diff options
author | qadeer <qadeer@microsoft.com> | 2015-04-22 09:26:56 -0700 |
---|---|---|
committer | qadeer <qadeer@microsoft.com> | 2015-04-22 09:26:56 -0700 |
commit | 4c6dd519143fdbc8ecada56d58103d098c6bd18c (patch) | |
tree | abdbf5f883d31236a221a5b95f5f0364e75caf36 /Test/civl/new1.bpl | |
parent | 95a9ed0282811aa2bc3170f41b8b63508918b28e (diff) |
renamed og to civl
Diffstat (limited to 'Test/civl/new1.bpl')
-rw-r--r-- | Test/civl/new1.bpl | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Test/civl/new1.bpl b/Test/civl/new1.bpl new file mode 100644 index 00000000..b80b6315 --- /dev/null +++ b/Test/civl/new1.bpl @@ -0,0 +1,42 @@ +// RUN: %boogie -noinfer -typeEncoding:m -useArrayTheory "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+function {:builtin "MapConst"} mapconstbool(x:bool): [int]bool;
+
+var {:layer 0,1} g:int;
+
+function {:inline} {:linear "Perm"} SetCollectorPerm(x: [int]bool) : [int]bool
+{
+ x
+}
+
+procedure {:yields} {:layer 1} PB({:linear_in "Perm"} permVar_in:[int]bool)
+requires {:layer 1} permVar_in[0] && g == 0;
+{
+ var {:linear "Perm"} permVar_out: [int]bool;
+ permVar_out := permVar_in;
+
+ yield;
+ assert {:layer 1} permVar_out[0];
+ assert {:layer 1} g == 0;
+
+ call IncrG();
+
+ yield;
+ assert {:layer 1} permVar_out[0];
+ assert {:layer 1} g == 1;
+}
+
+procedure {:yields} {:layer 1} Main({:linear_in "Perm"} Permissions: [int]bool)
+requires {:layer 1} Permissions == mapconstbool(true);
+{
+ yield;
+ call SetG(0);
+ async call PB(Permissions);
+ yield;
+}
+
+procedure {:yields} {:layer 0,1} SetG(val:int);
+ensures {:atomic} |{A: g := val; return true; }|;
+
+procedure {:yields} {:layer 0,1} IncrG();
+ensures {:atomic} |{A: g := g + 1; return true; }|;
|