src/FOLP/ROOT.ML
author wenzelm
Thu Mar 11 13:20:35 1999 +0100 (1999-03-11)
changeset 6349 f7750d816c21
parent 4223 f60e3d2c81d3
child 17480 fd19f77dcf60
permissions -rw-r--r--
removed foo_build_completed -- now handled by session management (via usedir);
clasohm@1459
     1
(*  Title:      FOLP/ROOT
clasohm@0
     2
    ID:         $Id$
clasohm@1459
     3
    Author:     martin Coen, Cambridge University Computer Laboratory
clasohm@0
     4
    Copyright   1993  University of Cambridge
clasohm@0
     5
clasohm@0
     6
Modifed version of Lawrence Paulson's FOL that contains proof terms.
clasohm@0
     7
clasohm@0
     8
Presence of unknown proof term means that matching does not behave as expected.
clasohm@0
     9
*)
clasohm@0
    10
clasohm@0
    11
val banner = "First-Order Logic with Natural Deduction with Proof Terms";
clasohm@0
    12
clasohm@0
    13
writeln banner;
clasohm@0
    14
wenzelm@3511
    15
print_depth 1;
clasohm@72
    16
clasohm@98
    17
use_thy "IFOLP";
clasohm@98
    18
use_thy "FOLP";
clasohm@0
    19
lcp@1008
    20
use "hypsubst.ML";
clasohm@0
    21
use "classical.ML";      (* Patched 'cos matching won't instantiate proof *)
clasohm@1459
    22
use "simp.ML";           (* Patched 'cos matching won't instantiate proof *)
clasohm@0
    23
clasohm@0
    24
clasohm@0
    25
(*** Applying HypsubstFun to generate hyp_subst_tac ***)
clasohm@0
    26
clasohm@0
    27
structure Hypsubst_Data =
clasohm@0
    28
  struct
clasohm@0
    29
  (*Take apart an equality judgement; otherwise raise Match!*)
clasohm@0
    30
  fun dest_eq (Const("Proof",_) $ (Const("op =",_)  $ t $ u) $ _) = (t,u);
clasohm@0
    31
clasohm@0
    32
  val imp_intr = impI
clasohm@0
    33
clasohm@0
    34
  (*etac rev_cut_eq moves an equality to be the last premise. *)
clasohm@0
    35
  val rev_cut_eq = prove_goal IFOLP.thy 
wenzelm@3836
    36
                "[| p:a=b;  !!x. x:a=b ==> f(x):R |] ==> ?p:R"
clasohm@0
    37
   (fn prems => [ REPEAT(resolve_tac prems 1) ]);
clasohm@0
    38
clasohm@0
    39
  val rev_mp = rev_mp
clasohm@0
    40
  val subst = subst
clasohm@0
    41
  val sym = sym
oheimb@4223
    42
  val thin_refl = prove_goal IFOLP.thy 
oheimb@4223
    43
		  "!!X. [|p:x=x; PROP W|] ==> PROP W" (K [atac 1]);
clasohm@0
    44
  end;
clasohm@0
    45
clasohm@0
    46
structure Hypsubst = HypsubstFun(Hypsubst_Data);
clasohm@0
    47
open Hypsubst;
clasohm@0
    48
clasohm@98
    49
use "intprover.ML";
clasohm@0
    50
clasohm@0
    51
(*** Applying ClassicalFun to create a classical prover ***)
clasohm@0
    52
structure Classical_Data = 
clasohm@0
    53
  struct
clasohm@0
    54
  val sizef = size_of_thm
clasohm@0
    55
  val mp = mp
clasohm@0
    56
  val not_elim = notE
clasohm@0
    57
  val swap = swap
clasohm@0
    58
  val hyp_subst_tacs=[hyp_subst_tac]
clasohm@0
    59
  end;
clasohm@0
    60
clasohm@0
    61
structure Cla = ClassicalFun(Classical_Data);
clasohm@0
    62
open Cla;
clasohm@0
    63
clasohm@0
    64
(*Propositional rules 
clasohm@0
    65
  -- iffCE might seem better, but in the examples in ex/cla
clasohm@0
    66
     run about 7% slower than with iffE*)
clasohm@0
    67
val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI] 
clasohm@0
    68
                       addSEs [conjE,disjE,impCE,FalseE,iffE];
clasohm@0
    69
clasohm@0
    70
(*Quantifier rules*)
clasohm@0
    71
val FOLP_cs = prop_cs addSIs [allI] addIs [exI,ex1I] 
clasohm@0
    72
                      addSEs [exE,ex1E] addEs [allE];
clasohm@0
    73
clasohm@0
    74
val FOLP_dup_cs = prop_cs addSIs [allI] addIs [exCI,ex1I] 
clasohm@0
    75
                          addSEs [exE,ex1E] addEs [all_dupE];
clasohm@0
    76
clasohm@0
    77
use "simpdata.ML";
clasohm@0
    78
wenzelm@3511
    79
clasohm@0
    80
print_depth 8;