Skip to content

Use globally unique bound variable names in SMT encoding#681

Merged
shigoel merged 2 commits intomainfrom
shilpi/smt-global-bvars
Mar 27, 2026
Merged

Use globally unique bound variable names in SMT encoding#681
shigoel merged 2 commits intomainfrom
shilpi/smt-global-bvars

Conversation

@shigoel
Copy link
Copy Markdown
Contributor

@shigoel shigoel commented Mar 27, 2026

Summary

  • Always generate $__bv{N} names for quantifier-bound variables instead of reusing user-provided names
  • This guarantees globally unique bound variable names across all quantifiers.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

🤖 Generated with Claude Code

shigoel and others added 2 commits March 26, 2026 20:58
Always generate $__bv{N} names for quantifier-bound variables instead of
reusing user-provided names. This guarantees globally unique bound
variable names across all quantifiers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shigoel shigoel marked this pull request as ready for review March 27, 2026 02:14
@shigoel shigoel requested a review from a team March 27, 2026 02:14
@shigoel shigoel enabled auto-merge March 27, 2026 02:16
@shigoel
Copy link
Copy Markdown
Contributor Author

shigoel commented Mar 27, 2026

CC: @aqjune-aws This is along the lines of #632 but stricter.

@shigoel shigoel added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit bdee518 Mar 27, 2026
15 checks passed
@shigoel shigoel deleted the shilpi/smt-global-bvars branch March 27, 2026 03:41
MikaelMayer added a commit that referenced this pull request Mar 27, 2026
… flag (#683)

Default behavior now uses human-readable names (e.g. 'n', 'x') for
quantifier-bound variables in SMT output, with disambiguation when
names clash with other bound variables or free variables.

The --unique-bound-names flag enables the PR #681 behavior of always
using globally unique $__bv{N} names for bound variables.

The existing isUsed check already ensures generated bound variable
names do not conflict with free variable names in the context.
github-merge-queue bot pushed a commit that referenced this pull request Mar 27, 2026
PR #681 replaced human-readable bound variable names (e.g. `n`, `m`,
`x`) with globally unique `$__bv{N}` identifiers in SMT output. While
this guarantees uniqueness, most SMT solvers don't require it and the
output becomes harder to read.

This PR restores human-readable names as the default behavior, with
disambiguation (e.g. `x@1`) when names clash with other bound variables
or free variables. The `$__bv{N}` naming is still available via the
`--unique-bound-names` CLI flag for solvers that need it.

The existing clash detection already ensures generated bound variable
names never conflict with free variable names passed through in the
context.

Existing tests pass. No new tests needed since the test expectations
were restored to their pre-#681 values.

Fixes #683
olivier-aws pushed a commit that referenced this pull request Mar 30, 2026
## Summary
- Always generate `$__bv{N}` names for quantifier-bound variables
instead of reusing user-provided names
- This guarantees globally unique bound variable names across all
quantifiers.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
olivier-aws pushed a commit that referenced this pull request Mar 30, 2026
PR #681 replaced human-readable bound variable names (e.g. `n`, `m`,
`x`) with globally unique `$__bv{N}` identifiers in SMT output. While
this guarantees uniqueness, most SMT solvers don't require it and the
output becomes harder to read.

This PR restores human-readable names as the default behavior, with
disambiguation (e.g. `x@1`) when names clash with other bound variables
or free variables. The `$__bv{N}` naming is still available via the
`--unique-bound-names` CLI flag for solvers that need it.

The existing clash detection already ensures generated bound variable
names never conflict with free variable names passed through in the
context.

Existing tests pass. No new tests needed since the test expectations
were restored to their pre-#681 values.

Fixes #683
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants