author | wenzelm |
Mon, 13 Mar 2000 13:21:39 +0100 | |
changeset 8434 | 5e4bba59bfaa |
parent 7426 | e0be36ee7ab9 |
child 8473 | 2798d2f71ec2 |
permissions | -rw-r--r-- |
923 | 1 |
(* Title: HOL/HOL.thy |
2 |
ID: $Id$ |
|
3 |
Author: Tobias Nipkow |
|
4 |
Copyright 1993 University of Cambridge |
|
5 |
||
2260 | 6 |
Higher-Order Logic. |
923 | 7 |
*) |
8 |
||
7357 | 9 |
theory HOL = CPure |
10 |
files ("HOL_lemmas.ML") ("cladata.ML") ("blastdata.ML") ("simpdata.ML"): |
|
923 | 11 |
|
2260 | 12 |
|
13 |
(** Core syntax **) |
|
14 |
||
3947 | 15 |
global |
16 |
||
7357 | 17 |
classes "term" < logic |
18 |
defaultsort "term" |
|
923 | 19 |
|
7357 | 20 |
typedecl bool |
923 | 21 |
|
22 |
arities |
|
7357 | 23 |
bool :: "term" |
24 |
fun :: ("term", "term") "term" |
|
923 | 25 |
|
26 |
||
27 |
consts |
|
28 |
||
29 |
(* Constants *) |
|
30 |
||
7357 | 31 |
Trueprop :: "bool => prop" ("(_)" 5) |
32 |
Not :: "bool => bool" ("~ _" [40] 40) |
|
33 |
True :: bool |
|
34 |
False :: bool |
|
35 |
If :: "[bool, 'a, 'a] => 'a" ("(if (_)/ then (_)/ else (_))" 10) |
|
3947 | 36 |
arbitrary :: 'a |
923 | 37 |
|
38 |
(* Binders *) |
|
39 |
||
7357 | 40 |
Eps :: "('a => bool) => 'a" |
41 |
All :: "('a => bool) => bool" (binder "ALL " 10) |
|
42 |
Ex :: "('a => bool) => bool" (binder "EX " 10) |
|
43 |
Ex1 :: "('a => bool) => bool" (binder "EX! " 10) |
|
44 |
Let :: "['a, 'a => 'b] => 'b" |
|
923 | 45 |
|
46 |
(* Infixes *) |
|
47 |
||
7357 | 48 |
"=" :: "['a, 'a] => bool" (infixl 50) |
49 |
& :: "[bool, bool] => bool" (infixr 35) |
|
50 |
"|" :: "[bool, bool] => bool" (infixr 30) |
|
51 |
--> :: "[bool, bool] => bool" (infixr 25) |
|
923 | 52 |
|
2260 | 53 |
|
54 |
(* Overloaded Constants *) |
|
55 |
||
7357 | 56 |
axclass plus < "term" |
57 |
axclass minus < "term" |
|
58 |
axclass times < "term" |
|
59 |
axclass power < "term" |
|
3370
5c5fdce3a4e4
Overloading of "^" requires new type class "power", with types "nat" and
paulson
parents:
3320
diff
changeset
|
60 |
|
2260 | 61 |
consts |
7357 | 62 |
"+" :: "['a::plus, 'a] => 'a" (infixl 65) |
63 |
- :: "['a::minus, 'a] => 'a" (infixl 65) |
|
64 |
uminus :: "['a::minus] => 'a" ("- _" [81] 80) |
|
7426 | 65 |
* :: "['a::times, 'a] => 'a" (infixl 70) |
3370
5c5fdce3a4e4
Overloading of "^" requires new type class "power", with types "nat" and
paulson
parents:
3320
diff
changeset
|
66 |
(*See Nat.thy for "^"*) |
2260 | 67 |
|
3820 | 68 |
|
7238
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
7220
diff
changeset
|
69 |
|
2260 | 70 |
(** Additional concrete syntax **) |
71 |
||
4868 | 72 |
nonterminals |
923 | 73 |
letbinds letbind |
74 |
case_syn cases_syn |
|
75 |
||
76 |
syntax |
|
7357 | 77 |
~= :: "['a, 'a] => bool" (infixl 50) |
78 |
"_Eps" :: "[pttrn, bool] => 'a" ("(3SOME _./ _)" [0, 10] 10) |
|
923 | 79 |
|
80 |
(* Let expressions *) |
|
81 |
||
7357 | 82 |
"_bind" :: "[pttrn, 'a] => letbind" ("(2_ =/ _)" 10) |
83 |
"" :: "letbind => letbinds" ("_") |
|
84 |
"_binds" :: "[letbind, letbinds] => letbinds" ("_;/ _") |
|
85 |
"_Let" :: "[letbinds, 'a] => 'a" ("(let (_)/ in (_))" 10) |
|
923 | 86 |
|
87 |
(* Case expressions *) |
|
88 |
||
7357 | 89 |
"@case" :: "['a, cases_syn] => 'b" ("(case _ of/ _)" 10) |
90 |
"@case1" :: "['a, 'b] => case_syn" ("(2_ =>/ _)" 10) |
|
91 |
"" :: "case_syn => cases_syn" ("_") |
|
92 |
"@case2" :: "[case_syn, cases_syn] => cases_syn" ("_/ | _") |
|
923 | 93 |
|
94 |
translations |
|
7238
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
7220
diff
changeset
|
95 |
"x ~= y" == "~ (x = y)" |
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
7220
diff
changeset
|
96 |
"SOME x. P" == "Eps (%x. P)" |
923 | 97 |
"_Let (_binds b bs) e" == "_Let b (_Let bs e)" |
1114 | 98 |
"let x = a in e" == "Let a (%x. e)" |
923 | 99 |
|
3820 | 100 |
syntax ("" output) |
7357 | 101 |
"op =" :: "['a, 'a] => bool" ("(_ =/ _)" [51, 51] 50) |
102 |
"op ~=" :: "['a, 'a] => bool" ("(_ ~=/ _)" [51, 51] 50) |
|
2260 | 103 |
|
104 |
syntax (symbols) |
|
7357 | 105 |
Not :: "bool => bool" ("\\<not> _" [40] 40) |
106 |
"op &" :: "[bool, bool] => bool" (infixr "\\<and>" 35) |
|
107 |
"op |" :: "[bool, bool] => bool" (infixr "\\<or>" 30) |
|
108 |
"op -->" :: "[bool, bool] => bool" (infixr "\\<midarrow>\\<rightarrow>" 25) |
|
109 |
"op o" :: "['b => 'c, 'a => 'b, 'a] => 'c" (infixl "\\<circ>" 55) |
|
110 |
"op ~=" :: "['a, 'a] => bool" (infixl "\\<noteq>" 50) |
|
111 |
"_Eps" :: "[pttrn, bool] => 'a" ("(3\\<epsilon>_./ _)" [0, 10] 10) |
|
112 |
"ALL " :: "[idts, bool] => bool" ("(3\\<forall>_./ _)" [0, 10] 10) |
|
113 |
"EX " :: "[idts, bool] => bool" ("(3\\<exists>_./ _)" [0, 10] 10) |
|
114 |
"EX! " :: "[idts, bool] => bool" ("(3\\<exists>!_./ _)" [0, 10] 10) |
|
115 |
"@case1" :: "['a, 'b] => case_syn" ("(2_ \\<Rightarrow>/ _)" 10) |
|
116 |
(*"@case2" :: "[case_syn, cases_syn] => cases_syn" ("_/ \\<orelse> _")*) |
|
2372 | 117 |
|
3820 | 118 |
syntax (symbols output) |
7357 | 119 |
"op ~=" :: "['a, 'a] => bool" ("(_ \\<noteq>/ _)" [51, 51] 50) |
3820 | 120 |
|
6027
9dd06eeda95c
added new print_mode "xsymbols" for extended symbol support
oheimb
parents:
5786
diff
changeset
|
121 |
syntax (xsymbols) |
7357 | 122 |
"op -->" :: "[bool, bool] => bool" (infixr "\\<longrightarrow>" 25) |
2260 | 123 |
|
6340 | 124 |
syntax (HTML output) |
7357 | 125 |
Not :: "bool => bool" ("\\<not> _" [40] 40) |
6340 | 126 |
|
7238
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
7220
diff
changeset
|
127 |
syntax (HOL) |
7357 | 128 |
"_Eps" :: "[pttrn, bool] => 'a" ("(3@ _./ _)" [0, 10] 10) |
129 |
"ALL " :: "[idts, bool] => bool" ("(3! _./ _)" [0, 10] 10) |
|
130 |
"EX " :: "[idts, bool] => bool" ("(3? _./ _)" [0, 10] 10) |
|
131 |
"EX! " :: "[idts, bool] => bool" ("(3?! _./ _)" [0, 10] 10) |
|
7238
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
7220
diff
changeset
|
132 |
|
36e58620ffc8
replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents:
7220
diff
changeset
|
133 |
|
6340 | 134 |
|
2260 | 135 |
(** Rules and definitions **) |
136 |
||
3947 | 137 |
local |
138 |
||
7357 | 139 |
axioms |
923 | 140 |
|
7357 | 141 |
eq_reflection: "(x=y) ==> (x==y)" |
923 | 142 |
|
143 |
(* Basic Rules *) |
|
144 |
||
7357 | 145 |
refl: "t = (t::'a)" |
146 |
subst: "[| s = t; P(s) |] ==> P(t::'a)" |
|
6289 | 147 |
|
148 |
(*Extensionality is built into the meta-logic, and this rule expresses |
|
149 |
a related property. It is an eta-expanded version of the traditional |
|
150 |
rule, and similar to the ABS rule of HOL.*) |
|
7357 | 151 |
ext: "(!!x::'a. (f x ::'b) = g x) ==> (%x. f x) = (%x. g x)" |
6289 | 152 |
|
7357 | 153 |
selectI: "P (x::'a) ==> P (@x. P x)" |
923 | 154 |
|
7357 | 155 |
impI: "(P ==> Q) ==> P-->Q" |
156 |
mp: "[| P-->Q; P |] ==> Q" |
|
923 | 157 |
|
158 |
defs |
|
159 |
||
7357 | 160 |
True_def: "True == ((%x::bool. x) = (%x. x))" |
161 |
All_def: "All(P) == (P = (%x. True))" |
|
162 |
Ex_def: "Ex(P) == P(@x. P(x))" |
|
163 |
False_def: "False == (!P. P)" |
|
164 |
not_def: "~ P == P-->False" |
|
165 |
and_def: "P & Q == !R. (P-->Q-->R) --> R" |
|
166 |
or_def: "P | Q == !R. (P-->R) --> (Q-->R) --> R" |
|
167 |
Ex1_def: "Ex1(P) == ? x. P(x) & (! y. P(y) --> y=x)" |
|
923 | 168 |
|
7357 | 169 |
axioms |
923 | 170 |
(* Axioms *) |
171 |
||
7357 | 172 |
iff: "(P-->Q) --> (Q-->P) --> (P=Q)" |
173 |
True_or_False: "(P=True) | (P=False)" |
|
923 | 174 |
|
175 |
defs |
|
5069 | 176 |
(*misc definitions*) |
7357 | 177 |
Let_def: "Let s f == f(s)" |
178 |
if_def: "If P x y == @z::'a. (P=True --> z=x) & (P=False --> z=y)" |
|
5069 | 179 |
|
180 |
(*arbitrary is completely unspecified, but is made to appear as a |
|
181 |
definition syntactically*) |
|
7357 | 182 |
arbitrary_def: "False ==> arbitrary == (@x. False)" |
923 | 183 |
|
3320 | 184 |
|
4868 | 185 |
|
7357 | 186 |
(* theory and package setup *) |
4868 | 187 |
|
7357 | 188 |
use "HOL_lemmas.ML" setup attrib_setup |
189 |
use "cladata.ML" setup Classical.setup setup clasetup |
|
190 |
use "blastdata.ML" setup Blast.setup |
|
7369 | 191 |
use "simpdata.ML" setup Simplifier.setup setup iff_attrib_setup |
192 |
setup simpsetup setup Clasimp.setup |
|
4868 | 193 |
|
194 |
||
923 | 195 |
end |