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