author | wenzelm |
Mon, 22 Jun 1998 17:13:09 +0200 | |
changeset 5068 | fb28eaa07e01 |
parent 4833 | 2e53109d4bc8 |
child 7229 | 6773ba0c36d5 |
permissions | -rw-r--r-- |
3071 | 1 |
(* Title: HOLCF/IOA/meta_theory/CompoExecs.ML |
3275 | 2 |
ID: $Id$ |
3071 | 3 |
Author: Olaf M"uller |
4 |
Copyright 1996 TU Muenchen |
|
5 |
||
6 |
Compositionality on Execution level. |
|
7 |
*) |
|
8 |
||
9 |
Delsimps (ex_simps @ all_simps); |
|
10 |
Delsimps [split_paired_All]; |
|
11 |
||
12 |
(* ----------------------------------------------------------------------------------- *) |
|
13 |
||
14 |
||
15 |
section "recursive equations of operators"; |
|
16 |
||
17 |
||
18 |
(* ---------------------------------------------------------------- *) |
|
19 |
(* ProjA2 *) |
|
20 |
(* ---------------------------------------------------------------- *) |
|
21 |
||
22 |
||
5068 | 23 |
Goal "ProjA2`UU = UU"; |
4098 | 24 |
by (simp_tac (simpset() addsimps [ProjA2_def]) 1); |
3071 | 25 |
qed"ProjA2_UU"; |
26 |
||
5068 | 27 |
Goal "ProjA2`nil = nil"; |
4098 | 28 |
by (simp_tac (simpset() addsimps [ProjA2_def]) 1); |
3071 | 29 |
qed"ProjA2_nil"; |
30 |
||
5068 | 31 |
Goal "ProjA2`((a,t)>>xs) = (a,fst t) >> ProjA2`xs"; |
4098 | 32 |
by (simp_tac (simpset() addsimps [ProjA2_def]) 1); |
3071 | 33 |
qed"ProjA2_cons"; |
34 |
||
35 |
||
36 |
(* ---------------------------------------------------------------- *) |
|
37 |
(* ProjB2 *) |
|
38 |
(* ---------------------------------------------------------------- *) |
|
39 |
||
40 |
||
5068 | 41 |
Goal "ProjB2`UU = UU"; |
4098 | 42 |
by (simp_tac (simpset() addsimps [ProjB2_def]) 1); |
3071 | 43 |
qed"ProjB2_UU"; |
44 |
||
5068 | 45 |
Goal "ProjB2`nil = nil"; |
4098 | 46 |
by (simp_tac (simpset() addsimps [ProjB2_def]) 1); |
3071 | 47 |
qed"ProjB2_nil"; |
48 |
||
5068 | 49 |
Goal "ProjB2`((a,t)>>xs) = (a,snd t) >> ProjB2`xs"; |
4098 | 50 |
by (simp_tac (simpset() addsimps [ProjB2_def]) 1); |
3071 | 51 |
qed"ProjB2_cons"; |
52 |
||
53 |
||
54 |
||
55 |
(* ---------------------------------------------------------------- *) |
|
56 |
(* Filter_ex2 *) |
|
57 |
(* ---------------------------------------------------------------- *) |
|
58 |
||
59 |
||
5068 | 60 |
Goal "Filter_ex2 sig`UU=UU"; |
4098 | 61 |
by (simp_tac (simpset() addsimps [Filter_ex2_def]) 1); |
3071 | 62 |
qed"Filter_ex2_UU"; |
63 |
||
5068 | 64 |
Goal "Filter_ex2 sig`nil=nil"; |
4098 | 65 |
by (simp_tac (simpset() addsimps [Filter_ex2_def]) 1); |
3071 | 66 |
qed"Filter_ex2_nil"; |
67 |
||
5068 | 68 |
Goal "Filter_ex2 sig`(at >> xs) = \ |
3521 | 69 |
\ (if (fst at:actions sig) \ |
70 |
\ then at >> (Filter_ex2 sig`xs) \ |
|
71 |
\ else Filter_ex2 sig`xs)"; |
|
3071 | 72 |
|
4098 | 73 |
by (asm_full_simp_tac (simpset() addsimps [Filter_ex2_def]) 1); |
3071 | 74 |
qed"Filter_ex2_cons"; |
75 |
||
76 |
||
77 |
(* ---------------------------------------------------------------- *) |
|
78 |
(* stutter2 *) |
|
79 |
(* ---------------------------------------------------------------- *) |
|
80 |
||
81 |
||
5068 | 82 |
Goal "stutter2 sig = (LAM ex. (%s. case ex of \ |
3071 | 83 |
\ nil => TT \ |
84 |
\ | x##xs => (flift1 \ |
|
3521 | 85 |
\ (%p.(If Def ((fst p)~:actions sig) \ |
3071 | 86 |
\ then Def (s=(snd p)) \ |
87 |
\ else TT fi) \ |
|
3521 | 88 |
\ andalso (stutter2 sig`xs) (snd p)) \ |
3071 | 89 |
\ `x) \ |
90 |
\ ))"; |
|
91 |
by (rtac trans 1); |
|
3457 | 92 |
by (rtac fix_eq2 1); |
93 |
by (rtac stutter2_def 1); |
|
94 |
by (rtac beta_cfun 1); |
|
4098 | 95 |
by (simp_tac (simpset() addsimps [flift1_def]) 1); |
3071 | 96 |
qed"stutter2_unfold"; |
97 |
||
5068 | 98 |
Goal "(stutter2 sig`UU) s=UU"; |
3071 | 99 |
by (stac stutter2_unfold 1); |
100 |
by (Simp_tac 1); |
|
101 |
qed"stutter2_UU"; |
|
102 |
||
5068 | 103 |
Goal "(stutter2 sig`nil) s = TT"; |
3071 | 104 |
by (stac stutter2_unfold 1); |
105 |
by (Simp_tac 1); |
|
106 |
qed"stutter2_nil"; |
|
107 |
||
5068 | 108 |
Goal "(stutter2 sig`(at>>xs)) s = \ |
3521 | 109 |
\ ((if (fst at)~:actions sig then Def (s=snd at) else TT) \ |
110 |
\ andalso (stutter2 sig`xs) (snd at))"; |
|
4423 | 111 |
by (rtac trans 1); |
3071 | 112 |
by (stac stutter2_unfold 1); |
4098 | 113 |
by (asm_full_simp_tac (simpset() addsimps [Cons_def,flift1_def,If_and_if]) 1); |
3071 | 114 |
by (Simp_tac 1); |
115 |
qed"stutter2_cons"; |
|
116 |
||
117 |
||
118 |
Addsimps [stutter2_UU,stutter2_nil,stutter2_cons]; |
|
119 |
||
120 |
||
121 |
(* ---------------------------------------------------------------- *) |
|
122 |
(* stutter *) |
|
123 |
(* ---------------------------------------------------------------- *) |
|
124 |
||
5068 | 125 |
Goal "stutter sig (s, UU)"; |
4098 | 126 |
by (simp_tac (simpset() addsimps [stutter_def]) 1); |
3071 | 127 |
qed"stutter_UU"; |
128 |
||
5068 | 129 |
Goal "stutter sig (s, nil)"; |
4098 | 130 |
by (simp_tac (simpset() addsimps [stutter_def]) 1); |
3071 | 131 |
qed"stutter_nil"; |
132 |
||
5068 | 133 |
Goal "stutter sig (s, (a,t)>>ex) = \ |
3521 | 134 |
\ ((a~:actions sig --> (s=t)) & stutter sig (t,ex))"; |
4833 | 135 |
by (simp_tac (simpset() addsimps [stutter_def]) 1); |
3071 | 136 |
qed"stutter_cons"; |
137 |
||
138 |
(* ----------------------------------------------------------------------------------- *) |
|
139 |
||
140 |
Delsimps [stutter2_UU,stutter2_nil,stutter2_cons]; |
|
141 |
||
142 |
val compoex_simps = [ProjA2_UU,ProjA2_nil,ProjA2_cons, |
|
143 |
ProjB2_UU,ProjB2_nil,ProjB2_cons, |
|
144 |
Filter_ex2_UU,Filter_ex2_nil,Filter_ex2_cons, |
|
145 |
stutter_UU,stutter_nil,stutter_cons]; |
|
146 |
||
147 |
Addsimps compoex_simps; |
|
148 |
||
149 |
||
150 |
||
151 |
(* ------------------------------------------------------------------ *) |
|
152 |
(* The following lemmata aim for *) |
|
153 |
(* COMPOSITIONALITY on EXECUTION Level *) |
|
154 |
(* ------------------------------------------------------------------ *) |
|
155 |
||
156 |
||
157 |
(* --------------------------------------------------------------------- *) |
|
158 |
(* Lemma_1_1a : is_ex_fr propagates from A||B to Projections A and B *) |
|
159 |
(* --------------------------------------------------------------------- *) |
|
160 |
||
5068 | 161 |
Goal "!s. is_exec_frag (A||B) (s,xs) \ |
3521 | 162 |
\ --> is_exec_frag A (fst s, Filter_ex2 (asig_of A)`(ProjA2`xs)) &\ |
163 |
\ is_exec_frag B (snd s, Filter_ex2 (asig_of B)`(ProjB2`xs))"; |
|
3071 | 164 |
|
3433
2de17c994071
added deadlock freedom, polished definitions and proofs
mueller
parents:
3275
diff
changeset
|
165 |
by (pair_induct_tac "xs" [is_exec_frag_def] 1); |
3071 | 166 |
(* main case *) |
167 |
ren "ss a t" 1; |
|
168 |
by (safe_tac set_cs); |
|
4833 | 169 |
by (REPEAT (asm_full_simp_tac (simpset() addsimps trans_of_defs2) 1)); |
3071 | 170 |
qed"lemma_1_1a"; |
171 |
||
172 |
||
173 |
(* --------------------------------------------------------------------- *) |
|
174 |
(* Lemma_1_1b : is_ex_fr (A||B) implies stuttering on Projections *) |
|
175 |
(* --------------------------------------------------------------------- *) |
|
176 |
||
5068 | 177 |
Goal "!s. is_exec_frag (A||B) (s,xs) \ |
3521 | 178 |
\ --> stutter (asig_of A) (fst s,ProjA2`xs) &\ |
179 |
\ stutter (asig_of B) (snd s,ProjB2`xs)"; |
|
3071 | 180 |
|
3433
2de17c994071
added deadlock freedom, polished definitions and proofs
mueller
parents:
3275
diff
changeset
|
181 |
by (pair_induct_tac "xs" [stutter_def,is_exec_frag_def] 1); |
3071 | 182 |
(* main case *) |
183 |
by (safe_tac set_cs); |
|
4833 | 184 |
by (REPEAT (asm_full_simp_tac (simpset() addsimps trans_of_defs2) 1)); |
3071 | 185 |
qed"lemma_1_1b"; |
186 |
||
187 |
||
188 |
(* --------------------------------------------------------------------- *) |
|
189 |
(* Lemma_1_1c : Executions of A||B have only A- or B-actions *) |
|
190 |
(* --------------------------------------------------------------------- *) |
|
191 |
||
5068 | 192 |
Goal "!s. (is_exec_frag (A||B) (s,xs) \ |
3842 | 193 |
\ --> Forall (%x. fst x:act (A||B)) xs)"; |
3071 | 194 |
|
3433
2de17c994071
added deadlock freedom, polished definitions and proofs
mueller
parents:
3275
diff
changeset
|
195 |
by (pair_induct_tac "xs" [Forall_def,sforall_def,is_exec_frag_def] 1); |
3071 | 196 |
(* main case *) |
197 |
by (safe_tac set_cs); |
|
4098 | 198 |
by (REPEAT (asm_full_simp_tac (simpset() addsimps trans_of_defs2 @ |
3071 | 199 |
[actions_asig_comp,asig_of_par]) 1)); |
200 |
qed"lemma_1_1c"; |
|
201 |
||
202 |
||
203 |
(* ----------------------------------------------------------------------- *) |
|
204 |
(* Lemma_1_2 : ex A, exB, stuttering and forall a:A|B implies ex (A||B) *) |
|
205 |
(* ----------------------------------------------------------------------- *) |
|
206 |
||
5068 | 207 |
Goal |
3521 | 208 |
"!s. is_exec_frag A (fst s,Filter_ex2 (asig_of A)`(ProjA2`xs)) &\ |
209 |
\ is_exec_frag B (snd s,Filter_ex2 (asig_of B)`(ProjB2`xs)) &\ |
|
210 |
\ stutter (asig_of A) (fst s,(ProjA2`xs)) & \ |
|
211 |
\ stutter (asig_of B) (snd s,(ProjB2`xs)) & \ |
|
3842 | 212 |
\ Forall (%x. fst x:act (A||B)) xs \ |
3433
2de17c994071
added deadlock freedom, polished definitions and proofs
mueller
parents:
3275
diff
changeset
|
213 |
\ --> is_exec_frag (A||B) (s,xs)"; |
3071 | 214 |
|
215 |
by (pair_induct_tac "xs" [Forall_def,sforall_def, |
|
3433
2de17c994071
added deadlock freedom, polished definitions and proofs
mueller
parents:
3275
diff
changeset
|
216 |
is_exec_frag_def, stutter_def] 1); |
4681 | 217 |
by (asm_full_simp_tac (simpset() addsimps trans_of_defs1 @ [actions_asig_comp,asig_of_par]) 1); |
3071 | 218 |
by (safe_tac set_cs); |
219 |
(* problem with asm_full_simp_tac: (fst s) = (fst t) is too high in assumption order ! *) |
|
220 |
by (rotate_tac ~4 1); |
|
4681 | 221 |
by (Asm_full_simp_tac 1); |
3071 | 222 |
by (rotate_tac ~4 1); |
4681 | 223 |
by (Asm_full_simp_tac 1); |
3071 | 224 |
qed"lemma_1_2"; |
225 |
||
226 |
||
227 |
(* ------------------------------------------------------------------ *) |
|
228 |
(* COMPOSITIONALITY on EXECUTION Level *) |
|
229 |
(* Main Theorem *) |
|
230 |
(* ------------------------------------------------------------------ *) |
|
231 |
||
232 |
||
5068 | 233 |
Goal |
3071 | 234 |
"ex:executions(A||B) =\ |
3521 | 235 |
\(Filter_ex (asig_of A) (ProjA ex) : executions A &\ |
236 |
\ Filter_ex (asig_of B) (ProjB ex) : executions B &\ |
|
237 |
\ stutter (asig_of A) (ProjA ex) & stutter (asig_of B) (ProjB ex) &\ |
|
3842 | 238 |
\ Forall (%x. fst x:act (A||B)) (snd ex))"; |
3071 | 239 |
|
4098 | 240 |
by (simp_tac (simpset() addsimps [executions_def,ProjB_def, |
3071 | 241 |
Filter_ex_def,ProjA_def,starts_of_par]) 1); |
242 |
by (pair_tac "ex" 1); |
|
243 |
by (rtac iffI 1); |
|
244 |
(* ==> *) |
|
245 |
by (REPEAT (etac conjE 1)); |
|
4098 | 246 |
by (asm_full_simp_tac (simpset() addsimps [lemma_1_1a RS spec RS mp, |
3071 | 247 |
lemma_1_1b RS spec RS mp,lemma_1_1c RS spec RS mp]) 1); |
248 |
(* <== *) |
|
249 |
by (REPEAT (etac conjE 1)); |
|
4098 | 250 |
by (asm_full_simp_tac (simpset() addsimps [lemma_1_2 RS spec RS mp]) 1); |
3071 | 251 |
qed"compositionality_ex"; |
252 |
||
253 |
||
3521 | 254 |
(* ------------------------------------------------------------------ *) |
255 |
(* COMPOSITIONALITY on EXECUTION Level *) |
|
256 |
(* For Modules *) |
|
257 |
(* ------------------------------------------------------------------ *) |
|
258 |
||
5068 | 259 |
Goalw [Execs_def,par_execs_def] |
3521 | 260 |
|
261 |
"Execs (A||B) = par_execs (Execs A) (Execs B)"; |
|
262 |
||
4098 | 263 |
by (asm_full_simp_tac (simpset() addsimps [asig_of_par]) 1); |
4423 | 264 |
by (rtac set_ext 1); |
4098 | 265 |
by (asm_full_simp_tac (simpset() addsimps [compositionality_ex,actions_of_par]) 1); |
3521 | 266 |
qed"compositionality_ex_modules"; |
3071 | 267 |
|
268 |
||
3521 | 269 |
|
270 |
||
271 |
||
272 |
||
273 |