author paulson Sat Nov 01 12:59:06 1997 +0100 (1997-11-01) changeset 4059 59c1422c9da5 parent 3842 b55686a7b22c child 4085 6e2d41a5ea43 permissions -rw-r--r--
New Blast_tac (and minor tidying...)
```     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 \$ u)) = (t,u);
```
```    18   val eq_reflection = eq_reflection
```
```    19   val imp_intr = impI
```
```    20   val rev_mp = rev_mp
```
```    21   val subst = subst
```
```    22   val sym = sym
```
```    23   end;
```
```    24
```
```    25 structure Hypsubst = HypsubstFun(Hypsubst_Data);
```
```    26 open Hypsubst;
```
```    27
```
```    28 (*** Applying ClassicalFun to create a classical prover ***)
```
```    29 structure Classical_Data =
```
```    30   struct
```
```    31   val sizef     = size_of_thm
```
```    32   val mp        = mp
```
```    33   val not_elim  = notE
```
```    34   val classical = classical
```
```    35   val hyp_subst_tacs=[hyp_subst_tac]
```
```    36   end;
```
```    37
```
```    38 structure Classical = ClassicalFun(Classical_Data);
```
```    39 open Classical;
```
```    40
```
```    41 (*Propositional rules*)
```
```    42 val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI]
```
```    43                        addSEs [conjE,disjE,impCE,FalseE,iffE];
```
```    44
```
```    45 (*Quantifier rules*)
```
```    46 val HOL_cs = prop_cs addSIs [allI,ex_ex1I] addIs [exI]
```
```    47                      addSEs [exE] addEs [allE];
```
```    48
```
```    49 exception CS_DATA of claset;
```
```    50
```
```    51 let fun merge [] = CS_DATA empty_cs
```
```    52       | merge cs = let val cs = map (fn CS_DATA x => x) cs;
```
```    53                    in CS_DATA (foldl merge_cs (hd cs, tl cs)) end;
```
```    54
```
```    55     fun put (CS_DATA cs) = claset := cs;
```
```    56
```
```    57     fun get () = CS_DATA (!claset);
```
```    58 in add_thydata "HOL"
```
```    59      ("claset", ThyMethods {merge = merge, put = put, get = get})
```
```    60 end;
```
```    61
```
```    62 fun claset_of tname =
```
```    63   case get_thydata tname "claset" of
```
```    64       None => empty_cs
```
```    65     | Some (CS_DATA cs) => cs;
```
```    66
```
```    67 claset := HOL_cs;
```
```    68
```
```    69 (*Better then ex1E for classical reasoner: needs no quantifier duplication!*)
```
```    70 qed_goal "alt_ex1E" thy
```
```    71     "[| ?! x. P(x);                                              \
```
```    72 \       !!x. [| P(x);  ALL y y'. P(y) & P(y') --> y=y' |] ==> R  \
```
```    73 \    |] ==> R"
```
```    74  (fn major::prems =>
```
```    75   [ (rtac (major RS ex1E) 1),
```
```    76     (REPEAT (ares_tac (allI::prems) 1)),
```
```    77     (etac (dup_elim allE) 1),
```
```    78     (Fast_tac 1)]);
```
```    79
```
```    80 AddSEs [alt_ex1E];
```
```    81
```
```    82 (*** Applying BlastFun to create Blast_tac ***)
```
```    83 structure Blast_Data =
```
```    84   struct
```
```    85   type claset	= Classical.claset
```
```    86   val notE	= notE
```
```    87   val ccontr	= ccontr
```
```    88   val contr_tac = Classical.contr_tac
```
```    89   val dup_intr	= Classical.dup_intr
```
```    90   val vars_gen_hyp_subst_tac = Hypsubst.vars_gen_hyp_subst_tac
```
```    91   val claset	= Classical.claset
```
```    92   val rep_claset = Classical.rep_claset
```
```    93   end;
```
```    94
```
```    95 structure Blast = BlastFun(Blast_Data);
```
```    96 Blast.overload ("op =", domain_type);	(*overloading of equality as iff*)
```
```    97
```
```    98 val Blast_tac = Blast.Blast_tac
```
```    99 and blast_tac = Blast.blast_tac;
```