src/HOL/UNITY/Project.ML
changeset 7878 43b03d412b82
parent 7841 65d91d13fc13
child 7880 62fb24e28e5e
equal deleted inserted replaced
7877:e5e019d60f71 7878:43b03d412b82
    10 
    10 
    11 Open_locale "Extend";
    11 Open_locale "Extend";
    12 
    12 
    13 (** projection: monotonicity for safety **)
    13 (** projection: monotonicity for safety **)
    14 
    14 
    15 Goal "D <= C ==> project_act D h act <= project_act C h act";
    15 Goal "D <= C ==> project_act h (Restrict D act) <= project_act h (Restrict C act)";
    16 by (auto_tac (claset(), simpset() addsimps [project_act_def]));
    16 by (auto_tac (claset(), simpset() addsimps [project_act_def]));
    17 qed "project_act_mono";
    17 qed "project_act_mono";
    18 
    18 
    19 Goal "[| D <= C; project C h F : A co B |] ==> project D h F : A co B";
    19 Goal "[| D <= C; project C h F : A co B |] ==> project D h F : A co B";
    20 by (auto_tac (claset(), simpset() addsimps [constrains_def]));
    20 by (auto_tac (claset(), simpset() addsimps [constrains_def]));
    33 qed "project_extend_constrains_I";
    33 qed "project_extend_constrains_I";
    34 
    34 
    35 Goal "UNIV <= project_set h C \
    35 Goal "UNIV <= project_set h C \
    36 \     ==> project C h ((extend h F) Join G) = F Join (project C h G)";
    36 \     ==> project C h ((extend h F) Join G) = F Join (project C h G)";
    37 by (rtac program_equalityI 1);
    37 by (rtac program_equalityI 1);
    38 by (asm_simp_tac (simpset() addsimps [image_Un, image_image,
    38 by (asm_simp_tac (simpset() addsimps [image_Un, image_image_eq_UN, image_UN,
    39 			subset_UNIV RS subset_trans RS extend_act_inverse]) 2);
    39 			subset_UNIV RS subset_trans RS Restrict_triv]) 2);
    40 by (simp_tac (simpset() addsimps [project_set_extend_set_Int]) 1);
    40 by (simp_tac (simpset() addsimps [project_set_extend_set_Int]) 1);
    41 qed "project_extend_Join";
    41 qed "project_extend_Join";
    42 
    42 
    43 Goal "UNIV <= project_set h C \
    43 Goal "UNIV <= project_set h C \
    44 \     ==> (extend h F) Join G = extend h H ==> H = F Join (project C h G)";
    44 \     ==> (extend h F) Join G = extend h H ==> H = F Join (project C h G)";
   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 **)
   426 \   (extend h F Join G : Increasing (func o f))";
   471 \   (extend h F Join G : Increasing (func o f))";
   427 by (asm_simp_tac (simpset() addsimps [Increasing_def, project_Stable,
   472 by (asm_simp_tac (simpset() addsimps [Increasing_def, project_Stable,
   428 				      Collect_eq_extend_set RS sym]) 1);
   473 				      Collect_eq_extend_set RS sym]) 1);
   429 qed "project_Increasing";
   474 qed "project_Increasing";
   430 
   475 
       
   476 Goal "extend h F Join G : (v o f) LocalTo extend h H \
       
   477 \     ==> F Join project (reachable (extend h F Join G)) h G : v LocalTo H";
       
   478 by (asm_full_simp_tac 
       
   479     (simpset() addsimps [LocalTo_def, project_set_reachable_extend_eq RS sym,
       
   480 			 gen_project_localTo_I]) 1);
       
   481 qed "project_LocalTo_I";
       
   482 
   431 (** A lot of redundant theorems: all are proved to facilitate reasoning
   483 (** A lot of redundant theorems: all are proved to facilitate reasoning
   432     about guarantees. **)
   484     about guarantees. **)
   433 
   485 
   434 Goalw [projecting_def]
   486 Goalw [projecting_def]
   435      "projecting (%G. reachable (extend h F Join G)) h F \
   487      "projecting (%G. reachable (extend h F Join G)) h F \
   452 Goalw [projecting_def]
   504 Goalw [projecting_def]
   453      "projecting (%G. reachable (extend h F Join G)) h F \
   505      "projecting (%G. reachable (extend h F Join G)) h F \
   454 \                (Increasing (func o f)) (Increasing func)";
   506 \                (Increasing (func o f)) (Increasing func)";
   455 by (blast_tac (claset() addIs [project_Increasing_I]) 1);
   507 by (blast_tac (claset() addIs [project_Increasing_I]) 1);
   456 qed "projecting_Increasing";
   508 qed "projecting_Increasing";
       
   509 
       
   510 Goalw [projecting_def]
       
   511      "projecting (%G. reachable (extend h F Join G)) h F \
       
   512 \         ((v o f) LocalTo extend h H)  (v LocalTo H)";
       
   513 by (blast_tac (claset() addIs [project_LocalTo_I]) 1);
       
   514 qed "projecting_LocalTo";
   457 
   515 
   458 Goalw [extending_def]
   516 Goalw [extending_def]
   459      "extending (%G. reachable (extend h F Join G)) h F X' \
   517      "extending (%G. reachable (extend h F Join G)) h F X' \
   460 \               (extend_set h A Co extend_set h B) (A Co B)";
   518 \               (extend_set h A Co extend_set h B) (A Co B)";
   461 by (blast_tac (claset() addIs [project_Constrains_D]) 1);
   519 by (blast_tac (claset() addIs [project_Constrains_D]) 1);
   508 (*UNUSED.  WHY??
   566 (*UNUSED.  WHY??
   509   Converse of the above...it requires a strong assumption about actions
   567   Converse of the above...it requires a strong assumption about actions
   510   being enabled for all possible values of the new variables.*)
   568   being enabled for all possible values of the new variables.*)
   511 Goalw [transient_def]
   569 Goalw [transient_def]
   512      "[| project C h F : transient A;  \
   570      "[| project C h F : transient A;  \
   513 \        ALL act: Acts F. project_act C h act ^^ A <= - A --> \
   571 \        ALL act: Acts F. project_act h (Restrict C act) ^^ A <= - A --> \
   514 \                         Domain act <= C \
   572 \                         Domain act <= C \
   515 \             & extend_set h (project_set h (Domain act)) <= Domain act |]  \
   573 \             & extend_set h (project_set h (Domain act)) <= Domain act |]  \
   516 \     ==> F : transient (extend_set h A)";
   574 \     ==> F : transient (extend_set h A)";
   517 by (auto_tac (claset() delrules [ballE],
   575 by (auto_tac (claset() delrules [ballE],
   518 	      simpset() addsimps [Domain_project_act]));
   576 	      simpset() addsimps [Domain_project_act]));
   620 
   678 
   621 Goal "F : X guarantees Y ==> \
   679 Goal "F : X guarantees Y ==> \
   622 \     extend h F : (extend h `` X) guarantees (extend h `` Y)";
   680 \     extend h F : (extend h `` X) guarantees (extend h `` Y)";
   623 by (rtac guaranteesI 1);
   681 by (rtac guaranteesI 1);
   624 by Auto_tac;
   682 by Auto_tac;
   625 by (blast_tac (claset() addDs [project_set_UNIV RS extend_Join_eq_extend_D, 
   683 by (blast_tac (claset() addDs [project_set_UNIV RS equalityD2 RS 
       
   684 			         extend_Join_eq_extend_D, 
   626 			       guaranteesD]) 1);
   685 			       guaranteesD]) 1);
   627 qed "guarantees_imp_extend_guarantees";
   686 qed "guarantees_imp_extend_guarantees";
   628 
   687 
   629 Goal "extend h F : (extend h `` X) guarantees (extend h `` Y) \
   688 Goal "extend h F : (extend h `` X) guarantees (extend h `` Y) \
   630 \    ==> F : X guarantees Y";
   689 \    ==> F : X guarantees Y";
   648 (*The raw version*)
   707 (*The raw version*)
   649 val [xguary,project,extend] =
   708 val [xguary,project,extend] =
   650 Goal "[| F : X guarantees Y;  \
   709 Goal "[| F : X guarantees Y;  \
   651 \        !!G. extend h F Join G : X' ==> F Join proj G h G : X;  \
   710 \        !!G. extend h F Join G : X' ==> F Join proj G h G : X;  \
   652 \        !!G. [| F Join proj G h G : Y; extend h F Join G : X'; \
   711 \        !!G. [| F Join proj G h G : Y; extend h F Join G : X'; \
   653 \                Disjoint (extend h F) G |] \
   712 \                Disjoint UNIV (extend h F) G |] \
   654 \             ==> extend h F Join G : Y' |] \
   713 \             ==> extend h F Join G : Y' |] \
   655 \     ==> extend h F : X' guarantees Y'";
   714 \     ==> extend h F : X' guarantees Y'";
   656 by (rtac (xguary RS guaranteesD RS extend RS guaranteesI) 1);
   715 by (rtac (xguary RS guaranteesD RS extend RS guaranteesI) 1);
   657 by (etac project 1);
   716 by (etac project 1);
   658 by (assume_tac 1);
   717 by (assume_tac 1);
   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);
   727 (*Previously tried to prove
   786 (*Previously tried to prove
   728 [| G : f localTo extend h F; project C h G : transient D |] ==> F : transient D
   787 [| G : f localTo extend h F; project C h G : transient D |] ==> F : transient D
   729 but it can fail if C removes some parts of an action of G.*)
   788 but it can fail if C removes some parts of an action of G.*)
   730 
   789 
   731 
   790 
   732 Goal "[| G : f localTo extend h F; \
   791 Goal "[| G : v localTo[UNIV] F;  Disjoint UNIV F G |] ==> G : stable {s. v s = z}";
   733 \        Disjoint (extend h F) G |] ==> project C h G : stable {x}";
   792 by (asm_full_simp_tac 
       
   793     (simpset() addsimps [LOCALTO_def, Diff_def, Disjoint_def,
       
   794 			 stable_def, constrains_def]) 1);
       
   795 by (Blast_tac 1);
       
   796 qed "localTo_imp_stable";
       
   797 
       
   798 Goal "[| G : f localTo[UNIV] extend h F; \
       
   799 \        Disjoint UNIV (extend h F) G |] ==> project C h G : stable {x}";
   734 by (asm_full_simp_tac
   800 by (asm_full_simp_tac
   735     (simpset() addsimps [localTo_imp_stable,
   801     (simpset() addsimps [localTo_imp_stable,
   736 			 extend_set_sing, project_stable_I]) 1);
   802 			 extend_set_sing, project_stable_I]) 1);
   737 qed "localTo_imp_project_stable";
   803 qed "localTo_imp_project_stable";
   738 
   804 
   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;