author | wenzelm |
Tue, 10 Jul 2007 23:29:43 +0200 | |
changeset 23719 | ccd9cb15c062 |
parent 19764 | 372065f34795 |
child 30609 | 983e8b6e4e69 |
permissions | -rw-r--r-- |
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
1 |
|
17244 | 2 |
(* $Id$ *) |
3 |
||
4 |
theory Cockpit |
|
5 |
imports MuIOAOracle |
|
6 |
begin |
|
7299 | 7 |
|
8 |
datatype 'a action = Alarm 'a | Info 'a | Ack 'a |
|
10127
86269867de34
renamed "None" to "NONE" (avoid clash with option type);
wenzelm
parents:
8733
diff
changeset
|
9 |
datatype event = NONE | PonR | Eng | Fue |
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
10 |
|
7299 | 11 |
|
17244 | 12 |
text {* |
13 |
This cockpit automaton is a deeply simplified version of the |
|
7299 | 14 |
control component of a helicopter alarm system considered in a study |
15 |
of ESG. Some properties will be proved by using model checker |
|
17244 | 16 |
mucke. *} |
7299 | 17 |
|
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
18 |
automaton cockpit = |
7299 | 19 |
signature |
17244 | 20 |
actions "event action" |
7299 | 21 |
inputs "Alarm a" |
17244 | 22 |
outputs "Ack a", "Info a" |
7299 | 23 |
states |
24 |
APonR_incl :: bool |
|
25 |
info :: event |
|
17244 | 26 |
initially "info = NONE & ~APonR_incl" |
7299 | 27 |
transitions |
28 |
"Alarm a" |
|
17244 | 29 |
post info := "if (a=NONE) then info else a", |
30 |
APonR_incl := "if (a=PonR) then True else APonR_incl" |
|
7299 | 31 |
"Info a" |
32 |
pre "(a=info)" |
|
33 |
"Ack a" |
|
10127
86269867de34
renamed "None" to "NONE" (avoid clash with option type);
wenzelm
parents:
8733
diff
changeset
|
34 |
pre "(a=PonR --> APonR_incl) & (a=NONE --> ~APonR_incl)" |
17244 | 35 |
post info := "NONE", |
36 |
APonR_incl := "if (a=PonR) then False else APonR_incl" |
|
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
37 |
|
8733 | 38 |
automaton cockpit_hide = hide_action "Info a" in cockpit |
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
39 |
|
17244 | 40 |
text {* |
41 |
Subsequent automata express the properties to be proved, see also |
|
42 |
Cockpit.ML *} |
|
7299 | 43 |
|
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
44 |
automaton Al_before_Ack = |
7299 | 45 |
signature |
17244 | 46 |
actions "event action" |
7299 | 47 |
inputs "Alarm a" |
48 |
outputs "Ack a" |
|
49 |
states |
|
50 |
APonR_incl :: bool |
|
51 |
initially "~APonR_incl" |
|
52 |
transitions |
|
53 |
"Alarm a" |
|
54 |
post APonR_incl:="if (a=PonR) then True else APonR_incl" |
|
55 |
"Ack a" |
|
56 |
pre "(a=PonR --> APonR_incl)" |
|
57 |
post APonR_incl:="if (a=PonR) then False else APonR_incl" |
|
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
58 |
|
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
59 |
automaton Info_while_Al = |
7299 | 60 |
signature |
17244 | 61 |
actions "event action" |
7299 | 62 |
inputs "Alarm a" |
63 |
outputs "Ack a", "Info i" |
|
64 |
states |
|
65 |
info_at_Pon :: bool |
|
66 |
initially "~info_at_Pon" |
|
67 |
transitions |
|
68 |
"Alarm a" |
|
69 |
post |
|
10127
86269867de34
renamed "None" to "NONE" (avoid clash with option type);
wenzelm
parents:
8733
diff
changeset
|
70 |
info_at_Pon:="if (a=PonR) then True else (if (a=NONE) then info_at_Pon else False)" |
7299 | 71 |
"Info a" |
72 |
pre "(a=PonR) --> info_at_Pon" |
|
73 |
"Ack a" |
|
74 |
post info_at_Pon:="False" |
|
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
75 |
|
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
76 |
automaton Info_before_Al = |
7299 | 77 |
signature |
17244 | 78 |
actions "event action" |
7299 | 79 |
inputs "Alarm a" |
80 |
outputs "Ack a", "Info i" |
|
81 |
states |
|
10127
86269867de34
renamed "None" to "NONE" (avoid clash with option type);
wenzelm
parents:
8733
diff
changeset
|
82 |
info_at_NONE :: bool |
86269867de34
renamed "None" to "NONE" (avoid clash with option type);
wenzelm
parents:
8733
diff
changeset
|
83 |
initially "info_at_NONE" |
7299 | 84 |
transitions |
85 |
"Alarm a" |
|
10127
86269867de34
renamed "None" to "NONE" (avoid clash with option type);
wenzelm
parents:
8733
diff
changeset
|
86 |
post info_at_NONE:="if (a=NONE) then info_at_NONE else False" |
7299 | 87 |
"Info a" |
10127
86269867de34
renamed "None" to "NONE" (avoid clash with option type);
wenzelm
parents:
8733
diff
changeset
|
88 |
pre "(a=NONE) --> info_at_NONE" |
7299 | 89 |
"Ack a" |
10127
86269867de34
renamed "None" to "NONE" (avoid clash with option type);
wenzelm
parents:
8733
diff
changeset
|
90 |
post info_at_NONE:="True" |
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
91 |
|
19764 | 92 |
lemmas aut_simps = |
93 |
cockpit_def cockpit_asig_def cockpit_trans_def |
|
94 |
cockpit_initial_def cockpit_hide_def |
|
95 |
Al_before_Ack_def Al_before_Ack_asig_def |
|
96 |
Al_before_Ack_initial_def Al_before_Ack_trans_def |
|
97 |
Info_while_Al_def Info_while_Al_asig_def |
|
98 |
Info_while_Al_initial_def Info_while_Al_trans_def |
|
99 |
Info_before_Al_def Info_before_Al_asig_def |
|
100 |
Info_before_Al_initial_def Info_before_Al_trans_def |
|
101 |
||
102 |
||
103 |
(* to prove, that info is always set at the recent alarm *) |
|
104 |
lemma cockpit_implements_Info_while_Al: "cockpit =<| Info_while_Al" |
|
105 |
apply (tactic {* is_sim_tac (thms "aut_simps") 1 *}) |
|
106 |
done |
|
107 |
||
108 |
(* to prove that before any alarm arrives (and after each acknowledgment), |
|
109 |
info remains at None *) |
|
110 |
lemma cockpit_implements_Info_before_Al: "cockpit =<| Info_before_Al" |
|
111 |
apply (tactic {* is_sim_tac (thms "aut_simps") 1 *}) |
|
112 |
done |
|
113 |
||
114 |
(* to prove that before any alarm would be acknowledged, it must be arrived *) |
|
115 |
lemma cockpit_implements_Al_before_Ack: "cockpit_hide =<| Al_before_Ack" |
|
116 |
apply (tactic {* is_sim_tac (thms "aut_simps") 1 *}) |
|
117 |
apply auto |
|
118 |
done |
|
17244 | 119 |
|
6471
08d12ef5fc19
added translation from IOA to mucalculus and corresponding modelchecker examples;
mueller
parents:
diff
changeset
|
120 |
end |