summaryrefslogtreecommitdiff
path: root/Test/og/parallel4.bpl
diff options
context:
space:
mode:
authorGravatar qadeer <unknown>2014-05-03 10:06:13 -0700
committerGravatar qadeer <unknown>2014-05-03 10:06:13 -0700
commit36e016acf963b7c19d59640b11b4a40f2072943e (patch)
tree31a45e868059d0ffe54fc3d212261245ff97886a /Test/og/parallel4.bpl
parent121071b9f87d23eaeba176897b9655cd540fb694 (diff)
checkpoint
Diffstat (limited to 'Test/og/parallel4.bpl')
-rw-r--r--Test/og/parallel4.bpl16
1 files changed, 10 insertions, 6 deletions
diff --git a/Test/og/parallel4.bpl b/Test/og/parallel4.bpl
index 1069399f..2a2feb2d 100644
--- a/Test/og/parallel4.bpl
+++ b/Test/og/parallel4.bpl
@@ -1,4 +1,4 @@
-var a:int;
+var {:phase 1} a:int;
procedure Allocate() returns ({:linear "tid"} xls: int);
@@ -8,7 +8,7 @@ function {:inline} {:linear "tid"} TidCollector(x: int) : [int]bool
MapConstBool(false)[x := true]
}
-procedure {:entrypoint} {:yields} main()
+procedure {:yields} {:phase 1} main()
{
var {:linear "tid"} i: int;
var {:linear "tid"} j: int;
@@ -17,15 +17,19 @@ procedure {:entrypoint} {:yields} main()
par i := t(i) | j := t(j);
}
-procedure {:yields} {:stable} t({:linear "tid"} i': int) returns ({:linear "tid"} i: int)
+procedure {:yields} {:phase 1} t({:linear "tid"} i': int) returns ({:linear "tid"} i: int)
{
i := i';
call Yield();
- assert a == old(a);
- a := a + 1;
+ assert {:phase 1} a == old(a);
+ call Incr();
+ yield;
}
-procedure {:yields} Yield()
+procedure {:yields} {:phase 0,1} Incr();
+ensures {:atomic} |{A: a := a + 1; return true; }|;
+
+procedure {:yields} {:phase 1} Yield()
{
yield;
}