1 (* Title: HOLCF/IOA/meta_theory/CompoExecs.ML |
1 (* Title: HOLCF/IOA/meta_theory/CompoExecs.ML |
2 ID: $Id$ |
2 ID: $Id$ |
3 Author: Olaf Müller |
3 Author: Olaf Müller |
4 |
4 *) |
5 Compositionality on Execution level. |
5 |
6 *) |
6 Delsimps (ex_simps @ all_simps); |
7 |
|
8 Delsimps (ex_simps @ all_simps); |
|
9 Delsimps [split_paired_All]; |
7 Delsimps [split_paired_All]; |
10 |
8 |
11 (* ----------------------------------------------------------------------------------- *) |
9 (* ----------------------------------------------------------------------------------- *) |
12 |
10 |
13 |
11 |
63 Goal "Filter_ex2 sig$nil=nil"; |
61 Goal "Filter_ex2 sig$nil=nil"; |
64 by (simp_tac (simpset() addsimps [Filter_ex2_def]) 1); |
62 by (simp_tac (simpset() addsimps [Filter_ex2_def]) 1); |
65 qed"Filter_ex2_nil"; |
63 qed"Filter_ex2_nil"; |
66 |
64 |
67 Goal "Filter_ex2 sig$(at >> xs) = \ |
65 Goal "Filter_ex2 sig$(at >> xs) = \ |
68 \ (if (fst at:actions sig) \ |
66 \ (if (fst at:actions sig) \ |
69 \ then at >> (Filter_ex2 sig$xs) \ |
67 \ then at >> (Filter_ex2 sig$xs) \ |
70 \ else Filter_ex2 sig$xs)"; |
68 \ else Filter_ex2 sig$xs)"; |
71 |
69 |
72 by (asm_full_simp_tac (simpset() addsimps [Filter_ex2_def]) 1); |
70 by (asm_full_simp_tac (simpset() addsimps [Filter_ex2_def]) 1); |
73 qed"Filter_ex2_cons"; |
71 qed"Filter_ex2_cons"; |
74 |
72 |
78 (* ---------------------------------------------------------------- *) |
76 (* ---------------------------------------------------------------- *) |
79 |
77 |
80 |
78 |
81 Goal "stutter2 sig = (LAM ex. (%s. case ex of \ |
79 Goal "stutter2 sig = (LAM ex. (%s. case ex of \ |
82 \ nil => TT \ |
80 \ nil => TT \ |
83 \ | x##xs => (flift1 \ |
81 \ | x##xs => (flift1 \ |
84 \ (%p.(If Def ((fst p)~:actions sig) \ |
82 \ (%p.(If Def ((fst p)~:actions sig) \ |
85 \ then Def (s=(snd p)) \ |
83 \ then Def (s=(snd p)) \ |
86 \ else TT fi) \ |
84 \ else TT fi) \ |
87 \ andalso (stutter2 sig$xs) (snd p)) \ |
85 \ andalso (stutter2 sig$xs) (snd p)) \ |
88 \ $x) \ |
86 \ $x) \ |
104 by (Simp_tac 1); |
102 by (Simp_tac 1); |
105 qed"stutter2_nil"; |
103 qed"stutter2_nil"; |
106 |
104 |
107 Goal "(stutter2 sig$(at>>xs)) s = \ |
105 Goal "(stutter2 sig$(at>>xs)) s = \ |
108 \ ((if (fst at)~:actions sig then Def (s=snd at) else TT) \ |
106 \ ((if (fst at)~:actions sig then Def (s=snd at) else TT) \ |
109 \ andalso (stutter2 sig$xs) (snd at))"; |
107 \ andalso (stutter2 sig$xs) (snd at))"; |
110 by (rtac trans 1); |
108 by (rtac trans 1); |
111 by (stac stutter2_unfold 1); |
109 by (stac stutter2_unfold 1); |
112 by (asm_full_simp_tac (simpset() addsimps [Consq_def,flift1_def,If_and_if]) 1); |
110 by (asm_full_simp_tac (simpset() addsimps [Consq_def,flift1_def,If_and_if]) 1); |
113 by (Simp_tac 1); |
111 by (Simp_tac 1); |
114 qed"stutter2_cons"; |
112 qed"stutter2_cons"; |
173 (* Lemma_1_1b : is_ex_fr (A||B) implies stuttering on Projections *) |
171 (* Lemma_1_1b : is_ex_fr (A||B) implies stuttering on Projections *) |
174 (* --------------------------------------------------------------------- *) |
172 (* --------------------------------------------------------------------- *) |
175 |
173 |
176 Goal "!s. is_exec_frag (A||B) (s,xs) \ |
174 Goal "!s. is_exec_frag (A||B) (s,xs) \ |
177 \ --> stutter (asig_of A) (fst s,ProjA2$xs) &\ |
175 \ --> stutter (asig_of A) (fst s,ProjA2$xs) &\ |
178 \ stutter (asig_of B) (snd s,ProjB2$xs)"; |
176 \ stutter (asig_of B) (snd s,ProjB2$xs)"; |
179 |
177 |
180 by (pair_induct_tac "xs" [stutter_def,is_exec_frag_def] 1); |
178 by (pair_induct_tac "xs" [stutter_def,is_exec_frag_def] 1); |
181 (* main case *) |
179 (* main case *) |
182 by (safe_tac set_cs); |
180 by (safe_tac set_cs); |
183 by (REPEAT (asm_full_simp_tac (simpset() addsimps trans_of_defs2) 1)); |
181 by (REPEAT (asm_full_simp_tac (simpset() addsimps trans_of_defs2) 1)); |
192 \ --> Forall (%x. fst x:act (A||B)) xs)"; |
190 \ --> Forall (%x. fst x:act (A||B)) xs)"; |
193 |
191 |
194 by (pair_induct_tac "xs" [Forall_def,sforall_def,is_exec_frag_def] 1); |
192 by (pair_induct_tac "xs" [Forall_def,sforall_def,is_exec_frag_def] 1); |
195 (* main case *) |
193 (* main case *) |
196 by (safe_tac set_cs); |
194 by (safe_tac set_cs); |
197 by (REPEAT (asm_full_simp_tac (simpset() addsimps trans_of_defs2 @ |
195 by (REPEAT (asm_full_simp_tac (simpset() addsimps trans_of_defs2 @ |
198 [actions_asig_comp,asig_of_par]) 1)); |
196 [actions_asig_comp,asig_of_par]) 1)); |
199 qed"lemma_1_1c"; |
197 qed"lemma_1_1c"; |
200 |
198 |
201 |
199 |
202 (* ----------------------------------------------------------------------- *) |
200 (* ----------------------------------------------------------------------- *) |
203 (* Lemma_1_2 : ex A, exB, stuttering and forall a:A|B implies ex (A||B) *) |
201 (* Lemma_1_2 : ex A, exB, stuttering and forall a:A|B implies ex (A||B) *) |
204 (* ----------------------------------------------------------------------- *) |
202 (* ----------------------------------------------------------------------- *) |
205 |
203 |
206 Goal |
204 Goal |
207 "!s. is_exec_frag A (fst s,Filter_ex2 (asig_of A)$(ProjA2$xs)) &\ |
205 "!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)) &\ |
206 \ is_exec_frag B (snd s,Filter_ex2 (asig_of B)$(ProjB2$xs)) &\ |
209 \ stutter (asig_of A) (fst s,(ProjA2$xs)) & \ |
207 \ stutter (asig_of A) (fst s,(ProjA2$xs)) & \ |
210 \ stutter (asig_of B) (snd s,(ProjB2$xs)) & \ |
208 \ stutter (asig_of B) (snd s,(ProjB2$xs)) & \ |
211 \ Forall (%x. fst x:act (A||B)) xs \ |
209 \ Forall (%x. fst x:act (A||B)) xs \ |
227 (* COMPOSITIONALITY on EXECUTION Level *) |
225 (* COMPOSITIONALITY on EXECUTION Level *) |
228 (* Main Theorem *) |
226 (* Main Theorem *) |
229 (* ------------------------------------------------------------------ *) |
227 (* ------------------------------------------------------------------ *) |
230 |
228 |
231 |
229 |
232 Goal |
230 Goal |
233 "(ex:executions(A||B)) =\ |
231 "(ex:executions(A||B)) =\ |
234 \(Filter_ex (asig_of A) (ProjA ex) : executions A &\ |
232 \(Filter_ex (asig_of A) (ProjA ex) : executions A &\ |
235 \ Filter_ex (asig_of B) (ProjB ex) : executions B &\ |
233 \ Filter_ex (asig_of B) (ProjB ex) : executions B &\ |
236 \ stutter (asig_of A) (ProjA ex) & stutter (asig_of B) (ProjB ex) &\ |
234 \ stutter (asig_of A) (ProjA ex) & stutter (asig_of B) (ProjB ex) &\ |
237 \ Forall (%x. fst x:act (A||B)) (snd ex))"; |
235 \ Forall (%x. fst x:act (A||B)) (snd ex))"; |