author paulson Tue Oct 17 10:21:12 2000 +0200 (2000-10-17) changeset 10231 178a272bceeb parent 10197 4ea3ee8de019 child 10383 a092ae7bb2a6 permissions -rw-r--r--
renaming of contrapos rules
```     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 rev_eq_reflection = def_imp_eq
```
```    22   val imp_intr = impI
```
```    23   val rev_mp = rev_mp
```
```    24   val subst = subst
```
```    25   val sym = sym
```
```    26   val thin_refl = prove_goal (the_context ())
```
```    27 		  "!!X. [|x=x; PROP W|] ==> PROP W" (K [atac 1]);
```
```    28   end;
```
```    29
```
```    30 structure Hypsubst = HypsubstFun(Hypsubst_Data);
```
```    31 open Hypsubst;
```
```    32
```
```    33
```
```    34 (*** Applying Make_Elim_Fun to create a classical "make_elim" rule ***)
```
```    35 structure Make_Elim = Make_Elim_Fun (val classical = classical);
```
```    36
```
```    37 (*we don't redeclare the original make_elim (Tactic.make_elim) for
```
```    38   compatibliity with strange things done in many existing proofs *)
```
```    39 val cla_make_elim = Make_Elim.make_elim;
```
```    40
```
```    41 (*** Applying ClassicalFun to create a classical prover ***)
```
```    42 structure Classical_Data =
```
```    43   struct
```
```    44   val make_elim = cla_make_elim
```
```    45   val mp        = mp
```
```    46   val not_elim  = notE
```
```    47   val classical = classical
```
```    48   val sizef     = size_of_thm
```
```    49   val hyp_subst_tacs=[hyp_subst_tac]
```
```    50   end;
```
```    51
```
```    52 structure Classical = ClassicalFun(Classical_Data);
```
```    53
```
```    54 structure BasicClassical: BASIC_CLASSICAL = Classical;
```
```    55 open BasicClassical;
```
```    56
```
```    57 bind_thm ("contrapos_np", inst "Pa" "?Q" swap);
```
```    58
```
```    59 structure Obtain = ObtainFun(val atomic_thesis = HOLogic.atomic_Trueprop and
```
```    60   that_atts = [Simplifier.simp_add_local, Classical.haz_intro_local]);
```
```    61
```
```    62 (*Propositional rules*)
```
```    63 val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI]
```
```    64                        addSEs [conjE,disjE,impCE,FalseE,iffCE];
```
```    65
```
```    66 (*Quantifier rules*)
```
```    67 val HOL_cs = prop_cs addSIs [allI,ex_ex1I] addIs [exI, some_equality]
```
```    68                      addSEs [exE] addEs [allE];
```
```    69
```
```    70 val clasetup = [fn thy => (claset_ref_of thy := HOL_cs; thy)];
```