src/HOL/cladata.ML
author paulson
Wed Jun 28 10:37:52 2000 +0200 (2000-06-28)
changeset 9158 084abf3d0eff
parent 8099 6a087be9f6d9
child 9472 b63b21f370ca
permissions -rw-r--r--
declaring and using cla_make_elim
     1 (*  Title:      HOL/cladata.ML
     2     ID:         $Id$
     3     Author:     Tobias Nipkow
     4     Copyright   1996  University of Cambridge
     5 
     6 Setting up the classical reasoner.
     7 *)
     8 
     9 
    10 (** Applying HypsubstFun to generate hyp_subst_tac **)
    11 section "Classical Reasoner";
    12 
    13 structure Hypsubst_Data =
    14   struct
    15   structure Simplifier = Simplifier
    16   (*Take apart an equality judgement; otherwise raise Match!*)
    17   fun dest_eq (Const("op =",T)  $ t $ u) = (t, u, domain_type T)
    18   val dest_Trueprop = HOLogic.dest_Trueprop
    19   val dest_imp = HOLogic.dest_imp
    20   val eq_reflection = eq_reflection
    21   val imp_intr = impI
    22   val rev_mp = rev_mp
    23   val subst = subst
    24   val sym = sym
    25   val thin_refl = prove_goal (the_context ())
    26 		  "!!X. [|x=x; PROP W|] ==> PROP W" (K [atac 1]);
    27   end;
    28 
    29 structure Hypsubst = HypsubstFun(Hypsubst_Data);
    30 open Hypsubst;
    31 
    32 
    33 (*** Applying Make_Elim_Fun to create a classical "make_elim" rule ***)
    34 structure Make_Elim_Data =
    35 struct
    36   val classical = classical
    37 end;
    38 
    39 structure Make_Elim = Make_Elim_Fun (Make_Elim_Data);
    40 
    41 (*we don't redeclare the original make_elim (Tactic.make_elim) for 
    42   compatibliity with strange things done in many existing proofs *)
    43 val cla_make_elim = Make_Elim.make_elim;
    44 
    45 (*** Applying ClassicalFun to create a classical prover ***)
    46 structure Classical_Data = 
    47   struct
    48   val make_elim = cla_make_elim
    49   val mp        = mp
    50   val not_elim  = notE
    51   val classical = classical
    52   val sizef     = size_of_thm
    53   val hyp_subst_tacs=[hyp_subst_tac]
    54   end;
    55 
    56 structure Classical = ClassicalFun(Classical_Data);
    57 structure BasicClassical: BASIC_CLASSICAL = Classical; open BasicClassical;
    58 structure Obtain = ObtainFun(val that_atts = [Simplifier.simp_add_local, Classical.haz_intro_local]);
    59 
    60 (*Propositional rules*)
    61 val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI]
    62                        addSEs [conjE,disjE,impCE,FalseE,iffCE];
    63 
    64 (*Quantifier rules*)
    65 val HOL_cs = prop_cs addSIs [allI,ex_ex1I] addIs [exI, select_equality] 
    66                      addSEs [exE] addEs [allE];
    67 
    68 val clasetup = [fn thy => (claset_ref_of thy := HOL_cs; thy)];