Skip to content

Keep spec quantifier binders from capturing clause variables - #295

Merged
coord-e merged 2 commits into
mainfrom
claude/gifted-bohr-dv8mt4
Sep 28, 2026
Merged

coord-e merged 2 commits into
mainfrom
claude/gifted-bohr-dv8mt4

Conversation

@coord-e

@coord-e coord-e commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Fixes #294.

forall/exists binders in annotations were printed to SMT-LIB under their Rust names. Those names share a namespace with the generated clause variables v0, v1, …, so a binder named, say, v1 captured the clause variable v1. In the reproducer from #294 this turns the callee's precondition into false, and a panicking program verifies as safe.

This PR prints quantified variables with a q$ prefix, in both the binder list and the occurrences (chc/smtlib2.rs). Neither Rust identifiers nor any generated symbol contain $, and z3 and PCSat both accept it.

The #294 reproducer is rejected with Unsat after this change. The existing cargo test suite passes locally with z3 5.0.0 and the pinned PCSat wrapper.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AK15mUhCmYuTaGGygSSA85

A `forall`/`exists` binder in an annotation was printed to SMT-LIB under
its Rust name, which shares a namespace with the generated clause
variables `v0`, `v1`, .... A binder named e.g. `v1` therefore captured
the clause variable `v1`, changing the meaning of the formula, and could
make a precondition collapse to `false` so that a panicking body
verified. Print quantified variables with a `q$` prefix, which neither
Rust identifiers nor generated symbols contain.

Fixes #294

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AK15mUhCmYuTaGGygSSA85
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T22:47:17.418690Z 50dd202 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Labels

None yet

Projects

None yet

2 participants