-
Notifications
You must be signed in to change notification settings - Fork 0
/
SH.scr
62 lines (58 loc) · 1.31 KB
/
SH.scr
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
62
//$ ~/scribbler/scribble/scribblec-assrt.sh -assrt -fair -z3 -batch SH.scr
//$ sessionstar SH.scr SH P
module SH;
type <fstar> "int" from "" as int;
global protocol SH(role P, role R, role C)
{
Plane(x1:int) from P to R;
Plane2(x2:int) from P to R;
Plane3(x3:int) from P to R;
Plane4(x4:int) from P to R;
do Loop(P, R, C);
}
aux global protocol Loop(role P, role R, role C)
{
choice at P
{
IsAbove(v1:int) from P to R;
Res(b1:int) from R to P; @"b1=0 || b1=1"
IsAbove(v2:int) from P to R;
Res(b2:int) from R to P; @"b2=0 || b2=1"
choice at P
{
BothIn() from P to R; @"b1=1 && b2=1"
BothIn(r1:int) from P to C;
do Loop(P, R, C);
}
or
{
BothOut() from P to R; @"b1=0 && b2=0"
BothOut() from P to C;
do Loop(P, R, C);
}
or
{
Intersct(y1:int) from P to R;
@"((b1=1 && b2=0) || (b1=0 && b2=1)) && (y1=v1)"
Intersct2(y2:int) from P to R;
@"(y2=v2)"
Res(i:int) from R to P;
choice at P
{
SecOut(r2:int) from P to C; @"b2=0 && r2=i"
do Loop(P, R, C);
}
or
{
SecIn(r3:int) from P to C; @"b2=1 && (r3=i)"
SecIn2(r4:int) from P to C; @"(r4=v2)"
do Loop(P, R, C);
}
}
}
or
{
Close() from P to R;
Close() from P to C;
}
}