0

1 
(* Title: FOL/ROOT


2 
ID: $Id$


3 
Author: Lawrence C Paulson, Cambridge University Computer Laboratory


4 
Copyright 1993 University of Cambridge


5 


6 
Adds FirstOrder Logic to a database containing pure Isabelle.


7 
Should be executed in the subdirectory FOL.


8 
*)


9 


10 
val banner = "FirstOrder Logic with Natural Deduction";


11 


12 
writeln banner;


13 

393

14 
init_thy_reader();

72

15 

0

16 
print_depth 1;

97

17 
use_thy "FOL";

0

18 


19 
use "../Provers/splitter.ML";


20 
use "../Provers/ind.ML";

1004

21 
use "../Provers/hypsubst.ML";


22 
use "../Provers/classical.ML";

0

23 


24 
(*** Applying HypsubstFun to generate hyp_subst_tac ***)


25 


26 
structure Hypsubst_Data =


27 
struct

1004

28 
structure Simplifier = Simplifier


29 
(*Take apart an equality judgement; otherwise raise Match!*)


30 
fun dest_eq (Const("Trueprop",_) $ (Const("op =",_) $ t $ u)) = (t,u)


31 
val eq_reflection = eq_reflection

0

32 
val imp_intr = impI


33 
val rev_mp = rev_mp


34 
val subst = subst


35 
val sym = sym


36 
end;


37 


38 
structure Hypsubst = HypsubstFun(Hypsubst_Data);


39 
open Hypsubst;


40 

97

41 
use "intprover.ML";

0

42 


43 
(*** Applying ClassicalFun to create a classical prover ***)


44 
structure Classical_Data =


45 
struct

666

46 
val sizef = size_of_thm


47 
val mp = mp


48 
val not_elim = notE


49 
val classical = classical

0

50 
val hyp_subst_tacs=[hyp_subst_tac]


51 
end;


52 


53 
structure Cla = ClassicalFun(Classical_Data);


54 
open Cla;


55 


56 
(*Propositional rules


57 
 iffCE might seem better, but in the examples in ex/cla


58 
run about 7% slower than with iffE*)


59 
val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI]


60 
addSEs [conjE,disjE,impCE,FalseE,iffE];


61 


62 
(*Quantifier rules*)


63 
val FOL_cs = prop_cs addSIs [allI] addIs [exI,ex1I]


64 
addSEs [exE,ex1E] addEs [allE];


65 

666

66 
val ex1_functional = prove_goal FOL.thy


67 
"!!a b c. [ EX! z. P(a,z); P(a,b); P(a,c) ] ==> b = c"

731

68 
(fn _ => [ (deepen_tac FOL_cs 0 1) ]);

0

69 


70 
use "simpdata.ML";


71 


72 
use "../Pure/install_pp.ML";


73 
print_depth 8;


74 


75 
val FOL_build_completed = (); (*indicate successful build*)


76 
