Repository navigation
Write a call argument as the caller wrote it in refinement errors - #486
Open
CatarinaGamboa wants to merge 3 commits into
Open
CatarinaGamboa wants to merge 3 commits into
CatarinaGamboa wants to merge 3 commits into
Conversation
When an argument is a call with a refinement, the error named its value after the callee's parameter (bound), which is not in the caller's code. It is now written as the call (items.size()) in Found, Expected and the counterexample. Only the display changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
Codex review, round 1
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
Codex review, round 1: response
|
Collaborator
Author
Codex review, round 2
|
Two calls written alike can return different values, so the counter tells them apart, as it does for every other instance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
Codex review, round 2: response
|
Collaborator
Author
Codex review, round 3
|
Collaborator
Author
Codex review, round 3: response
|
Collaborator
Author
Codex review, round 4Nothing relevant found. The new argument names affect diagnostic formatting only; no change to the verifier's proof obligations and no concrete correctness issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a call argument is itself a call, the refinement error named its value after the callee's parameter (
bound), which is not in the caller's code.Before / after
Issue reproducer (
return nextInt(size());):Real case, fixture
classes/found_binders_error(random.nextInt(items.size()), as in chaos-http-proxy'sfailures.size()):Nested calls read the same way:
nextInt(dec(size()))givessize()¹⁹ >= 0 && dec(size())²¹ == size()¹⁹ - 1 is not a subtype of dec(size())²¹ > 0.The argument keeps its instance counter, like every other instance, so two calls written alike (
between(next(), next())) stay apart.Unchanged
positive(t)→t), field reads (bound == this.f), other expressions (bound == this.f - 1) and literals keep the parameter name. Their refinement isbound == <expression>, so naming them after the expression would read as a tautology (this.f == this.f).bound == plain⁷) also keeps it, for the same reason.How
Same approach as
FieldDisplayNames(#459):MethodsFunctionsCheckerrecords the call's source text (Utils.getSourceCode, sosize()stayssize()instead of Spoon'sProbe.size()) for the argument instance in the newArgumentDisplayNames.VariableFormatter.formatwrites that text, andExpressionNameResolverkeeps it whole, as it does for fields (items.size()is not cut tosize()).CommandLineLauncherclears the record at the start of each run. The internal name and the SMT query are unchanged.Tests
TestFoundBinders: the reproducer's message, row and counterexample now useitems.size(); also the original step in the history.ExpressionNameResolverTest.writesACallArgumentAsTheCallerWroteIt.mvn test: 692 tests, 0 failures.Closes #481
🤖 Generated with Claude Code