Skip to content

fix: use macro scopes for generated binders and preserve counterexample reconstruction - #199

Draft
dranov wants to merge 1 commit into
codex/fix-symbolic-counterexample-paramsfrom
codex/veil-hygienic-binders
Draft

dranov wants to merge 1 commit into
codex/fix-symbolic-counterexample-paramsfrom
codex/veil-hygienic-binders

Conversation

@dranov

@dranov dranov commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #197. The diff starts at 4ad11bcc, which adds reconstruction for module parameters.

Why this changes both elaboration and reconstruction

Veil introduces binders while expanding actions, assertions, temporal formulas, and solver queries. A generated binder can capture a user field or parameter when they share a spelling. Lean macro scopes distinguish those binders during elaboration. Proof tactics such as expose_names can subsequently remove those scopes, so the counterexample decoder also needs a way to identify which binder produced a solver assignment.

Changes

  • Give generated binders scoped identities. Keep declared field names visible in DSL terms and publish source-facing named arguments after elaboration. A user parameter named ρ can be supplied by name. Primed transition syntax keeps its existing meaning.
  • Record each model binder’s role in the elaborated verification condition or when the verifier introduces fields. The induction and trace decoders use those roles and projection paths to reconstruct states, theory fields, and action labels. Rebuild action arguments in constructor order so later types can depend on earlier values.
  • Scope the quantified variables used by #updr. A module may now declare a relation named x0. The synthesizer chooses a distinct spelling when printing an invariant for the user to paste back into the module.

Verification

lake --no-cache build VeilTest Examples passed locally (1,630 jobs).

The regression tests check reconstructed values directly. Both induction modes and a symbolic trace recover step 3 2 when the second argument’s type depends on the first. The induction counterexamples also retain 7 for a quantified variable sharing the first argument’s name. A separate test reconstructs an SMT proof with two locals spelled x and checks its axioms.

@dranov
dranov added this pull request to stack #198 November 21, 2026 07:49
@dranov dranov changed the title Use macro scopes for generated binders and preserve counterexample reconstruction fix: use macro scopes for generated binders and preserve counterexample reconstruction Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant