Repository navigation
Conversation
dranov
force-pushed
the
codex/fix-symbolic-counterexample-params
branch
from
November 21, 2026 05:23
834917f to
3436770
Compare
params in counterexamples
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.
Stacked on #192. Addresses the counterexample reconstruction bug reported in #120.
Observed problem
With
param f : Nat → Nat,#check_invariantsreports thatstepviolatesdef_ybut fails to reconstruct the counterexample. The violation is real. Withf := id, initialization gives(x, y) = (0, 0). The second assignment reads the incrementedx, so one step gives(1, 2)and violatesy = f x. One-step trace and Lean proofWider problem
Ordinary module value parameters can prevent Veil from turning a satisfying solver model into a counterexample or symbolic trace. A scalar
param bound : Natsuffices. Withx := 0at initialization andx := bound + 1in a step,#check_invariantscan refutex ≤ boundbut loses the counterexample, andsat tracefinds the violating execution but fails to render it.Root cause
Veil supplied only the module’s sort arguments when rebuilding the generated Lean terms.
Instantiation,FieldAbstractType,Theory, andLabelalso expect value parameters in declaration order. This can leave a constructor partially applied or pass a state-field label where a value parameter belongs. Looking up the missing values by source name alone is ambiguous when a quantified variable shadows a module parameter.Fix
Other changes
param.<name>to distinguish them from same-named locals.Fintrace, and a class-valued parameter whose sort may be omitted.The cvc5 parser error reported for the larger model still needs a separate reproducer.
Validation
lake build VeilTest Examplespassed locally (1,621 jobs).