source:
CIVL/mods/dev.civl.com/examples/focus/nestedFor.cvl@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 386 bytes | |
| Rev | Line | |
|---|---|---|
| [01c5b2ce] | 1 | #include<assert.h> |
| 2 | ||
| 3 | #pragma CIVL ACSL | |
| 4 | $input int M; | |
| 5 | $assume(0 < M); | |
| 6 | $input int N = 1; | |
| 7 | $input float A[M][N], B[M][N]; | |
| 8 | ||
| 9 | int main() { | |
| 10 | double C[M][N]; | |
| 11 | //@ focus I; | |
| 12 | for (int i = 0; i < M; i++) { | |
| 13 | //@ focus J; | |
| 14 | for (int j = 0; j < N; j++) { | |
| 15 | C[i][j] = A[i][j]+B[i][j]; | |
| 16 | } | |
| 17 | } | |
| 18 | ||
| 19 | //@ focus I J; | |
| 20 | $assert($forall(int i:0..M-1;int j:0..N-1) C[i][j] == A[i][j]+B[i][j]); | |
| 21 | } |
Note:
See TracBrowser
for help on using the repository browser.
