Show variable origins and clause context in SMT2 comments - #273
Merged
Merged
Conversation
coord-e
force-pushed
the
clause-var-mapping
branch
from
September 23, 2026 10:25
3c3478c to
b89c8ba
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Only a minor request for regression coverage remains; no approval-blocking issues were identified.
Review effort: Balanced
Findings: None
What changed in this PR
Adds source-level provenance to SMT-LIB2 comments while preserving solver-facing constraints and variable names.
Changes:
- Tracks environment, body, head, and existential origins.
- Prints structured origin comments before assertions.
- Fixes leading whitespace for unguarded atoms.
| File | Description |
|---|---|
src/rty/subtyping.rs |
Records function parameter origins. |
src/rty/clause_builder.rs |
Records refinement and existential mappings. |
src/refine/env.rs |
Captures binding and assumption origins. |
src/chc/unbox.rs |
Preserves origins during unboxing. |
src/chc/smtlib2.rs |
Renders structured clause-origin comments. |
src/chc/debug/origin.rs |
Defines provenance metadata and mappings. |
src/chc/debug.rs |
Exposes the origin module. |
src/chc/clause_builder.rs |
Propagates origins into generated clauses. |
src/chc.rs |
Adds origins and fixes atom formatting. |
src/analyze/crate_.rs |
Records entry-parameter mappings. |
src/analyze/basic_block.rs |
Records block parameter and assumption origins. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
coord-e
marked this pull request as ready for review
September 23, 2026 10:36
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
SMT2 variables such as
v0do not show which environment binding or refinement variable they represent. Preserve this information in dedicated clause-origin types and print it before eachassert, with the environment underΓ, assumptions as_: { p }, and groupedbodyentries followed byhead. Variable mappings appear directly beneath the corresponding entry, including existential variables, without changing SMT variable names.A separate commit fixes an extra leading space when pretty-printing atoms without guards.
Validation:
cargo test --lib(3 passed),cargo fmt --all -- --check, the passing and failingsimple_mutexamples with Z3, andannot_existswith PCSat. The layout change preserves the non-comment SMT tokens in thesimple_mutoutput.