229 (*** Diff, needed for localTo ***) |
229 (*** Diff, needed for localTo ***) |
230 |
230 |
231 (*Opposite direction fails because Diff in the extended state may remove |
231 (*Opposite direction fails because Diff in the extended state may remove |
232 fewer actions, i.e. those that affect other state variables.*) |
232 fewer actions, i.e. those that affect other state variables.*) |
233 |
233 |
234 Goal "Diff (project C h G) (project_act C h `` acts) <= \ |
234 Goalw [project_set_def, project_act_def] |
235 \ project C h (Diff G acts)"; |
235 "Restrict (project_set h C) (project_act h (Restrict C act)) = \ |
236 by (auto_tac (claset(), simpset() addsimps [component_eq_subset, Diff_def, |
236 \ project_act h (Restrict C act)"; |
237 UN_subset_iff])); |
237 by (Blast_tac 1); |
|
238 qed "Restrict_project_act"; |
|
239 |
|
240 Goalw [project_set_def, project_act_def] |
|
241 "project_act h (Restrict C Id) = Restrict (project_set h C) Id"; |
|
242 by (Blast_tac 1); |
|
243 qed "project_act_Restrict_Id"; |
|
244 |
|
245 Goal |
|
246 "Diff(project_set h C)(project C h G)(project_act h `` Restrict C `` acts) \ |
|
247 \ <= project C h (Diff C G acts)"; |
|
248 by (simp_tac |
|
249 (simpset() addsimps [component_eq_subset, Diff_def, |
|
250 Restrict_project_act, project_act_Restrict_Id, |
|
251 image_image_eq_UN, image_UN, Restrict_image_Diff]) 1); |
|
252 by (Force_tac 1); |
238 qed "Diff_project_project_component_project_Diff"; |
253 qed "Diff_project_project_component_project_Diff"; |
239 |
254 |
240 Goal "(UN act:acts. Domain act) <= project_set h C \ |
255 Goal "Diff (project_set h C) (project C h G) acts <= \ |
241 \ ==> Diff (project C h G) acts <= \ |
256 \ project C h (Diff C G (extend_act h `` acts))"; |
242 \ project C h (Diff G (extend_act h `` acts))"; |
257 by (rtac component_trans 1); |
243 by (asm_full_simp_tac (simpset() addsimps [component_eq_subset, Diff_def, |
258 by (rtac Diff_project_project_component_project_Diff 2); |
244 UN_subset_iff]) 1); |
259 by (simp_tac |
245 by (force_tac (claset() addSIs [image_diff_subset RS subsetD], |
260 (simpset() addsimps [component_eq_subset, Diff_def, |
246 simpset() addsimps [image_image_eq_UN]) 1); |
261 Restrict_project_act, project_act_Restrict_Id, |
|
262 image_image_eq_UN, image_UN, Restrict_image_Diff]) 1); |
|
263 by (Blast_tac 1); |
247 qed "Diff_project_component_project_Diff"; |
264 qed "Diff_project_component_project_Diff"; |
248 |
265 |
249 Goal |
266 Goal "Diff C G (extend_act h `` acts) : (extend_set h A) co (extend_set h B) \ |
250 "[| (UN act:acts. Domain act) <= project_set h C; \ |
267 \ ==> Diff (project_set h C) (project C h G) acts : A co B"; |
251 \ Diff G (extend_act h `` acts) : (extend_set h A) co (extend_set h B) |]\ |
268 by (rtac (Diff_project_component_project_Diff RS component_constrains) 1); |
252 \ ==> Diff (project C h G) acts : A co B"; |
|
253 by (etac (Diff_project_component_project_Diff RS component_constrains) 1); |
|
254 by (rtac (project_constrains RS iffD2) 1); |
269 by (rtac (project_constrains RS iffD2) 1); |
255 by (ftac constrains_imp_subset 1); |
270 by (ftac constrains_imp_subset 1); |
256 by (Asm_full_simp_tac 1); |
|
257 by (blast_tac (claset() addIs [constrains_weaken]) 1); |
271 by (blast_tac (claset() addIs [constrains_weaken]) 1); |
258 qed "Diff_project_constrains"; |
272 qed "Diff_project_constrains"; |
259 |
273 |
260 Goalw [stable_def] |
274 Goalw [stable_def] |
261 "[| (UN act:acts. Domain act) <= project_set h C; \ |
275 "Diff C G (extend_act h `` acts) : stable (extend_set h A) \ |
262 \ Diff G (extend_act h `` acts) : stable (extend_set h A) |] \ |
276 \ ==> Diff (project_set h C) (project C h G) acts : stable A"; |
263 \ ==> Diff (project C h G) acts : stable A"; |
|
264 by (etac Diff_project_constrains 1); |
277 by (etac Diff_project_constrains 1); |
265 by (assume_tac 1); |
|
266 qed "Diff_project_stable"; |
278 qed "Diff_project_stable"; |
|
279 |
|
280 (** Some results for Diff, extend and project_set **) |
|
281 |
|
282 Goal "Diff C (extend h G) (extend_act h `` acts) \ |
|
283 \ : (extend_set h A) co (extend_set h B) \ |
|
284 \ ==> Diff (project_set h C) G acts : A co B"; |
|
285 br (Diff_project_set_component RS component_constrains) 1; |
|
286 by (forward_tac [constrains_imp_subset] 1); |
|
287 by (asm_full_simp_tac |
|
288 (simpset() addsimps [project_constrains, extend_set_strict_mono]) 1); |
|
289 by (blast_tac (claset() addIs [constrains_weaken]) 1); |
|
290 qed "Diff_project_set_constrains_I"; |
|
291 |
|
292 Goalw [stable_def] |
|
293 "Diff C (extend h G) (extend_act h `` acts) : stable (extend_set h A) \ |
|
294 \ ==> Diff (project_set h C) G acts : stable A"; |
|
295 by (asm_simp_tac (simpset() addsimps [Diff_project_set_constrains_I]) 1); |
|
296 qed "Diff_project_set_stable_I"; |
|
297 |
|
298 Goalw [LOCALTO_def] |
|
299 "extend h F : (v o f) localTo[C] extend h H \ |
|
300 \ ==> F : v localTo[project_set h C] H"; |
|
301 by Auto_tac; |
|
302 br Diff_project_set_stable_I 1; |
|
303 by (asm_simp_tac (simpset() addsimps [Collect_eq_extend_set RS sym]) 1); |
|
304 qed "localTo_project_set_I"; |
267 |
305 |
268 (*Converse fails: even if the conclusion holds, H could modify (v o f) |
306 (*Converse fails: even if the conclusion holds, H could modify (v o f) |
269 simultaneously with other variables, and this action would not be |
307 simultaneously with other variables, and this action would not be |
270 superseded by anything in (extend h G) *) |
308 superseded by anything in (extend h G) *) |
271 Goal "[| UNIV <= project_set h C; H : (func o f) localTo extend h G |] \ |
309 Goal "H : (v o f) localTo[C] extend h G \ |
272 \ ==> project C h H : func localTo G"; |
310 \ ==> project C h H : v localTo[project_set h C] G"; |
273 by (asm_full_simp_tac |
311 by (asm_full_simp_tac |
274 (simpset() addsimps [localTo_def, |
312 (simpset() addsimps [LOCALTO_def, |
275 project_extend_Join RS sym, |
313 project_extend_Join RS sym, |
276 subset_UNIV RS subset_trans RS Diff_project_stable, |
314 Diff_project_stable, |
277 Collect_eq_extend_set RS sym]) 1); |
315 Collect_eq_extend_set RS sym]) 1); |
278 qed "project_localTo_lemma"; |
316 qed "project_localTo_lemma"; |
279 |
317 |
280 Goal "extend h F Join G : (v o f) localTo extend h H \ |
318 Goal "extend h F Join G : (v o f) localTo[C] extend h H \ |
281 \ ==> F Join project UNIV h G : v localTo H"; |
319 \ ==> F Join project C h G : v localTo[project_set h C] H"; |
282 by (stac (project_set_UNIV RS project_extend_Join RS sym) 1); |
320 by (asm_full_simp_tac |
283 by (asm_simp_tac |
321 (simpset() addsimps [Join_localTo, localTo_project_set_I, |
284 (simpset() addsimps [project_set_UNIV RS project_localTo_lemma]) 1); |
322 project_localTo_lemma]) 1); |
|
323 qed "gen_project_localTo_I"; |
|
324 |
|
325 Goal "extend h F Join G : (v o f) localTo[UNIV] extend h H \ |
|
326 \ ==> F Join project UNIV h G : v localTo[UNIV] H"; |
|
327 bd gen_project_localTo_I 1; |
|
328 by (Asm_full_simp_tac 1); |
285 qed "project_localTo_I"; |
329 qed "project_localTo_I"; |
286 |
330 |
287 Goalw [projecting_def] |
331 Goalw [projecting_def] |
288 "projecting (%G. UNIV) h F ((v o f) localTo extend h H) (v localTo H)"; |
332 "projecting (%G. UNIV) h F \ |
|
333 \ ((v o f) localTo[UNIV] extend h H) (v localTo[UNIV] H)"; |
289 by (blast_tac (claset() addIs [project_localTo_I]) 1); |
334 by (blast_tac (claset() addIs [project_localTo_I]) 1); |
290 qed "projecting_localTo"; |
335 qed "projecting_localTo"; |
291 |
336 |
292 |
337 |
293 (** Reachability and project **) |
338 (** Reachability and project **) |
687 by (rtac extending_Increasing 2); |
746 by (rtac extending_Increasing 2); |
688 by (rtac projecting_UNIV 1); |
747 by (rtac projecting_UNIV 1); |
689 by Auto_tac; |
748 by Auto_tac; |
690 qed "extend_guar_Increasing"; |
749 qed "extend_guar_Increasing"; |
691 |
750 |
692 Goal "F : (v localTo G) guarantees increasing func \ |
751 Goal "F : (v localTo[UNIV] G) guarantees increasing func \ |
693 \ ==> extend h F : (v o f) localTo (extend h G) \ |
752 \ ==> extend h F : (v o f) localTo[UNIV] (extend h G) \ |
694 \ guarantees increasing (func o f)"; |
753 \ guarantees increasing (func o f)"; |
695 by (etac project_guarantees 1); |
754 by (etac project_guarantees 1); |
696 by (rtac extending_increasing 2); |
755 by (rtac extending_increasing 2); |
697 by (rtac projecting_localTo 1); |
756 by (rtac projecting_localTo 1); |
698 qed "extend_localTo_guar_increasing"; |
757 qed "extend_localTo_guar_increasing"; |
699 |
758 |
700 Goal "F : (v localTo G) guarantees Increasing func \ |
759 Goal "F : (v LocalTo G) guarantees Increasing func \ |
701 \ ==> extend h F : (v o f) localTo (extend h G) \ |
760 \ ==> extend h F : (v o f) LocalTo (extend h G) \ |
702 \ guarantees Increasing (func o f)"; |
761 \ guarantees Increasing (func o f)"; |
703 by (etac project_guarantees 1); |
762 by (etac project_guarantees 1); |
704 by (rtac extending_Increasing 2); |
763 by (rtac extending_Increasing 2); |
705 by (rtac projecting_localTo 1); |
764 by (rtac projecting_LocalTo 1); |
706 by Auto_tac; |
765 by Auto_tac; |
707 qed "extend_localTo_guar_Increasing"; |
766 qed "extend_LocalTo_guar_Increasing"; |
708 |
767 |
709 Goal "F : Always A guarantees Always B \ |
768 Goal "F : Always A guarantees Always B \ |
710 \ ==> extend h F : Always(extend_set h A) guarantees Always(extend_set h B)"; |
769 \ ==> extend h F : Always(extend_set h A) guarantees Always(extend_set h B)"; |
711 by (etac project_guarantees 1); |
770 by (etac project_guarantees 1); |
712 by (rtac extending_Always 2); |
771 by (rtac extending_Always 2); |
740 by (auto_tac (claset(), |
806 by (auto_tac (claset(), |
741 simpset() addsimps [FP_def, transient_def, |
807 simpset() addsimps [FP_def, transient_def, |
742 stable_def, constrains_def])); |
808 stable_def, constrains_def])); |
743 qed "stable_sing_imp_not_transient"; |
809 qed "stable_sing_imp_not_transient"; |
744 |
810 |
745 by (auto_tac (claset(), |
|
746 simpset() addsimps [FP_def, transient_def, |
|
747 stable_def, constrains_def])); |
|
748 qed "stable_sing_imp_not_transient"; |
|
749 |
|
750 Goal "[| F Join project UNIV h G : A leadsTo B; \ |
811 Goal "[| F Join project UNIV h G : A leadsTo B; \ |
751 \ G : f localTo extend h F; \ |
812 \ G : f localTo[UNIV] extend h F; \ |
752 \ Disjoint (extend h F) G |] \ |
813 \ Disjoint UNIV (extend h F) G |] \ |
753 \ ==> extend h F Join G : (extend_set h A) leadsTo (extend_set h B)"; |
814 \ ==> extend h F Join G : (extend_set h A) leadsTo (extend_set h B)"; |
754 by (rtac project_UNIV_leadsTo_lemma 1); |
815 by (rtac project_UNIV_leadsTo_lemma 1); |
755 by (Clarify_tac 1); |
816 by (Clarify_tac 1); |
756 by (rtac transient_lemma 1); |
817 by (rtac transient_lemma 1); |
757 by (auto_tac (claset(), |
818 by (auto_tac (claset(), |
758 simpset() addsimps [localTo_imp_project_stable, |
819 simpset() addsimps [localTo_imp_project_stable, |
759 stable_sing_imp_not_transient])); |
820 stable_sing_imp_not_transient])); |
760 qed "project_leadsTo_D"; |
821 qed "project_leadsTo_D"; |
761 |
822 |
762 Goal "[| F Join project (reachable (extend h F Join G)) h G : A LeadsTo B; \ |
823 Goal "[| F Join project (reachable (extend h F Join G)) h G : A LeadsTo B; \ |
763 \ G : f localTo extend h F; \ |
824 \ G : f localTo[UNIV] extend h F; \ |
764 \ Disjoint (extend h F) G |] \ |
825 \ Disjoint UNIV (extend h F) G |] \ |
765 \ ==> extend h F Join G : (extend_set h A) LeadsTo (extend_set h B)"; |
826 \ ==> extend h F Join G : (extend_set h A) LeadsTo (extend_set h B)"; |
766 by (rtac (refl RS Join_project_LeadsTo) 1); |
827 by (rtac (refl RS Join_project_LeadsTo) 1); |
767 by (Clarify_tac 1); |
828 by (Clarify_tac 1); |
768 by (rtac transient_lemma 1); |
829 by (rtac transient_lemma 1); |
769 by (auto_tac (claset(), |
830 by (auto_tac (claset(), |
771 stable_sing_imp_not_transient])); |
832 stable_sing_imp_not_transient])); |
772 qed "project_LeadsTo_D"; |
833 qed "project_LeadsTo_D"; |
773 |
834 |
774 Goalw [extending_def] |
835 Goalw [extending_def] |
775 "extending (%G. UNIV) h F \ |
836 "extending (%G. UNIV) h F \ |
776 \ (f localTo extend h F) \ |
837 \ (f localTo[UNIV] extend h F) \ |
777 \ (extend_set h A leadsTo extend_set h B) (A leadsTo B)"; |
838 \ (extend_set h A leadsTo extend_set h B) (A leadsTo B)"; |
778 by (blast_tac (claset() addSDs [Join_localTo RS iffD1] |
839 by (blast_tac (claset() addSDs [Join_localTo RS iffD1] |
779 addIs [project_leadsTo_D]) 1); |
840 addIs [project_leadsTo_D]) 1); |
780 qed "extending_leadsTo"; |
841 qed "extending_leadsTo"; |
781 |
842 |
782 Goalw [extending_def] |
843 Goalw [extending_def] |
783 "extending (%G. reachable (extend h F Join G)) h F \ |
844 "extending (%G. reachable (extend h F Join G)) h F \ |
784 \ (f localTo extend h F) \ |
845 \ (f localTo[UNIV] extend h F) \ |
785 \ (extend_set h A LeadsTo extend_set h B) (A LeadsTo B)"; |
846 \ (extend_set h A LeadsTo extend_set h B) (A LeadsTo B)"; |
786 by (blast_tac (claset() addSDs [Join_localTo RS iffD1] |
847 by (blast_tac (claset() addSDs [Join_localTo RS iffD1] |
787 addIs [project_LeadsTo_D]) 1); |
848 addIs [project_LeadsTo_D]) 1); |
788 qed "extending_LeadsTo"; |
849 qed "extending_LeadsTo"; |
789 |
850 |
790 (*STRONG precondition and postcondition*) |
851 (*STRONG precondition and postcondition*) |
791 Goal "F : (A co A') guarantees (B leadsTo B') \ |
852 Goal "F : (A co A') guarantees (B leadsTo B') \ |
792 \ ==> extend h F : ((extend_set h A) co (extend_set h A')) \ |
853 \ ==> extend h F : ((extend_set h A) co (extend_set h A')) \ |
793 \ Int (f localTo (extend h F)) \ |
854 \ Int (f localTo[UNIV] (extend h F)) \ |
794 \ guarantees ((extend_set h B) leadsTo (extend_set h B'))"; |
855 \ guarantees ((extend_set h B) leadsTo (extend_set h B'))"; |
795 by (etac project_guarantees 1); |
856 by (etac project_guarantees 1); |
796 by (rtac (extending_leadsTo RS extending_weaken) 2); |
857 by (rtac (extending_leadsTo RS extending_weaken) 2); |
797 by (rtac (projecting_constrains RS projecting_weaken) 1); |
858 by (rtac (projecting_constrains RS projecting_weaken) 1); |
798 by Auto_tac; |
859 by Auto_tac; |
799 qed "extend_co_guar_leadsTo"; |
860 qed "extend_co_guar_leadsTo"; |
800 |
861 |
801 (*WEAK precondition and postcondition*) |
862 (*WEAK precondition and postcondition*) |
802 Goal "F : (A Co A') guarantees (B LeadsTo B') \ |
863 Goal "F : (A Co A') guarantees (B LeadsTo B') \ |
803 \ ==> extend h F : ((extend_set h A) Co (extend_set h A')) \ |
864 \ ==> extend h F : ((extend_set h A) Co (extend_set h A')) \ |
804 \ Int (f localTo (extend h F)) \ |
865 \ Int (f localTo[UNIV] (extend h F)) \ |
805 \ guarantees ((extend_set h B) LeadsTo (extend_set h B'))"; |
866 \ guarantees ((extend_set h B) LeadsTo (extend_set h B'))"; |
806 by (etac project_guarantees 1); |
867 by (etac project_guarantees 1); |
807 by (rtac (extending_LeadsTo RS extending_weaken) 2); |
868 by (rtac (extending_LeadsTo RS extending_weaken) 2); |
808 by (rtac (projecting_Constrains RS projecting_weaken) 1); |
869 by (rtac (projecting_Constrains RS projecting_weaken) 1); |
809 by Auto_tac; |
870 by Auto_tac; |