216 "(EX x. P(x) | Q(x)) <-> ((EX x. P(x)) | (EX x. Q(x)))"; |
216 "(EX x. P(x) | Q(x)) <-> ((EX x. P(x)) | (EX x. Q(x)))"; |
217 int_prove "all_conj_distrib" |
217 int_prove "all_conj_distrib" |
218 "(ALL x. P(x) & Q(x)) <-> ((ALL x. P(x)) & (ALL x. Q(x)))"; |
218 "(ALL x. P(x) & Q(x)) <-> ((ALL x. P(x)) & (ALL x. Q(x)))"; |
219 |
219 |
220 |
220 |
|
221 local |
|
222 val uncurry = prove_goal (the_context()) "P --> Q --> R ==> P & Q --> R" |
|
223 (fn prems => [cut_facts_tac prems 1, Blast_tac 1]); |
|
224 |
|
225 val iff_allI = allI RS |
|
226 prove_goal (the_context()) "ALL x. P(x) <-> Q(x) ==> (ALL x. P(x)) <-> (ALL x. Q(x))" |
|
227 (fn prems => [cut_facts_tac prems 1, Blast_tac 1]) |
|
228 in |
|
229 |
221 (** make simplification procedures for quantifier elimination **) |
230 (** make simplification procedures for quantifier elimination **) |
222 structure Quantifier1 = Quantifier1Fun( |
231 structure Quantifier1 = Quantifier1Fun( |
223 struct |
232 struct |
224 (*abstract syntax*) |
233 (*abstract syntax*) |
225 fun dest_eq((c as Const("op =",_)) $ s $ t) = Some(c,s,t) |
234 fun dest_eq((c as Const("op =",_)) $ s $ t) = Some(c,s,t) |
226 | dest_eq _ = None; |
235 | dest_eq _ = None; |
227 fun dest_conj((c as Const("op &",_)) $ s $ t) = Some(c,s,t) |
236 fun dest_conj((c as Const("op &",_)) $ s $ t) = Some(c,s,t) |
228 | dest_conj _ = None; |
237 | dest_conj _ = None; |
|
238 fun dest_imp((c as Const("op -->",_)) $ s $ t) = Some(c,s,t) |
|
239 | dest_imp _ = None; |
229 val conj = FOLogic.conj |
240 val conj = FOLogic.conj |
230 val imp = FOLogic.imp |
241 val imp = FOLogic.imp |
231 (*rules*) |
242 (*rules*) |
232 val iff_reflection = iff_reflection |
243 val iff_reflection = iff_reflection |
233 val iffI = iffI |
244 val iffI = iffI |
234 val sym = sym |
|
235 val conjI= conjI |
245 val conjI= conjI |
236 val conjE= conjE |
246 val conjE= conjE |
237 val impI = impI |
247 val impI = impI |
238 val impE = impE |
|
239 val mp = mp |
248 val mp = mp |
|
249 val uncurry = uncurry |
240 val exI = exI |
250 val exI = exI |
241 val exE = exE |
251 val exE = exE |
242 val allI = allI |
252 val iff_allI = iff_allI |
243 val allE = allE |
|
244 end); |
253 end); |
|
254 |
|
255 end; |
245 |
256 |
246 local |
257 local |
247 |
258 |
248 val ex_pattern = |
259 val ex_pattern = |
249 read_cterm (Theory.sign_of (the_context ())) ("EX x. P(x) & Q(x)", FOLogic.oT) |
260 read_cterm (Theory.sign_of (the_context ())) ("EX x. P(x) & Q(x)", FOLogic.oT) |
250 |
261 |
251 val all_pattern = |
262 val all_pattern = |
252 read_cterm (Theory.sign_of (the_context ())) ("ALL x. P(x) & P'(x) --> Q(x)", FOLogic.oT) |
263 read_cterm (Theory.sign_of (the_context ())) ("ALL x. P(x) --> Q(x)", FOLogic.oT) |
253 |
264 |
254 in |
265 in |
255 val defEX_regroup = |
266 val defEX_regroup = |
256 mk_simproc "defined EX" [ex_pattern] Quantifier1.rearrange_ex; |
267 mk_simproc "defined EX" [ex_pattern] Quantifier1.rearrange_ex; |
257 val defALL_regroup = |
268 val defALL_regroup = |