-
Notifications
You must be signed in to change notification settings - Fork 273
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: optimize is_fresh separation checks, add ptr predicate uniqueness checks #8573
CONTRACTS: optimize is_fresh separation checks, add ptr predicate uniqueness checks #8573
Conversation
da879dc
to
0e93b07
Compare
0e93b07
to
e9b20d8
Compare
…queness checks - Replaces a bool array indexed by object ID by a nondet demonic variable to track the set of fresh objects and implement separation checks. - Ensures requires or ensures clause assume/assert at most one predicate per pointer by tracking locations where these pointers are stored and adding separation checks on them as well. This is necessary to catch occurences like `__CPROVER_is_fresh(p, size) && __CPROVER_is_fresh(p, size)` in assume contexts. - Adds a new type `__CPROVER_contracts_ptr_pred_ctx_t` in `cprover_contracts.c` to store all contextual information needed to evaluate all pointer predicates. - Propagate changes to `dfcc_libraryt` and `dfcc_wrapper_programt`. - Add new tests for pointer assumption uniqueness checks. - Fix failing tests that used is_fresh under negation in ensures. - Update dev doc
e9b20d8
to
ab4853d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8573 +/- ##
===========================================
- Coverage 78.92% 78.85% -0.07%
===========================================
Files 1732 1732
Lines 198953 199119 +166
Branches 18560 18560
===========================================
+ Hits 157021 157023 +2
- Misses 41932 42096 +164 ☔ View full report in Codecov by Sentry. |
…nter predicates in disjunctions.
@tautschnig I see some perf regressions on the AWS-commons library but the patch includes additional checks anyways. I'll iterate once more on this. |
Signed-off-by: Hanno Becker <[email protected]>
mlkem-native test here: pq-code-package/mlkem-native#688 |
Closing, will split the PR in two separate PRs |
track the set of fresh objects and implement separation checks.
per pointer by tracking locations where these pointers are stored and adding
separation checks on them as well. This is necessary to catch and reject occurences like
__CPROVER_is_fresh(p, size) && __CPROVER_is_fresh(p, size)
that would pass in assumecontexts by allocating twice but fail in assert contexts.
__CPROVER_contracts_ptr_pred_ctx_t
incprover_contracts.c
to store all contextual information needed to evaluate all pointer predicates.
dfcc_libraryt
anddfcc_wrapper_programt
.