Repository navigation
Write a call argument as the caller wrote it in refinement errors - #486
Merged
Merged
Conversation
Collaborator
Author
Codex review, round 1
|
Collaborator
Author
Codex review, round 1: response
|
Collaborator
Author
Codex review, round 2
|
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. |
CatarinaGamboa
force-pushed
the
fix/481-argument-names
branch
from
November 5, 2026 11:59
abf341f to
ce6dc7b
Compare
Collaborator
Author
Codex review, round 5 (after rebasing on #483 and #484)
|
When an argument is a call, 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, keeping its instance counter. Only the display changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CatarinaGamboa
force-pushed
the
fix/481-argument-names
branch
from
November 5, 2026 12:03
ce6dc7b to
0136a4b
Compare
Collaborator
Author
Codex review, round 5: response
|
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:
nextInt(dec(size()))givessize()¹⁹ >= 0 && dec(size())²¹ == size()¹⁹ - 1 is not a subtype of dec(size())²¹ > 0. An unrefined call readsplain()⁸ == #plain_result⁷(result name from #483).The argument keeps its instance counter, like every other instance, so two calls written alike (
between(next(), next())) stay apart.Unchanged
Plain variables (
positive(t)), field reads (bound == this.f), other expressions (bound == this.f - 1) and literals keep the parameter name: their refinement isbound == <their code>, so writing them as code would read as a tautology (0 == 0, whichTestGeneratedNameswould catch).How
Same approach as
FieldDisplayNames(#459):MethodsFunctionsCheckerrecords the call's source text as written (Spoon's original source fragment, socount()is not printed asBasket.count()) for the argument instance in the newArgumentDisplayNames.VariableFormatter.formatwrites it with the counter, andExpressionNameResolverkeeps it whole, as it does for fields (items.size()is not cut tosize()). A call with no source position (built by Spoon, not read from a file) keeps the parameter name.CommandLineLauncherclears the record at the start of each run. The internal name and the SMT query are unchanged.Size
+68 / −7 over 7 files (main code +48 / −2; the new
ArgumentDisplayNamesis 35 of those lines, most of them Javadoc).Tests
TestFoundBinders: the reproducer's rows (also in the original step of the history) now useitems.size(); newcallArgumentIsWrittenAsTheCallerWroteIton a new fixture linerandom.nextInt(count()), checking the message and counterexample readcount(), notboundorBasket.count().main, and the rows fail without theExpressionNameResolverchange.mvn test: 693 tests, 0 failures.Closes #481
🤖 Generated with Claude Code