author | nipkow |
Sat, 13 Aug 1994 16:33:53 +0200 | |
changeset 101 | 5f99df1e26c4 |
parent 86 | 2f3a2d9054d1 |
child 119 | 93dc86ccee28 |
permissions | -rw-r--r-- |
0 | 1 |
(* Title: HOL/ROOT |
2 |
ID: $Id$ |
|
3 |
Author: Tobias Nipkow |
|
4 |
Copyright 1993 University of Cambridge |
|
5 |
||
6 |
Adds Classical Higher-order Logic to a database containing pure Isabelle. |
|
7 |
Should be executed in the subdirectory HOL. |
|
8 |
*) |
|
9 |
||
10 |
val banner = "Higher-Order Logic"; |
|
11 |
writeln banner; |
|
12 |
||
80
d3d727449d7b
datatypes must now be defined using a thy file section
clasohm
parents:
74
diff
changeset
|
13 |
(* Add user section "datatype" *) |
86 | 14 |
use "Datatype.ML"; |
101
5f99df1e26c4
Added primitive recursive functions (Norbert Voelker's code) to the datatype
nipkow
parents:
86
diff
changeset
|
15 |
structure ThySyn = |
5f99df1e26c4
Added primitive recursive functions (Norbert Voelker's code) to the datatype
nipkow
parents:
86
diff
changeset
|
16 |
ThySynFun(val user_keywords = ["|", "datatype", "primrec"] |
5f99df1e26c4
Added primitive recursive functions (Norbert Voelker's code) to the datatype
nipkow
parents:
86
diff
changeset
|
17 |
and user_sections = [("datatype", datatype_decls), |
5f99df1e26c4
Added primitive recursive functions (Norbert Voelker's code) to the datatype
nipkow
parents:
86
diff
changeset
|
18 |
("primrec", primrec_decl)]); |
80
d3d727449d7b
datatypes must now be defined using a thy file section
clasohm
parents:
74
diff
changeset
|
19 |
init_thy_reader (); |
10 | 20 |
|
0 | 21 |
print_depth 1; |
22 |
eta_contract := true; |
|
17 | 23 |
use_thy "HOL"; |
0 | 24 |
use "../Provers/hypsubst.ML"; |
25 |
use "../Provers/classical.ML"; |
|
26 |
use "../Provers/simplifier.ML"; |
|
27 |
use "../Provers/splitter.ML"; |
|
28 |
use "../Provers/ind.ML"; |
|
29 |
||
30 |
(** Applying HypsubstFun to generate hyp_subst_tac **) |
|
31 |
||
32 |
structure Hypsubst_Data = |
|
33 |
struct |
|
34 |
(*Take apart an equality judgement; otherwise raise Match!*) |
|
35 |
fun dest_eq (Const("Trueprop",_) $ (Const("op =",_) $ t $ u)) = (t,u); |
|
36 |
||
37 |
val imp_intr = impI |
|
38 |
||
39 |
(*etac rev_cut_eq moves an equality to be the last premise. *) |
|
40 |
val rev_cut_eq = prove_goal HOL.thy "[| a=b; a=b ==> R |] ==> R" |
|
41 |
(fn prems => [ REPEAT(resolve_tac prems 1) ]); |
|
42 |
||
43 |
val rev_mp = rev_mp |
|
44 |
val subst = subst |
|
45 |
val sym = sym |
|
46 |
end; |
|
47 |
||
48 |
structure Hypsubst = HypsubstFun(Hypsubst_Data); |
|
49 |
open Hypsubst; |
|
50 |
||
51 |
(** Applying ClassicalFun to create a classical prover **) |
|
52 |
structure Classical_Data = |
|
53 |
struct |
|
54 |
val sizef = size_of_thm |
|
55 |
val mp = mp |
|
56 |
val not_elim = notE |
|
57 |
val swap = swap |
|
58 |
val hyp_subst_tacs=[hyp_subst_tac] |
|
59 |
end; |
|
60 |
||
61 |
structure Classical = ClassicalFun(Classical_Data); |
|
62 |
open Classical; |
|
63 |
||
64 |
(*Propositional rules*) |
|
65 |
val prop_cs = empty_cs addSIs [refl,TrueI,conjI,disjCI,impI,notI,iffI] |
|
66 |
addSEs [conjE,disjE,impCE,FalseE,iffE]; |
|
67 |
||
68 |
(*Quantifier rules*) |
|
69 |
val HOL_cs = prop_cs addSIs [allI] addIs [exI,ex1I] |
|
70 |
addSEs [exE,ex1E] addEs [allE]; |
|
71 |
||
72 |
val HOL_dup_cs = prop_cs addSIs [allI] addIs [exCI,ex1I] |
|
73 |
addSEs [exE,ex1E] addEs [all_dupE]; |
|
74 |
||
75 |
structure HOL_Induction = InductionFun(struct val spec=spec end); |
|
76 |
open HOL_Induction; |
|
77 |
||
78 |
use "simpdata.ML"; |
|
17 | 79 |
use_thy "Ord"; |
80 |
use_thy "Set"; |
|
0 | 81 |
use "fun.ML"; |
82 |
use "subset.ML"; |
|
83 |
use "equalities.ML"; |
|
17 | 84 |
use_thy "Prod"; |
85 |
use_thy "Sum"; |
|
0 | 86 |
use "mono.ML"; |
17 | 87 |
use_thy "LList"; |
0 | 88 |
|
89 |
use "../Pure/install_pp.ML"; |
|
90 |
print_depth 8; |
|
91 |
||
92 |
val HOL_build_completed = (); (*indicate successful build*) |