summaryrefslogtreecommitdiff
path: root/Test/og/Program4.bpl
diff options
context:
space:
mode:
authorGravatar qadeer <unknown>2015-02-11 17:29:22 -0800
committerGravatar qadeer <unknown>2015-02-11 17:29:22 -0800
commit882a965c3d212a2d79825e0d06200758ce3b9db4 (patch)
treeec187e8f7b7860f87d210a0703119178ab0d41c3 /Test/og/Program4.bpl
parenta7843fac5cfc4b5d755a10fc61dce896cc881d9e (diff)
moved some things around
Diffstat (limited to 'Test/og/Program4.bpl')
-rw-r--r--Test/og/Program4.bpl41
1 files changed, 22 insertions, 19 deletions
diff --git a/Test/og/Program4.bpl b/Test/og/Program4.bpl
index 7767e179..7f2f9c44 100644
--- a/Test/og/Program4.bpl
+++ b/Test/og/Program4.bpl
@@ -1,27 +1,8 @@
// RUN: %boogie -noinfer -typeEncoding:m -useArrayTheory "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
type Tid;
-function {:builtin "MapConst"} MapConstBool(bool): [Tid]bool;
-function {:builtin "MapOr"} MapOr([Tid]bool, [Tid]bool) : [Tid]bool;
-
-function {:inline} {:linear "tid"} TidCollector(x: Tid) : [Tid]bool
-{
- MapConstBool(false)[x := true]
-}
-function {:inline} {:linear "tid"} TidSetCollector(x: [Tid]bool) : [Tid]bool
-{
- x
-}
-
var {:layer 0,1} a:[Tid]int;
-procedure {:yields} {:layer 1} Allocate() returns ({:linear "tid"} tid: Tid)
-{
- yield;
- call tid := AllocateLow();
- yield;
-}
-
procedure {:yields} {:layer 1} main() {
var {:linear "tid"} tid:Tid;
@@ -49,6 +30,13 @@ ensures {:layer 1} a[tid] == old(a)[tid] + 1;
assert {:layer 1} a[tid] == t + 1;
}
+procedure {:yields} {:layer 1} Allocate() returns ({:linear "tid"} tid: Tid)
+{
+ yield;
+ call tid := AllocateLow();
+ yield;
+}
+
procedure {:yields} {:layer 0,1} Read({:linear "tid"} tid: Tid) returns (val: int);
ensures {:atomic}
|{A:
@@ -63,3 +51,18 @@ ensures {:atomic}
procedure {:yields} {:layer 0,1} AllocateLow() returns ({:linear "tid"} tid: Tid);
ensures {:atomic} |{ A: return true; }|;
+
+
+
+function {:builtin "MapConst"} MapConstBool(bool): [Tid]bool;
+function {:builtin "MapOr"} MapOr([Tid]bool, [Tid]bool) : [Tid]bool;
+
+function {:inline} {:linear "tid"} TidCollector(x: Tid) : [Tid]bool
+{
+ MapConstBool(false)[x := true]
+}
+function {:inline} {:linear "tid"} TidSetCollector(x: [Tid]bool) : [Tid]bool
+{
+ x
+}
+