forked from cubicle-model-checker/cubicle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathberkeley.cub
53 lines (40 loc) · 942 Bytes
/
berkeley.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
type location = UnOwned | Exclusive | NonExclusive | Invalid
array A[proc] : location
init (z) { A[z] = Invalid }
unsafe (z1 z2) { A[z1] = Exclusive && A[z2] = Exclusive }
transition t1 (x)
requires { A[x] = Invalid }
{
A[j] := case
| j = x : UnOwned
| A[j] = Exclusive : NonExclusive
| _ : A[j];
}
transition t2 (x)
requires { A[x] = UnOwned }
{
A[j] := case
| j = x : Exclusive
| A[j] = NonExclusive : Invalid
| A[j] = UnOwned : Invalid
| _ : A[j];
}
transition t3 (x)
requires { A[x] = NonExclusive }
{
A[j] := case
| j = x : Exclusive
| A[j] = UnOwned : Invalid
| A[j] = NonExclusive : Invalid
| _ : A[j];
}
transition t4 (x)
requires { A[x] = Invalid }
{
A[j] := case
| j = x : Exclusive
| A[j] = NonExclusive : Invalid
| A[j] = Exclusive : Invalid
| A[j] = UnOwned : Invalid
| _ : A[j];
}