summaryrefslogtreecommitdiff
path: root/Test/og/parallel2.bpl
diff options
context:
space:
mode:
authorGravatar Unknown <qadeer@FAIZ-AHMED-FAIZ.redmond.corp.microsoft.com>2013-05-18 21:15:20 -0700
committerGravatar Unknown <qadeer@FAIZ-AHMED-FAIZ.redmond.corp.microsoft.com>2013-05-18 21:15:20 -0700
commit64d8963508ce048d00db3766f4ca597b792c1b95 (patch)
tree67801fe71cd2ceb7eb851833dd489751baa21ce2 /Test/og/parallel2.bpl
parent89b20adf23750478098578895fef9ca3b9170927 (diff)
reworked the linear and og implementation based on available variables theory
Diffstat (limited to 'Test/og/parallel2.bpl')
-rw-r--r--Test/og/parallel2.bpl10
1 files changed, 7 insertions, 3 deletions
diff --git a/Test/og/parallel2.bpl b/Test/og/parallel2.bpl
index f2d45204..116612cb 100644
--- a/Test/og/parallel2.bpl
+++ b/Test/og/parallel2.bpl
@@ -1,16 +1,20 @@
var a:[int]int;
+procedure Allocate() returns ({:linear "tid"} xls: int);
+
procedure {:entrypoint} main()
{
var {:linear "tid"} i: int;
var {:linear "tid"} j: int;
+ call i := Allocate();
+ call j := Allocate();
call i := t(i) | j := t(j);
call i := u(i) | j := u(j);
}
procedure t({:linear "tid"} i': int) returns ({:linear "tid"} i: int)
{
- assume i == i';
+ i := i';
a[i] := 42;
call i := Yield(i);
@@ -19,7 +23,7 @@ procedure t({:linear "tid"} i': int) returns ({:linear "tid"} i: int)
procedure u({:linear "tid"} i': int) returns ({:linear "tid"} i: int)
{
- assume i == i';
+ i := i';
a[i] := 42;
yield;
@@ -30,7 +34,7 @@ procedure Yield({:linear "tid"} i': int) returns ({:linear "tid"} i: int)
ensures i == i';
ensures old(a)[i] == a[i];
{
- assume i == i';
+ i := i';
yield;
assert old(a)[i] == a[i];
} \ No newline at end of file