src/HOL/simpdata.ML
author paulson
Mon Dec 07 18:26:25 1998 +0100 (1998-12-07)
changeset 6019 0e55c2fb2ebb
parent 5975 cd19eaa90f45
child 6128 2acc5d36610c
permissions -rw-r--r--
tidying
     1 (*  Title:      HOL/simpdata.ML
     2     ID:         $Id$
     3     Author:     Tobias Nipkow
     4     Copyright   1991  University of Cambridge
     5 
     6 Instantiation of the generic simplifier for HOL.
     7 *)
     8 
     9 section "Simplifier";
    10 
    11 (*** Addition of rules to simpsets and clasets simultaneously ***)
    12 
    13 infix 4 addIffs delIffs;
    14 
    15 (*Takes UNCONDITIONAL theorems of the form A<->B to 
    16         the Safe Intr     rule B==>A and 
    17         the Safe Destruct rule A==>B.
    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 ((cla, simp), th) = 
    24       (case HOLogic.dest_Trueprop (#prop (rep_thm th)) of
    25                 (Const("Not", _) $ A) =>
    26                     cla addSEs [zero_var_indexes (th RS notE)]
    27               | (con $ _ $ _) =>
    28                     if con = iff_const
    29                     then cla addSIs [zero_var_indexes (th RS iffD2)]  
    30                               addSDs [zero_var_indexes (th RS iffD1)]
    31                     else  cla addSIs [th]
    32               | _ => cla addSIs [th],
    33        simp addsimps [th])
    34       handle _ => error ("AddIffs: theorem must be unconditional\n" ^ 
    35                          string_of_thm th);
    36 
    37   fun delIff ((cla, simp), th) = 
    38       (case HOLogic.dest_Trueprop (#prop (rep_thm th)) of
    39                 (Const ("Not", _) $ A) =>
    40                     cla delrules [zero_var_indexes (th RS notE)]
    41               | (con $ _ $ _) =>
    42                     if con = iff_const
    43                     then cla delrules [zero_var_indexes (th RS iffD2),
    44                                        make_elim (zero_var_indexes (th RS iffD1))]
    45                     else cla delrules [th]
    46               | _ => cla delrules [th],
    47        simp delsimps [th])
    48       handle _ => (warning("DelIffs: ignoring conditional theorem\n" ^ 
    49                           string_of_thm th); (cla, simp));
    50 
    51   fun store_clasimp (cla, simp) = (claset_ref () := cla; simpset_ref () := simp)
    52 in
    53 val op addIffs = foldl addIff;
    54 val op delIffs = foldl delIff;
    55 fun AddIffs thms = store_clasimp ((claset (), simpset ()) addIffs thms);
    56 fun DelIffs thms = store_clasimp ((claset (), simpset ()) delIffs thms);
    57 end;
    58 
    59 
    60 qed_goal "meta_eq_to_obj_eq" HOL.thy "x==y ==> x=y"
    61   (fn [prem] => [rewtac prem, rtac refl 1]);
    62 
    63 local
    64 
    65   fun prover s = prove_goal HOL.thy s (K [Blast_tac 1]);
    66 
    67   val P_imp_P_iff_True = prover "P --> (P = True)" RS mp;
    68   val P_imp_P_eq_True = P_imp_P_iff_True RS eq_reflection;
    69 
    70   val not_P_imp_P_iff_F = prover "~P --> (P = False)" RS mp;
    71   val not_P_imp_P_eq_False = not_P_imp_P_iff_F RS eq_reflection;
    72 
    73 in
    74 
    75 (*Make meta-equalities.  The operator below is Trueprop*)
    76 
    77   fun mk_meta_eq r = r RS eq_reflection;
    78 
    79   fun mk_eq th = case concl_of th of
    80           Const("==",_)$_$_       => th
    81       |   _$(Const("op =",_)$_$_) => mk_meta_eq th
    82       |   _$(Const("Not",_)$_)    => th RS not_P_imp_P_eq_False
    83       |   _                       => th RS P_imp_P_eq_True;
    84   (* last 2 lines requires all formulae to be of the from Trueprop(.) *)
    85 
    86   fun mk_eq_True r = Some(r RS meta_eq_to_obj_eq RS P_imp_P_eq_True);
    87 
    88   fun mk_meta_cong rl =
    89     standard(mk_meta_eq(replicate (nprems_of rl) meta_eq_to_obj_eq MRS rl))
    90     handle THM _ =>
    91     error("Premises and conclusion of congruence rules must be =-equalities");
    92 
    93 val not_not = prover "(~ ~ P) = P";
    94 
    95 val simp_thms = [not_not] @ map prover
    96  [ "(x=x) = True",
    97    "(~True) = False", "(~False) = True",
    98    "(~P) ~= P", "P ~= (~P)", "(P ~= Q) = (P = (~Q))",
    99    "(True=P) = P", "(P=True) = P", "(False=P) = (~P)", "(P=False) = (~P)",
   100    "(True --> P) = P", "(False --> P) = True", 
   101    "(P --> True) = True", "(P --> P) = True",
   102    "(P --> False) = (~P)", "(P --> ~P) = (~P)",
   103    "(P & True) = P", "(True & P) = P", 
   104    "(P & False) = False", "(False & P) = False",
   105    "(P & P) = P", "(P & (P & Q)) = (P & Q)",
   106    "(P & ~P) = False",    "(~P & P) = False",
   107    "(P | True) = True", "(True | P) = True", 
   108    "(P | False) = P", "(False | P) = P",
   109    "(P | P) = P", "(P | (P | Q)) = (P | Q)",
   110    "(P | ~P) = True",    "(~P | P) = True",
   111    "((~P) = (~Q)) = (P=Q)",
   112    "(!x. P) = P", "(? x. P) = P", "? x. x=t", "? x. t=x", 
   113 (*two needed for the one-point-rule quantifier simplification procs*)
   114    "(? x. x=t & P(x)) = P(t)",		(*essential for termination!!*)
   115    "(! x. t=x --> P(x)) = P(t)" ];      (*covers a stray case*)
   116 
   117 (* Add congruence rules for = (instead of ==) *)
   118 
   119 (* ###FIXME: Move to simplifier, 
   120    taking mk_meta_cong as input, eliminating addeqcongs and deleqcongs *)
   121 infix 4 addcongs delcongs;
   122 fun ss addcongs congs = ss addeqcongs (map mk_meta_cong congs);
   123 fun ss delcongs congs = ss deleqcongs (map mk_meta_cong congs);
   124 fun Addcongs congs = (simpset_ref() := simpset() addcongs congs);
   125 fun Delcongs congs = (simpset_ref() := simpset() delcongs congs);
   126 
   127 
   128 val imp_cong = impI RSN
   129     (2, prove_goal HOL.thy "(P=P')--> (P'--> (Q=Q'))--> ((P-->Q) = (P'-->Q'))"
   130         (fn _=> [Blast_tac 1]) RS mp RS mp);
   131 
   132 (*Miniscoping: pushing in existential quantifiers*)
   133 val ex_simps = map prover 
   134                 ["(EX x. P x & Q)   = ((EX x. P x) & Q)",
   135                  "(EX x. P & Q x)   = (P & (EX x. Q x))",
   136                  "(EX x. P x | Q)   = ((EX x. P x) | Q)",
   137                  "(EX x. P | Q x)   = (P | (EX x. Q x))",
   138                  "(EX x. P x --> Q) = ((ALL x. P x) --> Q)",
   139                  "(EX x. P --> Q x) = (P --> (EX x. Q x))"];
   140 
   141 (*Miniscoping: pushing in universal quantifiers*)
   142 val all_simps = map prover
   143                 ["(ALL x. P x & Q)   = ((ALL x. P x) & Q)",
   144                  "(ALL x. P & Q x)   = (P & (ALL x. Q x))",
   145                  "(ALL x. P x | Q)   = ((ALL x. P x) | Q)",
   146                  "(ALL x. P | Q x)   = (P | (ALL x. Q x))",
   147                  "(ALL x. P x --> Q) = ((EX x. P x) --> Q)",
   148                  "(ALL x. P --> Q x) = (P --> (ALL x. Q x))"];
   149 
   150 
   151 (* elimination of existential quantifiers in assumptions *)
   152 
   153 val ex_all_equiv =
   154   let val lemma1 = prove_goal HOL.thy
   155         "(? x. P(x) ==> PROP Q) ==> (!!x. P(x) ==> PROP Q)"
   156         (fn prems => [resolve_tac prems 1, etac exI 1]);
   157       val lemma2 = prove_goalw HOL.thy [Ex_def]
   158         "(!!x. P(x) ==> PROP Q) ==> (? x. P(x) ==> PROP Q)"
   159         (fn prems => [REPEAT(resolve_tac prems 1)])
   160   in equal_intr lemma1 lemma2 end;
   161 
   162 end;
   163 
   164 (* Elimination of True from asumptions: *)
   165 
   166 val True_implies_equals = prove_goal HOL.thy
   167  "(True ==> PROP P) == PROP P"
   168 (K [rtac equal_intr_rule 1, atac 2,
   169           METAHYPS (fn prems => resolve_tac prems 1) 1,
   170           rtac TrueI 1]);
   171 
   172 fun prove nm thm  = qed_goal nm HOL.thy thm (K [Blast_tac 1]);
   173 
   174 prove "conj_commute" "(P&Q) = (Q&P)";
   175 prove "conj_left_commute" "(P&(Q&R)) = (Q&(P&R))";
   176 val conj_comms = [conj_commute, conj_left_commute];
   177 prove "conj_assoc" "((P&Q)&R) = (P&(Q&R))";
   178 
   179 prove "disj_commute" "(P|Q) = (Q|P)";
   180 prove "disj_left_commute" "(P|(Q|R)) = (Q|(P|R))";
   181 val disj_comms = [disj_commute, disj_left_commute];
   182 prove "disj_assoc" "((P|Q)|R) = (P|(Q|R))";
   183 
   184 prove "conj_disj_distribL" "(P&(Q|R)) = (P&Q | P&R)";
   185 prove "conj_disj_distribR" "((P|Q)&R) = (P&R | Q&R)";
   186 
   187 prove "disj_conj_distribL" "(P|(Q&R)) = ((P|Q) & (P|R))";
   188 prove "disj_conj_distribR" "((P&Q)|R) = ((P|R) & (Q|R))";
   189 
   190 prove "imp_conjR" "(P --> (Q&R)) = ((P-->Q) & (P-->R))";
   191 prove "imp_conjL" "((P&Q) -->R)  = (P --> (Q --> R))";
   192 prove "imp_disjL" "((P|Q) --> R) = ((P-->R)&(Q-->R))";
   193 
   194 (*These two are specialized, but imp_disj_not1 is useful in Auth/Yahalom.ML*)
   195 prove "imp_disj_not1" "((P --> Q | R)) = (~Q --> P --> R)";
   196 prove "imp_disj_not2" "((P --> Q | R)) = (~R --> P --> Q)";
   197 
   198 prove "imp_disj1" "((P-->Q)|R) = (P--> Q|R)";
   199 prove "imp_disj2" "(Q|(P-->R)) = (P--> Q|R)";
   200 
   201 prove "de_Morgan_disj" "(~(P | Q)) = (~P & ~Q)";
   202 prove "de_Morgan_conj" "(~(P & Q)) = (~P | ~Q)";
   203 prove "not_imp" "(~(P --> Q)) = (P & ~Q)";
   204 prove "not_iff" "(P~=Q) = (P = (~Q))";
   205 prove "disj_not1" "(~P | Q) = (P --> Q)";
   206 prove "disj_not2" "(P | ~Q) = (Q --> P)"; (* changes orientation :-( *)
   207 prove "imp_conv_disj" "(P --> Q) = ((~P) | Q)";
   208 
   209 prove "iff_conv_conj_imp" "(P = Q) = ((P --> Q) & (Q --> P))";
   210 
   211 
   212 (*Avoids duplication of subgoals after split_if, when the true and false 
   213   cases boil down to the same thing.*) 
   214 prove "cases_simp" "((P --> Q) & (~P --> Q)) = Q";
   215 
   216 prove "not_all" "(~ (! x. P(x))) = (? x.~P(x))";
   217 prove "imp_all" "((! x. P x) --> Q) = (? x. P x --> Q)";
   218 prove "not_ex"  "(~ (? x. P(x))) = (! x.~P(x))";
   219 prove "imp_ex" "((? x. P x) --> Q) = (! x. P x --> Q)";
   220 
   221 prove "ex_disj_distrib" "(? x. P(x) | Q(x)) = ((? x. P(x)) | (? x. Q(x)))";
   222 prove "all_conj_distrib" "(!x. P(x) & Q(x)) = ((! x. P(x)) & (! x. Q(x)))";
   223 
   224 (* '&' congruence rule: not included by default!
   225    May slow rewrite proofs down by as much as 50% *)
   226 
   227 let val th = prove_goal HOL.thy 
   228                 "(P=P')--> (P'--> (Q=Q'))--> ((P&Q) = (P'&Q'))"
   229                 (fn _=> [Blast_tac 1])
   230 in  bind_thm("conj_cong",standard (impI RSN (2, th RS mp RS mp)))  end;
   231 
   232 let val th = prove_goal HOL.thy 
   233                 "(Q=Q')--> (Q'--> (P=P'))--> ((P&Q) = (P'&Q'))"
   234                 (fn _=> [Blast_tac 1])
   235 in  bind_thm("rev_conj_cong",standard (impI RSN (2, th RS mp RS mp)))  end;
   236 
   237 (* '|' congruence rule: not included by default! *)
   238 
   239 let val th = prove_goal HOL.thy 
   240                 "(P=P')--> (~P'--> (Q=Q'))--> ((P|Q) = (P'|Q'))"
   241                 (fn _=> [Blast_tac 1])
   242 in  bind_thm("disj_cong",standard (impI RSN (2, th RS mp RS mp)))  end;
   243 
   244 prove "eq_sym_conv" "(x=y) = (y=x)";
   245 
   246 
   247 (** if-then-else rules **)
   248 
   249 qed_goalw "if_True" HOL.thy [if_def] "(if True then x else y) = x"
   250  (K [Blast_tac 1]);
   251 
   252 qed_goalw "if_False" HOL.thy [if_def] "(if False then x else y) = y"
   253  (K [Blast_tac 1]);
   254 
   255 qed_goalw "if_P" HOL.thy [if_def] "!!P. P ==> (if P then x else y) = x"
   256  (K [Blast_tac 1]);
   257 
   258 qed_goalw "if_not_P" HOL.thy [if_def] "!!P. ~P ==> (if P then x else y) = y"
   259  (K [Blast_tac 1]);
   260 
   261 qed_goal "split_if" HOL.thy
   262     "P(if Q then x else y) = ((Q --> P(x)) & (~Q --> P(y)))" (K [
   263 	res_inst_tac [("Q","Q")] (excluded_middle RS disjE) 1,
   264          stac if_P 2,
   265          stac if_not_P 1,
   266          ALLGOALS (Blast_tac)]);
   267 (* for backwards compatibility: *)
   268 val expand_if = split_if;
   269 
   270 qed_goal "split_if_asm" HOL.thy
   271     "P(if Q then x else y) = (~((Q & ~P x) | (~Q & ~P y)))"
   272     (K [stac split_if 1,
   273 	Blast_tac 1]);
   274 
   275 qed_goal "if_cancel" HOL.thy "(if c then x else x) = x"
   276   (K [stac split_if 1, Blast_tac 1]);
   277 
   278 qed_goal "if_eq_cancel" HOL.thy "(if x = y then y else x) = x"
   279   (K [stac split_if 1, Blast_tac 1]);
   280 
   281 (*This form is useful for expanding IFs on the RIGHT of the ==> symbol*)
   282 qed_goal "if_bool_eq_conj" HOL.thy
   283     "(if P then Q else R) = ((P-->Q) & (~P-->R))"
   284     (K [rtac split_if 1]);
   285 
   286 (*And this form is useful for expanding IFs on the LEFT*)
   287 qed_goal "if_bool_eq_disj" HOL.thy
   288     "(if P then Q else R) = ((P&Q) | (~P&R))"
   289     (K [stac split_if 1,
   290 	Blast_tac 1]);
   291 
   292 
   293 (*** make simplification procedures for quantifier elimination ***)
   294 
   295 structure Quantifier1 = Quantifier1Fun(
   296 struct
   297   (*abstract syntax*)
   298   fun dest_eq((c as Const("op =",_)) $ s $ t) = Some(c,s,t)
   299     | dest_eq _ = None;
   300   fun dest_conj((c as Const("op &",_)) $ s $ t) = Some(c,s,t)
   301     | dest_conj _ = None;
   302   val conj = HOLogic.conj
   303   val imp  = HOLogic.imp
   304   (*rules*)
   305   val iff_reflection = eq_reflection
   306   val iffI = iffI
   307   val sym  = sym
   308   val conjI= conjI
   309   val conjE= conjE
   310   val impI = impI
   311   val impE = impE
   312   val mp   = mp
   313   val exI  = exI
   314   val exE  = exE
   315   val allI = allI
   316   val allE = allE
   317 end);
   318 
   319 local
   320 val ex_pattern =
   321   read_cterm (sign_of HOL.thy) ("EX x. P(x) & Q(x)",HOLogic.boolT)
   322 
   323 val all_pattern =
   324   read_cterm (sign_of HOL.thy) ("ALL x. P(x) & P'(x) --> Q(x)",HOLogic.boolT)
   325 
   326 in
   327 val defEX_regroup =
   328   mk_simproc "defined EX" [ex_pattern] Quantifier1.rearrange_ex;
   329 val defALL_regroup =
   330   mk_simproc "defined ALL" [all_pattern] Quantifier1.rearrange_all;
   331 end;
   332 
   333 
   334 (*** Case splitting ***)
   335 
   336 structure SplitterData =
   337   struct
   338   structure Simplifier = Simplifier
   339   val mk_eq          = mk_eq
   340   val meta_eq_to_iff = meta_eq_to_obj_eq
   341   val iffD           = iffD2
   342   val disjE          = disjE
   343   val conjE          = conjE
   344   val exE            = exE
   345   val contrapos      = contrapos
   346   val contrapos2     = contrapos2
   347   val notnotD        = notnotD
   348   end;
   349 
   350 structure Splitter = SplitterFun(SplitterData);
   351 
   352 val split_tac        = Splitter.split_tac;
   353 val split_inside_tac = Splitter.split_inside_tac;
   354 val split_asm_tac    = Splitter.split_asm_tac;
   355 val op addsplits     = Splitter.addsplits;
   356 val op delsplits     = Splitter.delsplits;
   357 val Addsplits        = Splitter.Addsplits;
   358 val Delsplits        = Splitter.Delsplits;
   359 
   360 (** 'if' congruence rules: neither included by default! *)
   361 
   362 (*Simplifies x assuming c and y assuming ~c*)
   363 qed_goal "if_cong" HOL.thy
   364   "[| b=c; c ==> x=u; ~c ==> y=v |] ==>\
   365 \  (if b then x else y) = (if c then u else v)"
   366   (fn rew::prems =>
   367    [stac rew 1, stac split_if 1, stac split_if 1,
   368     blast_tac (HOL_cs addDs prems) 1]);
   369 
   370 (*Prevents simplification of x and y: much faster*)
   371 qed_goal "if_weak_cong" HOL.thy
   372   "b=c ==> (if b then x else y) = (if c then x else y)"
   373   (fn [prem] => [rtac (prem RS arg_cong) 1]);
   374 
   375 (*Prevents simplification of t: much faster*)
   376 qed_goal "let_weak_cong" HOL.thy
   377   "a = b ==> (let x=a in t(x)) = (let x=b in t(x))"
   378   (fn [prem] => [rtac (prem RS arg_cong) 1]);
   379 
   380 (*In general it seems wrong to add distributive laws by default: they
   381   might cause exponential blow-up.  But imp_disjL has been in for a while
   382   and cannot be removed without affecting existing proofs.  Moreover, 
   383   rewriting by "(P|Q --> R) = ((P-->R)&(Q-->R))" might be justified on the
   384   grounds that it allows simplification of R in the two cases.*)
   385 
   386 fun gen_all th = forall_elim_vars (#maxidx(rep_thm th)+1) th;
   387 
   388 val mksimps_pairs =
   389   [("op -->", [mp]), ("op &", [conjunct1,conjunct2]),
   390    ("All", [spec]), ("True", []), ("False", []),
   391    ("If", [if_bool_eq_conj RS iffD1])];
   392 
   393 (* ###FIXME: move to Provers/simplifier.ML
   394 val mk_atomize:      (string * thm list) list -> thm -> thm list
   395 *)
   396 (* ###FIXME: move to Provers/simplifier.ML *)
   397 fun mk_atomize pairs =
   398   let fun atoms th =
   399         (case concl_of th of
   400            Const("Trueprop",_) $ p =>
   401              (case head_of p of
   402                 Const(a,_) =>
   403                   (case assoc(pairs,a) of
   404                      Some(rls) => flat (map atoms ([th] RL rls))
   405                    | None => [th])
   406               | _ => [th])
   407          | _ => [th])
   408   in atoms end;
   409 
   410 fun mksimps pairs = (map mk_eq o mk_atomize pairs o gen_all);
   411 
   412 fun unsafe_solver prems = FIRST'[resolve_tac (reflexive_thm::TrueI::refl::prems),
   413 				 atac, etac FalseE];
   414 (*No premature instantiation of variables during simplification*)
   415 fun   safe_solver prems = FIRST'[match_tac (reflexive_thm::TrueI::prems),
   416 				 eq_assume_tac, ematch_tac [FalseE]];
   417 
   418 val HOL_basic_ss = empty_ss setsubgoaler asm_simp_tac
   419 			    setSSolver   safe_solver
   420 			    setSolver  unsafe_solver
   421 			    setmksimps (mksimps mksimps_pairs)
   422 			    setmkeqTrue mk_eq_True;
   423 
   424 val HOL_ss = 
   425     HOL_basic_ss addsimps 
   426      ([triv_forall_equality, (* prunes params *)
   427        True_implies_equals, (* prune asms `True' *)
   428        if_True, if_False, if_cancel, if_eq_cancel,
   429        imp_disjL, conj_assoc, disj_assoc,
   430        de_Morgan_conj, de_Morgan_disj, imp_disj1, imp_disj2, not_imp,
   431        disj_not1, not_all, not_ex, cases_simp, Eps_eq, Eps_sym_eq]
   432      @ ex_simps @ all_simps @ simp_thms)
   433      addsimprocs [defALL_regroup,defEX_regroup]
   434      addcongs [imp_cong]
   435      addsplits [split_if];
   436 
   437 qed_goal "if_distrib" HOL.thy
   438   "f(if c then x else y) = (if c then f x else f y)" 
   439   (K [simp_tac (HOL_ss setloop (split_tac [split_if])) 1]);
   440 
   441 
   442 (*For expand_case_tac*)
   443 val prems = goal HOL.thy "[| P ==> Q(True); ~P ==> Q(False) |] ==> Q(P)";
   444 by (case_tac "P" 1);
   445 by (ALLGOALS (asm_simp_tac (HOL_ss addsimps prems)));
   446 val expand_case = result();
   447 
   448 (*Used in Auth proofs.  Typically P contains Vars that become instantiated
   449   during unification.*)
   450 fun expand_case_tac P i =
   451     res_inst_tac [("P",P)] expand_case i THEN
   452     Simp_tac (i+1) THEN 
   453     Simp_tac i;
   454 
   455 
   456 (* install implicit simpset *)
   457 
   458 simpset_ref() := HOL_ss;
   459 
   460 
   461 
   462 (*** integration of simplifier with classical reasoner ***)
   463 
   464 structure Clasimp = ClasimpFun
   465  (structure Simplifier = Simplifier 
   466         and Classical  = Classical 
   467         and Blast      = Blast);
   468 open Clasimp;
   469 
   470 val HOL_css = (HOL_cs, HOL_ss);
   471 
   472 
   473 (*** A general refutation procedure ***)
   474  
   475 (* Parameters:
   476 
   477    test: term -> bool
   478    tests if a term is at all relevant to the refutation proof;
   479    if not, then it can be discarded. Can improve performance,
   480    esp. if disjunctions can be discarded (no case distinction needed!).
   481 
   482    prep_tac: int -> tactic
   483    A preparation tactic to be applied to the goal once all relevant premises
   484    have been moved to the conclusion.
   485 
   486    ref_tac: int -> tactic
   487    the actual refutation tactic. Should be able to deal with goals
   488    [| A1; ...; An |] ==> False
   489    where the Ai are atomic, i.e. no top-level &, | or ?
   490 *)
   491 
   492 fun refute_tac test prep_tac ref_tac =
   493   let val nnf_simps =
   494         [imp_conv_disj,iff_conv_conj_imp,de_Morgan_disj,de_Morgan_conj,
   495          not_all,not_ex,not_not];
   496       val nnf_simpset =
   497         empty_ss setmkeqTrue mk_eq_True
   498                  setmksimps (mksimps mksimps_pairs)
   499                  addsimps nnf_simps;
   500       val prem_nnf_tac = full_simp_tac nnf_simpset;
   501 
   502       val refute_prems_tac =
   503         REPEAT(eresolve_tac [conjE, exE] 1 ORELSE
   504                filter_prems_tac test 1 ORELSE
   505                eresolve_tac [disjE] 1) THEN
   506         ref_tac 1;
   507   in EVERY'[TRY o filter_prems_tac test,
   508             REPEAT o etac rev_mp, prep_tac, rtac ccontr, prem_nnf_tac,
   509             SELECT_GOAL (DEPTH_SOLVE refute_prems_tac)]
   510   end;