-
Notifications
You must be signed in to change notification settings - Fork 269
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
CONTRACTS: ensure at most one predicate per pointer #8577
CONTRACTS: ensure at most one predicate per pointer #8577
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #8577 +/- ##
========================================
Coverage 78.85% 78.85%
========================================
Files 1732 1732
Lines 199119 199119
Branches 18560 18560
========================================
Hits 157023 157023
Misses 42096 42096 ☔ View full report in Codecov by Sentry. |
@tautschnig this one is also ready to merge |
// __CPROVER_assert( | ||
// write_set->linked_ptr_pred_ctx->ptr_pred != ptr1, | ||
// "__CPROVER_pointer_equals does not conflict with other pointer " | ||
// "predicate"); | ||
// write_set->linked_ptr_pred_ctx->ptr_pred = | ||
// __VERIFIER_nondet___CPROVER_bool() | ||
// ? ptr1 | ||
// : write_set->linked_ptr_pred_ctx->ptr_pred; |
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 to take away from this commented-out part?
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.
Thanks for catching this. I need to fix that and add more tests for predicates used in ensures clauses in contract replacement mode.
…nter predicates in disjunctions.
42af48e
to
7f7a03c
Compare
Ensures that at most one pointer predicate is positively asserted/assumed per pointer. Before, `is_fresh(p, n) && is_fresh(p, n)` would fail in assertion contexts as expected but pass in assumption contexts by allocating twice.
7f7a03c
to
bb3307a
Compare
@tautschnig test suite now check every combination of conflicting predicates in both requires and ensures clauses for both contract checking and replacement, we're good to go |
Please ignore the first commit, it is from #8576 and will disappear when rebasing.
Fixes a discrepancy between assert and assume behaviour for pointer predicates, by ensuring
that at most one predicate occurrence can be established at all times, in both assume and assert
contexts.
Before,
is_fresh(p, n) && is_fresh(p, n)
would fail in assert contexts but pass in assume contextsby allocating twice.