Repository navigation
Show the verifier's states of a state error on the state machine - #160
Open
CatarinaGamboa wants to merge 1 commit into
Open
CatarinaGamboa wants to merge 1 commit into
CatarinaGamboa wants to merge 1 commit into
Conversation
Bumps the verifier to 0.0.36, liquidjava-fsm to 0.2.0 and Spoon to 11.5.0. fsm now only draws the diagram, picked by the error's receiver class, and the possible, accepted, valid and invalid states come from the verifier's StateErrorContext instead of fsm's reading of the predicates' text. A state of the diagram is marked only when every possible combination with it agrees, so the marks stay true for classes with several state sets. 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
Until now, the state machine view got the receiver's possible and accepted states from liquidjava-fsm, which re-read the error's
expectedandfoundpredicates as text. The verifier now computes those states with the SMT solver and reports them onStateRefinementError#getContext()(liquid-java/liquidjava#421). fsm 0.2.0 dropped its error context and only draws diagrams (liquid-java/liquidjava-fsm#12). This PR switches the view to the verifier's answer, so the diagram never contradicts the error next to it.What
Dependencies: liquidjava-verifier 0.0.36, liquidjava-fsm 0.2.0 and Spoon 11.5.0, the version the verifier now uses.
Server
StateRefinementErrorDTObuilds the diagram withStateMachineParser.parse(declaration file, context.receiverClass()), so a file that declares several classes shows the receiver's class.StateMachineDTOandStateErrorContextDTOkeep the shape the webview already reads (stateMachine.errorContext). The error context now hascalledMethod,receiver,possibleStates,acceptedStates,validStatesandinvalidStates.Client
getStateErrorFocususes the server's lists directly. The fallbacks todefiniteFoundStateandactualStatesare gone, and so areexpectedConditionandfoundCondition, which nothing displayed.Fixed: the
setHinttest, which broke when hints became a list (liquid-java/liquidjava#410).Output for the fsm study fixtures (DatagramSocket and tree node), serialized by the server:
{"calledMethod":"receive","receiver":"socket","possibleStates":["bound","closed"],"acceptedStates":["unbound","bound","connected"],"validStates":["bound"],"invalidStates":["closed"]} {"calledMethod":"getFirstChild","receiver":"root","possibleStates":["childrenAllowed"],"acceptedStates":["maybeHasChildren"],"validStates":[],"invalidStates":["childrenAllowed"]}These are the same marks the view showed before for these examples.
Follow-ups
@StateSet(Show one state machine diagram per @StateSet #115, Highlight state errors in the relevant @StateSet diagram #116, Return one machine per @StateSet liquidjava-fsm#8), e.g. ImageWriteParam.Tests
mvn test, 27 tests pass, including the newStateErrorContextDTOTest: one state set, several sets with a partly accepted state, and unknown accepted states.vitest, 71 tests pass, andtscis clean.🤖 Generated with Claude Code