author | paulson |
Thu, 11 Nov 1999 10:25:17 +0100 | |
changeset 8005 | b64d86018785 |
parent 7915 | c7fd7eb3b0ef |
child 8069 | 19b9f92ca503 |
permissions | -rw-r--r-- |
4776 | 1 |
(* Title: HOL/UNITY/UNITY |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1998 University of Cambridge |
|
5 |
||
6 |
The basic UNITY theory (revised version, based upon the "co" operator) |
|
7 |
||
8 |
From Misra, "A Logic for Concurrent Programming", 1994 |
|
9 |
*) |
|
10 |
||
11 |
set proof_timing; |
|
12 |
||
13 |
||
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
14 |
(*** General lemmas ***) |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
15 |
|
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
16 |
Goal "UNIV Times UNIV = UNIV"; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
17 |
by Auto_tac; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
18 |
qed "UNIV_Times_UNIV"; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
19 |
Addsimps [UNIV_Times_UNIV]; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
20 |
|
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
21 |
Goal "- (UNIV Times A) = UNIV Times (-A)"; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
22 |
by Auto_tac; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
23 |
qed "Compl_Times_UNIV1"; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
24 |
|
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
25 |
Goal "- (A Times UNIV) = (-A) Times UNIV"; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
26 |
by Auto_tac; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
27 |
qed "Compl_Times_UNIV2"; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
28 |
|
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
29 |
Addsimps [Compl_Times_UNIV1, Compl_Times_UNIV2]; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
30 |
|
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
31 |
|
6535 | 32 |
(*** The abstract type of programs ***) |
33 |
||
34 |
val rep_ss = simpset() addsimps |
|
35 |
[Init_def, Acts_def, mk_program_def, Program_def, Rep_Program, |
|
36 |
Rep_Program_inverse, Abs_Program_inverse]; |
|
37 |
||
38 |
||
39 |
Goal "Id : Acts F"; |
|
40 |
by (cut_inst_tac [("x", "F")] Rep_Program 1); |
|
41 |
by (auto_tac (claset(), rep_ss)); |
|
42 |
qed "Id_in_Acts"; |
|
43 |
AddIffs [Id_in_Acts]; |
|
44 |
||
45 |
Goal "insert Id (Acts F) = Acts F"; |
|
46 |
by (simp_tac (simpset() addsimps [insert_absorb, Id_in_Acts]) 1); |
|
47 |
qed "insert_Id_Acts"; |
|
48 |
AddIffs [insert_Id_Acts]; |
|
49 |
||
50 |
(** Inspectors for type "program" **) |
|
51 |
||
52 |
Goal "Init (mk_program (init,acts)) = init"; |
|
53 |
by (auto_tac (claset(), rep_ss)); |
|
54 |
qed "Init_eq"; |
|
55 |
||
56 |
Goal "Acts (mk_program (init,acts)) = insert Id acts"; |
|
57 |
by (auto_tac (claset(), rep_ss)); |
|
58 |
qed "Acts_eq"; |
|
59 |
||
60 |
Addsimps [Acts_eq, Init_eq]; |
|
61 |
||
62 |
||
63 |
(** The notation of equality for type "program" **) |
|
64 |
||
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7826
diff
changeset
|
65 |
|
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7826
diff
changeset
|
66 |
Goal "mk_program (Init F, Acts F) = F"; |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7826
diff
changeset
|
67 |
by (cut_inst_tac [("x", "F")] Rep_Program 1); |
6535 | 68 |
by (auto_tac (claset(), rep_ss)); |
69 |
by (REPEAT (dres_inst_tac [("f", "Abs_Program")] arg_cong 1)); |
|
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7826
diff
changeset
|
70 |
by (asm_full_simp_tac (rep_ss addsimps [insert_absorb]) 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7826
diff
changeset
|
71 |
qed "surjective_mk_program"; |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7826
diff
changeset
|
72 |
|
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7826
diff
changeset
|
73 |
Goal "[| Init F = Init G; Acts F = Acts G |] ==> F = G"; |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7826
diff
changeset
|
74 |
by (stac (surjective_mk_program RS sym) 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7826
diff
changeset
|
75 |
by (stac (surjective_mk_program RS sym) 1 THEN Force_tac 1); |
6535 | 76 |
qed "program_equalityI"; |
77 |
||
78 |
val [major,minor] = |
|
79 |
Goal "[| F = G; [| Init F = Init G; Acts F = Acts G |] ==> P |] ==> P"; |
|
80 |
by (rtac minor 1); |
|
81 |
by (auto_tac (claset(), simpset() addsimps [major])); |
|
82 |
qed "program_equalityE"; |
|
83 |
||
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7826
diff
changeset
|
84 |
Addsimps [surjective_mk_program]; |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7826
diff
changeset
|
85 |
|
6535 | 86 |
|
87 |
(*** These rules allow "lazy" definition expansion |
|
88 |
They avoid expanding the full program, which is a large expression |
|
89 |
***) |
|
90 |
||
91 |
Goal "F == mk_program (init,acts) ==> Init F = init"; |
|
92 |
by Auto_tac; |
|
93 |
qed "def_prg_Init"; |
|
94 |
||
95 |
(*The program is not expanded, but its Init and Acts are*) |
|
96 |
val [rew] = goal thy |
|
97 |
"[| F == mk_program (init,acts) |] \ |
|
98 |
\ ==> Init F = init & Acts F = insert Id acts"; |
|
99 |
by (rewtac rew); |
|
100 |
by Auto_tac; |
|
101 |
qed "def_prg_simps"; |
|
102 |
||
103 |
(*An action is expanded only if a pair of states is being tested against it*) |
|
104 |
Goal "[| act == {(s,s'). P s s'} |] ==> ((s,s') : act) = P s s'"; |
|
105 |
by Auto_tac; |
|
106 |
qed "def_act_simp"; |
|
107 |
||
108 |
fun simp_of_act def = def RS def_act_simp; |
|
109 |
||
110 |
(*A set is expanded only if an element is being tested against it*) |
|
111 |
Goal "A == B ==> (x : A) = (x : B)"; |
|
112 |
by Auto_tac; |
|
113 |
qed "def_set_simp"; |
|
114 |
||
115 |
fun simp_of_set def = def RS def_set_simp; |
|
116 |
||
117 |
||
6536 | 118 |
(*** co ***) |
4776 | 119 |
|
7403 | 120 |
(*These operators are not overloaded, but their operands are sets, and |
121 |
ultimately there's a risk of reaching equality, which IS overloaded*) |
|
122 |
overload_1st_set "UNITY.constrains"; |
|
5648 | 123 |
overload_1st_set "UNITY.stable"; |
124 |
overload_1st_set "UNITY.unless"; |
|
5340 | 125 |
|
5277
e4297d03e5d2
A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents:
5253
diff
changeset
|
126 |
val prems = Goalw [constrains_def] |
5648 | 127 |
"(!!act s s'. [| act: Acts F; (s,s') : act; s: A |] ==> s': A') \ |
6536 | 128 |
\ ==> F : A co A'"; |
4776 | 129 |
by (blast_tac (claset() addIs prems) 1); |
130 |
qed "constrainsI"; |
|
131 |
||
5069 | 132 |
Goalw [constrains_def] |
6536 | 133 |
"[| F : A co A'; act: Acts F; (s,s'): act; s: A |] ==> s': A'"; |
4776 | 134 |
by (Blast_tac 1); |
135 |
qed "constrainsD"; |
|
136 |
||
6536 | 137 |
Goalw [constrains_def] "F : {} co B"; |
4776 | 138 |
by (Blast_tac 1); |
139 |
qed "constrains_empty"; |
|
140 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
141 |
Goalw [constrains_def] "(F : A co {}) = (A={})"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
142 |
by (Blast_tac 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
143 |
qed "constrains_empty2"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
144 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
145 |
Goalw [constrains_def] "(F : UNIV co B) = (B = UNIV)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
146 |
by (Blast_tac 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
147 |
qed "constrains_UNIV"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
148 |
|
6536 | 149 |
Goalw [constrains_def] "F : A co UNIV"; |
4776 | 150 |
by (Blast_tac 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
151 |
qed "constrains_UNIV2"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
152 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
153 |
AddIffs [constrains_empty, constrains_empty2, |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
154 |
constrains_UNIV, constrains_UNIV2]; |
4776 | 155 |
|
5648 | 156 |
(*monotonic in 2nd argument*) |
5069 | 157 |
Goalw [constrains_def] |
6536 | 158 |
"[| F : A co A'; A'<=B' |] ==> F : A co B'"; |
4776 | 159 |
by (Blast_tac 1); |
160 |
qed "constrains_weaken_R"; |
|
161 |
||
5648 | 162 |
(*anti-monotonic in 1st argument*) |
5069 | 163 |
Goalw [constrains_def] |
6536 | 164 |
"[| F : A co A'; B<=A |] ==> F : B co A'"; |
4776 | 165 |
by (Blast_tac 1); |
166 |
qed "constrains_weaken_L"; |
|
167 |
||
5069 | 168 |
Goalw [constrains_def] |
6536 | 169 |
"[| F : A co A'; B<=A; A'<=B' |] ==> F : B co B'"; |
4776 | 170 |
by (Blast_tac 1); |
171 |
qed "constrains_weaken"; |
|
172 |
||
173 |
(** Union **) |
|
174 |
||
5069 | 175 |
Goalw [constrains_def] |
7345 | 176 |
"[| F : A co A'; F : B co B' |] ==> F : (A Un B) co (A' Un B')"; |
4776 | 177 |
by (Blast_tac 1); |
178 |
qed "constrains_Un"; |
|
179 |
||
5069 | 180 |
Goalw [constrains_def] |
7345 | 181 |
"ALL i:I. F : (A i) co (A' i) ==> F : (UN i:I. A i) co (UN i:I. A' i)"; |
4776 | 182 |
by (Blast_tac 1); |
183 |
qed "ball_constrains_UN"; |
|
184 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
185 |
Goalw [constrains_def] "(A Un B) co C = (A co C) Int (B co C)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
186 |
by (Blast_tac 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
187 |
qed "constrains_Un_distrib"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
188 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
189 |
Goalw [constrains_def] "(UN i:I. A i) co B = (INT i:I. A i co B)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
190 |
by (Blast_tac 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
191 |
qed "constrains_UN_distrib"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
192 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
193 |
Goalw [constrains_def] "C co (A Int B) = (C co A) Int (C co B)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
194 |
by (Blast_tac 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
195 |
qed "constrains_Int_distrib"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
196 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
197 |
Goalw [constrains_def] "A co (INT i:I. B i) = (INT i:I. A co B i)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
198 |
by (Blast_tac 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
199 |
qed "constrains_INT_distrib"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7630
diff
changeset
|
200 |
|
4776 | 201 |
(** Intersection **) |
202 |
||
5069 | 203 |
Goalw [constrains_def] |
7345 | 204 |
"[| F : A co A'; F : B co B' |] ==> F : (A Int B) co (A' Int B')"; |
4776 | 205 |
by (Blast_tac 1); |
206 |
qed "constrains_Int"; |
|
207 |
||
5069 | 208 |
Goalw [constrains_def] |
7345 | 209 |
"ALL i:I. F : (A i) co (A' i) ==> F : (INT i:I. A i) co (INT i:I. A' i)"; |
4776 | 210 |
by (Blast_tac 1); |
211 |
qed "ball_constrains_INT"; |
|
212 |
||
6536 | 213 |
Goalw [constrains_def] "F : A co A' ==> A <= A'"; |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6012
diff
changeset
|
214 |
by Auto_tac; |
5277
e4297d03e5d2
A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents:
5253
diff
changeset
|
215 |
qed "constrains_imp_subset"; |
4776 | 216 |
|
6536 | 217 |
(*The reasoning is by subsets since "co" refers to single actions |
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
218 |
only. So this rule isn't that useful.*) |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6012
diff
changeset
|
219 |
Goalw [constrains_def] |
6536 | 220 |
"[| F : A co B; F : B co C |] ==> F : A co C"; |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6012
diff
changeset
|
221 |
by (Blast_tac 1); |
5277
e4297d03e5d2
A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents:
5253
diff
changeset
|
222 |
qed "constrains_trans"; |
4776 | 223 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6012
diff
changeset
|
224 |
Goalw [constrains_def] |
7345 | 225 |
"[| F : A co (A' Un B); F : B co B' |] ==> F : A co (A' Un B')"; |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6012
diff
changeset
|
226 |
by (Clarify_tac 1); |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6012
diff
changeset
|
227 |
by (Blast_tac 1); |
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
228 |
qed "constrains_cancel"; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5804
diff
changeset
|
229 |
|
4776 | 230 |
|
7630 | 231 |
(*** unless ***) |
232 |
||
233 |
Goalw [unless_def] "F : (A-B) co (A Un B) ==> F : A unless B"; |
|
234 |
by (assume_tac 1); |
|
235 |
qed "unlessI"; |
|
236 |
||
237 |
Goalw [unless_def] "F : A unless B ==> F : (A-B) co (A Un B)"; |
|
238 |
by (assume_tac 1); |
|
239 |
qed "unlessD"; |
|
240 |
||
241 |
||
4776 | 242 |
(*** stable ***) |
243 |
||
6536 | 244 |
Goalw [stable_def] "F : A co A ==> F : stable A"; |
4776 | 245 |
by (assume_tac 1); |
246 |
qed "stableI"; |
|
247 |
||
6536 | 248 |
Goalw [stable_def] "F : stable A ==> F : A co A"; |
4776 | 249 |
by (assume_tac 1); |
250 |
qed "stableD"; |
|
251 |
||
7594
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7403
diff
changeset
|
252 |
Goalw [stable_def, constrains_def] "stable UNIV = UNIV"; |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7403
diff
changeset
|
253 |
by Auto_tac; |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7403
diff
changeset
|
254 |
qed "stable_UNIV"; |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7403
diff
changeset
|
255 |
Addsimps [stable_UNIV]; |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7403
diff
changeset
|
256 |
|
5804
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
257 |
(** Union **) |
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
258 |
|
5069 | 259 |
Goalw [stable_def] |
5648 | 260 |
"[| F : stable A; F : stable A' |] ==> F : stable (A Un A')"; |
4776 | 261 |
by (blast_tac (claset() addIs [constrains_Un]) 1); |
262 |
qed "stable_Un"; |
|
263 |
||
5069 | 264 |
Goalw [stable_def] |
5804
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
265 |
"ALL i:I. F : stable (A i) ==> F : stable (UN i:I. A i)"; |
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
266 |
by (blast_tac (claset() addIs [ball_constrains_UN]) 1); |
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
267 |
qed "ball_stable_UN"; |
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
268 |
|
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
269 |
(** Intersection **) |
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
270 |
|
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
271 |
Goalw [stable_def] |
5648 | 272 |
"[| F : stable A; F : stable A' |] ==> F : stable (A Int A')"; |
4776 | 273 |
by (blast_tac (claset() addIs [constrains_Int]) 1); |
274 |
qed "stable_Int"; |
|
275 |
||
5804
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
276 |
Goalw [stable_def] |
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
277 |
"ALL i:I. F : stable (A i) ==> F : stable (INT i:I. A i)"; |
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
278 |
by (blast_tac (claset() addIs [ball_constrains_INT]) 1); |
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
279 |
qed "ball_stable_INT"; |
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
280 |
|
5277
e4297d03e5d2
A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents:
5253
diff
changeset
|
281 |
Goalw [stable_def, constrains_def] |
7345 | 282 |
"[| F : stable C; F : A co (C Un A') |] ==> F : (C Un A) co (C Un A')"; |
4776 | 283 |
by (Blast_tac 1); |
5277
e4297d03e5d2
A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents:
5253
diff
changeset
|
284 |
qed "stable_constrains_Un"; |
4776 | 285 |
|
5277
e4297d03e5d2
A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents:
5253
diff
changeset
|
286 |
Goalw [stable_def, constrains_def] |
7345 | 287 |
"[| F : stable C; F : (C Int A) co A' |] ==> F : (C Int A) co (C Int A')"; |
4776 | 288 |
by (Blast_tac 1); |
5277
e4297d03e5d2
A higher-level treatment of LeadsTo, minimizing use of "reachable"
paulson
parents:
5253
diff
changeset
|
289 |
qed "stable_constrains_Int"; |
4776 | 290 |
|
6536 | 291 |
(*[| F : stable C; F : co (C Int A) A |] ==> F : stable (C Int A)*) |
5648 | 292 |
bind_thm ("stable_constrains_stable", stable_constrains_Int RS stableI); |
293 |
||
294 |
||
5804
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
295 |
(*** invariant ***) |
5648 | 296 |
|
297 |
Goal "[| Init F<=A; F: stable A |] ==> F : invariant A"; |
|
298 |
by (asm_simp_tac (simpset() addsimps [invariant_def]) 1); |
|
299 |
qed "invariantI"; |
|
300 |
||
301 |
(*Could also say "invariant A Int invariant B <= invariant (A Int B)"*) |
|
302 |
Goal "[| F : invariant A; F : invariant B |] ==> F : invariant (A Int B)"; |
|
303 |
by (auto_tac (claset(), simpset() addsimps [invariant_def, stable_Int])); |
|
304 |
qed "invariant_Int"; |
|
305 |
||
306 |
||
307 |
(*** increasing ***) |
|
308 |
||
309 |
Goalw [increasing_def, stable_def, constrains_def] |
|
6712 | 310 |
"mono g ==> increasing f <= increasing (g o f)"; |
5648 | 311 |
by Auto_tac; |
6712 | 312 |
by (blast_tac (claset() addIs [monoD, order_trans]) 1); |
313 |
qed "mono_increasing_o"; |
|
5648 | 314 |
|
315 |
Goalw [increasing_def] |
|
316 |
"increasing f <= {F. ALL z::nat. F: stable {s. z < f s}}"; |
|
317 |
by (simp_tac (simpset() addsimps [Suc_le_eq RS sym]) 1); |
|
318 |
by (Blast_tac 1); |
|
5804
8e0a4c4fd67b
Revising the Client proof as suggested by Michel Charpentier. New lemmas
paulson
parents:
5669
diff
changeset
|
319 |
qed "increasing_stable_less"; |
5648 | 320 |
|
321 |
||
322 |
(** The Elimination Theorem. The "free" m has become universally quantified! |
|
323 |
Should the premise be !!m instead of ALL m ? Would make it harder to use |
|
324 |
in forward proof. **) |
|
325 |
||
5069 | 326 |
Goalw [constrains_def] |
6536 | 327 |
"[| ALL m:M. F : {s. s x = m} co (B m) |] \ |
328 |
\ ==> F : {s. s x : M} co (UN m:M. B m)"; |
|
4776 | 329 |
by (Blast_tac 1); |
330 |
qed "elimination"; |
|
331 |
||
332 |
(*As above, but for the trivial case of a one-variable state, in which the |
|
333 |
state is identified with its one variable.*) |
|
5069 | 334 |
Goalw [constrains_def] |
6536 | 335 |
"(ALL m:M. F : {m} co (B m)) ==> F : M co (UN m:M. B m)"; |
4776 | 336 |
by (Blast_tac 1); |
337 |
qed "elimination_sing"; |
|
338 |
||
339 |
||
340 |
||
341 |
(*** Theoretical Results from Section 6 ***) |
|
342 |
||
5069 | 343 |
Goalw [constrains_def, strongest_rhs_def] |
6536 | 344 |
"F : A co (strongest_rhs F A )"; |
4776 | 345 |
by (Blast_tac 1); |
346 |
qed "constrains_strongest_rhs"; |
|
347 |
||
5069 | 348 |
Goalw [constrains_def, strongest_rhs_def] |
6536 | 349 |
"F : A co B ==> strongest_rhs F A <= B"; |
4776 | 350 |
by (Blast_tac 1); |
351 |
qed "strongest_rhs_is_strongest"; |