-
Notifications
You must be signed in to change notification settings - Fork 274
SMT2 back-end: do not flatten flattened arrays #7144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMT2 back-end: do not flatten flattened arrays #7144
Conversation
|
88c669e
to
ed855b9
Compare
This PR now includes two (in some ways: unrelated) bugfixes. In order for the one test that is flipped from broken-smt-backend to works-with-Z3 both of these bugfixes are required. The second commit (which is about byte operator lowering) touches code that is most heavily exercised when using the SMT back-end, where all byte operators are rewritten via this code path. |
Codecov ReportBase: 78.00% // Head: 78.00% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #7144 +/- ##
========================================
Coverage 78.00% 78.00%
========================================
Files 1621 1621
Lines 187279 187264 -15
========================================
- Hits 146088 146080 -8
+ Misses 41191 41184 -7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
d396182
to
7997315
Compare
convert_expr may flatten an array anyway, in which case flatten_array would generate select statements over bitvectors instead of arrays (as flatten_array itself invokes convert_expr to supposedly construct the array expression). Also, make sure the same flattening logic applies to 1-element structs.
When updating an array/vector at a non-constant byte offset the update value may affect multiple array/vector elements. The last such element needs to be updated with however many bytes have not yet been used from the update value. With a non-constant byte offset the size of remaining bytes may be zero. Therefore, make the tail update use symbolic offsets rather than constants. When fixing this, it also became apparent that we must not use byte extracts of non-constant extraction size to build update elements. Instead, the update offset should be non-constant, and will actually need to be negative on such occasions.
7997315
to
e5d94c8
Compare
convert_expr may flatten an array anyway, in which case flatten_array would generate select statements over bitvectors instead of arrays (as flatten_array itself invokes convert_expr to supposedly construct the array expression).