diff options
author | 2014-07-15 19:47:44 -0700 | |
---|---|---|
committer | 2014-07-15 19:47:44 -0700 | |
commit | 9c1c28a5e28f76af29805e6dd8b4b34c99fbe1b4 (patch) | |
tree | 9e02ec556858d05124bb3547da664db838382a3a /Test/og/treiber-stack.bpl | |
parent | 74090e6fc892db326c6f98b8adb790f1f09fba41 (diff) |
updated the linear type system based on Chris' design with linear, linear_in, linear_out
Diffstat (limited to 'Test/og/treiber-stack.bpl')
-rw-r--r-- | Test/og/treiber-stack.bpl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Test/og/treiber-stack.bpl b/Test/og/treiber-stack.bpl index 8e5f059a..ecaf1e3a 100644 --- a/Test/og/treiber-stack.bpl +++ b/Test/og/treiber-stack.bpl @@ -24,13 +24,13 @@ ensures {:right} |{ A: goto B,C; B: assume dom(Stack)[i]; v := map(Stack)[i]; return true;
C: assume !dom(Stack)[i]; return true; }|;
-procedure {:yields} {:phase 0} Store({:linear "Node"} l_in:lmap, i:Node, v:Node) returns ({:linear "Node"} l_out:lmap);
+procedure {:yields} {:phase 0} Store({:linear_in "Node"} l_in:lmap, i:Node, v:Node) returns ({:linear "Node"} l_out:lmap);
ensures {:both} |{ A: assert dom(l_in)[i]; l_out := Add(l_in, i, v); return true; }|;
procedure {:yields} {:phase 0} MakeEmpty() returns ({:linear "Node"} l_out:lmap);
ensures {:both} |{ A: l_out := EmptyLmap(); return true; }|;
-procedure {:yields} {:phase 0} TransferToStack(oldVal: Node, newVal: Node, {:linear "Node"} l_in:lmap) returns (r: bool, {:linear "Node"} l_out:lmap);
+procedure {:yields} {:phase 0} TransferToStack(oldVal: Node, newVal: Node, {:linear_in "Node"} l_in:lmap) returns (r: bool, {:linear "Node"} l_out:lmap);
ensures {:atomic} |{ A: assert dom(l_in)[newVal];
goto B,C;
B: assume oldVal == TopOfStack; TopOfStack := newVal; l_out := EmptyLmap(); Stack := Add(Stack, newVal, map(l_in)[newVal]); r := true; return true;
@@ -51,7 +51,7 @@ function {:inline} Inv(TopOfStack: Node, Stack: lmap) : (bool) Subset(Difference(BetweenSet(map(Stack), TopOfStack, null), Singleton(null)), dom(Stack))
}
-procedure {:yields} {:phase 1} push(x: Node, {:linear "Node"} x_lmap: lmap)
+procedure {:yields} {:phase 1} push(x: Node, {:linear_in "Node"} x_lmap: lmap)
requires {:phase 1} dom(x_lmap)[x];
requires {:phase 1} Inv(TopOfStack, Stack);
ensures {:phase 1} Inv(TopOfStack, Stack);
|