-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTokenChain.prot
More file actions
48 lines (35 loc) · 796 Bytes
/
Copy pathTokenChain.prot
File metadata and controls
48 lines (35 loc) · 796 Bytes
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
constant N := 3;
constant M := 3;
shadow variable fwd[1] < 2;
shadow variable tok[N] < 2;
puppet variable x[N] < M;
((future & shadow) % puppet)
(unique i < N : tok[i]==1);
process Bot[i < 1]
{
write: x[i];
read: x[i+1];
write: fwd[0], tok[i], tok[i+1];
shadow:
( tok[i]==1 --> fwd[0]:=1; tok[i]:=0; tok[i+1]:=1; );
}
process P[i <- map tid < N-2 : tid+1]
{
read: x[i-1];
write: x[i];
read: x[i+1];
read: fwd[0];
write: tok[i-1], tok[i], tok[i+1];
shadow:
( fwd[0]==1 && tok[i]==1 --> tok[i]:=0; tok[i+1]:=1; )
( fwd[0]==0 && tok[i]==1 --> tok[i-1]:=1; tok[i]:=0; )
;
}
process Top[i <- map tid < 1 : N-1]
{
read: x[i-1];
write: x[i];
write: fwd[0], tok[i-1], tok[i];
shadow:
( tok[i]==1 --> fwd[0]:=0; tok[i-1]:=1; tok[i]:=0; );
}