source: CIVL/examples/focus/nestedFor.cvl@ e37044c

main test-branch
Last change on this file since e37044c 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: 476 bytes
RevLine 
[01c5b2ce]1#pragma CIVL ACSL
2$input int M;
3$assume(0 < M);
[a7752a9]4$input int N;
5$assume(0 < N);
[01c5b2ce]6$input float A[M][N], B[M][N];
7
8int main() {
9 double C[M][N];
[a7752a9]10 //@ loop assigns C[0..M-1][0..N-1];
11 //@ focus I | C[I][0..N-1];
[01c5b2ce]12 for (int i = 0; i < M; i++) {
[a7752a9]13 //@ loop assigns C[i][0..N-1];
14 //@ focus J | C[i][J];
[01c5b2ce]15 for (int j = 0; j < N; j++) {
16 C[i][j] = A[i][j]+B[i][j];
17 }
18 }
19
20 //@ focus I J;
21 $assert($forall(int i:0..M-1;int j:0..N-1) C[i][j] == A[i][j]+B[i][j]);
22}
Note: See TracBrowser for help on using the repository browser.