Commit 0e93b07
Remi Delmas
CONTRACTS: demonic encoding for is_fresh separation set, uniqueness of pointer requires/ensures
To reduce array theory usage, use a nondet demonic variable to track the set of fresh objects
and implement separation checks for is fresh (replaces a bool array indexed by object ID).
In the same way, track the set of locations storing pointers that are targets of pointer predicates,
and add assertions to prove that at most one pointer predicate is established per pointer.
This detects and avoids situations where a badly written requires or ensures clause would require
conflicting predicates to hold for a same pointer in a requires or ensures clause.
Adds a new type `__CPROVER_contracts_ptr_pred_ctx_t` and utility functions in `cprover_contracts.c`
to store these new pointer predicate context information used to support pointer predicate evaluation.
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 d4757e2 commit 0e93b07
File tree
40 files changed
+763
-168
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
+763
-168
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