Repository navigation
Treat an argument with no known refinement as unconstrained - #496
Open
CatarinaGamboa wants to merge 2 commits into
Open
CatarinaGamboa wants to merge 2 commits into
CatarinaGamboa wants to merge 2 commits into
Conversation
An argument whose refinement is just `true` (e.g. the result of a method without refinements) was turned into `arg == true`. For an int argument that crashed with "Sorts Int and Bool are incompatible"; for a boolean one it wrongly assumed the value was true. Fixes #451 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Codex review, round 1
Fixed in 54a6de7: the equality is now skipped only when the argument's refinement is exactly the literal |
Collaborator
Author
|
Codex review, round 2 No findings: "The change prevents an unknown argument refinement from being treated as the literal value |
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.
Fixes #451
Cause. When a call argument carries no information (its refinement is just
true, as for the result of a method without refinements),createVariableRepresentingArgumentstill wrapped it asarg == true. For anintargument Z3 rejects that with "Sorts Int and Bool are incompatible". For abooleanargument it silently assumed the value wastrue, sotakeTrue(s.isEmpty())against@Refinement("_ == true")was accepted. Now such an argument is left unconstrained, like any unknown value.Study exercise A2_04, fixed with
socket.connect(addr, Math.max(timeout, 0))(no spec forMath.max):Before:
After:
The other A2_04 fixes (guard + return, guard + throw, ternary) still verify. With a
Math.maxspec (_ >= a && _ >= b && (_ == a || _ == b)) theMath.maxfix verifies too. The issue'snew Socket(addr, server.getLocalPort())now reportsexpected server.getLocalPort() >= 0 && server.getLocalPort() <= 65535 but could not prove it.Tests. Two cases added to
ErrorUnknownMethodInOperation: an unknownintresult and an unknownbooleanresult passed as arguments. Both fail on main (the first crashes, the second is accepted).🤖 Generated with Claude Code