File tree 2 files changed +40
-0
lines changed
regression/contracts-dfcc/quantifiers-loop-fail
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+ #include <stdbool.h>
3
+
4
+ #define N 16
5
+
6
+ void main ()
7
+ {
8
+ int a [N ];
9
+ a [10 ] = 0 ;
10
+ bool flag = true;
11
+ for (int j = 0 ; j < N ; ++ j )
12
+ __CPROVER_loop_invariant (j <= N )
13
+ {
14
+ for (int i = 0 ; i < N ; ++ i )
15
+ // clang-format off
16
+ __CPROVER_assigns (i , __CPROVER_object_whole (a ))
17
+ __CPROVER_loop_invariant ((0 <= i ) && (i <= N ) && __CPROVER_forall {
18
+ int k ;
19
+ (0 <= k && k <= N ) == > (k < i == > a [k ] == 1 )
20
+ })
21
+ // clang-format on
22
+ {
23
+ a [i ] = 1 ;
24
+ }
25
+ }
26
+ assert (a [10 ] == 1 );
27
+ }
Original file line number Diff line number Diff line change
1
+ CORE dfcc-only
2
+ main.c
3
+ --dfcc main --apply-loop-contracts _ --smt2
4
+ ^EXIT=6$
5
+ ^SIGNAL=0$
6
+ ^SMT2 solver returned error message:$
7
+ ^.*\"line \d+ column \d+: unknown constant .*$
8
+ ^VERIFICATION ERROR$
9
+ --
10
+ ^warning: ignoring
11
+ --
12
+ This test case checks the handling of quantifiers in a nested loop's
13
+ loop contracts.
You can’t perform that action at this time.
0 commit comments