diff options
author | 2013-03-04 11:33:51 -0800 | |
---|---|---|
committer | 2013-03-04 11:33:51 -0800 | |
commit | f82dab21f1240fb3f8d67a880f4f93017d85c345 (patch) | |
tree | cdd03adc32960284e9ec20d8d8640a1709c40556 /Test/og/parallel5.bpl | |
parent | 68a39909f93535ad4d091fce647d8a0e8539508f (diff) |
fixed a bug in og
Diffstat (limited to 'Test/og/parallel5.bpl')
-rw-r--r-- | Test/og/parallel5.bpl | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Test/og/parallel5.bpl b/Test/og/parallel5.bpl new file mode 100644 index 00000000..8ee5e436 --- /dev/null +++ b/Test/og/parallel5.bpl @@ -0,0 +1,36 @@ +var a:[int]int;
+
+procedure {:entrypoint} main()
+{
+ var {:linear "tid"} i: int;
+ var {:linear "tid"} j: int;
+ call i := t(i) | j := Yield(j);
+ call i := u(i) | j := u(j);
+}
+
+procedure t({:linear "tid"} i': int) returns ({:linear "tid"} i: int)
+{
+ assume i == i';
+
+ a[i] := 42;
+ call i := Yield(i);
+ assert a[i] == 42;
+}
+
+procedure u({:linear "tid"} i': int) returns ({:linear "tid"} i: int)
+{
+ assume i == i';
+
+ a[i] := 42;
+ yield;
+ assert a[i] == 42;
+}
+
+procedure Yield({:linear "tid"} i': int) returns ({:linear "tid"} i: int)
+ensures i == i';
+ensures old(a)[i] == a[i];
+{
+ assume i == i';
+ yield;
+ assert old(a)[i] == a[i];
+}
\ No newline at end of file |