Commit ab4853d
Remi Delmas
CONTRACTS: optimize is_fresh separation checks, add ptr predicate uniqueness 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 doc1 parent 3d79560 commit ab4853d
File tree
40 files changed
+768
-185
lines changed- regression/contracts-dfcc
- test_aliasing_ensure
- test_pointer_predicate_enforce_requires_equals_equals_fail
- test_pointer_predicate_enforce_requires_equals_equals_pass
- test_pointer_predicate_enforce_requires_in_range_equals_fail
- test_pointer_predicate_enforce_requires_in_range_equals_pass
- test_pointer_predicate_enforce_requires_in_range_in_range_fail
- test_pointer_predicate_enforce_requires_in_range_in_range_pass
- test_pointer_predicate_enforce_requires_is_fresh_equals_fail
- test_pointer_predicate_enforce_requires_is_fresh_equals_pass
- test_pointer_predicate_enforce_requires_is_fresh_in_range_fail
- test_pointer_predicate_enforce_requires_is_fresh_in_range_pass
- test_pointer_predicate_enforce_requires_is_fresh_is_fresh_fail
- test_pointer_predicate_enforce_requires_is_fresh_is_fresh_pass
- test_pointer_predicate_enforce_reset_before_requires_equals_equals_pass
- test_pointer_predicate_replace_reset_before_requires_equals_equals_pass
- test_pointer_predicate_requires_in_range_in_range_fail
- test_scalar_memory_enforce
- src
- ansi-c/library
- goto-instrument/contracts
- doc/developer
- dynamic-frames
40 files changed
+768
-185
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
20 | 4 | | |
21 | 5 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
27 | 9 | | |
28 | 10 | | |
29 | 11 | | |
30 | 12 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 13 | + | |
34 | 14 | | |
35 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 7 | | |
12 | 8 | | |
13 | 9 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments