src/HOL/cladata.ML
author oheimb
Wed Nov 12 12:30:15 1997 +0100 (1997-11-12)
changeset 4205 96632970d203
parent 4179 cc4b6791d5dc
child 4206 688050e83d89
permissions -rw-r--r--
simpdata.ML: renamed split_prem_tac to split_asm_tac, added split_if_asm
cladata.ML: unintentinally committed
     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)  $ t $ u)) = 
    18 	(t, u, domain_type T)
    19   val eq_reflection = eq_reflection
    20   val imp_intr = impI
    21   val rev_mp = rev_mp
    22   val subst = subst
    23   val sym = sym
    24   end;
    25 
    26 structure Hypsubst = HypsubstFun(Hypsubst_Data);
    27 open Hypsubst;
    28 
    29 val thin_refl = prove_goal HOL.thy 
    30 	"!!X. [|x=x; PROP W|] ==> PROP W" (K [atac 1]);
    31 
    32 (*** Applying ClassicalFun to create a classical prover ***)
    33 structure Classical_Data = 
    34   struct
    35   val sizef     = size_of_thm
    36   val mp        = mp
    37   val not_elim  = notE
    38   val classical = classical
    39   val thin_refl = thin_refl
    40   val hyp_subst_tacs= [REPEAT_DETERM o ematch_tac [thin_refl] THEN' hyp_subst_tac]
    41   end;
    42 
    43 structure Classical = ClassicalFun(Classical_Data);
    44 open Classical;
    45 
    46 (*Propositional rules*)
    47 val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI]
    48                        addSEs [conjE,disjE,impCE,FalseE,iffE];
    49 
    50 (*Quantifier rules*)
    51 val HOL_cs = prop_cs addSIs [allI,ex_ex1I] addIs [exI] 
    52                      addSEs [exE] addEs [allE];
    53 
    54 claset_ref() := HOL_cs;
    55 
    56 (*Better then ex1E for classical reasoner: needs no quantifier duplication!*)
    57 qed_goal "alt_ex1E" thy
    58     "[| ?! x. P(x);                                              \
    59 \       !!x. [| P(x);  ALL y y'. P(y) & P(y') --> y=y' |] ==> R  \
    60 \    |] ==> R"
    61  (fn major::prems =>
    62   [ (rtac (major RS ex1E) 1),
    63     (REPEAT (ares_tac (allI::prems) 1)),
    64     (etac (dup_elim allE) 1),
    65     (Fast_tac 1)]);
    66 
    67 AddSEs [alt_ex1E];
    68 
    69 (*** Applying BlastFun to create Blast_tac ***)
    70 structure Blast_Data = 
    71   struct
    72   type claset	= Classical.claset
    73   val notE	= notE
    74   val ccontr	= ccontr
    75   val contr_tac = Classical.contr_tac
    76   val dup_intr	= Classical.dup_intr
    77   val vars_gen_hyp_subst_tac = Hypsubst.vars_gen_hyp_subst_tac
    78   val claset	= Classical.claset
    79   val rep_claset = Classical.rep_claset
    80   end;
    81 
    82 structure Blast = BlastFun(Blast_Data);
    83 Blast.overload ("op =", domain_type);	(*overloading of equality as iff*)
    84 
    85 val Blast_tac = Blast.Blast_tac
    86 and blast_tac = Blast.blast_tac;