src/FOL/cladata.ML
author wenzelm
Mon, 03 Nov 1997 12:28:14 +0100
changeset 4095 6fd0f439e50e
parent 3835 9a5a4e123859
child 4305 03d7de40ee4f
permissions -rw-r--r--
adapted to new implicit claset;
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
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     6
Setting up the classical reasoner 
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
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    10
section "Classical Reasoner";
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    11
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    12
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    13
(*** Applying ClassicalFun to create a classical prover ***)
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    14
structure Classical_Data = 
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    15
  struct
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    16
  val sizef     = size_of_thm
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    17
  val mp        = mp
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    18
  val not_elim  = notE
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    19
  val classical = classical
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    20
  val hyp_subst_tacs=[hyp_subst_tac]
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    21
  end;
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    22
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    23
structure Cla = ClassicalFun(Classical_Data);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    24
open Cla;
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    25
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    26
(*Better for fast_tac: needs no quantifier duplication!*)
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    27
qed_goal "alt_ex1E" IFOL.thy
3835
9a5a4e123859 fixed dots;
wenzelm
parents: 3610
diff changeset
    28
    "[| EX! x. P(x);                                              \
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    29
\       !!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
    30
\    |] ==> R"
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    31
 (fn major::prems =>
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    32
  [ (rtac (major RS ex1E) 1),
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    33
    (REPEAT (ares_tac (allI::prems) 1)),
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    34
    (etac (dup_elim allE) 1),
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    35
    (IntPr.fast_tac 1)]);
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    36
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    37
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    38
(*Propositional rules 
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    39
  -- iffCE might seem better, but in the examples in ex/cla
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    40
     run about 7% slower than with iffE*)
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    41
val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI] 
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    42
                       addSEs [conjE,disjE,impCE,FalseE,iffE];
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    43
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    44
(*Quantifier rules*)
2844
05d78159812d Now uses the alternative (safe!) rules for ex1
paulson
parents: 2469
diff changeset
    45
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
    46
                     addSEs [exE,alt_ex1E] addEs [allE];
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    47
4095
6fd0f439e50e adapted to new implicit claset;
wenzelm
parents: 3835
diff changeset
    48
claset_ref() := FOL_cs;
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    49
3610
7e5300420b03 Moved functions from file "thy_data.ML".
berghofe
parents: 2867
diff changeset
    50
2867
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    51
(*** Applying BlastFun to create Blast_tac ***)
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    52
structure Blast_Data = 
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    53
  struct
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    54
  type claset	= Cla.claset
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    55
  val notE	= notE
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    56
  val ccontr	= ccontr
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    57
  val contr_tac = Cla.contr_tac
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    58
  val dup_intr	= Cla.dup_intr
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    59
  val vars_gen_hyp_subst_tac = Hypsubst.vars_gen_hyp_subst_tac
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    60
  val claset	= Cla.claset
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    61
  val rep_claset = Cla.rep_claset
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    62
  end;
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    63
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    64
structure Blast = BlastFun(Blast_Data);
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    65
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    66
val Blast_tac = Blast.Blast_tac
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    67
and blast_tac = Blast.blast_tac;
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    68
0aa5a3cd4550 Now builds blast_tac
paulson
parents: 2844
diff changeset
    69