-
Notifications
You must be signed in to change notification settings - Fork 282
Support byte extract and update for new SMT backend #7285
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
Support byte extract and update for new SMT backend #7285
Conversation
10eac99
to
6fdc582
Compare
Codecov ReportBase: 78.24% // Head: 78.28% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #7285 +/- ##
===========================================
+ Coverage 78.24% 78.28% +0.03%
===========================================
Files 1642 1642
Lines 189752 189976 +224
===========================================
+ Hits 148479 148714 +235
+ Misses 41273 41262 -11
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. |
6fdc582
to
48a85bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This a partial review. I haven't reviewed the tests yet.
src/solvers/smt2_incremental/smt2_incremental_decision_procedure.cpp
Outdated
Show resolved
Hide resolved
5e3004e
to
8f62a0e
Compare
8f62a0e
to
8b3820f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should get the following sorted before merging -
- Fixing the one unit test which is squashed into the wrong commit.
- Adding commit message bodies. The commits now (mostly) say what they do, which is great. But some of the pre-requisite fixes are still missing the context as to why they are needed. I am happy to go through adding these with you.
smt_bit_vector_theoryt::make_or( | ||
smt_bit_vector_theoryt::make_and( | ||
original_int_term, | ||
smt_bit_vector_constant_termt{18446744073709486335UL, 64}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ I think this mask would be easier to interpret as a hex literal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
smt_bit_vector_theoryt::make_and( | ||
original_int_term, | ||
smt_bit_vector_constant_termt{18446744073709486335UL, 64}), | ||
smt_bit_vector_constant_termt{2816UL, 64})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ I think the literal 2816UL
may be easier to read as 11UL << 8
. This would make it clearer that it corresponds to the 11 in the input expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
} | ||
} | ||
|
||
TEST_CASE( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks like a good test to me.
8b3820f
to
9ec53d1
Compare
As `with_exprt` can be used as a multy-ary operatior (with more than 3 arguments) we need to introduce an index smt_identifier_termt for each index used by the expression.
Lowering of the byte extraction and byte update expressions can yield non-integer bitvector typed operands. Because we do not require a numeric interpretation of them we can relax the requirement of integer-typed operands for bitwise operators.
9ec53d1
to
6ad772c
Compare
When the input program includes non-aligned memory accesses the decision procedure is passed expressions including byte_extract and byte_update operators. To support such programs in the decision procedure we need to lower such operators to operators we support.
6ad772c
to
424bed5
Compare
This PR adds support for byte_extract_exprt and byte_update_exprt for the new incremental SMT backend.