source: CIVL/examples/focus/development/nonTrivialIndex.cvl

main
Last change on this file 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: 599 bytes
Line 
1#include<assert.h>
2
3#pragma CIVL ACSL
4$input int N;
5$assume(0 < N);
6$input int X;
7$assume(0 <= X);
8int a[N];
9int b[N+X];
10
11int main() {
12 //@ focus A;
13 for (int i = 0; i < N; i++) {
14 a[i] = i+1;
15 }
16
17 //@ focus A;
18 for (int i = 0; i < N; i++) {
19 b[i+X] = i;
20 }
21
22 //@ focus B;
23 for (int i = 0; i <= X; i++) {
24 b[i] = i;
25 }
26
27 //@ focus B;
28 $assert($forall(int i:0..X) b[i] == i);
29
30 //@ focus A;
31 for (int i = 0; i < N; i++) {
32 a[i] = a[i] * b[i+X];
33 }
34
35 //@ focus A;
36 $assert($forall(int i:0..N-1)
37 (i == 0 => a[i] == X) &&
38 (i > 0 => a[i] == (i+1)*i));
39}
Note: See TracBrowser for help on using the repository browser.