author oheimb Thu Jan 08 18:09:07 1998 +0100 (1998-01-08) changeset 4535 f24cebc299e4 parent 4466 305390f23734 child 4653 d60f76680bf4 permissions -rw-r--r--
added select_equality to the implicit claset
```     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("op =",T)  \$ t \$ u) = (t, u, domain_type T)
```
```    18   val dest_Trueprop = HOLogic.dest_Trueprop
```
```    19   val dest_imp = HOLogic.dest_imp
```
```    20   val eq_reflection = eq_reflection
```
```    21   val imp_intr = impI
```
```    22   val rev_mp = rev_mp
```
```    23   val subst = subst
```
```    24   val sym = sym
```
```    25   val thin_refl = prove_goal HOL.thy
```
```    26 		  "!!X. [|x=x; PROP W|] ==> PROP W" (K [atac 1]);
```
```    27   end;
```
```    28
```
```    29 structure Hypsubst = HypsubstFun(Hypsubst_Data);
```
```    30 open Hypsubst;
```
```    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 hyp_subst_tacs=[hyp_subst_tac]
```
```    40   end;
```
```    41
```
```    42 structure Classical = ClassicalFun(Classical_Data);
```
```    43 open Classical;
```
```    44
```
```    45 (*Propositional rules*)
```
```    46 val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI]
```
```    47                        addSEs [conjE,disjE,impCE,FalseE,iffCE];
```
```    48
```
```    49 (*Quantifier rules*)
```
```    50 val HOL_cs = prop_cs addSIs [allI,ex_ex1I] addIs [exI, select_equality]
```
```    51                      addSEs [exE] addEs [allE];
```
```    52
```
```    53 claset_ref() := HOL_cs;
```
```    54
```
```    55 (*Better then ex1E for classical reasoner: needs no quantifier duplication!*)
```
```    56 qed_goal "alt_ex1E" thy
```
```    57     "[| ?! x. P(x);                                              \
```
```    58 \       !!x. [| P(x);  ALL y y'. P(y) & P(y') --> y=y' |] ==> R  \
```
```    59 \    |] ==> R"
```
```    60  (fn major::prems =>
```
```    61   [ (rtac (major RS ex1E) 1),
```
```    62     (REPEAT (ares_tac (allI::prems) 1)),
```
```    63     (etac (dup_elim allE) 1),
```
```    64     (Fast_tac 1)]);
```
```    65
```
```    66 AddSEs [alt_ex1E];
```
```    67
```
```    68 (*** Applying BlastFun to create Blast_tac ***)
```
```    69 structure Blast_Data =
```
```    70   struct
```
```    71   type claset	= Classical.claset
```
```    72   val notE	= notE
```
```    73   val ccontr	= ccontr
```
```    74   val contr_tac = Classical.contr_tac
```
```    75   val dup_intr	= Classical.dup_intr
```
```    76   val hyp_subst_tac = Hypsubst.blast_hyp_subst_tac
```
```    77   val claset	= Classical.claset
```
```    78   val rep_claset = Classical.rep_claset
```
```    79   end;
```
```    80
```
```    81 structure Blast = BlastFun(Blast_Data);
```
```    82 Blast.overloaded ("op =", domain_type);	(*overloading of equality as iff*)
```
```    83
```
```    84 val Blast_tac = Blast.Blast_tac
```
```    85 and blast_tac = Blast.blast_tac;
```