Repository navigation
Read old(this) in a precondition as the state before the call - #422
Open
CatarinaGamboa wants to merge 1 commit into
Open
CatarinaGamboa wants to merge 1 commit into
CatarinaGamboa wants to merge 1 commit into
Conversation
The state machine builder passed preconditions such as "closed(this) && connected(old(this))" to the solver with old() still in them, so building the machine failed and errors on such classes got no hints, category or state context. Replace old(this) with the state before the call, as the verifier does when it checks the call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
The state machine builder sent preconditions that mention
old(this)to the solver without replacingold. One example is the expert DatagramSocket spec'sfrom = "closed(this) && connected(old(this))". The solver failed withGhost 'old' could not be found, and since the analysis is best effort, every state error on such a class lost its hints, its category and (since #421) itsStateErrorContext.The liquidjava-fsm test that checks the verifier's states against the diagram found this.
What
In
StateMachineBuilder.transitionsOf,old(this)in a precondition now means the state before the call, which is howAuxStateHandler.changeStatereads it (changeOldMentions(name, name)).Tests
ErrorStateHintOldInPreconditionwithTestStateHints#oldInAPreconditionIsTheStateBeforeTheCall. It fails without the fix and passes with it. On the fsm DatagramSocket client, the error now gets the path-dependent hint.mvn test: 494 tests pass.🤖 Generated with Claude Code