author | paulson |
Tue, 08 Jul 2003 11:44:30 +0200 | |
changeset 14092 | 68da54626309 |
parent 14077 | 37c964462747 |
permissions | -rw-r--r-- |
11479 | 1 |
(* Title: ZF/UNITY/Comp.ML |
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
2 |
ID: $Id \\<in> Comp.ML,v 1.8 2003/06/27 16:40:25 paulson Exp $ |
11479 | 3 |
Author: Sidi O Ehmety, Computer Laboratory |
4 |
Copyright 1998 University of Cambridge |
|
5 |
Composition |
|
6 |
From Chandy and Sanders, "Reasoning About Program Composition" |
|
7 |
||
8 |
Revised by Sidi Ehmety on January 2001 |
|
9 |
||
10 |
*) |
|
11 |
||
12 |
(*** component and strict_component relations ***) |
|
13 |
||
14 |
Goalw [component_def] |
|
15 |
"H component F | H component G ==> H component (F Join G)"; |
|
16 |
by Auto_tac; |
|
17 |
by (res_inst_tac [("x", "Ga Join G")] exI 1); |
|
18 |
by (res_inst_tac [("x", "G Join F")] exI 2); |
|
19 |
by (auto_tac (claset(), simpset() addsimps Join_ac)); |
|
20 |
qed "componentI"; |
|
21 |
||
22 |
Goalw [component_def] |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
23 |
"G \\<in> program ==> (F component G) <-> \ |
11479 | 24 |
\ (Init(G) <= Init(F) & Acts(F) <= Acts(G) & AllowedActs(G) <= AllowedActs(F))"; |
25 |
by Auto_tac; |
|
26 |
by (rtac exI 1); |
|
27 |
by (rtac program_equalityI 1); |
|
28 |
by Auto_tac; |
|
29 |
qed "component_eq_subset"; |
|
30 |
||
31 |
Goalw [component_def] |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
32 |
"F \\<in> program ==> SKIP component F"; |
11479 | 33 |
by (res_inst_tac [("x", "F")] exI 1); |
34 |
by (force_tac (claset() addIs [Join_SKIP_left], simpset()) 1); |
|
35 |
qed "component_SKIP"; |
|
36 |
||
37 |
Goalw [component_def] |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
38 |
"F \\<in> program ==> F component F"; |
11479 | 39 |
by (res_inst_tac [("x", "F")] exI 1); |
40 |
by (force_tac (claset() addIs [Join_SKIP_right], simpset()) 1); |
|
41 |
qed "component_refl"; |
|
42 |
||
43 |
Addsimps [component_SKIP, component_refl]; |
|
44 |
||
45 |
Goal "F component SKIP ==> programify(F) = SKIP"; |
|
46 |
by (rtac program_equalityI 1); |
|
47 |
by (ALLGOALS(asm_full_simp_tac (simpset() addsimps [component_eq_subset]))); |
|
48 |
by (Blast_tac 1); |
|
49 |
qed "SKIP_minimal"; |
|
50 |
||
51 |
Goalw [component_def] "F component (F Join G)"; |
|
52 |
by (Blast_tac 1); |
|
53 |
qed "component_Join1"; |
|
54 |
||
55 |
Goalw [component_def] "G component (F Join G)"; |
|
56 |
by (simp_tac (simpset() addsimps [Join_commute]) 1); |
|
57 |
by (Blast_tac 1); |
|
58 |
qed "component_Join2"; |
|
59 |
||
60 |
Goal "F component G ==> F Join G = G"; |
|
61 |
by (auto_tac (claset(), simpset() |
|
62 |
addsimps [component_def, Join_left_absorb])); |
|
63 |
qed "Join_absorb1"; |
|
64 |
||
65 |
Goal "G component F ==> F Join G = F"; |
|
66 |
by (auto_tac (claset(), simpset() addsimps Join_ac@[component_def])); |
|
67 |
qed "Join_absorb2"; |
|
68 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
69 |
Goal "H \\<in> program==>(JOIN(I,F) component H) <-> (\\<forall>i \\<in> I. F(i) component H)"; |
11479 | 70 |
by (case_tac "I=0" 1); |
71 |
by (Force_tac 1); |
|
72 |
by (asm_simp_tac (simpset() addsimps [component_eq_subset]) 1); |
|
73 |
by Auto_tac; |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12484
diff
changeset
|
74 |
by (Blast_tac 1); |
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12484
diff
changeset
|
75 |
by (rename_tac "y" 1); |
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12484
diff
changeset
|
76 |
by (dres_inst_tac [("c", "y"), ("A", "AllowedActs(H)")] subsetD 1); |
11479 | 77 |
by (REPEAT(blast_tac (claset() addSEs [not_emptyE]) 1)); |
78 |
qed "JN_component_iff"; |
|
79 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
80 |
Goalw [component_def] "i \\<in> I ==> F(i) component (\\<Squnion>i \\<in> I. (F(i)))"; |
11479 | 81 |
by (blast_tac (claset() addIs [JN_absorb]) 1); |
82 |
qed "component_JN"; |
|
83 |
||
84 |
Goalw [component_def] "[| F component G; G component H |] ==> F component H"; |
|
85 |
by (blast_tac (claset() addIs [Join_assoc RS sym]) 1); |
|
86 |
qed "component_trans"; |
|
87 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
88 |
Goal "[| F \\<in> program; G \\<in> program |] ==>(F component G & G component F) --> F = G"; |
11479 | 89 |
by (asm_simp_tac (simpset() addsimps [component_eq_subset]) 1); |
90 |
by (Clarify_tac 1); |
|
91 |
by (rtac program_equalityI 1); |
|
92 |
by Auto_tac; |
|
93 |
qed "component_antisym"; |
|
94 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
95 |
Goal "H \\<in> program ==> ((F Join G) component H) <-> (F component H & G component H)"; |
11479 | 96 |
by (asm_simp_tac (simpset() addsimps [component_eq_subset]) 1); |
97 |
by (Blast_tac 1); |
|
98 |
qed "Join_component_iff"; |
|
99 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
100 |
Goal "[| F component G; G \\<in> A co B; F \\<in> program |] ==> F \\<in> A co B"; |
12484 | 101 |
by (ftac constrainsD2 1); |
11479 | 102 |
by (rotate_tac ~1 1); |
103 |
by (auto_tac (claset(), |
|
104 |
simpset() addsimps [constrains_def, component_eq_subset])); |
|
105 |
qed "component_constrains"; |
|
106 |
||
12195 | 107 |
(* Used in Guar.thy to show that programs are partially ordered*) |
11479 | 108 |
(* bind_thm ("program_less_le", strict_component_def RS meta_eq_to_obj_eq);*) |
109 |
||
110 |
(*** preserves ***) |
|
111 |
||
14046 | 112 |
Goalw [preserves_def, safety_prop_def] |
113 |
"safety_prop(preserves(f))"; |
|
114 |
by (auto_tac (claset() addDs [ActsD], simpset() addsimps [stable_def, constrains_def])); |
|
115 |
by (dres_inst_tac [("c", "act")] subsetD 1); |
|
116 |
by Auto_tac; |
|
117 |
qed "preserves_is_safety_prop"; |
|
118 |
Addsimps [preserves_is_safety_prop]; |
|
119 |
||
120 |
||
12195 | 121 |
val prems = Goalw [preserves_def] |
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
122 |
"\\<forall>z. F \\<in> stable({s \\<in> state. f(s) = z}) ==> F \\<in> preserves(f)"; |
11479 | 123 |
by Auto_tac; |
124 |
by (blast_tac (claset() addDs [stableD2]) 1); |
|
12195 | 125 |
qed "preserves_aux"; |
126 |
bind_thm("preservesI", allI RS preserves_aux); |
|
11479 | 127 |
|
128 |
Goalw [preserves_def, stable_def, constrains_def] |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
129 |
"[| F \\<in> preserves(f); act \\<in> Acts(F); <s,t> \\<in> act |] ==> f(s) = f(t)"; |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
130 |
by (subgoal_tac "s \\<in> state & t \\<in> state" 1); |
12195 | 131 |
by (blast_tac (claset() addSDs [Acts_type RS subsetD]) 2); |
11479 | 132 |
by Auto_tac; |
133 |
by (dres_inst_tac [("x", "f(s)")] spec 1); |
|
134 |
by (dres_inst_tac [("x", "act")] bspec 1); |
|
135 |
by Auto_tac; |
|
136 |
qed "preserves_imp_eq"; |
|
137 |
||
138 |
Goalw [preserves_def] |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
139 |
"(F Join G \\<in> preserves(v)) <-> \ |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
140 |
\ (programify(F) \\<in> preserves(v) & programify(G) \\<in> preserves(v))"; |
11479 | 141 |
by (auto_tac (claset(), simpset() addsimps [INT_iff])); |
142 |
qed "Join_preserves"; |
|
143 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
144 |
Goal "(JOIN(I,F): preserves(v)) <-> (\\<forall>i \\<in> I. programify(F(i)):preserves(v))"; |
12195 | 145 |
by (auto_tac (claset(), simpset() addsimps [JN_stable, preserves_def, INT_iff])); |
11479 | 146 |
qed "JN_preserves"; |
147 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
148 |
Goal "SKIP \\<in> preserves(v)"; |
12195 | 149 |
by (auto_tac (claset(), simpset() addsimps [preserves_def, INT_iff])); |
11479 | 150 |
qed "SKIP_preserves"; |
151 |
||
152 |
AddIffs [Join_preserves, JN_preserves, SKIP_preserves]; |
|
153 |
||
14046 | 154 |
Goalw [fun_pair_def] "fun_pair(f,g,x) = <f(x), g(x)>"; |
155 |
by (Simp_tac 1); |
|
156 |
qed "fun_pair_apply"; |
|
157 |
Addsimps [fun_pair_apply]; |
|
158 |
||
159 |
Goal "preserves(fun_pair(v,w)) = preserves(v) Int preserves(w)"; |
|
160 |
by (rtac equalityI 1); |
|
161 |
by (auto_tac (claset(), |
|
162 |
simpset() addsimps [preserves_def, stable_def, constrains_def])); |
|
163 |
by (REPEAT(Blast_tac 1)); |
|
164 |
qed "preserves_fun_pair"; |
|
165 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
166 |
Goal "F \\<in> preserves(fun_pair(v, w)) <-> F \\<in> preserves(v) Int preserves(w)"; |
14046 | 167 |
by (simp_tac (simpset() addsimps [preserves_fun_pair]) 1); |
168 |
qed "preserves_fun_pair_iff"; |
|
169 |
AddIffs [preserves_fun_pair_iff]; |
|
170 |
||
171 |
Goal "(fun_pair(f, g) comp h)(x) = fun_pair(f comp h, g comp h, x)"; |
|
14077 | 172 |
by (simp_tac (simpset() addsimps [fun_pair_def, metacomp_def]) 1); |
14046 | 173 |
qed "fun_pair_comp_distrib"; |
174 |
||
175 |
Goal "(f comp g)(x) = f(g(x))"; |
|
14077 | 176 |
by (simp_tac (simpset() addsimps [metacomp_def]) 1); |
14046 | 177 |
qed "comp_apply"; |
178 |
Addsimps [comp_apply]; |
|
179 |
||
180 |
Goalw [preserves_def] |
|
181 |
"preserves(v)<=program"; |
|
182 |
by Auto_tac; |
|
183 |
qed "preserves_type"; |
|
184 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
185 |
Goal "F \\<in> preserves(f) ==> F \\<in> program"; |
14046 | 186 |
by (blast_tac (claset() addIs [preserves_type RS subsetD]) 1); |
187 |
qed "preserves_into_program"; |
|
188 |
AddTCs [preserves_into_program]; |
|
189 |
||
190 |
Goal "preserves(f) <= preserves(g comp f)"; |
|
191 |
by (auto_tac (claset(), simpset() |
|
192 |
addsimps [preserves_def, stable_def, constrains_def])); |
|
193 |
by (dres_inst_tac [("x", "f(xb)")] spec 1); |
|
194 |
by (dres_inst_tac [("x", "act")] bspec 1); |
|
195 |
by Auto_tac; |
|
196 |
qed "subset_preserves_comp"; |
|
197 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
198 |
Goal "F \\<in> preserves(f) ==> F \\<in> preserves(g comp f)"; |
14046 | 199 |
by (blast_tac (claset() addIs [subset_preserves_comp RS subsetD]) 1); |
200 |
qed "imp_preserves_comp"; |
|
201 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
202 |
Goal "preserves(f) <= stable({s \\<in> state. P(f(s))})"; |
14046 | 203 |
by (auto_tac (claset(), |
204 |
simpset() addsimps [preserves_def, stable_def, constrains_def])); |
|
205 |
by (rename_tac "s' s" 1); |
|
206 |
by (subgoal_tac "f(s) = f(s')" 1); |
|
207 |
by (ALLGOALS Force_tac); |
|
208 |
qed "preserves_subset_stable"; |
|
209 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
210 |
Goal "F \\<in> preserves(f) ==> F \\<in> stable({s \\<in> state. P(f(s))})"; |
14046 | 211 |
by (blast_tac (claset() addIs [preserves_subset_stable RS subsetD]) 1); |
212 |
qed "preserves_imp_stable"; |
|
213 |
||
214 |
Goalw [increasing_def] |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
215 |
"[| F \\<in> preserves(f); \\<forall>x \\<in> state. f(x):A |] ==> F \\<in> Increasing.increasing(A, r, f)"; |
14046 | 216 |
by (auto_tac (claset() addIs [preserves_into_program], |
217 |
simpset())); |
|
218 |
by (res_inst_tac [("P", "%x. <k, x>:r")] preserves_imp_stable 1); |
|
219 |
by Auto_tac; |
|
220 |
qed "preserves_imp_increasing"; |
|
221 |
||
222 |
Goalw [preserves_def, stable_def, constrains_def] |
|
223 |
"st_set(A) ==> preserves(%x. x) <= stable(A)"; |
|
224 |
by Auto_tac; |
|
225 |
by (dres_inst_tac [("x", "xb")] spec 1); |
|
226 |
by (dres_inst_tac [("x", "act")] bspec 1); |
|
227 |
by (auto_tac (claset() addDs [ActsD], simpset())); |
|
228 |
qed "preserves_id_subset_stable"; |
|
229 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
230 |
Goal "[| F \\<in> preserves(%x. x); st_set(A) |] ==> F \\<in> stable(A)"; |
14046 | 231 |
by (blast_tac (claset() addIs [preserves_id_subset_stable RS subsetD]) 1); |
232 |
qed "preserves_id_imp_stable"; |
|
233 |
||
12195 | 234 |
(** Added by Sidi **) |
11479 | 235 |
(** component_of **) |
236 |
||
237 |
(* component_of is stronger than component *) |
|
238 |
Goalw [component_def, component_of_def] |
|
239 |
"F component_of H ==> F component H"; |
|
240 |
by (Blast_tac 1); |
|
241 |
qed "component_of_imp_component"; |
|
242 |
||
12195 | 243 |
(* component_of satisfies many of component's properties *) |
11479 | 244 |
Goalw [component_of_def] |
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
245 |
"F \\<in> program ==> F component_of F"; |
11479 | 246 |
by (res_inst_tac [("x", "SKIP")] exI 1); |
247 |
by Auto_tac; |
|
248 |
qed "component_of_refl"; |
|
249 |
||
250 |
Goalw [component_of_def] |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
251 |
"F \\<in> program ==>SKIP component_of F"; |
11479 | 252 |
by Auto_tac; |
253 |
by (res_inst_tac [("x", "F")] exI 1); |
|
254 |
by Auto_tac; |
|
255 |
qed "component_of_SKIP"; |
|
256 |
Addsimps [component_of_refl, component_of_SKIP]; |
|
257 |
||
258 |
Goalw [component_of_def] |
|
259 |
"[| F component_of G; G component_of H |] ==> F component_of H"; |
|
260 |
by (blast_tac (claset() addIs [Join_assoc RS sym]) 1); |
|
261 |
qed "component_of_trans"; |
|
262 |
||
263 |
(** localize **) |
|
264 |
Goalw [localize_def] |
|
265 |
"Init(localize(v,F)) = Init(F)"; |
|
266 |
by (Simp_tac 1); |
|
267 |
qed "localize_Init_eq"; |
|
268 |
||
269 |
Goalw [localize_def] |
|
270 |
"Acts(localize(v,F)) = Acts(F)"; |
|
271 |
by (Simp_tac 1); |
|
272 |
qed "localize_Acts_eq"; |
|
273 |
||
274 |
Goalw [localize_def] |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
275 |
"AllowedActs(localize(v,F)) = AllowedActs(F) Int (\\<Union>G \\<in> preserves(v). Acts(G))"; |
12195 | 276 |
by (rtac equalityI 1); |
277 |
by (auto_tac (claset() addDs [Acts_type RS subsetD], simpset())); |
|
11479 | 278 |
qed "localize_AllowedActs_eq"; |
279 |
||
12195 | 280 |
AddIffs [localize_Init_eq, localize_Acts_eq, localize_AllowedActs_eq]; |
281 |
||
14046 | 282 |
(** Theorems used in ClientImpl **) |
283 |
||
284 |
Goal |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
285 |
"[| F \\<in> stable({s \\<in> state. P(f(s), g(s))}); G \\<in> preserves(f); G \\<in> preserves(g) |] \ |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
286 |
\ ==> F Join G \\<in> stable({s \\<in> state. P(f(s), g(s))})"; |
14046 | 287 |
by (auto_tac (claset() addDs [ActsD, preserves_into_program], |
288 |
simpset() addsimps [stable_def, constrains_def])); |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
289 |
by (case_tac "act \\<in> Acts(F)" 1); |
14046 | 290 |
by Auto_tac; |
291 |
by (dtac preserves_imp_eq 1); |
|
292 |
by (dtac preserves_imp_eq 3); |
|
293 |
by Auto_tac; |
|
294 |
qed "stable_localTo_stable2"; |
|
295 |
||
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
296 |
Goal "[| F \\<in> stable({s \\<in> state. <f(s), g(s)>:r}); G \\<in> preserves(f); \ |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
297 |
\ F Join G \\<in> Increasing(A, r, g); \ |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
298 |
\ \\<forall>x \\<in> state. f(x):A & g(x):A |] \ |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
299 |
\ ==> F Join G \\<in> Stable({s \\<in> state. <f(s), g(s)>:r})"; |
14046 | 300 |
by (auto_tac (claset(), |
301 |
simpset() addsimps [stable_def, Stable_def, Increasing_def, |
|
302 |
Constrains_def, all_conj_distrib])); |
|
303 |
by (ALLGOALS(asm_full_simp_tac (simpset() |
|
304 |
addsimps [constrains_type RS subsetD, preserves_type RS subsetD]))); |
|
305 |
by (blast_tac (claset() addIs [constrains_weaken]) 1); |
|
306 |
(*The G case remains*) |
|
307 |
by (auto_tac (claset() addDs [ActsD], |
|
308 |
simpset() addsimps [preserves_def, stable_def, constrains_def, |
|
309 |
ball_conj_distrib, all_conj_distrib])); |
|
310 |
(*We have a G-action, so delete assumptions about F-actions*) |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
311 |
by (thin_tac "\\<forall>act \\<in> Acts(F). ?P(act)" 1); |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
312 |
by (thin_tac "\\<forall>k\\<in>A. \\<forall>act \\<in> Acts(F). ?P(k,act)" 1); |
14046 | 313 |
by (subgoal_tac "f(x) = f(xa)" 1); |
314 |
by (auto_tac (claset() addSDs [bspec], simpset())); |
|
315 |
qed "Increasing_preserves_Stable"; |
|
316 |
||
317 |
||
318 |
(** Lemma used in AllocImpl **) |
|
319 |
||
320 |
Goalw [Constrains_def, constrains_def] |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
321 |
"[| \\<forall>x \\<in> I. F \\<in> A(x) Co B; F \\<in> program |] ==> F:(\\<Union>x \\<in> I. A(x)) Co B"; |
14046 | 322 |
by Auto_tac; |
323 |
qed "Constrains_UN_left"; |
|
324 |
||
325 |
Goalw [stable_def, Stable_def, preserves_def] |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
326 |
"[| F \\<in> stable({s \\<in> state. P(f(s), g(s))}); \ |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
327 |
\ \\<forall>k \\<in> A. F Join G \\<in> Stable({s \\<in> state. P(k, g(s))}); \ |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
328 |
\ G \\<in> preserves(f); \\<forall>s \\<in> state. f(s):A|] ==> \ |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
329 |
\ F Join G \\<in> Stable({s \\<in> state. P(f(s), g(s))})"; |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
330 |
by (res_inst_tac [("A", "(\\<Union>k \\<in> A. {s \\<in> state. f(s)=k} Int {s \\<in> state. P(f(s), g(s))})")] |
14046 | 331 |
Constrains_weaken_L 1); |
332 |
by (Blast_tac 2); |
|
333 |
by (rtac Constrains_UN_left 1); |
|
334 |
by Auto_tac; |
|
14092
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
335 |
by (res_inst_tac [("A", "{s \\<in> state. f(s)=k} Int {s \\<in> state. P(f(s), g(s))} Int \ |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
336 |
\ {s \\<in> state. P(k, g(s))}"), |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
337 |
("A'", "({s \\<in> state. f(s)=k} Un {s \\<in> state. P(f(s), g(s))}) \ |
68da54626309
Conversion of ZF/UNITY/{FP,Union} to Isar script.
paulson
parents:
14077
diff
changeset
|
338 |
\ Int {s \\<in> state. P(k, g(s))}")] Constrains_weaken 1); |
14046 | 339 |
by (REPEAT(Blast_tac 2)); |
340 |
by (rtac Constrains_Int 1); |
|
341 |
by (rtac constrains_imp_Constrains 1); |
|
342 |
by (auto_tac (claset(), simpset() addsimps [constrains_type RS subsetD])); |
|
343 |
by (ALLGOALS(rtac constrains_weaken)); |
|
344 |
by (rotate_tac ~1 4); |
|
345 |
by (dres_inst_tac [("x", "k")] spec 4); |
|
346 |
by (REPEAT(Blast_tac 1)); |
|
347 |
qed "stable_Join_Stable"; |
|
348 |