Debian Codegraph @

debian/patches/quilt-source-init

raw
1 Description: gcl build support
2 Adjustments to build with gcl
3 Forwarded: not-needed
4 Author: Camm Maguire <[email protected]>
5
6 --- hol88-2.02.19940316.orig/Makefile
7 +++ hol88-2.02.19940316/Makefile
8 @@ -150,7 +150,7 @@ SHELL=/bin/sh
9
10 LispType=cl
11 Obj=o
12 -Lisp=akcl
13 +Lisp=gcl
14 Liszt=
15 LisztComm=
16 Allegro=(set-case-mode :case-insensitive-upper)
17 @@ -159,7 +159,7 @@ AllegroV4.0= $(Allegro) (setq *cltl1-in-
18 AllegroV4.1= $(AllegroV4.0) (setq *enable-package-locked-errors* nil)
19 AllegroStuff= (progn () $(AllegroV4.1))
20
21 -HOLdir=/usr/local/hol
22 +HOLdir=$(shell pwd)
23 Theory=$(HOLdir)/theories
24 Library=$(HOLdir)/Library
25 Help=$(HOLdir)/help/ENTRIES/
26 @@ -168,7 +168,7 @@ Hol=hol
27 LispDir=${HOLdir}/lisp
28
29 ExeName = hol
30 -Version = 2.02 (SUN4/AKCL)
31 +Version = 2.02 (GCL)
32
33 # =====================================================================
34 # Default (from Phil Windley)
35 @@ -221,6 +221,34 @@ HolMl=ml/load_thms.ml ml/numconv_ml.o ml
36 # ---------------------------------------------------------------------
37
38 hol: basic-hol ${Theory}/HOL.th $(HolMl) lisp/banner.$(Obj) lisp/akcl.l
39 +# echo 'set_search_path[``; `${Theory}/`];;'\
40 +# 'load_theory `HOL`;;'\
41 +# 'loadf `ml/load_thms`;;'\
42 +# 'loadf `ml/lib_loader`;;'\
43 +# 'loadf `ml/numconv`;;'\
44 +# 'loadf `ml/tydefs`;;'\
45 +# 'loadf `ml/ind`;;'\
46 +# 'loadf `ml/prim_rec`;;'\
47 +# 'loadf `ml/tyfns`;;'\
48 +# 'loadf `ml/num`;;'\
49 +# 'loadf `ml/list`;;'\
50 +# 'map delete_cache [`arithmetic`;`sum`;`list`];;'\
51 +# 'map delete_cache [`tree`;`ltree`;`prim_rec`];;'\
52 +# 'lisp `(load "lisp/banner")`;;'\
53 +# 'lisp `(setq %system-name "HOL")`;;'\
54 +# 'lisp `(setq %hol-dir "$(HOLdir)")`;;'\
55 +# 'lisp `(setq %lib-dir "$(Library)")`;;'\
56 +# 'lisp `(setq %liszt "$(LisztComm)")`;;'\
57 +# 'lisp `(setq %version "$(Version)")`;;'\
58 +# 'set_flag(`abort_when_fail`,false);;'\
59 +# 'set_search_path[``; `~/`; `${Theory}/`];;'\
60 +# 'set_help_search_path (words `$(Help)`);;'\
61 +# 'set_library_search_path [`${Library}/`];;'\
62 +# 'lisp `(setup)`;;'\
63 +# 'save `${ExeName}`;;'\
64 +# 'set_thm_count 0;;'\
65 +# 'quit();;'\
66 +# | basic-hol
67 echo 'set_search_path[``; `${Theory}/`];;'\
68 'load_theory `HOL`;;'\
69 'loadf `ml/load_thms`;;'\
70 @@ -244,12 +272,8 @@ hol: basic-hol ${Theory}/HOL.th $(HolMl)
71 'set_search_path[``; `~/`; `${Theory}/`];;'\
72 'set_help_search_path (words `$(Help)`);;'\
73 'set_library_search_path [`${Library}/`];;'\
74 - 'lisp `(load "lisp/akcl.l")`;;'\
75 - 'lisp `(setup)`;;'\
76 - 'save `${ExeName}`;;'\
77 - 'set_thm_count 0;;'\
78 - 'quit();;'\
79 - | basic-hol
80 + 'lisp `(setup)`;;' >foo2
81 + echo 'lisp `(throw (quote eof) t)`;; #+native-reloc(progn (with-open-file (s "foo2") (let ((*standard-input* s)) (tml)))(ml-save "hol")) #-native-reloc(let ((si::*collect-binary-modules* t)(si::*binary-modules* (with-open-file (s "bm.l") (read s)))) (with-open-file (s "foo2") (let ((*standard-input* s)) (tml)))(compiler::link (remove-duplicates si::*binary-modules* :test (function equal)) "hol" "(progn (load \"debian/gcl_patch.l\")(load \"foo\")(with-open-file (s \"foo1\") (let ((*standard-input* s)) (tml)))(with-open-file (s \"foo2\") (let ((*standard-input* s)) (tml)))(ml-save \"hol\")(quit))" "" nil)(quit))`;;' | basic-hol
82 make permissions
83 @echo "=======> hol88 version $(Version) made"
84
85 @@ -291,11 +315,12 @@ Exec=hol hol-lcf basic-hol Manual/LaTeX/
86 Manual/Reference/bin/mktex Manual/Reference/bin/typecheck
87
88 permissions:
89 - find . \( -type d -user $(USER) -exec chmod $(Dperm) {} \; \) -o\
90 - \( -type f -user $(USER) -exec chmod $(Tperm) {} \; \)
91 - @for f in $(Exec) ; do\
92 - ( if [ -f $$f ]; then\
93 - find $$f \( -user $(USER) \) -exec chmod $(Eperm) {} \; ;fi) ; \
94 + find $$(ls -1 | grep -v debian) \
95 + \( -type d -exec chmod $(Dperm) {} \; \) -o\
96 + \( -type f -exec chmod $(Tperm) {} \; \)
97 + for f in $(Exec) ; do\
98 + ( if [ -f $$f ] ; then\
99 + find $$f -exec chmod $(Eperm) {} \; ;fi) ; \
100 done
101
102
103 @@ -482,6 +507,31 @@ BasicHolMl=ml/genfns_ml.o ml/hol-syn_ml.
104 # ---------------------------------------------------------------------
105
106 basic-hol: hol-lcf $(BasicHolLisp) ${Theory}/BASIC-HOL.th $(BasicHolMl)
107 +# echo 'set_search_path[``; `${Theory}/`];;'\
108 +# 'load_theory `BASIC-HOL`;;'\
109 +# 'loadf `ml/hol-in-out`;;'\
110 +# 'loadf `ml/hol-rule`;;'\
111 +# 'loadf `ml/hol-drule`;;'\
112 +# 'loadf `ml/drul`;;'\
113 +# 'loadf `ml/tacticals`;;'\
114 +# 'loadf `ml/tacont`;;'\
115 +# 'loadf `ml/tactics`;;'\
116 +# 'loadf `ml/conv`;;'\
117 +# 'loadf `ml/hol-net`;;'\
118 +# 'loadf `ml/rewrite`;;'\
119 +# 'loadf `ml/resolve`;;'\
120 +# 'loadf `ml/hol-thyfn`;;'\
121 +# 'loadf `ml/goals`;;'\
122 +# 'loadf `ml/stack`;;'\
123 +# 'loadf `ml/abs-rep`;;'\
124 +# 'activate_binders `bool`;;'\
125 +# 'lisp `(setq %liszt "$(LisztComm)")`;;'\
126 +# 'lisp `(setq %version "$(Version)")`;;'\
127 +# 'lisp `(setq %system-name "BASIC-HOL")`;;'\
128 +# 'lisp `(setup)`;;'\
129 +# 'save `basic-hol`;;'\
130 +# 'quit();;'\
131 +# | hol-lcf
132 echo 'set_search_path[``; `${Theory}/`];;'\
133 'load_theory `BASIC-HOL`;;'\
134 'loadf `ml/hol-in-out`;;'\
135 @@ -503,10 +553,8 @@ basic-hol: hol-lcf $(BasicHolLisp) ${The
136 'lisp `(setq %liszt "$(LisztComm)")`;;'\
137 'lisp `(setq %version "$(Version)")`;;'\
138 'lisp `(setq %system-name "BASIC-HOL")`;;'\
139 - 'lisp `(setup)`;;'\
140 - 'save `basic-hol`;;'\
141 - 'quit();;'\
142 - | hol-lcf
143 + 'lisp `(setup)`;;' >foo1
144 + echo 'lisp `(throw (quote eof) t)`;; #+native-reloc(progn (with-open-file (s "foo1") (let ((*standard-input* s)) (tml)))(ml-save "basic-hol")) #-native-reloc(let ((si::*collect-binary-modules* t)(si::*binary-modules* (with-open-file (s "bm.l") (read s)))) (with-open-file (s "foo1") (let ((*standard-input* s)) (tml)))(compiler::link (remove-duplicates si::*binary-modules* :test (function equal)) "basic-hol" "(progn (load \"debian/gcl_patch.l\")(load \"foo\")(with-open-file (s \"foo1\") (let ((*standard-input* s)) (tml)))(ml-save \"basic-hol\")(quit))" "" nil)(with-open-file (s "bm.l" :direction :output) (prin1 si::*binary-modules* s))(quit))`;;' | hol-lcf
145 @echo "=======> basic-hol88 made"
146
147 # ---------------------------------------------------------------------
148 @@ -780,6 +828,23 @@ HolLcfMl=ml/ml-curry_ml.o ml/lis_ml.o ml
149 # ---------------------------------------------------------------------
150
151 hol-lcf: $(HolLcfLisp) $(HolLcfMl)
152 +# echo '#+allegro $(AllegroStuff)'\
153 +# '(load "lisp/mk-ml")'\
154 +# '(load "lisp/mk-hol-lcf")'\
155 +# '(setq %version "$(Version)")'\
156 +# '(set-make)'\
157 +# '(tml)'\
158 +# 'load(`ml/site`,false);;'\
159 +# 'load(`ml/ml-curry`,false);;'\
160 +# 'load(`ml/lis`,false);;'\
161 +# 'load(`ml/gen`,false);;'\
162 +# 'load(`ml/killpp`,false);;'\
163 +# 'lisp `(setq %system-name "HOL-LCF")`;;'\
164 +# 'lisp `(setq %liszt "$(LisztComm)")`;;'\
165 +# 'lisp `(setup)`;;'\
166 +# 'save `hol-lcf`;;'\
167 +# 'quit();;'\
168 +# | $(Lisp)
169 echo '#+allegro $(AllegroStuff)'\
170 '(load "lisp/mk-ml")'\
171 '(load "lisp/mk-hol-lcf")'\
172 @@ -793,10 +858,8 @@ hol-lcf: $(HolLcfLisp) $(HolLcfMl)
173 'load(`ml/killpp`,false);;'\
174 'lisp `(setq %system-name "HOL-LCF")`;;'\
175 'lisp `(setq %liszt "$(LisztComm)")`;;'\
176 - 'lisp `(setup)`;;'\
177 - 'save `hol-lcf`;;'\
178 - 'quit();;'\
179 - | $(Lisp)
180 + 'lisp `(setup)`;;' >foo
181 + echo '#+native-reloc(progn (load "foo")(ml-save "hol-lcf"))#-native-reloc(let ((si::*collect-binary-modules* t)(si::*binary-modules* nil)) (load "foo")(compiler::link (remove-duplicates si::*binary-modules* :test (function equal)) "hol-lcf" "(load \"debian/gcl_patch.l\")(load \"foo\")(ml-save \"hol-lcf\")" "" nil)(with-open-file (s "bm.l" :direction :output) (prin1 si::*binary-modules* s)))(quit)' | $(Lisp)
182 @echo "=======> hol-lcf made"
183
184 # =====================================================================
185 --- hol88-2.02.19940316.orig/Manual/Makefile
186 +++ hol88-2.02.19940316/Manual/Makefile
187 @@ -41,3 +41,5 @@ all:
188 make tutorial;make description; make reference;make libraries;make covers
189 @echo "=======> MANUAL made"
190
191 +clean:
192 + for i in Tutorial Description Reference Libraries Covers ; do $(MAKE) -C $$i clean ; done
193 --- hol88-2.02.19940316.orig/Manual/Description/description.tex
194 +++ hol88-2.02.19940316/Manual/Description/description.tex
195 @@ -34,7 +34,7 @@
196
197 \include{title} % description title page
198 \include{preface} % preface to entire description
199 - \include{../LaTeX/ack} % global acknowledgements
200 + \include{ack} % global acknowledgements
201 \include{contents} % table of contents
202
203
204 --- hol88-2.02.19940316.orig/Manual/Tutorial/tutorial.tex
205 +++ hol88-2.02.19940316/Manual/Tutorial/tutorial.tex
206 @@ -38,7 +38,7 @@
207
208 \include{title} % tutorial title page
209 \include{preface} % preface to entire tutorial
210 - \include{../LaTeX/ack} % global acknowledgements
211 + \include{ack} % global acknowledgements
212 \include{contents} % table of contents
213
214 \pagenumbering{arabic} % arabic page numbers
215 --- hol88-2.02.19940316.orig/Manual/Covers/Makefile
216 +++ hol88-2.02.19940316/Manual/Covers/Makefile
217 @@ -20,12 +20,12 @@ default:
218
219 endpages.dvi: CRC.ps DESCRIPTION.ps LANTERN.ps REFERENCE.ps TUTORIAL.ps \
220 arms.ps endpages.tex endpages.sty
221 - $(LATEX) endpages
222 + TEXINPUTS=$$(pwd)/psfig:$$TEXINPUTS $(LATEX) endpages
223 @echo "===> endpages.dvi created"
224
225 titlepages.dvi: CRC.ps DESCRIPTION.ps LANTERN.ps REFERENCE.ps TUTORIAL.ps \
226 arms.ps titlepages.tex titlepages.sty
227 - $(LATEX) titlepages
228 + TEXINPUTS=$$(pwd)/psfig:$$TEXINPUTS $(LATEX) titlepages
229 @echo "===> titlepages.dvi created"
230
231 dvi: endpages.dvi titlepages.dvi
232 --- hol88-2.02.19940316.orig/Manual/LaTeX/ref-macros.tex
233 +++ hol88-2.02.19940316/Manual/LaTeX/ref-macros.tex
234 @@ -172,3 +172,8 @@
235 % ---------------------------------------------------------------------
236
237 \def\none{{\it none}}
238 +
239 +\newcommand\nintt{\fontsize{9pt}{11pt}\normalfont\ttfamily}
240 +\newcommand\tenrm{\fontsize{10pt}{12pt}\normalfont\rmfamily}
241 +%\def\ptt{\fam\ttfam\nintt}\textfont\ttfam\nintt\scriptfont\ttfam\nintt\scriptscriptfont\ttfam\nintt
242 +\def\ptt{\fam\ttfam\nintt}%\textfont\ttfam\nintt\scriptfont\ttfam\nintt\scriptscriptfont\ttfam\nintt
243 --- hol88-2.02.19940316.orig/Manual/LaTeX/layout.sty
244 +++ hol88-2.02.19940316/Manual/LaTeX/layout.sty
245 @@ -52,9 +52,9 @@
246 % MATH INDENTATION. = \tabcolsep + three small verbatim spaces (!)
247 % ---------------------------------------------------------------------
248 \setlength{\mathindent}{\tabcolsep}
249 -\addtolength{\mathindent}{\the\fontdimen2\elvtt}
250 -\addtolength{\mathindent}{\the\fontdimen2\elvtt}
251 -\addtolength{\mathindent}{\the\fontdimen2\elvtt}
252 +%\addtolength{\mathindent}{\the\fontdimen2\elvtt}
253 +%\addtolength{\mathindent}{\the\fontdimen2\elvtt}
254 +%\addtolength{\mathindent}{\the\fontdimen2\elvtt}
255
256 % ---------------------------------------------------------------------
257 % HEAD: spacing to match header macro below.
258 --- hol88-2.02.19940316.orig/Manual/Reference/theorems.tex
259 +++ hol88-2.02.19940316/Manual/Reference/theorems.tex
260 @@ -1,7 +1,4 @@
261 -\chapter{Pre-proved Theorems}
262 -\input{theorems-intro}
263 -\section{Definitions of Basic Logical Constants}
264 -\THEOREM AND\_DEF bool
265 +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{Definitions of Basic Logical Constants}\THEOREM AND\_DEF bool
266 |- $/\ = (\t1 t2. !t. (t1 ==> t2 ==> t) ==> t)
267 \ENDTHEOREM
268 \THEOREM EXISTS\_DEF bool
269 @@ -10,12 +7,12 @@
270 \THEOREM EXISTS\_UNIQUE\_DEF bool
271 |- $?! = (\P. $? P /\ (!x y. P x /\ P y ==> (x = y)))
272 \ENDTHEOREM
273 -\THEOREM FORALL\_DEF bool
274 -|- $! = (\P. P = (\x. T))
275 -\ENDTHEOREM
276 \THEOREM F\_DEF bool
277 |- F = (!t. t)
278 \ENDTHEOREM
279 +\THEOREM FORALL\_DEF bool
280 +|- $! = (\P. P = (\x. T))
281 +\ENDTHEOREM
282 \THEOREM NOT\_DEF bool
283 |- $~ = (\t. t ==> F)
284 \ENDTHEOREM
285 @@ -25,8 +22,7 @@
286 \THEOREM T\_DEF bool
287 |- T = ((\x. x) = (\x. x))
288 \ENDTHEOREM
289 -\section{Constants for syntactic abbreviations}
290 -\THEOREM ARB bool
291 +\section{Constants for syntactic abbreviations}\THEOREM ARB bool
292 |- ARB = (@x. T)
293 \ENDTHEOREM
294 \THEOREM COND\_DEF bool
295 @@ -49,8 +45,7 @@
296 \THEOREM RES\_SELECT bool
297 |- !P B. RES_SELECT P B = (@x. P x /\ B x)
298 \ENDTHEOREM
299 -\section{Axioms}
300 -\THEOREM ARB\_THM bool
301 +\section{Axioms}\THEOREM ARB\_THM bool
302 |- $= = $=
303 \ENDTHEOREM
304 \THEOREM BOOL\_CASES\_AX bool
305 @@ -68,8 +63,7 @@
306 \THEOREM SELECT\_AX bool
307 |- !P x. P x ==> P($@ P)
308 \ENDTHEOREM
309 -\section{Logical tautologies}
310 -\THEOREM AND1\_THM {\none}
311 +\section{Logical tautologies}\THEOREM AND1\_THM {\none}
312 |- !t1 t2. t1 /\ t2 ==> t1
313 \ENDTHEOREM
314 \THEOREM AND2\_THM {\none}
315 @@ -171,13 +165,13 @@
316 \THEOREM FALSITY {\none}
317 |- !t. F ==> t
318 \ENDTHEOREM
319 +\THEOREM F\_IMP {\none}
320 +|- !t. ~t ==>(t ==> F)
321 +\ENDTHEOREM
322 \THEOREM FORALL\_SIMP {\none}
323 |- !t. (!x. t) = t
324 \ENDTHEOREM
325
326 -\THEOREM F\_IMP {\none}
327 -|- !t. ~t ==>(t ==> F)
328 -\ENDTHEOREM
329 \THEOREM IMP\_CLAUSES {\none}
330 |- !t. (T ==> t) = t /\
331 (t ==> T) = T /\
332 @@ -258,8 +252,7 @@
333 \THEOREM TRUTH {\none}
334 |- T
335 \ENDTHEOREM
336 -\section{Theorems about functions}
337 -\THEOREM ABS\_SIMP {\none}
338 +\section{Theorems about functions}\THEOREM ABS\_SIMP {\none}
339 |- !t1 t2. (\x. t1)t2 = t1
340 \ENDTHEOREM
341
342 @@ -309,24 +302,22 @@
343 \THEOREM RIGHT\_ID\_DEF fun
344 |- !f e. RIGHT_ID f e = (!x. f x e = x)
345 \ENDTHEOREM
346 -\section{Theorems about the type {\tt one}}
347 -\THEOREM one one
348 -|- !v. v = one
349 +\section{Theorems about the type {\tt one}}\THEOREM one\_axiom one
350 +|- !f g. f = g
351 \ENDTHEOREM
352 \THEOREM one\_Axiom one
353 |- !e. ?! fn. fn one = e
354 \ENDTHEOREM
355 -\THEOREM one\_axiom one
356 -|- !f g. f = g
357 -\ENDTHEOREM
358 \THEOREM one\_DEF one
359 |- one = (@x. T)
360 \ENDTHEOREM
361 +\THEOREM one one
362 +|- !v. v = one
363 +\ENDTHEOREM
364 \THEOREM one\_TY\_DEF one
365 |- ?rep. TYPE_DEFINITION(\b. b)rep
366 \ENDTHEOREM
367 -\section{Theorems about combinators}
368 -\THEOREM I\_DEF combin
369 +\section{Theorems about combinators}\THEOREM I\_DEF combin
370 |- I = S K K
371 \ENDTHEOREM
372 \THEOREM I\_o\_ID combin
373 @@ -356,19 +347,18 @@
374 \THEOREM S\_THM combin
375 |- !f g x. S f g x = f x(g x)
376 \ENDTHEOREM
377 -\section{Theorems about pairs}
378 -\THEOREM COMMA\_DEF bool
379 +\section{Theorems about pairs}\THEOREM COMMA\_DEF bool
380 |- !x y. x,y = (@p. REP_prod p = MK_PAIR x y)
381 \ENDTHEOREM
382 \THEOREM CURRY\_DEF bool
383 |- !f x y. CURRY f x y = f(x,y)
384 \ENDTHEOREM
385 -\THEOREM FST bool
386 -|- !x y. FST(x,y) = x
387 -\ENDTHEOREM
388 \THEOREM FST\_DEF bool
389 |- !p. FST p = (@x. ?y. MK_PAIR x y = REP_prod p)
390 \ENDTHEOREM
391 +\THEOREM FST bool
392 +|- !x y. FST(x,y) = x
393 +\ENDTHEOREM
394 \THEOREM IS\_PAIR\_DEF bool
395 |- !p. IS_PAIR p = (?x y. p = MK_PAIR x y)
396 \ENDTHEOREM
397 @@ -390,28 +380,27 @@
398 (!p' p''. (rep p' = rep p'') ==> (p' = p'')) /\
399 (!p. IS_PAIR p = (?p'. p = rep p')))
400 \ENDTHEOREM
401 -\THEOREM SND bool
402 -|- !x y. SND(x,y) = y
403 -\ENDTHEOREM
404 \THEOREM SND\_DEF bool
405 |- !p. SND p = (@y. ?x. MK_PAIR x y = REP_prod p)
406 \ENDTHEOREM
407 +\THEOREM SND bool
408 +|- !x y. SND(x,y) = y
409 +\ENDTHEOREM
410 \THEOREM UNCURRY\_DEF bool
411 |- !f x y. UNCURRY f(x,y) = f x y
412 \ENDTHEOREM
413 -\section{Theorems about disjoint sums}
414 +\section{Theorems about disjoint sums}\THEOREM INL\_DEF sum
415 +|- !e. INL e = ABS_sum(\b x y. (x = e) /\ b)
416 +\ENDTHEOREM
417 \THEOREM INL sum
418 |- !x. ISL x ==> (INL(OUTL x) = x)
419 \ENDTHEOREM
420 -\THEOREM INL\_DEF sum
421 -|- !e. INL e = ABS_sum(\b x y. (x = e) /\ b)
422 +\THEOREM INR\_DEF sum
423 +|- !e. INR e = ABS_sum(\b x y. (y = e) /\ ~b)
424 \ENDTHEOREM
425 \THEOREM INR sum
426 |- !x. ISR x ==> (INR(OUTR x) = x)
427 \ENDTHEOREM
428 -\THEOREM INR\_DEF sum
429 -|- !e. INR e = ABS_sum(\b x y. (y = e) /\ ~b)
430 -\ENDTHEOREM
431 \THEOREM ISL sum
432 |- (!x. ISL(INL x)) /\ (!y. ~ISL(INR y))
433 \ENDTHEOREM
434 @@ -433,12 +422,12 @@
435 \THEOREM OUTR sum
436 |- !x. OUTR(INR x) = x
437 \ENDTHEOREM
438 -\THEOREM sum\_Axiom sum
439 -|- !f g. ?! h. (!x. h(INL x) = f x) /\ (!x. h(INR x) = g x)
440 -\ENDTHEOREM
441 \THEOREM sum\_axiom sum
442 |- !f g. ?! h. (h o INL = f) /\ (h o INR = g)
443 \ENDTHEOREM
444 +\THEOREM sum\_Axiom sum
445 +|- !f g. ?! h. (!x. h(INL x) = f x) /\ (!x. h(INR x) = g x)
446 +\ENDTHEOREM
447 \THEOREM sum\_ISO\_DEF sum
448 |- (!a. ABS_sum(REP_sum a) = a) /\
449 (!r. IS_SUM_REP r = (REP_sum(ABS_sum r) = r))
450 @@ -446,16 +435,12 @@
451 \THEOREM sum\_TY\_DEF sum
452 |- ?rep. TYPE_DEFINITION IS_SUM_REP rep
453 \ENDTHEOREM
454 -\section{Theorems about arithmetic}
455 -\THEOREM ADD arithmetic
456 -|- (!n. 0 + n = n) /\ (!m n. (SUC m) + n = SUC(m + n))
457 +\section{Theorems about arithmetic}\THEOREM ADD\_0 arithmetic
458 +|- !m. m + 0 = m
459 \ENDTHEOREM
460 \THEOREM ADD1 arithmetic
461 |- !m. SUC m = m + 1
462 \ENDTHEOREM
463 -\THEOREM ADD\_0 arithmetic
464 -|- !m. m + 0 = m
465 -\ENDTHEOREM
466 \THEOREM ADD\_ASSOC arithmetic
467 |- !m n p. m + (n + p) = (m + n) + p
468 \ENDTHEOREM
469 @@ -465,6 +450,9 @@
470 ((SUC m) + n = SUC(m + n)) /\
471 (m + (SUC n) = SUC(m + n))
472 \ENDTHEOREM
473 +\THEOREM ADD arithmetic
474 +|- (!n. 0 + n = n) /\ (!m n. (SUC m) + n = SUC(m + n))
475 +\ENDTHEOREM
476 \THEOREM ADD\_EQ\_0 arithmetic
477 |- !m n. (m + n = 0) = (m = 0) /\ (n = 0)
478 \ENDTHEOREM
479 @@ -523,15 +511,15 @@
480 \THEOREM EQ\_MONO\_ADD\_EQ arithmetic
481 |- !m n p. (m + p = n + p) = (m = n)
482 \ENDTHEOREM
483 -\THEOREM EVEN arithmetic
484 -|- (EVEN 0 = T) /\ (!n. EVEN(SUC n) = ~EVEN n)
485 -\ENDTHEOREM
486 \THEOREM EVEN\_ADD arithmetic
487 |- !m n. EVEN(m + n) = (EVEN m = EVEN n)
488 \ENDTHEOREM
489 \THEOREM EVEN\_AND\_ODD arithmetic
490 |- !n. ~(EVEN n /\ ODD n)
491 \ENDTHEOREM
492 +\THEOREM EVEN arithmetic
493 +|- (EVEN 0 = T) /\ (!n. EVEN(SUC n) = ~EVEN n)
494 +\ENDTHEOREM
495 \THEOREM EVEN\_DOUBLE arithmetic
496 |- !n. EVEN(2 * n)
497 \ENDTHEOREM
498 @@ -550,12 +538,12 @@
499 \THEOREM EVEN\_OR\_ODD arithmetic
500 |- !n. EVEN n \/ ODD n
501 \ENDTHEOREM
502 -\THEOREM EXP arithmetic
503 -|- (!m. m EXP 0 = 1) /\ (!m n. m EXP (SUC n) = m * (m EXP n))
504 -\ENDTHEOREM
505 \THEOREM EXP\_ADD arithmetic
506 |- !p q n. n EXP (p + q) = (n EXP p) * (n EXP q)
507 \ENDTHEOREM
508 +\THEOREM EXP arithmetic
509 +|- (!m. m EXP 0 = 1) /\ (!m n. m EXP (SUC n) = m * (m EXP n))
510 +\ENDTHEOREM
511 \THEOREM FACT arithmetic
512 |- (FACT 0 = 1) /\ (!n. FACT(SUC n) = (SUC n) * (FACT n))
513 \ENDTHEOREM
514 @@ -609,24 +597,21 @@
515 \THEOREM LEFT\_SUB\_DISTRIB arithmetic
516 |- !m n p. p * (m - n) = (p * m) - (p * n)
517 \ENDTHEOREM
518 -\THEOREM LESS prim\_rec
519 -|- !m n. m < n = (?P. (!n'. P(SUC n') ==> P n') /\ P m /\ ~P n)
520 -\ENDTHEOREM
521 -\THEOREM LESS\_0 prim\_rec
522 -|- !n. 0 < (SUC n)
523 -\ENDTHEOREM
524 \THEOREM LESS\_0\_0 prim\_rec
525 |- 0 < (SUC 0)
526 \ENDTHEOREM
527 \THEOREM LESS\_0\_CASES arithmetic
528 |- !m. (0 = m) \/ 0 < m
529 \ENDTHEOREM
530 -\THEOREM LESS\_ADD arithmetic
531 -|- !m n. n < m ==> (?p. p + n = m)
532 +\THEOREM LESS\_0 prim\_rec
533 +|- !n. 0 < (SUC n)
534 \ENDTHEOREM
535 \THEOREM LESS\_ADD\_1 arithmetic
536 |- !m n. n < m ==> (?p. m = n + (p + 1))
537 \ENDTHEOREM
538 +\THEOREM LESS\_ADD arithmetic
539 +|- !m n. n < m ==> (?p. p + n = m)
540 +\ENDTHEOREM
541 \THEOREM LESS\_ADD\_NONZERO arithmetic
542 |- !m n. ~(n = 0) ==> m < (m + n)
543 \ENDTHEOREM
544 @@ -642,14 +627,8 @@
545 \THEOREM LESS\_CASES\_IMP arithmetic
546 |- !m n. ~m < n /\ ~(m = n) ==> n < m
547 \ENDTHEOREM
548 -\THEOREM LESS\_EQ arithmetic
549 -|- !m n. m < n = (SUC m) <= n
550 -\ENDTHEOREM
551 -\THEOREM LESS\_EQUAL\_ADD arithmetic
552 -|- !m n. m <= n ==> (?p. n = m + p)
553 -\ENDTHEOREM
554 -\THEOREM LESS\_EQUAL\_ANTISYM arithmetic
555 -|- !n m. n <= m /\ m <= n ==> (n = m)
556 +\THEOREM LESS prim\_rec
557 +|- !m n. m < n = (?P. (!n'. P(SUC n') ==> P n') /\ P m /\ ~P n)
558 \ENDTHEOREM
559 \THEOREM LESS\_EQ\_0 arithmetic
560 |- !n. n <= 0 = (n = 0)
561 @@ -666,6 +645,9 @@
562 \THEOREM LESS\_EQ\_CASES arithmetic
563 |- !m n. m <= n \/ n <= m
564 \ENDTHEOREM
565 +\THEOREM LESS\_EQ arithmetic
566 +|- !m n. m < n = (SUC m) <= n
567 +\ENDTHEOREM
568 \THEOREM LESS\_EQ\_EXISTS arithmetic
569 |- !m n. m <= n = (?p. n = m + p)
570 \ENDTHEOREM
571 @@ -678,12 +660,12 @@
572 \THEOREM LESS\_EQ\_LESS\_TRANS arithmetic
573 |- !m n p. m <= n /\ n < p ==> m < p
574 \ENDTHEOREM
575 -\THEOREM LESS\_EQ\_MONO arithmetic
576 -|- !n m. (SUC n) <= (SUC m) = n <= m
577 -\ENDTHEOREM
578 \THEOREM LESS\_EQ\_MONO\_ADD\_EQ arithmetic
579 |- !m n p. (m + p) <= (n + p) = m <= n
580 \ENDTHEOREM
581 +\THEOREM LESS\_EQ\_MONO arithmetic
582 +|- !n m. (SUC n) <= (SUC m) = n <= m
583 +\ENDTHEOREM
584 \THEOREM LESS\_EQ\_REFL arithmetic
585 |- !m. m <= m
586 \ENDTHEOREM
587 @@ -696,6 +678,12 @@
588 \THEOREM LESS\_EQ\_TRANS arithmetic
589 |- !m n p. m <= n /\ n <= p ==> m <= p
590 \ENDTHEOREM
591 +\THEOREM LESS\_EQUAL\_ADD arithmetic
592 +|- !m n. m <= n ==> (?p. n = m + p)
593 +\ENDTHEOREM
594 +\THEOREM LESS\_EQUAL\_ANTISYM arithmetic
595 +|- !n m. n <= m /\ m <= n ==> (n = m)
596 +\ENDTHEOREM
597 \THEOREM LESS\_EXP\_SUC\_MONO arithmetic
598 |- !n m. ((SUC(SUC m)) EXP n) < ((SUC(SUC m)) EXP (SUC n))
599 \ENDTHEOREM
600 @@ -723,9 +711,6 @@
601 \THEOREM LESS\_MOD arithmetic
602 |- !n k. k < n ==> (k MOD n = k)
603 \ENDTHEOREM
604 -\THEOREM LESS\_MONO prim\_rec
605 -|- !m n. m < n ==> (SUC m) < (SUC n)
606 -\ENDTHEOREM
607 \THEOREM LESS\_MONO\_ADD arithmetic
608 |- !m n p. m < n ==> (m + p) < (n + p)
609 \ENDTHEOREM
610 @@ -735,6 +720,9 @@
611 \THEOREM LESS\_MONO\_ADD\_INV arithmetic
612 |- !m n p. (m + p) < (n + p) ==> m < n
613 \ENDTHEOREM
614 +\THEOREM LESS\_MONO prim\_rec
615 +|- !m n. m < n ==> (SUC m) < (SUC n)
616 +\ENDTHEOREM
617 \THEOREM LESS\_MONO\_EQ arithmetic
618 |- !m n. (SUC m) < (SUC n) = m < n
619 \ENDTHEOREM
620 @@ -759,12 +747,12 @@
621 \THEOREM LESS\_OR arithmetic
622 |- !m n. m < n ==> (SUC m) <= n
623 \ENDTHEOREM
624 -\THEOREM LESS\_OR\_EQ arithmetic
625 -|- !m n. m <= n = m < n \/ (m = n)
626 -\ENDTHEOREM
627 \THEOREM LESS\_OR\_EQ\_ADD arithmetic
628 |- !n m. n < m \/ (?p. n = p + m)
629 \ENDTHEOREM
630 +\THEOREM LESS\_OR\_EQ arithmetic
631 +|- !m n. m <= n = m < n \/ (m = n)
632 +\ENDTHEOREM
633 \THEOREM LESS\_REFL prim\_rec
634 |- !n. ~n < n
635 \ENDTHEOREM
636 @@ -822,9 +810,6 @@
637 \THEOREM MONOID\_MULT\_1 arithmetic
638 |- MONOID $* 1
639 \ENDTHEOREM
640 -\THEOREM MULT arithmetic
641 -|- (!n. 0 * n = 0) /\ (!m n. (SUC m) * n = (m * n) + n)
642 -\ENDTHEOREM
643 \THEOREM MULT\_0 arithmetic
644 |- !m. m * 0 = 0
645 \ENDTHEOREM
646 @@ -840,6 +825,9 @@
647 ((SUC m) * n = (m * n) + n) /\
648 (m * (SUC n) = m + (m * n))
649 \ENDTHEOREM
650 +\THEOREM MULT arithmetic
651 +|- (!n. 0 * n = 0) /\ (!m n. (SUC m) * n = (m * n) + n)
652 +\ENDTHEOREM
653 \THEOREM MULT\_EQ\_0 arithmetic
654 |- !m n. (m * n = 0) = (m = 0) \/ (n = 0)
655 \ENDTHEOREM
656 @@ -879,12 +867,12 @@
657 \THEOREM NOT\_LEQ arithmetic
658 |- !m n. ~m <= n = (SUC n) <= m
659 \ENDTHEOREM
660 -\THEOREM NOT\_LESS arithmetic
661 -|- !m n. ~m < n = n <= m
662 -\ENDTHEOREM
663 \THEOREM NOT\_LESS\_0 prim\_rec
664 |- !n. ~n < 0
665 \ENDTHEOREM
666 +\THEOREM NOT\_LESS arithmetic
667 +|- !m n. ~m < n = n <= m
668 +\ENDTHEOREM
669 \THEOREM NOT\_LESS\_EQ prim\_rec
670 |- !m n. (m = n) ==> ~m < n
671 \ENDTHEOREM
672 @@ -897,18 +885,18 @@
673 \THEOREM NOT\_ODD\_EQ\_EVEN arithmetic
674 |- !n m. ~(SUC(n + n) = m + m)
675 \ENDTHEOREM
676 -\THEOREM NOT\_SUC num
677 -|- !n. ~(SUC n = 0)
678 -\ENDTHEOREM
679 \THEOREM NOT\_SUC\_ADD\_LESS\_EQ arithmetic
680 |- !m n. ~(SUC(m + n)) <= m
681 \ENDTHEOREM
682 -\THEOREM NOT\_SUC\_LESS\_EQ arithmetic
683 -|- !n m. ~(SUC n) <= m = m <= n
684 +\THEOREM NOT\_SUC num
685 +|- !n. ~(SUC n = 0)
686 \ENDTHEOREM
687 \THEOREM NOT\_SUC\_LESS\_EQ\_0 arithmetic
688 |- !n. ~(SUC n) <= 0
689 \ENDTHEOREM
690 +\THEOREM NOT\_SUC\_LESS\_EQ arithmetic
691 +|- !n m. ~(SUC n) <= m = m <= n
692 +\ENDTHEOREM
693 \THEOREM num\_Axiom prim\_rec
694 |- !e f. ?! fn. (fn 0 = e) /\ (!n. fn(SUC n) = f(fn n)n)
695 \ENDTHEOREM
696 @@ -922,12 +910,12 @@
697 \THEOREM num\_TY\_DEF num
698 |- ?rep. TYPE_DEFINITION IS_NUM_REP rep
699 \ENDTHEOREM
700 -\THEOREM ODD arithmetic
701 -|- (ODD 0 = F) /\ (!n. ODD(SUC n) = ~ODD n)
702 -\ENDTHEOREM
703 \THEOREM ODD\_ADD arithmetic
704 |- !m n. ODD(m + n) = ~(ODD m = ODD n)
705 \ENDTHEOREM
706 +\THEOREM ODD arithmetic
707 +|- (ODD 0 = F) /\ (!n. ODD(SUC n) = ~ODD n)
708 +\ENDTHEOREM
709 \THEOREM ODD\_DOUBLE arithmetic
710 |- !n. ODD(SUC(2 * n))
711 \ENDTHEOREM
712 @@ -946,18 +934,18 @@
713 \THEOREM OR\_LESS arithmetic
714 |- !m n. (SUC m) <= n ==> m < n
715 \ENDTHEOREM
716 -\THEOREM PRE prim\_rec
717 -|- (PRE 0 = 0) /\ (!m. PRE(SUC m) = m)
718 -\ENDTHEOREM
719 \THEOREM PRE\_DEF prim\_rec
720 |- !m. PRE m = ((m = 0) => 0 | (@n. m = SUC n))
721 \ENDTHEOREM
722 -\THEOREM PRE\_SUB arithmetic
723 -|- !m n. PRE(m - n) = (PRE m) - n
724 +\THEOREM PRE prim\_rec
725 +|- (PRE 0 = 0) /\ (!m. PRE(SUC m) = m)
726 \ENDTHEOREM
727 \THEOREM PRE\_SUB1 arithmetic
728 |- !m. PRE m = m - 1
729 \ENDTHEOREM
730 +\THEOREM PRE\_SUB arithmetic
731 +|- !m n. PRE(m - n) = (PRE m) - n
732 +\ENDTHEOREM
733 \THEOREM PRE\_SUC\_EQ arithmetic
734 |- !m n. 0 < n ==> ((m = PRE n) = (SUC m = n))
735 \ENDTHEOREM
736 @@ -1013,9 +1001,6 @@
737 (SIMP_REC x f 0 = x) /\
738 (!m. SIMP_REC x f(SUC m) = f(SIMP_REC x f m))
739 \ENDTHEOREM
740 -\THEOREM SUB arithmetic
741 -|- (!m. 0 - m = 0) /\ (!m n. (SUC m) - n = (m < n => 0 | SUC(m - n)))
742 -\ENDTHEOREM
743 \THEOREM SUB\_0 arithmetic
744 |- !m. (0 - m = 0) /\ (m - 0 = m)
745 \ENDTHEOREM
746 @@ -1025,8 +1010,8 @@
747 \THEOREM SUB\_CANCEL arithmetic
748 |- !p n m. n <= p /\ m <= p ==> ((p - n = p - m) = (n = m))
749 \ENDTHEOREM
750 -\THEOREM SUB\_EQUAL\_0 arithmetic
751 -|- !c. c - c = 0
752 +\THEOREM SUB arithmetic
753 +|- (!m. 0 - m = 0) /\ (!m n. (SUC m) - n = (m < n => 0 | SUC(m - n)))
754 \ENDTHEOREM
755 \THEOREM SUB\_EQ\_0 arithmetic
756 |- !m n. (m - n = 0) = m <= n
757 @@ -1034,6 +1019,9 @@
758 \THEOREM SUB\_EQ\_EQ\_0 arithmetic
759 |- !m n. (m - n = m) = (m = 0) \/ (n = 0)
760 \ENDTHEOREM
761 +\THEOREM SUB\_EQUAL\_0 arithmetic
762 +|- !c. c - c = 0
763 +\ENDTHEOREM
764 \THEOREM SUB\_LEFT\_ADD arithmetic
765 |- !m n p. m + (n - p) = (n <= p => m | (m + n) - p)
766 \ENDTHEOREM
767 @@ -1061,12 +1049,12 @@
768 \THEOREM SUB\_LESS\_0 arithmetic
769 |- !n m. m < n = 0 < (n - m)
770 \ENDTHEOREM
771 -\THEOREM SUB\_LESS\_EQ arithmetic
772 -|- !n m. (n - m) <= n
773 -\ENDTHEOREM
774 \THEOREM SUB\_LESS\_EQ\_ADD arithmetic
775 |- !m p. m <= p ==> (!n. (p - m) <= n = p <= (m + n))
776 \ENDTHEOREM
777 +\THEOREM SUB\_LESS\_EQ arithmetic
778 +|- !n m. (n - m) <= n
779 +\ENDTHEOREM
780 \THEOREM SUB\_LESS\_OR arithmetic
781 |- !m n. n < m ==> n <= (m - 1)
782 \ENDTHEOREM
783 @@ -1148,12 +1136,7 @@
784 \THEOREM ZERO\_REP\_DEF num
785 |- ZERO_REP = (@x. !y. ~(x = SUC_REP y))
786 \ENDTHEOREM
787 -\section{Theorems about lists}
788 -\THEOREM ALL\_EL list
789 -|- (!P. ALL_EL P[] = T) /\
790 - (!P x l. ALL_EL P(CONS x l) = P x /\ ALL_EL P l)
791 -\ENDTHEOREM
792 -\THEOREM ALL\_EL\_APPEND list
793 +\section{Theorems about lists}\THEOREM ALL\_EL\_APPEND list
794 |- !P l1 l2. ALL_EL P(APPEND l1 l2) = ALL_EL P l1 /\ ALL_EL P l2
795 \ENDTHEOREM
796 \THEOREM ALL\_EL\_BUTFIRSTN list
797 @@ -1166,6 +1149,10 @@
798 \THEOREM ALL\_EL\_CONJ list
799 |- !P Q l. ALL_EL(\x. P x /\ Q x)l = ALL_EL P l /\ ALL_EL Q l
800 \ENDTHEOREM
801 +\THEOREM ALL\_EL list
802 +|- (!P. ALL_EL P[] = T) /\
803 + (!P x l. ALL_EL P(CONS x l) = P x /\ ALL_EL P l)
804 +\ENDTHEOREM
805 \THEOREM ALL\_EL\_FIRSTN list
806 |- !P l. ALL_EL P l ==> (!m. m <= (LENGTH l) ==> ALL_EL P(FIRSTN m l))
807 \ENDTHEOREM
808 @@ -1214,13 +1201,12 @@
809 (!h t l. AP(CONS h t)l = CONS(h(HD l))(AP t(TL l)))
810 \ENDTHEOREM
811
812 -\THEOREM APPEND list
813 -|- (!l. APPEND[]l = l) /\
814 - (!l1 l2 h. APPEND(CONS h l1)l2 = CONS h(APPEND l1 l2))
815 -\ENDTHEOREM
816 \THEOREM APPEND\_ASSOC list
817 |- !l1 l2 l3. APPEND l1(APPEND l2 l3) = APPEND(APPEND l1 l2)l3
818 \ENDTHEOREM
819 +\THEOREM APPEND\_BUTLAST\_LAST list
820 +|- !l. ~(l = []) ==> (APPEND(BUTLAST l)[LAST l] = l)
821 +\ENDTHEOREM
822 \THEOREM APPEND\_BUTLASTN\_BUTFIRSTN list
823 |- !m n l.
824 (m + n = LENGTH l) ==> (APPEND(BUTLASTN m l)(BUTFIRSTN n l) = l)
825 @@ -1228,8 +1214,9 @@
826 \THEOREM APPEND\_BUTLASTN\_LASTN list
827 |- !n l. n <= (LENGTH l) ==> (APPEND(BUTLASTN n l)(LASTN n l) = l)
828 \ENDTHEOREM
829 -\THEOREM APPEND\_BUTLAST\_LAST list
830 -|- !l. ~(l = []) ==> (APPEND(BUTLAST l)[LAST l] = l)
831 +\THEOREM APPEND list
832 +|- (!l. APPEND[]l = l) /\
833 + (!l1 l2 h. APPEND(CONS h l1)l2 = CONS h(APPEND l1 l2))
834 \ENDTHEOREM
835 \THEOREM APPEND\_FIRSTN\_BUTFIRSTN list
836 |- !n l. n <= (LENGTH l) ==> (APPEND(FIRSTN n l)(BUTFIRSTN n l) = l)
837 @@ -1273,10 +1260,6 @@
838 LEFT_ID f e ==>
839 (!l. FOLDR f e(FLAT l) = FOLDR f e(MAP(FOLDR f e)l)))
840 \ENDTHEOREM
841 -\THEOREM BUTFIRSTN list
842 -|- (!l. BUTFIRSTN 0 l = l) /\
843 - (!n x l. BUTFIRSTN(SUC n)(CONS x l) = BUTFIRSTN n l)
844 -\ENDTHEOREM
845 \THEOREM BUTFIRSTN\_APPEND1 list
846 |- !n l1.
847 n <= (LENGTH l1) ==>
848 @@ -1292,6 +1275,10 @@
849 (n + m) <= (LENGTH l) ==>
850 (BUTFIRSTN n(BUTFIRSTN m l) = BUTFIRSTN(n + m)l)
851 \ENDTHEOREM
852 +\THEOREM BUTFIRSTN list
853 +|- (!l. BUTFIRSTN 0 l = l) /\
854 + (!n x l. BUTFIRSTN(SUC n)(CONS x l) = BUTFIRSTN n l)
855 +\ENDTHEOREM
856 \THEOREM BUTFIRSTN\_LASTN list
857 |- !n l. n <= (LENGTH l) ==> (BUTFIRSTN n l = LASTN((LENGTH l) - n)l)
858 \ENDTHEOREM
859 @@ -1313,13 +1300,12 @@
860 n <= (LENGTH l) ==>
861 (!x. BUTFIRSTN n(SNOC x l) = SNOC x(BUTFIRSTN n l))
862 \ENDTHEOREM
863 +\THEOREM BUTLAST\_DEF list
864 +|- !l. BUTLAST l = SEG(PRE(LENGTH l))0 l
865 +\ENDTHEOREM
866 \THEOREM BUTLAST list
867 |- !x l. BUTLAST(SNOC x l) = l
868 \ENDTHEOREM
869 -\THEOREM BUTLASTN list
870 -|- (!l. BUTLASTN 0 l = l) /\
871 - (!n x l. BUTLASTN(SUC n)(SNOC x l) = BUTLASTN n l)
872 -\ENDTHEOREM
873 \THEOREM BUTLASTN\_1 list
874 |- !l. ~(l = []) ==> (BUTLASTN 1 l = BUTLAST l)
875 \ENDTHEOREM
876 @@ -1347,6 +1333,10 @@
877 n <= (LENGTH l) ==>
878 (!x. BUTLASTN n(CONS x l) = CONS x(BUTLASTN n l))
879 \ENDTHEOREM
880 +\THEOREM BUTLASTN list
881 +|- (!l. BUTLASTN 0 l = l) /\
882 + (!n x l. BUTLASTN(SUC n)(SNOC x l) = BUTLASTN n l)
883 +\ENDTHEOREM
884 \THEOREM BUTLASTN\_FIRSTN list
885 |- !n l. n <= (LENGTH l) ==> (BUTLASTN n l = FIRSTN((LENGTH l) - n)l)
886 \ENDTHEOREM
887 @@ -1381,9 +1371,6 @@
888 \THEOREM BUTLASTN\_SUC\_BUTLAST list
889 |- !n l. n < (LENGTH l) ==> (BUTLASTN(SUC n)l = BUTLASTN n(BUTLAST l))
890 \ENDTHEOREM
891 -\THEOREM BUTLAST\_DEF list
892 -|- !l. BUTLAST l = SEG(PRE(LENGTH l))0 l
893 -\ENDTHEOREM
894 \THEOREM COMM\_ASSOC\_FOLDL\_REVERSE list
895 |- !f. COMM f ==> ASSOC f ==> (!e l. FOLDL f e(REVERSE l) = FOLDL f e l)
896 \ENDTHEOREM
897 @@ -1400,9 +1387,6 @@
898 COMM f ==>
899 (!e'. MONOID f e' ==> (!e l. FOLDR f e l = f e(FOLDR f e' l)))
900 \ENDTHEOREM
901 -\THEOREM CONS list
902 -|- !l. ~NULL l ==> (CONS(HD l)(TL l) = l)
903 -\ENDTHEOREM
904 \THEOREM CONS\_11 list
905 |- !h t h' t'. (CONS h t = CONS h' t') = (h = h') /\ (t = t')
906 \ENDTHEOREM
907 @@ -1415,11 +1399,28 @@
908 ABS_list
909 ((\m. ((m = 0) => h | FST(REP_list t)(PRE m))),SUC(SND(REP_list t)))
910 \ENDTHEOREM
911 +\THEOREM CONS list
912 +|- !l. ~NULL l ==> (CONS(HD l)(TL l) = l)
913 +\ENDTHEOREM
914 +\THEOREM EL\_APPEND1 list
915 +|- !n l1 l2. n < (LENGTH l1) ==> (EL n(APPEND l1 l2) = EL n l1)
916 +\ENDTHEOREM
917 +\THEOREM EL\_APPEND2 list
918 +|- !l1 n.
919 + (LENGTH l1) <= n ==>
920 + (!l2. EL n(APPEND l1 l2) = EL(n - (LENGTH l1))l2)
921 +\ENDTHEOREM
922 +\THEOREM EL\_CONS list
923 +|- !n. 0 < n ==> (!x l. EL n(CONS x l) = EL(PRE n)l)
924 +\ENDTHEOREM
925 \THEOREM EL list
926 |- (!l. EL 0 l = HD l) /\ (!l n. EL(SUC n)l = EL n(TL l))
927 \ENDTHEOREM
928 -\THEOREM ELL list
929 -|- (!l. ELL 0 l = LAST l) /\ (!n l. ELL(SUC n)l = ELL n(BUTLAST l))
930 +\THEOREM EL\_ELL list
931 +|- !n l. n < (LENGTH l) ==> (EL n l = ELL(PRE((LENGTH l) - n))l)
932 +\ENDTHEOREM
933 +\THEOREM EL\_IS\_EL list
934 +|- !n l. n < (LENGTH l) ==> IS_EL(EL n l)l
935 \ENDTHEOREM
936 \THEOREM ELL\_0\_SNOC list
937 |- !l x. ELL 0(SNOC x l) = x
938 @@ -1435,9 +1436,18 @@
939 \THEOREM ELL\_CONS list
940 |- !n l. n < (LENGTH l) ==> (!x. ELL n(CONS x l) = ELL n l)
941 \ENDTHEOREM
942 +\THEOREM ELL list
943 +|- (!l. ELL 0 l = LAST l) /\ (!n l. ELL(SUC n)l = ELL n(BUTLAST l))
944 +\ENDTHEOREM
945 \THEOREM ELL\_EL list
946 |- !n l. n < (LENGTH l) ==> (ELL n l = EL(PRE((LENGTH l) - n))l)
947 \ENDTHEOREM
948 +\THEOREM EL\_LENGTH\_APPEND list
949 +|- !l2 l1. ~NULL l2 ==> (EL(LENGTH l1)(APPEND l1 l2) = HD l2)
950 +\ENDTHEOREM
951 +\THEOREM EL\_LENGTH\_SNOC list
952 +|- !l x. EL(LENGTH l)(SNOC x l) = x
953 +\ENDTHEOREM
954 \THEOREM ELL\_IS\_EL list
955 |- !n l. n < (LENGTH l) ==> IS_EL(EL n l)l
956 \ENDTHEOREM
957 @@ -1475,29 +1485,6 @@
958 \THEOREM ELL\_SUC\_SNOC list
959 |- !n x l. ELL(SUC n)(SNOC x l) = ELL n l
960 \ENDTHEOREM
961 -\THEOREM EL\_APPEND1 list
962 -|- !n l1 l2. n < (LENGTH l1) ==> (EL n(APPEND l1 l2) = EL n l1)
963 -\ENDTHEOREM
964 -\THEOREM EL\_APPEND2 list
965 -|- !l1 n.
966 - (LENGTH l1) <= n ==>
967 - (!l2. EL n(APPEND l1 l2) = EL(n - (LENGTH l1))l2)
968 -\ENDTHEOREM
969 -\THEOREM EL\_CONS list
970 -|- !n. 0 < n ==> (!x l. EL n(CONS x l) = EL(PRE n)l)
971 -\ENDTHEOREM
972 -\THEOREM EL\_ELL list
973 -|- !n l. n < (LENGTH l) ==> (EL n l = ELL(PRE((LENGTH l) - n))l)
974 -\ENDTHEOREM
975 -\THEOREM EL\_IS\_EL list
976 -|- !n l. n < (LENGTH l) ==> IS_EL(EL n l)l
977 -\ENDTHEOREM
978 -\THEOREM EL\_LENGTH\_APPEND list
979 -|- !l2 l1. ~NULL l2 ==> (EL(LENGTH l1)(APPEND l1 l2) = HD l2)
980 -\ENDTHEOREM
981 -\THEOREM EL\_LENGTH\_SNOC list
982 -|- !l x. EL(LENGTH l)(SNOC x l) = x
983 -\ENDTHEOREM
984 \THEOREM EL\_MAP list
985 |- !n l. n < (LENGTH l) ==> (!f. EL n(MAP f l) = f(EL n l))
986 \ENDTHEOREM
987 @@ -1548,17 +1535,17 @@
988 LEFT_ID g e ==>
989 (!l. FOLDR f e(FLAT l) = FOLDR g e(MAP(FOLDR f e)l)))
990 \ENDTHEOREM
991 -\THEOREM FILTER list
992 -|- (!P. FILTER P[] = []) /\
993 - (!P x l.
994 - FILTER P(CONS x l) = (P x => CONS x(FILTER P l) | FILTER P l))
995 -\ENDTHEOREM
996 \THEOREM FILTER\_APPEND list
997 |- !f l1 l2. FILTER f(APPEND l1 l2) = APPEND(FILTER f l1)(FILTER f l2)
998 \ENDTHEOREM
999 \THEOREM FILTER\_COMM list
1000 |- !f1 f2 l. FILTER f1(FILTER f2 l) = FILTER f2(FILTER f1 l)
1001 \ENDTHEOREM
1002 +\THEOREM FILTER list
1003 +|- (!P. FILTER P[] = []) /\
1004 + (!P x l.
1005 + FILTER P(CONS x l) = (P x => CONS x(FILTER P l) | FILTER P l))
1006 +\ENDTHEOREM
1007 \THEOREM FILTER\_FILTER list
1008 |- !P Q l. FILTER P(FILTER Q l) = FILTER(\x. P x /\ Q x)l
1009 \ENDTHEOREM
1010 @@ -1583,10 +1570,6 @@
1011 \THEOREM FILTER\_SNOC list
1012 |- !P x l. FILTER P(SNOC x l) = (P x => SNOC x(FILTER P l) | FILTER P l)
1013 \ENDTHEOREM
1014 -\THEOREM FIRSTN list
1015 -|- (!l. FIRSTN 0 l = []) /\
1016 - (!n x l. FIRSTN(SUC n)(CONS x l) = CONS x(FIRSTN n l))
1017 -\ENDTHEOREM
1018 \THEOREM FIRSTN\_APPEND1 list
1019 |- !n l1.
1020 n <= (LENGTH l1) ==> (!l2. FIRSTN n(APPEND l1 l2) = FIRSTN n l1)
1021 @@ -1599,6 +1582,10 @@
1022 \THEOREM FIRSTN\_BUTLASTN list
1023 |- !n l. n <= (LENGTH l) ==> (FIRSTN n l = BUTLASTN((LENGTH l) - n)l)
1024 \ENDTHEOREM
1025 +\THEOREM FIRSTN list
1026 +|- (!l. FIRSTN 0 l = []) /\
1027 + (!n x l. FIRSTN(SUC n)(CONS x l) = CONS x(FIRSTN n l))
1028 +\ENDTHEOREM
1029 \THEOREM FIRSTN\_FIRSTN list
1030 |- !m l.
1031 m <= (LENGTH l) ==>
1032 @@ -1619,12 +1606,12 @@
1033 \THEOREM FIRSTN\_SNOC list
1034 |- !n l. n <= (LENGTH l) ==> (!x. FIRSTN n(SNOC x l) = FIRSTN n l)
1035 \ENDTHEOREM
1036 -\THEOREM FLAT list
1037 -|- (FLAT[] = []) /\ (!h t. FLAT(CONS h t) = APPEND h(FLAT t))
1038 -\ENDTHEOREM
1039 \THEOREM FLAT\_APPEND list
1040 |- !l1 l2. FLAT(APPEND l1 l2) = APPEND(FLAT l1)(FLAT l2)
1041 \ENDTHEOREM
1042 +\THEOREM FLAT list
1043 +|- (FLAT[] = []) /\ (!h t. FLAT(CONS h t) = APPEND h(FLAT t))
1044 +\ENDTHEOREM
1045 \THEOREM FLAT\_FLAT list
1046 |- !l. FLAT(FLAT l) = FLAT(MAP FLAT l)
1047 \ENDTHEOREM
1048 @@ -1640,13 +1627,13 @@
1049 \THEOREM FLAT\_SNOC list
1050 |- !x l. FLAT(SNOC x l) = APPEND(FLAT l)x
1051 \ENDTHEOREM
1052 +\THEOREM FOLDL\_APPEND list
1053 +|- !f e l1 l2. FOLDL f e(APPEND l1 l2) = FOLDL f(FOLDL f e l1)l2
1054 +\ENDTHEOREM
1055 \THEOREM FOLDL list
1056 |- (!f e. FOLDL f e[] = e) /\
1057 (!f e x l. FOLDL f e(CONS x l) = FOLDL f(f e x)l)
1058 \ENDTHEOREM
1059 -\THEOREM FOLDL\_APPEND list
1060 -|- !f e l1 l2. FOLDL f e(APPEND l1 l2) = FOLDL f(FOLDL f e l1)l2
1061 -\ENDTHEOREM
1062 \THEOREM FOLDL\_FILTER list
1063 |- !f e P l. FOLDL f e(FILTER P l) = FOLDL(\x y. (P y => f x y | x))e l
1064 \ENDTHEOREM
1065 @@ -1668,16 +1655,16 @@
1066 \THEOREM FOLDL\_SNOC\_NIL list
1067 |- !l. FOLDL(\xs x. SNOC x xs)[]l = l
1068 \ENDTHEOREM
1069 -\THEOREM FOLDR list
1070 -|- (!f e. FOLDR f e[] = e) /\
1071 - (!f e x l. FOLDR f e(CONS x l) = f x(FOLDR f e l))
1072 -\ENDTHEOREM
1073 \THEOREM FOLDR\_APPEND list
1074 |- !f e l1 l2. FOLDR f e(APPEND l1 l2) = FOLDR f(FOLDR f e l2)l1
1075 \ENDTHEOREM
1076 \THEOREM FOLDR\_CONS\_NIL list
1077 |- !l. FOLDR CONS[]l = l
1078 \ENDTHEOREM
1079 +\THEOREM FOLDR list
1080 +|- (!f e. FOLDR f e[] = e) /\
1081 + (!f e x l. FOLDR f e(CONS x l) = f x(FOLDR f e l))
1082 +\ENDTHEOREM
1083 \THEOREM FOLDR\_FILTER list
1084 |- !f e P l. FOLDR f e(FILTER P l) = FOLDR(\x y. (P x => f x y | y))e l
1085 \ENDTHEOREM
1086 @@ -1716,10 +1703,6 @@
1087 \THEOREM HD list
1088 |- !h t. HD(CONS h t) = h
1089 \ENDTHEOREM
1090 -\THEOREM IS\_EL list
1091 -|- (!x. IS_EL x[] = F) /\
1092 - (!y x l. IS_EL y(CONS x l) = (y = x) \/ IS_EL y l)
1093 -\ENDTHEOREM
1094 \THEOREM IS\_EL\_APPEND list
1095 |- !l1 l2 x. IS_EL x(APPEND l1 l2) = IS_EL x l1 \/ IS_EL x l2
1096 \ENDTHEOREM
1097 @@ -1732,6 +1715,10 @@
1098 \THEOREM IS\_EL\_DEF list
1099 |- !x l. IS_EL x l = SOME_EL($= x)l
1100 \ENDTHEOREM
1101 +\THEOREM IS\_EL list
1102 +|- (!x. IS_EL x[] = F) /\
1103 + (!y x l. IS_EL y(CONS x l) = (y = x) \/ IS_EL y l)
1104 +\ENDTHEOREM
1105 \THEOREM IS\_EL\_FILTER list
1106 |- !P x. P x ==> (!l. IS_EL x(FILTER P l) = IS_EL x l)
1107 \ENDTHEOREM
1108 @@ -1772,15 +1759,15 @@
1109 \THEOREM IS\_list\_REP list
1110 |- !r. IS_list_REP r = (?f n. r = (\m. (m < n => f m | (@x. T))),n)
1111 \ENDTHEOREM
1112 +\THEOREM IS\_PREFIX\_APPEND list
1113 +|- !l1 l2. IS_PREFIX l1 l2 = (?l. l1 = APPEND l2 l)
1114 +\ENDTHEOREM
1115 \THEOREM IS\_PREFIX list
1116 |- (!l. IS_PREFIX l[] = T) /\
1117 (!x l. IS_PREFIX[](CONS x l) = F) /\
1118 (!x1 l1 x2 l2.
1119 IS_PREFIX(CONS x1 l1)(CONS x2 l2) = (x1 = x2) /\ IS_PREFIX l1 l2)
1120 \ENDTHEOREM
1121 -\THEOREM IS\_PREFIX\_APPEND list
1122 -|- !l1 l2. IS_PREFIX l1 l2 = (?l. l1 = APPEND l2 l)
1123 -\ENDTHEOREM
1124 \THEOREM IS\_PREFIX\_IS\_SUBLIST list
1125 |- !l1 l2. IS_PREFIX l1 l2 ==> IS_SUBLIST l1 l2
1126 \ENDTHEOREM
1127 @@ -1790,6 +1777,9 @@
1128 \THEOREM IS\_PREFIX\_REVERSE list
1129 |- !l1 l2. IS_PREFIX(REVERSE l1)(REVERSE l2) = IS_SUFFIX l1 l2
1130 \ENDTHEOREM
1131 +\THEOREM IS\_SUBLIST\_APPEND list
1132 +|- !l1 l2. IS_SUBLIST l1 l2 = (?l l'. l1 = APPEND l(APPEND l2 l'))
1133 +\ENDTHEOREM
1134 \THEOREM IS\_SUBLIST list
1135 |- (!l. IS_SUBLIST l[] = T) /\
1136 (!x l. IS_SUBLIST[](CONS x l) = F) /\
1137 @@ -1797,33 +1787,32 @@
1138 IS_SUBLIST(CONS x1 l1)(CONS x2 l2) =
1139 (x1 = x2) /\ IS_PREFIX l1 l2 \/ IS_SUBLIST l1(CONS x2 l2))
1140 \ENDTHEOREM
1141 -\THEOREM IS\_SUBLIST\_APPEND list
1142 -|- !l1 l2. IS_SUBLIST l1 l2 = (?l l'. l1 = APPEND l(APPEND l2 l'))
1143 -\ENDTHEOREM
1144 \THEOREM IS\_SUBLIST\_REVERSE list
1145 |- !l1 l2. IS_SUBLIST(REVERSE l1)(REVERSE l2) = IS_SUBLIST l1 l2
1146 \ENDTHEOREM
1147 +\THEOREM IS\_SUFFIX\_APPEND list
1148 +|- !l1 l2. IS_SUFFIX l1 l2 = (?l. l1 = APPEND l l2)
1149 +\ENDTHEOREM
1150 \THEOREM IS\_SUFFIX list
1151 |- (!l. IS_SUFFIX l[] = T) /\
1152 (!x l. IS_SUFFIX[](SNOC x l) = F) /\
1153 (!x1 l1 x2 l2.
1154 IS_SUFFIX(SNOC x1 l1)(SNOC x2 l2) = (x1 = x2) /\ IS_SUFFIX l1 l2)
1155 \ENDTHEOREM
1156 -\THEOREM IS\_SUFFIX\_APPEND list
1157 -|- !l1 l2. IS_SUFFIX l1 l2 = (?l. l1 = APPEND l l2)
1158 -\ENDTHEOREM
1159 \THEOREM IS\_SUFFIX\_IS\_SUBLIST list
1160 |- !l1 l2. IS_SUFFIX l1 l2 ==> IS_SUBLIST l1 l2
1161 \ENDTHEOREM
1162 \THEOREM IS\_SUFFIX\_REVERSE list
1163 |- !l1 l2. IS_SUFFIX(REVERSE l1)(REVERSE l2) = IS_PREFIX l1 l2
1164 \ENDTHEOREM
1165 +\THEOREM LAST\_DEF list
1166 +|- !l. LAST l = HD(SEG 1(PRE(LENGTH l))l)
1167 +\ENDTHEOREM
1168 \THEOREM LAST list
1169 |- !x l. LAST(SNOC x l) = x
1170 \ENDTHEOREM
1171 -\THEOREM LASTN list
1172 -|- (!l. LASTN 0 l = []) /\
1173 - (!n x l. LASTN(SUC n)(SNOC x l) = SNOC x(LASTN n l))
1174 +\THEOREM LAST\_LASTN\_LAST list
1175 +|- !n l. n <= (LENGTH l) ==> 0 < n ==> (LAST(LASTN n l) = LAST l)
1176 \ENDTHEOREM
1177 \THEOREM LASTN\_1 list
1178 |- !l. ~(l = []) ==> (LASTN 1 l = [LAST l])
1179 @@ -1847,6 +1836,10 @@
1180 \THEOREM LASTN\_CONS list
1181 |- !n l. n <= (LENGTH l) ==> (!x. LASTN n(CONS x l) = LASTN n l)
1182 \ENDTHEOREM
1183 +\THEOREM LASTN list
1184 +|- (!l. LASTN 0 l = []) /\
1185 + (!n x l. LASTN(SUC n)(SNOC x l) = SNOC x(LASTN n l))
1186 +\ENDTHEOREM
1187 \THEOREM LASTN\_LASTN list
1188 |- !l n m.
1189 m <= (LENGTH l) ==> n <= m ==> (LASTN n(LASTN m l) = LASTN n l)
1190 @@ -1866,15 +1859,6 @@
1191 \THEOREM LASTN\_SEG list
1192 |- !n l. n <= (LENGTH l) ==> (LASTN n l = SEG n((LENGTH l) - n)l)
1193 \ENDTHEOREM
1194 -\THEOREM LAST\_DEF list
1195 -|- !l. LAST l = HD(SEG 1(PRE(LENGTH l))l)
1196 -\ENDTHEOREM
1197 -\THEOREM LAST\_LASTN\_LAST list
1198 -|- !n l. n <= (LENGTH l) ==> 0 < n ==> (LAST(LASTN n l) = LAST l)
1199 -\ENDTHEOREM
1200 -\THEOREM LENGTH list
1201 -|- (LENGTH[] = 0) /\ (!h t. LENGTH(CONS h t) = SUC(LENGTH t))
1202 -\ENDTHEOREM
1203 \THEOREM LENGTH\_APPEND list
1204 |- !l1 l2. LENGTH(APPEND l1 l2) = (LENGTH l1) + (LENGTH l2)
1205 \ENDTHEOREM
1206 @@ -1891,14 +1875,17 @@
1207 |- !l n.
1208 (LENGTH l = SUC n) = (?h l'. (LENGTH l' = n) /\ (l = CONS h l'))
1209 \ENDTHEOREM
1210 -\THEOREM LENGTH\_EQ list
1211 -|- !x y. (x = y) ==> (LENGTH x = LENGTH y)
1212 +\THEOREM LENGTH list
1213 +|- (LENGTH[] = 0) /\ (!h t. LENGTH(CONS h t) = SUC(LENGTH t))
1214 \ENDTHEOREM
1215 \THEOREM LENGTH\_EQ\_CONS list
1216 |- !P n.
1217 (!l. (LENGTH l = SUC n) ==> P l) =
1218 (!l. (LENGTH l = n) ==> (\l. !x. P(CONS x l))l)
1219 \ENDTHEOREM
1220 +\THEOREM LENGTH\_EQ list
1221 +|- !x y. (x = y) ==> (LENGTH x = LENGTH y)
1222 +\ENDTHEOREM
1223 \THEOREM LENGTH\_EQ\_NIL list
1224 |- !P. (!l. (LENGTH l = 0) ==> P l) = P[]
1225 \ENDTHEOREM
1226 @@ -1920,9 +1907,6 @@
1227 \THEOREM LENGTH\_LASTN list
1228 |- !n l. n <= (LENGTH l) ==> (LENGTH(LASTN n l) = n)
1229 \ENDTHEOREM
1230 -\THEOREM LENGTH\_MAP list
1231 -|- !l f. LENGTH(MAP f l) = LENGTH l
1232 -\ENDTHEOREM
1233 \THEOREM LENGTH\_MAP2 list
1234 |- !l1 l2.
1235 (LENGTH l1 = LENGTH l2) ==>
1236 @@ -1930,6 +1914,9 @@
1237 (LENGTH(MAP2 f l1 l2) = LENGTH l1) /\
1238 (LENGTH(MAP2 f l1 l2) = LENGTH l2))
1239 \ENDTHEOREM
1240 +\THEOREM LENGTH\_MAP list
1241 +|- !l f. LENGTH(MAP f l) = LENGTH l
1242 +\ENDTHEOREM
1243 \THEOREM LENGTH\_NIL list
1244 |- !l. (LENGTH l = 0) = (l = [])
1245 \ENDTHEOREM
1246 @@ -1984,9 +1971,6 @@
1247 \THEOREM list\_TY\_DEF list
1248 |- ?rep. TYPE_DEFINITION IS_list_REP rep
1249 \ENDTHEOREM
1250 -\THEOREM MAP list
1251 -|- (!f. MAP f[] = []) /\ (!f h t. MAP f(CONS h t) = CONS(f h)(MAP f t))
1252 -\ENDTHEOREM
1253 \THEOREM MAP2 list
1254 |- (!f. MAP2 f[][] = []) /\
1255 (!f h1 t1 h2 t2.
1256 @@ -2000,6 +1984,9 @@
1257 \THEOREM MAP\_APPEND list
1258 |- !f l1 l2. MAP f(APPEND l1 l2) = APPEND(MAP f l1)(MAP f l2)
1259 \ENDTHEOREM
1260 +\THEOREM MAP list
1261 +|- (!f. MAP f[] = []) /\ (!f h t. MAP f(CONS h t) = CONS(f h)(MAP f t))
1262 +\ENDTHEOREM
1263 \THEOREM MAP\_FILTER list
1264 |- !f P l.
1265 (!x. P(f x) = P x) ==> (MAP f(FILTER P l) = FILTER P(MAP f l))
1266 @@ -2052,12 +2039,12 @@
1267 \THEOREM NOT\_SOME\_EL\_ALL\_EL list
1268 |- !P l. ~SOME_EL P l = ALL_EL($~ o P)l
1269 \ENDTHEOREM
1270 -\THEOREM NULL list
1271 -|- NULL[] /\ (!h t. ~NULL(CONS h t))
1272 -\ENDTHEOREM
1273 \THEOREM NULL\_DEF list
1274 |- (NULL[] = T) /\ (!h t. NULL(CONS h t) = F)
1275 \ENDTHEOREM
1276 +\THEOREM NULL list
1277 +|- NULL[] /\ (!h t. ~NULL(CONS h t))
1278 +\ENDTHEOREM
1279 \THEOREM NULL\_EQ\_NIL list
1280 |- !l. NULL l = (l = [])
1281 \ENDTHEOREM
1282 @@ -2081,13 +2068,13 @@
1283 (!n t l.
1284 PART(CONS n t)l = CONS(FST(SPLIT n l))(PART t(SND(SPLIT n l))))
1285 \ENDTHEOREM
1286 +\THEOREM PREFIX\_DEF list
1287 +|- !P l. PREFIX P l = FST(SPLITP($~ o P)l)
1288 +\ENDTHEOREM
1289 \THEOREM PREFIX list
1290 |- (!P. PREFIX P[] = []) /\
1291 (!P x l. PREFIX P(CONS x l) = (P x => CONS x(PREFIX P l) | []))
1292 \ENDTHEOREM
1293 -\THEOREM PREFIX\_DEF list
1294 -|- !P l. PREFIX P l = FST(SPLITP($~ o P)l)
1295 -\ENDTHEOREM
1296 \THEOREM PREFIX\_FOLDR list
1297 |- !P l. PREFIX P l = FOLDR(\x l'. (P x => CONS x l' | []))[]l
1298 \ENDTHEOREM
1299 @@ -2095,12 +2082,12 @@
1300 |- (!x. REPLICATE 0 x = []) /\
1301 (!n x. REPLICATE(SUC n)x = CONS x(REPLICATE n x))
1302 \ENDTHEOREM
1303 -\THEOREM REVERSE list
1304 -|- (REVERSE[] = []) /\ (!x l. REVERSE(CONS x l) = SNOC x(REVERSE l))
1305 -\ENDTHEOREM
1306 \THEOREM REVERSE\_APPEND list
1307 |- !l1 l2. REVERSE(APPEND l1 l2) = APPEND(REVERSE l2)(REVERSE l1)
1308 \ENDTHEOREM
1309 +\THEOREM REVERSE list
1310 +|- (REVERSE[] = []) /\ (!x l. REVERSE(CONS x l) = SNOC x(REVERSE l))
1311 +\ENDTHEOREM
1312 \THEOREM REVERSE\_EQ\_NIL list
1313 |- !l. (REVERSE l = []) = (l = [])
1314 \ENDTHEOREM
1315 @@ -2128,22 +2115,9 @@
1316 (!f e x l.
1317 SCANR f e(CONS x l) = CONS(f x(HD(SCANR f e l)))(SCANR f e l))
1318 \ENDTHEOREM
1319 -\THEOREM SEG list
1320 -|- (!k l. SEG 0 k l = []) /\
1321 - (!m x l. SEG(SUC m)0(CONS x l) = CONS x(SEG m 0 l)) /\
1322 - (!m k x l. SEG(SUC m)(SUC k)(CONS x l) = SEG(SUC m)k l)
1323 -\ENDTHEOREM
1324 \THEOREM SEG\_0\_SNOC list
1325 |- !m l x. m <= (LENGTH l) ==> (SEG m 0(SNOC x l) = SEG m 0 l)
1326 \ENDTHEOREM
1327 -\THEOREM SEG\_APPEND list
1328 -|- !m l1 n l2.
1329 - m < (LENGTH l1) /\
1330 - (LENGTH l1) <= (n + m) /\
1331 - (n + m) <= ((LENGTH l1) + (LENGTH l2)) ==>
1332 - (SEG n m(APPEND l1 l2) =
1333 - APPEND(SEG((LENGTH l1) - m)m l1)(SEG((n + m) - (LENGTH l1))0 l2))
1334 -\ENDTHEOREM
1335 \THEOREM SEG\_APPEND1 list
1336 |- !n m l1.
1337 (n + m) <= (LENGTH l1) ==> (!l2. SEG n m(APPEND l1 l2) = SEG n m l1)
1338 @@ -2153,6 +2127,19 @@
1339 (LENGTH l1) <= m /\ n <= (LENGTH l2) ==>
1340 (SEG n m(APPEND l1 l2) = SEG n(m - (LENGTH l1))l2)
1341 \ENDTHEOREM
1342 +\THEOREM SEG\_APPEND list
1343 +|- !m l1 n l2.
1344 + m < (LENGTH l1) /\
1345 + (LENGTH l1) <= (n + m) /\
1346 + (n + m) <= ((LENGTH l1) + (LENGTH l2)) ==>
1347 + (SEG n m(APPEND l1 l2) =
1348 + APPEND(SEG((LENGTH l1) - m)m l1)(SEG((n + m) - (LENGTH l1))0 l2))
1349 +\ENDTHEOREM
1350 +\THEOREM SEG list
1351 +|- (!k l. SEG 0 k l = []) /\
1352 + (!m x l. SEG(SUC m)0(CONS x l) = CONS x(SEG m 0 l)) /\
1353 + (!m k x l. SEG(SUC m)(SUC k)(CONS x l) = SEG(SUC m)k l)
1354 +\ENDTHEOREM
1355 \THEOREM SEG\_FIRSTN\_BUTFISTN list
1356 |- !n m l.
1357 (n + m) <= (LENGTH l) ==> (SEG n m l = FIRSTN n(BUTFIRSTN m l))
1358 @@ -2184,10 +2171,6 @@
1359 \THEOREM SEG\_SUC\_CONS list
1360 |- !m n l x. SEG m(SUC n)(CONS x l) = SEG m n l
1361 \ENDTHEOREM
1362 -\THEOREM SNOC list
1363 -|- (!x. SNOC x[] = [x]) /\
1364 - (!x x' l. SNOC x(CONS x' l) = CONS x'(SNOC x l))
1365 -\ENDTHEOREM
1366 \THEOREM SNOC\_11 list
1367 |- !x l x' l'. (SNOC x l = SNOC x' l') = (x = x') /\ (l = l')
1368 \ENDTHEOREM
1369 @@ -2200,6 +2183,10 @@
1370 \THEOREM SNOC\_CASES list
1371 |- !l. (l = []) \/ (?l' x. l = SNOC x l')
1372 \ENDTHEOREM
1373 +\THEOREM SNOC list
1374 +|- (!x. SNOC x[] = [x]) /\
1375 + (!x x' l. SNOC x(CONS x' l) = CONS x'(SNOC x l))
1376 +\ENDTHEOREM
1377 \THEOREM SNOC\_EQ\_LENGTH\_EQ list
1378 |- !x1 l1 x2 l2. (SNOC x1 l1 = SNOC x2 l2) ==> (LENGTH l1 = LENGTH l2)
1379 \ENDTHEOREM
1380 @@ -2212,10 +2199,6 @@
1381 \THEOREM SNOC\_REVERSE\_CONS list
1382 |- !x l. SNOC x l = REVERSE(CONS x(REVERSE l))
1383 \ENDTHEOREM
1384 -\THEOREM SOME\_EL list
1385 -|- (!P. SOME_EL P[] = F) /\
1386 - (!P x l. SOME_EL P(CONS x l) = P x \/ SOME_EL P l)
1387 -\ENDTHEOREM
1388 \THEOREM SOME\_EL\_APPEND list
1389 |- !P l1 l2. SOME_EL P(APPEND l1 l2) = SOME_EL P l1 \/ SOME_EL P l2
1390 \ENDTHEOREM
1391 @@ -2230,6 +2213,10 @@
1392 \THEOREM SOME\_EL\_DISJ list
1393 |- !P Q l. SOME_EL(\x. P x \/ Q x)l = SOME_EL P l \/ SOME_EL Q l
1394 \ENDTHEOREM
1395 +\THEOREM SOME\_EL list
1396 +|- (!P. SOME_EL P[] = F) /\
1397 + (!P x l. SOME_EL P(CONS x l) = P x \/ SOME_EL P l)
1398 +\ENDTHEOREM
1399 \THEOREM SOME\_EL\_FIRSTN list
1400 |- !m l. m <= (LENGTH l) ==> (!P. SOME_EL P(FIRSTN m l) ==> SOME_EL P l)
1401 \ENDTHEOREM
1402 @@ -2277,12 +2264,12 @@
1403 \THEOREM SUFFIX\_DEF list
1404 |- !P l. SUFFIX P l = FOLDL(\l' x. (P x => SNOC x l' | []))[]l
1405 \ENDTHEOREM
1406 -\THEOREM SUM list
1407 -|- (SUM[] = 0) /\ (!h t. SUM(CONS h t) = h + (SUM t))
1408 -\ENDTHEOREM
1409 \THEOREM SUM\_APPEND list
1410 |- !l1 l2. SUM(APPEND l1 l2) = (SUM l1) + (SUM l2)
1411 \ENDTHEOREM
1412 +\THEOREM SUM list
1413 +|- (SUM[] = 0) /\ (!h t. SUM(CONS h t) = h + (SUM t))
1414 +\ENDTHEOREM
1415 \THEOREM SUM\_FLAT list
1416 |- !l. SUM(FLAT l) = SUM(MAP SUM l)
1417 \ENDTHEOREM
1418 @@ -2336,8 +2323,7 @@
1419 \THEOREM ZIP\_UNZIP list
1420 |- !l. ZIP(UNZIP l) = l
1421 \ENDTHEOREM
1422 -\section{Theorems about trees}
1423 -\THEOREM AP ltree
1424 +\section{Theorems about trees}\THEOREM AP ltree
1425 |- (!l. AP[]l = []) /\
1426 (!h t l. AP(CONS h t)l = CONS(h(HD l))(AP t(TL l)))
1427 \ENDTHEOREM
1428 @@ -2372,21 +2358,21 @@
1429 \THEOREM ltree\_TY\_DEF ltree
1430 |- ?rep. TYPE_DEFINITION Is_ltree rep
1431 \ENDTHEOREM
1432 -\THEOREM Node ltree
1433 -|- !v tl.
1434 - Node v tl =
1435 - ABS_ltree
1436 - (node(MAP(FST o REP_ltree)tl),CONS v(FLAT(MAP(SND o REP_ltree)tl)))
1437 -\ENDTHEOREM
1438 -\THEOREM node tree
1439 -|- !tl. node tl = ABS_tree(node_REP(MAP REP_tree tl))
1440 +\THEOREM node\_11 tree
1441 +|- !tl1 tl2. (node tl1 = node tl2) = (tl1 = tl2)
1442 \ENDTHEOREM
1443 \THEOREM Node\_11 ltree
1444 |- !v1 v2 trl1 trl2.
1445 (Node v1 trl1 = Node v2 trl2) = (v1 = v2) /\ (trl1 = trl2)
1446 \ENDTHEOREM
1447 -\THEOREM node\_11 tree
1448 -|- !tl1 tl2. (node tl1 = node tl2) = (tl1 = tl2)
1449 +\THEOREM node tree
1450 +|- !tl. node tl = ABS_tree(node_REP(MAP REP_tree tl))
1451 +\ENDTHEOREM
1452 +\THEOREM Node ltree
1453 +|- !v tl.
1454 + Node v tl =
1455 + ABS_ltree
1456 + (node(MAP(FST o REP_ltree)tl),CONS v(FLAT(MAP(SND o REP_ltree)tl)))
1457 \ENDTHEOREM
1458 \THEOREM Node\_onto ltree
1459 |- !l. ?v trl. l = Node v trl
1460 @@ -2426,8 +2412,7 @@
1461 trf n f =
1462 (@fn. !trl. (HT(node trl)) <= n ==> (fn(node trl) = f(MAP fn trl)))
1463 \ENDTHEOREM
1464 -\section{Theorems used to define types}
1465 -\THEOREM ABS\_REP\_THM BASIC-HOL
1466 +\section{Theorems used to define types}\THEOREM ABS\_REP\_THM BASIC-HOL
1467 |- !P.
1468 (?rep. TYPE_DEFINITION P rep) ==>
1469 (?rep abs. (!a. abs(rep a) = a) /\ (!r. P r = (rep(abs r) = r)))
1470 @@ -2435,17 +2420,11 @@
1471 \THEOREM exists\_TRP tydefs
1472 |- !P. (?v. P v[]) ==> (?t. TRP P t)
1473 \ENDTHEOREM
1474 -\THEOREM TRP tydefs
1475 -|- !P v tl. TRP P(Node v tl) = P v tl /\ ALL_EL(TRP P)tl
1476 -\ENDTHEOREM
1477 \THEOREM TRP\_DEF tydefs
1478 |- !P. TRP P = (@trp. !v tl. trp(Node v tl) = P v tl /\ ALL_EL trp tl)
1479 \ENDTHEOREM
1480 -\THEOREM TYPE\_DEFINITION bool
1481 -|- !P rep.
1482 - TYPE_DEFINITION P rep =
1483 - (!x' x''. (rep x' = rep x'') ==> (x' = x'')) /\
1484 - (!x. P x = (?x'. x = rep x'))
1485 +\THEOREM TRP tydefs
1486 +|- !P v tl. TRP P(Node v tl) = P v tl /\ ALL_EL(TRP P)tl
1487 \ENDTHEOREM
1488 \THEOREM TY\_DEF\_THM tydefs
1489 |- !REP ABS P.
1490 @@ -2456,3 +2435,9 @@
1491 P v(MAP REP tl) ==>
1492 (fn(ABS(Node v(MAP REP tl))) = f(MAP fn tl)v tl))
1493 \ENDTHEOREM
1494 +\THEOREM TYPE\_DEFINITION bool
1495 +|- !P rep.
1496 + TYPE_DEFINITION P rep =
1497 + (!x' x''. (rep x' = rep x'') ==> (x' = x'')) /\
1498 + (!x. P x = (?x'. x = rep x'))
1499 +\ENDTHEOREM
1500 --- hol88-2.02.19940316.orig/Manual/Reference/reference.tex
1501 +++ hol88-2.02.19940316/Manual/Reference/reference.tex
1502 @@ -32,7 +32,7 @@
1503
1504 \include{title} % reference title page
1505 \include{preface} % preface to reference manual
1506 - \include{../LaTeX/ack} % global acknowledgements
1507 + \include{ack} % global acknowledgements
1508 \include{contents} % table of contents
1509
1510 % ---------------------------------------------------------------------
1511 --- hol88-2.02.19940316.orig/Manual/Reference/index.tex
1512 +++ hol88-2.02.19940316/Manual/Reference/index.tex
1513 @@ -1,1625 +1 @@
1514 -\begin{theindex}
1515 -
1516 - \item {\ptt *}, 1
1517 - \item {\ptt +}, 2
1518 - \item {\ptt -}, 2
1519 - \item {\ptt /}, 3
1520 - \item {\ptt <}, 4
1521 - \item {\ptt <<}, 4
1522 - \item {\ptt =}, 4
1523 - \item {\ptt >}, 6
1524 - \item {\ptt \#}, 1
1525 - \item {\ptt \char '056}, 2
1526 - \item {\ptt \char '100}, 7
1527 - \item {\ptt \char '136}, 3
1528 -
1529 - \indexspace
1530 -
1531 - \item {\ptt ABS}, 7
1532 - \item {\ptt ABS\_CONV}, 8
1533 - \item {\ptt abs\_goals}, 9
1534 - \item {\ptt ABS\_REP\_THM}, 661
1535 - \item {\ptt ABS\_SIMP}, 614
1536 - \item {\ptt AC\_CONV}, 11
1537 - \item {\ptt ACCEPT\_TAC}, 9
1538 - \item {\ptt achieve\_first}, 10
1539 - \item {\ptt achieves}, 10
1540 - \item {\ptt aconv}, 10
1541 - \item {\ptt activate\_binders}, 11
1542 - \item {\ptt ADD}, 619
1543 - \item {\ptt ADD1}, 619
1544 - \item {\ptt ADD\_0}, 619
1545 - \item {\ptt ADD\_ASSOC}, 619
1546 - \item {\ptt ADD\_ASSUM}, 12
1547 - \item {\ptt ADD\_CLAUSES}, 619
1548 - \item {\ptt ADD\_CONV}, 13
1549 - \item {\ptt ADD\_EQ\_0}, 619
1550 - \item {\ptt ADD\_EQ\_SUB}, 619
1551 - \item {\ptt ADD\_INV\_0}, 619
1552 - \item {\ptt ADD\_INV\_0\_EQ}, 619
1553 - \item {\ptt ADD\_MONO\_LESS\_EQ}, 619
1554 - \item {\ptt ADD\_SUB}, 619
1555 - \item {\ptt ADD\_SUC}, 619
1556 - \item {\ptt ADD\_SYM}, 619
1557 - \item {\ptt ALL\_CONV}, 15
1558 - \item {\ptt ALL\_EL}, 634
1559 - \item {\ptt ALL\_EL\_APPEND}, 634
1560 - \item {\ptt ALL\_EL\_BUTFIRSTN}, 634
1561 - \item {\ptt ALL\_EL\_BUTLASTN}, 634
1562 - \item {\ptt ALL\_EL\_CONJ}, 634
1563 - \item {\ptt ALL\_EL\_CONV}, 15
1564 - \item {\ptt ALL\_EL\_FIRSTN}, 634
1565 - \item {\ptt ALL\_EL\_FOLDL}, 634
1566 - \item {\ptt ALL\_EL\_FOLDL\_MAP}, 634
1567 - \item {\ptt ALL\_EL\_FOLDR}, 634
1568 - \item {\ptt ALL\_EL\_FOLDR\_MAP}, 634
1569 - \item {\ptt ALL\_EL\_LASTN}, 634
1570 - \item {\ptt ALL\_EL\_MAP}, 634
1571 - \item {\ptt ALL\_EL\_REPLICATE}, 634
1572 - \item {\ptt ALL\_EL\_REVERSE}, 634
1573 - \item {\ptt ALL\_EL\_SEG}, 635
1574 - \item {\ptt ALL\_EL\_SNOC}, 635
1575 - \item {\ptt ALL\_TAC}, 16
1576 - \item {\ptt ALL\_THEN}, 17
1577 - \item {\ptt allowed\_constant}, 14
1578 - \item {\ptt ALPHA}, 17
1579 - \item {\ptt ALPHA\_CONV}, 18
1580 - \item {\ptt ancestors}, 19
1581 - \item {\ptt ancestry}, 19
1582 - \item {\ptt AND1\_THM}, 611
1583 - \item {\ptt AND2\_THM}, 611
1584 - \item {\ptt AND\_CLAUSES}, 611
1585 - \item {\ptt AND\_DEF}, 609
1586 - \item {\ptt AND\_EL\_DEF}, 635
1587 - \item {\ptt AND\_EL\_FOLDL}, 635
1588 - \item {\ptt AND\_EL\_FOLDR}, 635
1589 - \item {\ptt AND\_EXISTS\_CONV}, 20
1590 - \item {\ptt AND\_FORALL\_CONV}, 20
1591 - \item {\ptt AND\_IMP\_INTRO}, 611
1592 - \item {\ptt AND\_INTRO\_THM}, 611
1593 - \item {\ptt ANTE\_CONJ\_CONV}, 21
1594 - \item {\ptt ANTE\_RES\_THEN}, 21
1595 - \item {\ptt AP}, 635, 659
1596 - \item {\ptt AP\_TERM}, 25
1597 - \item {\ptt AP\_TERM\_TAC}, 25
1598 - \item {\ptt AP\_THM}, 26
1599 - \item {\ptt AP\_THM\_TAC}, 26
1600 - \item {\ptt APPEND}, 635
1601 - \item {\ptt append}, 22
1602 - \item {\ptt APPEND\_ASSOC}, 635
1603 - \item {\ptt APPEND\_BUTLAST\_LAST}, 635
1604 - \item {\ptt APPEND\_BUTLASTN\_BUTFIRSTN}, 635
1605 - \item {\ptt APPEND\_BUTLASTN\_LASTN}, 635
1606 - \item {\ptt APPEND\_CONV}, 23
1607 - \item {\ptt APPEND\_FIRSTN\_BUTFIRSTN}, 635
1608 - \item {\ptt APPEND\_FIRSTN\_LASTN}, 635
1609 - \item {\ptt APPEND\_FOLDL}, 635
1610 - \item {\ptt APPEND\_FOLDR}, 636
1611 - \item {\ptt APPEND\_LENGTH\_EQ}, 636
1612 - \item {\ptt APPEND\_NIL}, 636
1613 - \item {\ptt append\_openw}, 23
1614 - \item {\ptt APPEND\_SNOC}, 636
1615 - \item {\ptt apply\_proof}, 24
1616 - \item {\ptt ARB}, 610
1617 - \item {\ptt arb\_term}, 27
1618 - \item {\ptt ARB\_THM}, 610
1619 - \item {\ptt arity}, 27
1620 - \item {\ptt ascii}, 28
1621 - \item {\ptt ascii\_code}, 28
1622 - \item {\ptt ASM\_CASES\_TAC}, 29
1623 - \item {\ptt ASM\_REWRITE\_RULE}, 29
1624 - \item {\ptt ASM\_REWRITE\_TAC}, 30
1625 - \item {\ptt assert}, 31
1626 - \item {\ptt assignable\_print\_term}, 32
1627 - \item {\ptt assoc}, 34
1628 - \item {\ptt ASSOC\_ADD}, 619
1629 - \item {\ptt ASSOC\_APPEND}, 636
1630 - \item {\ptt ASSOC\_CONJ}, 614
1631 - \item {\ptt ASSOC\_DEF}, 614
1632 - \item {\ptt ASSOC\_DISJ}, 614
1633 - \item {\ptt ASSOC\_FOLDL\_FLAT}, 636
1634 - \item {\ptt ASSOC\_FOLDR\_FLAT}, 636
1635 - \item {\ptt ASSOC\_MULT}, 620
1636 - \item {\ptt associate\_restriction}, 34
1637 - \item {\ptt ASSUM\_LIST}, 38
1638 - \item {\ptt ASSUME}, 36
1639 - \item {\ptt ASSUME\_TAC}, 37
1640 - \item {\ptt attempt\_first}, 39
1641 - \item {\ptt autoload}, 39
1642 - \item {\ptt autoload\_theory}, 41
1643 - \item {\ptt axiom}, 41
1644 - \item {\ptt axiom\_lfn}, 43
1645 - \item {\ptt axiom\_msg\_lfn}, 44
1646 - \item {\ptt axioms}, 42
1647 -
1648 - \indexspace
1649 -
1650 - \item {\ptt B}, 44
1651 - \item {\ptt b}, 45
1652 - \item {\ptt backup}, 45
1653 - \item {\ptt backup\_limit}, 47
1654 - \item {\ptt backup\_list}, 50
1655 - \item {\ptt basic\_rewrites}, 50
1656 - \item {\ptt BETA\_CONV}, 52
1657 - \item {\ptt BETA\_RULE}, 52
1658 - \item {\ptt BETA\_TAC}, 53
1659 - \item {\ptt bht}, 659
1660 - \item {\ptt binders}, 54
1661 - \item {\ptt bndvar}, 55
1662 - \item {\ptt body}, 55
1663 - \item {\ptt BODY\_CONJUNCTS}, 55
1664 - \item {\ptt BOOL\_CASES\_AX}, 610
1665 - \item {\ptt BOOL\_CASES\_TAC}, 56
1666 - \item {\ptt bool\_EQ\_CONV}, 57
1667 - \item {\ptt BOOL\_EQ\_DISTINCT}, 611
1668 - \item {\ptt bool\_ty}, 58
1669 - \item {\ptt BUTFIRSTN}, 636
1670 - \item {\ptt BUTFIRSTN\_APPEND1}, 636
1671 - \item {\ptt BUTFIRSTN\_APPEND2}, 636
1672 - \item {\ptt BUTFIRSTN\_BUTFIRSTN}, 637
1673 - \item {\ptt BUTFIRSTN\_CONV}, 58
1674 - \item {\ptt BUTFIRSTN\_LASTN}, 637
1675 - \item {\ptt BUTFIRSTN\_LENGTH\_APPEND}, 637
1676 - \item {\ptt BUTFIRSTN\_LENGTH\_NIL}, 637
1677 - \item {\ptt BUTFIRSTN\_REVERSE}, 637
1678 - \item {\ptt BUTFIRSTN\_SEG}, 637
1679 - \item {\ptt BUTFIRSTN\_SNOC}, 637
1680 - \item {\ptt BUTLAST}, 637
1681 - \item {\ptt butlast}, 59
1682 - \item {\ptt BUTLAST\_CONV}, 60
1683 - \item {\ptt BUTLAST\_DEF}, 639
1684 - \item {\ptt BUTLASTN}, 637
1685 - \item {\ptt BUTLASTN\_1}, 637
1686 - \item {\ptt BUTLASTN\_APPEND1}, 637
1687 - \item {\ptt BUTLASTN\_APPEND2}, 637
1688 - \item {\ptt BUTLASTN\_BUTLAST}, 638
1689 - \item {\ptt BUTLASTN\_BUTLASTN}, 638
1690 - \item {\ptt BUTLASTN\_CONS}, 638
1691 - \item {\ptt BUTLASTN\_CONV}, 59
1692 - \item {\ptt BUTLASTN\_FIRSTN}, 638
1693 - \item {\ptt BUTLASTN\_LASTN}, 638
1694 - \item {\ptt BUTLASTN\_LASTN\_NIL}, 638
1695 - \item {\ptt BUTLASTN\_LENGTH\_APPEND}, 638
1696 - \item {\ptt BUTLASTN\_LENGTH\_CONS}, 638
1697 - \item {\ptt BUTLASTN\_LENGTH\_NIL}, 638
1698 - \item {\ptt BUTLASTN\_MAP}, 638
1699 - \item {\ptt BUTLASTN\_REVERSE}, 638
1700 - \item {\ptt BUTLASTN\_SEG}, 638
1701 - \item {\ptt BUTLASTN\_SUC\_BUTLAST}, 638
1702 -
1703 - \indexspace
1704 -
1705 - \item {\ptt C}, 60
1706 - \item {\ptt cached\_theories}, 61
1707 - \item {\ptt can}, 61
1708 - \item {\ptt CANCEL\_SUB}, 620
1709 - \item {\ptt CASES\_THENL}, 62
1710 - \item {\ptt CB}, 63
1711 - \item {\ptt CCONTR}, 63
1712 - \item {\ptt change\_state}, 65
1713 - \item {\ptt CHANGED\_CONV}, 64
1714 - \item {\ptt CHANGED\_TAC}, 65
1715 - \item {\ptt CHECK\_ASSUME\_TAC}, 65
1716 - \item {\ptt check\_lhs}, 66
1717 - \item {\ptt check\_specification}, 66
1718 - \item {\ptt check\_valid}, 67
1719 - \item {\ptt check\_varstruct}, 67
1720 - \item {\ptt chktac}, 67
1721 - \item {\ptt CHOOSE}, 68
1722 - \item {\ptt CHOOSE\_TAC}, 69
1723 - \item {\ptt CHOOSE\_THEN}, 70
1724 - \item {\ptt chop\_list}, 71
1725 - \item {\ptt close}, 72
1726 - \item {\ptt close\_theory}, 72
1727 - \item {\ptt Co}, 73
1728 - \item {\ptt com}, 73
1729 - \item {\ptt combine}, 74
1730 - \item {\ptt COMM\_ASSOC\_FOLDL\_REVERSE}, 639
1731 - \item {\ptt COMM\_ASSOC\_FOLDR\_REVERSE}, 639
1732 - \item {\ptt COMM\_DEF}, 615
1733 - \item {\ptt COMM\_MONOID\_FOLDL}, 639
1734 - \item {\ptt COMM\_MONOID\_FOLDR}, 639
1735 - \item {\ptt COMMA\_DEF}, 617
1736 - \item {\ptt compile}, 74
1737 - \item {\ptt compilef}, 76
1738 - \item {\ptt compilet}, 77
1739 - \item {\ptt compiling}, 77
1740 - \item {\ptt compiling\_stack}, 78
1741 - \item {\ptt concat}, 79
1742 - \item {\ptt concatl}, 79
1743 - \item {\ptt concl}, 80
1744 - \item {\ptt COND\_ABS}, 611
1745 - \item {\ptt COND\_CASES\_TAC}, 80
1746 - \item {\ptt COND\_CLAUSES}, 611
1747 - \item {\ptt COND\_CONV}, 82
1748 - \item {\ptt COND\_DEF}, 610
1749 - \item {\ptt COND\_EXPAND}, 611
1750 - \item {\ptt COND\_ID}, 611
1751 - \item {\ptt COND\_RAND}, 611
1752 - \item {\ptt COND\_RATOR}, 611
1753 - \item {\ptt CONJ}, 82
1754 - \item {\ptt CONJ\_ASSOC}, 611
1755 - \item {\ptt CONJ\_DISCH}, 88
1756 - \item {\ptt CONJ\_DISCHL}, 89
1757 - \item {\ptt CONJ\_LIST}, 90
1758 - \item {\ptt CONJ\_PAIR}, 91
1759 - \item {\ptt CONJ\_SET\_CONV}, 92
1760 - \item {\ptt CONJ\_SYM}, 612
1761 - \item {\ptt CONJ\_TAC}, 92
1762 - \item {\ptt CONJUNCT1}, 83
1763 - \item {\ptt CONJUNCT2}, 83
1764 - \item {\ptt CONJUNCTS}, 84
1765 - \item {\ptt conjuncts}, 84
1766 - \item {\ptt CONJUNCTS\_CONV}, 85
1767 - \item {\ptt CONJUNCTS\_THEN}, 86
1768 - \item {\ptt CONJUNCTS\_THEN2}, 87
1769 - \item {\ptt CONS}, 639
1770 - \item {\ptt CONS\_11}, 639
1771 - \item {\ptt CONS\_APPEND}, 639
1772 - \item {\ptt CONS\_DEF}, 639
1773 - \item {\ptt constants}, 93
1774 - \item {\ptt CONTR}, 94
1775 - \item {\ptt CONTR\_TAC}, 95
1776 - \item {\ptt CONTRAPOS}, 94
1777 - \item {\ptt CONTRAPOS\_CONV}, 95
1778 - \item {\ptt CONV\_RULE}, 96
1779 - \item {\ptt CONV\_TAC}, 96
1780 - \item {\ptt current\_theory}, 97
1781 - \item {\ptt curry}, 98
1782 - \item {\ptt CURRY\_DEF}, 617
1783 -
1784 - \indexspace
1785 -
1786 - \item {\ptt DA}, 620
1787 - \item {\ptt DE\_MORGAN\_THM}, 612
1788 - \item {\ptt DEF\_EXISTS\_RULE}, 108
1789 - \item {\ptt define\_finite\_set\_syntax}, 99
1790 - \item {\ptt define\_load\_lib\_function}, 100
1791 - \item {\ptt define\_new\_type\_bijections}, 101
1792 - \item {\ptt define\_set\_abstraction\_syntax}, 102
1793 - \item {\ptt define\_type}, 103
1794 - \item {\ptt definition}, 105
1795 - \item {\ptt definition\_lfn}, 107
1796 - \item {\ptt definition\_msg\_lfn}, 108
1797 - \item {\ptt definitions}, 106
1798 - \item {\ptt delete\_cache}, 109
1799 - \item {\ptt delete\_thm}, 110
1800 - \item {\ptt DEPTH\_CONV}, 111
1801 - \item {\ptt dest\_abs}, 112
1802 - \item {\ptt dest\_comb}, 113
1803 - \item {\ptt dest\_cond}, 113
1804 - \item {\ptt dest\_conj}, 114
1805 - \item {\ptt dest\_cons}, 114
1806 - \item {\ptt dest\_const}, 115
1807 - \item {\ptt dest\_definition}, 115
1808 - \item {\ptt dest\_disj}, 115
1809 - \item {\ptt dest\_eq}, 116
1810 - \item {\ptt dest\_exists}, 116
1811 - \item {\ptt dest\_forall}, 117
1812 - \item {\ptt dest\_form}, 117
1813 - \item {\ptt dest\_imp}, 118
1814 - \item {\ptt dest\_let}, 118
1815 - \item {\ptt dest\_list}, 119
1816 - \item {\ptt dest\_neg}, 119
1817 - \item {\ptt dest\_neg\_imp}, 120
1818 - \item {\ptt dest\_node}, 659
1819 - \item {\ptt dest\_pabs}, 121
1820 - \item {\ptt dest\_pair}, 121
1821 - \item {\ptt dest\_pred}, 122
1822 - \item {\ptt dest\_select}, 122
1823 - \item {\ptt dest\_thm}, 123
1824 - \item {\ptt dest\_type}, 123
1825 - \item {\ptt dest\_var}, 124
1826 - \item {\ptt dest\_vartype}, 124
1827 - \item {\ptt DISCARD\_TAC}, 125
1828 - \item {\ptt DISCH}, 126
1829 - \item {\ptt disch}, 126
1830 - \item {\ptt DISCH\_ALL}, 127
1831 - \item {\ptt DISCH\_TAC}, 127
1832 - \item {\ptt DISCH\_THEN}, 128
1833 - \item {\ptt DISJ1}, 129
1834 - \item {\ptt DISJ1\_TAC}, 130
1835 - \item {\ptt DISJ2}, 131
1836 - \item {\ptt DISJ2\_TAC}, 131
1837 - \item {\ptt DISJ\_ASSOC}, 612
1838 - \item {\ptt DISJ\_CASES}, 133
1839 - \item {\ptt DISJ\_CASES\_TAC}, 134
1840 - \item {\ptt DISJ\_CASES\_THEN}, 135
1841 - \item {\ptt DISJ\_CASES\_THEN2}, 136
1842 - \item {\ptt DISJ\_CASES\_THENL}, 138
1843 - \item {\ptt DISJ\_CASES\_UNION}, 139
1844 - \item {\ptt DISJ\_IMP}, 139
1845 - \item {\ptt DISJ\_SYM}, 612
1846 - \item {\ptt disjuncts}, 132
1847 - \item {\ptt distinct}, 140
1848 - \item {\ptt DIV\_LESS\_EQ}, 620
1849 - \item {\ptt DIV\_MULT}, 620
1850 - \item {\ptt DIV\_UNIQUE}, 620
1851 - \item {\ptt DIVISION}, 620
1852 - \item {\ptt do}, 141
1853 - \item {\ptt draft\_mode}, 142
1854 - \item {\ptt dropout}, 142
1855 -
1856 - \indexspace
1857 -
1858 - \item {\ptt e}, 143
1859 - \item {\ptt EL}, 639
1860 - \item {\ptt el}, 144
1861 - \item {\ptt EL\_APPEND1}, 641
1862 - \item {\ptt EL\_APPEND2}, 641
1863 - \item {\ptt EL\_CONS}, 641
1864 - \item {\ptt EL\_CONV}, 145
1865 - \item {\ptt EL\_ELL}, 641
1866 - \item {\ptt EL\_IS\_EL}, 641
1867 - \item {\ptt EL\_LENGTH\_APPEND}, 641
1868 - \item {\ptt EL\_LENGTH\_SNOC}, 641
1869 - \item {\ptt EL\_MAP}, 641
1870 - \item {\ptt EL\_PRE\_LENGTH}, 641
1871 - \item {\ptt EL\_REVERSE}, 641
1872 - \item {\ptt EL\_REVERSE\_ELL}, 641
1873 - \item {\ptt EL\_SEG}, 641
1874 - \item {\ptt EL\_SNOC}, 641
1875 - \item {\ptt ELL}, 639
1876 - \item {\ptt ELL\_0\_SNOC}, 639
1877 - \item {\ptt ELL\_APPEND1}, 639
1878 - \item {\ptt ELL\_APPEND2}, 640
1879 - \item {\ptt ELL\_CONS}, 640
1880 - \item {\ptt ELL\_CONV}, 145
1881 - \item {\ptt ELL\_EL}, 640
1882 - \item {\ptt ELL\_IS\_EL}, 640
1883 - \item {\ptt ELL\_LAST}, 640
1884 - \item {\ptt ELL\_LENGTH\_APPEND}, 640
1885 - \item {\ptt ELL\_LENGTH\_CONS}, 640
1886 - \item {\ptt ELL\_LENGTH\_SNOC}, 640
1887 - \item {\ptt ELL\_MAP}, 640
1888 - \item {\ptt ELL\_PRE\_LENGTH}, 640
1889 - \item {\ptt ELL\_REVERSE}, 640
1890 - \item {\ptt ELL\_REVERSE\_EL}, 640
1891 - \item {\ptt ELL\_SEG}, 640
1892 - \item {\ptt ELL\_SNOC}, 640
1893 - \item {\ptt ELL\_SUC\_SNOC}, 640
1894 - \item {\ptt end\_itlist}, 146
1895 - \item {\ptt enter\_form\_rep}, 147
1896 - \item {\ptt enter\_term}, 147
1897 - \item {\ptt enter\_term\_rep}, 147
1898 - \item {\ptt EQ\_CLAUSES}, 612
1899 - \item {\ptt EQ\_EXPAND}, 612
1900 - \item {\ptt EQ\_EXT}, 615
1901 - \item {\ptt EQ\_IMP\_RULE}, 149
1902 - \item {\ptt EQ\_IMP\_THM}, 612
1903 - \item {\ptt EQ\_LENGTH\_INDUCT\_TAC}, 150
1904 - \item {\ptt EQ\_LENGTH\_SNOC\_INDUCT\_TAC}, 151
1905 - \item {\ptt EQ\_LESS}, 620
1906 - \item {\ptt EQ\_LESS\_EQ}, 620
1907 - \item {\ptt EQ\_LIST}, 641
1908 - \item {\ptt EQ\_MONO\_ADD\_EQ}, 620
1909 - \item {\ptt EQ\_MP}, 152
1910 - \item {\ptt EQ\_REFL}, 612
1911 - \item {\ptt EQ\_SYM}, 612
1912 - \item {\ptt EQ\_SYM\_EQ}, 612
1913 - \item {\ptt EQ\_TAC}, 152
1914 - \item {\ptt EQ\_TRANS}, 612
1915 - \item {\ptt EQF\_ELIM}, 147
1916 - \item {\ptt EQF\_INTRO}, 148
1917 - \item {\ptt EQT\_ELIM}, 148
1918 - \item {\ptt EQT\_INTRO}, 149
1919 - \item {\ptt ETA\_AX}, 610
1920 - \item {\ptt ETA\_CONV}, 153
1921 - \item {\ptt EVEN}, 620
1922 - \item {\ptt EVEN\_ADD}, 620
1923 - \item {\ptt EVEN\_AND\_ODD}, 620
1924 - \item {\ptt EVEN\_DOUBLE}, 620
1925 - \item {\ptt EVEN\_EXISTS}, 620
1926 - \item {\ptt EVEN\_MULT}, 621
1927 - \item {\ptt EVEN\_ODD}, 621
1928 - \item {\ptt EVEN\_ODD\_EXISTS}, 621
1929 - \item {\ptt EVEN\_OR\_ODD}, 621
1930 - \item {\ptt EVERY}, 153
1931 - \item {\ptt EVERY\_ASSUM}, 154
1932 - \item {\ptt EVERY\_CONV}, 155
1933 - \item {\ptt EVERY\_TCL}, 155
1934 - \item {\ptt EXCLUDED\_MIDDLE}, 612
1935 - \item {\ptt EXISTENCE}, 156
1936 - \item {\ptt EXISTS}, 157
1937 - \item {\ptt exists}, 157
1938 - \item {\ptt EXISTS\_AND\_CONV}, 158
1939 - \item {\ptt EXISTS\_DEF}, 609
1940 - \item {\ptt EXISTS\_EQ}, 159
1941 - \item {\ptt EXISTS\_GREATEST\_CONV}, 159
1942 - \item {\ptt EXISTS\_IMP}, 160
1943 - \item {\ptt EXISTS\_IMP\_CONV}, 160
1944 - \item {\ptt EXISTS\_LEAST\_CONV}, 161
1945 - \item {\ptt EXISTS\_NOT\_CONV}, 162
1946 - \item {\ptt EXISTS\_OR\_CONV}, 162
1947 - \item {\ptt EXISTS\_SIMP}, 612
1948 - \item {\ptt EXISTS\_TAC}, 163
1949 - \item {\ptt exists\_TRP}, 661
1950 - \item {\ptt EXISTS\_UNIQUE\_CONV}, 164
1951 - \item {\ptt EXISTS\_UNIQUE\_DEF}, 609
1952 - \item {\ptt EXP}, 621
1953 - \item {\ptt EXP\_ADD}, 621
1954 - \item {\ptt expand}, 164
1955 - \item {\ptt expandf}, 167
1956 - \item {\ptt explode}, 169
1957 - \item {\ptt EXT}, 169
1958 - \item {\ptt extend\_theory}, 170
1959 -
1960 - \indexspace
1961 -
1962 - \item {\ptt F\_DEF}, 609
1963 - \item {\ptt F\_IMP}, 613
1964 - \item {\ptt FACT}, 621
1965 - \item {\ptt FACT\_LESS}, 621
1966 - \item {\ptt FAIL\_TAC}, 171
1967 - \item {\ptt FALSITY}, 612
1968 - \item {\ptt falsity}, 172
1969 - \item {\ptt fast\_arith}, 172
1970 - \item {\ptt FCOMM\_ASSOC}, 615
1971 - \item {\ptt FCOMM\_DEF}, 615
1972 - \item {\ptt FCOMM\_FOLDL\_APPEND}, 642
1973 - \item {\ptt FCOMM\_FOLDL\_FLAT}, 642
1974 - \item {\ptt FCOMM\_FOLDR\_APPEND}, 642
1975 - \item {\ptt FCOMM\_FOLDR\_FLAT}, 642
1976 - \item {\ptt FILTER}, 642
1977 - \item {\ptt filter}, 173
1978 - \item {\ptt FILTER\_APPEND}, 642
1979 - \item {\ptt FILTER\_ASM\_REWRITE\_RULE}, 174
1980 - \item {\ptt FILTER\_ASM\_REWRITE\_TAC}, 174
1981 - \item {\ptt FILTER\_COMM}, 642
1982 - \item {\ptt FILTER\_CONV}, 175
1983 - \item {\ptt FILTER\_DISCH\_TAC}, 176
1984 - \item {\ptt FILTER\_DISCH\_THEN}, 177
1985 - \item {\ptt FILTER\_FILTER}, 642
1986 - \item {\ptt FILTER\_FLAT}, 642
1987 - \item {\ptt FILTER\_FOLDL}, 642
1988 - \item {\ptt FILTER\_FOLDR}, 643
1989 - \item {\ptt FILTER\_GEN\_TAC}, 178
1990 - \item {\ptt FILTER\_IDEM}, 643
1991 - \item {\ptt FILTER\_MAP}, 643
1992 - \item {\ptt FILTER\_ONCE\_ASM\_REWRITE\_RULE}, 179
1993 - \item {\ptt FILTER\_ONCE\_ASM\_REWRITE\_TAC}, 180
1994 - \item {\ptt FILTER\_PURE\_ASM\_REWRITE\_RULE}, 180
1995 - \item {\ptt FILTER\_PURE\_ASM\_REWRITE\_TAC}, 181
1996 - \item {\ptt FILTER\_PURE\_ONCE\_ASM\_REWRITE\_RULE}, 182
1997 - \item {\ptt FILTER\_PURE\_ONCE\_ASM\_REWRITE\_TAC}, 183
1998 - \item {\ptt FILTER\_REVERSE}, 643
1999 - \item {\ptt FILTER\_SNOC}, 643
2000 - \item {\ptt FILTER\_STRIP\_TAC}, 183
2001 - \item {\ptt FILTER\_STRIP\_THEN}, 185
2002 - \item {\ptt find}, 186
2003 - \item {\ptt find\_file}, 187
2004 - \item {\ptt find\_match}, 187
2005 - \item {\ptt find\_ml\_file}, 188
2006 - \item {\ptt find\_term}, 189
2007 - \item {\ptt find\_terms}, 190
2008 - \item {\ptt find\_theory}, 190
2009 - \item {\ptt FIRST}, 191
2010 - \item {\ptt FIRST\_ASSUM}, 192
2011 - \item {\ptt FIRST\_CONV}, 193
2012 - \item {\ptt FIRST\_TCL}, 193
2013 - \item {\ptt FIRSTN}, 643
2014 - \item {\ptt FIRSTN\_APPEND1}, 643
2015 - \item {\ptt FIRSTN\_APPEND2}, 643
2016 - \item {\ptt FIRSTN\_BUTLASTN}, 643
2017 - \item {\ptt FIRSTN\_CONV}, 191
2018 - \item {\ptt FIRSTN\_FIRSTN}, 643
2019 - \item {\ptt FIRSTN\_LENGTH\_APPEND}, 643
2020 - \item {\ptt FIRSTN\_LENGTH\_ID}, 643
2021 - \item {\ptt FIRSTN\_REVERSE}, 643
2022 - \item {\ptt FIRSTN\_SEG}, 643
2023 - \item {\ptt FIRSTN\_SNOC}, 644
2024 - \item {\ptt flags}, 194
2025 - \item {\ptt FLAT}, 644
2026 - \item {\ptt flat}, 194
2027 - \item {\ptt FLAT\_APPEND}, 644
2028 - \item {\ptt FLAT\_CONV}, 195
2029 - \item {\ptt FLAT\_FLAT}, 644
2030 - \item {\ptt FLAT\_FOLDL}, 644
2031 - \item {\ptt FLAT\_FOLDR}, 644
2032 - \item {\ptt FLAT\_REVERSE}, 644
2033 - \item {\ptt FLAT\_SNOC}, 644
2034 - \item {\ptt FOLDL}, 644
2035 - \item {\ptt FOLDL\_APPEND}, 644
2036 - \item {\ptt FOLDL\_CONV}, 196
2037 - \item {\ptt FOLDL\_FILTER}, 644
2038 - \item {\ptt FOLDL\_FOLDR\_REVERSE}, 644
2039 - \item {\ptt FOLDL\_MAP}, 644
2040 - \item {\ptt FOLDL\_REVERSE}, 644
2041 - \item {\ptt FOLDL\_SINGLE}, 644
2042 - \item {\ptt FOLDL\_SNOC}, 645
2043 - \item {\ptt FOLDL\_SNOC\_NIL}, 645
2044 - \item {\ptt FOLDR}, 645
2045 - \item {\ptt FOLDR\_APPEND}, 645
2046 - \item {\ptt FOLDR\_CONS\_NIL}, 645
2047 - \item {\ptt FOLDR\_CONV}, 197
2048 - \item {\ptt FOLDR\_FILTER}, 645
2049 - \item {\ptt FOLDR\_FILTER\_REVERSE}, 645
2050 - \item {\ptt FOLDR\_FOLDL}, 645
2051 - \item {\ptt FOLDR\_FOLDL\_REVERSE}, 645
2052 - \item {\ptt FOLDR\_MAP}, 645
2053 - \item {\ptt FOLDR\_MAP\_REVERSE}, 645
2054 - \item {\ptt FOLDR\_REVERSE}, 645
2055 - \item {\ptt FOLDR\_SINGLE}, 645
2056 - \item {\ptt FOLDR\_SNOC}, 645
2057 - \item {\ptt forall}, 198
2058 - \item {\ptt FORALL\_AND\_CONV}, 199
2059 - \item {\ptt FORALL\_DEF}, 609
2060 - \item {\ptt FORALL\_EQ}, 199
2061 - \item {\ptt FORALL\_IMP\_CONV}, 200
2062 - \item {\ptt FORALL\_NOT\_CONV}, 201
2063 - \item {\ptt FORALL\_OR\_CONV}, 201
2064 - \item {\ptt FORALL\_SIMP}, 612
2065 - \item {\ptt free\_in}, 205
2066 - \item {\ptt frees}, 202
2067 - \item {\ptt freesl}, 203
2068 - \item {\ptt FREEZE\_THEN}, 203
2069 - \item {\ptt FRONT\_CONJ\_CONV}, 205
2070 - \item {\ptt FST}, 617
2071 - \item {\ptt fst}, 206
2072 - \item {\ptt FST\_DEF}, 617
2073 - \item {\ptt FUN\_EQ\_CONV}, 207
2074 - \item {\ptt FUN\_EQ\_LEMMA}, 615, 621
2075 - \item {\ptt funpow}, 206
2076 -
2077 - \indexspace
2078 -
2079 - \item {\ptt g}, 208
2080 - \item {\ptt GEN}, 209
2081 - \item {\ptt GEN\_ALL}, 211
2082 - \item {\ptt GEN\_ALPHA\_CONV}, 212
2083 - \item {\ptt GEN\_BETA\_CONV}, 213
2084 - \item {\ptt GEN\_REWRITE\_CONV}, 214
2085 - \item {\ptt GEN\_REWRITE\_RULE}, 215
2086 - \item {\ptt GEN\_REWRITE\_TAC}, 217
2087 - \item {\ptt GEN\_TAC}, 219
2088 - \item {\ptt GENL}, 210
2089 - \item {\ptt GENLIST}, 646
2090 - \item {\ptt genvar}, 210
2091 - \item {\ptt get\_const\_type}, 220
2092 - \item {\ptt get\_flag\_value}, 221
2093 - \item {\ptt get\_state}, 221
2094 - \item {\ptt get\_steps}, 222
2095 - \item {\ptt get\_type}, 224
2096 - \item {\ptt getenv}, 219
2097 - \item {\ptt goals}, 224
2098 - \item {\ptt GREATER}, 621
2099 - \item {\ptt GREATER\_EQ}, 621
2100 - \item {\ptt GREATER\_OR\_EQ}, 621
2101 - \item {\ptt GSPEC}, 224
2102 - \item {\ptt GSUBST\_TAC}, 225
2103 - \item {\ptt GSYM}, 226
2104 -
2105 - \indexspace
2106 -
2107 - \item {\ptt HALF\_MK\_ABS}, 227
2108 - \item {\ptt HD}, 646
2109 - \item {\ptt hd}, 227
2110 - \item {\ptt help}, 228
2111 - \item {\ptt help\_search\_path}, 228
2112 - \item {\ptt hide\_constant}, 229
2113 - \item {\ptt hol\_pathname}, 229
2114 - \item {\ptt host\_name}, 230
2115 - \item {\ptt HT}, 659
2116 - \item {\ptt hyp}, 231
2117 - \item {\ptt hyp\_union}, 231
2118 -
2119 - \indexspace
2120 -
2121 - \item {\ptt I}, 232
2122 - \item {\ptt I\_DEF}, 616
2123 - \item {\ptt I\_o\_ID}, 616
2124 - \item {\ptt I\_THM}, 616
2125 - \item {\ptt IMP\_ANTISYM\_AX}, 610
2126 - \item {\ptt IMP\_ANTISYM\_RULE}, 233
2127 - \item {\ptt IMP\_CANON}, 234
2128 - \item {\ptt IMP\_CLAUSES}, 613
2129 - \item {\ptt IMP\_CONJ}, 234
2130 - \item {\ptt IMP\_DISJ\_THM}, 613
2131 - \item {\ptt IMP\_ELIM}, 235
2132 - \item {\ptt IMP\_F}, 613
2133 - \item {\ptt IMP\_F\_EQ\_F}, 613
2134 - \item {\ptt IMP\_RES\_TAC}, 236
2135 - \item {\ptt IMP\_RES\_THEN}, 237
2136 - \item {\ptt IMP\_TRANS}, 238
2137 - \item {\ptt implode}, 232
2138 - \item {\ptt INDUCT}, 239
2139 - \item {\ptt INDUCT\_TAC}, 240
2140 - \item {\ptt INDUCT\_THEN}, 240
2141 - \item {\ptt INDUCTION}, 621
2142 - \item {\ptt INFINITY\_AX}, 610
2143 - \item {\ptt infix\_variable}, 243
2144 - \item {\ptt infixes}, 242
2145 - \item {\ptt inject\_input}, 244
2146 - \item {\ptt INL}, 618
2147 - \item {\ptt inl}, 245
2148 - \item {\ptt INL\_DEF}, 618
2149 - \item {\ptt INR}, 618
2150 - \item {\ptt inr}, 245
2151 - \item {\ptt INR\_DEF}, 618
2152 - \item {\ptt INST}, 246
2153 - \item {\ptt inst}, 247
2154 - \item {\ptt inst\_check}, 248
2155 - \item {\ptt inst\_rename\_list}, 249
2156 - \item {\ptt INST\_TY\_TERM}, 252
2157 - \item {\ptt INST\_TYPE}, 250
2158 - \item {\ptt inst\_type}, 251
2159 - \item {\ptt install}, 248
2160 - \item {\ptt int\_of\_string}, 254
2161 - \item {\ptt int\_of\_term}, 254
2162 - \item {\ptt interface\_map}, 252
2163 - \item {\ptt intersect}, 253
2164 - \item {\ptt INV\_PRE\_EQ}, 621
2165 - \item {\ptt INV\_PRE\_LESS}, 621
2166 - \item {\ptt INV\_PRE\_LESS\_EQ}, 621
2167 - \item {\ptt INV\_SUC}, 622
2168 - \item {\ptt INV\_SUC\_EQ}, 622
2169 - \item {\ptt is\_abs}, 256
2170 - \item {\ptt is\_alphanum}, 257
2171 - \item {\ptt IS\_ASSUMPTION\_OF}, 613
2172 - \item {\ptt is\_axiom}, 257
2173 - \item {\ptt is\_binder}, 258
2174 - \item {\ptt is\_binder\_type}, 259
2175 - \item {\ptt is\_comb}, 259
2176 - \item {\ptt is\_cond}, 260
2177 - \item {\ptt is\_conj}, 260
2178 - \item {\ptt is\_cons}, 261
2179 - \item {\ptt is\_const}, 261
2180 - \item {\ptt is\_constant}, 262
2181 - \item {\ptt is\_definition}, 262
2182 - \item {\ptt is\_disj}, 263
2183 - \item {\ptt IS\_EL}, 646
2184 - \item {\ptt IS\_EL\_APPEND}, 646
2185 - \item {\ptt IS\_EL\_BUTFIRSTN}, 646
2186 - \item {\ptt IS\_EL\_BUTLASTN}, 646
2187 - \item {\ptt IS\_EL\_CONV}, 263
2188 - \item {\ptt IS\_EL\_DEF}, 646
2189 - \item {\ptt IS\_EL\_FILTER}, 646
2190 - \item {\ptt IS\_EL\_FIRSTN}, 646
2191 - \item {\ptt IS\_EL\_FOLDL}, 646
2192 - \item {\ptt IS\_EL\_FOLDL\_MAP}, 646
2193 - \item {\ptt IS\_EL\_FOLDR}, 646
2194 - \item {\ptt IS\_EL\_FOLDR\_MAP}, 646
2195 - \item {\ptt IS\_EL\_LASTN}, 646
2196 - \item {\ptt IS\_EL\_REPLICATE}, 646
2197 - \item {\ptt IS\_EL\_REVERSE}, 647
2198 - \item {\ptt IS\_EL\_SEG}, 647
2199 - \item {\ptt IS\_EL\_SNOC}, 647
2200 - \item {\ptt IS\_EL\_SOME\_EL}, 647
2201 - \item {\ptt is\_eq}, 264
2202 - \item {\ptt is\_exists}, 264
2203 - \item {\ptt is\_forall}, 265
2204 - \item {\ptt is\_hidden}, 265
2205 - \item {\ptt is\_imp}, 266
2206 - \item {\ptt is\_infix}, 267
2207 - \item {\ptt is\_infix\_type}, 267
2208 - \item {\ptt is\_let}, 268
2209 - \item {\ptt is\_letter}, 269
2210 - \item {\ptt is\_list}, 269
2211 - \item {\ptt IS\_list\_REP}, 647
2212 - \item {\ptt Is\_ltree}, 659
2213 - \item {\ptt is\_ml\_curried\_infix}, 270
2214 - \item {\ptt is\_ml\_infix}, 270
2215 - \item {\ptt is\_ml\_paired\_infix}, 271
2216 - \item {\ptt is\_neg}, 271
2217 - \item {\ptt is\_neg\_imp}, 272
2218 - \item {\ptt IS\_NUM\_REP}, 622
2219 - \item {\ptt is\_pabs}, 272
2220 - \item {\ptt is\_pair}, 273
2221 - \item {\ptt IS\_PAIR\_DEF}, 617
2222 - \item {\ptt is\_pred}, 273
2223 - \item {\ptt IS\_PREFIX}, 647
2224 - \item {\ptt IS\_PREFIX\_APPEND}, 647
2225 - \item {\ptt IS\_PREFIX\_IS\_SUBLIST}, 647
2226 - \item {\ptt IS\_PREFIX\_PREFIX}, 647
2227 - \item {\ptt IS\_PREFIX\_REVERSE}, 647
2228 - \item {\ptt is\_recording\_proof}, 274
2229 - \item {\ptt is\_select}, 274
2230 - \item {\ptt IS\_SUBLIST}, 647
2231 - \item {\ptt IS\_SUBLIST\_APPEND}, 647
2232 - \item {\ptt IS\_SUBLIST\_REVERSE}, 647
2233 - \item {\ptt IS\_SUFFIX}, 648
2234 - \item {\ptt IS\_SUFFIX\_APPEND}, 648
2235 - \item {\ptt IS\_SUFFIX\_IS\_SUBLIST}, 648
2236 - \item {\ptt IS\_SUFFIX\_REVERSE}, 648
2237 - \item {\ptt IS\_SUM\_REP}, 618
2238 - \item {\ptt Is\_tree\_REP}, 659
2239 - \item {\ptt is\_type}, 275
2240 - \item {\ptt is\_var}, 275
2241 - \item {\ptt is\_vartype}, 276
2242 - \item {\ptt ISL}, 618
2243 - \item {\ptt isl}, 255
2244 - \item {\ptt ISL\_OR\_ISR}, 618
2245 - \item {\ptt ISPEC}, 255
2246 - \item {\ptt ISPECL}, 256
2247 - \item {\ptt ISR}, 618
2248 - \item {\ptt it}, 276
2249 - \item {\ptt itlist}, 277
2250 - \item {\ptt itlist2}, 278
2251 -
2252 - \indexspace
2253 -
2254 - \item {\ptt K}, 278
2255 - \item {\ptt K\_DEF}, 616
2256 - \item {\ptt K\_THM}, 616
2257 - \item {\ptt KI}, 279
2258 -
2259 - \indexspace
2260 -
2261 - \item {\ptt LAST}, 648
2262 - \item {\ptt last}, 279
2263 - \item {\ptt LAST\_CONV}, 280
2264 - \item {\ptt LAST\_DEF}, 649
2265 - \item {\ptt LAST\_LASTN\_LAST}, 649
2266 - \item {\ptt LASTN}, 648
2267 - \item {\ptt LASTN\_1}, 648
2268 - \item {\ptt LASTN\_APPEND1}, 648
2269 - \item {\ptt LASTN\_APPEND2}, 648
2270 - \item {\ptt LASTN\_BUTFIRSTN}, 648
2271 - \item {\ptt LASTN\_BUTLASTN}, 648
2272 - \item {\ptt LASTN\_CONS}, 648
2273 - \item {\ptt LASTN\_CONV}, 280
2274 - \item {\ptt LASTN\_LASTN}, 648
2275 - \item {\ptt LASTN\_LENGTH\_APPEND}, 649
2276 - \item {\ptt LASTN\_LENGTH\_ID}, 649
2277 - \item {\ptt LASTN\_MAP}, 649
2278 - \item {\ptt LASTN\_REVERSE}, 649
2279 - \item {\ptt LASTN\_SEG}, 649
2280 - \item {\ptt LEFT\_ADD\_DISTRIB}, 622
2281 - \item {\ptt LEFT\_AND\_EXISTS\_CONV}, 281
2282 - \item {\ptt LEFT\_AND\_FORALL\_CONV}, 281
2283 - \item {\ptt LEFT\_AND\_OVER\_OR}, 613
2284 - \item {\ptt LEFT\_ID\_ADD\_0}, 622
2285 - \item {\ptt LEFT\_ID\_DEF}, 615
2286 - \item {\ptt LEFT\_ID\_MULT\_1}, 622
2287 - \item {\ptt LEFT\_IMP\_EXISTS\_CONV}, 282
2288 - \item {\ptt LEFT\_IMP\_FORALL\_CONV}, 282
2289 - \item {\ptt LEFT\_OR\_EXISTS\_CONV}, 283
2290 - \item {\ptt LEFT\_OR\_FORALL\_CONV}, 283
2291 - \item {\ptt LEFT\_OR\_OVER\_AND}, 613
2292 - \item {\ptt LEFT\_SUB\_DISTRIB}, 622
2293 - \item {\ptt LENGTH}, 649
2294 - \item {\ptt length}, 284
2295 - \item {\ptt LENGTH\_APPEND}, 649
2296 - \item {\ptt LENGTH\_BUTFIRSTN}, 649
2297 - \item {\ptt LENGTH\_BUTLAST}, 649
2298 - \item {\ptt LENGTH\_BUTLASTN}, 649
2299 - \item {\ptt LENGTH\_CONS}, 649
2300 - \item {\ptt LENGTH\_CONV}, 284
2301 - \item {\ptt LENGTH\_EQ}, 649
2302 - \item {\ptt LENGTH\_EQ\_CONS}, 649
2303 - \item {\ptt LENGTH\_EQ\_NIL}, 650
2304 - \item {\ptt LENGTH\_FIRSTN}, 650
2305 - \item {\ptt LENGTH\_FLAT}, 650
2306 - \item {\ptt LENGTH\_FOLDL}, 650
2307 - \item {\ptt LENGTH\_FOLDR}, 650
2308 - \item {\ptt LENGTH\_GENLIST}, 650
2309 - \item {\ptt LENGTH\_LASTN}, 650
2310 - \item {\ptt LENGTH\_MAP}, 650
2311 - \item {\ptt LENGTH\_MAP2}, 650
2312 - \item {\ptt LENGTH\_NIL}, 650
2313 - \item {\ptt LENGTH\_NOT\_NULL}, 650
2314 - \item {\ptt LENGTH\_REPLICATE}, 650
2315 - \item {\ptt LENGTH\_REVERSE}, 650
2316 - \item {\ptt LENGTH\_SCANL}, 650
2317 - \item {\ptt LENGTH\_SCANR}, 651
2318 - \item {\ptt LENGTH\_SEG}, 651
2319 - \item {\ptt LENGTH\_SNOC}, 651
2320 - \item {\ptt LENGTH\_UNZIP\_FST}, 651
2321 - \item {\ptt LENGTH\_UNZIP\_SND}, 651
2322 - \item {\ptt LENGTH\_ZIP}, 651
2323 - \item {\ptt LESS}, 622
2324 - \item {\ptt LESS\_0}, 622
2325 - \item {\ptt LESS\_0\_0}, 622
2326 - \item {\ptt LESS\_0\_CASES}, 622
2327 - \item {\ptt LESS\_ADD}, 622
2328 - \item {\ptt LESS\_ADD\_1}, 622
2329 - \item {\ptt LESS\_ADD\_NONZERO}, 622
2330 - \item {\ptt LESS\_ADD\_SUC}, 622
2331 - \item {\ptt LESS\_ANTISYM}, 623
2332 - \item {\ptt LESS\_CASES}, 623
2333 - \item {\ptt LESS\_CASES\_IMP}, 623
2334 - \item {\ptt LESS\_EQ}, 623
2335 - \item {\ptt LESS\_EQ\_0}, 623
2336 - \item {\ptt LESS\_EQ\_ADD}, 623
2337 - \item {\ptt LESS\_EQ\_ADD\_SUB}, 623
2338 - \item {\ptt LESS\_EQ\_ANTISYM}, 623
2339 - \item {\ptt LESS\_EQ\_CASES}, 623
2340 - \item {\ptt LESS\_EQ\_EXISTS}, 623
2341 - \item {\ptt LESS\_EQ\_IMP\_LESS\_SUC}, 623
2342 - \item {\ptt LESS\_EQ\_LESS\_EQ\_MONO}, 623
2343 - \item {\ptt LESS\_EQ\_LESS\_TRANS}, 623
2344 - \item {\ptt LESS\_EQ\_MONO}, 623
2345 - \item {\ptt LESS\_EQ\_MONO\_ADD\_EQ}, 624
2346 - \item {\ptt LESS\_EQ\_REFL}, 624
2347 - \item {\ptt LESS\_EQ\_SUB\_LESS}, 624
2348 - \item {\ptt LESS\_EQ\_SUC\_REFL}, 624
2349 - \item {\ptt LESS\_EQ\_TRANS}, 624
2350 - \item {\ptt LESS\_EQUAL\_ADD}, 623
2351 - \item {\ptt LESS\_EQUAL\_ANTISYM}, 623
2352 - \item {\ptt LESS\_EXP\_SUC\_MONO}, 624
2353 - \item {\ptt LESS\_IMP\_LESS\_ADD}, 624
2354 - \item {\ptt LESS\_IMP\_LESS\_OR\_EQ}, 624
2355 - \item {\ptt LESS\_LEMMA1}, 624
2356 - \item {\ptt LESS\_LEMMA2}, 624
2357 - \item {\ptt LESS\_LESS\_CASES}, 624
2358 - \item {\ptt LESS\_LESS\_EQ\_TRANS}, 624
2359 - \item {\ptt LESS\_LESS\_SUC}, 624
2360 - \item {\ptt LESS\_MOD}, 624
2361 - \item {\ptt LESS\_MONO}, 624
2362 - \item {\ptt LESS\_MONO\_ADD}, 624
2363 - \item {\ptt LESS\_MONO\_ADD\_EQ}, 625
2364 - \item {\ptt LESS\_MONO\_ADD\_INV}, 625
2365 - \item {\ptt LESS\_MONO\_EQ}, 625
2366 - \item {\ptt LESS\_MONO\_MULT}, 625
2367 - \item {\ptt LESS\_MONO\_REV}, 625
2368 - \item {\ptt LESS\_MULT2}, 625
2369 - \item {\ptt LESS\_MULT\_MONO}, 625
2370 - \item {\ptt LESS\_NOT\_EQ}, 625
2371 - \item {\ptt LESS\_NOT\_SUC}, 625
2372 - \item {\ptt LESS\_OR}, 625
2373 - \item {\ptt LESS\_OR\_EQ}, 625
2374 - \item {\ptt LESS\_OR\_EQ\_ADD}, 625
2375 - \item {\ptt LESS\_REFL}, 625
2376 - \item {\ptt LESS\_SUB\_ADD\_LESS}, 625
2377 - \item {\ptt LESS\_SUC}, 625
2378 - \item {\ptt LESS\_SUC\_EQ\_COR}, 625
2379 - \item {\ptt LESS\_SUC\_IMP}, 626
2380 - \item {\ptt LESS\_SUC\_NOT}, 626
2381 - \item {\ptt LESS\_SUC\_REFL}, 626
2382 - \item {\ptt LESS\_SUC\_SUC}, 626
2383 - \item {\ptt LESS\_THM}, 626
2384 - \item {\ptt LESS\_TRANS}, 626
2385 - \item {\ptt let\_after}, 285
2386 - \item {\ptt let\_before}, 286
2387 - \item {\ptt let\_CONV}, 287
2388 - \item {\ptt LET\_DEF}, 610
2389 - \item {\ptt lhs}, 289
2390 - \item {\ptt libraries}, 290
2391 - \item {\ptt library\_loader}, 290
2392 - \item {\ptt library\_pathname}, 292
2393 - \item {\ptt library\_search\_path}, 293
2394 - \item {\ptt link}, 294
2395 - \item {\ptt lisp}, 294
2396 - \item {\ptt lisp\_dir\_pathname}, 295
2397 - \item {\ptt list\_Axiom}, 651
2398 - \item {\ptt LIST\_BETA\_CONV}, 296
2399 - \item {\ptt list\_CASES}, 651
2400 - \item {\ptt LIST\_CONJ}, 297
2401 - \item {\ptt list\_EQ\_CONV}, 297
2402 - \item {\ptt list\_FOLD\_CONV}, 298
2403 - \item {\ptt LIST\_INDUCT}, 299
2404 - \item {\ptt list\_INDUCT}, 651
2405 - \item {\ptt LIST\_INDUCT\_TAC}, 300
2406 - \item {\ptt list\_ISO\_DEF}, 651
2407 - \item {\ptt list\_mk\_abs}, 301
2408 - \item {\ptt list\_mk\_comb}, 301
2409 - \item {\ptt list\_mk\_conj}, 302
2410 - \item {\ptt list\_mk\_disj}, 303
2411 - \item {\ptt LIST\_MK\_EXISTS}, 304
2412 - \item {\ptt list\_mk\_exists}, 304
2413 - \item {\ptt list\_mk\_forall}, 305
2414 - \item {\ptt list\_mk\_imp}, 305
2415 - \item {\ptt list\_mk\_pair}, 306
2416 - \item {\ptt LIST\_MP}, 307
2417 - \item {\ptt LIST\_NOT\_EQ}, 651
2418 - \item {\ptt list\_of\_binders}, 307
2419 - \item {\ptt list\_TY\_DEF}, 651
2420 - \item {\ptt load}, 308
2421 - \item {\ptt load\_axiom}, 310
2422 - \item {\ptt load\_axioms}, 311
2423 - \item {\ptt load\_definition}, 312
2424 - \item {\ptt load\_definitions}, 313
2425 - \item {\ptt load\_library}, 314
2426 - \item {\ptt load\_theorem}, 315
2427 - \item {\ptt load\_theorems}, 316
2428 - \item {\ptt load\_theory}, 317
2429 - \item {\ptt loadf}, 308
2430 - \item {\ptt loadt}, 309
2431 - \item {\ptt lookup\_form\_rep}, 318
2432 - \item {\ptt lookup\_term}, 318
2433 - \item {\ptt lookup\_term\_rep}, 318
2434 - \item {\ptt lsp}, 319
2435 - \item {\ptt ltree\_Axiom}, 659
2436 - \item {\ptt ltree\_Induct}, 659
2437 - \item {\ptt ltree\_ISO\_DEF}, 659
2438 - \item {\ptt ltree\_TY\_DEF}, 660
2439 -
2440 - \indexspace
2441 -
2442 - \item {\ptt MAP}, 651
2443 - \item {\ptt map}, 320
2444 - \item {\ptt MAP2}, 651
2445 - \item {\ptt map2}, 320
2446 - \item {\ptt MAP2\_CONV}, 321
2447 - \item {\ptt MAP2\_ZIP}, 652
2448 - \item {\ptt MAP\_APPEND}, 652
2449 - \item {\ptt MAP\_CONV}, 323
2450 - \item {\ptt MAP\_EVERY}, 324
2451 - \item {\ptt MAP\_FILTER}, 652
2452 - \item {\ptt MAP\_FIRST}, 325
2453 - \item {\ptt MAP\_FLAT}, 652
2454 - \item {\ptt MAP\_FOLDL}, 652
2455 - \item {\ptt MAP\_FOLDR}, 652
2456 - \item {\ptt MAP\_MAP\_o}, 652
2457 - \item {\ptt MAP\_o}, 652
2458 - \item {\ptt MAP\_REVERSE}, 652
2459 - \item {\ptt MAP\_SNOC}, 652
2460 - \item {\ptt mapfilter}, 322
2461 - \item {\ptt maptok}, 322
2462 - \item {\ptt match}, 326
2463 - \item {\ptt MATCH\_ACCEPT\_TAC}, 327
2464 - \item {\ptt MATCH\_MP}, 328
2465 - \item {\ptt MATCH\_MP\_TAC}, 329
2466 - \item {\ptt max\_print\_depth}, 330
2467 - \item {\ptt mem}, 331
2468 - \item {\ptt merge\_nets\_rep}, 331
2469 - \item {\ptt merge\_term\_nets}, 332
2470 - \item {\ptt message}, 332
2471 - \item {\ptt MK\_ABS}, 333
2472 - \item {\ptt mk\_abs}, 333
2473 - \item {\ptt MK\_COMB}, 334
2474 - \item {\ptt mk\_comb}, 334
2475 - \item {\ptt mk\_cond}, 335
2476 - \item {\ptt mk\_conj}, 335
2477 - \item {\ptt mk\_cons}, 336
2478 - \item {\ptt mk\_const}, 336
2479 - \item {\ptt mk\_conv\_net}, 337
2480 - \item {\ptt mk\_definition}, 337
2481 - \item {\ptt mk\_disj}, 337
2482 - \item {\ptt mk\_eq}, 338
2483 - \item {\ptt MK\_EXISTS}, 338
2484 - \item {\ptt mk\_exists}, 339
2485 - \item {\ptt mk\_forall}, 339
2486 - \item {\ptt mk\_form}, 340
2487 - \item {\ptt mk\_imp}, 340
2488 - \item {\ptt mk\_let}, 340
2489 - \item {\ptt mk\_list}, 341
2490 - \item {\ptt mk\_neg}, 342
2491 - \item {\ptt mk\_pabs}, 342
2492 - \item {\ptt mk\_pair}, 342
2493 - \item {\ptt mk\_pp\_thm}, 343
2494 - \item {\ptt mk\_pred}, 343
2495 - \item {\ptt mk\_primed\_var}, 344
2496 - \item {\ptt mk\_select}, 345
2497 - \item {\ptt mk\_thm}, 345
2498 - \item {\ptt mk\_type}, 346
2499 - \item {\ptt mk\_var}, 347
2500 - \item {\ptt mk\_vartype}, 347
2501 - \item {\ptt ml\_curried\_infix}, 348
2502 - \item {\ptt ml\_dir\_pathname}, 349
2503 - \item {\ptt ML\_eval}, 349
2504 - \item {\ptt ml\_paired\_infix}, 350
2505 - \item {\ptt MOD\_EQ\_0}, 626
2506 - \item {\ptt MOD\_MOD}, 626
2507 - \item {\ptt MOD\_MULT}, 626
2508 - \item {\ptt MOD\_ONE}, 626
2509 - \item {\ptt MOD\_PLUS}, 626
2510 - \item {\ptt MOD\_TIMES}, 626
2511 - \item {\ptt MOD\_UNIQUE}, 626
2512 - \item {\ptt MONOID\_ADD\_0}, 626
2513 - \item {\ptt MONOID\_APPEND\_NIL}, 652
2514 - \item {\ptt MONOID\_CONJ\_T}, 615
2515 - \item {\ptt MONOID\_DEF}, 615
2516 - \item {\ptt MONOID\_DISJ\_F}, 615
2517 - \item {\ptt MONOID\_MULT\_1}, 626
2518 - \item {\ptt MP}, 351
2519 - \item {\ptt MP\_TAC}, 351
2520 - \item {\ptt MULT}, 626
2521 - \item {\ptt MULT\_0}, 627
2522 - \item {\ptt MULT\_ASSOC}, 627
2523 - \item {\ptt MULT\_CLAUSES}, 627
2524 - \item {\ptt MULT\_EQ\_0}, 627
2525 - \item {\ptt MULT\_EXP\_MONO}, 627
2526 - \item {\ptt MULT\_LEFT\_1}, 627
2527 - \item {\ptt MULT\_LESS\_EQ\_SUC}, 627
2528 - \item {\ptt MULT\_MONO\_EQ}, 627
2529 - \item {\ptt MULT\_RIGHT\_1}, 627
2530 - \item {\ptt MULT\_SUC}, 627
2531 - \item {\ptt MULT\_SUC\_EQ}, 627
2532 - \item {\ptt MULT\_SYM}, 627
2533 -
2534 - \indexspace
2535 -
2536 - \item {\ptt n\_strip\_quant}, 391
2537 - \item {\ptt NEG\_DISCH}, 352
2538 - \item {\ptt new\_alphanum}, 353
2539 - \item {\ptt new\_axiom}, 354
2540 - \item {\ptt new\_binder}, 355
2541 - \item {\ptt new\_binder\_definition}, 355
2542 - \item {\ptt new\_constant}, 357
2543 - \item {\ptt new\_definition}, 358
2544 - \item {\ptt new\_flag}, 359
2545 - \item {\ptt new\_gen\_definition}, 360
2546 - \item {\ptt new\_infix}, 361
2547 - \item {\ptt new\_infix\_definition}, 362
2548 - \item {\ptt new\_infix\_list\_rec\_definition}, 363
2549 - \item {\ptt new\_infix\_prim\_rec\_definition}, 365
2550 - \item {\ptt new\_letter}, 367
2551 - \item {\ptt new\_list\_rec\_definition}, 367
2552 - \item {\ptt new\_open\_axiom}, 369
2553 - \item {\ptt new\_parent}, 369
2554 - \item {\ptt new\_predicate}, 370
2555 - \item {\ptt new\_prim\_rec\_definition}, 371
2556 - \item {\ptt new\_recursive\_definition}, 372
2557 - \item {\ptt new\_special\_symbol}, 375
2558 - \item {\ptt new\_specification}, 376
2559 - \item {\ptt new\_stack}, 377
2560 - \item {\ptt new\_syntax\_block}, 378
2561 - \item {\ptt new\_theory}, 379
2562 - \item {\ptt new\_type}, 380
2563 - \item {\ptt new\_type\_abbrev}, 381
2564 - \item {\ptt new\_type\_definition}, 382
2565 - \item {\ptt NIL\_DEF}, 652
2566 - \item {\ptt nil\_term\_net}, 383
2567 - \item {\ptt NO\_CONV}, 388
2568 - \item {\ptt NO\_TAC}, 388
2569 - \item {\ptt NO\_THEN}, 388
2570 - \item {\ptt Node}, 660
2571 - \item {\ptt node}, 660
2572 - \item {\ptt Node\_11}, 660
2573 - \item {\ptt node\_11}, 660
2574 - \item {\ptt Node\_onto}, 660
2575 - \item {\ptt node\_REP}, 660
2576 - \item {\ptt not}, 384
2577 - \item {\ptt NOT\_ALL\_EL\_SOME\_EL}, 652
2578 - \item {\ptt NOT\_AND}, 613
2579 - \item {\ptt NOT\_CLAUSES}, 613
2580 - \item {\ptt NOT\_CONS\_NIL}, 652
2581 - \item {\ptt NOT\_DEF}, 609
2582 - \item {\ptt NOT\_ELIM}, 384
2583 - \item {\ptt NOT\_EQ\_LIST}, 652
2584 - \item {\ptt NOT\_EQ\_SYM}, 385
2585 - \item {\ptt NOT\_EXISTS\_CONV}, 385
2586 - \item {\ptt NOT\_EXP\_0}, 627
2587 - \item {\ptt NOT\_F}, 613
2588 - \item {\ptt NOT\_FORALL\_CONV}, 386
2589 - \item {\ptt NOT\_GREATER}, 627
2590 - \item {\ptt NOT\_GREATER\_EQ}, 628
2591 - \item {\ptt NOT\_IMP}, 613
2592 - \item {\ptt NOT\_INTRO}, 386
2593 - \item {\ptt NOT\_LEQ}, 628
2594 - \item {\ptt NOT\_LESS}, 628
2595 - \item {\ptt NOT\_LESS\_0}, 628
2596 - \item {\ptt NOT\_LESS\_EQ}, 628
2597 - \item {\ptt NOT\_LESS\_EQUAL}, 628
2598 - \item {\ptt NOT\_MP}, 387
2599 - \item {\ptt NOT\_NIL\_CONS}, 653
2600 - \item {\ptt NOT\_NIL\_SNOC}, 653
2601 - \item {\ptt NOT\_NUM\_EQ}, 628
2602 - \item {\ptt NOT\_ODD\_EQ\_EVEN}, 628
2603 - \item {\ptt NOT\_SNOC\_NIL}, 653
2604 - \item {\ptt NOT\_SOME\_EL\_ALL\_EL}, 653
2605 - \item {\ptt NOT\_SUC}, 628
2606 - \item {\ptt NOT\_SUC\_ADD\_LESS\_EQ}, 628
2607 - \item {\ptt NOT\_SUC\_LESS\_EQ}, 628
2608 - \item {\ptt NOT\_SUC\_LESS\_EQ\_0}, 628
2609 - \item {\ptt NULL}, 653
2610 - \item {\ptt null}, 389
2611 - \item {\ptt NULL\_DEF}, 653
2612 - \item {\ptt NULL\_EQ\_NIL}, 653
2613 - \item {\ptt NULL\_FOLDL}, 653
2614 - \item {\ptt NULL\_FOLDR}, 653
2615 - \item {\ptt num\_Axiom}, 628
2616 - \item {\ptt num\_CASES}, 628
2617 - \item {\ptt num\_CONV}, 389
2618 - \item {\ptt num\_EQ\_CONV}, 390
2619 - \item {\ptt num\_ISO\_DEF}, 628
2620 - \item {\ptt num\_TY\_DEF}, 629
2621 -
2622 - \indexspace
2623 -
2624 - \item {\ptt o}, 391
2625 - \item {\ptt o\_ASSOC}, 616
2626 - \item {\ptt o\_DEF}, 616
2627 - \item {\ptt o\_THM}, 616
2628 - \item {\ptt ODD}, 629
2629 - \item {\ptt ODD\_ADD}, 629
2630 - \item {\ptt ODD\_DOUBLE}, 629
2631 - \item {\ptt ODD\_EVEN}, 629
2632 - \item {\ptt ODD\_EXISTS}, 629
2633 - \item {\ptt ODD\_MULT}, 629
2634 - \item {\ptt ODD\_OR\_EVEN}, 629
2635 - \item {\ptt ONCE\_ASM\_REWRITE\_RULE}, 392
2636 - \item {\ptt ONCE\_ASM\_REWRITE\_TAC}, 392
2637 - \item {\ptt ONCE\_DEPTH\_CONV}, 393
2638 - \item {\ptt ONCE\_REW\_DEPTH\_CONV}, 397
2639 - \item {\ptt ONCE\_REWRITE\_CONV}, 395
2640 - \item {\ptt ONCE\_REWRITE\_RULE}, 395
2641 - \item {\ptt ONCE\_REWRITE\_TAC}, 396
2642 - \item {\ptt one}, 615
2643 - \item {\ptt one\_Axiom}, 615
2644 - \item {\ptt one\_axiom}, 616
2645 - \item {\ptt one\_DEF}, 616
2646 - \item {\ptt ONE\_ONE\_DEF}, 615
2647 - \item {\ptt one\_TY\_DEF}, 616
2648 - \item {\ptt ONTO\_DEF}, 615
2649 - \item {\ptt oo}, 399
2650 - \item {\ptt openi}, 399
2651 - \item {\ptt openw}, 399
2652 - \item {\ptt OR\_CLAUSES}, 613
2653 - \item {\ptt OR\_DEF}, 609
2654 - \item {\ptt OR\_EL\_DEF}, 653
2655 - \item {\ptt OR\_EL\_FOLDL}, 653
2656 - \item {\ptt OR\_EL\_FOLDR}, 653
2657 - \item {\ptt OR\_ELIM\_THM}, 614
2658 - \item {\ptt OR\_EXISTS\_CONV}, 402
2659 - \item {\ptt OR\_FORALL\_CONV}, 402
2660 - \item {\ptt OR\_IMP\_THM}, 614
2661 - \item {\ptt OR\_INTRO\_THM1}, 614
2662 - \item {\ptt OR\_INTRO\_THM2}, 614
2663 - \item {\ptt OR\_LESS}, 629
2664 - \item {\ptt ORELSE}, 400
2665 - \item {\ptt ORELSE\_TCL}, 401
2666 - \item {\ptt ORELSEC}, 401
2667 - \item {\ptt OUTL}, 618
2668 - \item {\ptt outl}, 403
2669 - \item {\ptt OUTR}, 618
2670 - \item {\ptt outr}, 403
2671 -
2672 - \indexspace
2673 -
2674 - \item {\ptt p}, 404
2675 - \item {\ptt PAIR}, 617
2676 - \item {\ptt pair}, 405
2677 - \item {\ptt PAIR\_EQ}, 617
2678 - \item {\ptt PAIR\_EXISTS}, 617
2679 - \item {\ptt PAIRED\_BETA\_CONV}, 405
2680 - \item {\ptt paired\_delete\_thm}, 407
2681 - \item {\ptt PAIRED\_ETA\_CONV}, 407
2682 - \item {\ptt paired\_new\_type}, 408
2683 - \item {\ptt paired\_theorem}, 408
2684 - \item {\ptt parents}, 409
2685 - \item {\ptt parse\_as\_binder}, 410
2686 - \item {\ptt PART}, 653, 660
2687 - \item {\ptt PART\_MATCH}, 412
2688 - \item {\ptt partition}, 411
2689 - \item {\ptt POP\_ASSUM}, 413
2690 - \item {\ptt POP\_ASSUM\_LIST}, 414
2691 - \item {\ptt pop\_proofs}, 415
2692 - \item {\ptt pop\_proofs\_print}, 416
2693 - \item {\ptt pp\_axiom}, 416
2694 - \item {\ptt PRE}, 629
2695 - \item {\ptt PRE\_DEF}, 629
2696 - \item {\ptt PRE\_SUB}, 629
2697 - \item {\ptt PRE\_SUB1}, 629
2698 - \item {\ptt PRE\_SUC\_EQ}, 629
2699 - \item {\ptt PREFIX}, 653
2700 - \item {\ptt PREFIX\_DEF}, 653
2701 - \item {\ptt PREFIX\_FOLDR}, 654
2702 - \item {\ptt preterm\_abs}, 416
2703 - \item {\ptt preterm\_antiquot}, 417
2704 - \item {\ptt preterm\_comb}, 418
2705 - \item {\ptt preterm\_const}, 419
2706 - \item {\ptt preterm\_to\_term}, 419
2707 - \item {\ptt preterm\_typed}, 420
2708 - \item {\ptt preterm\_var}, 421
2709 - \item {\ptt PRIM\_REC}, 629
2710 - \item {\ptt PRIM\_REC\_EQN}, 630
2711 - \item {\ptt PRIM\_REC\_FUN}, 630
2712 - \item {\ptt PRIM\_REC\_THM}, 630
2713 - \item {\ptt print\_all\_thm}, 422
2714 - \item {\ptt print\_begin}, 423
2715 - \item {\ptt print\_bool}, 425
2716 - \item {\ptt print\_break}, 425
2717 - \item {\ptt print\_defined\_types}, 427
2718 - \item {\ptt print\_end}, 427
2719 - \item {\ptt print\_goal}, 428
2720 - \item {\ptt print\_hyps}, 429
2721 - \item {\ptt print\_ibegin}, 429
2722 - \item {\ptt print\_int}, 430
2723 - \item {\ptt print\_list}, 431
2724 - \item {\ptt print\_newline}, 432
2725 - \item {\ptt print\_stack}, 433
2726 - \item {\ptt print\_state}, 433
2727 - \item {\ptt print\_string}, 435
2728 - \item {\ptt print\_subgoals}, 435
2729 - \item {\ptt print\_term}, 435
2730 - \item {\ptt print\_theory}, 436
2731 - \item {\ptt print\_thm}, 437
2732 - \item {\ptt print\_tok}, 437
2733 - \item {\ptt print\_type}, 438
2734 - \item {\ptt print\_unquoted\_term}, 439
2735 - \item {\ptt print\_unquoted\_type}, 439
2736 - \item {\ptt print\_void}, 440
2737 - \item {\ptt prod\_TY\_DEF}, 617
2738 - \item {\ptt prompt}, 441
2739 - \item {\ptt PROVE}, 441
2740 - \item {\ptt prove}, 442
2741 - \item {\ptt prove\_abs\_fn\_one\_one}, 442
2742 - \item {\ptt prove\_abs\_fn\_onto}, 443
2743 - \item {\ptt prove\_cases\_thm}, 443
2744 - \item {\ptt prove\_constructors\_distinct}, 444
2745 - \item {\ptt prove\_constructors\_one\_one}, 445
2746 - \item {\ptt PROVE\_HYP}, 446
2747 - \item {\ptt prove\_induction\_thm}, 447
2748 - \item {\ptt prove\_rec\_fn\_exists}, 448
2749 - \item {\ptt prove\_rep\_fn\_one\_one}, 449
2750 - \item {\ptt prove\_rep\_fn\_onto}, 449
2751 - \item {\ptt prove\_thm}, 450
2752 - \item {\ptt PURE\_ASM\_REWRITE\_RULE}, 451
2753 - \item {\ptt PURE\_ASM\_REWRITE\_TAC}, 451
2754 - \item {\ptt PURE\_ONCE\_ASM\_REWRITE\_RULE}, 452
2755 - \item {\ptt PURE\_ONCE\_ASM\_REWRITE\_TAC}, 452
2756 - \item {\ptt PURE\_ONCE\_REWRITE\_CONV}, 453
2757 - \item {\ptt PURE\_ONCE\_REWRITE\_RULE}, 454
2758 - \item {\ptt PURE\_ONCE\_REWRITE\_TAC}, 454
2759 - \item {\ptt PURE\_REWRITE\_CONV}, 455
2760 - \item {\ptt PURE\_REWRITE\_RULE}, 455
2761 - \item {\ptt PURE\_REWRITE\_TAC}, 456
2762 - \item {\ptt push\_fsubgoals}, 457
2763 - \item {\ptt push\_print}, 457
2764 - \item {\ptt push\_subgoals}, 458
2765 -
2766 - \indexspace
2767 -
2768 - \item {\ptt quit}, 458
2769 -
2770 - \indexspace
2771 -
2772 - \item {\ptt r}, 458
2773 - \item {\ptt rand}, 459
2774 - \item {\ptt RAND\_CONV}, 459
2775 - \item {\ptt rator}, 460
2776 - \item {\ptt RATOR\_CONV}, 460
2777 - \item {\ptt read}, 461
2778 - \item {\ptt record\_proof}, 463
2779 - \item {\ptt RecordStep}, 462
2780 - \item {\ptt REDEPTH\_CONV}, 464
2781 - \item {\ptt REFL}, 466
2782 - \item {\ptt REFL\_CLAUSE}, 614
2783 - \item {\ptt REFL\_TAC}, 466
2784 - \item {\ptt remove}, 467
2785 - \item {\ptt remove\_sticky\_type}, 467
2786 - \item {\ptt rep\_goals}, 470
2787 - \item {\ptt REP\_prod}, 617
2788 - \item {\ptt REPEAT}, 468
2789 - \item {\ptt REPEAT\_GTCL}, 469
2790 - \item {\ptt REPEAT\_TCL}, 469
2791 - \item {\ptt REPEATC}, 468
2792 - \item {\ptt REPLICATE}, 654
2793 - \item {\ptt replicate}, 470
2794 - \item {\ptt RES\_ABSTRACT}, 610
2795 - \item {\ptt RES\_CANON}, 471
2796 - \item {\ptt RES\_EXISTS}, 610
2797 - \item {\ptt RES\_FORALL}, 610
2798 - \item {\ptt RES\_SELECT}, 610
2799 - \item {\ptt RES\_TAC}, 474
2800 - \item {\ptt RES\_THEN}, 475
2801 - \item {\ptt resume\_recording}, 471
2802 - \item {\ptt rev}, 477
2803 - \item {\ptt rev\_assoc}, 478
2804 - \item {\ptt rev\_itlist}, 478
2805 - \item {\ptt REVERSE}, 654
2806 - \item {\ptt REVERSE\_APPEND}, 654
2807 - \item {\ptt REVERSE\_CONV}, 477
2808 - \item {\ptt REVERSE\_EQ\_NIL}, 654
2809 - \item {\ptt REVERSE\_FLAT}, 654
2810 - \item {\ptt REVERSE\_FOLDL}, 654
2811 - \item {\ptt REVERSE\_FOLDR}, 654
2812 - \item {\ptt REVERSE\_REVERSE}, 654
2813 - \item {\ptt REVERSE\_SNOC}, 654
2814 - \item {\ptt REW\_DEPTH\_CONV}, 485
2815 - \item {\ptt REWR\_CONV}, 482
2816 - \item {\ptt REWRITE\_CONV}, 479
2817 - \item {\ptt REWRITE\_RULE}, 480
2818 - \item {\ptt REWRITE\_TAC}, 481
2819 - \item {\ptt rhs}, 487
2820 - \item {\ptt RIGHT\_ADD\_DISTRIB}, 630
2821 - \item {\ptt RIGHT\_AND\_EXISTS\_CONV}, 487
2822 - \item {\ptt RIGHT\_AND\_FORALL\_CONV}, 488
2823 - \item {\ptt RIGHT\_AND\_OVER\_OR}, 614
2824 - \item {\ptt RIGHT\_BETA}, 488
2825 - \item {\ptt RIGHT\_CONV\_RULE}, 489
2826 - \item {\ptt RIGHT\_ID\_ADD\_0}, 630
2827 - \item {\ptt RIGHT\_ID\_DEF}, 615
2828 - \item {\ptt RIGHT\_ID\_MULT\_1}, 630
2829 - \item {\ptt RIGHT\_IMP\_EXISTS\_CONV}, 490
2830 - \item {\ptt RIGHT\_IMP\_FORALL\_CONV}, 490
2831 - \item {\ptt RIGHT\_LIST\_BETA}, 491
2832 - \item {\ptt RIGHT\_OR\_EXISTS\_CONV}, 491
2833 - \item {\ptt RIGHT\_OR\_FORALL\_CONV}, 492
2834 - \item {\ptt RIGHT\_OR\_OVER\_AND}, 614
2835 - \item {\ptt RIGHT\_SUB\_DISTRIB}, 630
2836 - \item {\ptt root\_goal}, 492
2837 - \item {\ptt rotate}, 493
2838 - \item {\ptt rotate\_goals}, 494
2839 - \item {\ptt rotate\_top}, 495
2840 - \item {\ptt RULE\_ASSUM\_TAC}, 495
2841 -
2842 - \indexspace
2843 -
2844 - \item {\ptt S}, 496
2845 - \item {\ptt S\_DEF}, 616
2846 - \item {\ptt S\_THM}, 616
2847 - \item {\ptt save}, 496
2848 - \item {\ptt save\_thm}, 497
2849 - \item {\ptt save\_top\_thm}, 498
2850 - \item {\ptt SCANL}, 654
2851 - \item {\ptt SCANL\_CONV}, 499
2852 - \item {\ptt SCANR}, 654
2853 - \item {\ptt SCANR\_CONV}, 500
2854 - \item {\ptt search\_path}, 501
2855 - \item {\ptt SEG}, 654
2856 - \item {\ptt SEG\_0\_SNOC}, 654
2857 - \item {\ptt SEG\_APPEND}, 655
2858 - \item {\ptt SEG\_APPEND1}, 655
2859 - \item {\ptt SEG\_APPEND2}, 655
2860 - \item {\ptt SEG\_CONV}, 502
2861 - \item {\ptt SEG\_FIRSTN\_BUTFISTN}, 655
2862 - \item {\ptt SEG\_LASTN\_BUTLASTN}, 655
2863 - \item {\ptt SEG\_LENGTH\_ID}, 655
2864 - \item {\ptt SEG\_LENGTH\_SNOC}, 655
2865 - \item {\ptt SEG\_REVERSE}, 655
2866 - \item {\ptt SEG\_SEG}, 655
2867 - \item {\ptt SEG\_SNOC}, 655
2868 - \item {\ptt SEG\_SUC\_CONS}, 655
2869 - \item {\ptt SELECT\_AX}, 610
2870 - \item {\ptt SELECT\_CONV}, 503
2871 - \item {\ptt SELECT\_ELIM}, 504
2872 - \item {\ptt SELECT\_EQ}, 505
2873 - \item {\ptt SELECT\_INTRO}, 506
2874 - \item {\ptt SELECT\_REFL}, 614
2875 - \item {\ptt SELECT\_RULE}, 507
2876 - \item {\ptt SELECT\_UNIQUE}, 614
2877 - \item {\ptt set\_equal}, 509
2878 - \item {\ptt set\_fail}, 509
2879 - \item {\ptt set\_fail\_prefix}, 510
2880 - \item {\ptt set\_flag}, 511
2881 - \item {\ptt set\_goal}, 512
2882 - \item {\ptt set\_help}, 513
2883 - \item {\ptt set\_help\_search\_path}, 514
2884 - \item {\ptt set\_interface\_map}, 514
2885 - \item {\ptt set\_lambda}, 515
2886 - \item {\ptt set\_library\_search\_path}, 516
2887 - \item {\ptt set\_margin}, 517
2888 - \item {\ptt set\_pretty\_mode}, 517
2889 - \item {\ptt set\_prompt}, 518
2890 - \item {\ptt set\_search\_path}, 519
2891 - \item {\ptt set\_state}, 520
2892 - \item {\ptt set\_sticky\_type}, 521
2893 - \item {\ptt set\_string\_escape}, 522
2894 - \item {\ptt set\_thm\_count}, 523
2895 - \item {\ptt set\_turnstile}, 523
2896 - \item {\ptt setify}, 508
2897 - \item {\ptt show\_types}, 524
2898 - \item {\ptt SIMP\_REC}, 630
2899 - \item {\ptt SIMP\_REC\_EXISTS}, 630
2900 - \item {\ptt SIMP\_REC\_FUN}, 630
2901 - \item {\ptt SIMP\_REC\_FUN\_LEMMA}, 630
2902 - \item {\ptt SIMP\_REC\_REL}, 630
2903 - \item {\ptt SIMP\_REC\_THM}, 631
2904 - \item {\ptt Size}, 660
2905 - \item {\ptt SKOLEM\_CONV}, 525
2906 - \item {\ptt SND}, 617
2907 - \item {\ptt snd}, 526
2908 - \item {\ptt SND\_DEF}, 617
2909 - \item {\ptt SNOC}, 656
2910 - \item {\ptt SNOC\_11}, 656
2911 - \item {\ptt SNOC\_APPEND}, 656
2912 - \item {\ptt SNOC\_Axiom}, 656
2913 - \item {\ptt SNOC\_CASES}, 656
2914 - \item {\ptt SNOC\_CONV}, 526
2915 - \item {\ptt SNOC\_EQ\_LENGTH\_EQ}, 656
2916 - \item {\ptt SNOC\_FOLDR}, 656
2917 - \item {\ptt SNOC\_INDUCT}, 656
2918 - \item {\ptt SNOC\_INDUCT\_TAC}, 527
2919 - \item {\ptt SNOC\_REVERSE\_CONS}, 656
2920 - \item {\ptt SOME\_EL}, 656
2921 - \item {\ptt SOME\_EL\_APPEND}, 656
2922 - \item {\ptt SOME\_EL\_BUTFIRSTN}, 656
2923 - \item {\ptt SOME\_EL\_BUTLASTN}, 656
2924 - \item {\ptt SOME\_EL\_CONV}, 528
2925 - \item {\ptt SOME\_EL\_DISJ}, 656
2926 - \item {\ptt SOME\_EL\_FIRSTN}, 657
2927 - \item {\ptt SOME\_EL\_FOLDL}, 657
2928 - \item {\ptt SOME\_EL\_FOLDL\_MAP}, 657
2929 - \item {\ptt SOME\_EL\_FOLDR}, 657
2930 - \item {\ptt SOME\_EL\_FOLDR\_MAP}, 657
2931 - \item {\ptt SOME\_EL\_LASTN}, 657
2932 - \item {\ptt SOME\_EL\_MAP}, 657
2933 - \item {\ptt SOME\_EL\_REVERSE}, 657
2934 - \item {\ptt SOME\_EL\_SEG}, 657
2935 - \item {\ptt SOME\_EL\_SNOC}, 657
2936 - \item {\ptt sort}, 529
2937 - \item {\ptt SPEC}, 530
2938 - \item {\ptt SPEC\_ALL}, 532
2939 - \item {\ptt SPEC\_TAC}, 533
2940 - \item {\ptt SPEC\_VAR}, 534
2941 - \item {\ptt special\_symbols}, 531
2942 - \item {\ptt SPECL}, 531
2943 - \item {\ptt SPLIT}, 657, 660
2944 - \item {\ptt split}, 534
2945 - \item {\ptt SPLITP}, 657
2946 - \item {\ptt splitp}, 535
2947 - \item {\ptt sticky\_list}, 535
2948 - \item {\ptt store\_binders}, 536
2949 - \item {\ptt store\_definition}, 536
2950 - \item {\ptt string\_of\_int}, 536
2951 - \item {\ptt strip\_abs}, 537
2952 - \item {\ptt STRIP\_ASSUME\_TAC}, 537
2953 - \item {\ptt strip\_comb}, 539
2954 - \item {\ptt strip\_exists}, 540
2955 - \item {\ptt strip\_forall}, 540
2956 - \item {\ptt STRIP\_GOAL\_THEN}, 541
2957 - \item {\ptt strip\_imp}, 543
2958 - \item {\ptt strip\_pair}, 543
2959 - \item {\ptt STRIP\_TAC}, 544
2960 - \item {\ptt STRIP\_THM\_THEN}, 545
2961 - \item {\ptt STRUCT\_CASES\_TAC}, 547
2962 - \item {\ptt SUB}, 631
2963 - \item {\ptt SUB\_0}, 631
2964 - \item {\ptt SUB\_ADD}, 631
2965 - \item {\ptt SUB\_CANCEL}, 631
2966 - \item {\ptt SUB\_CONV}, 563
2967 - \item {\ptt SUB\_EQ\_0}, 631
2968 - \item {\ptt SUB\_EQ\_EQ\_0}, 631
2969 - \item {\ptt SUB\_EQUAL\_0}, 631
2970 - \item {\ptt SUB\_LEFT\_ADD}, 631
2971 - \item {\ptt SUB\_LEFT\_EQ}, 631
2972 - \item {\ptt SUB\_LEFT\_GREATER}, 631
2973 - \item {\ptt SUB\_LEFT\_GREATER\_EQ}, 631
2974 - \item {\ptt SUB\_LEFT\_LESS}, 631
2975 - \item {\ptt SUB\_LEFT\_LESS\_EQ}, 631
2976 - \item {\ptt SUB\_LEFT\_SUB}, 631
2977 - \item {\ptt SUB\_LEFT\_SUC}, 632
2978 - \item {\ptt SUB\_LESS\_0}, 632
2979 - \item {\ptt SUB\_LESS\_EQ}, 632
2980 - \item {\ptt SUB\_LESS\_EQ\_ADD}, 632
2981 - \item {\ptt SUB\_LESS\_OR}, 632
2982 - \item {\ptt SUB\_MONO\_EQ}, 632
2983 - \item {\ptt SUB\_PLUS}, 632
2984 - \item {\ptt SUB\_RIGHT\_ADD}, 632
2985 - \item {\ptt SUB\_RIGHT\_EQ}, 632
2986 - \item {\ptt SUB\_RIGHT\_GREATER}, 632
2987 - \item {\ptt SUB\_RIGHT\_GREATER\_EQ}, 632
2988 - \item {\ptt SUB\_RIGHT\_LESS}, 632
2989 - \item {\ptt SUB\_RIGHT\_LESS\_EQ}, 632
2990 - \item {\ptt SUB\_RIGHT\_SUB}, 632
2991 - \item {\ptt SUB\_SUB}, 632
2992 - \item {\ptt SUBGOAL\_THEN}, 548
2993 - \item {\ptt SUBS}, 549
2994 - \item {\ptt SUBS\_OCCS}, 561
2995 - \item {\ptt SUBST}, 551
2996 - \item {\ptt subst}, 552
2997 - \item {\ptt SUBST1\_TAC}, 553
2998 - \item {\ptt SUBST\_ALL\_TAC}, 554
2999 - \item {\ptt SUBST\_CONV}, 555
3000 - \item {\ptt SUBST\_MATCH}, 557
3001 - \item {\ptt subst\_occs}, 558
3002 - \item {\ptt SUBST\_OCCS\_TAC}, 559
3003 - \item {\ptt SUBST\_TAC}, 560
3004 - \item {\ptt subtract}, 562
3005 - \item {\ptt SUC\_ADD\_SYM}, 632
3006 - \item {\ptt SUC\_DEF}, 633
3007 - \item {\ptt SUC\_ID}, 633
3008 - \item {\ptt SUC\_LESS}, 633
3009 - \item {\ptt SUC\_NOT}, 633
3010 - \item {\ptt SUC\_ONE\_ADD}, 633
3011 - \item {\ptt SUC\_REP\_DEF}, 633
3012 - \item {\ptt SUC\_SUB1}, 633
3013 - \item {\ptt SUFFIX\_DEF}, 657
3014 - \item {\ptt SUM}, 658
3015 - \item {\ptt SUM\_APPEND}, 658
3016 - \item {\ptt sum\_Axiom}, 618
3017 - \item {\ptt sum\_axiom}, 618
3018 - \item {\ptt SUM\_FLAT}, 658
3019 - \item {\ptt SUM\_FOLDL}, 658
3020 - \item {\ptt SUM\_FOLDR}, 658
3021 - \item {\ptt sum\_ISO\_DEF}, 618
3022 - \item {\ptt SUM\_REVERSE}, 658
3023 - \item {\ptt SUM\_SNOC}, 658
3024 - \item {\ptt sum\_TY\_DEF}, 618
3025 - \item {\ptt suspend\_recording}, 564
3026 - \item {\ptt SWAP\_EXISTS\_CONV}, 565
3027 - \item {\ptt SYM}, 565
3028 - \item {\ptt SYM\_CONV}, 566
3029 - \item {\ptt syserror}, 566
3030 - \item {\ptt system}, 567
3031 -
3032 - \indexspace
3033 -
3034 - \item {\ptt T\_DEF}, 609
3035 - \item {\ptt TAC\_PROOF}, 567
3036 - \item {\ptt term\_of\_int}, 568
3037 - \item {\ptt THEN}, 568
3038 - \item {\ptt THEN\_TCL}, 570
3039 - \item {\ptt THENC}, 569
3040 - \item {\ptt THENL}, 570
3041 - \item {\ptt theorem}, 571
3042 - \item {\ptt theorem\_lfn}, 573
3043 - \item {\ptt theorem\_msg\_lfn}, 573
3044 - \item {\ptt theorems}, 572
3045 - \item {\ptt thm\_count}, 574
3046 - \item {\ptt thm\_frees}, 575
3047 - \item {\ptt timer}, 575
3048 - \item {\ptt TIMES2}, 633
3049 - \item {\ptt TL}, 658
3050 - \item {\ptt tl}, 576
3051 - \item {\ptt TL\_SNOC}, 658
3052 - \item {\ptt TOP\_DEPTH\_CONV}, 577
3053 - \item {\ptt top\_goal}, 578
3054 - \item {\ptt top\_print}, 578
3055 - \item {\ptt top\_proof}, 579
3056 - \item {\ptt top\_thm}, 580
3057 - \item {\ptt TRANS}, 580
3058 - \item {\ptt tree\_Axiom}, 660
3059 - \item {\ptt tree\_Induct}, 660
3060 - \item {\ptt tree\_ISO\_DEF}, 661
3061 - \item {\ptt tree\_TY\_DEF}, 661
3062 - \item {\ptt trf}, 661
3063 - \item {\ptt TRP}, 661
3064 - \item {\ptt TRP\_DEF}, 661
3065 - \item {\ptt TRUTH}, 614
3066 - \item {\ptt TRY}, 581
3067 - \item {\ptt TRY\_CONV}, 582
3068 - \item {\ptt tryfind}, 582
3069 - \item {\ptt tty\_read}, 583
3070 - \item {\ptt tty\_write}, 583
3071 - \item {\ptt TY\_DEF\_THM}, 661
3072 - \item {\ptt type\_abbrevs}, 585
3073 - \item {\ptt TYPE\_DEFINITION}, 661
3074 - \item {\ptt type\_in}, 586
3075 - \item {\ptt type\_in\_type}, 587
3076 - \item {\ptt type\_of}, 587
3077 - \item {\ptt type\_tyvars}, 588
3078 - \item {\ptt types}, 584
3079 - \item {\ptt tyvars}, 588
3080 - \item {\ptt tyvarsl}, 589
3081 -
3082 - \indexspace
3083 -
3084 - \item {\ptt uncurry}, 590
3085 - \item {\ptt UNCURRY\_DEF}, 617
3086 - \item {\ptt UNDISCH}, 590
3087 - \item {\ptt UNDISCH\_ALL}, 591
3088 - \item {\ptt UNDISCH\_TAC}, 592
3089 - \item {\ptt undo\_autoload}, 592
3090 - \item {\ptt unhide\_constant}, 593
3091 - \item {\ptt union}, 593
3092 - \item {\ptt unlink}, 594
3093 - \item {\ptt UNZIP}, 658
3094 - \item {\ptt UNZIP\_FST\_DEF}, 658
3095 - \item {\ptt UNZIP\_SND\_DEF}, 658
3096 - \item {\ptt UNZIP\_SNOC}, 658
3097 - \item {\ptt UNZIP\_ZIP}, 658
3098 -
3099 - \indexspace
3100 -
3101 - \item {\ptt VALID}, 594
3102 - \item {\ptt variant}, 595
3103 - \item {\ptt vars}, 596
3104 - \item {\ptt varsl}, 597
3105 - \item {\ptt version}, 598
3106 -
3107 - \indexspace
3108 -
3109 - \item {\ptt W}, 598
3110 - \item {\ptt WOP}, 633
3111 - \item {\ptt word\_separators}, 600
3112 - \item {\ptt words}, 598
3113 - \item {\ptt words2}, 599
3114 - \item {\ptt write}, 600
3115 -
3116 - \indexspace
3117 -
3118 - \item {\ptt X\_CASES\_THEN}, 601
3119 - \item {\ptt X\_CASES\_THENL}, 603
3120 - \item {\ptt X\_CHOOSE\_TAC}, 604
3121 - \item {\ptt X\_CHOOSE\_THEN}, 605
3122 - \item {\ptt X\_FUN\_EQ\_CONV}, 607
3123 - \item {\ptt X\_GEN\_TAC}, 607
3124 - \item {\ptt X\_SKOLEM\_CONV}, 608
3125 -
3126 - \indexspace
3127 -
3128 - \item {\ptt ZERO\_DEF}, 633
3129 - \item {\ptt ZERO\_DIV}, 633
3130 - \item {\ptt ZERO\_LESS\_EQ}, 633
3131 - \item {\ptt ZERO\_LESS\_EXP}, 633
3132 - \item {\ptt ZERO\_MOD}, 633
3133 - \item {\ptt ZERO\_REP\_DEF}, 633
3134 - \item {\ptt ZIP}, 659
3135 - \item {\ptt ZIP\_SNOC}, 659
3136 - \item {\ptt ZIP\_UNZIP}, 659
3137 -
3138 -\end{theindex}
3139 +\begin{theindex}\mbox{}\end{theindex}
3140 \ No newline at end of file
3141 --- hol88-2.02.19940316.orig/Manual/Reference/Makefile
3142 +++ hol88-2.02.19940316/Manual/Reference/Makefile
3143 @@ -19,46 +19,46 @@ default:
3144
3145 clean:
3146 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
3147 - @echo "\begin{theindex}" > index.tex
3148 - @echo "\mbox{}" >> index.tex
3149 - @echo "\end{theindex}" >> index.tex
3150 + @printf '\\begin{theindex}' > index.tex
3151 + @printf '\\mbox{}' >> index.tex
3152 + @printf '\\end{theindex}' >> index.tex
3153
3154 tex: ids theorems
3155 @echo "TeX files made"
3156
3157 ids:
3158 - @echo "\chapter{Pre-defined ML Identifiers}" > entries.tex
3159 - @echo "\input{entries-intro}" >> entries.tex
3160 + @printf '\\chapter{Pre-defined ML Identifiers}' > entries.tex
3161 + @printf '\\input{entries-intro}' >> entries.tex
3162 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/ENTRIES entries.tex
3163
3164 theorems:
3165 - @echo "\chapter{Pre-proved Theorems}" > theorems.tex
3166 - @echo "\input{theorems-intro}" >> theorems.tex
3167 - @echo "\section{Definitions of Basic Logical Constants}">>theorems.tex
3168 + @printf '\\chapter{Pre-proved Theorems}' > theorems.tex
3169 + @printf '\\input{theorems-intro}' >> theorems.tex
3170 + @printf '\\section{Definitions of Basic Logical Constants}'>>theorems.tex
3171 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/basic-logic theorems.tex
3172 - @echo "\section{Constants for syntactic abbreviations}" >> theorems.tex
3173 + @printf '\\section{Constants for syntactic abbreviations}' >> theorems.tex
3174 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/syntax theorems.tex
3175 - @echo "\section{Axioms}" >> theorems.tex
3176 + @printf '\\section{Axioms}' >> theorems.tex
3177 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/axioms theorems.tex
3178 - @echo "\section{Logical tautologies}" >> theorems.tex
3179 + @printf '\\section{Logical tautologies}' >> theorems.tex
3180 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/logic theorems.tex
3181 - @echo "\section{Theorems about functions}" >> theorems.tex
3182 + @printf '\\section{Theorems about functions}' >> theorems.tex
3183 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/functions theorems.tex
3184 - @echo "\section{Theorems about the type {\tt one}}" >> theorems.tex
3185 + @printf '\\section{Theorems about the type {\\tt one}}' >> theorems.tex
3186 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/one theorems.tex
3187 - @echo "\section{Theorems about combinators}" >> theorems.tex
3188 + @printf '\\section{Theorems about combinators}' >> theorems.tex
3189 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/combin theorems.tex
3190 - @echo "\section{Theorems about pairs}" >> theorems.tex
3191 + @printf '\\section{Theorems about pairs}' >> theorems.tex
3192 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/pairs theorems.tex
3193 - @echo "\section{Theorems about disjoint sums}" >> theorems.tex
3194 + @printf '\\section{Theorems about disjoint sums}' >> theorems.tex
3195 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/sum theorems.tex
3196 - @echo "\section{Theorems about arithmetic}" >> theorems.tex
3197 + @printf '\\section{Theorems about arithmetic}' >> theorems.tex
3198 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/arith theorems.tex
3199 - @echo "\section{Theorems about lists}" >> theorems.tex
3200 + @printf '\\section{Theorems about lists}' >> theorems.tex
3201 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/list theorems.tex
3202 - @echo "\section{Theorems about trees}" >> theorems.tex
3203 + @printf '\\section{Theorems about trees}' >> theorems.tex
3204 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/tree theorems.tex
3205 - @echo "\section{Theorems used to define types}" >> theorems.tex
3206 + @printf '\\section{Theorems used to define types}' >> theorems.tex
3207 /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/tydefs theorems.tex
3208
3209 reference:
3210 --- hol88-2.02.19940316.orig/Manual/Reference/entries.tex
3211 +++ hol88-2.02.19940316/Manual/Reference/entries.tex
3212 @@ -1,1114 +1,882 @@
3213 -\chapter{Pre-defined ML Identifiers}
3214 -\input{entries-intro}
3215 -\DOC{\#}
3216 +\chapter{Pre-defined ML Identifiers}\input{entries-intro}\DOC{ABS\_CONV}
3217
3218 -\TYPE {\small\verb%$# : (((* -> **) # (*** -> ****)) -> (* # ***) -> (** # ****))%}\egroup
3219 +\TYPE {\small\verb%ABS_CONV : (conv -> conv)%}\egroup
3220
3221 \SYNOPSIS
3222 -Applies two functions to a pair: {\small\verb%(f # g) (x,y)%} = {\small\verb%(f x, g y)%}.
3223 +Applies a conversion to the body of an abstraction.
3224 +
3225 +\DESCRIBE
3226 +If {\small\verb%c%} is a conversion that maps a term {\small\verb%"t"%} to the theorem {\small\verb%|- t = t'%}, then
3227 +the conversion {\small\verb%ABS_CONV c%} maps abstractions of the form {\small\verb%"\x.t"%} to theorems
3228 +of the form:
3229 +{\par\samepage\setseps\small
3230 +\begin{verbatim}
3231 + |- (\x.t) = (\x.t')
3232 +\end{verbatim}
3233 +}
3234 +\noindent That is, {\small\verb%ABS_CONV c "\x.t"%} applies {\small\verb%c%} to the body of the
3235 +abstraction {\small\verb%"\x.t"%}.
3236
3237 \FAILURE
3238 -Never fails.
3239 +{\small\verb%ABS_CONV c tm%} fails if {\small\verb%tm%} is not an abstraction or if {\small\verb%tm%} has the form
3240 +{\small\verb%"\x.t"%} but the conversion {\small\verb%c%} fails when applied to the term {\small\verb%t%}. The
3241 +function returned by {\small\verb%ABS_CONV c%} may also fail if the ML function
3242 +{\small\verb%c:term->thm%} is not, in fact, a conversion (i.e. a function that maps a term
3243 +{\small\verb%t%} to a theorem {\small\verb%|- t = t'%}).
3244
3245 +\EXAMPLE
3246 +{\par\samepage\setseps\small
3247 +\begin{verbatim}
3248 +#ABS_CONV SYM_CONV "\x. 1 = x";;
3249 +|- (\x. 1 = x) = (\x. x = 1)
3250 +\end{verbatim}
3251 +}
3252 \SEEALSO
3253 -B, C, CB, Co, I, K, KI, o, oo, S, W.
3254 +RAND_CONV, RATOR_CONV, SUB_CONV.
3255
3256 \ENDDOC
3257 -\DOC{*}
3258 +\DOC{ABS}
3259
3260 -\TYPE {\small\verb%$* : ((int # int) -> int)%}\egroup
3261 +\TYPE {\small\verb%ABS : (term -> thm -> thm)%}\egroup
3262
3263 \SYNOPSIS
3264 -Performs multiplication on ML integers.
3265 +Abstracts both sides of an equation.
3266
3267 +\DESCRIBE
3268 +{\par\samepage\setseps\small
3269 +\begin{verbatim}
3270 + A |- t1 = t2
3271 + ------------------------ ABS "x" [Where x is not free in A]
3272 + A |- (\x.t1) = (\x.t2)
3273 +\end{verbatim}
3274 +}
3275 \FAILURE
3276 -Never fails.
3277 +If the theorem is not an equation, or if the variable {\small\verb%x%} is free in the
3278 +assumptions {\small\verb%A%}.
3279
3280 -\ENDDOC
3281 +\EXAMPLE
3282 +{\par\samepage\setseps\small
3283 +\begin{verbatim}
3284 +#ABS "m:num" (REFL "m:num");;
3285 +|- (\m. m) = (\m. m)
3286 +\end{verbatim}
3287 +}
3288 +\SEEALSO
3289 +ETA_CONV, EXT, MK_ABS.
3290
3291 -\DOC{+}
3292 +\ENDDOC
3293 +\DOC{abs\_goals}
3294
3295 -\TYPE {\small\verb%$+ : ((int # int) -> int)%}\egroup
3296 +\TYPE {\small\verb%abs_goals : (subgoals list -> goalstack)%}\egroup
3297
3298 \SYNOPSIS
3299 -Performs addition on ML integers.
3300 -
3301 -\FAILURE
3302 -Never fails.
3303 +This function is for internal use only and is to be deleted from a future
3304 +version of the system. It should not be used.
3305
3306 \ENDDOC
3307 -\DOC{-}
3308 +\DOC{ACCEPT\_TAC}
3309
3310 -\TYPE {\small\verb%$- : ((int # int) -> int)%}\egroup
3311 +\TYPE {\small\verb%ACCEPT_TAC : thm_tactic%}\egroup
3312
3313 \SYNOPSIS
3314 -Performs subtraction on ML integers.
3315 +Solves a goal if supplied with the desired theorem (up to alpha-conversion).
3316 +
3317 +\DESCRIBE
3318 +{\small\verb%ACCEPT_TAC%} maps a given theorem {\small\verb%th%} to a tactic that solves any goal whose
3319 +conclusion is alpha-convertible to the conclusion of {\small\verb%th%}.
3320
3321 \FAILURE
3322 -Never fails.
3323 +{\small\verb%ACCEPT_TAC th (A,g)%} fails if the term {\small\verb%g%} is not alpha-convertible to the
3324 +conclusion of the supplied theorem {\small\verb%th%}.
3325
3326 -\COMMENTS
3327 -Unary {\small\verb%-%} exists as an internal parser object, but not as a function. So,
3328 -whilst typing in {\small\verb%-1;;%} will work, {\small\verb%-;;%} will return a parse error.
3329 +\EXAMPLE
3330 +{\small\verb%ACCEPT_TAC%} applied to the axiom
3331 +{\par\samepage\setseps\small
3332 +\begin{verbatim}
3333 + BOOL_CASES_AX = |- !t. (t = T) \/ (t = F)
3334 +\end{verbatim}
3335 +}
3336 +\noindent will solve the goal
3337 +{\par\samepage\setseps\small
3338 +\begin{verbatim}
3339 + ?- !x. (x = T) \/ (x = F)
3340 +\end{verbatim}
3341 +}
3342 +\noindent but will fail on the goal
3343 +{\par\samepage\setseps\small
3344 +\begin{verbatim}
3345 + ?- !x. (x = F) \/ (x = T)
3346 +\end{verbatim}
3347 +}
3348 +\USES
3349 +Used for completing proofs by supplying an existing theorem, such as an axiom,
3350 +or a lemma already proved.
3351 +
3352 +\SEEALSO
3353 +MATCH_ACCEPT_TAC.
3354
3355 \ENDDOC
3356 -\DOC{\char'056}
3357 +\DOC{AC\_CONV}
3358
3359 -\TYPE {\small\verb%$. : ((* # * list) -> * list)%}\egroup
3360 +\TYPE {\small\verb%AC_CONV : ((thm # thm) -> conv)%}\egroup
3361
3362 \SYNOPSIS
3363 -Adds single element to the head of a list.
3364 +Proves equality of terms using associative and commutative laws.
3365
3366 \DESCRIBE
3367 -The {\small\verb%.%} operator is an infixed primitive list constructor, analogous to {\small\verb%CONS%}
3368 -in LISP. Its effect is {\small\verb%x . [x1;....;xn]%} = {\small\verb%[x;x1;...;xn]%}.
3369 +Suppose {\small\verb%_%} is a function, which is assumed to be infix in the following syntax,
3370 +and {\small\verb%ath%} and {\small\verb%cth%} are theorems expressing its associativity and
3371 +commutativity; they must be of the following form, except that any free
3372 +variables may have arbitrary names and may be universally quantified:
3373 +{\par\samepage\setseps\small
3374 +\begin{verbatim}
3375 + ath = |- m _ (n _ p) = (m _ n) _ p
3376 + cth = |- m _ n = n _ m
3377 +\end{verbatim}
3378 +}
3379 +\noindent Then the conversion {\small\verb%AC_CONV(ath,cth)%} will prove equations whose
3380 +left and right sides can be made identical using these associative and
3381 +commutative laws.
3382
3383 \FAILURE
3384 -Never fails.
3385 +Fails if the associative or commutative law has an invalid form, or if the
3386 +term is not an equation between AC-equivalent terms.
3387 +
3388 +\EXAMPLE
3389 +{\par\samepage\setseps\small
3390 +\begin{verbatim}
3391 + #AC_CONV(ADD_ASSOC,ADD_SYM)
3392 + # "x + (SUC t) + ((3 + y) + z) = 3 + (SUC t) + x + y + z";;
3393 + |- (x + ((SUC t) + ((3 + y) + z)) = 3 + ((SUC t) + (x + (y + z)))) = T
3394 +\end{verbatim}
3395 +}
3396 +
3397 +\COMMENTS
3398 +Note that the preproved associative and commutative laws for the operators {\small\verb%+%},
3399 +{\small\verb%*%}, {\small\verb%/\%} and {\small\verb%\/%} are already in the right form to give to {\small\verb%AC_CONV%}.
3400 +
3401 +\SEEALSO
3402 +SYM_CONV.
3403
3404 \ENDDOC
3405 -\DOC{/}
3406 +\DOC{achieve\_first}
3407
3408 -\TYPE {\small\verb%$/ : ((int # int) -> int)%}\egroup
3409 +\TYPE {\small\verb%achieve_first : (subgoals -> thm -> subgoals)%}\egroup
3410
3411 \SYNOPSIS
3412 -Performs division on ML integers.
3413 +This function is for internal use only and is to be deleted from a future
3414 +version of the system. It should not be used.
3415
3416 -\FAILURE
3417 -Fails on division by zero.
3418 +\ENDDOC
3419 +\DOC{achieves}
3420 +
3421 +\TYPE {\small\verb%achieves : (thm -> goal -> bool)%}\egroup
3422 +
3423 +\SYNOPSIS
3424 +This function is for internal use only and is to be deleted from a future
3425 +version of the system. It should not be used.
3426
3427 \ENDDOC
3428 -\DOC{\char'136}
3429 +\DOC{aconv}
3430
3431 -\TYPE {\small\verb%$^ : (string -> string -> string)%}\egroup
3432 +\TYPE {\small\verb%aconv : (term -> term -> bool)%}\egroup
3433
3434 \SYNOPSIS
3435 -Concatenates two ML strings.
3436 +Tests for alpha-convertibility of terms.
3437
3438 \DESCRIBE
3439 -The {\small\verb%^%} is the ML infix string concatenation operator.
3440 -If {\small\verb%s1%} and {\small\verb%s2%} are strings, then {\small\verb%s1^s2%} gives a string which is their
3441 -concatenation.
3442 +When applied to two terms, {\small\verb%aconv%} returns {\small\verb%true%} if they are
3443 +alpha-convertible, and {\small\verb%false%} otherwise.
3444
3445 \FAILURE
3446 Never fails.
3447
3448 \EXAMPLE
3449 +A simple case of alpha-convertibility is the renaming of a single quantified
3450 +variable:
3451 {\par\samepage\setseps\small
3452 \begin{verbatim}
3453 -#`Hello `^`world`;;
3454 -`Hello world` : string
3455 + #aconv "?x. x=T" "?y. y=T";;
3456 + true : bool
3457 \end{verbatim}
3458 }
3459 -\COMMENTS
3460 -The ML role of the {\small\verb%^%} operator should not be confused with its use in
3461 -quoted terms to introduce antiquotation (see DESCRIPTION for details).
3462 -
3463 \SEEALSO
3464 -concat, concatl.
3465 +ALPHA, ALPHA_CONV.
3466
3467 \ENDDOC
3468 -\DOC{<}
3469 +\DOC{activate\_binders}
3470
3471 -\TYPE {\small\verb%$< : ((int # int) -> bool)%}\egroup
3472 +\TYPE {\small\verb%activate_binders : (string -> string list)%}\egroup
3473
3474 \SYNOPSIS
3475 -Performs a less-than test on ML integers.
3476 +Makes the quotation parser treat all binders in the current theory segment as
3477 +such.
3478 +
3479 +\DESCRIBE
3480 +The call
3481 +{\par\samepage\setseps\small
3482 +\begin{verbatim}
3483 + activate_binders `thy`
3484 +\end{verbatim}
3485 +}
3486 +\noindent where {\small\verb%thy%} is an ancestor theory ({\small\verb%`-`%} stands for the current
3487 +theory), will return a list of all binders on that theory, and make the parser
3488 +treat them all as binders, that is, for each binder {\small\verb%b%}, will allow the
3489 +syntactic sugaring {\small\verb%"b x. y"%} as a shorthand for {\small\verb%"b (\x. y)"%}. The special
3490 +syntactic status may be suppressed by preceding {\small\verb%b%} with a dollar sign. The
3491 +function returns a list of all the binders dealt with.
3492
3493 \FAILURE
3494 Never fails.
3495
3496 +\COMMENTS
3497 +This function is mainly intended for internal use. All binders declared by
3498 +{\small\verb%new_binder%} or {\small\verb%new_binder_definition%} are always parsed as such anyway.
3499 +
3500 +\SEEALSO
3501 +activate_all_binders, binders, new_binder, parse_as_binder.
3502 +
3503 \ENDDOC
3504 -\DOC{<<}
3505 +\DOC{ADD\_ASSUM}
3506
3507 -\TYPE {\small\verb%$<< : ((* # **) -> bool)%}\egroup
3508 +\TYPE {\small\verb%ADD_ASSUM : (term -> thm -> thm)%}\egroup
3509
3510 \SYNOPSIS
3511 -Performs a lexical comparison of values.
3512 +Adds an assumption to a theorem.
3513
3514 \DESCRIBE
3515 -{\small\verb%$<<%} performs a fast ordering on values. It is substitutive with
3516 -respect to equality in ML (i.e. if {\small\verb%x << y%} and {\small\verb%x = x'%} and {\small\verb%y = y'%}
3517 -then {\small\verb%x' << y'%}).
3518 +When applied to a boolean term {\small\verb%s%} and a theorem {\small\verb%A |- t%}, the inference
3519 +rule {\small\verb%ADD_ASSUM%} returns the theorem {\small\verb%A u {s} |- t%}.
3520 +{\par\samepage\setseps\small
3521 +\begin{verbatim}
3522 + A |- t
3523 + -------------- ADD_ASSUM "s"
3524 + A u {s} |- t
3525 +\end{verbatim}
3526 +}
3527 +\noindent {\small\verb%ADD_ASSUM%} performs straightforward set union with the new
3528 +assumption; it checks for identical assumptions, but not for alpha-equivalent
3529 +ones. The position at which the new assumption is inserted into the assumption
3530 +list should not be relied on.
3531
3532 \FAILURE
3533 -Never fails.
3534 -
3535 -\USES
3536 -It is often useful, for example in normalizing terms in some way, to be able to
3537 -impose some arbitrary (but definite) ordering on ML values.
3538 +Fails unless the given term has type {\small\verb%bool%}.
3539
3540 \SEEALSO
3541 -=.
3542 +ASSUME, UNDISCH.
3543
3544 \ENDDOC
3545 -\DOC{=}
3546 +\DOC{ADD\_CONV}
3547
3548 -\TYPE {\small\verb%$= : ((* # *) -> bool)%}\egroup
3549 +\TYPE {\small\verb%ADD_CONV : conv%}\egroup
3550
3551 \SYNOPSIS
3552 -Performs an equality test on two ML values.
3553 +Computes the sum of two natural number constants.
3554
3555 \DESCRIBE
3556 -{\small\verb%$=%} works as expected on non-function types. It may give unexpected results
3557 -when applied to function types (or types containing them, such as a pair of
3558 -functions), and should be considered unreliable in those situations.
3559 +If {\small\verb%n%} and {\small\verb%m%} are numeral constants (e.g. {\small\verb%0%}, {\small\verb%1%}, {\small\verb%2%}, {\small\verb%3%},...), then
3560 +{\small\verb%ADD_CONV "n + m"%} returns the theorem:
3561 +{\par\samepage\setseps\small
3562 +\begin{verbatim}
3563 + |- n + m = s
3564 +\end{verbatim}
3565 +}
3566 +\noindent where {\small\verb%s%} is the numeral that denotes the sum of the natural
3567 +numbers denoted by {\small\verb%n%} and {\small\verb%m%}.
3568
3569 \FAILURE
3570 -Never fails.
3571 +{\small\verb%ADD_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"n + m"%}, where {\small\verb%n%} and
3572 +{\small\verb%m%} are numerals.
3573
3574 \EXAMPLE
3575 {\par\samepage\setseps\small
3576 \begin{verbatim}
3577 -#1 = 2;;
3578 -false : bool
3579 -
3580 -#1 = 1;;
3581 -true : bool
3582 -
3583 -#let f x = x + 1 and g x = x + 2;;
3584 -f = - : (int -> int)
3585 -g = - : (int -> int)
3586 -
3587 -#let f' = f and h x = f x and h' x = x + 1;;
3588 -f' = - : (int -> int)
3589 -h = - : (int -> int)
3590 -h' = - : (int -> int)
3591 -
3592 -#f=f;;
3593 -true : bool
3594 -
3595 -#f = f';;
3596 -true : bool
3597 -
3598 -#f = g;;
3599 -false : bool
3600 -
3601 -#f =h;;
3602 -false : bool
3603 -
3604 -#f=h';;
3605 -false : bool
3606 -
3607 -#h = h';;
3608 -false : bool
3609 +#ADD_CONV "75 + 25";;
3610 +|- 75 + 25 = 100
3611 \end{verbatim}
3612 }
3613 \ENDDOC
3614 -\DOC{>}
3615 -
3616 -\TYPE {\small\verb%$> : ((int # int) -> bool)%}\egroup
3617 -
3618 -\SYNOPSIS
3619 -Performs a greater-than test on ML integers.
3620 -
3621 -\FAILURE
3622 -Never fails.
3623 -
3624 -\ENDDOC
3625 -\DOC{\char'100}
3626 +\DOC{ALL\_CONV}
3627
3628 -\TYPE {\small\verb%$@ : ((* list # * list) -> * list)%}\egroup
3629 +\TYPE {\small\verb%ALL_CONV : conv%}\egroup
3630
3631 \SYNOPSIS
3632 -Concatenates two lists.
3633 +Conversion that always succeeds and leaves a term unchanged.
3634
3635 \DESCRIBE
3636 -{\small\verb%@%} is an infix operator which concatenates two lists.
3637 +When applied to a term {\small\verb%"t"%}, the conversion {\small\verb%ALL_CONV%} returns the
3638 +theorem {\small\verb%|- t = t%}.
3639
3640 \FAILURE
3641 Never fails.
3642
3643 -\EXAMPLE
3644 -{\par\samepage\setseps\small
3645 -\begin{verbatim}
3646 -#[1;2;3] @ [4;5;6];;
3647 -[1; 2; 3; 4; 5; 6] : int list
3648 -\end{verbatim}
3649 -}
3650 +\USES
3651 +Identity element for {\small\verb%THENC%}.
3652 +
3653 \SEEALSO
3654 -append.
3655 +NO_CONV, REFL.
3656
3657 \ENDDOC
3658 -\DOC{ABS}
3659 +\DOC{ALL\_EL\_CONV}
3660
3661 -\TYPE {\small\verb%ABS : (term -> thm -> thm)%}\egroup
3662 +\TYPE {\small\verb%ALL_EL_CONV : conv -> conv%}\egroup
3663
3664 \SYNOPSIS
3665 -Abstracts both sides of an equation.
3666 +Computes by inference the result of applying a predicate to elements of a list.
3667
3668 \DESCRIBE
3669 +{\small\verb%ALL_EL_CONV%} takes a conversion {\small\verb%conv%} and a term {\small\verb%tm%} in the following form:
3670 {\par\samepage\setseps\small
3671 \begin{verbatim}
3672 - A |- t1 = t2
3673 - ------------------------ ABS "x" [Where x is not free in A]
3674 - A |- (\x.t1) = (\x.t2)
3675 -\end{verbatim}
3676 -}
3677 -\FAILURE
3678 -If the theorem is not an equation, or if the variable {\small\verb%x%} is free in the
3679 -assumptions {\small\verb%A%}.
3680 -
3681 -\EXAMPLE
3682 -{\par\samepage\setseps\small
3683 -\begin{verbatim}
3684 -#ABS "m:num" (REFL "m:num");;
3685 -|- (\m. m) = (\m. m)
3686 + ALL_EL P [x0;...xn]
3687 \end{verbatim}
3688 }
3689 -\SEEALSO
3690 -ETA_CONV, EXT, MK_ABS.
3691 -
3692 -\ENDDOC
3693 -\DOC{ABS\_CONV}
3694 -
3695 -\TYPE {\small\verb%ABS_CONV : (conv -> conv)%}\egroup
3696 -
3697 -\SYNOPSIS
3698 -Applies a conversion to the body of an abstraction.
3699 -
3700 -\DESCRIBE
3701 -If {\small\verb%c%} is a conversion that maps a term {\small\verb%"t"%} to the theorem {\small\verb%|- t = t'%}, then
3702 -the conversion {\small\verb%ABS_CONV c%} maps abstractions of the form {\small\verb%"\x.t"%} to theorems
3703 -of the form:
3704 +\noindent It returns the theorem
3705 {\par\samepage\setseps\small
3706 \begin{verbatim}
3707 - |- (\x.t) = (\x.t')
3708 + |- ALL_EL P [x0;...xn] = T
3709 \end{verbatim}
3710 }
3711 -\noindent That is, {\small\verb%ABS_CONV c "\x.t"%} applies {\small\verb%c%} to the body of the
3712 -abstraction {\small\verb%"\x.t"%}.
3713 -
3714 -\FAILURE
3715 -{\small\verb%ABS_CONV c tm%} fails if {\small\verb%tm%} is not an abstraction or if {\small\verb%tm%} has the form
3716 -{\small\verb%"\x.t"%} but the conversion {\small\verb%c%} fails when applied to the term {\small\verb%t%}. The
3717 -function returned by {\small\verb%ABS_CONV c%} may also fail if the ML function
3718 -{\small\verb%c:term->thm%} is not, in fact, a conversion (i.e. a function that maps a term
3719 -{\small\verb%t%} to a theorem {\small\verb%|- t = t'%}).
3720 -
3721 -\EXAMPLE
3722 +\noindent if for every {\small\verb%xi%} occurred in the list, {\small\verb%conv "P xi"%} returns a theorem {\small\verb%|- P xi = T%}, otherwise, if for at least one {\small\verb%xi%}, evaluating
3723 +{\small\verb%conv "P xi"%} returns the theorem {\small\verb%|- P xi = F%}, then it returns the theorem
3724 {\par\samepage\setseps\small
3725 \begin{verbatim}
3726 -#ABS_CONV SYM_CONV "\x. 1 = x";;
3727 -|- (\x. 1 = x) = (\x. x = 1)
3728 + |- ALL_EL P [x0;...xn] = F
3729 \end{verbatim}
3730 }
3731 -\SEEALSO
3732 -RAND_CONV, RATOR_CONV, SUB_CONV.
3733 -
3734 -\ENDDOC
3735 -\DOC{abs\_goals}
3736 -
3737 -\TYPE {\small\verb%abs_goals : (subgoals list -> goalstack)%}\egroup
3738 -
3739 -\SYNOPSIS
3740 -This function is for internal use only and is to be deleted from a future
3741 -version of the system. It should not be used.
3742 -
3743 -\ENDDOC
3744 -\DOC{ACCEPT\_TAC}
3745 -
3746 -\TYPE {\small\verb%ACCEPT_TAC : thm_tactic%}\egroup
3747 -
3748 -\SYNOPSIS
3749 -Solves a goal if supplied with the desired theorem (up to alpha-conversion).
3750 -
3751 -\DESCRIBE
3752 -{\small\verb%ACCEPT_TAC%} maps a given theorem {\small\verb%th%} to a tactic that solves any goal whose
3753 -conclusion is alpha-convertible to the conclusion of {\small\verb%th%}.
3754
3755 \FAILURE
3756 -{\small\verb%ACCEPT_TAC th (A,g)%} fails if the term {\small\verb%g%} is not alpha-convertible to the
3757 -conclusion of the supplied theorem {\small\verb%th%}.
3758 +{\small\verb%ALL_EL_CONV conv tm%} fails if {\small\verb%tm%} is not of the form described above, or
3759 +failure occurs when evaluating {\small\verb%conv "P xi"%} for some {\small\verb%xi%}.
3760
3761 \EXAMPLE
3762 -{\small\verb%ACCEPT_TAC%} applied to the axiom
3763 +Evaluating
3764 {\par\samepage\setseps\small
3765 \begin{verbatim}
3766 - BOOL_CASES_AX = |- !t. (t = T) \/ (t = F)
3767 + ALL_EL_CONV bool_EQ_CONV "ALL_EL ($= T) [T;F;T]";;
3768 \end{verbatim}
3769 }
3770 -\noindent will solve the goal
3771 +\noindent returns the following theorem:
3772 {\par\samepage\setseps\small
3773 \begin{verbatim}
3774 - ?- !x. (x = T) \/ (x = F)
3775 + |- ALL_EL($= T)[T;F;T] = F
3776 \end{verbatim}
3777 }
3778 -\noindent but will fail on the goal
3779 +\noindent In general, if the predicate {\small\verb%P%} is an explicit lambda abstraction
3780 +{\small\verb%(\x. P x)%}, the conversion should be in the form
3781 {\par\samepage\setseps\small
3782 \begin{verbatim}
3783 - ?- !x. (x = F) \/ (x = T)
3784 + (BETA_CONV THENC conv')
3785 \end{verbatim}
3786 }
3787 -\USES
3788 -Used for completing proofs by supplying an existing theorem, such as an axiom,
3789 -or a lemma already proved.
3790
3791 \SEEALSO
3792 -MATCH_ACCEPT_TAC.
3793 -
3794 -\ENDDOC
3795 -\DOC{achieves}
3796 -
3797 -\TYPE {\small\verb%achieves : (thm -> goal -> bool)%}\egroup
3798 -
3799 -\SYNOPSIS
3800 -This function is for internal use only and is to be deleted from a future
3801 -version of the system. It should not be used.
3802 +SOME_EL_CONV, IS_EL_CONV, FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV.
3803
3804 \ENDDOC
3805 -\DOC{achieve\_first}
3806 -
3807 -\TYPE {\small\verb%achieve_first : (subgoals -> thm -> subgoals)%}\egroup
3808
3809 -\SYNOPSIS
3810 -This function is for internal use only and is to be deleted from a future
3811 -version of the system. It should not be used.
3812 -
3813 -\ENDDOC
3814 -\DOC{aconv}
3815 +\DOC{allowed\_constant}
3816
3817 -\TYPE {\small\verb%aconv : (term -> term -> bool)%}\egroup
3818 +\TYPE {\small\verb%allowed_constant : (string -> bool)%}\egroup
3819
3820 \SYNOPSIS
3821 -Tests for alpha-convertibility of terms.
3822 +Tests if a string has a permissible name for a constant.
3823
3824 \DESCRIBE
3825 -When applied to two terms, {\small\verb%aconv%} returns {\small\verb%true%} if they are
3826 -alpha-convertible, and {\small\verb%false%} otherwise.
3827 +When applied to a string, {\small\verb%allowed_constant%} returns {\small\verb%true%} if the string is a
3828 +permissible constant name, that is, if it is an identifier (see the DESCRIPTION
3829 +for more details), and {\small\verb%false%} otherwise.
3830
3831 \FAILURE
3832 Never fails.
3833
3834 \EXAMPLE
3835 -A simple case of alpha-convertibility is the renaming of a single quantified
3836 -variable:
3837 +The following shows how the lexical rules can be altered:
3838 {\par\samepage\setseps\small
3839 \begin{verbatim}
3840 - #aconv "?x. x=T" "?y. y=T";;
3841 - true : bool
3842 + #map allowed_constant [`pi`; `@`; `a name`; `+++++`; `*`];;
3843 + [true; true; false; false; true] : bool list
3844 +
3845 + #new_special_symbol `+++++`;;
3846 + () : void
3847 +
3848 + #map allowed_constant [`pi`; `@`; `a name`; `+++++`; `*`];;
3849 + [true; true; false; true; true] : bool list
3850 \end{verbatim}
3851 }
3852 +\COMMENTS
3853 +Note that this function only performs a lexical test; it does not check whether
3854 +there is already a constant of that name in the current theory.
3855 +
3856 \SEEALSO
3857 -ALPHA, ALPHA_CONV.
3858 +constants, is_constant, new_alphanum, new_special_symbol, special_symbols.
3859
3860 \ENDDOC
3861 -\DOC{activate\_binders}
3862 +\DOC{ALL\_TAC}
3863
3864 -\TYPE {\small\verb%activate_binders : (string -> string list)%}\egroup
3865 +\TYPE {\small\verb%ALL_TAC : tactic%}\egroup
3866
3867 \SYNOPSIS
3868 -Makes the quotation parser treat all binders in the current theory segment as
3869 -such.
3870 +Passes on a goal unchanged.
3871
3872 \DESCRIBE
3873 -The call
3874 -{\par\samepage\setseps\small
3875 -\begin{verbatim}
3876 - activate_binders `thy`
3877 -\end{verbatim}
3878 -}
3879 -\noindent where {\small\verb%thy%} is an ancestor theory ({\small\verb%`-`%} stands for the current
3880 -theory), will return a list of all binders on that theory, and make the parser
3881 -treat them all as binders, that is, for each binder {\small\verb%b%}, will allow the
3882 -syntactic sugaring {\small\verb%"b x. y"%} as a shorthand for {\small\verb%"b (\x. y)"%}. The special
3883 -syntactic status may be suppressed by preceding {\small\verb%b%} with a dollar sign. The
3884 -function returns a list of all the binders dealt with.
3885 +{\small\verb%ALL_TAC%} applied to a goal {\small\verb%g%} simply produces the subgoal list {\small\verb%[g]%}. It is
3886 +the identity for the {\small\verb%THEN%} tactical.
3887
3888 \FAILURE
3889 Never fails.
3890
3891 -\COMMENTS
3892 -This function is mainly intended for internal use. All binders declared by
3893 -{\small\verb%new_binder%} or {\small\verb%new_binder_definition%} are always parsed as such anyway.
3894 +\EXAMPLE
3895 +The tactic {\small\verb%INDUCT_TAC THENL [ALL_TAC;tac]%}, applied to a goal {\small\verb%g%}, applies
3896 +{\small\verb%INDUCT_TAC%} to {\small\verb%g%} to give a basis and step subgoal; it then returns the
3897 +basis unchanged, along with the subgoals produced by applying {\small\verb%tac%} to the
3898 +step.
3899 +
3900 +\USES
3901 +Used to write tacticals such as {\small\verb%REPEAT%}.
3902 +Often used as a place-holder in building compound tactics using tacticals
3903 +such as {\small\verb%THENL%}.
3904
3905 \SEEALSO
3906 -activate_all_binders, binders, new_binder, parse_as_binder.
3907 +NO_TAC, REPEAT, THENL.
3908
3909 \ENDDOC
3910 -\DOC{AC\_CONV}
3911 +\DOC{ALL\_THEN}
3912
3913 -\TYPE {\small\verb%AC_CONV : ((thm # thm) -> conv)%}\egroup
3914 +\TYPE {\small\verb%ALL_THEN : thm_tactical%}\egroup
3915
3916 \SYNOPSIS
3917 -Proves equality of terms using associative and commutative laws.
3918 +Passes a theorem unchanged to a theorem-tactic.
3919
3920 \DESCRIBE
3921 -Suppose {\small\verb%_%} is a function, which is assumed to be infix in the following syntax,
3922 -and {\small\verb%ath%} and {\small\verb%cth%} are theorems expressing its associativity and
3923 -commutativity; they must be of the following form, except that any free
3924 -variables may have arbitrary names and may be universally quantified:
3925 -{\par\samepage\setseps\small
3926 -\begin{verbatim}
3927 - ath = |- m _ (n _ p) = (m _ n) _ p
3928 - cth = |- m _ n = n _ m
3929 -\end{verbatim}
3930 -}
3931 -\noindent Then the conversion {\small\verb%AC_CONV(ath,cth)%} will prove equations whose
3932 -left and right sides can be made identical using these associative and
3933 -commutative laws.
3934 +For any theorem-tactic {\small\verb%ttac%} and theorem {\small\verb%th%}, the application {\small\verb%ALL_THEN ttac
3935 +th%} results simply in {\small\verb%ttac th%}, that is, the theorem is passed unchanged to
3936 +the theorem-tactic. {\small\verb%ALL_THEN%} is the identity theorem-tactical.
3937
3938 \FAILURE
3939 -Fails if the associative or commutative law has an invalid form, or if the
3940 -term is not an equation between AC-equivalent terms.
3941 -
3942 -\EXAMPLE
3943 -{\par\samepage\setseps\small
3944 -\begin{verbatim}
3945 - #AC_CONV(ADD_ASSOC,ADD_SYM)
3946 - # "x + (SUC t) + ((3 + y) + z) = 3 + (SUC t) + x + y + z";;
3947 - |- (x + ((SUC t) + ((3 + y) + z)) = 3 + ((SUC t) + (x + (y + z)))) = T
3948 -\end{verbatim}
3949 -}
3950 +The application of {\small\verb%ALL_THEN%} to a theorem-tactic never fails. The resulting
3951 +theorem-tactic fails under exactly the same conditions as the original one
3952
3953 -\COMMENTS
3954 -Note that the preproved associative and commutative laws for the operators {\small\verb%+%},
3955 -{\small\verb%*%}, {\small\verb%/\%} and {\small\verb%\/%} are already in the right form to give to {\small\verb%AC_CONV%}.
3956 +\USES
3957 +Writing compound tactics or tacticals, e.g. terminating list iterations
3958 +of theorem-tacticals.
3959
3960 \SEEALSO
3961 -SYM_CONV.
3962 +ALL_TAC, FAIL_TAC, NO_TAC, NO_THEN, THEN_TCL, ORELSE_TCL.
3963
3964 \ENDDOC
3965 -\DOC{ADD\_ASSUM}
3966 +\DOC{ALPHA\_CONV}
3967
3968 -\TYPE {\small\verb%ADD_ASSUM : (term -> thm -> thm)%}\egroup
3969 +\TYPE {\small\verb%ALPHA_CONV : (term -> conv)%}\egroup
3970
3971 \SYNOPSIS
3972 -Adds an assumption to a theorem.
3973 +Renames the bound variable of a lambda-abstraction.
3974
3975 \DESCRIBE
3976 -When applied to a boolean term {\small\verb%s%} and a theorem {\small\verb%A |- t%}, the inference
3977 -rule {\small\verb%ADD_ASSUM%} returns the theorem {\small\verb%A u {s} |- t%}.
3978 +If {\small\verb%"x"%} is a variable of type {\small\verb%ty%} and {\small\verb%"\y.t"%} is an abstraction in which
3979 +the bound variable {\small\verb%y%} also has type {\small\verb%ty%}, then {\small\verb%ALPHA_CONV "x" "\y.t"%}
3980 +returns the theorem:
3981 {\par\samepage\setseps\small
3982 \begin{verbatim}
3983 - A |- t
3984 - -------------- ADD_ASSUM "s"
3985 - A u {s} |- t
3986 + |- (\y.t) = (\x'. t[x'/y])
3987 \end{verbatim}
3988 }
3989 -\noindent {\small\verb%ADD_ASSUM%} performs straightforward set union with the new
3990 -assumption; it checks for identical assumptions, but not for alpha-equivalent
3991 -ones. The position at which the new assumption is inserted into the assumption
3992 -list should not be relied on.
3993 +\noindent where the variable {\small\verb%x':ty%} is a primed variant of {\small\verb%x%} chosen so
3994 +as not to be free in {\small\verb%"\y.t"%}.
3995
3996 \FAILURE
3997 -Fails unless the given term has type {\small\verb%bool%}.
3998 +{\small\verb%ALPHA_CONV "x" "tm"%} fails if {\small\verb%x%} is not a variable, if {\small\verb%tm%} is not an
3999 +abstraction, or if {\small\verb%x%} is a variable {\small\verb%v%} and {\small\verb%tm%} is a lambda abstraction
4000 +{\small\verb%\y.t%} but the types of {\small\verb%v%} and {\small\verb%y%} differ.
4001
4002 \SEEALSO
4003 -ASSUME, UNDISCH.
4004 +ALPHA, GEN_ALPHA_CONV.
4005
4006 \ENDDOC
4007 -\DOC{ADD\_CONV}
4008 +\DOC{ALPHA}
4009
4010 -\TYPE {\small\verb%ADD_CONV : conv%}\egroup
4011 +\TYPE {\small\verb%ALPHA : (term -> term -> thm)%}\egroup
4012
4013 \SYNOPSIS
4014 -Computes the sum of two natural number constants.
4015 +Proves equality of alpha-equivalent terms.
4016
4017 \DESCRIBE
4018 -If {\small\verb%n%} and {\small\verb%m%} are numeral constants (e.g. {\small\verb%0%}, {\small\verb%1%}, {\small\verb%2%}, {\small\verb%3%},...), then
4019 -{\small\verb%ADD_CONV "n + m"%} returns the theorem:
4020 +When applied to a pair of terms {\small\verb%t1%} and {\small\verb%t1'%} which are
4021 +alpha-equivalent, {\small\verb%ALPHA%} returns the theorem {\small\verb%|- t1 = t1'%}.
4022 {\par\samepage\setseps\small
4023 \begin{verbatim}
4024 - |- n + m = s
4025 +
4026 + ------------- ALPHA "t1" "t1'"
4027 + |- t1 = t1'
4028 \end{verbatim}
4029 }
4030 -\noindent where {\small\verb%s%} is the numeral that denotes the sum of the natural
4031 -numbers denoted by {\small\verb%n%} and {\small\verb%m%}.
4032 -
4033 \FAILURE
4034 -{\small\verb%ADD_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"n + m"%}, where {\small\verb%n%} and
4035 -{\small\verb%m%} are numerals.
4036 +Fails unless the terms provided are alpha-equivalent.
4037
4038 \EXAMPLE
4039 {\par\samepage\setseps\small
4040 \begin{verbatim}
4041 -#ADD_CONV "75 + 25";;
4042 -|- 75 + 25 = 100
4043 +#ALPHA "!x:num. x = x" "!y:num. y = y";;
4044 +|- (!x. x = x) = (!y. y = y)
4045 \end{verbatim}
4046 }
4047 +\COMMENTS
4048 +The system shows the type of {\small\verb%ALPHA%} as {\small\verb%term -> conv%}.
4049 +
4050 +\SEEALSO
4051 +aconv, ALPHA_CONV, GEN_ALPHA_CONV.
4052 +
4053 \ENDDOC
4054 -\DOC{allowed\_constant}
4055 +\DOC{ancestors}
4056
4057 -\TYPE {\small\verb%allowed_constant : (string -> bool)%}\egroup
4058 +\TYPE {\small\verb%ancestors : (string -> string list)%}\egroup
4059
4060 \SYNOPSIS
4061 -Tests if a string has a permissible name for a constant.
4062 +Gets a list of the (proper) ancestors of a theory.
4063
4064 \DESCRIBE
4065 -When applied to a string, {\small\verb%allowed_constant%} returns {\small\verb%true%} if the string is a
4066 -permissible constant name, that is, if it is an identifier (see the DESCRIPTION
4067 -for more details), and {\small\verb%false%} otherwise.
4068 +A call to {\small\verb%ancestors `th`%} returns a list of all the proper ancestors (i.e.
4069 +parents, parents of parents, etc.) of the theory {\small\verb%th%}.
4070
4071 \FAILURE
4072 -Never fails.
4073 -
4074 -\EXAMPLE
4075 -The following shows how the lexical rules can be altered:
4076 -{\par\samepage\setseps\small
4077 -\begin{verbatim}
4078 - #map allowed_constant [`pi`; `@`; `a name`; `+++++`; `*`];;
4079 - [true; true; false; false; true] : bool list
4080 -
4081 - #new_special_symbol `+++++`;;
4082 - () : void
4083 -
4084 - #map allowed_constant [`pi`; `@`; `a name`; `+++++`; `*`];;
4085 - [true; true; false; true; true] : bool list
4086 -\end{verbatim}
4087 -}
4088 -\COMMENTS
4089 -Note that this function only performs a lexical test; it does not check whether
4090 -there is already a constant of that name in the current theory.
4091 +Fails if `th` is not an ancestor of the current theory.
4092
4093 \SEEALSO
4094 -constants, is_constant, new_alphanum, new_special_symbol, special_symbols.
4095 +ancestry, parents.
4096
4097 \ENDDOC
4098 -\DOC{ALL\_CONV}
4099 +\DOC{ancestry}
4100
4101 -\TYPE {\small\verb%ALL_CONV : conv%}\egroup
4102 +\TYPE {\small\verb%ancestry : (void -> string list)%}\egroup
4103
4104 \SYNOPSIS
4105 -Conversion that always succeeds and leaves a term unchanged.
4106 +Gets a list of the ancestors of the current theory.
4107
4108 \DESCRIBE
4109 -When applied to a term {\small\verb%"t"%}, the conversion {\small\verb%ALL_CONV%} returns the
4110 -theorem {\small\verb%|- t = t%}.
4111 +A call {\small\verb%ancestry()%} returns a list of all the ancestors of the current theory,
4112 +i.e. the current theory itself, its parents, parents of parents, etc.
4113
4114 \FAILURE
4115 Never fails.
4116
4117 -\USES
4118 -Identity element for {\small\verb%THENC%}.
4119 +\COMMENTS
4120 +The call {\small\verb%ancestry()%} is considerably more efficient than {\small\verb%ancestors `-`%}.
4121
4122 \SEEALSO
4123 -NO_CONV, REFL.
4124 +ancestors, parents.
4125
4126 \ENDDOC
4127 -\DOC{ALL\_EL\_CONV}
4128 +\DOC{AND\_EXISTS\_CONV}
4129
4130 -\TYPE {\small\verb%ALL_EL_CONV : conv -> conv%}\egroup
4131 +\TYPE {\small\verb%AND_EXISTS_CONV : conv%}\egroup
4132
4133 \SYNOPSIS
4134 -Computes by inference the result of applying a predicate to elements of a list.
4135 +Moves an existential quantification outwards through a conjunction.
4136
4137 \DESCRIBE
4138 -{\small\verb%ALL_EL_CONV%} takes a conversion {\small\verb%conv%} and a term {\small\verb%tm%} in the following form:
4139 +When applied to a term of the form {\small\verb%(?x.P) /\ (?x.Q)%}, where {\small\verb%x%} is free
4140 +in neither {\small\verb%P%} nor {\small\verb%Q%}, {\small\verb%AND_EXISTS_CONV%} returns the theorem:
4141 {\par\samepage\setseps\small
4142 \begin{verbatim}
4143 - ALL_EL P [x0;...xn]
4144 + |- (?x. P) /\ (?x. Q) = (?x. P /\ Q)
4145 \end{verbatim}
4146 }
4147 -\noindent It returns the theorem
4148 +\FAILURE
4149 +{\small\verb%AND_EXISTS_CONV%} fails if it is applied to a term not of the form
4150 +{\small\verb%(?x.P) /\ (?x.Q)%}, or if it is applied to a term {\small\verb%(?x.P) /\ (?x.Q)%}
4151 +in which the variable {\small\verb%x%} is free in either {\small\verb%P%} or {\small\verb%Q%}.
4152 +
4153 +\SEEALSO
4154 +EXISTS_AND_CONV, LEFT_AND_EXISTS_CONV, RIGHT_AND_EXISTS_CONV.
4155 +
4156 +\ENDDOC
4157 +\DOC{AND\_FORALL\_CONV}
4158 +
4159 +\TYPE {\small\verb%AND_FORALL_CONV : conv%}\egroup
4160 +
4161 +\SYNOPSIS
4162 +Moves a universal quantification outwards through a conjunction.
4163 +
4164 +\DESCRIBE
4165 +When applied to a term of the form {\small\verb%(!x.P) /\ (!x.Q)%}, the conversion
4166 +{\small\verb%AND_FORALL_CONV%} returns the theorem:
4167 {\par\samepage\setseps\small
4168 \begin{verbatim}
4169 - |- ALL_EL P [x0;...xn] = T
4170 + |- (!x.P) /\ (!x.Q) = (!x. P /\ Q)
4171 \end{verbatim}
4172 }
4173 -\noindent if for every {\small\verb%xi%} occurred in the list, {\small\verb%conv "P xi"%} returns a theorem {\small\verb%|- P xi = T%}, otherwise, if for at least one {\small\verb%xi%}, evaluating
4174 -{\small\verb%conv "P xi"%} returns the theorem {\small\verb%|- P xi = F%}, then it returns the theorem
4175 +\FAILURE
4176 +Fails if applied to a term not of the form {\small\verb%(!x.P) /\ (!x.Q)%}.
4177 +
4178 +\SEEALSO
4179 +FORALL_AND_CONV, LEFT_AND_FORALL_CONV, RIGHT_AND_FORALL_CONV.
4180 +
4181 +\ENDDOC
4182 +\DOC{ANTE\_CONJ\_CONV}
4183 +
4184 +\TYPE {\small\verb%ANTE_CONJ_CONV : conv%}\egroup
4185 +
4186 +\SYNOPSIS
4187 +Eliminates a conjunctive antecedent in favour of implication.
4188 +
4189 +\DESCRIBE
4190 +When applied to a term of the form {\small\verb%"(t1 /\ t2) ==> t"%}, the conversion
4191 +{\small\verb%ANTE_CONJ_CONV%} returns the theorem:
4192 {\par\samepage\setseps\small
4193 \begin{verbatim}
4194 - |- ALL_EL P [x0;...xn] = F
4195 + |- (t1 /\ t2 ==> t) = (t1 ==> t2 ==> t)
4196 \end{verbatim}
4197 }
4198 -
4199 \FAILURE
4200 -{\small\verb%ALL_EL_CONV conv tm%} fails if {\small\verb%tm%} is not of the form described above, or
4201 -failure occurs when evaluating {\small\verb%conv "P xi"%} for some {\small\verb%xi%}.
4202 +Fails if applied to a term not of the form {\small\verb%"(t1 /\ t2) ==> t"%}.
4203
4204 -\EXAMPLE
4205 -Evaluating
4206 +\USES
4207 +Somewhat ad-hoc, but can be used (with {\small\verb%CONV_TAC%}) to transform a goal of the
4208 +form {\small\verb%?- (P /\ Q) ==> R%} into the subgoal {\small\verb%?- P ==> (Q ==> R)%}, so that only
4209 +the antecedent {\small\verb%P%} is moved into the assumptions by {\small\verb%DISCH_TAC%}.
4210 +
4211 +\ENDDOC
4212 +\DOC{ANTE\_RES\_THEN}
4213 +
4214 +\TYPE {\small\verb%ANTE_RES_THEN : thm_tactical%}\egroup
4215 +
4216 +\SYNOPSIS
4217 +Resolves implicative assumptions with an antecedent.
4218 +
4219 +\DESCRIBE
4220 +Given a theorem-tactic {\small\verb%ttac%} and a theorem {\small\verb%A |- t%}, the function
4221 +{\small\verb%ANTE_RES_THEN%} produces a tactic that attempts to match {\small\verb%t%} to the antecedent
4222 +of each implication
4223 {\par\samepage\setseps\small
4224 \begin{verbatim}
4225 - ALL_EL_CONV bool_EQ_CONV "ALL_EL ($= T) [T;F;T]";;
4226 + Ai |- !x1...xn. ui ==> vi
4227 \end{verbatim}
4228 }
4229 -\noindent returns the following theorem:
4230 +\noindent (where {\small\verb%Ai%} is just {\small\verb%!x1...xn. ui ==> vi%}) that occurs among the
4231 +assumptions of a goal. If the antecedent {\small\verb%ui%} of any implication matches {\small\verb%t%},
4232 +then an instance of {\small\verb%Ai u A |- vi%} is obtained by specialization of the
4233 +variables {\small\verb%x1%}, ..., {\small\verb%xn%} and type instantiation, followed by an application of
4234 +modus ponens. Because all implicative assumptions are tried, this may result
4235 +in several modus-ponens consequences of the supplied theorem and the
4236 +assumptions. Tactics are produced using {\small\verb%ttac%} from all these theorems, and
4237 +these tactics are applied in sequence to the goal. That is,
4238 {\par\samepage\setseps\small
4239 \begin{verbatim}
4240 - |- ALL_EL($= T)[T;F;T] = F
4241 + ANTE_RES_THEN ttac (A |- t) g
4242 \end{verbatim}
4243 }
4244 -\noindent In general, if the predicate {\small\verb%P%} is an explicit lambda abstraction
4245 -{\small\verb%(\x. P x)%}, the conversion should be in the form
4246 +\noindent has the effect of:
4247 {\par\samepage\setseps\small
4248 \begin{verbatim}
4249 - (BETA_CONV THENC conv')
4250 + MAP_EVERY ttac [A1 u A |- v1; ...; Am u A |- vm] g
4251 \end{verbatim}
4252 }
4253 -
4254 -\SEEALSO
4255 -SOME_EL_CONV, IS_EL_CONV, FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV.
4256 -
4257 -\ENDDOC
4258 -
4259 -\DOC{ALL\_TAC}
4260 -
4261 -\TYPE {\small\verb%ALL_TAC : tactic%}\egroup
4262 -
4263 -\SYNOPSIS
4264 -Passes on a goal unchanged.
4265 -
4266 -\DESCRIBE
4267 -{\small\verb%ALL_TAC%} applied to a goal {\small\verb%g%} simply produces the subgoal list {\small\verb%[g]%}. It is
4268 -the identity for the {\small\verb%THEN%} tactical.
4269 -
4270 -\FAILURE
4271 -Never fails.
4272 -
4273 -\EXAMPLE
4274 -The tactic {\small\verb%INDUCT_TAC THENL [ALL_TAC;tac]%}, applied to a goal {\small\verb%g%}, applies
4275 -{\small\verb%INDUCT_TAC%} to {\small\verb%g%} to give a basis and step subgoal; it then returns the
4276 -basis unchanged, along with the subgoals produced by applying {\small\verb%tac%} to the
4277 -step.
4278 -
4279 -\USES
4280 -Used to write tacticals such as {\small\verb%REPEAT%}.
4281 -Often used as a place-holder in building compound tactics using tacticals
4282 -such as {\small\verb%THENL%}.
4283 -
4284 -\SEEALSO
4285 -NO_TAC, REPEAT, THENL.
4286 -
4287 -\ENDDOC
4288 -\DOC{ALL\_THEN}
4289 -
4290 -\TYPE {\small\verb%ALL_THEN : thm_tactical%}\egroup
4291 -
4292 -\SYNOPSIS
4293 -Passes a theorem unchanged to a theorem-tactic.
4294 -
4295 -\DESCRIBE
4296 -For any theorem-tactic {\small\verb%ttac%} and theorem {\small\verb%th%}, the application {\small\verb%ALL_THEN ttac
4297 -th%} results simply in {\small\verb%ttac th%}, that is, the theorem is passed unchanged to
4298 -the theorem-tactic. {\small\verb%ALL_THEN%} is the identity theorem-tactical.
4299 +\noindent where the theorems {\small\verb%Ai u A |- vi%} are all the consequences that can
4300 +be drawn by a (single) matching modus-ponens inference from the implications
4301 +that occur among the assumptions of the goal {\small\verb%g%} and the supplied theorem
4302 +{\small\verb%A |- t%}. Any negation {\small\verb%~v%} that appears among the assumptions of the goal is
4303 +treated as an implication {\small\verb%v ==> F%}. The sequence in which the theorems
4304 +{\small\verb%Ai u A |- vi%} are generated and the corresponding tactics applied is
4305 +unspecified.
4306
4307 \FAILURE
4308 -The application of {\small\verb%ALL_THEN%} to a theorem-tactic never fails. The resulting
4309 -theorem-tactic fails under exactly the same conditions as the original one
4310 -
4311 -\USES
4312 -Writing compound tactics or tacticals, e.g. terminating list iterations
4313 -of theorem-tacticals.
4314 +{\small\verb%ANTE_RES_THEN ttac (A |- t)%} fails when applied to a goal {\small\verb%g%} if any of the
4315 +tactics produced by {\small\verb%ttac (Ai u A |- vi)%}, where {\small\verb%Ai u A |- vi%} is the {\small\verb%i%}th
4316 +resolvent obtained from the theorem {\small\verb%A |- t%} and the assumptions of {\small\verb%g%}, fails
4317 +when applied in sequence to {\small\verb%g%}.
4318
4319 \SEEALSO
4320 -ALL_TAC, FAIL_TAC, NO_TAC, NO_THEN, THEN_TCL, ORELSE_TCL.
4321 +IMP_RES_TAC, IMP_RES_THEN, MATCH_MP, RES_TAC, RES_THEN.
4322
4323 \ENDDOC
4324 -\DOC{ALPHA}
4325 +\DOC{APPEND\_CONV}
4326
4327 -\TYPE {\small\verb%ALPHA : (term -> term -> thm)%}\egroup
4328 +\TYPE {\small\verb%APPEND_CONV : conv%}\egroup
4329
4330 \SYNOPSIS
4331 -Proves equality of alpha-equivalent terms.
4332 +Computes by inference the result of appending two object-language lists.
4333
4334 \DESCRIBE
4335 -When applied to a pair of terms {\small\verb%t1%} and {\small\verb%t1'%} which are
4336 -alpha-equivalent, {\small\verb%ALPHA%} returns the theorem {\small\verb%|- t1 = t1'%}.
4337 +For any pair of object language lists of the form {\small\verb%"[x1;...;xn]"%} and
4338 +{\small\verb%"[y1;...;ym]"%}, the result of evaluating
4339 {\par\samepage\setseps\small
4340 \begin{verbatim}
4341 -
4342 - ------------- ALPHA "t1" "t1'"
4343 - |- t1 = t1'
4344 + APPEND_CONV "APPEND [x1;...;xn] [y1;...;ym]"
4345 \end{verbatim}
4346 }
4347 -\FAILURE
4348 -Fails unless the terms provided are alpha-equivalent.
4349 -
4350 -\EXAMPLE
4351 +\noindent is the theorem
4352 {\par\samepage\setseps\small
4353 \begin{verbatim}
4354 -#ALPHA "!x:num. x = x" "!y:num. y = y";;
4355 -|- (!x. x = x) = (!y. y = y)
4356 + |- APPEND [x1;...;xn] [y1;...;ym] = [x1;...;xn;y1;...;ym]
4357 \end{verbatim}
4358 }
4359 -\COMMENTS
4360 -The system shows the type of {\small\verb%ALPHA%} as {\small\verb%term -> conv%}.
4361 +\noindent The length of either list (or both) may be 0.
4362
4363 -\SEEALSO
4364 -aconv, ALPHA_CONV, GEN_ALPHA_CONV.
4365 +\FAILURE
4366 +{\small\verb%APPEND_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"APPEND l1 l2"%}, where
4367 +{\small\verb%l1%} and {\small\verb%l2%} are (possibly empty) object-language lists of the forms
4368 +{\small\verb%"[x1;...;xn]"%} and {\small\verb%"[y1;...;ym]"%}.
4369
4370 \ENDDOC
4371 -\DOC{ALPHA\_CONV}
4372
4373 -\TYPE {\small\verb%ALPHA_CONV : (term -> conv)%}\egroup
4374 +\DOC{append}
4375 +
4376 +\TYPE {\small\verb%append : (* list -> * list -> * list)%}\egroup
4377
4378 \SYNOPSIS
4379 -Renames the bound variable of a lambda-abstraction.
4380 +Concatenates two lists.
4381
4382 \DESCRIBE
4383 -If {\small\verb%"x"%} is a variable of type {\small\verb%ty%} and {\small\verb%"\y.t"%} is an abstraction in which
4384 -the bound variable {\small\verb%y%} also has type {\small\verb%ty%}, then {\small\verb%ALPHA_CONV "x" "\y.t"%}
4385 -returns the theorem:
4386 -{\par\samepage\setseps\small
4387 -\begin{verbatim}
4388 - |- (\y.t) = (\x'. t[x'/y])
4389 -\end{verbatim}
4390 -}
4391 -\noindent where the variable {\small\verb%x':ty%} is a primed variant of {\small\verb%x%} chosen so
4392 -as not to be free in {\small\verb%"\y.t"%}.
4393 +{\small\verb%append [x1;...;xn] [y1;...;ym]%} returns {\small\verb%[x1;...;xn;y1;...;ym]%}.
4394
4395 \FAILURE
4396 -{\small\verb%ALPHA_CONV "x" "tm"%} fails if {\small\verb%x%} is not a variable, if {\small\verb%tm%} is not an
4397 -abstraction, or if {\small\verb%x%} is a variable {\small\verb%v%} and {\small\verb%tm%} is a lambda abstraction
4398 -{\small\verb%\y.t%} but the types of {\small\verb%v%} and {\small\verb%y%} differ.
4399 +Never fails.
4400
4401 -\SEEALSO
4402 -ALPHA, GEN_ALPHA_CONV.
4403 +\COMMENTS
4404 +Performs the same operation as {\small\verb%$@%}.
4405
4406 \ENDDOC
4407 -\DOC{ancestors}
4408 +\DOC{append\_openw}
4409
4410 -\TYPE {\small\verb%ancestors : (string -> string list)%}\egroup
4411 +\TYPE {\small\verb%append_openw : (string -> string)%}\egroup
4412
4413 \SYNOPSIS
4414 -Gets a list of the (proper) ancestors of a theory.
4415 +Opens a port for appending to a named file.
4416
4417 \DESCRIBE
4418 -A call to {\small\verb%ancestors `th`%} returns a list of all the proper ancestors (i.e.
4419 -parents, parents of parents, etc.) of the theory {\small\verb%th%}.
4420 -
4421 -\FAILURE
4422 -Fails if `th` is not an ancestor of the current theory.
4423 +When applied to a filename {\small\verb%`name`%}, the function {\small\verb%append_openw%} opens the file
4424 +{\small\verb%name%} for writing, such that existing contents are appended to rather than
4425 +overwritten. It returns a port descriptor string, which can be used by {\small\verb%write%}
4426 +to append to the file, and by {\small\verb%close%} to close it.
4427
4428 -\SEEALSO
4429 -ancestry, parents.
4430 +\EXAMPLE
4431 +The following example assumes that HOL is being run under Unix. It will
4432 +overwrite an existing file {\small\verb%test-file%} in the current directory.
4433 +{\par\samepage\setseps\small
4434 +\begin{verbatim}
4435 + #system `echo -n 'Hello ' >test-file`;;
4436 + 0 : int
4437
4438 -\ENDDOC
4439 -\DOC{ancestry}
4440 + #let port = append_openw `test-file`;;
4441 + port = `%test-file` : string
4442
4443 -\TYPE {\small\verb%ancestry : (void -> string list)%}\egroup
4444 + #write(port,`world`);;
4445 + () : void
4446
4447 -\SYNOPSIS
4448 -Gets a list of the ancestors of the current theory.
4449 + #close port;;
4450 + () : void
4451
4452 -\DESCRIBE
4453 -A call {\small\verb%ancestry()%} returns a list of all the ancestors of the current theory,
4454 -i.e. the current theory itself, its parents, parents of parents, etc.
4455 + #system `cat test-file`;;
4456 + Hello world0 : int
4457 +\end{verbatim}
4458 +}
4459 +\SEEALSO
4460 +close, openi, openw, read, write.
4461
4462 -\FAILURE
4463 -Never fails.
4464 +\ENDDOC
4465 +\DOC{apply\_proof}
4466
4467 -\COMMENTS
4468 -The call {\small\verb%ancestry()%} is considerably more efficient than {\small\verb%ancestors `-`%}.
4469 +\TYPE {\small\verb%apply_proof : (subgoals -> thm)%}\egroup
4470
4471 -\SEEALSO
4472 -ancestors, parents.
4473 +\SYNOPSIS
4474 +This function is for internal use only and is to be deleted from a future
4475 +version of the system. It should not be used.
4476
4477 \ENDDOC
4478 -\DOC{AND\_EXISTS\_CONV}
4479 +\DOC{AP\_TERM}
4480
4481 -\TYPE {\small\verb%AND_EXISTS_CONV : conv%}\egroup
4482 +\TYPE {\small\verb%AP_TERM : (term -> thm -> thm)%}\egroup
4483
4484 \SYNOPSIS
4485 -Moves an existential quantification outwards through a conjunction.
4486 +Applies a function to both sides of an equational theorem.
4487
4488 \DESCRIBE
4489 -When applied to a term of the form {\small\verb%(?x.P) /\ (?x.Q)%}, where {\small\verb%x%} is free
4490 -in neither {\small\verb%P%} nor {\small\verb%Q%}, {\small\verb%AND_EXISTS_CONV%} returns the theorem:
4491 +When applied to a term {\small\verb%f%} and a theorem {\small\verb%A |- x = y%}, the
4492 +inference rule {\small\verb%AP_TERM%} returns the theorem {\small\verb%A |- f x = f y%}.
4493 {\par\samepage\setseps\small
4494 \begin{verbatim}
4495 - |- (?x. P) /\ (?x. Q) = (?x. P /\ Q)
4496 + A |- x = y
4497 + ---------------- AP_TERM "f"
4498 + A |- f x = f y
4499 \end{verbatim}
4500 }
4501 \FAILURE
4502 -{\small\verb%AND_EXISTS_CONV%} fails if it is applied to a term not of the form
4503 -{\small\verb%(?x.P) /\ (?x.Q)%}, or if it is applied to a term {\small\verb%(?x.P) /\ (?x.Q)%}
4504 -in which the variable {\small\verb%x%} is free in either {\small\verb%P%} or {\small\verb%Q%}.
4505 +Fails unless the theorem is equational and the supplied term is a function
4506 +whose domain type is the same as the type of both sides of the equation.
4507
4508 \SEEALSO
4509 -EXISTS_AND_CONV, LEFT_AND_EXISTS_CONV, RIGHT_AND_EXISTS_CONV.
4510 +AP_THM, MK_COMB.
4511
4512 \ENDDOC
4513 -\DOC{AND\_FORALL\_CONV}
4514 +\DOC{AP\_TERM\_TAC}
4515
4516 -\TYPE {\small\verb%AND_FORALL_CONV : conv%}\egroup
4517 +\TYPE {\small\verb%AP_TERM_TAC : tactic%}\egroup
4518
4519 \SYNOPSIS
4520 -Moves a universal quantification outwards through a conjunction.
4521 +Strips a function application from both sides of an equational goal.
4522
4523 \DESCRIBE
4524 -When applied to a term of the form {\small\verb%(!x.P) /\ (!x.Q)%}, the conversion
4525 -{\small\verb%AND_FORALL_CONV%} returns the theorem:
4526 +{\small\verb%AP_TERM_TAC%} reduces a goal of the form {\small\verb%A ?- f x = f y%} by stripping away
4527 +the function applications, giving the new goal {\small\verb%A ?- x = y%}.
4528 {\par\samepage\setseps\small
4529 \begin{verbatim}
4530 - |- (!x.P) /\ (!x.Q) = (!x. P /\ Q)
4531 + A ?- f x = f y
4532 + ================ AP_TERM_TAC
4533 + A ?- x = y
4534 \end{verbatim}
4535 }
4536 \FAILURE
4537 -Fails if applied to a term not of the form {\small\verb%(!x.P) /\ (!x.Q)%}.
4538 +Fails unless the goal is equational, with both sides being applications
4539 +of the same function.
4540
4541 \SEEALSO
4542 -FORALL_AND_CONV, LEFT_AND_FORALL_CONV, RIGHT_AND_FORALL_CONV.
4543 +AP_TERM, AP_THM.
4544
4545 \ENDDOC
4546 -\DOC{ANTE\_CONJ\_CONV}
4547 +\DOC{AP\_THM}
4548
4549 -\TYPE {\small\verb%ANTE_CONJ_CONV : conv%}\egroup
4550 +\TYPE {\small\verb%AP_THM : (thm -> term -> thm)%}\egroup
4551
4552 \SYNOPSIS
4553 -Eliminates a conjunctive antecedent in favour of implication.
4554 +Proves equality of equal functions applied to a term.
4555
4556 \DESCRIBE
4557 -When applied to a term of the form {\small\verb%"(t1 /\ t2) ==> t"%}, the conversion
4558 -{\small\verb%ANTE_CONJ_CONV%} returns the theorem:
4559 +When applied to a theorem {\small\verb%A |- f = g%} and a term {\small\verb%x%}, the inference
4560 +rule {\small\verb%AP_THM%} returns the theorem {\small\verb%A |- f x = g x%}.
4561 {\par\samepage\setseps\small
4562 \begin{verbatim}
4563 - |- (t1 /\ t2 ==> t) = (t1 ==> t2 ==> t)
4564 + A |- f = g
4565 + ---------------- AP_THM (A |- f = g) "x"
4566 + A |- f x = g x
4567 \end{verbatim}
4568 }
4569 \FAILURE
4570 -Fails if applied to a term not of the form {\small\verb%"(t1 /\ t2) ==> t"%}.
4571 +Fails unless the conclusion of the theorem is an equation, both sides
4572 +of which are functions whose domain type is the same as that of the
4573 +supplied term.
4574
4575 -\USES
4576 -Somewhat ad-hoc, but can be used (with {\small\verb%CONV_TAC%}) to transform a goal of the
4577 -form {\small\verb%?- (P /\ Q) ==> R%} into the subgoal {\small\verb%?- P ==> (Q ==> R)%}, so that only
4578 -the antecedent {\small\verb%P%} is moved into the assumptions by {\small\verb%DISCH_TAC%}.
4579 +\COMMENTS
4580 +The type of {\small\verb%AP_THM%} is shown by the system as {\small\verb%thm -> conv%}.
4581 +
4582 +\SEEALSO
4583 +AP_TERM, ETA_CONV, EXT, MK_COMB.
4584
4585 \ENDDOC
4586 -\DOC{ANTE\_RES\_THEN}
4587 +\DOC{AP\_THM\_TAC}
4588
4589 -\TYPE {\small\verb%ANTE_RES_THEN : thm_tactical%}\egroup
4590 +\TYPE {\small\verb%AP_THM_TAC : tactic%}\egroup
4591
4592 \SYNOPSIS
4593 -Resolves implicative assumptions with an antecedent.
4594 +Strips identical operands from functions on both sides of an equation.
4595
4596 \DESCRIBE
4597 -Given a theorem-tactic {\small\verb%ttac%} and a theorem {\small\verb%A |- t%}, the function
4598 -{\small\verb%ANTE_RES_THEN%} produces a tactic that attempts to match {\small\verb%t%} to the antecedent
4599 -of each implication
4600 +When applied to a goal of the form {\small\verb%A ?- f x = g x%}, the tactic {\small\verb%AP_THM_TAC%}
4601 +strips away the operands of the function application:
4602 {\par\samepage\setseps\small
4603 \begin{verbatim}
4604 - Ai |- !x1...xn. ui ==> vi
4605 -\end{verbatim}
4606 -}
4607 -\noindent (where {\small\verb%Ai%} is just {\small\verb%!x1...xn. ui ==> vi%}) that occurs among the
4608 -assumptions of a goal. If the antecedent {\small\verb%ui%} of any implication matches {\small\verb%t%},
4609 -then an instance of {\small\verb%Ai u A |- vi%} is obtained by specialization of the
4610 -variables {\small\verb%x1%}, ..., {\small\verb%xn%} and type instantiation, followed by an application of
4611 -modus ponens. Because all implicative assumptions are tried, this may result
4612 -in several modus-ponens consequences of the supplied theorem and the
4613 -assumptions. Tactics are produced using {\small\verb%ttac%} from all these theorems, and
4614 -these tactics are applied in sequence to the goal. That is,
4615 -{\par\samepage\setseps\small
4616 -\begin{verbatim}
4617 - ANTE_RES_THEN ttac (A |- t) g
4618 -\end{verbatim}
4619 -}
4620 -\noindent has the effect of:
4621 -{\par\samepage\setseps\small
4622 -\begin{verbatim}
4623 - MAP_EVERY ttac [A1 u A |- v1; ...; Am u A |- vm] g
4624 -\end{verbatim}
4625 -}
4626 -\noindent where the theorems {\small\verb%Ai u A |- vi%} are all the consequences that can
4627 -be drawn by a (single) matching modus-ponens inference from the implications
4628 -that occur among the assumptions of the goal {\small\verb%g%} and the supplied theorem
4629 -{\small\verb%A |- t%}. Any negation {\small\verb%~v%} that appears among the assumptions of the goal is
4630 -treated as an implication {\small\verb%v ==> F%}. The sequence in which the theorems
4631 -{\small\verb%Ai u A |- vi%} are generated and the corresponding tactics applied is
4632 -unspecified.
4633 -
4634 -\FAILURE
4635 -{\small\verb%ANTE_RES_THEN ttac (A |- t)%} fails when applied to a goal {\small\verb%g%} if any of the
4636 -tactics produced by {\small\verb%ttac (Ai u A |- vi)%}, where {\small\verb%Ai u A |- vi%} is the {\small\verb%i%}th
4637 -resolvent obtained from the theorem {\small\verb%A |- t%} and the assumptions of {\small\verb%g%}, fails
4638 -when applied in sequence to {\small\verb%g%}.
4639 -
4640 -\SEEALSO
4641 -IMP_RES_TAC, IMP_RES_THEN, MATCH_MP, RES_TAC, RES_THEN.
4642 -
4643 -\ENDDOC
4644 -\DOC{append}
4645 -
4646 -\TYPE {\small\verb%append : (* list -> * list -> * list)%}\egroup
4647 -
4648 -\SYNOPSIS
4649 -Concatenates two lists.
4650 -
4651 -\DESCRIBE
4652 -{\small\verb%append [x1;...;xn] [y1;...;ym]%} returns {\small\verb%[x1;...;xn;y1;...;ym]%}.
4653 -
4654 -\FAILURE
4655 -Never fails.
4656 -
4657 -\COMMENTS
4658 -Performs the same operation as {\small\verb%$@%}.
4659 -
4660 -\ENDDOC
4661 -\DOC{APPEND\_CONV}
4662 -
4663 -\TYPE {\small\verb%APPEND_CONV : conv%}\egroup
4664 -
4665 -\SYNOPSIS
4666 -Computes by inference the result of appending two object-language lists.
4667 -
4668 -\DESCRIBE
4669 -For any pair of object language lists of the form {\small\verb%"[x1;...;xn]"%} and
4670 -{\small\verb%"[y1;...;ym]"%}, the result of evaluating
4671 -{\par\samepage\setseps\small
4672 -\begin{verbatim}
4673 - APPEND_CONV "APPEND [x1;...;xn] [y1;...;ym]"
4674 -\end{verbatim}
4675 -}
4676 -\noindent is the theorem
4677 -{\par\samepage\setseps\small
4678 -\begin{verbatim}
4679 - |- APPEND [x1;...;xn] [y1;...;ym] = [x1;...;xn;y1;...;ym]
4680 -\end{verbatim}
4681 -}
4682 -\noindent The length of either list (or both) may be 0.
4683 -
4684 -\FAILURE
4685 -{\small\verb%APPEND_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"APPEND l1 l2"%}, where
4686 -{\small\verb%l1%} and {\small\verb%l2%} are (possibly empty) object-language lists of the forms
4687 -{\small\verb%"[x1;...;xn]"%} and {\small\verb%"[y1;...;ym]"%}.
4688 -
4689 -\ENDDOC
4690 -
4691 -\DOC{append\_openw}
4692 -
4693 -\TYPE {\small\verb%append_openw : (string -> string)%}\egroup
4694 -
4695 -\SYNOPSIS
4696 -Opens a port for appending to a named file.
4697 -
4698 -\DESCRIBE
4699 -When applied to a filename {\small\verb%`name`%}, the function {\small\verb%append_openw%} opens the file
4700 -{\small\verb%name%} for writing, such that existing contents are appended to rather than
4701 -overwritten. It returns a port descriptor string, which can be used by {\small\verb%write%}
4702 -to append to the file, and by {\small\verb%close%} to close it.
4703 -
4704 -\EXAMPLE
4705 -The following example assumes that HOL is being run under Unix. It will
4706 -overwrite an existing file {\small\verb%test-file%} in the current directory.
4707 -{\par\samepage\setseps\small
4708 -\begin{verbatim}
4709 - #system `echo -n 'Hello ' >test-file`;;
4710 - 0 : int
4711 -
4712 - #let port = append_openw `test-file`;;
4713 - port = `%test-file` : string
4714 -
4715 - #write(port,`world`);;
4716 - () : void
4717 -
4718 - #close port;;
4719 - () : void
4720 -
4721 - #system `cat test-file`;;
4722 - Hello world0 : int
4723 -\end{verbatim}
4724 -}
4725 -\SEEALSO
4726 -close, openi, openw, read, write.
4727 -
4728 -\ENDDOC
4729 -\DOC{apply\_proof}
4730 -
4731 -\TYPE {\small\verb%apply_proof : (subgoals -> thm)%}\egroup
4732 -
4733 -\SYNOPSIS
4734 -This function is for internal use only and is to be deleted from a future
4735 -version of the system. It should not be used.
4736 -
4737 -\ENDDOC
4738 -\DOC{AP\_TERM}
4739 -
4740 -\TYPE {\small\verb%AP_TERM : (term -> thm -> thm)%}\egroup
4741 -
4742 -\SYNOPSIS
4743 -Applies a function to both sides of an equational theorem.
4744 -
4745 -\DESCRIBE
4746 -When applied to a term {\small\verb%f%} and a theorem {\small\verb%A |- x = y%}, the
4747 -inference rule {\small\verb%AP_TERM%} returns the theorem {\small\verb%A |- f x = f y%}.
4748 -{\par\samepage\setseps\small
4749 -\begin{verbatim}
4750 - A |- x = y
4751 - ---------------- AP_TERM "f"
4752 - A |- f x = f y
4753 -\end{verbatim}
4754 -}
4755 -\FAILURE
4756 -Fails unless the theorem is equational and the supplied term is a function
4757 -whose domain type is the same as the type of both sides of the equation.
4758 -
4759 -\SEEALSO
4760 -AP_THM, MK_COMB.
4761 -
4762 -\ENDDOC
4763 -\DOC{AP\_TERM\_TAC}
4764 -
4765 -\TYPE {\small\verb%AP_TERM_TAC : tactic%}\egroup
4766 -
4767 -\SYNOPSIS
4768 -Strips a function application from both sides of an equational goal.
4769 -
4770 -\DESCRIBE
4771 -{\small\verb%AP_TERM_TAC%} reduces a goal of the form {\small\verb%A ?- f x = f y%} by stripping away
4772 -the function applications, giving the new goal {\small\verb%A ?- x = y%}.
4773 -{\par\samepage\setseps\small
4774 -\begin{verbatim}
4775 - A ?- f x = f y
4776 - ================ AP_TERM_TAC
4777 - A ?- x = y
4778 -\end{verbatim}
4779 -}
4780 -\FAILURE
4781 -Fails unless the goal is equational, with both sides being applications
4782 -of the same function.
4783 -
4784 -\SEEALSO
4785 -AP_TERM, AP_THM.
4786 -
4787 -\ENDDOC
4788 -\DOC{AP\_THM}
4789 -
4790 -\TYPE {\small\verb%AP_THM : (thm -> term -> thm)%}\egroup
4791 -
4792 -\SYNOPSIS
4793 -Proves equality of equal functions applied to a term.
4794 -
4795 -\DESCRIBE
4796 -When applied to a theorem {\small\verb%A |- f = g%} and a term {\small\verb%x%}, the inference
4797 -rule {\small\verb%AP_THM%} returns the theorem {\small\verb%A |- f x = g x%}.
4798 -{\par\samepage\setseps\small
4799 -\begin{verbatim}
4800 - A |- f = g
4801 - ---------------- AP_THM (A |- f = g) "x"
4802 - A |- f x = g x
4803 -\end{verbatim}
4804 -}
4805 -\FAILURE
4806 -Fails unless the conclusion of the theorem is an equation, both sides
4807 -of which are functions whose domain type is the same as that of the
4808 -supplied term.
4809 -
4810 -\COMMENTS
4811 -The type of {\small\verb%AP_THM%} is shown by the system as {\small\verb%thm -> conv%}.
4812 -
4813 -\SEEALSO
4814 -AP_TERM, ETA_CONV, EXT, MK_COMB.
4815 -
4816 -\ENDDOC
4817 -\DOC{AP\_THM\_TAC}
4818 -
4819 -\TYPE {\small\verb%AP_THM_TAC : tactic%}\egroup
4820 -
4821 -\SYNOPSIS
4822 -Strips identical operands from functions on both sides of an equation.
4823 -
4824 -\DESCRIBE
4825 -When applied to a goal of the form {\small\verb%A ?- f x = g x%}, the tactic {\small\verb%AP_THM_TAC%}
4826 -strips away the operands of the function application:
4827 -{\par\samepage\setseps\small
4828 -\begin{verbatim}
4829 - A ?- f x = g x
4830 - ================ AP_THM_TAC
4831 - A ?- f = g
4832 + A ?- f x = g x
4833 + ================ AP_THM_TAC
4834 + A ?- f = g
4835 \end{verbatim}
4836 }
4837 \FAILURE
4838 @@ -1149,41 +917,41 @@ can be 0), and otherwise fails.
4839 is_type.
4840
4841 \ENDDOC
4842 -\DOC{ascii}
4843 +\DOC{ascii\_code}
4844
4845 -\TYPE {\small\verb%ascii : (int -> string)%}\egroup
4846 +\TYPE {\small\verb%ascii_code : (string -> int)%}\egroup
4847
4848 \SYNOPSIS
4849 -Maps an integer to the corresponding ASCII character.
4850 +Maps a character to corresponding ASCII numeric code.
4851
4852 \DESCRIBE
4853 -When given an integer, {\small\verb%ascii%} returns a string consisting of
4854 -the single character corresponding to that integer under the ASCII
4855 -encoding.
4856 +When given a string, {\small\verb%ascii_code%} returns the numeric encoding in the
4857 +ASCII character set of the first character of that string.
4858
4859 \FAILURE
4860 -Fails unless the integer supplied is in the range {\small\verb%0 <= x < 128%}.
4861 +Fails if the string is empty ({\small\verb%``%}).
4862
4863 \SEEALSO
4864 -ascii_code, int_of_string, is_alphanum, is_letter, string_of_int.
4865 +ascii, int_of_string, is_alphanum, is_letter, string_of_int.
4866
4867 \ENDDOC
4868 -\DOC{ascii\_code}
4869 +\DOC{ascii}
4870
4871 -\TYPE {\small\verb%ascii_code : (string -> int)%}\egroup
4872 +\TYPE {\small\verb%ascii : (int -> string)%}\egroup
4873
4874 \SYNOPSIS
4875 -Maps a character to corresponding ASCII numeric code.
4876 +Maps an integer to the corresponding ASCII character.
4877
4878 \DESCRIBE
4879 -When given a string, {\small\verb%ascii_code%} returns the numeric encoding in the
4880 -ASCII character set of the first character of that string.
4881 +When given an integer, {\small\verb%ascii%} returns a string consisting of
4882 +the single character corresponding to that integer under the ASCII
4883 +encoding.
4884
4885 \FAILURE
4886 -Fails if the string is empty ({\small\verb%``%}).
4887 +Fails unless the integer supplied is in the range {\small\verb%0 <= x < 128%}.
4888
4889 \SEEALSO
4890 -ascii, int_of_string, is_alphanum, is_letter, string_of_int.
4891 +ascii_code, int_of_string, is_alphanum, is_letter, string_of_int.
4892
4893 \ENDDOC
4894 \DOC{ASM\_CASES\_TAC}
4895 @@ -1813,41 +1581,6 @@ of the current theory. It will fail if t
4896 axioms, definition, load_axiom, load_axioms, new_axiom, print_theory, theorem.
4897
4898 \ENDDOC
4899 -\DOC{axioms}
4900 -
4901 -\TYPE {\small\verb%axioms : (string -> (string # thm) list)%}\egroup
4902 -
4903 -\SYNOPSIS
4904 -Returns the axioms of a given theory segment of the current theory.
4905 -
4906 -\DESCRIBE
4907 -A call {\small\verb%axioms `thy`%} returns the axioms of the theory segment {\small\verb%thy%} together
4908 -with their names. The theory segment {\small\verb%thy%} must be part of the current theory.
4909 -The names are those given to the axioms by the user when they were originally
4910 -added to the theory segment (by a call to {\small\verb%new_axiom%}). The name of the current
4911 -theory segment can be abbreviated by {\small\verb%`-`%}.
4912 -
4913 -\FAILURE
4914 -The call {\small\verb%axioms `thy`%} will fail if the theory segment {\small\verb%thy%} is not
4915 -part of the current theory.
4916 -
4917 -\EXAMPLE
4918 -{\par\samepage\setseps\small
4919 -\begin{verbatim}
4920 -#axioms `bool`;;
4921 -[(`SELECT_AX`, |- !P x. P x ==> P($@ P));
4922 - (`ETA_AX`, |- !t. (\x. t x) = t);
4923 - (`IMP_ANTISYM_AX`,
4924 - |- !t1 t2. (t1 ==> t2) ==> (t2 ==> t1) ==> (t1 = t2));
4925 - (`BOOL_CASES_AX`, |- !t. (t = T) \/ (t = F));
4926 - (`ARB_THM`, |- $= = $=)]
4927 -: (string # thm) list
4928 -\end{verbatim}
4929 -}
4930 -\SEEALSO
4931 -axiom, definitions, load_axiom, load_axioms, new_axiom, print_theory, theorems.
4932 -
4933 -\ENDDOC
4934 \DOC{axiom\_lfn}
4935
4936 \TYPE {\small\verb%axiom_lfn : (string list -> thm)%}\egroup
4937 @@ -1922,41 +1655,39 @@ autoload, autoload_theory, axiom, axioms
4938 undo_autoload.
4939
4940 \ENDDOC
4941 -\DOC{B}
4942 -
4943 -\TYPE {\small\verb%B : ((* -> **) -> (*** -> *) -> *** -> **)%}\egroup
4944 -
4945 -\SYNOPSIS
4946 -Performs curried function-composition: {\small\verb%B f g x%} = {\small\verb%f (g x)%}.
4947 -
4948 -\FAILURE
4949 -Never fails.
4950 -
4951 -\SEEALSO
4952 -\#, C, CB, Co, I, K, KI, o, oo, S, W.
4953 -
4954 -\ENDDOC
4955 -\DOC{b}
4956 +\DOC{axioms}
4957
4958 -\TYPE {\small\verb%b : (void -> void)%}\egroup
4959 +\TYPE {\small\verb%axioms : (string -> (string # thm) list)%}\egroup
4960
4961 \SYNOPSIS
4962 -Restores the proof state undoing the effects of a previous expansion.
4963 +Returns the axioms of a given theory segment of the current theory.
4964
4965 \DESCRIBE
4966 -The function {\small\verb%b%} is part of the subgoal package. It is an abbreviation for the
4967 -function {\small\verb%backup%}. For a description of the subgoal package, see
4968 -{\small\verb%set_goal%}.
4969 +A call {\small\verb%axioms `thy`%} returns the axioms of the theory segment {\small\verb%thy%} together
4970 +with their names. The theory segment {\small\verb%thy%} must be part of the current theory.
4971 +The names are those given to the axioms by the user when they were originally
4972 +added to the theory segment (by a call to {\small\verb%new_axiom%}). The name of the current
4973 +theory segment can be abbreviated by {\small\verb%`-`%}.
4974
4975 \FAILURE
4976 -As for {\small\verb%backup%}.
4977 -
4978 -\USES
4979 -Back tracking in a goal-directed proof to undo errors or try different tactics.
4980 +The call {\small\verb%axioms `thy`%} will fail if the theory segment {\small\verb%thy%} is not
4981 +part of the current theory.
4982
4983 +\EXAMPLE
4984 +{\par\samepage\setseps\small
4985 +\begin{verbatim}
4986 +#axioms `bool`;;
4987 +[(`SELECT_AX`, |- !P x. P x ==> P($@ P));
4988 + (`ETA_AX`, |- !t. (\x. t x) = t);
4989 + (`IMP_ANTISYM_AX`,
4990 + |- !t1 t2. (t1 ==> t2) ==> (t2 ==> t1) ==> (t1 = t2));
4991 + (`BOOL_CASES_AX`, |- !t. (t = T) \/ (t = F));
4992 + (`ARB_THM`, |- $= = $=)]
4993 +: (string # thm) list
4994 +\end{verbatim}
4995 +}
4996 \SEEALSO
4997 -backup, backup_limit, e, expand, expandf, g, get_state, p, print_state, r,
4998 -rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
4999 +axiom, definitions, load_axiom, load_axioms, new_axiom, print_theory, theorems.
5000
5001 \ENDDOC
5002 \DOC{backup}
5003 @@ -2183,6 +1914,43 @@ NOT_CLAUSES, OR_CLAUSES, PAIR, REFL_CLAU
5004 SND.
5005
5006 \ENDDOC
5007 +\DOC{b}
5008 +
5009 +\TYPE {\small\verb%b : (void -> void)%}\egroup
5010 +
5011 +\SYNOPSIS
5012 +Restores the proof state undoing the effects of a previous expansion.
5013 +
5014 +\DESCRIBE
5015 +The function {\small\verb%b%} is part of the subgoal package. It is an abbreviation for the
5016 +function {\small\verb%backup%}. For a description of the subgoal package, see
5017 +{\small\verb%set_goal%}.
5018 +
5019 +\FAILURE
5020 +As for {\small\verb%backup%}.
5021 +
5022 +\USES
5023 +Back tracking in a goal-directed proof to undo errors or try different tactics.
5024 +
5025 +\SEEALSO
5026 +backup, backup_limit, e, expand, expandf, g, get_state, p, print_state, r,
5027 +rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
5028 +
5029 +\ENDDOC
5030 +\DOC{B}
5031 +
5032 +\TYPE {\small\verb%B : ((* -> **) -> (*** -> *) -> *** -> **)%}\egroup
5033 +
5034 +\SYNOPSIS
5035 +Performs curried function-composition: {\small\verb%B f g x%} = {\small\verb%f (g x)%}.
5036 +
5037 +\FAILURE
5038 +Never fails.
5039 +
5040 +\SEEALSO
5041 +\#, C, CB, Co, I, K, KI, o, oo, S, W.
5042 +
5043 +\ENDDOC
5044 \DOC{BETA\_CONV}
5045
5046 \TYPE {\small\verb%BETA_CONV : conv%}\egroup
5047 @@ -2339,23 +2107,6 @@ Fails unless the term is an abstraction.
5048 body, dest_abs.
5049
5050 \ENDDOC
5051 -\DOC{body}
5052 -
5053 -\TYPE {\small\verb%body : (term -> term)%}\egroup
5054 -
5055 -\SYNOPSIS
5056 -Returns the body of an abstraction.
5057 -
5058 -\DESCRIBE
5059 -{\small\verb%body "\var. t"%} returns {\small\verb%"t"%}.
5060 -
5061 -\FAILURE
5062 -Fails unless the term is an abstraction.
5063 -
5064 -\SEEALSO
5065 -bndvar, dest_abs.
5066 -
5067 -\ENDDOC
5068 \DOC{BODY\_CONJUNCTS}
5069
5070 \TYPE {\small\verb%BODY_CONJUNCTS : (thm -> thm list)%}\egroup
5071 @@ -2393,6 +2144,23 @@ The following illustrates how a typical
5072 CONJ, CONJUNCT1, CONJUNCT2, CONJUNCTS, CONJ_TAC.
5073
5074 \ENDDOC
5075 +\DOC{body}
5076 +
5077 +\TYPE {\small\verb%body : (term -> term)%}\egroup
5078 +
5079 +\SYNOPSIS
5080 +Returns the body of an abstraction.
5081 +
5082 +\DESCRIBE
5083 +{\small\verb%body "\var. t"%} returns {\small\verb%"t"%}.
5084 +
5085 +\FAILURE
5086 +Fails unless the term is an abstraction.
5087 +
5088 +\SEEALSO
5089 +bndvar, dest_abs.
5090 +
5091 +\ENDDOC
5092 \DOC{BOOL\_CASES\_TAC}
5093
5094 \TYPE {\small\verb%BOOL_CASES_TAC : (term -> tactic)%}\egroup
5095 @@ -2523,6 +2291,34 @@ or {\small\verb%k%} is greater than the
5096
5097 \ENDDOC
5098
5099 +\DOC{BUTLAST\_CONV}
5100 +
5101 +\TYPE {\small\verb%BUTLAST_CONV : conv%}\egroup
5102 +
5103 +\SYNOPSIS
5104 +Computes by inference the result of stripping the last element of a list.
5105 +
5106 +\DESCRIBE
5107 +For any object language list of the form {\small\verb%"[x0;...x(n-1)]"%} ,
5108 +the result of evaluating
5109 +{\par\samepage\setseps\small
5110 +\begin{verbatim}
5111 + BUTLAST_CONV "BUTLAST [x0;...;x(n-1)]"
5112 +\end{verbatim}
5113 +}
5114 +\noindent is the theorem
5115 +{\par\samepage\setseps\small
5116 +\begin{verbatim}
5117 + |- BUTLAST [x0;...;x(n-1)] = [x0;...; x(n-2)]
5118 +\end{verbatim}
5119 +}
5120 +
5121 +
5122 +\FAILURE
5123 +{\small\verb%BUTLAST_CONV tm%} fails if {\small\verb%tm%} is an empty list.
5124 +
5125 +\ENDDOC
5126 +
5127 \DOC{butlast}
5128
5129 \TYPE {\small\verb%butlast : (* list -> * list)%}\egroup
5130 @@ -2569,48 +2365,6 @@ or {\small\verb%k%} is greater than the
5131
5132 \ENDDOC
5133
5134 -\DOC{BUTLAST\_CONV}
5135 -
5136 -\TYPE {\small\verb%BUTLAST_CONV : conv%}\egroup
5137 -
5138 -\SYNOPSIS
5139 -Computes by inference the result of stripping the last element of a list.
5140 -
5141 -\DESCRIBE
5142 -For any object language list of the form {\small\verb%"[x0;...x(n-1)]"%} ,
5143 -the result of evaluating
5144 -{\par\samepage\setseps\small
5145 -\begin{verbatim}
5146 - BUTLAST_CONV "BUTLAST [x0;...;x(n-1)]"
5147 -\end{verbatim}
5148 -}
5149 -\noindent is the theorem
5150 -{\par\samepage\setseps\small
5151 -\begin{verbatim}
5152 - |- BUTLAST [x0;...;x(n-1)] = [x0;...; x(n-2)]
5153 -\end{verbatim}
5154 -}
5155 -
5156 -
5157 -\FAILURE
5158 -{\small\verb%BUTLAST_CONV tm%} fails if {\small\verb%tm%} is an empty list.
5159 -
5160 -\ENDDOC
5161 -
5162 -\DOC{C}
5163 -
5164 -\TYPE {\small\verb%C : ((* -> ** -> ***) -> ** -> * -> ***)%}\egroup
5165 -
5166 -\SYNOPSIS
5167 -Permutes first two arguments to curried function: {\small\verb%C f x y%} = {\small\verb%f y x%}.
5168 -
5169 -\FAILURE
5170 -Never fails.
5171 -
5172 -\SEEALSO
5173 -\#, B, CB, Co, I, K, KI, o, oo, S, W.
5174 -
5175 -\ENDDOC
5176 \DOC{cached\_theories}
5177
5178 \TYPE {\small\verb%cached_theories : (void -> (string # bool) list)%}\egroup
5179 @@ -2756,6 +2510,20 @@ a contradiction, then {\small\verb%t%} m
5180 CONTR, CONTRAPOS, CONTR_TAC, NOT_ELIM.
5181
5182 \ENDDOC
5183 +\DOC{C}
5184 +
5185 +\TYPE {\small\verb%C : ((* -> ** -> ***) -> ** -> * -> ***)%}\egroup
5186 +
5187 +\SYNOPSIS
5188 +Permutes first two arguments to curried function: {\small\verb%C f x y%} = {\small\verb%f y x%}.
5189 +
5190 +\FAILURE
5191 +Never fails.
5192 +
5193 +\SEEALSO
5194 +\#, B, CB, Co, I, K, KI, o, oo, S, W.
5195 +
5196 +\ENDDOC
5197 \DOC{CHANGED\_CONV}
5198
5199 \TYPE {\small\verb%CHANGED_CONV : (conv -> conv)%}\egroup
5200 @@ -3180,44 +2948,44 @@ Never fails.
5201 \#, B, C, CB, I, K, KI, o, oo, S, W.
5202
5203 \ENDDOC
5204 -\DOC{com}
5205 +\DOC{combine}
5206
5207 -\TYPE {\small\verb%$com : ((* list # ** list) -> (* # **) list)%}\egroup
5208 +\TYPE {\small\verb%combine : ((* list # ** list) -> (* # **) list)%}\egroup
5209
5210 \SYNOPSIS
5211 -Converts a pair of lists into a list of pairs (infix version).
5212 +Converts a pair of lists into a list of pairs.
5213
5214 \DESCRIBE
5215 -{\small\verb%[x1;...;xn] com [y1;...;yn]%} returns {\small\verb%[(x1,y1);...;(xn,yn)]%}.
5216 +{\small\verb%combine ([x1;...;xn],[y1;...;yn])%} returns {\small\verb%[(x1,y1);...;(xn,yn)]%}.
5217
5218 \FAILURE
5219 Fails if the two lists are of different lengths.
5220
5221 \COMMENTS
5222 -Has the same effect as {\small\verb%combine%}.
5223 +Has the same effect as {\small\verb%com%}.
5224
5225 \SEEALSO
5226 -combine, split.
5227 +com, split.
5228
5229 \ENDDOC
5230 -\DOC{combine}
5231 +\DOC{com}
5232
5233 -\TYPE {\small\verb%combine : ((* list # ** list) -> (* # **) list)%}\egroup
5234 +\TYPE {\small\verb%$com : ((* list # ** list) -> (* # **) list)%}\egroup
5235
5236 \SYNOPSIS
5237 -Converts a pair of lists into a list of pairs.
5238 +Converts a pair of lists into a list of pairs (infix version).
5239
5240 \DESCRIBE
5241 -{\small\verb%combine ([x1;...;xn],[y1;...;yn])%} returns {\small\verb%[(x1,y1);...;(xn,yn)]%}.
5242 +{\small\verb%[x1;...;xn] com [y1;...;yn]%} returns {\small\verb%[(x1,y1);...;(xn,yn)]%}.
5243
5244 \FAILURE
5245 Fails if the two lists are of different lengths.
5246
5247 \COMMENTS
5248 -Has the same effect as {\small\verb%com%}.
5249 +Has the same effect as {\small\verb%combine%}.
5250
5251 \SEEALSO
5252 -com, split.
5253 +combine, split.
5254
5255 \ENDDOC
5256 \DOC{compile}
5257 @@ -3585,6 +3353,60 @@ The theorems returned in these three cas
5258 {\small\verb%c%} is {\small\verb%T%} or {\small\verb%F%}, or {\small\verb%u%} and {\small\verb%v%} are alpha-equivalent.
5259
5260 \ENDDOC
5261 +\DOC{CONJ\_DISCH}
5262 +
5263 +\TYPE {\small\verb%CONJ_DISCH : (term -> thm -> thm)%}\egroup
5264 +
5265 +\SYNOPSIS
5266 +Discharges an assumption and conjoins it to both sides of an equation.
5267 +
5268 +\DESCRIBE
5269 +Given an term {\small\verb%t%} and a theorem {\small\verb%A |- t1 = t2%}, which is an equation between
5270 +boolean terms, {\small\verb%CONJ_DISCH%} returns {\small\verb%A - {t} |- (t /\ t1) = (t /\ t2)%}, i.e.
5271 +conjoins {\small\verb%t%} to both sides of the equation, removing {\small\verb%t%} from the assumptions
5272 +if it was there.
5273 +{\par\samepage\setseps\small
5274 +\begin{verbatim}
5275 + A |- t1 = t2
5276 + ------------------------------ CONJ_DISCH "t"
5277 + A - {t} |- t /\ t1 = t /\ t2
5278 +\end{verbatim}
5279 +}
5280 +\FAILURE
5281 +Fails unless the theorem is an equation, both sides of which, and the term
5282 +provided are of type {\small\verb%bool%}.
5283 +
5284 +\SEEALSO
5285 +CONJ_DISCHL.
5286 +
5287 +\ENDDOC
5288 +\DOC{CONJ\_DISCHL}
5289 +
5290 +\TYPE {\small\verb%CONJ_DISCHL : (term list -> thm -> thm)%}\egroup
5291 +
5292 +\SYNOPSIS
5293 +Conjoins multiple assumptions to both sides of an equation.
5294 +
5295 +\DESCRIBE
5296 +Given a term list {\small\verb%[t1;...;tn]%} and a theorem whose conclusion is an equation
5297 +between boolean terms, {\small\verb%CONJ_DISCHL%} conjoins all the terms
5298 +in the list to both sides of the equation, and removes any of the terms which
5299 +were in the assumption list.
5300 +{\par\samepage\setseps\small
5301 +\begin{verbatim}
5302 + A |- s = t
5303 + -------------------------------------------------------- CONJ_DISCHL
5304 + A - {t1,...,tn} |- (t1/\.../\tn/\s) = (t1/\.../\tn/\t) ["t1";...;"tn"]
5305 +\end{verbatim}
5306 +}
5307 +\FAILURE
5308 +Fails unless the theorem is an equation, both sides of which, and all the terms
5309 +provided, are of type {\small\verb%bool%}.
5310 +
5311 +\SEEALSO
5312 +CONJ_DISCH.
5313 +
5314 +\ENDDOC
5315 \DOC{CONJ}
5316
5317 \TYPE {\small\verb%CONJ : (thm -> thm -> thm)%}\egroup
5318 @@ -3607,6 +3429,148 @@ Never fails.
5319 BODY_CONJUNCTS, CONJUNCT1, CONJUNCT2, CONJ_PAIR, LIST_CONJ, CONJ_LIST, CONJUNCTS.
5320
5321 \ENDDOC
5322 +\DOC{CONJ\_LIST}
5323 +
5324 +\TYPE {\small\verb%CONJ_LIST : (int -> thm -> thm list)%}\egroup
5325 +
5326 +\SYNOPSIS
5327 +Extracts a list of conjuncts from a theorem (non-flattening version).
5328 +
5329 +\DESCRIBE
5330 +{\small\verb%CONJ_LIST%} is the proper inverse of {\small\verb%LIST_CONJ%}. Unlike {\small\verb%CONJUNCTS%} which
5331 +recursively splits as many conjunctions as possible both to the left and to
5332 +the right, {\small\verb%CONJ_LIST%} splits the top-level conjunction and then splits
5333 +(recursively) only the right conjunct. The integer argument is required
5334 +because the term {\small\verb%tn%} may itself be a conjunction. A list of {\small\verb%n%} theorems is
5335 +returned.
5336 +{\par\samepage\setseps\small
5337 +\begin{verbatim}
5338 + A |- t1 /\ (t2 /\ ( ... /\ tn)...)
5339 + ------------------------------------ CONJ_LIST n (A |- t1 /\ ... /\ tn)
5340 + A |- t1 A |- t2 ... A |- tn
5341 +\end{verbatim}
5342 +}
5343 +\FAILURE
5344 +Fails if the integer argument ({\small\verb%n%}) is less than one, or if the input theorem
5345 +has less than {\small\verb%n%} conjuncts.
5346 +
5347 +\EXAMPLE
5348 +Suppose the identifier {\small\verb%th%} is bound to the theorem:
5349 +{\par\samepage\setseps\small
5350 +\begin{verbatim}
5351 + A |- (x /\ y) /\ z /\ w
5352 +\end{verbatim}
5353 +}
5354 +\noindent Here are some applications of {\small\verb%CONJ_LIST%} to {\small\verb%th%}:
5355 +{\par\samepage\setseps\small
5356 +\begin{verbatim}
5357 + #CONJ_LIST 0 th;;
5358 + evaluation failed CONJ_LIST
5359 +
5360 + #CONJ_LIST 1 th;;
5361 + [A |- (x /\ y) /\ z /\ w] : thm list
5362 +
5363 + #CONJ_LIST 2 th;;
5364 + [A |- x /\ y; A |- z /\ w] : thm list
5365 +
5366 + #CONJ_LIST 3 th;;
5367 + [A |- x /\ y; A |- z; A |- w] : thm list
5368 +
5369 + #CONJ_LIST 4 th;;
5370 + evaluation failed CONJ_LIST
5371 +\end{verbatim}
5372 +}
5373 +\SEEALSO
5374 +BODY_CONJUNCTS, LIST_CONJ, CONJUNCTS, CONJ, CONJUNCT1, CONJUNCT2, CONJ_PAIR.
5375 +
5376 +\ENDDOC
5377 +\DOC{CONJ\_PAIR}
5378 +
5379 +\TYPE {\small\verb%CONJ_PAIR : (thm -> (thm # thm))%}\egroup
5380 +
5381 +\SYNOPSIS
5382 +Extracts both conjuncts of a conjunction.
5383 +
5384 +\DESCRIBE
5385 +{\par\samepage\setseps\small
5386 +\begin{verbatim}
5387 + A |- t1 /\ t2
5388 + ---------------------- CONJ_PAIR
5389 + A |- t1 A |- t2
5390 +\end{verbatim}
5391 +}
5392 +\noindent The two resultant theorems are returned as a pair.
5393 +
5394 +\FAILURE
5395 +Fails if the input theorem is not a conjunction.
5396 +
5397 +\SEEALSO
5398 +BODY_CONJUNCTS, CONJUNCT1, CONJUNCT2, CONJ, LIST_CONJ, CONJ_LIST, CONJUNCTS.
5399 +
5400 +\ENDDOC
5401 +\DOC{CONJ\_SET\_CONV}
5402 +
5403 +\TYPE {\small\verb%CONJ_SET_CONV : (term list -> term list -> thm)%}\egroup
5404 +
5405 +\SYNOPSIS
5406 +Proves the equivalence of the conjunctions of two equal sets of terms.
5407 +
5408 +\DESCRIBE
5409 +The arguments to {\small\verb%CONJ_SET_CONV%} are two lists of terms {\small\verb%[t1;...;tn]%} and
5410 +{\small\verb%[u1;...;um]%}. If these are equal when considered as sets, that is if the sets
5411 +{\par\samepage\setseps\small
5412 +\begin{verbatim}
5413 + {t1,...,tn} and {u1,...,um}
5414 +\end{verbatim}
5415 +}
5416 +\noindent are equal, then {\small\verb%CONJ_SET_CONV%} returns the theorem:
5417 +{\par\samepage\setseps\small
5418 +\begin{verbatim}
5419 + |- (t1 /\ ... /\ tn) = (u1 /\ ... /\ um)
5420 +\end{verbatim}
5421 +}
5422 +\noindent Otherwise {\small\verb%CONJ_SET_CONV%} fails.
5423 +
5424 +\FAILURE
5425 +{\small\verb%CONJ_SET_CONV [t1;...;tn] [u1;...;um]%} fails if {\small\verb%[t1,...,tn]%} and
5426 +{\small\verb%[u1,...,um]%}, regarded as sets of terms, are not equal. Also fails
5427 +if any {\small\verb%ti%} or {\small\verb%ui%} does not have type {\small\verb%bool%}.
5428 +
5429 +\USES
5430 +Used to order conjuncts. First sort a list of conjuncts {\small\verb%l1%} into the
5431 +desired order to get a new list {\small\verb%l2%}, then call {\small\verb%CONJ_SET_CONV l1 l2%}.
5432 +
5433 +\COMMENTS
5434 +This is not a true conversion, so perhaps it ought to be called something else.
5435 +
5436 +\SEEALSO
5437 +CONJUNCTS_CONV.
5438 +
5439 +\ENDDOC
5440 +\DOC{CONJ\_TAC}
5441 +
5442 +\TYPE {\small\verb%CONJ_TAC : tactic%}\egroup
5443 +
5444 +\SYNOPSIS
5445 +Reduces a conjunctive goal to two separate subgoals.
5446 +
5447 +\DESCRIBE
5448 +When applied to a goal {\small\verb%A ?- t1 /\ t2%}, the tactic {\small\verb%CONJ_TAC%} reduces it to the
5449 +two subgoals corresponding to each conjunct separately.
5450 +{\par\samepage\setseps\small
5451 +\begin{verbatim}
5452 + A ?- t1 /\ t2
5453 + ====================== CONJ_TAC
5454 + A ?- t1 A ?- t2
5455 +\end{verbatim}
5456 +}
5457 +\FAILURE
5458 +Fails unless the conclusion of the goal is a conjunction.
5459 +
5460 +\SEEALSO
5461 +STRIP_TAC.
5462 +
5463 +\ENDDOC
5464 \DOC{CONJUNCT1}
5465
5466 \TYPE {\small\verb%CONJUNCT1 : (thm -> thm)%}\egroup
5467 @@ -3651,42 +3615,40 @@ Fails unless the input theorem is a conj
5468 BODY_CONJUNCTS, CONJUNCT1, CONJ_PAIR, CONJ, LIST_CONJ, CONJ_LIST, CONJUNCTS.
5469
5470 \ENDDOC
5471 -\DOC{CONJUNCTS}
5472 +\DOC{CONJUNCTS\_CONV}
5473
5474 -\TYPE {\small\verb%CONJUNCTS : (thm -> thm list)%}\egroup
5475 +\TYPE {\small\verb%CONJUNCTS_CONV : ((term # term) -> thm)%}\egroup
5476
5477 \SYNOPSIS
5478 -Recursively splits conjunctions into a list of conjuncts.
5479 +Prove equivalence under idempotence, symmetry and associativity of conjunction.
5480
5481 \DESCRIBE
5482 -Flattens out all conjuncts, regardless of grouping. Returns a singleton list
5483 -if the input theorem is not a conjunction.
5484 -{\par\samepage\setseps\small
5485 -\begin{verbatim}
5486 - A |- t1 /\ t2 /\ ... /\ tn
5487 - ----------------------------------- CONJUNCTS
5488 - A |- t1 A |- t2 ... A |- tn
5489 -\end{verbatim}
5490 -}
5491 +{\small\verb%CONJUNCTS_CONV%} takes a pair of terms {\small\verb%"t1"%} and {\small\verb%"t2"%}, and proves
5492 +{\small\verb%|- t1 = t2%} if {\small\verb%t1%} and {\small\verb%t2%} are equivalent up to idempotence, symmetry and
5493 +associativity of conjunction. That is, if {\small\verb%t1%} and {\small\verb%t2%} are two (different)
5494 +arbitrarily-nested conjunctions of the same set of terms, then {\small\verb%CONJUNCTS_CONV
5495 +(t1,t2)%} returns {\small\verb%|- t1 = t2%}. Otherwise, it fails.
5496 +
5497 \FAILURE
5498 -Never fails.
5499 +Fails if {\small\verb%t1%} and {\small\verb%t2%} are not equivalent, as described above.
5500
5501 \EXAMPLE
5502 -Suppose the identifier {\small\verb%th%} is bound to the theorem:
5503 -{\par\samepage\setseps\small
5504 -\begin{verbatim}
5505 - A |- (x /\ y) /\ z /\ w
5506 -\end{verbatim}
5507 -}
5508 -\noindent Application of {\small\verb%CONJUNCTS%} to {\small\verb%th%} returns the following list of
5509 -theorems:
5510 {\par\samepage\setseps\small
5511 \begin{verbatim}
5512 - [A |- x; A |- y; A |- z; A |- w] : thm list
5513 +#CONJUNCTS_CONV ("(P /\ Q) /\ R", "R /\ (Q /\ R) /\ P");;
5514 +|- (P /\ Q) /\ R = R /\ (Q /\ R) /\ P
5515 \end{verbatim}
5516 }
5517 +\USES
5518 +Used to reorder a conjunction. First sort the conjuncts in a term {\small\verb%t1%} into
5519 +the desired order (e.g. lexicographic order, for normalization) to get a new
5520 +term {\small\verb%t2%}, then call {\small\verb%CONJUNCTS_CONV(t1,t2)%}.
5521 +
5522 +\COMMENTS
5523 +This is not a true conversion, so perhaps it ought to be called something else.
5524 +
5525 \SEEALSO
5526 -BODY_CONJUNCTS, CONJ_LIST, LIST_CONJ, CONJ, CONJUNCT1, CONJUNCT2, CONJ_PAIR.
5527 +CONJ_SET_CONV.
5528
5529 \ENDDOC
5530 \DOC{conjuncts}
5531 @@ -3739,40 +3701,90 @@ introduce {\small\verb%list_dest_conj%}
5532 list_mk_conj, dest_conj.
5533
5534 \ENDDOC
5535 -\DOC{CONJUNCTS\_CONV}
5536 +\DOC{CONJUNCTS}
5537
5538 -\TYPE {\small\verb%CONJUNCTS_CONV : ((term # term) -> thm)%}\egroup
5539 +\TYPE {\small\verb%CONJUNCTS : (thm -> thm list)%}\egroup
5540
5541 \SYNOPSIS
5542 -Prove equivalence under idempotence, symmetry and associativity of conjunction.
5543 +Recursively splits conjunctions into a list of conjuncts.
5544
5545 \DESCRIBE
5546 -{\small\verb%CONJUNCTS_CONV%} takes a pair of terms {\small\verb%"t1"%} and {\small\verb%"t2"%}, and proves
5547 -{\small\verb%|- t1 = t2%} if {\small\verb%t1%} and {\small\verb%t2%} are equivalent up to idempotence, symmetry and
5548 -associativity of conjunction. That is, if {\small\verb%t1%} and {\small\verb%t2%} are two (different)
5549 -arbitrarily-nested conjunctions of the same set of terms, then {\small\verb%CONJUNCTS_CONV
5550 -(t1,t2)%} returns {\small\verb%|- t1 = t2%}. Otherwise, it fails.
5551 -
5552 +Flattens out all conjuncts, regardless of grouping. Returns a singleton list
5553 +if the input theorem is not a conjunction.
5554 +{\par\samepage\setseps\small
5555 +\begin{verbatim}
5556 + A |- t1 /\ t2 /\ ... /\ tn
5557 + ----------------------------------- CONJUNCTS
5558 + A |- t1 A |- t2 ... A |- tn
5559 +\end{verbatim}
5560 +}
5561 \FAILURE
5562 -Fails if {\small\verb%t1%} and {\small\verb%t2%} are not equivalent, as described above.
5563 +Never fails.
5564
5565 \EXAMPLE
5566 +Suppose the identifier {\small\verb%th%} is bound to the theorem:
5567 {\par\samepage\setseps\small
5568 \begin{verbatim}
5569 -#CONJUNCTS_CONV ("(P /\ Q) /\ R", "R /\ (Q /\ R) /\ P");;
5570 -|- (P /\ Q) /\ R = R /\ (Q /\ R) /\ P
5571 + A |- (x /\ y) /\ z /\ w
5572 \end{verbatim}
5573 }
5574 -\USES
5575 -Used to reorder a conjunction. First sort the conjuncts in a term {\small\verb%t1%} into
5576 -the desired order (e.g. lexicographic order, for normalization) to get a new
5577 -term {\small\verb%t2%}, then call {\small\verb%CONJUNCTS_CONV(t1,t2)%}.
5578 +\noindent Application of {\small\verb%CONJUNCTS%} to {\small\verb%th%} returns the following list of
5579 +theorems:
5580 +{\par\samepage\setseps\small
5581 +\begin{verbatim}
5582 + [A |- x; A |- y; A |- z; A |- w] : thm list
5583 +\end{verbatim}
5584 +}
5585 +\SEEALSO
5586 +BODY_CONJUNCTS, CONJ_LIST, LIST_CONJ, CONJ, CONJUNCT1, CONJUNCT2, CONJ_PAIR.
5587 +
5588 +\ENDDOC
5589 +\DOC{CONJUNCTS\_THEN2}
5590 +
5591 +\TYPE {\small\verb%CONJUNCTS_THEN2 : (thm_tactic -> thm_tactic -> thm_tactic)%}\egroup
5592 +
5593 +\SYNOPSIS
5594 +Applies two theorem-tactics to the corresponding conjuncts of a theorem.
5595 +
5596 +\DESCRIBE
5597 +{\small\verb%CONJUNCTS_THEN2%} takes two theorem-tactics, {\small\verb%f1%} and {\small\verb%f2%}, and a theorem {\small\verb%t%}
5598 +whose conclusion must be a conjunction. {\small\verb%CONJUNCTS_THEN2%} breaks {\small\verb%t%} into two
5599 +new theorems, {\small\verb%t1%} and {\small\verb%t2%} which are {\small\verb%CONJUNCT1%} and {\small\verb%CONJUNCT2%} of {\small\verb%t%}
5600 +respectively, and then returns the tactic {\small\verb%f1 t1 THEN f2 t2%}. Thus
5601 +{\par\samepage\setseps\small
5602 +\begin{verbatim}
5603 + CONJUNCTS_THEN2 f1 f2 (A |- l /\ r) = f1 (A |- l) THEN f2 (A |- r)
5604 +\end{verbatim}
5605 +}
5606 +\noindent so if
5607 +{\par\samepage\setseps\small
5608 +\begin{verbatim}
5609 + A1 ?- t1 A2 ?- t2
5610 + ========== f1 (A |- l) ========== f2 (A |- r)
5611 + A2 ?- t2 A3 ?- t3
5612 +\end{verbatim}
5613 +}
5614 +\noindent then
5615 +{\par\samepage\setseps\small
5616 +\begin{verbatim}
5617 + A1 ?- t1
5618 + ========== CONJUNCTS_THEN2 f1 f2 (A |- l /\ r)
5619 + A3 ?- t3
5620 +\end{verbatim}
5621 +}
5622 +\FAILURE
5623 +{\small\verb%CONJUNCTS_THEN f%} will fail if applied to a theorem whose conclusion is not a
5624 +conjunction.
5625
5626 \COMMENTS
5627 -This is not a true conversion, so perhaps it ought to be called something else.
5628 +The system shows the type as {\small\verb%(thm_tactic -> thm_tactical)%}.
5629 +
5630 +\USES
5631 +The construction of complex {\small\verb%tactical%}s like {\small\verb%CONJUNCTS_THEN%}.
5632
5633 \SEEALSO
5634 -CONJ_SET_CONV.
5635 +CONJUNCT1, CONJUNCT2, CONJUNCTS, CONJUNCTS_TAC, CONJUNCTS_THEN2,
5636 +STRIP_THM_THEN.
5637
5638 \ENDDOC
5639 \DOC{CONJUNCTS\_THEN}
5640 @@ -3839,390 +3851,146 @@ CONJUNCT1, CONJUNCT2, CONJUNCTS, CONJUNC
5641 STRIP_THM_THEN.
5642
5643 \ENDDOC
5644 -\DOC{CONJUNCTS\_THEN2}
5645 +\DOC{constants}
5646
5647 -\TYPE {\small\verb%CONJUNCTS_THEN2 : (thm_tactic -> thm_tactic -> thm_tactic)%}\egroup
5648 +\TYPE {\small\verb%constants : (string -> term list)%}\egroup
5649
5650 \SYNOPSIS
5651 -Applies two theorem-tactics to the corresponding conjuncts of a theorem.
5652 +Returns a list of the constants defined in a named theory.
5653
5654 \DESCRIBE
5655 -{\small\verb%CONJUNCTS_THEN2%} takes two theorem-tactics, {\small\verb%f1%} and {\small\verb%f2%}, and a theorem {\small\verb%t%}
5656 -whose conclusion must be a conjunction. {\small\verb%CONJUNCTS_THEN2%} breaks {\small\verb%t%} into two
5657 -new theorems, {\small\verb%t1%} and {\small\verb%t2%} which are {\small\verb%CONJUNCT1%} and {\small\verb%CONJUNCT2%} of {\small\verb%t%}
5658 -respectively, and then returns the tactic {\small\verb%f1 t1 THEN f2 t2%}. Thus
5659 -{\par\samepage\setseps\small
5660 -\begin{verbatim}
5661 - CONJUNCTS_THEN2 f1 f2 (A |- l /\ r) = f1 (A |- l) THEN f2 (A |- r)
5662 -\end{verbatim}
5663 -}
5664 -\noindent so if
5665 +The call
5666 {\par\samepage\setseps\small
5667 \begin{verbatim}
5668 - A1 ?- t1 A2 ?- t2
5669 - ========== f1 (A |- l) ========== f2 (A |- r)
5670 - A2 ?- t2 A3 ?- t3
5671 + constants `thy`
5672 \end{verbatim}
5673 }
5674 -\noindent then
5675 +\noindent where {\small\verb%thy%} is an ancestor theory (the special string {\small\verb%`-`%} means the
5676 +current theory), returns a list of all the constants in that theory.
5677 +
5678 +\FAILURE
5679 +Fails if the named theory does not exist, or is not an ancestor of the
5680 +current theory.
5681 +
5682 +\EXAMPLE
5683 {\par\samepage\setseps\small
5684 \begin{verbatim}
5685 - A1 ?- t1
5686 - ========== CONJUNCTS_THEN2 f1 f2 (A |- l /\ r)
5687 - A3 ?- t3
5688 +#constants `combin`;;
5689 +["I"; "S"; "K"; "$o"] : term list
5690 \end{verbatim}
5691 }
5692 -\FAILURE
5693 -{\small\verb%CONJUNCTS_THEN f%} will fail if applied to a theorem whose conclusion is not a
5694 -conjunction.
5695 -
5696 -\COMMENTS
5697 -The system shows the type as {\small\verb%(thm_tactic -> thm_tactical)%}.
5698 -
5699 -\USES
5700 -The construction of complex {\small\verb%tactical%}s like {\small\verb%CONJUNCTS_THEN%}.
5701 -
5702 \SEEALSO
5703 -CONJUNCT1, CONJUNCT2, CONJUNCTS, CONJUNCTS_TAC, CONJUNCTS_THEN2,
5704 -STRIP_THM_THEN.
5705 +axioms, binders, definitions, infixes, theorems
5706
5707 \ENDDOC
5708 -\DOC{CONJ\_DISCH}
5709 +\DOC{CONTRAPOS\_CONV}
5710
5711 -\TYPE {\small\verb%CONJ_DISCH : (term -> thm -> thm)%}\egroup
5712 +\TYPE {\small\verb%CONTRAPOS_CONV : conv%}\egroup
5713
5714 \SYNOPSIS
5715 -Discharges an assumption and conjoins it to both sides of an equation.
5716 +Proves the equivalence of an implication and its contrapositive.
5717
5718 \DESCRIBE
5719 -Given an term {\small\verb%t%} and a theorem {\small\verb%A |- t1 = t2%}, which is an equation between
5720 -boolean terms, {\small\verb%CONJ_DISCH%} returns {\small\verb%A - {t} |- (t /\ t1) = (t /\ t2)%}, i.e.
5721 -conjoins {\small\verb%t%} to both sides of the equation, removing {\small\verb%t%} from the assumptions
5722 -if it was there.
5723 +When applied to an implication {\small\verb%P ==> Q%}, the conversion {\small\verb%CONTRAPOS_CONV%}
5724 +returns the theorem:
5725 {\par\samepage\setseps\small
5726 \begin{verbatim}
5727 - A |- t1 = t2
5728 - ------------------------------ CONJ_DISCH "t"
5729 - A - {t} |- t /\ t1 = t /\ t2
5730 + |- (P ==> Q) = (~Q ==> ~P)
5731 \end{verbatim}
5732 }
5733 \FAILURE
5734 -Fails unless the theorem is an equation, both sides of which, and the term
5735 -provided are of type {\small\verb%bool%}.
5736 +Fails if applied to a term that is not an implication.
5737
5738 \SEEALSO
5739 -CONJ_DISCHL.
5740 +CONTRAPOS.
5741
5742 \ENDDOC
5743 -\DOC{CONJ\_DISCHL}
5744 +\DOC{CONTRAPOS}
5745
5746 -\TYPE {\small\verb%CONJ_DISCHL : (term list -> thm -> thm)%}\egroup
5747 +\TYPE {\small\verb%CONTRAPOS : (thm -> thm)%}\egroup
5748
5749 \SYNOPSIS
5750 -Conjoins multiple assumptions to both sides of an equation.
5751 +Deduces the contrapositive of an implication.
5752
5753 \DESCRIBE
5754 -Given a term list {\small\verb%[t1;...;tn]%} and a theorem whose conclusion is an equation
5755 -between boolean terms, {\small\verb%CONJ_DISCHL%} conjoins all the terms
5756 -in the list to both sides of the equation, and removes any of the terms which
5757 -were in the assumption list.
5758 +When applied to a theorem {\small\verb%A |- s ==> t%}, the inference rule {\small\verb%CONTRAPOS%}
5759 +returns its contrapositive, {\small\verb%A |- ~t ==> ~s%}.
5760 {\par\samepage\setseps\small
5761 \begin{verbatim}
5762 - A |- s = t
5763 - -------------------------------------------------------- CONJ_DISCHL
5764 - A - {t1,...,tn} |- (t1/\.../\tn/\s) = (t1/\.../\tn/\t) ["t1";...;"tn"]
5765 + A |- s ==> t
5766 + ---------------- CONTRAPOS
5767 + A |- ~t ==> ~s
5768 \end{verbatim}
5769 }
5770 \FAILURE
5771 -Fails unless the theorem is an equation, both sides of which, and all the terms
5772 -provided, are of type {\small\verb%bool%}.
5773 +Fails unless the theorem is an implication.
5774
5775 \SEEALSO
5776 -CONJ_DISCH.
5777 +CCONTR, CONTR, CONTRAPOS_CONV, NOT_ELIM.
5778
5779 \ENDDOC
5780 -\DOC{CONJ\_LIST}
5781 +\DOC{CONTR}
5782
5783 -\TYPE {\small\verb%CONJ_LIST : (int -> thm -> thm list)%}\egroup
5784 +\TYPE {\small\verb%CONTR : (term -> thm -> thm)%}\egroup
5785
5786 \SYNOPSIS
5787 -Extracts a list of conjuncts from a theorem (non-flattening version).
5788 +Implements the intuitionistic contradiction rule.
5789
5790 \DESCRIBE
5791 -{\small\verb%CONJ_LIST%} is the proper inverse of {\small\verb%LIST_CONJ%}. Unlike {\small\verb%CONJUNCTS%} which
5792 -recursively splits as many conjunctions as possible both to the left and to
5793 -the right, {\small\verb%CONJ_LIST%} splits the top-level conjunction and then splits
5794 -(recursively) only the right conjunct. The integer argument is required
5795 -because the term {\small\verb%tn%} may itself be a conjunction. A list of {\small\verb%n%} theorems is
5796 -returned.
5797 +When applied to a term {\small\verb%t%} and a theorem {\small\verb%A |- F%}, the inference rule {\small\verb%CONTR%}
5798 +returns the theorem {\small\verb%A |- t%}.
5799 {\par\samepage\setseps\small
5800 \begin{verbatim}
5801 - A |- t1 /\ (t2 /\ ( ... /\ tn)...)
5802 - ------------------------------------ CONJ_LIST n (A |- t1 /\ ... /\ tn)
5803 - A |- t1 A |- t2 ... A |- tn
5804 + A |- F
5805 + -------- CONTR "t"
5806 + A |- t
5807 \end{verbatim}
5808 }
5809 \FAILURE
5810 -Fails if the integer argument ({\small\verb%n%}) is less than one, or if the input theorem
5811 -has less than {\small\verb%n%} conjuncts.
5812 -
5813 -\EXAMPLE
5814 -Suppose the identifier {\small\verb%th%} is bound to the theorem:
5815 -{\par\samepage\setseps\small
5816 -\begin{verbatim}
5817 - A |- (x /\ y) /\ z /\ w
5818 -\end{verbatim}
5819 -}
5820 -\noindent Here are some applications of {\small\verb%CONJ_LIST%} to {\small\verb%th%}:
5821 -{\par\samepage\setseps\small
5822 -\begin{verbatim}
5823 - #CONJ_LIST 0 th;;
5824 - evaluation failed CONJ_LIST
5825 -
5826 - #CONJ_LIST 1 th;;
5827 - [A |- (x /\ y) /\ z /\ w] : thm list
5828 -
5829 - #CONJ_LIST 2 th;;
5830 - [A |- x /\ y; A |- z /\ w] : thm list
5831 -
5832 - #CONJ_LIST 3 th;;
5833 - [A |- x /\ y; A |- z; A |- w] : thm list
5834 +Fails unless the term has type {\small\verb%bool%} and the theorem has {\small\verb%F%} as its
5835 +conclusion.
5836
5837 - #CONJ_LIST 4 th;;
5838 - evaluation failed CONJ_LIST
5839 -\end{verbatim}
5840 -}
5841 \SEEALSO
5842 -BODY_CONJUNCTS, LIST_CONJ, CONJUNCTS, CONJ, CONJUNCT1, CONJUNCT2, CONJ_PAIR.
5843 +CCONTR, CONTRAPOS, CONTR_TAC, NOT_ELIM.
5844
5845 \ENDDOC
5846 -\DOC{CONJ\_PAIR}
5847 +\DOC{CONTR\_TAC}
5848
5849 -\TYPE {\small\verb%CONJ_PAIR : (thm -> (thm # thm))%}\egroup
5850 +\TYPE {\small\verb%CONTR_TAC : thm_tactic%}\egroup
5851
5852 \SYNOPSIS
5853 -Extracts both conjuncts of a conjunction.
5854 +Solves any goal from contradictory theorem.
5855
5856 \DESCRIBE
5857 +When applied to a contradictory theorem {\small\verb%A' |- F%}, and a goal {\small\verb%A ?- t%},
5858 +the tactic {\small\verb%CONTR_TAC%} completely solves the goal. This is an invalid
5859 +tactic unless {\small\verb%A'%} is a subset of {\small\verb%A%}.
5860 {\par\samepage\setseps\small
5861 \begin{verbatim}
5862 - A |- t1 /\ t2
5863 - ---------------------- CONJ_PAIR
5864 - A |- t1 A |- t2
5865 + A ?- t
5866 + ======== CONTR_TAC (A' |- F)
5867 +
5868 \end{verbatim}
5869 }
5870 -\noindent The two resultant theorems are returned as a pair.
5871 -
5872 \FAILURE
5873 -Fails if the input theorem is not a conjunction.
5874 +Fails unless the theorem is contradictory, i.e. has {\small\verb%F%} as its conclusion.
5875
5876 \SEEALSO
5877 -BODY_CONJUNCTS, CONJUNCT1, CONJUNCT2, CONJ, LIST_CONJ, CONJ_LIST, CONJUNCTS.
5878 +CHECK_ASSUME_TAC, CONTR, CCONTR, CONTRAPOS, NOT_ELIM.
5879
5880 \ENDDOC
5881 -\DOC{CONJ\_SET\_CONV}
5882 +\DOC{CONV\_RULE}
5883
5884 -\TYPE {\small\verb%CONJ_SET_CONV : (term list -> term list -> thm)%}\egroup
5885 +\TYPE {\small\verb%CONV_RULE : (conv -> thm -> thm)%}\egroup
5886
5887 \SYNOPSIS
5888 -Proves the equivalence of the conjunctions of two equal sets of terms.
5889 +Makes an inference rule from a conversion.
5890
5891 \DESCRIBE
5892 -The arguments to {\small\verb%CONJ_SET_CONV%} are two lists of terms {\small\verb%[t1;...;tn]%} and
5893 -{\small\verb%[u1;...;um]%}. If these are equal when considered as sets, that is if the sets
5894 -{\par\samepage\setseps\small
5895 -\begin{verbatim}
5896 - {t1,...,tn} and {u1,...,um}
5897 -\end{verbatim}
5898 -}
5899 -\noindent are equal, then {\small\verb%CONJ_SET_CONV%} returns the theorem:
5900 -{\par\samepage\setseps\small
5901 -\begin{verbatim}
5902 - |- (t1 /\ ... /\ tn) = (u1 /\ ... /\ um)
5903 -\end{verbatim}
5904 -}
5905 -\noindent Otherwise {\small\verb%CONJ_SET_CONV%} fails.
5906 -
5907 -\FAILURE
5908 -{\small\verb%CONJ_SET_CONV [t1;...;tn] [u1;...;um]%} fails if {\small\verb%[t1,...,tn]%} and
5909 -{\small\verb%[u1,...,um]%}, regarded as sets of terms, are not equal. Also fails
5910 -if any {\small\verb%ti%} or {\small\verb%ui%} does not have type {\small\verb%bool%}.
5911 -
5912 -\USES
5913 -Used to order conjuncts. First sort a list of conjuncts {\small\verb%l1%} into the
5914 -desired order to get a new list {\small\verb%l2%}, then call {\small\verb%CONJ_SET_CONV l1 l2%}.
5915 -
5916 -\COMMENTS
5917 -This is not a true conversion, so perhaps it ought to be called something else.
5918 -
5919 -\SEEALSO
5920 -CONJUNCTS_CONV.
5921 -
5922 -\ENDDOC
5923 -\DOC{CONJ\_TAC}
5924 -
5925 -\TYPE {\small\verb%CONJ_TAC : tactic%}\egroup
5926 -
5927 -\SYNOPSIS
5928 -Reduces a conjunctive goal to two separate subgoals.
5929 -
5930 -\DESCRIBE
5931 -When applied to a goal {\small\verb%A ?- t1 /\ t2%}, the tactic {\small\verb%CONJ_TAC%} reduces it to the
5932 -two subgoals corresponding to each conjunct separately.
5933 -{\par\samepage\setseps\small
5934 -\begin{verbatim}
5935 - A ?- t1 /\ t2
5936 - ====================== CONJ_TAC
5937 - A ?- t1 A ?- t2
5938 -\end{verbatim}
5939 -}
5940 -\FAILURE
5941 -Fails unless the conclusion of the goal is a conjunction.
5942 -
5943 -\SEEALSO
5944 -STRIP_TAC.
5945 -
5946 -\ENDDOC
5947 -\DOC{constants}
5948 -
5949 -\TYPE {\small\verb%constants : (string -> term list)%}\egroup
5950 -
5951 -\SYNOPSIS
5952 -Returns a list of the constants defined in a named theory.
5953 -
5954 -\DESCRIBE
5955 -The call
5956 -{\par\samepage\setseps\small
5957 -\begin{verbatim}
5958 - constants `thy`
5959 -\end{verbatim}
5960 -}
5961 -\noindent where {\small\verb%thy%} is an ancestor theory (the special string {\small\verb%`-`%} means the
5962 -current theory), returns a list of all the constants in that theory.
5963 -
5964 -\FAILURE
5965 -Fails if the named theory does not exist, or is not an ancestor of the
5966 -current theory.
5967 -
5968 -\EXAMPLE
5969 -{\par\samepage\setseps\small
5970 -\begin{verbatim}
5971 -#constants `combin`;;
5972 -["I"; "S"; "K"; "$o"] : term list
5973 -\end{verbatim}
5974 -}
5975 -\SEEALSO
5976 -axioms, binders, definitions, infixes, theorems
5977 -
5978 -\ENDDOC
5979 -\DOC{CONTR}
5980 -
5981 -\TYPE {\small\verb%CONTR : (term -> thm -> thm)%}\egroup
5982 -
5983 -\SYNOPSIS
5984 -Implements the intuitionistic contradiction rule.
5985 -
5986 -\DESCRIBE
5987 -When applied to a term {\small\verb%t%} and a theorem {\small\verb%A |- F%}, the inference rule {\small\verb%CONTR%}
5988 -returns the theorem {\small\verb%A |- t%}.
5989 -{\par\samepage\setseps\small
5990 -\begin{verbatim}
5991 - A |- F
5992 - -------- CONTR "t"
5993 - A |- t
5994 -\end{verbatim}
5995 -}
5996 -\FAILURE
5997 -Fails unless the term has type {\small\verb%bool%} and the theorem has {\small\verb%F%} as its
5998 -conclusion.
5999 -
6000 -\SEEALSO
6001 -CCONTR, CONTRAPOS, CONTR_TAC, NOT_ELIM.
6002 -
6003 -\ENDDOC
6004 -\DOC{CONTRAPOS}
6005 -
6006 -\TYPE {\small\verb%CONTRAPOS : (thm -> thm)%}\egroup
6007 -
6008 -\SYNOPSIS
6009 -Deduces the contrapositive of an implication.
6010 -
6011 -\DESCRIBE
6012 -When applied to a theorem {\small\verb%A |- s ==> t%}, the inference rule {\small\verb%CONTRAPOS%}
6013 -returns its contrapositive, {\small\verb%A |- ~t ==> ~s%}.
6014 -{\par\samepage\setseps\small
6015 -\begin{verbatim}
6016 - A |- s ==> t
6017 - ---------------- CONTRAPOS
6018 - A |- ~t ==> ~s
6019 -\end{verbatim}
6020 -}
6021 -\FAILURE
6022 -Fails unless the theorem is an implication.
6023 -
6024 -\SEEALSO
6025 -CCONTR, CONTR, CONTRAPOS_CONV, NOT_ELIM.
6026 -
6027 -\ENDDOC
6028 -\DOC{CONTRAPOS\_CONV}
6029 -
6030 -\TYPE {\small\verb%CONTRAPOS_CONV : conv%}\egroup
6031 -
6032 -\SYNOPSIS
6033 -Proves the equivalence of an implication and its contrapositive.
6034 -
6035 -\DESCRIBE
6036 -When applied to an implication {\small\verb%P ==> Q%}, the conversion {\small\verb%CONTRAPOS_CONV%}
6037 -returns the theorem:
6038 -{\par\samepage\setseps\small
6039 -\begin{verbatim}
6040 - |- (P ==> Q) = (~Q ==> ~P)
6041 -\end{verbatim}
6042 -}
6043 -\FAILURE
6044 -Fails if applied to a term that is not an implication.
6045 -
6046 -\SEEALSO
6047 -CONTRAPOS.
6048 -
6049 -\ENDDOC
6050 -\DOC{CONTR\_TAC}
6051 -
6052 -\TYPE {\small\verb%CONTR_TAC : thm_tactic%}\egroup
6053 -
6054 -\SYNOPSIS
6055 -Solves any goal from contradictory theorem.
6056 -
6057 -\DESCRIBE
6058 -When applied to a contradictory theorem {\small\verb%A' |- F%}, and a goal {\small\verb%A ?- t%},
6059 -the tactic {\small\verb%CONTR_TAC%} completely solves the goal. This is an invalid
6060 -tactic unless {\small\verb%A'%} is a subset of {\small\verb%A%}.
6061 -{\par\samepage\setseps\small
6062 -\begin{verbatim}
6063 - A ?- t
6064 - ======== CONTR_TAC (A' |- F)
6065 -
6066 -\end{verbatim}
6067 -}
6068 -\FAILURE
6069 -Fails unless the theorem is contradictory, i.e. has {\small\verb%F%} as its conclusion.
6070 -
6071 -\SEEALSO
6072 -CHECK_ASSUME_TAC, CONTR, CCONTR, CONTRAPOS, NOT_ELIM.
6073 -
6074 -\ENDDOC
6075 -\DOC{CONV\_RULE}
6076 -
6077 -\TYPE {\small\verb%CONV_RULE : (conv -> thm -> thm)%}\egroup
6078 -
6079 -\SYNOPSIS
6080 -Makes an inference rule from a conversion.
6081 -
6082 -\DESCRIBE
6083 -If {\small\verb%c%} is a conversion, then {\small\verb%CONV_RULE c%} is an inference rule that applies
6084 -{\small\verb%c%} to the conclusion of a theorem. That is, if {\small\verb%c%} maps a term {\small\verb%"t"%} to the
6085 -theorem {\small\verb%|- t = t'%}, then the rule {\small\verb%CONV_RULE c%} infers {\small\verb%|- t'%} from the
6086 -theorem {\small\verb%|- t%}. More precisely, if {\small\verb%c "t"%} returns {\small\verb%A' |- t = t'%}, then:
6087 +If {\small\verb%c%} is a conversion, then {\small\verb%CONV_RULE c%} is an inference rule that applies
6088 +{\small\verb%c%} to the conclusion of a theorem. That is, if {\small\verb%c%} maps a term {\small\verb%"t"%} to the
6089 +theorem {\small\verb%|- t = t'%}, then the rule {\small\verb%CONV_RULE c%} infers {\small\verb%|- t'%} from the
6090 +theorem {\small\verb%|- t%}. More precisely, if {\small\verb%c "t"%} returns {\small\verb%A' |- t = t'%}, then:
6091 {\par\samepage\setseps\small
6092 \begin{verbatim}
6093 A |- t
6094 @@ -4353,6 +4121,41 @@ increment = - : (int -> int)
6095 uncurry.
6096
6097 \ENDDOC
6098 +\DOC{DEF\_EXISTS\_RULE}
6099 +
6100 +\TYPE {\small\verb%DEF_EXISTS_RULE : (term -> thm)%}\egroup
6101 +
6102 +\SYNOPSIS
6103 +Proves that a function defined by a definitional equation exists.
6104 +
6105 +\DESCRIBE
6106 +This rule accepts a term of the form {\small\verb%"c = ..."%} or {\small\verb%"f x1 ... xn = ..."%}, the
6107 +variables of which may be universally quantified, and returns an existential
6108 +theorem. The resulting theorem is typically used for generating HOL
6109 +specifications.
6110 +
6111 +\FAILURE
6112 +{\small\verb%DEF_EXISTS_RULE%} fails if the definition is not an equation, if there
6113 +is any variable in the right-hand side which does not occur in the
6114 +left-hand side, if the definition is recursive, if there is a free type
6115 +variable, or if the name being defined by the function is not allowed.
6116 +
6117 +\EXAMPLE
6118 +The effect of this rule can be understood more clearly through an
6119 +example:
6120 +{\par\samepage\setseps\small
6121 +\begin{verbatim}
6122 + #DEF_EXISTS_RULE "max a b = ((a < b) => b | a)" ;;
6123 + |- ?max. !a b. max a b = (a < b => b | a)
6124 +\end{verbatim}
6125 +}
6126 +\COMMENTS
6127 +In later versions of HOL this function may be made internal.
6128 +
6129 +\SEEALSO
6130 +new_definition, new_gen_definition, new_specification.
6131 +
6132 +\ENDDOC
6133 \DOC{define\_finite\_set\_syntax}
6134
6135 \TYPE {\small\verb%define_finite_set_syntax : ((string # string) -> void)%}\egroup
6136 @@ -4712,62 +4515,26 @@ definition of name {\small\verb%def%} in
6137 axiom, definitions, load_definition, load_definitions, new_definition, print_theory, theorem.
6138
6139 \ENDDOC
6140 -\DOC{definitions}
6141 +\DOC{definition\_lfn}
6142
6143 -\TYPE {\small\verb%definitions : (string -> (string # thm) list)%}\egroup
6144 +\TYPE {\small\verb%definition_lfn : (string list -> thm)%}\egroup
6145
6146 \SYNOPSIS
6147 -Returns the constant definitions, type definitions and constant specifications
6148 -of a given theory segment of the current theory.
6149 +Loads a given definition from a given theory.
6150
6151 \DESCRIBE
6152 -A call of {\small\verb%definitions `thy`%} returns the definitions of the theory segment
6153 -{\small\verb%thy%} together with their names. Constant definitions, type definitions and
6154 -constant specifications are all retrieved by the function {\small\verb%definitions%}. The
6155 -theory segment {\small\verb%thy%} must be part of the current theory. The names are those
6156 -given to the definitions by the user when they were originally added to the
6157 -theory segment (by a call, for example, to {\small\verb%new_definition%}). The name of the
6158 -current theory segment can be abbreviated by {\small\verb%`-`%}.
6159 +If {\small\verb%thy%} is an ancestor theory, and {\small\verb%def%} one of its definitions, then the
6160 +call
6161 +{\par\samepage\setseps\small
6162 +\begin{verbatim}
6163 + definition_lfn [`thy`;`def`]
6164 +\end{verbatim}
6165 +}
6166 +\noindent will return that definition.
6167
6168 \FAILURE
6169 -The call {\small\verb%definitions `thy`%} will fail if the theory segment {\small\verb%thy%} is not
6170 -part of the current theory.
6171 -
6172 -\EXAMPLE
6173 -{\par\samepage\setseps\small
6174 -\begin{verbatim}
6175 -#definitions `combin`;;
6176 -[(`I_DEF`, |- I = S K K);
6177 - (`S_DEF`, |- S = (\f g x. f x(g x)));
6178 - (`K_DEF`, |- K = (\x y. x));
6179 - (`o_DEF`, |- !f g. f o g = (\x. f(g x)))]
6180 -: (string # thm) list
6181 -\end{verbatim}
6182 -}
6183 -\SEEALSO
6184 -axioms, definition, load_definition, load_definitions, new_definition, print_theory, theorems.
6185 -
6186 -\ENDDOC
6187 -\DOC{definition\_lfn}
6188 -
6189 -\TYPE {\small\verb%definition_lfn : (string list -> thm)%}\egroup
6190 -
6191 -\SYNOPSIS
6192 -Loads a given definition from a given theory.
6193 -
6194 -\DESCRIBE
6195 -If {\small\verb%thy%} is an ancestor theory, and {\small\verb%def%} one of its definitions, then the
6196 -call
6197 -{\par\samepage\setseps\small
6198 -\begin{verbatim}
6199 - definition_lfn [`thy`;`def`]
6200 -\end{verbatim}
6201 -}
6202 -\noindent will return that definition.
6203 -
6204 -\FAILURE
6205 -Fails if {\small\verb%thy%} is not an ancestor theory, or if {\small\verb%def%} is not one of its
6206 -definitions.
6207 +Fails if {\small\verb%thy%} is not an ancestor theory, or if {\small\verb%def%} is not one of its
6208 +definitions.
6209
6210 \EXAMPLE
6211 {\par\samepage\setseps\small
6212 @@ -4824,39 +4591,40 @@ autoload, autoload_theory, definition, d
6213 load_definition, load_definitions, undo_autoload.
6214
6215 \ENDDOC
6216 -\DOC{DEF\_EXISTS\_RULE}
6217 +\DOC{definitions}
6218
6219 -\TYPE {\small\verb%DEF_EXISTS_RULE : (term -> thm)%}\egroup
6220 +\TYPE {\small\verb%definitions : (string -> (string # thm) list)%}\egroup
6221
6222 \SYNOPSIS
6223 -Proves that a function defined by a definitional equation exists.
6224 +Returns the constant definitions, type definitions and constant specifications
6225 +of a given theory segment of the current theory.
6226
6227 \DESCRIBE
6228 -This rule accepts a term of the form {\small\verb%"c = ..."%} or {\small\verb%"f x1 ... xn = ..."%}, the
6229 -variables of which may be universally quantified, and returns an existential
6230 -theorem. The resulting theorem is typically used for generating HOL
6231 -specifications.
6232 +A call of {\small\verb%definitions `thy`%} returns the definitions of the theory segment
6233 +{\small\verb%thy%} together with their names. Constant definitions, type definitions and
6234 +constant specifications are all retrieved by the function {\small\verb%definitions%}. The
6235 +theory segment {\small\verb%thy%} must be part of the current theory. The names are those
6236 +given to the definitions by the user when they were originally added to the
6237 +theory segment (by a call, for example, to {\small\verb%new_definition%}). The name of the
6238 +current theory segment can be abbreviated by {\small\verb%`-`%}.
6239
6240 \FAILURE
6241 -{\small\verb%DEF_EXISTS_RULE%} fails if the definition is not an equation, if there
6242 -is any variable in the right-hand side which does not occur in the
6243 -left-hand side, if the definition is recursive, if there is a free type
6244 -variable, or if the name being defined by the function is not allowed.
6245 +The call {\small\verb%definitions `thy`%} will fail if the theory segment {\small\verb%thy%} is not
6246 +part of the current theory.
6247
6248 \EXAMPLE
6249 -The effect of this rule can be understood more clearly through an
6250 -example:
6251 {\par\samepage\setseps\small
6252 \begin{verbatim}
6253 - #DEF_EXISTS_RULE "max a b = ((a < b) => b | a)" ;;
6254 - |- ?max. !a b. max a b = (a < b => b | a)
6255 +#definitions `combin`;;
6256 +[(`I_DEF`, |- I = S K K);
6257 + (`S_DEF`, |- S = (\f g x. f x(g x)));
6258 + (`K_DEF`, |- K = (\x y. x));
6259 + (`o_DEF`, |- !f g. f o g = (\x. f(g x)))]
6260 +: (string # thm) list
6261 \end{verbatim}
6262 }
6263 -\COMMENTS
6264 -In later versions of HOL this function may be made internal.
6265 -
6266 \SEEALSO
6267 -new_definition, new_gen_definition, new_specification.
6268 +axioms, definition, load_definition, load_definitions, new_definition, print_theory, theorems.
6269
6270 \ENDDOC
6271 \DOC{delete\_cache}
6272 @@ -5582,31 +5350,34 @@ is not {\small\verb%T%} or already in th
6273 POP_ASSUM, POP_ASSUM_LIST.
6274
6275 \ENDDOC
6276 -\DOC{DISCH}
6277 +\DOC{DISCH\_ALL}
6278
6279 -\TYPE {\small\verb%DISCH : (term -> thm -> thm)%}\egroup
6280 +\TYPE {\small\verb%DISCH_ALL : (thm -> thm)%}\egroup
6281
6282 \SYNOPSIS
6283 -Discharges an assumption.
6284 +Discharges all hypotheses of a theorem.
6285
6286 \DESCRIBE
6287 {\par\samepage\setseps\small
6288 \begin{verbatim}
6289 - A |- t
6290 --------------------- DISCH "u"
6291 - A - {u} |- u ==> t
6292 + A1, ..., An |- t
6293 + ---------------------------- DISCH_ALL
6294 + |- A1 ==> ... ==> An ==> t
6295 \end{verbatim}
6296 }
6297 \FAILURE
6298 -{\small\verb%DISCH%} will fail if {\small\verb%"u"%} is not boolean.
6299 +{\small\verb%DISCH_ALL%} will not fail if there are no hypotheses to discharge, it will
6300 +simply return the theorem unchanged.
6301
6302 \COMMENTS
6303 -The term {\small\verb%"u"%} need not be a hypothesis. Discharging {\small\verb%"u"%} will remove all
6304 -identical and alpha-equivalent hypotheses.
6305 +Users should not rely on the hypotheses being discharged in any particular
6306 +order. Two or more alpha-convertible hypotheses will be discharged by a
6307 +single implication; users should not rely on which hypothesis appears in the
6308 +implication.
6309
6310 \SEEALSO
6311 -DISCH_ALL, DISCH_TAC, DISCH_THEN, FILTER_DISCH_TAC, FILTER_DISCH_THEN,
6312 -NEG_DISCH, STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC.
6313 +DISCH, DISCH_TAC, DISCH_THEN, NEG_DISCH, FILTER_DISCH_TAC, FILTER_DISCH_THEN,
6314 +STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC.
6315
6316 \ENDDOC
6317 \DOC{disch}
6318 @@ -5632,34 +5403,31 @@ disch ("\x:bool.T",["A = T";"B = 3";"\y:
6319 filter.
6320
6321 \ENDDOC
6322 -\DOC{DISCH\_ALL}
6323 +\DOC{DISCH}
6324
6325 -\TYPE {\small\verb%DISCH_ALL : (thm -> thm)%}\egroup
6326 +\TYPE {\small\verb%DISCH : (term -> thm -> thm)%}\egroup
6327
6328 \SYNOPSIS
6329 -Discharges all hypotheses of a theorem.
6330 +Discharges an assumption.
6331
6332 \DESCRIBE
6333 {\par\samepage\setseps\small
6334 \begin{verbatim}
6335 - A1, ..., An |- t
6336 - ---------------------------- DISCH_ALL
6337 - |- A1 ==> ... ==> An ==> t
6338 + A |- t
6339 +-------------------- DISCH "u"
6340 + A - {u} |- u ==> t
6341 \end{verbatim}
6342 }
6343 \FAILURE
6344 -{\small\verb%DISCH_ALL%} will not fail if there are no hypotheses to discharge, it will
6345 -simply return the theorem unchanged.
6346 +{\small\verb%DISCH%} will fail if {\small\verb%"u"%} is not boolean.
6347
6348 \COMMENTS
6349 -Users should not rely on the hypotheses being discharged in any particular
6350 -order. Two or more alpha-convertible hypotheses will be discharged by a
6351 -single implication; users should not rely on which hypothesis appears in the
6352 -implication.
6353 +The term {\small\verb%"u"%} need not be a hypothesis. Discharging {\small\verb%"u"%} will remove all
6354 +identical and alpha-equivalent hypotheses.
6355
6356 \SEEALSO
6357 -DISCH, DISCH_TAC, DISCH_THEN, NEG_DISCH, FILTER_DISCH_TAC, FILTER_DISCH_THEN,
6358 -STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC.
6359 +DISCH_ALL, DISCH_TAC, DISCH_THEN, FILTER_DISCH_TAC, FILTER_DISCH_THEN,
6360 +NEG_DISCH, STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC.
6361
6362 \ENDDOC
6363 \DOC{DISCH\_TAC}
6364 @@ -5861,55 +5629,6 @@ Fails if the goal is not a disjunction.
6365 DISJ1, DISJ1_TAC, DISJ2.
6366
6367 \ENDDOC
6368 -\DOC{disjuncts}
6369 -
6370 -\TYPE {\small\verb%disjuncts : (term -> term list)%}\egroup
6371 -
6372 -\SYNOPSIS
6373 -Iteratively breaks apart a disjunction.
6374 -
6375 -\DESCRIBE
6376 -{\small\verb%disjuncts "t1 \/ ... \/ tn"%} returns {\small\verb%["t1";...;"tn"]%}.
6377 -The argument term may be any tree of disjunctions;
6378 -it need not have the form {\small\verb%"t1 \/ (t2 \/ ( ... \/ tn)...)"%}.
6379 -A term that is not a disjunction is simply returned as the sole element of a
6380 -list. Note that
6381 -{\par\samepage\setseps\small
6382 -\begin{verbatim}
6383 - disjuncts(list_mk_disj(["t1";...;"tn"]))
6384 -\end{verbatim}
6385 -}
6386 -\noindent will not return {\small\verb%["t1";...;"tn"]%} if any of {\small\verb%t1%},...,{\small\verb%tn%} are
6387 -disjunctions.
6388 -
6389 -\FAILURE
6390 -Never fails.
6391 -
6392 -\EXAMPLE
6393 -{\par\samepage\setseps\small
6394 -\begin{verbatim}
6395 -#list_mk_disj ["a \/ b";"c \/ d";"e \/ f"];;
6396 -"(a \/ b) \/ (c \/ d) \/ e \/ f" : term
6397 -
6398 -#disjuncts it;;
6399 -["a"; "b"; "c"; "d"; "e"; "f"] : term list
6400 -
6401 -#list_mk_disj it;;
6402 -"a \/ b \/ c \/ d \/ e \/ f" : term
6403 -
6404 -#disjuncts "1";;
6405 -["1"] : term list
6406 -\end{verbatim}
6407 -}
6408 -\COMMENTS
6409 -Because {\small\verb%disjuncts%} splits both the left and right sides of a disjunction,
6410 -this operation is not the inverse of {\small\verb%list_mk_disj%}. It may be useful to
6411 -introduce {\small\verb%list_dest_disj%} for splitting only the right tails of a disjunction.
6412 -
6413 -\SEEALSO
6414 -list_mk_disj, dest_disj.
6415 -
6416 -\ENDDOC
6417 \DOC{DISJ\_CASES}
6418
6419 \TYPE {\small\verb%DISJ_CASES : (thm -> thm -> thm -> thm)%}\egroup
6420 @@ -6003,77 +5722,6 @@ Performing a case analysis according to
6421 ASSUME_TAC, ASM_CASES_TAC, COND_CASES_TAC, DISJ_CASES_THEN, STRUCT_CASES_TAC.
6422
6423 \ENDDOC
6424 -\DOC{DISJ\_CASES\_THEN}
6425 -
6426 -\TYPE {\small\verb%DISJ_CASES_THEN : thm_tactical%}\egroup
6427 -
6428 -\SYNOPSIS
6429 -Applies a theorem-tactic to each disjunct of a disjunctive theorem.
6430 -
6431 -\DESCRIBE
6432 -If the theorem-tactic {\small\verb%f:thm->tactic%} applied to either
6433 -{\small\verb%ASSUME%}d disjunct produces results as follows when applied to a goal
6434 -{\small\verb%(A ?- t)%}:
6435 -{\par\samepage\setseps\small
6436 -\begin{verbatim}
6437 - A ?- t A ?- t
6438 - ========= f (u |- u) and ========= f (v |- v)
6439 - A ?- t1 A ?- t2
6440 -\end{verbatim}
6441 -}
6442 -\noindent then applying {\small\verb%DISJ_CASES_THEN f (|- u \/ v)%}
6443 -to the goal {\small\verb%(A ?- t)%} produces two subgoals.
6444 -{\par\samepage\setseps\small
6445 -\begin{verbatim}
6446 - A ?- t
6447 - ====================== DISJ_CASES_THEN f (|- u \/ v)
6448 - A ?- t1 A ?- t2
6449 -\end{verbatim}
6450 -}
6451 -\FAILURE
6452 -Fails if the theorem is not a disjunction. An invalid tactic is
6453 -produced if the theorem has any hypothesis which is not
6454 -alpha-convertible to an assumption of the goal.
6455 -
6456 -\EXAMPLE
6457 -Given the theorem
6458 -{\par\samepage\setseps\small
6459 -\begin{verbatim}
6460 - th = |- (m = 0) \/ (?n. m = SUC n)
6461 -\end{verbatim}
6462 -}
6463 -\noindent and a goal of the form {\small\verb%?- (PRE m = m) = (m = 0)%},
6464 -applying the tactic
6465 -{\par\samepage\setseps\small
6466 -\begin{verbatim}
6467 - DISJ_CASES_THEN ASSUME_TAC th
6468 -\end{verbatim}
6469 -}
6470 -\noindent produces two subgoals, each with one disjunct as an added
6471 -assumption:
6472 -{\par\samepage\setseps\small
6473 -\begin{verbatim}
6474 - ?n. m = SUC n ?- (PRE m = m) = (m = 0)
6475 -
6476 - m = 0 ?- (PRE m = m) = (m = 0)
6477 -\end{verbatim}
6478 -}
6479 -\USES
6480 -Building cases tactics. For example, {\small\verb%DISJ_CASES_TAC%} could be defined by:
6481 -{\par\samepage\setseps\small
6482 -\begin{verbatim}
6483 - let DISJ_CASES_TAC = DISJ_CASES_THEN ASSUME_TAC
6484 -\end{verbatim}
6485 -}
6486 -\COMMENTS
6487 -Use {\small\verb%DISJ_CASES_THEN2%} to apply different tactic generating functions
6488 -to each case.
6489 -
6490 -\SEEALSO
6491 -STRIP_THM_THEN, CHOOSE_THEN, CONJUNCTS_THEN, CONJUNCTS_THEN2,
6492 -DISJ_CASES_TAC, DISJ_CASES_THEN2, DISJ_CASES_THENL.
6493 -
6494 -\ENDDOC
6495 \DOC{DISJ\_CASES\_THEN2}
6496
6497 \TYPE {\small\verb%DISJ_CASES_THEN2 : (thm_tactic -> thm_tactical)%}\egroup
6498 @@ -6156,21 +5804,92 @@ STRIP_THM_THEN, CHOOSE_THEN, CONJUNCTS_T
6499 DISJ_CASES_THEN, DISJ_CASES_THENL.
6500
6501 \ENDDOC
6502 -\DOC{DISJ\_CASES\_THENL}
6503 +\DOC{DISJ\_CASES\_THEN}
6504
6505 -\TYPE {\small\verb%DISJ_CASES_THENL : (thm_tactic list -> thm_tactic)%}\egroup
6506 +\TYPE {\small\verb%DISJ_CASES_THEN : thm_tactical%}\egroup
6507
6508 \SYNOPSIS
6509 -Applies theorem-tactics in a list to the corresponding disjuncts in a theorem.
6510 +Applies a theorem-tactic to each disjunct of a disjunctive theorem.
6511
6512 \DESCRIBE
6513 -If the theorem-tactics {\small\verb%f1...fn%} applied to the {\small\verb%ASSUME%}d disjuncts of a
6514 -theorem
6515 +If the theorem-tactic {\small\verb%f:thm->tactic%} applied to either
6516 +{\small\verb%ASSUME%}d disjunct produces results as follows when applied to a goal
6517 +{\small\verb%(A ?- t)%}:
6518 {\par\samepage\setseps\small
6519 \begin{verbatim}
6520 - |- d1 \/ d2 \/...\/ dn
6521 -\end{verbatim}
6522 -}
6523 + A ?- t A ?- t
6524 + ========= f (u |- u) and ========= f (v |- v)
6525 + A ?- t1 A ?- t2
6526 +\end{verbatim}
6527 +}
6528 +\noindent then applying {\small\verb%DISJ_CASES_THEN f (|- u \/ v)%}
6529 +to the goal {\small\verb%(A ?- t)%} produces two subgoals.
6530 +{\par\samepage\setseps\small
6531 +\begin{verbatim}
6532 + A ?- t
6533 + ====================== DISJ_CASES_THEN f (|- u \/ v)
6534 + A ?- t1 A ?- t2
6535 +\end{verbatim}
6536 +}
6537 +\FAILURE
6538 +Fails if the theorem is not a disjunction. An invalid tactic is
6539 +produced if the theorem has any hypothesis which is not
6540 +alpha-convertible to an assumption of the goal.
6541 +
6542 +\EXAMPLE
6543 +Given the theorem
6544 +{\par\samepage\setseps\small
6545 +\begin{verbatim}
6546 + th = |- (m = 0) \/ (?n. m = SUC n)
6547 +\end{verbatim}
6548 +}
6549 +\noindent and a goal of the form {\small\verb%?- (PRE m = m) = (m = 0)%},
6550 +applying the tactic
6551 +{\par\samepage\setseps\small
6552 +\begin{verbatim}
6553 + DISJ_CASES_THEN ASSUME_TAC th
6554 +\end{verbatim}
6555 +}
6556 +\noindent produces two subgoals, each with one disjunct as an added
6557 +assumption:
6558 +{\par\samepage\setseps\small
6559 +\begin{verbatim}
6560 + ?n. m = SUC n ?- (PRE m = m) = (m = 0)
6561 +
6562 + m = 0 ?- (PRE m = m) = (m = 0)
6563 +\end{verbatim}
6564 +}
6565 +\USES
6566 +Building cases tactics. For example, {\small\verb%DISJ_CASES_TAC%} could be defined by:
6567 +{\par\samepage\setseps\small
6568 +\begin{verbatim}
6569 + let DISJ_CASES_TAC = DISJ_CASES_THEN ASSUME_TAC
6570 +\end{verbatim}
6571 +}
6572 +\COMMENTS
6573 +Use {\small\verb%DISJ_CASES_THEN2%} to apply different tactic generating functions
6574 +to each case.
6575 +
6576 +\SEEALSO
6577 +STRIP_THM_THEN, CHOOSE_THEN, CONJUNCTS_THEN, CONJUNCTS_THEN2,
6578 +DISJ_CASES_TAC, DISJ_CASES_THEN2, DISJ_CASES_THENL.
6579 +
6580 +\ENDDOC
6581 +\DOC{DISJ\_CASES\_THENL}
6582 +
6583 +\TYPE {\small\verb%DISJ_CASES_THENL : (thm_tactic list -> thm_tactic)%}\egroup
6584 +
6585 +\SYNOPSIS
6586 +Applies theorem-tactics in a list to the corresponding disjuncts in a theorem.
6587 +
6588 +\DESCRIBE
6589 +If the theorem-tactics {\small\verb%f1...fn%} applied to the {\small\verb%ASSUME%}d disjuncts of a
6590 +theorem
6591 +{\par\samepage\setseps\small
6592 +\begin{verbatim}
6593 + |- d1 \/ d2 \/...\/ dn
6594 +\end{verbatim}
6595 +}
6596 \noindent produce results as follows when applied to a goal {\small\verb%(A ?- t)%}:
6597 {\par\samepage\setseps\small
6598 \begin{verbatim}
6599 @@ -6211,103 +5930,352 @@ DISJ_CASES_THEN, DISJ_CASES_THEN2, STRIP
6600 \TYPE {\small\verb%DISJ_CASES_UNION : (thm -> thm -> thm -> thm)%}\egroup
6601
6602 \SYNOPSIS
6603 -Makes an inference for each arm of a disjunct.
6604 +Makes an inference for each arm of a disjunct.
6605 +
6606 +\DESCRIBE
6607 +Given a disjunctive theorem, and two additional theorems each having one
6608 +disjunct as a hypothesis, a new theorem with a conclusion that is the
6609 +disjunction of the conclusions of the last two theorems is produced. The
6610 +hypotheses include the union of hypotheses of all three theorems less the two
6611 +disjuncts.
6612 +{\par\samepage\setseps\small
6613 +\begin{verbatim}
6614 + A |- t1 \/ t2 A1 u {t1} |- t3 A2 u {t2} |- t4
6615 + ------------------------------------------------------ DISJ_CASES_UNION
6616 + A u A1 u A2 |- t3 \/ t4
6617 +\end{verbatim}
6618 +}
6619 +\FAILURE
6620 +Fails if the first theorem is not a disjunction.
6621 +
6622 +\EXAMPLE
6623 +The built-in theorem {\small\verb%LESS_CASES%} can be specialized to:
6624 +{\par\samepage\setseps\small
6625 +\begin{verbatim}
6626 + th1 = |- m < n \/ n <= m
6627 +\end{verbatim}
6628 +}
6629 +\noindent and used with two additional theorems:
6630 +{\par\samepage\setseps\small
6631 +\begin{verbatim}
6632 + th2 = (m < n |- (m MOD n = m))
6633 + th3 = ({0 < n, n <= m} |- (m MOD n) = ((m - n) MOD n))
6634 +\end{verbatim}
6635 +}
6636 +\noindent to derive a new theorem:
6637 +{\par\samepage\setseps\small
6638 +\begin{verbatim}
6639 + #DISJ_CASES_UNION th1 th2 th3;;
6640 + ["0 < n"] |- (m MOD n = m) \/ (m MOD n = (m - n) MOD n)
6641 +\end{verbatim}
6642 +}
6643 +\SEEALSO
6644 +DISJ_CASES, DISJ_CASES_TAC, DISJ1, DISJ2.
6645 +
6646 +\ENDDOC
6647 +\DOC{DISJ\_IMP}
6648 +
6649 +\TYPE {\small\verb%DISJ_IMP : (thm -> thm)%}\egroup
6650 +
6651 +\SYNOPSIS
6652 +Converts a disjunctive theorem to an equivalent implicative theorem.
6653 +
6654 +\DESCRIBE
6655 +The left disjunct of a disjunctive theorem becomes the negated
6656 +antecedent of the newly generated theorem.
6657 +{\par\samepage\setseps\small
6658 +\begin{verbatim}
6659 + A |- t1 \/ t2
6660 + ----------------- DISJ_IMP
6661 + A |- ~t1 ==> t2
6662 +\end{verbatim}
6663 +}
6664 +\FAILURE
6665 +Fails if the theorem is not a disjunction.
6666 +
6667 +\EXAMPLE
6668 +Specializing the built-in theorem {\small\verb%LESS_CASES%} gives the theorem:
6669 +{\par\samepage\setseps\small
6670 +\begin{verbatim}
6671 + th = |- m < n \/ n <= m
6672 +\end{verbatim}
6673 +}
6674 +\noindent to which {\small\verb%DISJ_IMP%} may be applied:
6675 +{\par\samepage\setseps\small
6676 +\begin{verbatim}
6677 + #DISJ_IMP th;;
6678 + |- ~m < n ==> n <= m
6679 +\end{verbatim}
6680 +}
6681 +\SEEALSO
6682 +DISJ_CASES.
6683 +
6684 +\ENDDOC
6685 +\DOC{disjuncts}
6686 +
6687 +\TYPE {\small\verb%disjuncts : (term -> term list)%}\egroup
6688 +
6689 +\SYNOPSIS
6690 +Iteratively breaks apart a disjunction.
6691 +
6692 +\DESCRIBE
6693 +{\small\verb%disjuncts "t1 \/ ... \/ tn"%} returns {\small\verb%["t1";...;"tn"]%}.
6694 +The argument term may be any tree of disjunctions;
6695 +it need not have the form {\small\verb%"t1 \/ (t2 \/ ( ... \/ tn)...)"%}.
6696 +A term that is not a disjunction is simply returned as the sole element of a
6697 +list. Note that
6698 +{\par\samepage\setseps\small
6699 +\begin{verbatim}
6700 + disjuncts(list_mk_disj(["t1";...;"tn"]))
6701 +\end{verbatim}
6702 +}
6703 +\noindent will not return {\small\verb%["t1";...;"tn"]%} if any of {\small\verb%t1%},...,{\small\verb%tn%} are
6704 +disjunctions.
6705 +
6706 +\FAILURE
6707 +Never fails.
6708 +
6709 +\EXAMPLE
6710 +{\par\samepage\setseps\small
6711 +\begin{verbatim}
6712 +#list_mk_disj ["a \/ b";"c \/ d";"e \/ f"];;
6713 +"(a \/ b) \/ (c \/ d) \/ e \/ f" : term
6714 +
6715 +#disjuncts it;;
6716 +["a"; "b"; "c"; "d"; "e"; "f"] : term list
6717 +
6718 +#list_mk_disj it;;
6719 +"a \/ b \/ c \/ d \/ e \/ f" : term
6720 +
6721 +#disjuncts "1";;
6722 +["1"] : term list
6723 +\end{verbatim}
6724 +}
6725 +\COMMENTS
6726 +Because {\small\verb%disjuncts%} splits both the left and right sides of a disjunction,
6727 +this operation is not the inverse of {\small\verb%list_mk_disj%}. It may be useful to
6728 +introduce {\small\verb%list_dest_disj%} for splitting only the right tails of a disjunction.
6729 +
6730 +\SEEALSO
6731 +list_mk_disj, dest_disj.
6732 +
6733 +\ENDDOC
6734 +\DOC{distinct}
6735 +
6736 +\TYPE {\small\verb%distinct : (* list -> bool)%}\egroup
6737 +
6738 +\SYNOPSIS
6739 +Checks whether the elements of a list are all distinct.
6740 +
6741 +\DESCRIBE
6742 +If all the elements in a list are distinct, returns {\small\verb%true%}, otherwise returns
6743 +{\small\verb%false%}.
6744 +
6745 +\FAILURE
6746 +Never fails.
6747 +
6748 +\SEEALSO
6749 +setify.
6750 +
6751 +\ENDDOC
6752 +\DOC{/}
6753 +
6754 +\TYPE {\small\verb%$/ : ((int # int) -> int)%}\egroup
6755 +
6756 +\SYNOPSIS
6757 +Performs division on ML integers.
6758 +
6759 +\FAILURE
6760 +Fails on division by zero.
6761 +
6762 +\ENDDOC
6763 +\DOC{<<}
6764 +
6765 +\TYPE {\small\verb%$<< : ((* # **) -> bool)%}\egroup
6766 +
6767 +\SYNOPSIS
6768 +Performs a lexical comparison of values.
6769 +
6770 +\DESCRIBE
6771 +{\small\verb%$<<%} performs a fast ordering on values. It is substitutive with
6772 +respect to equality in ML (i.e. if {\small\verb%x << y%} and {\small\verb%x = x'%} and {\small\verb%y = y'%}
6773 +then {\small\verb%x' << y'%}).
6774 +
6775 +\FAILURE
6776 +Never fails.
6777 +
6778 +\USES
6779 +It is often useful, for example in normalizing terms in some way, to be able to
6780 +impose some arbitrary (but definite) ordering on ML values.
6781 +
6782 +\SEEALSO
6783 +=.
6784 +
6785 +\ENDDOC
6786 +\DOC{<}
6787 +
6788 +\TYPE {\small\verb%$< : ((int # int) -> bool)%}\egroup
6789 +
6790 +\SYNOPSIS
6791 +Performs a less-than test on ML integers.
6792 +
6793 +\FAILURE
6794 +Never fails.
6795 +
6796 +\ENDDOC
6797 +\DOC{=}
6798 +
6799 +\TYPE {\small\verb%$= : ((* # *) -> bool)%}\egroup
6800 +
6801 +\SYNOPSIS
6802 +Performs an equality test on two ML values.
6803 +
6804 +\DESCRIBE
6805 +{\small\verb%$=%} works as expected on non-function types. It may give unexpected results
6806 +when applied to function types (or types containing them, such as a pair of
6807 +functions), and should be considered unreliable in those situations.
6808 +
6809 +\FAILURE
6810 +Never fails.
6811 +
6812 +\EXAMPLE
6813 +{\par\samepage\setseps\small
6814 +\begin{verbatim}
6815 +#1 = 2;;
6816 +false : bool
6817 +
6818 +#1 = 1;;
6819 +true : bool
6820 +
6821 +#let f x = x + 1 and g x = x + 2;;
6822 +f = - : (int -> int)
6823 +g = - : (int -> int)
6824 +
6825 +#let f' = f and h x = f x and h' x = x + 1;;
6826 +f' = - : (int -> int)
6827 +h = - : (int -> int)
6828 +h' = - : (int -> int)
6829 +
6830 +#f=f;;
6831 +true : bool
6832 +
6833 +#f = f';;
6834 +true : bool
6835 +
6836 +#f = g;;
6837 +false : bool
6838 +
6839 +#f =h;;
6840 +false : bool
6841 +
6842 +#f=h';;
6843 +false : bool
6844 +
6845 +#h = h';;
6846 +false : bool
6847 +\end{verbatim}
6848 +}
6849 +\ENDDOC
6850 +\DOC{>}
6851 +
6852 +\TYPE {\small\verb%$> : ((int # int) -> bool)%}\egroup
6853 +
6854 +\SYNOPSIS
6855 +Performs a greater-than test on ML integers.
6856 +
6857 +\FAILURE
6858 +Never fails.
6859 +
6860 +\ENDDOC
6861 +\DOC{-}
6862 +
6863 +\TYPE {\small\verb%$- : ((int # int) -> int)%}\egroup
6864 +
6865 +\SYNOPSIS
6866 +Performs subtraction on ML integers.
6867 +
6868 +\FAILURE
6869 +Never fails.
6870 +
6871 +\COMMENTS
6872 +Unary {\small\verb%-%} exists as an internal parser object, but not as a function. So,
6873 +whilst typing in {\small\verb%-1;;%} will work, {\small\verb%-;;%} will return a parse error.
6874 +
6875 +\ENDDOC
6876 +\DOC{\char'056}
6877 +
6878 +\TYPE {\small\verb%$. : ((* # * list) -> * list)%}\egroup
6879 +
6880 +\SYNOPSIS
6881 +Adds single element to the head of a list.
6882 +
6883 +\DESCRIBE
6884 +The {\small\verb%.%} operator is an infixed primitive list constructor, analogous to {\small\verb%CONS%}
6885 +in LISP. Its effect is {\small\verb%x . [x1;....;xn]%} = {\small\verb%[x;x1;...;xn]%}.
6886 +
6887 +\FAILURE
6888 +Never fails.
6889 +
6890 +\ENDDOC
6891 +\DOC{\char'100}
6892 +
6893 +\TYPE {\small\verb%$@ : ((* list # * list) -> * list)%}\egroup
6894 +
6895 +\SYNOPSIS
6896 +Concatenates two lists.
6897
6898 \DESCRIBE
6899 -Given a disjunctive theorem, and two additional theorems each having one
6900 -disjunct as a hypothesis, a new theorem with a conclusion that is the
6901 -disjunction of the conclusions of the last two theorems is produced. The
6902 -hypotheses include the union of hypotheses of all three theorems less the two
6903 -disjuncts.
6904 -{\par\samepage\setseps\small
6905 -\begin{verbatim}
6906 - A |- t1 \/ t2 A1 u {t1} |- t3 A2 u {t2} |- t4
6907 - ------------------------------------------------------ DISJ_CASES_UNION
6908 - A u A1 u A2 |- t3 \/ t4
6909 -\end{verbatim}
6910 -}
6911 +{\small\verb%@%} is an infix operator which concatenates two lists.
6912 +
6913 \FAILURE
6914 -Fails if the first theorem is not a disjunction.
6915 +Never fails.
6916
6917 \EXAMPLE
6918 -The built-in theorem {\small\verb%LESS_CASES%} can be specialized to:
6919 -{\par\samepage\setseps\small
6920 -\begin{verbatim}
6921 - th1 = |- m < n \/ n <= m
6922 -\end{verbatim}
6923 -}
6924 -\noindent and used with two additional theorems:
6925 -{\par\samepage\setseps\small
6926 -\begin{verbatim}
6927 - th2 = (m < n |- (m MOD n = m))
6928 - th3 = ({0 < n, n <= m} |- (m MOD n) = ((m - n) MOD n))
6929 -\end{verbatim}
6930 -}
6931 -\noindent to derive a new theorem:
6932 {\par\samepage\setseps\small
6933 \begin{verbatim}
6934 - #DISJ_CASES_UNION th1 th2 th3;;
6935 - ["0 < n"] |- (m MOD n = m) \/ (m MOD n = (m - n) MOD n)
6936 +#[1;2;3] @ [4;5;6];;
6937 +[1; 2; 3; 4; 5; 6] : int list
6938 \end{verbatim}
6939 }
6940 \SEEALSO
6941 -DISJ_CASES, DISJ_CASES_TAC, DISJ1, DISJ2.
6942 +append.
6943
6944 \ENDDOC
6945 -\DOC{DISJ\_IMP}
6946 +\DOC{*}
6947
6948 -\TYPE {\small\verb%DISJ_IMP : (thm -> thm)%}\egroup
6949 +\TYPE {\small\verb%$* : ((int # int) -> int)%}\egroup
6950
6951 \SYNOPSIS
6952 -Converts a disjunctive theorem to an equivalent implicative theorem.
6953 +Performs multiplication on ML integers.
6954
6955 -\DESCRIBE
6956 -The left disjunct of a disjunctive theorem becomes the negated
6957 -antecedent of the newly generated theorem.
6958 -{\par\samepage\setseps\small
6959 -\begin{verbatim}
6960 - A |- t1 \/ t2
6961 - ----------------- DISJ_IMP
6962 - A |- ~t1 ==> t2
6963 -\end{verbatim}
6964 -}
6965 \FAILURE
6966 -Fails if the theorem is not a disjunction.
6967 -
6968 -\EXAMPLE
6969 -Specializing the built-in theorem {\small\verb%LESS_CASES%} gives the theorem:
6970 -{\par\samepage\setseps\small
6971 -\begin{verbatim}
6972 - th = |- m < n \/ n <= m
6973 -\end{verbatim}
6974 -}
6975 -\noindent to which {\small\verb%DISJ_IMP%} may be applied:
6976 -{\par\samepage\setseps\small
6977 -\begin{verbatim}
6978 - #DISJ_IMP th;;
6979 - |- ~m < n ==> n <= m
6980 -\end{verbatim}
6981 -}
6982 -\SEEALSO
6983 -DISJ_CASES.
6984 +Never fails.
6985
6986 \ENDDOC
6987 -\DOC{distinct}
6988
6989 -\TYPE {\small\verb%distinct : (* list -> bool)%}\egroup
6990 +\DOC{\#}
6991
6992 -\SYNOPSIS
6993 -Checks whether the elements of a list are all distinct.
6994 +\TYPE {\small\verb%$# : (((* -> **) # (*** -> ****)) -> (* # ***) -> (** # ****))%}\egroup
6995
6996 -\DESCRIBE
6997 -If all the elements in a list are distinct, returns {\small\verb%true%}, otherwise returns
6998 -{\small\verb%false%}.
6999 +\SYNOPSIS
7000 +Applies two functions to a pair: {\small\verb%(f # g) (x,y)%} = {\small\verb%(f x, g y)%}.
7001
7002 \FAILURE
7003 Never fails.
7004
7005 \SEEALSO
7006 -setify.
7007 +B, C, CB, Co, I, K, KI, o, oo, S, W.
7008 +
7009 +\ENDDOC
7010 +\DOC{+}
7011 +
7012 +\TYPE {\small\verb%$+ : ((int # int) -> int)%}\egroup
7013 +
7014 +\SYNOPSIS
7015 +Performs addition on ML integers.
7016 +
7017 +\FAILURE
7018 +Never fails.
7019
7020 \ENDDOC
7021 \DOC{do}
7022 @@ -6468,6 +6436,38 @@ b, backup, backup_limit, expand, expandf
7023 rotate, save_top_thm, set_goal, set_state, top_goal, top_thm, VALID.
7024
7025 \ENDDOC
7026 +\DOC{EL\_CONV}
7027 +
7028 +\TYPE {\small\verb%EL_CONV : conv%}\egroup
7029 +
7030 +\SYNOPSIS
7031 +Computes by inference the result of indexing an element from a list.
7032 +
7033 +\DESCRIBE
7034 +For any object language list of the form {\small\verb%"[x0;...xk;...;xn]"%} ,
7035 +the result of evaluating
7036 +{\par\samepage\setseps\small
7037 +\begin{verbatim}
7038 + EL_CONV "EL k [x0;...xk;...;xn]"
7039 +\end{verbatim}
7040 +}
7041 +\noindent is the theorem
7042 +{\par\samepage\setseps\small
7043 +\begin{verbatim}
7044 + |- EL k [x0;...;xk;...;xn] = xk
7045 +\end{verbatim}
7046 +}
7047 +
7048 +
7049 +\FAILURE
7050 +{\small\verb%EL_CONV tm%} fails if {\small\verb%tm%} is not of the form described above,
7051 +or {\small\verb%k%} is not less than the length of the list.
7052 +
7053 +\SEEALSO
7054 +ELL_CONV
7055 +
7056 +\ENDDOC
7057 +
7058 \DOC{el}
7059
7060 \TYPE {\small\verb%el : (int -> * list -> *)%}\egroup
7061 @@ -6527,38 +6527,6 @@ EL_CONV
7062
7063 \ENDDOC
7064
7065 -\DOC{EL\_CONV}
7066 -
7067 -\TYPE {\small\verb%EL_CONV : conv%}\egroup
7068 -
7069 -\SYNOPSIS
7070 -Computes by inference the result of indexing an element from a list.
7071 -
7072 -\DESCRIBE
7073 -For any object language list of the form {\small\verb%"[x0;...xk;...;xn]"%} ,
7074 -the result of evaluating
7075 -{\par\samepage\setseps\small
7076 -\begin{verbatim}
7077 - EL_CONV "EL k [x0;...xk;...;xn]"
7078 -\end{verbatim}
7079 -}
7080 -\noindent is the theorem
7081 -{\par\samepage\setseps\small
7082 -\begin{verbatim}
7083 - |- EL k [x0;...;xk;...;xn] = xk
7084 -\end{verbatim}
7085 -}
7086 -
7087 -
7088 -\FAILURE
7089 -{\small\verb%EL_CONV tm%} fails if {\small\verb%tm%} is not of the form described above,
7090 -or {\small\verb%k%} is not less than the length of the list.
7091 -
7092 -\SEEALSO
7093 -ELL_CONV
7094 -
7095 -\ENDDOC
7096 -
7097 \DOC{end\_itlist}
7098
7099 \TYPE {\small\verb%end_itlist : ((* -> * -> *) -> * list -> *)%}\egroup
7100 @@ -6656,51 +6624,6 @@ Fails if the argument theorem is not a n
7101 EQF_ELIM, EQT_ELIM, EQT_INTRO.
7102
7103 \ENDDOC
7104 -\DOC{EQT\_ELIM}
7105 -
7106 -\TYPE {\small\verb%EQT_ELIM : (thm -> thm)%}\egroup
7107 -
7108 -\SYNOPSIS
7109 -Eliminates equality with {\small\verb%T%}.
7110 -
7111 -\DESCRIBE
7112 -{\par\samepage\setseps\small
7113 -\begin{verbatim}
7114 - A |- tm = T
7115 - ------------- EQT_ELIM
7116 - A |- tm
7117 -\end{verbatim}
7118 -}
7119 -\FAILURE
7120 -Fails if the argument theorem is not of the form {\small\verb%A |- tm = T%}.
7121 -
7122 -\SEEALSO
7123 -EQT_INTRO, EQF_ELIM, EQF_INTRO.
7124 -
7125 -\ENDDOC
7126 -\DOC{EQT\_INTRO}
7127 -
7128 -\TYPE {\small\verb%EQT_INTRO : (thm -> thm)%}\egroup
7129 -
7130 -\SYNOPSIS
7131 -Introduces equality with {\small\verb%T%}.
7132 -
7133 -\DESCRIBE
7134 -{\par\samepage\setseps\small
7135 -\begin{verbatim}
7136 - A |- tm
7137 - ------------- EQF_INTRO
7138 - A |- tm = T
7139 -\end{verbatim}
7140 -}
7141 -
7142 -\FAILURE
7143 -Never fails.
7144 -
7145 -\SEEALSO
7146 -EQT_ELIM, EQF_ELIM, EQF_INTRO.
7147 -
7148 -\ENDDOC
7149 \DOC{EQ\_IMP\_RULE}
7150
7151 \TYPE {\small\verb%EQ_IMP_RULE : (thm -> (thm # thm))%}\egroup
7152 @@ -6840,37 +6763,82 @@ rule {\small\verb%EQ_MP%} returns the th
7153 \end{verbatim}
7154 }
7155 \FAILURE
7156 -Fails unless the first theorem is equational and its left side
7157 -is the same as the conclusion of the second theorem (and is therefore
7158 -of type {\small\verb%bool%}), up to alpha-conversion.
7159 +Fails unless the first theorem is equational and its left side
7160 +is the same as the conclusion of the second theorem (and is therefore
7161 +of type {\small\verb%bool%}), up to alpha-conversion.
7162 +
7163 +\SEEALSO
7164 +EQ_IMP_RULE, IMP_ANTISYM_RULE, MP.
7165 +
7166 +\ENDDOC
7167 +\DOC{EQ\_TAC}
7168 +
7169 +\TYPE {\small\verb%EQ_TAC : tactic%}\egroup
7170 +
7171 +\SYNOPSIS
7172 +Reduces goal of equality of boolean terms to forward and backward implication.
7173 +
7174 +\DESCRIBE
7175 +When applied to a goal {\small\verb%A ?- t1 = t2%}, where {\small\verb%t1%} and {\small\verb%t2%} have type {\small\verb%bool%},
7176 +the tactic {\small\verb%EQ_TAC%} returns the subgoals {\small\verb%A ?- t1 ==> t2%} and
7177 +{\small\verb%A ?- t2 ==> t1%}.
7178 +{\par\samepage\setseps\small
7179 +\begin{verbatim}
7180 + A ?- t1 = t2
7181 + ================================= EQ_TAC
7182 + A ?- t1 ==> t2 A ?- t2 ==> t1
7183 +\end{verbatim}
7184 +}
7185 +\FAILURE
7186 +Fails unless the conclusion of the goal is an equation between boolean terms.
7187 +
7188 +\SEEALSO
7189 +EQ_IMP_RULE, IMP_ANTISYM_RULE.
7190 +
7191 +\ENDDOC
7192 +\DOC{EQT\_ELIM}
7193 +
7194 +\TYPE {\small\verb%EQT_ELIM : (thm -> thm)%}\egroup
7195 +
7196 +\SYNOPSIS
7197 +Eliminates equality with {\small\verb%T%}.
7198 +
7199 +\DESCRIBE
7200 +{\par\samepage\setseps\small
7201 +\begin{verbatim}
7202 + A |- tm = T
7203 + ------------- EQT_ELIM
7204 + A |- tm
7205 +\end{verbatim}
7206 +}
7207 +\FAILURE
7208 +Fails if the argument theorem is not of the form {\small\verb%A |- tm = T%}.
7209
7210 \SEEALSO
7211 -EQ_IMP_RULE, IMP_ANTISYM_RULE, MP.
7212 +EQT_INTRO, EQF_ELIM, EQF_INTRO.
7213
7214 \ENDDOC
7215 -\DOC{EQ\_TAC}
7216 +\DOC{EQT\_INTRO}
7217
7218 -\TYPE {\small\verb%EQ_TAC : tactic%}\egroup
7219 +\TYPE {\small\verb%EQT_INTRO : (thm -> thm)%}\egroup
7220
7221 \SYNOPSIS
7222 -Reduces goal of equality of boolean terms to forward and backward implication.
7223 +Introduces equality with {\small\verb%T%}.
7224
7225 \DESCRIBE
7226 -When applied to a goal {\small\verb%A ?- t1 = t2%}, where {\small\verb%t1%} and {\small\verb%t2%} have type {\small\verb%bool%},
7227 -the tactic {\small\verb%EQ_TAC%} returns the subgoals {\small\verb%A ?- t1 ==> t2%} and
7228 -{\small\verb%A ?- t2 ==> t1%}.
7229 {\par\samepage\setseps\small
7230 \begin{verbatim}
7231 - A ?- t1 = t2
7232 - ================================= EQ_TAC
7233 - A ?- t1 ==> t2 A ?- t2 ==> t1
7234 + A |- tm
7235 + ------------- EQF_INTRO
7236 + A |- tm = T
7237 \end{verbatim}
7238 }
7239 +
7240 \FAILURE
7241 -Fails unless the conclusion of the goal is an equation between boolean terms.
7242 +Never fails.
7243
7244 \SEEALSO
7245 -EQ_IMP_RULE, IMP_ANTISYM_RULE.
7246 +EQT_ELIM, EQF_ELIM, EQF_INTRO.
7247
7248 \ENDDOC
7249 \DOC{ETA\_CONV}
7250 @@ -6888,37 +6856,6 @@ to the theorem {\small\verb%|- (\x. t x)
7251 Fails if the input term is not an eta-redex.
7252
7253 \ENDDOC
7254 -\DOC{EVERY}
7255 -
7256 -\TYPE {\small\verb%EVERY : (tactic list -> tactic)%}\egroup
7257 -
7258 -\SYNOPSIS
7259 -Sequentially applies all the tactics in a given list of tactics.
7260 -
7261 -\DESCRIBE
7262 -When applied to a list of tactics {\small\verb%[T1; ... ;Tn]%}, and a goal {\small\verb%g%}, the tactical
7263 -{\small\verb%EVERY%} applies each tactic in sequence to every
7264 -subgoal generated by the previous one. This can be represented as:
7265 -{\par\samepage\setseps\small
7266 -\begin{verbatim}
7267 - EVERY [T1;...;Tn] = T1 THEN ... THEN Tn
7268 -\end{verbatim}
7269 -}
7270 -\noindent If the tactic list is empty, the resulting tactic has no effect.
7271 -
7272 -\FAILURE
7273 -The application of {\small\verb%EVERY%} to a tactic list never fails. The resulting
7274 -tactic fails iff any of the component tactics do.
7275 -
7276 -\COMMENTS
7277 -It is possible to use {\small\verb%EVERY%} instead of {\small\verb%THEN%}, but probably
7278 -stylistically inferior. {\small\verb%EVERY%} is more useful when applied to a list of
7279 -tactics generated by a function.
7280 -
7281 -\SEEALSO
7282 -FIRST, MAP_EVERY, THEN.
7283 -
7284 -\ENDDOC
7285 \DOC{EVERY\_ASSUM}
7286
7287 \TYPE {\small\verb%EVERY_ASSUM : (thm_tactic -> tactic)%}\egroup
7288 @@ -6973,6 +6910,37 @@ is, {\small\verb%EVERY_CONV [] "t"%} ret
7289 THENC.
7290
7291 \ENDDOC
7292 +\DOC{EVERY}
7293 +
7294 +\TYPE {\small\verb%EVERY : (tactic list -> tactic)%}\egroup
7295 +
7296 +\SYNOPSIS
7297 +Sequentially applies all the tactics in a given list of tactics.
7298 +
7299 +\DESCRIBE
7300 +When applied to a list of tactics {\small\verb%[T1; ... ;Tn]%}, and a goal {\small\verb%g%}, the tactical
7301 +{\small\verb%EVERY%} applies each tactic in sequence to every
7302 +subgoal generated by the previous one. This can be represented as:
7303 +{\par\samepage\setseps\small
7304 +\begin{verbatim}
7305 + EVERY [T1;...;Tn] = T1 THEN ... THEN Tn
7306 +\end{verbatim}
7307 +}
7308 +\noindent If the tactic list is empty, the resulting tactic has no effect.
7309 +
7310 +\FAILURE
7311 +The application of {\small\verb%EVERY%} to a tactic list never fails. The resulting
7312 +tactic fails iff any of the component tactics do.
7313 +
7314 +\COMMENTS
7315 +It is possible to use {\small\verb%EVERY%} instead of {\small\verb%THEN%}, but probably
7316 +stylistically inferior. {\small\verb%EVERY%} is more useful when applied to a list of
7317 +tactics generated by a function.
7318 +
7319 +\SEEALSO
7320 +FIRST, MAP_EVERY, THEN.
7321 +
7322 +\ENDDOC
7323 \DOC{EVERY\_TCL}
7324
7325 \TYPE {\small\verb%EVERY_TCL : (thm_tactical list -> thm_tactical)%}\egroup
7326 @@ -7035,43 +7003,43 @@ Fails unless the conclusion of the theor
7327 EXISTS_UNIQUE_CONV.
7328
7329 \ENDDOC
7330 -\DOC{EXISTS}
7331 +\DOC{EXISTS\_AND\_CONV}
7332
7333 -\TYPE {\small\verb%EXISTS : ((term # term) -> thm -> thm)%}\egroup
7334 +\TYPE {\small\verb%EXISTS_AND_CONV : conv%}\egroup
7335
7336 \SYNOPSIS
7337 -Introduces existential quantification given a particular witness.
7338 +Moves an existential quantification inwards through a conjunction.
7339
7340 \DESCRIBE
7341 -When applied to a pair of terms and a theorem, the first term an existentially
7342 -quantified pattern indicating the desired form of the result, and the second a
7343 -witness whose substitution for the quantified variable gives a term which is
7344 -the same as the conclusion of the theorem, {\small\verb%EXISTS%} gives the desired theorem.
7345 +When applied to a term of the form {\small\verb%?x. P /\ Q%}, where {\small\verb%x%} is not free in both
7346 +{\small\verb%P%} and {\small\verb%Q%}, {\small\verb%EXISTS_AND_CONV%} returns a theorem of one of three forms,
7347 +depending on occurrences of the variable {\small\verb%x%} in {\small\verb%P%} and {\small\verb%Q%}. If {\small\verb%x%} is free
7348 +in {\small\verb%P%} but not in {\small\verb%Q%}, then the theorem:
7349 {\par\samepage\setseps\small
7350 \begin{verbatim}
7351 - A |- p[u/x]
7352 - ------------- EXISTS ("?x. p","u")
7353 - A |- ?x. p
7354 + |- (?x. P /\ Q) = (?x.P) /\ Q
7355 \end{verbatim}
7356 }
7357 -\FAILURE
7358 -Fails unless the substituted pattern is the same as the conclusion of the
7359 -theorem.
7360 -
7361 -\EXAMPLE
7362 -The following examples illustrate how it is possible to deduce different
7363 -things from the same theorem:
7364 +\noindent is returned. If {\small\verb%x%} is free in {\small\verb%Q%} but not in {\small\verb%P%}, then the
7365 +result is:
7366 {\par\samepage\setseps\small
7367 \begin{verbatim}
7368 - #EXISTS ("?x. x=T","T") (REFL "T");;
7369 - |- ?x. x = T
7370 -
7371 - #EXISTS ("?x:bool. x=x","T") (REFL "T");;
7372 - |- ?x. x = x
7373 + |- (?x. P /\ Q) = P /\ (?x.Q)
7374 +\end{verbatim}
7375 +}
7376 +\noindent And if {\small\verb%x%} is free in neither {\small\verb%P%} nor {\small\verb%Q%}, then the result is:
7377 +{\par\samepage\setseps\small
7378 +\begin{verbatim}
7379 + |- (?x. P /\ Q) = (?x.P) /\ (?x.Q)
7380 \end{verbatim}
7381 }
7382 +\FAILURE
7383 +{\small\verb%EXISTS_AND_CONV%} fails if it is applied to a term not of the form
7384 +{\small\verb%?x. P /\ Q%}, or if it is applied to a term {\small\verb%?x. P /\ Q%} in which the
7385 +variable {\small\verb%x%} is free in both {\small\verb%P%} and {\small\verb%Q%}.
7386 +
7387 \SEEALSO
7388 -CHOOSE, EXISTS_TAC.
7389 +AND_EXISTS_CONV, LEFT_AND_EXISTS_CONV, RIGHT_AND_EXISTS_CONV.
7390
7391 \ENDDOC
7392 \DOC{exists}
7393 @@ -7093,43 +7061,43 @@ Never fails.
7394 forall, find, tryfind, mem, assoc, rev_assoc.
7395
7396 \ENDDOC
7397 -\DOC{EXISTS\_AND\_CONV}
7398 +\DOC{EXISTS}
7399
7400 -\TYPE {\small\verb%EXISTS_AND_CONV : conv%}\egroup
7401 +\TYPE {\small\verb%EXISTS : ((term # term) -> thm -> thm)%}\egroup
7402
7403 \SYNOPSIS
7404 -Moves an existential quantification inwards through a conjunction.
7405 +Introduces existential quantification given a particular witness.
7406
7407 \DESCRIBE
7408 -When applied to a term of the form {\small\verb%?x. P /\ Q%}, where {\small\verb%x%} is not free in both
7409 -{\small\verb%P%} and {\small\verb%Q%}, {\small\verb%EXISTS_AND_CONV%} returns a theorem of one of three forms,
7410 -depending on occurrences of the variable {\small\verb%x%} in {\small\verb%P%} and {\small\verb%Q%}. If {\small\verb%x%} is free
7411 -in {\small\verb%P%} but not in {\small\verb%Q%}, then the theorem:
7412 -{\par\samepage\setseps\small
7413 -\begin{verbatim}
7414 - |- (?x. P /\ Q) = (?x.P) /\ Q
7415 -\end{verbatim}
7416 -}
7417 -\noindent is returned. If {\small\verb%x%} is free in {\small\verb%Q%} but not in {\small\verb%P%}, then the
7418 -result is:
7419 +When applied to a pair of terms and a theorem, the first term an existentially
7420 +quantified pattern indicating the desired form of the result, and the second a
7421 +witness whose substitution for the quantified variable gives a term which is
7422 +the same as the conclusion of the theorem, {\small\verb%EXISTS%} gives the desired theorem.
7423 {\par\samepage\setseps\small
7424 \begin{verbatim}
7425 - |- (?x. P /\ Q) = P /\ (?x.Q)
7426 + A |- p[u/x]
7427 + ------------- EXISTS ("?x. p","u")
7428 + A |- ?x. p
7429 \end{verbatim}
7430 }
7431 -\noindent And if {\small\verb%x%} is free in neither {\small\verb%P%} nor {\small\verb%Q%}, then the result is:
7432 +\FAILURE
7433 +Fails unless the substituted pattern is the same as the conclusion of the
7434 +theorem.
7435 +
7436 +\EXAMPLE
7437 +The following examples illustrate how it is possible to deduce different
7438 +things from the same theorem:
7439 {\par\samepage\setseps\small
7440 \begin{verbatim}
7441 - |- (?x. P /\ Q) = (?x.P) /\ (?x.Q)
7442 + #EXISTS ("?x. x=T","T") (REFL "T");;
7443 + |- ?x. x = T
7444 +
7445 + #EXISTS ("?x:bool. x=x","T") (REFL "T");;
7446 + |- ?x. x = x
7447 \end{verbatim}
7448 }
7449 -\FAILURE
7450 -{\small\verb%EXISTS_AND_CONV%} fails if it is applied to a term not of the form
7451 -{\small\verb%?x. P /\ Q%}, or if it is applied to a term {\small\verb%?x. P /\ Q%} in which the
7452 -variable {\small\verb%x%} is free in both {\small\verb%P%} and {\small\verb%Q%}.
7453 -
7454 \SEEALSO
7455 -AND_EXISTS_CONV, LEFT_AND_EXISTS_CONV, RIGHT_AND_EXISTS_CONV.
7456 +CHOOSE, EXISTS_TAC.
7457
7458 \ENDDOC
7459 \DOC{EXISTS\_EQ}
7460 @@ -7191,32 +7159,6 @@ true' and `there is a greatest number su
7461 EXISTS_LEAST_CONV.
7462
7463 \ENDDOC
7464 -\DOC{EXISTS\_IMP}
7465 -
7466 -\TYPE {\small\verb%EXISTS_IMP : (term -> thm -> thm)%}\egroup
7467 -
7468 -\SYNOPSIS
7469 -Existentially quantifies both the antecedent and consequent of an implication.
7470 -
7471 -\DESCRIBE
7472 -When applied to a variable {\small\verb%x%} and a theorem {\small\verb%A |- t1 ==> t2%}, the
7473 -inference rule {\small\verb%EXISTS_IMP%} returns the theorem {\small\verb%A |- (?x. t1) ==> (?x. t2)%},
7474 -provided {\small\verb%x%} is not free in the assumptions.
7475 -{\par\samepage\setseps\small
7476 -\begin{verbatim}
7477 - A |- t1 ==> t2
7478 - -------------------------- EXISTS_IMP "x" [where x is not free in A]
7479 - A |- (?x.t1) ==> (?x.t2)
7480 -\end{verbatim}
7481 -}
7482 -\FAILURE
7483 -Fails if the theorem is not implicative, or if the term is not a variable, or
7484 -if the term is a variable but is free in the assumption list.
7485 -
7486 -\SEEALSO
7487 -EXISTS_EQ.
7488 -
7489 -\ENDDOC
7490 \DOC{EXISTS\_IMP\_CONV}
7491
7492 \TYPE {\small\verb%EXISTS_IMP_CONV : conv%}\egroup
7493 @@ -7256,6 +7198,32 @@ variable {\small\verb%x%} is free in bot
7494 LEFT_IMP_FORALL_CONV, RIGHT_IMP_EXISTS_CONV.
7495
7496 \ENDDOC
7497 +\DOC{EXISTS\_IMP}
7498 +
7499 +\TYPE {\small\verb%EXISTS_IMP : (term -> thm -> thm)%}\egroup
7500 +
7501 +\SYNOPSIS
7502 +Existentially quantifies both the antecedent and consequent of an implication.
7503 +
7504 +\DESCRIBE
7505 +When applied to a variable {\small\verb%x%} and a theorem {\small\verb%A |- t1 ==> t2%}, the
7506 +inference rule {\small\verb%EXISTS_IMP%} returns the theorem {\small\verb%A |- (?x. t1) ==> (?x. t2)%},
7507 +provided {\small\verb%x%} is not free in the assumptions.
7508 +{\par\samepage\setseps\small
7509 +\begin{verbatim}
7510 + A |- t1 ==> t2
7511 + -------------------------- EXISTS_IMP "x" [where x is not free in A]
7512 + A |- (?x.t1) ==> (?x.t2)
7513 +\end{verbatim}
7514 +}
7515 +\FAILURE
7516 +Fails if the theorem is not implicative, or if the term is not a variable, or
7517 +if the term is a variable but is free in the assumption list.
7518 +
7519 +\SEEALSO
7520 +EXISTS_EQ.
7521 +
7522 +\ENDDOC
7523 \DOC{EXISTS\_LEAST\_CONV}
7524
7525 \TYPE {\small\verb%EXISTS_LEAST_CONV : conv%}\egroup
7526 @@ -7779,30 +7747,12 @@ pow2 = - : (int -> int)
7527 \end{verbatim}
7528 }
7529 \COMMENTS
7530 -This function is extremely dependent on the version of Lisp used, and its
7531 -behaviour should not be relied upon; it may not work at all in Lisps other than
7532 -Franz. It is questionable whether it is ever worthwhile to use it anyway,
7533 -because although it cannot compromise the consistency of the logic, it can
7534 -lead to confusing failures if one is manipulating numbers larger than the word
7535 -size of the machine.
7536 -
7537 -\ENDDOC
7538 -\DOC{filter}
7539 -
7540 -\TYPE {\small\verb%filter : ((* -> bool) -> * list -> * list)%}\egroup
7541 -
7542 -\SYNOPSIS
7543 -Filters a list to the sublist of elements satisfying a predicate.
7544 -
7545 -\DESCRIBE
7546 -{\small\verb%filter p l%} applies {\small\verb%p%} to every element of {\small\verb%l%}, returning a list of those
7547 -that satisfy {\small\verb%p%}, in the order they appeared in the original list.
7548 -
7549 -\FAILURE
7550 -Never fails.
7551 -
7552 -\SEEALSO
7553 -mapfilter, partition, remove.
7554 +This function is extremely dependent on the version of Lisp used, and its
7555 +behaviour should not be relied upon; it may not work at all in Lisps other than
7556 +Franz. It is questionable whether it is ever worthwhile to use it anyway,
7557 +because although it cannot compromise the consistency of the logic, it can
7558 +lead to confusing failures if one is manipulating numbers larger than the word
7559 +size of the machine.
7560
7561 \ENDDOC
7562 \DOC{FILTER\_ASM\_REWRITE\_RULE}
7563 @@ -8018,6 +7968,24 @@ DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN,
7564 STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC.
7565
7566 \ENDDOC
7567 +\DOC{filter}
7568 +
7569 +\TYPE {\small\verb%filter : ((* -> bool) -> * list -> * list)%}\egroup
7570 +
7571 +\SYNOPSIS
7572 +Filters a list to the sublist of elements satisfying a predicate.
7573 +
7574 +\DESCRIBE
7575 +{\small\verb%filter p l%} applies {\small\verb%p%} to every element of {\small\verb%l%}, returning a list of those
7576 +that satisfy {\small\verb%p%}, in the order they appeared in the original list.
7577 +
7578 +\FAILURE
7579 +Never fails.
7580 +
7581 +\SEEALSO
7582 +mapfilter, partition, remove.
7583 +
7584 +\ENDDOC
7585 \DOC{FILTER\_GEN\_TAC}
7586
7587 \TYPE {\small\verb%FILTER_GEN_TAC : (term -> tactic)%}\egroup
7588 @@ -8587,61 +8555,6 @@ Fails if the named theory file cannot be
7589 find_file, find_ml_file, search_path, set_search_path.
7590
7591 \ENDDOC
7592 -\DOC{FIRST}
7593 -
7594 -\TYPE {\small\verb%FIRST : (tactic list -> tactic)%}\egroup
7595 -
7596 -\SYNOPSIS
7597 -Applies the first tactic in a tactic list which succeeds.
7598 -
7599 -\DESCRIBE
7600 -When applied to a list of tactics {\small\verb%[T1;...;Tn]%}, and a goal {\small\verb%g%}, the tactical
7601 -{\small\verb%FIRST%} tries applying the tactics to the goal until one succeeds. If the
7602 -first tactic which succeeds is {\small\verb%Tm%}, then the effect is the same as just {\small\verb%Tm%}.
7603 -Thus {\small\verb%FIRST%} effectively behaves as follows:
7604 -{\par\samepage\setseps\small
7605 -\begin{verbatim}
7606 - FIRST [T1;...;Tn] = T1 ORELSE ... ORELSE Tn
7607 -\end{verbatim}
7608 -}
7609 -\FAILURE
7610 -The application of {\small\verb%FIRST%} to a tactic list never fails. The resulting
7611 -tactic fails iff all the component tactics do when applied to the goal,
7612 -or if the tactic list is empty.
7613 -
7614 -\SEEALSO
7615 -EVERY, ORELSE.
7616 -
7617 -\ENDDOC
7618 -\DOC{FIRSTN\_CONV}
7619 -
7620 -\TYPE {\small\verb%FIRSTN_CONV : conv%}\egroup
7621 -
7622 -\SYNOPSIS
7623 -Computes by inference the result of taking the initial n elements of a list.
7624 -
7625 -\DESCRIBE
7626 -For any object language list of the form {\small\verb%"[x0;...x(n-k);...;x(n-1)]"%} ,
7627 -the result of evaluating
7628 -{\par\samepage\setseps\small
7629 -\begin{verbatim}
7630 - FIRSTN_CONV "FIRSTN k [x0;...x(n-k);...;x(n-1)]"
7631 -\end{verbatim}
7632 -}
7633 -\noindent is the theorem
7634 -{\par\samepage\setseps\small
7635 -\begin{verbatim}
7636 - |- FIRSTN k [x0;...;x(n-k);...;x(n-1)] = [x0;...;x(n-k)]
7637 -\end{verbatim}
7638 -}
7639 -
7640 -
7641 -\FAILURE
7642 -{\small\verb%FIRSTN_CONV tm%} fails if {\small\verb%tm%} is not of the form described above,
7643 -or {\small\verb%k%} is greater than the length of the list.
7644 -
7645 -\ENDDOC
7646 -
7647 \DOC{FIRST\_ASSUM}
7648
7649 \TYPE {\small\verb%FIRST_ASSUM : (thm_tactic -> tactic)%}\egroup
7650 @@ -8709,6 +8622,61 @@ empty list.
7651 ORELSEC.
7652
7653 \ENDDOC
7654 +\DOC{FIRST}
7655 +
7656 +\TYPE {\small\verb%FIRST : (tactic list -> tactic)%}\egroup
7657 +
7658 +\SYNOPSIS
7659 +Applies the first tactic in a tactic list which succeeds.
7660 +
7661 +\DESCRIBE
7662 +When applied to a list of tactics {\small\verb%[T1;...;Tn]%}, and a goal {\small\verb%g%}, the tactical
7663 +{\small\verb%FIRST%} tries applying the tactics to the goal until one succeeds. If the
7664 +first tactic which succeeds is {\small\verb%Tm%}, then the effect is the same as just {\small\verb%Tm%}.
7665 +Thus {\small\verb%FIRST%} effectively behaves as follows:
7666 +{\par\samepage\setseps\small
7667 +\begin{verbatim}
7668 + FIRST [T1;...;Tn] = T1 ORELSE ... ORELSE Tn
7669 +\end{verbatim}
7670 +}
7671 +\FAILURE
7672 +The application of {\small\verb%FIRST%} to a tactic list never fails. The resulting
7673 +tactic fails iff all the component tactics do when applied to the goal,
7674 +or if the tactic list is empty.
7675 +
7676 +\SEEALSO
7677 +EVERY, ORELSE.
7678 +
7679 +\ENDDOC
7680 +\DOC{FIRSTN\_CONV}
7681 +
7682 +\TYPE {\small\verb%FIRSTN_CONV : conv%}\egroup
7683 +
7684 +\SYNOPSIS
7685 +Computes by inference the result of taking the initial n elements of a list.
7686 +
7687 +\DESCRIBE
7688 +For any object language list of the form {\small\verb%"[x0;...x(n-k);...;x(n-1)]"%} ,
7689 +the result of evaluating
7690 +{\par\samepage\setseps\small
7691 +\begin{verbatim}
7692 + FIRSTN_CONV "FIRSTN k [x0;...x(n-k);...;x(n-1)]"
7693 +\end{verbatim}
7694 +}
7695 +\noindent is the theorem
7696 +{\par\samepage\setseps\small
7697 +\begin{verbatim}
7698 + |- FIRSTN k [x0;...;x(n-k);...;x(n-1)] = [x0;...;x(n-k)]
7699 +\end{verbatim}
7700 +}
7701 +
7702 +
7703 +\FAILURE
7704 +{\small\verb%FIRSTN_CONV tm%} fails if {\small\verb%tm%} is not of the form described above,
7705 +or {\small\verb%k%} is greater than the length of the list.
7706 +
7707 +\ENDDOC
7708 +
7709 \DOC{FIRST\_TCL}
7710
7711 \TYPE {\small\verb%FIRST_TCL : (thm_tactical list -> thm_tactical)%}\egroup
7712 @@ -8752,28 +8720,6 @@ A full explanation of the standard flags
7713 set_flag.
7714
7715 \ENDDOC
7716 -\DOC{flat}
7717 -
7718 -\TYPE {\small\verb%flat : (* list list -> * list)%}\egroup
7719 -
7720 -\SYNOPSIS
7721 -Flattens a list of lists into one long list.
7722 -
7723 -\DESCRIBE
7724 -{\small\verb%flat [l1;...;ln]%} returns {\small\verb%(l1 @ ... @ ln)%} where each li is a list and {\small\verb%@%}
7725 -is list concatenation.
7726 -
7727 -\FAILURE
7728 -Never fails.
7729 -
7730 -\EXAMPLE
7731 -{\par\samepage\setseps\small
7732 -\begin{verbatim}
7733 -#flat [[1;2];[3;4;5];[6]];;
7734 -[1; 2; 3; 4; 5; 6] : int list
7735 -\end{verbatim}
7736 -}
7737 -\ENDDOC
7738 \DOC{FLAT\_CONV}
7739
7740 \TYPE {\small\verb%FLAT_CONV : conv%}\egroup
7741 @@ -8819,6 +8765,28 @@ FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV.
7742
7743 \ENDDOC
7744
7745 +\DOC{flat}
7746 +
7747 +\TYPE {\small\verb%flat : (* list list -> * list)%}\egroup
7748 +
7749 +\SYNOPSIS
7750 +Flattens a list of lists into one long list.
7751 +
7752 +\DESCRIBE
7753 +{\small\verb%flat [l1;...;ln]%} returns {\small\verb%(l1 @ ... @ ln)%} where each li is a list and {\small\verb%@%}
7754 +is list concatenation.
7755 +
7756 +\FAILURE
7757 +Never fails.
7758 +
7759 +\EXAMPLE
7760 +{\par\samepage\setseps\small
7761 +\begin{verbatim}
7762 +#flat [[1;2];[3;4;5];[6]];;
7763 +[1; 2; 3; 4; 5; 6] : int list
7764 +\end{verbatim}
7765 +}
7766 +\ENDDOC
7767 \DOC{FOLDL\_CONV}
7768
7769 \TYPE {\small\verb%FOLDL_CONV : conv -> conv%}\egroup
7770 @@ -8953,25 +8921,6 @@ FOLDL_CONV, list_FOLD_CONV.
7771
7772 \ENDDOC
7773
7774 -\DOC{forall}
7775 -
7776 -\TYPE {\small\verb%forall : ((* -> bool) -> * list -> bool)%}\egroup
7777 -
7778 -\SYNOPSIS
7779 -Tests a list to see if all its elements satisfy a predicate.
7780 -
7781 -\DESCRIBE
7782 -{\small\verb%forall p [x1;...;xn]%} returns {\small\verb%true%} if {\small\verb%(p xi)%} is true for all {\small\verb%xi%} in the
7783 -list. Otherwise it returns {\small\verb%false%}. If the list is empty, this function always
7784 -returns true.
7785 -
7786 -\FAILURE
7787 -Never fails.
7788 -
7789 -\SEEALSO
7790 -exists, find, tryfind, mem, assoc, rev_assoc.
7791 -
7792 -\ENDDOC
7793 \DOC{FORALL\_AND\_CONV}
7794
7795 \TYPE {\small\verb%FORALL_AND_CONV : conv%}\egroup
7796 @@ -8994,6 +8943,25 @@ Fails if applied to a term not of the fo
7797 AND_FORALL_CONV, LEFT_AND_FORALL_CONV, RIGHT_AND_FORALL_CONV.
7798
7799 \ENDDOC
7800 +\DOC{forall}
7801 +
7802 +\TYPE {\small\verb%forall : ((* -> bool) -> * list -> bool)%}\egroup
7803 +
7804 +\SYNOPSIS
7805 +Tests a list to see if all its elements satisfy a predicate.
7806 +
7807 +\DESCRIBE
7808 +{\small\verb%forall p [x1;...;xn]%} returns {\small\verb%true%} if {\small\verb%(p xi)%} is true for all {\small\verb%xi%} in the
7809 +list. Otherwise it returns {\small\verb%false%}. If the list is empty, this function always
7810 +returns true.
7811 +
7812 +\FAILURE
7813 +Never fails.
7814 +
7815 +\SEEALSO
7816 +exists, find, tryfind, mem, assoc, rev_assoc.
7817 +
7818 +\ENDDOC
7819 \DOC{FORALL\_EQ}
7820
7821 \TYPE {\small\verb%FORALL_EQ : (term -> thm -> thm)%}\egroup
7822 @@ -9113,13 +9081,49 @@ result is:
7823 |- (!x. P \/ Q) = (!x.P) \/ (!x.Q)
7824 \end{verbatim}
7825 }
7826 -\FAILURE
7827 -{\small\verb%FORALL_OR_CONV%} fails if it is applied to a term not of the form
7828 -{\small\verb%!x. P \/ Q%}, or if it is applied to a term {\small\verb%!x. P \/ Q%} in which the
7829 -variable {\small\verb%x%} is free in both {\small\verb%P%} and {\small\verb%Q%}.
7830 -
7831 +\FAILURE
7832 +{\small\verb%FORALL_OR_CONV%} fails if it is applied to a term not of the form
7833 +{\small\verb%!x. P \/ Q%}, or if it is applied to a term {\small\verb%!x. P \/ Q%} in which the
7834 +variable {\small\verb%x%} is free in both {\small\verb%P%} and {\small\verb%Q%}.
7835 +
7836 +\SEEALSO
7837 +OR_FORALL_CONV, LEFT_OR_FORALL_CONV, RIGHT_OR_FORALL_CONV.
7838 +
7839 +\ENDDOC
7840 +\DOC{free\_in}
7841 +
7842 +\TYPE {\small\verb%free_in : (term -> term -> bool)%}\egroup
7843 +
7844 +\SYNOPSIS
7845 +Tests if one term is free in another.
7846 +
7847 +\DESCRIBE
7848 +When applied to two terms {\small\verb%t1%} and {\small\verb%t2%}, the function {\small\verb%free_in%} returns
7849 +{\small\verb%true%} if {\small\verb%t1%} is free in {\small\verb%t2%}, and {\small\verb%false%} otherwise. It is not necessary
7850 +that {\small\verb%t1%} be simply a variable.
7851 +
7852 +\FAILURE
7853 +Never fails.
7854 +
7855 +\EXAMPLE
7856 +In the following example {\small\verb%free_in%} returns {\small\verb%false%} because the {\small\verb%x%} in {\small\verb%SUC x%}
7857 +in the second term is bound:
7858 +{\par\samepage\setseps\small
7859 +\begin{verbatim}
7860 + #free_in "SUC x" "!x. SUC x = x + 1";;
7861 + false : bool
7862 +\end{verbatim}
7863 +}
7864 +\noindent whereas the following call returns {\small\verb%true%} because the first instance
7865 +of {\small\verb%x%} in the second term is free, even though there is also a bound instance:
7866 +{\par\samepage\setseps\small
7867 +\begin{verbatim}
7868 + #free_in "x:bool" "x /\ (?x. x=T)";;
7869 + true : bool
7870 +\end{verbatim}
7871 +}
7872 \SEEALSO
7873 -OR_FORALL_CONV, LEFT_OR_FORALL_CONV, RIGHT_OR_FORALL_CONV.
7874 +frees, freesl, thm_frees.
7875
7876 \ENDDOC
7877 \DOC{frees}
7878 @@ -9250,42 +9254,6 @@ resolution and rewriting.
7879 ASSUME, IMP_RES_TAC, PROVE_HYP, RES_TAC, REWR_CONV.
7880
7881 \ENDDOC
7882 -\DOC{free\_in}
7883 -
7884 -\TYPE {\small\verb%free_in : (term -> term -> bool)%}\egroup
7885 -
7886 -\SYNOPSIS
7887 -Tests if one term is free in another.
7888 -
7889 -\DESCRIBE
7890 -When applied to two terms {\small\verb%t1%} and {\small\verb%t2%}, the function {\small\verb%free_in%} returns
7891 -{\small\verb%true%} if {\small\verb%t1%} is free in {\small\verb%t2%}, and {\small\verb%false%} otherwise. It is not necessary
7892 -that {\small\verb%t1%} be simply a variable.
7893 -
7894 -\FAILURE
7895 -Never fails.
7896 -
7897 -\EXAMPLE
7898 -In the following example {\small\verb%free_in%} returns {\small\verb%false%} because the {\small\verb%x%} in {\small\verb%SUC x%}
7899 -in the second term is bound:
7900 -{\par\samepage\setseps\small
7901 -\begin{verbatim}
7902 - #free_in "SUC x" "!x. SUC x = x + 1";;
7903 - false : bool
7904 -\end{verbatim}
7905 -}
7906 -\noindent whereas the following call returns {\small\verb%true%} because the first instance
7907 -of {\small\verb%x%} in the second term is free, even though there is also a bound instance:
7908 -{\par\samepage\setseps\small
7909 -\begin{verbatim}
7910 - #free_in "x:bool" "x /\ (?x. x=T)";;
7911 - true : bool
7912 -\end{verbatim}
7913 -}
7914 -\SEEALSO
7915 -frees, freesl, thm_frees.
7916 -
7917 -\ENDDOC
7918 \DOC{FRONT\_CONJ\_CONV}
7919
7920 \TYPE {\small\verb%FRONT_CONJ_CONV: (term list -> term -> thm)%}\egroup
7921 @@ -9330,6 +9298,36 @@ Never fails.
7922 snd, pair.
7923
7924 \ENDDOC
7925 +\DOC{FUN\_EQ\_CONV}
7926 +
7927 +\TYPE {\small\verb%FUN_EQ_CONV : conv%}\egroup
7928 +
7929 +\SYNOPSIS
7930 +Equates normal and extensional equality for two functions.
7931 +
7932 +\DESCRIBE
7933 +The conversion {\small\verb%FUN_EQ_CONV%} embodies the fact that two functions are equal
7934 +precisely when they give the same results for all values to which they can be
7935 +applied. When supplied with a term argument of the form {\small\verb%f = g%}, where {\small\verb%f%} and
7936 +{\small\verb%g%} are functions of type {\small\verb%ty1->ty2%}, {\small\verb%FUN_EQ_CONV%} returns the theorem:
7937 +{\par\samepage\setseps\small
7938 +\begin{verbatim}
7939 + |- (f = g) = (!x. f x = g x)
7940 +\end{verbatim}
7941 +}
7942 +\noindent where {\small\verb%x%} is a variable of type {\small\verb%ty1%} chosen by the conversion.
7943 +
7944 +\FAILURE
7945 +{\small\verb%FUN_EQ_CONV tm%} fails if {\small\verb%tm%} is not an equation {\small\verb%f = g%}, where {\small\verb%f%} and {\small\verb%g%}
7946 +are functions.
7947 +
7948 +\USES
7949 +Used for proving equality of functions.
7950 +
7951 +\SEEALSO
7952 +EXT, X_FUN_EQ_CONV.
7953 +
7954 +\ENDDOC
7955 \DOC{funpow}
7956
7957 \TYPE {\small\verb%funpow : (int -> (* -> *) -> * -> *)%}\egroup
7958 @@ -9384,36 +9382,6 @@ number of times, the application of {\sm
7959 \end{verbatim}
7960 }
7961 \ENDDOC
7962 -\DOC{FUN\_EQ\_CONV}
7963 -
7964 -\TYPE {\small\verb%FUN_EQ_CONV : conv%}\egroup
7965 -
7966 -\SYNOPSIS
7967 -Equates normal and extensional equality for two functions.
7968 -
7969 -\DESCRIBE
7970 -The conversion {\small\verb%FUN_EQ_CONV%} embodies the fact that two functions are equal
7971 -precisely when they give the same results for all values to which they can be
7972 -applied. When supplied with a term argument of the form {\small\verb%f = g%}, where {\small\verb%f%} and
7973 -{\small\verb%g%} are functions of type {\small\verb%ty1->ty2%}, {\small\verb%FUN_EQ_CONV%} returns the theorem:
7974 -{\par\samepage\setseps\small
7975 -\begin{verbatim}
7976 - |- (f = g) = (!x. f x = g x)
7977 -\end{verbatim}
7978 -}
7979 -\noindent where {\small\verb%x%} is a variable of type {\small\verb%ty1%} chosen by the conversion.
7980 -
7981 -\FAILURE
7982 -{\small\verb%FUN_EQ_CONV tm%} fails if {\small\verb%tm%} is not an equation {\small\verb%f = g%}, where {\small\verb%f%} and {\small\verb%g%}
7983 -are functions.
7984 -
7985 -\USES
7986 -Used for proving equality of functions.
7987 -
7988 -\SEEALSO
7989 -EXT, X_FUN_EQ_CONV.
7990 -
7991 -\ENDDOC
7992 \DOC{g}
7993
7994 \TYPE {\small\verb%g : (term -> void)%}\egroup
7995 @@ -9454,120 +9422,6 @@ b, backup, backup_limit, e, expand, expa
7996 rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
7997
7998 \ENDDOC
7999 -\DOC{GEN}
8000 -
8001 -\TYPE {\small\verb%GEN : (term -> thm -> thm)%}\egroup
8002 -
8003 -\SYNOPSIS
8004 -Generalizes the conclusion of a theorem.
8005 -
8006 -\DESCRIBE
8007 -When applied to a term {\small\verb%x%} and a theorem {\small\verb%A |- t%}, the inference rule
8008 -{\small\verb%GEN%} returns the theorem {\small\verb%A |- !x. t%}, provided {\small\verb%x%} is a variable not
8009 -free in any of the assumptions. There is no compulsion that {\small\verb%x%} should
8010 -be free in {\small\verb%t%}.
8011 -{\par\samepage\setseps\small
8012 -\begin{verbatim}
8013 - A |- t
8014 - ------------ GEN "x" [where x is not free in A]
8015 - A |- !x. t
8016 -\end{verbatim}
8017 -}
8018 -\FAILURE
8019 -Fails if {\small\verb%x%} is not a variable, or if it is free in any of the assumptions.
8020 -
8021 -\EXAMPLE
8022 -The following example shows how the above side-condition prevents
8023 -the derivation of the theorem {\small\verb%x=T |- !x. x=T%}, which is clearly invalid.
8024 -{\par\samepage\setseps\small
8025 -\begin{verbatim}
8026 - #top_print print_all_thm;;
8027 - - : (thm -> void)
8028 -
8029 - #let t = ASSUME "x=T";;
8030 - t = x = T |- x = T
8031 -
8032 - #GEN "x:bool" t;;
8033 - evaluation failed GEN
8034 -\end{verbatim}
8035 -}
8036 -\SEEALSO
8037 -GENL, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC.
8038 -
8039 -\ENDDOC
8040 -\DOC{GENL}
8041 -
8042 -\TYPE {\small\verb%GENL : (term list -> thm -> thm)%}\egroup
8043 -
8044 -\SYNOPSIS
8045 -Generalizes zero or more variables in the conclusion of a theorem.
8046 -
8047 -\DESCRIBE
8048 -When applied to a term list {\small\verb%[x1;...;xn]%} and a theorem {\small\verb%A |- t%}, the inference
8049 -rule {\small\verb%GENL%} returns the theorem {\small\verb%A |- !x1...xn. t%}, provided none of the
8050 -variables {\small\verb%xi%} are free in any of the assumptions. It is not necessary that
8051 -any or all of the {\small\verb%xi%} should be free in {\small\verb%t%}.
8052 -{\par\samepage\setseps\small
8053 -\begin{verbatim}
8054 - A |- t
8055 - ------------------ GENL "[x1;...;xn]" [where no xi is free in A]
8056 - A |- !x1...xn. t
8057 -\end{verbatim}
8058 -}
8059 -\FAILURE
8060 -Fails unless all the terms in the list are variables, none of which are
8061 -free in the assumption list.
8062 -
8063 -\SEEALSO
8064 -GEN, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC.
8065 -
8066 -\ENDDOC
8067 -\DOC{genvar}
8068 -
8069 -\TYPE {\small\verb%genvar : (type -> term)%}\egroup
8070 -
8071 -\SYNOPSIS
8072 -Returns a variable whose name has not been used previously.
8073 -
8074 -\DESCRIBE
8075 -When given a type, {\small\verb%genvar%} returns a variable of that type whose name has
8076 -not been used for a variable or constant in the HOL session so far.
8077 -
8078 -\FAILURE
8079 -Never fails.
8080 -
8081 -\EXAMPLE
8082 -The following indicates the typical stylized form of the names (this should
8083 -not be relied on, of course):
8084 -{\par\samepage\setseps\small
8085 -\begin{verbatim}
8086 - #genvar ":bool";;
8087 - "GEN%VAR%357" : term
8088 -
8089 - #genvar ":num";;
8090 - "GEN%VAR%358" : term
8091 -\end{verbatim}
8092 -}
8093 -\noindent Trying to anticipate {\small\verb%genvar%} doesn't work:
8094 -{\par\samepage\setseps\small
8095 -\begin{verbatim}
8096 - #let v = mk_var(`GEN%VAR%359`,":bool");;
8097 - v = "GEN%VAR%359" : term
8098 -
8099 - #genvar ":bool";;
8100 - "GEN%VAR%360" : term
8101 -\end{verbatim}
8102 -}
8103 -\USES
8104 -The unique variables are useful in writing derived rules, for specializing
8105 -terms without having to worry about such things as free variable capture.
8106 -If the names are to be visible to a typical user, the function {\small\verb%variant%} can
8107 -provide rather more meaningful names.
8108 -
8109 -\SEEALSO
8110 -GSPEC, variant.
8111 -
8112 -\ENDDOC
8113 \DOC{GEN\_ALL}
8114
8115 \TYPE {\small\verb%GEN_ALL : (thm -> thm)%}\egroup
8116 @@ -9670,21 +9524,89 @@ the following, it acts in the same way a
8117 pair, so {\small\verb%FST%} and {\small\verb%SND%} are introduced:
8118 {\par\samepage\setseps\small
8119 \begin{verbatim}
8120 - #GEN_BETA_CONV "(\(x,y). x + y) numpair";;
8121 - |- (\(x,y). x + y)numpair = (FST numpair) + (SND numpair)
8122 + #GEN_BETA_CONV "(\(x,y). x + y) numpair";;
8123 + |- (\(x,y). x + y)numpair = (FST numpair) + (SND numpair)
8124 +\end{verbatim}
8125 +}
8126 +\noindent The introduction of {\small\verb%FST%} and {\small\verb%SND%} will be done more than once as
8127 +necessary:
8128 +{\par\samepage\setseps\small
8129 +\begin{verbatim}
8130 + #GEN_BETA_CONV "(\(w,x,y,z). w + x + y + z) (1,triple)";;
8131 + |- (\(w,x,y,z). w + (x + (y + z)))(1,triple) =
8132 + 1 + ((FST triple) + ((FST(SND triple)) + (SND(SND triple))))
8133 +\end{verbatim}
8134 +}
8135 +\SEEALSO
8136 +BETA_CONV, PAIRED_BETA_CONV.
8137 +
8138 +\ENDDOC
8139 +\DOC{GEN}
8140 +
8141 +\TYPE {\small\verb%GEN : (term -> thm -> thm)%}\egroup
8142 +
8143 +\SYNOPSIS
8144 +Generalizes the conclusion of a theorem.
8145 +
8146 +\DESCRIBE
8147 +When applied to a term {\small\verb%x%} and a theorem {\small\verb%A |- t%}, the inference rule
8148 +{\small\verb%GEN%} returns the theorem {\small\verb%A |- !x. t%}, provided {\small\verb%x%} is a variable not
8149 +free in any of the assumptions. There is no compulsion that {\small\verb%x%} should
8150 +be free in {\small\verb%t%}.
8151 +{\par\samepage\setseps\small
8152 +\begin{verbatim}
8153 + A |- t
8154 + ------------ GEN "x" [where x is not free in A]
8155 + A |- !x. t
8156 +\end{verbatim}
8157 +}
8158 +\FAILURE
8159 +Fails if {\small\verb%x%} is not a variable, or if it is free in any of the assumptions.
8160 +
8161 +\EXAMPLE
8162 +The following example shows how the above side-condition prevents
8163 +the derivation of the theorem {\small\verb%x=T |- !x. x=T%}, which is clearly invalid.
8164 +{\par\samepage\setseps\small
8165 +\begin{verbatim}
8166 + #top_print print_all_thm;;
8167 + - : (thm -> void)
8168 +
8169 + #let t = ASSUME "x=T";;
8170 + t = x = T |- x = T
8171 +
8172 + #GEN "x:bool" t;;
8173 + evaluation failed GEN
8174 \end{verbatim}
8175 }
8176 -\noindent The introduction of {\small\verb%FST%} and {\small\verb%SND%} will be done more than once as
8177 -necessary:
8178 +\SEEALSO
8179 +GENL, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC.
8180 +
8181 +\ENDDOC
8182 +\DOC{GENL}
8183 +
8184 +\TYPE {\small\verb%GENL : (term list -> thm -> thm)%}\egroup
8185 +
8186 +\SYNOPSIS
8187 +Generalizes zero or more variables in the conclusion of a theorem.
8188 +
8189 +\DESCRIBE
8190 +When applied to a term list {\small\verb%[x1;...;xn]%} and a theorem {\small\verb%A |- t%}, the inference
8191 +rule {\small\verb%GENL%} returns the theorem {\small\verb%A |- !x1...xn. t%}, provided none of the
8192 +variables {\small\verb%xi%} are free in any of the assumptions. It is not necessary that
8193 +any or all of the {\small\verb%xi%} should be free in {\small\verb%t%}.
8194 {\par\samepage\setseps\small
8195 \begin{verbatim}
8196 - #GEN_BETA_CONV "(\(w,x,y,z). w + x + y + z) (1,triple)";;
8197 - |- (\(w,x,y,z). w + (x + (y + z)))(1,triple) =
8198 - 1 + ((FST triple) + ((FST(SND triple)) + (SND(SND triple))))
8199 + A |- t
8200 + ------------------ GENL "[x1;...;xn]" [where no xi is free in A]
8201 + A |- !x1...xn. t
8202 \end{verbatim}
8203 }
8204 +\FAILURE
8205 +Fails unless all the terms in the list are variables, none of which are
8206 +free in the assumption list.
8207 +
8208 \SEEALSO
8209 -BETA_CONV, PAIRED_BETA_CONV.
8210 +GEN, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC.
8211
8212 \ENDDOC
8213 \DOC{GEN\_REWRITE\_CONV}
8214 @@ -9976,28 +9898,51 @@ FILTER_GEN_TAC, GEN, GENL, GEN_ALL, SPEC
8215 X_GEN_TAC.
8216
8217 \ENDDOC
8218 -\DOC{getenv}
8219 +\DOC{genvar}
8220
8221 -\TYPE {\small\verb%getenv : (string -> string)%}\egroup
8222 +\TYPE {\small\verb%genvar : (type -> term)%}\egroup
8223
8224 \SYNOPSIS
8225 -Returns the value of a Unix environment variable.
8226 +Returns a variable whose name has not been used previously.
8227
8228 \DESCRIBE
8229 -{\small\verb%getenv x%} returns the value of {\small\verb%x%} from the current environment list; this
8230 -will include shell environment variables set before {\small\verb%HOL%} is run.
8231 +When given a type, {\small\verb%genvar%} returns a variable of that type whose name has
8232 +not been used for a variable or constant in the HOL session so far.
8233
8234 \FAILURE
8235 -If in a Unix environment, fails with {\small\verb%getenv%} if the variable is undefined,
8236 -or has an empty value. In other environments, it will normally fail anyway.
8237 +Never fails.
8238
8239 \EXAMPLE
8240 +The following indicates the typical stylized form of the names (this should
8241 +not be relied on, of course):
8242 {\par\samepage\setseps\small
8243 \begin{verbatim}
8244 -#getenv `SHELL`;;
8245 -`/bin/csh` : string
8246 + #genvar ":bool";;
8247 + "GEN%VAR%357" : term
8248 +
8249 + #genvar ":num";;
8250 + "GEN%VAR%358" : term
8251 +\end{verbatim}
8252 +}
8253 +\noindent Trying to anticipate {\small\verb%genvar%} doesn't work:
8254 +{\par\samepage\setseps\small
8255 +\begin{verbatim}
8256 + #let v = mk_var(`GEN%VAR%359`,":bool");;
8257 + v = "GEN%VAR%359" : term
8258 +
8259 + #genvar ":bool";;
8260 + "GEN%VAR%360" : term
8261 \end{verbatim}
8262 }
8263 +\USES
8264 +The unique variables are useful in writing derived rules, for specializing
8265 +terms without having to worry about such things as free variable capture.
8266 +If the names are to be visible to a typical user, the function {\small\verb%variant%} can
8267 +provide rather more meaningful names.
8268 +
8269 +\SEEALSO
8270 +GSPEC, variant.
8271 +
8272 \ENDDOC
8273 \DOC{get\_const\_type}
8274
8275 @@ -10023,6 +9968,29 @@ Gets the generic type of a constant from
8276 dest_const, is_constant.
8277
8278 \ENDDOC
8279 +\DOC{getenv}
8280 +
8281 +\TYPE {\small\verb%getenv : (string -> string)%}\egroup
8282 +
8283 +\SYNOPSIS
8284 +Returns the value of a Unix environment variable.
8285 +
8286 +\DESCRIBE
8287 +{\small\verb%getenv x%} returns the value of {\small\verb%x%} from the current environment list; this
8288 +will include shell environment variables set before {\small\verb%HOL%} is run.
8289 +
8290 +\FAILURE
8291 +If in a Unix environment, fails with {\small\verb%getenv%} if the variable is undefined,
8292 +or has an empty value. In other environments, it will normally fail anyway.
8293 +
8294 +\EXAMPLE
8295 +{\par\samepage\setseps\small
8296 +\begin{verbatim}
8297 +#getenv `SHELL`;;
8298 +`/bin/csh` : string
8299 +\end{verbatim}
8300 +}
8301 +\ENDDOC
8302 \DOC{get\_flag\_value}
8303
8304 \TYPE {\small\verb%get_flag_value : (string -> bool)%}\egroup
8305 @@ -10330,6 +10298,36 @@ variable is free in that function.
8306 ETA_CONV, MK_ABS, MK_COMB, MK_EXISTS.
8307
8308 \ENDDOC
8309 +\DOC{\char'136}
8310 +
8311 +\TYPE {\small\verb%$^ : (string -> string -> string)%}\egroup
8312 +
8313 +\SYNOPSIS
8314 +Concatenates two ML strings.
8315 +
8316 +\DESCRIBE
8317 +The {\small\verb%^%} is the ML infix string concatenation operator.
8318 +If {\small\verb%s1%} and {\small\verb%s2%} are strings, then {\small\verb%s1^s2%} gives a string which is their
8319 +concatenation.
8320 +
8321 +\FAILURE
8322 +Never fails.
8323 +
8324 +\EXAMPLE
8325 +{\par\samepage\setseps\small
8326 +\begin{verbatim}
8327 +#`Hello `^`world`;;
8328 +`Hello world` : string
8329 +\end{verbatim}
8330 +}
8331 +\COMMENTS
8332 +The ML role of the {\small\verb%^%} operator should not be confused with its use in
8333 +quoted terms to introduce antiquotation (see DESCRIPTION for details).
8334 +
8335 +\SEEALSO
8336 +concat, concatl.
8337 +
8338 +\ENDDOC
8339 \DOC{hd}
8340
8341 \TYPE {\small\verb%hd : (* list -> *)%}\egroup
8342 @@ -10544,36 +10542,6 @@ Never fails.
8343 \#, B, C, CB, Co, K, KI, o, oo, S, W.
8344
8345 \ENDDOC
8346 -\DOC{implode}
8347 -
8348 -\TYPE {\small\verb%implode : (string list -> string)%}\egroup
8349 -
8350 -\SYNOPSIS
8351 -Converts a list of single-character strings into one string.
8352 -
8353 -\DESCRIBE
8354 -{\small\verb%implode [s1;...;sn]%} returns the string formed by concatenating the
8355 -single-character strings {\small\verb%s1 ... sn%}. If {\small\verb%n%} is zero (the list is empty),
8356 -then the empty string is returned.
8357 -
8358 -\FAILURE
8359 -Fails if any of the strings in the argument list are null or longer than one
8360 -character.
8361 -
8362 -\EXAMPLE
8363 -{\par\samepage\setseps\small
8364 -\begin{verbatim}
8365 -#implode [`e`;`x`;`a`;`m`;`p`;`l`;`e`];;
8366 -`example` : string
8367 -
8368 -#implode [`ex`;`a`;`mpl`;``;`e`];;
8369 -evaluation failed implode
8370 -\end{verbatim}
8371 -}
8372 -\SEEALSO
8373 -explode, concat, concatl.
8374 -
8375 -\ENDDOC
8376 \DOC{IMP\_ANTISYM\_RULE}
8377
8378 \TYPE {\small\verb%IMP_ANTISYM_RULE : (thm -> thm -> thm)%}\egroup
8379 @@ -10680,6 +10648,36 @@ Fails unless the theorem is implicative.
8380 NOT_INTRO, NOT_ELIM.
8381
8382 \ENDDOC
8383 +\DOC{implode}
8384 +
8385 +\TYPE {\small\verb%implode : (string list -> string)%}\egroup
8386 +
8387 +\SYNOPSIS
8388 +Converts a list of single-character strings into one string.
8389 +
8390 +\DESCRIBE
8391 +{\small\verb%implode [s1;...;sn]%} returns the string formed by concatenating the
8392 +single-character strings {\small\verb%s1 ... sn%}. If {\small\verb%n%} is zero (the list is empty),
8393 +then the empty string is returned.
8394 +
8395 +\FAILURE
8396 +Fails if any of the strings in the argument list are null or longer than one
8397 +character.
8398 +
8399 +\EXAMPLE
8400 +{\par\samepage\setseps\small
8401 +\begin{verbatim}
8402 +#implode [`e`;`x`;`a`;`m`;`p`;`l`;`e`];;
8403 +`example` : string
8404 +
8405 +#implode [`ex`;`a`;`mpl`;``;`e`];;
8406 +evaluation failed implode
8407 +\end{verbatim}
8408 +}
8409 +\SEEALSO
8410 +explode, concat, concatl.
8411 +
8412 +\ENDDOC
8413 \DOC{IMP\_RES\_TAC}
8414
8415 \TYPE {\small\verb%IMP_RES_TAC : thm_tactic%}\egroup
8416 @@ -11193,43 +11191,73 @@ y = inr 12 : (string + int)
8417 inl, isl, outl, outr.
8418
8419 \ENDDOC
8420 -\DOC{INST}
8421 +\DOC{install}
8422
8423 -\TYPE {\small\verb%INST : ((term # term) list -> thm -> thm)%}\egroup
8424 +\TYPE {\small\verb%install : (string -> void)%}\egroup
8425
8426 \SYNOPSIS
8427 -Instantiates free variables in a theorem.
8428 +Informs HOL of the absolute pathname to the hol distribution directory.
8429
8430 \DESCRIBE
8431 -{\small\verb%INST%} is a rule for substituting arbitrary terms for free variables
8432 -in a theorem:
8433 +{\small\verb%install%} reconfigures a running HOL system to a new root directory. The
8434 +string argument to {\small\verb%install%} should be the absolute path name to the
8435 +directory in which the HOL system is located. Executing
8436 {\par\samepage\setseps\small
8437 \begin{verbatim}
8438 - A |- t
8439 - ----------------------------- INST [(t1,x1);...;(tn,xn)]
8440 - A |- t[t1,...,tn/x1,...,xn]
8441 + install `/dir1/dir2/dir3/.../hol`;;
8442 \end{verbatim}
8443 }
8444 -\noindent where the variables {\small\verb%x1, ..., xn%} are not free in the
8445 -assumptions {\small\verb%A%}.
8446 +\noindent sets the internal HOL search path to:
8447 +{\par\samepage\setseps\small
8448 +\begin{verbatim}
8449 + [``; `~/`; `/dir1/dir2/dir3/.../hol/theories/`]
8450 +\end{verbatim}
8451 +}
8452 +\noindent In addition, {\small\verb%install%} sets the internal search path used by HOL to
8453 +find the standard online help files and the internal search path used by HOL to
8454 +find libraries.
8455
8456 \FAILURE
8457 -{\small\verb%INST%} fails if a variable being instantiated is free in the
8458 -assumptions.
8459 +Never fails.
8460
8461 -\EXAMPLE
8462 -In the following example a theorem is instantiated for a specific term:
8463 -{\par\samepage\setseps\small
8464 -\begin{verbatim}
8465 - #CONJUNCT1 ADD_CLAUSES ;;
8466 - |- 0 + m = m
8467 +\COMMENTS
8468 +The effect persists only for the current HOL session. To change the image
8469 +permanently, use the {\small\verb%save%} function after installation.
8470
8471 - #INST [("2 * x","m:num")] (CONJUNCT1 ADD_CLAUSES) ;;
8472 - |- 0 + (2 * x) = 2 * x
8473 +\SEEALSO
8474 +help_search_path, library_pathname, library_search_path, search_path,
8475 +set_help_search_path, set_library_search_path, set_search_path.
8476 +
8477 +\ENDDOC
8478 +\DOC{inst\_check}
8479 +
8480 +\TYPE {\small\verb%inst_check : (((type # type) list # term list) -> term list)%}\egroup
8481 +
8482 +\SYNOPSIS
8483 +Checks the validity of type instantiations.
8484 +
8485 +\DESCRIBE
8486 +If the {\small\verb%t1...tn%} are types (monomorphic or polymorphic), the {\small\verb%v1...vn%} type
8487 +variables (e.g. {\small\verb%":*"%}), and {\small\verb%tm1...tmn%} terms, the call
8488 +{\par\samepage\setseps\small
8489 +\begin{verbatim}
8490 + inst_check ([(t1,v1);...;(tn,vn)],[tm1;...;tmn])
8491 \end{verbatim}
8492 }
8493 +\noindent will return a list of the variables free in the {\small\verb%tm1...tmn%}, provided
8494 +none of the type variables {\small\verb%v1...vn%} are free in {\small\verb%tm1...tmn%}. If this condition
8495 +is not met, or any of the {\small\verb%v%}'s are not simply type variables, the call fails.
8496 +
8497 +\FAILURE
8498 +Fails if any of the {\small\verb%v%}'s are not simple type variables, or if any of them are
8499 +free in the terms {\small\verb%v1...vn%}.
8500 +
8501 +\USES
8502 +Checking the validity of type instantiations (for example, if the terms are the
8503 +hypotheses of a theorem).
8504 +
8505 \SEEALSO
8506 -INST_TY_TERM, INST_TYPE, ISPEC, ISPECL, SPEC; SPECL, SUBS, subst, SUBST.
8507 +inst, inst_rename_list, inst_type, INST_TYPE.
8508
8509 \ENDDOC
8510 \DOC{inst}
8511 @@ -11281,73 +11309,43 @@ Performing internal functions connected
8512 inst_check, inst_rename_list, inst_type, INST_TYPE.
8513
8514 \ENDDOC
8515 -\DOC{install}
8516 +\DOC{INST}
8517
8518 -\TYPE {\small\verb%install : (string -> void)%}\egroup
8519 +\TYPE {\small\verb%INST : ((term # term) list -> thm -> thm)%}\egroup
8520
8521 \SYNOPSIS
8522 -Informs HOL of the absolute pathname to the hol distribution directory.
8523 +Instantiates free variables in a theorem.
8524
8525 \DESCRIBE
8526 -{\small\verb%install%} reconfigures a running HOL system to a new root directory. The
8527 -string argument to {\small\verb%install%} should be the absolute path name to the
8528 -directory in which the HOL system is located. Executing
8529 -{\par\samepage\setseps\small
8530 -\begin{verbatim}
8531 - install `/dir1/dir2/dir3/.../hol`;;
8532 -\end{verbatim}
8533 -}
8534 -\noindent sets the internal HOL search path to:
8535 +{\small\verb%INST%} is a rule for substituting arbitrary terms for free variables
8536 +in a theorem:
8537 {\par\samepage\setseps\small
8538 \begin{verbatim}
8539 - [``; `~/`; `/dir1/dir2/dir3/.../hol/theories/`]
8540 + A |- t
8541 + ----------------------------- INST [(t1,x1);...;(tn,xn)]
8542 + A |- t[t1,...,tn/x1,...,xn]
8543 \end{verbatim}
8544 }
8545 -\noindent In addition, {\small\verb%install%} sets the internal search path used by HOL to
8546 -find the standard online help files and the internal search path used by HOL to
8547 -find libraries.
8548 +\noindent where the variables {\small\verb%x1, ..., xn%} are not free in the
8549 +assumptions {\small\verb%A%}.
8550
8551 \FAILURE
8552 -Never fails.
8553 -
8554 -\COMMENTS
8555 -The effect persists only for the current HOL session. To change the image
8556 -permanently, use the {\small\verb%save%} function after installation.
8557 -
8558 -\SEEALSO
8559 -help_search_path, library_pathname, library_search_path, search_path,
8560 -set_help_search_path, set_library_search_path, set_search_path.
8561 -
8562 -\ENDDOC
8563 -\DOC{inst\_check}
8564 -
8565 -\TYPE {\small\verb%inst_check : (((type # type) list # term list) -> term list)%}\egroup
8566 -
8567 -\SYNOPSIS
8568 -Checks the validity of type instantiations.
8569 +{\small\verb%INST%} fails if a variable being instantiated is free in the
8570 +assumptions.
8571
8572 -\DESCRIBE
8573 -If the {\small\verb%t1...tn%} are types (monomorphic or polymorphic), the {\small\verb%v1...vn%} type
8574 -variables (e.g. {\small\verb%":*"%}), and {\small\verb%tm1...tmn%} terms, the call
8575 +\EXAMPLE
8576 +In the following example a theorem is instantiated for a specific term:
8577 {\par\samepage\setseps\small
8578 \begin{verbatim}
8579 - inst_check ([(t1,v1);...;(tn,vn)],[tm1;...;tmn])
8580 + #CONJUNCT1 ADD_CLAUSES ;;
8581 + |- 0 + m = m
8582 +
8583 + #INST [("2 * x","m:num")] (CONJUNCT1 ADD_CLAUSES) ;;
8584 + |- 0 + (2 * x) = 2 * x
8585 \end{verbatim}
8586 }
8587 -\noindent will return a list of the variables free in the {\small\verb%tm1...tmn%}, provided
8588 -none of the type variables {\small\verb%v1...vn%} are free in {\small\verb%tm1...tmn%}. If this condition
8589 -is not met, or any of the {\small\verb%v%}'s are not simply type variables, the call fails.
8590 -
8591 -\FAILURE
8592 -Fails if any of the {\small\verb%v%}'s are not simple type variables, or if any of them are
8593 -free in the terms {\small\verb%v1...vn%}.
8594 -
8595 -\USES
8596 -Checking the validity of type instantiations (for example, if the terms are the
8597 -hypotheses of a theorem).
8598 -
8599 \SEEALSO
8600 -inst, inst_rename_list, inst_type, INST_TYPE.
8601 +INST_TY_TERM, INST_TYPE, ISPEC, ISPECL, SPEC; SPECL, SUBS, subst, SUBST.
8602
8603 \ENDDOC
8604 \DOC{inst\_rename\_list}
8605 @@ -11395,6 +11393,51 @@ Checking the validity of type instantiat
8606 inst, inst_check, inst_type, INST_TYPE.
8607
8608 \ENDDOC
8609 +\DOC{inst\_type}
8610 +
8611 +\TYPE {\small\verb%inst_type : ((type # type) list -> type -> type)%}\egroup
8612 +
8613 +\SYNOPSIS
8614 +Instantiates types in a type.
8615 +
8616 +\DESCRIBE
8617 +If {\small\verb%[(t1',t1);...;(tn',tn)]%} is a list of type instantiations, where {\small\verb%t1...tn%}
8618 +are the initial types, and {\small\verb%t1'...tn'%} the desired instantiations, and {\small\verb%ty%} is
8619 +a type to instantiate, the call
8620 +{\par\samepage\setseps\small
8621 +\begin{verbatim}
8622 + inst_type [(t1',t1);...;(tn',tn)] ty
8623 +\end{verbatim}
8624 +}
8625 +\noindent will appropriately instantiate the type {\small\verb%ty%}. The instantiations will
8626 +be performed in parallel. If several of the type instantiations are applicable,
8627 +the choice is undefined. In normal use the {\small\verb%t1...tn%} are type variables,
8628 +although this is not essential. Neither is it necessary that any or all of the
8629 +types {\small\verb%t1...tn%} should in fact appear in {\small\verb%ty%}.
8630 +
8631 +\FAILURE
8632 +Never fails.
8633 +
8634 +\EXAMPLE
8635 +{\par\samepage\setseps\small
8636 +\begin{verbatim}
8637 +#inst_type [(":bool",":*")] ":* # **";;
8638 +":bool # **" : type
8639 +
8640 +#inst_type [(":num",":* # **"); (":bool",":*")] ":* # **";;
8641 +":num" : type
8642 +
8643 +#inst_type [(":bool",":*"); (":num",":* # **")] ":* # **";;
8644 +":num" : type
8645 +
8646 +#inst_type [(":bool",":num"); (":num",":bool")] ":(bool)list";;
8647 +":(num)list" : type
8648 +\end{verbatim}
8649 +}
8650 +\SEEALSO
8651 +inst, inst_check, inst_type, INST_TYPE.
8652 +
8653 +\ENDDOC
8654 \DOC{INST\_TYPE}
8655
8656 \TYPE {\small\verb%INST_TYPE : ((type # type) list -> thm -> thm)%}\egroup
8657 @@ -11446,51 +11489,6 @@ The desired specialization can be obtain
8658 INST, INST_TY_TERM.
8659
8660 \ENDDOC
8661 -\DOC{inst\_type}
8662 -
8663 -\TYPE {\small\verb%inst_type : ((type # type) list -> type -> type)%}\egroup
8664 -
8665 -\SYNOPSIS
8666 -Instantiates types in a type.
8667 -
8668 -\DESCRIBE
8669 -If {\small\verb%[(t1',t1);...;(tn',tn)]%} is a list of type instantiations, where {\small\verb%t1...tn%}
8670 -are the initial types, and {\small\verb%t1'...tn'%} the desired instantiations, and {\small\verb%ty%} is
8671 -a type to instantiate, the call
8672 -{\par\samepage\setseps\small
8673 -\begin{verbatim}
8674 - inst_type [(t1',t1);...;(tn',tn)] ty
8675 -\end{verbatim}
8676 -}
8677 -\noindent will appropriately instantiate the type {\small\verb%ty%}. The instantiations will
8678 -be performed in parallel. If several of the type instantiations are applicable,
8679 -the choice is undefined. In normal use the {\small\verb%t1...tn%} are type variables,
8680 -although this is not essential. Neither is it necessary that any or all of the
8681 -types {\small\verb%t1...tn%} should in fact appear in {\small\verb%ty%}.
8682 -
8683 -\FAILURE
8684 -Never fails.
8685 -
8686 -\EXAMPLE
8687 -{\par\samepage\setseps\small
8688 -\begin{verbatim}
8689 -#inst_type [(":bool",":*")] ":* # **";;
8690 -":bool # **" : type
8691 -
8692 -#inst_type [(":num",":* # **"); (":bool",":*")] ":* # **";;
8693 -":num" : type
8694 -
8695 -#inst_type [(":bool",":*"); (":num",":* # **")] ":* # **";;
8696 -":num" : type
8697 -
8698 -#inst_type [(":bool",":num"); (":num",":bool")] ":(bool)list";;
8699 -":(num)list" : type
8700 -\end{verbatim}
8701 -}
8702 -\SEEALSO
8703 -inst, inst_check, inst_type, INST_TYPE.
8704 -
8705 -\ENDDOC
8706 \DOC{INST\_TY\_TERM}
8707
8708 \TYPE {\small\verb%INST_TY_TERM : (((term # term) list # (type # type) list) -> thm -> thm)%}\egroup
8709 @@ -11583,105 +11581,25 @@ ascii, ascii_code, string_of_int.
8710 \TYPE {\small\verb%int_of_term : (term -> int)%}\egroup
8711
8712 \SYNOPSIS
8713 -Maps a numeric term to the corresponding ML integer.
8714 -
8715 -\DESCRIBE
8716 -Given a term representing a natural number, i.e., of type {\small\verb%:num%}
8717 -{\small\verb%int_of_term%} returns the corresponding ML integer constant.
8718 -
8719 -\FAILURE
8720 -Never fails.
8721 -
8722 -\EXAMPLE
8723 -{\par\samepage\setseps\small
8724 -\begin{verbatim}
8725 - #int_of_term "2";;
8726 - 2 : int
8727 -\end{verbatim}
8728 -}
8729 -
8730 -\SEEALSO
8731 -term_of_int, string_of_int, int_of_string.
8732 -
8733 -\ENDDOC
8734 -\DOC{isl}
8735 -
8736 -\TYPE {\small\verb%isl : ((* + **) -> bool)%}\egroup
8737 -
8738 -\SYNOPSIS
8739 -Tests for membership of left summand.
8740 -
8741 -\EXAMPLE
8742 -{\par\samepage\setseps\small
8743 -\begin{verbatim}
8744 -#let x = inl 1 and y = inr 2;;
8745 -
8746 -#isl x;;
8747 -true : bool
8748 -
8749 -#isl y;;
8750 -false : bool
8751 -\end{verbatim}
8752 -}
8753 -\SEEALSO
8754 -inl, inr
8755 -
8756 -\ENDDOC
8757 -\DOC{ISPEC}
8758 -
8759 -\TYPE {\small\verb%ISPEC : (term -> thm -> thm)%}\egroup
8760 -
8761 -\SYNOPSIS
8762 -Specializes a theorem, with type instantiation if necessary.
8763 -
8764 -\DESCRIBE
8765 -This rule specializes a quantified variable as does {\small\verb%SPEC%}; it differs
8766 -from it in also instantiating the type if needed:
8767 -{\par\samepage\setseps\small
8768 -\begin{verbatim}
8769 - A |- !x:ty.tm
8770 - ----------------------- ISPEC "t:ty'"
8771 - A |- tm[t/x]
8772 -\end{verbatim}
8773 -}
8774 -\noindent (where {\small\verb%t%} is free for {\small\verb%x%} in {\small\verb%tm%}, and {\small\verb%ty'%} is an instance
8775 -of {\small\verb%ty%}).
8776 -
8777 -\FAILURE
8778 -{\small\verb%ISPEC%} fails if the input theorem is not universally quantified, if
8779 -the type of the given term is not an instance of the type of the
8780 -quantified variable, or if the type variable is free in the
8781 -assumptions.
8782 -
8783 -\SEEALSO
8784 -INST_TY_TERM, INST_TYPE, ISPECL, SPEC, match.
8785 -
8786 -\ENDDOC
8787 -\DOC{ISPECL}
8788 -
8789 -\TYPE {\small\verb%ISPECL : (term list -> thm -> thm)%}\egroup
8790 -
8791 -\SYNOPSIS
8792 -Specializes a theorem zero or more times, with type instantiation if necessary.
8793 +Maps a numeric term to the corresponding ML integer.
8794
8795 \DESCRIBE
8796 -{\small\verb%ISPECL%} is an iterative version of {\small\verb%ISPEC%}
8797 +Given a term representing a natural number, i.e., of type {\small\verb%:num%}
8798 +{\small\verb%int_of_term%} returns the corresponding ML integer constant.
8799 +
8800 +\FAILURE
8801 +Never fails.
8802 +
8803 +\EXAMPLE
8804 {\par\samepage\setseps\small
8805 \begin{verbatim}
8806 - A |- !x1...xn.t
8807 - ---------------------------- ISPECL ["t1",...,"tn"]
8808 - A |- t[t1,...tn/x1,...,xn]
8809 + #int_of_term "2";;
8810 + 2 : int
8811 \end{verbatim}
8812 }
8813 -\noindent (where {\small\verb%ti%} is free for {\small\verb%xi%} in {\small\verb%tm%}).
8814 -
8815 -\FAILURE
8816 -{\small\verb%ISPECL%} fails if the list of terms is longer than the number of
8817 -quantified variables in the term, if the type instantiation fails, or
8818 -if the type variable being instantiated is free in the assumptions.
8819
8820 \SEEALSO
8821 -INST_TYPE, INST_TY_TERM, ISPEC, MATCH, SPEC, SPECL.
8822 +term_of_int, string_of_int, int_of_string.
8823
8824 \ENDDOC
8825 \DOC{is\_abs}
8826 @@ -11896,24 +11814,6 @@ Never fails.
8827 mk_cons, dest_cons, mk_list, dest_list, is_list.
8828
8829 \ENDDOC
8830 -\DOC{is\_const}
8831 -
8832 -\TYPE {\small\verb%is_const : (term -> bool)%}\egroup
8833 -
8834 -\SYNOPSIS
8835 -Tests a term to see if it is a constant.
8836 -
8837 -\DESCRIBE
8838 -{\small\verb%is_const "const:ty"%} returns {\small\verb%true%}. If the term is not a constant the
8839 -result is {\small\verb%false%}.
8840 -
8841 -\FAILURE
8842 -Never fails.
8843 -
8844 -\SEEALSO
8845 -mk_const, dest_const, is_var, is_comb, is_abs.
8846 -
8847 -\ENDDOC
8848 \DOC{is\_constant}
8849
8850 \TYPE {\small\verb%is_constant : (string -> bool)%}\egroup
8851 @@ -11949,6 +11849,24 @@ false : bool
8852 is_infix, is_binder
8853
8854 \ENDDOC
8855 +\DOC{is\_const}
8856 +
8857 +\TYPE {\small\verb%is_const : (term -> bool)%}\egroup
8858 +
8859 +\SYNOPSIS
8860 +Tests a term to see if it is a constant.
8861 +
8862 +\DESCRIBE
8863 +{\small\verb%is_const "const:ty"%} returns {\small\verb%true%}. If the term is not a constant the
8864 +result is {\small\verb%false%}.
8865 +
8866 +\FAILURE
8867 +Never fails.
8868 +
8869 +\SEEALSO
8870 +mk_const, dest_const, is_var, is_comb, is_abs.
8871 +
8872 +\ENDDOC
8873 \DOC{is\_definition}
8874
8875 \TYPE {\small\verb%is_definition : (term -> bool)%}\egroup
8876 @@ -12210,6 +12128,29 @@ false : bool
8877 is_infix, is_type, is_binder_type
8878
8879 \ENDDOC
8880 +\DOC{isl}
8881 +
8882 +\TYPE {\small\verb%isl : ((* + **) -> bool)%}\egroup
8883 +
8884 +\SYNOPSIS
8885 +Tests for membership of left summand.
8886 +
8887 +\EXAMPLE
8888 +{\par\samepage\setseps\small
8889 +\begin{verbatim}
8890 +#let x = inl 1 and y = inr 2;;
8891 +
8892 +#isl x;;
8893 +true : bool
8894 +
8895 +#isl y;;
8896 +false : bool
8897 +\end{verbatim}
8898 +}
8899 +\SEEALSO
8900 +inl, inr
8901 +
8902 +\ENDDOC
8903 \DOC{is\_let}
8904
8905 \TYPE {\small\verb%is_let : (term -> bool)%}\egroup
8906 @@ -12407,6 +12348,63 @@ Never fails.
8907 mk_pair, dest_pair.
8908
8909 \ENDDOC
8910 +\DOC{ISPEC}
8911 +
8912 +\TYPE {\small\verb%ISPEC : (term -> thm -> thm)%}\egroup
8913 +
8914 +\SYNOPSIS
8915 +Specializes a theorem, with type instantiation if necessary.
8916 +
8917 +\DESCRIBE
8918 +This rule specializes a quantified variable as does {\small\verb%SPEC%}; it differs
8919 +from it in also instantiating the type if needed:
8920 +{\par\samepage\setseps\small
8921 +\begin{verbatim}
8922 + A |- !x:ty.tm
8923 + ----------------------- ISPEC "t:ty'"
8924 + A |- tm[t/x]
8925 +\end{verbatim}
8926 +}
8927 +\noindent (where {\small\verb%t%} is free for {\small\verb%x%} in {\small\verb%tm%}, and {\small\verb%ty'%} is an instance
8928 +of {\small\verb%ty%}).
8929 +
8930 +\FAILURE
8931 +{\small\verb%ISPEC%} fails if the input theorem is not universally quantified, if
8932 +the type of the given term is not an instance of the type of the
8933 +quantified variable, or if the type variable is free in the
8934 +assumptions.
8935 +
8936 +\SEEALSO
8937 +INST_TY_TERM, INST_TYPE, ISPECL, SPEC, match.
8938 +
8939 +\ENDDOC
8940 +\DOC{ISPECL}
8941 +
8942 +\TYPE {\small\verb%ISPECL : (term list -> thm -> thm)%}\egroup
8943 +
8944 +\SYNOPSIS
8945 +Specializes a theorem zero or more times, with type instantiation if necessary.
8946 +
8947 +\DESCRIBE
8948 +{\small\verb%ISPECL%} is an iterative version of {\small\verb%ISPEC%}
8949 +{\par\samepage\setseps\small
8950 +\begin{verbatim}
8951 + A |- !x1...xn.t
8952 + ---------------------------- ISPECL ["t1",...,"tn"]
8953 + A |- t[t1,...tn/x1,...,xn]
8954 +\end{verbatim}
8955 +}
8956 +\noindent (where {\small\verb%ti%} is free for {\small\verb%xi%} in {\small\verb%tm%}).
8957 +
8958 +\FAILURE
8959 +{\small\verb%ISPECL%} fails if the list of terms is longer than the number of
8960 +quantified variables in the term, if the type instantiation fails, or
8961 +if the type variable being instantiated is free in the assumptions.
8962 +
8963 +\SEEALSO
8964 +INST_TYPE, INST_TY_TERM, ISPEC, MATCH, SPEC, SPECL.
8965 +
8966 +\ENDDOC
8967 \DOC{is\_pred}
8968
8969 \TYPE {\small\verb%is_pred : (term -> bool)%}\egroup
8970 @@ -12580,65 +12578,65 @@ Used in evaluating expressions that requ
8971 expression.
8972
8973 \ENDDOC
8974 -\DOC{itlist}
8975 +\DOC{itlist2}
8976
8977 -\TYPE {\small\verb%itlist : ((* -> ** -> **) -> * list -> ** -> **)%}\egroup
8978 +\TYPE {\small\verb%itlist2 : (((* # **) -> *** -> ***) -> (* list # ** list) -> *** -> ***)%}\egroup
8979
8980 \SYNOPSIS
8981 -List iteration function. Applies a binary function between adjacent elements
8982 -of a list.
8983 +Applies a paired function between adjacent elements of 2 lists.
8984
8985 \DESCRIBE
8986 -{\small\verb%itlist f [x1;...;xn] y%} returns
8987 +{\small\verb%itlist2 f ([x1;...;xn],[y1;...;yn]) z%} returns
8988 {\par\samepage\setseps\small
8989 \begin{verbatim}
8990 - f x1 (f x2 ... (f xn y)...)
8991 + f (x1,y1) (f (x2,y2) ... (f (xn,yn) z)...)
8992 \end{verbatim}
8993 }
8994 -\noindent It returns {\small\verb%y%} if list is empty.
8995 +\noindent It returns {\small\verb%z%} if both lists are empty.
8996
8997 \FAILURE
8998 -Never fails.
8999 +Fails with {\small\verb%itlist2%} if the two lists are of different lengths.
9000
9001 \EXAMPLE
9002 {\par\samepage\setseps\small
9003 \begin{verbatim}
9004 -#itlist (\x y. x + y) [1;2;3;4] 0;;
9005 -10 : int
9006 +#itlist2 (\(x,y) z. (x * y) + z) ([1;2],[3;4]) 0;;
9007 +11 : int
9008 \end{verbatim}
9009 }
9010 \SEEALSO
9011 -rev_itlist, end_itlist.
9012 +itlist, rev_itlist, end_itlist, uncurry.
9013
9014 \ENDDOC
9015 -\DOC{itlist2}
9016 +\DOC{itlist}
9017
9018 -\TYPE {\small\verb%itlist2 : (((* # **) -> *** -> ***) -> (* list # ** list) -> *** -> ***)%}\egroup
9019 +\TYPE {\small\verb%itlist : ((* -> ** -> **) -> * list -> ** -> **)%}\egroup
9020
9021 \SYNOPSIS
9022 -Applies a paired function between adjacent elements of 2 lists.
9023 +List iteration function. Applies a binary function between adjacent elements
9024 +of a list.
9025
9026 \DESCRIBE
9027 -{\small\verb%itlist2 f ([x1;...;xn],[y1;...;yn]) z%} returns
9028 +{\small\verb%itlist f [x1;...;xn] y%} returns
9029 {\par\samepage\setseps\small
9030 \begin{verbatim}
9031 - f (x1,y1) (f (x2,y2) ... (f (xn,yn) z)...)
9032 + f x1 (f x2 ... (f xn y)...)
9033 \end{verbatim}
9034 }
9035 -\noindent It returns {\small\verb%z%} if both lists are empty.
9036 +\noindent It returns {\small\verb%y%} if list is empty.
9037
9038 \FAILURE
9039 -Fails with {\small\verb%itlist2%} if the two lists are of different lengths.
9040 +Never fails.
9041
9042 \EXAMPLE
9043 {\par\samepage\setseps\small
9044 \begin{verbatim}
9045 -#itlist2 (\(x,y) z. (x * y) + z) ([1;2],[3;4]) 0;;
9046 -11 : int
9047 +#itlist (\x y. x + y) [1;2;3;4] 0;;
9048 +10 : int
9049 \end{verbatim}
9050 }
9051 \SEEALSO
9052 -itlist, rev_itlist, end_itlist, uncurry.
9053 +rev_itlist, end_itlist.
9054
9055 \ENDDOC
9056 \DOC{K}
9057 @@ -12672,6 +12670,34 @@ Never fails.
9058 \#, B, C, CB, Co, I, K, o, oo, S, W.
9059
9060 \ENDDOC
9061 +\DOC{LAST\_CONV}
9062 +
9063 +\TYPE {\small\verb%LAST_CONV : conv%}\egroup
9064 +
9065 +\SYNOPSIS
9066 +Computes by inference the result of taking the last element of a list.
9067 +
9068 +\DESCRIBE
9069 +For any object language list of the form {\small\verb%"[x0;...x(n-1)]"%} ,
9070 +the result of evaluating
9071 +{\par\samepage\setseps\small
9072 +\begin{verbatim}
9073 + LAST_CONV "LAST [x0;...;x(n-1)]"
9074 +\end{verbatim}
9075 +}
9076 +\noindent is the theorem
9077 +{\par\samepage\setseps\small
9078 +\begin{verbatim}
9079 + |- LAST [x0;...;x(n-1)] = x(n-1)
9080 +\end{verbatim}
9081 +}
9082 +
9083 +
9084 +\FAILURE
9085 +{\small\verb%LAST_CONV tm%} fails if {\small\verb%tm%} is an empty list.
9086 +
9087 +\ENDDOC
9088 +
9089 \DOC{last}
9090
9091 \TYPE {\small\verb%last : (* list -> *)%}\egroup
9092 @@ -12718,34 +12744,6 @@ or {\small\verb%k%} is greater than the
9093
9094 \ENDDOC
9095
9096 -\DOC{LAST\_CONV}
9097 -
9098 -\TYPE {\small\verb%LAST_CONV : conv%}\egroup
9099 -
9100 -\SYNOPSIS
9101 -Computes by inference the result of taking the last element of a list.
9102 -
9103 -\DESCRIBE
9104 -For any object language list of the form {\small\verb%"[x0;...x(n-1)]"%} ,
9105 -the result of evaluating
9106 -{\par\samepage\setseps\small
9107 -\begin{verbatim}
9108 - LAST_CONV "LAST [x0;...;x(n-1)]"
9109 -\end{verbatim}
9110 -}
9111 -\noindent is the theorem
9112 -{\par\samepage\setseps\small
9113 -\begin{verbatim}
9114 - |- LAST [x0;...;x(n-1)] = x(n-1)
9115 -\end{verbatim}
9116 -}
9117 -
9118 -
9119 -\FAILURE
9120 -{\small\verb%LAST_CONV tm%} fails if {\small\verb%tm%} is an empty list.
9121 -
9122 -\ENDDOC
9123 -
9124 \DOC{LEFT\_AND\_EXISTS\_CONV}
9125
9126 \TYPE {\small\verb%LEFT_AND_EXISTS_CONV : conv%}\egroup
9127 @@ -12902,17 +12900,6 @@ Fails if applied to a term not of the fo
9128 OR_FORALL_CONV, FORALL_OR_CONV, RIGHT_OR_FORALL_CONV.
9129
9130 \ENDDOC
9131 -\DOC{length}
9132 -
9133 -\TYPE {\small\verb%length : (* list -> int)%}\egroup
9134 -
9135 -\SYNOPSIS
9136 -Computes the length of a list: {\small\verb%length [x1;...;xn]%} returns {\small\verb%n%}.
9137 -
9138 -\FAILURE
9139 -Never fails.
9140 -
9141 -\ENDDOC
9142 \DOC{LENGTH\_CONV}
9143
9144 \TYPE {\small\verb%LENGTH_CONV : conv%}\egroup
9145 @@ -12938,8 +12925,19 @@ For any object language list of the form
9146 list.
9147
9148 \FAILURE
9149 -{\small\verb%LENGTH_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"LENGTH [x1;x2;...;xn]"%} or
9150 -{\small\verb%"LENGTH []"%}.
9151 +{\small\verb%LENGTH_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"LENGTH [x1;x2;...;xn]"%} or
9152 +{\small\verb%"LENGTH []"%}.
9153 +
9154 +\ENDDOC
9155 +\DOC{length}
9156 +
9157 +\TYPE {\small\verb%length : (* list -> int)%}\egroup
9158 +
9159 +\SYNOPSIS
9160 +Computes the length of a list: {\small\verb%length [x1;...;xn]%} returns {\small\verb%n%}.
9161 +
9162 +\FAILURE
9163 +Never fails.
9164
9165 \ENDDOC
9166 \DOC{let\_after}
9167 @@ -13418,6 +13416,25 @@ systems.
9168 system, unlink.
9169
9170 \ENDDOC
9171 +\DOC{lisp\_dir\_pathname}
9172 +
9173 +\TYPE {\small\verb%lisp_dir_pathname : string%}\egroup
9174 +
9175 +\SYNOPSIS
9176 +Absolute pathname to the HOL lisp sources.
9177 +
9178 +\DESCRIBE
9179 +For implementation reasons, the ML variable {\small\verb%lisp_dir_pathname%} is bound when
9180 +the system if built to a string giving the absolute pathname of the directory
9181 +containing the HOL lisp sources. This value is not for general use.
9182 +
9183 +\FAILURE
9184 +Evaluating {\small\verb%lisp_dir_pathname%} never fails.
9185 +
9186 +\SEEALSO
9187 +ml_dir_pathname.
9188 +
9189 +\ENDDOC
9190 \DOC{lisp}
9191
9192 \TYPE {\small\verb%lisp : (string -> void)%}\egroup
9193 @@ -13464,25 +13481,6 @@ using it.
9194 dropout, lsp.
9195
9196 \ENDDOC
9197 -\DOC{lisp\_dir\_pathname}
9198 -
9199 -\TYPE {\small\verb%lisp_dir_pathname : string%}\egroup
9200 -
9201 -\SYNOPSIS
9202 -Absolute pathname to the HOL lisp sources.
9203 -
9204 -\DESCRIBE
9205 -For implementation reasons, the ML variable {\small\verb%lisp_dir_pathname%} is bound when
9206 -the system if built to a string giving the absolute pathname of the directory
9207 -containing the HOL lisp sources. This value is not for general use.
9208 -
9209 -\FAILURE
9210 -Evaluating {\small\verb%lisp_dir_pathname%} never fails.
9211 -
9212 -\SEEALSO
9213 -ml_dir_pathname.
9214 -
9215 -\ENDDOC
9216 \DOC{LIST\_BETA\_CONV}
9217
9218 \TYPE {\small\verb%LIST_BETA_CONV : conv%}\egroup
9219 @@ -13855,6 +13853,28 @@ evaluation failed list_mk_disj
9220 disjuncts, mk_disj.
9221
9222 \ENDDOC
9223 +\DOC{list\_mk\_exists}
9224 +
9225 +\TYPE {\small\verb%list_mk_exists : ((term list # term) -> term)%}\egroup
9226 +
9227 +\SYNOPSIS
9228 +Iteratively constructs existential quantifications.
9229 +
9230 +\DESCRIBE
9231 +{\small\verb%list_mk_exists(["x1";...;"xn"],"t")%} returns {\small\verb%"?x1 ... xn. t"%}.
9232 +
9233 +\FAILURE
9234 +Fails with {\small\verb%list_mk_exists%} if the terms in the list are not variables or if
9235 +{\small\verb%t%} is not of type {\small\verb%":bool"%} and the list of terms is non-empty. If the list
9236 +of terms is empty the type of {\small\verb%t%} can be anything.
9237 +
9238 +\COMMENTS
9239 +The system shows the type as {\small\verb%(goal -> term)%}.
9240 +
9241 +\SEEALSO
9242 +strip_exists, mk_exists.
9243 +
9244 +\ENDDOC
9245 \DOC{LIST\_MK\_EXISTS}
9246
9247 \TYPE {\small\verb%LIST_MK_EXISTS : (term list -> thm -> thm)%}\egroup
9248 @@ -13884,28 +13904,6 @@ list, or if the theorem is not equationa
9249 EXISTS_EQ, MK_EXISTS.
9250
9251 \ENDDOC
9252 -\DOC{list\_mk\_exists}
9253 -
9254 -\TYPE {\small\verb%list_mk_exists : ((term list # term) -> term)%}\egroup
9255 -
9256 -\SYNOPSIS
9257 -Iteratively constructs existential quantifications.
9258 -
9259 -\DESCRIBE
9260 -{\small\verb%list_mk_exists(["x1";...;"xn"],"t")%} returns {\small\verb%"?x1 ... xn. t"%}.
9261 -
9262 -\FAILURE
9263 -Fails with {\small\verb%list_mk_exists%} if the terms in the list are not variables or if
9264 -{\small\verb%t%} is not of type {\small\verb%":bool"%} and the list of terms is non-empty. If the list
9265 -of terms is empty the type of {\small\verb%t%} can be anything.
9266 -
9267 -\COMMENTS
9268 -The system shows the type as {\small\verb%(goal -> term)%}.
9269 -
9270 -\SEEALSO
9271 -strip_exists, mk_exists.
9272 -
9273 -\ENDDOC
9274 \DOC{list\_mk\_forall}
9275
9276 \TYPE {\small\verb%list_mk_forall : ((term list # term) -> term)%}\egroup
9277 @@ -14035,115 +14033,6 @@ is not for general use, and users should
9278 Evaluating the assignable variable {\small\verb%list_of_binders%} never fails.
9279
9280 \ENDDOC
9281 -\DOC{load}
9282 -
9283 -\TYPE {\small\verb%load : ((string # bool) -> void)%}\egroup
9284 -
9285 -\SYNOPSIS
9286 -Loads ML phrases from the named file.
9287 -
9288 -\DESCRIBE
9289 -A call {\small\verb%load(`file`,flag)%} will load ML phrases from the file described by
9290 -{\small\verb%file%}. If the boolean value {\small\verb%flag%} is true, then toplevel printing of the
9291 -system responses will occur, otherwise just a dot is printed for each toplevel
9292 -phrase. The name {\small\verb%file%} is expanded into a real filename using the same
9293 -mechanism as {\small\verb%find_ml_file%}.
9294 -
9295 -\FAILURE
9296 -Fails if the appropriate file cannot be found on the search path, or if an
9297 -error occurs in the ML which is being loaded.
9298 -
9299 -\COMMENTS
9300 -It is usual to use either {\small\verb%loadf%} or {\small\verb%loadt%} rather than this function, which
9301 -perform the same action with one or the other setting of the flag.
9302 -
9303 -\SEEALSO
9304 -find_ml_file, loadf, loadt, search_path, set_search_path.
9305 -
9306 -\ENDDOC
9307 -\DOC{loadf}
9308 -
9309 -\TYPE {\small\verb%loadf : (string -> void)%}\egroup
9310 -
9311 -\SYNOPSIS
9312 -Loads an ML file with the verbose flag set to {\small\verb%false%}.
9313 -
9314 -\DESCRIBE
9315 -The function {\small\verb%loadf%} takes a string indicating the ML file name as
9316 -argument and loads it in the same manner as {\small\verb%load%}, except that the
9317 -verbose flag is always set to false.
9318 -
9319 -\FAILURE
9320 -{\small\verb%loadf%} will fail if the file named by the argument does not exist in
9321 -the search path. It will fail in the same manner if the file is not a
9322 -valid ML file. Failure in the ML file will terminate loading.
9323 -
9324 -\EXAMPLE
9325 -If we have a ML file called {\small\verb%foo.ml%} which contains the line
9326 -{\par\samepage\setseps\small
9327 -\begin{verbatim}
9328 - let x=2+2;;
9329 -\end{verbatim}
9330 -}
9331 -\noindent this can be loaded as follows:
9332 -{\par\samepage\setseps\small
9333 -\begin{verbatim}
9334 - #loadf `foo.ml`;;
9335 -\end{verbatim}
9336 -}
9337 -\noindent and the system would respond with:
9338 -{\par\samepage\setseps\small
9339 -\begin{verbatim}
9340 - .() : void
9341 -\end{verbatim}
9342 -}
9343 -\SEEALSO
9344 -load, loadf.
9345 -
9346 -\ENDDOC
9347 -\DOC{loadt}
9348 -
9349 -\TYPE {\small\verb%loadt : (string -> void)%}\egroup
9350 -
9351 -\SYNOPSIS
9352 -{\small\verb%loadt%} loads an ML file with the verbose flag set to {\small\verb%true%}.
9353 -
9354 -\DESCRIBE
9355 -The function {\small\verb%loadt%} takes a string indicating the ML file name as
9356 -argument and loads it in the same manner as {\small\verb%load%}, except that the
9357 -verbose flag is always set to {\small\verb%true%}.
9358 -
9359 -\FAILURE
9360 -{\small\verb%loadt%} will fail if the file named by the argument does not exist in
9361 -the search path. It will fail in the same manner if the file is not a
9362 -valid ML file. Failure in the ML file will also terminate loading.
9363 -
9364 -\EXAMPLE
9365 -If we have an ML file called {\small\verb%foo.ml%} which contains the line
9366 -{\par\samepage\setseps\small
9367 -\begin{verbatim}
9368 - let x=2+2;;
9369 -\end{verbatim}
9370 -}
9371 -\noindent this can be loaded as follows:
9372 -{\par\samepage\setseps\small
9373 -\begin{verbatim}
9374 - #loadt `foo.ml`;;
9375 -\end{verbatim}
9376 -}
9377 -\noindent and the system would respond with:
9378 -{\par\samepage\setseps\small
9379 -\begin{verbatim}
9380 - x = 4 : int
9381 -
9382 - File foo.ml loaded
9383 - () : void
9384 -\end{verbatim}
9385 -}
9386 -\SEEALSO
9387 -load, loadf.
9388 -
9389 -\ENDDOC
9390 \DOC{load\_axiom}
9391
9392 \TYPE {\small\verb%load_axiom : (string -> string -> void)%}\egroup
9393 @@ -14320,7 +14209,73 @@ o_DEF = |- !f g. f o g = (\x. f(g x))
9394 \end{verbatim}
9395 }
9396 \SEEALSO
9397 -definitions, let_after, let_before, load_definition.
9398 +definitions, let_after, let_before, load_definition.
9399 +
9400 +\ENDDOC
9401 +\DOC{load}
9402 +
9403 +\TYPE {\small\verb%load : ((string # bool) -> void)%}\egroup
9404 +
9405 +\SYNOPSIS
9406 +Loads ML phrases from the named file.
9407 +
9408 +\DESCRIBE
9409 +A call {\small\verb%load(`file`,flag)%} will load ML phrases from the file described by
9410 +{\small\verb%file%}. If the boolean value {\small\verb%flag%} is true, then toplevel printing of the
9411 +system responses will occur, otherwise just a dot is printed for each toplevel
9412 +phrase. The name {\small\verb%file%} is expanded into a real filename using the same
9413 +mechanism as {\small\verb%find_ml_file%}.
9414 +
9415 +\FAILURE
9416 +Fails if the appropriate file cannot be found on the search path, or if an
9417 +error occurs in the ML which is being loaded.
9418 +
9419 +\COMMENTS
9420 +It is usual to use either {\small\verb%loadf%} or {\small\verb%loadt%} rather than this function, which
9421 +perform the same action with one or the other setting of the flag.
9422 +
9423 +\SEEALSO
9424 +find_ml_file, loadf, loadt, search_path, set_search_path.
9425 +
9426 +\ENDDOC
9427 +\DOC{loadf}
9428 +
9429 +\TYPE {\small\verb%loadf : (string -> void)%}\egroup
9430 +
9431 +\SYNOPSIS
9432 +Loads an ML file with the verbose flag set to {\small\verb%false%}.
9433 +
9434 +\DESCRIBE
9435 +The function {\small\verb%loadf%} takes a string indicating the ML file name as
9436 +argument and loads it in the same manner as {\small\verb%load%}, except that the
9437 +verbose flag is always set to false.
9438 +
9439 +\FAILURE
9440 +{\small\verb%loadf%} will fail if the file named by the argument does not exist in
9441 +the search path. It will fail in the same manner if the file is not a
9442 +valid ML file. Failure in the ML file will terminate loading.
9443 +
9444 +\EXAMPLE
9445 +If we have a ML file called {\small\verb%foo.ml%} which contains the line
9446 +{\par\samepage\setseps\small
9447 +\begin{verbatim}
9448 + let x=2+2;;
9449 +\end{verbatim}
9450 +}
9451 +\noindent this can be loaded as follows:
9452 +{\par\samepage\setseps\small
9453 +\begin{verbatim}
9454 + #loadf `foo.ml`;;
9455 +\end{verbatim}
9456 +}
9457 +\noindent and the system would respond with:
9458 +{\par\samepage\setseps\small
9459 +\begin{verbatim}
9460 + .() : void
9461 +\end{verbatim}
9462 +}
9463 +\SEEALSO
9464 +load, loadf.
9465
9466 \ENDDOC
9467 \DOC{load\_library}
9468 @@ -14395,6 +14350,49 @@ libraries currently in the standard HOL
9469 libraries, library_pathname, library_search_path, set_library_search_path.
9470
9471 \ENDDOC
9472 +\DOC{loadt}
9473 +
9474 +\TYPE {\small\verb%loadt : (string -> void)%}\egroup
9475 +
9476 +\SYNOPSIS
9477 +{\small\verb%loadt%} loads an ML file with the verbose flag set to {\small\verb%true%}.
9478 +
9479 +\DESCRIBE
9480 +The function {\small\verb%loadt%} takes a string indicating the ML file name as
9481 +argument and loads it in the same manner as {\small\verb%load%}, except that the
9482 +verbose flag is always set to {\small\verb%true%}.
9483 +
9484 +\FAILURE
9485 +{\small\verb%loadt%} will fail if the file named by the argument does not exist in
9486 +the search path. It will fail in the same manner if the file is not a
9487 +valid ML file. Failure in the ML file will also terminate loading.
9488 +
9489 +\EXAMPLE
9490 +If we have an ML file called {\small\verb%foo.ml%} which contains the line
9491 +{\par\samepage\setseps\small
9492 +\begin{verbatim}
9493 + let x=2+2;;
9494 +\end{verbatim}
9495 +}
9496 +\noindent this can be loaded as follows:
9497 +{\par\samepage\setseps\small
9498 +\begin{verbatim}
9499 + #loadt `foo.ml`;;
9500 +\end{verbatim}
9501 +}
9502 +\noindent and the system would respond with:
9503 +{\par\samepage\setseps\small
9504 +\begin{verbatim}
9505 + x = 4 : int
9506 +
9507 + File foo.ml loaded
9508 + () : void
9509 +\end{verbatim}
9510 +}
9511 +\SEEALSO
9512 +load, loadf.
9513 +
9514 +\ENDDOC
9515 \DOC{load\_theorem}
9516
9517 \TYPE {\small\verb%load_theorem : (string -> string -> void)%}\egroup
9518 @@ -14584,54 +14582,6 @@ using it.
9519 dropout, lisp.
9520
9521 \ENDDOC
9522 -\DOC{map}
9523 -
9524 -\TYPE {\small\verb%map : ((* -> **) -> * list -> ** list)%}\egroup
9525 -
9526 -\SYNOPSIS
9527 -Applies a function to every element of a list.
9528 -
9529 -\DESCRIBE
9530 -{\small\verb%map f [x1;...;xn]%} returns {\small\verb%[(f x1);...;(f xn)]%}.
9531 -
9532 -\FAILURE
9533 -Never fails.
9534 -
9535 -\EXAMPLE
9536 -{\par\samepage\setseps\small
9537 -\begin{verbatim}
9538 -#map (\x. x * 2) [];;
9539 -[] : int list
9540 -
9541 -#map (\x. x * 2) [1;2;3];;
9542 -[2; 4; 6] : int list
9543 -\end{verbatim}
9544 -}
9545 -\ENDDOC
9546 -\DOC{map2}
9547 -
9548 -\TYPE {\small\verb%map2 : (((* # **) -> ***) -> (* list # ** list) -> *** list)%}\egroup
9549 -
9550 -\SYNOPSIS
9551 -Maps a binary function over two lists to create one new list.
9552 -
9553 -\DESCRIBE
9554 -{\small\verb%map2 f ([x1;...;xn],[y1;...;yn])%} returns {\small\verb%[f(x1,y1);...;f(xn,yn)]%}.
9555 -
9556 -\FAILURE
9557 -Fails with {\small\verb%map2%} if the two lists are of different lengths.
9558 -
9559 -\EXAMPLE
9560 -{\par\samepage\setseps\small
9561 -\begin{verbatim}
9562 -#map2 $+ ([1;2;3],[3;2;1]);;
9563 -[4; 4; 4] : int list
9564 -\end{verbatim}
9565 -}
9566 -\SEEALSO
9567 -map, uncurry.
9568 -
9569 -\ENDDOC
9570 \DOC{MAP2\_CONV}
9571
9572 \TYPE {\small\verb%MAP2_CONV : conv -> conv%}\egroup
9573 @@ -14685,62 +14635,28 @@ MAP_CONV
9574
9575 \ENDDOC
9576
9577 -\DOC{mapfilter}
9578 -
9579 -\TYPE {\small\verb%mapfilter : ((* -> **) -> * list -> ** list)%}\egroup
9580 -
9581 -\SYNOPSIS
9582 -Applies a function to every element of a list, returning a list of results
9583 -for those elements for which application succeeds.
9584 -
9585 -\FAILURE
9586 -Never fails.
9587 -
9588 -\EXAMPLE
9589 -{\par\samepage\setseps\small
9590 -\begin{verbatim}
9591 -#mapfilter hd [[1;2;3];[4;5];[];[6;7;8];[]];;
9592 -[1; 4; 6] : int list
9593 -\end{verbatim}
9594 -}
9595 -\SEEALSO
9596 -filter, map.
9597 -
9598 -\ENDDOC
9599 -\DOC{maptok}
9600 +\DOC{map2}
9601
9602 -\TYPE {\small\verb%maptok : ((string -> *) -> string -> * list)%}\egroup
9603 +\TYPE {\small\verb%map2 : (((* # **) -> ***) -> (* list # ** list) -> *** list)%}\egroup
9604
9605 \SYNOPSIS
9606 -Maps a function over the constituent words of a string.
9607 +Maps a binary function over two lists to create one new list.
9608
9609 \DESCRIBE
9610 -{\small\verb%maptok f s%} first splits the string {\small\verb%s%} into a list of substrings, and then
9611 -maps the function {\small\verb%f%} over that list. Splitting of the string occurs at each
9612 -sequence of blanks and carriage returns (white space). This white space does
9613 -not appear in the list of substrings. Leading and trailing white space in the
9614 -input string is also thrown away.
9615 +{\small\verb%map2 f ([x1;...;xn],[y1;...;yn])%} returns {\small\verb%[f(x1,y1);...;f(xn,yn)]%}.
9616
9617 \FAILURE
9618 -Fails if one of the applications of {\small\verb%f%} to a substring fails.
9619 +Fails with {\small\verb%map2%} if the two lists are of different lengths.
9620
9621 \EXAMPLE
9622 {\par\samepage\setseps\small
9623 \begin{verbatim}
9624 -#maptok explode ` the cat sat `;;
9625 -[[`t`; `h`; `e`]; [`c`; `a`; `t`]; [`s`; `a`; `t`]] : string list list
9626 -\end{verbatim}
9627 -}
9628 -\USES
9629 -Useful when wanting to map a function over a list of constant strings.
9630 -Instead of using {\small\verb%map f [`string1`;...;`stringn`]%} one can use:
9631 -{\par\samepage\setseps\small
9632 -\begin{verbatim}
9633 - (maptok f `string1 ... stringn`)
9634 +#map2 $+ ([1;2;3],[3;2;1]);;
9635 +[4; 4; 4] : int list
9636 \end{verbatim}
9637 }
9638 \SEEALSO
9639 -words, word_separators, words2, map.
9640 +map, uncurry.
9641
9642 \ENDDOC
9643 \DOC{MAP\_CONV}
9644 @@ -14819,6 +14735,30 @@ evaluating {\small\verb%conv "f ti"%} re
9645
9646 \ENDDOC
9647
9648 +\DOC{map}
9649 +
9650 +\TYPE {\small\verb%map : ((* -> **) -> * list -> ** list)%}\egroup
9651 +
9652 +\SYNOPSIS
9653 +Applies a function to every element of a list.
9654 +
9655 +\DESCRIBE
9656 +{\small\verb%map f [x1;...;xn]%} returns {\small\verb%[(f x1);...;(f xn)]%}.
9657 +
9658 +\FAILURE
9659 +Never fails.
9660 +
9661 +\EXAMPLE
9662 +{\par\samepage\setseps\small
9663 +\begin{verbatim}
9664 +#map (\x. x * 2) [];;
9665 +[] : int list
9666 +
9667 +#map (\x. x * 2) [1;2;3];;
9668 +[2; 4; 6] : int list
9669 +\end{verbatim}
9670 +}
9671 +\ENDDOC
9672 \DOC{MAP\_EVERY}
9673
9674 \TYPE {\small\verb%MAP_EVERY : ((* -> tactic) -> * list -> tactic)%}\egroup
9675 @@ -14848,41 +14788,148 @@ resulting tactic fails iff any of the re
9676 A convenient way of doing case analysis over several boolean variables is:
9677 {\par\samepage\setseps\small
9678 \begin{verbatim}
9679 - MAP_EVERY BOOL_CASES_TAC ["var1:bool";...;"varn:bool"]
9680 + MAP_EVERY BOOL_CASES_TAC ["var1:bool";...;"varn:bool"]
9681 +\end{verbatim}
9682 +}
9683 +\SEEALSO
9684 +EVERY, FIRST, MAP_FIRST, THEN.
9685 +
9686 +\ENDDOC
9687 +\DOC{mapfilter}
9688 +
9689 +\TYPE {\small\verb%mapfilter : ((* -> **) -> * list -> ** list)%}\egroup
9690 +
9691 +\SYNOPSIS
9692 +Applies a function to every element of a list, returning a list of results
9693 +for those elements for which application succeeds.
9694 +
9695 +\FAILURE
9696 +Never fails.
9697 +
9698 +\EXAMPLE
9699 +{\par\samepage\setseps\small
9700 +\begin{verbatim}
9701 +#mapfilter hd [[1;2;3];[4;5];[];[6;7;8];[]];;
9702 +[1; 4; 6] : int list
9703 +\end{verbatim}
9704 +}
9705 +\SEEALSO
9706 +filter, map.
9707 +
9708 +\ENDDOC
9709 +\DOC{MAP\_FIRST}
9710 +
9711 +\TYPE {\small\verb%MAP_FIRST : ((* -> tactic) -> * list -> tactic)%}\egroup
9712 +
9713 +\SYNOPSIS
9714 +Applies first tactic that succeeds in a list given by mapping a function over a
9715 +list.
9716 +
9717 +\DESCRIBE
9718 +When applied to a tactic-producing function {\small\verb%f%} and an operand list
9719 +{\small\verb%[x1;...;xn]%}, the elements of which have the same type as {\small\verb%f%}'s domain
9720 +type, {\small\verb%MAP_FIRST%} maps the function {\small\verb%f%} over the list, producing a list of
9721 +tactics, then tries applying these tactics to the goal till one succeeds.
9722 +If {\small\verb%f(xm)%} is the first to succeed, then the overall effect is the same
9723 +as applying {\small\verb%f(xm)%}. Thus:
9724 +{\par\samepage\setseps\small
9725 +\begin{verbatim}
9726 + MAP_FIRST f [x1;...;xn] = (f x1) ORELSE ... ORELSE (f xn)
9727 +\end{verbatim}
9728 +}
9729 +\FAILURE
9730 +The application of {\small\verb%MAP_FIRST%} to a function and tactic list fails iff
9731 +the function does when applied to any of the elements of the list. The
9732 +resulting tactic fails iff all the resulting tactics fail when
9733 +applied to the goal.
9734 +
9735 +\SEEALSO
9736 +EVERY, FIRST, MAP_EVERY, ORELSE.
9737 +
9738 +\ENDDOC
9739 +\DOC{maptok}
9740 +
9741 +\TYPE {\small\verb%maptok : ((string -> *) -> string -> * list)%}\egroup
9742 +
9743 +\SYNOPSIS
9744 +Maps a function over the constituent words of a string.
9745 +
9746 +\DESCRIBE
9747 +{\small\verb%maptok f s%} first splits the string {\small\verb%s%} into a list of substrings, and then
9748 +maps the function {\small\verb%f%} over that list. Splitting of the string occurs at each
9749 +sequence of blanks and carriage returns (white space). This white space does
9750 +not appear in the list of substrings. Leading and trailing white space in the
9751 +input string is also thrown away.
9752 +
9753 +\FAILURE
9754 +Fails if one of the applications of {\small\verb%f%} to a substring fails.
9755 +
9756 +\EXAMPLE
9757 +{\par\samepage\setseps\small
9758 +\begin{verbatim}
9759 +#maptok explode ` the cat sat `;;
9760 +[[`t`; `h`; `e`]; [`c`; `a`; `t`]; [`s`; `a`; `t`]] : string list list
9761 +\end{verbatim}
9762 +}
9763 +\USES
9764 +Useful when wanting to map a function over a list of constant strings.
9765 +Instead of using {\small\verb%map f [`string1`;...;`stringn`]%} one can use:
9766 +{\par\samepage\setseps\small
9767 +\begin{verbatim}
9768 + (maptok f `string1 ... stringn`)
9769 \end{verbatim}
9770 }
9771 \SEEALSO
9772 -EVERY, FIRST, MAP_FIRST, THEN.
9773 +words, word_separators, words2, map.
9774
9775 \ENDDOC
9776 -\DOC{MAP\_FIRST}
9777 +\DOC{MATCH\_ACCEPT\_TAC}
9778
9779 -\TYPE {\small\verb%MAP_FIRST : ((* -> tactic) -> * list -> tactic)%}\egroup
9780 +\TYPE {\small\verb%MATCH_ACCEPT_TAC : thm_tactic%}\egroup
9781
9782 \SYNOPSIS
9783 -Applies first tactic that succeeds in a list given by mapping a function over a
9784 -list.
9785 +Solves a goal which is an instance of the supplied theorem.
9786
9787 \DESCRIBE
9788 -When applied to a tactic-producing function {\small\verb%f%} and an operand list
9789 -{\small\verb%[x1;...;xn]%}, the elements of which have the same type as {\small\verb%f%}'s domain
9790 -type, {\small\verb%MAP_FIRST%} maps the function {\small\verb%f%} over the list, producing a list of
9791 -tactics, then tries applying these tactics to the goal till one succeeds.
9792 -If {\small\verb%f(xm)%} is the first to succeed, then the overall effect is the same
9793 -as applying {\small\verb%f(xm)%}. Thus:
9794 +When given a theorem {\small\verb%A' |- t%} and a goal {\small\verb%A ?- t'%} where {\small\verb%t%} can be matched
9795 +to {\small\verb%t'%} by instantiating variables which are either free or
9796 +universally quantified at the outer level, including appropriate type
9797 +instantiation, {\small\verb%MATCH_ACCEPT_TAC%} completely solves the goal.
9798 {\par\samepage\setseps\small
9799 \begin{verbatim}
9800 - MAP_FIRST f [x1;...;xn] = (f x1) ORELSE ... ORELSE (f xn)
9801 + A ?- t'
9802 + ========= MATCH_ACCEPT_TAC (A' |- t)
9803 +
9804 \end{verbatim}
9805 }
9806 +\noindent Unless {\small\verb%A'%} is a subset of {\small\verb%A%}, this is an invalid tactic.
9807 +
9808 \FAILURE
9809 -The application of {\small\verb%MAP_FIRST%} to a function and tactic list fails iff
9810 -the function does when applied to any of the elements of the list. The
9811 -resulting tactic fails iff all the resulting tactics fail when
9812 -applied to the goal.
9813 +Fails unless the theorem has a conclusion which is instantiable to match that
9814 +of the goal.
9815
9816 +\EXAMPLE
9817 +The following example shows variable and type instantiation at work. We can use
9818 +the polymorphic list theorem {\small\verb%HD%}:
9819 +{\par\samepage\setseps\small
9820 +\begin{verbatim}
9821 + HD = |- !h t. HD(CONS h t) = h
9822 +\end{verbatim}
9823 +}
9824 +\noindent to solve the goal:
9825 +{\par\samepage\setseps\small
9826 +\begin{verbatim}
9827 + ?- HD [1;2] = 1
9828 +\end{verbatim}
9829 +}
9830 +\noindent simply by:
9831 +{\par\samepage\setseps\small
9832 +\begin{verbatim}
9833 + MATCH_ACCEPT_TAC HD
9834 +\end{verbatim}
9835 +}
9836 \SEEALSO
9837 -EVERY, FIRST, MAP_EVERY, ORELSE.
9838 +ACCEPT_TAC.
9839
9840 \ENDDOC
9841 \DOC{match}
9842 @@ -14946,55 +14993,6 @@ type) which need to be instantiated may
9843 INST_TY_TERM, PART_MATCH.
9844
9845 \ENDDOC
9846 -\DOC{MATCH\_ACCEPT\_TAC}
9847 -
9848 -\TYPE {\small\verb%MATCH_ACCEPT_TAC : thm_tactic%}\egroup
9849 -
9850 -\SYNOPSIS
9851 -Solves a goal which is an instance of the supplied theorem.
9852 -
9853 -\DESCRIBE
9854 -When given a theorem {\small\verb%A' |- t%} and a goal {\small\verb%A ?- t'%} where {\small\verb%t%} can be matched
9855 -to {\small\verb%t'%} by instantiating variables which are either free or
9856 -universally quantified at the outer level, including appropriate type
9857 -instantiation, {\small\verb%MATCH_ACCEPT_TAC%} completely solves the goal.
9858 -{\par\samepage\setseps\small
9859 -\begin{verbatim}
9860 - A ?- t'
9861 - ========= MATCH_ACCEPT_TAC (A' |- t)
9862 -
9863 -\end{verbatim}
9864 -}
9865 -\noindent Unless {\small\verb%A'%} is a subset of {\small\verb%A%}, this is an invalid tactic.
9866 -
9867 -\FAILURE
9868 -Fails unless the theorem has a conclusion which is instantiable to match that
9869 -of the goal.
9870 -
9871 -\EXAMPLE
9872 -The following example shows variable and type instantiation at work. We can use
9873 -the polymorphic list theorem {\small\verb%HD%}:
9874 -{\par\samepage\setseps\small
9875 -\begin{verbatim}
9876 - HD = |- !h t. HD(CONS h t) = h
9877 -\end{verbatim}
9878 -}
9879 -\noindent to solve the goal:
9880 -{\par\samepage\setseps\small
9881 -\begin{verbatim}
9882 - ?- HD [1;2] = 1
9883 -\end{verbatim}
9884 -}
9885 -\noindent simply by:
9886 -{\par\samepage\setseps\small
9887 -\begin{verbatim}
9888 - MATCH_ACCEPT_TAC HD
9889 -\end{verbatim}
9890 -}
9891 -\SEEALSO
9892 -ACCEPT_TAC.
9893 -
9894 -\ENDDOC
9895 \DOC{MATCH\_MP}
9896
9897 \TYPE {\small\verb%MATCH_MP : (thm -> thm -> thm)%}\egroup
9898 @@ -15188,6 +15186,23 @@ This is an example
9899 print_string, print_tok, print_begin, print_end, print_newline.
9900
9901 \ENDDOC
9902 +\DOC{mk\_abs}
9903 +
9904 +\TYPE {\small\verb%mk_abs : ((term # term) -> term)%}\egroup
9905 +
9906 +\SYNOPSIS
9907 +Constructs an abstraction.
9908 +
9909 +\DESCRIBE
9910 +{\small\verb%mk_abs "var","t"%} returns the abstraction {\small\verb%"\var. t"%}.
9911 +
9912 +\FAILURE
9913 +Fails with {\small\verb%mk_abs%} if first term is not a variable.
9914 +
9915 +\SEEALSO
9916 +dest_abs, is_abs, list_mk_abs, mk_var, mk_const, mk_comb.
9917 +
9918 +\ENDDOC
9919 \DOC{MK\_ABS}
9920
9921 \TYPE {\small\verb%MK_ABS : (thm -> thm)%}\egroup
9922 @@ -15213,21 +15228,31 @@ Fails unless the theorem is a (singly) u
9923 ABS, HALF_MK_ABS, MK_COMB, MK_EXISTS.
9924
9925 \ENDDOC
9926 -\DOC{mk\_abs}
9927 +\DOC{mk\_comb}
9928
9929 -\TYPE {\small\verb%mk_abs : ((term # term) -> term)%}\egroup
9930 +\TYPE {\small\verb%mk_comb : ((term # term) -> term)%}\egroup
9931
9932 \SYNOPSIS
9933 -Constructs an abstraction.
9934 +Constructs a combination (function application).
9935
9936 \DESCRIBE
9937 -{\small\verb%mk_abs "var","t"%} returns the abstraction {\small\verb%"\var. t"%}.
9938 +{\small\verb%mk_comb "t1","t2"%} returns the combination {\small\verb%"t1 t2"%}.
9939
9940 \FAILURE
9941 -Fails with {\small\verb%mk_abs%} if first term is not a variable.
9942 +Fails with {\small\verb%mk_comb%} unless {\small\verb%t1%} is a function with domain type {\small\verb%t2%}.
9943 +
9944 +\EXAMPLE
9945 +{\par\samepage\setseps\small
9946 +\begin{verbatim}
9947 +#mk_comb("$~","T");;
9948 +"~T" : term
9949
9950 +#mk_comb("T","T");;
9951 +evaluation failed mk_comb
9952 +\end{verbatim}
9953 +}
9954 \SEEALSO
9955 -dest_abs, is_abs, list_mk_abs, mk_var, mk_const, mk_comb.
9956 +dest_comb, is_comb, list_mk_comb, mk_var, mk_const, mk_abs.
9957
9958 \ENDDOC
9959 \DOC{MK\_COMB}
9960 @@ -15257,33 +15282,6 @@ respectively.
9961 AP_TERM, AP_THM.
9962
9963 \ENDDOC
9964 -\DOC{mk\_comb}
9965 -
9966 -\TYPE {\small\verb%mk_comb : ((term # term) -> term)%}\egroup
9967 -
9968 -\SYNOPSIS
9969 -Constructs a combination (function application).
9970 -
9971 -\DESCRIBE
9972 -{\small\verb%mk_comb "t1","t2"%} returns the combination {\small\verb%"t1 t2"%}.
9973 -
9974 -\FAILURE
9975 -Fails with {\small\verb%mk_comb%} unless {\small\verb%t1%} is a function with domain type {\small\verb%t2%}.
9976 -
9977 -\EXAMPLE
9978 -{\par\samepage\setseps\small
9979 -\begin{verbatim}
9980 -#mk_comb("$~","T");;
9981 -"~T" : term
9982 -
9983 -#mk_comb("T","T");;
9984 -evaluation failed mk_comb
9985 -\end{verbatim}
9986 -}
9987 -\SEEALSO
9988 -dest_comb, is_comb, list_mk_comb, mk_var, mk_const, mk_abs.
9989 -
9990 -\ENDDOC
9991 \DOC{mk\_cond}
9992
9993 \TYPE {\small\verb%mk_cond : ((term # term # term) -> term)%}\egroup
9994 @@ -15421,6 +15419,24 @@ Fails with {\small\verb%mk_eq%} if {\sma
9995 dest_eq, is_eq.
9996
9997 \ENDDOC
9998 +\DOC{mk\_exists}
9999 +
10000 +\TYPE {\small\verb%mk_exists : ((term # term) -> term)%}\egroup
10001 +
10002 +\SYNOPSIS
10003 +Constructs an existential quantification.
10004 +
10005 +\DESCRIBE
10006 +{\small\verb%mk_exists("var","t")%} returns {\small\verb%"?var. t"%}.
10007 +
10008 +\FAILURE
10009 +Fails with {\small\verb%mk_exists%} if first term is not a variable or if {\small\verb%t%} is not of
10010 +type {\small\verb%":bool"%}.
10011 +
10012 +\SEEALSO
10013 +dest_exists, is_exists, list_mk_exists.
10014 +
10015 +\ENDDOC
10016 \DOC{MK\_EXISTS}
10017
10018 \TYPE {\small\verb%MK_EXISTS : (thm -> thm)%}\egroup
10019 @@ -15446,24 +15462,6 @@ Fails unless the theorem is a singly uni
10020 AP_TERM, EXISTS_EQ, GEN, LIST_MK_EXISTS, MK_ABS.
10021
10022 \ENDDOC
10023 -\DOC{mk\_exists}
10024 -
10025 -\TYPE {\small\verb%mk_exists : ((term # term) -> term)%}\egroup
10026 -
10027 -\SYNOPSIS
10028 -Constructs an existential quantification.
10029 -
10030 -\DESCRIBE
10031 -{\small\verb%mk_exists("var","t")%} returns {\small\verb%"?var. t"%}.
10032 -
10033 -\FAILURE
10034 -Fails with {\small\verb%mk_exists%} if first term is not a variable or if {\small\verb%t%} is not of
10035 -type {\small\verb%":bool"%}.
10036 -
10037 -\SEEALSO
10038 -dest_exists, is_exists, list_mk_exists.
10039 -
10040 -\ENDDOC
10041 \DOC{mk\_forall}
10042
10043 \TYPE {\small\verb%mk_forall : ((term # term) -> term)%}\egroup
10044 @@ -16111,58 +16109,23 @@ of that name in the current theory, or i
10045 \EXAMPLE
10046 {\par\samepage\setseps\small
10047 \begin{verbatim}
10048 -#new_theory `gurk`;;
10049 -() : void
10050 -
10051 -#new_axiom(`untrue`,"x = 1");;
10052 -|- !x. x = 1
10053 -\end{verbatim}
10054 -}
10055 -\COMMENTS
10056 -For most purposes, it is unnecessary to declare new axioms: all of classical
10057 -mathematics can be derived by definitional extension alone. Proceeding by
10058 -definition is not only more elegant, but also guarantees the consistency of the
10059 -deductions made. However, there are certain entities which cannot be modelled
10060 -in simple type theory without further axioms, such as higher transfinite
10061 -ordinals.
10062 -
10063 -\SEEALSO
10064 -mk_thm, new_definition.
10065 -
10066 -\ENDDOC
10067 -\DOC{new\_binder}
10068 -
10069 -\TYPE {\small\verb%new_binder : ((string # type) -> void)%}\egroup
10070 -
10071 -\SYNOPSIS
10072 -Sets up a new binder in the current theory.
10073 -
10074 -\DESCRIBE
10075 -A call {\small\verb%new_binder(`bnd`,":ty")%} declares a new binder {\small\verb%bnd%} in the current
10076 -theory. The type must be of the form {\small\verb%(* -> **) -> ***%}, because being a binder,
10077 -{\small\verb%bnd%} will apply to an abstraction; for example {\small\verb%"!x:bool. (x=T) \/ (x=F)"%} is
10078 -actually a prettyprinting of {\small\verb%"$! (\x. (x=T) \/ (x=F))"%}.
10079 -
10080 -\FAILURE
10081 -Fails if HOL is not in draft mode, or there is already a constant of some sort
10082 -of that name in the current theory, or if the type does not correspond to the
10083 -above pattern.
10084 -
10085 -\EXAMPLE
10086 -{\par\samepage\setseps\small
10087 -\begin{verbatim}
10088 -#new_theory `anorak`;;
10089 -() : void
10090 -
10091 -#new_binder(`!!`,":(bool->bool)->bool");;
10092 +#new_theory `gurk`;;
10093 () : void
10094
10095 -#"!!x. T";;
10096 -"!! x. T" : term
10097 +#new_axiom(`untrue`,"x = 1");;
10098 +|- !x. x = 1
10099 \end{verbatim}
10100 }
10101 +\COMMENTS
10102 +For most purposes, it is unnecessary to declare new axioms: all of classical
10103 +mathematics can be derived by definitional extension alone. Proceeding by
10104 +definition is not only more elegant, but also guarantees the consistency of the
10105 +deductions made. However, there are certain entities which cannot be modelled
10106 +in simple type theory without further axioms, such as higher transfinite
10107 +ordinals.
10108 +
10109 \SEEALSO
10110 -binders, is_binder.
10111 +mk_thm, new_definition.
10112
10113 \ENDDOC
10114 \DOC{new\_binder\_definition}
10115 @@ -16244,6 +16207,41 @@ new_infix_list_rec_definition, new_prim_
10116 new_list_rec_definition, new_prim_rec_definition.
10117
10118 \ENDDOC
10119 +\DOC{new\_binder}
10120 +
10121 +\TYPE {\small\verb%new_binder : ((string # type) -> void)%}\egroup
10122 +
10123 +\SYNOPSIS
10124 +Sets up a new binder in the current theory.
10125 +
10126 +\DESCRIBE
10127 +A call {\small\verb%new_binder(`bnd`,":ty")%} declares a new binder {\small\verb%bnd%} in the current
10128 +theory. The type must be of the form {\small\verb%(* -> **) -> ***%}, because being a binder,
10129 +{\small\verb%bnd%} will apply to an abstraction; for example {\small\verb%"!x:bool. (x=T) \/ (x=F)"%} is
10130 +actually a prettyprinting of {\small\verb%"$! (\x. (x=T) \/ (x=F))"%}.
10131 +
10132 +\FAILURE
10133 +Fails if HOL is not in draft mode, or there is already a constant of some sort
10134 +of that name in the current theory, or if the type does not correspond to the
10135 +above pattern.
10136 +
10137 +\EXAMPLE
10138 +{\par\samepage\setseps\small
10139 +\begin{verbatim}
10140 +#new_theory `anorak`;;
10141 +() : void
10142 +
10143 +#new_binder(`!!`,":(bool->bool)->bool");;
10144 +() : void
10145 +
10146 +#"!!x. T";;
10147 +"!! x. T" : term
10148 +\end{verbatim}
10149 +}
10150 +\SEEALSO
10151 +binders, is_binder.
10152 +
10153 +\ENDDOC
10154 \DOC{new\_constant}
10155
10156 \TYPE {\small\verb%new_constant : ((string # type) -> void)%}\egroup
10157 @@ -16415,46 +16413,6 @@ DEF_EXISTS_RULE, new_binder_definition,
10158 new_specification.
10159
10160 \ENDDOC
10161 -\DOC{new\_infix}
10162 -
10163 -\TYPE {\small\verb%new_infix : ((string # type) -> void)%}\egroup
10164 -
10165 -\SYNOPSIS
10166 -Declares a new infix constant in the current theory.
10167 -
10168 -\DESCRIBE
10169 -A call {\small\verb%new_infix(`i`,":ty")%} makes {\small\verb%i%} an infix
10170 -constant in the current theory. Note that it does not specifiy its value.
10171 -The constant may have a polymorphic type, which may be arbitrarily
10172 -instantiated. Like any other infix or binder, its special parse status may be
10173 -suppressed by preceding it with a dollar sign.
10174 -
10175 -\FAILURE
10176 -Fails if HOL is not in draft mode, or if the name is not a valid constant
10177 -name, or there is already a constant of that name in the current theory.
10178 -
10179 -\EXAMPLE
10180 -The following shows the use of the curried form as well as the infix:
10181 -{\par\samepage\setseps\small
10182 -\begin{verbatim}
10183 - #new_theory `groke`;;
10184 - () : void
10185 -
10186 - #new_infix(`orelse`,":bool->bool->bool");;
10187 - () : void
10188 -
10189 - #"T orelse F";;
10190 - "T orelse F" : term
10191 -
10192 - #"$orelse T F";;
10193 - "T orelse F" : term
10194 -\end{verbatim}
10195 -}
10196 -\SEEALSO
10197 -constants, infixes, is_constant, is_infix, new_constant, new_definition,
10198 -new_infix_definition.
10199 -
10200 -\ENDDOC
10201 \DOC{new\_infix\_definition}
10202
10203 \TYPE {\small\verb%new_infix_definition : ((string # term) -> thm)%}\egroup
10204 @@ -16530,6 +16488,46 @@ new_infix_list_rec_definition, new_prim_
10205 new_prim_rec_definition.
10206
10207 \ENDDOC
10208 +\DOC{new\_infix}
10209 +
10210 +\TYPE {\small\verb%new_infix : ((string # type) -> void)%}\egroup
10211 +
10212 +\SYNOPSIS
10213 +Declares a new infix constant in the current theory.
10214 +
10215 +\DESCRIBE
10216 +A call {\small\verb%new_infix(`i`,":ty")%} makes {\small\verb%i%} an infix
10217 +constant in the current theory. Note that it does not specifiy its value.
10218 +The constant may have a polymorphic type, which may be arbitrarily
10219 +instantiated. Like any other infix or binder, its special parse status may be
10220 +suppressed by preceding it with a dollar sign.
10221 +
10222 +\FAILURE
10223 +Fails if HOL is not in draft mode, or if the name is not a valid constant
10224 +name, or there is already a constant of that name in the current theory.
10225 +
10226 +\EXAMPLE
10227 +The following shows the use of the curried form as well as the infix:
10228 +{\par\samepage\setseps\small
10229 +\begin{verbatim}
10230 + #new_theory `groke`;;
10231 + () : void
10232 +
10233 + #new_infix(`orelse`,":bool->bool->bool");;
10234 + () : void
10235 +
10236 + #"T orelse F";;
10237 + "T orelse F" : term
10238 +
10239 + #"$orelse T F";;
10240 + "T orelse F" : term
10241 +\end{verbatim}
10242 +}
10243 +\SEEALSO
10244 +constants, infixes, is_constant, is_infix, new_constant, new_definition,
10245 +new_infix_definition.
10246 +
10247 +\ENDDOC
10248 \DOC{new\_infix\_list\_rec\_definition}
10249
10250 \TYPE {\small\verb%new_infix_list_rec_definition : ((string # term) -> thm)%}\egroup
10251 @@ -17401,43 +17399,6 @@ new_binder, new_constant, new_definition
10252 new_specification, new_type, print_theory, save_thm, search_path.
10253
10254 \ENDDOC
10255 -\DOC{new\_type}
10256 -
10257 -\TYPE {\small\verb%new_type : (int -> string -> void)%}\egroup
10258 -
10259 -\SYNOPSIS
10260 -Declares a new type or type constructor.
10261 -
10262 -\DESCRIBE
10263 -A call {\small\verb%new_type n `t`%} declares a new {\small\verb%n%}-ary type constructor called {\small\verb%t%} in
10264 -the current theory segment. If {\small\verb%n%} is zero, this is just a new base type.
10265 -
10266 -\FAILURE
10267 -Fails if HOL is not in draft mode, or if the name is not a valid type
10268 -name, or there is already a type operator of that name in the current theory.
10269 -
10270 -\EXAMPLE
10271 -A version of ZF set theory might declare a new type {\small\verb%set%} and start using it as
10272 -follows:
10273 -{\par\samepage\setseps\small
10274 -\begin{verbatim}
10275 - #new_theory `ZF`;;
10276 - () : void
10277 -
10278 - #new_type 0 `set`;;
10279 - () : void
10280 -
10281 - #new_infix(`mem`,":set->set->bool");;
10282 - () : void
10283 -
10284 - #new_axiom(`ext`,"(!z. z mem x = z mem y) ==> (x = y)");;
10285 - |- !x y. (!z. z mem x = z mem y) ==> (x = y)
10286 -\end{verbatim}
10287 -}
10288 -\SEEALSO
10289 -types, type_abbrevs, new_type_abbrev.
10290 -
10291 -\ENDDOC
10292 \DOC{new\_type\_abbrev}
10293
10294 \TYPE {\small\verb%new_type_abbrev : ((string # type) -> void)%}\egroup
10295 @@ -17545,6 +17506,43 @@ define_new_type_bijections, prove_abs_fn
10296 prove_rep_fn_one_one, prove_rep_fn_onto.
10297
10298 \ENDDOC
10299 +\DOC{new\_type}
10300 +
10301 +\TYPE {\small\verb%new_type : (int -> string -> void)%}\egroup
10302 +
10303 +\SYNOPSIS
10304 +Declares a new type or type constructor.
10305 +
10306 +\DESCRIBE
10307 +A call {\small\verb%new_type n `t`%} declares a new {\small\verb%n%}-ary type constructor called {\small\verb%t%} in
10308 +the current theory segment. If {\small\verb%n%} is zero, this is just a new base type.
10309 +
10310 +\FAILURE
10311 +Fails if HOL is not in draft mode, or if the name is not a valid type
10312 +name, or there is already a type operator of that name in the current theory.
10313 +
10314 +\EXAMPLE
10315 +A version of ZF set theory might declare a new type {\small\verb%set%} and start using it as
10316 +follows:
10317 +{\par\samepage\setseps\small
10318 +\begin{verbatim}
10319 + #new_theory `ZF`;;
10320 + () : void
10321 +
10322 + #new_type 0 `set`;;
10323 + () : void
10324 +
10325 + #new_infix(`mem`,":set->set->bool");;
10326 + () : void
10327 +
10328 + #new_axiom(`ext`,"(!z. z mem x = z mem y) ==> (x = y)");;
10329 + |- !x y. (!z. z mem x = z mem y) ==> (x = y)
10330 +\end{verbatim}
10331 +}
10332 +\SEEALSO
10333 +types, type_abbrevs, new_type_abbrev.
10334 +
10335 +\ENDDOC
10336 \DOC{nil\_term\_net}
10337
10338 \TYPE {\small\verb%nil_term_net : * term_net%}\egroup
10339 @@ -17554,6 +17552,38 @@ This function is for internal use only a
10340 version of the system. It should not be used.
10341
10342 \ENDDOC
10343 +\DOC{NO\_CONV}
10344 +
10345 +\TYPE {\small\verb%NO_CONV : conv%}\egroup
10346 +
10347 +\SYNOPSIS
10348 +Conversion that always fails.
10349 +
10350 +\FAILURE
10351 +{\small\verb%NO_CONV%} always fails.
10352 +
10353 +\SEEALSO
10354 +ALL_CONV.
10355 +
10356 +\ENDDOC
10357 +\DOC{NO\_TAC}
10358 +
10359 +\TYPE {\small\verb%NO_TAC : tactic%}\egroup
10360 +
10361 +\SYNOPSIS
10362 +Tactic which always fails.
10363 +
10364 +\DESCRIBE
10365 +Whatever goal it is applied to, {\small\verb%NO_TAC%} always fails
10366 +with string {\small\verb%`NO_TAC`%}.
10367 +
10368 +\FAILURE
10369 +Always fails.
10370 +
10371 +\SEEALSO
10372 +ALL_TAC, ALL_THEN, FAIL_TAC, NO_THEN.
10373 +
10374 +\ENDDOC
10375 \DOC{not}
10376
10377 \TYPE {\small\verb%$not : (bool -> bool)%}\egroup
10378 @@ -17660,7 +17690,29 @@ When applied to a term of the form {\sma
10379 Fails if applied to a term not of the form {\small\verb%~(!x.P)%}.
10380
10381 \SEEALSO
10382 -EXISTS_NOT_CONV, FORALL_NOT_CONV, NOT_EXISTS_CONV.
10383 +EXISTS_NOT_CONV, FORALL_NOT_CONV, NOT_EXISTS_CONV.
10384 +
10385 +\ENDDOC
10386 +\DOC{NO\_THEN}
10387 +
10388 +\TYPE {\small\verb%NO_THEN : thm_tactical%}\egroup
10389 +
10390 +\SYNOPSIS
10391 +Theorem-tactical which always fails.
10392 +
10393 +\DESCRIBE
10394 +When applied to a theorem-tactic and a theorem, the theorem-tactical
10395 +{\small\verb%NO_THEN%} always fails with string {\small\verb%`NO_THEN`%}.
10396 +
10397 +\FAILURE
10398 +Always fails when applied to a theorem-tactic and a theorem (note that it
10399 +never gets as far as being applied to a goal!)
10400 +
10401 +\USES
10402 +Writing compound tactics or tacticals.
10403 +
10404 +\SEEALSO
10405 +ALL_TAC, ALL_THEN, FAIL_TAC, NO_TAC.
10406
10407 \ENDDOC
10408 \DOC{NOT\_INTRO}
10409 @@ -17733,58 +17785,13 @@ expected to be a negation, use {\small\v
10410 MP, EQ_MP, LIST_MP, MATCH_MP, MATCH_MP_TAC, MP_TAC.
10411
10412 \ENDDOC
10413 -\DOC{NO\_CONV}
10414 -
10415 -\TYPE {\small\verb%NO_CONV : conv%}\egroup
10416 -
10417 -\SYNOPSIS
10418 -Conversion that always fails.
10419 -
10420 -\FAILURE
10421 -{\small\verb%NO_CONV%} always fails.
10422 -
10423 -\SEEALSO
10424 -ALL_CONV.
10425 -
10426 -\ENDDOC
10427 -\DOC{NO\_TAC}
10428 -
10429 -\TYPE {\small\verb%NO_TAC : tactic%}\egroup
10430 -
10431 -\SYNOPSIS
10432 -Tactic which always fails.
10433 -
10434 -\DESCRIBE
10435 -Whatever goal it is applied to, {\small\verb%NO_TAC%} always fails
10436 -with string {\small\verb%`NO_TAC`%}.
10437 -
10438 -\FAILURE
10439 -Always fails.
10440 -
10441 -\SEEALSO
10442 -ALL_TAC, ALL_THEN, FAIL_TAC, NO_THEN.
10443 -
10444 -\ENDDOC
10445 -\DOC{NO\_THEN}
10446 +\DOC{n\_strip\_quant}
10447
10448 -\TYPE {\small\verb%NO_THEN : thm_tactical%}\egroup
10449 +\TYPE {\small\verb%n_strip_quant : ((* -> (** # *)) -> int -> * -> (** list # *))%}\egroup
10450
10451 \SYNOPSIS
10452 -Theorem-tactical which always fails.
10453 -
10454 -\DESCRIBE
10455 -When applied to a theorem-tactic and a theorem, the theorem-tactical
10456 -{\small\verb%NO_THEN%} always fails with string {\small\verb%`NO_THEN`%}.
10457 -
10458 -\FAILURE
10459 -Always fails when applied to a theorem-tactic and a theorem (note that it
10460 -never gets as far as being applied to a goal!)
10461 -
10462 -\USES
10463 -Writing compound tactics or tacticals.
10464 -
10465 -\SEEALSO
10466 -ALL_TAC, ALL_THEN, FAIL_TAC, NO_TAC.
10467 +This function is for internal use only and is to be deleted from a future
10468 +version of the system. It should not be used.
10469
10470 \ENDDOC
10471 \DOC{null}
10472 @@ -17883,15 +17890,6 @@ and {\small\verb%m%} are syntactically i
10473 \end{verbatim}
10474 }
10475 \ENDDOC
10476 -\DOC{n\_strip\_quant}
10477 -
10478 -\TYPE {\small\verb%n_strip_quant : ((* -> (** # *)) -> int -> * -> (** list # *))%}\egroup
10479 -
10480 -\SYNOPSIS
10481 -This function is for internal use only and is to be deleted from a future
10482 -version of the system. It should not be used.
10483 -
10484 -\ENDDOC
10485 \DOC{o}
10486
10487 \TYPE {\small\verb%$o : (((* -> **) # (*** -> *)) -> *** -> **)%}\egroup
10488 @@ -18063,6 +18061,71 @@ happens to generate a failure with strin
10489 DEPTH_CONV, REDEPTH_CONV, TOP_DEPTH_CONV, ONCE_REW_DEPTH_CONV.
10490
10491 \ENDDOC
10492 +\DOC{ONCE\_REW\_DEPTH\_CONV}
10493 +
10494 +\TYPE {\small\verb%ONCE_REW_DEPTH_CONV : (conv -> conv)%}\egroup
10495 +
10496 +\SYNOPSIS
10497 +Applies a conversion once to the first suitable sub-term(s) encountered in
10498 +top-down order. For use in rewriting.
10499 +
10500 +\DESCRIBE
10501 +{\small\verb%ONCE_REW_DEPTH_CONV c tm%} applies the conversion {\small\verb%c%} once to the first
10502 +subterm or subterms encountered in a top-down `parallel' search of the term
10503 +{\small\verb%tm%} for which {\small\verb%c%} succeeds. If the conversion {\small\verb%c%} fails on all subterms of
10504 +{\small\verb%tm%}, the theorem returned is {\small\verb%|- tm = tm%}.
10505 +
10506 +{\small\verb%ONCE_REW_DEPTH_CONV%} is a special version of {\small\verb%ONCE_DEPTH_CONV%} for use by the
10507 +rewriting conversions, rules and tactics. It differs from {\small\verb%ONCE_DEPTH_CONV%} as
10508 +follows: If converting an abstraction fails due to the presence of the bound
10509 +variable in the hypotheses of the theorem generated by converting the body,
10510 +{\small\verb%ONCE_REW_DEPTH_CONV%} retries the conversion having renamed the bound variable
10511 +of the abstraction. If successful the renaming is reversed.
10512 +
10513 +\FAILURE
10514 +Never fails.
10515 +
10516 +\EXAMPLE
10517 +The following example illustrates the difference between the functions
10518 +{\small\verb%ONCE_REW_DEPTH_CONV%} and {\small\verb%ONCE_DEPTH_CONV%}. It is not intended to illustrate
10519 +the full range of behaviour of the former. Both {\small\verb%ONCE_REW_DEPTH_CONV%} and
10520 +{\small\verb%ONCE_DEPTH_CONV%} successfully apply the theorem {\small\verb%ADD_0%} inside an abstraction:
10521 +{\par\samepage\setseps\small
10522 +\begin{verbatim}
10523 + #ONCE_REW_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
10524 + |- (\n. n + 0) = (\n. n)
10525 +
10526 + #ONCE_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
10527 + |- (\n. n + 0) = (\n. n)
10528 +\end{verbatim}
10529 +}
10530 +\noindent However, if a hypothesis containing a free occurrence of the bound
10531 +variable is added to the rewrite rule, it interferes with the operation of
10532 +{\small\verb%ONCE_DEPTH_CONV%} but not that of {\small\verb%ONCE_REW_DEPTH_CONV%}:
10533 +{\par\samepage\setseps\small
10534 +\begin{verbatim}
10535 + #let th = ADD_ASSUM "n = 0" ADD_0;;
10536 + th = n = 0 |- !m. m + 0 = m
10537 +
10538 + #ONCE_REW_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
10539 + n = 0 |- (\n. n + 0) = (\n. n)
10540 +
10541 + #ONCE_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
10542 + |- (\n. n + 0) = (\n. n + 0)
10543 +\end{verbatim}
10544 +}
10545 +\COMMENTS
10546 +The implementation of this function uses failure to avoid rebuilding
10547 +unchanged subterms. That is to say, during execution the failure string
10548 +{\small\verb%`QCONV`%} may be generated and later trapped. The behaviour of the function
10549 +is dependent on this use of failure. So, if the conversion given as argument
10550 +happens to generate a failure with string {\small\verb%`QCONV`%}, the operation of
10551 +{\small\verb%ONCE_REW_DEPTH_CONV%} will be unpredictable.
10552 +
10553 +\SEEALSO
10554 +REW_DEPTH_CONV, ONCE_DEPTH_CONV.
10555 +
10556 +\ENDDOC
10557 \DOC{ONCE\_REWRITE\_CONV}
10558
10559 \TYPE {\small\verb%ONCE_REWRITE_CONV : (thm list -> conv)%}\egroup
10560 @@ -18176,71 +18239,6 @@ ASM_REWRITE_TAC, ONCE_ASM_REWRITE_TAC, P
10561 PURE_ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWRITE_TAC, SUBST_TAC.
10562
10563 \ENDDOC
10564 -\DOC{ONCE\_REW\_DEPTH\_CONV}
10565 -
10566 -\TYPE {\small\verb%ONCE_REW_DEPTH_CONV : (conv -> conv)%}\egroup
10567 -
10568 -\SYNOPSIS
10569 -Applies a conversion once to the first suitable sub-term(s) encountered in
10570 -top-down order. For use in rewriting.
10571 -
10572 -\DESCRIBE
10573 -{\small\verb%ONCE_REW_DEPTH_CONV c tm%} applies the conversion {\small\verb%c%} once to the first
10574 -subterm or subterms encountered in a top-down `parallel' search of the term
10575 -{\small\verb%tm%} for which {\small\verb%c%} succeeds. If the conversion {\small\verb%c%} fails on all subterms of
10576 -{\small\verb%tm%}, the theorem returned is {\small\verb%|- tm = tm%}.
10577 -
10578 -{\small\verb%ONCE_REW_DEPTH_CONV%} is a special version of {\small\verb%ONCE_DEPTH_CONV%} for use by the
10579 -rewriting conversions, rules and tactics. It differs from {\small\verb%ONCE_DEPTH_CONV%} as
10580 -follows: If converting an abstraction fails due to the presence of the bound
10581 -variable in the hypotheses of the theorem generated by converting the body,
10582 -{\small\verb%ONCE_REW_DEPTH_CONV%} retries the conversion having renamed the bound variable
10583 -of the abstraction. If successful the renaming is reversed.
10584 -
10585 -\FAILURE
10586 -Never fails.
10587 -
10588 -\EXAMPLE
10589 -The following example illustrates the difference between the functions
10590 -{\small\verb%ONCE_REW_DEPTH_CONV%} and {\small\verb%ONCE_DEPTH_CONV%}. It is not intended to illustrate
10591 -the full range of behaviour of the former. Both {\small\verb%ONCE_REW_DEPTH_CONV%} and
10592 -{\small\verb%ONCE_DEPTH_CONV%} successfully apply the theorem {\small\verb%ADD_0%} inside an abstraction:
10593 -{\par\samepage\setseps\small
10594 -\begin{verbatim}
10595 - #ONCE_REW_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
10596 - |- (\n. n + 0) = (\n. n)
10597 -
10598 - #ONCE_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
10599 - |- (\n. n + 0) = (\n. n)
10600 -\end{verbatim}
10601 -}
10602 -\noindent However, if a hypothesis containing a free occurrence of the bound
10603 -variable is added to the rewrite rule, it interferes with the operation of
10604 -{\small\verb%ONCE_DEPTH_CONV%} but not that of {\small\verb%ONCE_REW_DEPTH_CONV%}:
10605 -{\par\samepage\setseps\small
10606 -\begin{verbatim}
10607 - #let th = ADD_ASSUM "n = 0" ADD_0;;
10608 - th = n = 0 |- !m. m + 0 = m
10609 -
10610 - #ONCE_REW_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
10611 - n = 0 |- (\n. n + 0) = (\n. n)
10612 -
10613 - #ONCE_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
10614 - |- (\n. n + 0) = (\n. n + 0)
10615 -\end{verbatim}
10616 -}
10617 -\COMMENTS
10618 -The implementation of this function uses failure to avoid rebuilding
10619 -unchanged subterms. That is to say, during execution the failure string
10620 -{\small\verb%`QCONV`%} may be generated and later trapped. The behaviour of the function
10621 -is dependent on this use of failure. So, if the conversion given as argument
10622 -happens to generate a failure with string {\small\verb%`QCONV`%}, the operation of
10623 -{\small\verb%ONCE_REW_DEPTH_CONV%} will be unpredictable.
10624 -
10625 -\SEEALSO
10626 -REW_DEPTH_CONV, ONCE_DEPTH_CONV.
10627 -
10628 -\ENDDOC
10629 \DOC{oo}
10630
10631 \TYPE {\small\verb%$oo : ((((* # **) -> ***) # (**** -> *) # (**** -> **)) -> **** -> ***)%}\egroup
10632 @@ -18311,43 +18309,43 @@ contents of file foo
10633 close, openi, read, write
10634
10635 \ENDDOC
10636 -\DOC{ORELSE}
10637 +\DOC{ORELSEC}
10638
10639 -\TYPE {\small\verb%$ORELSE : (tactic -> tactic -> tactic)%}\egroup
10640 +\TYPE {\small\verb%$ORELSEC : (conv -> conv -> conv)%}\egroup
10641
10642 \SYNOPSIS
10643 -Applies first tactic, and iff it fails, applies the second instead.
10644 +Applies the first of two conversions that succeeds.
10645
10646 \DESCRIBE
10647 -If {\small\verb%T1%} and {\small\verb%T2%} are tactics, {\small\verb%T1 ORELSE T2%} is a tactic which applies {\small\verb%T1%} to
10648 -a goal, and iff it fails, applies {\small\verb%T2%} to the goal instead.
10649 +{\small\verb%(c1 ORELSEC c2) "t"%} returns the result of applying the conversion {\small\verb%c1%} to
10650 +the term {\small\verb%"t"%} if this succeeds. Otherwise {\small\verb%(c1 ORELSEC c2) "t"%} returns the
10651 +result of applying the conversion {\small\verb%c2%} to the term {\small\verb%"t"%}.
10652
10653 \FAILURE
10654 -The application of {\small\verb%ORELSE%} to a pair of tactics never fails.
10655 -The resulting tactic fails if both {\small\verb%T1%} and {\small\verb%T2%} fail when applied to the
10656 -relevant goal.
10657 +{\small\verb%(c1 ORELSEC c2) "t"%} fails both {\small\verb%c1%} and {\small\verb%c2%} fail when applied to {\small\verb%"t"%}.
10658
10659 \SEEALSO
10660 -EVERY, FIRST, THEN.
10661 +FIRST_CONV.
10662
10663 \ENDDOC
10664 -\DOC{ORELSEC}
10665 +\DOC{ORELSE}
10666
10667 -\TYPE {\small\verb%$ORELSEC : (conv -> conv -> conv)%}\egroup
10668 +\TYPE {\small\verb%$ORELSE : (tactic -> tactic -> tactic)%}\egroup
10669
10670 \SYNOPSIS
10671 -Applies the first of two conversions that succeeds.
10672 +Applies first tactic, and iff it fails, applies the second instead.
10673
10674 \DESCRIBE
10675 -{\small\verb%(c1 ORELSEC c2) "t"%} returns the result of applying the conversion {\small\verb%c1%} to
10676 -the term {\small\verb%"t"%} if this succeeds. Otherwise {\small\verb%(c1 ORELSEC c2) "t"%} returns the
10677 -result of applying the conversion {\small\verb%c2%} to the term {\small\verb%"t"%}.
10678 +If {\small\verb%T1%} and {\small\verb%T2%} are tactics, {\small\verb%T1 ORELSE T2%} is a tactic which applies {\small\verb%T1%} to
10679 +a goal, and iff it fails, applies {\small\verb%T2%} to the goal instead.
10680
10681 \FAILURE
10682 -{\small\verb%(c1 ORELSEC c2) "t"%} fails both {\small\verb%c1%} and {\small\verb%c2%} fail when applied to {\small\verb%"t"%}.
10683 +The application of {\small\verb%ORELSE%} to a pair of tactics never fails.
10684 +The resulting tactic fails if both {\small\verb%T1%} and {\small\verb%T2%} fail when applied to the
10685 +relevant goal.
10686
10687 \SEEALSO
10688 -FIRST_CONV.
10689 +EVERY, FIRST, THEN.
10690
10691 \ENDDOC
10692 \DOC{ORELSE\_TCL}
10693 @@ -18482,29 +18480,6 @@ evaluation failed outr
10694 outl, inl, inr, isl
10695
10696 \ENDDOC
10697 -\DOC{p}
10698 -
10699 -\TYPE {\small\verb%p : (int -> void)%}\egroup
10700 -
10701 -\SYNOPSIS
10702 -Prints the top levels of the subgoal package goal stack.
10703 -
10704 -\DESCRIBE
10705 -The function {\small\verb%p%} is part of the subgoal package. It is an abbreviation for the
10706 -function {\small\verb%print_state%}. For a description of the subgoal package, see
10707 -{\small\verb%set_goal%}.
10708 -
10709 -\FAILURE
10710 -Never fails.
10711 -
10712 -\USES
10713 -Examining the proof state during an interactive proof session.
10714 -
10715 -\SEEALSO
10716 -b, backup, backup_limit, e, expand, expandf, g, get_state, print_state, r,
10717 -rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
10718 -
10719 -\ENDDOC
10720 \DOC{pair}
10721
10722 \TYPE {\small\verb%pair : (* -> ** -> (* # **))%}\egroup
10723 @@ -18878,7 +18853,30 @@ implication (the inbuilt specialization
10724 quantifier), and matches it to {\small\verb%T%}.
10725
10726 \SEEALSO
10727 -INST_TYPE, INST_TY_TERM, match.
10728 +INST_TYPE, INST_TY_TERM, match.
10729 +
10730 +\ENDDOC
10731 +\DOC{p}
10732 +
10733 +\TYPE {\small\verb%p : (int -> void)%}\egroup
10734 +
10735 +\SYNOPSIS
10736 +Prints the top levels of the subgoal package goal stack.
10737 +
10738 +\DESCRIBE
10739 +The function {\small\verb%p%} is part of the subgoal package. It is an abbreviation for the
10740 +function {\small\verb%print_state%}. For a description of the subgoal package, see
10741 +{\small\verb%set_goal%}.
10742 +
10743 +\FAILURE
10744 +Never fails.
10745 +
10746 +\USES
10747 +Examining the proof state during an interactive proof session.
10748 +
10749 +\SEEALSO
10750 +b, backup, backup_limit, e, expand, expandf, g, get_state, print_state, r,
10751 +rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
10752
10753 \ENDDOC
10754 \DOC{POP\_ASSUM}
10755 @@ -20153,56 +20151,6 @@ Never fails.
10756 set_prompt.
10757
10758 \ENDDOC
10759 -\DOC{PROVE}
10760 -
10761 -\TYPE {\small\verb%PROVE : ((term # tactic) -> thm)%}\egroup
10762 -
10763 -\SYNOPSIS
10764 -Attempts to prove a boolean term using the supplied tactic.
10765 -
10766 -\DESCRIBE
10767 -When applied to a term-tactic pair {\small\verb%(tm,tac)%}, the function {\small\verb%PROVE%} attempts to
10768 -prove the goal {\small\verb%?- tm%}, that is, the term {\small\verb%tm%} with no assumptions, using the
10769 -tactic {\small\verb%tac%}. If {\small\verb%PROVE%} succeeds, it returns the corresponding theorem
10770 -{\small\verb%A |- tm%}, where the assumption list {\small\verb%A%} may not be empty if the tactic is
10771 -invalid; {\small\verb%PROVE%} has no inbuilt validity-checking.
10772 -
10773 -\FAILURE
10774 -Fails if the term is not of type {\small\verb%bool%} (and so cannot possibly be
10775 -the conclusion of a theorem), or if the tactic cannot solve the goal.
10776 -In the latter case {\small\verb%PROVE%} will list the unsolved goals to help the user.
10777 -
10778 -\SEEALSO
10779 -TAC_PROOF, prove, prove_thm, VALID.
10780 -
10781 -\ENDDOC
10782 -\DOC{prove}
10783 -
10784 -\TYPE {\small\verb%prove : ((term # tactic) -> thm)%}\egroup
10785 -
10786 -\SYNOPSIS
10787 -Attempts to prove a boolean term using the supplied tactic.
10788 -
10789 -\DESCRIBE
10790 -When applied to a term-tactic pair {\small\verb%(tm,tac)%}, the function {\small\verb%prove%} attempts to
10791 -prove the goal {\small\verb%?- tm%}, that is, the term {\small\verb%tm%} with no assumptions, using the
10792 -tactic {\small\verb%tac%}. If {\small\verb%prove%} succeeds, it returns the corresponding theorem
10793 -{\small\verb%A |- tm%}, where the assumption list {\small\verb%A%} may not be empty if the tactic is
10794 -invalid; {\small\verb%prove%} has no inbuilt validity-checking.
10795 -
10796 -\FAILURE
10797 -Fails if the term is not of type {\small\verb%bool%} (and so cannot possibly be
10798 -the conclusion of a theorem), or if the tactic cannot solve the goal.
10799 -
10800 -\COMMENTS
10801 -The function {\small\verb%PROVE%} provides almost identical functionality, and will
10802 -also list unsolved goals if the tactic fails. It is therefore preferable
10803 -for most purposes.
10804 -
10805 -\SEEALSO
10806 -PROVE, prove_thm, TAC_PROOF, VALID.
10807 -
10808 -\ENDDOC
10809 \DOC{prove\_abs\_fn\_one\_one}
10810
10811 \TYPE {\small\verb%prove_abs_fn_one_one : (thm -> thm)%}\egroup
10812 @@ -20398,6 +20346,56 @@ define_type, INDUCT_THEN, new_recursive_
10813 prove_constructors_distinct, prove_induction_thm, prove_rec_fn_exists.
10814
10815 \ENDDOC
10816 +\DOC{prove}
10817 +
10818 +\TYPE {\small\verb%prove : ((term # tactic) -> thm)%}\egroup
10819 +
10820 +\SYNOPSIS
10821 +Attempts to prove a boolean term using the supplied tactic.
10822 +
10823 +\DESCRIBE
10824 +When applied to a term-tactic pair {\small\verb%(tm,tac)%}, the function {\small\verb%prove%} attempts to
10825 +prove the goal {\small\verb%?- tm%}, that is, the term {\small\verb%tm%} with no assumptions, using the
10826 +tactic {\small\verb%tac%}. If {\small\verb%prove%} succeeds, it returns the corresponding theorem
10827 +{\small\verb%A |- tm%}, where the assumption list {\small\verb%A%} may not be empty if the tactic is
10828 +invalid; {\small\verb%prove%} has no inbuilt validity-checking.
10829 +
10830 +\FAILURE
10831 +Fails if the term is not of type {\small\verb%bool%} (and so cannot possibly be
10832 +the conclusion of a theorem), or if the tactic cannot solve the goal.
10833 +
10834 +\COMMENTS
10835 +The function {\small\verb%PROVE%} provides almost identical functionality, and will
10836 +also list unsolved goals if the tactic fails. It is therefore preferable
10837 +for most purposes.
10838 +
10839 +\SEEALSO
10840 +PROVE, prove_thm, TAC_PROOF, VALID.
10841 +
10842 +\ENDDOC
10843 +\DOC{PROVE}
10844 +
10845 +\TYPE {\small\verb%PROVE : ((term # tactic) -> thm)%}\egroup
10846 +
10847 +\SYNOPSIS
10848 +Attempts to prove a boolean term using the supplied tactic.
10849 +
10850 +\DESCRIBE
10851 +When applied to a term-tactic pair {\small\verb%(tm,tac)%}, the function {\small\verb%PROVE%} attempts to
10852 +prove the goal {\small\verb%?- tm%}, that is, the term {\small\verb%tm%} with no assumptions, using the
10853 +tactic {\small\verb%tac%}. If {\small\verb%PROVE%} succeeds, it returns the corresponding theorem
10854 +{\small\verb%A |- tm%}, where the assumption list {\small\verb%A%} may not be empty if the tactic is
10855 +invalid; {\small\verb%PROVE%} has no inbuilt validity-checking.
10856 +
10857 +\FAILURE
10858 +Fails if the term is not of type {\small\verb%bool%} (and so cannot possibly be
10859 +the conclusion of a theorem), or if the tactic cannot solve the goal.
10860 +In the latter case {\small\verb%PROVE%} will list the unsolved goals to help the user.
10861 +
10862 +\SEEALSO
10863 +TAC_PROOF, prove, prove_thm, VALID.
10864 +
10865 +\ENDDOC
10866 \DOC{PROVE\_HYP}
10867
10868 \TYPE {\small\verb%PROVE_HYP : (thm -> thm -> thm)%}\egroup
10869 @@ -20940,45 +20938,6 @@ Evaluating {\small\verb%quit()%} termina
10870 Never fails.
10871
10872 \ENDDOC
10873 -\DOC{r}
10874 -
10875 -\TYPE {\small\verb%r : (int -> void)%}\egroup
10876 -
10877 -\SYNOPSIS
10878 -Reorders the subgoals on top of the subgoal package goal stack.
10879 -
10880 -\DESCRIBE
10881 -The function {\small\verb%r%} is part of the subgoal package. It is an abbreviation for
10882 -{\small\verb%rotate%}. For a description of the subgoal package, see {\small\verb%set_goal%}.
10883 -
10884 -\FAILURE
10885 -As for {\small\verb%rotate%}.
10886 -
10887 -\USES
10888 -Proving subgoals in a different order to that generated by the subgoal package.
10889 -
10890 -\SEEALSO
10891 -b, backup, backup_limit, e, expand, expandf, g, get_state, p, print_state,
10892 -rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
10893 -
10894 -\ENDDOC
10895 -\DOC{rand}
10896 -
10897 -\TYPE {\small\verb%rand : (term -> term)%}\egroup
10898 -
10899 -\SYNOPSIS
10900 -Returns the operand from a combination (function application).
10901 -
10902 -\DESCRIBE
10903 -{\small\verb%rand "t1 t2"%} returns {\small\verb%"t2"%}.
10904 -
10905 -\FAILURE
10906 -Fails with {\small\verb%rand%} if term is not a combination.
10907 -
10908 -\SEEALSO
10909 -rator, dest_comb.
10910 -
10911 -\ENDDOC
10912 \DOC{RAND\_CONV}
10913
10914 \TYPE {\small\verb%RAND_CONV : (conv -> conv)%}\egroup
10915 @@ -21016,21 +20975,21 @@ function returned by {\small\verb%RAND_C
10916 ABS_CONV, RATOR_CONV, SUB_CONV.
10917
10918 \ENDDOC
10919 -\DOC{rator}
10920 +\DOC{rand}
10921
10922 -\TYPE {\small\verb%rator : (term -> term)%}\egroup
10923 +\TYPE {\small\verb%rand : (term -> term)%}\egroup
10924
10925 \SYNOPSIS
10926 -Returns the operator from a combination (function application).
10927 +Returns the operand from a combination (function application).
10928
10929 \DESCRIBE
10930 -{\small\verb%rator("t1 t2")%} returns {\small\verb%"t1"%}.
10931 +{\small\verb%rand "t1 t2"%} returns {\small\verb%"t2"%}.
10932
10933 \FAILURE
10934 -Fails with {\small\verb%rator%} if term is not a combination.
10935 +Fails with {\small\verb%rand%} if term is not a combination.
10936
10937 \SEEALSO
10938 -rand, dest_comb.
10939 +rator, dest_comb.
10940
10941 \ENDDOC
10942 \DOC{RATOR\_CONV}
10943 @@ -21070,6 +21029,45 @@ function returned by {\small\verb%RATOR_
10944 ABS_CONV, RAND_CONV, SUB_CONV.
10945
10946 \ENDDOC
10947 +\DOC{rator}
10948 +
10949 +\TYPE {\small\verb%rator : (term -> term)%}\egroup
10950 +
10951 +\SYNOPSIS
10952 +Returns the operator from a combination (function application).
10953 +
10954 +\DESCRIBE
10955 +{\small\verb%rator("t1 t2")%} returns {\small\verb%"t1"%}.
10956 +
10957 +\FAILURE
10958 +Fails with {\small\verb%rator%} if term is not a combination.
10959 +
10960 +\SEEALSO
10961 +rand, dest_comb.
10962 +
10963 +\ENDDOC
10964 +\DOC{r}
10965 +
10966 +\TYPE {\small\verb%r : (int -> void)%}\egroup
10967 +
10968 +\SYNOPSIS
10969 +Reorders the subgoals on top of the subgoal package goal stack.
10970 +
10971 +\DESCRIBE
10972 +The function {\small\verb%r%} is part of the subgoal package. It is an abbreviation for
10973 +{\small\verb%rotate%}. For a description of the subgoal package, see {\small\verb%set_goal%}.
10974 +
10975 +\FAILURE
10976 +As for {\small\verb%rotate%}.
10977 +
10978 +\USES
10979 +Proving subgoals in a different order to that generated by the subgoal package.
10980 +
10981 +\SEEALSO
10982 +b, backup, backup_limit, e, expand, expandf, g, get_state, p, print_state,
10983 +rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
10984 +
10985 +\ENDDOC
10986 \DOC{read}
10987
10988 \TYPE {\small\verb%read : (string -> string)%}\egroup
10989 @@ -21091,63 +21089,26 @@ descriptor.
10990 \EXAMPLE
10991 The following assumes that HOL is being run under Unix. It will overwrite an
10992 existing file {\small\verb%test-file%} in the current directory. Notice that the actual
10993 -string returned by {\small\verb%openi%} may vary on other systems.
10994 -{\par\samepage\setseps\small
10995 -\begin{verbatim}
10996 - #system `echo "Hi" >test-file`;;
10997 - 0 : int
10998 -
10999 - #let port = openi `test-file`;;
11000 - port = `%test-file` : string
11001 -
11002 - #read port, read port, read port, read port, read port;;
11003 - (`H`, `i`, `
11004 - `, `nil`, `nil`)
11005 - : (string # string # string # string # string)
11006 -
11007 - #close port;;
11008 - () : void
11009 -\end{verbatim}
11010 -}
11011 -\SEEALSO
11012 -append_openw, close, openi, openw, tty_read, tty_write, write.
11013 -
11014 -\ENDDOC
11015 -\DOC{RecordStep}
11016 -
11017 -\TYPE {\small\verb%RecordStep : step -> void%}\egroup
11018 -
11019 -
11020 -\SYNOPSIS
11021 -Record a single inference step.
11022 -
11023 -\DESCRIBE
11024 -A proof is a list of inference steps. After the proof recorder is
11025 -enabled, every inference performed by the system is recorded and
11026 -cumulated in an internal buffer. When a proof is completed, the raw
11027 -records can then be processed and output to a disk file.
11028 -
11029 -{\small\verb%record_proof%} is a system function for recording a single proof step.
11030 -The type {\small\verb%step%} represents a basic inference step. It contains all
11031 -the necessary information of each inference. There are currently 52
11032 -basic inferences which are being recorded. All other ML functions
11033 -representing inference rules are implemented by these basic
11034 -inferences.
11035 -If the proof recorder is enabled when an inference is performed,
11036 -{\small\verb%RecordStep%} will add a step into the internal buffer.
11037 +string returned by {\small\verb%openi%} may vary on other systems.
11038 +{\par\samepage\setseps\small
11039 +\begin{verbatim}
11040 + #system `echo "Hi" >test-file`;;
11041 + 0 : int
11042
11043 -\FAILURE
11044 -Never fail.
11045 + #let port = openi `test-file`;;
11046 + port = `%test-file` : string
11047
11048 -\COMMENTS
11049 -This is a system function implementing the proof recorded. Users
11050 -should not use this function directly. User functions are provided in
11051 -the library {\small\verb%record_proof%}. When new basic inference rule
11052 -is implemented, this function should be called to record the inference step.
11053 + #read port, read port, read port, read port, read port;;
11054 + (`H`, `i`, `
11055 + `, `nil`, `nil`)
11056 + : (string # string # string # string # string)
11057
11058 + #close port;;
11059 + () : void
11060 +\end{verbatim}
11061 +}
11062 \SEEALSO
11063 -record_proof, is_recording_proof, get_steps,
11064 -suspend_recording, resume_recording.
11065 +append_openw, close, openi, openw, tty_read, tty_write, write.
11066
11067 \ENDDOC
11068 \DOC{record\_proof}
11069 @@ -21225,6 +21186,43 @@ new_proof_file, close_proof_file, begin_
11070 TAC_PROOF, PROVE, prove, prove_thm.
11071
11072 \ENDDOC
11073 +\DOC{RecordStep}
11074 +
11075 +\TYPE {\small\verb%RecordStep : step -> void%}\egroup
11076 +
11077 +
11078 +\SYNOPSIS
11079 +Record a single inference step.
11080 +
11081 +\DESCRIBE
11082 +A proof is a list of inference steps. After the proof recorder is
11083 +enabled, every inference performed by the system is recorded and
11084 +cumulated in an internal buffer. When a proof is completed, the raw
11085 +records can then be processed and output to a disk file.
11086 +
11087 +{\small\verb%record_proof%} is a system function for recording a single proof step.
11088 +The type {\small\verb%step%} represents a basic inference step. It contains all
11089 +the necessary information of each inference. There are currently 52
11090 +basic inferences which are being recorded. All other ML functions
11091 +representing inference rules are implemented by these basic
11092 +inferences.
11093 +If the proof recorder is enabled when an inference is performed,
11094 +{\small\verb%RecordStep%} will add a step into the internal buffer.
11095 +
11096 +\FAILURE
11097 +Never fail.
11098 +
11099 +\COMMENTS
11100 +This is a system function implementing the proof recorded. Users
11101 +should not use this function directly. User functions are provided in
11102 +the library {\small\verb%record_proof%}. When new basic inference rule
11103 +is implemented, this function should be called to record the inference step.
11104 +
11105 +\SEEALSO
11106 +record_proof, is_recording_proof, get_steps,
11107 +suspend_recording, resume_recording.
11108 +
11109 +\ENDDOC
11110 \DOC{REDEPTH\_CONV}
11111
11112 \TYPE {\small\verb%REDEPTH_CONV : (conv -> conv)%}\egroup
11113 @@ -21373,25 +21371,6 @@ Fails if the name was not associated wit
11114 set_sticky_type, sticky_list.
11115
11116 \ENDDOC
11117 -\DOC{REPEAT}
11118 -
11119 -\TYPE {\small\verb%REPEAT : (tactic -> tactic)%}\egroup
11120 -
11121 -\SYNOPSIS
11122 -Repeatedly applies a tactic until it fails.
11123 -
11124 -\DESCRIBE
11125 -The tactic {\small\verb%REPEAT T%} is a tactic which applies {\small\verb%T%} to a goal, and while it
11126 -succeeds, continues applying it to all subgoals generated.
11127 -
11128 -\FAILURE
11129 -The application of {\small\verb%REPEAT%} to a tactic never fails, and neither does the
11130 -composite tactic, even if the basic tactic fails immediately.
11131 -
11132 -\SEEALSO
11133 -EVERY, FIRST, ORELSE, THEN, THENL.
11134 -
11135 -\ENDDOC
11136 \DOC{REPEATC}
11137
11138 \TYPE {\small\verb%REPEATC : (conv -> conv)%}\egroup
11139 @@ -21412,6 +21391,25 @@ returns {\small\verb%|- t1 = t(n+1)%}. A
11140 Never fails, but can diverge if the supplied conversion never fails.
11141
11142 \ENDDOC
11143 +\DOC{REPEAT}
11144 +
11145 +\TYPE {\small\verb%REPEAT : (tactic -> tactic)%}\egroup
11146 +
11147 +\SYNOPSIS
11148 +Repeatedly applies a tactic until it fails.
11149 +
11150 +\DESCRIBE
11151 +The tactic {\small\verb%REPEAT T%} is a tactic which applies {\small\verb%T%} to a goal, and while it
11152 +succeeds, continues applying it to all subgoals generated.
11153 +
11154 +\FAILURE
11155 +The application of {\small\verb%REPEAT%} to a tactic never fails, and neither does the
11156 +composite tactic, even if the basic tactic fails immediately.
11157 +
11158 +\SEEALSO
11159 +EVERY, FIRST, ORELSE, THEN, THENL.
11160 +
11161 +\ENDDOC
11162 \DOC{REPEAT\_GTCL}
11163
11164 \TYPE {\small\verb%REPEAT_GTCL : (thm_tactical -> thm_tactical)%}\egroup
11165 @@ -21492,20 +21490,6 @@ example the following goal:
11166 REPEAT_GTCL, THEN_TCL.
11167
11168 \ENDDOC
11169 -\DOC{replicate}
11170 -
11171 -\TYPE {\small\verb%replicate : (* -> int -> * list)%}\egroup
11172 -
11173 -\SYNOPSIS
11174 -Makes a list consisting of a value replicated a specified number of times.
11175 -
11176 -\DESCRIBE
11177 -{\small\verb%replicate x n%} returns {\small\verb%[x;...;x]%}, a list of length {\small\verb%n%}.
11178 -
11179 -\FAILURE
11180 -Fails if number of replications is less than zero.
11181 -
11182 -\ENDDOC
11183 \DOC{rep\_goals}
11184
11185 \TYPE {\small\verb%rep_goals : (goalstack -> subgoals list)%}\egroup
11186 @@ -21515,43 +21499,18 @@ This function is for internal use only a
11187 version of the system. It should not be used.
11188
11189 \ENDDOC
11190 -\DOC{resume\_recording}
11191 -
11192 -\TYPE {\small\verb%resume_recording : void -> void%}\egroup
11193 +\DOC{replicate}
11194
11195 +\TYPE {\small\verb%replicate : (* -> int -> * list)%}\egroup
11196
11197 \SYNOPSIS
11198 -Suspend proof recording temporarily.
11199 +Makes a list consisting of a value replicated a specified number of times.
11200
11201 \DESCRIBE
11202 -A proof is a list of inference steps. After the proof recorder is
11203 -enabled, every inference performed by the system is recorded and
11204 -cumulated in an internal buffer. When a proof is completed, the raw
11205 -records can then be processed and output to a disk file.
11206 -
11207 -{\small\verb%resume_recording%} is a low level user function for managing the proof
11208 -recorder. It resumes the proof recorder without clearing the internal
11209 -inference step buffer. The proof recorder should be in the suspended state.
11210 -Otherwise, this function does nothing.
11211 -
11212 -The current state of the proof recorder can interrogated using the
11213 -function {\small\verb%is_recording_proof%}. A value of {\small\verb%false%} indicates the proof
11214 -recorder is disabled.
11215 +{\small\verb%replicate x n%} returns {\small\verb%[x;...;x]%}, a list of length {\small\verb%n%}.
11216
11217 \FAILURE
11218 -Never fail.
11219 -
11220 -\COMMENTS
11221 -This function is used to implement higher level user functions for
11222 -recording proof in the library {\small\verb%record_proof%}. It is much more
11223 -convenient to use those functions than the low level functions
11224 -such as {\small\verb%resume_recording%} directly.
11225 -
11226 -\SEEALSO
11227 -record_proof, is_recording_proof, RecordStep, get_steps, suspend_recording,
11228 -current_proof, current_proof_file,
11229 -new_proof_file, close_proof_file, begin_proof, end_proof,
11230 -TAC_PROOF, PROVE, prove, prove_thm.
11231 +Fails if number of replications is less than zero.
11232
11233 \ENDDOC
11234 \DOC{RES\_CANON}
11235 @@ -21757,60 +21716,126 @@ assumptions of a goal. {\small\verb%RES_
11236 implications used for resolution are taken from the assumptions of the goal
11237 itself, rather than supplied as an argument.
11238
11239 -When applied to a goal {\small\verb%A ?- g%}, the tactic {\small\verb%RES_THEN ttac%} uses {\small\verb%RES_CANON%} to
11240 -obtain a set of implicative theorems in canonical form from the assumptions {\small\verb%A%}
11241 -of the goal. Each of the resulting theorems (if there are any) will have the
11242 -form:
11243 -{\par\samepage\setseps\small
11244 -\begin{verbatim}
11245 - ai |- !x1...xn. ui ==> vi
11246 -\end{verbatim}
11247 -}
11248 -\noindent where {\small\verb%ai%} is one of the assumptions of the goal. Having obtained
11249 -these implications, {\small\verb%RES_THEN%} then attempts to match each antecedent {\small\verb%ui%} to
11250 -each assumption {\small\verb%aj |- aj%} in the assumptions {\small\verb%A%}. If the antecedent {\small\verb%ui%} of
11251 -any implication matches the conclusion {\small\verb%aj%} of any assumption, then an instance
11252 -of the theorem {\small\verb%ai, aj |- vi%}, called a `resolvent', is obtained by
11253 -specialization of the variables {\small\verb%x1%}, ..., {\small\verb%xn%} and type instantiation,
11254 -followed by an application of modus ponens. There may be more than one
11255 -canonical implication derivable from the assumptions of the goal and each
11256 -such implication is tried against every assumption, so there may be several
11257 -resolvents (or, indeed, none).
11258 +When applied to a goal {\small\verb%A ?- g%}, the tactic {\small\verb%RES_THEN ttac%} uses {\small\verb%RES_CANON%} to
11259 +obtain a set of implicative theorems in canonical form from the assumptions {\small\verb%A%}
11260 +of the goal. Each of the resulting theorems (if there are any) will have the
11261 +form:
11262 +{\par\samepage\setseps\small
11263 +\begin{verbatim}
11264 + ai |- !x1...xn. ui ==> vi
11265 +\end{verbatim}
11266 +}
11267 +\noindent where {\small\verb%ai%} is one of the assumptions of the goal. Having obtained
11268 +these implications, {\small\verb%RES_THEN%} then attempts to match each antecedent {\small\verb%ui%} to
11269 +each assumption {\small\verb%aj |- aj%} in the assumptions {\small\verb%A%}. If the antecedent {\small\verb%ui%} of
11270 +any implication matches the conclusion {\small\verb%aj%} of any assumption, then an instance
11271 +of the theorem {\small\verb%ai, aj |- vi%}, called a `resolvent', is obtained by
11272 +specialization of the variables {\small\verb%x1%}, ..., {\small\verb%xn%} and type instantiation,
11273 +followed by an application of modus ponens. There may be more than one
11274 +canonical implication derivable from the assumptions of the goal and each
11275 +such implication is tried against every assumption, so there may be several
11276 +resolvents (or, indeed, none).
11277 +
11278 +Tactics are produced using the theorem-tactic {\small\verb%ttac%} from all these resolvents
11279 +(failures of {\small\verb%ttac%} at this stage are filtered out) and these tactics are then
11280 +applied in an unspecified sequence to the goal. That is,
11281 +{\par\samepage\setseps\small
11282 +\begin{verbatim}
11283 + RES_THEN ttac (A ?- g)
11284 +\end{verbatim}
11285 +}
11286 +\noindent has the effect of:
11287 +{\par\samepage\setseps\small
11288 +\begin{verbatim}
11289 + MAP_EVERY (mapfilter ttac [... ; (ai,aj |- vi) ; ...]) (A ?- g)
11290 +\end{verbatim}
11291 +}
11292 +\noindent where the theorems {\small\verb%ai,aj |- vi%} are all the consequences that can be
11293 +drawn by a (single) matching modus-ponens inference from the assumptions {\small\verb%A%}
11294 +and the implications derived using {\small\verb%RES_CANON%} from the assumptions. The
11295 +sequence in which the theorems {\small\verb%ai,aj |- vi%} are generated and the
11296 +corresponding tactics applied is unspecified.
11297 +
11298 +\FAILURE
11299 +Evaluating {\small\verb%RES_THEN ttac th%} fails with `{\small\verb%no implication%}' if no
11300 +implication(s) can be derived from the assumptions of the goal by the
11301 +transformation process described under the entry for {\small\verb%RES_CANON%}. Evaluating
11302 +{\small\verb%RES_THEN ttac (A ?- g)%} fails with `{\small\verb%no resolvents%}' if no assumption of the
11303 +goal {\small\verb%A ?- g%} can be resolved with the derived implication or implications.
11304 +Evaluation also fails, with `{\small\verb%no tactics%}', if there are resolvents, but for
11305 +every resolvent {\small\verb%ai,aj |- vi%} evaluating the application {\small\verb%ttac (ai,aj |- vi)%}
11306 +fails---that is, if for every resolvent {\small\verb%ttac%} fails to produce a tactic.
11307 +Finally, failure is propagated if any of the tactics that are produced from the
11308 +resolvents by {\small\verb%ttac%} fails when applied in sequence to the goal.
11309 +
11310 +\SEEALSO
11311 +IMP_RES_TAC, IMP_RES_THEN, MATCH_MP, RES_CANON, RES_TAC.
11312 +
11313 +\ENDDOC
11314 +\DOC{resume\_recording}
11315 +
11316 +\TYPE {\small\verb%resume_recording : void -> void%}\egroup
11317 +
11318 +
11319 +\SYNOPSIS
11320 +Suspend proof recording temporarily.
11321 +
11322 +\DESCRIBE
11323 +A proof is a list of inference steps. After the proof recorder is
11324 +enabled, every inference performed by the system is recorded and
11325 +cumulated in an internal buffer. When a proof is completed, the raw
11326 +records can then be processed and output to a disk file.
11327 +
11328 +{\small\verb%resume_recording%} is a low level user function for managing the proof
11329 +recorder. It resumes the proof recorder without clearing the internal
11330 +inference step buffer. The proof recorder should be in the suspended state.
11331 +Otherwise, this function does nothing.
11332 +
11333 +The current state of the proof recorder can interrogated using the
11334 +function {\small\verb%is_recording_proof%}. A value of {\small\verb%false%} indicates the proof
11335 +recorder is disabled.
11336 +
11337 +\FAILURE
11338 +Never fail.
11339 +
11340 +\COMMENTS
11341 +This function is used to implement higher level user functions for
11342 +recording proof in the library {\small\verb%record_proof%}. It is much more
11343 +convenient to use those functions than the low level functions
11344 +such as {\small\verb%resume_recording%} directly.
11345 +
11346 +\SEEALSO
11347 +record_proof, is_recording_proof, RecordStep, get_steps, suspend_recording,
11348 +current_proof, current_proof_file,
11349 +new_proof_file, close_proof_file, begin_proof, end_proof,
11350 +TAC_PROOF, PROVE, prove, prove_thm.
11351 +
11352 +\ENDDOC
11353 +\DOC{rev\_assoc}
11354 +
11355 +\TYPE {\small\verb%rev_assoc : (* -> (** # *) list -> (** # *))%}\egroup
11356 +
11357 +\SYNOPSIS
11358 +Searches a list of pairs for a pair whose second component equals a specified
11359 +value.
11360 +
11361 +\DESCRIBE
11362 +{\small\verb%rev_assoc y [(x1,y1);...;(xn,yn)]%} returns the first {\small\verb%(xi,yi)%} in the list
11363 +such that {\small\verb%yi%} equals {\small\verb%y%}.
11364 +
11365 +\FAILURE
11366 +Fails if no matching pair is found. This will always be the case if the list
11367 +is empty.
11368
11369 -Tactics are produced using the theorem-tactic {\small\verb%ttac%} from all these resolvents
11370 -(failures of {\small\verb%ttac%} at this stage are filtered out) and these tactics are then
11371 -applied in an unspecified sequence to the goal. That is,
11372 -{\par\samepage\setseps\small
11373 -\begin{verbatim}
11374 - RES_THEN ttac (A ?- g)
11375 -\end{verbatim}
11376 -}
11377 -\noindent has the effect of:
11378 +\EXAMPLE
11379 {\par\samepage\setseps\small
11380 \begin{verbatim}
11381 - MAP_EVERY (mapfilter ttac [... ; (ai,aj |- vi) ; ...]) (A ?- g)
11382 +#rev_assoc 2 [(1,4);(3,2);(2,5);(2,6)];;
11383 +(3, 2) : (int # int)
11384 \end{verbatim}
11385 }
11386 -\noindent where the theorems {\small\verb%ai,aj |- vi%} are all the consequences that can be
11387 -drawn by a (single) matching modus-ponens inference from the assumptions {\small\verb%A%}
11388 -and the implications derived using {\small\verb%RES_CANON%} from the assumptions. The
11389 -sequence in which the theorems {\small\verb%ai,aj |- vi%} are generated and the
11390 -corresponding tactics applied is unspecified.
11391 -
11392 -\FAILURE
11393 -Evaluating {\small\verb%RES_THEN ttac th%} fails with `{\small\verb%no implication%}' if no
11394 -implication(s) can be derived from the assumptions of the goal by the
11395 -transformation process described under the entry for {\small\verb%RES_CANON%}. Evaluating
11396 -{\small\verb%RES_THEN ttac (A ?- g)%} fails with `{\small\verb%no resolvents%}' if no assumption of the
11397 -goal {\small\verb%A ?- g%} can be resolved with the derived implication or implications.
11398 -Evaluation also fails, with `{\small\verb%no tactics%}', if there are resolvents, but for
11399 -every resolvent {\small\verb%ai,aj |- vi%} evaluating the application {\small\verb%ttac (ai,aj |- vi)%}
11400 -fails---that is, if for every resolvent {\small\verb%ttac%} fails to produce a tactic.
11401 -Finally, failure is propagated if any of the tactics that are produced from the
11402 -resolvents by {\small\verb%ttac%} fails when applied in sequence to the goal.
11403 -
11404 \SEEALSO
11405 -IMP_RES_TAC, IMP_RES_THEN, MATCH_MP, RES_CANON, RES_TAC.
11406 +assoc, find, mem, tryfind, exists, forall.
11407
11408 \ENDDOC
11409 \DOC{rev}
11410 @@ -21871,33 +21896,6 @@ FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV.
11411
11412 \ENDDOC
11413
11414 -\DOC{rev\_assoc}
11415 -
11416 -\TYPE {\small\verb%rev_assoc : (* -> (** # *) list -> (** # *))%}\egroup
11417 -
11418 -\SYNOPSIS
11419 -Searches a list of pairs for a pair whose second component equals a specified
11420 -value.
11421 -
11422 -\DESCRIBE
11423 -{\small\verb%rev_assoc y [(x1,y1);...;(xn,yn)]%} returns the first {\small\verb%(xi,yi)%} in the list
11424 -such that {\small\verb%yi%} equals {\small\verb%y%}.
11425 -
11426 -\FAILURE
11427 -Fails if no matching pair is found. This will always be the case if the list
11428 -is empty.
11429 -
11430 -\EXAMPLE
11431 -{\par\samepage\setseps\small
11432 -\begin{verbatim}
11433 -#rev_assoc 2 [(1,4);(3,2);(2,5);(2,6)];;
11434 -(3, 2) : (int # int)
11435 -\end{verbatim}
11436 -}
11437 -\SEEALSO
11438 -assoc, find, mem, tryfind, exists, forall.
11439 -
11440 -\ENDDOC
11441 \DOC{rev\_itlist}
11442
11443 \TYPE {\small\verb%rev_itlist : ((* -> ** -> **) -> * list -> ** -> **)%}\egroup
11444 @@ -21923,185 +21921,72 @@ Never fails.
11445 itlist, end_itlist.
11446
11447 \ENDDOC
11448 -\DOC{REWRITE\_CONV}
11449 -
11450 -\TYPE {\small\verb%REWRITE_CONV : (thm list -> conv)%}\egroup
11451 -
11452 -\SYNOPSIS
11453 -Rewrites a term including built-in tautologies in the list of rewrites.
11454 -
11455 -\DESCRIBE
11456 -Rewriting a term using {\small\verb%REWRITE_CONV%} utilizes as rewrites two sets
11457 -of theorems: the tautologies in the ML list {\small\verb%basic_rewrites%} and the
11458 -ones supplied by the user. The rule searches top-down and recursively
11459 -for subterms which match the left-hand side of any of the possible
11460 -rewrites, until none of the transformations are applicable. There is no
11461 -ordering specified among the set of rewrites.
11462 -
11463 -Variants of this conversion allow changes in the set of equations used:
11464 -{\small\verb%PURE_REWRITE_CONV%} and others in its family do not rewrite with the
11465 -theorems in {\small\verb%basic_rewrites%}.
11466 -
11467 -The top-down recursive search for matches may not be desirable, as
11468 -this may increase the number of inferences being made or may result in
11469 -divergence. In this case other rewriting tools such as
11470 -{\small\verb%ONCE_REWRITE_CONV%} and {\small\verb%GEN_REWRITE_CONV%} can be used, or the set of
11471 -theorems given may be reduced.
11472 -
11473 -See {\small\verb%GEN_REWRITE_CONV%} for the general strategy for simplifying
11474 -theorems in HOL using equational theorems.
11475 -
11476 -\FAILURE
11477 -Does not fail, but may diverge if the sequence of rewrites is
11478 -non-terminating.
11479 -
11480 -\USES
11481 -Used to manipulate terms by rewriting them with theorems.
11482 -While resulting in high degree of automation, {\small\verb%REWRITE_CONV%} can
11483 -spawn a large number of inference steps. Thus, variants such
11484 -as {\small\verb%PURE_REWRITE_CONV%}, or other rules such as {\small\verb%SUBST_CONV%}, may be used
11485 -instead to improve efficiency.
11486 -
11487 -\SEEALSO
11488 -basic_rewrites, GEN_REWRITE_CONV, ONCE_REWRITE_CONV,
11489 -PURE_REWRITE_CONV, REWR_CONV, SUBST_CONV.
11490 -
11491 -\ENDDOC
11492 -\DOC{REWRITE\_RULE}
11493 -
11494 -\TYPE {\small\verb%REWRITE_RULE : (thm list -> thm -> thm)%}\egroup
11495 -
11496 -\SYNOPSIS
11497 -Rewrites a theorem including built-in tautologies in the list of rewrites.
11498 -
11499 -\DESCRIBE
11500 -Rewriting a theorem using {\small\verb%REWRITE_RULE%} utilizes as rewrites two sets
11501 -of theorems: the tautologies in the ML list {\small\verb%basic_rewrites%} and the
11502 -ones supplied by the user. The rule searches top-down and recursively
11503 -for subterms which match the left-hand side of any of the possible
11504 -rewrites, until none of the transformations are applicable. There is no
11505 -ordering specified among the set of rewrites.
11506 -
11507 -Variants of this rule allow changes in the set of equations used:
11508 -{\small\verb%PURE_REWRITE_RULE%} and others in its family do not rewrite with the
11509 -theorems in {\small\verb%basic_rewrites%}. Rules such as {\small\verb%ASM_REWRITE_RULE%} add the
11510 -assumptions of the object theorem (or a specified subset of these assumptions)
11511 -to the set of possible rewrites.
11512 -
11513 -The top-down recursive search for matches may not be desirable, as
11514 -this may increase the number of inferences being made or may result in
11515 -divergence. In this case other rewriting tools such as
11516 -{\small\verb%ONCE_REWRITE_RULE%} and {\small\verb%GEN_REWRITE_RULE%} can be used, or the set of
11517 -theorems given may be reduced.
11518 -
11519 -See {\small\verb%GEN_REWRITE_RULE%} for the general strategy for simplifying
11520 -theorems in HOL using equational theorems.
11521 -
11522 -\FAILURE
11523 -Does not fail, but may diverge if the sequence of rewrites is
11524 -non-terminating.
11525 -
11526 -\USES
11527 -Used to manipulate theorems by rewriting them with other theorems.
11528 -While resulting in high degree of automation, {\small\verb%REWRITE_RULE%} can
11529 -spawn a large number of inference steps. Thus, variants such
11530 -as {\small\verb%PURE_REWRITE_RULE%}, or other rules such as {\small\verb%SUBST%}, may be used
11531 -instead to improve efficiency.
11532 -
11533 -\SEEALSO
11534 -ASM_REWRITE_RULE, basic_rewrites, GEN_REWRITE_RULE, ONCE_REWRITE_RULE,
11535 -PURE_REWRITE_RULE, REWR_CONV, REWRITE_CONV, SUBST.
11536 -
11537 -\ENDDOC
11538 -\DOC{REWRITE\_TAC}
11539 +\DOC{REW\_DEPTH\_CONV}
11540
11541 -\TYPE {\small\verb%REWRITE_TAC : (thm list -> tactic)%}\egroup
11542 +\TYPE {\small\verb%REW_DEPTH_CONV : (conv -> conv)%}\egroup
11543
11544 \SYNOPSIS
11545 -Rewrites a goal including built-in tautologies in the list of rewrites.
11546 +Applies a conversion top-down to all subterms, retraversing changed ones.
11547 +For use in rewriting.
11548
11549 \DESCRIBE
11550 -Rewriting tactics in HOL provide a recursive left-to-right matching
11551 -and rewriting facility that automatically decomposes subgoals and
11552 -justifies segments of proof in which equational theorems are used,
11553 -singly or collectively. These include the unfolding of definitions,
11554 -and the substitution of equals for equals. Rewriting is used either
11555 -to advance or to complete the decomposition of subgoals.
11556 -
11557 -{\small\verb%REWRITE_TAC%} transforms (or solves) a goal by using as rewrite rules
11558 -(i.e. as left-to-right replacement rules) the conclusions of the given
11559 -list of (equational) theorems, as well as a set of built-in theorems
11560 -(common tautologies) held in the ML variable {\small\verb%basic_rewrites%}.
11561 -Recognition of a tautology often terminates the subgoaling process
11562 -(i.e. solves the goal).
11563 -
11564 -The equational rewrites generated are applied recursively and to
11565 -arbitrary depth, with matching and instantiation of variables and type
11566 -variables. A list of rewrites can set off an infinite rewriting
11567 -process, and it is not, of course, decidable in general whether a
11568 -rewrite set has that property. The order in which the rewrite theorems
11569 -are applied is unspecified, and the user should not depend on any
11570 -ordering.
11571 -
11572 -See {\small\verb%GEN_REWRITE_TAC%} for more details on the rewriting process.
11573 -Variants of {\small\verb%REWRITE_TAC%} allow the use of a different set of
11574 -rewrites. Some of them, such as {\small\verb%PURE_REWRITE_TAC%}, exclude the basic
11575 -tautologies from the possible transformations. {\small\verb%ASM_REWRITE_TAC%} and
11576 -others include the assumptions at the goal in the set of possible
11577 -rewrites.
11578 +{\small\verb%REW_DEPTH_CONV c tm%} repeatedly applies the conversion {\small\verb%c%} to all the subterms
11579 +of the term {\small\verb%tm%}, including the term {\small\verb%tm%} itself. The supplied conversion {\small\verb%c%}
11580 +is applied to the subterms of {\small\verb%tm%} in top-down order and is applied repeatedly
11581 +(zero or more times, as is done by {\small\verb%REPEATC%}) at each subterm until it fails.
11582 +If a subterm {\small\verb%t%} is changed (up to alpha-equivalence) by virtue of the
11583 +application of {\small\verb%c%} to its own subterms, then the term into which {\small\verb%t%} is
11584 +transformed is retraversed by applying {\small\verb%REW_DEPTH_CONV c%} to it.
11585
11586 -Still other tactics allow greater control over the search for
11587 -rewritable subterms. Several of them such as {\small\verb%ONCE_REWRITE_TAC%} do not
11588 -apply rewrites recursively. {\small\verb%GEN_REWRITE_TAC%} allows a rewrite to be
11589 -applied at a particular subterm.
11590 +{\small\verb%REW_DEPTH_CONV%} is a special version of {\small\verb%TOP_DEPTH_CONV%} for use by the
11591 +rewriting conversions, rules and tactics. It differs from {\small\verb%TOP_DEPTH_CONV%} as
11592 +follows: If converting an abstraction fails due to the presence of the bound
11593 +variable in the hypotheses of the theorem generated by converting the body,
11594 +{\small\verb%REW_DEPTH_CONV%} retries the conversion having renamed the bound variable of
11595 +the abstraction. If successful the renaming is reversed.
11596
11597 \FAILURE
11598 -{\small\verb%REWRITE_TAC%} does not fail. Certain sets of rewriting theorems on
11599 -certain goals may cause a non-terminating sequence of rewrites.
11600 -Divergent rewriting behaviour results from a term {\small\verb%t%} being
11601 -immediately or eventually rewritten to a term containing {\small\verb%t%} as a
11602 -sub-term. The exact behaviour depends on the {\small\verb%HOL%} implementation; it
11603 -may be possible (unfortunately) to fall into Lisp in this event.
11604 +{\small\verb%REW_DEPTH_CONV c tm%} never fails but can diverge.
11605
11606 \EXAMPLE
11607 -The arithmetic theorem {\small\verb%GREATER%}, {\small\verb%|- !m n. m > n = n < m%}, is used
11608 -below to advance a goal:
11609 +The following example illustrates the difference between the functions
11610 +{\small\verb%REW_DEPTH_CONV%} and {\small\verb%TOP_DEPTH_CONV%}. It is not intended to illustrate the
11611 +full range of behaviour of the former. Both {\small\verb%REW_DEPTH_CONV%} and
11612 +{\small\verb%TOP_DEPTH_CONV%} successfully apply the theorem {\small\verb%ADD_0%} inside an abstraction:
11613 {\par\samepage\setseps\small
11614 \begin{verbatim}
11615 - #REWRITE_TAC[GREATER]([],"5 > 4");;
11616 - ([([], "4 < 5")], -) : subgoals
11617 + #REW_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
11618 + |- (\n. n + 0) = (\n. n)
11619 +
11620 + #TOP_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
11621 + |- (\n. n + 0) = (\n. n)
11622 \end{verbatim}
11623 }
11624 -\noindent It is used below with the theorem {\small\verb%LESS_0%},
11625 -{\small\verb%|- !n. 0 < (SUC n)%}, to solve a goal:
11626 +\noindent However, if a hypothesis containing a free occurrence of the bound
11627 +variable is added to the rewrite rule, it interferes with the operation of
11628 +{\small\verb%TOP_DEPTH_CONV%} but not that of {\small\verb%REW_DEPTH_CONV%}:
11629 {\par\samepage\setseps\small
11630 \begin{verbatim}
11631 - #let gl,p = REWRITE_TAC[GREATER;LESS_0]([],"(SUC n) > 0");;
11632 - gl = [] : goal list
11633 - p = - : proof
11634 + #let th = ADD_ASSUM "n = 0" ADD_0;;
11635 + th = n = 0 |- !m. m + 0 = m
11636 +
11637 + #REW_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
11638 + n = 0 |- (\n. n + 0) = (\n. n)
11639
11640 - #p[];;
11641 - |- (SUC n) > 0
11642 + #TOP_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
11643 + |- (\n. n + 0) = (\n. n + 0)
11644 \end{verbatim}
11645 }
11646 -\USES
11647 -Rewriting is a powerful and general mechanism in HOL, and an
11648 -important part of many proofs. It relieves the user of the burden of
11649 -directing and justifying a large number of minor proof steps.
11650 -{\small\verb%REWRITE_TAC%} fits a forward proof sequence smoothly into the general
11651 -goal-oriented framework. That is, (within one subgoaling step) it
11652 -produces and justifies certain forward inferences, none of which are
11653 -necessarily on a direct path to the desired goal.
11654 -
11655 -{\small\verb%REWRITE_TAC%} may be more powerful a tactic than is needed in certain
11656 -situations; if efficiency is at stake, alternatives might be
11657 -considered.
11658 +\COMMENTS
11659 +The implementation of this function uses failure to avoid rebuilding
11660 +unchanged subterms. That is to say, during execution the failure string
11661 +{\small\verb%`QCONV`%} may be generated and later trapped. The behaviour of the function
11662 +is dependent on this use of failure. So, if the conversion given as argument
11663 +happens to generate a failure with string {\small\verb%`QCONV`%}, the operation of
11664 +{\small\verb%REW_DEPTH_CONV%} will be unpredictable.
11665
11666 \SEEALSO
11667 -ASM_REWRITE_TAC, GEN_REWRITE_TAC, FILTER_ASM_REWRITE_TAC,
11668 -FILTER_ONCE_ASM_REWRITE_TAC, ONCE_ASM_REWRITE_TAC, ONCE_REWRITE_TAC,
11669 -PURE_ASM_REWRITE_TAC, PURE_ONCE_ASM_REWRITE_TAC,
11670 -PURE_ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWR_CONV, REWRITE_CONV, SUBST_TAC.
11671 +ONCE_REW_DEPTH_CONV, TOP_DEPTH_CONV.
11672
11673 \ENDDOC
11674 \DOC{REWR\_CONV}
11675 @@ -22271,72 +22156,185 @@ must be instantiated in order to match t
11676 REWRITE_CONV.
11677
11678 \ENDDOC
11679 -\DOC{REW\_DEPTH\_CONV}
11680 +\DOC{REWRITE\_CONV}
11681
11682 -\TYPE {\small\verb%REW_DEPTH_CONV : (conv -> conv)%}\egroup
11683 +\TYPE {\small\verb%REWRITE_CONV : (thm list -> conv)%}\egroup
11684
11685 \SYNOPSIS
11686 -Applies a conversion top-down to all subterms, retraversing changed ones.
11687 -For use in rewriting.
11688 +Rewrites a term including built-in tautologies in the list of rewrites.
11689
11690 \DESCRIBE
11691 -{\small\verb%REW_DEPTH_CONV c tm%} repeatedly applies the conversion {\small\verb%c%} to all the subterms
11692 -of the term {\small\verb%tm%}, including the term {\small\verb%tm%} itself. The supplied conversion {\small\verb%c%}
11693 -is applied to the subterms of {\small\verb%tm%} in top-down order and is applied repeatedly
11694 -(zero or more times, as is done by {\small\verb%REPEATC%}) at each subterm until it fails.
11695 -If a subterm {\small\verb%t%} is changed (up to alpha-equivalence) by virtue of the
11696 -application of {\small\verb%c%} to its own subterms, then the term into which {\small\verb%t%} is
11697 -transformed is retraversed by applying {\small\verb%REW_DEPTH_CONV c%} to it.
11698 +Rewriting a term using {\small\verb%REWRITE_CONV%} utilizes as rewrites two sets
11699 +of theorems: the tautologies in the ML list {\small\verb%basic_rewrites%} and the
11700 +ones supplied by the user. The rule searches top-down and recursively
11701 +for subterms which match the left-hand side of any of the possible
11702 +rewrites, until none of the transformations are applicable. There is no
11703 +ordering specified among the set of rewrites.
11704
11705 -{\small\verb%REW_DEPTH_CONV%} is a special version of {\small\verb%TOP_DEPTH_CONV%} for use by the
11706 -rewriting conversions, rules and tactics. It differs from {\small\verb%TOP_DEPTH_CONV%} as
11707 -follows: If converting an abstraction fails due to the presence of the bound
11708 -variable in the hypotheses of the theorem generated by converting the body,
11709 -{\small\verb%REW_DEPTH_CONV%} retries the conversion having renamed the bound variable of
11710 -the abstraction. If successful the renaming is reversed.
11711 +Variants of this conversion allow changes in the set of equations used:
11712 +{\small\verb%PURE_REWRITE_CONV%} and others in its family do not rewrite with the
11713 +theorems in {\small\verb%basic_rewrites%}.
11714 +
11715 +The top-down recursive search for matches may not be desirable, as
11716 +this may increase the number of inferences being made or may result in
11717 +divergence. In this case other rewriting tools such as
11718 +{\small\verb%ONCE_REWRITE_CONV%} and {\small\verb%GEN_REWRITE_CONV%} can be used, or the set of
11719 +theorems given may be reduced.
11720 +
11721 +See {\small\verb%GEN_REWRITE_CONV%} for the general strategy for simplifying
11722 +theorems in HOL using equational theorems.
11723
11724 \FAILURE
11725 -{\small\verb%REW_DEPTH_CONV c tm%} never fails but can diverge.
11726 +Does not fail, but may diverge if the sequence of rewrites is
11727 +non-terminating.
11728 +
11729 +\USES
11730 +Used to manipulate terms by rewriting them with theorems.
11731 +While resulting in high degree of automation, {\small\verb%REWRITE_CONV%} can
11732 +spawn a large number of inference steps. Thus, variants such
11733 +as {\small\verb%PURE_REWRITE_CONV%}, or other rules such as {\small\verb%SUBST_CONV%}, may be used
11734 +instead to improve efficiency.
11735 +
11736 +\SEEALSO
11737 +basic_rewrites, GEN_REWRITE_CONV, ONCE_REWRITE_CONV,
11738 +PURE_REWRITE_CONV, REWR_CONV, SUBST_CONV.
11739 +
11740 +\ENDDOC
11741 +\DOC{REWRITE\_RULE}
11742 +
11743 +\TYPE {\small\verb%REWRITE_RULE : (thm list -> thm -> thm)%}\egroup
11744 +
11745 +\SYNOPSIS
11746 +Rewrites a theorem including built-in tautologies in the list of rewrites.
11747 +
11748 +\DESCRIBE
11749 +Rewriting a theorem using {\small\verb%REWRITE_RULE%} utilizes as rewrites two sets
11750 +of theorems: the tautologies in the ML list {\small\verb%basic_rewrites%} and the
11751 +ones supplied by the user. The rule searches top-down and recursively
11752 +for subterms which match the left-hand side of any of the possible
11753 +rewrites, until none of the transformations are applicable. There is no
11754 +ordering specified among the set of rewrites.
11755 +
11756 +Variants of this rule allow changes in the set of equations used:
11757 +{\small\verb%PURE_REWRITE_RULE%} and others in its family do not rewrite with the
11758 +theorems in {\small\verb%basic_rewrites%}. Rules such as {\small\verb%ASM_REWRITE_RULE%} add the
11759 +assumptions of the object theorem (or a specified subset of these assumptions)
11760 +to the set of possible rewrites.
11761 +
11762 +The top-down recursive search for matches may not be desirable, as
11763 +this may increase the number of inferences being made or may result in
11764 +divergence. In this case other rewriting tools such as
11765 +{\small\verb%ONCE_REWRITE_RULE%} and {\small\verb%GEN_REWRITE_RULE%} can be used, or the set of
11766 +theorems given may be reduced.
11767 +
11768 +See {\small\verb%GEN_REWRITE_RULE%} for the general strategy for simplifying
11769 +theorems in HOL using equational theorems.
11770 +
11771 +\FAILURE
11772 +Does not fail, but may diverge if the sequence of rewrites is
11773 +non-terminating.
11774 +
11775 +\USES
11776 +Used to manipulate theorems by rewriting them with other theorems.
11777 +While resulting in high degree of automation, {\small\verb%REWRITE_RULE%} can
11778 +spawn a large number of inference steps. Thus, variants such
11779 +as {\small\verb%PURE_REWRITE_RULE%}, or other rules such as {\small\verb%SUBST%}, may be used
11780 +instead to improve efficiency.
11781 +
11782 +\SEEALSO
11783 +ASM_REWRITE_RULE, basic_rewrites, GEN_REWRITE_RULE, ONCE_REWRITE_RULE,
11784 +PURE_REWRITE_RULE, REWR_CONV, REWRITE_CONV, SUBST.
11785 +
11786 +\ENDDOC
11787 +\DOC{REWRITE\_TAC}
11788 +
11789 +\TYPE {\small\verb%REWRITE_TAC : (thm list -> tactic)%}\egroup
11790 +
11791 +\SYNOPSIS
11792 +Rewrites a goal including built-in tautologies in the list of rewrites.
11793 +
11794 +\DESCRIBE
11795 +Rewriting tactics in HOL provide a recursive left-to-right matching
11796 +and rewriting facility that automatically decomposes subgoals and
11797 +justifies segments of proof in which equational theorems are used,
11798 +singly or collectively. These include the unfolding of definitions,
11799 +and the substitution of equals for equals. Rewriting is used either
11800 +to advance or to complete the decomposition of subgoals.
11801 +
11802 +{\small\verb%REWRITE_TAC%} transforms (or solves) a goal by using as rewrite rules
11803 +(i.e. as left-to-right replacement rules) the conclusions of the given
11804 +list of (equational) theorems, as well as a set of built-in theorems
11805 +(common tautologies) held in the ML variable {\small\verb%basic_rewrites%}.
11806 +Recognition of a tautology often terminates the subgoaling process
11807 +(i.e. solves the goal).
11808 +
11809 +The equational rewrites generated are applied recursively and to
11810 +arbitrary depth, with matching and instantiation of variables and type
11811 +variables. A list of rewrites can set off an infinite rewriting
11812 +process, and it is not, of course, decidable in general whether a
11813 +rewrite set has that property. The order in which the rewrite theorems
11814 +are applied is unspecified, and the user should not depend on any
11815 +ordering.
11816 +
11817 +See {\small\verb%GEN_REWRITE_TAC%} for more details on the rewriting process.
11818 +Variants of {\small\verb%REWRITE_TAC%} allow the use of a different set of
11819 +rewrites. Some of them, such as {\small\verb%PURE_REWRITE_TAC%}, exclude the basic
11820 +tautologies from the possible transformations. {\small\verb%ASM_REWRITE_TAC%} and
11821 +others include the assumptions at the goal in the set of possible
11822 +rewrites.
11823 +
11824 +Still other tactics allow greater control over the search for
11825 +rewritable subterms. Several of them such as {\small\verb%ONCE_REWRITE_TAC%} do not
11826 +apply rewrites recursively. {\small\verb%GEN_REWRITE_TAC%} allows a rewrite to be
11827 +applied at a particular subterm.
11828 +
11829 +\FAILURE
11830 +{\small\verb%REWRITE_TAC%} does not fail. Certain sets of rewriting theorems on
11831 +certain goals may cause a non-terminating sequence of rewrites.
11832 +Divergent rewriting behaviour results from a term {\small\verb%t%} being
11833 +immediately or eventually rewritten to a term containing {\small\verb%t%} as a
11834 +sub-term. The exact behaviour depends on the {\small\verb%HOL%} implementation; it
11835 +may be possible (unfortunately) to fall into Lisp in this event.
11836
11837 \EXAMPLE
11838 -The following example illustrates the difference between the functions
11839 -{\small\verb%REW_DEPTH_CONV%} and {\small\verb%TOP_DEPTH_CONV%}. It is not intended to illustrate the
11840 -full range of behaviour of the former. Both {\small\verb%REW_DEPTH_CONV%} and
11841 -{\small\verb%TOP_DEPTH_CONV%} successfully apply the theorem {\small\verb%ADD_0%} inside an abstraction:
11842 +The arithmetic theorem {\small\verb%GREATER%}, {\small\verb%|- !m n. m > n = n < m%}, is used
11843 +below to advance a goal:
11844 {\par\samepage\setseps\small
11845 \begin{verbatim}
11846 - #REW_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
11847 - |- (\n. n + 0) = (\n. n)
11848 -
11849 - #TOP_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
11850 - |- (\n. n + 0) = (\n. n)
11851 + #REWRITE_TAC[GREATER]([],"5 > 4");;
11852 + ([([], "4 < 5")], -) : subgoals
11853 \end{verbatim}
11854 }
11855 -\noindent However, if a hypothesis containing a free occurrence of the bound
11856 -variable is added to the rewrite rule, it interferes with the operation of
11857 -{\small\verb%TOP_DEPTH_CONV%} but not that of {\small\verb%REW_DEPTH_CONV%}:
11858 +\noindent It is used below with the theorem {\small\verb%LESS_0%},
11859 +{\small\verb%|- !n. 0 < (SUC n)%}, to solve a goal:
11860 {\par\samepage\setseps\small
11861 \begin{verbatim}
11862 - #let th = ADD_ASSUM "n = 0" ADD_0;;
11863 - th = n = 0 |- !m. m + 0 = m
11864 -
11865 - #REW_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
11866 - n = 0 |- (\n. n + 0) = (\n. n)
11867 + #let gl,p = REWRITE_TAC[GREATER;LESS_0]([],"(SUC n) > 0");;
11868 + gl = [] : goal list
11869 + p = - : proof
11870
11871 - #TOP_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
11872 - |- (\n. n + 0) = (\n. n + 0)
11873 + #p[];;
11874 + |- (SUC n) > 0
11875 \end{verbatim}
11876 }
11877 -\COMMENTS
11878 -The implementation of this function uses failure to avoid rebuilding
11879 -unchanged subterms. That is to say, during execution the failure string
11880 -{\small\verb%`QCONV`%} may be generated and later trapped. The behaviour of the function
11881 -is dependent on this use of failure. So, if the conversion given as argument
11882 -happens to generate a failure with string {\small\verb%`QCONV`%}, the operation of
11883 -{\small\verb%REW_DEPTH_CONV%} will be unpredictable.
11884 +\USES
11885 +Rewriting is a powerful and general mechanism in HOL, and an
11886 +important part of many proofs. It relieves the user of the burden of
11887 +directing and justifying a large number of minor proof steps.
11888 +{\small\verb%REWRITE_TAC%} fits a forward proof sequence smoothly into the general
11889 +goal-oriented framework. That is, (within one subgoaling step) it
11890 +produces and justifies certain forward inferences, none of which are
11891 +necessarily on a direct path to the desired goal.
11892 +
11893 +{\small\verb%REWRITE_TAC%} may be more powerful a tactic than is needed in certain
11894 +situations; if efficiency is at stake, alternatives might be
11895 +considered.
11896
11897 \SEEALSO
11898 -ONCE_REW_DEPTH_CONV, TOP_DEPTH_CONV.
11899 +ASM_REWRITE_TAC, GEN_REWRITE_TAC, FILTER_ASM_REWRITE_TAC,
11900 +FILTER_ONCE_ASM_REWRITE_TAC, ONCE_ASM_REWRITE_TAC, ONCE_REWRITE_TAC,
11901 +PURE_ASM_REWRITE_TAC, PURE_ONCE_ASM_REWRITE_TAC,
11902 +PURE_ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWR_CONV, REWRITE_CONV, SUBST_TAC.
11903
11904 \ENDDOC
11905 \DOC{rhs}
11906 @@ -22722,20 +22720,6 @@ It does not matter if the goal has no as
11907 ASSUM_LIST, MAP_EVERY, MAP_FIRST, POP_ASSUM_LIST.
11908
11909 \ENDDOC
11910 -\DOC{S}
11911 -
11912 -\TYPE {\small\verb%S : ((* -> ** -> ***) -> (* -> **) -> * -> ***)%}\egroup
11913 -
11914 -\SYNOPSIS
11915 -Performs function composition: {\small\verb%S f g x%} = {\small\verb%f x (g x)%} (the {\small\verb%S%} combinator).
11916 -
11917 -\FAILURE
11918 -Never fails.
11919 -
11920 -\SEEALSO
11921 -\#, B, C, CB, Co, I, K, KI, o, oo, W.
11922 -
11923 -\ENDDOC
11924 \DOC{save}
11925
11926 \TYPE {\small\verb%save : (string -> void)%}\egroup
11927 @@ -22977,10 +22961,24 @@ To sum the elements of a list and save t
11928 }
11929
11930 \SEEALSO
11931 -SCANL_CONV, FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV.
11932 +SCANL_CONV, FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV.
11933 +
11934 +\ENDDOC
11935 +
11936 +\DOC{S}
11937 +
11938 +\TYPE {\small\verb%S : ((* -> ** -> ***) -> (* -> **) -> * -> ***)%}\egroup
11939 +
11940 +\SYNOPSIS
11941 +Performs function composition: {\small\verb%S f g x%} = {\small\verb%f x (g x)%} (the {\small\verb%S%} combinator).
11942 +
11943 +\FAILURE
11944 +Never fails.
11945 +
11946 +\SEEALSO
11947 +\#, B, C, CB, Co, I, K, KI, o, oo, W.
11948
11949 \ENDDOC
11950 -
11951 \DOC{search\_path}
11952
11953 \TYPE {\small\verb%search_path : (void -> string list)%}\egroup
11954 @@ -23327,35 +23325,6 @@ constant defined using the epsilon opera
11955 CHOOSE, SELECT_AX, SELECT_CONV, SELECT_ELIM, SELECT_INTRO.
11956
11957 \ENDDOC
11958 -\DOC{setify}
11959 -
11960 -\TYPE {\small\verb%setify : (* list -> * list)%}\egroup
11961 -
11962 -\SYNOPSIS
11963 -Removes repeated elements from a list. Makes a list into a `set'.
11964 -
11965 -\DESCRIBE
11966 -{\small\verb%setify l%} removes repeated elements from {\small\verb%l%}, leaving the last occurrence of
11967 -each duplicate in the list.
11968 -
11969 -\FAILURE
11970 -Never fails.
11971 -
11972 -\EXAMPLE
11973 -{\par\samepage\setseps\small
11974 -\begin{verbatim}
11975 -#setify [1;2;3;1;4;3];;
11976 -[2; 1; 4; 3] : int list
11977 -\end{verbatim}
11978 -}
11979 -\COMMENTS
11980 -Perhaps the first occurrence of each duplicate should be left in the list, not
11981 -the last? However, other functions may rely on the ordering currently used.
11982 -
11983 -\SEEALSO
11984 -distinct.
11985 -
11986 -\ENDDOC
11987 \DOC{set\_equal}
11988
11989 \TYPE {\small\verb%set_equal : (* list -> * list -> bool)%}\egroup
11990 @@ -23599,6 +23568,35 @@ Never fails.
11991 help_search_path, install, search_path, set_search_path.
11992
11993 \ENDDOC
11994 +\DOC{setify}
11995 +
11996 +\TYPE {\small\verb%setify : (* list -> * list)%}\egroup
11997 +
11998 +\SYNOPSIS
11999 +Removes repeated elements from a list. Makes a list into a `set'.
12000 +
12001 +\DESCRIBE
12002 +{\small\verb%setify l%} removes repeated elements from {\small\verb%l%}, leaving the last occurrence of
12003 +each duplicate in the list.
12004 +
12005 +\FAILURE
12006 +Never fails.
12007 +
12008 +\EXAMPLE
12009 +{\par\samepage\setseps\small
12010 +\begin{verbatim}
12011 +#setify [1;2;3;1;4;3];;
12012 +[2; 1; 4; 3] : int list
12013 +\end{verbatim}
12014 +}
12015 +\COMMENTS
12016 +Perhaps the first occurrence of each duplicate should be left in the list, not
12017 +the last? However, other functions may rely on the ordering currently used.
12018 +
12019 +\SEEALSO
12020 +distinct.
12021 +
12022 +\ENDDOC
12023 \DOC{set\_interface\_map}
12024
12025 \TYPE {\small\verb%set_interface_map : ((string # string) list -> (string # string) list)%}\egroup
12026 @@ -24272,6 +24270,45 @@ that the `ordering' is not antisymmetric
12027 \end{verbatim}
12028 }
12029 \ENDDOC
12030 +\DOC{SPEC\_ALL}
12031 +
12032 +\TYPE {\small\verb%SPEC_ALL : (thm -> thm)%}\egroup
12033 +
12034 +\SYNOPSIS
12035 +Specializes the conclusion of a theorem with its own quantified variables.
12036 +
12037 +\DESCRIBE
12038 +When applied to a theorem {\small\verb%A |- !x1...xn. t%}, the inference rule {\small\verb%SPEC_ALL%}
12039 +returns the theorem {\small\verb%A |- t[x1'/x1]...[xn'/xn]%} where the {\small\verb%xi'%} are distinct
12040 +variants of the corresponding {\small\verb%xi%}, chosen to avoid clashes with any variables
12041 +free in the assumption list and with the names of constants. Normally {\small\verb%xi'%} is
12042 +just {\small\verb%xi%}, in which case {\small\verb%SPEC_ALL%} simply removes all universal quantifiers.
12043 +{\par\samepage\setseps\small
12044 +\begin{verbatim}
12045 + A |- !x1...xn. t
12046 + --------------------------- SPEC_ALL
12047 + A |- t[x1'/x1]...[xn'/xn]
12048 +\end{verbatim}
12049 +}
12050 +\FAILURE
12051 +Never fails.
12052 +
12053 +\EXAMPLE
12054 +The following example shows how variables are also renamed to avoid clashing
12055 +with the names of constants.
12056 +{\par\samepage\setseps\small
12057 +\begin{verbatim}
12058 + #let v=mk_var(`T`,":bool") in ASSUME "!^v. ^v \/ ~^v";;
12059 + !T. T \/ ~T |- !T. T \/ ~T
12060 +
12061 + #SPEC_ALL it;;
12062 + !T. T \/ ~T |- T' \/ ~T'
12063 +\end{verbatim}
12064 +}
12065 +\SEEALSO
12066 +GEN, GENL, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC.
12067 +
12068 +\ENDDOC
12069 \DOC{SPEC}
12070
12071 \TYPE {\small\verb%SPEC : (term -> thm -> thm)%}\egroup
12072 @@ -24379,45 +24416,6 @@ The following is a specialization of a t
12073 GEN, GENL, GEN_ALL, GEN_TAC, SPEC, SPEC_ALL, SPEC_TAC.
12074
12075 \ENDDOC
12076 -\DOC{SPEC\_ALL}
12077 -
12078 -\TYPE {\small\verb%SPEC_ALL : (thm -> thm)%}\egroup
12079 -
12080 -\SYNOPSIS
12081 -Specializes the conclusion of a theorem with its own quantified variables.
12082 -
12083 -\DESCRIBE
12084 -When applied to a theorem {\small\verb%A |- !x1...xn. t%}, the inference rule {\small\verb%SPEC_ALL%}
12085 -returns the theorem {\small\verb%A |- t[x1'/x1]...[xn'/xn]%} where the {\small\verb%xi'%} are distinct
12086 -variants of the corresponding {\small\verb%xi%}, chosen to avoid clashes with any variables
12087 -free in the assumption list and with the names of constants. Normally {\small\verb%xi'%} is
12088 -just {\small\verb%xi%}, in which case {\small\verb%SPEC_ALL%} simply removes all universal quantifiers.
12089 -{\par\samepage\setseps\small
12090 -\begin{verbatim}
12091 - A |- !x1...xn. t
12092 - --------------------------- SPEC_ALL
12093 - A |- t[x1'/x1]...[xn'/xn]
12094 -\end{verbatim}
12095 -}
12096 -\FAILURE
12097 -Never fails.
12098 -
12099 -\EXAMPLE
12100 -The following example shows how variables are also renamed to avoid clashing
12101 -with the names of constants.
12102 -{\par\samepage\setseps\small
12103 -\begin{verbatim}
12104 - #let v=mk_var(`T`,":bool") in ASSUME "!^v. ^v \/ ~^v";;
12105 - !T. T \/ ~T |- !T. T \/ ~T
12106 -
12107 - #SPEC_ALL it;;
12108 - !T. T \/ ~T |- T' \/ ~T'
12109 -\end{verbatim}
12110 -}
12111 -\SEEALSO
12112 -GEN, GENL, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC.
12113 -
12114 -\ENDDOC
12115 \DOC{SPEC\_TAC}
12116
12117 \TYPE {\small\verb%SPEC_TAC : ((term # term) -> tactic)%}\egroup
12118 @@ -25123,6 +25121,50 @@ Generating a case split from the axioms
12119 ASM_CASES_TAC, BOOL_CASES_TAC, COND_CASES_TAC, DISJ_CASES_TAC.
12120
12121 \ENDDOC
12122 +\DOC{SUB\_CONV}
12123 +
12124 +\TYPE {\small\verb%SUB_CONV : (conv -> conv)%}\egroup
12125 +
12126 +\SYNOPSIS
12127 +Applies a conversion to the top-level subterms of a term.
12128 +
12129 +\DESCRIBE
12130 +For any conversion {\small\verb%c%}, the function returned by {\small\verb%SUB_CONV c%} is a conversion
12131 +that applies {\small\verb%c%} to all the top-level subterms of a term. If the conversion
12132 +{\small\verb%c%} maps {\small\verb%t%} to {\small\verb%|- t = t'%}, then {\small\verb%SUB_CONV c%} maps an abstraction {\small\verb%"\x.t"%} to
12133 +the theorem:
12134 +{\par\samepage\setseps\small
12135 +\begin{verbatim}
12136 + |- (\x.t) = (\x.t')
12137 +\end{verbatim}
12138 +}
12139 +\noindent That is, {\small\verb%SUB_CONV c "\x.t"%} applies {\small\verb%c%} to the body of the
12140 +abstraction {\small\verb%"\x.t"%}. If {\small\verb%c%} is a conversion that maps {\small\verb%"t1"%} to the theorem
12141 +{\small\verb%|- t1 = t1'%} and {\small\verb%"t2"%} to the theorem {\small\verb%|- t2 = t2'%}, then the conversion
12142 +{\small\verb%SUB_CONV c%} maps an application {\small\verb%"t1 t2"%} to the theorem:
12143 +{\par\samepage\setseps\small
12144 +\begin{verbatim}
12145 + |- (t1 t2) = (t1' t2')
12146 +\end{verbatim}
12147 +}
12148 +\noindent That is, {\small\verb%SUB_CONV c "t1 t2"%} applies {\small\verb%c%} to the both the operator
12149 +{\small\verb%t1%} and the operand {\small\verb%t2%} of the application {\small\verb%"t1 t2"%}. Finally, for any
12150 +conversion {\small\verb%c%}, the function returned by {\small\verb%SUB_CONV c%} acts as the identity
12151 +conversion on variables and constants. That is, if {\small\verb%"t"%} is a variable or
12152 +constant, then {\small\verb%SUB_CONV c "t"%} returns {\small\verb%|- t = t%}.
12153 +
12154 +\FAILURE
12155 +{\small\verb%SUB_CONV c tm%} fails if {\small\verb%tm%} is an abstraction {\small\verb%"\x.t"%} and the conversion {\small\verb%c%}
12156 +fails when applied to {\small\verb%t%}, or if {\small\verb%tm%} is an application {\small\verb%"t1 t2"%} and the
12157 +conversion {\small\verb%c%} fails when applied to either {\small\verb%t1%} or {\small\verb%t2%}. The function
12158 +returned by {\small\verb%SUB_CONV c%} may also fail if the ML function {\small\verb%c:term->thm%} is not,
12159 +in fact, a conversion (i.e. a function that maps a term {\small\verb%t%} to a theorem
12160 +{\small\verb%|- t = t'%}).
12161 +
12162 +\SEEALSO
12163 +ABS_CONV, RAND_CONV, RATOR_CONV.
12164 +
12165 +\ENDDOC
12166 \DOC{SUBGOAL\_THEN}
12167
12168 \TYPE {\small\verb%SUBGOAL_THEN : (term -> thm_tactic -> tactic)%}\egroup
12169 @@ -25220,141 +25262,80 @@ Substitutions are made with the theorems
12170 \begin{verbatim}
12171 #let thm1 = SPECL ["m:num"; "n:num"] ADD_SYM
12172 #and thm2 = CONJUNCT1 ADD_CLAUSES;;
12173 - thm1 = |- m + n = n + m
12174 - thm2 = |- 0 + m = m
12175 -\end{verbatim}
12176 -}
12177 -\noindent depending on the occurrence of free subterms
12178 -{\par\samepage\setseps\small
12179 -\begin{verbatim}
12180 - #SUBS [thm1; thm2] (ASSUME "(n + 0) + (0 + m) = m + n");;
12181 - . |- (n + 0) + m = n + m
12182 -
12183 - #SUBS [thm1; thm2] (ASSUME "!n. (n + 0) + (0 + m) = m + n");;
12184 - . |- !n. (n + 0) + m = m + n
12185 -\end{verbatim}
12186 -}
12187 -\USES
12188 -{\small\verb%SUBS%} can sometimes be used when rewriting (for example, with {\small\verb%REWRITE_RULE%})
12189 -would diverge and term instantiation is not needed. Moreover, applying the
12190 -substitution rules is often much faster than using the rewriting rules.
12191 -
12192 -\SEEALSO
12193 -ONCE_REWRITE_RULE, PURE_REWRITE_RULE, REWRITE_RULE, SUBST, SUBST_MATCH,
12194 -SUBS_OCCS.
12195 -
12196 -\ENDDOC
12197 -\DOC{SUBST}
12198 -
12199 -\TYPE {\small\verb%SUBST : ((thm # term) list -> term -> thm -> thm)%}\egroup
12200 -
12201 -\SYNOPSIS
12202 -Makes a set of parallel substitutions in a theorem.
12203 -
12204 -\DESCRIBE
12205 -Implements the following rule of simultaneous substitution
12206 -{\par\samepage\setseps\small
12207 -\begin{verbatim}
12208 - A1 |- t1 = u1 , ... , An |- tn = un , A |- t[t1,...,tn]
12209 - -------------------------------------------------------------
12210 - A u A1 u ... u An |- t[ui]
12211 -\end{verbatim}
12212 -}
12213 -\noindent Evaluating
12214 -{\par\samepage\setseps\small
12215 -\begin{verbatim}
12216 - SUBST [((A1 |- t1=u1), x1); ... ;((An |- tn=un), xn)]
12217 - t[x1,...,xn]
12218 - (A |- t[t1,...,tn])
12219 -\end{verbatim}
12220 -}
12221 -\noindent returns the theorem {\small\verb%A |- t[u1,...,un]%}. The term argument
12222 -{\small\verb%t[x1,...,xn]%} is a template which should match the conclusion of the theorem
12223 -being substituted into, with the variables {\small\verb%x1%}, ... , {\small\verb%xn%} marking those
12224 -places where occurrences of {\small\verb%t1%}, ... , {\small\verb%tn%} are to be replaced by the terms
12225 -{\small\verb%u1%}, ... , {\small\verb%un%}, respectively. The occurrence of {\small\verb%ti%} at the places marked by
12226 -{\small\verb%xi%} must be free (i.e. {\small\verb%ti%} must not contain any bound variables). {\small\verb%SUBST%}
12227 -automatically renames bound variables to prevent free variables in {\small\verb%ui%}
12228 -becoming bound after substitution.
12229 -
12230 -{\small\verb%SUBST%} is a complex primitive because it performs both parallel simultaneous
12231 -substitution and renaming of variables. This is for efficiency reasons, but it
12232 -would be logically cleaner if {\small\verb%SUBST%} were simpler.
12233 -
12234 -\FAILURE
12235 -If the template does not match the conclusion of the hypothesis, or the terms
12236 -in the conclusion marked by the variables {\small\verb%x1%}, ... , {\small\verb%xn%} in the template are
12237 -not identical to the left hand sides of the supplied equations (i.e. the terms
12238 -{\small\verb%t1%}, ... , {\small\verb%tn%}).
12239 -
12240 -\EXAMPLE
12241 + thm1 = |- m + n = n + m
12242 + thm2 = |- 0 + m = m
12243 +\end{verbatim}
12244 +}
12245 +\noindent depending on the occurrence of free subterms
12246 {\par\samepage\setseps\small
12247 \begin{verbatim}
12248 -#let th0 = SPEC "0" ADD1 and th1 = SPEC "1" ADD1;;
12249 -th0 = |- SUC 0 = 0 + 1
12250 -th1 = |- SUC 1 = 1 + 1
12251 -
12252 -#SUBST [(th0,"x:num");(th1,"y:num")]
12253 -# "(x+y) > SUC 0"
12254 -# (ASSUME "(SUC 0 + SUC 1) > SUC 0");;
12255 -. |- ((0 + 1) + (1 + 1)) > (SUC 0)
12256 -
12257 -#SUBST [(th0,"x:num");(th1,"y:num")]
12258 -# "(SUC 0 + y) > SUC 0"
12259 -# (ASSUME "(SUC 0 + SUC 1) > SUC 0");;
12260 -. |- ((SUC 0) + (1 + 1)) > (SUC 0)
12261 + #SUBS [thm1; thm2] (ASSUME "(n + 0) + (0 + m) = m + n");;
12262 + . |- (n + 0) + m = n + m
12263
12264 -#SUBST [(th0,"x:num");(th1,"y:num")]
12265 -# "(x+y) > x"
12266 -# (ASSUME "(SUC 0 + SUC 1) > SUC 0");;
12267 -. |- ((0 + 1) + (1 + 1)) > (0 + 1)
12268 + #SUBS [thm1; thm2] (ASSUME "!n. (n + 0) + (0 + m) = m + n");;
12269 + . |- !n. (n + 0) + m = m + n
12270 \end{verbatim}
12271 }
12272 \USES
12273 -For substituting at selected occurrences. Often useful
12274 -for writing special purpose derived inference rules.
12275 +{\small\verb%SUBS%} can sometimes be used when rewriting (for example, with {\small\verb%REWRITE_RULE%})
12276 +would diverge and term instantiation is not needed. Moreover, applying the
12277 +substitution rules is often much faster than using the rewriting rules.
12278
12279 \SEEALSO
12280 -SUBS.
12281 +ONCE_REWRITE_RULE, PURE_REWRITE_RULE, REWRITE_RULE, SUBST, SUBST_MATCH,
12282 +SUBS_OCCS.
12283
12284 \ENDDOC
12285 -\DOC{subst}
12286 +\DOC{SUBS\_OCCS}
12287
12288 -\TYPE {\small\verb%subst : ((term # term) list -> term -> term)%}\egroup
12289 +\TYPE {\small\verb%SUBS_OCCS : ((int list # thm) list -> thm -> thm)%}\egroup
12290
12291 \SYNOPSIS
12292 -Substitutes terms in a term.
12293 +Makes substitutions in a theorem at specific occurrences of a term, using a
12294 +list of equational theorems.
12295
12296 \DESCRIBE
12297 -Given a list of term pairs {\small\verb%[("a_1","b_1"),...,("a_n","b_n")]%}
12298 -and a term {\small\verb%"c"%}, {\small\verb%subst%} attempts to substitute all free occurrences of
12299 -{\small\verb%"b_i"%} in {\small\verb%"c"%} by {\small\verb%"a_i"%} for all {\small\verb%i%} ranging between {\small\verb%1%} and {\small\verb%n%}.
12300 -
12301 +Given a list {\small\verb%(l1,A1|-t1=v1),...,(ln,An|-tn=vn)%} and a theorem
12302 +{\small\verb%(A|-t)%}, {\small\verb%SUBS_OCCS%} simultaneously replaces each {\small\verb%ti%} in {\small\verb%t%} with {\small\verb%vi%},
12303 +at the occurrences specified by the integers
12304 +in the list {\small\verb%li = [o1;...;ok]%} for each theorem {\small\verb%Ai|-ti=vi%}.
12305 +{\par\samepage\setseps\small
12306 +\begin{verbatim}
12307 + (l1,A1|-t1=v1) ... (ln,An|-tn=vn) A|-t
12308 + ------------------------------------------- SUBS_OCCS[(l1,A1|-t1=v1);...;
12309 + A1 u ... An u A |- t[v1,...,vn/t1,...,tn] (ln,An|-tn=vn)] (A|-t)
12310 +\end{verbatim}
12311 +}
12312 \FAILURE
12313 -Failure occurs if for some {\small\verb%i%} ranging between {\small\verb%1%} and {\small\verb%n%}, the substitution
12314 -of {\small\verb%"b_i"%} by {\small\verb%"a_i"%} fails.
12315 -The substitution of {\small\verb%"b_i"%} by {\small\verb%"a_i"%} fails for some {\small\verb%i%},
12316 -if the types of {\small\verb%"a_i"%} and {\small\verb%"b_i"%} are not the same.
12317 +{\small\verb%SUBS_OCCS [(l1,th1);...;(ln,thn)] (A|-t)%} fails if
12318 +the conclusion of any theorem in the list is not an equation.
12319 +No change is made to the theorem if the supplied occurrences {\small\verb%li%} of the
12320 +left-hand side of the conclusion of {\small\verb%thi%} do not appear in {\small\verb%t%}.
12321
12322 \EXAMPLE
12323 +The commutative law for addition
12324 {\par\samepage\setseps\small
12325 \begin{verbatim}
12326 - #subst [("1","SUC 0")] "SUC(SUC 0)";;
12327 - "SUC 1" : term
12328 -
12329 - #subst [("1","SUC 0");("2","SUC 1")] "SUC(SUC 0)";;
12330 - "SUC 1" : term
12331 -
12332 - #subst [("1","SUC 0");("2","SUC 1")] "SUC(SUC 0) = SUC 1";;
12333 - "SUC 1 = 2" : term
12334 -
12335 - #subst [("b:num","a:num")] "\a:num. (b:num)";;
12336 - "\a. b" : term
12337 -
12338 - #subst [("foo:*","flip:*")] "waddle:*";;
12339 - "waddle" : term
12340 + #let thm = SPECL ["m:num"; "n:num"] ADD_SYM;;
12341 + thm = |- m + n = n + m
12342 +\end{verbatim}
12343 +}
12344 +\noindent can be used for substituting only the second occurrence of
12345 +the subterm {\small\verb%m + n%}
12346 +{\par\samepage\setseps\small
12347 +\begin{verbatim}
12348 + #SUBS_OCCS [([2],thm)] (ASSUME "(n + m) + (m + n) = (m + n) + (m + n)");;
12349 + . |- (n + m) + (m + n) = (n + m) + (m + n)
12350 \end{verbatim}
12351 }
12352 +\USES
12353 +{\small\verb%SUBS_OCCS%} is used when rewriting at specific occurrences of a term, and rules
12354 +such as {\small\verb%REWRITE_RULE%}, {\small\verb%PURE_REWRITE_RULE%}, {\small\verb%ONCE_REWRITE_RULE%}, and {\small\verb%SUBS%}
12355 +are too extensive or would diverge.
12356 +
12357 +\SEEALSO
12358 +ONCE_REWRITE_RULE, PURE_REWRITE_RULE, REWRITE_RULE, SUBS, SUBST, SUBST_MATCH.
12359 +
12360 \ENDDOC
12361 \DOC{SUBST1\_TAC}
12362
12363 @@ -25549,6 +25530,118 @@ and using rewriting rules/conversions is
12364 REWR_CONV, SUBS, SUBST, SUBS_OCCS.
12365
12366 \ENDDOC
12367 +\DOC{subst}
12368 +
12369 +\TYPE {\small\verb%subst : ((term # term) list -> term -> term)%}\egroup
12370 +
12371 +\SYNOPSIS
12372 +Substitutes terms in a term.
12373 +
12374 +\DESCRIBE
12375 +Given a list of term pairs {\small\verb%[("a_1","b_1"),...,("a_n","b_n")]%}
12376 +and a term {\small\verb%"c"%}, {\small\verb%subst%} attempts to substitute all free occurrences of
12377 +{\small\verb%"b_i"%} in {\small\verb%"c"%} by {\small\verb%"a_i"%} for all {\small\verb%i%} ranging between {\small\verb%1%} and {\small\verb%n%}.
12378 +
12379 +\FAILURE
12380 +Failure occurs if for some {\small\verb%i%} ranging between {\small\verb%1%} and {\small\verb%n%}, the substitution
12381 +of {\small\verb%"b_i"%} by {\small\verb%"a_i"%} fails.
12382 +The substitution of {\small\verb%"b_i"%} by {\small\verb%"a_i"%} fails for some {\small\verb%i%},
12383 +if the types of {\small\verb%"a_i"%} and {\small\verb%"b_i"%} are not the same.
12384 +
12385 +\EXAMPLE
12386 +{\par\samepage\setseps\small
12387 +\begin{verbatim}
12388 + #subst [("1","SUC 0")] "SUC(SUC 0)";;
12389 + "SUC 1" : term
12390 +
12391 + #subst [("1","SUC 0");("2","SUC 1")] "SUC(SUC 0)";;
12392 + "SUC 1" : term
12393 +
12394 + #subst [("1","SUC 0");("2","SUC 1")] "SUC(SUC 0) = SUC 1";;
12395 + "SUC 1 = 2" : term
12396 +
12397 + #subst [("b:num","a:num")] "\a:num. (b:num)";;
12398 + "\a. b" : term
12399 +
12400 + #subst [("foo:*","flip:*")] "waddle:*";;
12401 + "waddle" : term
12402 +\end{verbatim}
12403 +}
12404 +\ENDDOC
12405 +\DOC{SUBST}
12406 +
12407 +\TYPE {\small\verb%SUBST : ((thm # term) list -> term -> thm -> thm)%}\egroup
12408 +
12409 +\SYNOPSIS
12410 +Makes a set of parallel substitutions in a theorem.
12411 +
12412 +\DESCRIBE
12413 +Implements the following rule of simultaneous substitution
12414 +{\par\samepage\setseps\small
12415 +\begin{verbatim}
12416 + A1 |- t1 = u1 , ... , An |- tn = un , A |- t[t1,...,tn]
12417 + -------------------------------------------------------------
12418 + A u A1 u ... u An |- t[ui]
12419 +\end{verbatim}
12420 +}
12421 +\noindent Evaluating
12422 +{\par\samepage\setseps\small
12423 +\begin{verbatim}
12424 + SUBST [((A1 |- t1=u1), x1); ... ;((An |- tn=un), xn)]
12425 + t[x1,...,xn]
12426 + (A |- t[t1,...,tn])
12427 +\end{verbatim}
12428 +}
12429 +\noindent returns the theorem {\small\verb%A |- t[u1,...,un]%}. The term argument
12430 +{\small\verb%t[x1,...,xn]%} is a template which should match the conclusion of the theorem
12431 +being substituted into, with the variables {\small\verb%x1%}, ... , {\small\verb%xn%} marking those
12432 +places where occurrences of {\small\verb%t1%}, ... , {\small\verb%tn%} are to be replaced by the terms
12433 +{\small\verb%u1%}, ... , {\small\verb%un%}, respectively. The occurrence of {\small\verb%ti%} at the places marked by
12434 +{\small\verb%xi%} must be free (i.e. {\small\verb%ti%} must not contain any bound variables). {\small\verb%SUBST%}
12435 +automatically renames bound variables to prevent free variables in {\small\verb%ui%}
12436 +becoming bound after substitution.
12437 +
12438 +{\small\verb%SUBST%} is a complex primitive because it performs both parallel simultaneous
12439 +substitution and renaming of variables. This is for efficiency reasons, but it
12440 +would be logically cleaner if {\small\verb%SUBST%} were simpler.
12441 +
12442 +\FAILURE
12443 +If the template does not match the conclusion of the hypothesis, or the terms
12444 +in the conclusion marked by the variables {\small\verb%x1%}, ... , {\small\verb%xn%} in the template are
12445 +not identical to the left hand sides of the supplied equations (i.e. the terms
12446 +{\small\verb%t1%}, ... , {\small\verb%tn%}).
12447 +
12448 +\EXAMPLE
12449 +{\par\samepage\setseps\small
12450 +\begin{verbatim}
12451 +#let th0 = SPEC "0" ADD1 and th1 = SPEC "1" ADD1;;
12452 +th0 = |- SUC 0 = 0 + 1
12453 +th1 = |- SUC 1 = 1 + 1
12454 +
12455 +#SUBST [(th0,"x:num");(th1,"y:num")]
12456 +# "(x+y) > SUC 0"
12457 +# (ASSUME "(SUC 0 + SUC 1) > SUC 0");;
12458 +. |- ((0 + 1) + (1 + 1)) > (SUC 0)
12459 +
12460 +#SUBST [(th0,"x:num");(th1,"y:num")]
12461 +# "(SUC 0 + y) > SUC 0"
12462 +# (ASSUME "(SUC 0 + SUC 1) > SUC 0");;
12463 +. |- ((SUC 0) + (1 + 1)) > (SUC 0)
12464 +
12465 +#SUBST [(th0,"x:num");(th1,"y:num")]
12466 +# "(x+y) > x"
12467 +# (ASSUME "(SUC 0 + SUC 1) > SUC 0");;
12468 +. |- ((0 + 1) + (1 + 1)) > (0 + 1)
12469 +\end{verbatim}
12470 +}
12471 +\USES
12472 +For substituting at selected occurrences. Often useful
12473 +for writing special purpose derived inference rules.
12474 +
12475 +\SEEALSO
12476 +SUBS.
12477 +
12478 +\ENDDOC
12479 \DOC{SUBST\_MATCH}
12480
12481 \TYPE {\small\verb%SUBST_MATCH : (thm -> thm -> thm)%}\egroup
12482 @@ -25738,89 +25831,38 @@ any {\small\verb%Ai%} is not a subset of
12483 {\small\verb%vi%} becoming bound after substitution.
12484
12485 \FAILURE
12486 -{\small\verb%SUBST_TAC [th1;...;thn] (A,t)%} fails if the conclusion of any theorem in the
12487 -list is not an equation. No change is made to the goal if no occurrence of the
12488 -left-hand side of the conclusion of {\small\verb%thi%} appears in {\small\verb%t%}.
12489 -
12490 -\EXAMPLE
12491 -When trying to solve the goal
12492 -{\par\samepage\setseps\small
12493 -\begin{verbatim}
12494 - ?- (n + 0) + (0 + m) = m + n
12495 -\end{verbatim}
12496 -}
12497 -\noindent by substituting with the theorems
12498 -{\par\samepage\setseps\small
12499 -\begin{verbatim}
12500 - #let thm1 = SPECL ["m:num"; "n:num"] ADD_SYM
12501 - #and thm2 = CONJUNCT1 ADD_CLAUSES;;
12502 - thm1 = |- m + n = n + m
12503 - thm2 = |- 0 + m = m
12504 -\end{verbatim}
12505 -}
12506 -\noindent applying {\small\verb%SUBST_TAC [thm1; thm2]%} results in the goal
12507 -{\par\samepage\setseps\small
12508 -\begin{verbatim}
12509 - ?- (n + 0) + m = n + m
12510 -\end{verbatim}
12511 -}
12512 -\USES
12513 -{\small\verb%SUBST_TAC%} is used when rewriting (for example, with {\small\verb%REWRITE_TAC%}) is
12514 -extensive or would diverge. Substituting is also much faster than rewriting.
12515 -
12516 -\SEEALSO
12517 -ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWRITE_TAC, SUBST1_TAC, SUBST_ALL_TAC.
12518 -
12519 -\ENDDOC
12520 -\DOC{SUBS\_OCCS}
12521 -
12522 -\TYPE {\small\verb%SUBS_OCCS : ((int list # thm) list -> thm -> thm)%}\egroup
12523 -
12524 -\SYNOPSIS
12525 -Makes substitutions in a theorem at specific occurrences of a term, using a
12526 -list of equational theorems.
12527 -
12528 -\DESCRIBE
12529 -Given a list {\small\verb%(l1,A1|-t1=v1),...,(ln,An|-tn=vn)%} and a theorem
12530 -{\small\verb%(A|-t)%}, {\small\verb%SUBS_OCCS%} simultaneously replaces each {\small\verb%ti%} in {\small\verb%t%} with {\small\verb%vi%},
12531 -at the occurrences specified by the integers
12532 -in the list {\small\verb%li = [o1;...;ok]%} for each theorem {\small\verb%Ai|-ti=vi%}.
12533 +{\small\verb%SUBST_TAC [th1;...;thn] (A,t)%} fails if the conclusion of any theorem in the
12534 +list is not an equation. No change is made to the goal if no occurrence of the
12535 +left-hand side of the conclusion of {\small\verb%thi%} appears in {\small\verb%t%}.
12536 +
12537 +\EXAMPLE
12538 +When trying to solve the goal
12539 {\par\samepage\setseps\small
12540 \begin{verbatim}
12541 - (l1,A1|-t1=v1) ... (ln,An|-tn=vn) A|-t
12542 - ------------------------------------------- SUBS_OCCS[(l1,A1|-t1=v1);...;
12543 - A1 u ... An u A |- t[v1,...,vn/t1,...,tn] (ln,An|-tn=vn)] (A|-t)
12544 + ?- (n + 0) + (0 + m) = m + n
12545 \end{verbatim}
12546 }
12547 -\FAILURE
12548 -{\small\verb%SUBS_OCCS [(l1,th1);...;(ln,thn)] (A|-t)%} fails if
12549 -the conclusion of any theorem in the list is not an equation.
12550 -No change is made to the theorem if the supplied occurrences {\small\verb%li%} of the
12551 -left-hand side of the conclusion of {\small\verb%thi%} do not appear in {\small\verb%t%}.
12552 -
12553 -\EXAMPLE
12554 -The commutative law for addition
12555 +\noindent by substituting with the theorems
12556 {\par\samepage\setseps\small
12557 \begin{verbatim}
12558 - #let thm = SPECL ["m:num"; "n:num"] ADD_SYM;;
12559 - thm = |- m + n = n + m
12560 + #let thm1 = SPECL ["m:num"; "n:num"] ADD_SYM
12561 + #and thm2 = CONJUNCT1 ADD_CLAUSES;;
12562 + thm1 = |- m + n = n + m
12563 + thm2 = |- 0 + m = m
12564 \end{verbatim}
12565 }
12566 -\noindent can be used for substituting only the second occurrence of
12567 -the subterm {\small\verb%m + n%}
12568 +\noindent applying {\small\verb%SUBST_TAC [thm1; thm2]%} results in the goal
12569 {\par\samepage\setseps\small
12570 \begin{verbatim}
12571 - #SUBS_OCCS [([2],thm)] (ASSUME "(n + m) + (m + n) = (m + n) + (m + n)");;
12572 - . |- (n + m) + (m + n) = (n + m) + (m + n)
12573 + ?- (n + 0) + m = n + m
12574 \end{verbatim}
12575 }
12576 \USES
12577 -{\small\verb%SUBS_OCCS%} is used when rewriting at specific occurrences of a term, and rules
12578 -such as {\small\verb%REWRITE_RULE%}, {\small\verb%PURE_REWRITE_RULE%}, {\small\verb%ONCE_REWRITE_RULE%}, and {\small\verb%SUBS%}
12579 -are too extensive or would diverge.
12580 +{\small\verb%SUBST_TAC%} is used when rewriting (for example, with {\small\verb%REWRITE_TAC%}) is
12581 +extensive or would diverge. Substituting is also much faster than rewriting.
12582
12583 \SEEALSO
12584 -ONCE_REWRITE_RULE, PURE_REWRITE_RULE, REWRITE_RULE, SUBS, SUBST, SUBST_MATCH.
12585 +ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWRITE_TAC, SUBST1_TAC, SUBST_ALL_TAC.
12586
12587 \ENDDOC
12588 \DOC{subtract}
12589 @@ -25851,50 +25893,6 @@ Never fails.
12590 setify, set_equal, union, intersect.
12591
12592 \ENDDOC
12593 -\DOC{SUB\_CONV}
12594 -
12595 -\TYPE {\small\verb%SUB_CONV : (conv -> conv)%}\egroup
12596 -
12597 -\SYNOPSIS
12598 -Applies a conversion to the top-level subterms of a term.
12599 -
12600 -\DESCRIBE
12601 -For any conversion {\small\verb%c%}, the function returned by {\small\verb%SUB_CONV c%} is a conversion
12602 -that applies {\small\verb%c%} to all the top-level subterms of a term. If the conversion
12603 -{\small\verb%c%} maps {\small\verb%t%} to {\small\verb%|- t = t'%}, then {\small\verb%SUB_CONV c%} maps an abstraction {\small\verb%"\x.t"%} to
12604 -the theorem:
12605 -{\par\samepage\setseps\small
12606 -\begin{verbatim}
12607 - |- (\x.t) = (\x.t')
12608 -\end{verbatim}
12609 -}
12610 -\noindent That is, {\small\verb%SUB_CONV c "\x.t"%} applies {\small\verb%c%} to the body of the
12611 -abstraction {\small\verb%"\x.t"%}. If {\small\verb%c%} is a conversion that maps {\small\verb%"t1"%} to the theorem
12612 -{\small\verb%|- t1 = t1'%} and {\small\verb%"t2"%} to the theorem {\small\verb%|- t2 = t2'%}, then the conversion
12613 -{\small\verb%SUB_CONV c%} maps an application {\small\verb%"t1 t2"%} to the theorem:
12614 -{\par\samepage\setseps\small
12615 -\begin{verbatim}
12616 - |- (t1 t2) = (t1' t2')
12617 -\end{verbatim}
12618 -}
12619 -\noindent That is, {\small\verb%SUB_CONV c "t1 t2"%} applies {\small\verb%c%} to the both the operator
12620 -{\small\verb%t1%} and the operand {\small\verb%t2%} of the application {\small\verb%"t1 t2"%}. Finally, for any
12621 -conversion {\small\verb%c%}, the function returned by {\small\verb%SUB_CONV c%} acts as the identity
12622 -conversion on variables and constants. That is, if {\small\verb%"t"%} is a variable or
12623 -constant, then {\small\verb%SUB_CONV c "t"%} returns {\small\verb%|- t = t%}.
12624 -
12625 -\FAILURE
12626 -{\small\verb%SUB_CONV c tm%} fails if {\small\verb%tm%} is an abstraction {\small\verb%"\x.t"%} and the conversion {\small\verb%c%}
12627 -fails when applied to {\small\verb%t%}, or if {\small\verb%tm%} is an application {\small\verb%"t1 t2"%} and the
12628 -conversion {\small\verb%c%} fails when applied to either {\small\verb%t1%} or {\small\verb%t2%}. The function
12629 -returned by {\small\verb%SUB_CONV c%} may also fail if the ML function {\small\verb%c:term->thm%} is not,
12630 -in fact, a conversion (i.e. a function that maps a term {\small\verb%t%} to a theorem
12631 -{\small\verb%|- t = t'%}).
12632 -
12633 -\SEEALSO
12634 -ABS_CONV, RAND_CONV, RATOR_CONV.
12635 -
12636 -\ENDDOC
12637 \DOC{suspend\_recording}
12638
12639 \TYPE {\small\verb%suspend_recording : void -> void%}\egroup
12640 @@ -25958,50 +25956,50 @@ When applied to a term argument of the f
12641 {\small\verb%?x y. P%}.
12642
12643 \ENDDOC
12644 -\DOC{SYM}
12645 +\DOC{SYM\_CONV}
12646
12647 -\TYPE {\small\verb%SYM : (thm -> thm)%}\egroup
12648 +\TYPE {\small\verb%SYM_CONV : conv%}\egroup
12649
12650 \SYNOPSIS
12651 -Swaps left-hand and right-hand sides of an equation.
12652 +Interchanges the left and right-hand sides of an equation.
12653
12654 \DESCRIBE
12655 -When applied to a theorem {\small\verb%A |- t1 = t2%}, the inference rule {\small\verb%SYM%} returns
12656 -{\small\verb%A |- t2 = t1%}.
12657 +When applied to an equational term {\small\verb%t1 = t2%}, the conversion
12658 +{\small\verb%SYM_CONV%} returns the theorem:
12659 {\par\samepage\setseps\small
12660 \begin{verbatim}
12661 - A |- t1 = t2
12662 - -------------- SYM
12663 - A |- t2 = t1
12664 + |- (t1 = t2) = (t2 = t1)
12665 \end{verbatim}
12666 }
12667 \FAILURE
12668 -Fails unless the theorem is equational.
12669 +Fails if applied to a term that is not an equation.
12670
12671 \SEEALSO
12672 -GSYM, NOT_EQ_SYM, REFL.
12673 +SYM.
12674
12675 \ENDDOC
12676 -\DOC{SYM\_CONV}
12677 +\DOC{SYM}
12678
12679 -\TYPE {\small\verb%SYM_CONV : conv%}\egroup
12680 +\TYPE {\small\verb%SYM : (thm -> thm)%}\egroup
12681
12682 \SYNOPSIS
12683 -Interchanges the left and right-hand sides of an equation.
12684 +Swaps left-hand and right-hand sides of an equation.
12685
12686 \DESCRIBE
12687 -When applied to an equational term {\small\verb%t1 = t2%}, the conversion
12688 -{\small\verb%SYM_CONV%} returns the theorem:
12689 +When applied to a theorem {\small\verb%A |- t1 = t2%}, the inference rule {\small\verb%SYM%} returns
12690 +{\small\verb%A |- t2 = t1%}.
12691 {\par\samepage\setseps\small
12692 \begin{verbatim}
12693 - |- (t1 = t2) = (t2 = t1)
12694 + A |- t1 = t2
12695 + -------------- SYM
12696 + A |- t2 = t1
12697 \end{verbatim}
12698 }
12699 \FAILURE
12700 -Fails if applied to a term that is not an equation.
12701 +Fails unless the theorem is equational.
12702
12703 \SEEALSO
12704 -SYM.
12705 +GSYM, NOT_EQ_SYM, REFL.
12706
12707 \ENDDOC
12708 \DOC{syserror}
12709 @@ -26100,6 +26098,31 @@ Fails if the argument is less than 0.
12710 int_of_term, int_of_string, string_of_int.
12711
12712 \ENDDOC
12713 +\DOC{THENC}
12714 +
12715 +\TYPE {\small\verb%$THENC : (conv -> conv -> conv)%}\egroup
12716 +
12717 +\SYNOPSIS
12718 +Applies two conversions in sequence.
12719 +
12720 +\DESCRIBE
12721 +If the conversion {\small\verb%c1%} returns {\small\verb%|- t = t'%} when applied to a term {\small\verb%"t"%}, and
12722 +{\small\verb%c2%} returns {\small\verb%|- t' = t''%} when applied to {\small\verb%"t'"%}, then the composite
12723 +conversion {\small\verb%(c1 THENC c2) "t"%} returns {\small\verb%|- t = t''%}. That is, {\small\verb%(c1 THENC c2)
12724 +"t"%} has the effect of transforming the term {\small\verb%"t"%} first with the conversion
12725 +{\small\verb%c1%} and then with the conversion {\small\verb%c2%}.
12726 +
12727 +\FAILURE
12728 +{\small\verb%(c1 THENC c2) "t"%} fails if either the conversion {\small\verb%c1%} fails when applied to
12729 +{\small\verb%"t"%}, or if {\small\verb%c1 "t"%} succeeds and returns {\small\verb%|- t = t'%} but {\small\verb%c2%} fails when
12730 +applied to {\small\verb%"t'"%}. {\small\verb%(c1 THENC c2) "t"%} may also fail if either of {\small\verb%c1%} or {\small\verb%c2%}
12731 +is not, in fact, a conversion (i.e. a function that maps a term {\small\verb%t%} to a
12732 +theorem {\small\verb%|- t = t'%}).
12733 +
12734 +\SEEALSO
12735 +EVERY_CONV.
12736 +
12737 +\ENDDOC
12738 \DOC{THEN}
12739
12740 \TYPE {\small\verb%$THEN : (tactic -> tactic -> tactic)%}\egroup
12741 @@ -26136,31 +26159,6 @@ to multiple subgoals; sequences like the
12742 EVERY, ORELSE, THENL.
12743
12744 \ENDDOC
12745 -\DOC{THENC}
12746 -
12747 -\TYPE {\small\verb%$THENC : (conv -> conv -> conv)%}\egroup
12748 -
12749 -\SYNOPSIS
12750 -Applies two conversions in sequence.
12751 -
12752 -\DESCRIBE
12753 -If the conversion {\small\verb%c1%} returns {\small\verb%|- t = t'%} when applied to a term {\small\verb%"t"%}, and
12754 -{\small\verb%c2%} returns {\small\verb%|- t' = t''%} when applied to {\small\verb%"t'"%}, then the composite
12755 -conversion {\small\verb%(c1 THENC c2) "t"%} returns {\small\verb%|- t = t''%}. That is, {\small\verb%(c1 THENC c2)
12756 -"t"%} has the effect of transforming the term {\small\verb%"t"%} first with the conversion
12757 -{\small\verb%c1%} and then with the conversion {\small\verb%c2%}.
12758 -
12759 -\FAILURE
12760 -{\small\verb%(c1 THENC c2) "t"%} fails if either the conversion {\small\verb%c1%} fails when applied to
12761 -{\small\verb%"t"%}, or if {\small\verb%c1 "t"%} succeeds and returns {\small\verb%|- t = t'%} but {\small\verb%c2%} fails when
12762 -applied to {\small\verb%"t'"%}. {\small\verb%(c1 THENC c2) "t"%} may also fail if either of {\small\verb%c1%} or {\small\verb%c2%}
12763 -is not, in fact, a conversion (i.e. a function that maps a term {\small\verb%t%} to a
12764 -theorem {\small\verb%|- t = t'%}).
12765 -
12766 -\SEEALSO
12767 -EVERY_CONV.
12768 -
12769 -\ENDDOC
12770 \DOC{THENL}
12771
12772 \TYPE {\small\verb%$THENL : (tactic -> tactic list -> tactic)%}\egroup
12773 @@ -26253,41 +26251,6 @@ axiom, definition, load_theorem, load_th
12774 theorems.
12775
12776 \ENDDOC
12777 -\DOC{theorems}
12778 -
12779 -\TYPE {\small\verb%theorems : (string -> (string # thm) list)%}\egroup
12780 -
12781 -\SYNOPSIS
12782 -Returns the derived theorems of a given theory segment of the current theory.
12783 -
12784 -\DESCRIBE
12785 -A call of {\small\verb%theorems `thy`%} returns the derived theorems of the theory segment
12786 -{\small\verb%thy%} together with their names. The theory segment {\small\verb%thy%} must be part of
12787 -the current theory. The names are those given to the theorems by the user when
12788 -they were originally added to the theory segment (by, for example, a call to
12789 -{\small\verb%save_thm%}). The name of the current theory segment can be abbreviated by {\small\verb%`-`%}.
12790 -
12791 -\FAILURE
12792 -The call {\small\verb%theorems `thy`%} will fail if the theory segment {\small\verb%thy%} is not part
12793 -of the current theory.
12794 -
12795 -\EXAMPLE
12796 -{\par\samepage\setseps\small
12797 -\begin{verbatim}
12798 -#theorems `bool`;;
12799 -[(`PAIR_EQ`, |- !x y a b. (x,y = a,b) = (x = a) /\ (y = b));
12800 - (`SND`, |- !x y. SND(x,y) = y);
12801 - (`FST`, |- !x y. FST(x,y) = x);
12802 - (`PAIR`, |- !x. FST x,SND x = x);
12803 - (`PAIR_EXISTS`, |- ?p. IS_PAIR p)]
12804 -: (string # thm) list
12805 -\end{verbatim}
12806 -}
12807 -\SEEALSO
12808 -axioms, definitions, load_theorem, load_theorems, print_theory, save_thm,
12809 -theorem.
12810 -
12811 -\ENDDOC
12812 \DOC{theorem\_lfn}
12813
12814 \TYPE {\small\verb%theorem_lfn : (string list -> thm)%}\egroup
12815 @@ -26362,6 +26325,41 @@ autoload, autoload_theory, theorem, theo
12816 load_theorems, undo_autoload.
12817
12818 \ENDDOC
12819 +\DOC{theorems}
12820 +
12821 +\TYPE {\small\verb%theorems : (string -> (string # thm) list)%}\egroup
12822 +
12823 +\SYNOPSIS
12824 +Returns the derived theorems of a given theory segment of the current theory.
12825 +
12826 +\DESCRIBE
12827 +A call of {\small\verb%theorems `thy`%} returns the derived theorems of the theory segment
12828 +{\small\verb%thy%} together with their names. The theory segment {\small\verb%thy%} must be part of
12829 +the current theory. The names are those given to the theorems by the user when
12830 +they were originally added to the theory segment (by, for example, a call to
12831 +{\small\verb%save_thm%}). The name of the current theory segment can be abbreviated by {\small\verb%`-`%}.
12832 +
12833 +\FAILURE
12834 +The call {\small\verb%theorems `thy`%} will fail if the theory segment {\small\verb%thy%} is not part
12835 +of the current theory.
12836 +
12837 +\EXAMPLE
12838 +{\par\samepage\setseps\small
12839 +\begin{verbatim}
12840 +#theorems `bool`;;
12841 +[(`PAIR_EQ`, |- !x y a b. (x,y = a,b) = (x = a) /\ (y = b));
12842 + (`SND`, |- !x y. SND(x,y) = y);
12843 + (`FST`, |- !x y. FST(x,y) = x);
12844 + (`PAIR`, |- !x. FST x,SND x = x);
12845 + (`PAIR_EXISTS`, |- ?p. IS_PAIR p)]
12846 +: (string # thm) list
12847 +\end{verbatim}
12848 +}
12849 +\SEEALSO
12850 +axioms, definitions, load_theorem, load_theorems, print_theory, save_thm,
12851 +theorem.
12852 +
12853 +\ENDDOC
12854 \DOC{thm\_count}
12855
12856 \TYPE {\small\verb%thm_count : (void -> int)%}\egroup
12857 @@ -26653,15 +26651,36 @@ The following shows identical uses of {\
12858 t1 = . |- a = b
12859 t2 = . |- b = c
12860
12861 - #TRANS t1 t2;;
12862 - .. |- a = c
12863 + #TRANS t1 t2;;
12864 + .. |- a = c
12865 +
12866 + #t1 TRANS t2;;
12867 + .. |- a = c
12868 +\end{verbatim}
12869 +}
12870 +\SEEALSO
12871 +EQ_MP, IMP_TRANS, REFL, SYM.
12872 +
12873 +\ENDDOC
12874 +\DOC{TRY\_CONV}
12875 +
12876 +\TYPE {\small\verb%TRY_CONV : (conv -> conv)%}\egroup
12877 +
12878 +\SYNOPSIS
12879 +Attempts to apply a conversion; applies identity conversion in case of failure.
12880 +
12881 +\DESCRIBE
12882 +{\small\verb%TRY_CONV c "t"%} attempts to apply the conversion {\small\verb%c%} to the term {\small\verb%"t"%}; if
12883 +this fails, then the identity conversion applied instead. That is, if {\small\verb%c%} is a
12884 +conversion that maps a term {\small\verb%"t"%} to the theorem {\small\verb%|- t = t'%}, then the
12885 +conversion {\small\verb%TRY_CONV c%} also maps {\small\verb%"t"%} to {\small\verb%|- t = t'%}. But if {\small\verb%c%} fails when
12886 +applied to {\small\verb%"t"%}, then {\small\verb%TRY_CONV c "t"%} returns {\small\verb%|- t = t%}.
12887 +
12888 +\FAILURE
12889 +Never fails.
12890
12891 - #t1 TRANS t2;;
12892 - .. |- a = c
12893 -\end{verbatim}
12894 -}
12895 \SEEALSO
12896 -EQ_MP, IMP_TRANS, REFL, SYM.
12897 +ALL_CONV.
12898
12899 \ENDDOC
12900 \DOC{TRY}
12901 @@ -26704,27 +26723,6 @@ in the list. This will always be the cas
12902 find, mem, exists, forall, assoc, rev_assoc.
12903
12904 \ENDDOC
12905 -\DOC{TRY\_CONV}
12906 -
12907 -\TYPE {\small\verb%TRY_CONV : (conv -> conv)%}\egroup
12908 -
12909 -\SYNOPSIS
12910 -Attempts to apply a conversion; applies identity conversion in case of failure.
12911 -
12912 -\DESCRIBE
12913 -{\small\verb%TRY_CONV c "t"%} attempts to apply the conversion {\small\verb%c%} to the term {\small\verb%"t"%}; if
12914 -this fails, then the identity conversion applied instead. That is, if {\small\verb%c%} is a
12915 -conversion that maps a term {\small\verb%"t"%} to the theorem {\small\verb%|- t = t'%}, then the
12916 -conversion {\small\verb%TRY_CONV c%} also maps {\small\verb%"t"%} to {\small\verb%|- t = t'%}. But if {\small\verb%c%} fails when
12917 -applied to {\small\verb%"t"%}, then {\small\verb%TRY_CONV c "t"%} returns {\small\verb%|- t = t%}.
12918 -
12919 -\FAILURE
12920 -Never fails.
12921 -
12922 -\SEEALSO
12923 -ALL_CONV.
12924 -
12925 -\ENDDOC
12926 \DOC{tty\_read}
12927
12928 \TYPE {\small\verb%tty_read : (void -> string)%}\egroup
12929 @@ -26780,53 +26778,6 @@ standard output cannot be written.
12930 append_openw, close, openi, openw, read, tty_read, write.
12931
12932 \ENDDOC
12933 -\DOC{types}
12934 -
12935 -\TYPE {\small\verb%types : (string -> (int # string) list)%}\egroup
12936 -
12937 -\SYNOPSIS
12938 -Lists the types in the named theory.
12939 -
12940 -\DESCRIBE
12941 -The function {\small\verb%types%} should be applied to a string which is the name of an
12942 -ancestor theory (including the current theory; the special string {\small\verb%`-`%} is
12943 -always interpreted as the current theory). It returns a list of all the
12944 -type constructors declared in the named theory, in the form of arity-name
12945 -pairs.
12946 -
12947 -\FAILURE
12948 -Fails unless the named theory is an ancestor.
12949 -
12950 -\EXAMPLE
12951 -The theory {\small\verb%HOL%} has no types declared:
12952 -{\par\samepage\setseps\small
12953 -\begin{verbatim}
12954 - #types `HOL`;;
12955 - [] : (int # string) list
12956 -\end{verbatim}
12957 -}
12958 -\noindent but its ancestors have the following types declared:
12959 -{\par\samepage\setseps\small
12960 -\begin{verbatim}
12961 - #itlist union (map types (ancestors `HOL`)) [];;
12962 - [(2, `fun`);
12963 - (2, `prod`);
12964 - (0, `bool`);
12965 - (0, `ind`);
12966 - (0, `num`);
12967 - (1, `list`);
12968 - (0, `tree`);
12969 - (1, `ltree`);
12970 - (2, `sum`);
12971 - (0, `one`)]
12972 - : (int # string) list
12973 -\end{verbatim}
12974 -}
12975 -\SEEALSO
12976 -ancestors, axioms, constants, definitions, infixes, new_type, new_type_abbrev,
12977 -new_type_definition, parents.
12978 -
12979 -\ENDDOC
12980 \DOC{type\_abbrevs}
12981
12982 \TYPE {\small\verb%type_abbrevs : (string -> (string # type) list)%}\egroup
12983 @@ -26936,6 +26887,53 @@ Never fails.
12984 \end{verbatim}
12985 }
12986 \ENDDOC
12987 +\DOC{types}
12988 +
12989 +\TYPE {\small\verb%types : (string -> (int # string) list)%}\egroup
12990 +
12991 +\SYNOPSIS
12992 +Lists the types in the named theory.
12993 +
12994 +\DESCRIBE
12995 +The function {\small\verb%types%} should be applied to a string which is the name of an
12996 +ancestor theory (including the current theory; the special string {\small\verb%`-`%} is
12997 +always interpreted as the current theory). It returns a list of all the
12998 +type constructors declared in the named theory, in the form of arity-name
12999 +pairs.
13000 +
13001 +\FAILURE
13002 +Fails unless the named theory is an ancestor.
13003 +
13004 +\EXAMPLE
13005 +The theory {\small\verb%HOL%} has no types declared:
13006 +{\par\samepage\setseps\small
13007 +\begin{verbatim}
13008 + #types `HOL`;;
13009 + [] : (int # string) list
13010 +\end{verbatim}
13011 +}
13012 +\noindent but its ancestors have the following types declared:
13013 +{\par\samepage\setseps\small
13014 +\begin{verbatim}
13015 + #itlist union (map types (ancestors `HOL`)) [];;
13016 + [(2, `fun`);
13017 + (2, `prod`);
13018 + (0, `bool`);
13019 + (0, `ind`);
13020 + (0, `num`);
13021 + (1, `list`);
13022 + (0, `tree`);
13023 + (1, `ltree`);
13024 + (2, `sum`);
13025 + (0, `one`)]
13026 + : (int # string) list
13027 +\end{verbatim}
13028 +}
13029 +\SEEALSO
13030 +ancestors, axioms, constants, definitions, infixes, new_type, new_type_abbrev,
13031 +new_type_definition, parents.
13032 +
13033 +\ENDDOC
13034 \DOC{type\_tyvars}
13035
13036 \TYPE {\small\verb%type_tyvars : (type -> type list)%}\egroup
13037 @@ -27051,68 +27049,68 @@ Never fails.
13038 curry.
13039
13040 \ENDDOC
13041 -\DOC{UNDISCH}
13042 +\DOC{UNDISCH\_ALL}
13043
13044 -\TYPE {\small\verb%UNDISCH : (thm -> thm)%}\egroup
13045 +\TYPE {\small\verb%UNDISCH_ALL : (thm -> thm)%}\egroup
13046
13047 \SYNOPSIS
13048 -Undischarges the antecedent of an implicative theorem.
13049 +Iteratively undischarges antecedents in a chain of implications.
13050
13051 \DESCRIBE
13052 {\par\samepage\setseps\small
13053 \begin{verbatim}
13054 - A |- t1 ==> t2
13055 - ---------------- UNDISCH
13056 - A, t1 |- t2
13057 + A |- t1 ==> ... ==> tn ==> t
13058 + ------------------------------ UNDISCH_ALL
13059 + A, t1, ..., tn |- t
13060 \end{verbatim}
13061 }
13062 -\noindent Note that {\small\verb%UNDISCH%} treats {\small\verb%"~u"%} as {\small\verb%"u ==> F"%}.
13063 +\noindent Note that {\small\verb%UNDISCH_ALL%} treats {\small\verb%"~u"%} as {\small\verb%"u ==> F"%}.
13064
13065 \FAILURE
13066 -{\small\verb%UNDISCH%} will fail on theorems which are not implications or negations.
13067 +Unlike {\small\verb%UNDISCH%}, {\small\verb%UNDISCH_ALL%} will,
13068 +when called on something other than an implication or negation,
13069 +return its argument unchanged rather than failing.
13070
13071 \COMMENTS
13072 -If the antecedent already appears in the hypotheses, it will not be duplicated.
13073 -However, unlike {\small\verb%DISCH%},
13074 -if the antecedent is alpha-equivalent to one of the hypotheses,
13075 -it will still be added to the hypotheses.
13076 +Identical terms which are repeated in {\small\verb%A, "t1", ..., "tn"%} will
13077 +not be duplicated in the hypotheses of the resulting theorem.
13078 +However, if two or more alpha-equivalent terms appear in {\small\verb%A, "t1", ..., "tn"%},
13079 +then each distinct term will appear in the result.
13080
13081 \SEEALSO
13082 -DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, FILTER_DISCH_TAC, FILTER_DISCH_THEN,
13083 -NEG_DISCH, STRIP_TAC, UNDISCH_ALL, UNDISCH_TAC.
13084 +DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, NEG_DISCH, FILTER_DISCH_TAC,
13085 +FILTER_DISCH_THEN, STRIP_TAC, UNDISCH, UNDISCH_TAC.
13086
13087 \ENDDOC
13088 -\DOC{UNDISCH\_ALL}
13089 +\DOC{UNDISCH}
13090
13091 -\TYPE {\small\verb%UNDISCH_ALL : (thm -> thm)%}\egroup
13092 +\TYPE {\small\verb%UNDISCH : (thm -> thm)%}\egroup
13093
13094 \SYNOPSIS
13095 -Iteratively undischarges antecedents in a chain of implications.
13096 +Undischarges the antecedent of an implicative theorem.
13097
13098 \DESCRIBE
13099 {\par\samepage\setseps\small
13100 \begin{verbatim}
13101 - A |- t1 ==> ... ==> tn ==> t
13102 - ------------------------------ UNDISCH_ALL
13103 - A, t1, ..., tn |- t
13104 + A |- t1 ==> t2
13105 + ---------------- UNDISCH
13106 + A, t1 |- t2
13107 \end{verbatim}
13108 }
13109 -\noindent Note that {\small\verb%UNDISCH_ALL%} treats {\small\verb%"~u"%} as {\small\verb%"u ==> F"%}.
13110 +\noindent Note that {\small\verb%UNDISCH%} treats {\small\verb%"~u"%} as {\small\verb%"u ==> F"%}.
13111
13112 \FAILURE
13113 -Unlike {\small\verb%UNDISCH%}, {\small\verb%UNDISCH_ALL%} will,
13114 -when called on something other than an implication or negation,
13115 -return its argument unchanged rather than failing.
13116 +{\small\verb%UNDISCH%} will fail on theorems which are not implications or negations.
13117
13118 \COMMENTS
13119 -Identical terms which are repeated in {\small\verb%A, "t1", ..., "tn"%} will
13120 -not be duplicated in the hypotheses of the resulting theorem.
13121 -However, if two or more alpha-equivalent terms appear in {\small\verb%A, "t1", ..., "tn"%},
13122 -then each distinct term will appear in the result.
13123 +If the antecedent already appears in the hypotheses, it will not be duplicated.
13124 +However, unlike {\small\verb%DISCH%},
13125 +if the antecedent is alpha-equivalent to one of the hypotheses,
13126 +it will still be added to the hypotheses.
13127
13128 \SEEALSO
13129 -DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, NEG_DISCH, FILTER_DISCH_TAC,
13130 -FILTER_DISCH_THEN, STRIP_TAC, UNDISCH, UNDISCH_TAC.
13131 +DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, FILTER_DISCH_TAC, FILTER_DISCH_THEN,
13132 +NEG_DISCH, STRIP_TAC, UNDISCH_ALL, UNDISCH_TAC.
13133
13134 \ENDDOC
13135 \DOC{UNDISCH\_TAC}
13136 @@ -27424,18 +27422,21 @@ Never fails.
13137 \#, B, C, CB, Co, I, K, KI, o, oo, S.
13138
13139 \ENDDOC
13140 -\DOC{words}
13141 +\DOC{words2}
13142
13143 -\TYPE {\small\verb%words : (string -> string list)%}\egroup
13144 +\TYPE {\small\verb%words2 : (string -> string -> string list)%}\egroup
13145
13146 \SYNOPSIS
13147 -Splits a string into a list of words.
13148 +Splits a string into a list of substrings, breaking at occurrences of a
13149 +specified character.
13150
13151 \DESCRIBE
13152 -{\small\verb%words s%} splits the string {\small\verb%s%} into a list of substrings. Splitting occurs
13153 -at each sequence of blanks and carriage returns (white space). This white
13154 -space does not appear in the list of substrings. Leading and trailing white
13155 -space in the input string is also thrown away.
13156 +{\small\verb%words2 char s%} splits the string {\small\verb%s%} into a list of substrings. Splitting
13157 +occurs at each occurrence of a sequence of the character {\small\verb%char%}. The {\small\verb%char%}
13158 +characters do not appear in the list of substrings. Leading and trailing
13159 +occurrences of {\small\verb%char%} are also thrown away. If {\small\verb%char%} is not a
13160 +single-character string (its length is not 1), then {\small\verb%s%} will not be split and
13161 +so the result will be the list {\small\verb%[s]%}.
13162
13163 \FAILURE
13164 Never fails.
13165 @@ -27443,37 +27444,29 @@ Never fails.
13166 \EXAMPLE
13167 {\par\samepage\setseps\small
13168 \begin{verbatim}
13169 -#words ` the cat sat on the mat `;;
13170 +#words2 `/` `/the/cat//sat/on//the/mat/`;;
13171 [`the`; `cat`; `sat`; `on`; `the`; `mat`] : string list
13172 -\end{verbatim}
13173 -}
13174 -\USES
13175 -Useful when wanting to map a function over a list of constant strings.
13176 -Instead of using {\small\verb%[`string1`;...;`stringn`]%} one can use:
13177 -{\par\samepage\setseps\small
13178 -\begin{verbatim}
13179 - (words `string1 ... stringn`)
13180 +
13181 +#words2 `//` `/the/cat//sat/on//the/mat/`;;
13182 +[`/the/cat//sat/on//the/mat/`] : string list
13183 \end{verbatim}
13184 }
13185 \SEEALSO
13186 -words2, word_separators, maptok, explode.
13187 +words, word_separators, explode.
13188
13189 \ENDDOC
13190 -\DOC{words2}
13191 +\DOC{words}
13192
13193 -\TYPE {\small\verb%words2 : (string -> string -> string list)%}\egroup
13194 +\TYPE {\small\verb%words : (string -> string list)%}\egroup
13195
13196 \SYNOPSIS
13197 -Splits a string into a list of substrings, breaking at occurrences of a
13198 -specified character.
13199 +Splits a string into a list of words.
13200
13201 \DESCRIBE
13202 -{\small\verb%words2 char s%} splits the string {\small\verb%s%} into a list of substrings. Splitting
13203 -occurs at each occurrence of a sequence of the character {\small\verb%char%}. The {\small\verb%char%}
13204 -characters do not appear in the list of substrings. Leading and trailing
13205 -occurrences of {\small\verb%char%} are also thrown away. If {\small\verb%char%} is not a
13206 -single-character string (its length is not 1), then {\small\verb%s%} will not be split and
13207 -so the result will be the list {\small\verb%[s]%}.
13208 +{\small\verb%words s%} splits the string {\small\verb%s%} into a list of substrings. Splitting occurs
13209 +at each sequence of blanks and carriage returns (white space). This white
13210 +space does not appear in the list of substrings. Leading and trailing white
13211 +space in the input string is also thrown away.
13212
13213 \FAILURE
13214 Never fails.
13215 @@ -27481,15 +27474,20 @@ Never fails.
13216 \EXAMPLE
13217 {\par\samepage\setseps\small
13218 \begin{verbatim}
13219 -#words2 `/` `/the/cat//sat/on//the/mat/`;;
13220 +#words ` the cat sat on the mat `;;
13221 [`the`; `cat`; `sat`; `on`; `the`; `mat`] : string list
13222 -
13223 -#words2 `//` `/the/cat//sat/on//the/mat/`;;
13224 -[`/the/cat//sat/on//the/mat/`] : string list
13225 +\end{verbatim}
13226 +}
13227 +\USES
13228 +Useful when wanting to map a function over a list of constant strings.
13229 +Instead of using {\small\verb%[`string1`;...;`stringn`]%} one can use:
13230 +{\par\samepage\setseps\small
13231 +\begin{verbatim}
13232 + (words `string1 ... stringn`)
13233 \end{verbatim}
13234 }
13235 \SEEALSO
13236 -words, word_separators, explode.
13237 +words2, word_separators, maptok, explode.
13238
13239 \ENDDOC
13240 \DOC{word\_separators}
13241 --- hol88-2.02.19940316.orig/lisp/f-format.l
13242 +++ hol88-2.02.19940316/lisp/f-format.l
13243 @@ -131,8 +131,8 @@
13244 (defun flush-output-buffer nil
13245 ;; Some data types (e.g. streams) cannot be catenated in franz, so
13246 ;; print out items in buffer separately.
13247 - #+franz (mapc #'llprinc (nreverse %output-buffer))
13248 - #-franz (llprinc (apply #'catenate (nreverse %output-buffer)))
13249 + #+(or franz gcl) (mapc #'llprinc (nreverse %output-buffer))
13250 + #-(or franz gcl) (llprinc (apply #'catenate (nreverse %output-buffer)))
13251 (setq %output-buffer nil))
13252
13253
13254 --- hol88-2.02.19940316.orig/lisp/f-cl.l
13255 +++ hol88-2.02.19940316/lisp/f-cl.l
13256 @@ -164,10 +164,11 @@
13257 :gc t)
13258 #+kcl
13259 (progn
13260 - (setf (symbol-function 'si:top-level)
13261 - `(lambda nil (tml)))
13262 +; (setf (symbol-function 'si:top-level)
13263 +; `(lambda nil (tml)))
13264 + (setq si::*top-level-hook* (lambda nil (tml)))
13265 (gbc t)
13266 - (save file))
13267 + (si::save-system file))
13268 #+allegro
13269 (progn
13270 (setf (symbol-function 'excl::copyright-banner)
13271 @@ -569,10 +570,19 @@
13272 (setq *standard-input* (pop inputstack))
13273 (close current-input)))
13274
13275 +(defconstant +fast-digits+ 4)
13276 +(defconstant +slow-digits+ (- (truncate (log most-positive-fixnum 10) 1.0) +fast-digits+))
13277 +(defconstant +fast-mod+ (expt 10 +fast-digits+))
13278 +(defconstant +slow-mod+ (expt 10 +slow-digits+))
13279 +
13280
13281 (defun clock ()
13282 ;; Get absolute time - just for time-stamps
13283 - (get-universal-time))
13284 + (let ((s (get-universal-time))
13285 + (m (si::gettimeofday)))
13286 + (+ (* +fast-mod+ (mod s +slow-mod+))
13287 + (mod (truncate (* +fast-mod+ m) 1.0) +fast-mod+))))
13288 +; (get-universal-time))
13289
13290
13291 ;;; Add extension .o to a file name for output name in process of
13292 --- /dev/null
13293 +++ hol88-2.02.19940316/lisp/f-ol-syntax.h
13294 @@ -0,0 +1,367 @@
13295 +
13296 +static void L1();
13297 +static void L2();
13298 +static void L3();
13299 +static void L4();
13300 +static void L5();
13301 +static void L6();
13302 +static void L7();
13303 +static void L8();
13304 +static void L9();
13305 +static void L10();
13306 +static void L11();
13307 +static void L12();
13308 +static void L13();
13309 +static void L14();
13310 +static void L15();
13311 +static void L16();
13312 +static void L17();
13313 +static void L18();
13314 +static void L19();
13315 +static void L20();
13316 +static void L21();
13317 +static void L22();
13318 +static void L23();
13319 +static void L24();
13320 +static void L25();
13321 +static void L26();
13322 +static void L27();
13323 +static void L28();
13324 +static void L29();
13325 +static void L30();
13326 +static void L31();
13327 +static void L32();
13328 +static void L33();
13329 +static void L34();
13330 +static void L35();
13331 +static void L36();
13332 +static void L37();
13333 +static void L38();
13334 +static void L39();
13335 +static void L40();
13336 +static void L41();
13337 +static void L42();
13338 +static void L43();
13339 +static void L44();
13340 +static void L45();
13341 +static void L46();
13342 +static void L47();
13343 +static void L48();
13344 +static void L49();
13345 +static void L50();
13346 +static void L51();
13347 +static void L52();
13348 +static void L53();
13349 +static void L54();
13350 +static void L55();
13351 +static void L56();
13352 +static void L57();
13353 +static void L58();
13354 +static void L59();
13355 +static void L60();
13356 +static void L61();
13357 +static void L62();
13358 +static void L63();
13359 +static void L64();
13360 +static void L65();
13361 +static void L66();
13362 +static void L67();
13363 +static void L68();
13364 +static void L69();
13365 +static void L70();
13366 +#define VC1
13367 +#define VC2
13368 +#define VC3
13369 +#define VC4
13370 +#define VC5
13371 +#define VC6
13372 +#define VC7
13373 +#define VC8
13374 +#define VC9
13375 +#define VC10
13376 +#define VC11
13377 +#define VC12
13378 +#define VC13
13379 +#define VC14
13380 +#define VC15
13381 +#define VC16
13382 +#define VC17
13383 +#define VC18
13384 +#define VC19
13385 +#define VC20
13386 +#define VC21
13387 +#define VC22
13388 +#define VC23 object V37 ,V36;
13389 +#define VC24 object V43 ,V42;
13390 +#define VC25 object V46;
13391 +#define VC26
13392 +#define VC27
13393 +#define VC28 object V57 ,V56;
13394 +#define VC29
13395 +#define VC30
13396 +#define VC31
13397 +#define VC32 object V62;
13398 +#define VC33 object V68 ,V67;
13399 +#define VC34
13400 +#define VC35
13401 +#define VC36
13402 +#define VC37 object V79 ,V78 ,V77 ,V76;
13403 +#define VC38
13404 +#define VC39 object V82;
13405 +#define VC40 object V96 ,V95 ,V94 ,V93 ,V92 ,V91 ,V90 ,V89 ,V88 ,V87 ,V86 ,V85;
13406 +#define VC41
13407 +#define VC42 object V112 ,V111 ,V110 ,V109 ,V108 ,V107 ,V106 ,V105 ,V104 ,V103 ,V102 ,V101;
13408 +#define VC43 object V117 ,V116;
13409 +#define VC44
13410 +#define VC45 object V131 ,V130 ,V129 ,V128;
13411 +#define VC46 object V141 ,V140 ,V139 ,V136;
13412 +#define VC47 object V148 ,V147 ,V145;
13413 +#define VC48
13414 +#define VC49
13415 +#define VC50
13416 +#define VC51 object V160 ,V159;
13417 +#define VC52 object V169 ,V168;
13418 +#define VC53
13419 +#define VC54 object V173;
13420 +#define VC55
13421 +#define VC56
13422 +#define VC57
13423 +#define VC58 object V185 ,V184;
13424 +#define VC59
13425 +#define VC60
13426 +#define VC61 object V192 ,V190;
13427 +#define VC62
13428 +#define VC63
13429 +#define VC64 object V197;
13430 +#define VC65
13431 +#define VC66
13432 +#define VC67
13433 +#define VC68
13434 +#define VC69
13435 +#define VC70
13436 +#define VM70 2
13437 +#define VM69 2
13438 +#define VM68 2
13439 +#define VM67 2
13440 +#define VM66 1
13441 +#define VM65 2
13442 +#define VM64 2
13443 +#define VM63 2
13444 +#define VM62 2
13445 +#define VM61 3
13446 +#define VM60 2
13447 +#define VM59 2
13448 +#define VM58 2
13449 +#define VM57 7
13450 +#define VM56 5
13451 +#define VM55 5
13452 +#define VM54 2
13453 +#define VM53 2
13454 +#define VM52 6
13455 +#define VM51 5
13456 +#define VM50 5
13457 +#define VM49 2
13458 +#define VM48 4
13459 +#define VM47 3
13460 +#define VM46 3
13461 +#define VM45 2
13462 +#define VM44 3
13463 +#define VM43 3
13464 +#define VM42 2
13465 +#define VM41 4
13466 +#define VM40 2
13467 +#define VM39 2
13468 +#define VM38 2
13469 +#define VM37 3
13470 +#define VM36 4
13471 +#define VM35 2
13472 +#define VM34 2
13473 +#define VM33 6
13474 +#define VM32 3
13475 +#define VM31 2
13476 +#define VM30 2
13477 +#define VM29 4
13478 +#define VM28 5
13479 +#define VM27 2
13480 +#define VM26 2
13481 +#define VM25 3
13482 +#define VM24 6
13483 +#define VM23 6
13484 +#define VM22 2
13485 +#define VM21 2
13486 +#define VM20 3
13487 +#define VM19 4
13488 +#define VM18 2
13489 +#define VM17 2
13490 +#define VM16 3
13491 +#define VM15 4
13492 +#define VM14 2
13493 +#define VM13 2
13494 +#define VM12 2
13495 +#define VM11 3
13496 +#define VM10 2
13497 +#define VM9 2
13498 +#define VM8 3
13499 +#define VM7 2
13500 +#define VM6 2
13501 +#define VM5 3
13502 +#define VM4 2
13503 +#define VM3 2
13504 +#define VM2 5
13505 +#define VM1 2
13506 +static void * VVi[109]={
13507 +#define Cdata VV[108]
13508 +(void *)(L1),
13509 +(void *)(L2),
13510 +(void *)(L3),
13511 +(void *)(L4),
13512 +(void *)(L5),
13513 +(void *)(L6),
13514 +(void *)(L7),
13515 +(void *)(L8),
13516 +(void *)(L9),
13517 +(void *)(L10),
13518 +(void *)(L11),
13519 +(void *)(L12),
13520 +(void *)(L13),
13521 +(void *)(L14),
13522 +(void *)(L15),
13523 +(void *)(L16),
13524 +(void *)(L17),
13525 +(void *)(L18),
13526 +(void *)(L19),
13527 +(void *)(L20),
13528 +(void *)(L21),
13529 +(void *)(L22),
13530 +(void *)(L23),
13531 +(void *)(L24),
13532 +(void *)(L25),
13533 +(void *)(L26),
13534 +(void *)(L27),
13535 +(void *)(L28),
13536 +(void *)(L29),
13537 +(void *)(L30),
13538 +(void *)(L31),
13539 +(void *)(L32),
13540 +(void *)(L33),
13541 +(void *)(L34),
13542 +(void *)(L35),
13543 +(void *)(L36),
13544 +(void *)(L37),
13545 +(void *)(L38),
13546 +(void *)(L39),
13547 +(void *)(L40),
13548 +(void *)(L41),
13549 +(void *)(L42),
13550 +(void *)(L43),
13551 +(void *)(L44),
13552 +(void *)(L45),
13553 +(void *)(L46),
13554 +(void *)(L47),
13555 +(void *)(L48),
13556 +(void *)(L49),
13557 +(void *)(L50),
13558 +(void *)(L51),
13559 +(void *)(L52),
13560 +(void *)(L53),
13561 +(void *)(L54),
13562 +(void *)(L55),
13563 +(void *)(L56),
13564 +(void *)(L57),
13565 +(void *)(L58),
13566 +(void *)(L59),
13567 +(void *)(L60),
13568 +(void *)(L61),
13569 +(void *)(L62),
13570 +(void *)(L63),
13571 +(void *)(L64),
13572 +(void *)(L65),
13573 +(void *)(L66),
13574 +(void *)(L67),
13575 +(void *)(L68),
13576 +(void *)(L69),
13577 +(void *)(L70)
13578 +};
13579 +#define VV (VVi)
13580 +static void LnkT107();
13581 +static void (*Lnk107)() = LnkT107;
13582 +static void LnkT106();
13583 +static void (*Lnk106)() = LnkT106;
13584 +static void LnkT105();
13585 +static void (*Lnk105)() = LnkT105;
13586 +static void LnkT104();
13587 +static void (*Lnk104)() = LnkT104;
13588 +static object LnkTLI103(object,...);
13589 +static object (*LnkLI103)() = (object (*)()) LnkTLI103;
13590 +static object LnkTLI102(object,...);
13591 +static object (*LnkLI102)() = (object (*)()) LnkTLI102;
13592 +static void LnkT101();
13593 +static void (*Lnk101)() = LnkT101;
13594 +static void LnkT100();
13595 +static void (*Lnk100)() = LnkT100;
13596 +static void LnkT99();
13597 +static void (*Lnk99)() = LnkT99;
13598 +static void LnkT98();
13599 +static void (*Lnk98)() = LnkT98;
13600 +static void LnkT97();
13601 +static void (*Lnk97)() = LnkT97;
13602 +static void LnkT96();
13603 +static void (*Lnk96)() = LnkT96;
13604 +static void LnkT95();
13605 +static void (*Lnk95)() = LnkT95;
13606 +static void LnkT94();
13607 +static void (*Lnk94)() = LnkT94;
13608 +static void LnkT93();
13609 +static void (*Lnk93)() = LnkT93;
13610 +static void LnkT92();
13611 +static void (*Lnk92)() = LnkT92;
13612 +static void LnkT91();
13613 +static void (*Lnk91)() = LnkT91;
13614 +static void LnkT90();
13615 +static void (*Lnk90)() = LnkT90;
13616 +static void LnkT89();
13617 +static void (*Lnk89)() = LnkT89;
13618 +static void LnkT88();
13619 +static void (*Lnk88)() = LnkT88;
13620 +static void LnkT87();
13621 +static void (*Lnk87)() = LnkT87;
13622 +static void LnkT86();
13623 +static void (*Lnk86)() = LnkT86;
13624 +static void LnkT85();
13625 +static void (*Lnk85)() = LnkT85;
13626 +static void LnkT84();
13627 +static void (*Lnk84)() = LnkT84;
13628 +static void LnkT83();
13629 +static void (*Lnk83)() = LnkT83;
13630 +static void LnkT81();
13631 +static void (*Lnk81)() = LnkT81;
13632 +static void LnkT80();
13633 +static void (*Lnk80)() = LnkT80;
13634 +static void LnkT79();
13635 +static void (*Lnk79)() = LnkT79;
13636 +static void LnkT78();
13637 +static void (*Lnk78)() = LnkT78;
13638 +static void LnkT77();
13639 +static void (*Lnk77)() = LnkT77;
13640 +static void LnkT76();
13641 +static void (*Lnk76)() = LnkT76;
13642 +static void LnkT75();
13643 +static void (*Lnk75)() = LnkT75;
13644 +static void LnkT74();
13645 +static void (*Lnk74)() = LnkT74;
13646 +static void LnkT73();
13647 +static void (*Lnk73)() = LnkT73;
13648 +static void LnkT72();
13649 +static void (*Lnk72)() = LnkT72;
13650 +static void LnkT71();
13651 +static void (*Lnk71)() = LnkT71;
13652 +static void LnkT70();
13653 +static void (*Lnk70)() = LnkT70;
13654 +static void LnkT69();
13655 +static void (*Lnk69)() = LnkT69;
13656 +static void LnkT68();
13657 +static void (*Lnk68)() = LnkT68;
13658 +static void LnkT67();
13659 +static void (*Lnk67)() = LnkT67;
13660 +static void LnkT66();
13661 +static void (*Lnk66)() = LnkT66;
13662 --- /dev/null
13663 +++ hol88-2.02.19940316/lisp/f-ol-syntax.c
13664 @@ -0,0 +1,7805 @@
13665 +#define SGC
13666 +
13667 +#define EXTER extern
13668 +/* h/gclincl.h. Generated from gclincl.h.in by configure. */
13669 +/* h/gclincl.h.in. Generated from configure.in by autoheader. */
13670 +/* define where the heap could begin. Normally should
13671 +be the smallest value returned by sbrk(). Underestimating
13672 +by 10-20 megabytes is not a problem. */
13673 +
13674 +#define DBEGIN 0x8000000 /* where data begins */
13675 +
13676 +
13677 +/* the size of the page tables for gcl. Each page is PAGESIZE which
13678 +is usually 4K or 8K bytes. From 1 to 3 bytes per page are
13679 +preallocated in a table at compile time. this must be a power of 2 if
13680 +SGC is enabled. */
13681 +
13682 +#define MAXPAGE (128*1024*(SIZEOF_LONG>>2)/(1<<(PAGEWIDTH-12)))
13683 +#define VSSIZE 128*1024
13684 +#define BDSSIZE 2*1024
13685 +#define IHSSIZE 4*1024
13686 +#define FRSSIZE 4*1024
13687 +
13688 +#define HOLEPAGE (MAXPAGE/10)
13689 +
13690 +/* check to see if getcwd exists
13691 +*/
13692 +#define HAVE_GETCWD 1
13693 +
13694 +
13695 +/* if we dont have USEGETCWD, we will use GETWD unless following defined
13696 +*/
13697 +#define HAVE_GETWD 1
13698 +
13699 +
13700 +/* no gettimeofday function */
13701 +
13702 +/* #undef NO_GETTOD */
13703 +
13704 +/* define if have <asm/signal.h> */
13705 +#define HAVE_ASM_SIGNAL_H 1
13706 +
13707 +/* define if have <asm/sigcontext.h> */
13708 +#define HAVE_ASM_SIGCONTEXT_H 1
13709 +
13710 +/* define if have struct sigcontext in one of above */
13711 +/* #undef HAVE_SIGCONTEXT */
13712 +
13713 +
13714 +/* define if have <sys/ioctl.h> */
13715 +#define HAVE_SYS_IOCTL_H 1
13716 +
13717 +/* define if we can use the file nsocket.c */
13718 +#define HAVE_NSOCKET 1
13719 +
13720 +#ifndef HAVE_ALLOCA
13721 +/* define this if you have alloca */
13722 +#define HAVE_ALLOCA 1
13723 +#endif
13724 +
13725 +
13726 +/* define if need alloca.h */
13727 +/* #undef NEED_ALLOCA_H */
13728 +
13729 +#ifdef NEED_ALLOCA_H
13730 +#include <alloca.h>
13731 +#endif
13732 +
13733 +
13734 +/* define LISTEN_USE_FCNTL if we can check for input using fcntl */
13735 +#define LISTEN_USE_FCNTL 1
13736 +
13737 +/* if signal.h alone contains the stuff necessary for sgc */
13738 +#define SIGNAL_H_HAS_SIGCONTEXT 1
13739 +
13740 +
13741 +/* define if the profil system call is not defined in libc */
13742 +/* #undef NO_PROFILE */
13743 +
13744 +
13745 +/* define if the _cleanup() function exists and should be called
13746 + before saving */
13747 +/* #define USE_CLEANUP */
13748 +
13749 +
13750 +/* define if BIG_ENDIAN or LITTLE_ENDIAN is defined by including
13751 + the standard includes */
13752 +/* #define ENDIAN_ALREADY_DEFINED */
13753 +
13754 +/* define if SV_ONSTACK is defined in signal.h */
13755 +#define HAVE_SV_ONSTACK 1
13756 +
13757 +
13758 +/*
13759 + define to be a typical stack address. We use this to decide
13760 + whether we can use a cheap test for NULL_OR_ON_C_STACK, or whether
13761 + it has to be more complex..
13762 +
13763 +*/
13764 +
13765 +#define CSTACK_ADDRESS -1075718936
13766 +
13767 +/* define if SIGSYS is defined in signal.h */
13768 +
13769 +#define HAVE_SIGSYS 1
13770 +
13771 +/* define if SIGEMT is defined in signal.h */
13772 +
13773 +/* #undef HAVE_SIGEMT */
13774 +
13775 +
13776 +/* define if setenv is define */
13777 +#define HAVE_SETENV 1
13778 +
13779 +/* define if putenv is define */
13780 +/* #undef HAVE_PUTENV */
13781 +
13782 +
13783 +/* define if long long int works to multiply to ints, */
13784 +
13785 +#define HAVE_LONG_LONG 1
13786 +
13787 +/* define if want to use GMP */
13788 +#define GMP 1
13789 +
13790 +/* have a broken version of C compiler which makes bad code for -O4 */
13791 +/* #undef BROKEN_O4_OPT */
13792 +
13793 +/* See if gettimeofday is declared in the <sys/time.h> header file. */
13794 +/* if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can */
13795 +/* declare it. */
13796 +
13797 +#define GETTOD_NOT_DECLARED 1
13798 +
13799 +/* #undef HAVE_BSDGETTIMEOFDAY */
13800 +
13801 +/* #undef NO_UNAME */
13802 +
13803 +/* FIONBIO vs. O_NONBLOCK for nonblocking I/O */
13804 +/* #undef USE_FIONBIO */
13805 +
13806 +/* readline support */
13807 +#define HAVE_READLINE 1
13808 +
13809 +/* bfd support */
13810 +/* #undef HAVE_LIBBFD */
13811 +/* #undef NEED_CONST */
13812 +#define HAVE_BFD_BOOLEAN
13813 +
13814 +#ifdef HAVE_BFD_BOOLEAN
13815 +#define MY_BFD_BOOLEAN bfd_boolean
13816 +#define MY_BFD_FALSE FALSE
13817 +#define MY_BFD_TRUE TRUE
13818 +#else
13819 +#define MY_BFD_BOOLEAN boolean
13820 +#define MY_BFD_FALSE false
13821 +#define MY_BFD_TRUE true
13822 +#endif
13823 +/* isnormal check */
13824 +#define HAVE_ISNORMAL 1
13825 +
13826 +/* #undef HAVE_IEEEFP */
13827 +
13828 +#ifdef IN_NUM_CO
13829 +#ifdef HAVE_ISNORMAL
13830 +#define _GNU_SOURCE
13831 +#include <math.h>
13832 +#define ISNORMAL(a) isnormal(a)
13833 +#else
13834 +#ifdef HAVE_IEEEFP
13835 +#include <ieeefp.h>
13836 +#define ISNORMAL(a) (fpclass(a)>=FP_NZERO)
13837 +#else
13838 +#include <math.h>
13839 +#define ISNORMAL(a) ((sizeof (a) == sizeof (float)) ? \
13840 + gcl_isnormal_float(a) : \
13841 + gcl_isnormal_double(a))
13842 +#endif
13843 +#endif
13844 +#endif
13845 +
13846 +#define HAVE_ISFINITE 1
13847 +/* #undef HAVE_FINITE */
13848 +
13849 +#ifdef NEED_ISFINITE
13850 +#ifdef HAVE_ISFINITE
13851 +#define _GNU_SOURCE
13852 +#include <math.h>
13853 +#define ISFINITE(a) isfinite(a)
13854 +#else
13855 +#ifdef HAVE_FINITE
13856 +#include <math.h>
13857 +#include <ieeefp.h>
13858 +#define ISFINITE(a) finite(a)
13859 +#else
13860 +#error "No isfinite found"
13861 +#endif
13862 +#endif
13863 +#endif
13864 +
13865 +#define HAVE_VALUES_H 1
13866 +#define HAVE_FLOAT_H 1
13867 +
13868 +#ifdef IN_NUM_CO
13869 +#ifdef HAVE_VALUES_H
13870 +#include <values.h>
13871 +#endif
13872 +#ifdef HAVE_FLOAT_H
13873 +#include <float.h>
13874 +#endif
13875 +#endif
13876 +
13877 +
13878 +
13879 +/* math.h for definitions in generated C code */
13880 +#define HAVE_MATH_H 1
13881 +
13882 +#ifdef HAVE_MATH_H
13883 +#include <math.h>
13884 +#endif
13885 +
13886 +#define LITTLE_END 1
13887 +
13888 +#define PAGEWIDTH 12
13889 +
13890 +/* #ifdef PAGEWIDTH */
13891 +/* #undef PAGESIZE */
13892 +/* #define PAGESIZE (1<<PAGEWIDTH) */
13893 +/* #endif */
13894 +
13895 +#define SIZEOF_LONG 4
13896 +
13897 +/* #undef USE_DLOPEN */
13898 +
13899 +#define MP_LIMB_BYTES 4
13900 +
13901 +/* #undef ANSI_COMMON_LISP */
13902 +
13903 +/* #undef __SHORT_LIMB */
13904 +/* #undef __LONG_LONG_LIMB */
13905 +
13906 +/* #undef HAVE_JAPI_H */
13907 +
13908 +#define HAVE_XDR 1
13909 +/* #undef ENDIAN_ALREADY_DEFINED */
13910 +/* #undef USE_CLEANUP */
13911 +#define SIZEOF_CONTBLOCK 8
13912 +
13913 +/* #undef GCL_GPROF */
13914 +#define HAVE_DECL_RL_COMPLETION_MATCHES 1
13915 +#define HAVE_RL_COMPENTRY_FUNC_T 1
13916 +#define HAVE_GNU_LD 1
13917 +#define CAN_UNRANDOMIZE_SBRK 1
13918 +#define HOST_CPU "I486"
13919 +#define HOST_KERNEL "LINUX"
13920 +#define HOST_SYSTEM "GNU"
13921 +/* #undef GCL_GPROF_START */
13922 +#define HZ 100
13923 +/* #undef ADDR_NO_RANDOMIZE */
13924 +/* #undef LEADING_UNDERSCORE */
13925 +#define HAVE_XGCL 1
13926 +/* #undef HAVE_SYS_SOCKIO_H */
13927 +/* #undef HAVE_MALLOC_MALLOC_H */
13928 +/* #undef HAVE_OBJC_MALLOC_H */
13929 +/* #undef HAVE_OUTPUT_BFD */
13930 +#define HAVE_BUILTIN_CLEAR_CACHE 1
13931 +
13932 +/* Define to 1 if you have the <asm/sigcontext.h> header file. */
13933 +#define HAVE_ASM_SIGCONTEXT_H 1
13934 +
13935 +/* Define to 1 if you have the <asm/signal.h> header file. */
13936 +#define HAVE_ASM_SIGNAL_H 1
13937 +
13938 +/* Define to 1 if you have the <elf_abi.h> header file. */
13939 +/* #undef HAVE_ELF_ABI_H */
13940 +
13941 +/* Define to 1 if you have the <elf.h> header file. */
13942 +#define HAVE_ELF_H 1
13943 +
13944 +/* Have finite function */
13945 +/* #undef HAVE_FINITE */
13946 +
13947 +/* Define to 1 if you have the <float.h> header file. */
13948 +#define HAVE_FLOAT_H 1
13949 +
13950 +/* Define to 1 if you have the `getcwd' function. */
13951 +#define HAVE_GETCWD 1
13952 +
13953 +/* Define to 1 if you have the `getwd' function. */
13954 +#define HAVE_GETWD 1
13955 +
13956 +/* Have ieeefp fpclass function */
13957 +/* #undef HAVE_IEEEFP */
13958 +
13959 +/* Define to 1 if you have the <inttypes.h> header file. */
13960 +/* #undef HAVE_INTTYPES_H */
13961 +
13962 +/* Have isfinite function */
13963 +#define HAVE_ISFINITE 1
13964 +
13965 +/* Have isnormal function */
13966 +#define HAVE_ISNORMAL 1
13967 +
13968 +/* Define to 1 if you have the <japi.h> header file. */
13969 +/* #undef HAVE_JAPI_H */
13970 +
13971 +/* memalign element present */
13972 +/* #undef HAVE_MALLOC_ZONE_MEMALIGN */
13973 +
13974 +/* Define to 1 if you have the <math.h> header file. */
13975 +#define HAVE_MATH_H 1
13976 +
13977 +/* Define to 1 if you have the <memory.h> header file. */
13978 +/* #undef HAVE_MEMORY_H */
13979 +
13980 +/* Define to 1 if you have the <readline/readline.h> header file. */
13981 +#define HAVE_READLINE_READLINE_H 1
13982 +
13983 +/* Define to 1 if you have the <rpc/rpc.h> header file. */
13984 +/* #undef HAVE_RPC_RPC_H */
13985 +
13986 +/* Define to 1 if you have the <stdint.h> header file. */
13987 +/* #undef HAVE_STDINT_H */
13988 +
13989 +/* Define to 1 if you have the <stdlib.h> header file. */
13990 +/* #undef HAVE_STDLIB_H */
13991 +
13992 +/* Define to 1 if you have the <strings.h> header file. */
13993 +/* #undef HAVE_STRINGS_H */
13994 +
13995 +/* Define to 1 if you have the <string.h> header file. */
13996 +/* #undef HAVE_STRING_H */
13997 +
13998 +/* Define to 1 if you have the <sys/ioctl.h> header file. */
13999 +#define HAVE_SYS_IOCTL_H 1
14000 +
14001 +/* Define to 1 if you have the <sys/sockio.h> header file. */
14002 +/* #undef HAVE_SYS_SOCKIO_H */
14003 +
14004 +/* Define to 1 if you have the <sys/stat.h> header file. */
14005 +/* #undef HAVE_SYS_STAT_H */
14006 +
14007 +/* Define to 1 if you have the <sys/types.h> header file. */
14008 +/* #undef HAVE_SYS_TYPES_H */
14009 +
14010 +/* Define to 1 if you have the <unistd.h> header file. */
14011 +/* #undef HAVE_UNISTD_H */
14012 +
14013 +/* Define to 1 if you have the <values.h> header file. */
14014 +#define HAVE_VALUES_H 1
14015 +
14016 +/* Define to the address where bug reports for this package should be sent. */
14017 +#define PACKAGE_BUGREPORT ""
14018 +
14019 +/* Define to the full name of this package. */
14020 +#define PACKAGE_NAME ""
14021 +
14022 +/* Define to the full name and version of this package. */
14023 +#define PACKAGE_STRING ""
14024 +
14025 +/* Define to the one symbol short name of this package. */
14026 +#define PACKAGE_TARNAME ""
14027 +
14028 +/* Define to the home page for this package. */
14029 +#define PACKAGE_URL ""
14030 +
14031 +/* Define to the version of this package. */
14032 +#define PACKAGE_VERSION ""
14033 +
14034 +/* The size of `long', as computed by sizeof. */
14035 +#define SIZEOF_LONG 4
14036 +
14037 +/* staticly linked images */
14038 +/* #undef STATIC_LINKING */
14039 +
14040 +/* Define to 1 if you have the ANSI C header files. */
14041 +/* #undef STDC_HEADERS */
14042 +#include <stdarg.h>
14043 +#define _VA_LIST_DEFINED
14044 +
14045 +#include <setjmp.h>
14046 +#include <stdio.h>
14047 +
14048 +/* #define endp(obje) endp1(obje) */
14049 +
14050 +#define STSET(type,x,i,val) do{SGC_TOUCH(x);STREF(type,x,i) = (val);} while(0)
14051 +
14052 +
14053 +#ifndef NEW_LISP
14054 +#define t_doublefloat t_longfloat
14055 +#endif
14056 +
14057 +enum type {
14058 + t_cons,
14059 + t_start = 0,
14060 + t_fixnum,
14061 + t_bignum,
14062 + t_ratio,
14063 + t_shortfloat,
14064 + t_doublefloat,
14065 + t_complex,
14066 + t_character,
14067 + t_symbol,
14068 + t_package,
14069 + t_hashtable,
14070 + t_array,
14071 + t_vector,
14072 + t_string,
14073 + t_bitvector,
14074 + t_structure,
14075 + t_stream,
14076 + t_random,
14077 + t_readtable,
14078 + t_pathname,
14079 + t_cfun,
14080 + t_cclosure,
14081 + t_sfun,
14082 + t_gfun,
14083 + t_vfun,
14084 + t_afun,
14085 + t_closure,
14086 + t_cfdata,
14087 + t_spice,
14088 + t_end,
14089 + t_contiguous,
14090 + t_relocatable,
14091 + t_other
14092 +};
14093 +
14094 +
14095 +enum signals_allowed_values {
14096 + sig_none,
14097 + sig_normal,
14098 + sig_try_to_delay,
14099 + sig_safe,
14100 + sig_at_read,
14101 + sig_use_signals_allowed_value
14102 +
14103 +};
14104 +
14105 +
14106 +#ifdef __SHORT_LIMB
14107 +typedef unsigned int mp_limb_t;
14108 +#else
14109 +#ifdef __LONG_LONG_LIMB
14110 +typedef unsigned long long int mp_limb_t;
14111 +#else
14112 +typedef unsigned long int mp_limb_t;
14113 +#endif
14114 +#endif
14115 +
14116 +typedef mp_limb_t * mp_ptr;
14117 +
14118 +typedef struct
14119 +{
14120 + int _mp_alloc; /* Number of *limbs* allocated and pointed
14121 + to by the _mp_d field. */
14122 + int _mp_size; /* abs(_mp_size) is the number of limbs the
14123 + last field points to. If _mp_size is
14124 + negative this is a negative number. */
14125 + mp_limb_t *_mp_d; /* Pointer to the limbs. */
14126 +} __mpz_struct;
14127 +
14128 +typedef __mpz_struct MP_INT;
14129 +
14130 +/*
14131 + Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
14132 +
14133 +This file is part of GNU Common Lisp, herein referred to as GCL
14134 +
14135 +GCL is free software; you can redistribute it and/or modify it under
14136 +the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
14137 +the Free Software Foundation; either version 2, or (at your option)
14138 +any later version.
14139 +
14140 +GCL is distributed in the hope that it will be useful, but WITHOUT
14141 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14142 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14143 +License for more details.
14144 +
14145 +You should have received a copy of the GNU Library General Public License
14146 +along with GCL; see the file COPYING. If not, write to the Free Software
14147 +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
14148 +
14149 +*/
14150 +
14151 +/*
14152 + object.h
14153 +*/
14154 +
14155 +/*
14156 + Some system constants.
14157 +*/
14158 +
14159 +#define TRUE 1 /* boolean true value */
14160 +#define FALSE 0 /* boolean false value */
14161 +
14162 +#define FIRSTWORD unsigned char t,flag; char s,m
14163 +
14164 +#define NBPP 4 /* number of bytes per pointer */
14165 +
14166 +#ifndef PAGEWIDTH
14167 +#define PAGEWIDTH 11 /* page width */
14168 +#endif
14169 + /* log2(PAGESIZE) */
14170 +#undef PAGESIZE
14171 +#define PAGESIZE (1 << PAGEWIDTH) /* page size in bytes */
14172 +
14173 +
14174 +#define CHCODELIM 256 /* character code limit */
14175 + /* ASCII character set */
14176 +#define CHFONTLIM 1 /* character font limit */
14177 +#define CHBITSLIM 1 /* character bits limit */
14178 +#define CHCODEFLEN 8 /* character code field length */
14179 +#define CHFONTFLEN 0 /* character font field length */
14180 +#define CHBITSFLEN 0 /* character bits field length */
14181 +
14182 +#define PHTABSIZE 512 /* number of entries */
14183 + /* in the package hash table */
14184 +
14185 +#define ARANKLIM 64 /* array rank limit */
14186 +
14187 +#define RTABSIZE CHCODELIM
14188 + /* read table size */
14189 +
14190 +#define CBMINSIZE 64 /* contiguous block minimal size */
14191 +
14192 +#ifndef CHAR_SIZE
14193 +#define CHAR_SIZE 8 /* number of bits in a char */
14194 +#endif
14195 +
14196 +#undef bool
14197 +typedef int bool;
14198 +typedef long fixnum;
14199 +typedef unsigned long ufixnum;
14200 +typedef float shortfloat;
14201 +typedef double longfloat;
14202 +typedef unsigned short fatchar;
14203 +
14204 +#ifndef plong
14205 +#define plong int
14206 +#endif
14207 +
14208 +
14209 +#define SIGNED_CHAR(x) (((char ) -1) < (char )0 ? (char) x \
14210 + : (x >= (1<<(CHAR_SIZE-1)) ? \
14211 + x - (((int)(1<<(CHAR_SIZE-1))) << 1) \
14212 + : (char ) x))
14213 +
14214 +
14215 +/*
14216 + Definition of the type of LISP objects.
14217 +*/
14218 +typedef union lispunion *object;
14219 +
14220 +typedef union int_object iobject;
14221 +union int_object {object o; fixnum i;};
14222 +
14223 +/*
14224 + OBJect NULL value.
14225 + It should not coincide with any legal object value.
14226 +*/
14227 +#define OBJNULL ((object)NULL)
14228 +
14229 +/*
14230 + Definition of each implementation type.
14231 +*/
14232 +
14233 +struct fixnum_struct {
14234 + FIRSTWORD;
14235 + fixnum FIXVAL; /* fixnum value */
14236 +};
14237 +#define Mfix(obje) (obje)->FIX.FIXVAL
14238 +#define fix(x) Mfix(x)
14239 +
14240 +#define SMALL_FIXNUM_LIMIT 1024
14241 +
14242 +/* EXTER */
14243 +/* struct fixnum_struct small_fixnum_table[2*SMALL_FIXNUM_LIMIT]; */
14244 +
14245 +/* #define small_fixnum(i) \ */
14246 +/* (object)(small_fixnum_table+SMALL_FIXNUM_LIMIT+(i)) */
14247 +
14248 +struct shortfloat_struct {
14249 + FIRSTWORD;
14250 + shortfloat SFVAL; /* shortfloat value */
14251 +};
14252 +#define Msf(obje) (obje)->SF.SFVAL
14253 +#define sf(x) Msf(x)
14254 +
14255 +struct longfloat_struct {
14256 + FIRSTWORD;
14257 + longfloat LFVAL; /* longfloat value */
14258 +};
14259 +#define Mlf(obje) (obje)->LF.LFVAL
14260 +#define lf(x) Mlf(x)
14261 +
14262 +
14263 +
14264 +/* #ifdef _MP_H */
14265 +
14266 +/* #else */
14267 +/* typedef struct */
14268 +/* { */
14269 +/* int _mp_alloc; Number of *limbs* allocated and pointed */
14270 +/* to by the _mp_d field. */
14271 +/* int _mp_size; abs(_mp_size) is the number of limbs the */
14272 +/* last field points to. If _mp_size is */
14273 +/* negative this is a negative number. */
14274 +/* void *_mp_d; Pointer to the limbs. */
14275 +/* } our_mpz_struct; */
14276 +/* #endif */
14277 +
14278 +struct bignum {
14279 + FIRSTWORD;
14280 +#ifdef GMP
14281 + __mpz_struct big_mpz_t;
14282 +#else
14283 + plong *big_self; /* bignum body */
14284 + int big_length; /* bignum length */
14285 +#endif
14286 +};
14287 +
14288 +struct ratio {
14289 + FIRSTWORD;
14290 + object rat_den; /* denominator */
14291 + /* must be an integer */
14292 + object rat_num; /* numerator */
14293 + /* must be an integer */
14294 +};
14295 +
14296 +struct complex {
14297 + FIRSTWORD;
14298 + object cmp_real; /* real part */
14299 + /* must be a number */
14300 + object cmp_imag; /* imaginary part */
14301 + /* must be a number */
14302 +};
14303 +
14304 +struct character {
14305 + FIRSTWORD;
14306 + unsigned short ch_code; /* code */
14307 + unsigned char ch_font; /* font */
14308 + unsigned char ch_bits; /* bits */
14309 +};
14310 +
14311 +
14312 +
14313 +/* struct character character_table1[256+128]; */
14314 +/* EXTER */
14315 +/* union lispunion character_table1[256+128]; */
14316 +/* #define character_table (character_table1+128) */
14317 +/* #define code_char(c) (object)(character_table+(c)) */
14318 +/* #define char_code(obje) ((object)obje)->ch.ch_code */
14319 +/* #define char_font(obje) ((object)obje)->ch.ch_font */
14320 +/* #define char_bits(obje) ((object)obje)->ch.ch_bits */
14321 +
14322 +enum stype { /* symbol type */
14323 + stp_ordinary, /* ordinary */
14324 + stp_constant, /* constant */
14325 + stp_special /* special */
14326 +};
14327 +
14328 +#define Cnil ((object)&Cnil_body)
14329 +#define Ct ((object)&Ct_body)
14330 +#define sLnil Cnil
14331 +#define sLt Ct
14332 +
14333 +#define NOT_SPECIAL ((void (*)())Cnil)
14334 +#define s_fillp st_fillp
14335 +#define s_self st_self
14336 +
14337 +struct symbol {
14338 + FIRSTWORD;
14339 + object s_dbind; /* dynamic binding */
14340 + void (*s_sfdef)(); /* special form definition */
14341 + /* This field coincides with c_car */
14342 + char *s_self; /* print name */
14343 + /* These fields coincide with */
14344 + /* st_fillp and st_self. */
14345 + int s_fillp; /* print name length */
14346 +
14347 + object s_gfdef; /* global function definition */
14348 + /* For a macro, */
14349 + /* its expansion function */
14350 + /* is to be stored. */
14351 + object s_plist; /* property list */
14352 + object s_hpack; /* home package */
14353 + /* Cnil for uninterned symbols */
14354 + short s_stype; /* symbol type */
14355 + /* of enum stype */
14356 + short s_mflag; /* macro flag */
14357 +};
14358 +EXTER
14359 +/* struct symbol Cnil_body, Ct_body; */
14360 +union lispunion Cnil_body, Ct_body;
14361 +
14362 +struct package {
14363 + FIRSTWORD;
14364 + object p_name; /* package name */
14365 + /* a string */
14366 + object p_nicknames; /* nicknames */
14367 + /* list of strings */
14368 + object p_shadowings; /* shadowing symbol list */
14369 + object p_uselist; /* use-list of packages */
14370 + object p_usedbylist; /* used-by-list of packages */
14371 + object *p_internal; /* hashtable for internal symbols */
14372 + object *p_external; /* hashtable for external symbols */
14373 + int p_internal_size; /* size of internal hash table*/
14374 + int p_external_size; /* size of external hash table */
14375 + int p_internal_fp; /* [rough] number of symbols */
14376 + int p_external_fp; /* [rough] number of symbols */
14377 + struct package
14378 + *p_link; /* package link */
14379 +};
14380 +
14381 +/*
14382 + The values returned by intern and find_symbol.
14383 + File_symbol may return 0.
14384 +*/
14385 +#define INTERNAL 1
14386 +#define EXTERNAL 2
14387 +#define INHERITED 3
14388 +
14389 +/*
14390 + All the packages are linked through p_link.
14391 +*/
14392 +EXTER struct package *pack_pointer; /* package pointer */
14393 +
14394 +struct cons {
14395 + FIRSTWORD;
14396 + object c_cdr; /* cdr */
14397 + object c_car; /* car */
14398 +};
14399 +
14400 +enum httest { /* hash table key test function */
14401 + htt_eq, /* eq */
14402 + htt_eql, /* eql */
14403 + htt_equal /* equal */
14404 +};
14405 +
14406 +struct htent { /* hash table entry */
14407 + object hte_key; /* key */
14408 + object hte_value; /* value */
14409 +};
14410 +
14411 +struct hashtable { /* hash table header */
14412 + FIRSTWORD;
14413 + struct htent
14414 + *ht_self; /* pointer to the hash table */
14415 + object ht_rhsize; /* rehash size */
14416 + object ht_rhthresh; /* rehash threshold */
14417 + int ht_nent; /* number of entries */
14418 + int ht_size; /* hash table size */
14419 + short ht_test; /* key test function */
14420 + /* of enum httest */
14421 +};
14422 +
14423 +enum aelttype { /* array element type */
14424 + aet_object, /* t */
14425 + aet_ch, /* string-char */
14426 + aet_bit, /* bit */
14427 + aet_fix, /* fixnum */
14428 + aet_sf, /* short-float */
14429 + aet_lf, /* plong-float */
14430 + aet_char, /* signed char */
14431 + aet_uchar, /* unsigned char */
14432 + aet_short, /* signed short */
14433 + aet_ushort, /* unsigned short */
14434 + aet_last
14435 + };
14436 +
14437 +struct array { /* array header */
14438 + FIRSTWORD;
14439 + object a_displaced; /* displaced */
14440 + short a_rank; /* array rank */
14441 + short a_elttype; /* element type */
14442 + object *a_self; /* pointer to the array */
14443 + short a_adjustable; /* adjustable flag */
14444 + short a_offset; /* bitvector offset */
14445 + int a_dim; /* dimension */
14446 + int *a_dims; /* table of dimensions */
14447 +
14448 +};
14449 +
14450 +
14451 +
14452 +struct vector { /* vector header */
14453 + FIRSTWORD;
14454 + object v_displaced; /* displaced */
14455 + short v_hasfillp; /* has-fill-pointer flag */
14456 + short v_elttype; /* element type */
14457 +
14458 + object *v_self; /* pointer to the vector */
14459 + int v_fillp; /* fill pointer */
14460 + /* For simple vectors, */
14461 + /* v_fillp is equal to v_dim. */
14462 + int v_dim; /* dimension */
14463 + short v_adjustable; /* adjustable flag */
14464 + short v_offset; /* not used */
14465 +};
14466 +
14467 +struct string { /* string header */
14468 + FIRSTWORD;
14469 + object st_displaced; /* displaced */
14470 + short st_hasfillp; /* has-fill-pointer flag */
14471 + short st_adjustable; /* adjustable flag */
14472 + char *st_self; /* pointer to the string */
14473 + int st_fillp; /* fill pointer */
14474 + /* For simple strings, */
14475 + /* st_fillp is equal to st_dim. */
14476 + int st_dim; /* dimension */
14477 + /* string length */
14478 +
14479 +};
14480 +
14481 +struct ustring {
14482 + FIRSTWORD;
14483 + object ust_displaced;
14484 + short ust_hasfillp;
14485 + short ust_adjustable;
14486 + unsigned char *ust_self;
14487 + int ust_fillp;
14488 +
14489 + int ust_dim;
14490 +
14491 +
14492 +};
14493 +
14494 +#define USHORT_GCL(x,i) (((unsigned short *)(x)->ust.ust_self)[i])
14495 +#define SHORT_GCL(x,i) ((( short *)(x)->ust.ust_self)[i])
14496 +
14497 +#define BV_OFFSET(x) ((type_of(x)==t_bitvector ? x->bv.bv_offset : \
14498 + type_of(x)== t_array ? x->a.a_offset : (abort(),0)))
14499 +
14500 +#define SET_BV_OFFSET(x,val) ((type_of(x)==t_bitvector ? x->bv.bv_offset = val : \
14501 + type_of(x)== t_array ? x->a.a_offset=val : (abort(),0)))
14502 +
14503 +
14504 +
14505 +
14506 +struct bitvector { /* bitvector header */
14507 + FIRSTWORD;
14508 + object bv_displaced; /* displaced */
14509 + short bv_hasfillp; /* has-fill-pointer flag */
14510 + short bv_elttype; /* not used */
14511 + char *bv_self; /* pointer to the bitvector */
14512 + int bv_fillp; /* fill pointer */
14513 + /* For simple bitvectors, */
14514 + /* st_fillp is equal to st_dim. */
14515 + int bv_dim; /* dimension */
14516 + /* number of bits */
14517 + short bv_adjustable; /* adjustable flag */
14518 + short bv_offset; /* bitvector offset */
14519 + /* the position of the first bit */
14520 + /* in the first byte */
14521 +};
14522 +
14523 +struct fixarray { /* fixnum array header */
14524 + FIRSTWORD;
14525 + object fixa_displaced; /* displaced */
14526 + short fixa_rank; /* array rank */
14527 + short fixa_elttype; /* element type */
14528 + fixnum *fixa_self; /* pointer to the array */
14529 + short fixa_adjustable;/* adjustable flag */
14530 + short fixa_offset; /* not used */
14531 + int fixa_dim; /* dimension */
14532 + int *fixa_dims; /* table of dimensions */
14533 +
14534 +};
14535 +
14536 +struct sfarray { /* short-float array header */
14537 + FIRSTWORD;
14538 + object sfa_displaced; /* displaced */
14539 + short sfa_rank; /* array rank */
14540 + short sfa_elttype; /* element type */
14541 + shortfloat
14542 + *sfa_self; /* pointer to the array */
14543 + short sfa_adjustable; /* adjustable flag */
14544 + short sfa_offset; /* not used */
14545 + int sfa_dim; /* dimension */
14546 +
14547 + int *sfa_dims; /* table of dimensions */
14548 +
14549 +
14550 +
14551 +};
14552 +
14553 +struct lfarray { /* plong-float array header */
14554 + FIRSTWORD;
14555 + object lfa_displaced; /* displaced */
14556 + short lfa_rank; /* array rank */
14557 + short lfa_elttype; /* element type */
14558 + longfloat
14559 + *lfa_self; /* pointer to the array */
14560 + short lfa_adjustable; /* adjustable flag */
14561 + short lfa_offset; /* not used */
14562 + int lfa_dim; /* dimension */
14563 + int *lfa_dims; /* table of dimensions */
14564 +
14565 +
14566 +};
14567 +
14568 +struct structure { /* structure header */
14569 + FIRSTWORD;
14570 + object str_def; /* structure definition (a structure) */
14571 + object *str_self; /* structure self */
14572 +};
14573 +
14574 +struct s_data {object name;
14575 + fixnum length;
14576 + object raw;
14577 + object included;
14578 + object includes;
14579 + object staticp;
14580 + object print_function;
14581 + object slot_descriptions;
14582 + object slot_position;
14583 + fixnum size;
14584 + object has_holes;
14585 + };
14586 +
14587 +#define S_DATA(x) ((struct s_data *)((x)->str.str_self))
14588 +#define SLOT_TYPE(def,i) (((S_DATA(def))->raw->ust.ust_self[i]))
14589 +#define SLOT_POS(def,i) USHORT_GCL(S_DATA(def)->slot_position,i)
14590 +#define STREF(type,x,i) (*((type *)(((char *)((x)->str.str_self))+(i))))
14591 +
14592 +
14593 +
14594 +enum smmode { /* stream mode */
14595 + smm_input, /* input */
14596 + smm_output, /* output */
14597 + smm_io, /* input-output */
14598 + smm_probe, /* probe */
14599 + smm_synonym, /* synonym */
14600 + smm_broadcast, /* broadcast */
14601 + smm_concatenated, /* concatenated */
14602 + smm_two_way, /* two way */
14603 + smm_echo, /* echo */
14604 + smm_string_input, /* string input */
14605 + smm_string_output, /* string output */
14606 + smm_user_defined, /* for user defined */
14607 + smm_socket /* Socket stream */
14608 +};
14609 +
14610 +/* for any stream that takes writec_char, directly (not two_way or echo)
14611 + ie. smm_output,smm_io, smm_string_output, smm_socket
14612 + */
14613 +#define STREAM_FILE_COLUMN(str) ((str)->sm.sm_int1)
14614 +
14615 +/* for smm_echo */
14616 +#define ECHO_STREAM_N_UNREAD(strm) ((strm)->sm.sm_int0)
14617 +
14618 +/* file fd for socket */
14619 +#define SOCKET_STREAM_FD(strm) ((strm)->sm.sm_fd)
14620 +#define SOCKET_STREAM_BUFFER(strm) ((strm)->sm.sm_object1)
14621 +
14622 +/* for smm_string_input */
14623 +#define STRING_INPUT_STREAM_NEXT(strm) ((strm)->sm.sm_int0)
14624 +#define STRING_INPUT_STREAM_END(strm) ((strm)->sm.sm_int1)
14625 +
14626 +/* for smm_two_way and smm_echo */
14627 +#define STREAM_OUTPUT_STREAM(strm) ((strm)->sm.sm_object1)
14628 +#define STREAM_INPUT_STREAM(strm) ((strm)->sm.sm_object0)
14629 +
14630 +/* for smm_string_{input,output} */
14631 +#define STRING_STREAM_STRING(strm) ((strm)->sm.sm_object0)
14632 +
14633 +struct stream {
14634 + FIRSTWORD;
14635 + FILE *sm_fp; /* file pointer */
14636 + object sm_object0; /* some object */
14637 + object sm_object1; /* some object */
14638 + int sm_int0; /* some int */
14639 + int sm_int1; /* column for input or output, stream */
14640 + char *sm_buffer; /* ptr to BUFSIZE block of storage */
14641 + char sm_mode; /* stream mode */
14642 + unsigned char sm_flags; /* flags from gcl_sm_flags */
14643 + short sm_fd; /* stream fd */
14644 +
14645 +};
14646 +/* flags */
14647 +#define GET_STREAM_FLAG(strm,name) ((strm)->sm.sm_flags & (1<<(name)))
14648 +#define SET_STREAM_FLAG(strm,name,val) {if (val) (strm)->sm.sm_flags |= (1<<(name)); else (strm)->sm.sm_flags &= ~(1<<(name));}
14649 +
14650 +#define GCL_MODE_BLOCKING 1
14651 +#define GCL_MODE_NON_BLOCKING 0
14652 +#define GCL_TCP_ASYNC 1
14653 +
14654 +enum gcl_sm_flags {
14655 + gcl_sm_blocking=1,
14656 + gcl_sm_tcp_async,
14657 + gcl_sm_input,
14658 + gcl_sm_output,
14659 + gcl_sm_had_error
14660 +
14661 +
14662 +};
14663 +
14664 +#ifdef BSD
14665 +#ifdef SUN3
14666 +#define BASEFF (unsigned char *)0xffffffff
14667 +#else
14668 +#define BASEFF (char *)0xffffffff
14669 +#endif
14670 +#endif
14671 +
14672 +#ifdef ATT
14673 +#define BASEFF (unsigned char *)0xffffffff
14674 +#endif
14675 +
14676 +#ifdef E15
14677 +#define BASEFF (unsigned char *)0xffffffff
14678 +#endif
14679 +
14680 +#ifdef MV
14681 +
14682 +
14683 +#endif
14684 +
14685 +struct random {
14686 + FIRSTWORD;
14687 + unsigned rnd_value; /* random state value */
14688 +};
14689 +
14690 +enum chattrib { /* character attribute */
14691 + cat_whitespace, /* whitespace */
14692 + cat_terminating, /* terminating macro */
14693 + cat_non_terminating, /* non-terminating macro */
14694 + cat_single_escape, /* single-escape */
14695 + cat_multiple_escape, /* multiple-escape */
14696 + cat_constituent /* constituent */
14697 +};
14698 +
14699 +struct rtent { /* read table entry */
14700 + enum chattrib rte_chattrib; /* character attribute */
14701 + object rte_macro; /* macro function */
14702 + object *rte_dtab; /* pointer to the */
14703 + /* dispatch table */
14704 + /* NULL for */
14705 + /* non-dispatching */
14706 + /* macro character, or */
14707 + /* non-macro character */
14708 +};
14709 +
14710 +struct readtable { /* read table */
14711 + FIRSTWORD;
14712 + struct rtent *rt_self; /* read table itself */
14713 +};
14714 +
14715 +struct pathname {
14716 + FIRSTWORD;
14717 + object pn_host; /* host */
14718 + object pn_device; /* device */
14719 + object pn_directory; /* directory */
14720 + object pn_name; /* name */
14721 + object pn_type; /* type */
14722 + object pn_version; /* version */
14723 +};
14724 +
14725 +struct cfun { /* compiled function header */
14726 + FIRSTWORD;
14727 + object cf_name; /* compiled function name */
14728 + void (*cf_self)(); /* entry address */
14729 + object cf_data; /* data the function uses */
14730 + /* for GBC */
14731 +};
14732 +
14733 +struct cclosure { /* compiled closure header */
14734 + FIRSTWORD;
14735 + object cc_name; /* compiled closure name */
14736 + void (*cc_self)(); /* entry address */
14737 + object cc_env; /* environment */
14738 + object cc_data; /* data the closure uses */
14739 + /* for GBC */
14740 + int cc_envdim;
14741 + object *cc_turbo; /* turbo charger */
14742 +};
14743 +
14744 +struct closure {
14745 + FIRSTWORD;
14746 + object cl_name; /* name */
14747 + object (*cl_self)(); /* C start address of code */
14748 + object cl_data; /* To object holding VV vector */
14749 + int cl_argd; /* description of args + number */
14750 + int cl_envdim; /* length of the environment vector */
14751 + object *cl_env; /* environment vector referenced by cl_self()*/
14752 +};
14753 +
14754 +struct sfun {
14755 + FIRSTWORD;
14756 + object sfn_name; /* name */
14757 + object (*sfn_self)(); /* C start address of code */
14758 + object sfn_data; /* To object holding VV vector */
14759 + int sfn_argd; /* description of args + number */
14760 +
14761 + };
14762 +
14763 +struct vfun {
14764 + FIRSTWORD;
14765 + object vfn_name; /* name */
14766 + object (*vfn_self)(); /* C start address of code */
14767 + object vfn_data; /* To object holding VV data */
14768 + unsigned short vfn_minargs; /* Min args and where varargs start */
14769 + unsigned short vfn_maxargs; /* Max number of args */
14770 + };
14771 +struct cfdata {
14772 + FIRSTWORD;
14773 + char *cfd_start; /* beginning of contblock for fun */
14774 + int cfd_size; /* size of contblock */
14775 + int cfd_fillp; /* size of self */
14776 + object *cfd_self; /* body */
14777 + };
14778 +
14779 +struct spice {
14780 + FIRSTWORD;
14781 + int spc_dummy;
14782 +};
14783 +
14784 +/*
14785 + dummy type
14786 +*/
14787 +struct dummy {
14788 + FIRSTWORD;
14789 +};
14790 +
14791 +/*
14792 + Definition of lispunion.
14793 +*/
14794 +union lispunion {
14795 + struct fixnum_struct
14796 + FIX; /* fixnum */
14797 + struct bignum big; /* bignum */
14798 + struct ratio rat; /* ratio */
14799 + struct shortfloat_struct
14800 + SF; /* short floating-point number */
14801 + struct longfloat_struct
14802 + LF; /* plong floating-point number */
14803 + struct complex cmp; /* complex number */
14804 + struct character
14805 + ch; /* character */
14806 + struct symbol s; /* symbol */
14807 + struct package p; /* package */
14808 + struct cons c; /* cons */
14809 + struct hashtable
14810 + ht; /* hash table */
14811 + struct array a; /* array */
14812 + struct vector v; /* vector */
14813 + struct string st; /* string */
14814 + struct ustring ust;
14815 + struct bitvector
14816 + bv; /* bit-vector */
14817 + struct structure
14818 + str; /* structure */
14819 + struct stream sm; /* stream */
14820 + struct random rnd; /* random-states */
14821 + struct readtable
14822 + rt; /* read table */
14823 + struct pathname pn; /* path name */
14824 + struct cfun cf; /* compiled function uses value stack] */
14825 + struct cclosure cc; /* compiled closure uses value stack */
14826 + struct closure cl; /* compiled closure uses c stack */
14827 + struct sfun sfn; /* simple function */
14828 + struct vfun vfn; /* function with variable number of args */
14829 + struct cfdata cfd; /* compiled fun data */
14830 + struct spice spc; /* spice */
14831 +
14832 + struct dummy d; /* dummy */
14833 +
14834 + struct fixarray fixa; /* fixnum array */
14835 + struct sfarray sfa; /* short-float array */
14836 + struct lfarray lfa; /* plong-float array */
14837 +};
14838 +
14839 +
14840 +/* struct character character_table1[256+128]; */
14841 +EXTER
14842 +union lispunion character_table1[256+128];
14843 +#define character_table (character_table1+128)
14844 +#define code_char(c) (object)(character_table+(c))
14845 +#define char_code(obje) ((object)obje)->ch.ch_code
14846 +#define char_font(obje) ((object)obje)->ch.ch_font
14847 +#define char_bits(obje) ((object)obje)->ch.ch_bits
14848 +
14849 +EXTER
14850 +union lispunion small_fixnum_table[2*SMALL_FIXNUM_LIMIT];
14851 +
14852 +#define small_fixnum(i) \
14853 + (object)(small_fixnum_table+SMALL_FIXNUM_LIMIT+(i))
14854 +
14855 +
14856 +
14857 +#define address_int unsigned long
14858 +
14859 +/*
14860 + The struct of free lists.
14861 +*/
14862 +struct freelist {
14863 + FIRSTWORD;
14864 + address_int f_link;
14865 +};
14866 +#ifndef INT_TO_ADDRESS
14867 +#define INT_TO_ADDRESS(x) ((object )(long )x)
14868 +#endif
14869 +
14870 +#define F_LINK(x) ((struct freelist *)(long) x)->f_link
14871 +#define FL_LINK F_LINK
14872 +#define SET_LINK(x,val) F_LINK(x) = (address_int) (val)
14873 +#define OBJ_LINK(x) ((object) INT_TO_ADDRESS(F_LINK(x)))
14874 +
14875 +#define FREE (-1) /* free object */
14876 +
14877 +/*
14878 + Type_of.
14879 +*/
14880 +#define type_of(obje) ((enum type)(((object)(obje))->d.t))
14881 +
14882 +/*
14883 + Storage manager for each type.
14884 +*/
14885 +struct typemanager {
14886 + enum type
14887 + tm_type; /* type */
14888 + short tm_size; /* element size in bytes */
14889 + short tm_nppage; /* number per page */
14890 + object tm_free; /* free list */
14891 + /* Note that it is of type object. */
14892 + long tm_nfree; /* number of free elements */
14893 + long tm_nused; /* number of elements used */
14894 + long tm_npage; /* number of pages */
14895 + long tm_maxpage; /* maximum number of pages */
14896 + char *tm_name; /* type name */
14897 + int tm_gbccount; /* GBC count */
14898 + object tm_alt_free; /* Alternate free list (swap with tm_free) */
14899 + long tm_alt_nfree; /* Alternate nfree (length of nfree) */
14900 + short tm_sgc; /* this type has at least this many
14901 + sgc pages */
14902 + short tm_sgc_minfree; /* number free on a page to qualify for
14903 + being an sgc page */
14904 + short tm_sgc_max; /* max on sgc pages */
14905 + short tm_min_grow; /* min amount to grow when growing */
14906 + short tm_max_grow; /* max amount to grow when growing */
14907 + short tm_growth_percent; /* percent to increase maxpages */
14908 + short tm_percent_free; /* percent which must be free after a gc for this type */
14909 + short tm_distinct; /* pages of this type are distinct */
14910 + float tm_adjgbccnt;
14911 + long tm_opt_maxpage;
14912 +};
14913 +
14914 +
14915 +/*
14916 + The table of type managers.
14917 +*/
14918 +EXTER struct typemanager tm_table[ 32 /* (int) t_relocatable */];
14919 +
14920 +#define tm_of(t) (&(tm_table[(int)tm_table[(int)(t)].tm_type]))
14921 +
14922 +/*
14923 + Contiguous block header.
14924 +*/
14925 +struct contblock { /* contiguous block header */
14926 + int cb_size; /* size in bytes */
14927 + struct contblock
14928 + *cb_link; /* contiguous block link */
14929 +};
14930 +
14931 +/*
14932 + The pointer to the contiguous blocks.
14933 +*/
14934 +EXTER struct contblock *cb_pointer; /* contblock pointer */
14935 +
14936 +/* SGC cont pages: After SGC_start, old_cb_pointer will be a linked
14937 + list of free blocks on non-SGC pages, and cb_pointer will be
14938 + likewise for SGC pages. CM 20030827*/
14939 +EXTER struct contblock *old_cb_pointer; /* old contblock pointer when in SGC */
14940 +
14941 +/* SGC cont pages: FIXME -- at some point, enable runtime disabling of
14942 + SGC cont pages. Right now, the tm_sgc variable for type contiguous
14943 + will govern only the possible attempt to get new pages for SGC.
14944 + Contiguous pages normally allocated when SGC is on will always be
14945 + marked with SGC_PAGE_FLAG, as the current GBC algorithm always uses
14946 + sgc_contblock_sweep_phase in this case. */
14947 +/* #define SGC_CONT_ENABLED (sgc_enabled && tm_table[t_contiguous].tm_sgc) */
14948 +#define SGC_CONT_ENABLED (sgc_enabled)
14949 +
14950 +/*
14951 + Variables for memory management.
14952 +*/
14953 +EXTER long ncb; /* number of contblocks */
14954 +/* int ncbpage; number of contblock pages */
14955 +#define ncbpage tm_table[t_contiguous].tm_npage
14956 +#define maxcbpage tm_table[t_contiguous].tm_maxpage
14957 +#define cbgbccount tm_table[t_contiguous].tm_gbccount
14958 +
14959 +
14960 +/* int maxcbpage; maximum number of contblock pages */
14961 +EXTER
14962 +long holepage; /* hole pages */
14963 +#define nrbpage tm_table[t_relocatable].tm_npage
14964 +#define rbgbccount tm_table[t_relocatable].tm_gbccount
14965 +/* int nrbpage; number of relblock pages */
14966 +
14967 +
14968 +EXTER
14969 +char *rb_start; /* relblock start */
14970 +EXTER char *rb_end; /* relblock end */
14971 +EXTER char *rb_limit; /* relblock limit */
14972 +EXTER char *rb_pointer; /* relblock pointer */
14973 +EXTER char *rb_start1; /* relblock start in copy space */
14974 +EXTER char *rb_pointer1; /* relblock pointer in copy space */
14975 +
14976 +EXTER char *heap_end; /* heap end */
14977 +EXTER char *core_end; /* core end */
14978 +EXTER
14979 +char *tmp_alloc;
14980 +
14981 +/* make f allocate enough extra, so that we can round
14982 + up, the address given to an even multiple. Special
14983 + case of size == 0 , in which case we just want an aligned
14984 + number in the address range
14985 + */
14986 +
14987 +#define ALLOC_ALIGNED(f, size,align) \
14988 + (align <= sizeof(plong) ? (char *)((f)(size)) : \
14989 + (tmp_alloc = (char *)((f)(size+(size ?(align)-1 : 0)))+(align)-1 , \
14990 + (char *)(align * (((unsigned long)tmp_alloc)/align))))
14991 +#define AR_ALLOC(f,n,type) (type *) \
14992 + (ALLOC_ALIGNED(f,(n)*sizeof(type),sizeof(type)))
14993 +
14994 +
14995 +/* FIXME Make all other page constants scale similarly by default. */
14996 +#ifndef HOLEPAGE
14997 +#define HOLEPAGE (MAXPAGE/10)
14998 +#endif
14999 +
15000 +
15001 +/* #define INIT_HOLEPAGE 150 */
15002 +/* #define INIT_NRBPAGE 50 */
15003 +/* #define RB_GETA 512 */
15004 +
15005 +#define INIT_HOLEPAGE (6*HOLEPAGE/5)
15006 +#define INIT_NRBPAGE (INIT_HOLEPAGE/3)
15007 +#define RB_GETA (10*INIT_NRBPAGE)
15008 +
15009 +
15010 +#ifdef AV
15011 +#define STATIC register
15012 +#endif
15013 +#ifdef MV
15014 +
15015 +#endif
15016 +
15017 +#define TIME_ZONE (-9)
15018 +/* EXTER */
15019 +/* fixnum FIXtemp; */
15020 +
15021 +/* For IEEEFLOAT, the double may have exponent in the second word
15022 +(little endian) or first word.*/
15023 +
15024 +#if defined(I386) || defined(LITTLE_END)
15025 +#define HIND 1 /* (int) of double where the exponent and most signif is */
15026 +#define LIND 0 /* low part of a double */
15027 +#else /* big endian */
15028 +#define HIND 0
15029 +#define LIND 1
15030 +#endif
15031 +#ifndef VOL
15032 +#define VOL
15033 +#endif
15034 +
15035 +
15036 +#define isUpper(xxx) (((xxx)&0200) == 0 && isupper((int)xxx))
15037 +#define isLower(xxx) (((xxx)&0200) == 0 && islower((int)xxx))
15038 +#define isDigit(xxx) (((xxx)&0200) == 0 && isdigit((int)xxx))
15039 +enum ftype {f_object,f_fixnum};
15040 +EXTER
15041 +char *alloca_val;
15042 +/* ...xx|xx|xxxx|xxxx|
15043 + ret Narg */
15044 +
15045 +/* a9a8a7a6a5a4a3a4a3a2a1a0rrrrnnnnnnnn
15046 + ai=argtype(i) ret nargs
15047 + */
15048 +#define SFUN_NARGS(x) (x & 0xff) /* 8 bits */
15049 +#define RESTYPE(x) (x<<8) /* 3 bits */
15050 + /* set if the VFUN_NARGS = m ; has been set correctly */
15051 +#define VFUN_NARG_BIT (1 <<11)
15052 +#define ARGTYPE(i,x) ((x) <<(12+(i*2)))
15053 +#define ARGTYPE1(x) (1 | ARGTYPE(0,x))
15054 +#define ARGTYPE2(x,y) (2 | ARGTYPE(0,x) | ARGTYPE(1,y))
15055 +#define ARGTYPE3(x,y,z) (3 | ARGTYPE(0,x) | ARGTYPE(1,y) | ARGTYPE(2,z))
15056 +
15057 +object make_si_sfun();
15058 +EXTER object MVloc[10];
15059 +
15060 +/* Set new to be an (object *) whose [i]'th elmt is the
15061 + ith elmnt in a va_list
15062 + if
15063 + ((vl[0] == va_arg(ap,object)) ||
15064 + (vl[1] == va_arg(ap,object)) || .. vl[n-1] == va_arg(ap,object))
15065 + you may set
15066 + #define DONT_COPY_VA_LIST
15067 + In recent versions of gcc, i think the builtin_alist stuff does not
15068 + allow setting this.
15069 + */
15070 +#ifdef DONT_COPY_VA_LIST
15071 +#define COERCE_VA_LIST(new,vl,n) new = (object *) (vl)
15072 +#else
15073 +#define COERCE_VA_LIST(new,vl,n) \
15074 + object Xxvl[65]; \
15075 + {int i; \
15076 + new=Xxvl; \
15077 + if (n >= 65) FEerror("Too plong vl",0); \
15078 + for (i=0 ; i < (n); i++) new[i]=va_arg(vl,object);}
15079 +#endif
15080 +
15081 +#ifdef DONT_COPY_VA_LIST
15082 +#error Cannot set DONT_COPY_VA_LIST in ANSI C
15083 +#else
15084 +#define COERCE_VA_LIST_NEW(new,fst,vl,n) \
15085 + object Xxvl[65]; \
15086 + {int i; \
15087 + new=Xxvl; \
15088 + if (n >= 65) FEerror("va_list too long",0); \
15089 + for (i=0 ; i < (n); i++) new[i]=i ? va_arg(vl,object) : fst;}
15090 +#endif
15091 +
15092 +
15093 +
15094 +#define make_si_vfun(s,f,min,max) \
15095 + make_si_vfun1(s,f,min | (max << 8))
15096 +
15097 +/* Number of args supplied to a variable arg t_vfun
15098 + Used by the C function to set optionals */
15099 +
15100 +struct call_data {
15101 + object fun;
15102 + int argd;
15103 + int nvalues;
15104 + object values[50];
15105 + double double_return;
15106 +};
15107 +EXTER struct call_data fcall;
15108 +
15109 +#define VFUN_NARGS fcall.argd
15110 +#define RETURN2(x,y) do{/* object _x = (void *) x; */\
15111 + fcall.values[2]=y;fcall.nvalues=2; \
15112 + return (x) ;} while(0)
15113 +#define RETURN1(x) do{fcall.nvalues=1; return (x) ;} while(0)
15114 +#define RETURN0 do{fcall.nvalues=0; return Cnil ;} while(0)
15115 +
15116 +#define RV(x) (*_p++ = x)
15117 +
15118 +#define RETURNI(n,val1,listvals) RETURN(n,int,val1,listvals)
15119 +#define RETURNO(n,val1,listvals) RETURN(n,object,val1,listvals)
15120 +
15121 +/* eg: RETURN(3,object,val1,(RV(val2),RV(val3))) */
15122 +#define RETURN(n,typ,val1,listvals) \
15123 + do{typ _val1 = val1; object *_p=&fcall.values[1]; listvals; fcall.nvalues= n; return _val1;}while(0)
15124 +/* #define CALL(n,form) (VFUN_NARGS=n,form) */
15125 +
15126 +
15127 +
15128 +/* we sometimes have to touch the header of arrays or structures
15129 + to make sure the page is writable */
15130 +#ifdef SGC
15131 +#define SGC_TOUCH(x) if ((x)->d.m) system_error(); (x)->d.m=0
15132 +#else
15133 +#define SGC_TOUCH(x)
15134 +#endif
15135 +
15136 +object funcall_cfun(void(*)(),int,...);
15137 +object clear_compiler_properties();
15138 +EXTER object sSlambda_block_expanded;
15139 +
15140 +# ifdef __GNUC__
15141 +# define assert(ex)\
15142 +{if (!(ex)){(void)fprintf(stderr, \
15143 + "Assertion failed: file \"%s\", line %d\n", __FILE__, __LINE__);exit(1);}}
15144 +# else
15145 +# define assert(ex)
15146 +# endif
15147 +
15148 +#ifndef FIX_PATH_STRING
15149 +#define FIX_PATH_STRING(file) file
15150 +#endif
15151 +
15152 +
15153 +#define CHECK_INTERRUPT if (signals_pending) raise_pending_signals(sig_safe)
15154 +
15155 +#define BEGIN_NO_INTERRUPT \
15156 + plong old_signals_allowed = signals_allowed; \
15157 + signals_allowed = 0
15158 +
15159 +#define END_NO_INTERRUPT \
15160 + signals_allowed = old_signals_allowed
15161 +/* could add: if (signals_pending)
15162 + raise_pending_signals(sig_use_signals_allowed_value) */
15163 +
15164 +
15165 +#define END_NO_INTERRUPT_SAFE \
15166 + signals_allowed = old_signals_allowed; \
15167 + if (signals_pending) \
15168 + do{ if(signals_allowed ==0) /* should not get here*/abort(); \
15169 + raise_pending_signals(sig_safe)}while(0)
15170 +
15171 +void raise_pending_signals();
15172 +
15173 +EXTER unsigned plong signals_allowed, signals_pending ;
15174 +
15175 +EXTER struct symbol Dotnil_body;
15176 +#define Dotnil ((object)&Dotnil_body)
15177 +
15178 +#define endp(x) ({\
15179 + static union lispunion s_my_dot={.c={t_cons,0,0,0,Dotnil,Dotnil}}; \
15180 + object _x=(x);\
15181 + bool _b=FALSE;\
15182 + \
15183 + if (type_of(_x)==t_cons) {\
15184 + if (type_of(_x->c.c_cdr)!=t_cons && _x->c.c_cdr!=Cnil)\
15185 + s_my_dot.c.c_car=_x->c.c_cdr;\
15186 + else \
15187 + s_my_dot.c.c_car=Dotnil;\
15188 + } else {\
15189 + if (_x==s_my_dot.c.c_car)\
15190 + x=&s_my_dot;\
15191 + else {\
15192 + s_my_dot.c.c_car=Dotnil;\
15193 + if (_x==Cnil || _x==Dotnil)\
15194 + _b=TRUE;\
15195 + else\
15196 + FEwrong_type_argument(sLlist, _x);\
15197 + }\
15198 + }\
15199 + _b;\
15200 + })
15201 +
15202 +#define endp_prop(a) (type_of(a)==t_cons ? FALSE : ((a)==Cnil ? TRUE : (FEwrong_type_argument(sLlist, (a)),FALSE)))
15203 +
15204 +#define proper_list(a) (type_of(a)==t_cons || (a)==Cnil)
15205 +#define fix_dot(a) ((a) == Dotnil ? Cnil : (type_of(a)==t_cons && (a)->c.c_cdr==Dotnil ? (a)->c.c_car : (a)))
15206 +/*
15207 + Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
15208 +
15209 +This file is part of GNU Common Lisp, herein referred to as GCL
15210 +
15211 +GCL is free software; you can redistribute it and/or modify it under
15212 +the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
15213 +the Free Software Foundation; either version 2, or (at your option)
15214 +any later version.
15215 +
15216 +GCL is distributed in the hope that it will be useful, but WITHOUT
15217 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15218 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15219 +License for more details.
15220 +
15221 +You should have received a copy of the GNU Library General Public License
15222 +along with GCL; see the file COPYING. If not, write to the Free Software
15223 +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
15224 +
15225 +*/
15226 +
15227 +/*
15228 + vs.h
15229 +
15230 + value stack
15231 +*/
15232 +
15233 +EXTER object *vs_org;
15234 +EXTER object *vs_limit; /* value stack limit */
15235 +
15236 +EXTER object *vs_base; /* value stack base */
15237 +EXTER object *vs_top; /* value stack top */
15238 +
15239 +#define vs_push(obje) (*vs_top++ = (obje))
15240 +
15241 +#define vs_pop (*--vs_top)
15242 +#define vs_popp (--vs_top)
15243 +#define vs_head vs_top[-1]
15244 +
15245 +#define vs_mark object *old_vs_top = vs_top
15246 +#define vs_reset vs_top = old_vs_top
15247 +
15248 +#define vs_check if (vs_top >= vs_limit) \
15249 + vs_overflow()
15250 +
15251 +#define vs_check_push(obje) \
15252 + (vs_top >= vs_limit ? \
15253 + (object)vs_overflow() : (*vs_top++ = (obje)))
15254 +
15255 +#define check_arg(n) \
15256 + if (vs_top - vs_base != (n)) \
15257 + check_arg_failed(n)
15258 +
15259 +#define CHECK_ARG_RANGE(n,m) if (VFUN_NARGS < n || VFUN_NARGS >m) \
15260 + check_arg_range(n,m)
15261 +
15262 +#define MMcheck_arg(n) \
15263 + if (vs_top - vs_base < (n)) \
15264 + too_few_arguments(); \
15265 + else if (vs_top - vs_base > (n)) \
15266 + too_many_arguments()
15267 +
15268 +#define vs_reserve(x) if(vs_base+(x) >= vs_limit) \
15269 + vs_overflow();
15270 +/*
15271 + Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
15272 +
15273 +This file is part of GNU Common Lisp, herein referred to as GCL
15274 +
15275 +GCL is free software; you can redistribute it and/or modify it under
15276 +the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
15277 +the Free Software Foundation; either version 2, or (at your option)
15278 +any later version.
15279 +
15280 +GCL is distributed in the hope that it will be useful, but WITHOUT
15281 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15282 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15283 +License for more details.
15284 +
15285 +You should have received a copy of the GNU Library General Public License
15286 +along with GCL; see the file COPYING. If not, write to the Free Software
15287 +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
15288 +
15289 +*/
15290 +
15291 +/*
15292 + bds.h
15293 +
15294 + bind stack
15295 +*/
15296 +
15297 +struct bds_bd {
15298 + object bds_sym; /* symbol */
15299 + object bds_val; /* previous value of the symbol */
15300 +};
15301 +
15302 +
15303 +typedef struct bds_bd *bds_ptr;
15304 +
15305 +EXTER bds_ptr bds_org;
15306 +
15307 +EXTER bds_ptr bds_limit;
15308 +
15309 +EXTER bds_ptr bds_top; /* bind stack top */
15310 +
15311 +#ifdef KCLOVM
15312 +
15313 +/* for multiprocessing */
15314 +EXTER struct bds_bd save_bind_stack[BDSSIZE + BDSGETA + BDSGETA];
15315 +EXTER bds_ptr bds_save_org;
15316 +EXTER bds_ptr bds_save_limit;
15317 +EXTER bds_ptr bds_save_top;
15318 +
15319 +#endif
15320 +
15321 +#define bds_check \
15322 + if (bds_top >= bds_limit) \
15323 + bds_overflow()
15324 +
15325 +/* do this so that an interrupt in the middle will leave the VALID
15326 + part of the bds stack ie (<= bds_top) in a valid state, so
15327 + that a throw out will be ok */
15328 +#define bds_bind(sym, val) \
15329 + do {bds_ptr _b = bds_top+1; \
15330 + (_b)->bds_sym = (sym); \
15331 + _b->bds_val = ((object)sym)->s.s_dbind; \
15332 + ((object)sym)->s.s_dbind = (val); bds_top=_b;} while (0)
15333 +
15334 +#define bds_unwind1 \
15335 + ((bds_top->bds_sym)->s.s_dbind = bds_top->bds_val, --bds_top)
15336 +
15337 +
15338 +/*
15339 + Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
15340 +
15341 +This file is part of GNU Common Lisp, herein referred to as GCL
15342 +
15343 +GCL is free software; you can redistribute it and/or modify it under
15344 +the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
15345 +the Free Software Foundation; either version 2, or (at your option)
15346 +any later version.
15347 +
15348 +GCL is distributed in the hope that it will be useful, but WITHOUT
15349 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15350 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15351 +License for more details.
15352 +
15353 +You should have received a copy of the GNU Library General Public License
15354 +along with GCL; see the file COPYING. If not, write to the Free Software
15355 +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
15356 +
15357 +*/
15358 +
15359 +/*
15360 +
15361 + frame.h
15362 +
15363 + frame stack and non-local jump
15364 +*/
15365 +
15366 +
15367 +/* IHS Invocation History Stack */
15368 +
15369 +typedef struct invocation_history {
15370 + object ihs_function;
15371 + object *ihs_base;
15372 +} *ihs_ptr;
15373 +
15374 +EXTER ihs_ptr ihs_org;
15375 +
15376 +EXTER ihs_ptr ihs_limit;
15377 +
15378 +EXTER ihs_ptr ihs_top;
15379 +
15380 +#define ihs_check \
15381 + if (ihs_top >= ihs_limit) \
15382 + ihs_overflow()
15383 +
15384 +#define ihs_push(function) \
15385 + (++ihs_top)->ihs_function = (function); \
15386 + ihs_top->ihs_base = vs_base
15387 +#define ihs_push_base(function,base) \
15388 + (++ihs_top)->ihs_function = (function); \
15389 + ihs_top->ihs_base = base
15390 +
15391 +#define ihs_pop() (ihs_top--)
15392 +
15393 +
15394 +#define make_nil_block() \
15395 +{ \
15396 + object x; \
15397 + \
15398 + lex_copy(); \
15399 + x = alloc_frame_id(); \
15400 + vs_push(x); \
15401 + lex_block_bind(Cnil, x); \
15402 + vs_popp; \
15403 + frs_push(FRS_CATCH, x); \
15404 +}
15405 +
15406 +
15407 +/* Frame Stack */
15408 +
15409 +enum fr_class {
15410 + FRS_CATCH, /* for catch,block,tabbody */
15411 + FRS_CATCHALL, /* for catchall */
15412 + FRS_PROTECT /* for protect-all */
15413 +};
15414 +
15415 +EXTER int in_signal_handler;
15416 +struct frame {
15417 + jmp_buf frs_jmpbuf;
15418 + object *frs_lex;
15419 + bds_ptr frs_bds_top;
15420 + char frs_class;
15421 + char frs_in_signal_handler;
15422 + object frs_val;
15423 + ihs_ptr frs_ihs;
15424 +};
15425 +
15426 +typedef struct frame *frame_ptr;
15427 +
15428 +#define alloc_frame_id() alloc_object(t_spice)
15429 +
15430 +/*
15431 +frs_class | frs_value | frs_prev
15432 +----------+--------------------------------------+--------------
15433 +CATCH | frame-id, i.e. |
15434 + | throw-tag, |
15435 + | block-id (uninterned symbol), or | value of ihs_top
15436 + | tagbody-id (uninterned symbol) | when the frame
15437 +----------+--------------------------------------| was pushed
15438 +CATCHALL | NIL |
15439 +----------+--------------------------------------|
15440 +PROTECT | NIL |
15441 +----------------------------------------------------------------
15442 +*/
15443 +
15444 +
15445 +EXTER frame_ptr frs_org;
15446 +
15447 +EXTER frame_ptr frs_limit;
15448 +
15449 +EXTER frame_ptr frs_top; /* frame stack top */
15450 +
15451 +
15452 +#define frs_push(class, val) \
15453 + do { frame_ptr _frs_top = frs_top +1; \
15454 + if (_frs_top >= frs_limit) \
15455 + frs_overflow(); \
15456 + _frs_top->frs_lex = lex_env;\
15457 + _frs_top->frs_bds_top = bds_top; \
15458 + _frs_top->frs_class = (class); \
15459 + _frs_top->frs_in_signal_handler = in_signal_handler; \
15460 + _frs_top->frs_val = (val); \
15461 + _frs_top->frs_ihs = ihs_top; \
15462 + frs_top=_frs_top; \
15463 + setjmp(_frs_top->frs_jmpbuf); \
15464 + } while (0)
15465 +
15466 +#define frs_pop() frs_top--
15467 +
15468 +
15469 +/* global variables used during non-local jump */
15470 +
15471 +EXTER bool nlj_active; /* true during non-local jump */
15472 +EXTER frame_ptr nlj_fr; /* frame to return */
15473 +EXTER object nlj_tag; /* throw-tag, block-id, or */
15474 + /* (tagbody-id . label). */
15475 +
15476 +
15477 +/*
15478 +(c) Copyright Taiichi Yuasa and Masami Hagiya, 1984. All rights reserved.
15479 +Copying of this file is authorized to users who have executed the true and
15480 +proper "License Agreement for Kyoto Common LISP" with SIGLISP.
15481 +*/
15482 +
15483 +/*
15484 +
15485 + lex.h
15486 +
15487 + lexical environment
15488 +*/
15489 +
15490 +
15491 +EXTER object *lex_env;
15492 +
15493 +
15494 +
15495 +/*
15496 + VS
15497 + | |
15498 + |---------------|
15499 +lex_env ------> | lex-var | : lex_env[0]
15500 + |---------------|
15501 + | lex-fd | : lex_env[1]
15502 + |---------------|
15503 + | lex-tag | : lex_env[2]
15504 + |---------------|
15505 + | |
15506 + | |
15507 + | |
15508 +
15509 + lex-var: (symbol value) ; for local binding
15510 + (.... or ....)
15511 + (symbol) ; for special binding
15512 +
15513 + lex-fd: (fun-name 'FUNCTION' function)
15514 + (.... or ...)
15515 + (macro-name 'MACRO' expansion-function)
15516 +
15517 + lex-tag: (tag 'TAG' frame-id)
15518 + (.... or ....)
15519 + (block-name 'BLOCK' frame-id)
15520 +
15521 +where 'FUN' is the LISP object with pname FUN, etc.
15522 +
15523 +
15524 +*/
15525 +
15526 +#define lex_copy() ihs_top->ihs_base = vs_top; \
15527 + vs_push(lex_env[0]); \
15528 + vs_push(lex_env[1]); \
15529 + vs_push(lex_env[2]); \
15530 + lex_env = vs_top - 3
15531 +
15532 +#define lex_new() ihs_top->ihs_base = vs_top; \
15533 + lex_env = vs_top; \
15534 + vs_top[0] = vs_top[1] = vs_top[2] = Cnil; \
15535 + vs_top += 3
15536 +
15537 +#define lex_var_sch(name) assoc_eq((name),lex_env[0])
15538 +
15539 +#define lex_fd_sch(name) assoc_eq((name),lex_env[1])
15540 +
15541 +/*
15542 + Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
15543 +
15544 +This file is part of GNU Common Lisp, herein referred to as GCL
15545 +
15546 +GCL is free software; you can redistribute it and/or modify it under
15547 +the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
15548 +the Free Software Foundation; either version 2, or (at your option)
15549 +any later version.
15550 +
15551 +GCL is distributed in the hope that it will be useful, but WITHOUT
15552 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15553 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15554 +License for more details.
15555 +
15556 +You should have received a copy of the GNU Library General Public License
15557 +along with GCL; see the file COPYING. If not, write to the Free Software
15558 +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
15559 +
15560 +*/
15561 +
15562 +/*
15563 + eval.h
15564 +*/
15565 +
15566 +
15567 +/* C control stack */
15568 +
15569 +#define CSSIZE 20000
15570 +#define CSGETA 4000
15571 +
15572 +EXTER int *cs_org;
15573 +EXTER int *cs_limit;
15574 +
15575 +
15576 +/* we catch the segmentation fault and check to warn of c stack overflow */
15577 +#ifdef AV
15578 +#ifndef cs_check
15579 +#define cs_check(something) \
15580 + if ((int *)(&something) < cs_limit) \
15581 + cs_overflow()
15582 +#endif
15583 +#endif
15584 +#ifdef MV
15585 +
15586 +
15587 +
15588 +#endif
15589 +
15590 +/* bind template */
15591 +
15592 +struct bind_temp {
15593 + object bt_var;
15594 + object bt_spp;
15595 + object bt_init;
15596 + object bt_aux;
15597 +};
15598 +
15599 +
15600 +#define check_symbol(x) \
15601 + if (type_of(x) != t_symbol) \
15602 + not_a_symbol(x)
15603 +
15604 +#define check_var(x) \
15605 + if (type_of(x) != t_symbol || \
15606 + (enum stype)(x)->s.s_stype == stp_constant) \
15607 + not_a_variable(x)
15608 +
15609 +
15610 +#define eval_assign(to, form) \
15611 +{ \
15612 + object *old_top = vs_top; \
15613 + \
15614 + eval(form); \
15615 + to = vs_base[0]; \
15616 + vs_top = old_top; \
15617 +}
15618 +
15619 +
15620 +#define MMcall(x) \
15621 + ihs_check; \
15622 + ihs_push(x); \
15623 + (*(x)->cf.cf_self)(); \
15624 + ihs_pop()
15625 +
15626 +#define MMccall(x, env_top) \
15627 + ihs_check; \
15628 + ihs_push(x); \
15629 + (*(x)->cc.cc_self)(env_top); \
15630 + ihs_pop()
15631 +
15632 +
15633 +#define MMcons(a,d) make_cons((a),(d))
15634 +
15635 +
15636 +#define MMcar(x) (x)->c.c_car
15637 +#define MMcdr(x) (x)->c.c_cdr
15638 +#define MMcaar(x) (x)->c.c_car->c.c_car
15639 +#define MMcadr(x) (x)->c.c_cdr->c.c_car
15640 +#define MMcdar(x) (x)->c.c_car->c.c_cdr
15641 +#define MMcddr(x) (x)->c.c_cdr->c.c_cdr
15642 +#define MMcaaar(x) (x)->c.c_car->c.c_car->c.c_car
15643 +#define MMcaadr(x) (x)->c.c_cdr->c.c_car->c.c_car
15644 +#define MMcadar(x) (x)->c.c_car->c.c_cdr->c.c_car
15645 +#define MMcaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car
15646 +#define MMcdaar(x) (x)->c.c_car->c.c_car->c.c_cdr
15647 +#define MMcdadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr
15648 +#define MMcddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr
15649 +#define MMcdddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr
15650 +#define MMcaaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_car
15651 +#define MMcaaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_car
15652 +#define MMcaadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_car
15653 +#define MMcaaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_car
15654 +#define MMcadaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_car
15655 +#define MMcadadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_car
15656 +#define MMcaddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_car
15657 +#define MMcadddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_car
15658 +#define MMcdaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_cdr
15659 +#define MMcdaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_cdr
15660 +#define MMcdadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_cdr
15661 +#define MMcdaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_cdr
15662 +#define MMcddaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_cdr
15663 +#define MMcddadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_cdr
15664 +#define MMcdddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_cdr
15665 +#define MMcddddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_cdr
15666 +
15667 +
15668 +#define MMnull(x) ((x)==Cnil)
15669 +
15670 +
15671 +/* the link_desc, is an INT which carries the call information
15672 + for all uses of that link. It tells whether fcall.nargs is
15673 + set before the call, whether the VFUN_FUN is set, (to pass in
15674 + a closure function) or if the number of values is set after the
15675 + call. It gives the min and max number of args and the result
15676 + type expected. It describes the arg types.
15677 + enum F_arg_flags
15678 +
15679 +
15680 +*/
15681 +
15682 +/*
15683 +A link arg descriptor:
15684 + a6a5a4a3a2a1a0rrmmmmmmfffllllll
15685 + l = least number of args passed
15686 + m = max number of args passed
15687 + f = flags bits set according to F_arg_flags, There are F_end flag bits.
15688 + r = result type in F_arg_types
15689 + ai = i'th arg type in F_arg_types
15690 +*/
15691 +
15692 +/* We allow 2 bits for encoding arg types and return type */
15693 +#define F_TYPE_WIDTH 2
15694 +#define F_MIN_ARGS(x) (x & MASK_RANGE(0,F_NARG_WIDTH))
15695 +#define F_NARGS(x) F_MIN_ARGS(x)
15696 +#define F_ARG_FLAGS_P(x,flag) (x & (1 << (F_NARG_WIDTH + flag)))
15697 +#define F_ARG_FLAGS(x) ((x >> F_NARG_WIDTH) & MASK_RANGE(0,F_end))
15698 +#define F_MAX_ARGS(x) ((x >> (F_NARG_WIDTH + F_end )) \
15699 + & MASK_RANGE(0,F_NARG_WIDTH))
15700 +
15701 +#define BITS_PER_CHAR 8
15702 +#define MAX_ARGS 63
15703 +#define F_TYPES(x) (((x) >> F_START_TYPES_POS ) \
15704 + & MASK_RANGE(0, sizeof(int)*BITS_PER_CHAR - F_START_TYPES_POS))
15705 +#define F_RESULT_TYPE(x) (F_TYPES(x) & MASK_RANGE(0,F_TYPE_WIDTH))
15706 +#define F_ARG_LIMIT ((1<< F_NARG_WIDTH) -1)
15707 +
15708 +/* make an argd slot
15709 + where flags and argtypes are already set up as fields
15710 + */
15711 +#define F_ARGD(min,max,flags, argtypes) \
15712 + (min | ((flags | (max-min ? (1<<F_requires_nargs) : 0) \
15713 + << F_NARG_WIDTH)) \
15714 + | (max << (F_NARG_WIDTH+F_end)) \
15715 + | (argtypes<< (2* F_NARG_WIDTH + F_end )))
15716 +
15717 +#define ONE_VAL (1 << F_caller_sets_one_val)
15718 +#define CLOS (1 << F_requires_fun_passed)
15719 +#define VARARG (1 << F_requires_nargs)
15720 + /* the following may be used as an argument to DEFUN even in the case
15721 + of varargs, since the F_ARGD macro detects minargs<maxargs and sets this.*/
15722 +#define NONE 0
15723 +
15724 +/* we dont want to define all these two letter macros... all the time */
15725 +
15726 +#ifndef NO_DEFUN
15727 +#define OO (F_object | F_object << F_TYPE_WIDTH)
15728 +#define OI (F_object | F_int << F_TYPE_WIDTH)
15729 +#define OD (F_object | F_double_ptr << F_TYPE_WIDTH)
15730 +#define IO (F_int | F_object << F_TYPE_WIDTH)
15731 +#define II (F_int | F_int << F_TYPE_WIDTH)
15732 +#define ID (F_int | F_double_ptr << F_TYPE_WIDTH)
15733 +#define DO (F_double_ptr | F_object << F_TYPE_WIDTH)
15734 +#define DI (F_double_ptr | F_int << F_TYPE_WIDTH)
15735 +#define DD (F_double_ptr | F_double_ptr << F_TYPE_WIDTH)
15736 +#endif
15737 +
15738 +#define ARGTYPES(a,b,c,d) \
15739 + (a | (b << (2* F_TYPE_WIDTH)) | (c << (4* F_TYPE_WIDTH)) | (d << (6*F_TYPE_WIDTH)))
15740 +
15741 +
15742 +#define PUSH_FIRST_VAL(x) int nvals = 1 ; object result = (x)
15743 +#define PUSH_VAL(x) if (nvals>=sizeof(fcall.values)/sizeof(*fcall.values) \
15744 + FEerror("Too many function call values"); \
15745 + else fcall.values[nvals++] = (x)
15746 +#define RETURN_VALS fcall.nvalues= nvals; return result;} 0
15747 +
15748 +#define FUNCALL(n,form) (VFUN_NARGS=n,form)
15749 +
15750 +/*
15751 + Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
15752 +
15753 +This file is part of GNU Common Lisp, herein referred to as GCL
15754 +
15755 +GCL is free software; you can redistribute it and/or modify it under
15756 +the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
15757 +the Free Software Foundation; either version 2, or (at your option)
15758 +any later version.
15759 +
15760 +GCL is distributed in the hope that it will be useful, but WITHOUT
15761 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15762 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15763 +License for more details.
15764 +
15765 +You should have received a copy of the GNU Library General Public License
15766 +along with GCL; see the file COPYING. If not, write to the Free Software
15767 +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
15768 +
15769 +*/
15770 +#ifndef COM_LENG
15771 +#define COM_LENG
15772 +#endif
15773 +
15774 +/* alloc.c */
15775 +char *alloc_page();
15776 +object alloc_object();
15777 +void *malloc(size_t);
15778 +void *realloc(void *,size_t);
15779 +/* void * memalign(size_t,size_t); */
15780 +void *alloc_contblock(size_t);
15781 +void *alloc_relblock(size_t);
15782 +/* object fSallocate_contiguous_pages(); */
15783 +/* object fSallocate_relocatable_pages(); */
15784 +
15785 +/* array.c */
15786 +/* enum aelttype Iarray_element_type(); */
15787 +object fLrow_major_aref();
15788 +object fSaset1();
15789 +EXTER object sLarray_dimension_limit;
15790 +EXTER object sLarray_total_size_limit;
15791 +object fSmake_array1();
15792 +/* object fSmake_vector1(); */
15793 +
15794 +/* assignment.c */
15795 +/* object setf(); */
15796 +
15797 +
15798 +
15799 +/* backq.c */
15800 +EXTER int backq_level;
15801 +EXTER object sLlistA;
15802 +EXTER object sLappend;
15803 +EXTER object sLnconc;
15804 +
15805 +
15806 +/* bds.c */
15807 +
15808 +/* big.c */
15809 +object make_integer_clear();
15810 +object stretch_big();
15811 +object copy_big();
15812 +object copy_to_big();
15813 +object big_minus();
15814 +object big_plus();
15815 +object big_times();
15816 +object normalize_big_to_object();
15817 +double big_to_double();
15818 +EXTER struct bignum big_fixnum1_body,big_fixnum2_body;
15819 +EXTER object big_fixnum1,big_fixnum2;
15820 +object maybe_replace_big();
15821 +
15822 +
15823 +
15824 +
15825 +/* bind.c */
15826 +EXTER object ANDoptional;
15827 +EXTER object ANDrest;
15828 +EXTER object ANDkey;
15829 +EXTER object ANDallow_other_keys;
15830 +EXTER object ANDaux;
15831 +EXTER object sKallow_other_keys;
15832 +object find_special();
15833 +object let_bind();
15834 +object letA_bind();
15835 +
15836 +/* block.c */
15837 +
15838 +/* cfun.c */
15839 +object make_cfun();
15840 +object MF();
15841 +/* object MM(); */
15842 +/* object make_function_internal(); */
15843 +/* object make_si_function_internal(); */
15844 +/* object make_special_form_internal(); */
15845 +object make_macro();
15846 +object make_cclosure_new();
15847 +
15848 +/* character.d */
15849 +EXTER object STreturn;
15850 +EXTER object STspace;
15851 +EXTER object STrubout;
15852 +EXTER object STpage;
15853 +EXTER object STtab;
15854 +EXTER object STbackspace;
15855 +EXTER object STlinefeed;
15856 +EXTER object STnewline;
15857 +object coerce_to_character();
15858 +
15859 +/* catch.c */
15860 +
15861 +/* cmpaux.c */
15862 +char object_to_char();
15863 +char *object_to_string();
15864 +float object_to_float();
15865 +double object_to_double();
15866 +
15867 +/* error.c */
15868 +EXTER object sKerror;
15869 +EXTER object sKwrong_type_argument;
15870 +EXTER object sKcatch;
15871 +EXTER object sKprotect;
15872 +EXTER object sKcatchall;
15873 +EXTER object sKtoo_few_arguments;
15874 +EXTER object sKtoo_many_arguments;
15875 +EXTER object sKunexpected_keyword;
15876 +EXTER object sKinvalid_form;
15877 +EXTER object sKunbound_variable;
15878 +EXTER object sKinvalid_variable;
15879 +EXTER object sKundefined_function;
15880 +EXTER object sKinvalid_function;
15881 +EXTER object sKpackage_error;
15882 +object wrong_type_argument();
15883 +EXTER object sSuniversal_error_handler;
15884 +
15885 +/* eval.c */
15886 +EXTER object sLapply;
15887 +EXTER object sLfuncall;
15888 +object simple_lispcall();
15889 +object simple_lispcall_no_event();
15890 +object simple_symlispcall();
15891 +object simple_symlispcall_no_event();
15892 +EXTER object Vevalhook;
15893 +EXTER object Vapplyhook;
15894 +object ieval();
15895 +object ifuncall(object,int,...);
15896 +object ifuncall1();
15897 +object ifuncall2();
15898 +object ifuncall3();
15899 +object fcalln1(object,...);
15900 +#define fcalln ((object (*)())fcalln1)
15901 +object Ieval();
15902 +object Imacro_expand1();
15903 +
15904 +/* unixfasl.c fasload.c */
15905 +
15906 +/* file.d */
15907 +EXTER object sKabort;
15908 +EXTER object sKappend;
15909 +EXTER object sKcreate;
15910 +EXTER object sKdefault;
15911 +EXTER object sKdirection;
15912 +EXTER object sKelement_type;
15913 +EXTER object sKif_does_not_exist;
15914 +EXTER object sKif_exists;
15915 +EXTER object sKinput;
15916 +EXTER object sKio;
15917 +EXTER object sKnew_version;
15918 +EXTER object sKoutput;
15919 +EXTER object sKoverwrite;
15920 +EXTER object sKprint;
15921 +EXTER object sKprobe;
15922 +EXTER object sKrename;
15923 +EXTER object sKrename_and_delete;
15924 +EXTER object sKset_default_pathname;
15925 +EXTER object sKsupersede;
15926 +EXTER object sKverbose;
15927 +
15928 +EXTER object sLAstandard_inputA;
15929 +EXTER object sLAstandard_outputA;
15930 +EXTER object sLAerror_outputA;
15931 +EXTER object sLAquery_ioA;
15932 +EXTER object sLAdebug_ioA;
15933 +EXTER object sLAterminal_ioA;
15934 +EXTER object sLAtrace_outputA;
15935 +EXTER object terminal_io;
15936 +EXTER object standard_io;
15937 +
15938 +EXTER object sLAload_verboseA;
15939 +EXTER object FASL_string;
15940 +/* object stream_element_type(); */
15941 +object open_stream();
15942 +/* object make_two_way_stream(); */
15943 +/* object make_echo_stream(); */
15944 +object make_string_input_stream();
15945 +object make_string_output_stream();
15946 +/* object get_output_stream_string(); */
15947 +object read_fasl_data();
15948 +
15949 +#ifdef UNIX
15950 +/* unixfsys.c */
15951 +FILE *backup_fopen();
15952 +#else
15953 +/* filesystem.c */
15954 +FILE *backup_fopen();
15955 +#endif
15956 +
15957 +/* frame.c */
15958 +frame_ptr frs_sch();
15959 +frame_ptr frs_sch_catch();
15960 +
15961 +/* gbc.c */
15962 +EXTER bool GBC_enable;
15963 +
15964 +/* let.c */
15965 +
15966 +/* lex.c */
15967 +object assoc_eq();
15968 +object lex_tag_sch();
15969 +object lex_block_sch();
15970 +
15971 +/* list.d */
15972 +EXTER object sKtest;
15973 +EXTER object sKtest_not;
15974 +EXTER object sKkey;
15975 +EXTER object sKrev;
15976 +object car();
15977 +object cdr();
15978 +object kar();
15979 +object kdr();
15980 +object caar();
15981 +object cadr();
15982 +object cdar();
15983 +object cddr();
15984 +object caaar();
15985 +object caadr();
15986 +object cadar();
15987 +object caddr();
15988 +object cdaar();
15989 +object cdadr();
15990 +object cddar();
15991 +object cdddr();
15992 +object caaaar();
15993 +object caaadr();
15994 +object caadar();
15995 +object caaddr();
15996 +object cadaar();
15997 +object cadadr();
15998 +object caddar();
15999 +object cadddr();
16000 +object cdaaar();
16001 +object cdaadr();
16002 +object cdadar();
16003 +object cdaddr();
16004 +object cddaar();
16005 +object cddadr();
16006 +object cdddar();
16007 +object cddddr();
16008 +object nth();
16009 +object nthcdr();
16010 +object make_cons();
16011 +object list(int,...);
16012 +object listA(int,...);
16013 +object append();
16014 +object copy_list();
16015 +object make_list();
16016 +object nconc();
16017 +object sublis1();
16018 +
16019 +/* macros.c */
16020 +EXTER object sLAmacroexpand_hookA;
16021 +EXTER object sSdefmacroA;
16022 +object macro_expand();
16023 +
16024 +/* main.c */
16025 +EXTER char* system_directory;
16026 +EXTER int ARGC;
16027 +EXTER char **ARGV;
16028 +void error();
16029 +#ifdef UNIX
16030 +EXTER char **ENVP;
16031 +#endif
16032 +object vs_overflow(void);
16033 +
16034 +EXTER object sSAsystem_directoryA;
16035 +#ifdef UNIX
16036 +EXTER char *kcl_self;
16037 +#endif
16038 +#if !defined(IN_MAIN) || !defined(ATT)
16039 +EXTER bool initflag,raw_image;
16040 +#endif
16041 +char *merge_system_directory();
16042 +
16043 +
16044 +EXTER object sLquote;
16045 +
16046 +EXTER object sLlambda;
16047 +
16048 +EXTER object sLlambda_block;
16049 +EXTER object sLlambda_closure;
16050 +EXTER object sLlambda_block_closure;
16051 +
16052 +EXTER object sLfunction;
16053 +EXTER object sLmacro;
16054 +EXTER object sLtag;
16055 +EXTER object sLblock;
16056 +
16057 +
16058 +/* mapfun.c */
16059 +
16060 +/* multival.c */
16061 +
16062 +/* number.c */
16063 +EXTER object shortfloat_zero;
16064 +EXTER object longfloat_zero;
16065 +#define make_fixnum(a) ({fixnum _a=(a);((_a+SMALL_FIXNUM_LIMIT)&(-2*SMALL_FIXNUM_LIMIT))==0?small_fixnum(_a):make_fixnum1(_a);})
16066 +object make_fixnum1(long);
16067 +object make_ratio();
16068 +object make_shortfloat();
16069 +object make_longfloat();
16070 +object make_complex();
16071 +double number_to_double();
16072 +long fixint(object);
16073 +/* num_pred.c */
16074 +
16075 +/* num_comp.c */
16076 +
16077 +/* num_arith */
16078 +object bignum2();
16079 +object bignum3();
16080 +/* object number_to_complex(); */
16081 +object complex_plus();
16082 +object number_plus();
16083 +object number_negate();
16084 +object number_minus();
16085 +object number_times();
16086 +object number_divide();
16087 +object number_expt();
16088 +object integer_divide1();
16089 +object get_gcd();
16090 +object get_lcm();
16091 +object one_plus();
16092 +object one_minus();
16093 +object fixnum_add();
16094 +object fixnum_sub();
16095 +object new_bignum();
16096 +
16097 +/* num_co.c */
16098 +object double_to_integer();
16099 +
16100 +/* num_log.c */
16101 +object shift_integer();
16102 +
16103 +/* package.d */
16104 +EXTER object lisp_package;
16105 +EXTER object user_package;
16106 +#ifdef ANSI_COMMON_LISP
16107 +EXTER object common_lisp_package;
16108 +#endif
16109 +EXTER object keyword_package;
16110 +EXTER object system_package;
16111 +EXTER object sLApackageA;
16112 +EXTER object sKinternal;
16113 +EXTER object sKexternal;
16114 +EXTER object sKinherited;
16115 +EXTER object sKnicknames;
16116 +EXTER object sKuse;
16117 +EXTER int intern_flag;
16118 +EXTER object uninterned_list;
16119 +/* object make_package(); */
16120 +/* object in_package(); */
16121 +/* object rename_package(); */
16122 +object find_package();
16123 +/* object coerce_to_package(); */
16124 +object current_package();
16125 +object intern();
16126 +object find_symbol();
16127 +
16128 +/* pathname.d */
16129 +EXTER object Vdefault_pathname_defaults;
16130 +EXTER object sKwild;
16131 +EXTER object sKnewest;
16132 +EXTER object sKstart;
16133 +EXTER object sKend;
16134 +EXTER object sKjunk_allowed;
16135 +EXTER object sKhost;
16136 +EXTER object sKdevice;
16137 +EXTER object sKdirectory;
16138 +EXTER object sKname;
16139 +EXTER object sKtype;
16140 +EXTER object sKversion;
16141 +EXTER object sKdefaults;
16142 +EXTER object sKroot;
16143 +EXTER object sKcurrent;
16144 +EXTER object sKparent;
16145 +EXTER object sKper;
16146 +/* object parse_namestring(); */
16147 +object coerce_to_pathname();
16148 +/* object default_device(); */
16149 +object merge_pathnames();
16150 +object namestring();
16151 +object coerce_to_namestring();
16152 +
16153 +/* prediate.c */
16154 +
16155 +int eql(),equal(),eq();
16156 +
16157 +/* print.d */
16158 +EXTER object sKupcase;
16159 +EXTER object sKdowncase;
16160 +EXTER object sKcapitalize;
16161 +EXTER object sKstream;
16162 +EXTER object sKreadably;
16163 +EXTER object sKescape;
16164 +EXTER object sKpretty;
16165 +EXTER object sKcircle;
16166 +EXTER object sKbase;
16167 +EXTER object sKradix;
16168 +EXTER object sKcase;
16169 +EXTER object sKgensym;
16170 +EXTER object sKlevel;
16171 +EXTER object sKlength;
16172 +EXTER object sKarray;
16173 +EXTER object sLAprint_readablyA;
16174 +EXTER object sLAprint_escapeA;
16175 +EXTER object sLAprint_prettyA;
16176 +EXTER object sLAprint_circleA;
16177 +EXTER object sLAprint_baseA;
16178 +EXTER object sLAprint_radixA;
16179 +EXTER object sLAprint_caseA;
16180 +EXTER object sLAprint_gensymA;
16181 +EXTER object sLAprint_levelA;
16182 +EXTER object sLAprint_lengthA;
16183 +EXTER object sLAprint_arrayA;
16184 +EXTER object *PRINTvs_top;
16185 +EXTER object *PRINTvs_limit;
16186 +EXTER object PRINTstream;
16187 +EXTER bool PRINTreadably;
16188 +EXTER bool PRINTescape;
16189 +EXTER bool PRINTpretty;
16190 +EXTER bool PRINTcircle;
16191 +EXTER int PRINTbase;
16192 +EXTER bool PRINTradix;
16193 +EXTER object PRINTcase;
16194 +EXTER bool PRINTgensym;
16195 +EXTER int PRINTlevel;
16196 +EXTER int PRINTlength;
16197 +EXTER bool PRINTarray;
16198 +EXTER void (*write_ch_fun)(int);
16199 +object princ();
16200 +object prin1();
16201 +object print();
16202 +object terpri();
16203 +EXTER object sSpretty_print_format;
16204 +EXTER int line_length;
16205 +
16206 +/* Read.d */
16207 +EXTER object standard_readtable;
16208 +EXTER object Vreadtable;
16209 +EXTER object sLAread_default_float_formatA;
16210 +EXTER object sLAread_baseA;
16211 +EXTER object sLAread_suppressA;
16212 +EXTER object READtable;
16213 +EXTER object read_byte1();
16214 +EXTER int READdefault_float_format;
16215 +EXTER int READbase;
16216 +EXTER bool READsuppress;
16217 +EXTER object siSsharp_comma;
16218 +EXTER bool escape_flag;
16219 +EXTER object delimiting_char;
16220 +EXTER bool detect_eos_flag;
16221 +/* bool in_list_flag; */
16222 +EXTER bool dot_flag;
16223 +EXTER bool preserving_whitespace_flag;
16224 +EXTER object default_dispatch_macro;
16225 +EXTER object big_register_0;
16226 +EXTER int sharp_eq_context_max;
16227 +object read_char();
16228 +object read_char1(object,object);
16229 +object peek_char();
16230 +/* object read_object_recursive(); */
16231 +object read_object_non_recursive();
16232 +object standard_read_object_non_recursive();
16233 +object read_object();
16234 +/* object parse_number(); */
16235 +/* object parse_integer(); */
16236 +/* object copy_readtable(); */
16237 +/* object current_readtable(); */
16238 +/* object patch_sharp(); */
16239 +object read_fasl_vector();
16240 +
16241 +/* fasdump.c */
16242 +EXTER object sharing_table;
16243 +
16244 +/* reference.c */
16245 +object symbol_function();
16246 +
16247 +
16248 +/* sequence.d */
16249 +object alloc_simple_vector();
16250 +object alloc_simple_bitvector();
16251 +object elt();
16252 +object elt_set();
16253 +object reverse();
16254 +object nreverse();
16255 +
16256 +/* structure.c */
16257 +EXTER object sSs_data;
16258 +object structure_ref();
16259 +object structure_set();
16260 +object structure_to_list();
16261 +
16262 +/* string.d */
16263 +object alloc_simple_string();
16264 +object make_simple_string();
16265 +object copy_simple_string();
16266 +object coerce_to_string();
16267 +EXTER int string_sign, string_boundary;
16268 +
16269 +/* symbol.d */
16270 +EXTER object string_register;
16271 +EXTER object gensym_prefix;
16272 +/* EXTER int gensym_counter; */
16273 +EXTER object sLgensym_counter;
16274 +EXTER object gentemp_prefix;
16275 +EXTER int gentemp_counter;
16276 +EXTER object token;
16277 +object make_symbol();
16278 +object make_ordinary();
16279 +object make_special();
16280 +object make_constant();
16281 +object make_si_ordinary();
16282 +object make_si_special();
16283 +object make_si_constant();
16284 +object make_keyword();
16285 +object symbol_value();
16286 +object symbol_name();
16287 +object getf();
16288 +object get();
16289 +object putf();
16290 +object putprop();
16291 +object sputprop();
16292 +object remprop();
16293 +object gensym(); /* to be deleted */
16294 +
16295 +#ifdef UNIX
16296 +/* unixsys.c */
16297 +#else
16298 +/* sys.c */
16299 +#endif
16300 +
16301 +#ifdef UNIX
16302 +/* unixtime.c */
16303 +object unix_time_to_universal_time();
16304 +#else
16305 +/* time.c */
16306 +#endif
16307 +
16308 +/* toplevel.c */
16309 +EXTER object sLspecial,sLdeclare;
16310 +EXTER object sSvariable_documentation;
16311 +EXTER object sSfunction_documentation;
16312 +
16313 +/* typespec.c */
16314 +EXTER object sLcommon,sLnull,sLcons,sLlist,sLsymbol,sLarray,sLvector,sLbit_vector,sLstring;
16315 +EXTER object sLsequence,sLsimple_array,sLsimple_vector,sLsimple_bit_vector,sLsimple_string;
16316 +EXTER object sLcompiled_function,sLpathname,sLcharacter,sLnumber,sLrational,sLfloat,sLstring_char;
16317 +EXTER object sLinteger,sLratio,sLshort_float,sLstandard_char,sLfixnum,sLpositive_fixnum, sLcomplex;
16318 +EXTER object sLsingle_float,sLpackage,sLbignum,sLrandom_state,sLdouble_float,sLstream,sLbit,sLreadtable;
16319 +EXTER object sLlong_float,sLhash_table,sLstructure,sLboolean;
16320 +
16321 +#ifdef ANSI_COMMON_LISP
16322 +/* new ansi types */
16323 +EXTER object sLarithmetic_error,sLbase_char,sLbase_string,sLbroadcast_stream,sLbuilt_in_class;
16324 +EXTER object sLcell_error,sLclass,sLconcatenated_stream,sLcondition,sLcontrol_error,sLdivision_by_zero;
16325 +EXTER object sLecho_stream,sLend_of_file,sLerror,sLextended_char,sLfile_error,sLfile_stream;
16326 +EXTER object sLfloating_point_inexact,sLfloating_point_invalid_operation,sLfloating_point_overflow;
16327 +EXTER object sLfloating_point_underflow,sLgeneric_function,sLlogical_pathname,sLmethod,sLpackage_error;
16328 +EXTER object sLparse_error,sLprint_not_readable,sLprogram_error,sLreader_error,sLserious_condition;
16329 +EXTER object sLsimple_base_string,sLsimple_condition,sLsimple_type_error,sLsimple_warning,sLstandard_class;
16330 +EXTER object sLstandard_generic_function,sLstandard_method,sLstandard_object,sLstorage_condition;
16331 +EXTER object sLstream_error,sLstring_stream,sLstructure_class,sLstyle_warning,sLsynonym_stream;
16332 +EXTER object sLtwo_way_stream,sLtype_error,sLunbound_slot,sLunbound_variable,sLundefined_function,sLwarning;
16333 +EXTER object sLmethod_combination,sLstructure_object;
16334 +#endif
16335 +
16336 +EXTER object sLsatisfies;
16337 +EXTER object sLmember;
16338 +EXTER object sLnot;
16339 +EXTER object sLor;
16340 +EXTER object sLand;
16341 +EXTER object sLvalues;
16342 +EXTER object sLmod;
16343 +EXTER object sLsigned_byte;
16344 +EXTER object sLunsigned_byte;
16345 +EXTER object sLsigned_char;
16346 +EXTER object sLunsigned_char;
16347 +EXTER object sLsigned_short;
16348 +EXTER object sLunsigned_short;
16349 +EXTER object sLA;
16350 +EXTER object sLplusp;
16351 +EXTER object TSor_symbol_string;
16352 +EXTER object TSor_string_symbol;
16353 +EXTER object TSor_symbol_string_package;
16354 +EXTER object TSnon_negative_integer;
16355 +EXTER object TSpositive_number;
16356 +EXTER object TSor_integer_float;
16357 +EXTER object TSor_rational_float;
16358 +#ifdef UNIX
16359 +EXTER object TSor_pathname_string_symbol;
16360 +#endif
16361 +EXTER object TSor_pathname_string_symbol_stream;
16362 +
16363 +EXTER int interrupt_flag; /* console interupt flag */
16364 +EXTER int interrupt_enable; /* console interupt enable */
16365 +
16366 +/* CMPtemp */
16367 +EXTER object CMPtemp;
16368 +EXTER object CMPtemp1;
16369 +EXTER object CMPtemp2;
16370 +EXTER object CMPtemp3;
16371 +
16372 +EXTER object sLAlink_arrayA;
16373 +
16374 +/* nfunlink.c */
16375 +object Icall_proc();
16376 +float Icall_proc_float();
16377 +/* object Icall_proc(); */
16378 +float Icall_proc_float();
16379 +object ImakeStructure();
16380 +object list_vector();
16381 +object list_vector_new();
16382 +object Iapply_ap();
16383 +object IisFboundp();
16384 +object IapplyVector();
16385 +object c_apply_n();
16386 +EXTER object sSPmemory;
16387 +EXTER object sSPinit;
16388 +object sLfset();
16389 +object MakeAfun();
16390 +extern object Cstd_key_defaults[];
16391 +extern object call_proc0();
16392 +/* extern object call_proc(); */
16393 +/* extern object call_vproc(); */
16394 +object fLrow_major_aref();
16395 +object Icheck_one_type();
16396 +
16397 +/* utils.c */
16398 +object Iis_fixnum();
16399 +object Iapply_fun_n(object,int,int,...);
16400 +object Iapply_fun_n1(object (*)(),int,int,...);
16401 +object Iapply_fun_n2(object,int,int,...);
16402 +object Ifuncall_n(object,int,...);
16403 +object Ivs_values();
16404 +object Icheck_one_type();
16405 +object fSincorrect_type();
16406 +EXTER object fLbye (fixnum exitc);
16407 +EXTER object fLquit (fixnum exitc);
16408 +EXTER object sSAno_initA;
16409 +EXTER object fLidentity (object x0);
16410 +EXTER object fSgcl_compile_time (void);
16411 +EXTER object fSldb1 (fixnum a,fixnum b, fixnum c);
16412 +EXTER object fLlisp_implementation_version (void);
16413 +EXTER object sSAlisp_maxpagesA;
16414 +EXTER object sSAsystem_directoryA;
16415 +EXTER object sSAmultiply_stacksA;
16416 +EXTER object sStop_level;
16417 +EXTER object sSAcommand_argsA;
16418 +EXTER object sSAafter_gbc_hookA;
16419 +EXTER object sSAignore_maximum_pagesA;
16420 +EXTER object sSAoptimize_maximum_pagesA;
16421 +EXTER object sSAnotify_optimize_maximum_pagesA;
16422 +EXTER object fSallocated (object typ);
16423 +EXTER object fSreset_number_used (object typ);
16424 +EXTER object fSstaticp (object x);
16425 +EXTER object fSallocate_sgc (object type,fixnum min,fixnum max,fixnum free_percent);
16426 +EXTER object fSallocate_growth (object type,fixnum min,fixnum max,fixnum percent,fixnum percent_free);
16427 +EXTER object fSallocate_contiguous_pages (fixnum npages,...);
16428 +EXTER object fSallocated_contiguous_pages (void);
16429 +EXTER object fSmaximum_contiguous_pages (void);
16430 +EXTER object fSallocate_relocatable_pages (fixnum npages,...);
16431 +EXTER object fSallocate (object type,fixnum npages,...);
16432 +EXTER object fSallocated_relocatable_pages (void);
16433 +EXTER object fSget_hole_size (void);
16434 +EXTER object fSset_hole_size (fixnum npages,...);
16435 +EXTER object fLgbc (object x0);
16436 +EXTER object sSAnotify_gbcA;
16437 +EXTER object sSAgbc_messageA;
16438 +EXTER object sLcommon;
16439 +EXTER object sLnull;
16440 +EXTER object sLcons;
16441 +EXTER object sLlist;
16442 +EXTER object sLsymbol;
16443 +EXTER object sLarray;
16444 +EXTER object sLvector;
16445 +EXTER object sLbit_vector;
16446 +EXTER object sLstring;
16447 +EXTER object sLsequence;
16448 +EXTER object sLsimple_array;
16449 +EXTER object sLsimple_vector;
16450 +EXTER object sLsimple_bit_vector;
16451 +EXTER object sLsimple_string;
16452 +EXTER object sLfunction;
16453 +EXTER object sLcompiled_function;
16454 +EXTER object sLpathname;
16455 +EXTER object sLcharacter;
16456 +EXTER object sLnumber;
16457 +EXTER object sLrational;
16458 +EXTER object sLfloat;
16459 +EXTER object sLstring_char;
16460 +EXTER object sLinteger;
16461 +EXTER object sLratio;
16462 +EXTER object sLshort_float;
16463 +EXTER object sLstandard_char;
16464 +EXTER object sLboolean;
16465 +EXTER object sLfixnum;
16466 +EXTER object sLpositive_fixnum;
16467 +EXTER object sLcomplex;
16468 +EXTER object sLsingle_float;
16469 +EXTER object sLpackage;
16470 +EXTER object sLbignum;
16471 +EXTER object sLrandom_state;
16472 +EXTER object sLdouble_float;
16473 +EXTER object sLstream;
16474 +EXTER object sLbit;
16475 +EXTER object sLreadtable;
16476 +EXTER object sLlong_float;
16477 +EXTER object sLhash_table;
16478 +EXTER object sLkeyword;
16479 +EXTER object sLstructure;
16480 +EXTER object sLsatisfies;
16481 +EXTER object sLmember;
16482 +EXTER object sLnot;
16483 +EXTER object sLor;
16484 +EXTER object sLand;
16485 +EXTER object sLvalues;
16486 +EXTER object sLmod;
16487 +EXTER object sLsigned_byte;
16488 +EXTER object sLunsigned_byte;
16489 +EXTER object sLsigned_char;
16490 +EXTER object sLunsigned_char;
16491 +EXTER object sLsigned_short;
16492 +EXTER object sLunsigned_short;
16493 +EXTER object sLA;
16494 +EXTER object sLplusp;
16495 +EXTER object sSchar_size;
16496 +EXTER object sSshort_size;
16497 +EXTER object fLfuncall (object fun,...);
16498 +EXTER object fLapply (object fun,...);
16499 +EXTER object fLeval (object x0);
16500 +EXTER object fLconstantp (object x0);
16501 +EXTER object sSlambda_block_expanded;
16502 +EXTER object sSAbreak_pointsA;
16503 +EXTER object sSAbreak_stepA;
16504 +EXTER object fLmacroexpand (object form,...);
16505 +EXTER object sLfuncall;
16506 +EXTER object sLAmacroexpand_hookA;
16507 +EXTER object sSdefmacroA;
16508 +EXTER object sSAinhibit_macro_specialA;
16509 +EXTER object fLnull (object x0);
16510 +EXTER object fLnot (object x0);
16511 +EXTER object fLsymbolp (object x0);
16512 +EXTER object fLatom (object x0);
16513 +EXTER object fLconsp (object x0);
16514 +EXTER object fLlistp (object x0);
16515 +EXTER object fLnumberp (object x0);
16516 +EXTER object fLintegerp (object x0);
16517 +EXTER object fLrationalp (object x0);
16518 +EXTER object fLrealp (object x0);
16519 +EXTER object fLfloatp (object x0);
16520 +EXTER object fLcomplexp (object x0);
16521 +EXTER object fLcharacterp (object x0);
16522 +EXTER object fLstringp (object x0);
16523 +EXTER object fLbit_vector_p (object x0);
16524 +EXTER object fLvectorp (object x0);
16525 +EXTER object fLsimple_string_p (object x0);
16526 +EXTER object fLsimple_bit_vector_p (object x0);
16527 +EXTER object fLsimple_vector_p (object x0);
16528 +EXTER object fLarrayp (object x0);
16529 +EXTER object fLpackagep (object x0);
16530 +EXTER object fLfunctionp (object x0);
16531 +EXTER object fLcompiled_function_p (object x0);
16532 +EXTER object fLcommonp (object x0);
16533 +EXTER object fLeq (object x0,object x1);
16534 +EXTER object fLeql (object x0,object x1);
16535 +EXTER object fLequal (object x0,object x1);
16536 +EXTER object fLequalp (object x0,object x1);
16537 +EXTER object fScontains_sharp_comma (object x0);
16538 +EXTER object fSspicep (object x0);
16539 +EXTER object fSfixnump (object x0);
16540 +EXTER object fLset (object symbol,object value);
16541 +EXTER object fSfset (object sym,object function);
16542 +EXTER object fLmakunbound (object sym);
16543 +EXTER object fLfmakunbound (object sym);
16544 +EXTER object sSclear_compiler_properties;
16545 +EXTER object fSclear_compiler_properties (object x0,object x1);
16546 +EXTER object sLaref;
16547 +EXTER object sLcar;
16548 +EXTER object sLcdr;
16549 +EXTER object sLchar;
16550 +EXTER object sLdecf;
16551 +EXTER object sLelt;
16552 +EXTER object sLfill_pointer;
16553 +EXTER object sLget;
16554 +EXTER object sLgetf;
16555 +EXTER object sLgethash;
16556 +EXTER object sLincf;
16557 +EXTER object sLpop;
16558 +EXTER object sLpush;
16559 +EXTER object sLschar;
16560 +EXTER object sLsetf;
16561 +EXTER object sSsetf_lambda;
16562 +EXTER object sSstructure_access;
16563 +EXTER object sLsvref;
16564 +EXTER object sStraced;
16565 +EXTER object sLvector;
16566 +EXTER object sKallow_other_keys;
16567 +EXTER object fSerror_set (volatile object x0);
16568 +EXTER object sLgensym_counter;
16569 +EXTER object fSmc (object name,object address);
16570 +EXTER object fSmfsfun (object name,object address,object argd);
16571 +EXTER object fSmfvfun (object name,object address,object argd);
16572 +EXTER object fSmfvfun_key (object symbol,object address,object argd,object keys);
16573 +EXTER object fSmf (object name,object addr);
16574 +EXTER object fSmm (object name,object addr);
16575 +EXTER object fScompiled_function_name (object fun);
16576 +EXTER object fSturbo_closure (object funobj);
16577 +EXTER object fSspecialp (object sym);
16578 +EXTER object sSdebug;
16579 +EXTER object fSdefvar1 (object sym,object val,...);
16580 +EXTER object fSdebug (object sym,object val);
16581 +EXTER object fSsetvv (object index,object val);
16582 +EXTER object sSPmemory;
16583 +EXTER object sSPinit;
16584 +EXTER object fSinit_cmp_anon (void);
16585 +EXTER object fSfind_init_name (object namestring);
16586 +EXTER object sKexternal;
16587 +EXTER object sKinherited;
16588 +EXTER object sKinternal;
16589 +EXTER object sKnicknames;
16590 +EXTER object sKuse;
16591 +EXTER object sLApackageA;
16592 +EXTER object fSset_gmp_allocate_relocatable (object flag);
16593 +EXTER object fSallocate_bigger_fixnum_range (fixnum min,fixnum max);
16594 +EXTER object fScmod (object num);
16595 +EXTER object fScplus (object x0,object x1);
16596 +EXTER object fSctimes (object x0,object x1);
16597 +EXTER object fScdifference (object x0,object x1);
16598 +EXTER object fLnth (fixnum index,object list);
16599 +EXTER object fLfirst (object x);
16600 +EXTER object fLsecond (object x);
16601 +EXTER object fLthird (object x);
16602 +EXTER object fLfourth (object x);
16603 +EXTER object fLfifth (object x);
16604 +EXTER object fLsixth (object x);
16605 +EXTER object fLseventh (object x);
16606 +EXTER object fLeighth (object x);
16607 +EXTER object fLninth (object x);
16608 +EXTER object fLtenth (object x);
16609 +EXTER object fSnext_hash_table_entry (object table,object ind);
16610 +EXTER object fLhash_table_test (object table);
16611 +EXTER object fLhash_table_size (object table);
16612 +EXTER object sLarray_rank_limit;
16613 +EXTER object sLarray_dimension_limit;
16614 +EXTER object sLarray_total_size_limit;
16615 +EXTER object sLbit;
16616 +EXTER object fLaref (object x,fixnum i, ...);
16617 +EXTER object fLsvref (object x,ufixnum i);
16618 +EXTER object fLrow_major_aref (object x,fixnum i);
16619 +EXTER object fSaset1 (object x, fixnum i,object val);
16620 +EXTER object fSaset (object x,object ii,object y, ...);
16621 +EXTER object fSsvset (object x,fixnum i,object val);
16622 +EXTER object fSmake_vector1 (fixnum n,fixnum elt_type,object staticp,...);
16623 +EXTER object fSget_aelttype (object x);
16624 +EXTER object fSmake_vector (object x0,object x1,object x2,object x3,object x4,object x5,object x6,...);
16625 +EXTER object fSmake_array1 (fixnum elt_type,object staticp,object initial_element,object displaced_to,fixnum displaced_index_offset, object dimensions);
16626 +EXTER object fScopy_array_portion (object x,object y,fixnum i1,fixnum i2,object n1o);
16627 +EXTER object fSfill_pointer_set (object x,fixnum i);
16628 +EXTER object fLfill_pointer (object x);
16629 +EXTER object fLarray_has_fill_pointer_p (object x);
16630 +EXTER object fLarray_element_type (object x);
16631 +EXTER object fLadjustable_array_p (object x);
16632 +EXTER object fSdisplaced_array_p (object x);
16633 +EXTER object fLarray_rank (object x);
16634 +EXTER object fLarray_dimension (object x,fixnum i);
16635 +EXTER object fSreplace_array (object old,object new);
16636 +EXTER object fLarray_total_size (object x);
16637 +EXTER object fSaset_by_cursor (object array,object val,object cursor);
16638 +EXTER object sSAmatch_dataA;
16639 +EXTER object sSAcase_fold_searchA;
16640 +EXTER object fSmatch_beginning (fixnum i);
16641 +EXTER object fSmatch_end (fixnum i);
16642 +EXTER object fScompile_regexp (object p);
16643 +EXTER object fSstring_match (object pattern,object string,...);
16644 +EXTER object sSs_data;
16645 +EXTER object sLcompile;
16646 +EXTER object sKcompile_toplevel;
16647 +EXTER object sLdeclare;
16648 +EXTER object sLeval;
16649 +EXTER object sKexecute;
16650 +EXTER object sSfunction_documentation;
16651 +EXTER object sLload;
16652 +EXTER object sKload_toplevel;
16653 +EXTER object sLprogn;
16654 +EXTER object sLtypep;
16655 +EXTER object sLvalues;
16656 +EXTER object sSvariable_documentation;
16657 +EXTER object sLwarn;
16658 +EXTER object sSAallow_gzipped_fileA;
16659 +EXTER object sSAcollect_binary_modulesA;
16660 +EXTER object sSAbinary_modulesA;
16661 +EXTER object sKmyaddr;
16662 +EXTER object sKmyport;
16663 +EXTER object sKasync;
16664 +EXTER object sKhost;
16665 +EXTER object sKserver;
16666 +EXTER object sKdaemon;
16667 +EXTER object sKpersistent;
16668 +EXTER object sSsocket;
16669 +EXTER object sLAstandard_inputA;
16670 +EXTER object sLAstandard_outputA;
16671 +EXTER object sLAerror_outputA;
16672 +EXTER object sLAterminal_ioA;
16673 +EXTER object sLAquery_ioA;
16674 +EXTER object sLAdebug_ioA;
16675 +EXTER object sLAtrace_outputA;
16676 +EXTER object sSAignore_eof_on_terminal_ioA;
16677 +EXTER object sSAload_pathnameA;
16678 +EXTER object sLAload_verboseA;
16679 +EXTER object sKabort;
16680 +EXTER object sKappend;
16681 +EXTER object sKcreate;
16682 +EXTER object sKdefault;
16683 +EXTER object sKdirection;
16684 +EXTER object sKelement_type;
16685 +EXTER object sKerror;
16686 +EXTER object sKif_does_not_exist;
16687 +EXTER object sKif_exists;
16688 +EXTER object sKinput;
16689 +EXTER object sKio;
16690 +EXTER object sKnew_version;
16691 +EXTER object sKoutput;
16692 +EXTER object sKoverwrite;
16693 +EXTER object sKprint;
16694 +EXTER object sKprobe;
16695 +EXTER object sKrename;
16696 +EXTER object sKrename_and_delete;
16697 +EXTER object sKset_default_pathname;
16698 +EXTER object sKsupersede;
16699 +EXTER object sKverbose;
16700 +EXTER object sLAread_default_float_formatA;
16701 +EXTER object sLAread_baseA;
16702 +EXTER object sLAread_suppressA;
16703 +EXTER object sSY;
16704 +EXTER object sSYB;
16705 +EXTER object sSYZ;
16706 +EXTER object sLlistA;
16707 +EXTER object sLappend;
16708 +EXTER object sLnconc;
16709 +EXTER object sLapply;
16710 +EXTER object sLvector;
16711 +EXTER object sKupcase;
16712 +EXTER object sKdowncase;
16713 +EXTER object sKcapitalize;
16714 +EXTER object sKstream;
16715 +EXTER object sKescape;
16716 +EXTER object sKreadably;
16717 +EXTER object sKpretty;
16718 +EXTER object sKcircle;
16719 +EXTER object sKbase;
16720 +EXTER object sKradix;
16721 +EXTER object sKcase;
16722 +EXTER object sKgensym;
16723 +EXTER object sKlevel;
16724 +EXTER object sKlength;
16725 +EXTER object sKarray;
16726 +EXTER object sLAprint_escapeA;
16727 +EXTER object sLAprint_readablyA;
16728 +EXTER object sLAprint_prettyA;
16729 +EXTER object sLAprint_circleA;
16730 +EXTER object sLAprint_baseA;
16731 +EXTER object sLAprint_radixA;
16732 +EXTER object sLAprint_caseA;
16733 +EXTER object sLAprint_gensymA;
16734 +EXTER object sLAprint_levelA;
16735 +EXTER object sLAprint_lengthA;
16736 +EXTER object sLAprint_arrayA;
16737 +EXTER object sSAprint_packageA;
16738 +EXTER object sSAprint_structureA;
16739 +EXTER object sSpretty_print_format;
16740 +EXTER object sSAprint_nansA;
16741 +EXTER object fLformat (object strm, object control,...);
16742 +EXTER object sSAindent_formatted_outputA;
16743 +EXTER object sKdirectory;
16744 +EXTER object sKlink;
16745 +EXTER object sKfile;
16746 +EXTER object fSstat (object path);
16747 +EXTER object fSsetenv (object variable,object value);
16748 +EXTER object fLdelete_file (object path);
16749 +EXTER object fLerror (object fmt_string,...);
16750 +EXTER object fLspecific_error (object error_name,object fmt_string,...);
16751 +EXTER object fLspecific_correctable_error (object error_name,object fmt_string,...);
16752 +EXTER object fLcerror (object continue_fmt_string,object fmt_string,...);
16753 +EXTER object fSihs_top (void);
16754 +EXTER object fSihs_fun (object x0);
16755 +EXTER object fSihs_vs (object x0);
16756 +EXTER object fSfrs_top (void);
16757 +EXTER object fSfrs_vs (object x0);
16758 +EXTER object fSfrs_bds (object x0);
16759 +EXTER object fSfrs_class (object x0);
16760 +EXTER object fSfrs_tag (object x0);
16761 +EXTER object fSfrs_ihs (object x0);
16762 +EXTER object fSbds_top (void);
16763 +EXTER object fSbds_var (object x0);
16764 +EXTER object fSbds_val (object x0);
16765 +EXTER object fSvs_top (void);
16766 +EXTER object fSvs (object x0);
16767 +EXTER object fSsch_frs_base (object x0,object x1);
16768 +EXTER object fSinternal_super_go (object tag,object x1,object x2);
16769 +EXTER object sSuniversal_error_handler;
16770 +EXTER object fSuniversal_error_handler (object x0,object x1,object x2,object x3,object error_fmt_string);
16771 +EXTER object sSterminal_interrupt;
16772 +EXTER object sKwrong_type_argument;
16773 +EXTER object sKtoo_few_arguments;
16774 +EXTER object sKtoo_many_arguments;
16775 +EXTER object sKunexpected_keyword;
16776 +EXTER object sKinvalid_form;
16777 +EXTER object sKunbound_variable;
16778 +EXTER object sKinvalid_variable;
16779 +EXTER object sKundefined_function;
16780 +EXTER object sKinvalid_function;
16781 +EXTER object sKpackage_error;
16782 +EXTER object sKcatch;
16783 +EXTER object sKprotect;
16784 +EXTER object sKcatchall;
16785 +EXTER object fLget_universal_time (void);
16786 +EXTER object fSgettimeofday (void);
16787 +EXTER object fLget_internal_real_time (void);
16788 +EXTER object sSAdefault_time_zoneA;
16789 +EXTER object fSgetpid (void);
16790 +EXTER object sSAload_with_freadA;
16791 +EXTER object fSuse_fast_links (object flag,...);
16792 +EXTER object sScdefn;
16793 +EXTER object sLAlink_arrayA;
16794 +EXTER object fSprofile (object start_address,object scale);
16795 +EXTER object fSfunction_start (object funobj);
16796 +EXTER object fSset_up_combined (object first,...);
16797 +EXTER object fSdisplay_profile (object start_addr,object scal);
16798 +EXTER object fSarray_adress (object array);
16799 +EXTER object sSAprofile_arrayA;
16800 +EXTER object sSAinterrupt_enableA;
16801 +EXTER object sSsigusr1_interrupt;
16802 +EXTER object sSsigio_interrupt;
16803 +EXTER object sSsignal_safety_required (fixnum signo,fixnum safety);
16804 +EXTER object fSallow_signal (fixnum n);
16805 +EXTER object fSinitfun (object sym,object addr_ind,object argd,...);
16806 +EXTER object fSinitmacro (object first,...);
16807 +EXTER object fSset_key_struct (object key_struct_ind);
16808 +EXTER object fSinvoke (object x);
16809 +EXTER object fSopen_named_socket (fixnum port);
16810 +EXTER object fSclose_fd (fixnum fd);
16811 +EXTER object fSclose_sfd (object sfd);
16812 +EXTER object fSaccept_socket_connection (object named_socket);
16813 +EXTER object fShostname_to_hostid (object host);
16814 +EXTER object fSgethostname (void);
16815 +EXTER object fShostid_to_hostname (object host_id);
16816 +EXTER object fScheck_fd_for_input (fixnum fd,fixnum timeout);
16817 +EXTER object fSclear_connection (fixnum fd);
16818 +EXTER object fSconnection_state_fd (object sfd);
16819 +EXTER object fSour_write (object sfd,object buffer,fixnum nbytes);
16820 +EXTER object fSour_read_with_offset (object fd,object buffer,fixnum offset,fixnum nbytes,fixnum timeout);
16821 +EXTER object fSprint_to_string1 (object str,object x,object the_code);
16822 +EXTER object fSset_sigio_for_fd (fixnum fd);
16823 +EXTER object fSreset_string_input_stream (object strm,object string,fixnum start,fixnum end);
16824 +EXTER object fScheck_state_input (object osfd,fixnum timeout);
16825 +EXTER object fSclear_connection_state (object osfd);
16826 +EXTER object fSgetpeername (object sock);
16827 +EXTER object fSgetsockname (object sock);
16828 +EXTER object fSset_blocking (object sock,object setBlocking);
16829 +EXTER object sSAreadline_prefixA;
16830 +/* if already mp.h has been included skip */
16831 +#ifdef GMP
16832 +#define save_avma
16833 +#define restore_avma
16834 +#endif
16835 +
16836 +#ifdef _MP_H
16837 +#ifdef GMP
16838 +
16839 +#else /* no gmp */
16840 +
16841 +typedef plong *GEN1;
16842 +/* if genpari.h not loaded */
16843 +#ifndef MAXBLOC
16844 +typedef plong *GEN;
16845 +GEN1 addii(),mulii(),mulsi(),powerii(),shifti(),stoi(),dvmdii(),subii();
16846 +int cmpii();
16847 +plong itos();
16848 +#define signe(x) (((GEN1)(x))[1]>>24)
16849 +#define lg(x) (((GEN1)(x))[0]&0xffff)
16850 +#define setlg(x,s) (((GEN1)(x))[0]=(((GEN1)(x))[0]&0xffff0000)+s)
16851 +#define lgef(x) (((GEN1)(x))[1]&0xffff)
16852 +#define setlgef(x,s) (((GEN1)(x))[1]=(((GEN1)(x))[1]&0xffff0000)+s)
16853 +
16854 +#define our_ulong unsigned plong
16855 +#endif /* end MAXBLOC */
16856 +
16857 +
16858 +EXTER int in_saved_avma ;
16859 +EXTER unsigned plong avma;
16860 +EXTER GEN1 gzero;
16861 +EXTER GEN1 icopy_x;
16862 +/* #define DEBUG_AVMA */
16863 +
16864 +#ifdef DEBUG_AVMA
16865 +#define save_avma long lvma = (in_saved_avma = 1, avma)
16866 +#define restore_avma avma = (in_saved_avma = 0, lvma)
16867 +#else
16868 +#define save_avma long lvma = avma
16869 +#define restore_avma avma = lvma
16870 +#endif
16871 +
16872 +#endif /* NO GMP */
16873 +#endif /* _MP_H */
16874 +
16875 + /* copy x to y, increasing space by factor of 2 */
16876 +object make_integer();
16877 +
16878 +#define Mcar(x) (x)->c.c_car
16879 +#define Mcdr(x) (x)->c.c_cdr
16880 +#define Mcaar(x) (x)->c.c_car->c.c_car
16881 +#define Mcadr(x) (x)->c.c_cdr->c.c_car
16882 +#define Mcdar(x) (x)->c.c_car->c.c_cdr
16883 +#define Mcddr(x) (x)->c.c_cdr->c.c_cdr
16884 +#define Mcaaar(x) (x)->c.c_car->c.c_car->c.c_car
16885 +#define Mcaadr(x) (x)->c.c_cdr->c.c_car->c.c_car
16886 +#define Mcadar(x) (x)->c.c_car->c.c_cdr->c.c_car
16887 +#define Mcaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car
16888 +#define Mcdaar(x) (x)->c.c_car->c.c_car->c.c_cdr
16889 +#define Mcdadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr
16890 +#define Mcddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr
16891 +#define Mcdddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr
16892 +#define Mcaaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_car
16893 +#define Mcaaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_car
16894 +#define Mcaadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_car
16895 +#define Mcaaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_car
16896 +#define Mcadaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_car
16897 +#define Mcadadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_car
16898 +#define Mcaddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_car
16899 +#define Mcadddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_car
16900 +#define Mcdaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_cdr
16901 +#define Mcdaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_cdr
16902 +#define Mcdadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_cdr
16903 +#define Mcdaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_cdr
16904 +#define Mcddaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_cdr
16905 +#define Mcddadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_cdr
16906 +#define Mcdddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_cdr
16907 +#define Mcddddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_cdr
16908 +
16909 +/* for cmp */
16910 +
16911 +#define CMPcar(x) (x)->c.c_car
16912 +#define CMPcdr(x) (x)->c.c_cdr
16913 +#define CMPcaar(x) (x)->c.c_car->c.c_car
16914 +#define CMPcadr(x) (x)->c.c_cdr->c.c_car
16915 +#define CMPcdar(x) (x)->c.c_car->c.c_cdr
16916 +#define CMPcddr(x) (x)->c.c_cdr->c.c_cdr
16917 +#define CMPcaaar(x) (x)->c.c_car->c.c_car->c.c_car
16918 +#define CMPcaadr(x) (x)->c.c_cdr->c.c_car->c.c_car
16919 +#define CMPcadar(x) (x)->c.c_car->c.c_cdr->c.c_car
16920 +#define CMPcaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car
16921 +#define CMPcdaar(x) (x)->c.c_car->c.c_car->c.c_cdr
16922 +#define CMPcdadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr
16923 +#define CMPcddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr
16924 +#define CMPcdddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr
16925 +#define CMPcaaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_car
16926 +#define CMPcaaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_car
16927 +#define CMPcaadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_car
16928 +#define CMPcaaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_car
16929 +#define CMPcadaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_car
16930 +#define CMPcadadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_car
16931 +#define CMPcaddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_car
16932 +#define CMPcadddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_car
16933 +#define CMPcdaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_cdr
16934 +#define CMPcdaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_cdr
16935 +#define CMPcdadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_cdr
16936 +#define CMPcdaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_cdr
16937 +#define CMPcddaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_cdr
16938 +#define CMPcddadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_cdr
16939 +#define CMPcdddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_cdr
16940 +#define CMPcddddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_cdr
16941 +#define CMPfuncall funcall
16942 +#define Creturn(v) return((vs_top=vs,(v)))
16943 +/* end for cmp*/
16944 +
16945 +/* 2^6 is the limit on the number of args */
16946 +#define F_NARG_WIDTH 6
16947 +#define F_START_TYPES_POS (2* F_NARG_WIDTH + F_end )
16948 +enum F_arg_flags
16949 +{ F_requires_nargs, /* if set, then caller must store VFUN_NARGS with number
16950 + of args passed. F_ARGD is used to set up the argd,
16951 + and it sets this if minargs < maxargs. */
16952 + F_caller_sets_one_val, /* If set, then the CALLER will look after setting the
16953 + fcall.nvalues to 1, if necessary (eg the call is at the
16954 + end of a function, or if multiple-values-list invokes
16955 + the function.) If foo is proclaimed to return exactly
16956 + one value, then the CALLER might set this flag in the
16957 + link argd, or it might do it in the case we have (setq
16958 + x (foo)) or (values (foo)).
16959 +
16960 + If this flag is not set, then the CALLED function is
16961 + responsible for setting the number of values in
16962 + fcall.nvalues, and also for always returning as C value
16963 + Cnil, in the case that it sets fcall.nvalues == 0. */
16964 + F_requires_fun_passed, /* if set, the caller must set VFUN_FUN to the
16965 + calling function. This is used by closures, but
16966 + could be used by other things i suppose. */
16967 + F_end /* 1 bigger than the largest flag */
16968 + };
16969 +enum F_arg_types
16970 +{ F_object,
16971 + F_int,
16972 + F_double_ptr,
16973 + F_shortfloat
16974 + };
16975 +
16976 +/* Make a mask for bits i < j, masking j-i bits */
16977 +#define MASK_RANGE(i,j) ((~(~0 << (j-i)))<< i)
16978 +
16979 +#define F_PLAIN(x) (((x) & MASK_RANGE( F_START_TYPES_POS,31)) == 0)
16980 +#define ARG_LIMIT 63
16981 +
16982 +EXTER object MVloc[10];
16983 +
16984 +#define TYPEP(x,t) (type_of(x) == (t))
16985 +
16986 +
16987 +#ifdef HAVE_ALLOCA
16988 +/* #ifndef alloca */
16989 +/* char *alloca(); */
16990 +/* #endif */
16991 +#include <stdlib.h>
16992 +EXTER char *alloca_val;
16993 +#define OUR_ALLOCA(n) alloca(n)
16994 +#define ALLOCA_FREE(n)
16995 +
16996 +#define ALLOCA_CONS(n) (alloca_val=alloca((n)*sizeof(struct cons)))
16997 +#define ON_STACK_CONS(x,y) (alloca_val=alloca(sizeof(struct cons)), on_stack_cons(x,y))
16998 +#define ON_STACK_LIST on_stack_list
16999 +#define ON_STACK_LIST_VECTOR on_stack_list_vector
17000 +#define ON_STACK_LIST_VECTOR_NEW on_stack_list_vector_new
17001 +#define ON_STACK_MAKE_LIST on_stack_make_list
17002 +object on_stack_cons();
17003 +object on_stack_list(int,...);
17004 +/* object on_stack_list_vector(int,va_list); */
17005 +object on_stack_list_vector_new(int,object,va_list);
17006 +object on_stack_make_list();
17007 +#else /* no HAVE_ALLOCA */
17008 +#define OUR_ALLOCA(n) malloc(n)
17009 +#define ALLOCA_FREE(n) free(n)
17010 +#define ALLOCA_CONS(n) 0
17011 +#define ON_STACK_CONS(x,y) MMcons(x,y)
17012 +#define ON_STACK_LIST list
17013 +#define ON_STACK_LIST_VECTOR list_vector
17014 +#define ON_STACK_MAKE_LIST make_list
17015 +#endif
17016 +#ifndef KEYTYPE
17017 +#define KEYTYPE void *
17018 +#endif
17019 +
17020 +
17021 +
17022 +#define Scons sLcons
17023 +#define aref1 fLrow_major_aref
17024 +#define aref fLrow_major_aref
17025 +/* #define aset1 fSaset1 */
17026 +#define aset aset1
17027 +#define siSPinit sSPinit
17028 +#define siSPmemory sSPmemory
17029 +#define siSdefmacroA sSdefmacroA
17030 +#define siSfunction_documentation sSfunction_documentation
17031 +#define siSlambda_block_expanded sSlambda_block_expanded
17032 +#define siSpretty_print_format sSpretty_print_format
17033 +#define IdoInit(x,y) do_init(y)
17034 +/* #define siSsharp_comma */
17035 +#define siSvariable_documentation sSvariable_documentation
17036 +
17037 +
17038 +#define EQ(x,y) ((x)==(y))
17039 +
17040 +#define CMPmake_fixnum(x) make_fixnum(x)
17041 +
17042 +object make_integer();
17043 + /* copy x to y, increasing space by factor of 2 */
17044 +
17045 +#ifndef GMP
17046 +GEN otoi();
17047 +/*
17048 +object integ_temp;
17049 +#define otoi(x) (integ_temp = (x) , (type_of(integ_temp) == t_bignum \
17050 + ? MP(integ_temp) :stoi(fix(integ_temp))))
17051 +*/
17052 +#define ISETQ_FIX(a,b,c) isetq_fix(a,c)
17053 +void isetq_fix();
17054 +#ifdef HAVE_ALLOCA
17055 +#define SETQ_II(var,alloc,val) \
17056 + do{GEN _xx =(val) ; \
17057 + int _n = replace_copy1(_xx,var); \
17058 + if(_n) var = replace_copy2(_xx,alloca(_n));}while(0)
17059 +
17060 +#define SETQ_IO(var,alloc,val) {object _xx =(val) ; \
17061 + int _n = obj_replace_copy1(_xx,var); \
17062 + if(_n) var = obj_replace_copy2(_xx,alloca(_n));}
17063 +#define IDECL(a,b,c) our_ulong b[4];a =(b[0]=0x1010000 +4,b) ; object c
17064 +#else
17065 +GEN setq_io(),setq_ii();
17066 +#define SETQ_IO(x,alloc,val) (x)=setq_io(x,&alloc,val)
17067 +#define SETQ_II(x,alloc,val) (x)=setq_ii(x,&alloc,val)
17068 +#define IDECL(a,b,c) our_ulong b[4];a =(b[0]=0x1010000 +4,b);object c
17069 +#endif
17070 +
17071 +#else
17072 +
17073 +typedef MP_INT * GEN;
17074 +
17075 +int obj_to_mpz(object,MP_INT *);
17076 +int obj_to_mpz1(object,MP_INT *,void *);
17077 +int mpz_to_mpz(MP_INT *,MP_INT *);
17078 +int mpz_to_mpz1(MP_INT *,MP_INT *,void *);
17079 +void isetq_fix(MP_INT *,int);
17080 +MP_INT * otoi(object x);
17081 +
17082 +#ifndef HAVE_ALLOCA
17083 +#error Need alloca for GMP
17084 +#endif
17085 +
17086 +/* Add fourth argument af to the SETQ macros to allow for malloc allocation */
17087 +/* inside setjmp frames, and faster alloca allocation otherwise.*/
17088 +/* FIXME, verify that IDECL need not be changed, improve logic behind malloc */
17089 +/* selection, e.g. closure boundaries. CM 20031201*/
17090 +#define IDECL(a,b,c) mp_limb_t *c=(mp_limb_t *)alloca(1*sizeof(mp_limb_t));MP_INT b={1,1,c}; a = &b
17091 +#define SETQ_IO(var,alloc,val,af) { object _xx = (val); \
17092 + int _n; \
17093 + if ((_n=obj_to_mpz(_xx,(var)))) {\
17094 + obj_to_mpz1(_xx,(var),af(_n));}}
17095 +#define SETQ_II(var,alloc,val,af) { MP_INT * _xx = (val); \
17096 + int _n; \
17097 + if ((_n=mpz_to_mpz(_xx,(var)))) {\
17098 + mpz_to_mpz1(_xx,(var),af(_n));}}
17099 +#define ISETQ_FIX(a,b,c) isetq_fix(a,c)
17100 +
17101 +
17102 +/* #define IDECL(a,b,c) MP_INT b; a = (mpz_init(&b),&b) ; object c */
17103 +/* #define SETQ_IO(var,alloc,val) { object _xx = (val); \ */
17104 +/* obj_to_mpz(_xx,(var));} */
17105 +/* #define SETQ_II(var,alloc,val) { MP_INT * _xx = (val); \ */
17106 +/* mpz_to_mpz(_xx,(var));} */
17107 +/* #define ISETQ_FIX(a,b,c) isetq_fix(a,c) */
17108 +
17109 +
17110 +#endif /* end no GMP */
17111 +
17112 +#define cclosure_call funcall
17113 +
17114 +#ifndef _REGEXP
17115 +#define _REGEXP 1
17116 +
17117 +#define NSUBEXP 10
17118 +typedef struct regexp {
17119 + char *startp[NSUBEXP];
17120 + char *endp[NSUBEXP];
17121 + char regstart; /* Internal use only. */
17122 + char reganch; /* Internal use only. */
17123 + char *regmust; /* Internal use only. */
17124 + int regmlen; /* Internal use only. */
17125 + unsigned char regmaybe_boyer;
17126 + char program[1]; /* Unwarranted chumminess with compiler. */
17127 +} regexp;
17128 +
17129 +#if __STDC__ == 1
17130 +#define _ANSI_ARGS_(x) x
17131 +#else
17132 +#define _ANSI_ARGS_(x) ()
17133 +#endif
17134 +
17135 +/* extern regexp *regcomp _ANSI_ARGS_((char *exp)); */
17136 +/* extern int regexec _ANSI_ARGS_((regexp *prog, char *string, char *start,int length )); */
17137 +extern void regsub _ANSI_ARGS_((regexp *prog, char *source, char *dest));
17138 +#ifndef regerror
17139 +extern void regerror _ANSI_ARGS_((char *msg));
17140 +#endif
17141 +
17142 +#endif /* REGEXP */
17143 +/* alloc.c:89:OF */ extern char *alloc_page (long n); /* (n) int n; */
17144 +/* alloc.c:149:OF */ extern void add_page_to_freelist (char *p, struct typemanager *tm); /* (p, tm) char *p; struct typemanager *tm; */
17145 +/* alloc.c:196:OF */ extern object type_name (int t); /* (t) int t; */
17146 +/* alloc.c:213:OF */ extern object alloc_object (enum type t); /* (t) enum type t; */
17147 +/* alloc.c:296:OF */ extern object make_cons (object a, object d); /* (a, d) object a; object d; */
17148 +/* alloc.c:364:OF */ extern object on_stack_cons (object x, object y); /* (x, y) object x; object y; */
17149 +/* alloc.c:376:OF */ extern object fSallocated (object typ); /* (typ) object typ; */
17150 +/* alloc.c:401:OF */ extern object fSreset_number_used (object typ); /* (typ) object typ; */
17151 +/* alloc.c:480:OF */ extern void insert_contblock (char *p, int s); /* (p, s) char *p; int s; */
17152 +/* alloc.c:480:OF */ extern void insert_maybe_sgc_contblock (char *p, int s); /* (p, s) char *p; int s; */
17153 +/* alloc.c:611:OF */ extern void set_maxpage (void); /* () */
17154 +/* alloc.c:635:OF */ extern void gcl_init_alloc (void); /* () */
17155 +/* alloc.c:737:OF */ extern object fSstaticp (object x); /* (x) object x; */
17156 +/* alloc.c:822:OF */ extern object fSallocate_sgc (object type,fixnum min,fixnum max,fixnum free_percent); /* (type, min, max, free_percent) object type; int min; int max; int free_percent; */
17157 +/* alloc.c:846:OF */ extern object fSallocate_growth (object type,fixnum min,fixnum max,fixnum percent,fixnum percent_free); /* (type, min, max, percent, percent_free) object type; int min; int max; int percent; int percent_free; */
17158 +/* alloc.c:911:OF */ extern object fSallocated_contiguous_pages (void); /* () */
17159 +/* alloc.c:918:OF */ extern object fSmaximum_contiguous_pages (void); /* () */
17160 +/* alloc.c:958:OF */ extern object fSallocated_relocatable_pages (void); /* () */
17161 +/* alloc.c:965:OF */ extern object fSget_hole_size (void); /* () */
17162 +/* alloc.c:1000:OF */ extern void gcl_init_alloc_function (void); /* () */
17163 +/* alloc.c:1126:OF */ extern void free (void *ptr); /* (ptr) void *ptr; */
17164 +/* array.c:57:OF */ extern void Laref (void); /* () */
17165 +/* array.c:126:OF */ extern object fLsvref (object x, ufixnum i); /* (x, i) object x; unsigned int i; */
17166 +/* array.c:142:OF */ extern object fLrow_major_aref (object x,fixnum i); /* (x, i) object x; int i; */
17167 +/* array.c:190:OF */ extern object fSaset1 (object x,fixnum i, object val); /* (x, i, val) object x; int i; object val; */
17168 +/* array.c:262:OF */ extern void siLaset (void); /* () */
17169 +/* array.c:321:OF */ extern void siLsvset (void); /* () */
17170 +/* array.c:324:OF */ extern object fSsvset (object x,fixnum i, object val); /* (x, i, val) object x; int i; object val; */
17171 +/* array.c:461:OF */ extern object fSget_aelttype (object x); /* (x) object x; */
17172 +/* array.c:480:OF */ extern void siLmake_vector (void); /* () */
17173 +/* array.c:519:OF */ extern object fSmake_array1 (fixnum elt_type, object staticp, object initial_element, object displaced_to,fixnum displaced_index_offset, object dimensions); /* (elt_type, staticp, initial_element, displaced_to, displaced_index_offset, dimensions) int elt_type; object staticp; object initial_element; object displaced_to; int displaced_index_offset; object dimensions; */
17174 +/* array.c::OF */ extern object fSmake_vector1_1 (fixnum n,fixnum elt_type,object staticp);
17175 +/* array.c:738:OF */ extern void adjust_displaced (object x, long diff); /* (x, diff) object x; int diff; */
17176 +/* array.c:790:OF */ extern void gset (void *p1, void *val, int n, int typ); /* (p1, val, n, typ) char *p1; char *val; int n; int typ; */
17177 +/* array.c:831:OF */ extern object fScopy_array_portion (object x, object y,fixnum i1,fixnum i2, object n1); /* (x, y, i1, i2, n1) object x; object y; int i1; int i2; int n1; */
17178 +/* array.c:879:OF */ extern void array_allocself (object x, int staticp, object dflt); /* (x, staticp, dflt) object x; int staticp; object dflt; */
17179 +/* array.c:920:OF */ extern void siLfill_pointer_set (void); /* () */
17180 +/* array.c:923:OF */ extern object fSfill_pointer_set (object x,fixnum i); /* (x, i) object x; int i; */
17181 +/* array.c:944:OF */ extern void Lfill_pointer (void); /* () */
17182 +/* array.c:947:OF */ extern object fLfill_pointer (object x); /* (x) object x; */
17183 +/* array.c:965:OF */ extern object fLarray_has_fill_pointer_p (object x); /* (x) object x; */
17184 +/* array.c:986:OF */ extern void Larray_element_type (void); /* () */
17185 +/* array.c:989:OF */ extern object fLarray_element_type (object x); /* (x) object x; */
17186 +/* array.c:995:OF */ extern void Ladjustable_array_p (void); /* () */
17187 +/* array.c:998:OF */ extern object fLadjustable_array_p (object x); /* (x) object x; */
17188 +/* array.c:1002:OF */ extern void siLdisplaced_array_p (void); /* () */
17189 +/* array.c:1005:OF */ extern object fSdisplaced_array_p (object x); /* (x) object x; */
17190 +/* array.c:1010:OF */ extern void Larray_rank (void); /* () */
17191 +/* array.c:1013:OF */ extern object fLarray_rank (object x); /* (x) object x; */
17192 +/* array.c:1020:OF */ extern void Larray_dimension (void); /* () */
17193 +/* array.c:1023:OF */ extern object fLarray_dimension (object x,fixnum i); /* (x, i) object x; int i; */
17194 +/* array.c:1090:OF */ extern void siLreplace_array (void); /* () */
17195 +/* array.c:1093:OF */ extern object fSreplace_array (object old, object new); /* (old, new) object old; object new; */
17196 +/* array.c:1132:OF */ extern object fLarray_total_size (object x); /* (x) object x; */
17197 +/* array.c:1140:OF */ extern object fSaset_by_cursor (object array, object val, object cursor); /* (array, val, cursor) object array; object val; object cursor; */
17198 +/* array.c:1160:OF */ extern void gcl_init_array_function (void); /* () */
17199 +/* assignment.c:62:OF */ extern void setq (object sym, object val); /* (sym, val) object sym; object val; */
17200 +/* assignment.c:128:OF */ extern void Lset (void); /* () */
17201 +/* assignment.c:130:OF */ extern object fLset (object symbol, object value); /* (symbol, value) object symbol; object value; */
17202 +/* assignment.c:142:OF */ extern void siLfset (void); /* () */
17203 +/* assignment.c:144:OF */ extern object fSfset (object sym, object function); /* (sym, function) object sym; object function; */
17204 +/* assignment.c:214:OF */ extern object fLmakunbound (object sym); /* (sym) object sym; */
17205 +/* assignment.c:228:OF */ extern void Lfmakunbound (void); /* () */
17206 +/* assignment.c:230:OF */ extern object fLfmakunbound (object sym); /* (sym) object sym; */
17207 +/* assignment.c:547:OF */ extern object clear_compiler_properties (object sym, object code); /* (sym, code) object sym; object code; */
17208 +/* assignment.c:563:OF */ extern object fSclear_compiler_properties (object x0, object x1); /* (x0, x1) object x0; object x1; */
17209 +/* assignment.c:591:OF */ extern void gcl_init_assignment (void); /* () */
17210 +/* backq.c:259:OF */ extern int backq_car (object x); /* (x) object x; */
17211 +/* backq.c:381:OF */ extern void gcl_init_backq (void); /* () */
17212 +/* bds.c:31:OF */ extern void bds_unwind (bds_ptr new_bds_top); /* (new_bds_top) bds_ptr new_bds_top; */
17213 +/* big.c:53:OF */ extern object fSset_gmp_allocate_relocatable (object flag); /* (flag) object flag; */
17214 +/* gmp_big.c:96:OF */ extern void gcl_init_big1 (void); /* () */
17215 +/* gmp_big.c:108:OF */ extern object new_bignum (void); /* () */
17216 +/* gmp_big.c:161:OF */ extern object make_integer (__mpz_struct *u); /* (u) __mpz_struct *u; */
17217 +/* gmp_big.c:207:OF */ extern int big_compare (object x, object y); /* (x, y) object x; object y; */
17218 +/* gmp_big.c:214:OF */ extern object normalize_big_to_object (object x); /* (x) object x; */
17219 +/* gmp_big.c:230:OF */ extern void add_int_big (int i, object x); /* (i, x) int i; object x; */
17220 +/* gmp_big.c:244:OF */ extern void mul_int_big (int i, object x); /* (i, x) int i; object x; */
17221 +/* gmp_big.c:289:OF */ extern object normalize_big (object x); /* (x) object x; */
17222 +/* gmp_big.c:302:OF */ extern object big_minus (object x); /* (x) object x; */
17223 +/* gmp_big.c:324:OF */ extern double big_to_double (object x); /* (x) object x; */
17224 +/* gmp_big.c:454:OF */ extern object maybe_replace_big (object x); /* (x) object x; */
17225 +/* gmp_big.c:472:OF */ extern object bignum2 (unsigned int h, unsigned int l); /* (h, l) unsigned int h; unsigned int l; */
17226 +/* gmp_big.c:482:OF */ extern void integer_quotient_remainder_1 (object x, object y, object *qp, object *rp); /* (x, y, qp, rp) object x; object y; object *qp; object *rp; */
17227 +/* gmp_big.c:502:OF */ extern object coerce_big_to_string (object x, int printbase); /* (x, printbase) object x; int printbase; */
17228 +/* gmp_big.c:521:OF */ extern void gcl_init_big (void); /* () */
17229 +/* big.c:72:OF */ extern int big_sign (object x); /* (x) object x; */
17230 +/* big.c:78:OF */ extern void set_big_sign (object x, int sign); /* (x, sign) object x; int sign; */
17231 +/* big.c:85:OF */ extern void zero_big (object x); /* (x) object x; */
17232 +/* bind.c:74:OF */ extern void lambda_bind (object *arg_top); /* (arg_top) object *arg_top; */
17233 +/* bind.c:564:OF */ extern void bind_var (object var, object val, object spp); /* (var, val, spp) object var; object val; object spp; */
17234 +/* bind.c:610:OF */ extern object find_special (object body, struct bind_temp *start, struct bind_temp *end); /* (body, start, end) object body; struct bind_temp *start; struct bind_temp *end; */
17235 +/* bind.c:670:OF */ extern object let_bind (object body, struct bind_temp *start, struct bind_temp *end); /* (body, start, end) object body; struct bind_temp *start; struct bind_temp *end; */
17236 +/* bind.c:688:OF */ extern object letA_bind (object body, struct bind_temp *start, struct bind_temp *end); /* (body, start, end) object body; struct bind_temp *start; struct bind_temp *end; */
17237 +/* bind.c:712:OF */ extern void parse_key (object *base, bool rest, bool allow_other_keys, register int n, ... );
17238 +/* bind.c:820:OF */ extern void check_other_key (object l, int n, ...);
17239 +struct key {short n,allow_other_keys;
17240 + iobject *defaults;
17241 + iobject keys[1];
17242 + };
17243 +
17244 +/* bind.c:866:OF */ extern int parse_key_new_new (int n, object *base, struct key *keys, object first, va_list ap); /* (n, base, keys, ap) int n; object *base; struct key *keys; va_list ap; */
17245 +/* bind.c:916:OF */ extern int parse_key_rest_new (object rest, int n, object *base, struct key *keys, object first, va_list ap); /* (rest, n, base, keys, ap) object rest; int n; object *base; struct key *keys; va_list ap; */
17246 +/* bind.c:975:OF */ extern void set_key_struct (struct key *ks, object data); /* (ks, data) struct key *ks; object data; */
17247 +/* bind.c:995:OF */ extern void gcl_init_bind (void); /* () */
17248 +/* block.c:121:OF */ extern void gcl_init_block (void); /* () */
17249 +/* bsearch.c:5:OF */ extern void *bsearch (const void *key, const void *base, size_t nel, size_t keysize, int (*compar) (const void *,const void *)); /* (key, base, nel, keysize, compar) char *key; char *base; unsigned int nel; unsigned int keysize; int (*compar)(); */
17250 +#if defined (__MINGW32__)
17251 +/* bzero.c:3:OF */ /* extern void bzero (char *b, size_t length); */ /* (b, length) char *b; int length; */
17252 +#endif
17253 +/* catch.c:61:OF */ extern object fSerror_set (object x0); /* (x0) object x0; */
17254 +/* catch.c:166:OF */ extern void gcl_init_catch (void); /* () */
17255 +/* cfun.c:37:OF */ extern object make_cfun (void (*self)(), object name, object data, char *start, int size); /* (self, name, data, start, size) int (*self)(); object name; object data; char *start; int size; */
17256 +/* cfun.c:56:OF */ extern object make_sfun (object name, object (*self)(), int argd, object data); /* (name, self, argd, data) object name; int (*self)(); int argd; object data; */
17257 +/* cfun.c:91:OF */ extern object make_cclosure_new (void (*self)(), object name, object env, object data); /* (self, name, env, data) int (*self)(); object name; object env; object data; */
17258 +/* cfun.c:108:OF */ extern object make_cclosure (void (*self)(), object name, object env, object data, char *start, int size); /* (self, name, env, data, start, size) int (*self)(); object name; object env; object data; char *start; int size; */
17259 +/* cfun.c:124:OF */ extern object fSmc (object name, object address); /* (name, address) object name; object address; */
17260 +/* cfun.c:150:OF */ extern object fSmfsfun (object name, object address, object argd); /* (name, address, argd) object name; object address; object argd; */
17261 +/* cfun.c:174:OF */ extern object fSmfvfun (object name, object address, object argd); /* (name, address, argd) object name; object address; object argd; */
17262 +/* cfun.c:193:OF */ extern object fSmfvfun_key (object symbol, object address, object argd, object keys); /* (symbol, address, argd, keys) object symbol; object address; object argd; object keys; */
17263 +/* cfun.c:221:OF */ extern object fSmf (object name, object addr); /* (name, addr) object name; object addr; */
17264 +/* cfun.c:269:OF */ extern object fSmm (object name, object addr); /* (name, addr) object name; object addr; */
17265 +/* cfun.c:283:OF */ extern object make_function_internal (char *s, void(*f)()); /* (s, f) char *s; int (*f)(); */
17266 +/* cfun.c:299:OF */ extern object make_si_sfun_internal (char *s, object (*f)(), int argd); /* (s, f, argd) char *s; int (*f)(); int argd; */
17267 +/* cfun.c:322:OF */ extern object make_si_function_internal (char *s, void (*f) ()); /* (s, f) char *s; int (*f)(); */
17268 +/* cfun.c:341:OF */ extern object make_special_form_internal (char *s, void (*f)()); /* (s, f) char *s; int (*f)(); */
17269 +/* cfun.c:352:OF */ extern object fScompiled_function_name (object fun); /* (fun) object fun; */
17270 +/* cfun.c:371:OF */ extern void turbo_closure (object fun); /* (fun) object fun; */
17271 +/* cfun.c:392:OF */ extern object fSturbo_closure (object funobj); /* (funobj) object funobj; */
17272 +/* cfun.c:403:OF */ extern void gcl_init_cfun (void); /* () */
17273 +/* cmac.c:147:OF */ extern object fScmod (object num); /* (num) object num; */
17274 +/* cmac.c:156:OF */ extern object fScplus (object x0, object x1); /* (x0, x1) object x0; object x1; */
17275 +/* cmac.c:165:OF */ extern object fSctimes (object x0, object x1); /* (x0, x1) object x0; object x1; */
17276 +/* cmac.c:175:OF */ extern object fScdifference (object x0, object x1); /* (x0, x1) object x0; object x1; */
17277 +/* cmac.c:191:OF */ extern void gcl_init_cmac (void); /* () */
17278 +/* cmpaux.c:33:OF */ extern void siLspecialp (void); /* () */
17279 +/* cmpaux.c:35:OF */ extern object fSspecialp (object sym); /* (sym) object sym; */
17280 +/* cmpaux.c:73:OF */ extern object fSdebug (object sym, object val); /* (sym, val) object sym; object val; */
17281 +/* cmpaux.c:82:OF */ extern object fSsetvv (object index, object val); /* (index, val) object index; object val; */
17282 +/* cmpaux.c:95:OF */ extern void gcl_init_cmpaux (void); /* () */
17283 +/* cmpaux.c:106:OF */ /* extern int ifloor (int x, int y); */ /* (x, y) int x; int y; */
17284 +/* cmpaux.c:124:OF */ /* extern int imod (int x, int y); */ /* (x, y) int x; int y; */
17285 +/* cmpaux.c:185:OF */ extern int object_to_int (object x); /* (x) object x; */
17286 +/* cmpaux.c:185:OF */ extern fixnum object_to_fixnum (object x); /* (x) object x; */
17287 +/* cmpaux.c:263:OF */ extern char *object_to_string (object x); /* (x) object x; */
17288 +typedef int (*FUNC)();
17289 +/* cmpaux.c:294:OF */ extern void call_init (int init_address, object memory, object fasl_vec, FUNC fptr); /* (init_address, memory, fasl_vec, fptr) int init_address; object memory; object fasl_vec; FUNC fptr; */
17290 +/* cmpaux.c:339:OF */ extern void do_init (object *statVV); /* (statVV) object *statVV; */
17291 +/* cmpaux.c:416:OF */ extern void gcl_init_or_load1 (void (*fn) (void), const char *file); /* (fn, file) int (*fn)(); char *file; */
17292 +/* conditional.c:200:OF */ extern void gcl_init_conditional (void); /* () */
17293 +/* error.c:38:OF */ extern void terminal_interrupt (int correctable); /* (correctable) int correctable; */
17294 +/* error.c:147:OF */ extern void Lerror (void); /* () */
17295 +/* error.c:164:OF */ extern void Lcerror (void); /* () */
17296 +/* error.c:184:OF */ extern void FEerror (char *s, int num, ... ); /* (s, num, arg1, arg2, arg3, arg4) char *s; int num; object arg1; object arg2; object arg3; object arg4; */
17297 +/* error.c:203:OF */ extern void FEwrong_type_argument (object type, object value); /* (type, value) object type; object value; */
17298 +/* error.c:210:OF */ extern void FEtoo_few_arguments (object *base, object *top); /* (base, top) object *base; object *top; */
17299 +/* error.c:219:OF */ extern void FEtoo_few_argumentsF (object args); /* (args) object args; */
17300 +/* error.c:227:OF */ extern void FEtoo_many_arguments (object *base, object *top); /* (base, top) object *base; object *top; */
17301 +/* error.c:234:OF */ extern void FEtoo_many_argumentsF (object args); /* (args) object args; */
17302 +/* error.c:247:OF */ extern void FEunexpected_keyword (object key); /* (key) object key; */
17303 +/* error.c:258:OF */ extern void FEinvalid_form (char *s, object form); /* (s, form) char *s; object form; */
17304 +/* error.c:266:OF */ extern void FEunbound_variable (object sym); /* (sym) object sym; */
17305 +/* error.c:273:OF */ extern void FEinvalid_variable (char *s, object obj); /* (s, obj) char *s; object obj; */
17306 +/* error.c:280:OF */ extern void FEundefined_function (object fname); /* (fname) object fname; */
17307 +/* error.c:287:OF */ extern void FEinvalid_function (object obj); /* (obj) object obj; */
17308 +/* error.c:297:OF */ extern object CEerror (char *error_str, char *cont_str, int num, object arg1, object arg2, object arg3, object arg4); /* (error_str, cont_str, num, arg1, arg2, arg3, arg4) char *error_str; char *cont_str; int num; object arg1; object arg2; object arg3; object arg4; */
17309 +/* error.c:330:OF */ extern object fSihs_top (void); /* () */
17310 +/* error.c:337:OF */ extern object fSihs_fun (object x0); /* (x0) object x0; */
17311 +/* error.c:346:OF */ extern object fSihs_vs (object x0); /* (x0) object x0; */
17312 +/* error.c:371:OF */ extern object fSfrs_top (void); /* () */
17313 +/* error.c:378:OF */ extern object fSfrs_vs (object x0); /* (x0) object x0; */
17314 +/* error.c:387:OF */ extern object fSfrs_bds (object x0); /* (x0) object x0; */
17315 +/* error.c:397:OF */ extern object fSfrs_class (object x0); /* (x0) object x0; */
17316 +/* error.c:413:OF */ extern object fSfrs_tag (object x0); /* (x0) object x0; */
17317 +/* error.c:422:OF */ extern object fSfrs_ihs (object x0); /* (x0) object x0; */
17318 +/* error.c:448:OF */ extern object fSbds_top (void); /* () */
17319 +/* error.c:455:OF */ extern object fSbds_var (object x0); /* (x0) object x0; */
17320 +/* error.c:464:OF */ extern object fSbds_val (object x0); /* (x0) object x0; */
17321 +/* error.c:487:OF */ extern object fSvs_top (void); /* () */
17322 +/* error.c:496:OF */ extern object fSvs (object x0); /* (x0) object x0; */
17323 +/* error.c:505:OF */ extern object fSsch_frs_base (object x0, object x1); /* (x0, x1) object x0; object x1; */
17324 +/* error.c:523:OF */ extern object fSinternal_super_go (object tag, object x1, object x2); /* (tag, x1, x2) object tag; object x1; object x2; */
17325 +/* error.c:549:OF */ extern object fSuniversal_error_handler (object x0, object x1, object x2, object x3, object error_fmt_string); /* (x0, x1, x2, x3, error_fmt_string) object x0; object x1; object x2; object x3; object error_fmt_string; */
17326 +/* error.c:561:OF */ extern void check_arg_failed (int n); /* (n) int n; */
17327 +/* error.c:568:OF */ extern void too_few_arguments (void); /* () */
17328 +/* error.c:573:OF */ extern void too_many_arguments (void); /* () */
17329 +/* error.c:586:OF */ extern void ck_larg_exactly (int n, object x); /* (n, x) int n; object x; */
17330 +/* error.c:595:OF */ extern void invalid_macro_call (void); /* () */
17331 +/* error.c:618:OF */ extern object wrong_type_argument (object typ, object obj); /* (typ, obj) object typ; object obj; */
17332 +/* error.c:625:OF */ extern void illegal_declare (object form); /* (form) int form; */
17333 +/* error.c:635:OF */ extern void not_a_string_or_symbol (object x); /* (x) object x; */
17334 +/* error.c:641:OF */ extern void not_a_symbol (object obj); /* (obj) object obj; */
17335 +/* error.c:647:OF */ extern int not_a_variable (object obj); /* (obj) object obj; */
17336 +/* error.c:653:OF */ extern void illegal_index (object x, object i); /* (x, i) object x; object i; */
17337 +/* error.c:660:OF */ extern void check_socket (object x); /* (x) object x; */
17338 +/* error.c:670:OF */ extern void check_stream (object strm); /* (strm) object strm; */
17339 +/* error.c:697:OF */ extern void check_arg_range (int n, int m); /* (n, m) int n; int m; */
17340 +/* error.c:727:OF */ extern void gcl_init_error (void); /* () */
17341 +/* eval.c:143:OF */ extern void funcall (object fun); /* (fun) object fun; */
17342 +/* eval.c:375:OF */ extern void lispcall (object *funp, int narg); /* (funp, narg) object *funp; int narg; */
17343 +/* eval.c:461:OF */ extern void symlispcall (object sym, object *base, int narg); /* (sym, base, narg) object sym; object *base; int narg; */
17344 +/* eval.c:549:OF */ extern object simple_lispcall (object *funp, int narg); /* (funp, narg) object *funp; int narg; */
17345 +/* eval.c:645:OF */ extern object simple_symlispcall (object sym, object *base, int narg); /* (sym, base, narg) object sym; object *base; int narg; */
17346 +/* eval.c:739:OF */ extern void super_funcall (object fun); /* (fun) object fun; */
17347 +/* eval.c:752:OF */ extern void super_funcall_no_event (object fun); /* (fun) object fun; */
17348 +/* eval.c:936:OF */ extern object Ieval (object form); /* (form) object form; */
17349 +/* eval.c:944:OF */ extern void eval (object form); /* (form) object form; */
17350 +/* eval.c:1189:OF */ extern void Leval (void); /* () */
17351 +/* eval.c:1191:OF */ extern object fLeval (object x0); /* (x0) object x0; */
17352 +/* eval.c:1203:OF */ extern void Levalhook (void); /* () */
17353 +/* eval.c:1269:OF */ extern void Lconstantp (void); /* () */
17354 +/* eval.c:1271:OF */ extern object fLconstantp (object x0); /* (x0) object x0; */
17355 +/* eval.c:1293:OF */ extern object ieval (object x); /* (x) object x; */
17356 +/* eval.c:1309:OF */ extern object ifuncall1 (object fun, object arg1); /* (fun, arg1) object fun; object arg1; */
17357 +/* eval.c:1328:OF */ extern object ifuncall2 (object fun, object arg1, object arg2); /* (fun, arg1, arg2) object fun; object arg1; object arg2; */
17358 +/* eval.c:1348:OF */ extern object ifuncall3 (object fun, object arg1, object arg2, object arg3); /* (fun, arg1, arg2, arg3) object fun; object arg1; object arg2; object arg3; */
17359 +typedef void (*funcvoid)(void);
17360 +/* eval.c:1545:OF */ extern void gcl_init_eval (void); /* () */
17361 +/* fasdump.c:1465:OF */ extern object read_fasl_vector (object in); /* (in) object in; */
17362 +/* fat_string.c:29:OF */ extern object fSprofile (object start_address, object scale); /* (start_address, scale) object start_address; object scale; */
17363 +/* fat_string.c:46:OF */ extern object fSfunction_start (object funobj); /* (funobj) object funobj; */
17364 +/* fat_string.c:331:OF */ extern object fSdisplay_profile (object start_addr, object scal); /* (start_addr, scal) object start_addr; object scal; */
17365 +/* fat_string.c:394:OF */ extern object fSarray_adress (object array); /* (array) object array; */
17366 +/* fat_string.c:435:OF */ extern void gcl_init_fat_string (void); /* () */
17367 +/* sfasli.c::OF */ extern void gcl_init_sfasl (void); /* () */
17368 +/* format.c::OF */ extern object fLformat_1(object strm, object control,object x);
17369 +/* format.c:2084:OF */ extern void Lformat (void); /* () */
17370 +/* format.c:2171:OF */ extern void gcl_init_format (void); /* () */
17371 +/* frame.c:32:OF */ extern void unwind (frame_ptr fr, object tag); /* (fr, tag) frame_ptr fr; object tag; */
17372 +/* frame.c:58:OF */ extern frame_ptr frs_sch (object frame_id); /* (frame_id) object frame_id; */
17373 +/* frame.c:69:OF */ extern frame_ptr frs_sch_catch (object frame_id); /* (frame_id) object frame_id; */
17374 +/* funlink.c:19:OF */ extern void call_or_link (object sym, void **link); /* (sym, link) object sym; void **link; */
17375 +/* funlink.c:41:OF */ extern void call_or_link_closure (object sym, void **link, void **ptr); /* (sym, link, ptr) object sym; void **link; object *ptr; */
17376 +/* funlink.c:230:OF */ extern object c_apply_n (object (*fn)(), int n, object *x); /* (fn, n, x) long int (*fn)(); int n; object *x; */
17377 +/* funlink.c:696:OF */ extern object call_proc0 (object sym, void *link); /* (sym, link) object sym; void *link; */
17378 +/* funlink.c:784:OF */ extern int clear_stack (object *beg, object *limit); /* (beg, limit) object *beg; object *limit; */
17379 +/* funlink.c:821:OF */ extern void gcl_init_links (void); /* () */
17380 +/* gbc.c:151:OF */ extern void enter_mark_origin (object *p); /* (p) object *p; */
17381 +/* gbc.c:938:OF */ extern void GBC (enum type t); /* (t) enum type t; */
17382 +/* gbc.c:1326:OF */ extern object fLgbc (object x0); /* (x0) object x0; */
17383 +/* sgbc.c:924:OF */ extern int sgc_count_type (int t); /* (t) int t; */
17384 +/* sgbc.c:938:OF */ extern int sgc_start (void); /* () */
17385 +/* sgbc.c:1068:OF */ extern int sgc_quit (void); /* () */
17386 +/* sgbc.c:1131:OF */ extern void make_writable (unsigned long beg, unsigned long i); /* (beg, i) int beg; int i; */
17387 +#ifndef __MINGW32__
17388 +/* #include <signal.h> */
17389 +#endif
17390 +/* sgbc.c:1246:OF */ extern void memory_protect (int on); /* (on) int on; */
17391 +/* sgbc.c:1306:OF */ extern void perm_writable (char *p, long n); /* (p, n) char *p; int n; */
17392 +/* sgbc.c:1321:OF */ extern void system_error (void); /* () */
17393 +/* gbc.c:1357:OF */ extern void gcl_init_GBC (void); /* () */
17394 +/* gnumalloc.c:286:OF */ extern void malloc_init (char *start, void (*warnfun) (/* ??? */)); /* (start, warnfun) char *start; void (*warnfun)(); */
17395 +/* gnumalloc.c:301:OF */ extern int malloc_usable_size (char *mem); /* (mem) char *mem; */
17396 +/* gnumalloc.c:461:OF */ /* extern void *malloc (size_t n); */ /* (n) unsigned int n; */
17397 +/* gnumalloc.c:529:OF */ /* extern int free (char *mem); */ /* (mem) char *mem; */
17398 +/* gnumalloc.c:577:OF */ /* extern char *realloc (char *mem, register unsigned int n); */ /* (mem, n) char *mem; register unsigned int n; */
17399 +/* gnumalloc.c:639:OF */ /* extern char *memalign (unsigned int alignment, unsigned int size); */ /* (alignment, size) unsigned int alignment; unsigned int size; */
17400 +/* gnumalloc.c:737:OF */ extern int get_lim_data (void); /* () */
17401 +/* grab_defs.c:35:OF */ extern int read_some (char *buf, int n, int start_ch, int copy); /* (buf, n, start_ch, copy) char *buf; int n; int start_ch; int copy; */
17402 +/* grab_defs.c:71:OF */ /* extern int main (void); */ /* () */
17403 +/* iteration.c:457:OF */ extern void gcl_init_iteration (void); /* () */
17404 +/* let.c:29:OF */ extern void let_var_list (object var_list); /* (var_list) object var_list; */
17405 +/* let.c:321:OF */ extern void gcl_init_let (void); /* () */
17406 +/* lex.c:34:OF */ extern object assoc_eq (object key, object alist); /* (key, alist) object key; object alist; */
17407 +/* lex.c:47:OF */ extern void lex_fun_bind (object name, object fun); /* (name, fun) object name; object fun; */
17408 +/* lex.c:59:OF */ extern void lex_macro_bind (object name, object exp_fun); /* (name, exp_fun) object name; object exp_fun; */
17409 +/* lex.c:70:OF */ extern void lex_tag_bind (object tag, object id); /* (tag, id) object tag; object id; */
17410 +/* lex.c:82:OF */ extern void lex_block_bind (object name, object id); /* (name, id) object name; object id; */
17411 +/* lex.c:95:OF */ extern object lex_tag_sch (object tag); /* (tag) object tag; */
17412 +/* lex.c:110:OF */ extern object lex_block_sch (object name); /* (name) object name; */
17413 +/* lex.c:125:OF */ extern void gcl_init_lex (void); /* () */
17414 +/* littleXwin.c:32:OF */ /* extern Window open_window (void); */ /* () */
17415 +/* littleXwin.c:102:OF */ /* extern int close_window (Window the_window); */ /* (the_window) Window the_window; */
17416 +/* littleXwin.c:110:OF */ /* extern int draw_line (Window the_window, int x1, int y1, int x2, int y2); */ /* (the_window, x1, y1, x2, y2) Window the_window; int x1; int y1; int x2; int y2; */
17417 +/* littleXwin.c:119:OF */ /* extern int draw_arc (Window the_window, int x, int y, int width, int height, int angle1, int angle2); *//* (the_window, x, y, width, height, angle1, angle2) Window the_window; int x; int y; int width; int height; int angle1; int angle2; */
17418 +/* littleXwin.c:129:OF */ /* extern int fill_arc (Window the_window, int x, int y, int width, int height, int angle1, int angle2); */ /* (the_window, x, y, width, height, angle1, angle2) Window the_window; int x; int y; int width; int height; int angle1; int angle2; */
17419 +/* littleXwin.c:139:OF */ /* extern int clear_arc (Window the_window, int x, int y, int width, int height, int angle1, int angle2); *//* (the_window, x, y, width, height, angle1, angle2) Window the_window; int x; int y; int width; int height; int angle1; int angle2; */
17420 +/* littleXwin.c:149:OF */ /* extern int set_arc_mode (int pie_or_chord); */ /* (pie_or_chord) int pie_or_chord; */
17421 +/* littleXwin.c:162:OF */ /* extern int erase_line (Window the_window, int x1, int y1, int x2, int y2); *//* (the_window, x1, y1, x2, y2) Window the_window; int x1; int y1; int x2; int y2; */
17422 +/* littleXwin.c:171:OF */ /* extern int draw_text (Window the_window, char *string, int x, int y); */ /* (the_window, string, x, y) Window the_window; char *string; int x; int y; */
17423 +/* littleXwin.c:182:OF */ /* extern int erase_text (Window the_window, char *string, int x, int y); */ /* (the_window, string, x, y) Window the_window; char *string; int x; int y; */
17424 +/* littleXwin.c:193:OF */ /* extern int clear_window (Window the_window); */ /* (the_window) Window the_window; */
17425 +/* littleXwin.c:201:OF */ /* extern int resize_window (Window the_window, int width, int height); */ /* (the_window, width, height) Window the_window; int width; int height; */
17426 +/* littleXwin.c:210:OF */ /* extern int raise_window (Window the_window); */ /* (the_window) Window the_window; */
17427 +/* littleXwin.c:218:OF */ /* extern int use_font (char *font_name); */ /* (font_name) char *font_name; */
17428 +/* littleXwin.c:233:OF */ /* extern int set_background (Window the_window, char *color_string); */ /* (the_window, color_string) Window the_window; char *color_string; */
17429 +/* littleXwin.c:251:OF */ /* extern int set_foreground (char *color_string); */ /* (color_string) char *color_string; */
17430 +/* macros.c:139:OF */ extern object Imacro_expand1 (object exp_fun, object form); /* (exp_fun, form) object exp_fun; object form; */
17431 +/* macros.c:173:OF */ extern void Lmacroexpand (void); /* () */
17432 +/* macros.c:224:OF */ extern void Lmacroexpand_1 (void); /* () */
17433 +/* macros.c:265:OF */ extern object macro_expand (object form); /* (form) object form; */
17434 +/* macros.c:344:OF */ extern void gcl_init_macros (void); /* () */
17435 +/* main.c:111:OF */ extern int main (int argc, char **argv, char **envp); /* (argc, argv, envp) int argc; char **argv; char **envp; */
17436 +/* main.c:346:OF */ extern void install_segmentation_catcher (void); /* () */
17437 +/* main.c:359:OF */ extern void error (char *s); /* (s) char *s; */
17438 +/* main.c:519:OF */ extern object vs_overflow (void); /* () */
17439 +/* main.c:528:OF */ extern void bds_overflow (void); /* () */
17440 +/* main.c:537:OF */ extern void frs_overflow (void); /* () */
17441 +/* main.c:546:OF */ extern void ihs_overflow (void); /* () */
17442 +/* main.c:556:OF */ extern void segmentation_catcher (int); /* () */
17443 +/* main.c:587:OF */ extern void Lby (void); /* () */
17444 +/* main.c:607:OF */ extern void Lquit(void); /* () */
17445 +/* main.c:612:OF */ extern void Lexit(void); /* () */
17446 +/* main.c:619:OF */ extern int c_trace (void); /* () */
17447 +/* main.c:695:OF */ extern void siLreset_stack_limits (void); /* (arg) int arg; */
17448 +/* main.c:797:OF */ extern void Lidentity(void); /* () */
17449 +/* main.c:799:OF */ extern object fLidentity (object x0); /* (x0) object x0; */
17450 +/* main.c:805:OF */ extern void Llisp_implementation_version(void); /* () */
17451 +/* main.c:807:OF */ extern object fLlisp_implementation_version (void); /* () */
17452 +/* makefun.c:10:OF */ extern object MakeAfun (object (*addr)(object,object), unsigned int argd, object data); /* (addr, argd, data) int (*addr)(); unsigned int argd; object data; */
17453 +/* makefun.c:113:OF */ extern object fSset_key_struct (object key_struct_ind); /* (key_struct_ind) object key_struct_ind; */
17454 +/* makefun.c:122:OF */ extern void SI_makefun (char *strg, object (*fn) (/* ??? */), unsigned int argd); /* (strg, fn, argd) char *strg; object (*fn)(); unsigned int argd; */
17455 +/* makefun.c:131:OF */ extern void LISP_makefun (char *strg, object (*fn) (/* ??? */), unsigned int argd); /* (strg, fn, argd) char *strg; object (*fn)(); unsigned int argd; */
17456 +/* makefun.c:167:OF */ extern object fSinvoke (object x); /* (x) object x; */
17457 +/* mapfun.c:324:OF */ extern void gcl_init_mapfun (void); /* () */
17458 +/* multival.c:32:OF */ extern void Lvalues (void); /* () */
17459 +/* multival.c:37:OF */ extern void Lvalues_list (void); /* () */
17460 +/* multival.c:134:OF */ extern void gcl_init_multival (void); /* () */
17461 +/* nfunlink.c:190:OF */ extern object IapplyVector (object fun, int nargs, object *base); /* (fun, nargs, base) object fun; int nargs; object *base; */
17462 +/* nfunlink.c:269:OF */ extern void Iinvoke_c_function_from_value_stack (object (*f)(), int fargd); /* (f, fargd) object (*f)(); int fargd; */
17463 +/* nsocket.c:190:OF */ extern int CreateSocket (int port, char *host, int server, char *myaddr, int myport, int async); /* (port, host, server, myaddr, myport, async) int port; char *host; int server; char *myaddr; int myport; int async; */
17464 +/* nsocket.c:329:OF */ extern object fSgetpeername (object sock); /* (sock) object sock; */
17465 +/* nsocket.c:353:OF */ extern object fSgetsockname (object sock); /* (sock) object sock; */
17466 +/* nsocket.c:385:OF */ extern object fSset_blocking (object sock, object setBlocking); /* (sock, setBlocking) object sock; object setBlocking; */
17467 +/* nsocket.c:484:OF */ extern int getOneChar (FILE *fp); /* (fp) FILE *fp; */
17468 +/* nsocket.c:539:OF */ extern void ungetCharGclSocket (int c, object strm); /* (c, strm) int c; object strm; */
17469 +#ifndef __MINGW32__
17470 +/* nsocket.c:592:OF */ extern void tcpCloseSocket (int fd); /* (fd) int fd; */
17471 +/* nsocket.c:575:OF */ extern int TcpOutputProc (int fd, char *buf, int toWrite, int *errorCodePtr); /* (fd, buf, toWrite, errorCodePtr) int fd; char *buf; int toWrite; int *errorCodePtr; */
17472 +#endif
17473 +/* nsocket.c:619:OF */ extern int getCharGclSocket (object strm, object block); /* (strm, block) object strm; object block; */
17474 +/* num_arith.c:31:OF */ extern object fixnum_add (fixnum i, fixnum j); /* (i, j) int i; int j; */
17475 +/* num_arith.c:48:OF */ extern object fixnum_sub (fixnum i, fixnum j); /* (i, j) int i; int j; */
17476 +/* num_arith.c:100:OF */ extern object number_plus (object x, object y); /* (x, y) object x; object y; */
17477 +/* num_arith.c:246:OF */ extern object one_plus (object x); /* (x) object x; */
17478 +/* num_arith.c:292:OF */ extern object number_minus (object x, object y); /* (x, y) object x; object y; */
17479 +/* num_arith.c:438:OF */ extern object one_minus (object x); /* (x) object x; */
17480 +/* num_arith.c:478:OF */ extern object number_negate (object x); /* (x) object x; */
17481 +/* num_arith.c:520:OF */ extern object number_times (object x, object y); /* (x, y) object x; object y; */
17482 +/* num_arith.c:670:OF */ extern object number_divide (object x, object y); /* (x, y) object x; object y; */
17483 +/* num_arith.c:818:OF */ extern object integer_divide1 (object x, object y); /* (x, y) object x; object y; */
17484 +/* num_arith.c:828:OF */ extern object get_gcd (object x, object y); /* (x, y) object x; object y; */
17485 +/* num_arith.c:873:OF */ extern void Lplus (void); /* () */
17486 +/* num_arith.c:889:OF */ extern void Lminus (void); /* () */
17487 +/* num_arith.c:907:OF */ extern void Ltimes (void); /* () */
17488 +/* num_arith.c:923:OF */ extern void Ldivide (void); /* () */
17489 +/* num_arith.c:1029:OF */ extern void gcl_init_num_arith (void); /* () */
17490 +/* num_co.c:292:OF */ extern object double_to_integer (double d); /* (d) double d; */
17491 +/* num_co.c:372:OF */ extern void Lfloat (void); /* () */
17492 +/* num_co.c:424:OF */ extern void Lnumerator (void); /* () */
17493 +/* num_co.c:432:OF */ extern void Ldenominator (void); /* () */
17494 +/* num_co.c:442:OF */ extern void Lfloor (void); /* () */
17495 +/* num_co.c:563:OF */ extern void Lceiling (void); /* () */
17496 +/* num_co.c:684:OF */ extern void Ltruncate (void); /* () */
17497 +/* num_co.c:766:OF */ extern void Lround (void); /* () */
17498 +/* num_co.c:896:OF */ extern void Lmod (void); /* () */
17499 +/* num_co.c:987:OF */ extern void Lfloat_radix (void); /* () */
17500 +/* num_co.c:1089:OF */ extern void Linteger_decode_float (void); /* () */
17501 +/* num_co.c:1114:OF */ extern void Lcomplex (void); /* () */
17502 +/* num_co.c:1136:OF */ extern void Lrealpart (void); /* () */
17503 +/* num_co.c:1147:OF */ extern void Limagpart (void); /* () */
17504 +/* num_co.c:1185:OF */ extern void gcl_init_num_co (void); /* () */
17505 +/* num_comp.c:40:OF */ extern int number_compare (object x, object y); /* (x, y) object x; object y; */
17506 +/* num_comp.c:269:OF */ extern void Lmonotonically_increasing (void); /* () */
17507 +/* num_comp.c:271:OF */ extern void Lmonotonically_nondecreasing (void); /* () */
17508 +/* num_comp.c:272:OF */ extern void Lmonotonically_nonincreasing (void); /* () */
17509 +/* num_comp.c:292:OF */ extern void Lmin (void); /* () */
17510 +/* num_comp.c:309:OF */ extern void gcl_init_num_comp (void); /* () */
17511 +/* num_log.c:224:OF */ extern object shift_integer (object x, int w); /* (x, w) object x; int w; */
17512 +/* num_log.c:258:OF */ extern void Llogior (void); /* () */
17513 +/* num_log.c:279:OF */ extern void Llogxor (void); /* () */
17514 +/* num_log.c:299:OF */ extern void Llogand (void); /* () */
17515 +/* num_log.c:339:OF */ extern void Lboole (void); /* () */
17516 +/* num_log.c:380:OF */ extern void Llogbitp (void); /* () */
17517 +/* num_log.c:420:OF */ extern void Lash (void); /* () */
17518 +/* num_log.c:482:OF */ extern void Linteger_length (void); /* () */
17519 +/* num_log.c:549:OF */ extern void gcl_init_num_log (void); /* () */
17520 +/* num_log.c:585:OF */ extern void siLbit_array_op (void); /* () */
17521 +/* num_pred.c:31:OF */ extern int number_zerop (object x); /* (x) object x; */
17522 +/* num_pred.c:67:OF */ extern int number_plusp (object x); /* (x) object x; */
17523 +/* num_pred.c:107:OF */ extern int number_minusp (object x); /* (x) object x; */
17524 +/* num_pred.c:147:OF */ extern int number_oddp (object x); /* (x) object x; */
17525 +/* num_pred.c:161:OF */ extern int number_evenp (object x); /* (x) object x; */
17526 +/* num_pred.c:240:OF */ extern void gcl_init_num_pred (void); /* () */
17527 +/* num_rand.c:111:OF */ extern void Lrandom (void); /* () */
17528 +/* num_rand.c:151:OF */ extern void gcl_init_num_rand (void); /* () */
17529 +/* num_sfun.c:91:OF */ extern object number_expt (object x, object y); /* (x, y) object x; object y; */
17530 +/* num_sfun.c:453:OF */ extern void Lexp (void); /* () */
17531 +/* num_sfun.c:469:OF */ extern void Llog (void); /* () */
17532 +/* num_sfun.c:488:OF */ extern void Lsqrt (void); /* () */
17533 +/* num_sfun.c:495:OF */ extern void Lsin (void); /* () */
17534 +/* num_sfun.c:502:OF */ extern void Lcos (void); /* () */
17535 +/* num_sfun.c:516:OF */ extern void Latan (void); /* () */
17536 +/* num_sfun.c:535:OF */ extern void gcl_init_num_sfun (void); /* () */
17537 +/* number.c:35:OF */ extern long int fixint (object x); /* (x) object x; */
17538 +/* number.c:44:OF */ extern int fixnnint (object x); /* (x) object x; */
17539 +/* number.c:59:OF */ extern object fSallocate_bigger_fixnum_range (fixnum min,fixnum max); /* (min, max) int min; int max; */
17540 +/* number.c:81:OF */ extern object make_fixnum1 (long i); /* (i) int i; */
17541 +/* number.c:102:OF */ extern object make_ratio (object num, object den); /* (num, den) object num; object den; */
17542 +/* number.c:144:OF */ extern object make_shortfloat (double f); /* (f) double f; */
17543 +/* number.c:157:OF */ extern object make_longfloat (longfloat f); /* (f) longfloat f; */
17544 +/* number.c:170:OF */ extern object make_complex (object r, object i); /* (r, i) object r; object i; */
17545 +/* number.c:229:OF */ extern double number_to_double (object x); /* (x) object x; */
17546 +/* number.c:254:OF */ extern void gcl_init_number (void); /* () */
17547 +/* peculiar.c:14:OF */ /* extern int main (void); */ /* () */
17548 +/* predicate.c:35:OF */ extern object fLnot (object x0); /* (x0) object x0; */
17549 +/* predicate.c:46:OF */ extern void Lsymbolp (void); /* () */
17550 +/* predicate.c:48:OF */ extern object fLsymbolp (object x0); /* (x0) object x0; */
17551 +/* predicate.c:61:OF */ extern object fLatom (object x0); /* (x0) object x0; */
17552 +/* predicate.c:74:OF */ extern object fLconsp (object x0); /* (x0) object x0; */
17553 +/* predicate.c:87:OF */ extern object fLlistp (object x0); /* (x0) object x0; */
17554 +/* predicate.c:100:OF */ extern object fLnumberp (object x0); /* (x0) object x0; */
17555 +/* predicate.c:117:OF */ extern object fLintegerp (object x0); /* (x0) object x0; */
17556 +/* predicate.c:132:OF */ extern object fLrationalp (object x0); /* (x0) object x0; */
17557 +/* predicate.c:148:OF */ extern object fLrealp (object x0); /* (x0) object x0; */
17558 +/* predicate.c:164:OF */ extern object fLfloatp (object x0); /* (x0) object x0; */
17559 +/* predicate.c:176:OF */ extern void Lcomplexp (void); /* () */
17560 +/* predicate.c:178:OF */ extern object fLcomplexp (object x0); /* (x0) object x0; */
17561 +/* predicate.c:190:OF */ extern object fLcharacterp (object x0); /* (x0) object x0; */
17562 +/* predicate.c:202:OF */ extern object fLstringp (object x0); /* (x0) object x0; */
17563 +/* predicate.c:214:OF */ extern object fLbit_vector_p (object x0); /* (x0) object x0; */
17564 +/* predicate.c:226:OF */ extern object fLvectorp (object x0); /* (x0) object x0; */
17565 +/* predicate.c:238:OF */ extern void Lsimple_string_p (void); /* () */
17566 +/* predicate.c:240:OF */ extern object fLsimple_string_p (object x0); /* (x0) object x0; */
17567 +/* predicate.c:253:OF */ extern void Lsimple_bit_vector_p (void); /* () */
17568 +/* predicate.c:255:OF */ extern object fLsimple_bit_vector_p (object x0); /* (x0) object x0; */
17569 +/* predicate.c:268:OF */ extern void Lsimple_vector_p (void); /* () */
17570 +/* predicate.c:270:OF */ extern object fLsimple_vector_p (object x0); /* (x0) object x0; */
17571 +/* predicate.c:288:OF */ extern object fLarrayp (object x0); /* (x0) object x0; */
17572 +/* predicate.c:301:OF */ extern void Lpackagep (void); /* () */
17573 +/* predicate.c:303:OF */ extern object fLpackagep (object x0); /* (x0) object x0; */
17574 +/* predicate.c:313:OF */ extern void Lfunctionp (void); /* () */
17575 +/* predicate.c:315:OF */ extern object fLfunctionp (object x0); /* (x0) object x0; */
17576 +/* predicate.c:344:OF */ extern void Lcompiled_function_p (void); /* () */
17577 +/* predicate.c:346:OF */ extern object fLcompiled_function_p (object x0); /* (x0) object x0; */
17578 +/* predicate.c:367:OF */ extern object fLcommonp (object x0); /* (x0) object x0; */
17579 +/* predicate.c:379:OF */ extern object fLeq (object x0, object x1); /* (x0, x1) object x0; object x1; */
17580 +/* predicate.c:393:OF */ extern int eql (object x, object y); /* (x, y) object x; object y; */
17581 +/* predicate.c:455:OF */ extern object fLeql (object x0, object x1); /* (x0, x1) object x0; object x1; */
17582 +/* predicate.c:469:OF */ extern int equal (register object x, register object y); /* (x, y) register object x; register object y; */
17583 +/* predicate.c:543:OF */ extern object fLequal (object x0, object x1); /* (x0, x1) object x0; object x1; */
17584 +/* predicate.c:557:OF */ extern bool equalp (object x, object y); /* (x, y) object x; object y; */
17585 +/* predicate.c:681:OF */ extern object fLequalp (object x0, object x1); /* (x0, x1) object x0; object x1; */
17586 +/* predicate.c:750:OF */ extern bool contains_sharp_comma (object x); /* (x) object x; */
17587 +/* predicate.c:797:OF */ extern object fScontains_sharp_comma (object x0); /* (x0) object x0; */
17588 +/* predicate.c:810:OF */ extern object fSspicep (object x0); /* (x0) object x0; */
17589 +/* predicate.c:822:OF */ extern object fSfixnump (object x0); /* (x0) object x0; */
17590 +/* predicate.c:833:OF */ extern void gcl_init_predicate_function (void); /* () */
17591 +/* prog.c:48:OF */ extern void Ftagbody (object body); /* (body) object body; */
17592 +/* prog.c:246:OF */ extern void Fprogn (object body); /* (body) object body; */
17593 +/* prog.c:303:OF */ extern void gcl_init_prog (void); /* () */
17594 +/* reference.c:32:OF */ extern void Lfboundp (void); /* () */
17595 +/* reference.c:49:OF */ extern object symbol_function (object sym); /* (sym) object sym; */
17596 +/* reference.c:69:OF */ extern void Lsymbol_function (void); /* () */
17597 +/* reference.c:143:OF */ extern void Lsymbol_value (void); /* () */
17598 +/* reference.c:156:OF */ extern void Lboundp (void); /* () */
17599 +/* reference.c:169:OF */ extern void Lmacro_function (void); /* () */
17600 +/* reference.c:180:OF */ extern void Lspecial_form_p (void); /* () */
17601 +/* reference.c:191:OF */ extern void gcl_init_reference (void); /* () */
17602 +/* #include "regexp.h" */
17603 +/* regexp.c:1588:OF */ extern void regerror (char *s); /* (s) char *s; */
17604 +/* regexpr.c:48:OF */ extern object fSmatch_beginning (fixnum i); /* (i) int i; */
17605 +/* regexpr.c:57:OF */ extern object fSmatch_end (fixnum i); /* (i) int i; */
17606 +/* save.c:17:OF */ extern void Lsave (void); /* () */
17607 +#include <unistd.h>
17608 +/* sbrk.c:9:OF */ /* extern void * sbrk (int n); */ /* (n) int n; */
17609 +/* strcspn.c:3:OF */ /* extern size_t strcspn (const char *s1, const char *s2); */ /* (s1, s2) char *s1; char *s2; */
17610 +/* structure.c:59:OF */ extern object structure_ref (object x, object name, int i); /* (x, name, i) object x; object name; int i; */
17611 +/* structure.c:107:OF */ extern object structure_set (object x, object name, int i, object v); /* (x, name, i, v) object x; object name; int i; object v; */
17612 +/* structure.c:164:OF */ extern object structure_to_list (object x); /* (x) object x; */
17613 +/* structure.c:188:OF */ extern void siLmake_structure (void); /* () */
17614 +/* structure.c:281:OF */ extern void siLstructure_set (void); /* () */
17615 +/* structure.c:326:OF */ extern void siLlist_nth (void); /* () */
17616 +/* structure.c:439:OF */ extern void gcl_init_structure_function (void); /* () */
17617 +/* toplevel.c:211:OF */ extern void gcl_init_toplevel (void); /* () */
17618 +/* typespec.c:38:OF */ extern void check_type_integer (object *p); /* (p) object *p; */
17619 +/* typespec.c:47:OF */ extern void check_type_non_negative_integer (object *p); /* (p) object *p; */
17620 +/* typespec.c:65:OF */ extern void check_type_rational (object *p); /* (p) object *p; */
17621 +/* typespec.c:75:OF */ extern void check_type_float (object *p); /* (p) object *p; */
17622 +/* typespec.c:94:OF */ extern void check_type_or_rational_float (object *p); /* (p) object *p; */
17623 +/* typespec.c:104:OF */ extern void check_type_number (object *p); /* (p) object *p; */
17624 +/* typespec.c:123:OF */ extern void check_type_character (object *p); /* (p) object *p; */
17625 +/* typespec.c:139:OF */ extern void check_type_symbol (object *p); /* (p) object *p; */
17626 +/* typespec.c:146:OF */ extern void check_type_or_symbol_string (object *p); /* (p) object *p; */
17627 +/* typespec.c:153:OF */ extern void check_type_or_string_symbol (object *p); /* (p) object *p; */
17628 +/* typespec.c:170:OF */ extern void check_type_package (object *p); /* (p) object *p; */
17629 +/* typespec.c:177:OF */ extern void check_type_string (object *p); /* (p) object *p; */
17630 +/* typespec.c:191:OF */ extern void check_type_cons (object *p); /* (p) object *p; */
17631 +/* typespec.c:198:OF */ extern void check_type_stream (object *p); /* (p) object *p; */
17632 +/* typespec.c:205:OF */ extern void check_type_readtable (object *p); /* (p) object *p; */
17633 +/* typespec.c:213:OF */ extern void check_type_or_Pathname_string_symbol (object *p); /* (p) object *p; */
17634 +/* typespec.c:225:OF */ extern void check_type_or_pathname_string_symbol_stream (object *p); /* (p) object *p; */
17635 +/* typespec.c:236:OF */ extern void check_type_random_state (object *p); /* (p) object *p; */
17636 +/* typespec.c:243:OF */ extern void check_type_hash_table (object *p); /* (p) object *p; */
17637 +/* typespec.c:250:OF */ extern void check_type_array (object *p); /* (p) object *p; */
17638 +/* typespec.c:284:OF */ extern void check_type (object x, int t); /* (x, t) object x; int t; */
17639 +/* typespec.c:294:OF */ extern void Ltype_of (void); /* () */
17640 +/* typespec.c:493:OF */ extern void gcl_init_typespec (void); /* () */
17641 +/* typespec.c:497:OF */ extern void gcl_init_typespec_function (void); /* () */
17642 +/* unexec-19.29.c:1016:OF */ extern int write_segment (int new, register char *ptr, register char *end); /* (new, ptr, end) int new; register char *ptr; register char *end; */
17643 +/* unexec.c:1016:OF */ extern int write_segment (int new, register char *ptr, register char *end); /* (new, ptr, end) int new; register char *ptr; register char *end; */
17644 +/* unexlin.c:808:OF */ extern int write_segment (int new, register char *ptr, register char *end); /* (new, ptr, end) int new; register char *ptr; register char *end; */
17645 +/* unixfasl.c:409:OF */ extern void gcl_init_unixfasl (void); /* () */
17646 +/* unixfsys.c:145:OF */ extern char *getwd (char *buffer); /* (buffer) char *buffer; */
17647 +/* unixfsys.c:209:OF */ extern void coerce_to_filename (object pathname, char *p); /* (pathname, p) object pathname; char *p; */
17648 +/* unixfsys.c:329:OF */ extern bool file_exists (object file); /* (file) object file; */
17649 +/* unixfsys.c:359:OF */ extern FILE *backup_fopen (char *filename, char *option); /* (filename, option) char *filename; char *option; */
17650 +/* unixfsys.c:359:OF */ extern FILE *fopen_not_dir (char *filename, char *option); /* (filename, option) char *filename; char *option; */
17651 +/* unixfsys.c:372:OF */ extern int file_len (FILE *fp); /* (fp) FILE *fp; */
17652 +/* unixfsys.c:382:OF */ extern object truename (object); /* () */
17653 +/* unixfsys.c:382:OF */ extern void Ltruename (void); /* () */
17654 +/* unixfsys.c:418:OF */ extern object fSsetenv (object variable, object value); /* (variable, value) object variable; object value; */
17655 +/* unixfsys.c:442:OF */ extern object fLdelete_file (object path); /* (path) object path; */
17656 +/* unixfsys.c:456:OF */ extern void Lprobe_file (void); /* () */
17657 +/* unixfsys.c:533:OF */ extern void Ldirectory (void); /* () */
17658 +/* unixfsys.c:777:OF */ extern void gcl_init_unixfsys (void); /* () */
17659 +/* unixsave.c:173:OF */ extern void gcl_init_unixsave (void); /* () */
17660 +/* unixsys.c:83:OF */ extern object fSgetpid (void); /* () */
17661 +/* unixsys.c:87:OF */ extern void gcl_init_unixsys (void); /* () */
17662 +/* unixtime.c:67:OF */ extern int runtime (void); /* () */
17663 +/* unixtime.c:82:OF */ extern object unix_time_to_universal_time (int i); /* (i) int i; */
17664 +/* unixtime.c:99:OF */ extern object fLget_universal_time (void); /* () */
17665 +/* unixtime.c:144:OF */ extern object fLget_internal_real_time (void); /* () */
17666 +/* unixtime.c:173:OF */ extern void gcl_init_unixtime (void); /* () */
17667 +/* user_init.c:2:OF */ extern object user_init (void); /* () */
17668 +/* user_init.c:2:OF */ extern int user_match (const char *,int n); /* () */
17669 +/* usig.c:49:OF */ extern void gcl_signal (int signo, void (*handler) (/* ??? */)); /* (signo, handler) int signo; void (*handler)(); */
17670 +/* usig.c:92:OF */ extern int unblock_signals (int n, int m); /* (n, m) int n; int m; */
17671 +/* usig.c:119:OF */ extern void unblock_sigusr_sigio (void); /* () */
17672 +/* usig.c:182:OF */ extern void install_default_signals (void); /* () */
17673 +/* usig2.c:142:OF */ extern void gcl_init_safety (void); /* () */
17674 +/* usig2.c:158:OF */ extern object sSsignal_safety_required (fixnum signo,fixnum safety); /* (signo, safety) int signo; int safety; */
17675 +#ifdef __MINGW32__
17676 +/* usig2.c:167:OF */ extern void main_signal_handler (int signo); /* (signo) int signo */
17677 +#else
17678 +/* usig2.c:167:OF */ extern void main_signal_handler (int signo, int a, int b); /* (signo, a, b) int signo; int a; int b; */
17679 +#endif
17680 +/* usig2.c:375:OF */ extern void raise_pending_signals (int cond); /* (cond) int cond; */
17681 +/* usig2.c:407:OF */ extern object fSallow_signal (fixnum n); /* (n) int n; */
17682 +/* utils.c:12:OF */ extern object IisSymbol (object f); /* (f) object f; */
17683 +/* utils.c:20:OF */ extern object IisFboundp (object f); /* (f) object f; */
17684 +/* utils.c:30:OF */ extern object IisArray (object f); /* (f) object f; */
17685 +/* utils.c:44:OF */ extern object Iis_fixnum (object f); /* (f) object f; */
17686 +/* utils.c:61:OF */ extern object Iapply_ap_new (object (*f) (/* ??? */), object first, va_list ap); /* (f, ap) object (*f)(); va_list ap; */
17687 +/* utils.c:178:OF */ extern object Icheck_one_type (object x, enum type t); /* (x, t) object x; enum type t; */
17688 +/* utils.c:189:OF */ extern object fSincorrect_type (object val, object type); /* (val, type) object val; object type; */
17689 +/* utils.c:202:OF */ extern object Ivs_values (void); /* () */
17690 +/* utils.c:227:OF */ extern char *lisp_copy_to_null_terminated (object string, char *buf, int n); /* (string, buf, n) object string; char *buf; int n; */
17691 +
17692 +
17693 +/* readline.d */
17694 +extern int readline_on;
17695 +void
17696 +gcl_init_readline_function(void);
17697 +
17698 +/* sys_gcl.c */
17699 +void
17700 +gcl_init_init(void);
17701 +
17702 +/* misc */
17703 +void
17704 +gcl_init_symbol(void);
17705 +
17706 +void
17707 +gcl_init_package(void);
17708 +
17709 +void
17710 +gcl_init_character(void);
17711 +
17712 +void
17713 +gcl_init_read(void);
17714 +
17715 +void
17716 +gcl_init_pathname(void);
17717 +
17718 +void
17719 +gcl_init_print(void);
17720 +
17721 +void
17722 +gcl_init_character_function(void);
17723 +
17724 +void
17725 +gcl_init_file_function(void);
17726 +
17727 +void
17728 +gcl_init_list_function(void);
17729 +
17730 +void
17731 +gcl_init_package_function(void);
17732 +
17733 +void
17734 +gcl_init_pathname_function(void);
17735 +
17736 +void
17737 +gcl_init_print_function(void);
17738 +
17739 +void
17740 +gcl_init_read_function(void);
17741 +
17742 +void
17743 +gcl_init_sequence_function(void);
17744 +
17745 +void
17746 +gcl_init_string_function(void);
17747 +
17748 +void
17749 +gcl_init_symbol_function(void);
17750 +
17751 +void
17752 +gcl_init_socket_function(void);
17753 +
17754 +void
17755 +gcl_init_hash(void);
17756 +
17757 +void
17758 +import(object,object);
17759 +
17760 +void
17761 +export(object,object);
17762 +
17763 +void
17764 +NewInit(void);
17765 +
17766 +void
17767 +gcl_init_system(object);
17768 +
17769 +void
17770 +set_up_string_register(char *);
17771 +
17772 +bool
17773 +endp1(object);
17774 +
17775 +void
17776 +stack_cons(void);
17777 +
17778 +bool
17779 +char_equal(object,object);
17780 +
17781 +bool
17782 +string_equal(object,object);
17783 +
17784 +bool
17785 +string_eq(object,object);
17786 +
17787 +bool
17788 +remf(object *,object);
17789 +
17790 +bool
17791 +keywordp(object);
17792 +
17793 +int
17794 +pack_hash(object);
17795 +
17796 +void
17797 +load(const char *);
17798 +
17799 +bool
17800 +member_eq(object,object);
17801 +
17802 +void
17803 +delete_eq(object,object *);
17804 +
17805 +int
17806 +length(object);
17807 +
17808 +int
17809 +rl_getc_em(FILE *);
17810 +
17811 +void
17812 +setupPRINTdefault(object);
17813 +
17814 +void
17815 +write_str(char *);
17816 +
17817 +void
17818 +write_object(object,int);
17819 +
17820 +void
17821 +cleanupPRINT(void);
17822 +
17823 +int
17824 +fasload(object);
17825 +
17826 +int
17827 +readc_stream(object);
17828 +
17829 +void
17830 +unreadc_stream(int,object);
17831 +
17832 +void
17833 +end_of_stream(object);
17834 +
17835 +bool
17836 +stream_at_end(object);
17837 +
17838 +int
17839 +digitp(int,int);
17840 +
17841 +bool
17842 +char_eq(object,object);
17843 +
17844 +bool
17845 +listen_stream(object);
17846 +
17847 +void
17848 +get_string_start_end(object,object,object,int *,int *);
17849 +
17850 +int
17851 +file_column(object);
17852 +
17853 +int
17854 +writec_stream(int,object);
17855 +
17856 +int
17857 +digit_weight(int,int);
17858 +
17859 +void
17860 +flush_stream(object);
17861 +
17862 +void
17863 +writestr_stream(char *,object);
17864 +
17865 +void
17866 +write_string(object,object);
17867 +
17868 +void
17869 +edit_double(int, double, int *, char *, int *);
17870 +
17871 +void
17872 +sethash(object,object,object);
17873 +
17874 +int
17875 +file_position(object);
17876 +
17877 +int
17878 +file_position_set(object, int);
17879 +
17880 +void
17881 +princ_str(char *s, object);
17882 +
17883 +void
17884 +close_stream(object);
17885 +
17886 +void
17887 +build_symbol_table(void);
17888 +
17889 +void
17890 +gcl_init_file(void);
17891 +
17892 +object
17893 +aset1(object,fixnum,object);
17894 +
17895 +void
17896 +dfprintf(FILE *,char *,...);
17897 +
17898 +void
17899 +Lmake_list(void);
17900 +
17901 +void
17902 +Llast(void);
17903 +
17904 +void
17905 +Lgensym(void);
17906 +
17907 +void
17908 +Lldiff(void);
17909 +
17910 +void
17911 +Lintern(void);
17912 +
17913 +void
17914 +Lgensym(void);
17915 +
17916 +void
17917 +Lldiff(void);
17918 +
17919 +void
17920 +Lgensym(void);
17921 +
17922 +void
17923 +Lintern(void);
17924 +
17925 +void
17926 +Lintern(void);
17927 +
17928 +void
17929 +Lreconc(void);
17930 +
17931 +void
17932 +Lmember(void);
17933 +
17934 +void
17935 +Ladjoin(void);
17936 +
17937 +void
17938 +Llist(void);
17939 +
17940 +void
17941 +Lappend(void);
17942 +
17943 +void
17944 +Lread(void);
17945 +
17946 +void
17947 +Lread_char(void);
17948 +
17949 +void
17950 +Lchar_eq(void);
17951 +
17952 +void
17953 +Lwrite_char(void);
17954 +
17955 +void
17956 +Lforce_output(void);
17957 +
17958 +void
17959 +Lchar_neq(void);
17960 +
17961 +void
17962 +Llist(void);
17963 +
17964 +void
17965 +Lwrite(void);
17966 +
17967 +void
17968 +Lfresh_line(void);
17969 +
17970 +void
17971 +Lsymbol_package(void);
17972 +
17973 +void
17974 +Lfind_package(void);
17975 +
17976 +void
17977 +Lfind_symbol(void);
17978 +
17979 +void
17980 +Lpackage_name(void);
17981 +
17982 +void
17983 +Lsymbol_plist(void);
17984 +
17985 +void
17986 +Lpackage_nicknames(void);
17987 +
17988 +void
17989 +Lpackage_use_list(void);
17990 +
17991 +void
17992 +Lpackage_used_by_list(void);
17993 +
17994 +void
17995 +Lstandard_char_p(void);
17996 +
17997 +void
17998 +Lstring_char_p(void);
17999 +
18000 +void
18001 +Lchar_code(void);
18002 +
18003 +void
18004 +Lchar_bits(void);
18005 +
18006 +void
18007 +Lchar_font(void);
18008 +
18009 +void
18010 +Lread_line(void);
18011 +
18012 +void
18013 +siLpackage_internal(void);
18014 +
18015 +void
18016 +siLpackage_external(void);
18017 +
18018 +void
18019 +Llist_all_packages(void);
18020 +
18021 +void
18022 +Lgensym(void);
18023 +
18024 +void
18025 +Lread(void);
18026 +
18027 +void
18028 +Lwrite(void);
18029 +
18030 +void
18031 +Lstring_equal(void);
18032 +
18033 +void
18034 +Lclose(void);
18035 +
18036 +void
18037 +Lnamestring(void);
18038 +
18039 +void
18040 +Lmake_echo_stream(void);
18041 +
18042 +void
18043 +Lmake_broadcast_stream(void);
18044 +
18045 +void
18046 +Lmake_two_way_stream(void);
18047 +
18048 +void
18049 +Lbutlast(void);
18050 +
18051 +void
18052 +Ladjoin(void);
18053 +
18054 +void
18055 +Lstring_downcase(void);
18056 +
18057 +void
18058 +Lmember(void);
18059 +
18060 +void
18061 +Lgensym(void);
18062 +
18063 +void
18064 +Llist_all_packages(void);
18065 +
18066 +void
18067 +Lfind_symbol(void);
18068 +
18069 +void
18070 +Lstring_equal(void);
18071 +
18072 +void
18073 +Lfind_package(void);
18074 +
18075 +void
18076 +siLpackage_internal(void);
18077 +
18078 +void
18079 +siLpackage_external(void);
18080 +
18081 +void
18082 +Lpackage_use_list(void);
18083 +
18084 +void
18085 +Lreconc(void);
18086 +
18087 +void
18088 +Lstandard_char_p(void);
18089 +
18090 +void
18091 +Lstring_char_p(void);
18092 +
18093 +void
18094 +Lcharacter(void);
18095 +
18096 +void
18097 +Llength(void);
18098 +
18099 +void
18100 +Lreconc(void);
18101 +
18102 +void
18103 +Llength(void);
18104 +
18105 +void
18106 +Lgensym(void);
18107 +
18108 +void
18109 +Llist_length(void);
18110 +
18111 +void
18112 +Lgensym(void);
18113 +
18114 +void
18115 +Lbutlast(void);
18116 +
18117 +void
18118 +Lnconc(void);
18119 +
18120 +void
18121 +Lfind_package(void);
18122 +
18123 +void
18124 +Lpackage_name(void);
18125 +
18126 +void
18127 +Llist(void);
18128 +
18129 +void
18130 +Lfresh_line(void);
18131 +
18132 +void
18133 +Lread_char(void);
18134 +
18135 +void
18136 +Lunread_char(void);
18137 +
18138 +void
18139 +Lread_line(void);
18140 +
18141 +void
18142 +Lread(void);
18143 +
18144 +void
18145 +Lforce_output(void);
18146 +
18147 +void
18148 +Lwrite(void);
18149 +
18150 +void
18151 +Lmember(void);
18152 +
18153 +void
18154 +siLpackage_internal(void);
18155 +
18156 +void
18157 +siLpackage_external(void);
18158 +
18159 +void
18160 +Lmake_pathname(void);
18161 +
18162 +void
18163 +Lnamestring(void);
18164 +
18165 +void
18166 +Lclose(void);
18167 +
18168 +void
18169 +Lgensym(void);
18170 +
18171 +void
18172 +Lfresh_line(void);
18173 +
18174 +void
18175 +Llist(void);
18176 +
18177 +void
18178 +Lread_char(void);
18179 +
18180 +void
18181 +Lchar_eq(void);
18182 +
18183 +void
18184 +Lfinish_output(void);
18185 +
18186 +void
18187 +Lchar_neq(void);
18188 +
18189 +void
18190 +Lwrite(void);
18191 +
18192 +void
18193 +Lgensym(void);
18194 +
18195 +void
18196 +Lmember(void);
18197 +
18198 +void
18199 +Lappend(void);
18200 +
18201 +void
18202 +Lcopy_tree(void);
18203 +
18204 +void
18205 +Ladjoin(void);
18206 +
18207 +void
18208 +Lgetf(void);
18209 +
18210 +void
18211 +Lsubst(void);
18212 +
18213 +void
18214 +Lsymbol_package(void);
18215 +
18216 +void
18217 +Lcopy_list(void);
18218 +
18219 +void
18220 +Lintern(void);
18221 +
18222 +void
18223 +Lfind_package(void);
18224 +
18225 +void
18226 +LlistA(void);
18227 +
18228 +void
18229 +Llist(void);
18230 +
18231 +void
18232 +Lgetf(void);
18233 +
18234 +void
18235 +Lstreamp(void);
18236 +
18237 +void
18238 +Lpeek_char(void);
18239 +
18240 +void
18241 +Lread_char(void);
18242 +
18243 +void
18244 +Lread_line(void);
18245 +
18246 +void
18247 +Lset_macro_character(void);
18248 +
18249 +void
18250 +Lclrhash(void);
18251 +
18252 +void
18253 +siLhash_set(void);
18254 +
18255 +void
18256 +Lgethash(void);
18257 +
18258 +void
18259 +Lremhash(void);
18260 +
18261 +void
18262 +Llist_all_packages(void);
18263 +
18264 +void
18265 +Lintern(void);
18266 +
18267 +void
18268 +Lunintern(void);
18269 +
18270 +void
18271 +Lsubseq(void);
18272 +
18273 +void
18274 +Lsymbol_package(void);
18275 +
18276 +void
18277 +Lfind_package(void);
18278 +
18279 +void
18280 +siLpackage_internal(void);
18281 +
18282 +void
18283 +siLpackage_external(void);
18284 +
18285 +void
18286 +Lread_char(void);
18287 +
18288 +void
18289 +Lfile_length(void);
18290 +
18291 +void
18292 +Lfile_position(void);
18293 +
18294 +void
18295 +Lclose(void);
18296 +
18297 +void
18298 +Lsubseq(void);
18299 +
18300 +void
18301 +Lnamestring(void);
18302 +
18303 +void
18304 +Lmerge_pathnames(void);
18305 +
18306 +void
18307 +Lcopy_list(void);
18308 +
18309 +void
18310 +Lread_line(void);
18311 +
18312 +void
18313 +Lgensym(void);
18314 +
18315 +void
18316 +Lcopy_list(void);
18317 +
18318 +void
18319 +Lintern(void);
18320 +
18321 +void
18322 +Lappend(void);
18323 +
18324 +void
18325 +Lgensym(void);
18326 +
18327 +void
18328 +Lcopy_list(void);
18329 +
18330 +void
18331 +Lmember(void);
18332 +
18333 +void
18334 +Lintern(void);
18335 +
18336 +void
18337 +Lappend(void);
18338 +
18339 +void
18340 +Lfind_package(void);
18341 +
18342 +void
18343 +Lpackage_name(void);
18344 +
18345 +void
18346 +Lpackage_nicknames(void);
18347 +
18348 +void
18349 +Lpackage_use_list(void);
18350 +
18351 +void
18352 +siLpackage_external(void);
18353 +
18354 +void
18355 +siLpackage_internal(void);
18356 +
18357 +void
18358 +Lsymbol_package(void);
18359 +
18360 +void
18361 +Lappend(void);
18362 +
18363 +void
18364 +Lgentemp(void);
18365 +
18366 +void
18367 +Lgensym(void);
18368 +
18369 +void
18370 +Lassoc(void);
18371 +
18372 +void
18373 +Ladjoin(void);
18374 +
18375 +void
18376 +Lstring_eq(void);
18377 +
18378 +void
18379 +Lmember(void);
18380 +
18381 +void
18382 +Lgethash(void);
18383 +
18384 +void
18385 +Lfinish_output(void);
18386 +
18387 +void
18388 +Lread(void);
18389 +
18390 +void
18391 +Lmake_hash_table(void);
18392 +
18393 +void
18394 +siLhash_set(void);
18395 +
18396 +void
18397 +Lrevappend(void);
18398 +
18399 +void
18400 +Lreconc(void);
18401 +
18402 +void
18403 +Lcopy_list(void);
18404 +
18405 +void
18406 +LlistA(void);
18407 +
18408 +void
18409 +Lfind_package(void);
18410 +
18411 +void
18412 +siLpackage_internal(void);
18413 +
18414 +void
18415 +siLpackage_external(void);
18416 +
18417 +void
18418 +princ_char(int,object);
18419 +
18420 +void
18421 +Ldigit_char_p(void);
18422 +
18423 +void
18424 +Lwrite_byte(void);
18425 +
18426 +void
18427 +unlink_loaded_files(void);
18428 +
18429 +void
18430 +FEpackage_error(object,const char *s);
18431 +
18432 +int
18433 +system_time_zone_helper(void);
18434 +
18435 +object
18436 +call_proc_new(object,void **,int,object,va_list);
18437 +
18438 +object
18439 +call_vproc_new(object,void *,object,va_list);
18440 +
18441 +void
18442 +funcall_with_catcher(object, object);
18443 +
18444 +void
18445 +siLset_symbol_plist(void);
18446 +
18447 +void
18448 +Lhash_table_p(void);
18449 +
18450 +void
18451 +Lreadtablep(void);
18452 +
18453 +int
18454 +fixnum_expt(int, int);
18455 +
18456 +void
18457 +check_alist(object);
18458 +
18459 +void
18460 +ck_larg_at_least(int,object);
18461 +
18462 +void
18463 +vfun_wrong_number_of_args(object);
18464 +
18465 +/* FIXME from lfun_list.lsp -- should be automatically generated */
18466 +void Lgensym(void);
18467 +void Lsubseq(void);
18468 +void Lminusp(void);
18469 +void Linteger_decode_float(void);
18470 +void Lminus(void);
18471 +void Lint_char(void);
18472 +void Lchar_int(void);
18473 +void Lall_different(void);
18474 +void Lcopy_seq(void);
18475 +void Lkeywordp(void);
18476 +void Lname_char(void);
18477 +void Lchar_name(void);
18478 +void Lrassoc_if(void);
18479 +void Lmake_list(void);
18480 +void Lhost_namestring(void);
18481 +void Lmake_echo_stream(void);
18482 +void Lnth(void);
18483 +void Lsin(void);
18484 +void Lnumerator(void);
18485 +void Larray_rank(void);
18486 +void Lcaar(void);
18487 +void Lboth_case_p(void);
18488 +void Lnull(void);
18489 +void Lrename_file(void);
18490 +void Lfile_author(void);
18491 +void Lstring_capitalize(void);
18492 +void Lmacroexpand(void);
18493 +void Lnconc(void);
18494 +void Lboole(void);
18495 +void Ltailp(void);
18496 +void Lconsp(void);
18497 +void Llistp(void);
18498 +void Lmapcan(void);
18499 +void Llength(void);
18500 +void Lrassoc(void);
18501 +void Lpprint(void);
18502 +void Lpathname_host(void);
18503 +void Lnsubst_if_not(void);
18504 +void Lfile_position(void);
18505 +void Lstring_l(void);
18506 +void Lreverse(void);
18507 +void Lstreamp(void);
18508 +void siLputprop(void);
18509 +void Lremprop(void);
18510 +void Lsymbol_package(void);
18511 +void Lnstring_upcase(void);
18512 +void Lstring_ge(void);
18513 +void Lrealpart(void);
18514 +void Lnbutlast(void);
18515 +void Larray_dimension(void);
18516 +void Lcdr(void);
18517 +void Leql(void);
18518 +void Llog(void);
18519 +void Ldirectory(void);
18520 +void Lstring_not_equal(void);
18521 +void Lshadowing_import(void);
18522 +void Lmapc(void);
18523 +void Lmapl(void);
18524 +void Lmakunbound(void);
18525 +void Lcons(void);
18526 +void Llist(void);
18527 +void Luse_package(void);
18528 +void Lfile_length(void);
18529 +void Lmake_symbol(void);
18530 +void Lstring_right_trim(void);
18531 +void Lenough_namestring(void);
18532 +void Lprint(void);
18533 +void Lcddaar(void);
18534 +void Lcdadar(void);
18535 +void Lcdaadr(void);
18536 +void Lcaddar(void);
18537 +void Lcadadr(void);
18538 +void Lcaaddr(void);
18539 +void Lset_macro_character(void);
18540 +void Lforce_output(void);
18541 +void Lnthcdr(void);
18542 +void Llogior(void);
18543 +void Lchar_downcase(void);
18544 +void Lstring_char_p(void);
18545 +void Lstream_element_type(void);
18546 +void Lpackage_used_by_list(void);
18547 +void Ldivide(void);
18548 +void Lmaphash(void);
18549 +void Lstring_eq(void);
18550 +void Lpairlis(void);
18551 +void Lsymbolp(void);
18552 +void Lchar_not_lessp(void);
18553 +void Lone_plus(void);
18554 +void Lby(void);
18555 +void Lnsubst_if(void);
18556 +void Lcopy_list(void);
18557 +void Ltan(void);
18558 +void Lset(void);
18559 +void Lfunctionp(void);
18560 +void Lwrite_byte(void);
18561 +void Llast(void);
18562 +void Lmake_string(void);
18563 +void Lcaaar(void);
18564 +void Llist_length(void);
18565 +void Lcdddr(void);
18566 +void Lprin1(void);
18567 +void Lprinc(void);
18568 +void Llower_case_p(void);
18569 +void Lchar_le(void);
18570 +void Lstring_equal(void);
18571 +void Lclear_output(void);
18572 +void CERROR(void);
18573 +void Lterpri(void);
18574 +void Lnsubst(void);
18575 +void Lunuse_package(void);
18576 +void Lstring_not_greaterp(void);
18577 +void Lstring_g(void);
18578 +void Lfinish_output(void);
18579 +void Lspecial_form_p(void);
18580 +void Lstringp(void);
18581 +void Lget_internal_run_time(void);
18582 +void Ltruncate(void);
18583 +void Lcode_char(void);
18584 +void Lchar_code(void);
18585 +void Lsimple_string_p(void);
18586 +void Lrevappend(void);
18587 +void Lhash_table_count(void);
18588 +void Lpackage_use_list(void);
18589 +void Lrem(void);
18590 +void Lmin(void);
18591 +void Lapplyhook(void);
18592 +void Lexp(void);
18593 +void Lchar_lessp(void);
18594 +void Lcdar(void);
18595 +void Lcadr(void);
18596 +void Llist_all_packages(void);
18597 +void Lcdr(void);
18598 +void Lcopy_symbol(void);
18599 +void Lacons(void);
18600 +void Ladjustable_array_p(void);
18601 +void Lsvref(void);
18602 +void Lapply(void);
18603 +void Ldecode_float(void);
18604 +void Lsubst_if_not(void);
18605 +void Lrplaca(void);
18606 +void Lsymbol_plist(void);
18607 +void Lwrite_string(void);
18608 +void Llogeqv(void);
18609 +void Lstring(void);
18610 +void Lstring_upcase(void);
18611 +void Lceiling(void);
18612 +void Lgethash(void);
18613 +void Ltype_of(void);
18614 +void Lbutlast(void);
18615 +void Lone_minus(void);
18616 +void Lmake_hash_table(void);
18617 +void Lstring_neq(void);
18618 +void Lmonotonically_nondecreasing(void);
18619 +void Lmake_broadcast_stream(void);
18620 +void Limagpart(void);
18621 +void Lintegerp(void);
18622 +void Lread_char(void);
18623 +void Lpeek_char(void);
18624 +void Lchar_font(void);
18625 +void Lstring_greaterp(void);
18626 +void Loutput_stream_p(void);
18627 +void Lash(void);
18628 +void Llcm(void);
18629 +void Lelt(void);
18630 +void Lcos(void);
18631 +void Lnstring_downcase(void);
18632 +void Lcopy_alist(void);
18633 +void Latan(void);
18634 +void Ldelete_file(void);
18635 +void Lfloat_radix(void);
18636 +void Lsymbol_name(void);
18637 +void Lclear_input(void);
18638 +void Lfind_symbol(void);
18639 +void Lchar_l(void);
18640 +void Lhash_table_p(void);
18641 +void Levenp(void);
18642 +void siLcmod(void);
18643 +void siLcplus(void);
18644 +void siLctimes(void);
18645 +void siLcdifference(void);
18646 +void Lzerop(void);
18647 +void Lcaaaar(void);
18648 +void Lchar_ge(void);
18649 +void Lcdddar(void);
18650 +void Lcddadr(void);
18651 +void Lcdaddr(void);
18652 +void Lcadddr(void);
18653 +void Lfill_pointer(void);
18654 +void Lmapcar(void);
18655 +void Lfloatp(void);
18656 +void Lshadow(void);
18657 +void Lmacroexpand_1(void);
18658 +void Lsxhash(void);
18659 +void Llisten(void);
18660 +void Larrayp(void);
18661 +void Lmake_pathname(void);
18662 +void Lpathname_type(void);
18663 +void Lfuncall(void);
18664 +void Lclrhash(void);
18665 +void Lgraphic_char_p(void);
18666 +void Lfboundp(void);
18667 +void Lnsublis(void);
18668 +void Lchar_not_equal(void);
18669 +void Lmacro_function(void);
18670 +void Lsubst_if(void);
18671 +void Lcomplexp(void);
18672 +void Lread_line(void);
18673 +void Lpathnamep(void);
18674 +void Lmax(void);
18675 +void Lin_package(void);
18676 +void Lreadtablep(void);
18677 +void Lfloat_sign(void);
18678 +void Lcharacterp(void);
18679 +void Lread(void);
18680 +void Lnamestring(void);
18681 +void Lunread_char(void);
18682 +void Lcdaar(void);
18683 +void Lcadar(void);
18684 +void Lcaadr(void);
18685 +void Lchar_eq(void);
18686 +void Lalpha_char_p(void);
18687 +void Lstring_trim(void);
18688 +void Lmake_package(void);
18689 +void Lclose(void);
18690 +void Ldenominator(void);
18691 +void Lfloat(void);
18692 +void Lcar(void);
18693 +void Lround(void);
18694 +void Lsubst(void);
18695 +void Lupper_case_p(void);
18696 +void Larray_element_type(void);
18697 +void Ladjoin(void);
18698 +void Llogand(void);
18699 +void Lmapcon(void);
18700 +void Lintern(void);
18701 +void Lvalues(void);
18702 +void Lexport(void);
18703 +void Ltimes(void);
18704 +void Lmonotonically_increasing(void);
18705 +void Lcomplex(void);
18706 +void Lset_syntax_from_char(void);
18707 +void Lchar_bit(void);
18708 +void Linteger_length(void);
18709 +void Lpackagep(void);
18710 +void Linput_stream_p(void);
18711 +void Lmonotonically_nonincreasing(void);
18712 +void Lpathname(void);
18713 +void Leq(void);
18714 +void Lmake_char(void);
18715 +void Lfile_namestring(void);
18716 +void Lcharacter(void);
18717 +void Lsymbol_function(void);
18718 +void Lconstantp(void);
18719 +void Lchar_equal(void);
18720 +void Ltree_equal(void);
18721 +void Lcddr(void);
18722 +void Lgetf(void);
18723 +void Lsave(void);
18724 +void Lmake_random_state(void);
18725 +void Lchar_not_greaterp(void);
18726 +void Lexpt(void);
18727 +void Lsqrt(void);
18728 +void Lscale_float(void);
18729 +void Lchar_g(void);
18730 +void Lldiff(void);
18731 +void Lassoc_if_not(void);
18732 +void Lbit_vector_p(void);
18733 +void Lnstring_capitalize(void);
18734 +void Lsymbol_value(void);
18735 +void Lrplacd(void);
18736 +void Lboundp(void);
18737 +void Lequalp(void);
18738 +void Lsimple_bit_vector_p(void);
18739 +void Lmember_if_not(void);
18740 +void Lmake_two_way_stream(void);
18741 +void Lparse_integer(void);
18742 +void Lplus(void);
18743 +void Lall_the_same(void);
18744 +void Lgentemp(void);
18745 +void Lrename_package(void);
18746 +void Lcommonp(void);
18747 +void Lnumberp(void);
18748 +void Lcopy_readtable(void);
18749 +void Lrandom_state_p(void);
18750 +void Ldirectory_namestring(void);
18751 +void Lstandard_char_p(void);
18752 +void Ltruename(void);
18753 +void Lidentity(void);
18754 +void Lnreverse(void);
18755 +void Lpathname_device(void);
18756 +void Lunintern(void);
18757 +void Lunexport(void);
18758 +void Lfloat_precision(void);
18759 +void Lstring_downcase(void);
18760 +void Lcar(void);
18761 +void Lconjugate(void);
18762 +void Lnull(void);
18763 +void Lread_char_no_hang(void);
18764 +void Lfresh_line(void);
18765 +void Lwrite_char(void);
18766 +void Lparse_namestring(void);
18767 +void Lstring_not_lessp(void);
18768 +void Lchar(void);
18769 +void Laref(void);
18770 +void Lpackage_nicknames(void);
18771 +void Lendp(void);
18772 +void Loddp(void);
18773 +void Lchar_upcase(void);
18774 +void LlistA(void);
18775 +void Lvalues_list(void);
18776 +void Lequal(void);
18777 +void Ldigit_char_p(void);
18778 +void ERROR(void);
18779 +void Lchar_neq(void);
18780 +void Lpathname_directory(void);
18781 +void Lcdaaar(void);
18782 +void Lcadaar(void);
18783 +void Lcaadar(void);
18784 +void Lcaaadr(void);
18785 +void Lcddddr(void);
18786 +void Lget_macro_character(void);
18787 +void Lformat(void);
18788 +void Lcompiled_function_p(void);
18789 +void Lsublis(void);
18790 +void Lpathname_name(void);
18791 +void Limport(void);
18792 +void Llogxor(void);
18793 +void Lrassoc_if_not(void);
18794 +void Lchar_greaterp(void);
18795 +void Lmake_synonym_stream(void);
18796 +void Lalphanumericp(void);
18797 +void Lremhash(void);
18798 +void Lreconc(void);
18799 +void Lmonotonically_decreasing(void);
18800 +void Llogbitp(void);
18801 +void Lmaplist(void);
18802 +void Lvectorp(void);
18803 +void Lassoc_if(void);
18804 +void Lget_properties(void);
18805 +void Lstring_le(void);
18806 +void Levalhook(void);
18807 +void Lfile_write_date(void);
18808 +void Llogcount(void);
18809 +void Lmerge_pathnames(void);
18810 +void Lmember_if(void);
18811 +void Lread_byte(void);
18812 +void Lsimple_vector_p(void);
18813 +void Lchar_bits(void);
18814 +void Lcopy_tree(void);
18815 +void Lgcd(void);
18816 +void Lby(void);
18817 +void Lget(void);
18818 +void Lmod(void);
18819 +void Ldigit_char(void);
18820 +void Lprobe_file(void);
18821 +void Lstring_left_trim(void);
18822 +void Lpathname_version(void);
18823 +void Lwrite_line(void);
18824 +void Leval(void);
18825 +void Latom(void);
18826 +void Lcddar(void);
18827 +void Lcdadr(void);
18828 +void Lcaddr(void);
18829 +void Lfmakunbound(void);
18830 +void Lsleep(void);
18831 +void Lpackage_name(void);
18832 +void Lfind_package(void);
18833 +void Lassoc(void);
18834 +void Lset_char_bit(void);
18835 +void Lfloor(void);
18836 +void Lwrite(void);
18837 +void Lplusp(void);
18838 +void Lfloat_digits(void);
18839 +void Lread_delimited_list(void);
18840 +void Lappend(void);
18841 +void Lmember(void);
18842 +void Lstring_lessp(void);
18843 +void Lrandom(void);
18844 +void siLspecialp(void);
18845 +void siLoutput_stream_string(void);
18846 +void siLstructurep(void);
18847 +void siLcopy_stream(void);
18848 +void siLinit_system(void);
18849 +void siLstring_to_object(void);
18850 +void siLreset_stack_limits(void);
18851 +void siLdisplaced_array_p(void);
18852 +void siLrplaca_nthcdr(void);
18853 +void siLlist_nth(void);
18854 +void siLmake_vector(void);
18855 +void siLaset(void);
18856 +void siLsvset(void);
18857 +void siLfill_pointer_set(void);
18858 +void siLreplace_array(void);
18859 +void siLfset(void);
18860 +void siLhash_set(void);
18861 +void Lboole(void);
18862 +void siLpackage_internal(void);
18863 +void siLpackage_external(void);
18864 +void siLelt_set(void);
18865 +void siLchar_set(void);
18866 +void siLmake_structure(void);
18867 +void siLstructure_name(void);
18868 +void siLstructure_ref(void);
18869 +void siLstructure_set(void);
18870 +void siLput_f(void);
18871 +void siLrem_f(void);
18872 +void siLset_symbol_plist(void);
18873 +void siLbit_array_op(void);
18874 +
18875 +object
18876 +cmod(object);
18877 +object
18878 +ctimes(object,object);
18879 +object
18880 +cdifference(object,object);
18881 +object
18882 +cplus(object,object);
18883 +
18884 +object
18885 +Icall_error_handler(object,object,int,...);
18886 +
18887 +void *
18888 +gcl_gmp_alloc(size_t);
18889 +
18890 +int
18891 +my_plt(const char *,unsigned long *);
18892 +
18893 +int
18894 +parse_plt(void);
18895 +
18896 +int
18897 +sgc_count_read_only_type(int);
18898 +
18899 +int
18900 +gcl_isnormal_double(double);
18901 +
18902 +int
18903 +gcl_isnormal_float(float);
18904 +
18905 +object
18906 +find_init_name1(char *,unsigned);
18907 +
18908 +#ifdef SGC
18909 +void
18910 +memprotect_test_reset(void);
18911 +#endif
18912 +
18913 +
18914 +#if defined (__MINGW32__)
18915 +int bcmp ( const void *s1, const void *s2, size_t n );
18916 +void bcopy ( const void *s1, void *s2, size_t n );
18917 +void bzero(void *b, size_t length);
18918 +int TcpOutputProc ( int fd, char *buf, int toWrite, int *errorCodePtr, int block );
18919 +void recreate_heap1 ( void );
18920 +void gcl_init_shared_memory ( void );
18921 +void fix_filename ( object pathname, char *filename1 );
18922 +void alarm ( int n );
18923 +void *sbrk ( unsigned long increment );
18924 +void sigemptyset( sigset_t *set);
18925 +void sigaddset ( sigset_t *set, int n);
18926 +int sigismember ( sigset_t *set, int n );
18927 +int sigprocmask ( int how, const sigset_t *set, sigset_t *oldset );
18928 +#endif
18929 +
18930 +#ifdef GCL_GPROF
18931 +void
18932 +gprof_cleanup(void);
18933 +#endif
18934 +
18935 +int
18936 +msystem(const char *);
18937 +
18938 +void
18939 +assert_error(const char *,unsigned,const char *,const char *);
18940 +
18941 +#ifdef _WIN32
18942 +void
18943 +detect_wine(void);
18944 +
18945 +void
18946 +init_shared_memory(void);
18947 +
18948 +void *
18949 +alloca(size_t);
18950 +
18951 +object
18952 +find_init_string(const char *);
18953 +
18954 +#endif
18955 +
18956 +void *
18957 +get_mmap(FILE *,void **);
18958 +
18959 +int
18960 +un_mmap(void *,void *);
18961 +
18962 +object
18963 +fSuse_fast_links_2(object,object);
18964 +
18965 +MP_INT *
18966 +otoi(object);
18967 +void
18968 +isetq_fix(MP_INT *,int);
18969 +int
18970 +mpz_to_mpz1(MP_INT *,MP_INT *,void *);
18971 +int
18972 +mpz_to_mpz(MP_INT *,MP_INT *);
18973 +int
18974 +obj_to_mpz1(object,MP_INT *,void *);
18975 +int
18976 +obj_to_mpz(object,MP_INT *);
18977 +
18978 +
18979 +#include "f-ol-syntax.h"
18980 +void init_code(){do_init((void *)VV);}
18981 +/* function definition for Q-MK_ANTIQUOT */
18982 +
18983 +static void L1()
18984 +{register object *base=vs_base;
18985 + register object *sup=base+VM1; VC1
18986 + vs_check;
18987 + {object V1;
18988 + V1=(base[0]);
18989 + vs_top=sup;
18990 + goto TTL;
18991 +TTL:;
18992 + base[1]= make_cons(((object)VV[0]),(V1));
18993 + vs_top=(vs_base=base+1)+1;
18994 + return;
18995 + }
18996 +}
18997 +/* function definition for Q-MK_PRED */
18998 +
18999 +static void L2()
19000 +{register object *base=vs_base;
19001 + register object *sup=base+VM2; VC2
19002 + vs_check;
19003 + {object V2;
19004 + object V3;
19005 + V2=(base[0]);
19006 + V3=(base[1]);
19007 + vs_top=sup;
19008 + goto TTL;
19009 +TTL:;
19010 + base[4]= (V2);
19011 + vs_top=(vs_base=base+4)+1;
19012 + (void) (*Lnk66)();
19013 + vs_top=sup;
19014 + base[3]= vs_base[0];
19015 + vs_top=(vs_base=base+3)+1;
19016 + (void) (*Lnk67)();
19017 + vs_top=sup;
19018 + base[2]= vs_base[0];
19019 + base[4]= (V3);
19020 + vs_top=(vs_base=base+4)+1;
19021 + (void) (*Lnk68)();
19022 + vs_top=sup;
19023 + base[3]= vs_base[0];
19024 + vs_top=(vs_base=base+2)+2;
19025 + (void) (*Lnk69)();
19026 + vs_top=sup;
19027 + if((vs_base[0])==Cnil){
19028 + goto T2;}
19029 + base[2]= listA(3,((object)VV[1]),(V2),(V3));
19030 + vs_top=(vs_base=base+2)+1;
19031 + return;
19032 + goto T2;
19033 +T2:;
19034 + {frame_ptr fr;
19035 + fr=frs_sch_catch(((object)VV[2]));
19036 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19037 + base[2]= ((object)VV[3]);
19038 + vs_top=(vs_base=base+2)+1;
19039 + unwind(fr,((object)VV[2]));}
19040 + }
19041 +}
19042 +/* function definition for ML-IS_PRED */
19043 +
19044 +static void L3()
19045 +{register object *base=vs_base;
19046 + register object *sup=base+VM3; VC3
19047 + vs_check;
19048 + {object V4;
19049 + V4=(base[0]);
19050 + vs_top=sup;
19051 + goto TTL;
19052 +TTL:;
19053 + base[1]= ((CMPcar((V4)))==(((object)VV[1]))?Ct:Cnil);
19054 + vs_top=(vs_base=base+1)+1;
19055 + return;
19056 + }
19057 +}
19058 +/* function definition for ML-DEST_PRED */
19059 +
19060 +static void L4()
19061 +{register object *base=vs_base;
19062 + register object *sup=base+VM4; VC4
19063 + vs_check;
19064 + {object V5;
19065 + V5=(base[0]);
19066 + vs_top=sup;
19067 + goto TTL;
19068 +TTL:;
19069 + if(!(eql(CMPcar((V5)),((object)VV[1])))){
19070 + goto T11;}
19071 + base[1]= CMPcdr((V5));
19072 + vs_top=(vs_base=base+1)+1;
19073 + return;
19074 + goto T11;
19075 +T11:;
19076 + {frame_ptr fr;
19077 + fr=frs_sch_catch(((object)VV[2]));
19078 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19079 + base[1]= ((object)VV[4]);
19080 + vs_top=(vs_base=base+1)+1;
19081 + unwind(fr,((object)VV[2]));}
19082 + }
19083 +}
19084 +/* function definition for Q-MK_CONJ */
19085 +
19086 +static void L5()
19087 +{register object *base=vs_base;
19088 + register object *sup=base+VM5; VC5
19089 + vs_check;
19090 + {object V6;
19091 + object V7;
19092 + V6=(base[0]);
19093 + V7=(base[1]);
19094 + vs_top=sup;
19095 + goto TTL;
19096 +TTL:;
19097 + base[2]= listA(3,((object)VV[5]),(V6),(V7));
19098 + vs_top=(vs_base=base+2)+1;
19099 + return;
19100 + }
19101 +}
19102 +/* function definition for ML-IS_CONJ */
19103 +
19104 +static void L6()
19105 +{register object *base=vs_base;
19106 + register object *sup=base+VM6; VC6
19107 + vs_check;
19108 + {object V8;
19109 + V8=(base[0]);
19110 + vs_top=sup;
19111 + goto TTL;
19112 +TTL:;
19113 + base[1]= ((CMPcar((V8)))==(((object)VV[5]))?Ct:Cnil);
19114 + vs_top=(vs_base=base+1)+1;
19115 + return;
19116 + }
19117 +}
19118 +/* function definition for ML-DEST_CONJ */
19119 +
19120 +static void L7()
19121 +{register object *base=vs_base;
19122 + register object *sup=base+VM7; VC7
19123 + vs_check;
19124 + {object V9;
19125 + V9=(base[0]);
19126 + vs_top=sup;
19127 + goto TTL;
19128 +TTL:;
19129 + if(!(eql(CMPcar((V9)),((object)VV[5])))){
19130 + goto T15;}
19131 + base[1]= CMPcdr((V9));
19132 + vs_top=(vs_base=base+1)+1;
19133 + return;
19134 + goto T15;
19135 +T15:;
19136 + {frame_ptr fr;
19137 + fr=frs_sch_catch(((object)VV[2]));
19138 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19139 + base[1]= ((object)VV[6]);
19140 + vs_top=(vs_base=base+1)+1;
19141 + unwind(fr,((object)VV[2]));}
19142 + }
19143 +}
19144 +/* function definition for Q-MK_DISJ */
19145 +
19146 +static void L8()
19147 +{register object *base=vs_base;
19148 + register object *sup=base+VM8; VC8
19149 + vs_check;
19150 + {object V10;
19151 + object V11;
19152 + V10=(base[0]);
19153 + V11=(base[1]);
19154 + vs_top=sup;
19155 + goto TTL;
19156 +TTL:;
19157 + base[2]= listA(3,((object)VV[7]),(V10),(V11));
19158 + vs_top=(vs_base=base+2)+1;
19159 + return;
19160 + }
19161 +}
19162 +/* function definition for ML-IS_DISJ */
19163 +
19164 +static void L9()
19165 +{register object *base=vs_base;
19166 + register object *sup=base+VM9; VC9
19167 + vs_check;
19168 + {object V12;
19169 + V12=(base[0]);
19170 + vs_top=sup;
19171 + goto TTL;
19172 +TTL:;
19173 + base[1]= ((CMPcar((V12)))==(((object)VV[7]))?Ct:Cnil);
19174 + vs_top=(vs_base=base+1)+1;
19175 + return;
19176 + }
19177 +}
19178 +/* function definition for ML-DEST_DISJ */
19179 +
19180 +static void L10()
19181 +{register object *base=vs_base;
19182 + register object *sup=base+VM10; VC10
19183 + vs_check;
19184 + {object V13;
19185 + V13=(base[0]);
19186 + vs_top=sup;
19187 + goto TTL;
19188 +TTL:;
19189 + if(!(eql(CMPcar((V13)),((object)VV[7])))){
19190 + goto T19;}
19191 + base[1]= CMPcdr((V13));
19192 + vs_top=(vs_base=base+1)+1;
19193 + return;
19194 + goto T19;
19195 +T19:;
19196 + {frame_ptr fr;
19197 + fr=frs_sch_catch(((object)VV[2]));
19198 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19199 + base[1]= ((object)VV[8]);
19200 + vs_top=(vs_base=base+1)+1;
19201 + unwind(fr,((object)VV[2]));}
19202 + }
19203 +}
19204 +/* function definition for Q-MK_IMP */
19205 +
19206 +static void L11()
19207 +{register object *base=vs_base;
19208 + register object *sup=base+VM11; VC11
19209 + vs_check;
19210 + {object V14;
19211 + object V15;
19212 + V14=(base[0]);
19213 + V15=(base[1]);
19214 + vs_top=sup;
19215 + goto TTL;
19216 +TTL:;
19217 + base[2]= listA(3,((object)VV[9]),(V14),(V15));
19218 + vs_top=(vs_base=base+2)+1;
19219 + return;
19220 + }
19221 +}
19222 +/* function definition for ML-IS_IMP */
19223 +
19224 +static void L12()
19225 +{register object *base=vs_base;
19226 + register object *sup=base+VM12; VC12
19227 + vs_check;
19228 + {object V16;
19229 + V16=(base[0]);
19230 + vs_top=sup;
19231 + goto TTL;
19232 +TTL:;
19233 + base[1]= ((CMPcar((V16)))==(((object)VV[9]))?Ct:Cnil);
19234 + vs_top=(vs_base=base+1)+1;
19235 + return;
19236 + }
19237 +}
19238 +/* function definition for ML-DEST_IMP */
19239 +
19240 +static void L13()
19241 +{register object *base=vs_base;
19242 + register object *sup=base+VM13; VC13
19243 + vs_check;
19244 + {object V17;
19245 + V17=(base[0]);
19246 + vs_top=sup;
19247 + goto TTL;
19248 +TTL:;
19249 + if(!(eql(CMPcar((V17)),((object)VV[9])))){
19250 + goto T23;}
19251 + base[1]= CMPcdr((V17));
19252 + vs_top=(vs_base=base+1)+1;
19253 + return;
19254 + goto T23;
19255 +T23:;
19256 + {frame_ptr fr;
19257 + fr=frs_sch_catch(((object)VV[2]));
19258 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19259 + base[1]= ((object)VV[10]);
19260 + vs_top=(vs_base=base+1)+1;
19261 + unwind(fr,((object)VV[2]));}
19262 + }
19263 +}
19264 +/* function definition for Q-MK_NEG */
19265 +
19266 +static void L14()
19267 +{register object *base=vs_base;
19268 + register object *sup=base+VM14; VC14
19269 + vs_check;
19270 + {object V18;
19271 + V18=(base[0]);
19272 + vs_top=sup;
19273 + goto TTL;
19274 +TTL:;
19275 + base[1]= listA(3,((object)VV[9]),(V18),(((object)VV[11])->s.s_dbind));
19276 + vs_top=(vs_base=base+1)+1;
19277 + return;
19278 + }
19279 +}
19280 +/* function definition for Q-MK_FORALL */
19281 +
19282 +static void L15()
19283 +{register object *base=vs_base;
19284 + register object *sup=base+VM15; VC15
19285 + vs_check;
19286 + {object V19;
19287 + object V20;
19288 + V19=(base[0]);
19289 + V20=(base[1]);
19290 + vs_top=sup;
19291 + goto TTL;
19292 +TTL:;
19293 + {object V21;
19294 + base[2]= (V19);
19295 + vs_top=(vs_base=base+2)+1;
19296 + (void) (*Lnk70)();
19297 + vs_top=sup;
19298 + V21= vs_base[0];
19299 + base[2]= (V21);
19300 + vs_top=(vs_base=base+2)+1;
19301 + (void) (*Lnk71)();
19302 + vs_top=sup;
19303 + base[2]= (V21);
19304 + base[3]= (V20);
19305 + vs_top=(vs_base=base+2)+2;
19306 + (void) (*Lnk72)();
19307 + return;}
19308 + }
19309 +}
19310 +/* function definition for ML-MK_FORALL */
19311 +
19312 +static void L16()
19313 +{register object *base=vs_base;
19314 + register object *sup=base+VM16; VC16
19315 + vs_check;
19316 + {object V22;
19317 + object V23;
19318 + V22=(base[0]);
19319 + V23=(base[1]);
19320 + vs_top=sup;
19321 + goto TTL;
19322 +TTL:;
19323 + if(!((CMPcar((V22)))==(((object)VV[12])))){
19324 + goto T33;}
19325 + base[2]= listA(3,((object)VV[13]),(V22),(V23));
19326 + vs_top=(vs_base=base+2)+1;
19327 + return;
19328 + goto T33;
19329 +T33:;
19330 + {frame_ptr fr;
19331 + fr=frs_sch_catch(((object)VV[2]));
19332 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19333 + base[2]= ((object)VV[14]);
19334 + vs_top=(vs_base=base+2)+1;
19335 + unwind(fr,((object)VV[2]));}
19336 + }
19337 +}
19338 +/* function definition for ML-IS_FORALL */
19339 +
19340 +static void L17()
19341 +{register object *base=vs_base;
19342 + register object *sup=base+VM17; VC17
19343 + vs_check;
19344 + {object V24;
19345 + V24=(base[0]);
19346 + vs_top=sup;
19347 + goto TTL;
19348 +TTL:;
19349 + base[1]= ((CMPcar((V24)))==(((object)VV[13]))?Ct:Cnil);
19350 + vs_top=(vs_base=base+1)+1;
19351 + return;
19352 + }
19353 +}
19354 +/* function definition for ML-DEST_FORALL */
19355 +
19356 +static void L18()
19357 +{register object *base=vs_base;
19358 + register object *sup=base+VM18; VC18
19359 + vs_check;
19360 + {object V25;
19361 + V25=(base[0]);
19362 + vs_top=sup;
19363 + goto TTL;
19364 +TTL:;
19365 + if(!(eql(CMPcar((V25)),((object)VV[13])))){
19366 + goto T37;}
19367 + base[1]= CMPcdr((V25));
19368 + vs_top=(vs_base=base+1)+1;
19369 + return;
19370 + goto T37;
19371 +T37:;
19372 + {frame_ptr fr;
19373 + fr=frs_sch_catch(((object)VV[2]));
19374 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19375 + base[1]= ((object)VV[15]);
19376 + vs_top=(vs_base=base+1)+1;
19377 + unwind(fr,((object)VV[2]));}
19378 + }
19379 +}
19380 +/* function definition for Q-MK_EXISTS */
19381 +
19382 +static void L19()
19383 +{register object *base=vs_base;
19384 + register object *sup=base+VM19; VC19
19385 + vs_check;
19386 + {object V26;
19387 + object V27;
19388 + V26=(base[0]);
19389 + V27=(base[1]);
19390 + vs_top=sup;
19391 + goto TTL;
19392 +TTL:;
19393 + {object V28;
19394 + base[2]= (V26);
19395 + vs_top=(vs_base=base+2)+1;
19396 + (void) (*Lnk70)();
19397 + vs_top=sup;
19398 + V28= vs_base[0];
19399 + base[2]= (V28);
19400 + vs_top=(vs_base=base+2)+1;
19401 + (void) (*Lnk71)();
19402 + vs_top=sup;
19403 + base[2]= (V28);
19404 + base[3]= (V27);
19405 + vs_top=(vs_base=base+2)+2;
19406 + (void) (*Lnk73)();
19407 + return;}
19408 + }
19409 +}
19410 +/* function definition for ML-MK_EXISTS */
19411 +
19412 +static void L20()
19413 +{register object *base=vs_base;
19414 + register object *sup=base+VM20; VC20
19415 + vs_check;
19416 + {object V29;
19417 + object V30;
19418 + V29=(base[0]);
19419 + V30=(base[1]);
19420 + vs_top=sup;
19421 + goto TTL;
19422 +TTL:;
19423 + if(!((CMPcar((V29)))==(((object)VV[12])))){
19424 + goto T47;}
19425 + base[2]= listA(3,((object)VV[16]),(V29),(V30));
19426 + vs_top=(vs_base=base+2)+1;
19427 + return;
19428 + goto T47;
19429 +T47:;
19430 + {frame_ptr fr;
19431 + fr=frs_sch_catch(((object)VV[2]));
19432 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19433 + base[2]= ((object)VV[17]);
19434 + vs_top=(vs_base=base+2)+1;
19435 + unwind(fr,((object)VV[2]));}
19436 + }
19437 +}
19438 +/* function definition for ML-IS_EXISTS */
19439 +
19440 +static void L21()
19441 +{register object *base=vs_base;
19442 + register object *sup=base+VM21; VC21
19443 + vs_check;
19444 + {object V31;
19445 + V31=(base[0]);
19446 + vs_top=sup;
19447 + goto TTL;
19448 +TTL:;
19449 + base[1]= ((CMPcar((V31)))==(((object)VV[16]))?Ct:Cnil);
19450 + vs_top=(vs_base=base+1)+1;
19451 + return;
19452 + }
19453 +}
19454 +/* function definition for ML-DEST_EXISTS */
19455 +
19456 +static void L22()
19457 +{register object *base=vs_base;
19458 + register object *sup=base+VM22; VC22
19459 + vs_check;
19460 + {object V32;
19461 + V32=(base[0]);
19462 + vs_top=sup;
19463 + goto TTL;
19464 +TTL:;
19465 + if(!(eql(CMPcar((V32)),((object)VV[16])))){
19466 + goto T51;}
19467 + base[1]= CMPcdr((V32));
19468 + vs_top=(vs_base=base+1)+1;
19469 + return;
19470 + goto T51;
19471 +T51:;
19472 + {frame_ptr fr;
19473 + fr=frs_sch_catch(((object)VV[2]));
19474 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19475 + base[1]= ((object)VV[18]);
19476 + vs_top=(vs_base=base+1)+1;
19477 + unwind(fr,((object)VV[2]));}
19478 + }
19479 +}
19480 +/* function definition for Q-MK_EQUIV */
19481 +
19482 +static void L23()
19483 +{register object *VOL base=vs_base;
19484 + register object *VOL sup=base+VM23; VC23
19485 + vs_check;
19486 + {VOL object V33;
19487 + VOL object V34;
19488 + V33=(base[0]);
19489 + V34=(base[1]);
19490 + vs_top=sup;
19491 + goto TTL;
19492 +TTL:;
19493 + {VOL object V35;
19494 + frs_push(FRS_CATCH,((object)VV[2]));
19495 + if(nlj_active)
19496 + {nlj_active=FALSE;frs_pop();
19497 + vs_top=sup;
19498 + V35= vs_base[0];
19499 + goto T54;}
19500 + else{
19501 + base[2]= ((object)VV[19]);
19502 + base[4]= (V33);
19503 + base[5]= (V34);
19504 + vs_top=(vs_base=base+4)+2;
19505 + (void) (*Lnk74)();
19506 + vs_top=sup;
19507 + base[3]= vs_base[0];
19508 + vs_top=(vs_base=base+2)+2;
19509 + (void) (*Lnk75)();
19510 + vs_top=sup;
19511 + V36= vs_base[0];
19512 + V37= make_cons(V36,Cnil);
19513 + frs_pop();
19514 + V35= V37;}
19515 + goto T54;
19516 +T54:;
19517 + if(!(type_of((V35))!=t_cons)){
19518 + goto T62;}
19519 + {frame_ptr fr;
19520 + fr=frs_sch_catch(((object)VV[2]));
19521 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19522 + base[2]= ((object)VV[20]);
19523 + vs_top=(vs_base=base+2)+1;
19524 + unwind(fr,((object)VV[2]));}
19525 + goto T62;
19526 +T62:;
19527 + base[2]= CMPcar((V35));
19528 + vs_top=(vs_base=base+2)+1;
19529 + return;}
19530 + }
19531 +}
19532 +/* function definition for Q-MK_INEQUIV */
19533 +
19534 +static void L24()
19535 +{register object *VOL base=vs_base;
19536 + register object *VOL sup=base+VM24; VC24
19537 + vs_check;
19538 + {VOL object V39;
19539 + VOL object V40;
19540 + V39=(base[0]);
19541 + V40=(base[1]);
19542 + vs_top=sup;
19543 + goto TTL;
19544 +TTL:;
19545 + {VOL object V41;
19546 + frs_push(FRS_CATCH,((object)VV[2]));
19547 + if(nlj_active)
19548 + {nlj_active=FALSE;frs_pop();
19549 + vs_top=sup;
19550 + V41= vs_base[0];
19551 + goto T65;}
19552 + else{
19553 + base[2]= ((object)VV[21]);
19554 + base[4]= (V39);
19555 + base[5]= (V40);
19556 + vs_top=(vs_base=base+4)+2;
19557 + (void) (*Lnk74)();
19558 + vs_top=sup;
19559 + base[3]= vs_base[0];
19560 + vs_top=(vs_base=base+2)+2;
19561 + (void) (*Lnk75)();
19562 + vs_top=sup;
19563 + V42= vs_base[0];
19564 + V43= make_cons(V42,Cnil);
19565 + frs_pop();
19566 + V41= V43;}
19567 + goto T65;
19568 +T65:;
19569 + if(!(type_of((V41))!=t_cons)){
19570 + goto T73;}
19571 + {frame_ptr fr;
19572 + fr=frs_sch_catch(((object)VV[2]));
19573 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19574 + base[2]= ((object)VV[22]);
19575 + vs_top=(vs_base=base+2)+1;
19576 + unwind(fr,((object)VV[2]));}
19577 + goto T73;
19578 +T73:;
19579 + base[2]= CMPcar((V41));
19580 + vs_top=(vs_base=base+2)+1;
19581 + return;}
19582 + }
19583 +}
19584 +/* function definition for Q-MK_VAR */
19585 +
19586 +static void L25()
19587 +{register object *base=vs_base;
19588 + register object *sup=base+VM25; VC25
19589 + vs_check;
19590 + {object V45;
19591 + V45=(base[0]);
19592 + vs_top=sup;
19593 + goto TTL;
19594 +TTL:;{object V47;
19595 + base[1]= (V45);
19596 + base[2]= (((object)VV[23])->s.s_dbind);
19597 + vs_top=(vs_base=base+1)+2;
19598 + (void) (*Lnk76)();
19599 + vs_top=sup;
19600 + V47= vs_base[0];
19601 + if(V47==Cnil)goto T77;
19602 + V46= V47;
19603 + goto T76;
19604 + goto T77;
19605 +T77:;}
19606 + base[1]= (V45);
19607 + vs_top=(vs_base=base+1)+1;
19608 + (void) (*Lnk77)();
19609 + vs_top=sup;
19610 + V46= vs_base[0];
19611 + goto T76;
19612 +T76:;
19613 + base[1]= listA(3,((object)VV[12]),(V45),V46);
19614 + vs_top=(vs_base=base+1)+1;
19615 + return;
19616 + }
19617 +}
19618 +/* function definition for NEW-VAR-TYPE */
19619 +
19620 +static void L26()
19621 +{register object *base=vs_base;
19622 + register object *sup=base+VM26; VC26
19623 + vs_check;
19624 + {object V48;
19625 + V48=(base[0]);
19626 + vs_top=sup;
19627 + goto TTL;
19628 +TTL:;
19629 + {object V49;
19630 + vs_base=vs_top;
19631 + (void) (*Lnk78)();
19632 + vs_top=sup;
19633 + V49= vs_base[0];
19634 + {object V50;
19635 + V50= make_cons((V48),(V49));
19636 + (((object)VV[23])->s.s_dbind)= make_cons((V50),(((object)VV[23])->s.s_dbind));}
19637 + base[1]= (V49);
19638 + vs_top=(vs_base=base+1)+1;
19639 + return;}
19640 + }
19641 +}
19642 +/* function definition for Q-FREE-VAR */
19643 +
19644 +static void L27()
19645 +{register object *base=vs_base;
19646 + register object *sup=base+VM27; VC27
19647 + vs_check;
19648 + {object V51;
19649 + V51=(base[0]);
19650 + vs_top=sup;
19651 + goto TTL;
19652 +TTL:;
19653 + if(!((CMPcar((V51)))==(((object)VV[12])))){
19654 + goto T87;}
19655 + base[1]= CMPcadr((V51));
19656 + vs_top=(vs_base=base+1)+1;
19657 + (void) (*Lnk77)();
19658 + return;
19659 + goto T87;
19660 +T87:;
19661 + base[1]= Cnil;
19662 + vs_top=(vs_base=base+1)+1;
19663 + return;
19664 + }
19665 +}
19666 +/* function definition for MK_REALVAR */
19667 +
19668 +static void L28()
19669 +{register object *base=vs_base;
19670 + register object *sup=base+VM28; VC28
19671 + vs_check;
19672 + {object V52;
19673 + object V53;
19674 + V52=(base[0]);
19675 + V53=(base[1]);
19676 + vs_top=sup;
19677 + goto TTL;
19678 +TTL:;{object V54;
19679 + base[2]= (V53);
19680 + {object V55 =((V52))->s.s_plist;
19681 + object ind= ((object)VV[24]);
19682 + while(V55!=Cnil){
19683 + if(V55->c.c_car==ind){
19684 + base[3]= (V55->c.c_cdr->c.c_car);
19685 + goto T93;
19686 + }else V55=V55->c.c_cdr->c.c_cdr;}
19687 + base[3]= Cnil;}
19688 + goto T93;
19689 +T93:;
19690 + vs_top=(vs_base=base+2)+2;
19691 + (void) (*Lnk76)();
19692 + vs_top=sup;
19693 + V54= vs_base[0];
19694 + if(V54==Cnil)goto T90;
19695 + base[2]= V54;
19696 + vs_top=(vs_base=base+2)+1;
19697 + return;
19698 + goto T90;
19699 +T90:;}
19700 + base[2]= (V52);
19701 + V57= listA(3,((object)VV[12]),(V52),(V53));
19702 + base[3]= make_cons((V53),/* INLINE-ARGS */V57);
19703 + base[4]= ((object)VV[24]);
19704 + vs_top=(vs_base=base+2)+3;
19705 + (void) (*Lnk79)();
19706 + vs_top=sup;
19707 + V56= vs_base[0];
19708 + base[2]= CMPcdr(V56);
19709 + vs_top=(vs_base=base+2)+1;
19710 + return;
19711 + }
19712 +}
19713 +/* function definition for ML-GENVAR */
19714 +
19715 +static void L29()
19716 +{register object *base=vs_base;
19717 + register object *sup=base+VM29; VC29
19718 + vs_check;
19719 + {object V58;
19720 + V58=(base[0]);
19721 + vs_top=sup;
19722 + goto TTL;
19723 +TTL:;
19724 + base[2]= ((object)VV[25]);
19725 + base[3]= ((object)VV[12]);
19726 + vs_top=(vs_base=base+2)+2;
19727 + (void) (*Lnk80)();
19728 + vs_top=sup;
19729 + base[1]= vs_base[0];
19730 + base[2]= (V58);
19731 + vs_top=(vs_base=base+1)+2;
19732 + (void) (*Lnk81)();
19733 + return;
19734 + }
19735 +}
19736 +/* function definition for ML-IS_VAR */
19737 +
19738 +static void L30()
19739 +{register object *base=vs_base;
19740 + register object *sup=base+VM30; VC30
19741 + vs_check;
19742 + {object V59;
19743 + V59=(base[0]);
19744 + vs_top=sup;
19745 + goto TTL;
19746 +TTL:;
19747 + base[1]= ((CMPcar((V59)))==(((object)VV[12]))?Ct:Cnil);
19748 + vs_top=(vs_base=base+1)+1;
19749 + return;
19750 + }
19751 +}
19752 +/* function definition for ML-DEST_VAR */
19753 +
19754 +static void L31()
19755 +{register object *base=vs_base;
19756 + register object *sup=base+VM31; VC31
19757 + vs_check;
19758 + {object V60;
19759 + V60=(base[0]);
19760 + vs_top=sup;
19761 + goto TTL;
19762 +TTL:;
19763 + if(!(eql(CMPcar((V60)),((object)VV[12])))){
19764 + goto T103;}
19765 + base[1]= CMPcdr((V60));
19766 + vs_top=(vs_base=base+1)+1;
19767 + return;
19768 + goto T103;
19769 +T103:;
19770 + {frame_ptr fr;
19771 + fr=frs_sch_catch(((object)VV[2]));
19772 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19773 + base[1]= ((object)VV[26]);
19774 + vs_top=(vs_base=base+1)+1;
19775 + unwind(fr,((object)VV[2]));}
19776 + }
19777 +}
19778 +/* function definition for Q-MK_CONST */
19779 +
19780 +static void L32()
19781 +{register object *base=vs_base;
19782 + register object *sup=base+VM32; VC32
19783 + vs_check;
19784 + {object V61;
19785 + V61=(base[0]);
19786 + vs_top=sup;
19787 + goto TTL;
19788 +TTL:;
19789 + base[2]= (V61);
19790 + base[1]= simple_symlispcall(((object)VV[82]),base+2,1);
19791 + vs_top=(vs_base=base+1)+1;
19792 + (void) (*Lnk67)();
19793 + vs_top=sup;
19794 + V62= vs_base[0];
19795 + base[1]= listA(3,((object)VV[27]),(V61),V62);
19796 + vs_top=(vs_base=base+1)+1;
19797 + return;
19798 + }
19799 +}
19800 +/* function definition for ML-MK_CONST */
19801 +
19802 +static void L33()
19803 +{register object *base=vs_base;
19804 + register object *sup=base+VM33; VC33
19805 + vs_check;
19806 + {register object V63;
19807 + register object V64;
19808 + V63=(base[0]);
19809 + V64=(base[1]);
19810 + vs_top=sup;
19811 + goto TTL;
19812 +TTL:;
19813 + {object V65;
19814 + base[2]= (V64);
19815 + {object V66 =((V63))->s.s_plist;
19816 + object ind= ((object)VV[28]);
19817 + while(V66!=Cnil){
19818 + if(V66->c.c_car==ind){
19819 + base[3]= (V66->c.c_cdr->c.c_car);
19820 + goto T111;
19821 + }else V66=V66->c.c_cdr->c.c_cdr;}
19822 + base[3]= Cnil;}
19823 + goto T111;
19824 +T111:;
19825 + vs_top=(vs_base=base+2)+2;
19826 + (void) (*Lnk76)();
19827 + vs_top=sup;
19828 + V65= vs_base[0];
19829 + if(((V65))==Cnil){
19830 + goto T113;}
19831 + base[2]= (V65);
19832 + vs_top=(vs_base=base+2)+1;
19833 + return;
19834 + goto T113;
19835 +T113:;
19836 + base[2]= (V63);
19837 + if((simple_symlispcall(((object)VV[82]),base+2,1))==Cnil){
19838 + goto T116;}
19839 + base[2]= (V64);
19840 + base[5]= (V63);
19841 + base[4]= simple_symlispcall(((object)VV[82]),base+5,1);
19842 + vs_top=(vs_base=base+4)+1;
19843 + (void) (*Lnk67)();
19844 + vs_top=sup;
19845 + base[3]= vs_base[0];
19846 + vs_top=(vs_base=base+2)+2;
19847 + (void) (*Lnk69)();
19848 + vs_top=sup;
19849 + if((vs_base[0])==Cnil){
19850 + goto T116;}
19851 + base[2]= (V63);
19852 + V68= listA(3,((object)VV[27]),(V63),(V64));
19853 + base[3]= make_cons((V64),/* INLINE-ARGS */V68);
19854 + base[4]= ((object)VV[28]);
19855 + vs_top=(vs_base=base+2)+3;
19856 + (void) (*Lnk79)();
19857 + vs_top=sup;
19858 + V67= vs_base[0];
19859 + base[2]= CMPcdr(V67);
19860 + vs_top=(vs_base=base+2)+1;
19861 + return;
19862 + goto T116;
19863 +T116:;
19864 + base[2]= (V63);
19865 + if((simple_symlispcall(((object)VV[82]),base+2,1))!=Cnil){
19866 + goto T130;}
19867 + {frame_ptr fr;
19868 + fr=frs_sch_catch(((object)VV[2]));
19869 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19870 + base[2]= ((object)VV[29]);
19871 + base[3]= (V63);
19872 + base[4]= ((object)VV[30]);
19873 + vs_top=(vs_base=base+2)+3;
19874 + (void) (*Lnk83)();
19875 + unwind(fr,((object)VV[2]));}
19876 + goto T130;
19877 +T130:;
19878 + base[2]= (V64);
19879 + base[5]= (V63);
19880 + base[4]= simple_symlispcall(((object)VV[82]),base+5,1);
19881 + vs_top=(vs_base=base+4)+1;
19882 + (void) (*Lnk67)();
19883 + vs_top=sup;
19884 + base[3]= vs_base[0];
19885 + vs_top=(vs_base=base+2)+2;
19886 + (void) (*Lnk69)();
19887 + vs_top=sup;
19888 + if((vs_base[0])!=Cnil){
19889 + goto T138;}
19890 + {frame_ptr fr;
19891 + fr=frs_sch_catch(((object)VV[2]));
19892 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19893 + base[2]= ((object)VV[31]);
19894 + base[3]= (V63);
19895 + base[4]= ((object)VV[32]);
19896 + vs_top=(vs_base=base+2)+3;
19897 + (void) (*Lnk83)();
19898 + unwind(fr,((object)VV[2]));}
19899 + goto T138;
19900 +T138:;
19901 + {frame_ptr fr;
19902 + fr=frs_sch_catch(((object)VV[2]));
19903 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19904 + base[2]= ((object)VV[33]);
19905 + vs_top=(vs_base=base+2)+1;
19906 + unwind(fr,((object)VV[2]));}}
19907 + }
19908 +}
19909 +/* function definition for ML-IS_CONST */
19910 +
19911 +static void L34()
19912 +{register object *base=vs_base;
19913 + register object *sup=base+VM34; VC34
19914 + vs_check;
19915 + {object V69;
19916 + V69=(base[0]);
19917 + vs_top=sup;
19918 + goto TTL;
19919 +TTL:;
19920 + base[1]= ((CMPcar((V69)))==(((object)VV[27]))?Ct:Cnil);
19921 + vs_top=(vs_base=base+1)+1;
19922 + return;
19923 + }
19924 +}
19925 +/* function definition for ML-DEST_CONST */
19926 +
19927 +static void L35()
19928 +{register object *base=vs_base;
19929 + register object *sup=base+VM35; VC35
19930 + vs_check;
19931 + {object V70;
19932 + V70=(base[0]);
19933 + vs_top=sup;
19934 + goto TTL;
19935 +TTL:;
19936 + if(!(eql(CMPcar((V70)),((object)VV[27])))){
19937 + goto T150;}
19938 + base[1]= CMPcdr((V70));
19939 + vs_top=(vs_base=base+1)+1;
19940 + return;
19941 + goto T150;
19942 +T150:;
19943 + {frame_ptr fr;
19944 + fr=frs_sch_catch(((object)VV[2]));
19945 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
19946 + base[1]= ((object)VV[34]);
19947 + vs_top=(vs_base=base+1)+1;
19948 + unwind(fr,((object)VV[2]));}
19949 + }
19950 +}
19951 +/* function definition for Q-MK_ABS */
19952 +
19953 +static void L36()
19954 +{register object *base=vs_base;
19955 + register object *sup=base+VM36; VC36
19956 + vs_check;
19957 + {object V71;
19958 + object V72;
19959 + V71=(base[0]);
19960 + V72=(base[1]);
19961 + vs_top=sup;
19962 + goto TTL;
19963 +TTL:;
19964 + {object V73;
19965 + base[2]= (V71);
19966 + vs_top=(vs_base=base+2)+1;
19967 + (void) (*Lnk70)();
19968 + vs_top=sup;
19969 + V73= vs_base[0];
19970 + base[2]= (V73);
19971 + vs_top=(vs_base=base+2)+1;
19972 + (void) (*Lnk71)();
19973 + vs_top=sup;
19974 + base[2]= (V73);
19975 + base[3]= (V72);
19976 + vs_top=(vs_base=base+2)+2;
19977 + (void) (*Lnk84)();
19978 + return;}
19979 + }
19980 +}
19981 +/* function definition for ML-MK_ABS */
19982 +
19983 +static void L37()
19984 +{register object *base=vs_base;
19985 + register object *sup=base+VM37; VC37
19986 + vs_check;
19987 + {object V74;
19988 + object V75;
19989 + V74=(base[0]);
19990 + V75=(base[1]);
19991 + vs_top=sup;
19992 + goto TTL;
19993 +TTL:;
19994 + if(!((CMPcar((V74)))==(((object)VV[12])))){
19995 + goto T160;}
19996 + V76= make_cons((V74),(V75));
19997 + base[2]= (V74);
19998 + vs_top=(vs_base=base+2)+1;
19999 + (void) (*Lnk68)();
20000 + vs_top=sup;
20001 + V77= vs_base[0];
20002 + base[2]= (V75);
20003 + vs_top=(vs_base=base+2)+1;
20004 + (void) (*Lnk68)();
20005 + vs_top=sup;
20006 + V78= vs_base[0];
20007 + V79= list(2,V77,V78);
20008 + base[2]= listA(3,((object)VV[35]),/* INLINE-ARGS */V76,make_cons(((object)VV[36]),/* INLINE-ARGS */V79));
20009 + vs_top=(vs_base=base+2)+1;
20010 + return;
20011 + goto T160;
20012 +T160:;
20013 + {frame_ptr fr;
20014 + fr=frs_sch_catch(((object)VV[2]));
20015 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
20016 + base[2]= ((object)VV[37]);
20017 + vs_top=(vs_base=base+2)+1;
20018 + unwind(fr,((object)VV[2]));}
20019 + }
20020 +}
20021 +/* function definition for ML-IS_ABS */
20022 +
20023 +static void L38()
20024 +{register object *base=vs_base;
20025 + register object *sup=base+VM38; VC38
20026 + vs_check;
20027 + {object V80;
20028 + V80=(base[0]);
20029 + vs_top=sup;
20030 + goto TTL;
20031 +TTL:;
20032 + base[1]= ((CMPcar((V80)))==(((object)VV[35]))?Ct:Cnil);
20033 + vs_top=(vs_base=base+1)+1;
20034 + return;
20035 + }
20036 +}
20037 +/* function definition for ML-DEST_ABS */
20038 +
20039 +static void L39()
20040 +{register object *base=vs_base;
20041 + register object *sup=base+VM39; VC39
20042 + vs_check;
20043 + {object V81;
20044 + V81=(base[0]);
20045 + vs_top=sup;
20046 + goto TTL;
20047 +TTL:;
20048 + if(!(eql(CMPcar((V81)),((object)VV[35])))){
20049 + goto T169;}
20050 + V82= CMPcdr((V81));
20051 + goto T167;
20052 + goto T169;
20053 +T169:;
20054 + {frame_ptr fr;
20055 + fr=frs_sch_catch(((object)VV[2]));
20056 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
20057 + base[1]= ((object)VV[38]);
20058 + vs_top=(vs_base=base+1)+1;
20059 + unwind(fr,((object)VV[2]));}
20060 + goto T167;
20061 +T167:;
20062 + base[1]= CMPcar(V82);
20063 + vs_top=(vs_base=base+1)+1;
20064 + return;
20065 + }
20066 +}
20067 +/* function definition for PREP-TERM-FN */
20068 +
20069 +static void L40()
20070 +{register object *base=vs_base;
20071 + register object *sup=base+VM40; VC40
20072 + vs_check;
20073 + {register object V83;
20074 + V83=(base[0]);
20075 + vs_top=sup;
20076 + goto TTL;
20077 +TTL:;
20078 + {object V84= CMPcar((V83));
20079 + if((V84!= ((object)VV[12])))goto T172;
20080 + V85= CMPcadr((V83));
20081 + base[1]= CMPcddr((V83));
20082 + vs_top=(vs_base=base+1)+1;
20083 + (void) (*Lnk85)();
20084 + vs_top=sup;
20085 + V86= vs_base[0];
20086 + base[1]= listA(3,((object)VV[12]),/* INLINE-ARGS */V85,V86);
20087 + vs_top=(vs_base=base+1)+1;
20088 + return;
20089 + goto T172;
20090 +T172:;
20091 + if((V84!= ((object)VV[27])))goto T175;
20092 + V87= CMPcadr((V83));
20093 + base[1]= CMPcddr((V83));
20094 + vs_top=(vs_base=base+1)+1;
20095 + (void) (*Lnk85)();
20096 + vs_top=sup;
20097 + V88= vs_base[0];
20098 + base[1]= listA(3,((object)VV[27]),/* INLINE-ARGS */V87,V88);
20099 + vs_top=(vs_base=base+1)+1;
20100 + return;
20101 + goto T175;
20102 +T175:;
20103 + if((V84!= ((object)VV[39])))goto T178;
20104 + base[1]= CMPcaadr((V83));
20105 + vs_top=(vs_base=base+1)+1;
20106 + (void) (*Lnk86)();
20107 + vs_top=sup;
20108 + V89= vs_base[0];
20109 + base[1]= CMPcdadr((V83));
20110 + vs_top=(vs_base=base+1)+1;
20111 + (void) (*Lnk86)();
20112 + vs_top=sup;
20113 + V90= vs_base[0];
20114 + V91= make_cons(V89,V90);
20115 + base[1]= CMPcddr((V83));
20116 + vs_top=(vs_base=base+1)+1;
20117 + (void) (*Lnk85)();
20118 + vs_top=sup;
20119 + V92= vs_base[0];
20120 + base[1]= listA(3,((object)VV[39]),/* INLINE-ARGS */V91,V92);
20121 + vs_top=(vs_base=base+1)+1;
20122 + return;
20123 + goto T178;
20124 +T178:;
20125 + if((V84!= ((object)VV[35])))goto T185;
20126 + base[1]= CMPcaadr((V83));
20127 + vs_top=(vs_base=base+1)+1;
20128 + (void) (*Lnk86)();
20129 + vs_top=sup;
20130 + V93= vs_base[0];
20131 + base[1]= CMPcdadr((V83));
20132 + vs_top=(vs_base=base+1)+1;
20133 + (void) (*Lnk86)();
20134 + vs_top=sup;
20135 + V94= vs_base[0];
20136 + V95= make_cons(V93,V94);
20137 + base[1]= CMPcddr((V83));
20138 + vs_top=(vs_base=base+1)+1;
20139 + (void) (*Lnk85)();
20140 + vs_top=sup;
20141 + V96= vs_base[0];
20142 + base[1]= listA(3,((object)VV[35]),/* INLINE-ARGS */V95,V96);
20143 + vs_top=(vs_base=base+1)+1;
20144 + return;
20145 + goto T185;
20146 +T185:;
20147 + if((V84!= ((object)VV[0])))goto T192;
20148 + V83= CMPcdr((V83));
20149 + goto TTL;
20150 + goto T192;
20151 +T192:;
20152 + {frame_ptr fr;
20153 + fr=frs_sch_catch(((object)VV[2]));
20154 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
20155 + base[1]= ((object)VV[40]);
20156 + vs_top=(vs_base=base+1)+1;
20157 + unwind(fr,((object)VV[2]));}}
20158 + }
20159 +}
20160 +/* function definition for PREP-TERM-FOR-PRINT */
20161 +
20162 +static void L41()
20163 +{register object *base=vs_base;
20164 + register object *sup=base+VM41; VC41
20165 + vs_check;
20166 + bds_check;
20167 + {object V97;
20168 + V97=(base[0]);
20169 + vs_top=sup;
20170 + goto TTL;
20171 +TTL:;
20172 + {object V98;
20173 + base[1]= (V97);
20174 + vs_top=(vs_base=base+1)+1;
20175 + (void) (*Lnk87)();
20176 + vs_top=sup;
20177 + V98= vs_base[0];
20178 + base[3]= (V98);
20179 + vs_top=(vs_base=base+3)+1;
20180 + (void) (*Lnk88)();
20181 + vs_top=sup;
20182 + base[2]= vs_base[0];
20183 + vs_top=(vs_base=base+2)+1;
20184 + (void) (*Lnk89)();
20185 + vs_top=sup;
20186 + base[1]= vs_base[0];
20187 + bds_bind(((object)VV[41]),base[1]);
20188 + base[2]= (V98);
20189 + vs_top=(vs_base=base+2)+1;
20190 + (void) (*Lnk86)();
20191 + bds_unwind1;
20192 + return;}
20193 + }
20194 +}
20195 +/* function definition for ADD-TERM-LINKS */
20196 +
20197 +static void L42()
20198 +{register object *base=vs_base;
20199 + register object *sup=base+VM42; VC42
20200 + vs_check;
20201 + {register object V99;
20202 + V99=(base[0]);
20203 + vs_top=sup;
20204 + goto TTL;
20205 +TTL:;
20206 + {object V100= CMPcar((V99));
20207 + if((V100!= ((object)VV[12])))goto T202;
20208 + V101= CMPcadr((V99));
20209 + base[1]= CMPcddr((V99));
20210 + vs_top=(vs_base=base+1)+1;
20211 + (void) (*Lnk90)();
20212 + vs_top=sup;
20213 + V102= vs_base[0];
20214 + base[1]= listA(3,((object)VV[12]),/* INLINE-ARGS */V101,V102);
20215 + vs_top=(vs_base=base+1)+1;
20216 + return;
20217 + goto T202;
20218 +T202:;
20219 + if((V100!= ((object)VV[27])))goto T205;
20220 + V103= CMPcadr((V99));
20221 + base[1]= CMPcddr((V99));
20222 + vs_top=(vs_base=base+1)+1;
20223 + (void) (*Lnk90)();
20224 + vs_top=sup;
20225 + V104= vs_base[0];
20226 + base[1]= listA(3,((object)VV[27]),/* INLINE-ARGS */V103,V104);
20227 + vs_top=(vs_base=base+1)+1;
20228 + return;
20229 + goto T205;
20230 +T205:;
20231 + if((V100!= ((object)VV[39])))goto T208;
20232 + base[1]= CMPcaadr((V99));
20233 + vs_top=(vs_base=base+1)+1;
20234 + (void) (*Lnk87)();
20235 + vs_top=sup;
20236 + V105= vs_base[0];
20237 + base[1]= CMPcdadr((V99));
20238 + vs_top=(vs_base=base+1)+1;
20239 + (void) (*Lnk87)();
20240 + vs_top=sup;
20241 + V106= vs_base[0];
20242 + V107= make_cons(V105,V106);
20243 + base[1]= CMPcddr((V99));
20244 + vs_top=(vs_base=base+1)+1;
20245 + (void) (*Lnk90)();
20246 + vs_top=sup;
20247 + V108= vs_base[0];
20248 + base[1]= listA(3,((object)VV[39]),/* INLINE-ARGS */V107,V108);
20249 + vs_top=(vs_base=base+1)+1;
20250 + return;
20251 + goto T208;
20252 +T208:;
20253 + if((V100!= ((object)VV[35])))goto T215;
20254 + base[1]= CMPcaadr((V99));
20255 + vs_top=(vs_base=base+1)+1;
20256 + (void) (*Lnk87)();
20257 + vs_top=sup;
20258 + V109= vs_base[0];
20259 + base[1]= CMPcdadr((V99));
20260 + vs_top=(vs_base=base+1)+1;
20261 + (void) (*Lnk87)();
20262 + vs_top=sup;
20263 + V110= vs_base[0];
20264 + V111= make_cons(V109,V110);
20265 + base[1]= CMPcddr((V99));
20266 + vs_top=(vs_base=base+1)+1;
20267 + (void) (*Lnk90)();
20268 + vs_top=sup;
20269 + V112= vs_base[0];
20270 + base[1]= listA(3,((object)VV[35]),/* INLINE-ARGS */V111,V112);
20271 + vs_top=(vs_base=base+1)+1;
20272 + return;
20273 + goto T215;
20274 +T215:;
20275 + if((V100!= ((object)VV[0])))goto T222;
20276 + V99= CMPcdr((V99));
20277 + goto TTL;
20278 + goto T222;
20279 +T222:;
20280 + {frame_ptr fr;
20281 + fr=frs_sch_catch(((object)VV[2]));
20282 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
20283 + base[1]= ((object)VV[42]);
20284 + vs_top=(vs_base=base+1)+1;
20285 + unwind(fr,((object)VV[2]));}}
20286 + }
20287 +}
20288 +/* function definition for ADD-TYPE-LINKS */
20289 +
20290 +static void L43()
20291 +{register object *base=vs_base;
20292 + register object *sup=base+VM43; VC43
20293 + vs_check;
20294 + {register object V113;
20295 + V113=(base[0]);
20296 + vs_top=sup;
20297 + goto TTL;
20298 +TTL:;
20299 + {object V114= CMPcar((V113));
20300 + if((V114!= ((object)VV[0])))goto T226;
20301 + base[1]= CMPcdr((V113));
20302 + vs_top=(vs_base=base+1)+1;
20303 + return;
20304 + goto T226;
20305 +T226:;
20306 + if((V114!= ((object)VV[47])))goto T227;
20307 + base[1]= (V113);
20308 + vs_top=(vs_base=base+1)+1;
20309 + return;
20310 + goto T227;
20311 +T227:;
20312 + if((V114!= ((object)VV[43])))goto T228;
20313 + {object V115= CMPcdr((V113));
20314 + if(!(type_of(V115)==t_fixnum||
20315 +type_of(V115)==t_bignum||
20316 +type_of(V115)==t_ratio||
20317 +type_of(V115)==t_shortfloat||
20318 +type_of(V115)==t_longfloat||
20319 +type_of(V115)==t_complex)){
20320 + goto T230;}}
20321 + base[1]= (V113);
20322 + vs_top=(vs_base=base+1)+1;
20323 + return;
20324 + goto T230;
20325 +T230:;
20326 + if((CMPcdr((V113)))!=Cnil){
20327 + goto T233;}
20328 + (((object)VV[44])->s.s_dbind)= number_plus((((object)VV[44])->s.s_dbind),small_fixnum(1));
20329 + base[1]= make_cons(((object)VV[43]),(((object)VV[44])->s.s_dbind));
20330 + vs_top=(vs_base=base+1)+1;
20331 + return;
20332 + goto T233;
20333 +T233:;
20334 + V113= CMPcdr((V113));
20335 + goto TTL;
20336 + goto T228;
20337 +T228:;
20338 + V116= CMPcar((V113));
20339 + {object V118;
20340 + object V119= CMPcdr((V113));
20341 + if(V119==Cnil){
20342 + V117= Cnil;
20343 + goto T238;}
20344 + base[1]=V118=MMcons(Cnil,Cnil);
20345 + goto T239;
20346 +T239:;
20347 + base[2]= (V119->c.c_car);
20348 + vs_top=(vs_base=base+2)+1;
20349 + (void) (*Lnk90)();
20350 + vs_top=sup;
20351 + (V118->c.c_car)= vs_base[0];
20352 + if((V119=MMcdr(V119))==Cnil){
20353 + V117= base[1];
20354 + goto T238;}
20355 + V118=MMcdr(V118)=MMcons(Cnil,Cnil);
20356 + goto T239;}
20357 + goto T238;
20358 +T238:;
20359 + base[1]= make_cons(/* INLINE-ARGS */V116,V117);
20360 + vs_top=(vs_base=base+1)+1;
20361 + return;}
20362 + }
20363 +}
20364 +/* function definition for GET-TYPE-LINKS */
20365 +
20366 +static void L44()
20367 +{register object *base=vs_base;
20368 + register object *sup=base+VM44; VC44
20369 + vs_check;
20370 + {register object V120;
20371 + V120=(base[0]);
20372 + vs_top=sup;
20373 + goto TTL;
20374 +TTL:;
20375 + {object V121= CMPcar((V120));
20376 + if((V121!= ((object)VV[0]))
20377 + && (V121!= ((object)VV[47])))goto T242;
20378 + base[1]= Cnil;
20379 + vs_top=(vs_base=base+1)+1;
20380 + return;
20381 + goto T242;
20382 +T242:;
20383 + if((V121!= ((object)VV[43])))goto T243;
20384 + {object V122= CMPcdr((V120));
20385 + if(!(type_of(V122)==t_fixnum||
20386 +type_of(V122)==t_bignum||
20387 +type_of(V122)==t_ratio||
20388 +type_of(V122)==t_shortfloat||
20389 +type_of(V122)==t_longfloat||
20390 +type_of(V122)==t_complex)){
20391 + goto T245;}}
20392 + base[1]= make_cons(CMPcdr((V120)),Cnil);
20393 + vs_top=(vs_base=base+1)+1;
20394 + return;
20395 + goto T245;
20396 +T245:;
20397 + V120= CMPcdr((V120));
20398 + goto TTL;
20399 + goto T243;
20400 +T243:;
20401 + {object V123;
20402 + {object V124;
20403 + object V125= CMPcdr((V120));
20404 + if(V125==Cnil){
20405 + V123= Cnil;
20406 + goto T249;}
20407 + base[1]=V124=MMcons(Cnil,Cnil);
20408 + goto T250;
20409 +T250:;
20410 + base[2]= (V125->c.c_car);
20411 + vs_top=(vs_base=base+2)+1;
20412 + (void) (*Lnk91)();
20413 + vs_top=sup;
20414 + (V124->c.c_car)= vs_base[0];
20415 + if((V125=MMcdr(V125))==Cnil){
20416 + V123= base[1];
20417 + goto T249;}
20418 + V124=MMcdr(V124)=MMcons(Cnil,Cnil);
20419 + goto T250;}
20420 + goto T249;
20421 +T249:;
20422 + vs_top=base+1;
20423 + while(V123!=Cnil)
20424 + {vs_push((V123)->c.c_car);V123=(V123)->c.c_cdr;}
20425 + vs_base=base+1;}
20426 + Lappend();
20427 + return;}
20428 + }
20429 +}
20430 +/* function definition for GET-TERM-LINKS */
20431 +
20432 +static void L45()
20433 +{register object *base=vs_base;
20434 + register object *sup=base+VM45; VC45
20435 + vs_check;
20436 + {register object V126;
20437 + V126=(base[0]);
20438 + vs_top=sup;
20439 + goto TTL;
20440 +TTL:;
20441 + {object V127= CMPcar((V126));
20442 + if((V127!= ((object)VV[12])))goto T253;
20443 + base[1]= CMPcddr((V126));
20444 + vs_top=(vs_base=base+1)+1;
20445 + (void) (*Lnk91)();
20446 + return;
20447 + goto T253;
20448 +T253:;
20449 + if((V127!= ((object)VV[27])))goto T255;
20450 + base[1]= CMPcddr((V126));
20451 + vs_top=(vs_base=base+1)+1;
20452 + (void) (*Lnk91)();
20453 + return;
20454 + goto T255;
20455 +T255:;
20456 + if((V127!= ((object)VV[39])))goto T257;
20457 + base[1]= CMPcaadr((V126));
20458 + vs_top=(vs_base=base+1)+1;
20459 + (void) (*Lnk88)();
20460 + vs_top=sup;
20461 + V128= vs_base[0];
20462 + base[1]= CMPcdadr((V126));
20463 + vs_top=(vs_base=base+1)+1;
20464 + (void) (*Lnk88)();
20465 + vs_top=sup;
20466 + V129= vs_base[0];
20467 + base[1]= append(V128,V129);
20468 + vs_top=(vs_base=base+1)+1;
20469 + return;
20470 + goto T257;
20471 +T257:;
20472 + if((V127!= ((object)VV[35])))goto T262;
20473 + base[1]= CMPcaadr((V126));
20474 + vs_top=(vs_base=base+1)+1;
20475 + (void) (*Lnk88)();
20476 + vs_top=sup;
20477 + V130= vs_base[0];
20478 + base[1]= CMPcdadr((V126));
20479 + vs_top=(vs_base=base+1)+1;
20480 + (void) (*Lnk88)();
20481 + vs_top=sup;
20482 + V131= vs_base[0];
20483 + base[1]= append(V130,V131);
20484 + vs_top=(vs_base=base+1)+1;
20485 + return;
20486 + goto T262;
20487 +T262:;
20488 + if((V127!= ((object)VV[0])))goto T267;
20489 + V126= CMPcdr((V126));
20490 + goto TTL;
20491 + goto T267;
20492 +T267:;
20493 + {frame_ptr fr;
20494 + fr=frs_sch_catch(((object)VV[2]));
20495 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
20496 + base[1]= ((object)VV[45]);
20497 + vs_top=(vs_base=base+1)+1;
20498 + unwind(fr,((object)VV[2]));}}
20499 + }
20500 +}
20501 +/* function definition for MAKE-LINK-NAMES */
20502 +
20503 +static void L46()
20504 +{register object *base=vs_base;
20505 + register object *sup=base+VM46; VC46
20506 + vs_check;
20507 + {object V132;
20508 + V132=(base[0]);
20509 + vs_top=sup;
20510 + goto TTL;
20511 +TTL:;
20512 + {register object V133;
20513 + register object V134;
20514 + register object V135;
20515 + V133= Cnil;
20516 + V134= Cnil;
20517 + V135= Cnil;
20518 + if(((V132))!=Cnil){
20519 + goto T275;}
20520 + base[1]= make_cons(Cnil,Cnil);
20521 + vs_top=(vs_base=base+1)+1;
20522 + return;
20523 + goto T275;
20524 +T275:;
20525 + if(!(((long)length((V132)))==((long)1))){
20526 + goto T273;}
20527 + V136= make_cons(CMPcar((V132)),((object)VV[46]));
20528 + base[1]= make_cons(/* INLINE-ARGS */V136,Cnil);
20529 + vs_top=(vs_base=base+1)+1;
20530 + return;
20531 + goto T273;
20532 +T273:;
20533 + V135= small_fixnum(1);
20534 + V133= (V132);
20535 + V134= Cnil;
20536 + goto T272;
20537 +T272:;
20538 + if(((V133))!=Cnil){
20539 + goto T286;}
20540 + base[1]= (V134);
20541 + vs_top=(vs_base=base+1)+1;
20542 + return;
20543 + goto T286;
20544 +T286:;
20545 + {object V137;
20546 + {register object x= CMPcar((V133)),V138= (V134);
20547 + while(V138!=Cnil)
20548 + if(equal(x,V138->c.c_car->c.c_car) &&V138->c.c_car != Cnil){
20549 + V137= (V138->c.c_car);
20550 + goto T288;
20551 + }else V138=V138->c.c_cdr;
20552 + V137= Cnil;}
20553 + goto T288;
20554 +T288:;
20555 + if(((V137))==Cnil){
20556 + goto T290;}
20557 + goto T284;
20558 + goto T290;
20559 +T290:;
20560 + V139= CMPcar((V133));
20561 + base[1]= ((object)VV[46]);
20562 + base[2]= (V135);
20563 + vs_top=(vs_base=base+1)+2;
20564 + (void) (*Lnk83)();
20565 + vs_top=sup;
20566 + V140= vs_base[0];
20567 + V141= make_cons(/* INLINE-ARGS */V139,V140);
20568 + V134= make_cons(/* INLINE-ARGS */V141,(V134));
20569 + V135= one_plus((V135));}
20570 + goto T284;
20571 +T284:;
20572 + V133= CMPcdr((V133));
20573 + goto T272;}
20574 + }
20575 +}
20576 +/* function definition for PREP-TY-FN */
20577 +
20578 +static void L47()
20579 +{register object *base=vs_base;
20580 + register object *sup=base+VM47; VC47
20581 + vs_check;
20582 + {register object V142;
20583 + V142=(base[0]);
20584 + vs_top=sup;
20585 + goto TTL;
20586 +TTL:;
20587 + {object V143= CMPcar((V142));
20588 + if((V143!= ((object)VV[0])))goto T301;
20589 + base[1]= CMPcdr((V142));
20590 + vs_top=(vs_base=base+1)+1;
20591 + return;
20592 + goto T301;
20593 +T301:;
20594 + if((V143!= ((object)VV[47])))goto T302;
20595 + base[1]= (V142);
20596 + vs_top=(vs_base=base+1)+1;
20597 + return;
20598 + goto T302;
20599 +T302:;
20600 + if((V143!= ((object)VV[43])))goto T303;
20601 + {object V144= CMPcdr((V142));
20602 + if(!(type_of(V144)==t_fixnum||
20603 +type_of(V144)==t_bignum||
20604 +type_of(V144)==t_ratio||
20605 +type_of(V144)==t_shortfloat||
20606 +type_of(V144)==t_longfloat||
20607 +type_of(V144)==t_complex)){
20608 + goto T305;}}
20609 + {register object x= CMPcdr((V142)),V146= (((object)VV[41])->s.s_dbind);
20610 + while(V146!=Cnil)
20611 + if(equal(x,V146->c.c_car->c.c_car) &&V146->c.c_car != Cnil){
20612 + V145= (V146->c.c_car);
20613 + goto T307;
20614 + }else V146=V146->c.c_cdr;
20615 + V145= Cnil;}
20616 + goto T307;
20617 +T307:;
20618 + base[1]= make_cons(((object)VV[47]),CMPcdr(V145));
20619 + vs_top=(vs_base=base+1)+1;
20620 + return;
20621 + goto T305;
20622 +T305:;
20623 + V142= CMPcdr((V142));
20624 + goto TTL;
20625 + goto T303;
20626 +T303:;
20627 + V147= CMPcar((V142));
20628 + {object V149;
20629 + object V150= CMPcdr((V142));
20630 + if(V150==Cnil){
20631 + V148= Cnil;
20632 + goto T310;}
20633 + base[1]=V149=MMcons(Cnil,Cnil);
20634 + goto T311;
20635 +T311:;
20636 + base[2]= (V150->c.c_car);
20637 + vs_top=(vs_base=base+2)+1;
20638 + (void) (*Lnk85)();
20639 + vs_top=sup;
20640 + (V149->c.c_car)= vs_base[0];
20641 + if((V150=MMcdr(V150))==Cnil){
20642 + V148= base[1];
20643 + goto T310;}
20644 + V149=MMcdr(V149)=MMcons(Cnil,Cnil);
20645 + goto T311;}
20646 + goto T310;
20647 +T310:;
20648 + base[1]= make_cons(/* INLINE-ARGS */V147,V148);
20649 + vs_top=(vs_base=base+1)+1;
20650 + return;}
20651 + }
20652 +}
20653 +/* function definition for PREP-TY-FOR-PRINT */
20654 +
20655 +static void L48()
20656 +{register object *base=vs_base;
20657 + register object *sup=base+VM48; VC48
20658 + vs_check;
20659 + bds_check;
20660 + {object V151;
20661 + V151=(base[0]);
20662 + vs_top=sup;
20663 + goto TTL;
20664 +TTL:;
20665 + {object V152;
20666 + base[1]= (V151);
20667 + vs_top=(vs_base=base+1)+1;
20668 + (void) (*Lnk90)();
20669 + vs_top=sup;
20670 + V152= vs_base[0];
20671 + base[3]= (V152);
20672 + vs_top=(vs_base=base+3)+1;
20673 + (void) (*Lnk91)();
20674 + vs_top=sup;
20675 + base[2]= vs_base[0];
20676 + vs_top=(vs_base=base+2)+1;
20677 + (void) (*Lnk89)();
20678 + vs_top=sup;
20679 + base[1]= vs_base[0];
20680 + bds_bind(((object)VV[41]),base[1]);
20681 + base[2]= (V152);
20682 + vs_top=(vs_base=base+2)+1;
20683 + (void) (*Lnk85)();
20684 + bds_unwind1;
20685 + return;}
20686 + }
20687 +}
20688 +/* function definition for PREP-TERM-TY */
20689 +
20690 +static void L49()
20691 +{register object *base=vs_base;
20692 + register object *sup=base+VM49; VC49
20693 + vs_check;
20694 + {object V153;
20695 + V153=(base[0]);
20696 + vs_top=sup;
20697 + goto TTL;
20698 +TTL:;
20699 + if(!((CMPcar((V153)))==(((object)VV[0])))){
20700 + goto T321;}
20701 + base[1]= CMPcddr(CMPcdr((V153)));
20702 + vs_top=(vs_base=base+1)+1;
20703 + return;
20704 + goto T321;
20705 +T321:;
20706 + base[1]= CMPcddr((V153));
20707 + vs_top=(vs_base=base+1)+1;
20708 + return;
20709 + }
20710 +}
20711 +/* function definition for PRINT-MK_COMB-ERROR */
20712 +
20713 +static void L50()
20714 +{register object *base=vs_base;
20715 + register object *sup=base+VM50; VC50
20716 + vs_check;
20717 + {object V154;
20718 + object V155;
20719 + V154=(base[0]);
20720 + V155=(base[1]);
20721 + vs_top=sup;
20722 + goto TTL;
20723 +TTL:;
20724 + base[2]= ((object)VV[48]);
20725 + base[3]= small_fixnum(27);
20726 + vs_top=(vs_base=base+2)+2;
20727 + (void) (*Lnk92)();
20728 + vs_top=sup;
20729 + base[2]= small_fixnum(2);
20730 + base[3]= small_fixnum(4);
20731 + vs_top=(vs_base=base+2)+2;
20732 + (void) (*Lnk93)();
20733 + vs_top=sup;
20734 + base[3]= (V154);
20735 + vs_top=(vs_base=base+3)+1;
20736 + (void) (*Lnk94)();
20737 + vs_top=sup;
20738 + base[2]= vs_base[0];
20739 + vs_top=(vs_base=base+2)+1;
20740 + (void) (*Lnk95)();
20741 + vs_top=sup;
20742 + vs_base=vs_top;
20743 + (void) (*Lnk96)();
20744 + vs_top=sup;
20745 + base[2]= ((object)VV[49]);
20746 + base[3]= small_fixnum(27);
20747 + vs_top=(vs_base=base+2)+2;
20748 + (void) (*Lnk92)();
20749 + vs_top=sup;
20750 + base[2]= small_fixnum(2);
20751 + base[3]= small_fixnum(4);
20752 + vs_top=(vs_base=base+2)+2;
20753 + (void) (*Lnk93)();
20754 + vs_top=sup;
20755 + base[4]= (V154);
20756 + vs_top=(vs_base=base+4)+1;
20757 + (void) (*Lnk97)();
20758 + vs_top=sup;
20759 + base[3]= vs_base[0];
20760 + vs_top=(vs_base=base+3)+1;
20761 + (void) (*Lnk98)();
20762 + vs_top=sup;
20763 + base[2]= vs_base[0];
20764 + vs_top=(vs_base=base+2)+1;
20765 + (void) (*Lnk99)();
20766 + vs_top=sup;
20767 + vs_base=vs_top;
20768 + (void) (*Lnk96)();
20769 + vs_top=sup;
20770 + base[2]= ((object)VV[50]);
20771 + base[3]= small_fixnum(27);
20772 + vs_top=(vs_base=base+2)+2;
20773 + (void) (*Lnk92)();
20774 + vs_top=sup;
20775 + base[2]= small_fixnum(2);
20776 + base[3]= small_fixnum(4);
20777 + vs_top=(vs_base=base+2)+2;
20778 + (void) (*Lnk93)();
20779 + vs_top=sup;
20780 + base[3]= (V155);
20781 + vs_top=(vs_base=base+3)+1;
20782 + (void) (*Lnk94)();
20783 + vs_top=sup;
20784 + base[2]= vs_base[0];
20785 + vs_top=(vs_base=base+2)+1;
20786 + (void) (*Lnk95)();
20787 + vs_top=sup;
20788 + vs_base=vs_top;
20789 + (void) (*Lnk96)();
20790 + vs_top=sup;
20791 + base[2]= ((object)VV[51]);
20792 + base[3]= small_fixnum(27);
20793 + vs_top=(vs_base=base+2)+2;
20794 + (void) (*Lnk92)();
20795 + vs_top=sup;
20796 + base[2]= small_fixnum(2);
20797 + base[3]= small_fixnum(4);
20798 + vs_top=(vs_base=base+2)+2;
20799 + (void) (*Lnk93)();
20800 + vs_top=sup;
20801 + base[4]= (V155);
20802 + vs_top=(vs_base=base+4)+1;
20803 + (void) (*Lnk97)();
20804 + vs_top=sup;
20805 + base[3]= vs_base[0];
20806 + vs_top=(vs_base=base+3)+1;
20807 + (void) (*Lnk98)();
20808 + vs_top=sup;
20809 + base[2]= vs_base[0];
20810 + vs_top=(vs_base=base+2)+1;
20811 + (void) (*Lnk99)();
20812 + vs_top=sup;
20813 + vs_base=vs_top;
20814 + (void) (*Lnk96)();
20815 + vs_top=sup;
20816 + vs_base=vs_top;
20817 + (void) (*Lnk96)();
20818 + return;
20819 + }
20820 +}
20821 +/* function definition for Q-MK_COMB */
20822 +
20823 +static void L51()
20824 +{register object *base=vs_base;
20825 + register object *sup=base+VM51; VC51
20826 + vs_check;
20827 + {object V156;
20828 + object V157;
20829 + V156=(base[0]);
20830 + V157=(base[1]);
20831 + vs_top=sup;
20832 + goto TTL;
20833 +TTL:;
20834 + {object V158;
20835 + vs_base=vs_top;
20836 + (void) (*Lnk78)();
20837 + vs_top=sup;
20838 + V158= vs_base[0];
20839 + base[3]= (V156);
20840 + vs_top=(vs_base=base+3)+1;
20841 + (void) (*Lnk68)();
20842 + vs_top=sup;
20843 + base[2]= vs_base[0];
20844 + base[4]= (V157);
20845 + vs_top=(vs_base=base+4)+1;
20846 + (void) (*Lnk68)();
20847 + vs_top=sup;
20848 + V159= vs_base[0];
20849 + V160= list(2,V159,(V158));
20850 + base[3]= make_cons(((object)VV[36]),/* INLINE-ARGS */V160);
20851 + vs_top=(vs_base=base+2)+2;
20852 + (void) (*Lnk69)();
20853 + vs_top=sup;
20854 + if((vs_base[0])==Cnil){
20855 + goto T367;}
20856 + base[2]= listA(3,((object)VV[39]),make_cons((V156),(V157)),(V158));
20857 + vs_top=(vs_base=base+2)+1;
20858 + return;
20859 + goto T367;
20860 +T367:;
20861 + if(((((object)VV[52])->s.s_dbind))==Cnil){
20862 + goto T374;}
20863 + base[2]= (V156);
20864 + base[3]= (V157);
20865 + vs_top=(vs_base=base+2)+2;
20866 + (void) (*Lnk100)();
20867 + vs_top=sup;
20868 + goto T374;
20869 +T374:;
20870 + {object V161;
20871 + {frame_ptr fr;
20872 + fr=frs_sch_catch(((object)VV[2]));
20873 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
20874 + base[2]= ((object)VV[53]);
20875 + vs_top=(vs_base=base+2)+1;
20876 + unwind(fr,((object)VV[2]));}
20877 + base[2]= (V161);
20878 + vs_top=(vs_base=base+2)+1;
20879 + return;}}
20880 + }
20881 +}
20882 +/* function definition for ML-MK_COMB */
20883 +
20884 +static void L52()
20885 +{register object *VOL base=vs_base;
20886 + register object *VOL sup=base+VM52; VC52
20887 + vs_check;
20888 + {VOL object V162;
20889 + VOL object V163;
20890 + V162=(base[0]);
20891 + V163=(base[1]);
20892 + vs_top=sup;
20893 + goto TTL;
20894 +TTL:;
20895 + {VOL object V164;
20896 + VOL object V165;
20897 + VOL object V166;
20898 + {VOL object V167;
20899 + frs_push(FRS_CATCH,((object)VV[2]));
20900 + if(nlj_active)
20901 + {nlj_active=FALSE;frs_pop();
20902 + vs_top=sup;
20903 + V167= vs_base[0];
20904 + goto T382;}
20905 + else{
20906 + base[5]= CMPcddr((V162));
20907 + vs_top=(vs_base=base+5)+1;
20908 + (void) (*Lnk101)();
20909 + vs_top=sup;
20910 + V168= vs_base[0];
20911 + V169= make_cons(V168,Cnil);
20912 + frs_pop();
20913 + V167= V169;}
20914 + goto T382;
20915 +T382:;
20916 + if(!(type_of((V167))!=t_cons)){
20917 + goto T387;}
20918 + {frame_ptr fr;
20919 + fr=frs_sch_catch(((object)VV[2]));
20920 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
20921 + base[5]= ((object)VV[53]);
20922 + vs_top=(vs_base=base+5)+1;
20923 + unwind(fr,((object)VV[2]));}
20924 + goto T387;
20925 +T387:;
20926 + V164= CMPcar((V167));}
20927 + V165= CMPcar((V164));
20928 + V166= CMPcdr((V164));
20929 + if(!(((V165))==(((object)VV[36])))){
20930 + goto T393;}
20931 + if(!(equal(CMPcar((V166)),CMPcddr((V163))))){
20932 + goto T393;}
20933 + base[5]= listA(3,((object)VV[39]),make_cons((V162),(V163)),CMPcadr((V166)));
20934 + vs_top=(vs_base=base+5)+1;
20935 + return;
20936 + goto T393;
20937 +T393:;
20938 + {frame_ptr fr;
20939 + fr=frs_sch_catch(((object)VV[2]));
20940 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
20941 + base[5]= ((object)VV[53]);
20942 + vs_top=(vs_base=base+5)+1;
20943 + unwind(fr,((object)VV[2]));}}
20944 + }
20945 +}
20946 +/* function definition for ML-IS_COMB */
20947 +
20948 +static void L53()
20949 +{register object *base=vs_base;
20950 + register object *sup=base+VM53; VC53
20951 + vs_check;
20952 + {object V171;
20953 + V171=(base[0]);
20954 + vs_top=sup;
20955 + goto TTL;
20956 +TTL:;
20957 + base[1]= ((CMPcar((V171)))==(((object)VV[39]))?Ct:Cnil);
20958 + vs_top=(vs_base=base+1)+1;
20959 + return;
20960 + }
20961 +}
20962 +/* function definition for ML-DEST_COMB */
20963 +
20964 +static void L54()
20965 +{register object *base=vs_base;
20966 + register object *sup=base+VM54; VC54
20967 + vs_check;
20968 + {object V172;
20969 + V172=(base[0]);
20970 + vs_top=sup;
20971 + goto TTL;
20972 +TTL:;
20973 + if(!(eql(CMPcar((V172)),((object)VV[39])))){
20974 + goto T400;}
20975 + V173= CMPcdr((V172));
20976 + goto T398;
20977 + goto T400;
20978 +T400:;
20979 + {frame_ptr fr;
20980 + fr=frs_sch_catch(((object)VV[2]));
20981 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
20982 + base[1]= ((object)VV[54]);
20983 + vs_top=(vs_base=base+1)+1;
20984 + unwind(fr,((object)VV[2]));}
20985 + goto T398;
20986 +T398:;
20987 + base[1]= CMPcar(V173);
20988 + vs_top=(vs_base=base+1)+1;
20989 + return;
20990 + }
20991 +}
20992 +/* function definition for Q-MK_TYPED */
20993 +
20994 +static void L55()
20995 +{register object *base=vs_base;
20996 + register object *sup=base+VM55; VC55
20997 + vs_check;
20998 + {object V174;
20999 + object V175;
21000 + V174=(base[0]);
21001 + V175=(base[1]);
21002 + vs_top=sup;
21003 + goto TTL;
21004 +TTL:;
21005 + base[3]= (V174);
21006 + vs_top=(vs_base=base+3)+1;
21007 + (void) (*Lnk68)();
21008 + vs_top=sup;
21009 + base[2]= vs_base[0];
21010 + base[4]= (V175);
21011 + vs_top=(vs_base=base+4)+1;
21012 + (void) (*Lnk104)();
21013 + vs_top=sup;
21014 + base[3]= vs_base[0];
21015 + vs_top=(vs_base=base+2)+2;
21016 + (void) (*Lnk69)();
21017 + vs_top=sup;
21018 + if((vs_base[0])==Cnil){
21019 + goto T404;}
21020 + base[2]= (V174);
21021 + vs_top=(vs_base=base+2)+1;
21022 + return;
21023 + goto T404;
21024 +T404:;
21025 + {frame_ptr fr;
21026 + fr=frs_sch_catch(((object)VV[2]));
21027 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
21028 + base[2]= ((object)VV[55]);
21029 + vs_top=(vs_base=base+2)+1;
21030 + unwind(fr,((object)VV[2]));}
21031 + }
21032 +}
21033 +/* function definition for Q-MK_PAIR */
21034 +
21035 +static void L56()
21036 +{register object *base=vs_base;
21037 + register object *sup=base+VM56; VC56
21038 + vs_check;
21039 + {object V176;
21040 + object V177;
21041 + V176=(base[0]);
21042 + V177=(base[1]);
21043 + vs_top=sup;
21044 + goto TTL;
21045 +TTL:;
21046 + base[4]= ((object)VV[56]);
21047 + vs_top=(vs_base=base+4)+1;
21048 + (void) (*Lnk105)();
21049 + vs_top=sup;
21050 + base[3]= vs_base[0];
21051 + base[4]= (V176);
21052 + vs_top=(vs_base=base+3)+2;
21053 + (void) (*Lnk106)();
21054 + vs_top=sup;
21055 + base[2]= vs_base[0];
21056 + base[3]= (V177);
21057 + vs_top=(vs_base=base+2)+2;
21058 + (void) (*Lnk106)();
21059 + return;
21060 + }
21061 +}
21062 +/* function definition for Q-MK_COND */
21063 +
21064 +static void L57()
21065 +{register object *base=vs_base;
21066 + register object *sup=base+VM57; VC57
21067 + vs_check;
21068 + {object V178;
21069 + object V179;
21070 + object V180;
21071 + V178=(base[0]);
21072 + V179=(base[1]);
21073 + V180=(base[2]);
21074 + vs_top=sup;
21075 + goto TTL;
21076 +TTL:;
21077 + base[6]= ((object)VV[57]);
21078 + vs_top=(vs_base=base+6)+1;
21079 + (void) (*Lnk105)();
21080 + vs_top=sup;
21081 + base[5]= vs_base[0];
21082 + base[6]= (V178);
21083 + vs_top=(vs_base=base+5)+2;
21084 + (void) (*Lnk106)();
21085 + vs_top=sup;
21086 + base[4]= vs_base[0];
21087 + base[5]= (V179);
21088 + vs_top=(vs_base=base+4)+2;
21089 + (void) (*Lnk106)();
21090 + vs_top=sup;
21091 + base[3]= vs_base[0];
21092 + base[4]= (V180);
21093 + vs_top=(vs_base=base+3)+2;
21094 + (void) (*Lnk106)();
21095 + return;
21096 + }
21097 +}
21098 +/* function definition for Q-MK_VARTYPE */
21099 +
21100 +static void L58()
21101 +{register object *base=vs_base;
21102 + register object *sup=base+VM58; VC58
21103 + vs_check;
21104 + {register object V181;
21105 + V181=(base[0]);
21106 + vs_top=sup;
21107 + goto TTL;
21108 +TTL:;
21109 + {object V182;
21110 + {object V183 =((V181))->s.s_plist;
21111 + object ind= ((object)VV[58]);
21112 + while(V183!=Cnil){
21113 + if(V183->c.c_car==ind){
21114 + V182= (V183->c.c_cdr->c.c_car);
21115 + goto T423;
21116 + }else V183=V183->c.c_cdr->c.c_cdr;}
21117 + V182= Cnil;}
21118 + goto T423;
21119 +T423:;
21120 + if(((V182))==Cnil){
21121 + goto T425;}
21122 + base[1]= (V182);
21123 + vs_top=(vs_base=base+1)+1;
21124 + return;
21125 + goto T425;
21126 +T425:;
21127 + base[1]= (V181);
21128 + vs_top=(vs_base=base+1)+1;
21129 + (void) (*Lnk107)();
21130 + vs_top=sup;
21131 + V184= vs_base[0];
21132 + if(!(number_compare(CMPcar(V184),small_fixnum(42))==0)){
21133 + goto T428;}
21134 + V185= make_cons(((object)VV[47]),(V181));
21135 + base[1]= sputprop((V181),((object)VV[58]),/* INLINE-ARGS */V185);
21136 + vs_top=(vs_base=base+1)+1;
21137 + return;
21138 + goto T428;
21139 +T428:;
21140 + {frame_ptr fr;
21141 + fr=frs_sch_catch(((object)VV[2]));
21142 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
21143 + base[1]= ((object)VV[58]);
21144 + vs_top=(vs_base=base+1)+1;
21145 + unwind(fr,((object)VV[2]));}}
21146 + }
21147 +}
21148 +/* function definition for ML-IS_VARTYPE */
21149 +
21150 +static void L59()
21151 +{register object *base=vs_base;
21152 + register object *sup=base+VM59; VC59
21153 + vs_check;
21154 + {object V186;
21155 + V186=(base[0]);
21156 + vs_top=sup;
21157 + goto TTL;
21158 +TTL:;
21159 + base[1]= ((CMPcar((V186)))==(((object)VV[47]))?Ct:Cnil);
21160 + vs_top=(vs_base=base+1)+1;
21161 + return;
21162 + }
21163 +}
21164 +/* function definition for ML-DEST_VARTYPE */
21165 +
21166 +static void L60()
21167 +{register object *base=vs_base;
21168 + register object *sup=base+VM60; VC60
21169 + vs_check;
21170 + {object V187;
21171 + V187=(base[0]);
21172 + vs_top=sup;
21173 + goto TTL;
21174 +TTL:;
21175 + if(!((CMPcar((V187)))==(((object)VV[47])))){
21176 + goto T434;}
21177 + base[1]= CMPcdr((V187));
21178 + vs_top=(vs_base=base+1)+1;
21179 + return;
21180 + goto T434;
21181 +T434:;
21182 + {frame_ptr fr;
21183 + fr=frs_sch_catch(((object)VV[2]));
21184 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
21185 + base[1]= ((object)VV[59]);
21186 + vs_top=(vs_base=base+1)+1;
21187 + unwind(fr,((object)VV[2]));}
21188 + }
21189 +}
21190 +/* function definition for Q-MK_TYPE */
21191 +
21192 +static void L61()
21193 +{register object *base=vs_base;
21194 + register object *sup=base+VM61; VC61
21195 + vs_check;
21196 + {object V188;
21197 + object V189;
21198 + V188=(base[0]);
21199 + V189=(base[1]);
21200 + vs_top=sup;
21201 + goto TTL;
21202 +TTL:;
21203 + {object V191 =((V188))->s.s_plist;
21204 + object ind= ((object)VV[60]);
21205 + while(V191!=Cnil){
21206 + if(V191->c.c_car==ind){
21207 + V190= (V191->c.c_cdr->c.c_car);
21208 + goto T440;
21209 + }else V191=V191->c.c_cdr->c.c_cdr;}
21210 + V190= Cnil;}
21211 + goto T440;
21212 +T440:;
21213 + V192 = CMPmake_fixnum((long)length((V189)));
21214 + if(equal(V190,V192)){
21215 + goto T438;}
21216 + {frame_ptr fr;
21217 + fr=frs_sch_catch(((object)VV[2]));
21218 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
21219 + base[2]= ((object)VV[61]);
21220 + vs_top=(vs_base=base+2)+1;
21221 + unwind(fr,((object)VV[2]));}
21222 + goto T438;
21223 +T438:;
21224 + if(((V189))!=Cnil){
21225 + goto T443;}
21226 + {object V193 =((V188))->s.s_plist;
21227 + object ind= ((object)VV[62]);
21228 + while(V193!=Cnil){
21229 + if(V193->c.c_car==ind){
21230 + base[2]= (V193->c.c_cdr->c.c_car);
21231 + vs_top=(vs_base=base+2)+1;
21232 + return;
21233 + }else V193=V193->c.c_cdr->c.c_cdr;}
21234 + base[2]= Cnil;
21235 + vs_top=(vs_base=base+2)+1;
21236 + return;}
21237 + goto T443;
21238 +T443:;
21239 + base[2]= make_cons((V188),(V189));
21240 + vs_top=(vs_base=base+2)+1;
21241 + return;
21242 + }
21243 +}
21244 +/* function definition for ML-DEST_TYPE */
21245 +
21246 +static void L62()
21247 +{register object *base=vs_base;
21248 + register object *sup=base+VM62; VC62
21249 + vs_check;
21250 + {object V194;
21251 + V194=(base[0]);
21252 + vs_top=sup;
21253 + goto TTL;
21254 +TTL:;
21255 + if(!((CMPcar((V194)))==(((object)VV[47])))){
21256 + goto T446;}
21257 + {frame_ptr fr;
21258 + fr=frs_sch_catch(((object)VV[2]));
21259 + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2]));
21260 + base[1]= ((object)VV[63]);
21261 + vs_top=(vs_base=base+1)+1;
21262 + unwind(fr,((object)VV[2]));}
21263 + goto T446;
21264 +T446:;
21265 + base[1]= (V194);
21266 + vs_top=(vs_base=base+1)+1;
21267 + return;
21268 + }
21269 +}
21270 +/* function definition for ML-TYPE_OF */
21271 +
21272 +static void L63()
21273 +{register object *base=vs_base;
21274 + register object *sup=base+VM63; VC63
21275 + vs_check;
21276 + {object V195;
21277 + V195=(base[0]);
21278 + vs_top=sup;
21279 + goto TTL;
21280 +TTL:;
21281 + base[1]= CMPcddr((V195));
21282 + vs_top=(vs_base=base+1)+1;
21283 + return;
21284 + }
21285 +}
21286 +/* function definition for Q-TYPEOF */
21287 +
21288 +static void L64()
21289 +{register object *base=vs_base;
21290 + register object *sup=base+VM64; VC64
21291 + vs_check;
21292 + {object V196;
21293 + V196=(base[0]);
21294 + vs_top=sup;
21295 + goto TTL;
21296 +TTL:;
21297 + base[1]= (V196);
21298 + vs_top=(vs_base=base+1)+1;
21299 + (void) (*Lnk70)();
21300 + vs_top=sup;
21301 + V197= vs_base[0];
21302 + base[1]= CMPcddr(V197);
21303 + vs_top=(vs_base=base+1)+1;
21304 + return;
21305 + }
21306 +}
21307 +/* function definition for STRIP-ANTIQUOT */
21308 +
21309 +static void L65()
21310 +{register object *base=vs_base;
21311 + register object *sup=base+VM65; VC65
21312 + vs_check;
21313 + {register object V198;
21314 + V198=(base[0]);
21315 + vs_top=sup;
21316 + goto TTL;
21317 +TTL:;
21318 + goto T453;
21319 +T453:;
21320 + if(!((CMPcar((V198)))==(((object)VV[0])))){
21321 + goto T456;}
21322 + V198= CMPcdr((V198));
21323 + goto T453;
21324 + goto T456;
21325 +T456:;
21326 + goto T451;
21327 + goto T451;
21328 + goto T451;
21329 +T451:;
21330 + base[1]= (V198);
21331 + vs_top=(vs_base=base+1)+1;
21332 + return;
21333 + }
21334 +}
21335 +/* function definition for ML-THM_COUNT */
21336 +
21337 +static void L66()
21338 +{register object *base=vs_base;
21339 + register object *sup=base+VM66; VC66
21340 + vs_check;
21341 + vs_top=sup;
21342 + goto TTL;
21343 +TTL:;
21344 + base[0]= (((object)VV[64])->s.s_dbind);
21345 + vs_top=(vs_base=base+0)+1;
21346 + return;
21347 +}
21348 +/* function definition for ML-MK_THM */
21349 +
21350 +static void L67()
21351 +{register object *base=vs_base;
21352 + register object *sup=base+VM67; VC67
21353 + vs_check;
21354 + {object V199;
21355 + V199=(base[0]);
21356 + vs_top=sup;
21357 + goto TTL;
21358 +TTL:;
21359 + (((object)VV[64])->s.s_dbind)= number_plus((((object)VV[64])->s.s_dbind),small_fixnum(1));
21360 + base[1]= (V199);
21361 + vs_top=(vs_base=base+1)+1;
21362 + return;
21363 + }
21364 +}
21365 +/* function definition for ML-DEST_THM */
21366 +
21367 +static void L68()
21368 +{register object *base=vs_base;
21369 + register object *sup=base+VM68; VC68
21370 + vs_check;
21371 + {object V200;
21372 + V200=(base[0]);
21373 + vs_top=sup;
21374 + goto TTL;
21375 +TTL:;
21376 + base[1]= (V200);
21377 + vs_top=(vs_base=base+1)+1;
21378 + return;
21379 + }
21380 +}
21381 +/* function definition for PREDICATEP */
21382 +
21383 +static void L69()
21384 +{register object *base=vs_base;
21385 + register object *sup=base+VM69; VC69
21386 + vs_check;
21387 + {object V201;
21388 + V201=(base[0]);
21389 + vs_top=sup;
21390 + goto TTL;
21391 +TTL:;
21392 + {object V202 =((V201))->s.s_plist;
21393 + object ind= ((object)VV[65]);
21394 + while(V202!=Cnil){
21395 + if(V202->c.c_car==ind){
21396 + base[1]= (V202->c.c_cdr->c.c_car);
21397 + vs_top=(vs_base=base+1)+1;
21398 + return;
21399 + }else V202=V202->c.c_cdr->c.c_cdr;}
21400 + base[1]= Cnil;
21401 + vs_top=(vs_base=base+1)+1;
21402 + return;}
21403 + }
21404 +}
21405 +/* function definition for CONSTP */
21406 +
21407 +static void L70()
21408 +{register object *base=vs_base;
21409 + register object *sup=base+VM70; VC70
21410 + vs_check;
21411 + {object V203;
21412 + V203=(base[0]);
21413 + vs_top=sup;
21414 + goto TTL;
21415 +TTL:;
21416 + {object V204 =((V203))->s.s_plist;
21417 + object ind= ((object)VV[27]);
21418 + while(V204!=Cnil){
21419 + if(V204->c.c_car==ind){
21420 + base[1]= (V204->c.c_cdr->c.c_car);
21421 + vs_top=(vs_base=base+1)+1;
21422 + return;
21423 + }else V204=V204->c.c_cdr->c.c_cdr;}
21424 + base[1]= Cnil;
21425 + vs_top=(vs_base=base+1)+1;
21426 + return;}
21427 + }
21428 +}
21429 +static void LnkT107(){ call_or_link(((object)VV[107]),(void **)(void *)&Lnk107);} /* EXPLODEN */
21430 +static void LnkT106(){ call_or_link(((object)VV[106]),(void **)(void *)&Lnk106);} /* Q-MK_COMB */
21431 +static void LnkT105(){ call_or_link(((object)VV[105]),(void **)(void *)&Lnk105);} /* Q-MK_CONST */
21432 +static void LnkT104(){ call_or_link(((object)VV[104]),(void **)(void *)&Lnk104);} /* Q-MK_ANTIQUOT */
21433 +static object LnkTLI103(object first,...){object V1;va_list ap;va_start(ap,first);V1=call_proc_new(((object)VV[103]),(void **)(void *)&LnkLI103,1,first,ap);va_end(ap);return V1;} /* SECOND */
21434 +static object LnkTLI102(object first,...){object V1;va_list ap;va_start(ap,first);V1=call_proc_new(((object)VV[102]),(void **)(void *)&LnkLI102,1,first,ap);va_end(ap);return V1;} /* FIRST */
21435 +static void LnkT101(){ call_or_link(((object)VV[101]),(void **)(void *)&Lnk101);} /* ML-DEST_TYPE */
21436 +static void LnkT100(){ call_or_link(((object)VV[100]),(void **)(void *)&Lnk100);} /* PRINT-MK_COMB-ERROR */
21437 +static void LnkT99(){ call_or_link(((object)VV[99]),(void **)(void *)&Lnk99);} /* ML-PRINT_TYPE */
21438 +static void LnkT98(){ call_or_link(((object)VV[98]),(void **)(void *)&Lnk98);} /* PREP-TY-FOR-PRINT */
21439 +static void LnkT97(){ call_or_link(((object)VV[97]),(void **)(void *)&Lnk97);} /* PREP-TERM-TY */
21440 +static void LnkT96(){ call_or_link(((object)VV[96]),(void **)(void *)&Lnk96);} /* PNEWLINE */
21441 +static void LnkT95(){ call_or_link(((object)VV[95]),(void **)(void *)&Lnk95);} /* ML-PRINT_TERM */
21442 +static void LnkT94(){ call_or_link(((object)VV[94]),(void **)(void *)&Lnk94);} /* PREP-TERM-FOR-PRINT */
21443 +static void LnkT93(){ call_or_link(((object)VV[93]),(void **)(void *)&Lnk93);} /* PBREAK */
21444 +static void LnkT92(){ call_or_link(((object)VV[92]),(void **)(void *)&Lnk92);} /* PSTRINGLEN */
21445 +static void LnkT91(){ call_or_link(((object)VV[91]),(void **)(void *)&Lnk91);} /* GET-TYPE-LINKS */
21446 +static void LnkT90(){ call_or_link(((object)VV[90]),(void **)(void *)&Lnk90);} /* ADD-TYPE-LINKS */
21447 +static void LnkT89(){ call_or_link(((object)VV[89]),(void **)(void *)&Lnk89);} /* MAKE-LINK-NAMES */
21448 +static void LnkT88(){ call_or_link(((object)VV[88]),(void **)(void *)&Lnk88);} /* GET-TERM-LINKS */
21449 +static void LnkT87(){ call_or_link(((object)VV[87]),(void **)(void *)&Lnk87);} /* ADD-TERM-LINKS */
21450 +static void LnkT86(){ call_or_link(((object)VV[86]),(void **)(void *)&Lnk86);} /* PREP-TERM-FN */
21451 +static void LnkT85(){ call_or_link(((object)VV[85]),(void **)(void *)&Lnk85);} /* PREP-TY-FN */
21452 +static void LnkT84(){ call_or_link(((object)VV[84]),(void **)(void *)&Lnk84);} /* ML-MK_ABS */
21453 +static void LnkT83(){ call_or_link(((object)VV[83]),(void **)(void *)&Lnk83);} /* CONCAT */
21454 +static void LnkT81(){ call_or_link(((object)VV[81]),(void **)(void *)&Lnk81);} /* MK_REALVAR */
21455 +static void LnkT80(){ call_or_link(((object)VV[80]),(void **)(void *)&Lnk80);} /* UNIQUESYM */
21456 +static void LnkT79(){ call_or_link(((object)VV[79]),(void **)(void *)&Lnk79);} /* CONSPROP */
21457 +static void LnkT78(){ call_or_link(((object)VV[78]),(void **)(void *)&Lnk78);} /* GENLINK */
21458 +static void LnkT77(){ call_or_link(((object)VV[77]),(void **)(void *)&Lnk77);} /* NEW-VAR-TYPE */
21459 +static void LnkT76(){ call_or_link(((object)VV[76]),(void **)(void *)&Lnk76);} /* ASSOC1 */
21460 +static void LnkT75(){ call_or_link(((object)VV[75]),(void **)(void *)&Lnk75);} /* Q-MK_PRED */
21461 +static void LnkT74(){ call_or_link(((object)VV[74]),(void **)(void *)&Lnk74);} /* Q-MK_PAIR */
21462 +static void LnkT73(){ call_or_link(((object)VV[73]),(void **)(void *)&Lnk73);} /* ML-MK_EXISTS */
21463 +static void LnkT72(){ call_or_link(((object)VV[72]),(void **)(void *)&Lnk72);} /* ML-MK_FORALL */
21464 +static void LnkT71(){ call_or_link(((object)VV[71]),(void **)(void *)&Lnk71);} /* Q-FREE-VAR */
21465 +static void LnkT70(){ call_or_link(((object)VV[70]),(void **)(void *)&Lnk70);} /* STRIP-ANTIQUOT */
21466 +static void LnkT69(){ call_or_link(((object)VV[69]),(void **)(void *)&Lnk69);} /* UNIFY */
21467 +static void LnkT68(){ call_or_link(((object)VV[68]),(void **)(void *)&Lnk68);} /* Q-TYPEOF */
21468 +static void LnkT67(){ call_or_link(((object)VV[67]),(void **)(void *)&Lnk67);} /* OMUTANT */
21469 +static void LnkT66(){ call_or_link(((object)VV[66]),(void **)(void *)&Lnk66);} /* PREDICATEP */
21470 --- hol88-2.02.19940316.orig/lisp/f-iox-stand.l
21471 +++ hol88-2.02.19940316/lisp/f-iox-stand.l
21472 @@ -283,7 +283,7 @@
21473
21474 (defun find-file1 (dir name exts)
21475 (do
21476 - ((exts exts (cdr exts))
21477 + ((exts (cons "" exts) (cdr exts))
21478 (file nil))
21479 ((null exts) nil)
21480 (setq file (catenate dir name (car exts)))
21481 --- hol88-2.02.19940316.orig/Library/numeral/Manual/theorems.tex
21482 +++ hol88-2.02.19940316/Library/numeral/Manual/theorems.tex
21483 @@ -1,13 +1,4 @@
21484 -\chapter{Pre-proved Theorems}
21485 -\input{theorems-intro}
21486 -\section{Numeral theory}
21487 -\THEOREM BASEN numeral
21488 -|- (!radix. BASEN radix[] = 0) /\
21489 - (!radix digit digits.
21490 - BASEN radix(CONS digit digits) =
21491 - (digit * (radix EXP (LENGTH digits))) + (BASEN radix digits))
21492 -\ENDTHEOREM
21493 -\THEOREM BASEN\_11 numeral
21494 +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{Numeral theory}\THEOREM BASEN\_11 numeral
21495 |- !r l1 l2.
21496 1 < r ==>
21497 IS_BASEN r l1 ==>
21498 @@ -24,14 +15,20 @@
21499 \THEOREM BASEN\_CONS\_0 numeral
21500 |- !r l. BASEN r(CONS 0 l) = BASEN r l
21501 \ENDTHEOREM
21502 +\THEOREM BASEN\_DIGIT\_EQ\_DIGIT numeral
21503 +|- !r e. BASEN r[e] = e
21504 +\ENDTHEOREM
21505 \THEOREM BASEN\_DIGITS numeral
21506 |- !n m r.
21507 1 < r ==>
21508 (LENGTH(BASEN_DIGITS r n m) = n) /\
21509 (BASEN r(BASEN_DIGITS r n m) = m MOD (r EXP n))
21510 \ENDTHEOREM
21511 -\THEOREM BASEN\_DIGIT\_EQ\_DIGIT numeral
21512 -|- !r e. BASEN r[e] = e
21513 +\THEOREM BASEN numeral
21514 +|- (!radix. BASEN radix[] = 0) /\
21515 + (!radix digit digits.
21516 + BASEN radix(CONS digit digits) =
21517 + (digit * (radix EXP (LENGTH digits))) + (BASEN radix digits))
21518 \ENDTHEOREM
21519 \THEOREM BASEN\_EMPTY\_EQ\_0 numeral
21520 |- !r l. 1 < r ==> IS_NORMALIZED l ==> ((BASEN r l = 0) = (l = []))
21521 @@ -85,9 +82,6 @@
21522 \THEOREM BASEN\_ZEROS numeral
21523 |- !r n. BASEN r(REPLICATE n 0) = 0
21524 \ENDTHEOREM
21525 -\THEOREM BINARY numeral
21526 -|- BINARY = BASEN 2
21527 -\ENDTHEOREM
21528 \THEOREM BINARY\_11 numeral
21529 |- !l1 l2.
21530 IS_BINARY l1 ==>
21531 @@ -102,6 +96,9 @@
21532 \THEOREM BINARY\_DIGIT\_EQ\_DIGIT numeral
21533 |- !e. BINARY[e] = e
21534 \ENDTHEOREM
21535 +\THEOREM BINARY numeral
21536 +|- BINARY = BASEN 2
21537 +\ENDTHEOREM
21538 \THEOREM BINARY\_EMPTY\_EQ\_0 numeral
21539 |- !l. IS_NORMALIZED l ==> ((BINARY l = 0) = (l = []))
21540 \ENDTHEOREM
21541 @@ -134,9 +131,6 @@
21542 \THEOREM BINARY\_ZEROS numeral
21543 |- !n. BINARY(REPLICATE n 0) = 0
21544 \ENDTHEOREM
21545 -\THEOREM DECIMAL numeral
21546 -|- DECIMAL = BASEN 10
21547 -\ENDTHEOREM
21548 \THEOREM DECIMAL\_11 numeral
21549 |- !l1 l2.
21550 IS_DECIMAL l1 ==>
21551 @@ -151,6 +145,9 @@
21552 \THEOREM DECIMAL\_DIGIT\_EQ\_DIGIT numeral
21553 |- !e. DECIMAL[e] = e
21554 \ENDTHEOREM
21555 +\THEOREM DECIMAL numeral
21556 +|- DECIMAL = BASEN 10
21557 +\ENDTHEOREM
21558 \THEOREM DECIMAL\_EMPTY\_EQ\_0 numeral
21559 |- !l. IS_NORMALIZED l ==> ((DECIMAL l = 0) = (l = []))
21560 \ENDTHEOREM
21561 @@ -183,9 +180,6 @@
21562 \THEOREM DECIMAL\_ZEROS numeral
21563 |- !n. DECIMAL(REPLICATE n 0) = 0
21564 \ENDTHEOREM
21565 -\THEOREM HEX numeral
21566 -|- HEX = BASEN 16
21567 -\ENDTHEOREM
21568 \THEOREM HEX\_11 numeral
21569 |- !l1 l2.
21570 IS_HEX l1 ==>
21571 @@ -200,6 +194,9 @@
21572 \THEOREM HEX\_DIGIT\_EQ\_DIGIT numeral
21573 |- !e. HEX[e] = e
21574 \ENDTHEOREM
21575 +\THEOREM HEX numeral
21576 +|- HEX = BASEN 16
21577 +\ENDTHEOREM
21578 \THEOREM HEX\_EMPTY\_EQ\_0 numeral
21579 |- !l. IS_NORMALIZED l ==> ((HEX l = 0) = (l = []))
21580 \ENDTHEOREM
21581 @@ -232,9 +229,6 @@
21582 \THEOREM HEX\_ZEROS numeral
21583 |- !n. HEX(REPLICATE n 0) = 0
21584 \ENDTHEOREM
21585 -\THEOREM IS\_BASEN numeral
21586 -|- !radix digits. IS_BASEN radix digits = EVERY($> radix)digits
21587 -\ENDTHEOREM
21588 \THEOREM IS\_BASEN\_APPEND numeral
21589 |- !r l m. IS_BASEN r(APPEND l m) = IS_BASEN r l /\ IS_BASEN r m
21590 \ENDTHEOREM
21591 @@ -250,12 +244,12 @@
21592 \THEOREM IS\_BASEN\_CONS\_IMP\_LESS numeral
21593 |- !r l e. 1 < r ==> IS_BASEN r(CONS e l) ==> e < r
21594 \ENDTHEOREM
21595 +\THEOREM IS\_BASEN numeral
21596 +|- !radix digits. IS_BASEN radix digits = EVERY($> radix)digits
21597 +\ENDTHEOREM
21598 \THEOREM IS\_BASEN\_NIL numeral
21599 |- !r. IS_BASEN r[]
21600 \ENDTHEOREM
21601 -\THEOREM IS\_BINARY numeral
21602 -|- IS_BINARY = IS_BASEN 2
21603 -\ENDTHEOREM
21604 \THEOREM IS\_BINARY\_CONS numeral
21605 |- !l e. IS_BINARY(CONS e l) = e < 2 /\ IS_BINARY l
21606 \ENDTHEOREM
21607 @@ -265,6 +259,9 @@
21608 \THEOREM IS\_BINARY\_CONS\_IMP\_LESS numeral
21609 |- !l e. IS_BINARY(CONS e l) ==> e < 2
21610 \ENDTHEOREM
21611 +\THEOREM IS\_BINARY numeral
21612 +|- IS_BINARY = IS_BASEN 2
21613 +\ENDTHEOREM
21614 \THEOREM IS\_BINARY\_NIL numeral
21615 |- IS_BINARY[]
21616 \ENDTHEOREM
21617 @@ -273,9 +270,6 @@
21618 IS_BINARY_NORMALIZED digits =
21619 IS_BINARY digits /\ IS_NORMALIZED digits
21620 \ENDTHEOREM
21621 -\THEOREM IS\_DECIMAL numeral
21622 -|- IS_DECIMAL = IS_BASEN 10
21623 -\ENDTHEOREM
21624 \THEOREM IS\_DECIMAL\_CONS numeral
21625 |- !l e. IS_DECIMAL(CONS e l) = e < 10 /\ IS_DECIMAL l
21626 \ENDTHEOREM
21627 @@ -285,6 +279,9 @@
21628 \THEOREM IS\_DECIMAL\_CONS\_IMP\_LESS numeral
21629 |- !l e. IS_DECIMAL(CONS e l) ==> e < 10
21630 \ENDTHEOREM
21631 +\THEOREM IS\_DECIMAL numeral
21632 +|- IS_DECIMAL = IS_BASEN 10
21633 +\ENDTHEOREM
21634 \THEOREM IS\_DECIMAL\_NIL numeral
21635 |- IS_DECIMAL[]
21636 \ENDTHEOREM
21637 @@ -293,9 +290,6 @@
21638 IS_DECIMAL_NORMALIZED digits =
21639 IS_DECIMAL digits /\ IS_NORMALIZED digits
21640 \ENDTHEOREM
21641 -\THEOREM IS\_HEX numeral
21642 -|- IS_HEX = IS_BASEN 16
21643 -\ENDTHEOREM
21644 \THEOREM IS\_HEX\_CONS numeral
21645 |- !l e. IS_HEX(CONS e l) = e < 16 /\ IS_HEX l
21646 \ENDTHEOREM
21647 @@ -305,6 +299,9 @@
21648 \THEOREM IS\_HEX\_CONS\_IMP\_LESS numeral
21649 |- !l e. IS_HEX(CONS e l) ==> e < 16
21650 \ENDTHEOREM
21651 +\THEOREM IS\_HEX numeral
21652 +|- IS_HEX = IS_BASEN 16
21653 +\ENDTHEOREM
21654 \THEOREM IS\_HEX\_NIL numeral
21655 |- IS_HEX[]
21656 \ENDTHEOREM
21657 @@ -312,18 +309,15 @@
21658 |- !digits.
21659 IS_HEX_NORMALIZED digits = IS_HEX digits /\ IS_NORMALIZED digits
21660 \ENDTHEOREM
21661 -\THEOREM IS\_NORMALIZED numeral
21662 -|- !digits. IS_NORMALIZED digits = (digits = []) \/ 0 < (HD digits)
21663 -\ENDTHEOREM
21664 \THEOREM IS\_NORMALIZED\_CONS numeral
21665 |- !e l. IS_NORMALIZED(CONS e l) = 0 < e
21666 \ENDTHEOREM
21667 +\THEOREM IS\_NORMALIZED numeral
21668 +|- !digits. IS_NORMALIZED digits = (digits = []) \/ 0 < (HD digits)
21669 +\ENDTHEOREM
21670 \THEOREM IS\_NORMALIZED\_NIL numeral
21671 |- IS_NORMALIZED[]
21672 \ENDTHEOREM
21673 -\THEOREM IS\_OCTAL numeral
21674 -|- IS_OCTAL = IS_BASEN 8
21675 -\ENDTHEOREM
21676 \THEOREM IS\_OCTAL\_CONS numeral
21677 |- !l e. IS_OCTAL(CONS e l) = e < 8 /\ IS_OCTAL l
21678 \ENDTHEOREM
21679 @@ -333,6 +327,9 @@
21680 \THEOREM IS\_OCTAL\_CONS\_IMP\_LESS numeral
21681 |- !l e. IS_OCTAL(CONS e l) ==> e < 8
21682 \ENDTHEOREM
21683 +\THEOREM IS\_OCTAL numeral
21684 +|- IS_OCTAL = IS_BASEN 8
21685 +\ENDTHEOREM
21686 \THEOREM IS\_OCTAL\_NIL numeral
21687 |- IS_OCTAL[]
21688 \ENDTHEOREM
21689 @@ -340,12 +337,12 @@
21690 |- !digits.
21691 IS_OCTAL_NORMALIZED digits = IS_OCTAL digits /\ IS_NORMALIZED digits
21692 \ENDTHEOREM
21693 -\THEOREM LOG numeral
21694 -|- !r n. LOG r n = (@x. (r EXP x) <= n /\ n < (r EXP (x + 1)))
21695 -\ENDTHEOREM
21696 \THEOREM LOG\_1 numeral
21697 |- !r. 1 < r ==> (LOG r 1 = 0)
21698 \ENDTHEOREM
21699 +\THEOREM LOG numeral
21700 +|- !r n. LOG r n = (@x. (r EXP x) <= n /\ n < (r EXP (x + 1)))
21701 +\ENDTHEOREM
21702 \THEOREM NORMALIZED\_BASEN\_11 numeral
21703 |- !l1 l2 r.
21704 1 < r ==>
21705 @@ -376,9 +373,6 @@
21706 (BASEN r l1 = BASEN r l2) /\
21707 (LENGTH l1) < (LENGTH l2))
21708 \ENDTHEOREM
21709 -\THEOREM OCTAL numeral
21710 -|- OCTAL = BASEN 8
21711 -\ENDTHEOREM
21712 \THEOREM OCTAL\_11 numeral
21713 |- !l1 l2.
21714 IS_OCTAL l1 ==>
21715 @@ -393,6 +387,9 @@
21716 \THEOREM OCTAL\_DIGIT\_EQ\_DIGIT numeral
21717 |- !e. OCTAL[e] = e
21718 \ENDTHEOREM
21719 +\THEOREM OCTAL numeral
21720 +|- OCTAL = BASEN 8
21721 +\ENDTHEOREM
21722 \THEOREM OCTAL\_EMPTY\_EQ\_0 numeral
21723 |- !l. IS_NORMALIZED l ==> ((OCTAL l = 0) = (l = []))
21724 \ENDTHEOREM
21725 --- hol88-2.02.19940316.orig/Library/numeral/Manual/Makefile
21726 +++ hol88-2.02.19940316/Library/numeral/Manual/Makefile
21727 @@ -15,19 +15,19 @@ all:; make clean; make thms; make ids; m
21728
21729 clean:; \
21730 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg entries.tex; \
21731 - echo "\begin{theindex}" >index.tex; \
21732 - echo "\mbox{}" >>index.tex; \
21733 - echo "\end{theindex}" >>index.tex
21734 + printf '\\begin{theindex}' >index.tex; \
21735 + printf '\\mbox{}' >>index.tex; \
21736 + printf '\\end{theindex}' >>index.tex
21737
21738 ids:; \
21739 - echo "\chapter{ML Functions in the numeral Library}" >entries.tex; \
21740 - echo "\input{entries-intro}" >>entries.tex; \
21741 + printf '\\chapter{ML Functions in the numeral Library}' >entries.tex; \
21742 + printf '\\input{entries-intro}' >>entries.tex; \
21743 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
21744
21745 thms:; \
21746 - echo "\chapter{Pre-proved Theorems}" > theorems.tex; \
21747 - echo "\input{theorems-intro}" >> theorems.tex; \
21748 - echo "\section{Numeral theory}" >> theorems.tex; \
21749 + printf '\\chapter{Pre-proved Theorems}' > theorems.tex; \
21750 + printf '\\input{theorems-intro}' >> theorems.tex; \
21751 + printf '\\section{Numeral theory}' >> theorems.tex; \
21752 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/numeral theorems.tex
21753
21754 index:; \
21755 --- hol88-2.02.19940316.orig/Library/latex-hol/Manual/Makefile
21756 +++ hol88-2.02.19940316/Library/latex-hol/Manual/Makefile
21757 @@ -28,16 +28,16 @@ default:
21758 # ---------------------------------------------------------------------
21759 clean:
21760 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
21761 - @echo "\begin{theindex}" > index.tex
21762 - @echo "\mbox{}" >> index.tex
21763 - @echo "\end{theindex}" >> index.tex
21764 + @printf '\\begin{theindex}' > index.tex
21765 + @printf '\\mbox{}' >> index.tex
21766 + @printf '\\end{theindex}' >> index.tex
21767
21768 tex: ids
21769 @echo "TeX files made"
21770
21771 ids:
21772 - @echo "\chapter{ML Functions in the {\tt latex-hol} Library}">entries.tex
21773 - @echo "\input{entries-intro}" >> entries.tex
21774 + @printf '\\chapter{ML Functions in the {\\tt latex-hol} Library}'>entries.tex
21775 + @printf '\\input{entries-intro}' >> entries.tex
21776 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
21777
21778
21779 --- hol88-2.02.19940316.orig/Library/string/Manual/theorems.tex
21780 +++ hol88-2.02.19940316/Library/string/Manual/theorems.tex
21781 @@ -1,7 +1,4 @@
21782 -\chapter{Pre-proved Theorems}
21783 -\input{theorems-intro}
21784 -\section{Definitions}
21785 -\THEOREM ASCII\_DEF ascii
21786 +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{Definitions}\THEOREM ASCII\_DEF ascii
21787 |- !b0 b1 b2 b3 b4 b5 b6 b7.
21788 ASCII b0 b1 b2 b3 b4 b5 b6 b7 =
21789 ABS_ascii(Node(b0,b1,b2,b3,b4,b5,b6,b7)[])
21790 @@ -25,6 +22,9 @@
21791 (LENGTH tl = 0)))
21792 rep
21793 \ENDTHEOREM
21794 +\THEOREM ``\_DEF string
21795 +|- `` = ABS_string(Node(INL one)[]))
21796 +\ENDTHEOREM
21797 \THEOREM STRING\_DEF string
21798 |- !a s. STRING a s = ABS_string(Node(INR a)[REP_string s])
21799 \ENDTHEOREM
21800 @@ -47,11 +47,7 @@
21801 (?a. v = INR a) /\ (LENGTH tl = SUC 0)))
21802 rep
21803 \ENDTHEOREM
21804 -\THEOREM ``\_DEF string
21805 -|- `` = ABS_string(Node(INL one)[]))
21806 -\ENDTHEOREM
21807 -\section{Theorems}
21808 -\THEOREM ASCII\_11 ascii
21809 +\section{Theorems}\THEOREM ASCII\_11 ascii
21810 |- !b0 b1 b2 b3 b4 b5 b6 b7 b0' b1' b2' b3' b4' b5' b6' b7'.
21811 (ASCII b0 b1 b2 b3 b4 b5 b6 b7 =
21812 ASCII b0' b1' b2' b3' b4' b5' b6' b7') =
21813 --- hol88-2.02.19940316.orig/Library/string/Manual/Makefile
21814 +++ hol88-2.02.19940316/Library/string/Manual/Makefile
21815 @@ -26,24 +26,24 @@ default:
21816 # ---------------------------------------------------------------------
21817 clean:
21818 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
21819 - @echo "\begin{theindex}" > index.tex
21820 - @echo "\mbox{}" >> index.tex
21821 - @echo "\end{theindex}" >> index.tex
21822 + @printf '\\begin{theindex}' > index.tex
21823 + @printf '\\mbox{}' >> index.tex
21824 + @printf '\\end{theindex}' >> index.tex
21825
21826 tex: ids theorems
21827 @echo "TeX files made"
21828
21829 ids:
21830 - @echo "\chapter{ML Functions in the string Library}">entries.tex
21831 - @echo "\input{entries-intro}" >> entries.tex
21832 + @printf '\\chapter{ML Functions in the string Library}'>entries.tex
21833 + @printf '\\input{entries-intro}' >> entries.tex
21834 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
21835
21836 theorems:
21837 - @echo "\chapter{Pre-proved Theorems}" > theorems.tex
21838 - @echo "\input{theorems-intro}" >> theorems.tex
21839 - @echo "\section{Definitions}">>theorems.tex
21840 + @printf '\\chapter{Pre-proved Theorems}' > theorems.tex
21841 + @printf '\\input{theorems-intro}' >> theorems.tex
21842 + @printf '\\section{Definitions}'>>theorems.tex
21843 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/defs theorems.tex
21844 - @echo "\section{Theorems}">>theorems.tex
21845 + @printf '\\section{Theorems}'>>theorems.tex
21846 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms theorems.tex
21847
21848 index:
21849 --- hol88-2.02.19940316.orig/Library/string/Manual/entries.tex
21850 +++ hol88-2.02.19940316/Library/string/Manual/entries.tex
21851 @@ -1,6 +1,4 @@
21852 -\chapter{ML Functions in the string Library}
21853 -\input{entries-intro}
21854 -\DOC{ascii\_EQ\_CONV}
21855 +\chapter{ML Functions in the string Library}\input{entries-intro}\DOC{ascii\_EQ\_CONV}
21856
21857 \TYPE {\small\verb%ascii_EQ_CONV : conv%}\egroup
21858
21859 --- hol88-2.02.19940316.orig/Library/wellorder/Manual/theorems.tex
21860 +++ hol88-2.02.19940316/Library/wellorder/Manual/theorems.tex
21861 @@ -1,7 +1,4 @@
21862 -\chapter{Pre-proved Theorems}
21863 -\input{theorems-intro}
21864 -\section{Basic definitions}
21865 -\THEOREM wo\_chain WELLORDER
21866 +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{Basic definitions}\THEOREM wo\_chain WELLORDER
21867 |- !l P. chain l P = (!x y. P x /\ P y ==> l(x,y) \/ l(y,x))
21868 \ENDTHEOREM
21869 \THEOREM wo\_fl WELLORDER
21870 @@ -41,8 +38,7 @@
21871 (!x. P x ==> fl l x) /\ (?x. P x) ==>
21872 (?y. P y /\ (!z. P z ==> l(y,z))))
21873 \ENDTHEOREM
21874 -\section{Miscellaneous lemmas}
21875 -\THEOREM AGREE\_LEMMA WELLORDER
21876 +\section{Miscellaneous lemmas}\THEOREM AGREE\_LEMMA WELLORDER
21877 |- !l h ms m n f g z.
21878 woset l /\
21879 (!x. fl l(ms x)) /\
21880 @@ -152,44 +148,6 @@
21881 \THEOREM UNION\_INSEG WELLORDER
21882 |- !P l. (!m. P m ==> m inseg l) ==> (Union P) inseg l
21883 \ENDTHEOREM
21884 -\THEOREM WOSET WELLORDER
21885 -|- !l.
21886 - woset l =
21887 - (!x y. l(x,y) /\ l(y,x) ==> (x = y)) /\
21888 - (!P.
21889 - (!x. P x ==> fl l x) /\ (?x. P x) ==>
21890 - (?y. P y /\ (!z. P z ==> l(y,z))))
21891 -\ENDTHEOREM
21892 -\THEOREM WOSET\_FLEQ WELLORDER
21893 -|- !l. woset l ==> (!x. fl l x = l(x,x))
21894 -\ENDTHEOREM
21895 -\THEOREM WOSET\_NUM WELLORDER
21896 -|- woset(\(m,n). m <= n)
21897 -\ENDTHEOREM
21898 -\THEOREM WOSET\_POSET WELLORDER
21899 -|- !l. woset l ==> poset l
21900 -\ENDTHEOREM
21901 -\THEOREM WOSET\_TOTAL\_LE WELLORDER
21902 -|- !l. woset l ==> (!x y. fl l x /\ fl l y ==> l(x,y) \/ less l(y,x))
21903 -\ENDTHEOREM
21904 -\THEOREM WOSET\_TOTAL\_LT WELLORDER
21905 -|- !l.
21906 - woset l ==>
21907 - (!x y. fl l x /\ fl l y ==> (x = y) \/ less l(x,y) \/ less l(y,x))
21908 -\ENDTHEOREM
21909 -\THEOREM WOSET\_TRANS\_LE WELLORDER
21910 -|- !l. woset l ==> (!x y z. l(x,y) /\ less l(y,z) ==> less l(x,z))
21911 -\ENDTHEOREM
21912 -\THEOREM WOSET\_TRANS\_LESS WELLORDER
21913 -|- !l. woset l ==> (!x y z. less l(x,y) /\ l(y,z) ==> less l(x,z))
21914 -\ENDTHEOREM
21915 -\THEOREM WOSET\_WELL\_CONTRAPOS WELLORDER
21916 -|- !l.
21917 - woset l ==>
21918 - (!P.
21919 - (!x. P x ==> fl l x) /\ (?x. P x) ==>
21920 - (?y. P y /\ (!z. less l(z,y) ==> ~P z)))
21921 -\ENDTHEOREM
21922 \THEOREM WO\_FL\_RESTRICT WELLORDER
21923 |- !l.
21924 woset l ==>
21925 @@ -233,8 +191,45 @@
21926 (!y. (ms y) < (ms x) ==> (f y = g y)) ==> (h f x = h g x)) ==>
21927 (?! f. !x. f x = h f x)
21928 \ENDTHEOREM
21929 -\section{Main theorems}
21930 -\THEOREM HP WELLORDER
21931 +\THEOREM WOSET WELLORDER
21932 +|- !l.
21933 + woset l =
21934 + (!x y. l(x,y) /\ l(y,x) ==> (x = y)) /\
21935 + (!P.
21936 + (!x. P x ==> fl l x) /\ (?x. P x) ==>
21937 + (?y. P y /\ (!z. P z ==> l(y,z))))
21938 +\ENDTHEOREM
21939 +\THEOREM WOSET\_FLEQ WELLORDER
21940 +|- !l. woset l ==> (!x. fl l x = l(x,x))
21941 +\ENDTHEOREM
21942 +\THEOREM WOSET\_NUM WELLORDER
21943 +|- woset(\(m,n). m <= n)
21944 +\ENDTHEOREM
21945 +\THEOREM WOSET\_POSET WELLORDER
21946 +|- !l. woset l ==> poset l
21947 +\ENDTHEOREM
21948 +\THEOREM WOSET\_TOTAL\_LE WELLORDER
21949 +|- !l. woset l ==> (!x y. fl l x /\ fl l y ==> l(x,y) \/ less l(y,x))
21950 +\ENDTHEOREM
21951 +\THEOREM WOSET\_TOTAL\_LT WELLORDER
21952 +|- !l.
21953 + woset l ==>
21954 + (!x y. fl l x /\ fl l y ==> (x = y) \/ less l(x,y) \/ less l(y,x))
21955 +\ENDTHEOREM
21956 +\THEOREM WOSET\_TRANS\_LE WELLORDER
21957 +|- !l. woset l ==> (!x y z. l(x,y) /\ less l(y,z) ==> less l(x,z))
21958 +\ENDTHEOREM
21959 +\THEOREM WOSET\_TRANS\_LESS WELLORDER
21960 +|- !l. woset l ==> (!x y z. less l(x,y) /\ l(y,z) ==> less l(x,z))
21961 +\ENDTHEOREM
21962 +\THEOREM WOSET\_WELL\_CONTRAPOS WELLORDER
21963 +|- !l.
21964 + woset l ==>
21965 + (!P.
21966 + (!x. P x ==> fl l x) /\ (?x. P x) ==>
21967 + (?y. P y /\ (!z. less l(z,y) ==> ~P z)))
21968 +\ENDTHEOREM
21969 +\section{Main theorems}\THEOREM HP WELLORDER
21970 |- !l.
21971 poset l ==>
21972 (?P. chain l P /\ (!Q. chain l Q /\ P subset Q ==> (Q = P)))
21973 --- hol88-2.02.19940316.orig/Library/wellorder/Manual/Makefile
21974 +++ hol88-2.02.19940316/Library/wellorder/Manual/Makefile
21975 @@ -14,26 +14,26 @@ all:; make clean; make tex; make wellord
21976
21977 clean:; \
21978 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg entries.tex; \
21979 - echo "\begin{theindex}" >index.tex; \
21980 - echo "\mbox{}" >>index.tex; \
21981 - echo "\end{theindex}" >>index.tex
21982 + printf '\\begin{theindex}' >index.tex; \
21983 + printf '\\mbox{}' >>index.tex; \
21984 + printf '\\end{theindex}' >>index.tex
21985
21986 tex: theorems ids
21987
21988 ids:; \
21989 - echo "\chapter{ML Functions in the wellorder Library}" >entries.tex;\
21990 - echo "\label{entries}" >>entries.tex; \
21991 - echo "\input{entries-intro}" >>entries.tex; \
21992 + printf '\\chapter{ML Functions in the wellorder Library}' >entries.tex;\
21993 + printf '\\label{entries}' >>entries.tex; \
21994 + printf '\\input{entries-intro}' >>entries.tex; \
21995 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
21996
21997 theorems:; \
21998 - echo "\chapter{Pre-proved Theorems}" >theorems.tex; \
21999 - echo "\input{theorems-intro}" >>theorems.tex; \
22000 - echo "\section{Basic definitions}" >>theorems.tex; \
22001 + printf '\\chapter{Pre-proved Theorems}' >theorems.tex; \
22002 + printf '\\input{theorems-intro}' >>theorems.tex; \
22003 + printf '\\section{Basic definitions}' >>theorems.tex; \
22004 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/defs theorems.tex; \
22005 - echo "\section{Miscellaneous lemmas}" >>theorems.tex; \
22006 + printf '\\section{Miscellaneous lemmas}' >>theorems.tex; \
22007 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/lemmas theorems.tex;\
22008 - echo "\section{Main theorems}" >>theorems.tex; \
22009 + printf '\\section{Main theorems}' >>theorems.tex; \
22010 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/main theorems.tex
22011
22012 wellorder:; \
22013 --- hol88-2.02.19940316.orig/Library/reduce/Manual/Makefile
22014 +++ hol88-2.02.19940316/Library/reduce/Manual/Makefile
22015 @@ -15,13 +15,13 @@ all:; make clean; make ids; make reduce;
22016
22017 clean:; \
22018 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg entries.tex; \
22019 - echo "\begin{theindex}" >index.tex; \
22020 - echo "\mbox{}" >>index.tex; \
22021 - echo "\end{theindex}" >>index.tex
22022 + printf '\\begin{theindex}' >index.tex; \
22023 + printf '\\mbox{}' >>index.tex; \
22024 + printf '\\end{theindex}' >>index.tex
22025
22026 ids:; \
22027 - echo "\chapter{ML Functions in the reduce Library}" >entries.tex; \
22028 - echo "\input{entries-intro}" >>entries.tex; \
22029 + printf '\\chapter{ML Functions in the reduce Library}' >entries.tex; \
22030 + printf '\\input{entries-intro}' >>entries.tex; \
22031 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
22032
22033 index:; \
22034 --- hol88-2.02.19940316.orig/Library/finite_sets/Manual/theorems.tex
22035 +++ hol88-2.02.19940316/Library/finite_sets/Manual/theorems.tex
22036 @@ -1,7 +1,4 @@
22037 -\chapter{Pre-proved Theorems}
22038 -\input{theorems-intro}
22039 -\section{The type definition}
22040 -\THEOREM FINITE\_SET\_DEF finite\_sets
22041 +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{The type definition}\THEOREM FINITE\_SET\_DEF finite\_sets
22042 |- (!x. ~x IN {}) /\
22043 (!x y s. x IN (y INSERT s) = (x = y) \/ x IN s) /\
22044 (!x s. x INSERT (x INSERT s) = x INSERT s) /\
22045 @@ -18,8 +15,7 @@
22046 \THEOREM set\_TY\_DEF finite\_sets
22047 |- ?rep. TYPE_DEFINITION IS_SET_REP rep
22048 \ENDTHEOREM
22049 -\section{Basic properties of {\tt EMPTY}, {\tt INSERT}, and {\tt IN}}
22050 -\THEOREM ABSORPTION finite\_sets
22051 +\section{Basic properties of {\tt EMPTY}, {\tt INSERT}, and {\tt IN}}\THEOREM ABSORPTION finite\_sets
22052 |- !x s. x IN s = (x INSERT s = s)
22053 \ENDTHEOREM
22054 \THEOREM COMPONENT finite\_sets
22055 @@ -31,15 +27,15 @@
22056 \THEOREM EXTENSION finite\_sets
22057 |- !s t. (s = t) = (!x. x IN s = x IN t)
22058 \ENDTHEOREM
22059 +\THEOREM IN\_INSERT finite\_sets
22060 +|- !x y s. x IN (y INSERT s) = (x = y) \/ x IN s
22061 +\ENDTHEOREM
22062 \THEOREM INSERT\_COMM finite\_sets
22063 |- !x y s. x INSERT (y INSERT s) = y INSERT (x INSERT s)
22064 \ENDTHEOREM
22065 \THEOREM INSERT\_INSERT finite\_sets
22066 |- !x s. x INSERT (x INSERT s) = x INSERT s
22067 \ENDTHEOREM
22068 -\THEOREM IN\_INSERT finite\_sets
22069 -|- !x y s. x IN (y INSERT s) = (x = y) \/ x IN s
22070 -\ENDTHEOREM
22071 \THEOREM MEMBER\_NOT\_EMPTY finite\_sets
22072 |- !s. (?x. x IN s) = ~(s = {})
22073 \ENDTHEOREM
22074 @@ -49,12 +45,12 @@
22075 \THEOREM NOT\_EQUAL\_SETS finite\_sets
22076 |- !s t. ~(s = t) = (?x. x IN t = ~x IN s)
22077 \ENDTHEOREM
22078 -\THEOREM NOT\_INSERT\_EMPTY finite\_sets
22079 -|- !x s. ~(x INSERT s = {})
22080 -\ENDTHEOREM
22081 \THEOREM NOT\_IN\_EMPTY finite\_sets
22082 |- !x. ~x IN {}
22083 \ENDTHEOREM
22084 +\THEOREM NOT\_INSERT\_EMPTY finite\_sets
22085 +|- !x s. ~(x INSERT s = {})
22086 +\ENDTHEOREM
22087 \THEOREM NUM\_SET\_WOP finite\_sets
22088 |- !s. (?n. n IN s) = (?n. n IN s /\ (!m. m IN s ==> n <= m))
22089 \ENDTHEOREM
22090 @@ -68,8 +64,7 @@
22091 \THEOREM SET\_MINIMUM finite\_sets
22092 |- !s M. (?x. x IN s) = (?x. x IN s /\ (!y. y IN s ==> (M x) <= (M y)))
22093 \ENDTHEOREM
22094 -\section{Set inclusion}
22095 -\THEOREM EMPTY\_SUBSET finite\_sets
22096 +\section{Set inclusion}\THEOREM EMPTY\_SUBSET finite\_sets
22097 |- !s. {} SUBSET s
22098 \ENDTHEOREM
22099 \THEOREM INSERT\_SUBSET finite\_sets
22100 @@ -111,13 +106,15 @@
22101 \THEOREM SUBSET\_TRANS finite\_sets
22102 |- !s t u. s SUBSET t /\ t SUBSET u ==> s SUBSET u
22103 \ENDTHEOREM
22104 -\section{Intersection and union}
22105 -\THEOREM DELETE\_INTER finite\_sets
22106 +\section{Intersection and union}\THEOREM DELETE\_INTER finite\_sets
22107 |- !s t x. (s DELETE x) INTER t = (s INTER t) DELETE x
22108 \ENDTHEOREM
22109 \THEOREM EMPTY\_UNION finite\_sets
22110 |- !s t. (s UNION t = {}) = (s = {}) /\ (t = {})
22111 \ENDTHEOREM
22112 +\THEOREM IN\_INTER finite\_sets
22113 +|- !s t x. x IN (s INTER t) = x IN s /\ x IN t
22114 +\ENDTHEOREM
22115 \THEOREM INSERT\_INTER finite\_sets
22116 |- !x s t.
22117 (x INSERT s) INTER t = (x IN t => x INSERT (s INTER t) | s INTER t)
22118 @@ -147,21 +144,18 @@
22119 \THEOREM INTER\_SUBSET finite\_sets
22120 |- (!s t. (s INTER t) SUBSET s) /\ (!s t. (t INTER s) SUBSET s)
22121 \ENDTHEOREM
22122 -\THEOREM IN\_INTER finite\_sets
22123 -|- !s t x. x IN (s INTER t) = x IN s /\ x IN t
22124 -\ENDTHEOREM
22125 \THEOREM IN\_UNION finite\_sets
22126 |- !s t x. x IN (s UNION t) = x IN s \/ x IN t
22127 \ENDTHEOREM
22128 \THEOREM SUBSET\_INTER\_ABSORPTION finite\_sets
22129 |- !s t. s SUBSET t = (s INTER t = s)
22130 \ENDTHEOREM
22131 -\THEOREM SUBSET\_UNION finite\_sets
22132 -|- (!s t. s SUBSET (s UNION t)) /\ (!s t. s SUBSET (t UNION s))
22133 -\ENDTHEOREM
22134 \THEOREM SUBSET\_UNION\_ABSORPTION finite\_sets
22135 |- !s t. s SUBSET t = (s UNION t = t)
22136 \ENDTHEOREM
22137 +\THEOREM SUBSET\_UNION finite\_sets
22138 +|- (!s t. s SUBSET (s UNION t)) /\ (!s t. s SUBSET (t UNION s))
22139 +\ENDTHEOREM
22140 \THEOREM UNION\_ASSOC finite\_sets
22141 |- !s t u. (s UNION t) UNION u = s UNION (t UNION u)
22142 \ENDTHEOREM
22143 @@ -177,8 +171,7 @@
22144 \THEOREM UNION\_OVER\_INTER finite\_sets
22145 |- !s t u. s INTER (t UNION u) = (s INTER t) UNION (s INTER u)
22146 \ENDTHEOREM
22147 -\section{Set difference}
22148 -\THEOREM DIFF\_DIFF finite\_sets
22149 +\section{Set difference}\THEOREM DIFF\_DIFF finite\_sets
22150 |- !s t. (s DIFF t) DIFF t = s DIFF t
22151 \ENDTHEOREM
22152 \THEOREM DIFF\_EMPTY finite\_sets
22153 @@ -193,8 +186,7 @@
22154 \THEOREM IN\_DIFF finite\_sets
22155 |- !s t x. x IN (s DIFF t) = x IN s /\ ~x IN t
22156 \ENDTHEOREM
22157 -\section{Deletion of an element}
22158 -\THEOREM DELETE\_COMM finite\_sets
22159 +\section{Deletion of an element}\THEOREM DELETE\_COMM finite\_sets
22160 |- !x y s. (s DELETE x) DELETE y = (s DELETE y) DELETE x
22161 \ENDTHEOREM
22162 \THEOREM DELETE\_DEF finite\_sets
22163 @@ -220,9 +212,6 @@
22164 \THEOREM EMPTY\_DELETE finite\_sets
22165 |- !x. {} DELETE x = {}
22166 \ENDTHEOREM
22167 -\THEOREM INSERT\_DELETE finite\_sets
22168 -|- !x s. x IN s ==> (x INSERT (s DELETE x) = s)
22169 -\ENDTHEOREM
22170 \THEOREM IN\_DELETE finite\_sets
22171 |- !s x y. x IN (s DELETE y) = x IN s /\ ~(x = y)
22172 \ENDTHEOREM
22173 @@ -230,14 +219,16 @@
22174 |- !s x x'.
22175 (x IN s = x' IN s) = (x IN (s DELETE x') = x' IN (s DELETE x))
22176 \ENDTHEOREM
22177 +\THEOREM INSERT\_DELETE finite\_sets
22178 +|- !x s. x IN s ==> (x INSERT (s DELETE x) = s)
22179 +\ENDTHEOREM
22180 \THEOREM SUBSET\_DELETE finite\_sets
22181 |- !x s t. s SUBSET (t DELETE x) = ~x IN s /\ s SUBSET t
22182 \ENDTHEOREM
22183 \THEOREM SUBSET\_INSERT\_DELETE finite\_sets
22184 |- !x s t. s SUBSET (x INSERT t) = (s DELETE x) SUBSET t
22185 \ENDTHEOREM
22186 -\section{Disjoint sets}
22187 -\THEOREM DISJOINT\_DEF finite\_sets
22188 +\section{Disjoint sets}\THEOREM DISJOINT\_DEF finite\_sets
22189 |- !s t. DISJOINT s t = (s INTER t = {})
22190 \ENDTHEOREM
22191 \THEOREM DISJOINT\_DELETE\_SYM finite\_sets
22192 @@ -261,8 +252,7 @@
22193 \THEOREM IN\_DISJOINT finite\_sets
22194 |- !s t. DISJOINT s t = ~(?x. x IN s /\ x IN t)
22195 \ENDTHEOREM
22196 -\section{The {\tt CHOICE} and {\tt REST} functions}
22197 -\THEOREM CHOICE\_DEF finite\_sets
22198 +\section{The {\tt CHOICE} and {\tt REST} functions}\THEOREM CHOICE\_DEF finite\_sets
22199 |- !s. ~(s = {}) ==> (CHOICE s) IN s
22200 \ENDTHEOREM
22201 \THEOREM CHOICE\_INSERT\_REST finite\_sets
22202 @@ -289,8 +279,7 @@
22203 \THEOREM SING\_IFF\_EMPTY\_REST finite\_sets
22204 |- !s. SING s = ~(s = {}) /\ (REST s = {})
22205 \ENDTHEOREM
22206 -\section{Image of a function on a set}
22207 -\THEOREM IMAGE\_COMPOSE finite\_sets
22208 +\section{Image of a function on a set}\THEOREM IMAGE\_COMPOSE finite\_sets
22209 |- !f g s. IMAGE(f o g)s = IMAGE f(IMAGE g s)
22210 \ENDTHEOREM
22211 \THEOREM IMAGE\_DELETE finite\_sets
22212 @@ -323,8 +312,7 @@
22213 \THEOREM IN\_IMAGE finite\_sets
22214 |- !f s y. y IN (IMAGE f s) = (?x. (y = f x) /\ x IN s)
22215 \ENDTHEOREM
22216 -\section{Mappings between sets}
22217 -\THEOREM BIJ\_COMPOSE finite\_sets
22218 +\section{Mappings between sets}\THEOREM BIJ\_COMPOSE finite\_sets
22219 |- !f g s t u. BIJ f s t /\ BIJ g t u ==> BIJ(g o f)s u
22220 \ENDTHEOREM
22221 \THEOREM BIJ\_DEF finite\_sets
22222 @@ -375,8 +363,7 @@
22223 \THEOREM SURJ\_ID finite\_sets
22224 |- !s. SURJ(\x. x)s s
22225 \ENDTHEOREM
22226 -\section{Singleton sets}
22227 -\THEOREM DELETE\_EQ\_SING finite\_sets
22228 +\section{Singleton sets}\THEOREM DELETE\_EQ\_SING finite\_sets
22229 |- !s x. x IN s ==> ((s DELETE x = {}) = (s = {x}))
22230 \ENDTHEOREM
22231 \THEOREM DISJOINT\_SING\_EMPTY finite\_sets
22232 @@ -397,17 +384,16 @@
22233 \THEOREM NOT\_SING\_EMPTY finite\_sets
22234 |- !x. ~({x} = {})
22235 \ENDTHEOREM
22236 -\THEOREM SING finite\_sets
22237 -|- !x. SING{x}
22238 -\ENDTHEOREM
22239 \THEOREM SING\_DEF finite\_sets
22240 |- !s. SING s = (?x. s = {x})
22241 \ENDTHEOREM
22242 \THEOREM SING\_DELETE finite\_sets
22243 |- !x. {x} DELETE x = {}
22244 \ENDTHEOREM
22245 -\section{Cardinality of sets}
22246 -\THEOREM CARD\_DEF finite\_sets
22247 +\THEOREM SING finite\_sets
22248 +|- !x. SING{x}
22249 +\ENDTHEOREM
22250 +\section{Cardinality of sets}\THEOREM CARD\_DEF finite\_sets
22251 |- (CARD{} = 0) /\
22252 (!s x. CARD(x INSERT s) = (x IN s => CARD s | SUC(CARD s)))
22253 \ENDTHEOREM
22254 --- hol88-2.02.19940316.orig/Library/finite_sets/Manual/Makefile
22255 +++ hol88-2.02.19940316/Library/finite_sets/Manual/Makefile
22256 @@ -26,45 +26,45 @@ default:
22257 # ---------------------------------------------------------------------
22258 clean:
22259 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
22260 - @echo "\begin{theindex}" > index.tex
22261 - @echo "\mbox{}" >> index.tex
22262 - @echo "\end{theindex}" >> index.tex
22263 + @printf '\\begin{theindex}' > index.tex
22264 + @printf '\\mbox{}' >> index.tex
22265 + @printf '\\end{theindex}' >> index.tex
22266
22267 tex: theorems ids
22268 @echo "TeX files made"
22269
22270 ids:
22271 - @echo "\chapter{ML Functions in the Library}">entries.tex
22272 - @echo "\label{entries}">>entries.tex
22273 - @echo "\input{entries-intro}" >> entries.tex
22274 + @printf '\\chapter{ML Functions in the Library}'>entries.tex
22275 + @printf '\\label{entries}'>>entries.tex
22276 + @printf '\\input{entries-intro}' >> entries.tex
22277 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
22278
22279 theorems:
22280 - @echo "\chapter{Pre-proved Theorems}" > theorems.tex
22281 - @echo "\input{theorems-intro}" >> theorems.tex
22282 - @echo "\section{The type definition}">>theorems.tex
22283 + @printf '\\chapter{Pre-proved Theorems}' > theorems.tex
22284 + @printf '\\input{theorems-intro}' >> theorems.tex
22285 + @printf '\\section{The type definition}'>>theorems.tex
22286 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/sdef theorems.tex
22287 - @echo "\section{Basic properties of {\tt EMPTY}, {\tt INSERT}, and {\tt IN}}">>theorems.tex
22288 + @printf '\\section{Basic properties of {\\tt EMPTY}, {\\tt INSERT}, and {\\tt IN}}'>>theorems.tex
22289 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/basic theorems.tex
22290 - @echo "\section{Set inclusion}">>theorems.tex
22291 + @printf '\\section{Set inclusion}'>>theorems.tex
22292 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/subs theorems.tex
22293 - @echo "\section{Intersection and union}">>theorems.tex
22294 + @printf '\\section{Intersection and union}'>>theorems.tex
22295 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/unin theorems.tex
22296 - @echo "\section{Set difference}">>theorems.tex
22297 + @printf '\\section{Set difference}'>>theorems.tex
22298 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/diff theorems.tex
22299 - @echo "\section{Deletion of an element}">>theorems.tex
22300 + @printf '\\section{Deletion of an element}'>>theorems.tex
22301 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/del theorems.tex
22302 - @echo "\section{Disjoint sets}">>theorems.tex
22303 + @printf '\\section{Disjoint sets}'>>theorems.tex
22304 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/disj theorems.tex
22305 - @echo "\section{The {\tt CHOICE} and {\tt REST} functions}">>theorems.tex
22306 + @printf '\\section{The {\\tt CHOICE} and {\\tt REST} functions}'>>theorems.tex
22307 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/chre theorems.tex
22308 - @echo "\section{Image of a function on a set}">>theorems.tex
22309 + @printf '\\section{Image of a function on a set}'>>theorems.tex
22310 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/image theorems.tex
22311 - @echo "\section{Mappings between sets}">>theorems.tex
22312 + @printf '\\section{Mappings between sets}'>>theorems.tex
22313 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/fun theorems.tex
22314 - @echo "\section{Singleton sets}">>theorems.tex
22315 + @printf '\\section{Singleton sets}'>>theorems.tex
22316 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/sing theorems.tex
22317 - @echo "\section{Cardinality of sets}">>theorems.tex
22318 + @printf '\\section{Cardinality of sets}'>>theorems.tex
22319 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/card theorems.tex
22320
22321 index:
22322 --- hol88-2.02.19940316.orig/Library/finite_sets/Manual/entries.tex
22323 +++ hol88-2.02.19940316/Library/finite_sets/Manual/entries.tex
22324 @@ -1,7 +1,4 @@
22325 -\chapter{ML Functions in the Library}
22326 -\label{entries}
22327 -\input{entries-intro}
22328 -\DOC{DELETE\_CONV}
22329 +\chapter{ML Functions in the Library}\label{entries}\input{entries-intro}\DOC{DELETE\_CONV}
22330
22331 \TYPE {\small\verb%DELETE_CONV : conv -> conv%}\egroup
22332
22333 @@ -171,6 +168,84 @@ for some {\small\verb%ri%}.
22334
22335 \ENDDOC
22336
22337 +\DOC{IN\_CONV}
22338 +
22339 +\TYPE {\small\verb%IN_CONV : conv -> conv%}\egroup
22340 +
22341 +\SYNOPSIS
22342 +Decision procedure for membership in finite sets.
22343 +
22344 +\DESCRIBE
22345 +The function {\small\verb%IN_CONV%} is a parameterized conversion for proving or disproving
22346 +membership assertions of the general form:
22347 +{\par\samepage\setseps\small
22348 +\begin{verbatim}
22349 + "t IN {t1,...,tn}"
22350 +\end{verbatim}
22351 +}
22352 +\noindent where {\small\verb%{t1,...,tn}%} is a set of type {\small\verb%(ty)set%} and {\small\verb%t%} is a value
22353 +of the base type {\small\verb%ty%}. The first argument to {\small\verb%IN_CONV%} is expected to be a
22354 +conversion that decides equality between values of the base type {\small\verb%ty%}. Given
22355 +an equation {\small\verb%"e1 = e2"%}, where {\small\verb%e1%} and {\small\verb%e2%} are terms of type {\small\verb%ty%}, this
22356 +conversion should return the theorem {\small\verb%|- (e1 = e2) = T%} or the theorem
22357 +{\small\verb%|- (e1 = e2) = F%}, as appropriate.
22358 +
22359 +Given such a conversion, the function {\small\verb%IN_CONV%} returns a conversion that
22360 +maps a term of the form {\small\verb%"t IN {t1,...,tn}"%} to the theorem
22361 +{\par\samepage\setseps\small
22362 +\begin{verbatim}
22363 + |- t IN {t1,...,tn} = T
22364 +\end{verbatim}
22365 +}
22366 +
22367 +\noindent if {\small\verb%t%} is alpha-equivalent to any {\small\verb%ti%}, or if the supplied conversion
22368 +proves {\small\verb%|- (t = ti) = T%} for any {\small\verb%ti%}. If the supplied conversion proves
22369 +{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}, then the result is the theorem
22370 +{\par\samepage\setseps\small
22371 +\begin{verbatim}
22372 + |- t IN {t1,...,tn} = F
22373 +\end{verbatim}
22374 +}
22375 +\noindent In all other cases, {\small\verb%IN_CONV%} will fail.
22376 +
22377 +\EXAMPLE
22378 +In the following example, the conversion {\small\verb%num_EQ_CONV%} is supplied as a
22379 +parameter and used to test equality of the candidate element {\small\verb%1%} with the
22380 +actual elements of the given set.
22381 +{\par\samepage\setseps\small
22382 +\begin{verbatim}
22383 + #IN_CONV num_EQ_CONV "2 IN {0,SUC 1,3}";;
22384 + |- 2 IN {0,SUC 1,3} = T
22385 +\end{verbatim}
22386 +}
22387 +\noindent The result is {\small\verb%T%} because {\small\verb%num_EQ_CONV%} is able to prove that {\small\verb%2%} is
22388 +equal to {\small\verb%SUC 1%}. An example of a negative result is:
22389 +{\par\samepage\setseps\small
22390 +\begin{verbatim}
22391 + #IN_CONV num_EQ_CONV "1 IN {0,2,3}";;
22392 + |- 1 IN {0,2,3} = F
22393 +\end{verbatim}
22394 +}
22395 +\noindent Finally the behaviour of the supplied conversion is irrelevant when
22396 +the value to be tested for membership is alpha-equivalent to an actual element:
22397 +{\par\samepage\setseps\small
22398 +\begin{verbatim}
22399 + #IN_CONV NO_CONV "1 IN {3,2,1}";;
22400 + |- 1 IN {3,2,1} = T
22401 +\end{verbatim}
22402 +}
22403 +\noindent The conversion {\small\verb%NO_CONV%} always fails, but {\small\verb%IN_CONV%} is nontheless
22404 +able in this case to prove the required result.
22405 +
22406 +\FAILURE
22407 +{\small\verb%IN_CONV conv%} fails if applied to a term that is not of the form {\small\verb%"t IN
22408 +{t1,...,tn}"%}. A call {\small\verb%IN_CONV conv "t IN {t1,...,tn}"%} fails unless the
22409 +term {\small\verb%t%} is alpha-equivalent to some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns
22410 +{\small\verb%|- (t = ti) = T%} for some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns
22411 +{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}.
22412 +
22413 +\ENDDOC
22414 +
22415 \DOC{INSERT\_CONV}
22416
22417 \TYPE {\small\verb%INSERT_CONV : conv -> conv%}\egroup
22418 @@ -257,84 +332,6 @@ DELETE_CONV.
22419
22420 \ENDDOC
22421
22422 -\DOC{IN\_CONV}
22423 -
22424 -\TYPE {\small\verb%IN_CONV : conv -> conv%}\egroup
22425 -
22426 -\SYNOPSIS
22427 -Decision procedure for membership in finite sets.
22428 -
22429 -\DESCRIBE
22430 -The function {\small\verb%IN_CONV%} is a parameterized conversion for proving or disproving
22431 -membership assertions of the general form:
22432 -{\par\samepage\setseps\small
22433 -\begin{verbatim}
22434 - "t IN {t1,...,tn}"
22435 -\end{verbatim}
22436 -}
22437 -\noindent where {\small\verb%{t1,...,tn}%} is a set of type {\small\verb%(ty)set%} and {\small\verb%t%} is a value
22438 -of the base type {\small\verb%ty%}. The first argument to {\small\verb%IN_CONV%} is expected to be a
22439 -conversion that decides equality between values of the base type {\small\verb%ty%}. Given
22440 -an equation {\small\verb%"e1 = e2"%}, where {\small\verb%e1%} and {\small\verb%e2%} are terms of type {\small\verb%ty%}, this
22441 -conversion should return the theorem {\small\verb%|- (e1 = e2) = T%} or the theorem
22442 -{\small\verb%|- (e1 = e2) = F%}, as appropriate.
22443 -
22444 -Given such a conversion, the function {\small\verb%IN_CONV%} returns a conversion that
22445 -maps a term of the form {\small\verb%"t IN {t1,...,tn}"%} to the theorem
22446 -{\par\samepage\setseps\small
22447 -\begin{verbatim}
22448 - |- t IN {t1,...,tn} = T
22449 -\end{verbatim}
22450 -}
22451 -
22452 -\noindent if {\small\verb%t%} is alpha-equivalent to any {\small\verb%ti%}, or if the supplied conversion
22453 -proves {\small\verb%|- (t = ti) = T%} for any {\small\verb%ti%}. If the supplied conversion proves
22454 -{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}, then the result is the theorem
22455 -{\par\samepage\setseps\small
22456 -\begin{verbatim}
22457 - |- t IN {t1,...,tn} = F
22458 -\end{verbatim}
22459 -}
22460 -\noindent In all other cases, {\small\verb%IN_CONV%} will fail.
22461 -
22462 -\EXAMPLE
22463 -In the following example, the conversion {\small\verb%num_EQ_CONV%} is supplied as a
22464 -parameter and used to test equality of the candidate element {\small\verb%1%} with the
22465 -actual elements of the given set.
22466 -{\par\samepage\setseps\small
22467 -\begin{verbatim}
22468 - #IN_CONV num_EQ_CONV "2 IN {0,SUC 1,3}";;
22469 - |- 2 IN {0,SUC 1,3} = T
22470 -\end{verbatim}
22471 -}
22472 -\noindent The result is {\small\verb%T%} because {\small\verb%num_EQ_CONV%} is able to prove that {\small\verb%2%} is
22473 -equal to {\small\verb%SUC 1%}. An example of a negative result is:
22474 -{\par\samepage\setseps\small
22475 -\begin{verbatim}
22476 - #IN_CONV num_EQ_CONV "1 IN {0,2,3}";;
22477 - |- 1 IN {0,2,3} = F
22478 -\end{verbatim}
22479 -}
22480 -\noindent Finally the behaviour of the supplied conversion is irrelevant when
22481 -the value to be tested for membership is alpha-equivalent to an actual element:
22482 -{\par\samepage\setseps\small
22483 -\begin{verbatim}
22484 - #IN_CONV NO_CONV "1 IN {3,2,1}";;
22485 - |- 1 IN {3,2,1} = T
22486 -\end{verbatim}
22487 -}
22488 -\noindent The conversion {\small\verb%NO_CONV%} always fails, but {\small\verb%IN_CONV%} is nontheless
22489 -able in this case to prove the required result.
22490 -
22491 -\FAILURE
22492 -{\small\verb%IN_CONV conv%} fails if applied to a term that is not of the form {\small\verb%"t IN
22493 -{t1,...,tn}"%}. A call {\small\verb%IN_CONV conv "t IN {t1,...,tn}"%} fails unless the
22494 -term {\small\verb%t%} is alpha-equivalent to some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns
22495 -{\small\verb%|- (t = ti) = T%} for some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns
22496 -{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}.
22497 -
22498 -\ENDDOC
22499 -
22500 \DOC{SET\_INDUCT\_TAC}
22501
22502 \TYPE {\small\verb%SET_INDUCT_TAC : tactic%}\egroup
22503 --- hol88-2.02.19940316.orig/Library/pair/Manual/Makefile
22504 +++ hol88-2.02.19940316/Library/pair/Manual/Makefile
22505 @@ -26,19 +26,19 @@ default:
22506 # ---------------------------------------------------------------------
22507 clean:
22508 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg entries.tex theorems.tex; \
22509 - echo "\begin{theindex}" >index.tex; \
22510 - echo "\mbox{}" >>index.tex; \
22511 - echo "\end{theindex}" >>index.tex
22512 + printf '\\begin{theindex}' >index.tex; \
22513 + printf '\\mbox{}' >>index.tex; \
22514 + printf '\\end{theindex}' >>index.tex
22515
22516 ids:
22517 - echo "\chapter{ML Functions in the pair Library}" >entries.tex; \
22518 - echo "\input{entries-intro}" >>entries.tex; \
22519 + printf '\\chapter{ML Functions in the pair Library}' >entries.tex; \
22520 + printf '\\input{entries-intro}' >>entries.tex; \
22521 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
22522
22523 theorems:
22524 - @echo "\chapter{Pre-proved Theorems}" > theorems.tex
22525 - @echo "\input{theorems-intro}" >> theorems.tex
22526 - @echo "\section{Theorems}">>theorems.tex
22527 + @printf '\\chapter{Pre-proved Theorems}' > theorems.tex
22528 + @printf '\\input{theorems-intro}' >> theorems.tex
22529 + @printf '\\section{Theorems}'>>theorems.tex
22530 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms theorems.tex
22531
22532 index:
22533 --- hol88-2.02.19940316.orig/Library/window/Manual/theorems.tex
22534 +++ hol88-2.02.19940316/Library/window/Manual/theorems.tex
22535 @@ -1,11 +1,7 @@
22536 -\chapter{Pre-proved Theorems}
22537 -\input{theorems-intro}
22538 -\section{Definitions}
22539 -\THEOREM PMI\_DEF win
22540 +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{Definitions}\THEOREM PMI\_DEF win
22541 |- !a b. a <== b = b ==> a
22542 \ENDTHEOREM
22543 -\section{Theorems}
22544 -\THEOREM IMP\_REFL\_THM win
22545 +\section{Theorems}\THEOREM IMP\_REFL\_THM win
22546 |- !x. x ==> x
22547 \ENDTHEOREM
22548 \THEOREM IMP\_TRANS\_THM win
22549 --- hol88-2.02.19940316.orig/Library/window/Manual/Makefile
22550 +++ hol88-2.02.19940316/Library/window/Manual/Makefile
22551 @@ -26,24 +26,24 @@ default:
22552 # ---------------------------------------------------------------------
22553 clean:
22554 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg entries.tex *.bak; \
22555 - echo "\begin{theindex}" >index.tex; \
22556 - echo "\mbox{}" >>index.tex; \
22557 - echo "\end{theindex}" >>index.tex
22558 + printf '\\begin{theindex}' >index.tex; \
22559 + printf '\\mbox{}' >>index.tex; \
22560 + printf '\\end{theindex}' >>index.tex
22561
22562 tex: ids theorems
22563 @echo "TeX files makde"
22564
22565 ids:
22566 - echo "\chapter{ML Functions in the window Library}" >entries.tex; \
22567 - echo "\input{entries-intro}" >>entries.tex; \
22568 + printf '\\chapter{ML Functions in the window Library}' >entries.tex; \
22569 + printf '\\input{entries-intro}' >>entries.tex; \
22570 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
22571
22572 theorems:
22573 - @echo "\chapter{Pre-proved Theorems}" > theorems.tex
22574 - @echo "\input{theorems-intro}" >> theorems.tex
22575 - @echo "\section{Definitions}">>theorems.tex
22576 + @printf '\\chapter{Pre-proved Theorems}' > theorems.tex
22577 + @printf '\\input{theorems-intro}' >> theorems.tex
22578 + @printf '\\section{Definitions}'>>theorems.tex
22579 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/defs theorems.tex
22580 - @echo "\section{Theorems}">>theorems.tex
22581 + @printf '\\section{Theorems}'>>theorems.tex
22582 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms theorems.tex
22583
22584 index:
22585 --- hol88-2.02.19940316.orig/Library/parser/Manual/theorems.tex
22586 +++ hol88-2.02.19940316/Library/parser/Manual/theorems.tex
22587 @@ -1 +1 @@
22588 -\chapter{Pre-proved Theorems}
22589 +\chapter{Pre-proved Theorems}
22590 \ No newline at end of file
22591 --- hol88-2.02.19940316.orig/Library/parser/Manual/Makefile
22592 +++ hol88-2.02.19940316/Library/parser/Manual/Makefile
22593 @@ -25,20 +25,20 @@ default:
22594 # ---------------------------------------------------------------------
22595 clean:
22596 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
22597 - @echo "\begin{theindex}" > index.tex
22598 - @echo "\mbox{}" >> index.tex
22599 - @echo "\end{theindex}" >> index.tex
22600 + @printf '\\begin{theindex}' > index.tex
22601 + @printf '\\mbox{}' >> index.tex
22602 + @printf '\\end{theindex}' >> index.tex
22603
22604 tex: ids theorems
22605 @echo "TeX files made"
22606
22607 ids:
22608 - @echo "\chapter{ML Functions in the parser Library}">entries.tex
22609 - @echo "\input{entries-intro}" >> entries.tex
22610 + @printf '\\chapter{ML Functions in the parser Library}'>entries.tex
22611 + @printf '\\input{entries-intro}' >> entries.tex
22612 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
22613
22614 theorems:
22615 - @echo "\chapter{Pre-proved Theorems}" > theorems.tex
22616 + @printf '\\chapter{Pre-proved Theorems}' > theorems.tex
22617
22618 index:
22619 ${MAKEINDEX} parser.idx index.tex
22620 --- hol88-2.02.19940316.orig/Library/parser/Manual/entries.tex
22621 +++ hol88-2.02.19940316/Library/parser/Manual/entries.tex
22622 @@ -1,6 +1,4 @@
22623 -\chapter{ML Functions in the parser Library}
22624 -\input{entries-intro}
22625 -\DOC{parse}
22626 +\chapter{ML Functions in the parser Library}\input{entries-intro}\DOC{parse}
22627
22628 \TYPE {\small\verb%parse : (* -> void)%}\egroup
22629
22630 --- hol88-2.02.19940316.orig/Library/record_proof/Manual/Makefile
22631 +++ hol88-2.02.19940316/Library/record_proof/Manual/Makefile
22632 @@ -27,17 +27,17 @@ default:
22633 # ---------------------------------------------------------------------
22634 clean:
22635 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
22636 - @echo "\begin{theindex}" > index.tex
22637 - @echo "\mbox{}" >> index.tex
22638 - @echo "\end{theindex}" >> index.tex
22639 + @printf '\\begin{theindex}' > index.tex
22640 + @printf '\\mbox{}' >> index.tex
22641 + @printf '\\end{theindex}' >> index.tex
22642
22643 tex: functions
22644 @echo "TeX files made"
22645
22646 functions:
22647 - @echo "\chapter{ML Functions in the {\tt record\_proof} Library}">entries.tex
22648 - @echo "\label{entries}">>entries.tex
22649 - @echo "\input{entries-intro}" >> entries.tex
22650 + @printf '\\chapter{ML Functions in the {\\tt record\\_proof} Library}'>entries.tex
22651 + @printf '\\label{entries}'>>entries.tex
22652 + @printf '\\input{entries-intro}' >> entries.tex
22653 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help} entries.tex
22654
22655 index:
22656 --- hol88-2.02.19940316.orig/Library/record_proof/Manual/entries.tex
22657 +++ hol88-2.02.19940316/Library/record_proof/Manual/entries.tex
22658 @@ -1,3 +1 @@
22659 -\chapter{ML Functions in the {\tt record\_proof} Library}
22660 -\label{entries}
22661 -\input{entries-intro}
22662 +\chapter{ML Functions in the {\tt record\_proof} Library}\label{entries}\input{entries-intro}
22663 \ No newline at end of file
22664 --- hol88-2.02.19940316.orig/Library/word/Manual/theorems.tex
22665 +++ hol88-2.02.19940316/Library/word/Manual/theorems.tex
22666 @@ -1,7 +1,4 @@
22667 -\chapter{Pre-proved Theorems}
22668 -\input{theorems-intro}
22669 -\section{The theory {\tt word\_base}}
22670 -\THEOREM BIT0 word\_base
22671 +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{The theory {\tt word\_base}}\THEOREM BIT0 word\_base
22672 |- !b. BIT 0(WORD[b]) = b
22673 \ENDTHEOREM
22674 \THEOREM BIT\_DEF word\_base
22675 @@ -33,20 +30,17 @@
22676 !m k j.
22677 (m + k) <= n ==> j < m ==> (BIT j(WSEG m k w) = BIT(j + k)w)
22678 \ENDTHEOREM
22679 -\THEOREM LSB word\_base
22680 -|- !n. !w :: PWORDLEN n. 0 < n ==> (LSB w = BIT 0 w)
22681 -\ENDTHEOREM
22682 \THEOREM LSB\_DEF word\_base
22683 |- !l. LSB(WORD l) = LAST l
22684 \ENDTHEOREM
22685 -\THEOREM MSB word\_base
22686 -|- !n. !w :: PWORDLEN n. 0 < n ==> (MSB w = BIT(PRE n)w)
22687 +\THEOREM LSB word\_base
22688 +|- !n. !w :: PWORDLEN n. 0 < n ==> (LSB w = BIT 0 w)
22689 \ENDTHEOREM
22690 \THEOREM MSB\_DEF word\_base
22691 |- !l. MSB(WORD l) = HD l
22692 \ENDTHEOREM
22693 -\THEOREM PWORDLEN word\_base
22694 -|- !n w. PWORDLEN n w = (WORDLEN w = n)
22695 +\THEOREM MSB word\_base
22696 +|- !n. !w :: PWORDLEN n. 0 < n ==> (MSB w = BIT(PRE n)w)
22697 \ENDTHEOREM
22698 \THEOREM PWORDLEN0 word\_base
22699 |- !w. PWORDLEN 0 w ==> (w = WORD[])
22700 @@ -57,6 +51,9 @@
22701 \THEOREM PWORDLEN\_DEF word\_base
22702 |- !n l. PWORDLEN n(WORD l) = (n = LENGTH l)
22703 \ENDTHEOREM
22704 +\THEOREM PWORDLEN word\_base
22705 +|- !n w. PWORDLEN n w = (WORDLEN w = n)
22706 +\ENDTHEOREM
22707 \THEOREM WCAT0 word\_base
22708 |- !w. (WCAT(WORD[],w) = w) /\ (WCAT(w,WORD[]) = w)
22709 \ENDTHEOREM
22710 @@ -84,26 +81,6 @@
22711 (m1 + (m2 + k)) <= n ==>
22712 (WCAT(WSEG m2(m1 + k)w,WSEG m1 k w) = WSEG(m1 + m2)k w)
22713 \ENDTHEOREM
22714 -\THEOREM WORDLEN\_DEF word\_base
22715 -|- !l. WORDLEN(WORD l) = LENGTH l
22716 -\ENDTHEOREM
22717 -\THEOREM WORDLEN\_SUC\_WCAT word\_base
22718 -|- !n w.
22719 - PWORDLEN(SUC n)w ==>
22720 - (?b :: PWORDLEN 1. ?w' :: PWORDLEN n. w = WCAT(b,w'))
22721 -\ENDTHEOREM
22722 -\THEOREM WORDLEN\_SUC\_WCAT\_BIT\_WSEG word\_base
22723 -|- !n. !w :: PWORDLEN(SUC n). w = WCAT(WORD[BIT n w],WSEG n 0 w)
22724 -\ENDTHEOREM
22725 -\THEOREM WORDLEN\_SUC\_WCAT\_BIT\_WSEG\_RIGHT word\_base
22726 -|- !n. !w :: PWORDLEN(SUC n). w = WCAT(WSEG n 1 w,WORD[BIT 0 w])
22727 -\ENDTHEOREM
22728 -\THEOREM WORDLEN\_SUC\_WCAT\_WSEG\_WSEG word\_base
22729 -|- !w :: PWORDLEN(SUC n). w = WCAT(WSEG 1 n w,WSEG n 0 w)
22730 -\ENDTHEOREM
22731 -\THEOREM WORDLEN\_SUC\_WCAT\_WSEG\_WSEG\_RIGHT word\_base
22732 -|- !w :: PWORDLEN(SUC n). w = WCAT(WSEG n 1 w,WSEG 1 0 w)
22733 -\ENDTHEOREM
22734 \THEOREM WORD\_11 word\_base
22735 |- !l l'. (WORD l = WORD l') = (l = l')
22736 \ENDTHEOREM
22737 @@ -128,6 +105,26 @@
22738 TRP(\v tl. (?l. v = l) /\ (LENGTH tl = 0))r =
22739 (REP_word(ABS_word r) = r))
22740 \ENDTHEOREM
22741 +\THEOREM WORDLEN\_DEF word\_base
22742 +|- !l. WORDLEN(WORD l) = LENGTH l
22743 +\ENDTHEOREM
22744 +\THEOREM WORDLEN\_SUC\_WCAT\_BIT\_WSEG word\_base
22745 +|- !n. !w :: PWORDLEN(SUC n). w = WCAT(WORD[BIT n w],WSEG n 0 w)
22746 +\ENDTHEOREM
22747 +\THEOREM WORDLEN\_SUC\_WCAT\_BIT\_WSEG\_RIGHT word\_base
22748 +|- !n. !w :: PWORDLEN(SUC n). w = WCAT(WSEG n 1 w,WORD[BIT 0 w])
22749 +\ENDTHEOREM
22750 +\THEOREM WORDLEN\_SUC\_WCAT word\_base
22751 +|- !n w.
22752 + PWORDLEN(SUC n)w ==>
22753 + (?b :: PWORDLEN 1. ?w' :: PWORDLEN n. w = WCAT(b,w'))
22754 +\ENDTHEOREM
22755 +\THEOREM WORDLEN\_SUC\_WCAT\_WSEG\_WSEG word\_base
22756 +|- !w :: PWORDLEN(SUC n). w = WCAT(WSEG 1 n w,WSEG n 0 w)
22757 +\ENDTHEOREM
22758 +\THEOREM WORDLEN\_SUC\_WCAT\_WSEG\_WSEG\_RIGHT word\_base
22759 +|- !w :: PWORDLEN(SUC n). w = WCAT(WSEG n 1 w,WSEG 1 0 w)
22760 +\ENDTHEOREM
22761 \THEOREM WORD\_PARTITION word\_base
22762 |- (!n. !w :: PWORDLEN n. !m. m <= n ==> (WCAT(WSPLIT m w) = w)) /\
22763 (!n m.
22764 @@ -162,15 +159,6 @@
22765 |- !n1 n2.
22766 !w1 :: PWORDLEN n1. !w2 :: PWORDLEN n2. WSEG n2 0(WCAT(w1,w2)) = w2
22767 \ENDTHEOREM
22768 -\THEOREM WSEG\_WCAT\_WSEG word\_base
22769 -|- !n1 n2.
22770 - !w1 :: PWORDLEN n1.
22771 - !w2 :: PWORDLEN n2.
22772 - !m k.
22773 - (m + k) <= (n1 + n2) /\ k < n2 /\ n2 <= (m + k) ==>
22774 - (WSEG m k(WCAT(w1,w2)) =
22775 - WCAT(WSEG((m + k) - n2)0 w1,WSEG(n2 - k)k w2))
22776 -\ENDTHEOREM
22777 \THEOREM WSEG\_WCAT\_WSEG1 word\_base
22778 |- !n1 n2.
22779 !w1 :: PWORDLEN n1.
22780 @@ -184,6 +172,15 @@
22781 !w2 :: PWORDLEN n2.
22782 !m k. (m + k) <= n2 ==> (WSEG m k(WCAT(w1,w2)) = WSEG m k w2)
22783 \ENDTHEOREM
22784 +\THEOREM WSEG\_WCAT\_WSEG word\_base
22785 +|- !n1 n2.
22786 + !w1 :: PWORDLEN n1.
22787 + !w2 :: PWORDLEN n2.
22788 + !m k.
22789 + (m + k) <= (n1 + n2) /\ k < n2 /\ n2 <= (m + k) ==>
22790 + (WSEG m k(WCAT(w1,w2)) =
22791 + WCAT(WSEG((m + k) - n2)0 w1,WSEG(n2 - k)k w2))
22792 +\ENDTHEOREM
22793 \THEOREM WSEG\_WORDLEN word\_base
22794 |- !n.
22795 !w :: PWORDLEN n. !m k. (m + k) <= n ==> (WORDLEN(WSEG m k w) = m)
22796 @@ -208,11 +205,6 @@
22797 m <= n ==>
22798 PWORDLEN(n - m)(FST(WSPLIT m w)) /\ PWORDLEN m(SND(WSPLIT m w))
22799 \ENDTHEOREM
22800 -\THEOREM WSPLIT\_WSEG word\_base
22801 -|- !n.
22802 - !w :: PWORDLEN n.
22803 - !k. k <= n ==> (WSPLIT k w = WSEG(n - k)k w,WSEG k 0 w)
22804 -\ENDTHEOREM
22805 \THEOREM WSPLIT\_WSEG1 word\_base
22806 |- !n.
22807 !w :: PWORDLEN n. !k. k <= n ==> (FST(WSPLIT k w) = WSEG(n - k)k w)
22808 @@ -220,13 +212,17 @@
22809 \THEOREM WSPLIT\_WSEG2 word\_base
22810 |- !n. !w :: PWORDLEN n. !k. k <= n ==> (SND(WSPLIT k w) = WSEG k 0 w)
22811 \ENDTHEOREM
22812 -\section{The theory {\tt word\_bitop}}
22813 -\THEOREM EXISTSABIT word\_bitop
22814 -|- !n. !w :: PWORDLEN n. !P. EXISTSABIT P w = (?k. k < n /\ P(BIT k w))
22815 +\THEOREM WSPLIT\_WSEG word\_base
22816 +|- !n.
22817 + !w :: PWORDLEN n.
22818 + !k. k <= n ==> (WSPLIT k w = WSEG(n - k)k w,WSEG k 0 w)
22819 \ENDTHEOREM
22820 -\THEOREM EXISTSABIT\_DEF word\_bitop
22821 +\section{The theory {\tt word\_bitop}}\THEOREM EXISTSABIT\_DEF word\_bitop
22822 |- !P l. EXISTSABIT P(WORD l) = SOME_EL P l
22823 \ENDTHEOREM
22824 +\THEOREM EXISTSABIT word\_bitop
22825 +|- !n. !w :: PWORDLEN n. !P. EXISTSABIT P w = (?k. k < n /\ P(BIT k w))
22826 +\ENDTHEOREM
22827 \THEOREM EXISTSABIT\_WCAT word\_bitop
22828 |- !w1 w2 P.
22829 EXISTSABIT P(WCAT(w1,w2)) = EXISTSABIT P w1 \/ EXISTSABIT P w2
22830 @@ -237,12 +233,12 @@
22831 !m k.
22832 (m + k) <= n ==> (!P. EXISTSABIT P(WSEG m k w) ==> EXISTSABIT P w)
22833 \ENDTHEOREM
22834 -\THEOREM FORALLBITS word\_bitop
22835 -|- !n. !w :: PWORDLEN n. !P. FORALLBITS P w = (!k. k < n ==> P(BIT k w))
22836 -\ENDTHEOREM
22837 \THEOREM FORALLBITS\_DEF word\_bitop
22838 |- !P l. FORALLBITS P(WORD l) = ALL_EL P l
22839 \ENDTHEOREM
22840 +\THEOREM FORALLBITS word\_bitop
22841 +|- !n. !w :: PWORDLEN n. !P. FORALLBITS P w = (!k. k < n ==> P(BIT k w))
22842 +\ENDTHEOREM
22843 \THEOREM FORALLBITS\_WCAT word\_bitop
22844 |- !w1 w2 P.
22845 FORALLBITS P(WCAT(w1,w2)) = FORALLBITS P w1 /\ FORALLBITS P w2
22846 @@ -316,6 +312,16 @@
22847 BIT(PRE(WORDLEN w))w,
22848 WCAT(WSEG(PRE(WORDLEN w))0 w,(f => WSEG 1 0 w | WORD[b]))
22849 \ENDTHEOREM
22850 +\THEOREM SHL\_WSEG\_1F word\_bitop
22851 +|- !n.
22852 + !w :: PWORDLEN n.
22853 + !m k.
22854 + (m + k) <= n ==>
22855 + 0 < m ==>
22856 + (!b.
22857 + SHL F(WSEG m k w)b =
22858 + BIT(k + (m - 1))w,WCAT(WSEG(m - 1)k w,WORD[b]))
22859 +\ENDTHEOREM
22860 \THEOREM SHL\_WSEG word\_bitop
22861 |- !n.
22862 !w :: PWORDLEN n.
22863 @@ -329,16 +335,6 @@
22864 WCAT(WSEG(m - 1)k w,WSEG 1 k w) |
22865 WCAT(WSEG(m - 1)k w,WORD[b])))
22866 \ENDTHEOREM
22867 -\THEOREM SHL\_WSEG\_1F word\_bitop
22868 -|- !n.
22869 - !w :: PWORDLEN n.
22870 - !m k.
22871 - (m + k) <= n ==>
22872 - 0 < m ==>
22873 - (!b.
22874 - SHL F(WSEG m k w)b =
22875 - BIT(k + (m - 1))w,WCAT(WSEG(m - 1)k w,WORD[b]))
22876 -\ENDTHEOREM
22877 \THEOREM SHL\_WSEG\_NF word\_bitop
22878 |- !n.
22879 !w :: PWORDLEN n.
22880 @@ -356,26 +352,26 @@
22881 ((f => WSEG 1(PRE(WORDLEN w))w | WORD[b]),WSEG(PRE(WORDLEN w))1 w),
22882 BIT 0 w
22883 \ENDTHEOREM
22884 -\THEOREM SHR\_WSEG word\_bitop
22885 +\THEOREM SHR\_WSEG\_1F word\_bitop
22886 |- !n.
22887 !w :: PWORDLEN n.
22888 !m k.
22889 (m + k) <= n ==>
22890 0 < m ==>
22891 - (!f b.
22892 - SHR f b(WSEG m k w) =
22893 - (f =>
22894 - WCAT(WSEG 1(k + (m - 1))w,WSEG(m - 1)(k + 1)w) |
22895 - WCAT(WORD[b],WSEG(m - 1)(k + 1)w)),BIT k w)
22896 + (!b.
22897 + SHR F b(WSEG m k w) = WCAT(WORD[b],WSEG(m - 1)(k + 1)w),BIT k w)
22898 \ENDTHEOREM
22899 -\THEOREM SHR\_WSEG\_1F word\_bitop
22900 +\THEOREM SHR\_WSEG word\_bitop
22901 |- !n.
22902 !w :: PWORDLEN n.
22903 !m k.
22904 (m + k) <= n ==>
22905 0 < m ==>
22906 - (!b.
22907 - SHR F b(WSEG m k w) = WCAT(WORD[b],WSEG(m - 1)(k + 1)w),BIT k w)
22908 + (!f b.
22909 + SHR f b(WSEG m k w) =
22910 + (f =>
22911 + WCAT(WSEG 1(k + (m - 1))w,WSEG(m - 1)(k + 1)w) |
22912 + WCAT(WORD[b],WSEG(m - 1)(k + 1)w)),BIT k w)
22913 \ENDTHEOREM
22914 \THEOREM SHR\_WSEG\_NF word\_bitop
22915 |- !n.
22916 @@ -413,13 +409,6 @@
22917 !m k.
22918 (m + k) <= n ==> (!f. WMAP f(WSEG m k w) = WSEG m k(WMAP f w))
22919 \ENDTHEOREM
22920 -\THEOREM WSEG\_SHL word\_bitop
22921 -|- !n.
22922 - !w :: PWORDLEN(SUC n).
22923 - !m k.
22924 - 0 < k /\ (m + k) <= (SUC n) ==>
22925 - (!b. WSEG m k(SND(SHL f w b)) = WSEG m(k - 1)w)
22926 -\ENDTHEOREM
22927 \THEOREM WSEG\_SHL\_0 word\_bitop
22928 |- !n.
22929 !w :: PWORDLEN(SUC n).
22930 @@ -428,15 +417,21 @@
22931 (WSEG m 0(SND(SHL f w b)) =
22932 WCAT(WSEG(m - 1)0 w,(f => WSEG 1 0 w | WORD[b])))
22933 \ENDTHEOREM
22934 -\section{The theory {\tt word\_num}}
22935 +\THEOREM WSEG\_SHL word\_bitop
22936 +|- !n.
22937 + !w :: PWORDLEN(SUC n).
22938 + !m k.
22939 + 0 < k /\ (m + k) <= (SUC n) ==>
22940 + (!b. WSEG m k(SND(SHL f w b)) = WSEG m(k - 1)w)
22941 +\ENDTHEOREM
22942 +\section{The theory {\tt word\_num}}\THEOREM LVAL\_DEF word\_num
22943 +|- !f b l. LVAL f b l = FOLDL(\e x. (b * e) + (f x))0 l
22944 +\ENDTHEOREM
22945 \THEOREM LVAL word\_num
22946 |- (!f b. LVAL f b[] = 0) /\
22947 (!l f b x.
22948 LVAL f b(CONS x l) = ((f x) * (b EXP (LENGTH l))) + (LVAL f b l))
22949 \ENDTHEOREM
22950 -\THEOREM LVAL\_DEF word\_num
22951 -|- !f b l. LVAL f b l = FOLDL(\e x. (b * e) + (f x))0 l
22952 -\ENDTHEOREM
22953 \THEOREM LVAL\_MAX word\_num
22954 |- !l f b. (!x. (f x) < b) ==> (LVAL f b l) < (b EXP (LENGTH l))
22955 \ENDTHEOREM
22956 @@ -461,14 +456,6 @@
22957 |- !f b.
22958 (!x. (f x) < b) ==> (!n. !w :: PWORDLEN n. (NVAL f b w) < (b EXP n))
22959 \ENDTHEOREM
22960 -\THEOREM NVAL\_WCAT word\_num
22961 -|- !n m.
22962 - !w1 :: PWORDLEN n.
22963 - !w2 :: PWORDLEN m.
22964 - !f b.
22965 - NVAL f b(WCAT(w1,w2)) =
22966 - ((NVAL f b w1) * (b EXP m)) + (NVAL f b w2)
22967 -\ENDTHEOREM
22968 \THEOREM NVAL\_WCAT1 word\_num
22969 |- !w f b x. NVAL f b(WCAT(w,WORD[x])) = ((NVAL f b w) * b) + (f x)
22970 \ENDTHEOREM
22971 @@ -478,6 +465,14 @@
22972 !f b x.
22973 NVAL f b(WCAT(WORD[x],w)) = ((f x) * (b EXP n)) + (NVAL f b w)
22974 \ENDTHEOREM
22975 +\THEOREM NVAL\_WCAT word\_num
22976 +|- !n m.
22977 + !w1 :: PWORDLEN n.
22978 + !w2 :: PWORDLEN m.
22979 + !f b.
22980 + NVAL f b(WCAT(w1,w2)) =
22981 + ((NVAL f b w1) * (b EXP m)) + (NVAL f b w2)
22982 +\ENDTHEOREM
22983 \THEOREM NVAL\_WORDLEN\_0 word\_num
22984 |- !w :: PWORDLEN 0. !fv r. NVAL fv r w = 0
22985 \ENDTHEOREM
22986 @@ -490,8 +485,7 @@
22987 \THEOREM NWORD\_PWORDLEN word\_num
22988 |- !n f b m. PWORDLEN n(NWORD n f b m)
22989 \ENDTHEOREM
22990 -\section{The theory {\tt bword\_bitop}}
22991 -\THEOREM PBITBOP\_WAND bword\_bitop
22992 +\section{The theory {\tt bword\_bitop}}\THEOREM PBITBOP\_WAND bword\_bitop
22993 |- PBITBOP $WAND
22994 \ENDTHEOREM
22995 \THEOREM PBITBOP\_WOR bword\_bitop
22996 @@ -523,8 +517,7 @@
22997 \THEOREM WXOR\_DEF bword\_bitop
22998 |- !l1 l2. (WORD l1) WXOR (WORD l2) = WORD(MAP2(\x y. ~(x = y))l1 l2)
22999 \ENDTHEOREM
23000 -\section{The theory {\tt bword\_num}}
23001 -\THEOREM ADD\_BNVAL\_LEFT bword\_num
23002 +\section{The theory {\tt bword\_num}}\THEOREM ADD\_BNVAL\_LEFT bword\_num
23003 |- !n.
23004 !w1 w2 :: PWORDLEN(SUC n).
23005 (BNVAL w1) + (BNVAL w2) =
23006 @@ -570,12 +563,6 @@
23007 \THEOREM BNVAL\_ONTO bword\_num
23008 |- !w. ?n. BNVAL w = n
23009 \ENDTHEOREM
23010 -\THEOREM BNVAL\_WCAT bword\_num
23011 -|- !n m.
23012 - !w1 :: PWORDLEN n.
23013 - !w2 :: PWORDLEN m.
23014 - BNVAL(WCAT(w1,w2)) = ((BNVAL w1) * (2 EXP m)) + (BNVAL w2)
23015 -\ENDTHEOREM
23016 \THEOREM BNVAL\_WCAT1 bword\_num
23017 |- !n.
23018 !w :: PWORDLEN n.
23019 @@ -586,6 +573,12 @@
23020 !w :: PWORDLEN n.
23021 !x. BNVAL(WCAT(WORD[x],w)) = ((BV x) * (2 EXP n)) + (BNVAL w)
23022 \ENDTHEOREM
23023 +\THEOREM BNVAL\_WCAT bword\_num
23024 +|- !n m.
23025 + !w1 :: PWORDLEN n.
23026 + !w2 :: PWORDLEN m.
23027 + BNVAL(WCAT(w1,w2)) = ((BNVAL w1) * (2 EXP m)) + (BNVAL w2)
23028 +\ENDTHEOREM
23029 \THEOREM BV\_DEF bword\_num
23030 |- !b. BV b = (b => SUC 0 | 0)
23031 \ENDTHEOREM
23032 @@ -667,8 +660,7 @@
23033 \THEOREM ZERO\_WORD\_VAL bword\_num
23034 |- !n. !w :: PWORDLEN n. (w = NBWORD n 0) = (BNVAL w = 0)
23035 \ENDTHEOREM
23036 -\section{The theory {\tt bword\_arith}}
23037 -\THEOREM ACARRY\_ACARRY\_WSEG bword\_arith
23038 +\section{The theory {\tt bword\_arith}}\THEOREM ACARRY\_ACARRY\_WSEG bword\_arith
23039 |- !n.
23040 !w1 w2 :: PWORDLEN n.
23041 !cin m k1 k2.
23042 --- hol88-2.02.19940316.orig/Library/word/Manual/Makefile
23043 +++ hol88-2.02.19940316/Library/word/Manual/Makefile
23044 @@ -27,33 +27,33 @@ default:
23045 # ---------------------------------------------------------------------
23046 clean:
23047 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
23048 - @echo "\begin{theindex}" > index.tex
23049 - @echo "\mbox{}" >> index.tex
23050 - @echo "\end{theindex}" >> index.tex
23051 + @printf '\\begin{theindex}' > index.tex
23052 + @printf '\\mbox{}' >> index.tex
23053 + @printf '\\end{theindex}' >> index.tex
23054
23055 tex: theorems functions
23056 @echo "TeX files made"
23057
23058 functions:
23059 - @echo "\chapter{ML Functions in the {\tt word} Library}">entries.tex
23060 - @echo "\label{entries}">>entries.tex
23061 - @echo "\input{entries-intro}" >> entries.tex
23062 + @printf '\\chapter{ML Functions in the {\\tt word} Library}'>entries.tex
23063 + @printf '\\label{entries}'>>entries.tex
23064 + @printf '\\input{entries-intro}' >> entries.tex
23065 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
23066
23067 theorems:
23068 - @echo "\chapter{Pre-proved Theorems}" > theorems.tex
23069 - @echo "\input{theorems-intro}" >> theorems.tex
23070 - @echo "\section{The theory {\tt word\_base}}">>theorems.tex
23071 + @printf '\\chapter{Pre-proved Theorems}' > theorems.tex
23072 + @printf '\\input{theorems-intro}' >> theorems.tex
23073 + @printf '\\section{The theory {\\tt word\\_base}}'>>theorems.tex
23074 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/word_base theorems.tex
23075 - @echo "\section{The theory {\tt word\_bitop}}">>theorems.tex
23076 + @printf '\\section{The theory {\\tt word\\_bitop}}'>>theorems.tex
23077 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/word_bitop theorems.tex
23078 - @echo "\section{The theory {\tt word\_num}}">>theorems.tex
23079 + @printf '\\section{The theory {\\tt word\\_num}}'>>theorems.tex
23080 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/word_num theorems.tex
23081 - @echo "\section{The theory {\tt bword\_bitop}}">>theorems.tex
23082 + @printf '\\section{The theory {\\tt bword\\_bitop}}'>>theorems.tex
23083 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/bword_bitop theorems.tex
23084 - @echo "\section{The theory {\tt bword\_num}}">>theorems.tex
23085 + @printf '\\section{The theory {\\tt bword\\_num}}'>>theorems.tex
23086 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/bword_num theorems.tex
23087 - @echo "\section{The theory {\tt bword\_arith}}">>theorems.tex
23088 + @printf '\\section{The theory {\\tt bword\\_arith}}'>>theorems.tex
23089 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/bword_arith theorems.tex
23090
23091 index:
23092 --- hol88-2.02.19940316.orig/Library/word/Manual/entries.tex
23093 +++ hol88-2.02.19940316/Library/word/Manual/entries.tex
23094 @@ -1,7 +1,4 @@
23095 -\chapter{ML Functions in the {\tt word} Library}
23096 -\label{entries}
23097 -\input{entries-intro}
23098 -\DOC{BIT\_CONV}
23099 +\chapter{ML Functions in the {\tt word} Library}\label{entries}\input{entries-intro}\DOC{BIT\_CONV}
23100
23101 \TYPE {\small\verb%BIT_CONV : conv%}\egroup
23102
23103 --- hol88-2.02.19940316.orig/Library/pred_sets/Manual/Makefile
23104 +++ hol88-2.02.19940316/Library/pred_sets/Manual/Makefile
23105 @@ -25,47 +25,47 @@ default:
23106 # ---------------------------------------------------------------------
23107 clean:
23108 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
23109 - @echo "\begin{theindex}" > index.tex
23110 - @echo "\mbox{}" >> index.tex
23111 - @echo "\end{theindex}" >> index.tex
23112 + @printf '\\begin{theindex}' > index.tex
23113 + @printf '\\mbox{}' >> index.tex
23114 + @printf '\\end{theindex}' >> index.tex
23115
23116 tex: theorems ids
23117 @echo "TeX files made"
23118
23119 ids:
23120 - @echo "\chapter{ML Functions in the Library}">entries.tex
23121 - @echo "\label{entries}">>entries.tex
23122 - @echo "\input{entries-intro}" >> entries.tex
23123 + @printf '\\chapter{ML Functions in the Library}'>entries.tex
23124 + @printf '\\label{entries}'>>entries.tex
23125 + @printf '\\input{entries-intro}' >> entries.tex
23126 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
23127
23128 theorems:
23129 - @echo "\chapter{Pre-proved Theorems}" > theorems.tex
23130 - @echo "\input{theorems-intro}" >> theorems.tex
23131 - @echo "\section{Membership, equality, and set specifications}">>theorems.tex
23132 + @printf '\\chapter{Pre-proved Theorems}' > theorems.tex
23133 + @printf '\\input{theorems-intro}' >> theorems.tex
23134 + @printf '\\section{Membership, equality, and set specifications}'>>theorems.tex
23135 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/mem theorems.tex
23136 - @echo "\section{The empty and universal sets}">>theorems.tex
23137 + @printf '\\section{The empty and universal sets}'>>theorems.tex
23138 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/emuniv theorems.tex
23139 - @echo "\section{Set inclusion}">>theorems.tex
23140 + @printf '\\section{Set inclusion}'>>theorems.tex
23141 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/subs theorems.tex
23142 - @echo "\section{Intersection and union}">>theorems.tex
23143 + @printf '\\section{Intersection and union}'>>theorems.tex
23144 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/unin theorems.tex
23145 - @echo "\section{Set difference}">>theorems.tex
23146 + @printf '\\section{Set difference}'>>theorems.tex
23147 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/diff theorems.tex
23148 - @echo "\section{Disjoint sets}">>theorems.tex
23149 + @printf '\\section{Disjoint sets}'>>theorems.tex
23150 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/disj theorems.tex
23151 - @echo "\section{Insertion and deletion of an element}">>theorems.tex
23152 + @printf '\\section{Insertion and deletion of an element}'>>theorems.tex
23153 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/insdel theorems.tex
23154 - @echo "\section{The {\tt CHOICE} and {\tt REST} functions}">>theorems.tex
23155 + @printf '\\section{The {\\tt CHOICE} and {\\tt REST} functions}'>>theorems.tex
23156 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/chre theorems.tex
23157 - @echo "\section{Image of a function on a set}">>theorems.tex
23158 + @printf '\\section{Image of a function on a set}'>>theorems.tex
23159 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/image theorems.tex
23160 - @echo "\section{Mappings between sets}">>theorems.tex
23161 + @printf '\\section{Mappings between sets}'>>theorems.tex
23162 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/fun theorems.tex
23163 - @echo "\section{Singleton sets}">>theorems.tex
23164 + @printf '\\section{Singleton sets}'>>theorems.tex
23165 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/sing theorems.tex
23166 - @echo "\section{Finite and infinite sets}">>theorems.tex
23167 + @printf '\\section{Finite and infinite sets}'>>theorems.tex
23168 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/fin theorems.tex
23169 - @echo "\section{Cardinality of sets}">>theorems.tex
23170 + @printf '\\section{Cardinality of sets}'>>theorems.tex
23171 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/card theorems.tex
23172
23173 index:
23174 --- hol88-2.02.19940316.orig/Library/pred_sets/Manual/entries.tex
23175 +++ hol88-2.02.19940316/Library/pred_sets/Manual/entries.tex
23176 @@ -1,7 +1,4 @@
23177 -\chapter{ML Functions in the Library}
23178 -\label{entries}
23179 -\input{entries-intro}
23180 -\DOC{DELETE\_CONV}
23181 +\chapter{ML Functions in the Library}\label{entries}\input{entries-intro}\DOC{DELETE\_CONV}
23182
23183 \TYPE {\small\verb%DELETE_CONV : conv -> conv%}\egroup
23184
23185 @@ -204,6 +201,84 @@ for some {\small\verb%ri%}.
23186
23187 \ENDDOC
23188
23189 +\DOC{IN\_CONV}
23190 +
23191 +\TYPE {\small\verb%IN_CONV : conv -> conv%}\egroup
23192 +
23193 +\SYNOPSIS
23194 +Decision procedure for membership in finite sets.
23195 +
23196 +\DESCRIBE
23197 +The function {\small\verb%IN_CONV%} is a parameterized conversion for proving or disproving
23198 +membership assertions of the general form:
23199 +{\par\samepage\setseps\small
23200 +\begin{verbatim}
23201 + "t IN {t1,...,tn}"
23202 +\end{verbatim}
23203 +}
23204 +\noindent where {\small\verb%{t1,...,tn}%} is a set of type {\small\verb%ty->bool%} and {\small\verb%t%} is a value
23205 +of the base type {\small\verb%ty%}. The first argument to {\small\verb%IN_CONV%} is expected to be a
23206 +conversion that decides equality between values of the base type {\small\verb%ty%}. Given
23207 +an equation {\small\verb%"e1 = e2"%}, where {\small\verb%e1%} and {\small\verb%e2%} are terms of type {\small\verb%ty%}, this
23208 +conversion should return the theorem {\small\verb%|- (e1 = e2) = T%} or the theorem
23209 +{\small\verb%|- (e1 = e2) = F%}, as appropriate.
23210 +
23211 +Given such a conversion, the function {\small\verb%IN_CONV%} returns a conversion that
23212 +maps a term of the form {\small\verb%"t IN {t1,...,tn}"%} to the theorem
23213 +{\par\samepage\setseps\small
23214 +\begin{verbatim}
23215 + |- t IN {t1,...,tn} = T
23216 +\end{verbatim}
23217 +}
23218 +
23219 +\noindent if {\small\verb%t%} is alpha-equivalent to any {\small\verb%ti%}, or if the supplied conversion
23220 +proves {\small\verb%|- (t = ti) = T%} for any {\small\verb%ti%}. If the supplied conversion proves
23221 +{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}, then the result is the theorem
23222 +{\par\samepage\setseps\small
23223 +\begin{verbatim}
23224 + |- t IN {t1,...,tn} = F
23225 +\end{verbatim}
23226 +}
23227 +\noindent In all other cases, {\small\verb%IN_CONV%} will fail.
23228 +
23229 +\EXAMPLE
23230 +In the following example, the conversion {\small\verb%num_EQ_CONV%} is supplied as a
23231 +parameter and used to test equality of the candidate element {\small\verb%1%} with the
23232 +actual elements of the given set.
23233 +{\par\samepage\setseps\small
23234 +\begin{verbatim}
23235 + #IN_CONV num_EQ_CONV "2 IN {0,SUC 1,3}";;
23236 + |- 2 IN {0,SUC 1,3} = T
23237 +\end{verbatim}
23238 +}
23239 +\noindent The result is {\small\verb%T%} because {\small\verb%num_EQ_CONV%} is able to prove that {\small\verb%2%} is
23240 +equal to {\small\verb%SUC 1%}. An example of a negative result is:
23241 +{\par\samepage\setseps\small
23242 +\begin{verbatim}
23243 + #IN_CONV num_EQ_CONV "1 IN {0,2,3}";;
23244 + |- 1 IN {0,2,3} = F
23245 +\end{verbatim}
23246 +}
23247 +\noindent Finally the behaviour of the supplied conversion is irrelevant when
23248 +the value to be tested for membership is alpha-equivalent to an actual element:
23249 +{\par\samepage\setseps\small
23250 +\begin{verbatim}
23251 + #IN_CONV NO_CONV "1 IN {3,2,1}";;
23252 + |- 1 IN {3,2,1} = T
23253 +\end{verbatim}
23254 +}
23255 +\noindent The conversion {\small\verb%NO_CONV%} always fails, but {\small\verb%IN_CONV%} is nontheless
23256 +able in this case to prove the required result.
23257 +
23258 +\FAILURE
23259 +{\small\verb%IN_CONV conv%} fails if applied to a term that is not of the form {\small\verb%"t IN
23260 +{t1,...,tn}"%}. A call {\small\verb%IN_CONV conv "t IN {t1,...,tn}"%} fails unless the
23261 +term {\small\verb%t%} is alpha-equivalent to some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns
23262 +{\small\verb%|- (t = ti) = T%} for some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns
23263 +{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}.
23264 +
23265 +\ENDDOC
23266 +
23267 \DOC{INSERT\_CONV}
23268
23269 \TYPE {\small\verb%INSERT_CONV : conv -> conv%}\egroup
23270 @@ -290,84 +365,6 @@ DELETE_CONV.
23271
23272 \ENDDOC
23273
23274 -\DOC{IN\_CONV}
23275 -
23276 -\TYPE {\small\verb%IN_CONV : conv -> conv%}\egroup
23277 -
23278 -\SYNOPSIS
23279 -Decision procedure for membership in finite sets.
23280 -
23281 -\DESCRIBE
23282 -The function {\small\verb%IN_CONV%} is a parameterized conversion for proving or disproving
23283 -membership assertions of the general form:
23284 -{\par\samepage\setseps\small
23285 -\begin{verbatim}
23286 - "t IN {t1,...,tn}"
23287 -\end{verbatim}
23288 -}
23289 -\noindent where {\small\verb%{t1,...,tn}%} is a set of type {\small\verb%ty->bool%} and {\small\verb%t%} is a value
23290 -of the base type {\small\verb%ty%}. The first argument to {\small\verb%IN_CONV%} is expected to be a
23291 -conversion that decides equality between values of the base type {\small\verb%ty%}. Given
23292 -an equation {\small\verb%"e1 = e2"%}, where {\small\verb%e1%} and {\small\verb%e2%} are terms of type {\small\verb%ty%}, this
23293 -conversion should return the theorem {\small\verb%|- (e1 = e2) = T%} or the theorem
23294 -{\small\verb%|- (e1 = e2) = F%}, as appropriate.
23295 -
23296 -Given such a conversion, the function {\small\verb%IN_CONV%} returns a conversion that
23297 -maps a term of the form {\small\verb%"t IN {t1,...,tn}"%} to the theorem
23298 -{\par\samepage\setseps\small
23299 -\begin{verbatim}
23300 - |- t IN {t1,...,tn} = T
23301 -\end{verbatim}
23302 -}
23303 -
23304 -\noindent if {\small\verb%t%} is alpha-equivalent to any {\small\verb%ti%}, or if the supplied conversion
23305 -proves {\small\verb%|- (t = ti) = T%} for any {\small\verb%ti%}. If the supplied conversion proves
23306 -{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}, then the result is the theorem
23307 -{\par\samepage\setseps\small
23308 -\begin{verbatim}
23309 - |- t IN {t1,...,tn} = F
23310 -\end{verbatim}
23311 -}
23312 -\noindent In all other cases, {\small\verb%IN_CONV%} will fail.
23313 -
23314 -\EXAMPLE
23315 -In the following example, the conversion {\small\verb%num_EQ_CONV%} is supplied as a
23316 -parameter and used to test equality of the candidate element {\small\verb%1%} with the
23317 -actual elements of the given set.
23318 -{\par\samepage\setseps\small
23319 -\begin{verbatim}
23320 - #IN_CONV num_EQ_CONV "2 IN {0,SUC 1,3}";;
23321 - |- 2 IN {0,SUC 1,3} = T
23322 -\end{verbatim}
23323 -}
23324 -\noindent The result is {\small\verb%T%} because {\small\verb%num_EQ_CONV%} is able to prove that {\small\verb%2%} is
23325 -equal to {\small\verb%SUC 1%}. An example of a negative result is:
23326 -{\par\samepage\setseps\small
23327 -\begin{verbatim}
23328 - #IN_CONV num_EQ_CONV "1 IN {0,2,3}";;
23329 - |- 1 IN {0,2,3} = F
23330 -\end{verbatim}
23331 -}
23332 -\noindent Finally the behaviour of the supplied conversion is irrelevant when
23333 -the value to be tested for membership is alpha-equivalent to an actual element:
23334 -{\par\samepage\setseps\small
23335 -\begin{verbatim}
23336 - #IN_CONV NO_CONV "1 IN {3,2,1}";;
23337 - |- 1 IN {3,2,1} = T
23338 -\end{verbatim}
23339 -}
23340 -\noindent The conversion {\small\verb%NO_CONV%} always fails, but {\small\verb%IN_CONV%} is nontheless
23341 -able in this case to prove the required result.
23342 -
23343 -\FAILURE
23344 -{\small\verb%IN_CONV conv%} fails if applied to a term that is not of the form {\small\verb%"t IN
23345 -{t1,...,tn}"%}. A call {\small\verb%IN_CONV conv "t IN {t1,...,tn}"%} fails unless the
23346 -term {\small\verb%t%} is alpha-equivalent to some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns
23347 -{\small\verb%|- (t = ti) = T%} for some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns
23348 -{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}.
23349 -
23350 -\ENDDOC
23351 -
23352 \DOC{SET\_INDUCT\_TAC}
23353
23354 \TYPE {\small\verb%SET_INDUCT_TAC : tactic%}\egroup
23355 --- hol88-2.02.19940316.orig/Library/reals/Manual/theorems.tex
23356 +++ hol88-2.02.19940316/Library/reals/Manual/theorems.tex
23357 @@ -1,18 +1,15 @@
23358 -\chapter{Pre-proved Theorems}
23359 -\input{theorems-intro}
23360 -\section{HRAT}
23361 -\THEOREM hrat\_1 HRAT
23362 +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{HRAT}\THEOREM hrat\_1 HRAT
23363 |- hrat_1 = mk_hrat($trat_eq trat_1)
23364 \ENDTHEOREM
23365 +\THEOREM HRAT\_ADD\_ASSOC HRAT
23366 +|- !h i j. h hrat_add (i hrat_add j) = (h hrat_add i) hrat_add j
23367 +\ENDTHEOREM
23368 \THEOREM hrat\_add HRAT
23369 |- !g00014 g00015.
23370 g00014 hrat_add g00015 =
23371 mk_hrat
23372 ($trat_eq(($@(dest_hrat g00014)) trat_add ($@(dest_hrat g00015))))
23373 \ENDTHEOREM
23374 -\THEOREM HRAT\_ADD\_ASSOC HRAT
23375 -|- !h i j. h hrat_add (i hrat_add j) = (h hrat_add i) hrat_add j
23376 -\ENDTHEOREM
23377 \THEOREM HRAT\_ADD\_SYM HRAT
23378 |- !h i. h hrat_add i = i hrat_add h
23379 \ENDTHEOREM
23380 @@ -30,15 +27,15 @@
23381 |- !h i j.
23382 h hrat_mul (i hrat_add j) = (h hrat_mul i) hrat_add (h hrat_mul j)
23383 \ENDTHEOREM
23384 +\THEOREM HRAT\_MUL\_ASSOC HRAT
23385 +|- !h i j. h hrat_mul (i hrat_mul j) = (h hrat_mul i) hrat_mul j
23386 +\ENDTHEOREM
23387 \THEOREM hrat\_mul HRAT
23388 |- !g00016 g00017.
23389 g00016 hrat_mul g00017 =
23390 mk_hrat
23391 ($trat_eq(($@(dest_hrat g00016)) trat_mul ($@(dest_hrat g00017))))
23392 \ENDTHEOREM
23393 -\THEOREM HRAT\_MUL\_ASSOC HRAT
23394 -|- !h i j. h hrat_mul (i hrat_mul j) = (h hrat_mul i) hrat_mul j
23395 -\ENDTHEOREM
23396 \THEOREM HRAT\_MUL\_LID HRAT
23397 |- !h. hrat_1 hrat_mul h = h
23398 \ENDTHEOREM
23399 @@ -51,13 +48,13 @@
23400 \THEOREM HRAT\_NOZERO HRAT
23401 |- !h i. ~(h hrat_add i = h)
23402 \ENDTHEOREM
23403 +\THEOREM hrat\_sucint HRAT
23404 +|- !g00018. hrat_sucint g00018 = mk_hrat($trat_eq(trat_sucint g00018))
23405 +\ENDTHEOREM
23406 \THEOREM HRAT\_SUCINT HRAT
23407 |- (hrat_sucint 0 = hrat_1) /\
23408 (!n. hrat_sucint(SUC n) = (hrat_sucint n) hrat_add hrat_1)
23409 \ENDTHEOREM
23410 -\THEOREM hrat\_sucint HRAT
23411 -|- !g00018. hrat_sucint g00018 = mk_hrat($trat_eq(trat_sucint g00018))
23412 -\ENDTHEOREM
23413 \THEOREM hrat\_tybij HRAT
23414 |- (!a. mk_hrat(dest_hrat a) = a) /\
23415 (!r. (\c. ?x. c = $trat_eq x)r = (dest_hrat(mk_hrat r) = r))
23416 @@ -68,16 +65,16 @@
23417 \THEOREM trat\_1 HRAT
23418 |- trat_1 = 0,0
23419 \ENDTHEOREM
23420 +\THEOREM TRAT\_ADD\_ASSOC HRAT
23421 +|- !h i j.
23422 + (h trat_add (i trat_add j)) trat_eq ((h trat_add i) trat_add j)
23423 +\ENDTHEOREM
23424 \THEOREM trat\_add HRAT
23425 |- !x y x' y'.
23426 (x,y) trat_add (x',y') =
23427 PRE(((SUC x) * (SUC y')) + ((SUC x') * (SUC y))),
23428 PRE((SUC y) * (SUC y'))
23429 \ENDTHEOREM
23430 -\THEOREM TRAT\_ADD\_ASSOC HRAT
23431 -|- !h i j.
23432 - (h trat_add (i trat_add j)) trat_eq ((h trat_add i) trat_add j)
23433 -\ENDTHEOREM
23434 \THEOREM TRAT\_ADD\_SYM HRAT
23435 |- !h i. (h trat_add i) trat_eq (i trat_add h)
23436 \ENDTHEOREM
23437 @@ -90,24 +87,24 @@
23438 (?d. h trat_eq (i trat_add d)) \/
23439 (?d. i trat_eq (h trat_add d))
23440 \ENDTHEOREM
23441 -\THEOREM TRAT\_ADD\_WELLDEFINED HRAT
23442 -|- !p q r. p trat_eq q ==> (p trat_add r) trat_eq (q trat_add r)
23443 -\ENDTHEOREM
23444 \THEOREM TRAT\_ADD\_WELLDEFINED2 HRAT
23445 |- !p1 p2 q1 q2.
23446 p1 trat_eq p2 /\ q1 trat_eq q2 ==>
23447 (p1 trat_add q1) trat_eq (p2 trat_add q2)
23448 \ENDTHEOREM
23449 +\THEOREM TRAT\_ADD\_WELLDEFINED HRAT
23450 +|- !p q r. p trat_eq q ==> (p trat_add r) trat_eq (q trat_add r)
23451 +\ENDTHEOREM
23452 \THEOREM TRAT\_ARCH HRAT
23453 |- !h. ?n d. (trat_sucint n) trat_eq (h trat_add d)
23454 \ENDTHEOREM
23455 +\THEOREM TRAT\_EQ\_AP HRAT
23456 +|- !p q. (p = q) ==> p trat_eq q
23457 +\ENDTHEOREM
23458 \THEOREM trat\_eq HRAT
23459 |- !x y x' y'.
23460 (x,y) trat_eq (x',y') = ((SUC x) * (SUC y') = (SUC x') * (SUC y))
23461 \ENDTHEOREM
23462 -\THEOREM TRAT\_EQ\_AP HRAT
23463 -|- !p q. (p = q) ==> p trat_eq q
23464 -\ENDTHEOREM
23465 \THEOREM TRAT\_EQ\_EQUIV HRAT
23466 |- !p q. p trat_eq q = ($trat_eq p = $trat_eq q)
23467 \ENDTHEOREM
23468 @@ -131,15 +128,15 @@
23469 (h trat_mul (i trat_add j)) trat_eq
23470 ((h trat_mul i) trat_add (h trat_mul j))
23471 \ENDTHEOREM
23472 +\THEOREM TRAT\_MUL\_ASSOC HRAT
23473 +|- !h i j.
23474 + (h trat_mul (i trat_mul j)) trat_eq ((h trat_mul i) trat_mul j)
23475 +\ENDTHEOREM
23476 \THEOREM trat\_mul HRAT
23477 |- !x y x' y'.
23478 (x,y) trat_mul (x',y') =
23479 PRE((SUC x) * (SUC x')),PRE((SUC y) * (SUC y'))
23480 \ENDTHEOREM
23481 -\THEOREM TRAT\_MUL\_ASSOC HRAT
23482 -|- !h i j.
23483 - (h trat_mul (i trat_mul j)) trat_eq ((h trat_mul i) trat_mul j)
23484 -\ENDTHEOREM
23485 \THEOREM TRAT\_MUL\_LID HRAT
23486 |- !h. (trat_1 trat_mul h) trat_eq h
23487 \ENDTHEOREM
23488 @@ -152,30 +149,29 @@
23489 \THEOREM TRAT\_MUL\_SYM\_EQ HRAT
23490 |- !h i. h trat_mul i = i trat_mul h
23491 \ENDTHEOREM
23492 -\THEOREM TRAT\_MUL\_WELLDEFINED HRAT
23493 -|- !p q r. p trat_eq q ==> (p trat_mul r) trat_eq (q trat_mul r)
23494 -\ENDTHEOREM
23495 \THEOREM TRAT\_MUL\_WELLDEFINED2 HRAT
23496 |- !p1 p2 q1 q2.
23497 p1 trat_eq p2 /\ q1 trat_eq q2 ==>
23498 (p1 trat_mul q1) trat_eq (p2 trat_mul q2)
23499 \ENDTHEOREM
23500 +\THEOREM TRAT\_MUL\_WELLDEFINED HRAT
23501 +|- !p q r. p trat_eq q ==> (p trat_mul r) trat_eq (q trat_mul r)
23502 +\ENDTHEOREM
23503 \THEOREM TRAT\_NOZERO HRAT
23504 |- !h i. ~(h trat_add i) trat_eq h
23505 \ENDTHEOREM
23506 -\THEOREM TRAT\_SUCINT HRAT
23507 -|- (trat_sucint 0) trat_eq trat_1 /\
23508 - (!n. (trat_sucint(SUC n)) trat_eq ((trat_sucint n) trat_add trat_1))
23509 +\THEOREM TRAT\_SUCINT\_0 HRAT
23510 +|- !n. (trat_sucint n) trat_eq (n,0)
23511 \ENDTHEOREM
23512 \THEOREM trat\_sucint HRAT
23513 |- (trat_sucint 0 = trat_1) /\
23514 (!n. trat_sucint(SUC n) = (trat_sucint n) trat_add trat_1)
23515 \ENDTHEOREM
23516 -\THEOREM TRAT\_SUCINT\_0 HRAT
23517 -|- !n. (trat_sucint n) trat_eq (n,0)
23518 +\THEOREM TRAT\_SUCINT HRAT
23519 +|- (trat_sucint 0) trat_eq trat_1 /\
23520 + (!n. (trat_sucint(SUC n)) trat_eq ((trat_sucint n) trat_add trat_1))
23521 \ENDTHEOREM
23522 -\section{HREAL}
23523 -\THEOREM CUT\_BOUNDED HREAL
23524 +\section{HREAL}\THEOREM CUT\_BOUNDED HREAL
23525 |- !X. ?x. ~cut X x
23526 \ENDTHEOREM
23527 \THEOREM CUT\_DOWN HREAL
23528 @@ -208,12 +204,12 @@
23529 \THEOREM EQUAL\_CUTS HREAL
23530 |- !X Y. (cut X = cut Y) ==> (X = Y)
23531 \ENDTHEOREM
23532 -\THEOREM HRAT\_DOWN HREAL
23533 -|- !x. ?y. y hrat_lt x
23534 -\ENDTHEOREM
23535 \THEOREM HRAT\_DOWN2 HREAL
23536 |- !x y. ?z. z hrat_lt x /\ z hrat_lt y
23537 \ENDTHEOREM
23538 +\THEOREM HRAT\_DOWN HREAL
23539 +|- !x. ?y. y hrat_lt x
23540 +\ENDTHEOREM
23541 \THEOREM HRAT\_EQ\_LADD HREAL
23542 |- !x y z. (x hrat_add y = x hrat_add z) = (y = z)
23543 \ENDTHEOREM
23544 @@ -229,9 +225,6 @@
23545 \THEOREM HRAT\_INV\_MUL HREAL
23546 |- !x y. hrat_inv(x hrat_mul y) = (hrat_inv x) hrat_mul (hrat_inv y)
23547 \ENDTHEOREM
23548 -\THEOREM hrat\_lt HREAL
23549 -|- !x y. x hrat_lt y = (?d. y = x hrat_add d)
23550 -\ENDTHEOREM
23551 \THEOREM HRAT\_LT\_ADD2 HREAL
23552 |- !u v x y.
23553 u hrat_lt x /\ v hrat_lt y ==> (u hrat_add v) hrat_lt (x hrat_add y)
23554 @@ -245,6 +238,9 @@
23555 \THEOREM HRAT\_LT\_ANTISYM HREAL
23556 |- !x y. ~(x hrat_lt y /\ y hrat_lt x)
23557 \ENDTHEOREM
23558 +\THEOREM hrat\_lt HREAL
23559 +|- !x y. x hrat_lt y = (?d. y = x hrat_add d)
23560 +\ENDTHEOREM
23561 \THEOREM HRAT\_LT\_GT HREAL
23562 |- !x y. x hrat_lt y ==> ~y hrat_lt x
23563 \ENDTHEOREM
23564 @@ -254,12 +250,12 @@
23565 \THEOREM HRAT\_LT\_LADD HREAL
23566 |- !x y z. (z hrat_add x) hrat_lt (z hrat_add y) = x hrat_lt y
23567 \ENDTHEOREM
23568 -\THEOREM HRAT\_LT\_LMUL HREAL
23569 -|- !x y z. (z hrat_mul x) hrat_lt (z hrat_mul y) = x hrat_lt y
23570 -\ENDTHEOREM
23571 \THEOREM HRAT\_LT\_LMUL1 HREAL
23572 |- !x y. (x hrat_mul y) hrat_lt y = x hrat_lt hrat_1
23573 \ENDTHEOREM
23574 +\THEOREM HRAT\_LT\_LMUL HREAL
23575 +|- !x y z. (z hrat_mul x) hrat_lt (z hrat_mul y) = x hrat_lt y
23576 +\ENDTHEOREM
23577 \THEOREM HRAT\_LT\_MUL2 HREAL
23578 |- !u v x y.
23579 u hrat_lt x /\ v hrat_lt y ==> (u hrat_mul v) hrat_lt (x hrat_mul y)
23580 @@ -276,12 +272,12 @@
23581 \THEOREM HRAT\_LT\_REFL HREAL
23582 |- !x. ~x hrat_lt x
23583 \ENDTHEOREM
23584 -\THEOREM HRAT\_LT\_RMUL HREAL
23585 -|- !x y z. (x hrat_mul z) hrat_lt (y hrat_mul z) = x hrat_lt y
23586 -\ENDTHEOREM
23587 \THEOREM HRAT\_LT\_RMUL1 HREAL
23588 |- !x y. (x hrat_mul y) hrat_lt x = y hrat_lt hrat_1
23589 \ENDTHEOREM
23590 +\THEOREM HRAT\_LT\_RMUL HREAL
23591 +|- !x y z. (x hrat_mul z) hrat_lt (y hrat_mul z) = x hrat_lt y
23592 +\ENDTHEOREM
23593 \THEOREM HRAT\_LT\_TOTAL HREAL
23594 |- !x y. (x = y) \/ x hrat_lt y \/ y hrat_lt x
23595 \ENDTHEOREM
23596 @@ -307,14 +303,14 @@
23597 \THEOREM hreal\_1 HREAL
23598 |- hreal_1 = hreal(cut_of_hrat hrat_1)
23599 \ENDTHEOREM
23600 +\THEOREM HREAL\_ADD\_ASSOC HREAL
23601 +|- !X Y Z. X hreal_add (Y hreal_add Z) = (X hreal_add Y) hreal_add Z
23602 +\ENDTHEOREM
23603 \THEOREM hreal\_add HREAL
23604 |- !X Y.
23605 X hreal_add Y =
23606 hreal(\w. ?x y. (w = x hrat_add y) /\ cut X x /\ cut Y y)
23607 \ENDTHEOREM
23608 -\THEOREM HREAL\_ADD\_ASSOC HREAL
23609 -|- !X Y Z. X hreal_add (Y hreal_add Z) = (X hreal_add Y) hreal_add Z
23610 -\ENDTHEOREM
23611 \THEOREM HREAL\_ADD\_ISACUT HREAL
23612 |- !X Y. isacut(\w. ?x y. (w = x hrat_add y) /\ cut X x /\ cut Y y)
23613 \ENDTHEOREM
23614 @@ -342,26 +338,26 @@
23615 X hreal_mul (Y hreal_add Z) =
23616 (X hreal_mul Y) hreal_add (X hreal_mul Z)
23617 \ENDTHEOREM
23618 -\THEOREM HREAL\_LT HREAL
23619 -|- !X Y. X hreal_lt Y = (?D. Y = X hreal_add D)
23620 -\ENDTHEOREM
23621 \THEOREM hreal\_lt HREAL
23622 |- !X Y. X hreal_lt Y = ~(X = Y) /\ (!x. cut X x ==> cut Y x)
23623 \ENDTHEOREM
23624 +\THEOREM HREAL\_LT HREAL
23625 +|- !X Y. X hreal_lt Y = (?D. Y = X hreal_add D)
23626 +\ENDTHEOREM
23627 \THEOREM HREAL\_LT\_LEMMA HREAL
23628 |- !X Y. X hreal_lt Y ==> (?x. ~cut X x /\ cut Y x)
23629 \ENDTHEOREM
23630 \THEOREM HREAL\_LT\_TOTAL HREAL
23631 |- !X Y. (X = Y) \/ X hreal_lt Y \/ Y hreal_lt X
23632 \ENDTHEOREM
23633 +\THEOREM HREAL\_MUL\_ASSOC HREAL
23634 +|- !X Y Z. X hreal_mul (Y hreal_mul Z) = (X hreal_mul Y) hreal_mul Z
23635 +\ENDTHEOREM
23636 \THEOREM hreal\_mul HREAL
23637 |- !X Y.
23638 X hreal_mul Y =
23639 hreal(\w. ?x y. (w = x hrat_mul y) /\ cut X x /\ cut Y y)
23640 \ENDTHEOREM
23641 -\THEOREM HREAL\_MUL\_ASSOC HREAL
23642 -|- !X Y Z. X hreal_mul (Y hreal_mul Z) = (X hreal_mul Y) hreal_mul Z
23643 -\ENDTHEOREM
23644 \THEOREM HREAL\_MUL\_ISACUT HREAL
23645 |- !X Y. isacut(\w. ?x y. (w = x hrat_mul y) /\ cut X x /\ cut Y y)
23646 \ENDTHEOREM
23647 @@ -377,24 +373,24 @@
23648 \THEOREM HREAL\_NOZERO HREAL
23649 |- !X Y. ~(X hreal_add Y = X)
23650 \ENDTHEOREM
23651 -\THEOREM hreal\_sub HREAL
23652 -|- !Y X. Y hreal_sub X = hreal(\w. ?x. ~cut X x /\ cut Y(x hrat_add w))
23653 -\ENDTHEOREM
23654 \THEOREM HREAL\_SUB\_ADD HREAL
23655 |- !X Y. X hreal_lt Y ==> ((Y hreal_sub X) hreal_add X = Y)
23656 \ENDTHEOREM
23657 +\THEOREM hreal\_sub HREAL
23658 +|- !Y X. Y hreal_sub X = hreal(\w. ?x. ~cut X x /\ cut Y(x hrat_add w))
23659 +\ENDTHEOREM
23660 \THEOREM HREAL\_SUB\_ISACUT HREAL
23661 |- !X Y.
23662 X hreal_lt Y ==> isacut(\w. ?x. ~cut X x /\ cut Y(x hrat_add w))
23663 \ENDTHEOREM
23664 +\THEOREM hreal\_sup HREAL
23665 +|- !P. hreal_sup P = hreal(\w. ?X. P X /\ cut X w)
23666 +\ENDTHEOREM
23667 \THEOREM HREAL\_SUP HREAL
23668 |- !P.
23669 (?X. P X) /\ (?Y. !X. P X ==> X hreal_lt Y) ==>
23670 (!Y. (?X. P X /\ Y hreal_lt X) = Y hreal_lt (hreal_sup P))
23671 \ENDTHEOREM
23672 -\THEOREM hreal\_sup HREAL
23673 -|- !P. hreal_sup P = hreal(\w. ?X. P X /\ cut X w)
23674 -\ENDTHEOREM
23675 \THEOREM HREAL\_SUP\_ISACUT HREAL
23676 |- !P.
23677 (?X. P X) /\ (?Y. !X. P X ==> X hreal_lt Y) ==>
23678 @@ -417,8 +413,7 @@
23679 \THEOREM ISACUT\_HRAT HREAL
23680 |- !h. isacut(cut_of_hrat h)
23681 \ENDTHEOREM
23682 -\section{REALAX}
23683 -\THEOREM HREAL\_EQ\_ADDL REALAX
23684 +\section{REALAX}\THEOREM HREAL\_EQ\_ADDL REALAX
23685 |- !x y. ~(x = x hreal_add y)
23686 \ENDTHEOREM
23687 \THEOREM HREAL\_EQ\_ADDR REALAX
23688 @@ -470,15 +465,15 @@
23689 \THEOREM REAL\_10 REALAX
23690 |- ~(r1 = r0)
23691 \ENDTHEOREM
23692 +\THEOREM REAL\_ADD\_ASSOC REALAX
23693 +|- !x y z. x + (y + z) = (x + y) + z
23694 +\ENDTHEOREM
23695 \THEOREM real\_add REALAX
23696 |- !g00025 g00026.
23697 g00025 + g00026 =
23698 mk_real
23699 ($treal_eq(($@(dest_real g00025)) treal_add ($@(dest_real g00026))))
23700 \ENDTHEOREM
23701 -\THEOREM REAL\_ADD\_ASSOC REALAX
23702 -|- !x y z. x + (y + z) = (x + y) + z
23703 -\ENDTHEOREM
23704 \THEOREM REAL\_ADD\_LID REALAX
23705 |- !x. r0 + x = x
23706 \ENDTHEOREM
23707 @@ -518,15 +513,15 @@
23708 \THEOREM REAL\_LT\_TRANS REALAX
23709 |- !x y z. x < y /\ y < z ==> x < z
23710 \ENDTHEOREM
23711 +\THEOREM REAL\_MUL\_ASSOC REALAX
23712 +|- !x y z. x * (y * z) = (x * y) * z
23713 +\ENDTHEOREM
23714 \THEOREM real\_mul REALAX
23715 |- !g00027 g00028.
23716 g00027 * g00028 =
23717 mk_real
23718 ($treal_eq(($@(dest_real g00027)) treal_mul ($@(dest_real g00028))))
23719 \ENDTHEOREM
23720 -\THEOREM REAL\_MUL\_ASSOC REALAX
23721 -|- !x y z. x * (y * z) = (x * y) * z
23722 -\ENDTHEOREM
23723 \THEOREM REAL\_MUL\_LID REALAX
23724 |- !x. r1 * x = x
23725 \ENDTHEOREM
23726 @@ -578,19 +573,19 @@
23727 \THEOREM treal\_0 REALAX
23728 |- treal_0 = hreal_1,hreal_1
23729 \ENDTHEOREM
23730 +\THEOREM TREAL\_10 REALAX
23731 +|- ~treal_1 treal_eq treal_0
23732 +\ENDTHEOREM
23733 \THEOREM treal\_1 REALAX
23734 |- treal_1 = hreal_1 hreal_add hreal_1,hreal_1
23735 \ENDTHEOREM
23736 -\THEOREM TREAL\_10 REALAX
23737 -|- ~treal_1 treal_eq treal_0
23738 +\THEOREM TREAL\_ADD\_ASSOC REALAX
23739 +|- !x y z. x treal_add (y treal_add z) = (x treal_add y) treal_add z
23740 \ENDTHEOREM
23741 \THEOREM treal\_add REALAX
23742 |- !x1 y1 x2 y2.
23743 (x1,y1) treal_add (x2,y2) = x1 hreal_add x2,y1 hreal_add y2
23744 \ENDTHEOREM
23745 -\THEOREM TREAL\_ADD\_ASSOC REALAX
23746 -|- !x y z. x treal_add (y treal_add z) = (x treal_add y) treal_add z
23747 -\ENDTHEOREM
23748 \THEOREM TREAL\_ADD\_LID REALAX
23749 |- !x. (treal_0 treal_add x) treal_eq x
23750 \ENDTHEOREM
23751 @@ -617,13 +612,13 @@
23752 \THEOREM TREAL\_BIJ\_WELLDEF REALAX
23753 |- !h i. h treal_eq i ==> (hreal_of_treal h = hreal_of_treal i)
23754 \ENDTHEOREM
23755 +\THEOREM TREAL\_EQ\_AP REALAX
23756 +|- !p q. (p = q) ==> p treal_eq q
23757 +\ENDTHEOREM
23758 \THEOREM treal\_eq REALAX
23759 |- !x1 y1 x2 y2.
23760 (x1,y1) treal_eq (x2,y2) = (x1 hreal_add y2 = x2 hreal_add y1)
23761 \ENDTHEOREM
23762 -\THEOREM TREAL\_EQ\_AP REALAX
23763 -|- !p q. (p = q) ==> p treal_eq q
23764 -\ENDTHEOREM
23765 \THEOREM TREAL\_EQ\_EQUIV REALAX
23766 |- !p q. p treal_eq q = ($treal_eq p = $treal_eq q)
23767 \ENDTHEOREM
23768 @@ -656,14 +651,14 @@
23769 x treal_mul (y treal_add z) =
23770 (x treal_mul y) treal_add (x treal_mul z)
23771 \ENDTHEOREM
23772 +\THEOREM TREAL\_LT\_ADD REALAX
23773 +|- !x y z. y treal_lt z ==> (x treal_add y) treal_lt (x treal_add z)
23774 +\ENDTHEOREM
23775 \THEOREM treal\_lt REALAX
23776 |- !x1 y1 x2 y2.
23777 (x1,y1) treal_lt (x2,y2) =
23778 (x1 hreal_add y2) hreal_lt (x2 hreal_add y1)
23779 \ENDTHEOREM
23780 -\THEOREM TREAL\_LT\_ADD REALAX
23781 -|- !x y z. y treal_lt z ==> (x treal_add y) treal_lt (x treal_add z)
23782 -\ENDTHEOREM
23783 \THEOREM TREAL\_LT\_MUL REALAX
23784 |- !x y.
23785 treal_0 treal_lt x /\ treal_0 treal_lt y ==>
23786 @@ -689,15 +684,15 @@
23787 \THEOREM TREAL\_LT\_WELLDEFR REALAX
23788 |- !x1 x2 y. x1 treal_eq x2 ==> (x1 treal_lt y = x2 treal_lt y)
23789 \ENDTHEOREM
23790 +\THEOREM TREAL\_MUL\_ASSOC REALAX
23791 +|- !x y z. x treal_mul (y treal_mul z) = (x treal_mul y) treal_mul z
23792 +\ENDTHEOREM
23793 \THEOREM treal\_mul REALAX
23794 |- !x1 y1 x2 y2.
23795 (x1,y1) treal_mul (x2,y2) =
23796 (x1 hreal_mul x2) hreal_add (y1 hreal_mul y2),
23797 (x1 hreal_mul y2) hreal_add (y1 hreal_mul x2)
23798 \ENDTHEOREM
23799 -\THEOREM TREAL\_MUL\_ASSOC REALAX
23800 -|- !x y z. x treal_mul (y treal_mul z) = (x treal_mul y) treal_mul z
23801 -\ENDTHEOREM
23802 \THEOREM TREAL\_MUL\_LID REALAX
23803 |- !x. (treal_1 treal_mul x) treal_eq x
23804 \ENDTHEOREM
23805 @@ -726,11 +721,7 @@
23806 \THEOREM treal\_of\_hreal REALAX
23807 |- !x. treal_of_hreal x = x hreal_add hreal_1,hreal_1
23808 \ENDTHEOREM
23809 -\section{REAL}
23810 -\THEOREM abs REAL
23811 -|- !x. abs x = ((& 0) <= x => x | -- x)
23812 -\ENDTHEOREM
23813 -\THEOREM REAL\_ABS\_0 REAL
23814 +\section{REAL}\THEOREM REAL\_ABS\_0 REAL
23815 |- abs(& 0) = & 0
23816 \ENDTHEOREM
23817 \THEOREM REAL\_ABS\_1 REAL
23818 @@ -739,9 +730,6 @@
23819 \THEOREM REAL\_ABS\_ABS REAL
23820 |- !x. abs(abs x) = abs x
23821 \ENDTHEOREM
23822 -\THEOREM REAL\_ABS\_BETWEEN REAL
23823 -|- !x y d. (& 0) < d /\ (x - d) < y /\ y < (x + d) = (abs(y - x)) < d
23824 -\ENDTHEOREM
23825 \THEOREM REAL\_ABS\_BETWEEN1 REAL
23826 |- !x y z. x < z /\ (abs(y - x)) < (z - x) ==> y < z
23827 \ENDTHEOREM
23828 @@ -752,6 +740,9 @@
23829 (abs(y - y0)) < ((y0 - x0) / (& 2)) ==>
23830 x < y
23831 \ENDTHEOREM
23832 +\THEOREM REAL\_ABS\_BETWEEN REAL
23833 +|- !x y d. (& 0) < d /\ (x - d) < y /\ y < (x + d) = (abs(y - x)) < d
23834 +\ENDTHEOREM
23835 \THEOREM REAL\_ABS\_BOUND REAL
23836 |- !x y d. (abs(x - y)) < d ==> y < (x + d)
23837 \ENDTHEOREM
23838 @@ -767,6 +758,9 @@
23839 \THEOREM REAL\_ABS\_DIV REAL
23840 |- !y. ~(y = & 0) ==> (!x. abs(x / y) = (abs x) / (abs y))
23841 \ENDTHEOREM
23842 +\THEOREM abs REAL
23843 +|- !x. abs x = ((& 0) <= x => x | -- x)
23844 +\ENDTHEOREM
23845 \THEOREM REAL\_ABS\_INV REAL
23846 |- !x. ~(x = & 0) ==> (abs(inv x) = inv(abs x))
23847 \ENDTHEOREM
23848 @@ -797,21 +791,21 @@
23849 \THEOREM REAL\_ABS\_REFL REAL
23850 |- !x. (abs x = x) = (& 0) <= x
23851 \ENDTHEOREM
23852 -\THEOREM REAL\_ABS\_SIGN REAL
23853 -|- !x y. (abs(x - y)) < y ==> (& 0) < x
23854 -\ENDTHEOREM
23855 \THEOREM REAL\_ABS\_SIGN2 REAL
23856 |- !x y. (abs(x - y)) < (-- y) ==> x < (& 0)
23857 \ENDTHEOREM
23858 +\THEOREM REAL\_ABS\_SIGN REAL
23859 +|- !x y. (abs(x - y)) < y ==> (& 0) < x
23860 +\ENDTHEOREM
23861 \THEOREM REAL\_ABS\_STILLNZ REAL
23862 |- !x y. (abs(x - y)) < (abs y) ==> ~(x = & 0)
23863 \ENDTHEOREM
23864 -\THEOREM REAL\_ABS\_SUB REAL
23865 -|- !x y. abs(x - y) = abs(y - x)
23866 -\ENDTHEOREM
23867 \THEOREM REAL\_ABS\_SUB\_ABS REAL
23868 |- !x y. (abs((abs x) - (abs y))) <= (abs(x - y))
23869 \ENDTHEOREM
23870 +\THEOREM REAL\_ABS\_SUB REAL
23871 +|- !x y. abs(x - y) = abs(y - x)
23872 +\ENDTHEOREM
23873 \THEOREM ABS\_SUM REAL
23874 |- !f m n. (abs(Sum(m,n)f)) <= (Sum(m,n)(\n'. abs(f n')))
23875 \ENDTHEOREM
23876 @@ -821,9 +815,6 @@
23877 \THEOREM REAL\_ABS\_ZERO REAL
23878 |- !x. (abs x = & 0) = (x = & 0)
23879 \ENDTHEOREM
23880 -\THEOREM pow REAL
23881 -|- (!x. x pow 0 = & 1) /\ (!x n. x pow (SUC n) = x * (x pow n))
23882 -\ENDTHEOREM
23883 \THEOREM POW\_0 REAL
23884 |- !n. (& 0) pow (SUC n) = & 0
23885 \ENDTHEOREM
23886 @@ -845,6 +836,9 @@
23887 \THEOREM POW\_ADD REAL
23888 |- !c m n. c pow (m num_add n) = (c pow m) * (c pow n)
23889 \ENDTHEOREM
23890 +\THEOREM pow REAL
23891 +|- (!x. x pow 0 = & 1) /\ (!x n. x pow (SUC n) = x * (x pow n))
23892 +\ENDTHEOREM
23893 \THEOREM POW\_INV REAL
23894 |- !c. ~(c = & 0) ==> (!n. inv(c pow n) = (inv c) pow n)
23895 \ENDTHEOREM
23896 @@ -872,20 +866,14 @@
23897 \THEOREM POW\_POS\_LT REAL
23898 |- !x n. (& 0) < x ==> (& 0) < (x pow (SUC n))
23899 \ENDTHEOREM
23900 -\THEOREM REAL REAL
23901 -|- !n. &(SUC n) = (& n) + (& 1)
23902 -\ENDTHEOREM
23903 \THEOREM REAL\_0 REAL
23904 |- r0 = & 0
23905 \ENDTHEOREM
23906 -\THEOREM REAL\_1 REAL
23907 -|- r1 = & 1
23908 -\ENDTHEOREM
23909 \THEOREM REAL\_10 REAL
23910 |- ~(& 1 = & 0)
23911 \ENDTHEOREM
23912 -\THEOREM REAL\_ADD REAL
23913 -|- !m n. (& m) + (& n) = &(m num_add n)
23914 +\THEOREM REAL\_1 REAL
23915 +|- r1 = & 1
23916 \ENDTHEOREM
23917 \THEOREM REAL\_ADD2\_SUB2 REAL
23918 |- !a b c d. (a + b) - (c + d) = (a - c) + (b - d)
23919 @@ -893,6 +881,9 @@
23920 \THEOREM REAL\_ADD\_ASSOC REAL
23921 |- !x y z. x + (y + z) = (x + y) + z
23922 \ENDTHEOREM
23923 +\THEOREM REAL\_ADD REAL
23924 +|- !m n. (& m) + (& n) = &(m num_add n)
23925 +\ENDTHEOREM
23926 \THEOREM REAL\_ADD\_LID REAL
23927 |- !x. (& 0) + x = x
23928 \ENDTHEOREM
23929 @@ -911,12 +902,12 @@
23930 \THEOREM REAL\_ADD\_RINV REAL
23931 |- !x. x + (-- x) = & 0
23932 \ENDTHEOREM
23933 -\THEOREM REAL\_ADD\_SUB REAL
23934 -|- !x y. (x + y) - x = y
23935 -\ENDTHEOREM
23936 \THEOREM REAL\_ADD\_SUB2 REAL
23937 |- !x y. x - (x + y) = -- y
23938 \ENDTHEOREM
23939 +\THEOREM REAL\_ADD\_SUB REAL
23940 +|- !x y. (x + y) - x = y
23941 +\ENDTHEOREM
23942 \THEOREM REAL\_ADD\_SYM REAL
23943 |- !x y. x + y = y + x
23944 \ENDTHEOREM
23945 @@ -949,15 +940,18 @@
23946 \THEOREM REAL\_DIV\_RMUL REAL
23947 |- !x y. ~(y = & 0) ==> ((x / y) * y = x)
23948 \ENDTHEOREM
23949 +\THEOREM REAL REAL
23950 +|- !n. &(SUC n) = (& n) + (& 1)
23951 +\ENDTHEOREM
23952 \THEOREM REAL\_DOUBLE REAL
23953 |- !x. x + x = (& 2) * x
23954 \ENDTHEOREM
23955 -\THEOREM REAL\_DOWN REAL
23956 -|- !x. (& 0) < x ==> (?y. (& 0) < y /\ y < x)
23957 -\ENDTHEOREM
23958 \THEOREM REAL\_DOWN2 REAL
23959 |- !x y. (& 0) < x /\ (& 0) < y ==> (?z. (& 0) < z /\ z < x /\ z < y)
23960 \ENDTHEOREM
23961 +\THEOREM REAL\_DOWN REAL
23962 +|- !x. (& 0) < x ==> (?y. (& 0) < y /\ y < x)
23963 +\ENDTHEOREM
23964 \THEOREM REAL\_ENTIRE REAL
23965 |- !x y. (x * y = & 0) = (x = & 0) \/ (y = & 0)
23966 \ENDTHEOREM
23967 @@ -967,12 +961,12 @@
23968 \THEOREM REAL\_EQ\_LADD REAL
23969 |- !x y z. (x + y = x + z) = (y = z)
23970 \ENDTHEOREM
23971 -\THEOREM REAL\_EQ\_LMUL REAL
23972 -|- !x y z. (x * y = x * z) = (x = & 0) \/ (y = z)
23973 -\ENDTHEOREM
23974 \THEOREM REAL\_EQ\_LMUL2 REAL
23975 |- !x y z. ~(x = & 0) ==> ((y = z) = (x * y = x * z))
23976 \ENDTHEOREM
23977 +\THEOREM REAL\_EQ\_LMUL REAL
23978 +|- !x y z. (x * y = x * z) = (x = & 0) \/ (y = z)
23979 +\ENDTHEOREM
23980 \THEOREM REAL\_EQ\_LMUL\_IMP REAL
23981 |- !x y z. ~(x = & 0) /\ (x * y = x * z) ==> (y = z)
23982 \ENDTHEOREM
23983 @@ -1012,12 +1006,12 @@
23984 \THEOREM REAL\_INV1 REAL
23985 |- inv(& 1) = & 1
23986 \ENDTHEOREM
23987 -\THEOREM REAL\_INVINV REAL
23988 -|- !x. ~(x = & 0) ==> (inv(inv x) = x)
23989 -\ENDTHEOREM
23990 \THEOREM REAL\_INV\_1OVER REAL
23991 |- !x. inv x = (& 1) / x
23992 \ENDTHEOREM
23993 +\THEOREM REAL\_INVINV REAL
23994 +|- !x. ~(x = & 0) ==> (inv(inv x) = x)
23995 +\ENDTHEOREM
23996 \THEOREM REAL\_INV\_LT1 REAL
23997 |- !x. (& 0) < x /\ x < (& 1) ==> (& 1) < (inv x)
23998 \ENDTHEOREM
23999 @@ -1033,39 +1027,18 @@
24000 \THEOREM REAL\_LDISTRIB REAL
24001 |- !x y z. x * (y + z) = (x * y) + (x * z)
24002 \ENDTHEOREM
24003 -\THEOREM REAL\_LE REAL
24004 -|- !m n. (& m) <= (& n) = m num_le n
24005 -\ENDTHEOREM
24006 -\THEOREM real\_le REAL
24007 -|- !x y. x <= y = ~y < x
24008 +\THEOREM REAL\_LE\_01 REAL
24009 +|- (& 0) <= (& 1)
24010 \ENDTHEOREM
24011 \THEOREM REAL\_LE1\_POW2 REAL
24012 |- !x. (& 1) <= x ==> (& 1) <= (x pow 2)
24013 \ENDTHEOREM
24014 -\THEOREM REAL\_LET\_ADD REAL
24015 -|- !x y. (& 0) <= x /\ (& 0) < y ==> (& 0) < (x + y)
24016 -\ENDTHEOREM
24017 -\THEOREM REAL\_LET\_ADD2 REAL
24018 -|- !w x y z. w <= x /\ y < z ==> (w + y) < (x + z)
24019 -\ENDTHEOREM
24020 -\THEOREM REAL\_LET\_ANTISYM REAL
24021 -|- !x y. ~(x < y /\ y <= x)
24022 -\ENDTHEOREM
24023 -\THEOREM REAL\_LET\_TOTAL REAL
24024 -|- !x y. x <= y \/ y < x
24025 -\ENDTHEOREM
24026 -\THEOREM REAL\_LET\_TRANS REAL
24027 -|- !x y z. x <= y /\ y < z ==> x < z
24028 -\ENDTHEOREM
24029 -\THEOREM REAL\_LE\_01 REAL
24030 -|- (& 0) <= (& 1)
24031 +\THEOREM REAL\_LE\_ADD2 REAL
24032 +|- !w x y z. w <= x /\ y <= z ==> (w + y) <= (x + z)
24033 \ENDTHEOREM
24034 \THEOREM REAL\_LE\_ADD REAL
24035 |- !x y. (& 0) <= x /\ (& 0) <= y ==> (& 0) <= (x + y)
24036 \ENDTHEOREM
24037 -\THEOREM REAL\_LE\_ADD2 REAL
24038 -|- !w x y z. w <= x /\ y <= z ==> (w + y) <= (x + z)
24039 -\ENDTHEOREM
24040 \THEOREM REAL\_LE\_ADDL REAL
24041 |- !x y. y <= (x + y) = (& 0) <= x
24042 \ENDTHEOREM
24043 @@ -1075,7 +1048,13 @@
24044 \THEOREM REAL\_LE\_ANTISYM REAL
24045 |- !x y. x <= y /\ y <= x = (x = y)
24046 \ENDTHEOREM
24047 -\THEOREM REAL\_LE\_DOUBLE REAL
24048 +\THEOREM real\_le REAL
24049 +|- !x y. x <= y = ~y < x
24050 +\ENDTHEOREM
24051 +\THEOREM REAL\_LE REAL
24052 +|- !m n. (& m) <= (& n) = m num_le n
24053 +\ENDTHEOREM
24054 +\THEOREM REAL\_LE\_DOUBLE REAL
24055 |- !x. (& 0) <= (x + x) = (& 0) <= x
24056 \ENDTHEOREM
24057 \THEOREM REAL\_LE\_LADD REAL
24058 @@ -1093,14 +1072,14 @@
24059 \THEOREM REAL\_LE\_LT REAL
24060 |- !x y. x <= y = x < y \/ (x = y)
24061 \ENDTHEOREM
24062 -\THEOREM REAL\_LE\_MUL REAL
24063 -|- !x y. (& 0) <= x /\ (& 0) <= y ==> (& 0) <= (x * y)
24064 -\ENDTHEOREM
24065 \THEOREM REAL\_LE\_MUL2 REAL
24066 |- !x1 x2 y1 y2.
24067 (& 0) <= x1 /\ (& 0) <= y1 /\ x1 <= x2 /\ y1 <= y2 ==>
24068 (x1 * y1) <= (x2 * y2)
24069 \ENDTHEOREM
24070 +\THEOREM REAL\_LE\_MUL REAL
24071 +|- !x y. (& 0) <= x /\ (& 0) <= y ==> (& 0) <= (x * y)
24072 +\ENDTHEOREM
24073 \THEOREM REAL\_LE\_NEG REAL
24074 |- !x y. (-- x) <= (-- y) = y <= x
24075 \ENDTHEOREM
24076 @@ -1140,47 +1119,41 @@
24077 \THEOREM REAL\_LE\_SUB\_RADD REAL
24078 |- !x y z. (x - y) <= z = x <= (z + y)
24079 \ENDTHEOREM
24080 +\THEOREM REAL\_LET\_ADD2 REAL
24081 +|- !w x y z. w <= x /\ y < z ==> (w + y) < (x + z)
24082 +\ENDTHEOREM
24083 +\THEOREM REAL\_LET\_ADD REAL
24084 +|- !x y. (& 0) <= x /\ (& 0) < y ==> (& 0) < (x + y)
24085 +\ENDTHEOREM
24086 +\THEOREM REAL\_LET\_ANTISYM REAL
24087 +|- !x y. ~(x < y /\ y <= x)
24088 +\ENDTHEOREM
24089 \THEOREM REAL\_LE\_TOTAL REAL
24090 |- !x y. x <= y \/ y <= x
24091 \ENDTHEOREM
24092 \THEOREM REAL\_LE\_TRANS REAL
24093 |- !x y z. x <= y /\ y <= z ==> x <= z
24094 \ENDTHEOREM
24095 +\THEOREM REAL\_LET\_TOTAL REAL
24096 +|- !x y. x <= y \/ y < x
24097 +\ENDTHEOREM
24098 +\THEOREM REAL\_LET\_TRANS REAL
24099 +|- !x y z. x <= y /\ y < z ==> x < z
24100 +\ENDTHEOREM
24101 \THEOREM REAL\_LINV\_UNIQ REAL
24102 |- !x y. (x * y = & 1) ==> (x = inv y)
24103 \ENDTHEOREM
24104 \THEOREM REAL\_LNEG\_UNIQ REAL
24105 |- !x y. (x + y = & 0) = (x = -- y)
24106 \ENDTHEOREM
24107 -\THEOREM REAL\_LT REAL
24108 -|- !m n. (& m) < (& n) = m num_lt n
24109 -\ENDTHEOREM
24110 -\THEOREM REAL\_LT1\_POW2 REAL
24111 -|- !x. (& 1) < x ==> (& 1) < (x pow 2)
24112 -\ENDTHEOREM
24113 -\THEOREM REAL\_LTE\_ADD REAL
24114 -|- !x y. (& 0) < x /\ (& 0) <= y ==> (& 0) < (x + y)
24115 -\ENDTHEOREM
24116 -\THEOREM REAL\_LTE\_ADD2 REAL
24117 -|- !w x y z. w < x /\ y <= z ==> (w + y) < (x + z)
24118 -\ENDTHEOREM
24119 -\THEOREM REAL\_LTE\_ANTSYM REAL
24120 -|- !x y. ~(x <= y /\ y < x)
24121 -\ENDTHEOREM
24122 -\THEOREM REAL\_LTE\_TOTAL REAL
24123 -|- !x y. x < y \/ y <= x
24124 -\ENDTHEOREM
24125 -\THEOREM REAL\_LTE\_TRANS REAL
24126 -|- !x y z. x < y /\ y <= z ==> x < z
24127 -\ENDTHEOREM
24128 \THEOREM REAL\_LT\_01 REAL
24129 |- (& 0) < (& 1)
24130 \ENDTHEOREM
24131 \THEOREM REAL\_LT\_1 REAL
24132 |- !x y. (& 0) <= x /\ x < y ==> (x / y) < (& 1)
24133 \ENDTHEOREM
24134 -\THEOREM REAL\_LT\_ADD REAL
24135 -|- !x y. (& 0) < x /\ (& 0) < y ==> (& 0) < (x + y)
24136 +\THEOREM REAL\_LT1\_POW2 REAL
24137 +|- !x. (& 1) < x ==> (& 1) < (x pow 2)
24138 \ENDTHEOREM
24139 \THEOREM REAL\_LT\_ADD1 REAL
24140 |- !x y. x <= y ==> x < (y + (& 1))
24141 @@ -1188,15 +1161,18 @@
24142 \THEOREM REAL\_LT\_ADD2 REAL
24143 |- !w x y z. w < x /\ y < z ==> (w + y) < (x + z)
24144 \ENDTHEOREM
24145 +\THEOREM REAL\_LT\_ADD REAL
24146 +|- !x y. (& 0) < x /\ (& 0) < y ==> (& 0) < (x + y)
24147 +\ENDTHEOREM
24148 \THEOREM REAL\_LT\_ADDL REAL
24149 |- !x y. y < (x + y) = (& 0) < x
24150 \ENDTHEOREM
24151 -\THEOREM REAL\_LT\_ADDNEG REAL
24152 -|- !x y z. y < (x + (-- z)) = (y + z) < x
24153 -\ENDTHEOREM
24154 \THEOREM REAL\_LT\_ADDNEG2 REAL
24155 |- !x y z. (x + (-- y)) < z = x < (z + y)
24156 \ENDTHEOREM
24157 +\THEOREM REAL\_LT\_ADDNEG REAL
24158 +|- !x y z. y < (x + (-- z)) = (y + z) < x
24159 +\ENDTHEOREM
24160 \THEOREM REAL\_LT\_ADDR REAL
24161 |- !x y. x < (x + y) = (& 0) < y
24162 \ENDTHEOREM
24163 @@ -1206,12 +1182,30 @@
24164 \THEOREM REAL\_LT\_ANTISYM REAL
24165 |- !x y. ~(x < y /\ y < x)
24166 \ENDTHEOREM
24167 -\THEOREM REAL\_LT\_FRACTION REAL
24168 -|- !n d. 1 num_lt n ==> ((d / (& n)) < d = (& 0) < d)
24169 +\THEOREM REAL\_LT REAL
24170 +|- !m n. (& m) < (& n) = m num_lt n
24171 +\ENDTHEOREM
24172 +\THEOREM REAL\_LTE\_ADD2 REAL
24173 +|- !w x y z. w < x /\ y <= z ==> (w + y) < (x + z)
24174 +\ENDTHEOREM
24175 +\THEOREM REAL\_LTE\_ADD REAL
24176 +|- !x y. (& 0) < x /\ (& 0) <= y ==> (& 0) < (x + y)
24177 +\ENDTHEOREM
24178 +\THEOREM REAL\_LTE\_ANTSYM REAL
24179 +|- !x y. ~(x <= y /\ y < x)
24180 +\ENDTHEOREM
24181 +\THEOREM REAL\_LTE\_TOTAL REAL
24182 +|- !x y. x < y \/ y <= x
24183 +\ENDTHEOREM
24184 +\THEOREM REAL\_LTE\_TRANS REAL
24185 +|- !x y z. x < y /\ y <= z ==> x < z
24186 \ENDTHEOREM
24187 \THEOREM REAL\_LT\_FRACTION\_0 REAL
24188 |- !n d. ~(n = 0) ==> ((& 0) < (d / (& n)) = (& 0) < d)
24189 \ENDTHEOREM
24190 +\THEOREM REAL\_LT\_FRACTION REAL
24191 +|- !n d. 1 num_lt n ==> ((d / (& n)) < d = (& 0) < d)
24192 +\ENDTHEOREM
24193 \THEOREM REAL\_LT\_GT REAL
24194 |- !x y. x < y ==> ~y < x
24195 \ENDTHEOREM
24196 @@ -1239,23 +1233,23 @@
24197 \THEOREM REAL\_LT\_LE REAL
24198 |- !x y. x < y = x <= y /\ ~(x = y)
24199 \ENDTHEOREM
24200 -\THEOREM REAL\_LT\_LMUL REAL
24201 -|- !x y z. (& 0) < x ==> ((x * y) < (x * z) = y < z)
24202 -\ENDTHEOREM
24203 \THEOREM REAL\_LT\_LMUL\_0 REAL
24204 |- !x y. (& 0) < x ==> ((& 0) < (x * y) = (& 0) < y)
24205 \ENDTHEOREM
24206 +\THEOREM REAL\_LT\_LMUL REAL
24207 +|- !x y z. (& 0) < x ==> ((x * y) < (x * z) = y < z)
24208 +\ENDTHEOREM
24209 \THEOREM REAL\_LT\_LMUL\_IMP REAL
24210 |- !x y z. y < z /\ (& 0) < x ==> (x * y) < (x * z)
24211 \ENDTHEOREM
24212 -\THEOREM REAL\_LT\_MUL REAL
24213 -|- !x y. (& 0) < x /\ (& 0) < y ==> (& 0) < (x * y)
24214 -\ENDTHEOREM
24215 \THEOREM REAL\_LT\_MUL2 REAL
24216 |- !x1 x2 y1 y2.
24217 (& 0) <= x1 /\ (& 0) <= y1 /\ x1 < x2 /\ y1 < y2 ==>
24218 (x1 * y1) < (x2 * y2)
24219 \ENDTHEOREM
24220 +\THEOREM REAL\_LT\_MUL REAL
24221 +|- !x y. (& 0) < x /\ (& 0) < y ==> (& 0) < (x * y)
24222 +\ENDTHEOREM
24223 \THEOREM REAL\_LT\_MULTIPLE REAL
24224 |- !n d. 1 num_lt n ==> (d < ((& n) * d) = (& 0) < d)
24225 \ENDTHEOREM
24226 @@ -1271,21 +1265,21 @@
24227 \THEOREM REAL\_LT\_RADD REAL
24228 |- !x y z. (x + z) < (y + z) = x < y
24229 \ENDTHEOREM
24230 -\THEOREM REAL\_LT\_RDIV REAL
24231 -|- !x y z. (& 0) < z ==> ((x / z) < (y / z) = x < y)
24232 -\ENDTHEOREM
24233 \THEOREM REAL\_LT\_RDIV\_0 REAL
24234 |- !y z. (& 0) < z ==> ((& 0) < (y / z) = (& 0) < y)
24235 \ENDTHEOREM
24236 +\THEOREM REAL\_LT\_RDIV REAL
24237 +|- !x y z. (& 0) < z ==> ((x / z) < (y / z) = x < y)
24238 +\ENDTHEOREM
24239 \THEOREM REAL\_LT\_REFL REAL
24240 |- !x. ~x < x
24241 \ENDTHEOREM
24242 -\THEOREM REAL\_LT\_RMUL REAL
24243 -|- !x y z. (& 0) < z ==> ((x * z) < (y * z) = x < y)
24244 -\ENDTHEOREM
24245 \THEOREM REAL\_LT\_RMUL\_0 REAL
24246 |- !x y. (& 0) < y ==> ((& 0) < (x * y) = (& 0) < x)
24247 \ENDTHEOREM
24248 +\THEOREM REAL\_LT\_RMUL REAL
24249 +|- !x y z. (& 0) < z ==> ((x * z) < (y * z) = x < y)
24250 +\ENDTHEOREM
24251 \THEOREM REAL\_LT\_RMUL\_IMP REAL
24252 |- !x y z. x < y /\ (& 0) < z ==> (x * z) < (y * z)
24253 \ENDTHEOREM
24254 @@ -1304,12 +1298,12 @@
24255 \THEOREM REAL\_MEAN REAL
24256 |- !x y. x < y ==> (?z. x < z /\ z < y)
24257 \ENDTHEOREM
24258 -\THEOREM REAL\_MUL REAL
24259 -|- !m n. (& m) * (& n) = &(m num_mul n)
24260 -\ENDTHEOREM
24261 \THEOREM REAL\_MUL\_ASSOC REAL
24262 |- !x y z. x * (y * z) = (x * y) * z
24263 \ENDTHEOREM
24264 +\THEOREM REAL\_MUL REAL
24265 +|- !m n. (& m) * (& n) = &(m num_mul n)
24266 +\ENDTHEOREM
24267 \THEOREM REAL\_MUL\_LID REAL
24268 |- !x. (& 1) * x = x
24269 \ENDTHEOREM
24270 @@ -1331,21 +1325,18 @@
24271 \THEOREM REAL\_MUL\_SYM REAL
24272 |- !x y. x * y = y * x
24273 \ENDTHEOREM
24274 -\THEOREM REAL\_NEGNEG REAL
24275 -|- !x. --(-- x) = x
24276 -\ENDTHEOREM
24277 \THEOREM REAL\_NEG\_0 REAL
24278 |- --(& 0) = & 0
24279 \ENDTHEOREM
24280 \THEOREM REAL\_NEG\_ADD REAL
24281 |- !x y. --(x + y) = (-- x) + (-- y)
24282 \ENDTHEOREM
24283 -\THEOREM REAL\_NEG\_EQ REAL
24284 -|- !x y. (-- x = y) = (x = -- y)
24285 -\ENDTHEOREM
24286 \THEOREM REAL\_NEG\_EQ0 REAL
24287 |- !x. (-- x = & 0) = (x = & 0)
24288 \ENDTHEOREM
24289 +\THEOREM REAL\_NEG\_EQ REAL
24290 +|- !x y. (-- x = y) = (x = -- y)
24291 +\ENDTHEOREM
24292 \THEOREM REAL\_NEG\_GE0 REAL
24293 |- !x. (& 0) <= (-- x) = x <= (& 0)
24294 \ENDTHEOREM
24295 @@ -1370,6 +1361,9 @@
24296 \THEOREM REAL\_NEG\_MUL2 REAL
24297 |- !x y. (-- x) * (-- y) = x * y
24298 \ENDTHEOREM
24299 +\THEOREM REAL\_NEGNEG REAL
24300 +|- !x. --(-- x) = x
24301 +\ENDTHEOREM
24302 \THEOREM REAL\_NEG\_RMUL REAL
24303 |- !x y. --(x * y) = x * (-- y)
24304 \ENDTHEOREM
24305 @@ -1412,20 +1406,20 @@
24306 \THEOREM REAL\_RNEG\_UNIQ REAL
24307 |- !x y. (x + y = & 0) = (y = -- x)
24308 \ENDTHEOREM
24309 -\THEOREM real\_sub REAL
24310 -|- !x y. x - y = x + (-- y)
24311 -\ENDTHEOREM
24312 \THEOREM REAL\_SUB\_0 REAL
24313 |- !x y. (x - y = & 0) = (x = y)
24314 \ENDTHEOREM
24315 \THEOREM REAL\_SUB\_ABS REAL
24316 |- !x y. ((abs x) - (abs y)) <= (abs(x - y))
24317 \ENDTHEOREM
24318 +\THEOREM REAL\_SUB\_ADD2 REAL
24319 +|- !x y. y + (x - y) = x
24320 +\ENDTHEOREM
24321 \THEOREM REAL\_SUB\_ADD REAL
24322 |- !x y. (x - y) + y = x
24323 \ENDTHEOREM
24324 -\THEOREM REAL\_SUB\_ADD2 REAL
24325 -|- !x y. y + (x - y) = x
24326 +\THEOREM real\_sub REAL
24327 +|- !x y. x - y = x + (-- y)
24328 \ENDTHEOREM
24329 \THEOREM REAL\_SUB\_INV2 REAL
24330 |- !x y.
24331 @@ -1461,28 +1455,28 @@
24332 \THEOREM REAL\_SUB\_RZERO REAL
24333 |- !x. x - (& 0) = x
24334 \ENDTHEOREM
24335 -\THEOREM REAL\_SUB\_SUB REAL
24336 -|- !x y. (x - y) - x = -- y
24337 -\ENDTHEOREM
24338 \THEOREM REAL\_SUB\_SUB2 REAL
24339 |- !x y. x - (x - y) = y
24340 \ENDTHEOREM
24341 +\THEOREM REAL\_SUB\_SUB REAL
24342 +|- !x y. (x - y) - x = -- y
24343 +\ENDTHEOREM
24344 \THEOREM REAL\_SUB\_TRIANGLE REAL
24345 |- !a b c. (a - b) + (b - c) = a - c
24346 \ENDTHEOREM
24347 \THEOREM REAL\_SUMSQ REAL
24348 |- !x y. ((x * x) + (y * y) = & 0) = (x = & 0) /\ (y = & 0)
24349 \ENDTHEOREM
24350 -\THEOREM REAL\_SUP REAL
24351 -|- !P.
24352 - (?x. P x) /\ (?z. !x. P x ==> x < z) ==>
24353 - (!y. (?x. P x /\ y < x) = y < (sup P))
24354 -\ENDTHEOREM
24355 \THEOREM REAL\_SUP\_ALLPOS REAL
24356 |- !P.
24357 (!x. P x ==> (& 0) < x) /\ (?x. P x) /\ (?z. !x. P x ==> x < z) ==>
24358 (?s. !y. (?x. P x /\ y < x) = y < s)
24359 \ENDTHEOREM
24360 +\THEOREM REAL\_SUP REAL
24361 +|- !P.
24362 + (?x. P x) /\ (?z. !x. P x ==> x < z) ==>
24363 + (!y. (?x. P x /\ y < x) = y < (sup P))
24364 +\ENDTHEOREM
24365 \THEOREM REAL\_SUP\_EXISTS REAL
24366 |- !P.
24367 (?x. P x) /\ (?z. !x. P x ==> x < z) ==>
24368 @@ -1511,13 +1505,6 @@
24369 (?x. P x) /\ (?z. !x. P x ==> x <= z) =
24370 (?x. P x) /\ (?z. !x. P x ==> x < z)
24371 \ENDTHEOREM
24372 -\THEOREM Sum REAL
24373 -|- (Sum(n,0)f = & 0) /\ (Sum(n,SUC m)f = (Sum(n,m)f) + (f(n num_add m)))
24374 -\ENDTHEOREM
24375 -\THEOREM sum REAL
24376 -|- (!n f. sum n 0 f = & 0) /\
24377 - (!n m f. sum n(SUC m)f = (sum n m f) + (f(n num_add m)))
24378 -\ENDTHEOREM
24379 \THEOREM SUM\_0 REAL
24380 |- !m n. Sum(m,n)(\r. & 0) = & 0
24381 \ENDTHEOREM
24382 @@ -1550,6 +1537,13 @@
24383 \THEOREM SUM\_DIFF REAL
24384 |- !f m n. Sum(m,n)f = (Sum(0,m num_add n)f) - (Sum(0,m)f)
24385 \ENDTHEOREM
24386 +\THEOREM sum REAL
24387 +|- (!n f. sum n 0 f = & 0) /\
24388 + (!n m f. sum n(SUC m)f = (sum n m f) + (f(n num_add m)))
24389 +\ENDTHEOREM
24390 +\THEOREM Sum REAL
24391 +|- (Sum(n,0)f = & 0) /\ (Sum(n,SUC m)f = (Sum(n,m)f) + (f(n num_add m)))
24392 +\ENDTHEOREM
24393 \THEOREM SUM\_EQ REAL
24394 |- !N. (!n. N num_le n ==> (f n = g n)) ==> (!n. Sum(N,n)f = Sum(N,n)g)
24395 \ENDTHEOREM
24396 @@ -1615,8 +1609,7 @@
24397 \THEOREM SUP\_LEMMA3 REAL
24398 |- !d. (?z. !x. P x ==> x < z) ==> (?z. !x. (\x. P(x + d))x ==> x < z)
24399 \ENDTHEOREM
24400 -\section{TOPOLOGY}
24401 -\THEOREM ball TOPOLOGY
24402 +\section{TOPOLOGY}\THEOREM ball TOPOLOGY
24403 |- !m x e. B m(x,e) = (\y. (dist m(x,y)) < e)
24404 \ENDTHEOREM
24405 \THEOREM BALL\_NEIGH TOPOLOGY
24406 @@ -1689,9 +1682,6 @@
24407 \THEOREM METRIC\_ZERO TOPOLOGY
24408 |- !m x y. (dist m(x,y) = & 0) = (x = y)
24409 \ENDTHEOREM
24410 -\THEOREM mr1 TOPOLOGY
24411 -|- mr1 = metric(\(x,y). abs(y - x))
24412 -\ENDTHEOREM
24413 \THEOREM MR1\_ADD TOPOLOGY
24414 |- !x d. dist mr1(x,x + d) = abs d
24415 \ENDTHEOREM
24416 @@ -1707,6 +1697,9 @@
24417 \THEOREM MR1\_DEF TOPOLOGY
24418 |- !x y. dist mr1(x,y) = abs(y - x)
24419 \ENDTHEOREM
24420 +\THEOREM mr1 TOPOLOGY
24421 +|- mr1 = metric(\(x,y). abs(y - x))
24422 +\ENDTHEOREM
24423 \THEOREM MR1\_LIMPT TOPOLOGY
24424 |- !x. limpt(mtop mr1)x universe
24425 \ENDTHEOREM
24426 @@ -1759,12 +1752,12 @@
24427 \THEOREM OPEN\_UNOPEN TOPOLOGY
24428 |- !S top. open top S = (Union(\P. open top P /\ P subset S) = S)
24429 \ENDTHEOREM
24430 -\THEOREM subset TOPOLOGY
24431 -|- !P Q. P subset Q = (!x. P x ==> Q x)
24432 -\ENDTHEOREM
24433 \THEOREM SUBSET\_ANTISYM TOPOLOGY
24434 |- !P Q. P subset Q /\ Q subset P = (P = Q)
24435 \ENDTHEOREM
24436 +\THEOREM subset TOPOLOGY
24437 +|- !P Q. P subset Q = (!x. P x ==> Q x)
24438 +\ENDTHEOREM
24439 \THEOREM SUBSET\_REFL TOPOLOGY
24440 |- !S. S subset S
24441 \ENDTHEOREM
24442 @@ -1788,17 +1781,16 @@
24443 \THEOREM TOPOLOGY\_UNION TOPOLOGY
24444 |- !L P. P subset (open L) ==> open L(Union P)
24445 \ENDTHEOREM
24446 -\THEOREM Union TOPOLOGY
24447 -|- !S. Union S = (\x. ?s. S s /\ s x)
24448 -\ENDTHEOREM
24449 \THEOREM union\_def TOPOLOGY
24450 |- !P Q. P union Q = (\x. P x \/ Q x)
24451 \ENDTHEOREM
24452 +\THEOREM Union TOPOLOGY
24453 +|- !S. Union S = (\x. ?s. S s /\ s x)
24454 +\ENDTHEOREM
24455 \THEOREM universe TOPOLOGY
24456 |- universe = (\x. T)
24457 \ENDTHEOREM
24458 -\section{NETS}
24459 -\THEOREM bounded NETS
24460 +\section{NETS}\THEOREM bounded NETS
24461 |- !m g f.
24462 bounded(m,g)f =
24463 (?k x N. g N N /\ (!n. g n N ==> (dist m(f n,x)) real_lt k))
24464 @@ -1823,7 +1815,7 @@
24465 \THEOREM DORDER\_TENDSTO NETS
24466 |- !m x. dorder(tendsto(m,x))
24467 \ENDTHEOREM
24468 -\THEOREM LIM\_TENDS NETS
24469 +\THEOREM LIM\_TENDS2 NETS
24470 |- !m1 m2 f x0 y0.
24471 limpt(mtop m1)x0 universe ==>
24472 ((f tends y0)(mtop m2,tendsto(m1,x0)) =
24473 @@ -1833,10 +1825,10 @@
24474 (real_of_num 0) real_lt d /\
24475 (!x.
24476 (real_of_num 0) real_lt (dist m1(x,x0)) /\
24477 - (dist m1(x,x0)) real_le d ==>
24478 + (dist m1(x,x0)) real_lt d ==>
24479 (dist m2(f x,y0)) real_lt e))))
24480 \ENDTHEOREM
24481 -\THEOREM LIM\_TENDS2 NETS
24482 +\THEOREM LIM\_TENDS NETS
24483 |- !m1 m2 f x0 y0.
24484 limpt(mtop m1)x0 universe ==>
24485 ((f tends y0)(mtop m2,tendsto(m1,x0)) =
24486 @@ -1846,7 +1838,7 @@
24487 (real_of_num 0) real_lt d /\
24488 (!x.
24489 (real_of_num 0) real_lt (dist m1(x,x0)) /\
24490 - (dist m1(x,x0)) real_lt d ==>
24491 + (dist m1(x,x0)) real_le d ==>
24492 (dist m2(f x,y0)) real_lt e))))
24493 \ENDTHEOREM
24494 \THEOREM MR1\_BOUNDED NETS
24495 @@ -1931,11 +1923,6 @@
24496 (x tends x0)(mtop mr1,g) =
24497 ((\n. real_neg(x n)) tends (real_neg x0))(mtop mr1,g))
24498 \ENDTHEOREM
24499 -\THEOREM NET\_NULL NETS
24500 -|- !g x x0.
24501 - (x tends x0)(mtop mr1,g) =
24502 - ((\n. (x n) real_sub x0) tends (real_of_num 0))(mtop mr1,g)
24503 -\ENDTHEOREM
24504 \THEOREM NET\_NULL\_ADD NETS
24505 |- !g.
24506 dorder g ==>
24507 @@ -1949,6 +1936,11 @@
24508 (x tends (real_of_num 0))(mtop mr1,g) ==>
24509 ((\n. k real_mul (x n)) tends (real_of_num 0))(mtop mr1,g)
24510 \ENDTHEOREM
24511 +\THEOREM NET\_NULL NETS
24512 +|- !g x x0.
24513 + (x tends x0)(mtop mr1,g) =
24514 + ((\n. (x n) real_sub x0) tends (real_of_num 0))(mtop mr1,g)
24515 +\ENDTHEOREM
24516 \THEOREM NET\_NULL\_MUL NETS
24517 |- !g.
24518 dorder g ==>
24519 @@ -1981,8 +1973,7 @@
24520 (real_of_num 0) real_lt (dist m(x,y)) /\
24521 (dist m(x,y)) real_le (dist m(x,z))
24522 \ENDTHEOREM
24523 -\section{LIM}
24524 -\THEOREM CHAIN\_LEMMA1 LIM
24525 +\section{LIM}\THEOREM CHAIN\_LEMMA1 LIM
24526 |- !f g x h.
24527 ((f(g(x + h))) - (f(g x))) / h =
24528 (((f(g(x + h))) - (f(g x))) / ((g(x + h)) - (g x))) *
24529 @@ -1991,27 +1982,21 @@
24530 \THEOREM CHAIN\_LEMMA2 LIM
24531 |- !x y d. (abs(x - y)) < d ==> (abs x) < ((abs y) + d)
24532 \ENDTHEOREM
24533 -\THEOREM contl LIM
24534 -|- !f x. f contl x = ((\h. f(x + h)) --> (f x))(& 0)
24535 -\ENDTHEOREM
24536 -\THEOREM CONTL\_LIM LIM
24537 -|- !f x. f contl x = (f --> (f x))x
24538 -\ENDTHEOREM
24539 \THEOREM CONT\_ADD LIM
24540 |- !x. f contl x /\ g contl x ==> (\x. (f x) + (g x)) contl x
24541 \ENDTHEOREM
24542 -\THEOREM CONT\_ATTAINS LIM
24543 +\THEOREM CONT\_ATTAINS2 LIM
24544 |- !f a b.
24545 a <= b /\ (!x. a <= x /\ x <= b ==> f contl x) ==>
24546 (?M.
24547 - (!x. a <= x /\ x <= b ==> (f x) <= M) /\
24548 + (!x. a <= x /\ x <= b ==> M <= (f x)) /\
24549 (?x. a <= x /\ x <= b /\ (f x = M)))
24550 \ENDTHEOREM
24551 -\THEOREM CONT\_ATTAINS2 LIM
24552 +\THEOREM CONT\_ATTAINS LIM
24553 |- !f a b.
24554 a <= b /\ (!x. a <= x /\ x <= b ==> f contl x) ==>
24555 (?M.
24556 - (!x. a <= x /\ x <= b ==> M <= (f x)) /\
24557 + (!x. a <= x /\ x <= b ==> (f x) <= M) /\
24558 (?x. a <= x /\ x <= b /\ (f x = M)))
24559 \ENDTHEOREM
24560 \THEOREM CONT\_BOUNDED LIM
24561 @@ -2037,6 +2022,12 @@
24562 \THEOREM CONT\_INV LIM
24563 |- !x. f contl x /\ ~(f x = & 0) ==> (\x. inv(f x)) contl x
24564 \ENDTHEOREM
24565 +\THEOREM contl LIM
24566 +|- !f x. f contl x = ((\h. f(x + h)) --> (f x))(& 0)
24567 +\ENDTHEOREM
24568 +\THEOREM CONTL\_LIM LIM
24569 +|- !f x. f contl x = (f --> (f x))x
24570 +\ENDTHEOREM
24571 \THEOREM CONT\_MUL LIM
24572 |- !x. f contl x /\ g contl x ==> (\x. (f x) * (g x)) contl x
24573 \ENDTHEOREM
24574 @@ -2046,12 +2037,6 @@
24575 \THEOREM CONT\_SUB LIM
24576 |- !x. f contl x /\ g contl x ==> (\x. (f x) - (g x)) contl x
24577 \ENDTHEOREM
24578 -\THEOREM differentiable LIM
24579 -|- !f x. f differentiable x = (?l. (f diffl l)x)
24580 -\ENDTHEOREM
24581 -\THEOREM diffl LIM
24582 -|- !f l x. (f diffl l)x = ((\h. ((f(x + h)) - (f x)) / h) --> l)(& 0)
24583 -\ENDTHEOREM
24584 \THEOREM DIFF\_ADD LIM
24585 |- !f g l m x.
24586 (f diffl l)x /\ (g diffl m)x ==>
24587 @@ -2077,11 +2062,17 @@
24588 (((l * (g x)) - (m * (f x))) / ((g x) pow 2)))
24589 x
24590 \ENDTHEOREM
24591 +\THEOREM differentiable LIM
24592 +|- !f x. f differentiable x = (?l. (f diffl l)x)
24593 +\ENDTHEOREM
24594 \THEOREM DIFF\_INV LIM
24595 |- !f l x.
24596 (f diffl l)x /\ ~(f x = & 0) ==>
24597 ((\x. inv(f x)) diffl (--(l / ((f x) pow 2))))x
24598 \ENDTHEOREM
24599 +\THEOREM DIFF\_ISCONST\_ALL LIM
24600 +|- !f. (!x. (f diffl (& 0))x) ==> (!x y. f x = f y)
24601 +\ENDTHEOREM
24602 \THEOREM DIFF\_ISCONST LIM
24603 |- !f a b.
24604 a < b /\
24605 @@ -2089,9 +2080,6 @@
24606 (!x. a < x /\ x < b ==> (f diffl (& 0))x) ==>
24607 (!x. a <= x /\ x <= b ==> (f x = f a))
24608 \ENDTHEOREM
24609 -\THEOREM DIFF\_ISCONST\_ALL LIM
24610 -|- !f. (!x. (f diffl (& 0))x) ==> (!x y. f x = f y)
24611 -\ENDTHEOREM
24612 \THEOREM DIFF\_ISCONST\_END LIM
24613 |- !f a b.
24614 a < b /\
24615 @@ -2110,6 +2098,9 @@
24616 (f diffl l)x /\ l < (& 0) ==>
24617 (?d. (& 0) < d /\ (!h. (& 0) < h /\ h < d ==> (f x) < (f(x - h))))
24618 \ENDTHEOREM
24619 +\THEOREM diffl LIM
24620 +|- !f l x. (f diffl l)x = ((\h. ((f(x + h)) - (f x)) / h) --> l)(& 0)
24621 +\ENDTHEOREM
24622 \THEOREM DIFF\_LINC LIM
24623 |- !f x l.
24624 (f diffl l)x /\ (& 0) < l ==>
24625 @@ -2164,27 +2155,20 @@
24626 a < x /\ x < b ==>
24627 (?d. (& 0) < d /\ (!y. (abs(x - y)) < d ==> a <= y /\ y <= b))
24628 \ENDTHEOREM
24629 -\THEOREM IVT LIM
24630 +\THEOREM IVT2 LIM
24631 |- !f a b y.
24632 a <= b /\
24633 - ((f a) <= y /\ y <= (f b)) /\
24634 + ((f b) <= y /\ y <= (f a)) /\
24635 (!x. a <= x /\ x <= b ==> f contl x) ==>
24636 (?x. a <= x /\ x <= b /\ (f x = y))
24637 \ENDTHEOREM
24638 -\THEOREM IVT2 LIM
24639 +\THEOREM IVT LIM
24640 |- !f a b y.
24641 a <= b /\
24642 - ((f b) <= y /\ y <= (f a)) /\
24643 + ((f a) <= y /\ y <= (f b)) /\
24644 (!x. a <= x /\ x <= b ==> f contl x) ==>
24645 (?x. a <= x /\ x <= b /\ (f x = y))
24646 \ENDTHEOREM
24647 -\THEOREM IVT\_SUPLEMMA LIM
24648 -|- a <= b /\
24649 - ((f a) <= y /\ y <= (f b)) /\
24650 - (!x. a <= x /\ x <= b ==> f contl x) ==>
24651 - (?x. (\x. a <= x /\ x <= b /\ (f x) <= y)x) /\
24652 - (?z. !x. (\x. a <= x /\ x <= b /\ (f x) <= y)x ==> x <= z)
24653 -\ENDTHEOREM
24654 \THEOREM IVT\_SUPLEMMA2 LIM
24655 |- a <= b /\
24656 ((f a) <= y /\ y <= (f b)) /\
24657 @@ -2192,16 +2176,12 @@
24658 a <= (sup(\x. a <= x /\ x <= b /\ (f x) <= y)) /\
24659 (sup(\x. a <= x /\ x <= b /\ (f x) <= y)) <= b
24660 \ENDTHEOREM
24661 -\THEOREM LIM LIM
24662 -|- !f y0 x0.
24663 - (f --> y0)x0 =
24664 - (!e.
24665 - (& 0) < e ==>
24666 - (?d.
24667 - (& 0) < d /\
24668 - (!x.
24669 - (& 0) < (abs(x - x0)) /\ (abs(x - x0)) < d ==>
24670 - (abs((f x) - y0)) < e)))
24671 +\THEOREM IVT\_SUPLEMMA LIM
24672 +|- a <= b /\
24673 + ((f a) <= y /\ y <= (f b)) /\
24674 + (!x. a <= x /\ x <= b ==> f contl x) ==>
24675 + (?x. (\x. a <= x /\ x <= b /\ (f x) <= y)x) /\
24676 + (?z. !x. (\x. a <= x /\ x <= b /\ (f x) <= y)x ==> x <= z)
24677 \ENDTHEOREM
24678 \THEOREM LIM\_ADD LIM
24679 |- !f g l m.
24680 @@ -2221,6 +2201,17 @@
24681 (f --> l)x /\ (g --> m)x /\ ~(m = & 0) ==>
24682 ((\x. (f x) / (g x)) --> (l / m))x
24683 \ENDTHEOREM
24684 +\THEOREM LIM LIM
24685 +|- !f y0 x0.
24686 + (f --> y0)x0 =
24687 + (!e.
24688 + (& 0) < e ==>
24689 + (?d.
24690 + (& 0) < d /\
24691 + (!x.
24692 + (& 0) < (abs(x - x0)) /\ (abs(x - x0)) < d ==>
24693 + (abs((f x) - y0)) < e)))
24694 +\ENDTHEOREM
24695 \THEOREM LIM\_EQUAL LIM
24696 |- !f g l x0.
24697 (!x. ~(x = x0) ==> (f x = g x)) ==> ((f --> l)x0 = (g --> l)x0)
24698 @@ -2289,8 +2280,7 @@
24699 \THEOREM tends\_real\_real LIM
24700 |- !f l x0. (f --> l)x0 = (f tends l)(mtop mr1,tendsto(mr1,x0))
24701 \ENDTHEOREM
24702 -\section{SEQ}
24703 -\THEOREM ABS\_NEG\_LEMMA SEQ
24704 +\section{SEQ}\THEOREM ABS\_NEG\_LEMMA SEQ
24705 |- !c. c <= (& 0) ==> (!x y. (abs x) <= (c * (abs y)) ==> (x = & 0))
24706 \ENDTHEOREM
24707 \THEOREM cauchy SEQ
24708 @@ -2326,11 +2316,6 @@
24709 \THEOREM MONO\_SUC SEQ
24710 |- !f. mono f = (!n. (f(SUC n)) >= (f n)) \/ (!n. (f(SUC n)) <= (f n))
24711 \ENDTHEOREM
24712 -\THEOREM SEQ SEQ
24713 -|- !x x0.
24714 - x --> x0 =
24715 - (!e. (& 0) < e ==> (?N. !n. n num_ge N ==> (abs((x n) - x0)) < e))
24716 -\ENDTHEOREM
24717 \THEOREM SEQ\_ABS SEQ
24718 |- !f. (\n. abs(f n)) --> (& 0) = f --> (& 0)
24719 \ENDTHEOREM
24720 @@ -2364,18 +2349,23 @@
24721 x --> x0 /\ y --> y0 /\ ~(y0 = & 0) ==>
24722 (\n. (x n) / (y n)) --> (x0 / y0)
24723 \ENDTHEOREM
24724 +\THEOREM SEQ SEQ
24725 +|- !x x0.
24726 + x --> x0 =
24727 + (!e. (& 0) < e ==> (?N. !n. n num_ge N ==> (abs((x n) - x0)) < e))
24728 +\ENDTHEOREM
24729 \THEOREM SEQ\_ICONV SEQ
24730 |- !f.
24731 bounded(mr1,$num_ge)f /\ (!m n. m num_ge n ==> (f m) >= (f n)) ==>
24732 convergent f
24733 \ENDTHEOREM
24734 -\THEOREM SEQ\_INV SEQ
24735 -|- !x x0. x --> x0 /\ ~(x0 = & 0) ==> (\n. inv(x n)) --> (inv x0)
24736 -\ENDTHEOREM
24737 \THEOREM SEQ\_INV0 SEQ
24738 |- !f.
24739 (!y. ?N. !n. n num_ge N ==> (f n) > y) ==> (\n. inv(f n)) --> (& 0)
24740 \ENDTHEOREM
24741 +\THEOREM SEQ\_INV SEQ
24742 +|- !x x0. x --> x0 /\ ~(x0 = & 0) ==> (\n. inv(x n)) --> (inv x0)
24743 +\ENDTHEOREM
24744 \THEOREM SEQ\_LE SEQ
24745 |- !f g l m.
24746 f --> l /\ g --> m /\ (?N. !n. n num_ge N ==> (f n) <= (g n)) ==>
24747 @@ -2391,21 +2381,21 @@
24748 |- !x x0 y y0.
24749 x --> x0 /\ y --> y0 ==> (\n. (x n) * (y n)) --> (x0 * y0)
24750 \ENDTHEOREM
24751 -\THEOREM SEQ\_NEG SEQ
24752 -|- !x x0. x --> x0 = (\n. --(x n)) --> (-- x0)
24753 -\ENDTHEOREM
24754 \THEOREM SEQ\_NEG\_BOUNDED SEQ
24755 |- !f. bounded(mr1,$num_ge)(\n. --(f n)) = bounded(mr1,$num_ge)f
24756 \ENDTHEOREM
24757 \THEOREM SEQ\_NEG\_CONV SEQ
24758 |- !f. convergent f = convergent(\n. --(f n))
24759 \ENDTHEOREM
24760 -\THEOREM SEQ\_POWER SEQ
24761 -|- !c. (abs c) < (& 1) ==> (\n. c pow n) --> (& 0)
24762 +\THEOREM SEQ\_NEG SEQ
24763 +|- !x x0. x --> x0 = (\n. --(x n)) --> (-- x0)
24764 \ENDTHEOREM
24765 \THEOREM SEQ\_POWER\_ABS SEQ
24766 |- !c. (abs c) < (& 1) ==> (\n. (abs c) pow n) --> (& 0)
24767 \ENDTHEOREM
24768 +\THEOREM SEQ\_POWER SEQ
24769 +|- !c. (abs c) < (& 1) ==> (\n. c pow n) --> (& 0)
24770 +\ENDTHEOREM
24771 \THEOREM SEQ\_SBOUNDED SEQ
24772 |- !s f. bounded(mr1,$num_ge)s ==> bounded(mr1,$num_ge)(\n. s(f n))
24773 \ENDTHEOREM
24774 @@ -2447,31 +2437,31 @@
24775 \THEOREM SER\_CMUL SEQ
24776 |- !x x0 c. x sums x0 ==> (\n. c * (x n)) sums (c * x0)
24777 \ENDTHEOREM
24778 -\THEOREM SER\_COMPAR SEQ
24779 +\THEOREM SER\_COMPARA SEQ
24780 |- !f g.
24781 (?N. !n. n num_ge N ==> (abs(f n)) <= (g n)) /\ summable g ==>
24782 - summable f
24783 + summable(\k. abs(f k))
24784 \ENDTHEOREM
24785 -\THEOREM SER\_COMPARA SEQ
24786 +\THEOREM SER\_COMPAR SEQ
24787 |- !f g.
24788 (?N. !n. n num_ge N ==> (abs(f n)) <= (g n)) /\ summable g ==>
24789 - summable(\k. abs(f k))
24790 + summable f
24791 \ENDTHEOREM
24792 \THEOREM SER\_GROUP SEQ
24793 |- !f k.
24794 summable f /\ 0 num_lt k ==>
24795 (\n. Sum(n num_mul k,k)f) sums (suminf f)
24796 \ENDTHEOREM
24797 -\THEOREM SER\_LE SEQ
24798 -|- !f g.
24799 - (!n. (f n) <= (g n)) /\ summable f /\ summable g ==>
24800 - (suminf f) <= (suminf g)
24801 -\ENDTHEOREM
24802 \THEOREM SER\_LE2 SEQ
24803 |- !f g.
24804 (!n. (abs(f n)) <= (g n)) /\ summable g ==>
24805 summable f /\ (suminf f) <= (suminf g)
24806 \ENDTHEOREM
24807 +\THEOREM SER\_LE SEQ
24808 +|- !f g.
24809 + (!n. (f n) <= (g n)) /\ summable f /\ summable g ==>
24810 + (suminf f) <= (suminf g)
24811 +\ENDTHEOREM
24812 \THEOREM SER\_NEG SEQ
24813 |- !x x0. x sums x0 ==> (\n. --(x n)) sums (-- x0)
24814 \ENDTHEOREM
24815 @@ -2542,8 +2532,7 @@
24816 \THEOREM tends\_num\_real SEQ
24817 |- !x x0. x --> x0 = (x tends x0)(mtop mr1,$num_ge)
24818 \ENDTHEOREM
24819 -\section{POWSER}
24820 -\THEOREM diffs POWSER
24821 +\section{POWSER}\THEOREM diffs POWSER
24822 |- !c. diffs c = (\n. (&(SUC n)) * (c(SUC n)))
24823 \ENDTHEOREM
24824 \THEOREM DIFFS\_EQUIV POWSER
24825 @@ -2552,18 +2541,18 @@
24826 (\n. (& n) * ((c n) * (x pow (n num_sub 1)))) sums
24827 (suminf(\n. (diffs c n) * (x pow n)))
24828 \ENDTHEOREM
24829 -\THEOREM DIFFS\_LEMMA POWSER
24830 -|- !n c x.
24831 - Sum(0,n)(\n'. (diffs c n') * (x pow n')) =
24832 - (Sum(0,n)(\n'. (& n') * ((c n') * (x pow (n' num_sub 1))))) +
24833 - ((& n) * ((c n) * (x pow (n num_sub 1))))
24834 -\ENDTHEOREM
24835 \THEOREM DIFFS\_LEMMA2 POWSER
24836 |- !n c x.
24837 Sum(0,n)(\n. (& n) * ((c n) * (x pow (n num_sub 1)))) =
24838 (Sum(0,n)(\n. (diffs c n) * (x pow n))) -
24839 ((& n) * ((c n) * (x pow (n num_sub 1))))
24840 \ENDTHEOREM
24841 +\THEOREM DIFFS\_LEMMA POWSER
24842 +|- !n c x.
24843 + Sum(0,n)(\n'. (diffs c n') * (x pow n')) =
24844 + (Sum(0,n)(\n'. (& n') * ((c n') * (x pow (n' num_sub 1))))) +
24845 + ((& n) * ((c n) * (x pow (n num_sub 1))))
24846 +\ENDTHEOREM
24847 \THEOREM DIFFS\_NEG POWSER
24848 |- !c. diffs(\n. --(c n)) = (\n. --(diffs c n))
24849 \ENDTHEOREM
24850 @@ -2582,15 +2571,15 @@
24851 Sum(0,SUC n)(\p. (x pow p) * (y pow (n num_sub p))) =
24852 Sum(0,SUC n)(\p. (x pow (n num_sub p)) * (y pow p))
24853 \ENDTHEOREM
24854 -\THEOREM POWSER\_INSIDE POWSER
24855 +\THEOREM POWSER\_INSIDEA POWSER
24856 |- !f x z.
24857 summable(\n. (f n) * (x pow n)) /\ (abs z) < (abs x) ==>
24858 - summable(\n. (f n) * (z pow n))
24859 + summable(\n. (abs(f n)) * (z pow n))
24860 \ENDTHEOREM
24861 -\THEOREM POWSER\_INSIDEA POWSER
24862 +\THEOREM POWSER\_INSIDE POWSER
24863 |- !f x z.
24864 summable(\n. (f n) * (x pow n)) /\ (abs z) < (abs x) ==>
24865 - summable(\n. (abs(f n)) * (z pow n))
24866 + summable(\n. (f n) * (z pow n))
24867 \ENDTHEOREM
24868 \THEOREM TERMDIFF POWSER
24869 |- !c K.
24870 @@ -2649,69 +2638,58 @@
24871 (!n. (abs(g h n)) <= ((f n) * (abs h)))) ==>
24872 ((\h. suminf(g h)) tends_real_real (& 0))(& 0)
24873 \ENDTHEOREM
24874 -\section{TRANSC}
24875 -\THEOREM ACS TRANSC
24876 +\section{TRANSC}\THEOREM ACS\_BOUNDS TRANSC
24877 |- !y.
24878 - (--(& 1)) <= y /\ y <= (& 1) ==>
24879 - (& 0) <= (acs y) /\ (acs y) <= pi /\ (cos(acs y) = y)
24880 + (--(& 1)) <= y /\ y <= (& 1) ==> (& 0) <= (acs y) /\ (acs y) <= pi
24881 +\ENDTHEOREM
24882 +\THEOREM ACS\_COS TRANSC
24883 +|- !y. (--(& 1)) <= y /\ y <= (& 1) ==> (cos(acs y) = y)
24884 \ENDTHEOREM
24885 \THEOREM acs TRANSC
24886 |- !y. acs y = (@x. (& 0) <= x /\ x <= pi /\ (cos x = y))
24887 \ENDTHEOREM
24888 -\THEOREM ACS\_BOUNDS TRANSC
24889 +\THEOREM ACS TRANSC
24890 |- !y.
24891 - (--(& 1)) <= y /\ y <= (& 1) ==> (& 0) <= (acs y) /\ (acs y) <= pi
24892 -\ENDTHEOREM
24893 -\THEOREM ACS\_COS TRANSC
24894 -|- !y. (--(& 1)) <= y /\ y <= (& 1) ==> (cos(acs y) = y)
24895 + (--(& 1)) <= y /\ y <= (& 1) ==>
24896 + (& 0) <= (acs y) /\ (acs y) <= pi /\ (cos(acs y) = y)
24897 \ENDTHEOREM
24898 -\THEOREM ASN TRANSC
24899 +\THEOREM ASN\_BOUNDS TRANSC
24900 |- !y.
24901 (--(& 1)) <= y /\ y <= (& 1) ==>
24902 - (--(pi / (& 2))) <= (asn y) /\
24903 - (asn y) <= (pi / (& 2)) /\
24904 - (sin(asn y) = y)
24905 + (--(pi / (& 2))) <= (asn y) /\ (asn y) <= (pi / (& 2))
24906 \ENDTHEOREM
24907 \THEOREM asn TRANSC
24908 |- !y.
24909 asn y =
24910 (@x. (--(pi / (& 2))) <= x /\ x <= (pi / (& 2)) /\ (sin x = y))
24911 \ENDTHEOREM
24912 -\THEOREM ASN\_BOUNDS TRANSC
24913 +\THEOREM ASN TRANSC
24914 |- !y.
24915 (--(& 1)) <= y /\ y <= (& 1) ==>
24916 - (--(pi / (& 2))) <= (asn y) /\ (asn y) <= (pi / (& 2))
24917 + (--(pi / (& 2))) <= (asn y) /\
24918 + (asn y) <= (pi / (& 2)) /\
24919 + (sin(asn y) = y)
24920 \ENDTHEOREM
24921 \THEOREM ASN\_SIN TRANSC
24922 |- !y. (--(& 1)) <= y /\ y <= (& 1) ==> (sin(asn y) = y)
24923 \ENDTHEOREM
24924 -\THEOREM ATN TRANSC
24925 -|- !y.
24926 - (--(pi / (& 2))) < (atn y) /\
24927 - (atn y) < (pi / (& 2)) /\
24928 - (tan(atn y) = y)
24929 +\THEOREM ATN\_BOUNDS TRANSC
24930 +|- !y. (--(pi / (& 2))) < (atn y) /\ (atn y) < (pi / (& 2))
24931 \ENDTHEOREM
24932 \THEOREM atn TRANSC
24933 |- !y.
24934 atn y =
24935 (@x. (--(pi / (& 2))) < x /\ x < (pi / (& 2)) /\ (tan x = y))
24936 \ENDTHEOREM
24937 -\THEOREM ATN\_BOUNDS TRANSC
24938 -|- !y. (--(pi / (& 2))) < (atn y) /\ (atn y) < (pi / (& 2))
24939 +\THEOREM ATN TRANSC
24940 +|- !y.
24941 + (--(pi / (& 2))) < (atn y) /\
24942 + (atn y) < (pi / (& 2)) /\
24943 + (tan(atn y) = y)
24944 \ENDTHEOREM
24945 \THEOREM ATN\_TAN TRANSC
24946 |- !y. tan(atn y) = y
24947 \ENDTHEOREM
24948 -\THEOREM cos TRANSC
24949 -|- !x.
24950 - cos x =
24951 - suminf
24952 - (\n.
24953 - ((\n'.
24954 - (EVEN n' => ((--(& 1)) pow (n' DIV 2)) / (&(FACT n')) | & 0))
24955 - n) *
24956 - (x pow n))
24957 -\ENDTHEOREM
24958 \THEOREM COS\_0 TRANSC
24959 |- cos(& 0) = & 1
24960 \ENDTHEOREM
24961 @@ -2737,6 +2715,16 @@
24962 (x pow n)) sums
24963 (cos x)
24964 \ENDTHEOREM
24965 +\THEOREM cos TRANSC
24966 +|- !x.
24967 + cos x =
24968 + suminf
24969 + (\n.
24970 + ((\n'.
24971 + (EVEN n' => ((--(& 1)) pow (n' DIV 2)) / (&(FACT n')) | & 0))
24972 + n) *
24973 + (x pow n))
24974 +\ENDTHEOREM
24975 \THEOREM COS\_DOUBLE TRANSC
24976 |- !x. cos((& 2) * x) = ((cos x) pow 2) - ((sin x) pow 2)
24977 \ENDTHEOREM
24978 @@ -2772,18 +2760,18 @@
24979 \THEOREM COS\_PERIODIC\_PI TRANSC
24980 |- !x. cos(x + pi) = --(cos x)
24981 \ENDTHEOREM
24982 -\THEOREM COS\_PI TRANSC
24983 -|- cos pi = --(& 1)
24984 -\ENDTHEOREM
24985 \THEOREM COS\_PI2 TRANSC
24986 |- cos(pi / (& 2)) = & 0
24987 \ENDTHEOREM
24988 -\THEOREM COS\_POS\_PI TRANSC
24989 -|- !x. (--(pi / (& 2))) < x /\ x < (pi / (& 2)) ==> (& 0) < (cos x)
24990 +\THEOREM COS\_PI TRANSC
24991 +|- cos pi = --(& 1)
24992 \ENDTHEOREM
24993 \THEOREM COS\_POS\_PI2 TRANSC
24994 |- !x. (& 0) < x /\ x < (pi / (& 2)) ==> (& 0) < (cos x)
24995 \ENDTHEOREM
24996 +\THEOREM COS\_POS\_PI TRANSC
24997 +|- !x. (--(pi / (& 2))) < x /\ x < (pi / (& 2)) ==> (& 0) < (cos x)
24998 +\ENDTHEOREM
24999 \THEOREM COS\_SIN TRANSC
25000 |- !x. cos x = sin((pi / (& 2)) - x)
25001 \ENDTHEOREM
25002 @@ -2815,9 +2803,6 @@
25003 \THEOREM DIFF\_TAN TRANSC
25004 |- !x. ~(cos x = & 0) ==> (tan diffl (inv((cos x) pow 2)))x
25005 \ENDTHEOREM
25006 -\THEOREM exp TRANSC
25007 -|- !x. exp x = suminf(\n. ((\n'. inv(&(FACT n')))n) * (x pow n))
25008 -\ENDTHEOREM
25009 \THEOREM EXP\_0 TRANSC
25010 |- exp(& 0) = & 1
25011 \ENDTHEOREM
25012 @@ -2830,6 +2815,9 @@
25013 \THEOREM EXP\_CONVERGES TRANSC
25014 |- !x. (\n. ((\n. inv(&(FACT n)))n) * (x pow n)) sums (exp x)
25015 \ENDTHEOREM
25016 +\THEOREM exp TRANSC
25017 +|- !x. exp x = suminf(\n. ((\n'. inv(&(FACT n')))n) * (x pow n))
25018 +\ENDTHEOREM
25019 \THEOREM EXP\_FDIFF TRANSC
25020 |- diffs(\n. inv(&(FACT n))) = (\n. inv(&(FACT n)))
25021 \ENDTHEOREM
25022 @@ -2860,12 +2848,12 @@
25023 \THEOREM EXP\_NEG TRANSC
25024 |- !x. exp(-- x) = inv(exp x)
25025 \ENDTHEOREM
25026 -\THEOREM EXP\_NEG\_MUL TRANSC
25027 -|- !x. (exp x) * (exp(-- x)) = & 1
25028 -\ENDTHEOREM
25029 \THEOREM EXP\_NEG\_MUL2 TRANSC
25030 |- !x. (exp(-- x)) * (exp x) = & 1
25031 \ENDTHEOREM
25032 +\THEOREM EXP\_NEG\_MUL TRANSC
25033 +|- !x. (exp x) * (exp(-- x)) = & 1
25034 +\ENDTHEOREM
25035 \THEOREM EXP\_NZ TRANSC
25036 |- !x. ~(exp x = & 0)
25037 \ENDTHEOREM
25038 @@ -2885,15 +2873,15 @@
25039 |- !y.
25040 (& 1) <= y ==> (?x. (& 0) <= x /\ x <= (y - (& 1)) /\ (exp x = y))
25041 \ENDTHEOREM
25042 -\THEOREM ln TRANSC
25043 -|- !x. ln x = (@u. exp u = x)
25044 -\ENDTHEOREM
25045 \THEOREM LN\_1 TRANSC
25046 |- ln(& 1) = & 0
25047 \ENDTHEOREM
25048 \THEOREM LN\_DIV TRANSC
25049 |- !x. (& 0) < x /\ (& 0) < y ==> (ln(x / y) = (ln x) - (ln y))
25050 \ENDTHEOREM
25051 +\THEOREM ln TRANSC
25052 +|- !x. ln x = (@u. exp u = x)
25053 +\ENDTHEOREM
25054 \THEOREM LN\_EXP TRANSC
25055 |- !x. ln(exp x) = x
25056 \ENDTHEOREM
25057 @@ -2915,27 +2903,27 @@
25058 \THEOREM LN\_POW TRANSC
25059 |- !n x. (& 0) < x ==> (ln(x pow n) = (& n) * (ln x))
25060 \ENDTHEOREM
25061 -\THEOREM pi TRANSC
25062 -|- pi = (& 2) * (@x. (& 0) <= x /\ x <= (& 2) /\ (cos x = & 0))
25063 +\THEOREM PI2\_BOUNDS TRANSC
25064 +|- (& 0) < (pi / (& 2)) /\ (pi / (& 2)) < (& 2)
25065 \ENDTHEOREM
25066 \THEOREM PI2 TRANSC
25067 |- pi / (& 2) = (@x. (& 0) <= x /\ x <= (& 2) /\ (cos x = & 0))
25068 \ENDTHEOREM
25069 -\THEOREM PI2\_BOUNDS TRANSC
25070 -|- (& 0) < (pi / (& 2)) /\ (pi / (& 2)) < (& 2)
25071 +\THEOREM pi TRANSC
25072 +|- pi = (& 2) * (@x. (& 0) <= x /\ x <= (& 2) /\ (cos x = & 0))
25073 \ENDTHEOREM
25074 \THEOREM PI\_POS TRANSC
25075 |- (& 0) < pi
25076 \ENDTHEOREM
25077 -\THEOREM root TRANSC
25078 -|- !n x. root n x = (@u. ((& 0) < x ==> (& 0) < u) /\ (u pow n = x))
25079 -\ENDTHEOREM
25080 \THEOREM ROOT\_0 TRANSC
25081 |- !n. root(SUC n)(& 0) = & 0
25082 \ENDTHEOREM
25083 \THEOREM ROOT\_1 TRANSC
25084 |- !n. root(SUC n)(& 1) = & 1
25085 \ENDTHEOREM
25086 +\THEOREM root TRANSC
25087 +|- !n x. root n x = (@u. ((& 0) < x ==> (& 0) < u) /\ (u pow n = x))
25088 +\ENDTHEOREM
25089 \THEOREM ROOT\_LN TRANSC
25090 |- !n x. (& 0) < x ==> (!n. root(SUC n)x = exp((ln x) / (&(SUC n))))
25091 \ENDTHEOREM
25092 @@ -2945,18 +2933,6 @@
25093 \THEOREM ROOT\_POW\_POS TRANSC
25094 |- !n x. (& 0) <= x ==> ((root(SUC n)x) pow (SUC n) = x)
25095 \ENDTHEOREM
25096 -\THEOREM sin TRANSC
25097 -|- !x.
25098 - sin x =
25099 - suminf
25100 - (\n.
25101 - ((\n'.
25102 - (EVEN n' =>
25103 - & 0 |
25104 - ((--(& 1)) pow ((n' num_sub 1) DIV 2)) / (&(FACT n'))))
25105 - n) *
25106 - (x pow n))
25107 -\ENDTHEOREM
25108 \THEOREM SIN\_0 TRANSC
25109 |- sin(& 0) = & 0
25110 \ENDTHEOREM
25111 @@ -2986,20 +2962,32 @@
25112 (x pow n)) sums
25113 (sin x)
25114 \ENDTHEOREM
25115 -\THEOREM SIN\_COS TRANSC
25116 -|- !x. sin x = cos((pi / (& 2)) - x)
25117 -\ENDTHEOREM
25118 \THEOREM SIN\_COS\_ADD TRANSC
25119 |- !x y.
25120 (((sin(x + y)) - (((sin x) * (cos y)) + ((cos x) * (sin y)))) pow 2) +
25121 (((cos(x + y)) - (((cos x) * (cos y)) - ((sin x) * (sin y)))) pow 2) =
25122 & 0
25123 \ENDTHEOREM
25124 +\THEOREM SIN\_COS TRANSC
25125 +|- !x. sin x = cos((pi / (& 2)) - x)
25126 +\ENDTHEOREM
25127 \THEOREM SIN\_COS\_NEG TRANSC
25128 |- !x.
25129 (((sin(-- x)) + (sin x)) pow 2) + (((cos(-- x)) - (cos x)) pow 2) =
25130 & 0
25131 \ENDTHEOREM
25132 +\THEOREM sin TRANSC
25133 +|- !x.
25134 + sin x =
25135 + suminf
25136 + (\n.
25137 + ((\n'.
25138 + (EVEN n' =>
25139 + & 0 |
25140 + ((--(& 1)) pow ((n' num_sub 1) DIV 2)) / (&(FACT n'))))
25141 + n) *
25142 + (x pow n))
25143 +\ENDTHEOREM
25144 \THEOREM SIN\_DOUBLE TRANSC
25145 |- !x. sin((& 2) * x) = (& 2) * ((sin x) * (cos x))
25146 \ENDTHEOREM
25147 @@ -3043,21 +3031,21 @@
25148 \THEOREM SIN\_PERIODIC\_PI TRANSC
25149 |- !x. sin(x + pi) = --(sin x)
25150 \ENDTHEOREM
25151 -\THEOREM SIN\_PI TRANSC
25152 -|- sin pi = & 0
25153 -\ENDTHEOREM
25154 \THEOREM SIN\_PI2 TRANSC
25155 |- sin(pi / (& 2)) = & 1
25156 \ENDTHEOREM
25157 +\THEOREM SIN\_PI TRANSC
25158 +|- sin pi = & 0
25159 +\ENDTHEOREM
25160 \THEOREM SIN\_POS TRANSC
25161 |- !x. (& 0) < x /\ x < (& 2) ==> (& 0) < (sin x)
25162 \ENDTHEOREM
25163 -\THEOREM SIN\_POS\_PI TRANSC
25164 -|- !x. (& 0) < x /\ x < pi ==> (& 0) < (sin x)
25165 -\ENDTHEOREM
25166 \THEOREM SIN\_POS\_PI2 TRANSC
25167 |- !x. (& 0) < x /\ x < (pi / (& 2)) ==> (& 0) < (sin x)
25168 \ENDTHEOREM
25169 +\THEOREM SIN\_POS\_PI TRANSC
25170 +|- !x. (& 0) < x /\ x < pi ==> (& 0) < (sin x)
25171 +\ENDTHEOREM
25172 \THEOREM SIN\_TOTAL TRANSC
25173 |- !y.
25174 (--(& 1)) <= y /\ y <= (& 1) ==>
25175 @@ -3074,21 +3062,18 @@
25176 (& 0) <= x /\ (sin x = & 0) ==>
25177 (?n. EVEN n /\ (x = (& n) * (pi / (& 2))))
25178 \ENDTHEOREM
25179 -\THEOREM sqrt TRANSC
25180 -|- !x. sqrt x = root 2 x
25181 -\ENDTHEOREM
25182 \THEOREM SQRT\_0 TRANSC
25183 |- sqrt(& 0) = & 0
25184 \ENDTHEOREM
25185 \THEOREM SQRT\_1 TRANSC
25186 |- sqrt(& 1) = & 1
25187 \ENDTHEOREM
25188 +\THEOREM sqrt TRANSC
25189 +|- !x. sqrt x = root 2 x
25190 +\ENDTHEOREM
25191 \THEOREM SQRT\_POW2 TRANSC
25192 |- !x. ((sqrt x) pow 2 = x) = (& 0) <= x
25193 \ENDTHEOREM
25194 -\THEOREM tan TRANSC
25195 -|- !x. tan x = (sin x) / (cos x)
25196 -\ENDTHEOREM
25197 \THEOREM TAN\_0 TRANSC
25198 |- tan(& 0) = & 0
25199 \ENDTHEOREM
25200 @@ -3100,6 +3085,9 @@
25201 \THEOREM TAN\_ATN TRANSC
25202 |- !x. (--(pi / (& 2))) < x /\ x < (pi / (& 2)) ==> (atn(tan x) = x)
25203 \ENDTHEOREM
25204 +\THEOREM tan TRANSC
25205 +|- !x. tan x = (sin x) / (cos x)
25206 +\ENDTHEOREM
25207 \THEOREM TAN\_DOUBLE TRANSC
25208 |- !x.
25209 ~(cos x = & 0) /\ ~(cos((& 2) * x) = & 0) ==>
25210 --- hol88-2.02.19940316.orig/Library/reals/Manual/Makefile
25211 +++ hol88-2.02.19940316/Library/reals/Manual/Makefile
25212 @@ -15,34 +15,34 @@ all:; make clean; make tex; make reals;
25213
25214 clean:; \
25215 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg; \
25216 - echo "\begin{theindex}" >index.tex; \
25217 - echo "\mbox{}" >>index.tex; \
25218 - echo "\end{theindex}" >>index.tex
25219 + printf '\\begin{theindex}' >index.tex; \
25220 + printf '\\mbox{}' >>index.tex; \
25221 + printf '\\end{theindex}' >>index.tex
25222
25223 tex: theorems
25224
25225 theorems:; \
25226 - echo "\chapter{Pre-proved Theorems}" >theorems.tex; \
25227 - echo "\input{theorems-intro}" >>theorems.tex; \
25228 - echo "\section{HRAT}" >>theorems.tex; \
25229 + printf '\\chapter{Pre-proved Theorems}' >theorems.tex; \
25230 + printf '\\input{theorems-intro}' >>theorems.tex; \
25231 + printf '\\section{HRAT}' >>theorems.tex; \
25232 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/HRAT theorems.tex; \
25233 - echo "\section{HREAL}" >>theorems.tex; \
25234 + printf '\\section{HREAL}' >>theorems.tex; \
25235 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/HREAL theorems.tex; \
25236 - echo "\section{REALAX}" >>theorems.tex; \
25237 + printf '\\section{REALAX}' >>theorems.tex; \
25238 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/REALAX theorems.tex; \
25239 - echo "\section{REAL}" >>theorems.tex; \
25240 + printf '\\section{REAL}' >>theorems.tex; \
25241 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/REAL theorems.tex; \
25242 - echo "\section{TOPOLOGY}" >>theorems.tex; \
25243 + printf '\\section{TOPOLOGY}' >>theorems.tex; \
25244 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/TOPOLOGY theorems.tex; \
25245 - echo "\section{NETS}" >>theorems.tex; \
25246 + printf '\\section{NETS}' >>theorems.tex; \
25247 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/NETS theorems.tex; \
25248 - echo "\section{LIM}" >>theorems.tex; \
25249 + printf '\\section{LIM}' >>theorems.tex; \
25250 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/LIM theorems.tex; \
25251 - echo "\section{SEQ}" >>theorems.tex; \
25252 + printf '\\section{SEQ}' >>theorems.tex; \
25253 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/SEQ theorems.tex; \
25254 - echo "\section{POWSER}" >>theorems.tex; \
25255 + printf '\\section{POWSER}' >>theorems.tex; \
25256 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/POWSER theorems.tex; \
25257 - echo "\section{TRANSC}" >>theorems.tex; \
25258 + printf '\\section{TRANSC}' >>theorems.tex; \
25259 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/TRANSC theorems.tex
25260
25261 reals:; \
25262 --- hol88-2.02.19940316.orig/Library/prettyp/Manual/Makefile
25263 +++ hol88-2.02.19940316/Library/prettyp/Manual/Makefile
25264 @@ -26,16 +26,16 @@ default:
25265 # ---------------------------------------------------------------------
25266 clean:
25267 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
25268 - @echo "\begin{theindex}" > index.tex
25269 - @echo "\mbox{}" >> index.tex
25270 - @echo "\end{theindex}" >> index.tex
25271 + @printf '\\begin{theindex}' > index.tex
25272 + @printf '\\mbox{}' >> index.tex
25273 + @printf '\\end{theindex}' >> index.tex
25274
25275 tex: ids
25276 @echo "TeX files made"
25277
25278 ids:
25279 - @echo "\chapter{ML Functions in the prettyp Library}">entries.tex
25280 - @echo "\input{entries-intro}" >> entries.tex
25281 + @printf '\\chapter{ML Functions in the prettyp Library}'>entries.tex
25282 + @printf '\\input{entries-intro}' >> entries.tex
25283 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
25284
25285 index:
25286 --- hol88-2.02.19940316.orig/Library/prettyp/Manual/entries.tex
25287 +++ hol88-2.02.19940316/Library/prettyp/Manual/entries.tex
25288 @@ -1,6 +1,4 @@
25289 -\chapter{ML Functions in the prettyp Library}
25290 -\input{entries-intro}
25291 -\DOC{Address}
25292 +\chapter{ML Functions in the prettyp Library}\input{entries-intro}\DOC{Address}
25293
25294 \TYPE {\small\verb%Address : (int list -> address)%}\egroup
25295
25296 @@ -831,57 +829,6 @@ function to include no type information
25297 Hidden_types, Useful_types, All_types, term_to_print_tree.
25298
25299 \ENDDOC
25300 -\DOC{pp}
25301 -
25302 -{\small
25303 -\begin{verbatim}
25304 -pp : (print_rule_function -> string -> (string # int) list ->
25305 - print_tree -> void)
25306 -\end{verbatim}
25307 -}\egroup
25308 -
25309 -\SYNOPSIS
25310 -One of the main pretty-printing functions. For use with the standard HOL
25311 -pretty-printer.
25312 -
25313 -\DESCRIBE
25314 -{\small\verb%pp%} invokes the pretty-printer. It can be used for merging output with text
25315 -produced by the standard HOL pretty-printer. Instead of ending each line of
25316 -text by printing a new-line, it sends its output to the standard HOL printer
25317 -in the form of a pretty-printing block. The arguments to the function are:
25318 -(1) pretty-printing rules expressed as a function, (2) the initial context,
25319 -(3) initial parameters, (4) tree to be printed. {\small\verb%pp%} uses as its maximum width
25320 -the width for the standard HOL printer, as specified by the function
25321 -{\small\verb%set_margin%}. The initial offset from the left margin is taken to be zero.
25322 -
25323 -\FAILURE
25324 -Failure or incorrect behaviour can be caused by mistakes in the pretty-printing
25325 -rules or by inappropriate arguments to the printing function. The most common
25326 -errors are use of uninitialised parameters and reference to unknown
25327 -metavariables. The latter are due to metavariables appearing in the format of a
25328 -rule, but not in the pattern. Errors also occur if a metavariable is used in a
25329 -place inappropriate for the value it is bound to. An example of this is an
25330 -attempt to compare a string with a metavariable that is bound to a tree rather
25331 -than a node-name.
25332 -
25333 -Use of negative indentations in formats may cause text to overflow the left
25334 -margin, and an exception to be raised. Any user defined function may also
25335 -cause a run-time error.
25336 -
25337 -The printing functions have been designed to trap exceptions and to print
25338 -{\small\verb%*error*%}. This does not indicate what caused the error, but it may give some
25339 -indication of where the error occurred. However, this is not the main reason
25340 -for trapping exceptions. The ML directive {\small\verb%top_print%} installs a user print
25341 -function. If an exception is raised within this function, it does not appear
25342 -at the top-level of ML. Instead, an obscure Lisp error is produced. Since the
25343 -pretty-printing functions are normally used with {\small\verb%top_print%}, it is best to
25344 -avoid raising exceptions. For this reason the printing functions display
25345 -{\small\verb%*error*%} instead.
25346 -
25347 -\SEEALSO
25348 -pretty_print, pp_write.
25349 -
25350 -\ENDDOC
25351 \DOC{pp\_convert\_all\_thm}
25352
25353 \TYPE {\small\verb%pp_convert_all_thm : (thm -> print_tree)%}\egroup
25354 @@ -991,6 +938,57 @@ Never fails.
25355 type_to_print_tree, pp_convert_term, pp_convert_thm, pp_convert_all_thm.
25356
25357 \ENDDOC
25358 +\DOC{pp}
25359 +
25360 +{\small
25361 +\begin{verbatim}
25362 +pp : (print_rule_function -> string -> (string # int) list ->
25363 + print_tree -> void)
25364 +\end{verbatim}
25365 +}\egroup
25366 +
25367 +\SYNOPSIS
25368 +One of the main pretty-printing functions. For use with the standard HOL
25369 +pretty-printer.
25370 +
25371 +\DESCRIBE
25372 +{\small\verb%pp%} invokes the pretty-printer. It can be used for merging output with text
25373 +produced by the standard HOL pretty-printer. Instead of ending each line of
25374 +text by printing a new-line, it sends its output to the standard HOL printer
25375 +in the form of a pretty-printing block. The arguments to the function are:
25376 +(1) pretty-printing rules expressed as a function, (2) the initial context,
25377 +(3) initial parameters, (4) tree to be printed. {\small\verb%pp%} uses as its maximum width
25378 +the width for the standard HOL printer, as specified by the function
25379 +{\small\verb%set_margin%}. The initial offset from the left margin is taken to be zero.
25380 +
25381 +\FAILURE
25382 +Failure or incorrect behaviour can be caused by mistakes in the pretty-printing
25383 +rules or by inappropriate arguments to the printing function. The most common
25384 +errors are use of uninitialised parameters and reference to unknown
25385 +metavariables. The latter are due to metavariables appearing in the format of a
25386 +rule, but not in the pattern. Errors also occur if a metavariable is used in a
25387 +place inappropriate for the value it is bound to. An example of this is an
25388 +attempt to compare a string with a metavariable that is bound to a tree rather
25389 +than a node-name.
25390 +
25391 +Use of negative indentations in formats may cause text to overflow the left
25392 +margin, and an exception to be raised. Any user defined function may also
25393 +cause a run-time error.
25394 +
25395 +The printing functions have been designed to trap exceptions and to print
25396 +{\small\verb%*error*%}. This does not indicate what caused the error, but it may give some
25397 +indication of where the error occurred. However, this is not the main reason
25398 +for trapping exceptions. The ML directive {\small\verb%top_print%} installs a user print
25399 +function. If an exception is raised within this function, it does not appear
25400 +at the top-level of ML. Instead, an obscure Lisp error is produced. Since the
25401 +pretty-printing functions are normally used with {\small\verb%top_print%}, it is best to
25402 +avoid raising exceptions. For this reason the printing functions display
25403 +{\small\verb%*error*%} instead.
25404 +
25405 +\SEEALSO
25406 +pretty_print, pp_write.
25407 +
25408 +\ENDDOC
25409 \DOC{pp\_print\_all\_thm}
25410
25411 \TYPE {\small\verb%pp_print_all_thm : (thm -> void)%}\egroup
25412 --- hol88-2.02.19940316.orig/Library/taut/Manual/Makefile
25413 +++ hol88-2.02.19940316/Library/taut/Manual/Makefile
25414 @@ -26,16 +26,16 @@ default:
25415 # ---------------------------------------------------------------------
25416 clean:
25417 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
25418 - @echo "\begin{theindex}" > index.tex
25419 - @echo "\mbox{}" >> index.tex
25420 - @echo "\end{theindex}" >> index.tex
25421 + @printf '\\begin{theindex}' > index.tex
25422 + @printf '\\mbox{}' >> index.tex
25423 + @printf '\\end{theindex}' >> index.tex
25424
25425 tex: ids
25426 @echo "TeX files made"
25427
25428 ids:
25429 - @echo "\chapter{ML Functions in the taut Library}">entries.tex
25430 - @echo "\input{entries-intro}" >> entries.tex
25431 + @printf '\\chapter{ML Functions in the taut Library}'>entries.tex
25432 + @printf '\\input{entries-intro}' >> entries.tex
25433 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
25434
25435 index:
25436 --- hol88-2.02.19940316.orig/Library/taut/Manual/entries.tex
25437 +++ hol88-2.02.19940316/Library/taut/Manual/entries.tex
25438 @@ -1,6 +1,4 @@
25439 -\chapter{ML Functions in the taut Library}
25440 -\input{entries-intro}
25441 -\DOC{PTAUT\_CONV}
25442 +\chapter{ML Functions in the taut Library}\input{entries-intro}\DOC{PTAUT\_CONV}
25443
25444 \TYPE {\small\verb%PTAUT_CONV : conv%}\egroup
25445
25446 --- hol88-2.02.19940316.orig/Library/sets/Manual/theorems.tex
25447 +++ hol88-2.02.19940316/Library/sets/Manual/theorems.tex
25448 @@ -1,22 +1,18 @@
25449 -\chapter{Pre-proved Theorems}
25450 -\input{theorems-intro}
25451 -\section{The type definition}
25452 -\THEOREM set\_ISO\_DEF sets
25453 +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{The type definition}\THEOREM set\_ISO\_DEF sets
25454 |- (!a. SPEC(CHF a) = a) /\ (!r. (\p. T)r = (CHF(SPEC r) = r))
25455 \ENDTHEOREM
25456 \THEOREM set\_TY\_DEF sets
25457 |- ?rep. TYPE_DEFINITION(\p. T)rep
25458 \ENDTHEOREM
25459 -\section{Membership, equality, and set specifications}
25460 -\THEOREM EXTENSION sets
25461 +\section{Membership, equality, and set specifications}\THEOREM EXTENSION sets
25462 |- !s t. (s = t) = (!x. x IN s = x IN t)
25463 \ENDTHEOREM
25464 -\THEOREM GSPECIFICATION sets
25465 -|- !f v. v IN (GSPEC f) = (?x. v,T = f x)
25466 -\ENDTHEOREM
25467 \THEOREM GSPEC\_DEF sets
25468 |- !f. GSPEC f = SPEC(\y. ?x. y,T = f x)
25469 \ENDTHEOREM
25470 +\THEOREM GSPECIFICATION sets
25471 +|- !f v. v IN (GSPEC f) = (?x. v,T = f x)
25472 +\ENDTHEOREM
25473 \THEOREM IN\_DEF sets
25474 |- !x s. x IN s = CHF s x
25475 \ENDTHEOREM
25476 @@ -32,8 +28,7 @@
25477 \THEOREM SPECIFICATION sets
25478 |- !P x. x IN (SPEC P) = P x
25479 \ENDTHEOREM
25480 -\section{The empty and universal sets}
25481 -\THEOREM EMPTY\_DEF sets
25482 +\section{The empty and universal sets}\THEOREM EMPTY\_DEF sets
25483 |- {} = SPEC(\x. F)
25484 \ENDTHEOREM
25485 \THEOREM EMPTY\_NOT\_UNIV sets
25486 @@ -57,8 +52,7 @@
25487 \THEOREM UNIV\_NOT\_EMPTY sets
25488 |- ~(UNIV = {})
25489 \ENDTHEOREM
25490 -\section{Set inclusion}
25491 -\THEOREM EMPTY\_SUBSET sets
25492 +\section{Set inclusion}\THEOREM EMPTY\_SUBSET sets
25493 |- !s. {} SUBSET s
25494 \ENDTHEOREM
25495 \THEOREM NOT\_PSUBSET\_EMPTY sets
25496 @@ -103,10 +97,12 @@
25497 \THEOREM UNIV\_SUBSET sets
25498 |- !s. UNIV SUBSET s = (s = UNIV)
25499 \ENDTHEOREM
25500 -\section{Intersection and union}
25501 -\THEOREM EMPTY\_UNION sets
25502 +\section{Intersection and union}\THEOREM EMPTY\_UNION sets
25503 |- !s t. (s UNION t = {}) = (s = {}) /\ (t = {})
25504 \ENDTHEOREM
25505 +\THEOREM IN\_INTER sets
25506 +|- !s t x. x IN (s INTER t) = x IN s /\ x IN t
25507 +\ENDTHEOREM
25508 \THEOREM INTER\_ASSOC sets
25509 |- !s t u. (s INTER t) INTER u = s INTER (t INTER u)
25510 \ENDTHEOREM
25511 @@ -131,21 +127,18 @@
25512 \THEOREM INTER\_UNIV sets
25513 |- (!s. UNIV INTER s = s) /\ (!s. s INTER UNIV = s)
25514 \ENDTHEOREM
25515 -\THEOREM IN\_INTER sets
25516 -|- !s t x. x IN (s INTER t) = x IN s /\ x IN t
25517 -\ENDTHEOREM
25518 \THEOREM IN\_UNION sets
25519 |- !s t x. x IN (s UNION t) = x IN s \/ x IN t
25520 \ENDTHEOREM
25521 \THEOREM SUBSET\_INTER\_ABSORPTION sets
25522 |- !s t. s SUBSET t = (s INTER t = s)
25523 \ENDTHEOREM
25524 -\THEOREM SUBSET\_UNION sets
25525 -|- (!s t. s SUBSET (s UNION t)) /\ (!s t. s SUBSET (t UNION s))
25526 -\ENDTHEOREM
25527 \THEOREM SUBSET\_UNION\_ABSORPTION sets
25528 |- !s t. s SUBSET t = (s UNION t = t)
25529 \ENDTHEOREM
25530 +\THEOREM SUBSET\_UNION sets
25531 +|- (!s t. s SUBSET (s UNION t)) /\ (!s t. s SUBSET (t UNION s))
25532 +\ENDTHEOREM
25533 \THEOREM UNION\_ASSOC sets
25534 |- !s t u. (s UNION t) UNION u = s UNION (t UNION u)
25535 \ENDTHEOREM
25536 @@ -167,8 +160,7 @@
25537 \THEOREM UNION\_UNIV sets
25538 |- (!s. UNIV UNION s = UNIV) /\ (!s. s UNION UNIV = UNIV)
25539 \ENDTHEOREM
25540 -\section{Set difference}
25541 -\THEOREM DIFF\_DEF sets
25542 +\section{Set difference}\THEOREM DIFF\_DEF sets
25543 |- !s t. s DIFF t = {x | x IN s /\ ~x IN t}
25544 \ENDTHEOREM
25545 \THEOREM DIFF\_DIFF sets
25546 @@ -189,8 +181,7 @@
25547 \THEOREM IN\_DIFF sets
25548 |- !s t x. x IN (s DIFF t) = x IN s /\ ~x IN t
25549 \ENDTHEOREM
25550 -\section{Disjoint sets}
25551 -\THEOREM DISJOINT\_DEF sets
25552 +\section{Disjoint sets}\THEOREM DISJOINT\_DEF sets
25553 |- !s t. DISJOINT s t = (s INTER t = {})
25554 \ENDTHEOREM
25555 \THEOREM DISJOINT\_DELETE\_SYM sets
25556 @@ -212,8 +203,7 @@
25557 \THEOREM IN\_DISJOINT sets
25558 |- !s t. DISJOINT s t = ~(?x. x IN s /\ x IN t)
25559 \ENDTHEOREM
25560 -\section{Insertion and deletion of an element}
25561 -\THEOREM ABSORPTION sets
25562 +\section{Insertion and deletion of an element}\THEOREM ABSORPTION sets
25563 |- !x s. x IN s = (x INSERT s = s)
25564 \ENDTHEOREM
25565 \THEOREM COMPONENT sets
25566 @@ -254,6 +244,16 @@
25567 \THEOREM EMPTY\_DELETE sets
25568 |- !x. {} DELETE x = {}
25569 \ENDTHEOREM
25570 +\THEOREM IN\_DELETE sets
25571 +|- !s x y. x IN (s DELETE y) = x IN s /\ ~(x = y)
25572 +\ENDTHEOREM
25573 +\THEOREM IN\_DELETE\_EQ sets
25574 +|- !s x x'.
25575 + (x IN s = x' IN s) = (x IN (s DELETE x') = x' IN (s DELETE x))
25576 +\ENDTHEOREM
25577 +\THEOREM IN\_INSERT sets
25578 +|- !x y s. x IN (y INSERT s) = (x = y) \/ x IN s
25579 +\ENDTHEOREM
25580 \THEOREM INSERT\_COMM sets
25581 |- !x y s. x INSERT (y INSERT s) = y INSERT (x INSERT s)
25582 \ENDTHEOREM
25583 @@ -287,16 +287,6 @@
25584 \THEOREM INSERT\_UNIV sets
25585 |- !x. x INSERT UNIV = UNIV
25586 \ENDTHEOREM
25587 -\THEOREM IN\_DELETE sets
25588 -|- !s x y. x IN (s DELETE y) = x IN s /\ ~(x = y)
25589 -\ENDTHEOREM
25590 -\THEOREM IN\_DELETE\_EQ sets
25591 -|- !s x x'.
25592 - (x IN s = x' IN s) = (x IN (s DELETE x') = x' IN (s DELETE x))
25593 -\ENDTHEOREM
25594 -\THEOREM IN\_INSERT sets
25595 -|- !x y s. x IN (y INSERT s) = (x = y) \/ x IN s
25596 -\ENDTHEOREM
25597 \THEOREM NOT\_EMPTY\_INSERT sets
25598 |- !x s. ~({} = x INSERT s)
25599 \ENDTHEOREM
25600 @@ -312,14 +302,13 @@
25601 \THEOREM SUBSET\_DELETE sets
25602 |- !x s t. s SUBSET (t DELETE x) = ~x IN s /\ s SUBSET t
25603 \ENDTHEOREM
25604 -\THEOREM SUBSET\_INSERT sets
25605 -|- !x s. ~x IN s ==> (!t. s SUBSET (x INSERT t) = s SUBSET t)
25606 -\ENDTHEOREM
25607 \THEOREM SUBSET\_INSERT\_DELETE sets
25608 |- !x s t. s SUBSET (x INSERT t) = (s DELETE x) SUBSET t
25609 \ENDTHEOREM
25610 -\section{The {\tt CHOICE} and {\tt REST} functions}
25611 -\THEOREM CHOICE\_DEF sets
25612 +\THEOREM SUBSET\_INSERT sets
25613 +|- !x s. ~x IN s ==> (!t. s SUBSET (x INSERT t) = s SUBSET t)
25614 +\ENDTHEOREM
25615 +\section{The {\tt CHOICE} and {\tt REST} functions}\THEOREM CHOICE\_DEF sets
25616 |- !s. ~(s = {}) ==> (CHOICE s) IN s
25617 \ENDTHEOREM
25618 \THEOREM CHOICE\_INSERT\_REST sets
25619 @@ -346,8 +335,7 @@
25620 \THEOREM SING\_IFF\_EMPTY\_REST sets
25621 |- !s. SING s = ~(s = {}) /\ (REST s = {})
25622 \ENDTHEOREM
25623 -\section{Image of a function on a set}
25624 -\THEOREM IMAGE\_COMPOSE sets
25625 +\section{Image of a function on a set}\THEOREM IMAGE\_COMPOSE sets
25626 |- !f g s. IMAGE(f o g)s = IMAGE f(IMAGE g s)
25627 \ENDTHEOREM
25628 \THEOREM IMAGE\_DEF sets
25629 @@ -383,8 +371,7 @@
25630 \THEOREM IN\_IMAGE sets
25631 |- !y s f. y IN (IMAGE f s) = (?x. (y = f x) /\ x IN s)
25632 \ENDTHEOREM
25633 -\section{Mappings between sets}
25634 -\THEOREM BIJ\_COMPOSE sets
25635 +\section{Mappings between sets}\THEOREM BIJ\_COMPOSE sets
25636 |- !f g s t u. BIJ f s t /\ BIJ g t u ==> BIJ(g o f)s u
25637 \ENDTHEOREM
25638 \THEOREM BIJ\_DEF sets
25639 @@ -435,8 +422,7 @@
25640 \THEOREM SURJ\_ID sets
25641 |- !s. SURJ(\x. x)s s
25642 \ENDTHEOREM
25643 -\section{Singleton sets}
25644 -\THEOREM DELETE\_EQ\_SING sets
25645 +\section{Singleton sets}\THEOREM DELETE\_EQ\_SING sets
25646 |- !s x. x IN s ==> ((s DELETE x = {}) = (s = {x}))
25647 \ENDTHEOREM
25648 \THEOREM DISJOINT\_SING\_EMPTY sets
25649 @@ -460,20 +446,19 @@
25650 \THEOREM NOT\_SING\_EMPTY sets
25651 |- !x. ~({x} = {})
25652 \ENDTHEOREM
25653 -\THEOREM SING sets
25654 -|- !x. SING{x}
25655 -\ENDTHEOREM
25656 \THEOREM SING\_DEF sets
25657 |- !s. SING s = (?x. s = {x})
25658 \ENDTHEOREM
25659 \THEOREM SING\_DELETE sets
25660 |- !x. {x} DELETE x = {}
25661 \ENDTHEOREM
25662 +\THEOREM SING sets
25663 +|- !x. SING{x}
25664 +\ENDTHEOREM
25665 \THEOREM SING\_FINITE sets
25666 |- !s. SING s ==> FINITE s
25667 \ENDTHEOREM
25668 -\section{Finite and infinite sets}
25669 -\THEOREM FINITE\_DEF sets
25670 +\section{Finite and infinite sets}\THEOREM FINITE\_DEF sets
25671 |- !s.
25672 FINITE s = (!P. P{} /\ (!s'. P s' ==> (!e. P(e INSERT s'))) ==> P s)
25673 \ENDTHEOREM
25674 @@ -531,12 +516,12 @@
25675 |- INFINITE (UNIV:(*)set) =
25676 (?f:*->*. (!x y. (f x = f y) ==> (x = y)) /\ (?y. !x. ~(f x = y)))
25677 \ENDTHEOREM
25678 -\THEOREM INTER\_FINITE sets
25679 -|- !s. FINITE s ==> (!t. FINITE(s INTER t))
25680 -\ENDTHEOREM
25681 \THEOREM IN\_INFINITE\_NOT\_FINITE sets
25682 |- !s t. INFINITE s /\ FINITE t ==> (?x. x IN s /\ ~x IN t)
25683 \ENDTHEOREM
25684 +\THEOREM INTER\_FINITE sets
25685 +|- !s. FINITE s ==> (!t. FINITE(s INTER t))
25686 +\ENDTHEOREM
25687 \THEOREM NOT\_IN\_FINITE sets
25688 |- INFINITE UNIV = (!s. FINITE s ==> (?x. ~x IN s))
25689 \ENDTHEOREM
25690 @@ -546,8 +531,7 @@
25691 \THEOREM SUBSET\_FINITE sets
25692 |- !s. FINITE s ==> (!t. t SUBSET s ==> FINITE t)
25693 \ENDTHEOREM
25694 -\section{Cardinality of sets}
25695 -\THEOREM CARD\_DEF sets
25696 +\section{Cardinality of sets}\THEOREM CARD\_DEF sets
25697 |- (CARD{} = 0) /\
25698 (!s.
25699 FINITE s ==>
25700 --- hol88-2.02.19940316.orig/Library/sets/Manual/Makefile
25701 +++ hol88-2.02.19940316/Library/sets/Manual/Makefile
25702 @@ -26,49 +26,49 @@ default:
25703 # ---------------------------------------------------------------------
25704 clean:
25705 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
25706 - @echo "\begin{theindex}" > index.tex
25707 - @echo "\mbox{}" >> index.tex
25708 - @echo "\end{theindex}" >> index.tex
25709 + @printf '\\begin{theindex}' > index.tex
25710 + @printf '\\mbox{}' >> index.tex
25711 + @printf '\\end{theindex}' >> index.tex
25712
25713 tex: theorems ids
25714 @echo "TeX files made"
25715
25716 ids:
25717 - @echo "\chapter{ML Functions in the sets Library}">entries.tex
25718 - @echo "\label{entries}">>entries.tex
25719 - @echo "\input{entries-intro}" >> entries.tex
25720 + @printf '\\chapter{ML Functions in the sets Library}'>entries.tex
25721 + @printf '\\label{entries}'>>entries.tex
25722 + @printf '\\input{entries-intro}' >> entries.tex
25723 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
25724
25725 theorems:
25726 - @echo "\chapter{Pre-proved Theorems}" > theorems.tex
25727 - @echo "\input{theorems-intro}" >> theorems.tex
25728 - @echo "\section{The type definition}">>theorems.tex
25729 + @printf '\\chapter{Pre-proved Theorems}' > theorems.tex
25730 + @printf '\\input{theorems-intro}' >> theorems.tex
25731 + @printf '\\section{The type definition}'>>theorems.tex
25732 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/sdef theorems.tex
25733 - @echo "\section{Membership, equality, and set specifications}">>theorems.tex
25734 + @printf '\\section{Membership, equality, and set specifications}'>>theorems.tex
25735 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/mem theorems.tex
25736 - @echo "\section{The empty and universal sets}">>theorems.tex
25737 + @printf '\\section{The empty and universal sets}'>>theorems.tex
25738 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/emuniv theorems.tex
25739 - @echo "\section{Set inclusion}">>theorems.tex
25740 + @printf '\\section{Set inclusion}'>>theorems.tex
25741 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/subs theorems.tex
25742 - @echo "\section{Intersection and union}">>theorems.tex
25743 + @printf '\\section{Intersection and union}'>>theorems.tex
25744 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/unin theorems.tex
25745 - @echo "\section{Set difference}">>theorems.tex
25746 + @printf '\\section{Set difference}'>>theorems.tex
25747 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/diff theorems.tex
25748 - @echo "\section{Disjoint sets}">>theorems.tex
25749 + @printf '\\section{Disjoint sets}'>>theorems.tex
25750 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/disj theorems.tex
25751 - @echo "\section{Insertion and deletion of an element}">>theorems.tex
25752 + @printf '\\section{Insertion and deletion of an element}'>>theorems.tex
25753 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/insdel theorems.tex
25754 - @echo "\section{The {\tt CHOICE} and {\tt REST} functions}">>theorems.tex
25755 + @printf '\\section{The {\\tt CHOICE} and {\\tt REST} functions}'>>theorems.tex
25756 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/chre theorems.tex
25757 - @echo "\section{Image of a function on a set}">>theorems.tex
25758 + @printf '\\section{Image of a function on a set}'>>theorems.tex
25759 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/image theorems.tex
25760 - @echo "\section{Mappings between sets}">>theorems.tex
25761 + @printf '\\section{Mappings between sets}'>>theorems.tex
25762 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/fun theorems.tex
25763 - @echo "\section{Singleton sets}">>theorems.tex
25764 + @printf '\\section{Singleton sets}'>>theorems.tex
25765 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/sing theorems.tex
25766 - @echo "\section{Finite and infinite sets}">>theorems.tex
25767 + @printf '\\section{Finite and infinite sets}'>>theorems.tex
25768 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/fin theorems.tex
25769 - @echo "\section{Cardinality of sets}">>theorems.tex
25770 + @printf '\\section{Cardinality of sets}'>>theorems.tex
25771 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/card theorems.tex
25772
25773 index:
25774 --- hol88-2.02.19940316.orig/Library/sets/Manual/entries.tex
25775 +++ hol88-2.02.19940316/Library/sets/Manual/entries.tex
25776 @@ -1,7 +1,4 @@
25777 -\chapter{ML Functions in the sets Library}
25778 -\label{entries}
25779 -\input{entries-intro}
25780 -\DOC{DELETE\_CONV}
25781 +\chapter{ML Functions in the sets Library}\label{entries}\input{entries-intro}\DOC{DELETE\_CONV}
25782
25783 \TYPE {\small\verb%DELETE_CONV : conv -> conv%}\egroup
25784
25785 @@ -204,6 +201,84 @@ for some {\small\verb%ri%}.
25786
25787 \ENDDOC
25788
25789 +\DOC{IN\_CONV}
25790 +
25791 +\TYPE {\small\verb%IN_CONV : conv -> conv%}\egroup
25792 +
25793 +\SYNOPSIS
25794 +Decision procedure for membership in finite sets.
25795 +
25796 +\DESCRIBE
25797 +The function {\small\verb%IN_CONV%} is a parameterized conversion for proving or disproving
25798 +membership assertions of the general form:
25799 +{\par\samepage\setseps\small
25800 +\begin{verbatim}
25801 + "t IN {t1,...,tn}"
25802 +\end{verbatim}
25803 +}
25804 +\noindent where {\small\verb%{t1,...,tn}%} is a set of type {\small\verb%(ty)set%} and {\small\verb%t%} is a value
25805 +of the base type {\small\verb%ty%}. The first argument to {\small\verb%IN_CONV%} is expected to be a
25806 +conversion that decides equality between values of the base type {\small\verb%ty%}. Given
25807 +an equation {\small\verb%"e1 = e2"%}, where {\small\verb%e1%} and {\small\verb%e2%} are terms of type {\small\verb%ty%}, this
25808 +conversion should return the theorem {\small\verb%|- (e1 = e2) = T%} or the theorem
25809 +{\small\verb%|- (e1 = e2) = F%}, as appropriate.
25810 +
25811 +Given such a conversion, the function {\small\verb%IN_CONV%} returns a conversion that
25812 +maps a term of the form {\small\verb%"t IN {t1,...,tn}"%} to the theorem
25813 +{\par\samepage\setseps\small
25814 +\begin{verbatim}
25815 + |- t IN {t1,...,tn} = T
25816 +\end{verbatim}
25817 +}
25818 +
25819 +\noindent if {\small\verb%t%} is alpha-equivalent to any {\small\verb%ti%}, or if the supplied conversion
25820 +proves {\small\verb%|- (t = ti) = T%} for any {\small\verb%ti%}. If the supplied conversion proves
25821 +{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}, then the result is the theorem
25822 +{\par\samepage\setseps\small
25823 +\begin{verbatim}
25824 + |- t IN {t1,...,tn} = F
25825 +\end{verbatim}
25826 +}
25827 +\noindent In all other cases, {\small\verb%IN_CONV%} will fail.
25828 +
25829 +\EXAMPLE
25830 +In the following example, the conversion {\small\verb%num_EQ_CONV%} is supplied as a
25831 +parameter and used to test equality of the candidate element {\small\verb%1%} with the
25832 +actual elements of the given set.
25833 +{\par\samepage\setseps\small
25834 +\begin{verbatim}
25835 + #IN_CONV num_EQ_CONV "2 IN {0,SUC 1,3}";;
25836 + |- 2 IN {0,SUC 1,3} = T
25837 +\end{verbatim}
25838 +}
25839 +\noindent The result is {\small\verb%T%} because {\small\verb%num_EQ_CONV%} is able to prove that {\small\verb%2%} is
25840 +equal to {\small\verb%SUC 1%}. An example of a negative result is:
25841 +{\par\samepage\setseps\small
25842 +\begin{verbatim}
25843 + #IN_CONV num_EQ_CONV "1 IN {0,2,3}";;
25844 + |- 1 IN {0,2,3} = F
25845 +\end{verbatim}
25846 +}
25847 +\noindent Finally the behaviour of the supplied conversion is irrelevant when
25848 +the value to be tested for membership is alpha-equivalent to an actual element:
25849 +{\par\samepage\setseps\small
25850 +\begin{verbatim}
25851 + #IN_CONV NO_CONV "1 IN {3,2,1}";;
25852 + |- 1 IN {3,2,1} = T
25853 +\end{verbatim}
25854 +}
25855 +\noindent The conversion {\small\verb%NO_CONV%} always fails, but {\small\verb%IN_CONV%} is nontheless
25856 +able in this case to prove the required result.
25857 +
25858 +\FAILURE
25859 +{\small\verb%IN_CONV conv%} fails if applied to a term that is not of the form {\small\verb%"t IN
25860 +{t1,...,tn}"%}. A call {\small\verb%IN_CONV conv "t IN {t1,...,tn}"%} fails unless the
25861 +term {\small\verb%t%} is alpha-equivalent to some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns
25862 +{\small\verb%|- (t = ti) = T%} for some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns
25863 +{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}.
25864 +
25865 +\ENDDOC
25866 +
25867 \DOC{INSERT\_CONV}
25868
25869 \TYPE {\small\verb%INSERT_CONV : conv -> conv%}\egroup
25870 @@ -290,84 +365,6 @@ DELETE_CONV.
25871
25872 \ENDDOC
25873
25874 -\DOC{IN\_CONV}
25875 -
25876 -\TYPE {\small\verb%IN_CONV : conv -> conv%}\egroup
25877 -
25878 -\SYNOPSIS
25879 -Decision procedure for membership in finite sets.
25880 -
25881 -\DESCRIBE
25882 -The function {\small\verb%IN_CONV%} is a parameterized conversion for proving or disproving
25883 -membership assertions of the general form:
25884 -{\par\samepage\setseps\small
25885 -\begin{verbatim}
25886 - "t IN {t1,...,tn}"
25887 -\end{verbatim}
25888 -}
25889 -\noindent where {\small\verb%{t1,...,tn}%} is a set of type {\small\verb%(ty)set%} and {\small\verb%t%} is a value
25890 -of the base type {\small\verb%ty%}. The first argument to {\small\verb%IN_CONV%} is expected to be a
25891 -conversion that decides equality between values of the base type {\small\verb%ty%}. Given
25892 -an equation {\small\verb%"e1 = e2"%}, where {\small\verb%e1%} and {\small\verb%e2%} are terms of type {\small\verb%ty%}, this
25893 -conversion should return the theorem {\small\verb%|- (e1 = e2) = T%} or the theorem
25894 -{\small\verb%|- (e1 = e2) = F%}, as appropriate.
25895 -
25896 -Given such a conversion, the function {\small\verb%IN_CONV%} returns a conversion that
25897 -maps a term of the form {\small\verb%"t IN {t1,...,tn}"%} to the theorem
25898 -{\par\samepage\setseps\small
25899 -\begin{verbatim}
25900 - |- t IN {t1,...,tn} = T
25901 -\end{verbatim}
25902 -}
25903 -
25904 -\noindent if {\small\verb%t%} is alpha-equivalent to any {\small\verb%ti%}, or if the supplied conversion
25905 -proves {\small\verb%|- (t = ti) = T%} for any {\small\verb%ti%}. If the supplied conversion proves
25906 -{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}, then the result is the theorem
25907 -{\par\samepage\setseps\small
25908 -\begin{verbatim}
25909 - |- t IN {t1,...,tn} = F
25910 -\end{verbatim}
25911 -}
25912 -\noindent In all other cases, {\small\verb%IN_CONV%} will fail.
25913 -
25914 -\EXAMPLE
25915 -In the following example, the conversion {\small\verb%num_EQ_CONV%} is supplied as a
25916 -parameter and used to test equality of the candidate element {\small\verb%1%} with the
25917 -actual elements of the given set.
25918 -{\par\samepage\setseps\small
25919 -\begin{verbatim}
25920 - #IN_CONV num_EQ_CONV "2 IN {0,SUC 1,3}";;
25921 - |- 2 IN {0,SUC 1,3} = T
25922 -\end{verbatim}
25923 -}
25924 -\noindent The result is {\small\verb%T%} because {\small\verb%num_EQ_CONV%} is able to prove that {\small\verb%2%} is
25925 -equal to {\small\verb%SUC 1%}. An example of a negative result is:
25926 -{\par\samepage\setseps\small
25927 -\begin{verbatim}
25928 - #IN_CONV num_EQ_CONV "1 IN {0,2,3}";;
25929 - |- 1 IN {0,2,3} = F
25930 -\end{verbatim}
25931 -}
25932 -\noindent Finally the behaviour of the supplied conversion is irrelevant when
25933 -the value to be tested for membership is alpha-equivalent to an actual element:
25934 -{\par\samepage\setseps\small
25935 -\begin{verbatim}
25936 - #IN_CONV NO_CONV "1 IN {3,2,1}";;
25937 - |- 1 IN {3,2,1} = T
25938 -\end{verbatim}
25939 -}
25940 -\noindent The conversion {\small\verb%NO_CONV%} always fails, but {\small\verb%IN_CONV%} is nontheless
25941 -able in this case to prove the required result.
25942 -
25943 -\FAILURE
25944 -{\small\verb%IN_CONV conv%} fails if applied to a term that is not of the form {\small\verb%"t IN
25945 -{t1,...,tn}"%}. A call {\small\verb%IN_CONV conv "t IN {t1,...,tn}"%} fails unless the
25946 -term {\small\verb%t%} is alpha-equivalent to some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns
25947 -{\small\verb%|- (t = ti) = T%} for some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns
25948 -{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}.
25949 -
25950 -\ENDDOC
25951 -
25952 \DOC{SET\_INDUCT\_TAC}
25953
25954 \TYPE {\small\verb%SET_INDUCT_TAC : tactic%}\egroup
25955 --- hol88-2.02.19940316.orig/Library/unwind/Manual/Makefile
25956 +++ hol88-2.02.19940316/Library/unwind/Manual/Makefile
25957 @@ -26,16 +26,16 @@ default:
25958 # ---------------------------------------------------------------------
25959 clean:
25960 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
25961 - @echo "\begin{theindex}" > index.tex
25962 - @echo "\mbox{}" >> index.tex
25963 - @echo "\end{theindex}" >> index.tex
25964 + @printf '\\begin{theindex}' > index.tex
25965 + @printf '\\mbox{}' >> index.tex
25966 + @printf '\\end{theindex}' >> index.tex
25967
25968 tex: ids
25969 @echo "TeX files made"
25970
25971 ids:
25972 - @echo "\chapter{ML Functions in the unwind Library}">entries.tex
25973 - @echo "\input{entries-intro}" >> entries.tex
25974 + @printf '\\chapter{ML Functions in the unwind Library}'>entries.tex
25975 + @printf '\\input{entries-intro}' >> entries.tex
25976 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
25977
25978 index:
25979 --- hol88-2.02.19940316.orig/Library/unwind/Manual/entries.tex
25980 +++ hol88-2.02.19940316/Library/unwind/Manual/entries.tex
25981 @@ -1,6 +1,4 @@
25982 -\chapter{ML Functions in the unwind Library}
25983 -\input{entries-intro}
25984 -\DOC{CONJ\_FORALL\_CONV}
25985 +\chapter{ML Functions in the unwind Library}\input{entries-intro}\DOC{CONJ\_FORALL\_CONV}
25986
25987 \TYPE {\small\verb%CONJ_FORALL_CONV : conv%}\egroup
25988
25989 --- hol88-2.02.19940316.orig/Library/abs_theory/Manual/Makefile
25990 +++ hol88-2.02.19940316/Library/abs_theory/Manual/Makefile
25991 @@ -15,13 +15,13 @@ all:; make clean; make ids; make abs_the
25992
25993 clean:; \
25994 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg entries.tex; \
25995 - echo "\begin{theindex}" >index.tex; \
25996 - echo "\mbox{}" >>index.tex; \
25997 - echo "\end{theindex}" >>index.tex
25998 + printf '\\begin{theindex}' >index.tex; \
25999 + printf '\\mbox{}' >>index.tex; \
26000 + printf '\\end{theindex}' >>index.tex
26001
26002 ids:; \
26003 - echo "\chapter{ML Functions in the {\tt abs\_theory} Library}" >entries.tex; \
26004 - echo "\input{entries-intro}" >>entries.tex; \
26005 + printf '\\chapter{ML Functions in the {\\tt abs\\_theory} Library}' >entries.tex; \
26006 + printf '\\input{entries-intro}' >>entries.tex; \
26007 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
26008
26009 index:; \
26010 --- hol88-2.02.19940316.orig/Library/arith/Manual/Makefile
26011 +++ hol88-2.02.19940316/Library/arith/Manual/Makefile
26012 @@ -26,16 +26,16 @@ default:
26013 # ---------------------------------------------------------------------
26014 clean:
26015 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
26016 - @echo "\begin{theindex}" > index.tex
26017 - @echo "\mbox{}" >> index.tex
26018 - @echo "\end{theindex}" >> index.tex
26019 + @printf '\\begin{theindex}' > index.tex
26020 + @printf '\\mbox{}' >> index.tex
26021 + @printf '\\end{theindex}' >> index.tex
26022
26023 tex: ids
26024 @echo "TeX files made"
26025
26026 ids:
26027 - @echo "\chapter{ML Functions in the arith Library}">entries.tex
26028 - @echo "\input{entries-intro}" >> entries.tex
26029 + @printf '\\chapter{ML Functions in the arith Library}'>entries.tex
26030 + @printf '\\input{entries-intro}' >> entries.tex
26031 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
26032
26033 index:
26034 --- hol88-2.02.19940316.orig/Library/arith/Manual/entries.tex
26035 +++ hol88-2.02.19940316/Library/arith/Manual/entries.tex
26036 @@ -1,6 +1,4 @@
26037 -\chapter{ML Functions in the arith Library}
26038 -\input{entries-intro}
26039 -\DOC{ARITH\_CONV}
26040 +\chapter{ML Functions in the arith Library}\input{entries-intro}\DOC{ARITH\_CONV}
26041
26042 \TYPE {\small\verb%ARITH_CONV : conv%}\egroup
26043
26044 --- hol88-2.02.19940316.orig/Library/res_quan/Manual/theorems.tex
26045 +++ hol88-2.02.19940316/Library/res_quan/Manual/theorems.tex
26046 @@ -1,6 +1,4 @@
26047 -\chapter{Pre-proved Theorems}
26048 -\input{theorems-intro}
26049 -\THEOREM DISJ\_RESQ\_EXISTS\_DIST res\_quan
26050 +\chapter{Pre-proved Theorems}\input{theorems-intro}\THEOREM DISJ\_RESQ\_EXISTS\_DIST res\_quan
26051 |- !P Q R.
26052 (?i :: \i. P i \/ Q i. R i) = (?i :: P. R i) \/ (?i :: Q. R i)
26053 \ENDTHEOREM
26054 --- hol88-2.02.19940316.orig/Library/res_quan/Manual/Makefile
26055 +++ hol88-2.02.19940316/Library/res_quan/Manual/Makefile
26056 @@ -27,22 +27,22 @@ default:
26057 # ---------------------------------------------------------------------
26058 clean:
26059 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
26060 - @echo "\begin{theindex}" > index.tex
26061 - @echo "\mbox{}" >> index.tex
26062 - @echo "\end{theindex}" >> index.tex
26063 + @printf '\\begin{theindex}' > index.tex
26064 + @printf '\\mbox{}' >> index.tex
26065 + @printf '\\end{theindex}' >> index.tex
26066
26067 tex: theorems functions
26068 @echo "TeX files made"
26069
26070 functions:
26071 - @echo "\chapter{ML Functions in the {\tt res\_quan} Library}">entries.tex
26072 - @echo "\label{entries}">>entries.tex
26073 - @echo "\input{entries-intro}" >> entries.tex
26074 + @printf '\\chapter{ML Functions in the {\\tt res\\_quan} Library}'>entries.tex
26075 + @printf '\\label{entries}'>>entries.tex
26076 + @printf '\\input{entries-intro}' >> entries.tex
26077 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
26078
26079 theorems:
26080 - @echo "\chapter{Pre-proved Theorems}" > theorems.tex
26081 - @echo "\input{theorems-intro}" >> theorems.tex
26082 + @printf '\\chapter{Pre-proved Theorems}' > theorems.tex
26083 + @printf '\\input{theorems-intro}' >> theorems.tex
26084 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms theorems.tex
26085
26086 index:
26087 --- hol88-2.02.19940316.orig/Library/res_quan/Manual/entries.tex
26088 +++ hol88-2.02.19940316/Library/res_quan/Manual/entries.tex
26089 @@ -1,6 +1,142 @@
26090 -\chapter{ML Functions in the {\tt res\_quan} Library}
26091 -\label{entries}
26092 -\input{entries-intro}
26093 +\chapter{ML Functions in the {\tt res\_quan} Library}\label{entries}\input{entries-intro}\DOC{COND\_REWR\_CANON}
26094 +
26095 +\TYPE {\small\verb%COND_REWR_CANON : thm -> thm%}\egroup
26096 +
26097 +\SYNOPSIS
26098 +Transform a theorem into a form accepted by {\small\verb%COND_REWR_TAC%}.
26099 +
26100 +\DESCRIBE
26101 +{\small\verb%COND_REWR_CANON%} transforms a theorem into a form accepted by {\small\verb%COND_REWR_TAC%}.
26102 +The input theorem should be an implication of the following form
26103 +{\par\samepage\setseps\small
26104 +\begin{verbatim}
26105 + !x1 ... xn. P1[xi] ==> ... ==> !y1 ... ym. Pr[xi,yi] ==>
26106 + (!z1 ... zk. u[xi,yi,zi] = v[xi,yi,zi])
26107 +\end{verbatim}
26108 +}
26109 +\noindent where each antecedent {\small\verb%Pi%} itself may be a conjunction or
26110 +disjunction. The output theorem will have all universal quantifications
26111 +moved to the outer most level with possible renaming to prevent
26112 +variable capture, and have all antecedents which are a conjunction
26113 +transformed to implications. The output theorem will be in the
26114 +following form
26115 +{\par\samepage\setseps\small
26116 +\begin{verbatim}
26117 + !x1 ... xn y1 ... ym z1 ... zk.
26118 + P11[xi] ==> ... ==> P1p[xi] ==> ... ==>
26119 + Pr1[xi,yi] ==> ... ==> Prq[x1,yi] ==> (u[xi,yi,zi] = v[xi,yi,zi])
26120 +\end{verbatim}
26121 +}
26122 +
26123 +\FAILURE
26124 +This function fails if the input theorem is not in the correct form.
26125 +
26126 +\EXAMPLE
26127 +{\small\verb%COND_REWR_CANON%} transforms the built-in theorem {\small\verb%CANCL_SUB%} into the
26128 +form for conditional rewriting:
26129 +{\par\samepage\setseps\small
26130 +\begin{verbatim}
26131 + #COND_REWR_CANON CANCEL_SUB;;
26132 + Theorem CANCEL_SUB autoloading from theory `arithmetic` ...
26133 + CANCEL_SUB = |- !p n m. p <= n /\ p <= m ==> ((n - p = m - p) = (n = m))
26134 +
26135 + |- !p n m. p <= n ==> p <= m ==> ((n - p = m - p) = (n = m))
26136 +\end{verbatim}
26137 +}
26138 +
26139 +\SEEALSO
26140 +COND_REWRITE1_TAC, COND_REWR_TAC, COND_REWRITE1_CONV, COND_REWR_CONV,
26141 +search_top_down.
26142 +
26143 +\ENDDOC
26144 +
26145 +\DOC{COND\_REWR\_CONV}
26146 +
26147 +{\small
26148 +\begin{verbatim}
26149 +COND_REWR_CONV : ((term -> term ->
26150 + ((term # term) list # (type # type) list) list) -> thm -> conv)
26151 +\end{verbatim}
26152 +}\egroup
26153 +
26154 +\SYNOPSIS
26155 +A lower level conversion implementing simple conditional rewriting.
26156 +
26157 +\DESCRIBE
26158 +{\small\verb%COND_REWR_CONV%} is one of the basic building blocks for the
26159 +implementation of the simple conditional rewriting conversions in the
26160 +HOL system. In particular, the conditional term replacement or
26161 +rewriting done by all the conditional
26162 +rewriting conversions in this library is ultimately done by applications of
26163 +{\small\verb%COND_REWR_CONV%}. The description given here for {\small\verb%COND_REWR_CONV%} may
26164 +therefore be taken as a specification of the atomic action of
26165 +replacing equals by equals in a term under certain conditions that
26166 +are used in all these higher level conditional rewriting conversions.
26167 +
26168 +The first argument to {\small\verb%COND_REWR_CONV%} is expected to be a function
26169 +which returns a list of matches. Each of these matches is in the form
26170 +of the value returned by the built-in function {\small\verb%match%}. It is used to
26171 +search the input term for instances which may be rewritten.
26172 +
26173 +The second argument to {\small\verb%COND_REWR_CONV%} is expected to be an
26174 +implicative theorem in the following form:
26175 +{\par\samepage\setseps\small
26176 +\begin{verbatim}
26177 + A |- !x1 ... xn. P1 ==> ... Pm ==> (Q[x1,...,xn] = R[x1,...,xn])
26178 +\end{verbatim}
26179 +}
26180 +\noindent where {\small\verb%x1%}, ..., {\small\verb%xn%} are all the variables that occur free in the
26181 +left hand side of the conclusion of the theorem but do not occur free in the
26182 +assumptions.
26183 +
26184 +The last argument to {\small\verb%COND_REWR_CONV%} is the term to be rewritten.
26185 +
26186 +If {\small\verb%fn%} is a function and {\small\verb%th%} is an implicative theorem of the kind
26187 +shown above, then {\small\verb%COND_REWR_CONV fn th%} will be a conversion.
26188 +When applying to a term {\small\verb%tm%}, it will return a theorem
26189 +{\par\samepage\setseps\small
26190 +\begin{verbatim}
26191 + P1', ..., Pm' |- tm = tm[R'/Q']
26192 +\end{verbatim}
26193 +}
26194 +\noindent if evaluating {\small\verb%fn Q[x1,...,xn] tm%} returns a
26195 +non-empty list of matches.
26196 +The assumptions of the resulting theorem are instances of the
26197 +antecedents of the input theorem {\small\verb%th%}. The right hand side of the
26198 +equation is obtained by rewriting the input term {\small\verb%tm%} with instances of
26199 +the conclusion of the input theorem.
26200 +
26201 +\FAILURE
26202 +{\small\verb%COND_REWR_CONV fn th%} fails if {\small\verb%th%} is not an implication of the form
26203 +described above. If {\small\verb%th%} is such an equation, but the function {\small\verb%fn%}
26204 +returns a null list of matches, or the function {\small\verb%fn%} returns a
26205 +non-empty list of matches, but the term or type instantiation fails.
26206 +
26207 +\EXAMPLE
26208 +The following example illustrates a straightforward use of {\small\verb%COND_REWR_CONV%}.
26209 +We use the built-in theorem {\small\verb%LESS_MOD%} as the input theorem, and the function
26210 +{\small\verb%search_top_down%} as the search function.
26211 +{\par\samepage\setseps\small
26212 +\begin{verbatim}
26213 + #LESS_MOD;;
26214 + Theorem LESS_MOD autoloading from theory `arithmetic` ...
26215 + LESS_MOD = |- !n k. k < n ==> (k MOD n = k)
26216 +
26217 + |- !n k. k < n ==> (k MOD n = k)
26218 +
26219 + #search_top_down;;
26220 + - : (term -> term -> ((term # term) list # (type # type) list) list)
26221 +
26222 + #COND_REWR_CONV search_top_down LESS_MOD "2 MOD 3";;
26223 + 2 < 3 |- 2 MOD 3 = 2
26224 +\end{verbatim}
26225 +}
26226 +
26227 +\SEEALSO
26228 +COND_REWR_TAC, COND_REWRITE1_TAC, COND_REWRITE1_CONV, COND_REWR_CANON,
26229 +search_top_down.
26230 +
26231 +\ENDDOC
26232 \DOC{COND\_REWRITE1\_CONV}
26233
26234 \TYPE {\small\verb%COND_REWRITE1_CONV : (thm list -> thm -> conv)%}\egroup
26235 @@ -147,145 +283,6 @@ COND_REWR_CANON, search_top_down.
26236
26237 \ENDDOC
26238
26239 -\DOC{COND\_REWR\_CANON}
26240 -
26241 -\TYPE {\small\verb%COND_REWR_CANON : thm -> thm%}\egroup
26242 -
26243 -\SYNOPSIS
26244 -Transform a theorem into a form accepted by {\small\verb%COND_REWR_TAC%}.
26245 -
26246 -\DESCRIBE
26247 -{\small\verb%COND_REWR_CANON%} transforms a theorem into a form accepted by {\small\verb%COND_REWR_TAC%}.
26248 -The input theorem should be an implication of the following form
26249 -{\par\samepage\setseps\small
26250 -\begin{verbatim}
26251 - !x1 ... xn. P1[xi] ==> ... ==> !y1 ... ym. Pr[xi,yi] ==>
26252 - (!z1 ... zk. u[xi,yi,zi] = v[xi,yi,zi])
26253 -\end{verbatim}
26254 -}
26255 -\noindent where each antecedent {\small\verb%Pi%} itself may be a conjunction or
26256 -disjunction. The output theorem will have all universal quantifications
26257 -moved to the outer most level with possible renaming to prevent
26258 -variable capture, and have all antecedents which are a conjunction
26259 -transformed to implications. The output theorem will be in the
26260 -following form
26261 -{\par\samepage\setseps\small
26262 -\begin{verbatim}
26263 - !x1 ... xn y1 ... ym z1 ... zk.
26264 - P11[xi] ==> ... ==> P1p[xi] ==> ... ==>
26265 - Pr1[xi,yi] ==> ... ==> Prq[x1,yi] ==> (u[xi,yi,zi] = v[xi,yi,zi])
26266 -\end{verbatim}
26267 -}
26268 -
26269 -\FAILURE
26270 -This function fails if the input theorem is not in the correct form.
26271 -
26272 -\EXAMPLE
26273 -{\small\verb%COND_REWR_CANON%} transforms the built-in theorem {\small\verb%CANCL_SUB%} into the
26274 -form for conditional rewriting:
26275 -{\par\samepage\setseps\small
26276 -\begin{verbatim}
26277 - #COND_REWR_CANON CANCEL_SUB;;
26278 - Theorem CANCEL_SUB autoloading from theory `arithmetic` ...
26279 - CANCEL_SUB = |- !p n m. p <= n /\ p <= m ==> ((n - p = m - p) = (n = m))
26280 -
26281 - |- !p n m. p <= n ==> p <= m ==> ((n - p = m - p) = (n = m))
26282 -\end{verbatim}
26283 -}
26284 -
26285 -\SEEALSO
26286 -COND_REWRITE1_TAC, COND_REWR_TAC, COND_REWRITE1_CONV, COND_REWR_CONV,
26287 -search_top_down.
26288 -
26289 -\ENDDOC
26290 -
26291 -\DOC{COND\_REWR\_CONV}
26292 -
26293 -{\small
26294 -\begin{verbatim}
26295 -COND_REWR_CONV : ((term -> term ->
26296 - ((term # term) list # (type # type) list) list) -> thm -> conv)
26297 -\end{verbatim}
26298 -}\egroup
26299 -
26300 -\SYNOPSIS
26301 -A lower level conversion implementing simple conditional rewriting.
26302 -
26303 -\DESCRIBE
26304 -{\small\verb%COND_REWR_CONV%} is one of the basic building blocks for the
26305 -implementation of the simple conditional rewriting conversions in the
26306 -HOL system. In particular, the conditional term replacement or
26307 -rewriting done by all the conditional
26308 -rewriting conversions in this library is ultimately done by applications of
26309 -{\small\verb%COND_REWR_CONV%}. The description given here for {\small\verb%COND_REWR_CONV%} may
26310 -therefore be taken as a specification of the atomic action of
26311 -replacing equals by equals in a term under certain conditions that
26312 -are used in all these higher level conditional rewriting conversions.
26313 -
26314 -The first argument to {\small\verb%COND_REWR_CONV%} is expected to be a function
26315 -which returns a list of matches. Each of these matches is in the form
26316 -of the value returned by the built-in function {\small\verb%match%}. It is used to
26317 -search the input term for instances which may be rewritten.
26318 -
26319 -The second argument to {\small\verb%COND_REWR_CONV%} is expected to be an
26320 -implicative theorem in the following form:
26321 -{\par\samepage\setseps\small
26322 -\begin{verbatim}
26323 - A |- !x1 ... xn. P1 ==> ... Pm ==> (Q[x1,...,xn] = R[x1,...,xn])
26324 -\end{verbatim}
26325 -}
26326 -\noindent where {\small\verb%x1%}, ..., {\small\verb%xn%} are all the variables that occur free in the
26327 -left hand side of the conclusion of the theorem but do not occur free in the
26328 -assumptions.
26329 -
26330 -The last argument to {\small\verb%COND_REWR_CONV%} is the term to be rewritten.
26331 -
26332 -If {\small\verb%fn%} is a function and {\small\verb%th%} is an implicative theorem of the kind
26333 -shown above, then {\small\verb%COND_REWR_CONV fn th%} will be a conversion.
26334 -When applying to a term {\small\verb%tm%}, it will return a theorem
26335 -{\par\samepage\setseps\small
26336 -\begin{verbatim}
26337 - P1', ..., Pm' |- tm = tm[R'/Q']
26338 -\end{verbatim}
26339 -}
26340 -\noindent if evaluating {\small\verb%fn Q[x1,...,xn] tm%} returns a
26341 -non-empty list of matches.
26342 -The assumptions of the resulting theorem are instances of the
26343 -antecedents of the input theorem {\small\verb%th%}. The right hand side of the
26344 -equation is obtained by rewriting the input term {\small\verb%tm%} with instances of
26345 -the conclusion of the input theorem.
26346 -
26347 -\FAILURE
26348 -{\small\verb%COND_REWR_CONV fn th%} fails if {\small\verb%th%} is not an implication of the form
26349 -described above. If {\small\verb%th%} is such an equation, but the function {\small\verb%fn%}
26350 -returns a null list of matches, or the function {\small\verb%fn%} returns a
26351 -non-empty list of matches, but the term or type instantiation fails.
26352 -
26353 -\EXAMPLE
26354 -The following example illustrates a straightforward use of {\small\verb%COND_REWR_CONV%}.
26355 -We use the built-in theorem {\small\verb%LESS_MOD%} as the input theorem, and the function
26356 -{\small\verb%search_top_down%} as the search function.
26357 -{\par\samepage\setseps\small
26358 -\begin{verbatim}
26359 - #LESS_MOD;;
26360 - Theorem LESS_MOD autoloading from theory `arithmetic` ...
26361 - LESS_MOD = |- !n k. k < n ==> (k MOD n = k)
26362 -
26363 - |- !n k. k < n ==> (k MOD n = k)
26364 -
26365 - #search_top_down;;
26366 - - : (term -> term -> ((term # term) list # (type # type) list) list)
26367 -
26368 - #COND_REWR_CONV search_top_down LESS_MOD "2 MOD 3";;
26369 - 2 < 3 |- 2 MOD 3 = 2
26370 -\end{verbatim}
26371 -}
26372 -
26373 -\SEEALSO
26374 -COND_REWR_TAC, COND_REWRITE1_TAC, COND_REWRITE1_CONV, COND_REWR_CANON,
26375 -search_top_down.
26376 -
26377 -\ENDDOC
26378 \DOC{COND\_REWR\_TAC}
26379
26380 {\small
26381 @@ -553,6 +550,36 @@ choice quantification.
26382 mk_resq_select, is_resq_select, strip_resq_select.
26383
26384 \ENDDOC
26385 +\DOC{GQSPEC\_ALL}
26386 +
26387 +\TYPE {\small\verb%GQSPEC_ALL : (thm -> thm)%}\egroup
26388 +
26389 +\SYNOPSIS
26390 +Specializes the conclusion of a theorem with its own quantified variables.
26391 +
26392 +\DESCRIBE
26393 +When applied to a theorem whose conclusion has zero or more
26394 +ordinary or restricted universal quantifications,
26395 +the inference rule {\small\verb%GQSPEC_ALL%} returns a theorem which is the result
26396 +of specializing the quantified variables with its own variables. If this
26397 +will cause name clashes, a variant of the variable is used instead.
26398 +Normally {\small\verb%xi'%} is just {\small\verb%xi%}, in which case {\small\verb%GQSPEC_ALL%} simply removes
26399 +all universal quantifiers.
26400 +{\par\samepage\setseps\small
26401 +\begin{verbatim}
26402 + A |- !x1::P1. ...!xk. ... !xn::Pn. t
26403 + ------------------------------------------------------ GQSPEC_ALL
26404 + A,P1 x1,...,Pn xn |- t[x1'/x1]...[xk'/xk]...[xn'/xn]
26405 +\end{verbatim}
26406 +}
26407 +\FAILURE
26408 +Never fails.
26409 +
26410 +\SEEALSO
26411 +GQSPEC, GQSPECL, SPEC, SPECL, SPEC_ALL, RESQ_GEN, RESQ_GENL,
26412 +RESQ_GEN_ALL, RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPECL, RESQ_SPEC_ALL.
26413 +
26414 +\ENDDOC
26415 \DOC{GQSPECL}
26416
26417 \TYPE {\small\verb%GQSPECL : (term list -> thm -> thm)%}\egroup
26418 @@ -588,36 +615,6 @@ GQSPEC, GQSPEC_ALL, SPECL, GENL, RESQ_GE
26419 RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPECL, RESQ_SPEC_ALL.
26420
26421 \ENDDOC
26422 -\DOC{GQSPEC\_ALL}
26423 -
26424 -\TYPE {\small\verb%GQSPEC_ALL : (thm -> thm)%}\egroup
26425 -
26426 -\SYNOPSIS
26427 -Specializes the conclusion of a theorem with its own quantified variables.
26428 -
26429 -\DESCRIBE
26430 -When applied to a theorem whose conclusion has zero or more
26431 -ordinary or restricted universal quantifications,
26432 -the inference rule {\small\verb%GQSPEC_ALL%} returns a theorem which is the result
26433 -of specializing the quantified variables with its own variables. If this
26434 -will cause name clashes, a variant of the variable is used instead.
26435 -Normally {\small\verb%xi'%} is just {\small\verb%xi%}, in which case {\small\verb%GQSPEC_ALL%} simply removes
26436 -all universal quantifiers.
26437 -{\par\samepage\setseps\small
26438 -\begin{verbatim}
26439 - A |- !x1::P1. ...!xk. ... !xn::Pn. t
26440 - ------------------------------------------------------ GQSPEC_ALL
26441 - A,P1 x1,...,Pn xn |- t[x1'/x1]...[xk'/xk]...[xn'/xn]
26442 -\end{verbatim}
26443 -}
26444 -\FAILURE
26445 -Never fails.
26446 -
26447 -\SEEALSO
26448 -GQSPEC, GQSPECL, SPEC, SPECL, SPEC_ALL, RESQ_GEN, RESQ_GENL,
26449 -RESQ_GEN_ALL, RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPECL, RESQ_SPEC_ALL.
26450 -
26451 -\ENDDOC
26452 \DOC{IMP\_RESQ\_FORALL\_CONV}
26453
26454 \TYPE {\small\verb%IMP_RESQ_FORALL_CONV : conv%}\egroup
26455 @@ -1216,6 +1213,31 @@ Fails if applied to a term not of the co
26456 RESQ_FORALL_CONV.
26457
26458 \ENDDOC
26459 +\DOC{RESQ\_GEN\_ALL}
26460 +
26461 +\TYPE {\small\verb%RESQ_GEN_ALL : (thm -> thm)%}\egroup
26462 +
26463 +\SYNOPSIS
26464 +Generalizes the conclusion of a theorem over its own assumptions.
26465 +
26466 +\DESCRIBE
26467 +When applied to a theorem {\small\verb%A |- t%}, the inference rule {\small\verb%RESQ_GEN_ALL%} returns
26468 +the theorem {\small\verb%A' |- !x1::P1. ...!xn::Pn. t%}, where the {\small\verb%Pi xi%} are in the
26469 +assumptions.
26470 +{\par\samepage\setseps\small
26471 +\begin{verbatim}
26472 + A |- t
26473 + ------------------------------------------------ RESQ_GEN_ALL
26474 + A - (P1 x1,...,Pn xn) |- !x1::P1. ... !xn::Pn. t
26475 +\end{verbatim}
26476 +}
26477 +\FAILURE
26478 +Never fails.
26479 +
26480 +\SEEALSO
26481 +RESQ_GEN, RESQ_GENL, GEN_ALL, RESQ_SPEC, RESQ_SPECL, RESQ_SPEC_ALL.
26482 +
26483 +\ENDDOC
26484 \DOC{RESQ\_GEN}
26485
26486 \TYPE {\small\verb%RESQ_GEN : ((term # term) -> thm -> thm)%}\egroup
26487 @@ -1274,31 +1296,6 @@ free in the assumption list except in {\
26488 RESQ_GEN, RESQ_GEN_ALL, RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPECL, RESQ_SPEC_ALL.
26489
26490 \ENDDOC
26491 -\DOC{RESQ\_GEN\_ALL}
26492 -
26493 -\TYPE {\small\verb%RESQ_GEN_ALL : (thm -> thm)%}\egroup
26494 -
26495 -\SYNOPSIS
26496 -Generalizes the conclusion of a theorem over its own assumptions.
26497 -
26498 -\DESCRIBE
26499 -When applied to a theorem {\small\verb%A |- t%}, the inference rule {\small\verb%RESQ_GEN_ALL%} returns
26500 -the theorem {\small\verb%A' |- !x1::P1. ...!xn::Pn. t%}, where the {\small\verb%Pi xi%} are in the
26501 -assumptions.
26502 -{\par\samepage\setseps\small
26503 -\begin{verbatim}
26504 - A |- t
26505 - ------------------------------------------------ RESQ_GEN_ALL
26506 - A - (P1 x1,...,Pn xn) |- !x1::P1. ... !xn::Pn. t
26507 -\end{verbatim}
26508 -}
26509 -\FAILURE
26510 -Never fails.
26511 -
26512 -\SEEALSO
26513 -RESQ_GEN, RESQ_GENL, GEN_ALL, RESQ_SPEC, RESQ_SPECL, RESQ_SPEC_ALL.
26514 -
26515 -\ENDDOC
26516 \DOC{RESQ\_GEN\_TAC}
26517
26518 \TYPE {\small\verb%RESQ_GEN_TAC : tactic%}\egroup
26519 @@ -1571,6 +1568,40 @@ RESQ_IMP_RES_TAC, RESQ_IMP_RES_THEN, RES
26520 IMP_RES_THEN, IMP_RES_TAC, MATCH_MP, RES_CANON, RES_TAC, RES_THEN.
26521
26522 \ENDDOC
26523 +\DOC{RESQ\_REWR\_CANON}
26524 +
26525 +\TYPE {\small\verb%RESQ_REWR_CANON : thm -> thm%}\egroup
26526 +
26527 +\SYNOPSIS
26528 +Transform a theorem into a form accepted for rewriting.
26529 +
26530 +\DESCRIBE
26531 +{\small\verb%RESQ_REWR_CANON%} transforms a theorem into a form accepted by {\small\verb%COND_REWR_TAC%}.
26532 +The input theorem should be headed by a series of restricted universal
26533 +quantifications in the following form
26534 +{\par\samepage\setseps\small
26535 +\begin{verbatim}
26536 + !x1::P1. ... !xn::Pn. u[xi] = v[xi])
26537 +\end{verbatim}
26538 +}
26539 +\noindent Other variables occurring in {\small\verb%u%} and {\small\verb%v%} may be universally quantified.
26540 +The output theorem will have all ordinary universal quantifications
26541 +moved to the outer most level with possible renaming to prevent
26542 +variable capture, and have all restricted universal quantifications
26543 +converted to implications. The output theorem will be in the
26544 +form accepted by {\small\verb%COND_REWR_TAC%}.
26545 +
26546 +\FAILURE
26547 +This function fails is the input theorem is not in the correct form.
26548 +
26549 +
26550 +\SEEALSO
26551 +RESQ_REWRITE1_TAC, RESQ_REWRITE1_CONV,
26552 +COND_REWR_CANON, COND_REWR_TAC, COND_REWR_CONV,.
26553 +
26554 +
26555 +\ENDDOC
26556 +
26557 \DOC{RESQ\_REWRITE1\_CONV}
26558
26559 \TYPE {\small\verb%RESQ_REWRITE1_CONV : thm list -> thm -> conv%}\egroup
26560 @@ -1656,40 +1687,38 @@ COND_REWRITE1_CONV, COND_REWR_CONV, COND
26561
26562 \ENDDOC
26563
26564 -\DOC{RESQ\_REWR\_CANON}
26565 +\DOC{RESQ\_SPEC\_ALL}
26566
26567 -\TYPE {\small\verb%RESQ_REWR_CANON : thm -> thm%}\egroup
26568 +\TYPE {\small\verb%RESQ_SPEC_ALL : (thm -> thm)%}\egroup
26569
26570 \SYNOPSIS
26571 -Transform a theorem into a form accepted for rewriting.
26572 +Specializes the conclusion of a theorem with its own restricted
26573 +quantified variables.
26574
26575 \DESCRIBE
26576 -{\small\verb%RESQ_REWR_CANON%} transforms a theorem into a form accepted by {\small\verb%COND_REWR_TAC%}.
26577 -The input theorem should be headed by a series of restricted universal
26578 -quantifications in the following form
26579 +When applied to a theorem {\small\verb%A |- !x1::P1. ...!xn::Pn. t%},
26580 +the inference rule {\small\verb%RESQ_SPEC_ALL%}
26581 +returns the theorem {\small\verb%A,P1 x1',...,Pn xn' |- t[x1'/x1]...[xn'/xn]%}
26582 + where the {\small\verb%xi'%} are distinct
26583 +variants of the corresponding {\small\verb%xi%}, chosen to avoid clashes with any variables
26584 +free in the assumption list and with the names of constants. Normally {\small\verb%xi'%} is
26585 +just {\small\verb%xi%}, in which case {\small\verb%RESQ_SPEC_ALL%} simply removes all restricted
26586 + universal quantifiers.
26587 {\par\samepage\setseps\small
26588 \begin{verbatim}
26589 - !x1::P1. ... !xn::Pn. u[xi] = v[xi])
26590 + A |- !x1::P1. ... !xn::Pn. t
26591 + ------------------------------------------- RESQ_SPEC_ALL
26592 + A,P1 x1,...,Pn xn |- t[x1'/x1]...[xn'/xn]
26593 \end{verbatim}
26594 }
26595 -\noindent Other variables occurring in {\small\verb%u%} and {\small\verb%v%} may be universally quantified.
26596 -The output theorem will have all ordinary universal quantifications
26597 -moved to the outer most level with possible renaming to prevent
26598 -variable capture, and have all restricted universal quantifications
26599 -converted to implications. The output theorem will be in the
26600 -form accepted by {\small\verb%COND_REWR_TAC%}.
26601
26602 \FAILURE
26603 -This function fails is the input theorem is not in the correct form.
26604 -
26605 +Never fails.
26606
26607 \SEEALSO
26608 -RESQ_REWRITE1_TAC, RESQ_REWRITE1_CONV,
26609 -COND_REWR_CANON, COND_REWR_TAC, COND_REWR_CONV,.
26610 -
26611 +RESQ_GEN, RESQ_GENL, RESQ_GEN_ALL, RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPECL.
26612
26613 \ENDDOC
26614 -
26615 \DOC{RESQ\_SPEC}
26616
26617 \TYPE {\small\verb%RESQ_SPEC : (term -> thm -> thm)%}\egroup
26618 @@ -1769,38 +1798,6 @@ restricted universally quantified variab
26619 RESQ_GEN, RESQ_GENL, RESQ_GEN_ALL, RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPEC_ALL.
26620
26621 \ENDDOC
26622 -\DOC{RESQ\_SPEC\_ALL}
26623 -
26624 -\TYPE {\small\verb%RESQ_SPEC_ALL : (thm -> thm)%}\egroup
26625 -
26626 -\SYNOPSIS
26627 -Specializes the conclusion of a theorem with its own restricted
26628 -quantified variables.
26629 -
26630 -\DESCRIBE
26631 -When applied to a theorem {\small\verb%A |- !x1::P1. ...!xn::Pn. t%},
26632 -the inference rule {\small\verb%RESQ_SPEC_ALL%}
26633 -returns the theorem {\small\verb%A,P1 x1',...,Pn xn' |- t[x1'/x1]...[xn'/xn]%}
26634 - where the {\small\verb%xi'%} are distinct
26635 -variants of the corresponding {\small\verb%xi%}, chosen to avoid clashes with any variables
26636 -free in the assumption list and with the names of constants. Normally {\small\verb%xi'%} is
26637 -just {\small\verb%xi%}, in which case {\small\verb%RESQ_SPEC_ALL%} simply removes all restricted
26638 - universal quantifiers.
26639 -{\par\samepage\setseps\small
26640 -\begin{verbatim}
26641 - A |- !x1::P1. ... !xn::Pn. t
26642 - ------------------------------------------- RESQ_SPEC_ALL
26643 - A,P1 x1,...,Pn xn |- t[x1'/x1]...[xn'/xn]
26644 -\end{verbatim}
26645 -}
26646 -
26647 -\FAILURE
26648 -Never fails.
26649 -
26650 -\SEEALSO
26651 -RESQ_GEN, RESQ_GENL, RESQ_GEN_ALL, RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPECL.
26652 -
26653 -\ENDDOC
26654 \DOC{search\_top\_down}
26655
26656 {\small
26657 --- hol88-2.02.19940316.orig/Library/more_arithmetic/Manual/theorems.tex
26658 +++ hol88-2.02.19940316/Library/more_arithmetic/Manual/theorems.tex
26659 @@ -1,7 +1,4 @@
26660 -\chapter{Pre-proved Theorems}\label{thms}
26661 -\input{theorems-intro}
26662 -\section{Theorems about Inequalities}
26663 -\THEOREM GEN\_INDUCTION ineq
26664 +\chapter{Pre-proved Theorems}\label{thms}\input{theorems-intro}\section{Theorems about Inequalities}\THEOREM GEN\_INDUCTION ineq
26665 |- !P. P 0 /\ (!n. (!m. m < n ==> P m) ==> P n) ==> (!n. P n)
26666 \ENDTHEOREM
26667 \THEOREM GREATER\_EQ\_ANTISYM ineq
26668 @@ -19,8 +16,7 @@
26669 \THEOREM NOT\_LESS\_AND\_GREATER ineq
26670 |- !n m. n < m ==> ~m < n
26671 \ENDTHEOREM
26672 -\section{Theorems about {\tt 0}}
26673 -\THEOREM GREATER\_NOT\_ZERO zero\_ineq
26674 +\section{Theorems about {\tt 0}}\THEOREM GREATER\_NOT\_ZERO zero\_ineq
26675 |- !x. 0 < x ==> ~(x = 0)
26676 \ENDTHEOREM
26677 \THEOREM LESS1EQ0 zero\_ineq
26678 @@ -38,8 +34,7 @@
26679 \THEOREM NOT\_EQ\_0 zero\_ineq
26680 |- !m. ~(m = 0) ==> m >= 1
26681 \ENDTHEOREM
26682 -\section{Theorems about {\tt SUC}}
26683 -\THEOREM LESS\_EQ\_LESS\_SUC suc
26684 +\section{Theorems about {\tt SUC}}\THEOREM LESS\_EQ\_LESS\_SUC suc
26685 |- !m n. m <= n = m < (SUC n)
26686 \ENDTHEOREM
26687 \THEOREM NOT\_0\_GREATER\_EQ\_SUC suc
26688 @@ -63,8 +58,7 @@
26689 \THEOREM SUC\_NOT\_0 suc
26690 |- !n. ~(SUC n = 0)
26691 \ENDTHEOREM
26692 -\section{Theorems about {\tt PRE}}
26693 -\THEOREM LESS\_IMP\_LESS\_EQ\_PRE pre
26694 +\section{Theorems about {\tt PRE}}\THEOREM LESS\_IMP\_LESS\_EQ\_PRE pre
26695 |- !m n. 0 < n ==> (m < n = m <= (PRE n))
26696 \ENDTHEOREM
26697 \THEOREM PRE\_ADD pre
26698 @@ -94,31 +88,30 @@
26699 \THEOREM SUC\_PRE pre
26700 |- !n. 0 < n ==> (SUC(PRE n) = n)
26701 \ENDTHEOREM
26702 -\section{Theorems about Addition}
26703 +\section{Theorems about Addition}\THEOREM ADD\_EQ\_LESS\_EQ add
26704 +|- !m n p. (m + n = p) ==> m <= p
26705 +\ENDTHEOREM
26706 +\THEOREM ADD\_EQ\_LESS\_IMP\_LESS add
26707 +|- !n m k l. (k + m = l + n) /\ k < l ==> n < m
26708 +\ENDTHEOREM
26709 +\THEOREM ADD\_GREATER\_EQ add
26710 +|- !m n. (m + n) >= m
26711 +\ENDTHEOREM
26712 \THEOREM ADDL\_GREATER add
26713 |- !m n p. m < n ==> m < (p + n)
26714 \ENDTHEOREM
26715 \THEOREM ADDL\_GREATER\_EQ add
26716 |- !m n p. m <= n ==> m <= (p + n)
26717 \ENDTHEOREM
26718 +\THEOREM ADD\_MONO\_LESS add
26719 +|- !m n p. (m + p) < (m + n) = p < n
26720 +\ENDTHEOREM
26721 \THEOREM ADDR\_GREATER add
26722 |- !m n p. m < n ==> m < (n + p)
26723 \ENDTHEOREM
26724 \THEOREM ADDR\_GREATER\_EQ add
26725 |- !m n p. m <= n ==> m <= (n + p)
26726 \ENDTHEOREM
26727 -\THEOREM ADD\_EQ\_LESS\_EQ add
26728 -|- !m n p. (m + n = p) ==> m <= p
26729 -\ENDTHEOREM
26730 -\THEOREM ADD\_EQ\_LESS\_IMP\_LESS add
26731 -|- !n m k l. (k + m = l + n) /\ k < l ==> n < m
26732 -\ENDTHEOREM
26733 -\THEOREM ADD\_GREATER\_EQ add
26734 -|- !m n. (m + n) >= m
26735 -\ENDTHEOREM
26736 -\THEOREM ADD\_MONO\_LESS add
26737 -|- !m n p. (m + p) < (m + n) = p < n
26738 -\ENDTHEOREM
26739 \THEOREM ADD\_SUC\_0 add
26740 |- !m. SUC m = (SUC 0) + m
26741 \ENDTHEOREM
26742 @@ -174,8 +167,7 @@
26743 \THEOREM SUM\_LESS add
26744 |- !m n p. (m + n) < p ==> m < p /\ n < p
26745 \ENDTHEOREM
26746 -\section{Theorems about Subtraction}
26747 -\THEOREM ADD\_EQ\_IMP\_SUB\_EQ sub
26748 +\section{Theorems about Subtraction}\THEOREM ADD\_EQ\_IMP\_SUB\_EQ sub
26749 |- !a b c. (a = b + c) ==> (a - b = c)
26750 \ENDTHEOREM
26751 \THEOREM ADD\_LESS\_EQ\_SUB sub
26752 @@ -253,6 +245,9 @@
26753 \THEOREM SUB\_GREATER\_EQ\_ADD sub
26754 |- !n m p. p >= n ==> ((p - n) >= m = p >= (n + m))
26755 \ENDTHEOREM
26756 +\THEOREM SUB\_LE\_ADD sub
26757 +|- !n m p. n <= p ==> (m <= (p - n) = (n + m) <= p)
26758 +\ENDTHEOREM
26759 \THEOREM SUB\_LESS\_BOTH\_SIDES sub
26760 |- !m n p. p <= m /\ m < n ==> (m - p) < (n - p)
26761 \ENDTHEOREM
26762 @@ -268,9 +263,6 @@
26763 \THEOREM SUB\_LESS\_TO\_LESS\_ADDR sub
26764 |- !m n p. p <= m ==> ((m - p) < n = m < (n + p))
26765 \ENDTHEOREM
26766 -\THEOREM SUB\_LE\_ADD sub
26767 -|- !n m p. n <= p ==> (m <= (p - n) = (n + m) <= p)
26768 -\ENDTHEOREM
26769 \THEOREM SUB\_PRE\_SUB\_1 sub
26770 |- !a b. 0 < b ==> ((a - (PRE b)) - 1 = a - b)
26771 \ENDTHEOREM
26772 @@ -288,8 +280,7 @@
26773 (m < n ==> ((SUC m) - n = 0)) /\
26774 (~m < n ==> ((SUC m) - n = SUC(m - n)))
26775 \ENDTHEOREM
26776 -\section{Theorems about Multiplication and Exponential Functions}
26777 -\THEOREM EXP1 mult
26778 +\section{Theorems about Multiplication and Exponential Functions}\THEOREM EXP1 mult
26779 |- !n. n EXP 1 = n
26780 \ENDTHEOREM
26781 \THEOREM LESS\_MONO\_MULT1 mult
26782 @@ -310,8 +301,7 @@
26783 \THEOREM ZERO\_LESS\_TWO\_EXP mult
26784 |- !n. 0 < (2 EXP n)
26785 \ENDTHEOREM
26786 -\section{Theorems about Division}
26787 -\THEOREM ADD\_DIV\_ADD\_DIV div\_mod
26788 +\section{Theorems about Division}\THEOREM ADD\_DIV\_ADD\_DIV div\_mod
26789 |- !n. 0 < n ==> (!x r. ((x * n) + r) DIV n = x + (r DIV n))
26790 \ENDTHEOREM
26791 \THEOREM ADD\_DIV\_SUC\_DIV div\_mod
26792 @@ -349,8 +339,7 @@
26793 \THEOREM SUC\_MOD\_SELF div\_mod
26794 |- !n. (SUC n) MOD (SUC n) = 0
26795 \ENDTHEOREM
26796 -\section{Theorems about Maximum and Minimum}
26797 -\THEOREM MAX\_0 min\_max
26798 +\section{Theorems about Maximum and Minimum}\THEOREM MAX\_0 min\_max
26799 |- !n. MAX 0 n = n
26800 \ENDTHEOREM
26801 \THEOREM MAX\_DEF min\_max
26802 @@ -386,8 +375,7 @@
26803 \THEOREM SUC\_MIN min\_max
26804 |- !n p. MIN(SUC n)(SUC p) = SUC(MIN n p)
26805 \ENDTHEOREM
26806 -\section{Theorems about Odd and Even Numbers}
26807 -\THEOREM EVEN\_MULT odd\_even
26808 +\section{Theorems about Odd and Even Numbers}\THEOREM EVEN\_MULT odd\_even
26809 |- !n m. EVEN n \/ EVEN m ==> EVEN(n * m)
26810 \ENDTHEOREM
26811 \THEOREM EVEN\_ODD\_0 odd\_even
26812 --- hol88-2.02.19940316.orig/Library/more_arithmetic/Manual/Makefile
26813 +++ hol88-2.02.19940316/Library/more_arithmetic/Manual/Makefile
26814 @@ -26,40 +26,40 @@ default:
26815 # ---------------------------------------------------------------------
26816 clean:
26817 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
26818 - @echo "\begin{theindex}" > index.tex
26819 - @echo "\mbox{}" >> index.tex
26820 - @echo "\end{theindex}" >> index.tex
26821 + @printf '\\begin{theindex}' > index.tex
26822 + @printf '\\mbox{}' >> index.tex
26823 + @printf '\\end{theindex}' >> index.tex
26824
26825 tex: ids theorems
26826 @echo "TeX files made"
26827
26828 ids:
26829 - @echo "\chapter{ML Functions in the more\_arithmetic Library}">entries.tex
26830 - @echo "\input{entries-intro}" >> entries.tex
26831 + @printf '\\chapter{ML Functions in the more\\_arithmetic Library}'>entries.tex
26832 + @printf '\\input{entries-intro}' >> entries.tex
26833 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
26834
26835 theorems:
26836 - @echo "\chapter{Pre-proved Theorems}\label{thms}" > theorems.tex
26837 - @echo "\input{theorems-intro}" >> theorems.tex
26838 - @echo "\section{Theorems about Inequalities}">>theorems.tex
26839 + @printf '\\chapter{Pre-proved Theorems}\\label{thms}' > theorems.tex
26840 + @printf '\\input{theorems-intro}' >> theorems.tex
26841 + @printf '\\section{Theorems about Inequalities}'>>theorems.tex
26842 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/ineq theorems.tex
26843 - @echo "\section{Theorems about {\tt 0}}">>theorems.tex
26844 + @printf '\\section{Theorems about {\\tt 0}}'>>theorems.tex
26845 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/zero_ineq theorems.tex
26846 - @echo "\section{Theorems about {\tt SUC}}">>theorems.tex
26847 + @printf '\\section{Theorems about {\\tt SUC}}'>>theorems.tex
26848 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/suc theorems.tex
26849 - @echo "\section{Theorems about {\tt PRE}}">>theorems.tex
26850 + @printf '\\section{Theorems about {\\tt PRE}}'>>theorems.tex
26851 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/pre theorems.tex
26852 - @echo "\section{Theorems about Addition}">>theorems.tex
26853 + @printf '\\section{Theorems about Addition}'>>theorems.tex
26854 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/add theorems.tex
26855 - @echo "\section{Theorems about Subtraction}">>theorems.tex
26856 + @printf '\\section{Theorems about Subtraction}'>>theorems.tex
26857 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/sub theorems.tex
26858 - @echo "\section{Theorems about Multiplication and Exponential Functions}">>theorems.tex
26859 + @printf '\\section{Theorems about Multiplication and Exponential Functions}'>>theorems.tex
26860 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/mult theorems.tex
26861 - @echo "\section{Theorems about Division}">>theorems.tex
26862 + @printf '\\section{Theorems about Division}'>>theorems.tex
26863 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/div_mod theorems.tex
26864 - @echo "\section{Theorems about Maximum and Minimum}">>theorems.tex
26865 + @printf '\\section{Theorems about Maximum and Minimum}'>>theorems.tex
26866 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/min_max theorems.tex
26867 - @echo "\section{Theorems about Odd and Even Numbers}">>theorems.tex
26868 + @printf '\\section{Theorems about Odd and Even Numbers}'>>theorems.tex
26869 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/odd_even theorems.tex
26870
26871 index:
26872 --- hol88-2.02.19940316.orig/Library/more_arithmetic/Manual/entries.tex
26873 +++ hol88-2.02.19940316/Library/more_arithmetic/Manual/entries.tex
26874 @@ -1,6 +1,4 @@
26875 -\chapter{ML Functions in the more\_arithmetic Library}
26876 -\input{entries-intro}
26877 -\DOC{GEN\_INDUCT\_RULE}
26878 +\chapter{ML Functions in the more\_arithmetic Library}\input{entries-intro}\DOC{GEN\_INDUCT\_RULE}
26879
26880 \TYPE {\small\verb%GEN_INDUCT_RULE : (thm -> thm -> thm)%}\egroup
26881
26882 --- hol88-2.02.19940316.orig/Library/trs/Manual/Makefile
26883 +++ hol88-2.02.19940316/Library/trs/Manual/Makefile
26884 @@ -26,16 +26,16 @@ default:
26885 # ---------------------------------------------------------------------
26886 clean:
26887 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
26888 - @echo "\begin{theindex}" > index.tex
26889 - @echo "\mbox{}" >> index.tex
26890 - @echo "\end{theindex}" >> index.tex
26891 + @printf '\\begin{theindex}' > index.tex
26892 + @printf '\\mbox{}' >> index.tex
26893 + @printf '\\end{theindex}' >> index.tex
26894
26895 tex: ids
26896 @echo "TeX files made"
26897
26898 ids:
26899 - @echo "\chapter{ML Functions in the trs Library}">entries.tex
26900 - @echo "\input{entries-intro}" >> entries.tex
26901 + @printf '\\chapter{ML Functions in the trs Library}'>entries.tex
26902 + @printf '\\input{entries-intro}' >> entries.tex
26903 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex
26904
26905 index:
26906 --- hol88-2.02.19940316.orig/Library/trs/Manual/entries.tex
26907 +++ hol88-2.02.19940316/Library/trs/Manual/entries.tex
26908 @@ -1,6 +1,4 @@
26909 -\chapter{ML Functions in the trs Library}
26910 -\input{entries-intro}
26911 -\DOC{Ancestors}
26912 +\chapter{ML Functions in the trs Library}\input{entries-intro}\DOC{Ancestors}
26913
26914 \TYPE {\small\verb%Ancestors : ((string list # string list) -> searchpath)%}\egroup
26915
26916 --- hol88-2.02.19940316.orig/contrib/wordn/Manual/Makefile
26917 +++ hol88-2.02.19940316/contrib/wordn/Manual/Makefile
26918 @@ -26,27 +26,27 @@ default:
26919 # ---------------------------------------------------------------------
26920 clean:
26921 rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
26922 - @echo "\begin{theindex}" > index.tex
26923 - @echo "\mbox{}" >> index.tex
26924 - @echo "\end{theindex}" >> index.tex
26925 + @printf '\\begin{theindex}' > index.tex
26926 + @printf '\\mbox{}' >> index.tex
26927 + @printf '\\end{theindex}' >> index.tex
26928
26929 tex: entries theorems
26930 @echo "TeX files made"
26931
26932 entries:
26933 - @echo "\chapter{ML Functions in the wordn Library}">entries.tex
26934 - @echo "\label{entries}">>entries.tex
26935 - @echo "\input{entries-intro}" >> entries.tex
26936 + @printf '\\chapter{ML Functions in the wordn Library}'>entries.tex
26937 + @printf '\\label{entries}'>>entries.tex
26938 + @printf '\\input{entries-intro}' >> entries.tex
26939 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/ENTRIES entries.tex
26940
26941 theorems:
26942 - @echo "\chapter{Pre-proved Theorems}" > theorems.tex
26943 - @echo "\input{theorems-intro}" >> theorems.tex
26944 - @echo "\section{The theory {\tt wordn\_base}}">>theorems.tex
26945 + @printf '\\chapter{Pre-proved Theorems}' > theorems.tex
26946 + @printf '\\input{theorems-intro}' >> theorems.tex
26947 + @printf '\\section{The theory {\\tt wordn\\_base}}'>>theorems.tex
26948 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/THEOREMS/base theorems.tex
26949 - @echo "\section{The theory {\tt wordn\_bitops}}">>theorems.tex
26950 + @printf '\\section{The theory {\\tt wordn\\_bitops}}'>>theorems.tex
26951 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/THEOREMS/bitops theorems.tex
26952 - @echo "\section{The theory {\tt wordn\_num}}">>theorems.tex
26953 + @printf '\\section{The theory {\\tt wordn\\_num}}'>>theorems.tex
26954 /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/THEOREMS/num theorems.tex
26955
26956 index: