src/FOL/cladata.ML
author wenzelm
Thu, 19 Jan 2006 21:22:08 +0100
changeset 18708 4b3dadb4fe33
parent 18529 540da2415751
child 21539 c5cf9243ad62
permissions -rw-r--r--
setup: theory -> theory;
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
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    11
(*** Applying ClassicalFun to create a classical prover ***)
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    12
structure Classical_Data = 
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    13
  struct
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    14
  val mp        = mp
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    15
  val not_elim  = notE
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    16
  val classical = classical
9158
084abf3d0eff declaring and using cla_make_elim
paulson
parents: 8099
diff changeset
    17
  val sizef     = size_of_thm
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    18
  val hyp_subst_tacs=[hyp_subst_tac]
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    19
  end;
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    20
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    21
structure Cla = ClassicalFun(Classical_Data);
8099
6a087be9f6d9 ObtainFun;
wenzelm
parents: 7355
diff changeset
    22
structure BasicClassical: BASIC_CLASSICAL = Cla; open BasicClassical;
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    23
7355
4c43090659ca proper bootstrap of IFOL/FOL theories and packages;
wenzelm
parents: 7156
diff changeset
    24
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    25
(*Better for fast_tac: needs no quantifier duplication!*)
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    26
qed_goal "alt_ex1E" IFOL.thy
3835
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
    27
    "[| EX! x. P(x);                                              \
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    28
\       !!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
    29
\    |] ==> R"
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    30
 (fn major::prems =>
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    31
  [ (rtac (major RS ex1E) 1),
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    32
    (REPEAT (ares_tac (allI::prems) 1)),
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    33
    (etac (dup_elim allE) 1),
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    34
    (IntPr.fast_tac 1)]);
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    35
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    36
4305
03d7de40ee4f The change from iffE to iffCE means fewer case splits in most cases. Very few
paulson
parents: 4095
diff changeset
    37
(*Propositional rules*)
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    38
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
    39
                       addSEs [conjE,disjE,impCE,FalseE,iffCE];
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    40
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    41
(*Quantifier rules*)
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    42
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
    43
                     addSEs [exE,alt_ex1E] addEs [allE];
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    44
18708
4b3dadb4fe33 setup: theory -> theory;
wenzelm
parents: 18529
diff changeset
    45
val cla_setup = (fn thy => (change_claset_of thy (fn _ => FOL_cs); thy));
14156
2072802ab0e3 new case_tac method
paulson
parents: 13034
diff changeset
    46
2072802ab0e3 new case_tac method
paulson
parents: 13034
diff changeset
    47
val case_setup =
18708
4b3dadb4fe33 setup: theory -> theory;
wenzelm
parents: 18529
diff changeset
    48
 (Method.add_methods
14156
2072802ab0e3 new case_tac method
paulson
parents: 13034
diff changeset
    49
    [("case_tac", Method.goal_args Args.name case_tac,
18708
4b3dadb4fe33 setup: theory -> theory;
wenzelm
parents: 18529
diff changeset
    50
      "case_tac emulation (dynamic instantiation!)")]);