src/FOL/cladata.ML
author wenzelm
Fri, 03 Nov 2000 21:31:11 +0100
changeset 10383 a092ae7bb2a6
parent 9846 bb848beb53f6
child 10429 8820f787e61e
permissions -rw-r--r--
"atomize" for classical tactics;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     1
(*  Title:      FOL/cladata.ML
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     2
    ID:         $Id$
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     3
    Author:     Tobias Nipkow
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     5
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 7156
diff changeset
     6
Setting up the classical reasoner.
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     7
*)
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     8
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     9
section "Classical Reasoner";
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    10
9158
084abf3d0eff declaring and using cla_make_elim
paulson
parents: 8099
diff changeset
    11
(*** Applying Make_Elim_Fun to create a classical "make_elim" rule ***)
9846
wenzelm
parents: 9472
diff changeset
    12
structure Make_Elim = Make_Elim_Fun(val classical = classical);
9158
084abf3d0eff declaring and using cla_make_elim
paulson
parents: 8099
diff changeset
    13
084abf3d0eff declaring and using cla_make_elim
paulson
parents: 8099
diff changeset
    14
(*we don't redeclare the original make_elim (Tactic.make_elim) for 
084abf3d0eff declaring and using cla_make_elim
paulson
parents: 8099
diff changeset
    15
  compatibliity with strange things done in many existing proofs *)
084abf3d0eff declaring and using cla_make_elim
paulson
parents: 8099
diff changeset
    16
val cla_make_elim = Make_Elim.make_elim;
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    17
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    18
(*** Applying ClassicalFun to create a classical prover ***)
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    19
structure Classical_Data = 
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    20
  struct
9158
084abf3d0eff declaring and using cla_make_elim
paulson
parents: 8099
diff changeset
    21
  val make_elim = cla_make_elim
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    22
  val mp        = mp
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    23
  val not_elim  = notE
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    24
  val classical = classical
9158
084abf3d0eff declaring and using cla_make_elim
paulson
parents: 8099
diff changeset
    25
  val sizef     = size_of_thm
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    26
  val hyp_subst_tacs=[hyp_subst_tac]
10383
a092ae7bb2a6 "atomize" for classical tactics;
wenzelm
parents: 9846
diff changeset
    27
  val atomize	= thms "atomize"
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    28
  end;
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    29
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    30
structure Cla = ClassicalFun(Classical_Data);
8099
6a087be9f6d9 ObtainFun;
wenzelm
parents: 7355
diff changeset
    31
structure BasicClassical: BASIC_CLASSICAL = Cla; open BasicClassical;
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    32
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 7156
diff changeset
    33
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    34
(*Better for fast_tac: needs no quantifier duplication!*)
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    35
qed_goal "alt_ex1E" IFOL.thy
3835
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
    36
    "[| EX! x. P(x);                                              \
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    37
\       !!x. [| P(x);  ALL y y'. P(y) & P(y') --> y=y' |] ==> R  \
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    38
\    |] ==> R"
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    39
 (fn major::prems =>
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    40
  [ (rtac (major RS ex1E) 1),
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    41
    (REPEAT (ares_tac (allI::prems) 1)),
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    42
    (etac (dup_elim allE) 1),
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    43
    (IntPr.fast_tac 1)]);
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    44
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    45
4305
03d7de40ee4f The change from iffE to iffCE means fewer case splits in most cases. Very few
paulson
parents: 4095
diff changeset
    46
(*Propositional rules*)
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    47
val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI] 
4305
03d7de40ee4f The change from iffE to iffCE means fewer case splits in most cases. Very few
paulson
parents: 4095
diff changeset
    48
                       addSEs [conjE,disjE,impCE,FalseE,iffCE];
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    49
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    50
(*Quantifier rules*)
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    51
val FOL_cs = prop_cs addSIs [allI,ex_ex1I] addIs [exI] 
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    52
                     addSEs [exE,alt_ex1E] addEs [allE];
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    53
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 7156
diff changeset
    54
val clasetup = [fn thy => (claset_ref_of thy := FOL_cs; thy)];