author | wenzelm |
Sat, 03 Sep 2005 16:47:25 +0200 | |
changeset 17241 | 62bb8dcc316e |
parent 7299 | 743b22579a2f |
child 17244 | 0b2ff9541727 |
permissions | -rw-r--r-- |
7299 | 1 |
|
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
2 |
Ring3 = MuIOAOracle + |
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
3 |
|
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
4 |
datatype token = Leader | id0 | id1 | id2 | id3 | id4 |
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
5 |
|
7299 | 6 |
datatype Comm = |
7 |
Zero_One token | One_Two token | Two_Zero token | |
|
8 |
Leader_Zero | Leader_One | Leader_Two |
|
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
9 |
|
7299 | 10 |
constdefs |
11 |
Greater :: [token, token] => bool |
|
12 |
"Greater x y == |
|
13 |
(x~=Leader & x~=id0 & y=id0) | (x=id4 & y~=id4 & y~=Leader) | |
|
14 |
(x=id2 & y=id1) | (x=id3 & y=id1) | (x=id3 & y=id2)" |
|
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
15 |
|
7299 | 16 |
|
17 |
(*the ring is the composition of aut0, aut1 and aut2*) |
|
18 |
||
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
19 |
automaton aut0 = |
7299 | 20 |
signature |
21 |
actions Comm |
|
22 |
inputs "Two_Zero t" |
|
23 |
outputs "Zero_One t","Leader_Zero" |
|
24 |
states |
|
25 |
idf :: token |
|
26 |
initially "idf=id0 | idf = id3" |
|
27 |
transitions |
|
28 |
"Two_Zero t" |
|
29 |
transrel |
|
30 |
"if (t=id0 | t=id3) then (idf'=Leader) else |
|
31 |
(if (Greater t idf) then (idf'=t) else (idf'=idf))" |
|
32 |
"Zero_One t" |
|
33 |
pre "t=idf" |
|
34 |
"Leader_Zero" |
|
35 |
pre "idf=Leader" |
|
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
36 |
|
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
37 |
automaton aut1 = |
7299 | 38 |
signature |
39 |
actions Comm |
|
40 |
inputs "Zero_One t" |
|
41 |
outputs "One_Two t","Leader_One" |
|
42 |
states |
|
43 |
idf :: token |
|
44 |
initially "idf=id1 | idf=id4" |
|
45 |
transitions |
|
46 |
"Zero_One t" |
|
47 |
transrel |
|
48 |
"if (t=id1 | t=id4) then (idf'=Leader) else |
|
49 |
(if (Greater t idf) then (idf'=t) else (idf'=idf))" |
|
50 |
"One_Two t" |
|
51 |
pre "t=idf" |
|
52 |
"Leader_One" |
|
53 |
pre "idf=Leader" |
|
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
54 |
|
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
55 |
automaton aut2 = |
7299 | 56 |
signature |
57 |
actions Comm |
|
58 |
inputs "One_Two t" |
|
59 |
outputs "Two_Zero t","Leader_Two" |
|
60 |
states |
|
61 |
idf :: token |
|
62 |
initially "idf=id2" |
|
63 |
transitions |
|
64 |
"One_Two t" |
|
65 |
transrel |
|
66 |
"if (t=id2) then (idf'=Leader) else |
|
67 |
(if (Greater t idf) then (idf'=t) else (idf'=idf))" |
|
68 |
"Two_Zero t" |
|
69 |
pre "t=idf" |
|
70 |
"Leader_Two" |
|
71 |
pre "idf=Leader" |
|
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
72 |
|
7299 | 73 |
automaton ring = compose aut0, aut1, aut2 |
74 |
||
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
75 |
|
7299 | 76 |
(*one_leader expresses property that at most one component declares |
77 |
itself to leader*) |
|
78 |
||
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
79 |
automaton one_leader = |
7299 | 80 |
signature |
81 |
actions Comm |
|
82 |
outputs "Zero_One t","One_Two t","Two_Zero t","Leader_Zero","Leader_One","Leader_Two" |
|
83 |
states |
|
84 |
leader :: token |
|
85 |
initially "leader=Leader" |
|
86 |
transitions |
|
87 |
"Zero_One t" |
|
88 |
pre "True" |
|
89 |
"One_Two t" |
|
90 |
pre "True" |
|
91 |
"Two_Zero t" |
|
92 |
pre "True" |
|
93 |
"Leader_Zero" |
|
94 |
pre "leader=id0 | leader=Leader" |
|
95 |
post leader:="id0" |
|
96 |
"Leader_One" |
|
97 |
pre "leader=id1 | leader=Leader" |
|
98 |
post leader:="id1" |
|
99 |
"Leader_Two" |
|
100 |
pre "leader=id2 | leader=Leader" |
|
101 |
post leader:="id2" |
|
102 |
||
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
103 |
|
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
104 |
end |