Connect let-bound arrays to originals in array theory#8942
Open
tautschnig wants to merge 1 commit intodiffblue:developfrom
Open
Connect let-bound arrays to originals in array theory#8942tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig wants to merge 1 commit intodiffblue:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes missing propagation in the unbounded-array theory when arrays are introduced via let bindings, by explicitly connecting the fresh let-bound array symbol to the original array expression so array constraints (Ackermann + extensional equality) propagate correctly in smt2_solver.
Changes:
- In
boolbvt::convert_let, record and assert an array equality between fresh let-bound symbols and their bound values for unbounded array types. - Add a new
smt2_solverregression test descriptor for let-bound arrays.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/solvers/flattening/boolbv_let.cpp |
Records/asserts array equalities for unbounded array let-bindings to connect union-find classes in array theory. |
regression/smt2_solver/let-array/let-array.desc |
Adds a regression descriptor intended to check the corrected let/array-theory interaction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When a let expression binds a variable to an array value, the fresh symbol and the original array are disconnected in the array theory's union-find. This means Ackermann constraints and element-wise equality constraints don't propagate between them, causing spurious counterexamples in smt2_solver. Fix: in convert_let, for array-typed bindings with unbounded array type, call record_array_equality to create an element-wise equality between the fresh variable and the bound value, and assert it as true. This connects the two representations so the array theory generates proper constraints. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
771b119 to
7a23bee
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8942 +/- ##
===========================================
- Coverage 80.46% 80.46% -0.01%
===========================================
Files 1704 1704
Lines 188665 188675 +10
Branches 73 73
===========================================
+ Hits 151805 151812 +7
- Misses 36860 36863 +3 ☔ View full report in Codecov by Sentry. 🚀 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.
When a let expression binds a variable to an array value, the fresh symbol and the original array are disconnected in the array theory's union-find. This means Ackermann constraints and element-wise equality constraints don't propagate between them, causing spurious counterexamples in smt2_solver.
Fix: in convert_let, for array-typed bindings with unbounded array type, call record_array_equality to create an element-wise equality between the fresh variable and the bound value, and assert it as true. This connects the two representations so the array theory generates proper constraints.