source: CIVL/examples/focus/development/multiLoop.cvl@ 397ae5f

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

Cleaned up focus examples. Enhanced focus window performance. Fixed a pretty print bug

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

  • Property mode set to 100644
File size: 451 bytes
Line 
1#include<assert.h>
2
3#pragma CIVL ACSL
4$input int N;
5$assume(0 < N);
6int a[N];
7int b[N];
8
9int main() {
10
11 int x = 1;
12 //@ focus I;
13 /*@ loop invariant x == i+1;
14 @*/
15 for (int i = 0; i < N; i++) {
16 a[i] = i + x;
17 x = x+1;
18 }
19
20 //@ focus I;
21 for (int i = 0; i < N; i++) {
22 b[i] = i;
23 }
24
25 //@ focus I;
26 for (int i = 0; i < N; i++) {
27 a[i] = a[i] * b[i];
28 }
29
30 //@ focus I;
31 $assert($forall(int i:0..N-1) a[i] == (2*i+1)*i);
32}
Note: See TracBrowser for help on using the repository browser.