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