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
```     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 (*** Applying ClassicalFun to create a classical prover ***)
```
```    30 structure Classical_Data =
```
```    31   struct
```
```    32   val sizef     = size_of_thm
```
```    33   val mp        = mp
```
```    34   val not_elim  = notE
```
```    35   val classical = classical
```
```    36   val hyp_subst_tacs=[hyp_subst_tac]
```
```    37   end;
```
```    38
```
```    39 structure Classical = ClassicalFun(Classical_Data);
```
```    40 open Classical;
```
```    41
```
```    42 (*Propositional rules*)
```
```    43 val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI]
```
```    44                        addSEs [conjE,disjE,impCE,FalseE,iffE];
```
```    45
```
```    46 (*Quantifier rules*)
```
```    47 val HOL_cs = prop_cs addSIs [allI,ex_ex1I] addIs [exI]
```
```    48                      addSEs [exE] addEs [allE];
```
```    49
```
```    50 claset_ref() := HOL_cs;
```
```    51
```
```    52 (*Better then ex1E for classical reasoner: needs no quantifier duplication!*)
```
```    53 qed_goal "alt_ex1E" thy
```
```    54     "[| ?! x. P(x);                                              \
```
```    55 \       !!x. [| P(x);  ALL y y'. P(y) & P(y') --> y=y' |] ==> R  \
```
```    56 \    |] ==> R"
```
```    57  (fn major::prems =>
```
```    58   [ (rtac (major RS ex1E) 1),
```
```    59     (REPEAT (ares_tac (allI::prems) 1)),
```
```    60     (etac (dup_elim allE) 1),
```
```    61     (Fast_tac 1)]);
```
```    62
```
```    63 AddSEs [alt_ex1E];
```
```    64
```
```    65 (*** Applying BlastFun to create Blast_tac ***)
```
```    66 structure Blast_Data =
```
```    67   struct
```
```    68   type claset	= Classical.claset
```
```    69   val notE	= notE
```
```    70   val ccontr	= ccontr
```
```    71   val contr_tac = Classical.contr_tac
```
```    72   val dup_intr	= Classical.dup_intr
```
```    73   val vars_gen_hyp_subst_tac = Hypsubst.vars_gen_hyp_subst_tac
```
```    74   val claset	= Classical.claset
```
```    75   val rep_claset = Classical.rep_claset
```
```    76   end;
```
```    77
```
```    78 structure Blast = BlastFun(Blast_Data);
```
```    79 Blast.overload ("op =", domain_type);	(*overloading of equality as iff*)
```
```    80
```
```    81 val Blast_tac = Blast.Blast_tac
```
```    82 and blast_tac = Blast.blast_tac;
```