src/FOL/ROOT.ML
author clasohm
Tue, 09 Nov 1993 13:21:41 +0100
changeset 97 dd350da66c2c
parent 72 099d949fe467
child 121 d392174734e9
permissions -rw-r--r--
renamed int-prover.ML to intprover.ML, used exact theory names in ROOT.ML
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     1
(*  Title: 	FOL/ROOT
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
Adds First-Order Logic to a database containing pure Isabelle. 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
Should be executed in the subdirectory FOL.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
val banner = "First-Order Logic with Natural Deduction";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
writeln banner;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
72
099d949fe467 changes for new Readthy
clasohm
parents: 0
diff changeset
    14
structure Readthy = ReadthyFUN (structure ThySyn = ThySyn);
099d949fe467 changes for new Readthy
clasohm
parents: 0
diff changeset
    15
open Readthy;
099d949fe467 changes for new Readthy
clasohm
parents: 0
diff changeset
    16
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
print_depth 1;  
97
dd350da66c2c renamed int-prover.ML to intprover.ML,
clasohm
parents: 72
diff changeset
    18
use_thy "IFOL";
dd350da66c2c renamed int-prover.ML to intprover.ML,
clasohm
parents: 72
diff changeset
    19
use_thy "FOL";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
use "../Provers/hypsubst.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
use "../Provers/classical.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
use "../Provers/simplifier.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
use "../Provers/splitter.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
use "../Provers/ind.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
(*** Applying HypsubstFun to generate hyp_subst_tac ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
structure Hypsubst_Data =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
  struct
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
  (*Take apart an equality judgement; otherwise raise Match!*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
  fun dest_eq (Const("Trueprop",_) $ (Const("op =",_)  $ t $ u)) = (t,u);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
  val imp_intr = impI
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
  (*etac rev_cut_eq moves an equality to be the last premise. *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
  val rev_cut_eq = prove_goal IFOL.thy "[| a=b;  a=b ==> R |] ==> R"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
   (fn prems => [ REPEAT(resolve_tac prems 1) ]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
  val rev_mp = rev_mp
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
  val subst = subst
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
  val sym = sym
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
structure Hypsubst = HypsubstFun(Hypsubst_Data);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
open Hypsubst;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
97
dd350da66c2c renamed int-prover.ML to intprover.ML,
clasohm
parents: 72
diff changeset
    48
use "intprover.ML";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    50
(*** Applying ClassicalFun to create a classical prover ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
structure Classical_Data = 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
  struct
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
  val sizef = size_of_thm
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
  val mp = mp
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
  val not_elim = notE
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    56
  val swap = swap
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
  val hyp_subst_tacs=[hyp_subst_tac]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
structure Cla = ClassicalFun(Classical_Data);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
open Cla;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
(*Propositional rules 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
  -- iffCE might seem better, but in the examples in ex/cla
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
     run about 7% slower than with iffE*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI] 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
                       addSEs [conjE,disjE,impCE,FalseE,iffE];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
(*Quantifier rules*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
val FOL_cs = prop_cs addSIs [allI] addIs [exI,ex1I] 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
                     addSEs [exE,ex1E] addEs [allE];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
val FOL_dup_cs = prop_cs addSIs [allI] addIs [exCI,ex1I] 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
                         addSEs [exE,ex1E] addEs [all_dupE];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
use "simpdata.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
use "../Pure/install_pp.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
print_depth 8;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
val FOL_build_completed = ();	(*indicate successful build*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82