goto-symex: handle plain-symbol quantifier bound variables in rewrite_quantifiers#9066
Open
tautschnig wants to merge 1 commit into
Open
goto-symex: handle plain-symbol quantifier bound variables in rewrite_quantifiers#9066tautschnig wants to merge 1 commit into
tautschnig wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes a crash/assert in rewrite_quantifiers when a quantifier’s bound variable is a plain (non-SSA) symbol by guarding SSA unwrapping with is_ssa_expr.
Changes:
- Introduce a local
qsymbinding for the quantifier symbol and checkis_ssa_exprbefore callingto_ssa_expr - Preserve existing behavior for SSA-bound variables by unwrapping to the original symbol when applicable
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
12cc4f4 to
7325d62
Compare
7325d62 to
906564a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #9066 +/- ##
========================================
Coverage 80.68% 80.69%
========================================
Files 1714 1715 +1
Lines 189593 189650 +57
Branches 73 73
========================================
+ Hits 152979 153033 +54
- Misses 36614 36617 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…_quantifiers rewrite_quantifiers unwraps the quantifier's bound variable with to_ssa_expr to recover the original symbol. The C front end always presents the bound variable as an SSA expression at this point, but other front ends (e.g. Strata) may present it as a plain symbol, for which to_ssa_expr fails with "wrong SSA expression ID". Guard the unwrapping with is_ssa_expr (written as an explicit if, so the guard cannot be dropped by accident) and use the symbol as-is when it is not an SSA expression. Adds a unit test that drives rewrite_quantifiers with a plain-symbol bound variable in both the assertion (forall) and assumption (exists) code paths. The test puts invariants into throwing mode (cbmc_invariants_should_throwt) so that, without the guard, the to_ssa_expr invariant surfaces as a clean REQUIRE_NOTHROW failure rather than aborting the whole unit binary. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
906564a to
32e86d2
Compare
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.
rewrite_quantifiers calls to_ssa_expr on a quantifier's bound variable, but the bound variable may be a plain (non-SSA) symbol. Guard the unwrap with is_ssa_expr.