File tree 18 files changed +117
-45
lines changed
18 files changed +117
-45
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,14 @@ name=${*:$#}
11
11
name=${name% .c}
12
12
13
13
args=${*: 5: $# -5}
14
+ if [[ " $args " != * " _ " * ]]
15
+ then
16
+ args_inst=$args
17
+ args_cbmc=" "
18
+ else
19
+ args_inst=" ${args%% " _ " * } "
20
+ args_cbmc=" ${args#* " _ " } "
21
+ fi
14
22
15
23
if [[ " ${is_windows} " == " true" ]]; then
16
24
$goto_cc " ${name} .c"
20
28
fi
21
29
22
30
rm -f " ${name} -mod.gb"
23
- $goto_instrument ${args } " ${name} .gb" " ${name} -mod.gb"
31
+ $goto_instrument ${args_inst } " ${name} .gb" " ${name} -mod.gb"
24
32
if [ ! -e " ${name} -mod.gb" ] ; then
25
33
cp " $name .gb" " ${name} -mod.gb"
26
- elif echo $args | grep -q -- " --dump-c" ; then
34
+ elif echo $args_inst | grep -q -- " --dump-c" ; then
27
35
mv " ${name} -mod.gb" " ${name} -mod.c"
28
36
29
37
if [[ " ${is_windows} " == " true" ]]; then
@@ -36,4 +44,4 @@ elif echo $args | grep -q -- "--dump-c" ; then
36
44
rm " ${name} -mod.c"
37
45
fi
38
46
$goto_instrument --show-goto-functions " ${name} -mod.gb"
39
- $cbmc " ${name} -mod.gb"
47
+ $cbmc " ${name} -mod.gb" ${args_cbmc}
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the postconditions.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | assumed | asserted
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the preconditions.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | asserted | assumed
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the postconditions of both f1 and f2.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | assumed | asserted
13
+ f2 | assumed | asserted
10
14
11
15
Known bug:
12
16
Enforce flag not handled correctly for function calls within functions.
13
- This bug is fixed in PR #5538.
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the preconditions of f2 (called from f1) and of the postcondition of f1.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | assumed | asserted
13
+ f2 | asserted | assumed
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the preconditions of f1 (called from main).
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | asserted | assumed
13
+ f2 | n/a | n/a
14
+
15
+ Note: the call to f2 does not occur because the call to f1 is replaced by its contracts.
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the postconditions of both f1 and f2.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | assumed | asserted
13
+ f2 | assumed | asserted
10
14
11
15
Known bug:
12
16
Enforce flag not handled correctly for function calls within functions.
13
- This bug is fixed in PR #5538.
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the preconditions of f2 (called from f1) and of the postcondition of f1.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | assumed | asserted
13
+ f2 | asserted | assumed
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the preconditions of f1 (called from main).
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | asserted | assumed
13
+ f2 | n/a | n/a
14
+
15
+ Note: the call to f2 does not occur because the call to f1 is replaced by its contracts.
Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
main.c
3
- --enforce-all-contracts
3
+ --enforce-all-contracts _ --unwind 20 --unwinding-assertions
4
4
^EXIT=10$
5
5
^SIGNAL=0$
6
6
^VERIFICATION FAILED$
7
7
--
8
8
--
9
- This confirms the accuracy of the postconditions of both f1 and f2.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | assumed | asserted
13
+ f2 | assumed | asserted
10
14
11
15
Test should fail:
12
16
The postcondition of f2 is incorrect, considering the recursion particularity.
13
17
14
18
Recursion:
15
19
The base case for the recursive call to f2 provides different behavior than the common case (given the pre-conditions).
16
-
17
- Known bug 2:
18
- This test requires the "--unwind 20 --unwinding-assertions" flag for the cbmc call in "chain.sh", which is currently not handled.
Original file line number Diff line number Diff line change 1
1
KNOWNBUG
2
2
main.c
3
- --enforce-all-contracts
3
+ --enforce-all-contracts _ --unwind 20 --unwinding-assertions
4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the postconditions of both f1 and f2.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | assumed | asserted
13
+ f2 | assumed | asserted
10
14
11
15
Recursion:
12
16
The base case for the recursive call to f2 provides the same behavior as the common case (given the pre-conditions).
13
17
14
- Known bug 1 :
18
+ Known bug:
15
19
Enforce flag not handled correctly for function calls within functions.
16
- This bug is fixed in PR #5538.
17
-
18
- Known bug 2:
19
- This test requires the "--unwind 20 --unwinding-assertions" flag for the cbmc call in "chain.sh", which is currently not handled.
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the preconditions of f2 (called from f1) and of the postcondition of f1.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | assumed | asserted
13
+ f2 | asserted | assumed
10
14
11
15
Recursion:
12
16
The base case for the recursive call to f2 provides the same behavior as the common case (given the pre-conditions).
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the preconditions of f1 (called from main).
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | asserted | assumed
13
+ f2 | n/a | n/a
14
+
15
+ Note: the call to f2 does not occur because the call to f1 is replaced by its contracts.
10
16
11
17
Recursion:
12
18
The base case for the recursive call to f2 provides the same behavior as the common case (given the pre-conditions).
Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
main.c
3
- --enforce-all-contracts
3
+ --enforce-all-contracts _ --unwind 20 --unwinding-assertions
4
4
^EXIT=10$
5
5
^SIGNAL=0$
6
6
^VERIFICATION FAILED$
7
7
--
8
8
--
9
- This confirms the accuracy of the postconditions of f1, f2_out and f2_in.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | assumed | asserted
13
+ f2_out | assumed | asserted
14
+ f2_in | assumed | asserted
10
15
11
16
Test should fail:
12
17
The postcondition of f2 is incorrect, considering the recursion particularity.
13
18
14
19
Recursion:
15
20
The base case for the recursive call to f2 provides different behavior than the general case (given the pre-conditions).
16
-
17
- Known bug:
18
- This test requires the "--unwind 20 --unwinding-assertions" flag for the cbmc call in "chain.sh", which is currently not handled.
Original file line number Diff line number Diff line change 1
1
KNOWNBUG
2
2
main.c
3
- --enforce-all-contracts
3
+ --enforce-all-contracts _ --unwind 20 --unwinding-assertions
4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the postconditions of f1, f2_out and f2_in.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | assumed | asserted
13
+ f2_out | assumed | asserted
14
+ f2_in | assumed | asserted
10
15
11
16
Recursion:
12
17
The base case for the recursive call to f2 provides the same behavior as the common case (given the pre-conditions).
13
18
14
- Known bug 1 :
19
+ Known bug:
15
20
Enforce flag not handled correctly for function calls within functions.
16
- This bug is fixed in PR #5538.
17
-
18
- Known bug 2:
19
- This test requires the "--unwind 20 --unwinding-assertions" flag for the cbmc call in "chain.sh", which is currently not handled.
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the preconditions of f2_out (called from f1) and of the postconditions of f1.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | assumed | asserted
13
+ f2_out | asserted | assumed
14
+ f2_in | n/a | n/a
15
+
16
+ Note: the calls to f2_in does not occur because the call to f2_out is replaced by its contracts.
10
17
11
18
Recursion:
12
19
The base case for the recursive call to f2 provides the same behavior as the common case (given the pre-conditions).
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the preconditions of f2_in (called from f2_out) and of the postconditions of f1 and of f2_out.
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | assumed | asserted
13
+ f2_out | assumed | asserted
14
+ f2_in | asserted | assumed
10
15
11
16
Recursion
12
17
(1) This test checks the mutualy recursive f2_out and f2-in functions by enforcing f2_out and replacing the internal f2_in call with its contract.
@@ -15,4 +20,3 @@ Recursion
15
20
16
21
Known bug:
17
22
Enforce flag not handled correctly for function calls within functions.
18
- This bug is fixed in PR #5538.
Original file line number Diff line number Diff line change 6
6
^VERIFICATION SUCCESSFUL$
7
7
--
8
8
--
9
- This confirms the accuracy of the preconditions of f1 (called from main).
9
+ Verification:
10
+ function | pre-cond | post-cond
11
+ ---------|----------|----------
12
+ f1 | asserted | assumed
13
+ f2_out | n/a | n/a
14
+ f2_in | n/a | n/a
15
+
16
+ Note: the calls to f2_out and to f2_in do not occur because the call to f1 is replaced by its contracts.
10
17
11
18
Recursion:
12
19
The base case for the recursive call to f2 provides the same behavior as the common case (given the pre-conditions).
You can’t perform that action at this time.
0 commit comments