summaryrefslogtreecommitdiff
path: root/Test/og/treiber-stack.bpl
diff options
context:
space:
mode:
authorGravatar qadeer <unknown>2014-01-16 14:04:21 -0800
committerGravatar qadeer <unknown>2014-01-16 14:04:21 -0800
commit0c59d966ecd190b0c5acdaab55fc3c71af305684 (patch)
treee9ce6881988ff509e5f7ca8afac4d3e729b3430a /Test/og/treiber-stack.bpl
parent55dc4cbfddfaf1487e9c731b51986cafd0aa4817 (diff)
updating treiber stack
Diffstat (limited to 'Test/og/treiber-stack.bpl')
-rw-r--r--Test/og/treiber-stack.bpl21
1 files changed, 21 insertions, 0 deletions
diff --git a/Test/og/treiber-stack.bpl b/Test/og/treiber-stack.bpl
index bc5e0b10..f9c9eb70 100644
--- a/Test/og/treiber-stack.bpl
+++ b/Test/og/treiber-stack.bpl
@@ -1,3 +1,24 @@
+type lmap;
+function dom(lmap) : [int]bool;
+function map(lmap): [int]int;
+
+procedure Load({:linear "Node"} l:lmap, i:int) returns({:linear "Node"} l':lmap, v:int);
+ requires dom(l)[i];
+ ensures l' == l;
+ ensures v == map(l)[i];
+
+procedure Store({:linear "Node"} l:lmap, i:int, v:int) returns({:linear "Node"} l':lmap);
+ requires dom(l)[i];
+ ensures dom(l') == dom(l);
+ ensures map(l') == map(l)[i := v];
+
+procedure Transfer({:linear "Node"} l1:lmap, {:linear "Node"} l2:lmap, d:int) returns({:linear "Node} l1':lmap, {:linear "Node"} l2':lmap);
+ requires dom(l1)[i];
+ ensures dom(l1') == intersect(dom(l1), complement(d));
+ ensures dom(l2') == union(dom(l2), d);
+ ensures map(l1') == map(l1);
+ ensures map(l2') == map(l2);
+
record Node
{