src/FOL/cladata.ML
author oheimb
Thu May 15 15:51:09 1997 +0200 (1997-05-15 ago)
changeset 3206 a3de7f32728c
parent 2867 0aa5a3cd4550
child 3610 7e5300420b03
permissions -rw-r--r--
renamed addss to addSss, unsafe_addss to addss, extended auto_tac
paulson@2469
     1
(*  Title:      FOL/cladata.ML
paulson@2469
     2
    ID:         $Id$
paulson@2469
     3
    Author:     Tobias Nipkow
paulson@2469
     4
    Copyright   1996  University of Cambridge
paulson@2469
     5
paulson@2469
     6
Setting up the classical reasoner 
paulson@2469
     7
*)
paulson@2469
     8
paulson@2469
     9
paulson@2469
    10
section "Classical Reasoner";
paulson@2469
    11
paulson@2844
    12
paulson@2469
    13
(*** Applying ClassicalFun to create a classical prover ***)
paulson@2469
    14
structure Classical_Data = 
paulson@2469
    15
  struct
paulson@2469
    16
  val sizef     = size_of_thm
paulson@2469
    17
  val mp        = mp
paulson@2469
    18
  val not_elim  = notE
paulson@2469
    19
  val classical = classical
paulson@2469
    20
  val hyp_subst_tacs=[hyp_subst_tac]
paulson@2469
    21
  end;
paulson@2469
    22
paulson@2469
    23
structure Cla = ClassicalFun(Classical_Data);
paulson@2469
    24
open Cla;
paulson@2469
    25
paulson@2844
    26
(*Better for fast_tac: needs no quantifier duplication!*)
paulson@2844
    27
qed_goal "alt_ex1E" IFOL.thy
paulson@2844
    28
    "[| EX! x.P(x);                                              \
paulson@2844
    29
\       !!x. [| P(x);  ALL y y'. P(y) & P(y') --> y=y' |] ==> R  \
paulson@2844
    30
\    |] ==> R"
paulson@2844
    31
 (fn major::prems =>
paulson@2844
    32
  [ (rtac (major RS ex1E) 1),
paulson@2844
    33
    (REPEAT (ares_tac (allI::prems) 1)),
paulson@2844
    34
    (etac (dup_elim allE) 1),
paulson@2844
    35
    (IntPr.fast_tac 1)]);
paulson@2844
    36
paulson@2844
    37
paulson@2469
    38
(*Propositional rules 
paulson@2469
    39
  -- iffCE might seem better, but in the examples in ex/cla
paulson@2469
    40
     run about 7% slower than with iffE*)
paulson@2469
    41
val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI] 
paulson@2469
    42
                       addSEs [conjE,disjE,impCE,FalseE,iffE];
paulson@2469
    43
paulson@2469
    44
(*Quantifier rules*)
paulson@2844
    45
val FOL_cs = prop_cs addSIs [allI,ex_ex1I] addIs [exI] 
paulson@2844
    46
                     addSEs [exE,alt_ex1E] addEs [allE];
paulson@2469
    47
paulson@2469
    48
paulson@2469
    49
exception CS_DATA of claset;
paulson@2469
    50
paulson@2469
    51
let fun merge [] = CS_DATA empty_cs
paulson@2469
    52
      | merge cs = let val cs = map (fn CS_DATA x => x) cs;
paulson@2469
    53
                   in CS_DATA (foldl merge_cs (hd cs, tl cs)) end;
paulson@2469
    54
paulson@2469
    55
    fun put (CS_DATA cs) = claset := cs;
paulson@2469
    56
paulson@2469
    57
    fun get () = CS_DATA (!claset);
paulson@2469
    58
in add_thydata "FOL"
paulson@2469
    59
     ("claset", ThyMethods {merge = merge, put = put, get = get})
paulson@2469
    60
end;
paulson@2469
    61
paulson@2469
    62
claset := FOL_cs;
paulson@2469
    63
paulson@2867
    64
(*** Applying BlastFun to create Blast_tac ***)
paulson@2867
    65
structure Blast_Data = 
paulson@2867
    66
  struct
paulson@2867
    67
  type claset	= Cla.claset
paulson@2867
    68
  val notE	= notE
paulson@2867
    69
  val ccontr	= ccontr
paulson@2867
    70
  val contr_tac = Cla.contr_tac
paulson@2867
    71
  val dup_intr	= Cla.dup_intr
paulson@2867
    72
  val vars_gen_hyp_subst_tac = Hypsubst.vars_gen_hyp_subst_tac
paulson@2867
    73
  val claset	= Cla.claset
paulson@2867
    74
  val rep_claset = Cla.rep_claset
paulson@2867
    75
  end;
paulson@2867
    76
paulson@2867
    77
structure Blast = BlastFun(Blast_Data);
paulson@2867
    78
paulson@2867
    79
val Blast_tac = Blast.Blast_tac
paulson@2867
    80
and blast_tac = Blast.blast_tac;
paulson@2867
    81
paulson@2867
    82