-
Notifications
You must be signed in to change notification settings - Fork 277
Introduce value-set supported simplifier for goto-symex #8642
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8642 +/- ##
========================================
Coverage 80.36% 80.37%
========================================
Files 1686 1688 +2
Lines 206981 207064 +83
Branches 73 73
========================================
+ Hits 166340 166421 +81
- Misses 40641 40643 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b1e951c
to
fc80921
Compare
ac731d4
to
77d0e0e
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 don't have any meaningful comment on the simplification at the symbolic execution level and all the changes LGTM. It's mostly creating simplify_expr_with_value_set
with additional clean ups and maintaining the behaviour.
// all pointed-to objects on the left-hand side are different from any of | ||
// the pointed-to objects on the right-hand side | ||
return expr.id() == ID_equal ? changed(static_cast<exprt>(false_exprt{})) | ||
: changed(static_cast<exprt>(true_exprt{})); |
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.
If pointed-to objects are the same for LHS and RHS but for each object we have statically different symbolic offsets then we could conclude that the comparison is still always false ?
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 meant to say this still seems to rely only on object information, not really using offset info to the fullest ? but this might already be done somewhere else.
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.
Note this is simplify_inequality_pointer_object
, which really is for POINTER_OBJECT(x) == POINTER_OBJECT(y)
comparisons. There is try_evaluate_pointer_comparison
where the above suggestions, however, might apply.
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.
The simplifier class could be improved with some more doc explaining how knowledge of the symbolic offsets for pointers are used to simplify pointer comparisons
Move `try_evaluate_pointer_comparison` to a simplifier that can eventually support more cases than just equalities in GOTO conditions. The initial change does not alter behaviour (except that previously `try_evaluate_pointer_comparison` was even used when simplification was disabled). A side-effect is that we can also clean up renamedt.
value-set based simplifications may be helpful well outside just GOTO conditions.
When all candidates in the value set have the same offset we can replace a pointer_offset expression by the offset value found in the value set.
The value set can help us infer that, e.g., a particular pointer cannot be among the ones assigned to __CPROVER_dead_object, whereby we can simplify R_OK/W_OK expressions.
77d0e0e
to
803954a
Compare
This release adds aarch64 va_list support (via diffblue#8572), which makes all tests pass on aarch64 Linux. We reworked expression simplification during symbolic execution (via diffblue#8642, diffblue#8647, diffblue#8627) to produce smaller and quicker-to-solve formulae for scenarios seen by our users.
This release adds aarch64 va_list support (via diffblue#8572), which makes all tests pass on aarch64 Linux. We reworked expression simplification during symbolic execution (via diffblue#8642, diffblue#8647, diffblue#8627) to produce smaller and quicker-to-solve formulae for scenarios seen by our users.
This release adds aarch64 va_list support (via diffblue#8572), which makes all tests pass on aarch64 Linux. We reworked expression simplification during symbolic execution (via diffblue#8642, diffblue#8647, diffblue#8627) to produce smaller and quicker-to-solve formulae for scenarios seen by our users.
Move
try_evaluate_pointer_comparison
to a simplifier that can eventually support more cases than just equalities in GOTO conditions. The initial change does not alter behaviour (except that previouslytry_evaluate_pointer_comparison
was even used when simplification was disabled).A side-effect is that we can also clean up renamedt.