blob: fbc97d591486bb3a3706a06186b481dd6683a51d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
function {:builtin "MapConst"} mapconstbool(bool) : [int]bool;
var g: int;
var h: int;
procedure A({:linear "tid"} tid_in: int) returns ({:linear "tid"} tid_out: int)
{
var {:linear "1"} x: [int]bool;
var {:linear "2"} y: [int]bool;
var {:linear "tid"} tid_child: int;
assume tid_in == tid_out;
assume x == mapconstbool(true);
assume y == mapconstbool(true);
g := 0;
yield;
assert g == 0 && x == mapconstbool(true);
yield;
assume tid_child != 0;
async call B(tid_child, x);
yield;
h := 0;
yield;
assert h == 0 && y == mapconstbool(true);
yield;
async call C(tid_child, y);
}
procedure B({:linear "tid"} tid_in: int, {:linear "1"} x_in: [int]bool)
requires x_in != mapconstbool(false);
{
var {:linear "tid"} tid_out: int;
var {:linear "1"} x: [int]bool;
assume tid_in == tid_out;
assume x_in == x;
g := 1;
yield;
g := 2;
}
procedure C({:linear "tid"} tid_in: int, {:linear "2"} y_in: [int]bool)
requires y_in != mapconstbool(false);
{
var {:linear "tid"} tid_out: int;
var {:linear "2"} y: [int]bool;
assume tid_in == tid_out;
assume y_in == y;
h := 1;
yield;
h := 2;
}
|