Skip to content

Fix parser, powerset domains, and compound var aliases#11

Merged
danwt merged 3 commits intomainfrom
danwt/claude/symbolic-mc-phase2
Feb 12, 2026
Merged

Fix parser, powerset domains, and compound var aliases#11
danwt merged 3 commits intomainfrom
danwt/claude/symbolic-mc-phase2

Conversation

@danwt
Copy link
Owner

@danwt danwt commented Feb 12, 2026

Summary

Three bugs fixed, bringing symbolic checker from 49/59 to 54/59 specs (52 OK + 2 expected violations).

  • Parser postfix call ambiguity: parse_postfix_expr unconditionally matched LParen after any expression, causing 10\n(x = x+1) to parse as a function call 10(x=x+1). Now restricted to Ident and Field expressions only.
  • Powerset set-local domains: extract_range failed on set-local domains from powerset quantifiers. Added resolve_domain_values helper that handles both Range and set-local domains, used at 4 call sites (choose, len, membership, as_set).
  • Compound variable Let aliases: Inlined function args like AnyInSet(toCheck) where toCheck is a Dict produced Let { value: Var(idx), body: ... } which failed because bare compound Var can't encode to a single Z3 value. Added whole_var_locals tracking to alias these back to the original variable.

Remaining 5 failures (not bugs)

Spec Reason
raft, raft-vanlightly, narwhal_tusk Set[Seq[T]] not yet supported
test_func_powerset len() on non-range set expression
semaphores/dining_philosophers Pre-existing index panic in transition.rs

Test plan

  • All 125 workspace tests pass
  • cargo fmt --check clean
  • MultiPaxos-reconfig (powerset fix) passes symbolically
  • Parallel-commits (compound var fix) passes symbolically
  • stress_eval (parser fix) passes symbolically
  • Full 59-spec test suite: 52 OK, 2 expected VIOL, 5 known limitations

🤖 Generated with Claude Code

danwt and others added 3 commits February 12, 2026 17:58
…ccesses

parse_postfix_expr() unconditionally matched LParen after any
expression. When `require x < 10` preceded `(x = x + 1)` on the
next line, the parser treated `10(x = x + 1)` as a function call,
swallowing the entire effect into the guard.

Restrict the postfix LParen branch to fire only when the base
expression is an Ident or Field, which are the only callable forms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… and choose

Replace extract_range with resolve_domain_values at 4 call sites
(encode_choose, encode_len, encode_set_membership, encode_as_set) so
set-local domains from powerset quantifiers are handled alongside ranges.
Handle empty domain (empty subset in powerset) gracefully.

Fixes multipaxos-reconfig spec which uses len({a in Q if ...}) where Q
is a powerset-bound set variable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add whole_var_locals tracking for locals that alias an entire compound
variable (e.g., inlined function arg `AnyInSet(toCheck)` where toCheck
is a Dict). The Let handler detects bare Var/PrimedVar with compound
z3_var_count > 1, and encode_index resolves these aliases back to the
original variable's z3 vars.

Fixes parallel-commits spec which uses AnyInSet(toCheck) where toCheck
is Dict[Int, Bool].

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@danwt danwt merged commit c60c428 into main Feb 12, 2026
1 check failed
@danwt danwt deleted the danwt/claude/symbolic-mc-phase2 branch February 14, 2026 21:16
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