source: CIVL/examples/focus/sv-benchmarks-main-c-array-industry-pattern/c/array-industry-pattern/array_mul_init.c@ a7752a9

main test-branch
Last change on this file since a7752a9 was c2b37db, checked in by Alex Wilton <awilton@…>, 8 months ago

Merged focus branch into trunk.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5988 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 741 bytes
Line 
1/* Verifiable with -memeq but fails without. TODO: Figure out what the discrepency is.
2 */
3#include <stdlib.h>
4#include <assert.h>
5
6#pragma CIVL ACSL
7
8$input int N;
9$assume(0 < N);
10short __VERIFIER_nondet_short() {
11 short x;
12 $havoc(&x);
13 return x;
14}
15int main()
16{
17 int a[N];
18 int b[N];
19 int k;
20 int i;
21
22 //@ focus I;
23 for (i = 0; i<N ; i++)
24 {
25 a[i] = i;
26 b[i] = i ;
27 }
28
29 //@ focus I;
30 for (i=0; i< N; i++)
31 {
32 if(__VERIFIER_nondet_short())
33 {
34 k = __VERIFIER_nondet_short();
35 a[i] = k;
36 b[i] = k * k ;
37 }
38 }
39
40 // Modified
41 //@ focus I;
42 $assert($forall(int i:0..N-1) a[i] == b[i] || b[i] == a[i] * a[i]);
43 // Original
44 /*
45 for (i=0; i< N; i++)
46 {
47 __VERIFIER_assert(a[i] == b[i] || b[i] == a[i] * a[i]);
48 }
49 */
50}
51
Note: See TracBrowser for help on using the repository browser.