src/FOLP/ROOT.ML
author lcp
Wed, 01 Dec 1993 12:41:25 +0100
changeset 176 5729f6757473
parent 98 329b5ac27f6e
child 393 02b27671b899
permissions -rw-r--r--
now declares FOLP_build_completed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     1
(*  Title: 	FOLP/ROOT
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Author: 	martin Coen, 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
Modifed version of Lawrence Paulson's FOL that contains proof terms.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
Presence of unknown proof term means that matching does not behave as expected.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
val banner = "First-Order Logic with Natural Deduction with Proof Terms";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
writeln banner;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
72
099d949fe467 changes for new Readthy
clasohm
parents: 0
diff changeset
    15
structure Readthy = ReadthyFUN (structure ThySyn = ThySyn);
099d949fe467 changes for new Readthy
clasohm
parents: 0
diff changeset
    16
open Readthy;
099d949fe467 changes for new Readthy
clasohm
parents: 0
diff changeset
    17
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
print_depth 1;  
98
329b5ac27f6e renamed int-prover.ML to intprover.ML,
clasohm
parents: 72
diff changeset
    19
use_thy "IFOLP";
329b5ac27f6e renamed int-prover.ML to intprover.ML,
clasohm
parents: 72
diff changeset
    20
use_thy "FOLP";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
use "../Provers/hypsubst.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
use "classical.ML";      (* Patched 'cos matching won't instantiate proof *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
use "simp.ML";	         (* Patched 'cos matching won't instantiate proof *)
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
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
(*** Applying HypsubstFun to generate hyp_subst_tac ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
structure Hypsubst_Data =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
  struct
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
  (*Take apart an equality judgement; otherwise raise Match!*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
  fun dest_eq (Const("Proof",_) $ (Const("op =",_)  $ t $ u) $ _) = (t,u);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
  val imp_intr = impI
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
  (*etac rev_cut_eq moves an equality to be the last premise. *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
  val rev_cut_eq = prove_goal IFOLP.thy 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
		"[| p:a=b;  !!x.x:a=b ==> f(x):R |] ==> ?p:R"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
   (fn prems => [ REPEAT(resolve_tac prems 1) ]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
  val rev_mp = rev_mp
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
  val subst = subst
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
  val sym = sym
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
structure Hypsubst = HypsubstFun(Hypsubst_Data);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
open Hypsubst;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
98
329b5ac27f6e renamed int-prover.ML to intprover.ML,
clasohm
parents: 72
diff changeset
    50
use "intprover.ML";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
(*** Applying ClassicalFun to create a classical prover ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
structure Classical_Data = 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
  struct
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
  val sizef = size_of_thm
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    56
  val mp = mp
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
  val not_elim = notE
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
  val swap = swap
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
  val hyp_subst_tacs=[hyp_subst_tac]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
structure Cla = ClassicalFun(Classical_Data);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
open Cla;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
(*Propositional rules 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
  -- iffCE might seem better, but in the examples in ex/cla
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
     run about 7% slower than with iffE*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI] 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
                       addSEs [conjE,disjE,impCE,FalseE,iffE];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
(*Quantifier rules*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
val FOLP_cs = prop_cs addSIs [allI] addIs [exI,ex1I] 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
                      addSEs [exE,ex1E] addEs [allE];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
val FOLP_dup_cs = prop_cs addSIs [allI] addIs [exCI,ex1I] 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
                          addSEs [exE,ex1E] addEs [all_dupE];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
use "simpdata.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
use "../Pure/install_pp.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
print_depth 8;
176
5729f6757473 now declares FOLP_build_completed
lcp
parents: 98
diff changeset
    82
5729f6757473 now declares FOLP_build_completed
lcp
parents: 98
diff changeset
    83
val FOLP_build_completed = ();	(*indicate successful build*)