source:
CIVL/examples/focus/development/prevLoopDependency.cvl
| Last change on this file was 6d5b8a3, checked in by , 8 months ago | |
|---|---|
|
|
| File size: 380 bytes | |
| Rev | Line | |
|---|---|---|
| [01c5b2ce] | 1 | #include<assert.h> |
| 2 | ||
| 3 | #pragma CIVL ACSL | |
| 4 | $input int N; | |
| 5 | $assume(0 < N); | |
| 6 | int a[N]; | |
| 7 | //int b[N]; | |
| 8 | ||
| 9 | int main() { | |
| 10 | ||
| 11 | //@ focus J; | |
| 12 | for (int i = 0; i < N; i++) { | |
| 13 | a[i] = i; | |
| 14 | } | |
| 15 | ||
| 16 | //@ focus J; | |
| 17 | $assume($forall(int i:0..N-1) a[i] == i); | |
| 18 | ||
| 19 | //@ focus I; | |
| 20 | for (int i = 0; i < N-1; i++) { | |
| 21 | a[i] = a[i+1] + a[i]; | |
| 22 | } | |
| 23 | ||
| 24 | //@ focus I; | |
| 25 | $assert($forall(int i:0..N-2) a[i] == 2*i + 1); | |
| 26 | } |
Note:
See TracBrowser
for help on using the repository browser.
