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