3071
|
1 |
(* Title: HOLCF/IOA/meta_theory/Traces.ML
|
|
2 |
ID:
|
|
3 |
Author: Olaf M"uller
|
|
4 |
Copyright 1996 TU Muenchen
|
|
5 |
|
|
6 |
Theorems about Executions and Traces of I/O automata in HOLCF.
|
|
7 |
*)
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
val exec_rws = [executions_def,is_execution_fragment_def];
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
(* ----------------------------------------------------------------------------------- *)
|
|
16 |
|
|
17 |
section "recursive equations of operators";
|
|
18 |
|
|
19 |
|
|
20 |
(* ---------------------------------------------------------------- *)
|
|
21 |
(* filter_act *)
|
|
22 |
(* ---------------------------------------------------------------- *)
|
|
23 |
|
|
24 |
|
|
25 |
goal thy "filter_act`UU = UU";
|
|
26 |
by (simp_tac (!simpset addsimps [filter_act_def]) 1);
|
|
27 |
qed"filter_act_UU";
|
|
28 |
|
|
29 |
goal thy "filter_act`nil = nil";
|
|
30 |
by (simp_tac (!simpset addsimps [filter_act_def]) 1);
|
|
31 |
qed"filter_act_nil";
|
|
32 |
|
|
33 |
goal thy "filter_act`(x>>xs) = (fst x) >> filter_act`xs";
|
|
34 |
by (simp_tac (!simpset addsimps [filter_act_def]) 1);
|
|
35 |
qed"filter_act_cons";
|
|
36 |
|
|
37 |
Addsimps [filter_act_UU,filter_act_nil,filter_act_cons];
|
|
38 |
|
|
39 |
|
|
40 |
(* ---------------------------------------------------------------- *)
|
|
41 |
(* mk_trace *)
|
|
42 |
(* ---------------------------------------------------------------- *)
|
|
43 |
|
|
44 |
goal thy "mk_trace A`UU=UU";
|
|
45 |
by (simp_tac (!simpset addsimps [mk_trace_def]) 1);
|
|
46 |
qed"mk_trace_UU";
|
|
47 |
|
|
48 |
goal thy "mk_trace A`nil=nil";
|
|
49 |
by (simp_tac (!simpset addsimps [mk_trace_def]) 1);
|
|
50 |
qed"mk_trace_nil";
|
|
51 |
|
|
52 |
goal thy "mk_trace A`(at >> xs) = \
|
|
53 |
\ (if ((fst at):ext A) \
|
|
54 |
\ then (fst at) >> (mk_trace A`xs) \
|
|
55 |
\ else mk_trace A`xs)";
|
|
56 |
|
|
57 |
by (asm_full_simp_tac (!simpset addsimps [mk_trace_def]) 1);
|
|
58 |
qed"mk_trace_cons";
|
|
59 |
|
|
60 |
Addsimps [mk_trace_UU,mk_trace_nil,mk_trace_cons];
|
|
61 |
|
|
62 |
(* ---------------------------------------------------------------- *)
|
|
63 |
(* is_ex_fr *)
|
|
64 |
(* ---------------------------------------------------------------- *)
|
|
65 |
|
|
66 |
|
|
67 |
goal thy "is_ex_fr A = (LAM ex. (%s. case ex of \
|
|
68 |
\ nil => TT \
|
|
69 |
\ | x##xs => (flift1 \
|
|
70 |
\ (%p.Def ((s,p):trans_of A) andalso (is_ex_fr A`xs) (snd p)) \
|
|
71 |
\ `x) \
|
|
72 |
\ ))";
|
|
73 |
by (rtac trans 1);
|
|
74 |
br fix_eq2 1;
|
|
75 |
br is_ex_fr_def 1;
|
|
76 |
br beta_cfun 1;
|
|
77 |
by (simp_tac (!simpset addsimps [flift1_def]) 1);
|
|
78 |
qed"is_ex_fr_unfold";
|
|
79 |
|
|
80 |
goal thy "(is_ex_fr A`UU) s=UU";
|
|
81 |
by (stac is_ex_fr_unfold 1);
|
|
82 |
by (Simp_tac 1);
|
|
83 |
qed"is_ex_fr_UU";
|
|
84 |
|
|
85 |
goal thy "(is_ex_fr A`nil) s = TT";
|
|
86 |
by (stac is_ex_fr_unfold 1);
|
|
87 |
by (Simp_tac 1);
|
|
88 |
qed"is_ex_fr_nil";
|
|
89 |
|
|
90 |
goal thy "(is_ex_fr A`(pr>>xs)) s = \
|
|
91 |
\ (Def ((s,pr):trans_of A) \
|
|
92 |
\ andalso (is_ex_fr A`xs)(snd pr))";
|
|
93 |
br trans 1;
|
|
94 |
by (stac is_ex_fr_unfold 1);
|
|
95 |
by (asm_full_simp_tac (!simpset addsimps [Cons_def,flift1_def]) 1);
|
|
96 |
by (Simp_tac 1);
|
|
97 |
qed"is_ex_fr_cons";
|
|
98 |
|
|
99 |
|
|
100 |
Addsimps [is_ex_fr_UU,is_ex_fr_nil,is_ex_fr_cons];
|
|
101 |
|
|
102 |
|
|
103 |
(* ---------------------------------------------------------------- *)
|
|
104 |
(* is_execution_fragment *)
|
|
105 |
(* ---------------------------------------------------------------- *)
|
|
106 |
|
|
107 |
goal thy "is_execution_fragment A (s, UU)";
|
|
108 |
by (simp_tac (!simpset addsimps [is_execution_fragment_def]) 1);
|
|
109 |
qed"is_execution_fragment_UU";
|
|
110 |
|
|
111 |
goal thy "is_execution_fragment A (s, nil)";
|
|
112 |
by (simp_tac (!simpset addsimps [is_execution_fragment_def]) 1);
|
|
113 |
qed"is_execution_fragment_nil";
|
|
114 |
|
|
115 |
goal thy "is_execution_fragment A (s, (a,t)>>ex) = \
|
|
116 |
\ (((s,a,t):trans_of A) & \
|
|
117 |
\ is_execution_fragment A (t, ex))";
|
|
118 |
by (simp_tac (!simpset addsimps [is_execution_fragment_def]) 1);
|
|
119 |
qed"is_execution_fragment_cons";
|
|
120 |
|
|
121 |
|
|
122 |
(* Delsimps [is_ex_fr_UU,is_ex_fr_nil,is_ex_fr_cons]; *)
|
|
123 |
Addsimps [is_execution_fragment_UU,is_execution_fragment_nil, is_execution_fragment_cons];
|
|
124 |
|
|
125 |
|
|
126 |
(* -------------------------------------------------------------------------------- *)
|
|
127 |
|
|
128 |
section "has_trace, mk_trace";
|
|
129 |
|
|
130 |
(* alternative definition of has_trace tailored for the refinement proof, as it does not
|
|
131 |
take the detour of schedules *)
|
|
132 |
|
|
133 |
goalw thy [executions_def,mk_trace_def,has_trace_def,schedules_def,has_schedule_def]
|
|
134 |
"has_trace A b = (? ex:executions A. b = mk_trace A`(snd ex))";
|
|
135 |
|
|
136 |
by (safe_tac set_cs);
|
|
137 |
(* 1 *)
|
|
138 |
by (res_inst_tac[("x","ex")] bexI 1);
|
|
139 |
by (stac beta_cfun 1);
|
|
140 |
by (cont_tacR 1);
|
|
141 |
by (Simp_tac 1);
|
|
142 |
by (Asm_simp_tac 1);
|
|
143 |
(* 2 *)
|
|
144 |
by (res_inst_tac[("x","filter_act`(snd ex)")] bexI 1);
|
|
145 |
by (stac beta_cfun 1);
|
|
146 |
by (cont_tacR 1);
|
|
147 |
by (Simp_tac 1);
|
|
148 |
by (safe_tac set_cs);
|
|
149 |
by (res_inst_tac[("x","ex")] bexI 1);
|
|
150 |
by (REPEAT (Asm_simp_tac 1));
|
|
151 |
qed"has_trace_def2";
|
|
152 |
|