src/FOLP/ROOT.ML
author wenzelm
Mon, 20 Oct 1997 11:06:01 +0200
changeset 3942 1f1c1f524d19
parent 3836 f1a1817659e6
child 4024 3c056eab237c
permissions -rw-r--r--
adapted to qualified names;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1459
d12da312eff4 expanded tabs
clasohm
parents: 1361
diff changeset
     1
(*  Title:      FOLP/ROOT
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1459
d12da312eff4 expanded tabs
clasohm
parents: 1361
diff changeset
     3
    Author:     martin Coen, Cambridge University Computer Laboratory
0
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
3942
1f1c1f524d19 adapted to qualified names;
wenzelm
parents: 3836
diff changeset
    15
reset global_names;
1f1c1f524d19 adapted to qualified names;
wenzelm
parents: 3836
diff changeset
    16
3511
da4dd8b7ced4 removed obsolete init_pps and init_thy_reader;
wenzelm
parents: 2237
diff changeset
    17
print_depth 1;
72
099d949fe467 changes for new Readthy
clasohm
parents: 0
diff changeset
    18
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
1008
fa11e1e28bd3 Loads the local hypsubst.ML. No longer loads ../Provers/ind.ML,
lcp
parents: 393
diff changeset
    22
use "hypsubst.ML";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
use "classical.ML";      (* Patched 'cos matching won't instantiate proof *)
1459
d12da312eff4 expanded tabs
clasohm
parents: 1361
diff changeset
    24
use "simp.ML";           (* Patched 'cos matching won't instantiate proof *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
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("Proof",_) $ (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 IFOLP.thy 
3836
f1a1817659e6 fixed dots;
wenzelm
parents: 3511
diff changeset
    38
                "[| p:a=b;  !!x. x:a=b ==> f(x):R |] ==> ?p:R"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
   (fn prems => [ REPEAT(resolve_tac prems 1) ]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
  val rev_mp = rev_mp
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
  val subst = subst
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
  val sym = sym
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
structure Hypsubst = HypsubstFun(Hypsubst_Data);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
open Hypsubst;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
98
329b5ac27f6e renamed int-prover.ML to intprover.ML,
clasohm
parents: 72
diff changeset
    49
use "intprover.ML";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    50
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
(*** Applying ClassicalFun to create a classical prover ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
structure Classical_Data = 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
  struct
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
  val sizef = size_of_thm
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
  val mp = mp
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    56
  val not_elim = notE
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
  val swap = swap
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
  val hyp_subst_tacs=[hyp_subst_tac]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
structure Cla = ClassicalFun(Classical_Data);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
open Cla;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
(*Propositional rules 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
  -- iffCE might seem better, but in the examples in ex/cla
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
     run about 7% slower than with iffE*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI] 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
                       addSEs [conjE,disjE,impCE,FalseE,iffE];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
(*Quantifier rules*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
val FOLP_cs = prop_cs addSIs [allI] addIs [exI,ex1I] 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
                      addSEs [exE,ex1E] addEs [allE];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
val FOLP_dup_cs = prop_cs addSIs [allI] addIs [exCI,ex1I] 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
                          addSEs [exE,ex1E] addEs [all_dupE];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
use "simpdata.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
3511
da4dd8b7ced4 removed obsolete init_pps and init_thy_reader;
wenzelm
parents: 2237
diff changeset
    79
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
print_depth 8;
176
5729f6757473 now declares FOLP_build_completed
lcp
parents: 98
diff changeset
    81
1459
d12da312eff4 expanded tabs
clasohm
parents: 1361
diff changeset
    82
val FOLP_build_completed = ();  (*indicate successful build*)