forked from cubicle-model-checker/cubicle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
motivating.cub
65 lines (53 loc) · 1.04 KB
/
motivating.cub
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
63
64
65
type msg = Epsilon | RS | RE
type state = I | S | E
var Exg : bool
var Cmd : msg
var Ptr : proc
array Cache[proc] : state
array Shr[proc] : bool
init (z) { Cache[z] = I && Shr[z] = False &&
Exg = False && Cmd = Epsilon }
unsafe (z1 z2) { Cache[z1] = E && Cache[z2] <> I }
transition t1 (n)
requires { Cmd = Epsilon && Cache[n] = I }
{
Cmd := RS;
Ptr := n ;
}
transition t2 (n)
requires { Cmd = Epsilon && Cache[n] <> E }
{
Cmd := RE;
Ptr := n;
}
transition t3 (n)
requires { Shr[n]=True && Cmd = RE }
{
Exg := False;
Cache[n] := I;
Shr[n] :=False;
}
transition t4 (n)
requires { Shr[n]=True && Cmd = RS && Exg=True }
{
Exg := False;
Cache[n] := S;
Shr[n] := True;
}
transition t5 (n)
requires { Ptr = n && Cmd = RS && Exg = False }
{
Cmd := Epsilon;
Shr[n] := True;
Cache[n] := S;
}
transition t6 (n)
requires { Shr[n] = False && Cmd = RE &&
Exg = False && Ptr = n &&
forall_other l. Shr[l] = False }
{
Cmd := Epsilon;
Exg := True;
Shr[n] := True;
Cache[n] := E;
}