src/HOL/cladata.ML
author paulson
Thu Nov 06 10:29:37 1997 +0100 (1997-11-06)
changeset 4179 cc4b6791d5dc
parent 4085 6e2d41a5ea43
child 4205 96632970d203
permissions -rw-r--r--
hyp_subst_tac checks if the equality has type variables and uses a suitable
method if so. Affects the dest_eq function
paulson@1985
     1
(*  Title:      HOL/cladata.ML
paulson@1985
     2
    ID:         $Id$
paulson@1985
     3
    Author:     Tobias Nipkow
paulson@1985
     4
    Copyright   1996  University of Cambridge
paulson@1985
     5
wenzelm@4085
     6
Setting up the classical reasoner.
paulson@1985
     7
*)
paulson@1985
     8
paulson@1985
     9
paulson@1985
    10
(** Applying HypsubstFun to generate hyp_subst_tac **)
paulson@1985
    11
section "Classical Reasoner";
paulson@1985
    12
paulson@1985
    13
structure Hypsubst_Data =
paulson@1985
    14
  struct
paulson@1985
    15
  structure Simplifier = Simplifier
paulson@1985
    16
  (*Take apart an equality judgement; otherwise raise Match!*)
paulson@4179
    17
  fun dest_eq (Const("Trueprop",_) $ (Const("op =",T)  $ t $ u)) = 
paulson@4179
    18
	(t, u, domain_type T)
paulson@1985
    19
  val eq_reflection = eq_reflection
paulson@1985
    20
  val imp_intr = impI
paulson@1985
    21
  val rev_mp = rev_mp
paulson@1985
    22
  val subst = subst
paulson@1985
    23
  val sym = sym
paulson@1985
    24
  end;
paulson@1985
    25
paulson@1985
    26
structure Hypsubst = HypsubstFun(Hypsubst_Data);
paulson@1985
    27
open Hypsubst;
paulson@1985
    28
paulson@1985
    29
(*** Applying ClassicalFun to create a classical prover ***)
paulson@1985
    30
structure Classical_Data = 
paulson@1985
    31
  struct
paulson@1985
    32
  val sizef     = size_of_thm
paulson@1985
    33
  val mp        = mp
paulson@1985
    34
  val not_elim  = notE
paulson@1985
    35
  val classical = classical
paulson@1985
    36
  val hyp_subst_tacs=[hyp_subst_tac]
paulson@1985
    37
  end;
paulson@1985
    38
paulson@1985
    39
structure Classical = ClassicalFun(Classical_Data);
paulson@1985
    40
open Classical;
paulson@1985
    41
paulson@1985
    42
(*Propositional rules*)
paulson@1985
    43
val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI]
paulson@1985
    44
                       addSEs [conjE,disjE,impCE,FalseE,iffE];
paulson@1985
    45
paulson@1985
    46
(*Quantifier rules*)
paulson@3004
    47
val HOL_cs = prop_cs addSIs [allI,ex_ex1I] addIs [exI] 
paulson@3004
    48
                     addSEs [exE] addEs [allE];
paulson@1985
    49
wenzelm@4085
    50
claset_ref() := HOL_cs;
paulson@1985
    51
paulson@3004
    52
(*Better then ex1E for classical reasoner: needs no quantifier duplication!*)
paulson@3004
    53
qed_goal "alt_ex1E" thy
wenzelm@3842
    54
    "[| ?! x. P(x);                                              \
paulson@3004
    55
\       !!x. [| P(x);  ALL y y'. P(y) & P(y') --> y=y' |] ==> R  \
paulson@3004
    56
\    |] ==> R"
paulson@3004
    57
 (fn major::prems =>
paulson@3004
    58
  [ (rtac (major RS ex1E) 1),
paulson@3004
    59
    (REPEAT (ares_tac (allI::prems) 1)),
paulson@3004
    60
    (etac (dup_elim allE) 1),
paulson@3004
    61
    (Fast_tac 1)]);
paulson@3004
    62
paulson@3004
    63
AddSEs [alt_ex1E];
paulson@2860
    64
paulson@2860
    65
(*** Applying BlastFun to create Blast_tac ***)
paulson@2860
    66
structure Blast_Data = 
paulson@2860
    67
  struct
paulson@2860
    68
  type claset	= Classical.claset
paulson@2860
    69
  val notE	= notE
paulson@2860
    70
  val ccontr	= ccontr
paulson@2860
    71
  val contr_tac = Classical.contr_tac
paulson@2860
    72
  val dup_intr	= Classical.dup_intr
paulson@2860
    73
  val vars_gen_hyp_subst_tac = Hypsubst.vars_gen_hyp_subst_tac
paulson@2860
    74
  val claset	= Classical.claset
paulson@2860
    75
  val rep_claset = Classical.rep_claset
paulson@2860
    76
  end;
paulson@2860
    77
paulson@2860
    78
structure Blast = BlastFun(Blast_Data);
paulson@4059
    79
Blast.overload ("op =", domain_type);	(*overloading of equality as iff*)
paulson@2860
    80
paulson@2860
    81
val Blast_tac = Blast.Blast_tac
paulson@2860
    82
and blast_tac = Blast.blast_tac;