| author | wenzelm |
| Thu, 10 Feb 2000 13:34:52 +0100 | |
| changeset 8228 | 8283e416b680 |
| parent 8216 | e4b3192dfefa |
| child 8251 | 9be357df93d4 |
| permissions | -rw-r--r-- |
| 7186 | 1 |
(* Title: HOL/UNITY/Lift_prog.ML |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1998 University of Cambridge |
|
| 7482 | 5 |
|
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7688
diff
changeset
|
6 |
Arrays of processes. Many results are instances of those in Extend & Project. |
| 7186 | 7 |
*) |
8 |
||
9 |
||
10 |
(*** Basic properties ***) |
|
11 |
||
12 |
(** lift_set and drop_set **) |
|
13 |
||
14 |
Goalw [lift_set_def] "(f : lift_set i A) = (f i : A)"; |
|
15 |
by Auto_tac; |
|
16 |
qed "lift_set_iff"; |
|
17 |
AddIffs [lift_set_iff]; |
|
18 |
||
| 7525 | 19 |
Goalw [lift_set_def] "lift_set i A Int lift_set i B = lift_set i (A Int B)"; |
20 |
by Auto_tac; |
|
21 |
qed "Int_lift_set"; |
|
22 |
||
23 |
Goalw [lift_set_def] "lift_set i A Un lift_set i B = lift_set i (A Un B)"; |
|
| 7186 | 24 |
by Auto_tac; |
| 7525 | 25 |
qed "Un_lift_set"; |
26 |
||
27 |
Goalw [lift_set_def] "lift_set i A - lift_set i B = lift_set i (A-B)"; |
|
28 |
by Auto_tac; |
|
29 |
qed "Diff_lift_set"; |
|
30 |
||
31 |
Addsimps [Int_lift_set, Un_lift_set, Diff_lift_set]; |
|
| 7186 | 32 |
|
33 |
(** lift_act and drop_act **) |
|
34 |
||
| 7688 | 35 |
(*For compatibility with the original definition and perhaps simpler proofs*) |
36 |
Goalw [lift_act_def] |
|
37 |
"((f,f') : lift_act i act) = (EX s'. f' = f(i := s') & (f i, s') : act)"; |
|
38 |
by Auto_tac; |
|
39 |
by (rtac exI 1); |
|
40 |
by Auto_tac; |
|
41 |
qed "lift_act_eq"; |
|
42 |
AddIffs [lift_act_eq]; |
|
43 |
||
| 7186 | 44 |
(** lift_prog and drop_prog **) |
45 |
||
46 |
Goalw [lift_prog_def] "Init (lift_prog i F) = lift_set i (Init F)"; |
|
47 |
by Auto_tac; |
|
48 |
qed "Init_lift_prog"; |
|
49 |
Addsimps [Init_lift_prog]; |
|
50 |
||
51 |
Goalw [lift_prog_def] "Acts (lift_prog i F) = lift_act i `` Acts F"; |
|
| 8041 | 52 |
by (auto_tac (claset() addIs [rev_image_eqI], simpset())); |
| 7186 | 53 |
qed "Acts_lift_prog"; |
54 |
Addsimps [Acts_lift_prog]; |
|
55 |
||
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
56 |
Goalw [drop_prog_def] "Init (drop_prog i C F) = drop_set i (Init F)"; |
| 7186 | 57 |
by Auto_tac; |
58 |
qed "Init_drop_prog"; |
|
59 |
Addsimps [Init_drop_prog]; |
|
60 |
||
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
61 |
Goal "Acts (drop_prog i C F) = insert Id (drop_act i `` Restrict C `` Acts F)"; |
| 8041 | 62 |
by (auto_tac (claset() addIs [image_eqI], |
| 7688 | 63 |
simpset() addsimps [drop_prog_def])); |
| 7186 | 64 |
qed "Acts_drop_prog"; |
65 |
Addsimps [Acts_drop_prog]; |
|
66 |
||
| 7688 | 67 |
|
68 |
(*** sub ***) |
|
69 |
||
| 7947 | 70 |
Goal "sub i f = f i"; |
71 |
by (simp_tac (simpset() addsimps [sub_def]) 1); |
|
72 |
qed "sub_apply"; |
|
73 |
Addsimps [sub_apply]; |
|
| 7688 | 74 |
|
75 |
Goal "lift_set i {s. P s} = {s. P (sub i s)}";
|
|
76 |
by (asm_simp_tac (simpset() addsimps [lift_set_def]) 1); |
|
77 |
qed "lift_set_sub"; |
|
|
7343
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
78 |
|
| 7688 | 79 |
Goal "{s. P (s i)} = lift_set i {s. P s}";
|
80 |
by (asm_simp_tac (simpset() addsimps [lift_set_def]) 1); |
|
81 |
qed "Collect_eq_lift_set"; |
|
| 7186 | 82 |
|
| 7688 | 83 |
Goal "sub i -`` A = lift_set i A"; |
84 |
by (Force_tac 1); |
|
85 |
qed "sub_vimage"; |
|
86 |
Addsimps [sub_vimage]; |
|
87 |
||
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
88 |
(*For tidying the result of "export"*) |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
89 |
Goal "v o (%z. z i) = v o sub i"; |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
90 |
by (simp_tac (simpset() addsimps [sub_def]) 1); |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
91 |
qed "fold_o_sub"; |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
92 |
|
| 7688 | 93 |
|
94 |
||
95 |
(*** lift_prog and the lattice operations ***) |
|
| 7186 | 96 |
|
97 |
Goal "lift_prog i SKIP = SKIP"; |
|
98 |
by (auto_tac (claset() addSIs [program_equalityI], |
|
99 |
simpset() addsimps [SKIP_def, lift_prog_def])); |
|
100 |
qed "lift_prog_SKIP"; |
|
101 |
||
102 |
Goal "lift_prog i (F Join G) = (lift_prog i F) Join (lift_prog i G)"; |
|
103 |
by (rtac program_equalityI 1); |
|
| 7537 | 104 |
by Auto_tac; |
| 7186 | 105 |
qed "lift_prog_Join"; |
106 |
||
| 7525 | 107 |
Goal "lift_prog i (JOIN J F) = (JN j:J. lift_prog i (F j))"; |
| 7186 | 108 |
by (rtac program_equalityI 1); |
| 7537 | 109 |
by Auto_tac; |
| 7186 | 110 |
qed "lift_prog_JN"; |
111 |
||
112 |
||
| 7525 | 113 |
(*** Equivalence with "extend" version ***) |
114 |
||
115 |
Goalw [lift_map_def] "good_map (lift_map i)"; |
|
116 |
by (rtac good_mapI 1); |
|
117 |
by (res_inst_tac [("f", "%f. (f i, f)")] surjI 1);
|
|
118 |
by Auto_tac; |
|
119 |
by (dres_inst_tac [("f", "%f. f i")] arg_cong 1);
|
|
120 |
by Auto_tac; |
|
121 |
qed "good_map_lift_map"; |
|
122 |
||
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
123 |
fun lift_export0 th = |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
124 |
good_map_lift_map RS export th |
| 8216 | 125 |
|> simplify (simpset() addsimps [fold_o_sub]); |
| 7525 | 126 |
|
127 |
Goal "fst (inv (lift_map i) g) = g i"; |
|
128 |
by (rtac (good_map_lift_map RS good_map_is_surj RS fst_inv_equalityI) 1); |
|
129 |
by (auto_tac (claset(), simpset() addsimps [lift_map_def])); |
|
130 |
qed "fst_inv_lift_map"; |
|
131 |
Addsimps [fst_inv_lift_map]; |
|
132 |
||
133 |
||
134 |
Goal "lift_set i A = extend_set (lift_map i) A"; |
|
135 |
by (auto_tac (claset(), |
|
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
136 |
simpset() addsimps [lift_export0 mem_extend_set_iff])); |
| 7525 | 137 |
qed "lift_set_correct"; |
138 |
||
139 |
Goalw [drop_set_def, project_set_def, lift_map_def] |
|
140 |
"drop_set i A = project_set (lift_map i) A"; |
|
141 |
by Auto_tac; |
|
142 |
by (rtac image_eqI 2); |
|
143 |
by (rtac exI 1); |
|
144 |
by (stac (refl RS fun_upd_idem) 1); |
|
145 |
by Auto_tac; |
|
146 |
qed "drop_set_correct"; |
|
147 |
||
148 |
Goal "lift_act i = extend_act (lift_map i)"; |
|
149 |
by (rtac ext 1); |
|
150 |
by Auto_tac; |
|
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
151 |
by (forward_tac [lift_export0 extend_act_D] 2); |
| 7688 | 152 |
by (auto_tac (claset(), simpset() addsimps [extend_act_def])); |
| 7525 | 153 |
by (auto_tac (claset(), simpset() addsimps [extend_act_def, lift_map_def])); |
154 |
by (rtac bexI 1); |
|
155 |
by (auto_tac (claset() addSIs [exI], simpset())); |
|
156 |
qed "lift_act_correct"; |
|
157 |
||
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7840
diff
changeset
|
158 |
Goal "drop_act i = project_act (lift_map i)"; |
| 7525 | 159 |
by (rtac ext 1); |
160 |
by (rewrite_goals_tac [project_act_def, drop_act_def, lift_map_def]); |
|
161 |
by Auto_tac; |
|
| 7688 | 162 |
by (REPEAT_FIRST (ares_tac [exI, conjI])); |
| 7525 | 163 |
by Auto_tac; |
| 7688 | 164 |
by (REPEAT_FIRST (assume_tac ORELSE' stac (refl RS fun_upd_idem))); |
| 7525 | 165 |
qed "drop_act_correct"; |
166 |
||
| 7688 | 167 |
Goal "lift_prog i = extend (lift_map i)"; |
168 |
by (rtac (program_equalityI RS ext) 1); |
|
| 7525 | 169 |
by (simp_tac (simpset() addsimps [lift_set_correct]) 1); |
170 |
by (simp_tac (simpset() |
|
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
171 |
addsimps [lift_export0 Acts_extend, |
| 7525 | 172 |
lift_act_correct]) 1); |
173 |
qed "lift_prog_correct"; |
|
174 |
||
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
175 |
Goal "drop_prog i C = project (lift_map i) C"; |
| 7688 | 176 |
by (rtac (program_equalityI RS ext) 1); |
| 7525 | 177 |
by (simp_tac (simpset() addsimps [drop_set_correct]) 1); |
178 |
by (simp_tac (simpset() |
|
|
7547
a72a551b6d79
new proof of drop_prog_correct for new definition of project_act
paulson
parents:
7537
diff
changeset
|
179 |
addsimps [Acts_project, drop_act_correct]) 1); |
| 7525 | 180 |
qed "drop_prog_correct"; |
181 |
||
182 |
||
| 7688 | 183 |
(** Injectivity of lift_set, lift_act, lift_prog **) |
184 |
||
185 |
Goalw [lift_set_def, drop_set_def] "drop_set i (lift_set i F) = F"; |
|
186 |
by Auto_tac; |
|
187 |
qed "lift_set_inverse"; |
|
188 |
Addsimps [lift_set_inverse]; |
|
189 |
||
190 |
Goal "inj (lift_set i)"; |
|
191 |
by (rtac inj_on_inverseI 1); |
|
192 |
by (rtac lift_set_inverse 1); |
|
193 |
qed "inj_lift_set"; |
|
194 |
||
195 |
(*Because A and B could differ outside i, cannot generalize result to |
|
196 |
drop_set i (A Int B) = drop_set i A Int drop_set i B |
|
197 |
*) |
|
198 |
Goalw [lift_set_def, drop_set_def] |
|
199 |
"drop_set i ((lift_set i A) Int B) = A Int (drop_set i B)"; |
|
200 |
by Auto_tac; |
|
201 |
qed "drop_set_Int_lift_set"; |
|
202 |
||
203 |
Goalw [lift_set_def, drop_set_def] |
|
204 |
"drop_set i (B Int (lift_set i A)) = (drop_set i B) Int A"; |
|
205 |
by Auto_tac; |
|
206 |
qed "drop_set_Int_lift_set2"; |
|
207 |
||
208 |
Goalw [drop_set_def] |
|
209 |
"i : I ==> drop_set i (INT j:I. lift_set j A) = A"; |
|
210 |
by Auto_tac; |
|
211 |
qed "drop_set_INT"; |
|
212 |
||
213 |
Goal "lift_set i UNIV = UNIV"; |
|
| 8128 | 214 |
by (simp_tac (simpset() addsimps [lift_set_correct, |
215 |
lift_export0 extend_set_UNIV_eq]) 1); |
|
| 7688 | 216 |
qed "lift_set_UNIV_eq"; |
217 |
Addsimps [lift_set_UNIV_eq]; |
|
218 |
||
219 |
Goal "inj (lift_prog i)"; |
|
220 |
by (simp_tac |
|
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
221 |
(simpset() addsimps [lift_prog_correct, lift_export0 inj_extend]) 1); |
| 7688 | 222 |
qed "inj_lift_prog"; |
223 |
||
224 |
||
| 7525 | 225 |
(*** More Lemmas ***) |
226 |
||
227 |
Goal "lift_act i act ^^ lift_set i A = lift_set i (act^^A)"; |
|
228 |
by (asm_simp_tac (simpset() addsimps [lift_set_correct, lift_act_correct, |
|
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
229 |
lift_export0 extend_act_Image]) 1); |
| 7525 | 230 |
qed "lift_act_Image"; |
231 |
Addsimps [lift_act_Image]; |
|
232 |
||
233 |
||
234 |
||
| 7186 | 235 |
(*** Safety: co, stable, invariant ***) |
236 |
||
237 |
(** Safety and lift_prog **) |
|
238 |
||
239 |
Goal "(lift_prog i F : (lift_set i A) co (lift_set i B)) = \ |
|
240 |
\ (F : A co B)"; |
|
241 |
by (auto_tac (claset(), |
|
242 |
simpset() addsimps [constrains_def])); |
|
243 |
by (Force_tac 1); |
|
|
7343
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
244 |
qed "lift_prog_constrains"; |
| 7186 | 245 |
|
246 |
Goal "(lift_prog i F : stable (lift_set i A)) = (F : stable A)"; |
|
|
7343
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
247 |
by (simp_tac (simpset() addsimps [stable_def, lift_prog_constrains]) 1); |
|
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
248 |
qed "lift_prog_stable"; |
| 7186 | 249 |
|
250 |
Goal "(lift_prog i F : invariant (lift_set i A)) = (F : invariant A)"; |
|
251 |
by (auto_tac (claset(), |
|
|
7343
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
252 |
simpset() addsimps [invariant_def, lift_prog_stable])); |
|
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
253 |
qed "lift_prog_invariant"; |
| 7186 | 254 |
|
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7688
diff
changeset
|
255 |
Goal "[| lift_prog i F : A co B |] \ |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7688
diff
changeset
|
256 |
\ ==> F : (drop_set i A) co (drop_set i B)"; |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7688
diff
changeset
|
257 |
by (asm_full_simp_tac |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7688
diff
changeset
|
258 |
(simpset() addsimps [drop_set_correct, lift_prog_correct, |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
259 |
lift_export0 extend_constrains_project_set]) 1); |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7688
diff
changeset
|
260 |
qed "lift_prog_constrains_drop_set"; |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7688
diff
changeset
|
261 |
|
| 7186 | 262 |
(*This one looks strange! Proof probably is by case analysis on i=j. |
263 |
If i~=j then lift_prog j (F j) does nothing to lift_set i, and the |
|
264 |
premise ensures A<=B.*) |
|
265 |
Goal "F i : A co B \ |
|
266 |
\ ==> lift_prog j (F j) : (lift_set i A) co (lift_set i B)"; |
|
267 |
by (auto_tac (claset(), |
|
268 |
simpset() addsimps [constrains_def])); |
|
269 |
by (REPEAT (Blast_tac 1)); |
|
270 |
qed "constrains_imp_lift_prog_constrains"; |
|
271 |
||
272 |
||
273 |
(** Safety and drop_prog **) |
|
274 |
||
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
275 |
Goal "(drop_prog i C F : A co B) = \ |
| 7688 | 276 |
\ (F : (C Int lift_set i A) co (lift_set i B) & A <= B)"; |
277 |
by (simp_tac |
|
| 8128 | 278 |
(simpset() addsimps [drop_prog_correct, lift_set_correct, |
279 |
lift_export0 project_constrains]) 1); |
|
|
7343
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
280 |
qed "drop_prog_constrains"; |
| 7186 | 281 |
|
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
282 |
Goal "(drop_prog i UNIV F : stable A) = (F : stable (lift_set i A))"; |
|
7343
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
283 |
by (simp_tac (simpset() addsimps [stable_def, drop_prog_constrains]) 1); |
|
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
284 |
qed "drop_prog_stable"; |
| 7186 | 285 |
|
286 |
||
|
7343
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
287 |
(*** Weak safety primitives: Co, Stable ***) |
| 7186 | 288 |
|
289 |
(** Reachability **) |
|
290 |
||
291 |
Goal "reachable (lift_prog i F) = lift_set i (reachable F)"; |
|
| 7688 | 292 |
by (simp_tac |
293 |
(simpset() addsimps [lift_prog_correct, lift_set_correct, |
|
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
294 |
lift_export0 reachable_extend_eq]) 1); |
| 7186 | 295 |
qed "reachable_lift_prog"; |
296 |
||
297 |
Goal "(lift_prog i F : (lift_set i A) Co (lift_set i B)) = \ |
|
298 |
\ (F : A Co B)"; |
|
| 7947 | 299 |
by (simp_tac |
300 |
(simpset() addsimps [lift_prog_correct, lift_set_correct, |
|
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
301 |
lift_export0 extend_Constrains]) 1); |
|
7343
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
302 |
qed "lift_prog_Constrains"; |
| 7186 | 303 |
|
304 |
Goal "(lift_prog i F : Stable (lift_set i A)) = (F : Stable A)"; |
|
|
7343
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
305 |
by (simp_tac (simpset() addsimps [Stable_def, lift_prog_Constrains]) 1); |
|
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
306 |
qed "lift_prog_Stable"; |
| 7186 | 307 |
|
| 8128 | 308 |
Goal "F Join drop_prog i (reachable (lift_prog i F Join G)) G : A Co B \ |
| 7688 | 309 |
\ ==> lift_prog i F Join G : (lift_set i A) Co (lift_set i B)"; |
310 |
by (asm_full_simp_tac |
|
311 |
(simpset() addsimps [lift_prog_correct, drop_prog_correct, |
|
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
312 |
lift_set_correct, lift_export0 project_Constrains_D]) 1); |
| 7186 | 313 |
qed "drop_prog_Constrains_D"; |
314 |
||
315 |
Goalw [Stable_def] |
|
| 8128 | 316 |
"F Join drop_prog i (reachable (lift_prog i F Join G)) G : Stable A \ |
| 7688 | 317 |
\ ==> lift_prog i F Join G : Stable (lift_set i A)"; |
| 7186 | 318 |
by (asm_simp_tac (simpset() addsimps [drop_prog_Constrains_D]) 1); |
319 |
qed "drop_prog_Stable_D"; |
|
320 |
||
| 8128 | 321 |
Goal "F Join drop_prog i (reachable (lift_prog i F Join G)) G : Always A \ |
| 7688 | 322 |
\ ==> lift_prog i F Join G : Always (lift_set i A)"; |
323 |
by (asm_full_simp_tac |
|
324 |
(simpset() addsimps [lift_prog_correct, drop_prog_correct, |
|
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
325 |
lift_set_correct, lift_export0 project_Always_D]) 1); |
| 7688 | 326 |
qed "drop_prog_Always_D"; |
| 7186 | 327 |
|
| 7688 | 328 |
Goalw [Increasing_def] |
| 8128 | 329 |
"F Join drop_prog i (reachable (lift_prog i F Join G)) G : Increasing func \ |
330 |
\ ==> lift_prog i F Join G : Increasing (func o (sub i))"; |
|
| 7186 | 331 |
by Auto_tac; |
| 7688 | 332 |
by (stac Collect_eq_lift_set 1); |
333 |
by (asm_simp_tac (simpset() addsimps [drop_prog_Stable_D]) 1); |
|
334 |
qed "project_Increasing_D"; |
|
| 7186 | 335 |
|
| 7361 | 336 |
|
| 7525 | 337 |
(*** Progress: transient, ensures ***) |
338 |
||
339 |
Goal "(lift_prog i F : transient (lift_set i A)) = (F : transient A)"; |
|
340 |
by (simp_tac (simpset() addsimps [lift_set_correct, lift_prog_correct, |
|
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
341 |
lift_export0 extend_transient]) 1); |
| 7525 | 342 |
qed "lift_prog_transient"; |
343 |
||
344 |
Goal "(lift_prog i F : transient (lift_set j A)) = \ |
|
345 |
\ (i=j & F : transient A | A={})";
|
|
346 |
by (case_tac "i=j" 1); |
|
347 |
by (auto_tac (claset(), simpset() addsimps [lift_prog_transient])); |
|
348 |
by (auto_tac (claset(), simpset() addsimps [lift_prog_def, transient_def])); |
|
349 |
by (Force_tac 1); |
|
350 |
qed "lift_prog_transient_eq_disj"; |
|
351 |
||
352 |
||
| 7186 | 353 |
(*** guarantees properties ***) |
354 |
||
|
8065
658e0d4e4ed9
first working version to Alloc/System_Client_Progress;
paulson
parents:
8055
diff
changeset
|
355 |
Goal "lift_prog i F : preserves (v o sub j) = \ |
|
658e0d4e4ed9
first working version to Alloc/System_Client_Progress;
paulson
parents:
8055
diff
changeset
|
356 |
\ (if i=j then F : preserves v else True)"; |
|
658e0d4e4ed9
first working version to Alloc/System_Client_Progress;
paulson
parents:
8055
diff
changeset
|
357 |
by (simp_tac (simpset() addsimps [lift_prog_correct, |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
358 |
lift_export0 extend_preserves]) 1); |
|
8065
658e0d4e4ed9
first working version to Alloc/System_Client_Progress;
paulson
parents:
8055
diff
changeset
|
359 |
by (auto_tac (claset(), |
|
658e0d4e4ed9
first working version to Alloc/System_Client_Progress;
paulson
parents:
8055
diff
changeset
|
360 |
simpset() addsimps [preserves_def, extend_def, extend_act_def, |
|
658e0d4e4ed9
first working version to Alloc/System_Client_Progress;
paulson
parents:
8055
diff
changeset
|
361 |
stable_def, constrains_def, lift_map_def])); |
|
658e0d4e4ed9
first working version to Alloc/System_Client_Progress;
paulson
parents:
8055
diff
changeset
|
362 |
qed "lift_prog_preserves_sub"; |
|
658e0d4e4ed9
first working version to Alloc/System_Client_Progress;
paulson
parents:
8055
diff
changeset
|
363 |
|
|
658e0d4e4ed9
first working version to Alloc/System_Client_Progress;
paulson
parents:
8055
diff
changeset
|
364 |
Addsimps [lift_prog_preserves_sub]; |
|
658e0d4e4ed9
first working version to Alloc/System_Client_Progress;
paulson
parents:
8055
diff
changeset
|
365 |
|
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
366 |
Goal "G : preserves (v o sub i) ==> drop_prog i C G : preserves v"; |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
367 |
by (asm_simp_tac |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
368 |
(simpset() addsimps [drop_prog_correct, fold_o_sub, |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
369 |
lift_export0 project_preserves_I]) 1); |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
370 |
qed "drop_prog_preserves_I"; |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
371 |
|
| 8041 | 372 |
(*The raw version*) |
373 |
val [xguary,drop_prog,lift_prog] = |
|
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
374 |
Goal "[| F : X guarantees[v] Y; \ |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
375 |
\ !!G. lift_prog i F Join G : X' ==> F Join drop_prog i (C G) G : X; \ |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
376 |
\ !!G. [| F Join drop_prog i (C G) G : Y; lift_prog i F Join G : X'; \ |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
377 |
\ G : preserves (v o sub i) |] \ |
| 8041 | 378 |
\ ==> lift_prog i F Join G : Y' |] \ |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
379 |
\ ==> lift_prog i F : X' guarantees[v o sub i] Y'"; |
| 8041 | 380 |
by (rtac (xguary RS guaranteesD RS lift_prog RS guaranteesI) 1); |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
381 |
by (etac drop_prog_preserves_I 1); |
| 8041 | 382 |
by (etac drop_prog 1); |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
383 |
by Auto_tac; |
| 8041 | 384 |
qed "drop_prog_guarantees_raw"; |
385 |
||
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
386 |
Goal "[| F : X guarantees[v] Y; \ |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
387 |
\ projecting C (lift_map i) F X' X; \ |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
388 |
\ extending w C (lift_map i) F Y' Y; \ |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
389 |
\ preserves w <= preserves (v o sub i) |] \ |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
390 |
\ ==> lift_prog i F : X' guarantees[w] Y'"; |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
391 |
by (asm_simp_tac |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
392 |
(simpset() addsimps [lift_prog_correct, fold_o_sub, |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
393 |
lift_export0 project_guarantees]) 1); |
| 7186 | 394 |
qed "drop_prog_guarantees"; |
395 |
||
396 |
||
397 |
(** Are these two useful?? **) |
|
398 |
||
399 |
(*The other direction fails: having FF : Stable {s. z <= f (s i)} does not
|
|
400 |
ensure that F has the form lift_prog i F for some F.*) |
|
401 |
Goal "lift_prog i `` Stable {s. P (f s)} <= Stable {s. P (f (s i))}";
|
|
402 |
by Auto_tac; |
|
403 |
by (stac Collect_eq_lift_set 1); |
|
|
7343
4fa705cedbdb
renamed some theorems; also better natural deduction style for old ones
paulson
parents:
7186
diff
changeset
|
404 |
by (asm_simp_tac (simpset() addsimps [lift_prog_Stable]) 1); |
| 7186 | 405 |
qed "image_lift_prog_Stable"; |
406 |
||
407 |
Goal "lift_prog i `` Increasing f <= Increasing (f o sub i)"; |
|
408 |
by (simp_tac (simpset() addsimps [Increasing_def, |
|
409 |
inj_lift_prog RS image_INT]) 1); |
|
410 |
by (blast_tac (claset() addIs [impOfSubs image_lift_prog_Stable]) 1); |
|
411 |
qed "image_lift_prog_Increasing"; |
|
412 |
||
413 |
||
414 |
(*** guarantees corollaries ***) |
|
415 |
||
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
416 |
Goal "F : UNIV guarantees[v] increasing func \ |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
417 |
\ ==> lift_prog i F : UNIV guarantees[v o sub i] increasing (func o sub i)"; |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
418 |
by (dtac (lift_export0 extend_guar_increasing) 1); |
| 7688 | 419 |
by (asm_full_simp_tac (simpset() addsimps [lift_prog_correct, o_def]) 1); |
| 7186 | 420 |
qed "lift_prog_guar_increasing"; |
421 |
||
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
422 |
Goal "F : UNIV guarantees[v] Increasing func \ |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
423 |
\ ==> lift_prog i F : UNIV guarantees[v o sub i] Increasing (func o sub i)"; |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
424 |
by (dtac (lift_export0 extend_guar_Increasing) 1); |
| 7688 | 425 |
by (asm_full_simp_tac (simpset() addsimps [lift_prog_correct, o_def]) 1); |
| 7186 | 426 |
qed "lift_prog_guar_Increasing"; |
427 |
||
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
428 |
Goal "F : Always A guarantees[v] Always B \ |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
429 |
\ ==> lift_prog i F : \ |
|
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
430 |
\ Always(lift_set i A) guarantees[v o sub i] Always (lift_set i B)"; |
| 7688 | 431 |
by (asm_simp_tac |
432 |
(simpset() addsimps [lift_set_correct, lift_prog_correct, |
|
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
433 |
lift_export0 extend_guar_Always]) 1); |
| 7688 | 434 |
qed "lift_prog_guar_Always"; |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
435 |
|
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
436 |
(*version for outside use*) |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
437 |
fun lift_export th = |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
438 |
good_map_lift_map RS export th |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
439 |
|> simplify |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
440 |
(simpset() addsimps [fold_o_sub, |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
441 |
drop_set_correct RS sym, |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
442 |
lift_set_correct RS sym, |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
443 |
drop_prog_correct RS sym, |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
444 |
lift_prog_correct RS sym]);; |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8065
diff
changeset
|
445 |