src/FOLP/ROOT.ML
author paulson
Wed, 27 Nov 1996 10:36:38 +0100
changeset 2237 f01ac387e82b
parent 1459 d12da312eff4
child 3511 da4dd8b7ced4
permissions -rw-r--r--
Replaced obsolete "use" command
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
393
02b27671b899 thy reader now initialised by init_thy_reader();
wenzelm
parents: 176
diff changeset
    15
init_thy_reader();
72
099d949fe467 changes for new Readthy
clasohm
parents: 0
diff changeset
    16
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
print_depth 1;  
98
329b5ac27f6e renamed int-prover.ML to intprover.ML,
clasohm
parents: 72
diff changeset
    18
use_thy "IFOLP";
329b5ac27f6e renamed int-prover.ML to intprover.ML,
clasohm
parents: 72
diff changeset
    19
use_thy "FOLP";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
1008
fa11e1e28bd3 Loads the local hypsubst.ML. No longer loads ../Provers/ind.ML,
lcp
parents: 393
diff changeset
    21
use "hypsubst.ML";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
use "classical.ML";      (* Patched 'cos matching won't instantiate proof *)
1459
d12da312eff4 expanded tabs
clasohm
parents: 1361
diff changeset
    23
use "simp.ML";           (* Patched 'cos matching won't instantiate proof *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
(*** Applying HypsubstFun to generate hyp_subst_tac ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
structure Hypsubst_Data =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
  struct
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
  (*Take apart an equality judgement; otherwise raise Match!*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
  fun dest_eq (Const("Proof",_) $ (Const("op =",_)  $ t $ u) $ _) = (t,u);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
  val imp_intr = impI
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
  (*etac rev_cut_eq moves an equality to be the last premise. *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
  val rev_cut_eq = prove_goal IFOLP.thy 
1459
d12da312eff4 expanded tabs
clasohm
parents: 1361
diff changeset
    37
                "[| p:a=b;  !!x.x:a=b ==> f(x):R |] ==> ?p:R"
0
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
98
329b5ac27f6e 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 FOLP_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 FOLP_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
2237
f01ac387e82b Replaced obsolete "use" command
paulson
parents: 1459
diff changeset
    78
init_pps ();
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
print_depth 8;
176
5729f6757473 now declares FOLP_build_completed
lcp
parents: 98
diff changeset
    80
1459
d12da312eff4 expanded tabs
clasohm
parents: 1361
diff changeset
    81
val FOLP_build_completed = ();  (*indicate successful build*)