src/HOL/cladata.ML
author paulson
Wed Apr 02 11:30:03 1997 +0200 (1997-04-02)
changeset 2860 6dde30a9e905
parent 1985 84cf16192e03
child 2882 2563063772d9
permissions -rw-r--r--
Installation of blast_tac
     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("Trueprop",_) $ (Const("op =",_)  $ t $ u)) = (t,u);
    18   val eq_reflection = eq_reflection
    19   val imp_intr = impI
    20   val rev_mp = rev_mp
    21   val subst = subst
    22   val sym = sym
    23   end;
    24 
    25 structure Hypsubst = HypsubstFun(Hypsubst_Data);
    26 open Hypsubst;
    27 
    28 (*** Applying ClassicalFun to create a classical prover ***)
    29 structure Classical_Data = 
    30   struct
    31   val sizef     = size_of_thm
    32   val mp        = mp
    33   val not_elim  = notE
    34   val classical = classical
    35   val hyp_subst_tacs=[hyp_subst_tac]
    36   end;
    37 
    38 structure Classical = ClassicalFun(Classical_Data);
    39 open Classical;
    40 
    41 (*Propositional rules*)
    42 val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI]
    43                        addSEs [conjE,disjE,impCE,FalseE,iffE];
    44 
    45 (*Quantifier rules*)
    46 val HOL_cs = prop_cs addSIs [allI] addIs [exI,ex1I]
    47                      addSEs [exE,ex1E] addEs [allE];
    48 
    49 exception CS_DATA of claset;
    50 
    51 let fun merge [] = CS_DATA empty_cs
    52       | merge cs = let val cs = map (fn CS_DATA x => x) cs;
    53                    in CS_DATA (foldl merge_cs (hd cs, tl cs)) end;
    54 
    55     fun put (CS_DATA cs) = claset := cs;
    56 
    57     fun get () = CS_DATA (!claset);
    58 in add_thydata "HOL"
    59      ("claset", ThyMethods {merge = merge, put = put, get = get})
    60 end;
    61 
    62 claset := HOL_cs;
    63 
    64 
    65 (*** Applying BlastFun to create Blast_tac ***)
    66 structure Blast_Data = 
    67   struct
    68   type claset	= Classical.claset
    69   val notE	= notE
    70   val ccontr	= ccontr
    71   val contr_tac = Classical.contr_tac
    72   val dup_intr	= Classical.dup_intr
    73   val vars_gen_hyp_subst_tac = Hypsubst.vars_gen_hyp_subst_tac
    74   val claset	= Classical.claset
    75   val rep_claset = Classical.rep_claset
    76   end;
    77 
    78 structure Blast = BlastFun(Blast_Data);
    79 
    80 val Blast_tac = Blast.Blast_tac
    81 and blast_tac = Blast.blast_tac;