author | nipkow |
Fri, 28 Nov 1997 07:41:24 +0100 | |
changeset 4321 | 2a2956ccb86c |
parent 4320 | 24d9e6639cd4 |
child 4327 | 2335f6584a1b |
permissions | -rw-r--r-- |
1465 | 1 |
(* Title: HOL/simpdata.ML |
923 | 2 |
ID: $Id$ |
1465 | 3 |
Author: Tobias Nipkow |
923 | 4 |
Copyright 1991 University of Cambridge |
5 |
||
6 |
Instantiation of the generic simplifier |
|
7 |
*) |
|
8 |
||
1984 | 9 |
section "Simplifier"; |
10 |
||
923 | 11 |
open Simplifier; |
12 |
||
1984 | 13 |
(*** Addition of rules to simpsets and clasets simultaneously ***) |
14 |
||
15 |
(*Takes UNCONDITIONAL theorems of the form A<->B to |
|
2031 | 16 |
the Safe Intr rule B==>A and |
17 |
the Safe Destruct rule A==>B. |
|
1984 | 18 |
Also ~A goes to the Safe Elim rule A ==> ?R |
19 |
Failing other cases, A is added as a Safe Intr rule*) |
|
20 |
local |
|
21 |
val iff_const = HOLogic.eq_const HOLogic.boolT; |
|
22 |
||
23 |
fun addIff th = |
|
24 |
(case HOLogic.dest_Trueprop (#prop(rep_thm th)) of |
|
2718 | 25 |
(Const("Not",_) $ A) => |
2031 | 26 |
AddSEs [zero_var_indexes (th RS notE)] |
27 |
| (con $ _ $ _) => |
|
28 |
if con=iff_const |
|
29 |
then (AddSIs [zero_var_indexes (th RS iffD2)]; |
|
30 |
AddSDs [zero_var_indexes (th RS iffD1)]) |
|
31 |
else AddSIs [th] |
|
32 |
| _ => AddSIs [th]; |
|
1984 | 33 |
Addsimps [th]) |
34 |
handle _ => error ("AddIffs: theorem must be unconditional\n" ^ |
|
2031 | 35 |
string_of_thm th) |
1984 | 36 |
|
37 |
fun delIff th = |
|
38 |
(case HOLogic.dest_Trueprop (#prop(rep_thm th)) of |
|
2718 | 39 |
(Const("Not",_) $ A) => |
2031 | 40 |
Delrules [zero_var_indexes (th RS notE)] |
41 |
| (con $ _ $ _) => |
|
42 |
if con=iff_const |
|
43 |
then Delrules [zero_var_indexes (th RS iffD2), |
|
3518 | 44 |
make_elim (zero_var_indexes (th RS iffD1))] |
2031 | 45 |
else Delrules [th] |
46 |
| _ => Delrules [th]; |
|
1984 | 47 |
Delsimps [th]) |
48 |
handle _ => warning("DelIffs: ignoring conditional theorem\n" ^ |
|
2031 | 49 |
string_of_thm th) |
1984 | 50 |
in |
51 |
val AddIffs = seq addIff |
|
52 |
val DelIffs = seq delIff |
|
53 |
end; |
|
54 |
||
4320
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
55 |
(** instantiate generic simp procs for `quantifier elimination': **) |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
56 |
structure Quantifier1 = Quantifier1Fun( |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
57 |
struct |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
58 |
(*abstract syntax*) |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
59 |
fun dest_eq((c as Const("op =",_)) $ s $ t) = Some(c,s,t) |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
60 |
| dest_eq _ = None; |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
61 |
fun dest_conj((c as Const("op &",_)) $ s $ t) = Some(c,s,t) |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
62 |
| dest_conj _ = None; |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
63 |
val conj = HOLogic.conj |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
64 |
val imp = HOLogic.imp |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
65 |
(*rules*) |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
66 |
val iff_reflection = eq_reflection |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
67 |
val iffI = iffI |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
68 |
val sym = sym |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
69 |
val conjI= conjI |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
70 |
val conjE= conjE |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
71 |
val impI = impI |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
72 |
val impE = impE |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
73 |
val mp = mp |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
74 |
val exI = exI |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
75 |
val exE = exE |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
76 |
val allI = allI |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
77 |
val allE = allE |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
78 |
end); |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
79 |
|
1984 | 80 |
|
923 | 81 |
local |
82 |
||
2935 | 83 |
fun prover s = prove_goal HOL.thy s (fn _ => [blast_tac HOL_cs 1]); |
923 | 84 |
|
1922 | 85 |
val P_imp_P_iff_True = prover "P --> (P = True)" RS mp; |
86 |
val P_imp_P_eq_True = P_imp_P_iff_True RS eq_reflection; |
|
923 | 87 |
|
1922 | 88 |
val not_P_imp_P_iff_F = prover "~P --> (P = False)" RS mp; |
89 |
val not_P_imp_P_eq_False = not_P_imp_P_iff_F RS eq_reflection; |
|
923 | 90 |
|
1922 | 91 |
fun atomize pairs = |
92 |
let fun atoms th = |
|
2031 | 93 |
(case concl_of th of |
94 |
Const("Trueprop",_) $ p => |
|
95 |
(case head_of p of |
|
96 |
Const(a,_) => |
|
97 |
(case assoc(pairs,a) of |
|
98 |
Some(rls) => flat (map atoms ([th] RL rls)) |
|
99 |
| None => [th]) |
|
100 |
| _ => [th]) |
|
101 |
| _ => [th]) |
|
1922 | 102 |
in atoms end; |
923 | 103 |
|
2134 | 104 |
fun gen_all th = forall_elim_vars (#maxidx(rep_thm th)+1) th; |
105 |
||
106 |
in |
|
107 |
||
3896
ee8ebb74ec00
Various new lemmas. Improved conversion of equations to rewrite rules:
nipkow
parents:
3842
diff
changeset
|
108 |
fun mk_meta_eq r = r RS eq_reflection; |
ee8ebb74ec00
Various new lemmas. Improved conversion of equations to rewrite rules:
nipkow
parents:
3842
diff
changeset
|
109 |
|
ee8ebb74ec00
Various new lemmas. Improved conversion of equations to rewrite rules:
nipkow
parents:
3842
diff
changeset
|
110 |
fun mk_meta_eq_simp r = case concl_of r of |
2031 | 111 |
Const("==",_)$_$_ => r |
3896
ee8ebb74ec00
Various new lemmas. Improved conversion of equations to rewrite rules:
nipkow
parents:
3842
diff
changeset
|
112 |
| _$(Const("op =",_)$lhs$rhs) => |
4117 | 113 |
(case fst(Logic.rewrite_rule_ok (#sign(rep_thm r)) (prems_of r) lhs rhs) of |
3896
ee8ebb74ec00
Various new lemmas. Improved conversion of equations to rewrite rules:
nipkow
parents:
3842
diff
changeset
|
114 |
None => mk_meta_eq r |
ee8ebb74ec00
Various new lemmas. Improved conversion of equations to rewrite rules:
nipkow
parents:
3842
diff
changeset
|
115 |
| Some _ => r RS P_imp_P_eq_True) |
2718 | 116 |
| _$(Const("Not",_)$_) => r RS not_P_imp_P_eq_False |
1922 | 117 |
| _ => r RS P_imp_P_eq_True; |
118 |
(* last 2 lines requires all formulae to be of the from Trueprop(.) *) |
|
923 | 119 |
|
2082 | 120 |
val simp_thms = map prover |
121 |
[ "(x=x) = True", |
|
122 |
"(~True) = False", "(~False) = True", "(~ ~ P) = P", |
|
123 |
"(~P) ~= P", "P ~= (~P)", "(P ~= Q) = (P = (~Q))", |
|
124 |
"(True=P) = P", "(P=True) = P", |
|
125 |
"(True --> P) = P", "(False --> P) = True", |
|
126 |
"(P --> True) = True", "(P --> P) = True", |
|
127 |
"(P --> False) = (~P)", "(P --> ~P) = (~P)", |
|
128 |
"(P & True) = P", "(True & P) = P", |
|
2800 | 129 |
"(P & False) = False", "(False & P) = False", |
130 |
"(P & P) = P", "(P & (P & Q)) = (P & Q)", |
|
3913 | 131 |
"(P & ~P) = False", "(~P & P) = False", |
2082 | 132 |
"(P | True) = True", "(True | P) = True", |
2800 | 133 |
"(P | False) = P", "(False | P) = P", |
134 |
"(P | P) = P", "(P | (P | Q)) = (P | Q)", |
|
3913 | 135 |
"(P | ~P) = True", "(~P | P) = True", |
2082 | 136 |
"((~P) = (~Q)) = (P=Q)", |
3842 | 137 |
"(!x. P) = P", "(? x. P) = P", "? x. x=t", "? x. t=x", |
3573 | 138 |
"(? x. x=t & P(x)) = P(t)", |
3568
36ff1ab12021
Prod.ML: Added split_paired_EX and lots of comments about failed attempts to
nipkow
parents:
3559
diff
changeset
|
139 |
"(! x. t=x --> P(x)) = P(t)" ]; |
923 | 140 |
|
988 | 141 |
(*Add congruence rules for = (instead of ==) *) |
2636
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
142 |
infix 4 addcongs delcongs; |
3559 | 143 |
fun ss addcongs congs = ss addeqcongs (map standard (congs RL [eq_reflection])); |
144 |
fun ss delcongs congs = ss deleqcongs (map standard (congs RL [eq_reflection])); |
|
923 | 145 |
|
4086 | 146 |
fun Addcongs congs = (simpset_ref() := simpset() addcongs congs); |
147 |
fun Delcongs congs = (simpset_ref() := simpset() delcongs congs); |
|
1264 | 148 |
|
3896
ee8ebb74ec00
Various new lemmas. Improved conversion of equations to rewrite rules:
nipkow
parents:
3842
diff
changeset
|
149 |
fun mksimps pairs = map mk_meta_eq_simp o atomize pairs o gen_all; |
923 | 150 |
|
1922 | 151 |
val imp_cong = impI RSN |
152 |
(2, prove_goal HOL.thy "(P=P')--> (P'--> (Q=Q'))--> ((P-->Q) = (P'-->Q'))" |
|
2935 | 153 |
(fn _=> [blast_tac HOL_cs 1]) RS mp RS mp); |
1922 | 154 |
|
1948
78e5bfcbc1e9
Added miniscoping to the simplifier: quantifiers are now pushed in
paulson
parents:
1922
diff
changeset
|
155 |
(*Miniscoping: pushing in existential quantifiers*) |
78e5bfcbc1e9
Added miniscoping to the simplifier: quantifiers are now pushed in
paulson
parents:
1922
diff
changeset
|
156 |
val ex_simps = map prover |
3842 | 157 |
["(EX x. P x & Q) = ((EX x. P x) & Q)", |
158 |
"(EX x. P & Q x) = (P & (EX x. Q x))", |
|
159 |
"(EX x. P x | Q) = ((EX x. P x) | Q)", |
|
160 |
"(EX x. P | Q x) = (P | (EX x. Q x))", |
|
161 |
"(EX x. P x --> Q) = ((ALL x. P x) --> Q)", |
|
162 |
"(EX x. P --> Q x) = (P --> (EX x. Q x))"]; |
|
1948
78e5bfcbc1e9
Added miniscoping to the simplifier: quantifiers are now pushed in
paulson
parents:
1922
diff
changeset
|
163 |
|
78e5bfcbc1e9
Added miniscoping to the simplifier: quantifiers are now pushed in
paulson
parents:
1922
diff
changeset
|
164 |
(*Miniscoping: pushing in universal quantifiers*) |
78e5bfcbc1e9
Added miniscoping to the simplifier: quantifiers are now pushed in
paulson
parents:
1922
diff
changeset
|
165 |
val all_simps = map prover |
3842 | 166 |
["(ALL x. P x & Q) = ((ALL x. P x) & Q)", |
167 |
"(ALL x. P & Q x) = (P & (ALL x. Q x))", |
|
168 |
"(ALL x. P x | Q) = ((ALL x. P x) | Q)", |
|
169 |
"(ALL x. P | Q x) = (P | (ALL x. Q x))", |
|
170 |
"(ALL x. P x --> Q) = ((EX x. P x) --> Q)", |
|
171 |
"(ALL x. P --> Q x) = (P --> (ALL x. Q x))"]; |
|
1948
78e5bfcbc1e9
Added miniscoping to the simplifier: quantifiers are now pushed in
paulson
parents:
1922
diff
changeset
|
172 |
|
923 | 173 |
|
2022 | 174 |
(* elimination of existential quantifiers in assumptions *) |
923 | 175 |
|
176 |
val ex_all_equiv = |
|
177 |
let val lemma1 = prove_goal HOL.thy |
|
178 |
"(? x. P(x) ==> PROP Q) ==> (!!x. P(x) ==> PROP Q)" |
|
179 |
(fn prems => [resolve_tac prems 1, etac exI 1]); |
|
180 |
val lemma2 = prove_goalw HOL.thy [Ex_def] |
|
181 |
"(!!x. P(x) ==> PROP Q) ==> (? x. P(x) ==> PROP Q)" |
|
182 |
(fn prems => [REPEAT(resolve_tac prems 1)]) |
|
183 |
in equal_intr lemma1 lemma2 end; |
|
184 |
||
185 |
end; |
|
186 |
||
3654 | 187 |
(* Elimination of True from asumptions: *) |
188 |
||
189 |
val True_implies_equals = prove_goal HOL.thy |
|
190 |
"(True ==> PROP P) == PROP P" |
|
191 |
(fn _ => [rtac equal_intr_rule 1, atac 2, |
|
192 |
METAHYPS (fn prems => resolve_tac prems 1) 1, |
|
193 |
rtac TrueI 1]); |
|
194 |
||
2935 | 195 |
fun prove nm thm = qed_goal nm HOL.thy thm (fn _ => [blast_tac HOL_cs 1]); |
923 | 196 |
|
197 |
prove "conj_commute" "(P&Q) = (Q&P)"; |
|
198 |
prove "conj_left_commute" "(P&(Q&R)) = (Q&(P&R))"; |
|
199 |
val conj_comms = [conj_commute, conj_left_commute]; |
|
2134 | 200 |
prove "conj_assoc" "((P&Q)&R) = (P&(Q&R))"; |
923 | 201 |
|
1922 | 202 |
prove "disj_commute" "(P|Q) = (Q|P)"; |
203 |
prove "disj_left_commute" "(P|(Q|R)) = (Q|(P|R))"; |
|
204 |
val disj_comms = [disj_commute, disj_left_commute]; |
|
2134 | 205 |
prove "disj_assoc" "((P|Q)|R) = (P|(Q|R))"; |
1922 | 206 |
|
923 | 207 |
prove "conj_disj_distribL" "(P&(Q|R)) = (P&Q | P&R)"; |
208 |
prove "conj_disj_distribR" "((P|Q)&R) = (P&R | Q&R)"; |
|
1485
240cc98b94a7
Added qed_spec_mp to avoid renaming of bound vars in 'th RS spec'
nipkow
parents:
1465
diff
changeset
|
209 |
|
1892 | 210 |
prove "disj_conj_distribL" "(P|(Q&R)) = ((P|Q) & (P|R))"; |
211 |
prove "disj_conj_distribR" "((P&Q)|R) = ((P|R) & (Q|R))"; |
|
212 |
||
2134 | 213 |
prove "imp_conjR" "(P --> (Q&R)) = ((P-->Q) & (P-->R))"; |
214 |
prove "imp_conjL" "((P&Q) -->R) = (P --> (Q --> R))"; |
|
215 |
prove "imp_disjL" "((P|Q) --> R) = ((P-->R)&(Q-->R))"; |
|
1892 | 216 |
|
3448 | 217 |
(*These two are specialized, but imp_disj_not1 is useful in Auth/Yahalom.ML*) |
218 |
prove "imp_disj_not1" "((P --> Q | R)) = (~Q --> P --> R)"; |
|
219 |
prove "imp_disj_not2" "((P --> Q | R)) = (~R --> P --> Q)"; |
|
220 |
||
3904 | 221 |
prove "imp_disj1" "((P-->Q)|R) = (P--> Q|R)"; |
222 |
prove "imp_disj2" "(Q|(P-->R)) = (P--> Q|R)"; |
|
223 |
||
1485
240cc98b94a7
Added qed_spec_mp to avoid renaming of bound vars in 'th RS spec'
nipkow
parents:
1465
diff
changeset
|
224 |
prove "de_Morgan_disj" "(~(P | Q)) = (~P & ~Q)"; |
240cc98b94a7
Added qed_spec_mp to avoid renaming of bound vars in 'th RS spec'
nipkow
parents:
1465
diff
changeset
|
225 |
prove "de_Morgan_conj" "(~(P & Q)) = (~P | ~Q)"; |
3446
a14e5451f613
Addition of not_imp (which pushes negation into implication) as a default
paulson
parents:
3282
diff
changeset
|
226 |
prove "not_imp" "(~(P --> Q)) = (P & ~Q)"; |
1922 | 227 |
prove "not_iff" "(P~=Q) = (P = (~Q))"; |
1485
240cc98b94a7
Added qed_spec_mp to avoid renaming of bound vars in 'th RS spec'
nipkow
parents:
1465
diff
changeset
|
228 |
|
2134 | 229 |
(*Avoids duplication of subgoals after expand_if, when the true and false |
230 |
cases boil down to the same thing.*) |
|
231 |
prove "cases_simp" "((P --> Q) & (~P --> Q)) = Q"; |
|
232 |
||
3842 | 233 |
prove "not_all" "(~ (! x. P(x))) = (? x.~P(x))"; |
1922 | 234 |
prove "imp_all" "((! x. P x) --> Q) = (? x. P x --> Q)"; |
3842 | 235 |
prove "not_ex" "(~ (? x. P(x))) = (! x.~P(x))"; |
1922 | 236 |
prove "imp_ex" "((? x. P x) --> Q) = (! x. P x --> Q)"; |
1660 | 237 |
|
1655 | 238 |
prove "ex_disj_distrib" "(? x. P(x) | Q(x)) = ((? x. P(x)) | (? x. Q(x)))"; |
239 |
prove "all_conj_distrib" "(!x. P(x) & Q(x)) = ((! x. P(x)) & (! x. Q(x)))"; |
|
240 |
||
2134 | 241 |
(* '&' congruence rule: not included by default! |
242 |
May slow rewrite proofs down by as much as 50% *) |
|
243 |
||
244 |
let val th = prove_goal HOL.thy |
|
245 |
"(P=P')--> (P'--> (Q=Q'))--> ((P&Q) = (P'&Q'))" |
|
2935 | 246 |
(fn _=> [blast_tac HOL_cs 1]) |
2134 | 247 |
in bind_thm("conj_cong",standard (impI RSN (2, th RS mp RS mp))) end; |
248 |
||
249 |
let val th = prove_goal HOL.thy |
|
250 |
"(Q=Q')--> (Q'--> (P=P'))--> ((P&Q) = (P'&Q'))" |
|
2935 | 251 |
(fn _=> [blast_tac HOL_cs 1]) |
2134 | 252 |
in bind_thm("rev_conj_cong",standard (impI RSN (2, th RS mp RS mp))) end; |
253 |
||
254 |
(* '|' congruence rule: not included by default! *) |
|
255 |
||
256 |
let val th = prove_goal HOL.thy |
|
257 |
"(P=P')--> (~P'--> (Q=Q'))--> ((P|Q) = (P'|Q'))" |
|
2935 | 258 |
(fn _=> [blast_tac HOL_cs 1]) |
2134 | 259 |
in bind_thm("disj_cong",standard (impI RSN (2, th RS mp RS mp))) end; |
260 |
||
261 |
prove "eq_sym_conv" "(x=y) = (y=x)"; |
|
262 |
||
263 |
qed_goalw "o_apply" HOL.thy [o_def] "(f o g) x = f (g x)" |
|
264 |
(fn _ => [rtac refl 1]); |
|
265 |
||
266 |
qed_goal "meta_eq_to_obj_eq" HOL.thy "x==y ==> x=y" |
|
267 |
(fn [prem] => [rewtac prem, rtac refl 1]); |
|
268 |
||
269 |
qed_goalw "if_True" HOL.thy [if_def] "(if True then x else y) = x" |
|
2935 | 270 |
(fn _=>[blast_tac (HOL_cs addIs [select_equality]) 1]); |
2134 | 271 |
|
272 |
qed_goalw "if_False" HOL.thy [if_def] "(if False then x else y) = y" |
|
2935 | 273 |
(fn _=>[blast_tac (HOL_cs addIs [select_equality]) 1]); |
2134 | 274 |
|
275 |
qed_goal "if_P" HOL.thy "P ==> (if P then x else y) = x" |
|
276 |
(fn [prem] => [ stac (prem RS eqTrueI) 1, rtac if_True 1 ]); |
|
277 |
(* |
|
278 |
qed_goal "if_not_P" HOL.thy "~P ==> (if P then x else y) = y" |
|
279 |
(fn [prem] => [ stac (prem RS not_P_imp_P_iff_F) 1, rtac if_False 1 ]); |
|
280 |
*) |
|
281 |
qed_goalw "if_not_P" HOL.thy [if_def] "!!P. ~P ==> (if P then x else y) = y" |
|
2935 | 282 |
(fn _ => [blast_tac (HOL_cs addIs [select_equality]) 1]); |
2134 | 283 |
|
284 |
qed_goal "expand_if" HOL.thy |
|
4205
96632970d203
simpdata.ML: renamed split_prem_tac to split_asm_tac, added split_if_asm
oheimb
parents:
4189
diff
changeset
|
285 |
"P(if Q then x else y) = ((Q --> P(x)) & (~Q --> P(y)))" (K [ |
96632970d203
simpdata.ML: renamed split_prem_tac to split_asm_tac, added split_if_asm
oheimb
parents:
4189
diff
changeset
|
286 |
res_inst_tac [("Q","Q")] (excluded_middle RS disjE) 1, |
2134 | 287 |
stac if_P 2, |
288 |
stac if_not_P 1, |
|
4205
96632970d203
simpdata.ML: renamed split_prem_tac to split_asm_tac, added split_if_asm
oheimb
parents:
4189
diff
changeset
|
289 |
ALLGOALS (blast_tac HOL_cs)]); |
96632970d203
simpdata.ML: renamed split_prem_tac to split_asm_tac, added split_if_asm
oheimb
parents:
4189
diff
changeset
|
290 |
|
96632970d203
simpdata.ML: renamed split_prem_tac to split_asm_tac, added split_if_asm
oheimb
parents:
4189
diff
changeset
|
291 |
qed_goal "split_if_asm" HOL.thy |
96632970d203
simpdata.ML: renamed split_prem_tac to split_asm_tac, added split_if_asm
oheimb
parents:
4189
diff
changeset
|
292 |
"P(if Q then x else y) = (~((Q & ~P x) | (~Q & ~P y)))" (K [ |
96632970d203
simpdata.ML: renamed split_prem_tac to split_asm_tac, added split_if_asm
oheimb
parents:
4189
diff
changeset
|
293 |
stac expand_if 1, |
96632970d203
simpdata.ML: renamed split_prem_tac to split_asm_tac, added split_if_asm
oheimb
parents:
4189
diff
changeset
|
294 |
blast_tac HOL_cs 1]); |
2134 | 295 |
|
296 |
qed_goal "if_bool_eq" HOL.thy |
|
297 |
"(if P then Q else R) = ((P-->Q) & (~P-->R))" |
|
298 |
(fn _ => [rtac expand_if 1]); |
|
299 |
||
4320
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
300 |
(** make simp procs for quantifier elimination **) |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
301 |
local |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
302 |
val ex_pattern = |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
303 |
read_cterm (sign_of HOL.thy) ("? x. P(x) & Q(x)",HOLogic.boolT) |
3913 | 304 |
|
4320
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
305 |
val all_pattern = |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
306 |
read_cterm (sign_of HOL.thy) ("! x. P(x) & P'(x) --> Q(x)",HOLogic.boolT) |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
307 |
|
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
308 |
in |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
309 |
val defEX_regroup = |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
310 |
mk_simproc "defined EX" [ex_pattern] Quantifier1.rearrange_ex; |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
311 |
val defALL_regroup = |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
312 |
mk_simproc "defined ALL" [all_pattern] Quantifier1.rearrange_all; |
24d9e6639cd4
Moved the quantifier elimination simp procs into Provers.
nipkow
parents:
4205
diff
changeset
|
313 |
end; |
3913 | 314 |
|
315 |
(** Case splitting **) |
|
316 |
||
2263 | 317 |
local val mktac = mk_case_split_tac (meta_eq_to_obj_eq RS iffD2) |
318 |
in |
|
319 |
fun split_tac splits = mktac (map mk_meta_eq splits) |
|
320 |
end; |
|
321 |
||
322 |
local val mktac = mk_case_split_inside_tac (meta_eq_to_obj_eq RS iffD2) |
|
323 |
in |
|
324 |
fun split_inside_tac splits = mktac (map mk_meta_eq splits) |
|
325 |
end; |
|
326 |
||
4205
96632970d203
simpdata.ML: renamed split_prem_tac to split_asm_tac, added split_if_asm
oheimb
parents:
4189
diff
changeset
|
327 |
val split_asm_tac = mk_case_split_asm_tac split_tac |
96632970d203
simpdata.ML: renamed split_prem_tac to split_asm_tac, added split_if_asm
oheimb
parents:
4189
diff
changeset
|
328 |
(disjE,conjE,exE,contrapos,contrapos2,notnotD); |
4189 | 329 |
|
3919 | 330 |
infix 4 addsplits; |
331 |
fun ss addsplits splits = ss addloop (split_tac splits); |
|
332 |
||
2263 | 333 |
|
2251 | 334 |
qed_goal "if_cancel" HOL.thy "(if c then x else x) = x" |
2935 | 335 |
(fn _ => [split_tac [expand_if] 1, blast_tac HOL_cs 1]); |
2251 | 336 |
|
2134 | 337 |
(** 'if' congruence rules: neither included by default! *) |
338 |
||
339 |
(*Simplifies x assuming c and y assuming ~c*) |
|
340 |
qed_goal "if_cong" HOL.thy |
|
341 |
"[| b=c; c ==> x=u; ~c ==> y=v |] ==>\ |
|
342 |
\ (if b then x else y) = (if c then u else v)" |
|
343 |
(fn rew::prems => |
|
344 |
[stac rew 1, stac expand_if 1, stac expand_if 1, |
|
2935 | 345 |
blast_tac (HOL_cs addDs prems) 1]); |
2134 | 346 |
|
347 |
(*Prevents simplification of x and y: much faster*) |
|
348 |
qed_goal "if_weak_cong" HOL.thy |
|
349 |
"b=c ==> (if b then x else y) = (if c then x else y)" |
|
350 |
(fn [prem] => [rtac (prem RS arg_cong) 1]); |
|
351 |
||
352 |
(*Prevents simplification of t: much faster*) |
|
353 |
qed_goal "let_weak_cong" HOL.thy |
|
354 |
"a = b ==> (let x=a in t(x)) = (let x=b in t(x))" |
|
355 |
(fn [prem] => [rtac (prem RS arg_cong) 1]); |
|
356 |
||
357 |
(*In general it seems wrong to add distributive laws by default: they |
|
358 |
might cause exponential blow-up. But imp_disjL has been in for a while |
|
359 |
and cannot be removed without affecting existing proofs. Moreover, |
|
360 |
rewriting by "(P|Q --> R) = ((P-->R)&(Q-->R))" might be justified on the |
|
361 |
grounds that it allows simplification of R in the two cases.*) |
|
362 |
||
363 |
val mksimps_pairs = |
|
364 |
[("op -->", [mp]), ("op &", [conjunct1,conjunct2]), |
|
365 |
("All", [spec]), ("True", []), ("False", []), |
|
366 |
("If", [if_bool_eq RS iffD1])]; |
|
1758 | 367 |
|
2636
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
368 |
fun unsafe_solver prems = FIRST'[resolve_tac (TrueI::refl::prems), |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
369 |
atac, etac FalseE]; |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
370 |
(*No premature instantiation of variables during simplification*) |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
371 |
fun safe_solver prems = FIRST'[match_tac (TrueI::refl::prems), |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
372 |
eq_assume_tac, ematch_tac [FalseE]]; |
2443
a81d4c219c3c
factored out HOL_base_ss and val HOL_min_ss, added HOL_safe_min_ss
oheimb
parents:
2263
diff
changeset
|
373 |
|
2636
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
374 |
val HOL_basic_ss = empty_ss setsubgoaler asm_simp_tac |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
375 |
setSSolver safe_solver |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
376 |
setSolver unsafe_solver |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
377 |
setmksimps (mksimps mksimps_pairs); |
2443
a81d4c219c3c
factored out HOL_base_ss and val HOL_min_ss, added HOL_safe_min_ss
oheimb
parents:
2263
diff
changeset
|
378 |
|
3446
a14e5451f613
Addition of not_imp (which pushes negation into implication) as a default
paulson
parents:
3282
diff
changeset
|
379 |
val HOL_ss = |
a14e5451f613
Addition of not_imp (which pushes negation into implication) as a default
paulson
parents:
3282
diff
changeset
|
380 |
HOL_basic_ss addsimps |
a14e5451f613
Addition of not_imp (which pushes negation into implication) as a default
paulson
parents:
3282
diff
changeset
|
381 |
([triv_forall_equality, (* prunes params *) |
3654 | 382 |
True_implies_equals, (* prune asms `True' *) |
3446
a14e5451f613
Addition of not_imp (which pushes negation into implication) as a default
paulson
parents:
3282
diff
changeset
|
383 |
if_True, if_False, if_cancel, |
a14e5451f613
Addition of not_imp (which pushes negation into implication) as a default
paulson
parents:
3282
diff
changeset
|
384 |
o_apply, imp_disjL, conj_assoc, disj_assoc, |
3904 | 385 |
de_Morgan_conj, de_Morgan_disj, imp_disj1, imp_disj2, not_imp, |
3446
a14e5451f613
Addition of not_imp (which pushes negation into implication) as a default
paulson
parents:
3282
diff
changeset
|
386 |
not_all, not_ex, cases_simp] |
a14e5451f613
Addition of not_imp (which pushes negation into implication) as a default
paulson
parents:
3282
diff
changeset
|
387 |
@ ex_simps @ all_simps @ simp_thms) |
4032
4b1c69d8b767
For each datatype `t' there is now a theorem `split_t_case' of the form
nipkow
parents:
3919
diff
changeset
|
388 |
addsimprocs [defALL_regroup,defEX_regroup] |
3446
a14e5451f613
Addition of not_imp (which pushes negation into implication) as a default
paulson
parents:
3282
diff
changeset
|
389 |
addcongs [imp_cong]; |
2082 | 390 |
|
1655 | 391 |
qed_goal "if_distrib" HOL.thy |
392 |
"f(if c then x else y) = (if c then f x else f y)" |
|
393 |
(fn _ => [simp_tac (HOL_ss setloop (split_tac [expand_if])) 1]); |
|
394 |
||
2097 | 395 |
qed_goalw "o_assoc" HOL.thy [o_def] "f o (g o h) = f o g o h" |
2098
2bfc0675c92f
corrected `correction` of o_assoc (of version 1.14),
oheimb
parents:
2097
diff
changeset
|
396 |
(fn _ => [rtac ext 1, rtac refl 1]); |
1984 | 397 |
|
398 |
||
2948
f18035b1d531
Moved expand_case_tac from Auth/Message.ML to simpdata.ML
paulson
parents:
2935
diff
changeset
|
399 |
val prems = goal HOL.thy "[| P ==> Q(True); ~P ==> Q(False) |] ==> Q(P)"; |
f18035b1d531
Moved expand_case_tac from Auth/Message.ML to simpdata.ML
paulson
parents:
2935
diff
changeset
|
400 |
by (case_tac "P" 1); |
f18035b1d531
Moved expand_case_tac from Auth/Message.ML to simpdata.ML
paulson
parents:
2935
diff
changeset
|
401 |
by (ALLGOALS (asm_simp_tac (HOL_ss addsimps prems))); |
f18035b1d531
Moved expand_case_tac from Auth/Message.ML to simpdata.ML
paulson
parents:
2935
diff
changeset
|
402 |
val expand_case = result(); |
f18035b1d531
Moved expand_case_tac from Auth/Message.ML to simpdata.ML
paulson
parents:
2935
diff
changeset
|
403 |
|
f18035b1d531
Moved expand_case_tac from Auth/Message.ML to simpdata.ML
paulson
parents:
2935
diff
changeset
|
404 |
fun expand_case_tac P i = |
f18035b1d531
Moved expand_case_tac from Auth/Message.ML to simpdata.ML
paulson
parents:
2935
diff
changeset
|
405 |
res_inst_tac [("P",P)] expand_case i THEN |
f18035b1d531
Moved expand_case_tac from Auth/Message.ML to simpdata.ML
paulson
parents:
2935
diff
changeset
|
406 |
Simp_tac (i+1) THEN |
f18035b1d531
Moved expand_case_tac from Auth/Message.ML to simpdata.ML
paulson
parents:
2935
diff
changeset
|
407 |
Simp_tac i; |
f18035b1d531
Moved expand_case_tac from Auth/Message.ML to simpdata.ML
paulson
parents:
2935
diff
changeset
|
408 |
|
f18035b1d531
Moved expand_case_tac from Auth/Message.ML to simpdata.ML
paulson
parents:
2935
diff
changeset
|
409 |
|
4119 | 410 |
(* install implicit simpset *) |
1984 | 411 |
|
4086 | 412 |
simpset_ref() := HOL_ss; |
1984 | 413 |
|
3615
e5322197cfea
Moved some functions which used to be part of thy_data.ML
berghofe
parents:
3577
diff
changeset
|
414 |
|
2636
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
415 |
(*** Integration of simplifier with classical reasoner ***) |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
416 |
|
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
417 |
(* rot_eq_tac rotates the first equality premise of subgoal i to the front, |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
418 |
fails if there is no equaliy or if an equality is already at the front *) |
3538 | 419 |
local |
420 |
fun is_eq (Const ("Trueprop", _) $ (Const("op =" ,_) $ _ $ _)) = true |
|
421 |
| is_eq _ = false; |
|
4188
1025a27b08f9
changed libraray function find to find_index_eq, currying it
oheimb
parents:
4119
diff
changeset
|
422 |
val find_eq = find_index is_eq; |
3538 | 423 |
in |
424 |
val rot_eq_tac = |
|
4188
1025a27b08f9
changed libraray function find to find_index_eq, currying it
oheimb
parents:
4119
diff
changeset
|
425 |
SUBGOAL (fn (Bi,i) => let val n = find_eq (Logic.strip_assums_hyp Bi) in |
1025a27b08f9
changed libraray function find to find_index_eq, currying it
oheimb
parents:
4119
diff
changeset
|
426 |
if n>0 then rotate_tac n i else no_tac end) |
3538 | 427 |
end; |
2636
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
428 |
|
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
429 |
(*an unsatisfactory fix for the incomplete asm_full_simp_tac! |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
430 |
better: asm_really_full_simp_tac, a yet to be implemented version of |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
431 |
asm_full_simp_tac that applies all equalities in the |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
432 |
premises to all the premises *) |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
433 |
fun safe_asm_more_full_simp_tac ss = TRY o rot_eq_tac THEN' |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
434 |
safe_asm_full_simp_tac ss; |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
435 |
|
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
436 |
(*Add a simpset to a classical set!*) |
3206
a3de7f32728c
renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents:
3040
diff
changeset
|
437 |
infix 4 addSss addss; |
a3de7f32728c
renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents:
3040
diff
changeset
|
438 |
fun cs addSss ss = cs addSaltern (CHANGED o (safe_asm_more_full_simp_tac ss)); |
a3de7f32728c
renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents:
3040
diff
changeset
|
439 |
fun cs addss ss = cs addbefore asm_full_simp_tac ss; |
2636
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
440 |
|
4086 | 441 |
fun Addss ss = (claset_ref() := claset() addss ss); |
2636
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
442 |
|
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
443 |
(*Designed to be idempotent, except if best_tac instantiates variables |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
444 |
in some of the subgoals*) |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
445 |
|
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
446 |
type clasimpset = (claset * simpset); |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
447 |
|
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
448 |
val HOL_css = (HOL_cs, HOL_ss); |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
449 |
|
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
450 |
fun pair_upd1 f ((a,b),x) = (f(a,x), b); |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
451 |
fun pair_upd2 f ((a,b),x) = (a, f(b,x)); |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
452 |
|
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
453 |
infix 4 addSIs2 addSEs2 addSDs2 addIs2 addEs2 addDs2 |
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
454 |
addsimps2 delsimps2 addcongs2 delcongs2; |
2748
3ae9ccdd701e
Eta-expanded some declarations for compatibility with value polymorphism
paulson
parents:
2718
diff
changeset
|
455 |
fun op addSIs2 arg = pair_upd1 (op addSIs) arg; |
3ae9ccdd701e
Eta-expanded some declarations for compatibility with value polymorphism
paulson
parents:
2718
diff
changeset
|
456 |
fun op addSEs2 arg = pair_upd1 (op addSEs) arg; |
3ae9ccdd701e
Eta-expanded some declarations for compatibility with value polymorphism
paulson
parents:
2718
diff
changeset
|
457 |
fun op addSDs2 arg = pair_upd1 (op addSDs) arg; |
3ae9ccdd701e
Eta-expanded some declarations for compatibility with value polymorphism
paulson
parents:
2718
diff
changeset
|
458 |
fun op addIs2 arg = pair_upd1 (op addIs ) arg; |
3ae9ccdd701e
Eta-expanded some declarations for compatibility with value polymorphism
paulson
parents:
2718
diff
changeset
|
459 |
fun op addEs2 arg = pair_upd1 (op addEs ) arg; |
3ae9ccdd701e
Eta-expanded some declarations for compatibility with value polymorphism
paulson
parents:
2718
diff
changeset
|
460 |
fun op addDs2 arg = pair_upd1 (op addDs ) arg; |
3ae9ccdd701e
Eta-expanded some declarations for compatibility with value polymorphism
paulson
parents:
2718
diff
changeset
|
461 |
fun op addsimps2 arg = pair_upd2 (op addsimps) arg; |
3ae9ccdd701e
Eta-expanded some declarations for compatibility with value polymorphism
paulson
parents:
2718
diff
changeset
|
462 |
fun op delsimps2 arg = pair_upd2 (op delsimps) arg; |
3ae9ccdd701e
Eta-expanded some declarations for compatibility with value polymorphism
paulson
parents:
2718
diff
changeset
|
463 |
fun op addcongs2 arg = pair_upd2 (op addcongs) arg; |
3ae9ccdd701e
Eta-expanded some declarations for compatibility with value polymorphism
paulson
parents:
2718
diff
changeset
|
464 |
fun op delcongs2 arg = pair_upd2 (op delcongs) arg; |
2636
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
465 |
|
2805 | 466 |
fun auto_tac (cs,ss) = |
467 |
let val cs' = cs addss ss |
|
468 |
in EVERY [TRY (safe_tac cs'), |
|
469 |
REPEAT (FIRSTGOAL (fast_tac cs')), |
|
3206
a3de7f32728c
renamed addss to addSss, unsafe_addss to addss, extended auto_tac
oheimb
parents:
3040
diff
changeset
|
470 |
TRY (safe_tac (cs addSss ss)), |
2805 | 471 |
prune_params_tac] |
472 |
end; |
|
2636
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
473 |
|
4086 | 474 |
fun Auto_tac () = auto_tac (claset(), simpset()); |
2636
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
475 |
|
4b30dbe4a020
added delcongs, Delcongs, unsafe_solver, safe_solver, HOL_basic_ss,
oheimb
parents:
2595
diff
changeset
|
476 |
fun auto () = by (Auto_tac ()); |