SMT2: tolerate non-constant array indices when parsing array models#9063
Open
tautschnig wants to merge 1 commit into
Open
SMT2: tolerate non-constant array indices when parsing array models#9063tautschnig wants to merge 1 commit into
tautschnig wants to merge 1 commit into
Conversation
smt2_convt::walk_array_tree assumes every (store array index value) term in a solver-returned array model has a constant index, calling to_constant_expr on it unconditionally. Models for unbounded or non-integer-keyed arrays can contain a non-constant index, which trips the to_constant_expr precondition. Skip such store entries during model reconstruction instead of aborting. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates SMT2 array model parsing to avoid aborting when encountering store terms with non-constant indices, instead skipping those entries during model reconstruction.
Changes:
- Detect non-constant
storeindices duringwalk_array_treeand skip processing those stores - Prevent
to_constant_exprprecondition violations caused by solver-returned models containing symbolic indices
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+640
to
+643
| if(!index_expr.is_constant()) | ||
| // Non-constant index (e.g. an unbounded / non-integer-keyed heap array | ||
| // from Strata's `Map Ref _`): skip this store in model reconstruction. | ||
| return; |
Comment on lines
+640
to
+643
| if(!index_expr.is_constant()) | ||
| // Non-constant index (e.g. an unbounded / non-integer-keyed heap array | ||
| // from Strata's `Map Ref _`): skip this store in model reconstruction. | ||
| return; |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #9063 +/- ##
========================================
Coverage 80.68% 80.68%
========================================
Files 1714 1714
Lines 189501 189502 +1
Branches 73 73
========================================
+ Hits 152902 152905 +3
+ Misses 36599 36597 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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_convt::walk_array_tree assumes every (store array index value) term in a solver-returned array model has a constant index, calling to_constant_expr on it unconditionally. Models for unbounded or non-integer-keyed arrays can contain a non-constant index, which trips the to_constant_expr precondition. Skip such store entries during model reconstruction instead of aborting.