src/HOL/cladata.ML
author paulson
Thu Jul 15 10:27:54 1999 +0200 (1999-07-15)
changeset 7007 b46ccfee8e59
parent 5929 890f2f9b926d
child 7153 820c8c8573d9
permissions -rw-r--r--
qed_goal -> Goal
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@4466
    17
  fun dest_eq (Const("op =",T)  $ t $ u) = (t, u, domain_type T)
paulson@4466
    18
  val dest_Trueprop = HOLogic.dest_Trueprop
paulson@4466
    19
  val dest_imp = HOLogic.dest_imp
paulson@1985
    20
  val eq_reflection = eq_reflection
paulson@1985
    21
  val imp_intr = impI
paulson@1985
    22
  val rev_mp = rev_mp
paulson@1985
    23
  val subst = subst
paulson@1985
    24
  val sym = sym
oheimb@4223
    25
  val thin_refl = prove_goal HOL.thy 
oheimb@4223
    26
		  "!!X. [|x=x; PROP W|] ==> PROP W" (K [atac 1]);
paulson@1985
    27
  end;
paulson@1985
    28
paulson@1985
    29
structure Hypsubst = HypsubstFun(Hypsubst_Data);
paulson@1985
    30
open Hypsubst;
paulson@1985
    31
paulson@1985
    32
(*** Applying ClassicalFun to create a classical prover ***)
paulson@1985
    33
structure Classical_Data = 
paulson@1985
    34
  struct
paulson@1985
    35
  val sizef     = size_of_thm
paulson@1985
    36
  val mp        = mp
paulson@1985
    37
  val not_elim  = notE
paulson@1985
    38
  val classical = classical
oheimb@4206
    39
  val hyp_subst_tacs=[hyp_subst_tac]
paulson@1985
    40
  end;
paulson@1985
    41
paulson@1985
    42
structure Classical = ClassicalFun(Classical_Data);
paulson@1985
    43
open Classical;
paulson@1985
    44
paulson@1985
    45
(*Propositional rules*)
paulson@1985
    46
val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI]
paulson@4305
    47
                       addSEs [conjE,disjE,impCE,FalseE,iffCE];
paulson@1985
    48
paulson@1985
    49
(*Quantifier rules*)
oheimb@4535
    50
val HOL_cs = prop_cs addSIs [allI,ex_ex1I] addIs [exI, select_equality] 
paulson@3004
    51
                     addSEs [exE] addEs [allE];
paulson@1985
    52
wenzelm@4085
    53
claset_ref() := HOL_cs;
paulson@1985
    54
paulson@3004
    55
(*Better then ex1E for classical reasoner: needs no quantifier duplication!*)
paulson@7007
    56
val major::prems = goal thy
wenzelm@3842
    57
    "[| ?! x. P(x);                                              \
paulson@3004
    58
\       !!x. [| P(x);  ALL y y'. P(y) & P(y') --> y=y' |] ==> R  \
paulson@7007
    59
\    |] ==> R";
paulson@7007
    60
by (rtac (major RS ex1E) 1);
paulson@7007
    61
by (REPEAT (ares_tac (allI::prems) 1));
paulson@7007
    62
by (etac (dup_elim allE) 1);
paulson@7007
    63
by (Fast_tac 1);
paulson@7007
    64
qed "alt_ex1E";
paulson@3004
    65
paulson@3004
    66
AddSEs [alt_ex1E];
paulson@2860
    67
paulson@2860
    68
(*** Applying BlastFun to create Blast_tac ***)
paulson@2860
    69
structure Blast_Data = 
paulson@2860
    70
  struct
paulson@2860
    71
  type claset	= Classical.claset
paulson@2860
    72
  val notE	= notE
paulson@2860
    73
  val ccontr	= ccontr
paulson@2860
    74
  val contr_tac = Classical.contr_tac
paulson@2860
    75
  val dup_intr	= Classical.dup_intr
paulson@4466
    76
  val hyp_subst_tac = Hypsubst.blast_hyp_subst_tac
paulson@2860
    77
  val claset	= Classical.claset
oheimb@4653
    78
  val rep_cs    = Classical.rep_cs
wenzelm@5929
    79
  val cla_method' = Classical.cla_method'
paulson@2860
    80
  end;
paulson@2860
    81
paulson@2860
    82
structure Blast = BlastFun(Blast_Data);
paulson@4240
    83
Blast.overloaded ("op =", domain_type);	(*overloading of equality as iff*)
paulson@2860
    84
paulson@2860
    85
val Blast_tac = Blast.Blast_tac
paulson@2860
    86
and blast_tac = Blast.blast_tac;