File tree Expand file tree Collapse file tree 4 files changed +54
-0
lines changed
regression/cbmc-primitives/exists_assume_6231 Expand file tree Collapse file tree 4 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <stdlib.h>
2
+
3
+ // clang-format off
4
+ int main (int argc , char * * argv )
5
+ {
6
+ int * i = malloc (sizeof (int ));
7
+ * i = 1 ;
8
+
9
+ // The exists inside the assume will evaluate to true,
10
+ // and be flipped by the negation in front of it, resulting
11
+ // to assume(false), which will allow the assertion to evaluate
12
+ // to true.
13
+ __CPROVER_assume (
14
+ !__CPROVER_exists {int z ; (z > 1 && z < 10 ) && z > * i }
15
+ );
16
+ __CPROVER_assert (0 , "this assertion should be satified" );
17
+ }
18
+ // clang-format on
Original file line number Diff line number Diff line change
1
+ CORE
2
+ test.c
3
+ --pointer-check
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ \[main\.assertion\.1\] line \d+ this assertion should be satified: SUCCESS
7
+ ^VERIFICATION SUCCESSFUL$
8
+ --
9
+ ^warning: ignoring forall
10
+ --
Original file line number Diff line number Diff line change
1
+ #include <stdlib.h>
2
+
3
+ // clang-format off
4
+ int main (int argc , char * * argv )
5
+ {
6
+ int * i = malloc (sizeof (int ));
7
+ * i = 1 ;
8
+
9
+ // The exists inside the assume will evaluate to true,
10
+ // and as such, the assertion below will fail as expected.
11
+ __CPROVER_assume (
12
+ __CPROVER_exists {int z ; (z > 1 && z < 10 ) && z > * i }
13
+ );
14
+ __CPROVER_assert (0 , "this should come out as failure" );
15
+ }
16
+ // clang-format on
Original file line number Diff line number Diff line change
1
+ CORE
2
+ test2.c
3
+ --pointer-check
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ \[main\.assertion\.1\] line \d+ this should come out as failure: FAILURE
7
+ ^VERIFICATION FAILED$
8
+ --
9
+ ^warning: ignoring forall
10
+ --
You can’t perform that action at this time.
0 commit comments