-
Notifications
You must be signed in to change notification settings - Fork 277
Add support for subtracting a constant value from a pointer in the conversion code of new SMT backend #7124
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
Add support for subtracting a constant value from a pointer in the conversion code of new SMT backend #7124
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #7124 +/- ##
=========================================
Coverage 77.87% 77.88%
=========================================
Files 1576 1576
Lines 181587 181765 +178
=========================================
+ Hits 141412 141567 +155
- Misses 40175 40198 +23
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
81cf965
to
65cc794
Compare
65cc794
to
f6cc0da
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.
Weren't we expecting this to fix regression/cbmc-primitives/r_w_ok_bug/test.desc
with the new decision procedure?
smt_term_a, | ||
smt_bit_vector_theoryt::multiply( | ||
smt_bit_vector_theoryt::negate(smt_term_two_32bit), | ||
smt_term_four_32bit)); |
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.
🚫 Missing REQUIRE(constructed_term == expected_term);
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.
Both this & the negate
below were copy-paste fails of mine while I was cleaning up/rebasing.
Fixed now - thanks for catching this.
const auto expected_term = smt_bit_vector_theoryt::subtract( | ||
smt_term_a, | ||
smt_bit_vector_theoryt::multiply( | ||
smt_bit_vector_theoryt::negate(smt_term_two_32bit), |
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.
What is this negate
doing here?
Yeah, it has fixed it in so far as not getting an invariant violation, but we still have some divergence from the test against the SAT backend mainly because we don't support the dynamic memory primitives yet (the assertions re This is why I don't want to enable it (the test fails). Do you think we can handle this situation better? |
f6cc0da
to
74acb22
Compare
74acb22
to
731ff1f
Compare
Previously we didn't support expressions of the form
a - 3
wherea
is a pointer,because we thought that it wouldn't be possible to get this code as input. Some regression tests however showed us that this assumption was incorrect, so now we needed to add support for this.