| author | wenzelm | 
| Tue, 13 Nov 2001 22:20:15 +0100 | |
| changeset 12174 | a0aab0b9f2e9 | 
| parent 10834 | a7897aebbffc | 
| permissions | -rw-r--r-- | 
| 8044 | 1  | 
(* Title: HOL/UNITY/ELT  | 
2  | 
ID: $Id$  | 
|
3  | 
Author: Lawrence C Paulson, Cambridge University Computer Laboratory  | 
|
4  | 
Copyright 1999 University of Cambridge  | 
|
5  | 
||
6  | 
leadsTo strengthened with a specification of the allowable sets transient parts  | 
|
7  | 
*)  | 
|
8  | 
||
| 8128 | 9  | 
(*** givenBy ***)  | 
10  | 
||
11  | 
Goalw [givenBy_def] "givenBy id = UNIV";  | 
|
12  | 
by Auto_tac;  | 
|
13  | 
qed "givenBy_id";  | 
|
14  | 
Addsimps [givenBy_id];  | 
|
15  | 
||
16  | 
Goalw [givenBy_def] "(givenBy v) = {A. ALL x:A. ALL y. v x = v y --> y: A}";
 | 
|
17  | 
by Safe_tac;  | 
|
| 10834 | 18  | 
by (res_inst_tac [("x", "v ` ?u")] image_eqI 2);
 | 
| 8128 | 19  | 
by Auto_tac;  | 
20  | 
qed "givenBy_eq_all";  | 
|
21  | 
||
22  | 
val prems =  | 
|
23  | 
Goal "(!!x y. [| x:A; v x = v y |] ==> y: A) ==> A: givenBy v";  | 
|
24  | 
by (stac givenBy_eq_all 1);  | 
|
25  | 
by (blast_tac (claset() addIs prems) 1);  | 
|
26  | 
qed "givenByI";  | 
|
27  | 
||
28  | 
Goalw [givenBy_def] "[| A: givenBy v; x:A; v x = v y |] ==> y: A";  | 
|
29  | 
by Auto_tac;  | 
|
30  | 
qed "givenByD";  | 
|
31  | 
||
32  | 
Goal "{} : givenBy v";
 | 
|
33  | 
by (blast_tac (claset() addSIs [givenByI]) 1);  | 
|
34  | 
qed "empty_mem_givenBy";  | 
|
35  | 
||
36  | 
AddIffs [empty_mem_givenBy];  | 
|
37  | 
||
38  | 
Goal "A: givenBy v ==> EX P. A = {s. P(v s)}";
 | 
|
39  | 
by (res_inst_tac [("x", "%n. EX s. v s = n & s : A")] exI 1);
 | 
|
40  | 
by (full_simp_tac (simpset() addsimps [givenBy_eq_all]) 1);  | 
|
41  | 
by (Blast_tac 1);  | 
|
42  | 
qed "givenBy_imp_eq_Collect";  | 
|
43  | 
||
44  | 
Goalw [givenBy_def] "{s. P(v s)} : givenBy v";
 | 
|
45  | 
by (Best_tac 1);  | 
|
46  | 
qed "Collect_mem_givenBy";  | 
|
47  | 
||
48  | 
Goal "givenBy v = {A. EX P. A = {s. P(v s)}}";
 | 
|
49  | 
by (blast_tac (claset() addIs [Collect_mem_givenBy,  | 
|
50  | 
givenBy_imp_eq_Collect]) 1);  | 
|
| 9389 | 51  | 
qed "givenBy_eq_Collect";  | 
| 8128 | 52  | 
|
53  | 
(*preserving v preserves properties given by v*)  | 
|
54  | 
Goal "[| F : preserves v; D : givenBy v |] ==> F : stable D";  | 
|
55  | 
by (force_tac (claset(),  | 
|
56  | 
simpset() addsimps [impOfSubs preserves_subset_stable,  | 
|
57  | 
givenBy_eq_Collect]) 1);  | 
|
58  | 
qed "preserves_givenBy_imp_stable";  | 
|
59  | 
||
60  | 
Goal "givenBy (w o v) <= givenBy v";  | 
|
61  | 
by (simp_tac (simpset() addsimps [givenBy_eq_Collect]) 1);  | 
|
62  | 
by (Deepen_tac 0 1);  | 
|
63  | 
qed "givenBy_o_subset";  | 
|
64  | 
||
65  | 
Goal "[| A : givenBy v; B : givenBy v |] ==> A-B : givenBy v";  | 
|
66  | 
by (full_simp_tac (simpset() addsimps [givenBy_eq_Collect]) 1);  | 
|
67  | 
by Safe_tac;  | 
|
68  | 
by (res_inst_tac [("x", "%z. ?R z & ~ ?Q z")] exI 1);
 | 
|
69  | 
by (deepen_tac (set_cs addSIs [equalityI]) 0 1);  | 
|
70  | 
qed "givenBy_DiffI";  | 
|
71  | 
||
72  | 
||
| 8044 | 73  | 
(** Standard leadsTo rules **)  | 
74  | 
||
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
75  | 
Goalw [leadsETo_def]  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
76  | 
     "[| F: A ensures B;  A-B: insert {} CC |] ==> F : A leadsTo[CC] B";
 | 
| 8044 | 77  | 
by (blast_tac (claset() addIs [elt.Basis]) 1);  | 
78  | 
qed "leadsETo_Basis";  | 
|
| 
10064
 
1a77667b21ef
added compatibility relation: AllowedActs, Allowed, ok,
 
paulson 
parents: 
9403 
diff
changeset
 | 
79  | 
AddIs [leadsETo_Basis];  | 
| 8044 | 80  | 
|
81  | 
Goalw [leadsETo_def]  | 
|
82  | 
"[| F : A leadsTo[CC] B; F : B leadsTo[CC] C |] ==> F : A leadsTo[CC] C";  | 
|
83  | 
by (blast_tac (claset() addIs [elt.Trans]) 1);  | 
|
84  | 
qed "leadsETo_Trans";  | 
|
85  | 
||
| 
8122
 
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
 
paulson 
parents: 
8110 
diff
changeset
 | 
86  | 
|
| 8044 | 87  | 
(*Useful with cancellation, disjunction*)  | 
88  | 
Goal "F : A leadsTo[CC] (A' Un A') ==> F : A leadsTo[CC] A'";  | 
|
89  | 
by (asm_full_simp_tac (simpset() addsimps Un_ac) 1);  | 
|
90  | 
qed "leadsETo_Un_duplicate";  | 
|
91  | 
||
92  | 
Goal "F : A leadsTo[CC] (A' Un C Un C) ==> F : A leadsTo[CC] (A' Un C)";  | 
|
93  | 
by (asm_full_simp_tac (simpset() addsimps Un_ac) 1);  | 
|
94  | 
qed "leadsETo_Un_duplicate2";  | 
|
95  | 
||
96  | 
(*The Union introduction rule as we should have liked to state it*)  | 
|
97  | 
val prems = Goalw [leadsETo_def]  | 
|
98  | 
"(!!A. A : S ==> F : A leadsTo[CC] B) ==> F : (Union S) leadsTo[CC] B";  | 
|
99  | 
by (blast_tac (claset() addIs [elt.Union] addDs prems) 1);  | 
|
100  | 
qed "leadsETo_Union";  | 
|
101  | 
||
102  | 
val prems = Goal  | 
|
103  | 
"(!!i. i : I ==> F : (A i) leadsTo[CC] B) \  | 
|
104  | 
\ ==> F : (UN i:I. A i) leadsTo[CC] B";  | 
|
105  | 
by (stac (Union_image_eq RS sym) 1);  | 
|
106  | 
by (blast_tac (claset() addIs leadsETo_Union::prems) 1);  | 
|
107  | 
qed "leadsETo_UN";  | 
|
108  | 
||
109  | 
(*The INDUCTION rule as we should have liked to state it*)  | 
|
110  | 
val major::prems = Goalw [leadsETo_def]  | 
|
111  | 
"[| F : za leadsTo[CC] zb; \  | 
|
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
112  | 
\     !!A B. [| F : A ensures B;  A-B : insert {} CC |] ==> P A B; \
 | 
| 8044 | 113  | 
\ !!A B C. [| F : A leadsTo[CC] B; P A B; F : B leadsTo[CC] C; P B C |] \  | 
114  | 
\ ==> P A C; \  | 
|
115  | 
\ !!B S. ALL A:S. F : A leadsTo[CC] B & P A B ==> P (Union S) B \  | 
|
116  | 
\ |] ==> P za zb";  | 
|
117  | 
by (rtac (major RS CollectD RS elt.induct) 1);  | 
|
118  | 
by (REPEAT (blast_tac (claset() addIs prems) 1));  | 
|
119  | 
qed "leadsETo_induct";  | 
|
120  | 
||
121  | 
||
122  | 
(** New facts involving leadsETo **)  | 
|
123  | 
||
124  | 
Goal "CC' <= CC ==> (A leadsTo[CC'] B) <= (A leadsTo[CC] B)";  | 
|
125  | 
by Safe_tac;  | 
|
126  | 
by (etac leadsETo_induct 1);  | 
|
127  | 
by (blast_tac (claset() addIs [leadsETo_Union]) 3);  | 
|
128  | 
by (blast_tac (claset() addIs [leadsETo_Trans]) 2);  | 
|
129  | 
by (blast_tac (claset() addIs [leadsETo_Basis]) 1);  | 
|
130  | 
qed "leadsETo_mono";  | 
|
131  | 
||
| 
8122
 
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
 
paulson 
parents: 
8110 
diff
changeset
 | 
132  | 
Goal "[| F : A leadsTo[CC] B; F : B leadsTo[DD] C |] \  | 
| 
 
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
 
paulson 
parents: 
8110 
diff
changeset
 | 
133  | 
\ ==> F : A leadsTo[CC Un DD] C";  | 
| 
 
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
 
paulson 
parents: 
8110 
diff
changeset
 | 
134  | 
by (blast_tac (claset() addIs [impOfSubs leadsETo_mono, leadsETo_Trans]) 1);  | 
| 
 
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
 
paulson 
parents: 
8110 
diff
changeset
 | 
135  | 
qed "leadsETo_Trans_Un";  | 
| 
 
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
 
paulson 
parents: 
8110 
diff
changeset
 | 
136  | 
|
| 8044 | 137  | 
val prems = Goalw [leadsETo_def]  | 
138  | 
"(!!A. A : S ==> F : (A Int C) leadsTo[CC] B) ==> F : (Union S Int C) leadsTo[CC] B";  | 
|
139  | 
by (simp_tac (HOL_ss addsimps [Int_Union_Union]) 1);  | 
|
140  | 
by (blast_tac (claset() addIs [elt.Union] addDs prems) 1);  | 
|
141  | 
qed "leadsETo_Union_Int";  | 
|
142  | 
||
143  | 
(*Binary union introduction rule*)  | 
|
144  | 
Goal "[| F : A leadsTo[CC] C; F : B leadsTo[CC] C |] ==> F : (A Un B) leadsTo[CC] C";  | 
|
145  | 
by (stac Un_eq_Union 1);  | 
|
146  | 
by (blast_tac (claset() addIs [leadsETo_Union]) 1);  | 
|
147  | 
qed "leadsETo_Un";  | 
|
148  | 
||
149  | 
val prems =  | 
|
150  | 
Goal "(!!x. x : A ==> F : {x} leadsTo[CC] B) ==> F : A leadsTo[CC] B";
 | 
|
151  | 
by (stac (UN_singleton RS sym) 1 THEN rtac leadsETo_UN 1);  | 
|
152  | 
by (blast_tac (claset() addIs prems) 1);  | 
|
153  | 
qed "single_leadsETo_I";  | 
|
154  | 
||
155  | 
||
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
156  | 
Goal "A<=B ==> F : A leadsTo[CC] B";  | 
| 8044 | 157  | 
by (asm_simp_tac (simpset() addsimps [subset_imp_ensures RS leadsETo_Basis,  | 
158  | 
Diff_eq_empty_iff RS iffD2]) 1);  | 
|
159  | 
qed "subset_imp_leadsETo";  | 
|
160  | 
||
161  | 
bind_thm ("empty_leadsETo", empty_subsetI RS subset_imp_leadsETo);
 | 
|
162  | 
Addsimps [empty_leadsETo];  | 
|
163  | 
||
164  | 
||
| 
8122
 
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
 
paulson 
parents: 
8110 
diff
changeset
 | 
165  | 
|
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
166  | 
(** Weakening laws **)  | 
| 8044 | 167  | 
|
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
168  | 
Goal "[| F : A leadsTo[CC] A'; A'<=B' |] ==> F : A leadsTo[CC] B'";  | 
| 8044 | 169  | 
by (blast_tac (claset() addIs [subset_imp_leadsETo, leadsETo_Trans]) 1);  | 
170  | 
qed "leadsETo_weaken_R";  | 
|
171  | 
||
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
172  | 
Goal "[| F : A leadsTo[CC] A'; B<=A |] ==> F : B leadsTo[CC] A'";  | 
| 8044 | 173  | 
by (blast_tac (claset() addIs [leadsETo_Trans, subset_imp_leadsETo]) 1);  | 
174  | 
qed_spec_mp "leadsETo_weaken_L";  | 
|
175  | 
||
176  | 
(*Distributes over binary unions*)  | 
|
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
177  | 
Goal "F : (A Un B) leadsTo[CC] C = \  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
178  | 
\ (F : A leadsTo[CC] C & F : B leadsTo[CC] C)";  | 
| 8044 | 179  | 
by (blast_tac (claset() addIs [leadsETo_Un, leadsETo_weaken_L]) 1);  | 
180  | 
qed "leadsETo_Un_distrib";  | 
|
181  | 
||
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
182  | 
Goal "F : (UN i:I. A i) leadsTo[CC] B = \  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
183  | 
\ (ALL i : I. F : (A i) leadsTo[CC] B)";  | 
| 8044 | 184  | 
by (blast_tac (claset() addIs [leadsETo_UN, leadsETo_weaken_L]) 1);  | 
185  | 
qed "leadsETo_UN_distrib";  | 
|
186  | 
||
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
187  | 
Goal "F : (Union S) leadsTo[CC] B = (ALL A : S. F : A leadsTo[CC] B)";  | 
| 8044 | 188  | 
by (blast_tac (claset() addIs [leadsETo_Union, leadsETo_weaken_L]) 1);  | 
189  | 
qed "leadsETo_Union_distrib";  | 
|
190  | 
||
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
191  | 
Goal "[| F : A leadsTo[CC'] A'; B<=A; A'<=B'; CC' <= CC |] \  | 
| 8044 | 192  | 
\ ==> F : B leadsTo[CC] B'";  | 
193  | 
by (dtac (impOfSubs leadsETo_mono) 1);  | 
|
194  | 
by (assume_tac 1);  | 
|
| 8110 | 195  | 
by (blast_tac (claset() delrules [subsetCE]  | 
196  | 
addIs [leadsETo_weaken_R, leadsETo_weaken_L,  | 
|
| 8044 | 197  | 
leadsETo_Trans]) 1);  | 
198  | 
qed "leadsETo_weaken";  | 
|
199  | 
||
200  | 
Goal "[| F : A leadsTo[CC] A'; CC <= givenBy v |] \  | 
|
201  | 
\ ==> F : A leadsTo[givenBy v] A'";  | 
|
202  | 
by (blast_tac (claset() addIs [empty_mem_givenBy, leadsETo_weaken]) 1);  | 
|
203  | 
qed "leadsETo_givenBy";  | 
|
204  | 
||
205  | 
||
206  | 
(*Set difference*)  | 
|
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
207  | 
Goal "[| F : (A-B) leadsTo[CC] C; F : B leadsTo[CC] C |] \  | 
| 8044 | 208  | 
\ ==> F : A leadsTo[CC] C";  | 
209  | 
by (blast_tac (claset() addIs [leadsETo_Un, leadsETo_weaken]) 1);  | 
|
210  | 
qed "leadsETo_Diff";  | 
|
211  | 
||
212  | 
||
213  | 
(*Binary union version*)  | 
|
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
214  | 
Goal "[| F : A leadsTo[CC] A'; F : B leadsTo[CC] B' |] \  | 
| 8044 | 215  | 
\ ==> F : (A Un B) leadsTo[CC] (A' Un B')";  | 
216  | 
by (blast_tac (claset() addIs [leadsETo_Un,  | 
|
217  | 
leadsETo_weaken_R]) 1);  | 
|
218  | 
qed "leadsETo_Un_Un";  | 
|
219  | 
||
220  | 
||
221  | 
(** The cancellation law **)  | 
|
222  | 
||
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
223  | 
Goal "[| F : A leadsTo[CC] (A' Un B); F : B leadsTo[CC] B' |] \  | 
| 8044 | 224  | 
\ ==> F : A leadsTo[CC] (A' Un B')";  | 
225  | 
by (blast_tac (claset() addIs [leadsETo_Un_Un,  | 
|
226  | 
subset_imp_leadsETo, leadsETo_Trans]) 1);  | 
|
227  | 
qed "leadsETo_cancel2";  | 
|
228  | 
||
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
229  | 
Goal "[| F : A leadsTo[CC] (B Un A'); F : B leadsTo[CC] B' |] \  | 
| 8044 | 230  | 
\ ==> F : A leadsTo[CC] (B' Un A')";  | 
231  | 
by (asm_full_simp_tac (simpset() addsimps [Un_commute]) 1);  | 
|
232  | 
by (blast_tac (claset() addSIs [leadsETo_cancel2]) 1);  | 
|
233  | 
qed "leadsETo_cancel1";  | 
|
234  | 
||
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
235  | 
Goal "[| F : A leadsTo[CC] (B Un A'); F : (B-A') leadsTo[CC] B' |] \  | 
| 8044 | 236  | 
\ ==> F : A leadsTo[CC] (B' Un A')";  | 
237  | 
by (rtac leadsETo_cancel1 1);  | 
|
238  | 
by (assume_tac 2);  | 
|
239  | 
by (ALLGOALS Asm_simp_tac);  | 
|
240  | 
qed "leadsETo_cancel_Diff1";  | 
|
241  | 
||
242  | 
||
243  | 
(** The impossibility law **)  | 
|
244  | 
||
245  | 
Goal "F : A leadsTo[CC] B ==> B={} --> A={}";
 | 
|
246  | 
by (etac leadsETo_induct 1);  | 
|
247  | 
by (ALLGOALS Asm_simp_tac);  | 
|
248  | 
by (rewrite_goals_tac [ensures_def, constrains_def, transient_def]);  | 
|
249  | 
by (Blast_tac 1);  | 
|
250  | 
val lemma = result() RS mp;  | 
|
251  | 
||
252  | 
Goal "F : A leadsTo[CC] {} ==> A={}";
 | 
|
253  | 
by (blast_tac (claset() addSIs [lemma]) 1);  | 
|
254  | 
qed "leadsETo_empty";  | 
|
255  | 
||
256  | 
||
257  | 
(** PSP: Progress-Safety-Progress **)  | 
|
258  | 
||
259  | 
(*Special case of PSP: Misra's "stable conjunction"*)  | 
|
260  | 
Goalw [stable_def]  | 
|
261  | 
"[| F : A leadsTo[CC] A'; F : stable B; ALL C:CC. C Int B : CC |] \  | 
|
262  | 
\ ==> F : (A Int B) leadsTo[CC] (A' Int B)";  | 
|
263  | 
by (etac leadsETo_induct 1);  | 
|
264  | 
by (blast_tac (claset() addIs [leadsETo_Union_Int]) 3);  | 
|
265  | 
by (blast_tac (claset() addIs [leadsETo_Trans]) 2);  | 
|
266  | 
by (rtac leadsETo_Basis 1);  | 
|
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
267  | 
by (force_tac (claset(),  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
268  | 
simpset() addsimps [Diff_Int_distrib2 RS sym]) 2);  | 
| 8044 | 269  | 
by (asm_full_simp_tac  | 
270  | 
(simpset() addsimps [ensures_def,  | 
|
271  | 
Diff_Int_distrib2 RS sym, Int_Un_distrib2 RS sym]) 1);  | 
|
272  | 
by (blast_tac (claset() addIs [transient_strengthen, constrains_Int]) 1);  | 
|
273  | 
qed "e_psp_stable";  | 
|
274  | 
||
275  | 
Goal "[| F : A leadsTo[CC] A'; F : stable B; ALL C:CC. C Int B : CC |] \  | 
|
276  | 
\ ==> F : (B Int A) leadsTo[CC] (B Int A')";  | 
|
277  | 
by (asm_simp_tac (simpset() addsimps e_psp_stable::Int_ac) 1);  | 
|
278  | 
qed "e_psp_stable2";  | 
|
279  | 
||
280  | 
Goal "[| F : A leadsTo[CC] A'; F : B co B'; \  | 
|
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
281  | 
\ ALL C:CC. C Int B Int B' : CC |] \  | 
| 8044 | 282  | 
\ ==> F : (A Int B') leadsTo[CC] ((A' Int B) Un (B' - B))";  | 
283  | 
by (etac leadsETo_induct 1);  | 
|
284  | 
by (blast_tac (claset() addIs [leadsETo_Union_Int]) 3);  | 
|
285  | 
(*Transitivity case has a delicate argument involving "cancellation"*)  | 
|
286  | 
by (rtac leadsETo_Un_duplicate2 2);  | 
|
287  | 
by (etac leadsETo_cancel_Diff1 2);  | 
|
288  | 
by (asm_full_simp_tac (simpset() addsimps [Int_Diff, Diff_triv]) 2);  | 
|
289  | 
by (blast_tac (claset() addIs [leadsETo_weaken_L]  | 
|
290  | 
addDs [constrains_imp_subset]) 2);  | 
|
291  | 
(*Basis case*)  | 
|
292  | 
by (rtac leadsETo_Basis 1);  | 
|
293  | 
by (blast_tac (claset() addIs [psp_ensures]) 1);  | 
|
294  | 
by (subgoal_tac "A Int B' - (Ba Int B Un (B' - B)) = (A - Ba) Int B Int B'" 1);  | 
|
295  | 
by Auto_tac;  | 
|
296  | 
qed "e_psp";  | 
|
297  | 
||
298  | 
Goal "[| F : A leadsTo[CC] A'; F : B co B'; \  | 
|
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
299  | 
\ ALL C:CC. C Int B Int B' : CC |] \  | 
| 8044 | 300  | 
\ ==> F : (B' Int A) leadsTo[CC] ((B Int A') Un (B' - B))";  | 
301  | 
by (asm_full_simp_tac (simpset() addsimps e_psp::Int_ac) 1);  | 
|
302  | 
qed "e_psp2";  | 
|
303  | 
||
304  | 
||
305  | 
(*** Special properties involving the parameter [CC] ***)  | 
|
306  | 
||
307  | 
(*??IS THIS NEEDED?? or is it just an example of what's provable??*)  | 
|
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
308  | 
Goal "[| F: (A leadsTo[givenBy v] B); G : preserves v; \  | 
| 8044 | 309  | 
\ F Join G : stable C |] \  | 
| 10834 | 310  | 
\ ==> F Join G : ((C Int A) leadsTo[(%D. C Int D) ` givenBy v] B)";  | 
| 8044 | 311  | 
by (etac leadsETo_induct 1);  | 
312  | 
by (stac Int_Union 3);  | 
|
313  | 
by (blast_tac (claset() addIs [leadsETo_UN]) 3);  | 
|
314  | 
by (blast_tac (claset() addIs [e_psp_stable2 RS leadsETo_weaken_L,  | 
|
315  | 
leadsETo_Trans]) 2);  | 
|
316  | 
by (rtac leadsETo_Basis 1);  | 
|
317  | 
by (auto_tac (claset(),  | 
|
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
318  | 
simpset() addsimps [Diff_eq_empty_iff RS iffD2,  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
319  | 
Int_Diff, ensures_def,  | 
| 
9403
 
aad13b59b8d9
much tidying in connection with the 2nd UNITY paper
 
paulson 
parents: 
9389 
diff
changeset
 | 
320  | 
givenBy_eq_Collect, Join_transient]));  | 
| 8044 | 321  | 
by (blast_tac (claset() addIs [transient_strengthen]) 3);  | 
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
322  | 
by (ALLGOALS (dres_inst_tac [("P1","P")] (impOfSubs preserves_subset_stable)));
 | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
323  | 
by (rewtac stable_def);  | 
| 9190 | 324  | 
by (blast_tac (claset() addIs [constrains_Int RS constrains_weaken]) 2);  | 
325  | 
by (blast_tac (claset() addIs [constrains_Int RS constrains_weaken]) 1);  | 
|
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
326  | 
qed "gen_leadsETo_imp_Join_leadsETo";  | 
| 8044 | 327  | 
|
328  | 
(*useful??*)  | 
|
329  | 
Goal "[| F Join G : (A leadsTo[CC] B); ALL C:CC. G : stable C |] \  | 
|
330  | 
\ ==> F: (A leadsTo[CC] B)";  | 
|
331  | 
by (etac leadsETo_induct 1);  | 
|
332  | 
by (blast_tac (claset() addIs [leadsETo_Union]) 3);  | 
|
333  | 
by (blast_tac (claset() addIs [leadsETo_Trans]) 2);  | 
|
334  | 
by (rtac leadsETo_Basis 1);  | 
|
335  | 
by (case_tac "A <= B" 1);  | 
|
336  | 
by (etac subset_imp_ensures 1);  | 
|
337  | 
by (auto_tac (claset() addIs [constrains_weaken],  | 
|
| 
9403
 
aad13b59b8d9
much tidying in connection with the 2nd UNITY paper
 
paulson 
parents: 
9389 
diff
changeset
 | 
338  | 
simpset() addsimps [stable_def, ensures_def, Join_transient]));  | 
| 8044 | 339  | 
by (REPEAT (thin_tac "?F : ?A co ?B" 1));  | 
340  | 
by (etac transientE 1);  | 
|
341  | 
by (rewtac constrains_def);  | 
|
342  | 
by (blast_tac (claset() addSDs [bspec]) 1);  | 
|
343  | 
qed "Join_leadsETo_stable_imp_leadsETo";  | 
|
344  | 
||
| 8067 | 345  | 
(**** Relationship with traditional "leadsTo", strong & weak ****)  | 
346  | 
||
347  | 
(** strong **)  | 
|
348  | 
||
349  | 
Goal "(A leadsTo[CC] B) <= (A leadsTo B)";  | 
|
350  | 
by Safe_tac;  | 
|
351  | 
by (etac leadsETo_induct 1);  | 
|
352  | 
by (blast_tac (claset() addIs [leadsTo_Union]) 3);  | 
|
353  | 
by (blast_tac (claset() addIs [leadsTo_Trans]) 2);  | 
|
| 
10064
 
1a77667b21ef
added compatibility relation: AllowedActs, Allowed, ok,
 
paulson 
parents: 
9403 
diff
changeset
 | 
354  | 
by (Blast_tac 1);  | 
| 8067 | 355  | 
qed "leadsETo_subset_leadsTo";  | 
356  | 
||
357  | 
Goal "(A leadsTo[UNIV] B) = (A leadsTo B)";  | 
|
358  | 
by Safe_tac;  | 
|
359  | 
by (etac (impOfSubs leadsETo_subset_leadsTo) 1);  | 
|
360  | 
(*right-to-left case*)  | 
|
361  | 
by (etac leadsTo_induct 1);  | 
|
362  | 
by (blast_tac (claset() addIs [leadsETo_Union]) 3);  | 
|
363  | 
by (blast_tac (claset() addIs [leadsETo_Trans]) 2);  | 
|
| 
10064
 
1a77667b21ef
added compatibility relation: AllowedActs, Allowed, ok,
 
paulson 
parents: 
9403 
diff
changeset
 | 
364  | 
by (Blast_tac 1);  | 
| 8067 | 365  | 
qed "leadsETo_UNIV_eq_leadsTo";  | 
366  | 
||
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
367  | 
(**** weak ****)  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
368  | 
|
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
369  | 
Goalw [LeadsETo_def]  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
370  | 
"A LeadsTo[CC] B = \  | 
| 10834 | 371  | 
\       {F. F : (reachable F Int A) leadsTo[(%C. reachable F Int C) ` CC] \
 | 
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
372  | 
\ (reachable F Int B)}";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
373  | 
by (blast_tac (claset() addDs [e_psp_stable2] addIs [leadsETo_weaken]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
374  | 
qed "LeadsETo_eq_leadsETo";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
375  | 
|
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
376  | 
(*** Introduction rules: Basis, Trans, Union ***)  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
377  | 
|
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
378  | 
Goal "[| F : A LeadsTo[CC] B; F : B LeadsTo[CC] C |] \  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
379  | 
\ ==> F : A LeadsTo[CC] C";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
380  | 
by (asm_full_simp_tac (simpset() addsimps [LeadsETo_eq_leadsETo]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
381  | 
by (blast_tac (claset() addIs [leadsETo_Trans]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
382  | 
qed "LeadsETo_Trans";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
383  | 
|
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
384  | 
val prems = Goalw [LeadsETo_def]  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
385  | 
"(!!A. A : S ==> F : A LeadsTo[CC] B) ==> F : (Union S) LeadsTo[CC] B";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
386  | 
by (Simp_tac 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
387  | 
by (stac Int_Union 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
388  | 
by (blast_tac (claset() addIs [leadsETo_UN] addDs prems) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
389  | 
qed "LeadsETo_Union";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
390  | 
|
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
391  | 
val prems =  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
392  | 
Goal "(!!i. i : I ==> F : (A i) LeadsTo[CC] B) \  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
393  | 
\ ==> F : (UN i:I. A i) LeadsTo[CC] B";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
394  | 
by (simp_tac (HOL_ss addsimps [Union_image_eq RS sym]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
395  | 
by (blast_tac (claset() addIs (LeadsETo_Union::prems)) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
396  | 
qed "LeadsETo_UN";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
397  | 
|
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
398  | 
(*Binary union introduction rule*)  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
399  | 
Goal "[| F : A LeadsTo[CC] C; F : B LeadsTo[CC] C |] \  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
400  | 
\ ==> F : (A Un B) LeadsTo[CC] C";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
401  | 
by (stac Un_eq_Union 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
402  | 
by (blast_tac (claset() addIs [LeadsETo_Union]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
403  | 
qed "LeadsETo_Un";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
404  | 
|
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
405  | 
(*Lets us look at the starting state*)  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
406  | 
val prems =  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
407  | 
Goal "(!!s. s : A ==> F : {s} LeadsTo[CC] B) ==> F : A LeadsTo[CC] B";
 | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
408  | 
by (stac (UN_singleton RS sym) 1 THEN rtac LeadsETo_UN 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
409  | 
by (blast_tac (claset() addIs prems) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
410  | 
qed "single_LeadsETo_I";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
411  | 
|
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
412  | 
Goal "A <= B ==> F : A LeadsTo[CC] B";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
413  | 
by (simp_tac (simpset() addsimps [LeadsETo_def]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
414  | 
by (blast_tac (claset() addIs [subset_imp_leadsETo]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
415  | 
qed "subset_imp_LeadsETo";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
416  | 
|
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
417  | 
bind_thm ("empty_LeadsETo", empty_subsetI RS subset_imp_LeadsETo);
 | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
418  | 
|
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
419  | 
Goal "[| F : A LeadsTo[CC] A'; A' <= B' |] ==> F : A LeadsTo[CC] B'";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
420  | 
by (full_simp_tac (simpset() addsimps [LeadsETo_def]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
421  | 
by (blast_tac (claset() addIs [leadsETo_weaken_R]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
422  | 
qed_spec_mp "LeadsETo_weaken_R";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
423  | 
|
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
424  | 
Goal "[| F : A LeadsTo[CC] A'; B <= A |] ==> F : B LeadsTo[CC] A'";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
425  | 
by (full_simp_tac (simpset() addsimps [LeadsETo_def]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
426  | 
by (blast_tac (claset() addIs [leadsETo_weaken_L]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
427  | 
qed_spec_mp "LeadsETo_weaken_L";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
428  | 
|
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
429  | 
Goal "[| F : A LeadsTo[CC'] A'; \  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
430  | 
\ B <= A; A' <= B'; CC' <= CC |] \  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
431  | 
\ ==> F : B LeadsTo[CC] B'";  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
432  | 
by (full_simp_tac (simpset() addsimps [LeadsETo_def]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
433  | 
by (blast_tac (claset() addIs [leadsETo_weaken]) 1);  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
434  | 
qed "LeadsETo_weaken";  | 
| 8067 | 435  | 
|
436  | 
Goalw [LeadsETo_def, LeadsTo_def] "(A LeadsTo[CC] B) <= (A LeadsTo B)";  | 
|
437  | 
by (blast_tac (claset() addIs [impOfSubs leadsETo_subset_leadsTo]) 1);  | 
|
438  | 
qed "LeadsETo_subset_LeadsTo";  | 
|
439  | 
||
440  | 
(*Postcondition can be strengthened to (reachable F Int B) *)  | 
|
441  | 
Goal "F : A ensures B ==> F : (reachable F Int A) ensures B";  | 
|
442  | 
by (rtac (stable_ensures_Int RS ensures_weaken_R) 1);  | 
|
| 
8069
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
443  | 
by Auto_tac;  | 
| 8067 | 444  | 
qed "reachable_ensures";  | 
445  | 
||
446  | 
Goal "F : A leadsTo B ==> F : (reachable F Int A) leadsTo[Pow(reachable F)] B";  | 
|
447  | 
by (etac leadsTo_induct 1);  | 
|
448  | 
by (stac Int_Union 3);  | 
|
449  | 
by (blast_tac (claset() addIs [leadsETo_UN]) 3);  | 
|
450  | 
by (blast_tac (claset() addDs [e_psp_stable2]  | 
|
| 
8069
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
451  | 
addIs [leadsETo_Trans, leadsETo_weaken_L]) 2);  | 
| 8067 | 452  | 
by (blast_tac (claset() addIs [reachable_ensures, leadsETo_Basis]) 1);  | 
453  | 
val lemma = result();  | 
|
454  | 
||
455  | 
Goal "(A LeadsTo[UNIV] B) = (A LeadsTo B)";  | 
|
456  | 
by Safe_tac;  | 
|
457  | 
by (etac (impOfSubs LeadsETo_subset_LeadsTo) 1);  | 
|
458  | 
(*right-to-left case*)  | 
|
459  | 
by (rewrite_goals_tac [LeadsETo_def, LeadsTo_def]);  | 
|
460  | 
by (fast_tac (claset() addEs [lemma RS leadsETo_weaken]) 1);  | 
|
461  | 
qed "LeadsETo_UNIV_eq_LeadsTo";  | 
|
462  | 
||
| 8044 | 463  | 
|
464  | 
(**** EXTEND/PROJECT PROPERTIES ****)  | 
|
465  | 
||
466  | 
Open_locale "Extend";  | 
|
467  | 
||
| 
8334
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
468  | 
(*givenBy laws that need to be in the locale*)  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
469  | 
|
| 10834 | 470  | 
Goal "givenBy (v o f) = extend_set h ` (givenBy v)";  | 
| 
8334
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
471  | 
by (simp_tac (simpset() addsimps [givenBy_eq_Collect]) 1);  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
472  | 
by (Deepen_tac 0 1);  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
473  | 
qed "givenBy_o_eq_extend_set";  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
474  | 
|
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
475  | 
Goal "givenBy f = range (extend_set h)";  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
476  | 
by (simp_tac (simpset() addsimps [givenBy_eq_Collect]) 1);  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
477  | 
by (Deepen_tac 0 1);  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
478  | 
qed "givenBy_eq_extend_set";  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
479  | 
|
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
480  | 
Goal "D : givenBy v ==> extend_set h D : givenBy (v o f)";  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
481  | 
by (full_simp_tac (simpset() addsimps [givenBy_eq_all]) 1);  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
482  | 
by (Blast_tac 1);  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
483  | 
qed "extend_set_givenBy_I";  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
484  | 
|
| 8044 | 485  | 
Goal "F : A leadsTo[CC] B \  | 
| 10834 | 486  | 
\ ==> extend h F : (extend_set h A) leadsTo[extend_set h ` CC] \  | 
| 8044 | 487  | 
\ (extend_set h B)";  | 
488  | 
by (etac leadsETo_induct 1);  | 
|
489  | 
by (asm_simp_tac (simpset() addsimps [leadsETo_UN, extend_set_Union]) 3);  | 
|
490  | 
by (blast_tac (claset() addIs [leadsETo_Trans]) 2);  | 
|
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
491  | 
by (force_tac (claset() addIs [leadsETo_Basis, subset_imp_ensures],  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
492  | 
simpset() addsimps [extend_ensures,  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
493  | 
extend_set_Diff_distrib RS sym]) 1);  | 
| 8044 | 494  | 
qed "leadsETo_imp_extend_leadsETo";  | 
495  | 
||
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
496  | 
|
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
497  | 
|
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
498  | 
(*NOT USED, but analogous to preserves_project_transient_empty in Project.ML*)  | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
499  | 
Goal "[| G : preserves (v o f); project h C G : transient D; \  | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
500  | 
\        D : givenBy v |] ==> D={}";
 | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
501  | 
by (rtac stable_transient_empty 1);  | 
| 8044 | 502  | 
by (assume_tac 2);  | 
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
503  | 
(*If addIs then PROOF FAILED at depth 2*)  | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
504  | 
by (blast_tac (claset() addSIs [preserves_givenBy_imp_stable,  | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
505  | 
project_preserves_I]) 1);  | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
506  | 
result();  | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
507  | 
|
| 8044 | 508  | 
|
509  | 
(*This version's stronger in the "ensures" precondition  | 
|
510  | 
BUT there's no ensures_weaken_L*)  | 
|
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
511  | 
Goal "[| project h C G ~: transient (project_set h C Int (A-B)) | \  | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
512  | 
\          project_set h C Int (A - B) = {};  \
 | 
| 8044 | 513  | 
\ extend h F Join G : stable C; \  | 
514  | 
\ F Join project h C G : (project_set h C Int A) ensures B |] \  | 
|
515  | 
\ ==> extend h F Join G : (C Int extend_set h A) ensures (extend_set h B)";  | 
|
516  | 
by (stac (Int_extend_set_lemma RS sym) 1);  | 
|
517  | 
by (rtac Join_project_ensures 1);  | 
|
518  | 
by (auto_tac (claset(), simpset() addsimps [Int_Diff]));  | 
|
519  | 
qed "Join_project_ensures_strong";  | 
|
520  | 
||
| 
8334
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
521  | 
(*Generalizes preserves_project_transient_empty*)  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
522  | 
Goal "[| G : preserves (v o f); \  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
523  | 
\ project h C G : transient (C' Int D); \  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
524  | 
\ project h C G : stable C'; D : givenBy v |] \  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
525  | 
\     ==> C' Int D = {}";
 | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
526  | 
by (rtac stable_transient_empty 1);  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
527  | 
by (assume_tac 2);  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
528  | 
(*If addIs then PROOF FAILED at depth 3*)  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
529  | 
by (blast_tac (claset() addSIs [stable_Int, preserves_givenBy_imp_stable,  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
530  | 
project_preserves_I]) 1);  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
531  | 
qed "preserves_o_project_transient_empty";  | 
| 
 
7896bcbd8641
Added Tanja's Detects and Reachability theories.  Also
 
paulson 
parents: 
8128 
diff
changeset
 | 
532  | 
|
| 8044 | 533  | 
Goal "[| extend h F Join G : stable C; \  | 
| 10834 | 534  | 
\ F Join project h C G : (project_set h C Int A) leadsTo[(%D. project_set h C Int D)`givenBy v] B; \  | 
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
535  | 
\ G : preserves (v o f) |] \  | 
| 8044 | 536  | 
\ ==> extend h F Join G : \  | 
537  | 
\ (C Int extend_set h (project_set h C Int A)) \  | 
|
| 10834 | 538  | 
\ leadsTo[(%D. C Int extend_set h D)`givenBy v] (extend_set h B)";  | 
| 8044 | 539  | 
by (etac leadsETo_induct 1);  | 
540  | 
by (asm_simp_tac (simpset() delsimps UN_simps  | 
|
541  | 
addsimps [Int_UN_distrib, leadsETo_UN, extend_set_Union]) 3);  | 
|
542  | 
by (blast_tac (claset() addIs [e_psp_stable2 RS leadsETo_weaken_L,  | 
|
543  | 
leadsETo_Trans]) 2);  | 
|
| 8110 | 544  | 
by Auto_tac;  | 
| 
8072
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
545  | 
by (force_tac (claset() addIs [leadsETo_Basis, subset_imp_ensures],  | 
| 
 
5b95377d7538
removing the "{} : CC" requirement for leadsTo[CC]
 
paulson 
parents: 
8069 
diff
changeset
 | 
546  | 
simpset()) 1);  | 
| 8044 | 547  | 
by (rtac leadsETo_Basis 1);  | 
548  | 
by (asm_simp_tac (simpset() addsimps [Int_Diff, Int_extend_set_lemma,  | 
|
549  | 
extend_set_Diff_distrib RS sym]) 2);  | 
|
550  | 
by (rtac Join_project_ensures_strong 1);  | 
|
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
551  | 
by (auto_tac (claset() addDs [preserves_o_project_transient_empty]  | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
552  | 
addIs [project_stable_project_set],  | 
| 
9403
 
aad13b59b8d9
much tidying in connection with the 2nd UNITY paper
 
paulson 
parents: 
9389 
diff
changeset
 | 
553  | 
simpset() addsimps [Int_left_absorb]));  | 
| 8044 | 554  | 
by (asm_simp_tac  | 
555  | 
(simpset() addsimps [stable_ensures_Int RS ensures_weaken_R,  | 
|
556  | 
Int_lower2, project_stable_project_set,  | 
|
| 
9403
 
aad13b59b8d9
much tidying in connection with the 2nd UNITY paper
 
paulson 
parents: 
9389 
diff
changeset
 | 
557  | 
extend_stable_project_set]) 1);  | 
| 8044 | 558  | 
val lemma = result();  | 
559  | 
||
560  | 
Goal "[| extend h F Join G : stable C; \  | 
|
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
561  | 
\ F Join project h C G : \  | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
562  | 
\ (project_set h C Int A) \  | 
| 10834 | 563  | 
\ leadsTo[(%D. project_set h C Int D)`givenBy v] B; \  | 
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
564  | 
\ G : preserves (v o f) |] \  | 
| 8044 | 565  | 
\ ==> extend h F Join G : (C Int extend_set h A) \  | 
| 10834 | 566  | 
\ leadsTo[(%D. C Int extend_set h D)`givenBy v] (extend_set h B)";  | 
| 8044 | 567  | 
by (rtac (lemma RS leadsETo_weaken) 1);  | 
| 
8069
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
568  | 
by (auto_tac (claset(),  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
569  | 
simpset() addsimps [split_extended_all]));  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
570  | 
qed "project_leadsETo_D_lemma";  | 
| 8044 | 571  | 
|
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
572  | 
Goal "[| F Join project h UNIV G : A leadsTo[givenBy v] B; \  | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
573  | 
\ G : preserves (v o f) |] \  | 
| 8044 | 574  | 
\ ==> extend h F Join G : (extend_set h A) \  | 
575  | 
\ leadsTo[givenBy (v o f)] (extend_set h B)";  | 
|
| 
8069
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
576  | 
by (rtac (make_elim project_leadsETo_D_lemma) 1);  | 
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
577  | 
by (stac stable_UNIV 1);  | 
| 8044 | 578  | 
by Auto_tac;  | 
579  | 
by (etac leadsETo_givenBy 1);  | 
|
| 
8069
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
580  | 
by (rtac (givenBy_o_eq_extend_set RS equalityD2) 1);  | 
| 8044 | 581  | 
qed "project_leadsETo_D";  | 
582  | 
||
583  | 
Goal "[| F Join project h (reachable (extend h F Join G)) G \  | 
|
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
584  | 
\ : A LeadsTo[givenBy v] B; \  | 
| 
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
585  | 
\ G : preserves (v o f) |] \  | 
| 8044 | 586  | 
\ ==> extend h F Join G : \  | 
587  | 
\ (extend_set h A) LeadsTo[givenBy (v o f)] (extend_set h B)";  | 
|
588  | 
by (rtac (make_elim (subset_refl RS stable_reachable RS  | 
|
| 
8069
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
589  | 
project_leadsETo_D_lemma)) 1);  | 
| 8044 | 590  | 
by (auto_tac (claset(),  | 
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
591  | 
simpset() addsimps [LeadsETo_def]));  | 
| 8044 | 592  | 
by (asm_full_simp_tac  | 
593  | 
(simpset() addsimps [project_set_reachable_extend_eq RS sym]) 1);  | 
|
594  | 
by (etac (impOfSubs leadsETo_mono) 1);  | 
|
595  | 
by (blast_tac (claset() addIs [extend_set_givenBy_I]) 1);  | 
|
596  | 
qed "project_LeadsETo_D";  | 
|
597  | 
||
598  | 
Goalw [extending_def]  | 
|
| 
10064
 
1a77667b21ef
added compatibility relation: AllowedActs, Allowed, ok,
 
paulson 
parents: 
9403 
diff
changeset
 | 
599  | 
"(ALL G. extend h F ok G --> G : preserves (v o f)) \  | 
| 
 
1a77667b21ef
added compatibility relation: AllowedActs, Allowed, ok,
 
paulson 
parents: 
9403 
diff
changeset
 | 
600  | 
\ ==> extending (%G. UNIV) h F \  | 
| 8044 | 601  | 
\ (extend_set h A leadsTo[givenBy (v o f)] extend_set h B) \  | 
602  | 
\ (A leadsTo[givenBy v] B)";  | 
|
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
603  | 
by (auto_tac (claset(), simpset() addsimps [project_leadsETo_D]));  | 
| 8044 | 604  | 
qed "extending_leadsETo";  | 
605  | 
||
606  | 
||
607  | 
Goalw [extending_def]  | 
|
| 
10064
 
1a77667b21ef
added compatibility relation: AllowedActs, Allowed, ok,
 
paulson 
parents: 
9403 
diff
changeset
 | 
608  | 
"(ALL G. extend h F ok G --> G : preserves (v o f)) \  | 
| 
 
1a77667b21ef
added compatibility relation: AllowedActs, Allowed, ok,
 
paulson 
parents: 
9403 
diff
changeset
 | 
609  | 
\ ==> extending (%G. reachable (extend h F Join G)) h F \  | 
| 8044 | 610  | 
\ (extend_set h A LeadsTo[givenBy (v o f)] extend_set h B) \  | 
611  | 
\ (A LeadsTo[givenBy v] B)";  | 
|
| 
8055
 
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
 
paulson 
parents: 
8044 
diff
changeset
 | 
612  | 
by (blast_tac (claset() addIs [project_LeadsETo_D]) 1);  | 
| 8044 | 613  | 
qed "extending_LeadsETo";  | 
614  | 
||
615  | 
||
| 
8069
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
616  | 
(*** leadsETo in the precondition ***)  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
617  | 
|
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
618  | 
(*Lemma for the Trans case*)  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
619  | 
Goal "[| extend h F Join G : stable C; \  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
620  | 
\ F Join project h C G \  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
621  | 
\ : project_set h C Int project_set h A leadsTo project_set h B |] \  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
622  | 
\ ==> F Join project h C G \  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
623  | 
\ : project_set h C Int project_set h A leadsTo \  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
624  | 
\ project_set h C Int project_set h B";  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
625  | 
by (rtac (psp_stable2 RS leadsTo_weaken_L) 1);  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
626  | 
by (auto_tac (claset(),  | 
| 
9403
 
aad13b59b8d9
much tidying in connection with the 2nd UNITY paper
 
paulson 
parents: 
9389 
diff
changeset
 | 
627  | 
simpset() addsimps [project_stable_project_set,  | 
| 
8069
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
628  | 
extend_stable_project_set]));  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
629  | 
val lemma = result();  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
630  | 
|
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
631  | 
Goal "[| extend h F Join G : stable C; \  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
632  | 
\ extend h F Join G : \  | 
| 10834 | 633  | 
\ (C Int A) leadsTo[(%D. C Int D)`givenBy f] B |] \  | 
| 
8069
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
634  | 
\ ==> F Join project h C G \  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
635  | 
\ : (project_set h C Int project_set h (C Int A)) leadsTo (project_set h B)";  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
636  | 
by (etac leadsETo_induct 1);  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
637  | 
by (asm_simp_tac (HOL_ss addsimps [Int_UN_distrib, project_set_Union]) 3);  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
638  | 
by (blast_tac (claset() addIs [leadsTo_UN]) 3);  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
639  | 
by (blast_tac (claset() addIs [leadsTo_Trans, lemma]) 2);  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
640  | 
by (asm_full_simp_tac  | 
| 
9403
 
aad13b59b8d9
much tidying in connection with the 2nd UNITY paper
 
paulson 
parents: 
9389 
diff
changeset
 | 
641  | 
(simpset() addsimps [givenBy_eq_extend_set]) 1);  | 
| 
8069
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
642  | 
by (rtac leadsTo_Basis 1);  | 
| 
10064
 
1a77667b21ef
added compatibility relation: AllowedActs, Allowed, ok,
 
paulson 
parents: 
9403 
diff
changeset
 | 
643  | 
by (blast_tac (claset() addIs [ensures_extend_set_imp_project_ensures]) 1);  | 
| 
8069
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
644  | 
|
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
645  | 
qed "project_leadsETo_I_lemma";  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
646  | 
|
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
647  | 
Goal "extend h F Join G : (extend_set h A) leadsTo[givenBy f] (extend_set h B)\  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
648  | 
\ ==> F Join project h UNIV G : A leadsTo B";  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
649  | 
by (rtac (project_leadsETo_I_lemma RS leadsTo_weaken) 1);  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
650  | 
by Auto_tac;  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
651  | 
qed "project_leadsETo_I";  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
652  | 
|
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
653  | 
Goal "extend h F Join G : (extend_set h A) LeadsTo[givenBy f] (extend_set h B)\  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
654  | 
\ ==> F Join project h (reachable (extend h F Join G)) G \  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
655  | 
\ : A LeadsTo B";  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
656  | 
by (full_simp_tac (simpset() addsimps [LeadsTo_def, LeadsETo_def]) 1);  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
657  | 
by (rtac (project_leadsETo_I_lemma RS leadsTo_weaken) 1);  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
658  | 
by (auto_tac (claset(),  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
659  | 
simpset() addsimps [project_set_reachable_extend_eq RS sym]));  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
660  | 
qed "project_LeadsETo_I";  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
661  | 
|
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
662  | 
Goalw [projecting_def]  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
663  | 
"projecting (%G. UNIV) h F \  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
664  | 
\ (extend_set h A leadsTo[givenBy f] extend_set h B) \  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
665  | 
\ (A leadsTo B)";  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
666  | 
by (force_tac (claset() addDs [project_leadsETo_I], simpset()) 1);  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
667  | 
qed "projecting_leadsTo";  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
668  | 
|
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
669  | 
Goalw [projecting_def]  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
670  | 
"projecting (%G. reachable (extend h F Join G)) h F \  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
671  | 
\ (extend_set h A LeadsTo[givenBy f] extend_set h B) \  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
672  | 
\ (A LeadsTo B)";  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
673  | 
by (force_tac (claset() addDs [project_LeadsETo_I], simpset()) 1);  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
674  | 
qed "projecting_LeadsTo";  | 
| 
 
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
 
paulson 
parents: 
8067 
diff
changeset
 | 
675  | 
|
| 8044 | 676  | 
Close_locale "Extend";  | 
677  | 
||
678  |