1 (* Title: HOL/UNITY/Lift_prog.ML |
1 (* Title: HOL/UNITY/Lift_prog.ML |
2 ID: $Id$ |
2 ID: $Id$ |
3 Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
3 Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
4 Copyright 1998 University of Cambridge |
4 Copyright 1998 University of Cambridge |
5 |
5 |
6 THESE PROOFS CAN BE REPLACED BY INVOCATIONS OF RESULTS FROM EXTEND.ML |
6 Arrays of processes. Many results are instances of those in Extend & Project. |
7 *) |
7 *) |
8 |
8 |
9 |
|
10 val image_eqI' = read_instantiate_sg (sign_of thy) |
|
11 [("x", "?ff(i := ?u)")] image_eqI; |
|
12 |
9 |
13 (*** Basic properties ***) |
10 (*** Basic properties ***) |
14 |
11 |
15 (** lift_set and drop_set **) |
12 (** lift_set and drop_set **) |
16 |
13 |
280 |
277 |
281 Goal "(lift_prog i F : invariant (lift_set i A)) = (F : invariant A)"; |
278 Goal "(lift_prog i F : invariant (lift_set i A)) = (F : invariant A)"; |
282 by (auto_tac (claset(), |
279 by (auto_tac (claset(), |
283 simpset() addsimps [invariant_def, lift_prog_stable])); |
280 simpset() addsimps [invariant_def, lift_prog_stable])); |
284 qed "lift_prog_invariant"; |
281 qed "lift_prog_invariant"; |
|
282 |
|
283 Goal "[| lift_prog i F : A co B |] \ |
|
284 \ ==> F : (drop_set i A) co (drop_set i B)"; |
|
285 by (asm_full_simp_tac |
|
286 (simpset() addsimps [drop_set_correct, lift_prog_correct, |
|
287 lift_export extend_constrains_project_set]) 1); |
|
288 qed "lift_prog_constrains_drop_set"; |
285 |
289 |
286 (*This one looks strange! Proof probably is by case analysis on i=j. |
290 (*This one looks strange! Proof probably is by case analysis on i=j. |
287 If i~=j then lift_prog j (F j) does nothing to lift_set i, and the |
291 If i~=j then lift_prog j (F j) does nothing to lift_set i, and the |
288 premise ensures A<=B.*) |
292 premise ensures A<=B.*) |
289 Goal "F i : A co B \ |
293 Goal "F i : A co B \ |
314 \ Diff G (lift_act i `` acts) : (lift_set i A) co (lift_set i B) |] \ |
318 \ Diff G (lift_act i `` acts) : (lift_set i A) co (lift_set i B) |] \ |
315 \ ==> Diff (drop_prog C i G) acts : A co B"; |
319 \ ==> Diff (drop_prog C i G) acts : A co B"; |
316 by (asm_full_simp_tac |
320 by (asm_full_simp_tac |
317 (simpset() addsimps [drop_set_correct, drop_prog_correct, |
321 (simpset() addsimps [drop_set_correct, drop_prog_correct, |
318 lift_set_correct, lift_act_correct, |
322 lift_set_correct, lift_act_correct, |
319 lift_export Diff_project_co]) 1); |
323 lift_export Diff_project_constrains]) 1); |
320 qed "Diff_drop_prog_co"; |
324 qed "Diff_drop_prog_constrains"; |
321 |
325 |
322 Goalw [stable_def] |
326 Goalw [stable_def] |
323 "[| (UN act:acts. Domain act) <= drop_set i C; \ |
327 "[| (UN act:acts. Domain act) <= drop_set i C; \ |
324 \ Diff G (lift_act i `` acts) : stable (lift_set i A) |] \ |
328 \ Diff G (lift_act i `` acts) : stable (lift_set i A) |] \ |
325 \ ==> Diff (drop_prog C i G) acts : stable A"; |
329 \ ==> Diff (drop_prog C i G) acts : stable A"; |
326 by (etac Diff_drop_prog_co 1); |
330 by (etac Diff_drop_prog_constrains 1); |
327 by (assume_tac 1); |
331 by (assume_tac 1); |
328 qed "Diff_drop_prog_stable"; |
332 qed "Diff_drop_prog_stable"; |
329 |
333 |
330 Goalw [constrains_def, Diff_def] |
334 Goalw [constrains_def, Diff_def] |
331 "Diff G acts : A co B \ |
335 "Diff G acts : A co B \ |
485 \ ==> lift_prog i F : Always(lift_set i A) guarantees Always (lift_set i B)"; |
489 \ ==> lift_prog i F : Always(lift_set i A) guarantees Always (lift_set i B)"; |
486 by (asm_simp_tac |
490 by (asm_simp_tac |
487 (simpset() addsimps [lift_set_correct, lift_prog_correct, |
491 (simpset() addsimps [lift_set_correct, lift_prog_correct, |
488 lift_export extend_guar_Always]) 1); |
492 lift_export extend_guar_Always]) 1); |
489 qed "lift_prog_guar_Always"; |
493 qed "lift_prog_guar_Always"; |
490 |
|
491 (*No analogue of this in Extend.ML!*) |
|
492 Goal "[| lift_prog i F : A co B |] \ |
|
493 \ ==> F : (drop_set i A) co (drop_set i B)"; |
|
494 by (auto_tac (claset(), |
|
495 simpset() addsimps [constrains_def, drop_set_def])); |
|
496 by (force_tac (claset() addSIs [image_eqI'], simpset()) 1); |
|
497 qed "lift_prog_constrains_drop_set"; |
|