src/FOL/cladata.ML
author paulson
Fri, 29 Oct 2004 15:16:02 +0200
changeset 15270 8b3f707a78a7
parent 14156 2072802ab0e3
child 17876 b9c92f384109
permissions -rw-r--r--
fixed reference to renamed theorem
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 
13034
wenzelm
parents: 11748
diff changeset
    15
  compatibility with strange things done in many existing proofs *)
9158
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]
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    27
  end;
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    28
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    29
structure Cla = ClassicalFun(Classical_Data);
8099
6a087be9f6d9 ObtainFun;
wenzelm
parents: 7355
diff changeset
    30
structure BasicClassical: BASIC_CLASSICAL = Cla; open BasicClassical;
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    31
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 7156
diff changeset
    32
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    33
(*Better for fast_tac: needs no quantifier duplication!*)
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    34
qed_goal "alt_ex1E" IFOL.thy
3835
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
    35
    "[| EX! x. P(x);                                              \
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    36
\       !!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
    37
\    |] ==> R"
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    38
 (fn major::prems =>
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    39
  [ (rtac (major RS ex1E) 1),
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    40
    (REPEAT (ares_tac (allI::prems) 1)),
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    41
    (etac (dup_elim allE) 1),
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    42
    (IntPr.fast_tac 1)]);
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    43
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    44
4305
03d7de40ee4f The change from iffE to iffCE means fewer case splits in most cases. Very few
paulson
parents: 4095
diff changeset
    45
(*Propositional rules*)
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    46
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
    47
                       addSEs [conjE,disjE,impCE,FalseE,iffCE];
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    48
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    49
(*Quantifier rules*)
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    50
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
    51
                     addSEs [exE,alt_ex1E] addEs [allE];
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    52
14156
2072802ab0e3 new case_tac method
paulson
parents: 13034
diff changeset
    53
val cla_setup = [fn thy => (claset_ref_of thy := FOL_cs; thy)];
2072802ab0e3 new case_tac method
paulson
parents: 13034
diff changeset
    54
2072802ab0e3 new case_tac method
paulson
parents: 13034
diff changeset
    55
val case_setup =
2072802ab0e3 new case_tac method
paulson
parents: 13034
diff changeset
    56
 [Method.add_methods
2072802ab0e3 new case_tac method
paulson
parents: 13034
diff changeset
    57
    [("case_tac", Method.goal_args Args.name case_tac,
2072802ab0e3 new case_tac method
paulson
parents: 13034
diff changeset
    58
      "case_tac emulation (dynamic instantiation!)")]];