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.
Comment on lines
+263
to
+269
| // The bound variable may be a plain symbol (e.g. from front ends other than | ||
| // C, such as Strata) rather than an already-renamed SSA expression; only | ||
| // unwrap via to_ssa_expr when it really is one. | ||
| const symbol_exprt &qsym = quant_expr.symbol(); | ||
| symbol_exprt tmp0 = | ||
| to_symbol_expr(to_ssa_expr(quant_expr.symbol()).get_original_expr()); | ||
| is_ssa_expr(qsym) ? to_symbol_expr(to_ssa_expr(qsym).get_original_expr()) | ||
| : qsym; |
Comment on lines
+268
to
+269
| is_ssa_expr(qsym) ? to_symbol_expr(to_ssa_expr(qsym).get_original_expr()) | ||
| : qsym; |
Prevent field sensitivity and simplification from turning the bound variables of forall/exists into non-symbol expressions (which violates the invariant that quantifier bound variables are symbols): handle plain-symbol bound variables in rewrite_quantifiers, skip renaming the bound-variable operand in goto_symex_statet, and simplify only the body of a quantifier (operand 1), not its bound variables. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
12cc4f4 to
7325d62
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.