diff options
author | mikebarnett <unknown> | 2009-07-15 21:03:41 +0000 |
---|---|---|
committer | mikebarnett <unknown> | 2009-07-15 21:03:41 +0000 |
commit | ce1c2de044c91624370411e23acab13b0381949b (patch) | |
tree | 592539996fe08050ead5ee210c973801611dde40 /Test/test21/ParallelAssignment.bpl |
Initial set of files.
Diffstat (limited to 'Test/test21/ParallelAssignment.bpl')
-rw-r--r-- | Test/test21/ParallelAssignment.bpl | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Test/test21/ParallelAssignment.bpl b/Test/test21/ParallelAssignment.bpl new file mode 100644 index 00000000..05791b8e --- /dev/null +++ b/Test/test21/ParallelAssignment.bpl @@ -0,0 +1,56 @@ +// Examples from the Boogie2 language report
+
+type C, D;
+
+var x : int;
+var y : int;
+var z : int;
+var a : [int]int;
+var b : [int][C, D]int;
+
+procedure P(i:int, j:int, m:C, n:D) returns () modifies x, y, a, b; {
+ var x1 : int;
+ var y1 : int;
+
+ x := x+1;
+ a[i] := 12;
+
+ assert a[i] == 12;
+
+ x1 := x;
+ y1 := y;
+
+ x, y := y, x;
+
+ assert x == y1 && y == x1;
+ assert x == x1; // error
+
+ x, a[i] := x+1, x;
+ assert x == y1+1 && a[i] == y1;
+
+ b[i][m, n] := 17;
+ b[i][m, n], x := a[x], y;
+
+ assert b[i][m, n] == a[y1+1];
+ assert false; // error
+}
+
+procedure Q() returns () modifies x, y, z; {
+
+ x, y, z := 1, 2, 3;
+
+ x, y, z := y, z, x;
+ x, y, z := y, z, x;
+ x, y, z := y, z, x;
+
+ assert x == 1 && y == 2 && z == 3;
+
+ x, y, z := y+1, z+1, x+1;
+ x, y, z := y+1, z+1, x+1;
+ x, y, z := y+1, z+1, x+1;
+
+ assert x == 4 && y == 5 && z == 6;
+
+ assert a[x] == a[y]; // error
+
+}
\ No newline at end of file |