fix: require the trace proof term to start on the line of the closing brace#16
Closed
hwbehrens wants to merge 4 commits into
Closed
fix: require the trace proof term to start on the line of the closing brace#16hwbehrens wants to merge 4 commits into
hwbehrens wants to merge 4 commits into
Conversation
…elaborate An assertion whose body fails to elaborate is reported as an error but is not registered in the module. #gen_spec then finalized the specification without it and #check_invariants reported all green, silently omitting the property the user wrote. elabAssertion now records the names of failed assertion declarations, and Module.ensureSpecIsFinalized refuses to finalize while any exist. Since all checking commands require a finalized spec, nothing downstream can run against a specification that silently lost an assertion. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… brace The trace command's optional proof term was a bare (term)?, so the parser greedily tried to consume whatever followed the trace command as its proof term. A subsequent set_option ... in <command> parses as a term up to 'in' and then fails, taking the whole trace command down with it: the trace never runs, its result message is lost, and error recovery then runs the inner command without the option applied. A term-shaped follow-up line was silently swallowed as the proof term. Guard the tail with withPosition/lineEq so the proof term must start on the same line as the closing brace. (A bare lineEq without withPosition is a no-op, since there is no saved position to compare against.) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fix: require the trace proof term to start on the line of the closing brace
fix: refuse to finalize spec when an assertion declaration failed to elaborate
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.
set_option ... infails to parse when the immediately preceding command is a trace command:sat trace [can_acquire] { acquire } set_option veil.violationIsError false in sat trace [handoff] { acquire release acquire }The trace command's grammar ends with a bare optional proof term:
set_option X in <term>is valid term syntax, so after}the parser consumes the following command as the trace's proof term, commits pastin, and fails onsat("expected spec" is the furthest-progress expectation, from the scopedspec : termrule). The consequences:trivialafter a trace reports an unrelated "Type mismatch").This PR requires the proof term to start on the same line as the closing brace:
The module above then parses and both traces run, with the option applied to the second.
VeilTest/Regression/TraceTermTail.leancovers the trace-then-scoped-trace pattern, and the fulllake build(Veil + VeilTest) passes.Two notes:
}no longer parse. I found no in-tree usage; nothing in VeilTest or Examples passes a proof term to a trace.lineEqwithout an enclosingwithPositionis a silent no-op, since there is no saved position to compare against.pickExpressioninVeil/Frontend/DSL/Action/Syntax.leanuseskw_pick (lineEq term)?without one, so its guard may be vacuous as well; happy to look at that separately if useful.