Description: <short summary of the patch>
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.
.
hol88 (2.02.19940316-15) unstable; urgency=low
.
* lintian fixes
* 3.0 quilt source format
Author: Camm Maguire <camm@debian.org>
---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:
Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>
--- hol88-2.02.19940316.orig/Makefile
+++ hol88-2.02.19940316/Makefile
@@ -150,7 +150,7 @@ SHELL=/bin/sh
LispType=cl
Obj=o
-Lisp=akcl
+Lisp=gcl
Liszt=
LisztComm=
Allegro=(set-case-mode :case-insensitive-upper)
@@ -159,7 +159,7 @@ AllegroV4.0= $(Allegro) (setq *cltl1-in-
AllegroV4.1= $(AllegroV4.0) (setq *enable-package-locked-errors* nil)
AllegroStuff= (progn () $(AllegroV4.1))
-HOLdir=/usr/local/hol
+HOLdir=$(shell pwd)
Theory=$(HOLdir)/theories
Library=$(HOLdir)/Library
Help=$(HOLdir)/help/ENTRIES/
@@ -168,7 +168,7 @@ Hol=hol
LispDir=${HOLdir}/lisp
ExeName = hol
-Version = 2.02 (SUN4/AKCL)
+Version = 2.02 (GCL)
# =====================================================================
# Default (from Phil Windley)
@@ -221,6 +221,34 @@ HolMl=ml/load_thms.ml ml/numconv_ml.o ml
# ---------------------------------------------------------------------
hol: basic-hol ${Theory}/HOL.th $(HolMl) lisp/banner.$(Obj) lisp/akcl.l
+# echo 'set_search_path[``; `${Theory}/`];;'\
+# 'load_theory `HOL`;;'\
+# 'loadf `ml/load_thms`;;'\
+# 'loadf `ml/lib_loader`;;'\
+# 'loadf `ml/numconv`;;'\
+# 'loadf `ml/tydefs`;;'\
+# 'loadf `ml/ind`;;'\
+# 'loadf `ml/prim_rec`;;'\
+# 'loadf `ml/tyfns`;;'\
+# 'loadf `ml/num`;;'\
+# 'loadf `ml/list`;;'\
+# 'map delete_cache [`arithmetic`;`sum`;`list`];;'\
+# 'map delete_cache [`tree`;`ltree`;`prim_rec`];;'\
+# 'lisp `(load "lisp/banner")`;;'\
+# 'lisp `(setq %system-name "HOL")`;;'\
+# 'lisp `(setq %hol-dir "$(HOLdir)")`;;'\
+# 'lisp `(setq %lib-dir "$(Library)")`;;'\
+# 'lisp `(setq %liszt "$(LisztComm)")`;;'\
+# 'lisp `(setq %version "$(Version)")`;;'\
+# 'set_flag(`abort_when_fail`,false);;'\
+# 'set_search_path[``; `~/`; `${Theory}/`];;'\
+# 'set_help_search_path (words `$(Help)`);;'\
+# 'set_library_search_path [`${Library}/`];;'\
+# 'lisp `(setup)`;;'\
+# 'save `${ExeName}`;;'\
+# 'set_thm_count 0;;'\
+# 'quit();;'\
+# | basic-hol
echo 'set_search_path[``; `${Theory}/`];;'\
'load_theory `HOL`;;'\
'loadf `ml/load_thms`;;'\
@@ -244,12 +272,8 @@ hol: basic-hol ${Theory}/HOL.th $(HolMl)
'set_search_path[``; `~/`; `${Theory}/`];;'\
'set_help_search_path (words `$(Help)`);;'\
'set_library_search_path [`${Library}/`];;'\
- 'lisp `(load "lisp/akcl.l")`;;'\
- 'lisp `(setup)`;;'\
- 'save `${ExeName}`;;'\
- 'set_thm_count 0;;'\
- 'quit();;'\
- | basic-hol
+ 'lisp `(setup)`;;' >foo2
+ 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
make permissions
@echo "=======> hol88 version $(Version) made"
@@ -291,11 +315,12 @@ Exec=hol hol-lcf basic-hol Manual/LaTeX/
Manual/Reference/bin/mktex Manual/Reference/bin/typecheck
permissions:
- find . \( -type d -user $(USER) -exec chmod $(Dperm) {} \; \) -o\
- \( -type f -user $(USER) -exec chmod $(Tperm) {} \; \)
- @for f in $(Exec) ; do\
- ( if [ -f $$f ]; then\
- find $$f \( -user $(USER) \) -exec chmod $(Eperm) {} \; ;fi) ; \
+ find $$(ls -1 | grep -v debian) \
+ \( -type d -exec chmod $(Dperm) {} \; \) -o\
+ \( -type f -exec chmod $(Tperm) {} \; \)
+ for f in $(Exec) ; do\
+ ( if [ -f $$f ] ; then\
+ find $$f -exec chmod $(Eperm) {} \; ;fi) ; \
done
@@ -482,6 +507,31 @@ BasicHolMl=ml/genfns_ml.o ml/hol-syn_ml.
# ---------------------------------------------------------------------
basic-hol: hol-lcf $(BasicHolLisp) ${Theory}/BASIC-HOL.th $(BasicHolMl)
+# echo 'set_search_path[``; `${Theory}/`];;'\
+# 'load_theory `BASIC-HOL`;;'\
+# 'loadf `ml/hol-in-out`;;'\
+# 'loadf `ml/hol-rule`;;'\
+# 'loadf `ml/hol-drule`;;'\
+# 'loadf `ml/drul`;;'\
+# 'loadf `ml/tacticals`;;'\
+# 'loadf `ml/tacont`;;'\
+# 'loadf `ml/tactics`;;'\
+# 'loadf `ml/conv`;;'\
+# 'loadf `ml/hol-net`;;'\
+# 'loadf `ml/rewrite`;;'\
+# 'loadf `ml/resolve`;;'\
+# 'loadf `ml/hol-thyfn`;;'\
+# 'loadf `ml/goals`;;'\
+# 'loadf `ml/stack`;;'\
+# 'loadf `ml/abs-rep`;;'\
+# 'activate_binders `bool`;;'\
+# 'lisp `(setq %liszt "$(LisztComm)")`;;'\
+# 'lisp `(setq %version "$(Version)")`;;'\
+# 'lisp `(setq %system-name "BASIC-HOL")`;;'\
+# 'lisp `(setup)`;;'\
+# 'save `basic-hol`;;'\
+# 'quit();;'\
+# | hol-lcf
echo 'set_search_path[``; `${Theory}/`];;'\
'load_theory `BASIC-HOL`;;'\
'loadf `ml/hol-in-out`;;'\
@@ -503,10 +553,8 @@ basic-hol: hol-lcf $(BasicHolLisp) ${The
'lisp `(setq %liszt "$(LisztComm)")`;;'\
'lisp `(setq %version "$(Version)")`;;'\
'lisp `(setq %system-name "BASIC-HOL")`;;'\
- 'lisp `(setup)`;;'\
- 'save `basic-hol`;;'\
- 'quit();;'\
- | hol-lcf
+ 'lisp `(setup)`;;' >foo1
+ 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
@echo "=======> basic-hol88 made"
# ---------------------------------------------------------------------
@@ -780,6 +828,23 @@ HolLcfMl=ml/ml-curry_ml.o ml/lis_ml.o ml
# ---------------------------------------------------------------------
hol-lcf: $(HolLcfLisp) $(HolLcfMl)
+# echo '#+allegro $(AllegroStuff)'\
+# '(load "lisp/mk-ml")'\
+# '(load "lisp/mk-hol-lcf")'\
+# '(setq %version "$(Version)")'\
+# '(set-make)'\
+# '(tml)'\
+# 'load(`ml/site`,false);;'\
+# 'load(`ml/ml-curry`,false);;'\
+# 'load(`ml/lis`,false);;'\
+# 'load(`ml/gen`,false);;'\
+# 'load(`ml/killpp`,false);;'\
+# 'lisp `(setq %system-name "HOL-LCF")`;;'\
+# 'lisp `(setq %liszt "$(LisztComm)")`;;'\
+# 'lisp `(setup)`;;'\
+# 'save `hol-lcf`;;'\
+# 'quit();;'\
+# | $(Lisp)
echo '#+allegro $(AllegroStuff)'\
'(load "lisp/mk-ml")'\
'(load "lisp/mk-hol-lcf")'\
@@ -793,10 +858,8 @@ hol-lcf: $(HolLcfLisp) $(HolLcfMl)
'load(`ml/killpp`,false);;'\
'lisp `(setq %system-name "HOL-LCF")`;;'\
'lisp `(setq %liszt "$(LisztComm)")`;;'\
- 'lisp `(setup)`;;'\
- 'save `hol-lcf`;;'\
- 'quit();;'\
- | $(Lisp)
+ 'lisp `(setup)`;;' >foo
+ 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)
@echo "=======> hol-lcf made"
# =====================================================================
--- hol88-2.02.19940316.orig/Manual/Makefile
+++ hol88-2.02.19940316/Manual/Makefile
@@ -41,3 +41,5 @@ all:
make tutorial;make description; make reference;make libraries;make covers
@echo "=======> MANUAL made"
+clean:
+ for i in Tutorial Description Reference Libraries Covers ; do $(MAKE) -C $$i clean ; done
--- hol88-2.02.19940316.orig/Manual/Description/description.tex
+++ hol88-2.02.19940316/Manual/Description/description.tex
@@ -34,7 +34,7 @@
\include{title} % description title page
\include{preface} % preface to entire description
- \include{../LaTeX/ack} % global acknowledgements
+ \include{ack} % global acknowledgements
\include{contents} % table of contents
--- hol88-2.02.19940316.orig/Manual/Tutorial/tutorial.tex
+++ hol88-2.02.19940316/Manual/Tutorial/tutorial.tex
@@ -38,7 +38,7 @@
\include{title} % tutorial title page
\include{preface} % preface to entire tutorial
- \include{../LaTeX/ack} % global acknowledgements
+ \include{ack} % global acknowledgements
\include{contents} % table of contents
\pagenumbering{arabic} % arabic page numbers
--- hol88-2.02.19940316.orig/Manual/Covers/Makefile
+++ hol88-2.02.19940316/Manual/Covers/Makefile
@@ -20,12 +20,12 @@ default:
endpages.dvi: CRC.ps DESCRIPTION.ps LANTERN.ps REFERENCE.ps TUTORIAL.ps \
arms.ps endpages.tex endpages.sty
- $(LATEX) endpages
+ TEXINPUTS=$$(pwd)/psfig:$$TEXINPUTS $(LATEX) endpages
@echo "===> endpages.dvi created"
titlepages.dvi: CRC.ps DESCRIPTION.ps LANTERN.ps REFERENCE.ps TUTORIAL.ps \
arms.ps titlepages.tex titlepages.sty
- $(LATEX) titlepages
+ TEXINPUTS=$$(pwd)/psfig:$$TEXINPUTS $(LATEX) titlepages
@echo "===> titlepages.dvi created"
dvi: endpages.dvi titlepages.dvi
--- hol88-2.02.19940316.orig/Manual/LaTeX/ref-macros.tex
+++ hol88-2.02.19940316/Manual/LaTeX/ref-macros.tex
@@ -172,3 +172,8 @@
% ---------------------------------------------------------------------
\def\none{{\it none}}
+
+\newcommand\nintt{\fontsize{9pt}{11pt}\normalfont\ttfamily}
+\newcommand\tenrm{\fontsize{10pt}{12pt}\normalfont\rmfamily}
+%\def\ptt{\fam\ttfam\nintt}\textfont\ttfam\nintt\scriptfont\ttfam\nintt\scriptscriptfont\ttfam\nintt
+\def\ptt{\fam\ttfam\nintt}%\textfont\ttfam\nintt\scriptfont\ttfam\nintt\scriptscriptfont\ttfam\nintt
--- hol88-2.02.19940316.orig/Manual/LaTeX/layout.sty
+++ hol88-2.02.19940316/Manual/LaTeX/layout.sty
@@ -52,9 +52,9 @@
% MATH INDENTATION. = \tabcolsep + three small verbatim spaces (!)
% ---------------------------------------------------------------------
\setlength{\mathindent}{\tabcolsep}
-\addtolength{\mathindent}{\the\fontdimen2\elvtt}
-\addtolength{\mathindent}{\the\fontdimen2\elvtt}
-\addtolength{\mathindent}{\the\fontdimen2\elvtt}
+%\addtolength{\mathindent}{\the\fontdimen2\elvtt}
+%\addtolength{\mathindent}{\the\fontdimen2\elvtt}
+%\addtolength{\mathindent}{\the\fontdimen2\elvtt}
% ---------------------------------------------------------------------
% HEAD: spacing to match header macro below.
--- hol88-2.02.19940316.orig/Manual/Reference/theorems.tex
+++ hol88-2.02.19940316/Manual/Reference/theorems.tex
@@ -1,7 +1,4 @@
-\chapter{Pre-proved Theorems}
-\input{theorems-intro}
-\section{Definitions of Basic Logical Constants}
-\THEOREM AND\_DEF bool
+\chapter{Pre-proved Theorems}\input{theorems-intro}\section{Definitions of Basic Logical Constants}\THEOREM AND\_DEF bool
|- $/\ = (\t1 t2. !t. (t1 ==> t2 ==> t) ==> t)
\ENDTHEOREM
\THEOREM EXISTS\_DEF bool
@@ -10,12 +7,12 @@
\THEOREM EXISTS\_UNIQUE\_DEF bool
|- $?! = (\P. $? P /\ (!x y. P x /\ P y ==> (x = y)))
\ENDTHEOREM
-\THEOREM FORALL\_DEF bool
-|- $! = (\P. P = (\x. T))
-\ENDTHEOREM
\THEOREM F\_DEF bool
|- F = (!t. t)
\ENDTHEOREM
+\THEOREM FORALL\_DEF bool
+|- $! = (\P. P = (\x. T))
+\ENDTHEOREM
\THEOREM NOT\_DEF bool
|- $~ = (\t. t ==> F)
\ENDTHEOREM
@@ -25,8 +22,7 @@
\THEOREM T\_DEF bool
|- T = ((\x. x) = (\x. x))
\ENDTHEOREM
-\section{Constants for syntactic abbreviations}
-\THEOREM ARB bool
+\section{Constants for syntactic abbreviations}\THEOREM ARB bool
|- ARB = (@x. T)
\ENDTHEOREM
\THEOREM COND\_DEF bool
@@ -49,8 +45,7 @@
\THEOREM RES\_SELECT bool
|- !P B. RES_SELECT P B = (@x. P x /\ B x)
\ENDTHEOREM
-\section{Axioms}
-\THEOREM ARB\_THM bool
+\section{Axioms}\THEOREM ARB\_THM bool
|- $= = $=
\ENDTHEOREM
\THEOREM BOOL\_CASES\_AX bool
@@ -68,8 +63,7 @@
\THEOREM SELECT\_AX bool
|- !P x. P x ==> P($@ P)
\ENDTHEOREM
-\section{Logical tautologies}
-\THEOREM AND1\_THM {\none}
+\section{Logical tautologies}\THEOREM AND1\_THM {\none}
|- !t1 t2. t1 /\ t2 ==> t1
\ENDTHEOREM
\THEOREM AND2\_THM {\none}
@@ -171,13 +165,13 @@
\THEOREM FALSITY {\none}
|- !t. F ==> t
\ENDTHEOREM
+\THEOREM F\_IMP {\none}
+|- !t. ~t ==>(t ==> F)
+\ENDTHEOREM
\THEOREM FORALL\_SIMP {\none}
|- !t. (!x. t) = t
\ENDTHEOREM
-\THEOREM F\_IMP {\none}
-|- !t. ~t ==>(t ==> F)
-\ENDTHEOREM
\THEOREM IMP\_CLAUSES {\none}
|- !t. (T ==> t) = t /\
(t ==> T) = T /\
@@ -258,8 +252,7 @@
\THEOREM TRUTH {\none}
|- T
\ENDTHEOREM
-\section{Theorems about functions}
-\THEOREM ABS\_SIMP {\none}
+\section{Theorems about functions}\THEOREM ABS\_SIMP {\none}
|- !t1 t2. (\x. t1)t2 = t1
\ENDTHEOREM
@@ -309,24 +302,22 @@
\THEOREM RIGHT\_ID\_DEF fun
|- !f e. RIGHT_ID f e = (!x. f x e = x)
\ENDTHEOREM
-\section{Theorems about the type {\tt one}}
-\THEOREM one one
-|- !v. v = one
+\section{Theorems about the type {\tt one}}\THEOREM one\_axiom one
+|- !f g. f = g
\ENDTHEOREM
\THEOREM one\_Axiom one
|- !e. ?! fn. fn one = e
\ENDTHEOREM
-\THEOREM one\_axiom one
-|- !f g. f = g
-\ENDTHEOREM
\THEOREM one\_DEF one
|- one = (@x. T)
\ENDTHEOREM
+\THEOREM one one
+|- !v. v = one
+\ENDTHEOREM
\THEOREM one\_TY\_DEF one
|- ?rep. TYPE_DEFINITION(\b. b)rep
\ENDTHEOREM
-\section{Theorems about combinators}
-\THEOREM I\_DEF combin
+\section{Theorems about combinators}\THEOREM I\_DEF combin
|- I = S K K
\ENDTHEOREM
\THEOREM I\_o\_ID combin
@@ -356,19 +347,18 @@
\THEOREM S\_THM combin
|- !f g x. S f g x = f x(g x)
\ENDTHEOREM
-\section{Theorems about pairs}
-\THEOREM COMMA\_DEF bool
+\section{Theorems about pairs}\THEOREM COMMA\_DEF bool
|- !x y. x,y = (@p. REP_prod p = MK_PAIR x y)
\ENDTHEOREM
\THEOREM CURRY\_DEF bool
|- !f x y. CURRY f x y = f(x,y)
\ENDTHEOREM
-\THEOREM FST bool
-|- !x y. FST(x,y) = x
-\ENDTHEOREM
\THEOREM FST\_DEF bool
|- !p. FST p = (@x. ?y. MK_PAIR x y = REP_prod p)
\ENDTHEOREM
+\THEOREM FST bool
+|- !x y. FST(x,y) = x
+\ENDTHEOREM
\THEOREM IS\_PAIR\_DEF bool
|- !p. IS_PAIR p = (?x y. p = MK_PAIR x y)
\ENDTHEOREM
@@ -390,28 +380,27 @@
(!p' p''. (rep p' = rep p'') ==> (p' = p'')) /\
(!p. IS_PAIR p = (?p'. p = rep p')))
\ENDTHEOREM
-\THEOREM SND bool
-|- !x y. SND(x,y) = y
-\ENDTHEOREM
\THEOREM SND\_DEF bool
|- !p. SND p = (@y. ?x. MK_PAIR x y = REP_prod p)
\ENDTHEOREM
+\THEOREM SND bool
+|- !x y. SND(x,y) = y
+\ENDTHEOREM
\THEOREM UNCURRY\_DEF bool
|- !f x y. UNCURRY f(x,y) = f x y
\ENDTHEOREM
-\section{Theorems about disjoint sums}
+\section{Theorems about disjoint sums}\THEOREM INL\_DEF sum
+|- !e. INL e = ABS_sum(\b x y. (x = e) /\ b)
+\ENDTHEOREM
\THEOREM INL sum
|- !x. ISL x ==> (INL(OUTL x) = x)
\ENDTHEOREM
-\THEOREM INL\_DEF sum
-|- !e. INL e = ABS_sum(\b x y. (x = e) /\ b)
+\THEOREM INR\_DEF sum
+|- !e. INR e = ABS_sum(\b x y. (y = e) /\ ~b)
\ENDTHEOREM
\THEOREM INR sum
|- !x. ISR x ==> (INR(OUTR x) = x)
\ENDTHEOREM
-\THEOREM INR\_DEF sum
-|- !e. INR e = ABS_sum(\b x y. (y = e) /\ ~b)
-\ENDTHEOREM
\THEOREM ISL sum
|- (!x. ISL(INL x)) /\ (!y. ~ISL(INR y))
\ENDTHEOREM
@@ -433,12 +422,12 @@
\THEOREM OUTR sum
|- !x. OUTR(INR x) = x
\ENDTHEOREM
-\THEOREM sum\_Axiom sum
-|- !f g. ?! h. (!x. h(INL x) = f x) /\ (!x. h(INR x) = g x)
-\ENDTHEOREM
\THEOREM sum\_axiom sum
|- !f g. ?! h. (h o INL = f) /\ (h o INR = g)
\ENDTHEOREM
+\THEOREM sum\_Axiom sum
+|- !f g. ?! h. (!x. h(INL x) = f x) /\ (!x. h(INR x) = g x)
+\ENDTHEOREM
\THEOREM sum\_ISO\_DEF sum
|- (!a. ABS_sum(REP_sum a) = a) /\
(!r. IS_SUM_REP r = (REP_sum(ABS_sum r) = r))
@@ -446,16 +435,12 @@
\THEOREM sum\_TY\_DEF sum
|- ?rep. TYPE_DEFINITION IS_SUM_REP rep
\ENDTHEOREM
-\section{Theorems about arithmetic}
-\THEOREM ADD arithmetic
-|- (!n. 0 + n = n) /\ (!m n. (SUC m) + n = SUC(m + n))
+\section{Theorems about arithmetic}\THEOREM ADD\_0 arithmetic
+|- !m. m + 0 = m
\ENDTHEOREM
\THEOREM ADD1 arithmetic
|- !m. SUC m = m + 1
\ENDTHEOREM
-\THEOREM ADD\_0 arithmetic
-|- !m. m + 0 = m
-\ENDTHEOREM
\THEOREM ADD\_ASSOC arithmetic
|- !m n p. m + (n + p) = (m + n) + p
\ENDTHEOREM
@@ -465,6 +450,9 @@
((SUC m) + n = SUC(m + n)) /\
(m + (SUC n) = SUC(m + n))
\ENDTHEOREM
+\THEOREM ADD arithmetic
+|- (!n. 0 + n = n) /\ (!m n. (SUC m) + n = SUC(m + n))
+\ENDTHEOREM
\THEOREM ADD\_EQ\_0 arithmetic
|- !m n. (m + n = 0) = (m = 0) /\ (n = 0)
\ENDTHEOREM
@@ -523,15 +511,15 @@
\THEOREM EQ\_MONO\_ADD\_EQ arithmetic
|- !m n p. (m + p = n + p) = (m = n)
\ENDTHEOREM
-\THEOREM EVEN arithmetic
-|- (EVEN 0 = T) /\ (!n. EVEN(SUC n) = ~EVEN n)
-\ENDTHEOREM
\THEOREM EVEN\_ADD arithmetic
|- !m n. EVEN(m + n) = (EVEN m = EVEN n)
\ENDTHEOREM
\THEOREM EVEN\_AND\_ODD arithmetic
|- !n. ~(EVEN n /\ ODD n)
\ENDTHEOREM
+\THEOREM EVEN arithmetic
+|- (EVEN 0 = T) /\ (!n. EVEN(SUC n) = ~EVEN n)
+\ENDTHEOREM
\THEOREM EVEN\_DOUBLE arithmetic
|- !n. EVEN(2 * n)
\ENDTHEOREM
@@ -550,12 +538,12 @@
\THEOREM EVEN\_OR\_ODD arithmetic
|- !n. EVEN n \/ ODD n
\ENDTHEOREM
-\THEOREM EXP arithmetic
-|- (!m. m EXP 0 = 1) /\ (!m n. m EXP (SUC n) = m * (m EXP n))
-\ENDTHEOREM
\THEOREM EXP\_ADD arithmetic
|- !p q n. n EXP (p + q) = (n EXP p) * (n EXP q)
\ENDTHEOREM
+\THEOREM EXP arithmetic
+|- (!m. m EXP 0 = 1) /\ (!m n. m EXP (SUC n) = m * (m EXP n))
+\ENDTHEOREM
\THEOREM FACT arithmetic
|- (FACT 0 = 1) /\ (!n. FACT(SUC n) = (SUC n) * (FACT n))
\ENDTHEOREM
@@ -609,24 +597,21 @@
\THEOREM LEFT\_SUB\_DISTRIB arithmetic
|- !m n p. p * (m - n) = (p * m) - (p * n)
\ENDTHEOREM
-\THEOREM LESS prim\_rec
-|- !m n. m < n = (?P. (!n'. P(SUC n') ==> P n') /\ P m /\ ~P n)
-\ENDTHEOREM
-\THEOREM LESS\_0 prim\_rec
-|- !n. 0 < (SUC n)
-\ENDTHEOREM
\THEOREM LESS\_0\_0 prim\_rec
|- 0 < (SUC 0)
\ENDTHEOREM
\THEOREM LESS\_0\_CASES arithmetic
|- !m. (0 = m) \/ 0 < m
\ENDTHEOREM
-\THEOREM LESS\_ADD arithmetic
-|- !m n. n < m ==> (?p. p + n = m)
+\THEOREM LESS\_0 prim\_rec
+|- !n. 0 < (SUC n)
\ENDTHEOREM
\THEOREM LESS\_ADD\_1 arithmetic
|- !m n. n < m ==> (?p. m = n + (p + 1))
\ENDTHEOREM
+\THEOREM LESS\_ADD arithmetic
+|- !m n. n < m ==> (?p. p + n = m)
+\ENDTHEOREM
\THEOREM LESS\_ADD\_NONZERO arithmetic
|- !m n. ~(n = 0) ==> m < (m + n)
\ENDTHEOREM
@@ -642,14 +627,8 @@
\THEOREM LESS\_CASES\_IMP arithmetic
|- !m n. ~m < n /\ ~(m = n) ==> n < m
\ENDTHEOREM
-\THEOREM LESS\_EQ arithmetic
-|- !m n. m < n = (SUC m) <= n
-\ENDTHEOREM
-\THEOREM LESS\_EQUAL\_ADD arithmetic
-|- !m n. m <= n ==> (?p. n = m + p)
-\ENDTHEOREM
-\THEOREM LESS\_EQUAL\_ANTISYM arithmetic
-|- !n m. n <= m /\ m <= n ==> (n = m)
+\THEOREM LESS prim\_rec
+|- !m n. m < n = (?P. (!n'. P(SUC n') ==> P n') /\ P m /\ ~P n)
\ENDTHEOREM
\THEOREM LESS\_EQ\_0 arithmetic
|- !n. n <= 0 = (n = 0)
@@ -666,6 +645,9 @@
\THEOREM LESS\_EQ\_CASES arithmetic
|- !m n. m <= n \/ n <= m
\ENDTHEOREM
+\THEOREM LESS\_EQ arithmetic
+|- !m n. m < n = (SUC m) <= n
+\ENDTHEOREM
\THEOREM LESS\_EQ\_EXISTS arithmetic
|- !m n. m <= n = (?p. n = m + p)
\ENDTHEOREM
@@ -678,12 +660,12 @@
\THEOREM LESS\_EQ\_LESS\_TRANS arithmetic
|- !m n p. m <= n /\ n < p ==> m < p
\ENDTHEOREM
-\THEOREM LESS\_EQ\_MONO arithmetic
-|- !n m. (SUC n) <= (SUC m) = n <= m
-\ENDTHEOREM
\THEOREM LESS\_EQ\_MONO\_ADD\_EQ arithmetic
|- !m n p. (m + p) <= (n + p) = m <= n
\ENDTHEOREM
+\THEOREM LESS\_EQ\_MONO arithmetic
+|- !n m. (SUC n) <= (SUC m) = n <= m
+\ENDTHEOREM
\THEOREM LESS\_EQ\_REFL arithmetic
|- !m. m <= m
\ENDTHEOREM
@@ -696,6 +678,12 @@
\THEOREM LESS\_EQ\_TRANS arithmetic
|- !m n p. m <= n /\ n <= p ==> m <= p
\ENDTHEOREM
+\THEOREM LESS\_EQUAL\_ADD arithmetic
+|- !m n. m <= n ==> (?p. n = m + p)
+\ENDTHEOREM
+\THEOREM LESS\_EQUAL\_ANTISYM arithmetic
+|- !n m. n <= m /\ m <= n ==> (n = m)
+\ENDTHEOREM
\THEOREM LESS\_EXP\_SUC\_MONO arithmetic
|- !n m. ((SUC(SUC m)) EXP n) < ((SUC(SUC m)) EXP (SUC n))
\ENDTHEOREM
@@ -723,9 +711,6 @@
\THEOREM LESS\_MOD arithmetic
|- !n k. k < n ==> (k MOD n = k)
\ENDTHEOREM
-\THEOREM LESS\_MONO prim\_rec
-|- !m n. m < n ==> (SUC m) < (SUC n)
-\ENDTHEOREM
\THEOREM LESS\_MONO\_ADD arithmetic
|- !m n p. m < n ==> (m + p) < (n + p)
\ENDTHEOREM
@@ -735,6 +720,9 @@
\THEOREM LESS\_MONO\_ADD\_INV arithmetic
|- !m n p. (m + p) < (n + p) ==> m < n
\ENDTHEOREM
+\THEOREM LESS\_MONO prim\_rec
+|- !m n. m < n ==> (SUC m) < (SUC n)
+\ENDTHEOREM
\THEOREM LESS\_MONO\_EQ arithmetic
|- !m n. (SUC m) < (SUC n) = m < n
\ENDTHEOREM
@@ -759,12 +747,12 @@
\THEOREM LESS\_OR arithmetic
|- !m n. m < n ==> (SUC m) <= n
\ENDTHEOREM
-\THEOREM LESS\_OR\_EQ arithmetic
-|- !m n. m <= n = m < n \/ (m = n)
-\ENDTHEOREM
\THEOREM LESS\_OR\_EQ\_ADD arithmetic
|- !n m. n < m \/ (?p. n = p + m)
\ENDTHEOREM
+\THEOREM LESS\_OR\_EQ arithmetic
+|- !m n. m <= n = m < n \/ (m = n)
+\ENDTHEOREM
\THEOREM LESS\_REFL prim\_rec
|- !n. ~n < n
\ENDTHEOREM
@@ -822,9 +810,6 @@
\THEOREM MONOID\_MULT\_1 arithmetic
|- MONOID $* 1
\ENDTHEOREM
-\THEOREM MULT arithmetic
-|- (!n. 0 * n = 0) /\ (!m n. (SUC m) * n = (m * n) + n)
-\ENDTHEOREM
\THEOREM MULT\_0 arithmetic
|- !m. m * 0 = 0
\ENDTHEOREM
@@ -840,6 +825,9 @@
((SUC m) * n = (m * n) + n) /\
(m * (SUC n) = m + (m * n))
\ENDTHEOREM
+\THEOREM MULT arithmetic
+|- (!n. 0 * n = 0) /\ (!m n. (SUC m) * n = (m * n) + n)
+\ENDTHEOREM
\THEOREM MULT\_EQ\_0 arithmetic
|- !m n. (m * n = 0) = (m = 0) \/ (n = 0)
\ENDTHEOREM
@@ -879,12 +867,12 @@
\THEOREM NOT\_LEQ arithmetic
|- !m n. ~m <= n = (SUC n) <= m
\ENDTHEOREM
-\THEOREM NOT\_LESS arithmetic
-|- !m n. ~m < n = n <= m
-\ENDTHEOREM
\THEOREM NOT\_LESS\_0 prim\_rec
|- !n. ~n < 0
\ENDTHEOREM
+\THEOREM NOT\_LESS arithmetic
+|- !m n. ~m < n = n <= m
+\ENDTHEOREM
\THEOREM NOT\_LESS\_EQ prim\_rec
|- !m n. (m = n) ==> ~m < n
\ENDTHEOREM
@@ -897,18 +885,18 @@
\THEOREM NOT\_ODD\_EQ\_EVEN arithmetic
|- !n m. ~(SUC(n + n) = m + m)
\ENDTHEOREM
-\THEOREM NOT\_SUC num
-|- !n. ~(SUC n = 0)
-\ENDTHEOREM
\THEOREM NOT\_SUC\_ADD\_LESS\_EQ arithmetic
|- !m n. ~(SUC(m + n)) <= m
\ENDTHEOREM
-\THEOREM NOT\_SUC\_LESS\_EQ arithmetic
-|- !n m. ~(SUC n) <= m = m <= n
+\THEOREM NOT\_SUC num
+|- !n. ~(SUC n = 0)
\ENDTHEOREM
\THEOREM NOT\_SUC\_LESS\_EQ\_0 arithmetic
|- !n. ~(SUC n) <= 0
\ENDTHEOREM
+\THEOREM NOT\_SUC\_LESS\_EQ arithmetic
+|- !n m. ~(SUC n) <= m = m <= n
+\ENDTHEOREM
\THEOREM num\_Axiom prim\_rec
|- !e f. ?! fn. (fn 0 = e) /\ (!n. fn(SUC n) = f(fn n)n)
\ENDTHEOREM
@@ -922,12 +910,12 @@
\THEOREM num\_TY\_DEF num
|- ?rep. TYPE_DEFINITION IS_NUM_REP rep
\ENDTHEOREM
-\THEOREM ODD arithmetic
-|- (ODD 0 = F) /\ (!n. ODD(SUC n) = ~ODD n)
-\ENDTHEOREM
\THEOREM ODD\_ADD arithmetic
|- !m n. ODD(m + n) = ~(ODD m = ODD n)
\ENDTHEOREM
+\THEOREM ODD arithmetic
+|- (ODD 0 = F) /\ (!n. ODD(SUC n) = ~ODD n)
+\ENDTHEOREM
\THEOREM ODD\_DOUBLE arithmetic
|- !n. ODD(SUC(2 * n))
\ENDTHEOREM
@@ -946,18 +934,18 @@
\THEOREM OR\_LESS arithmetic
|- !m n. (SUC m) <= n ==> m < n
\ENDTHEOREM
-\THEOREM PRE prim\_rec
-|- (PRE 0 = 0) /\ (!m. PRE(SUC m) = m)
-\ENDTHEOREM
\THEOREM PRE\_DEF prim\_rec
|- !m. PRE m = ((m = 0) => 0 | (@n. m = SUC n))
\ENDTHEOREM
-\THEOREM PRE\_SUB arithmetic
-|- !m n. PRE(m - n) = (PRE m) - n
+\THEOREM PRE prim\_rec
+|- (PRE 0 = 0) /\ (!m. PRE(SUC m) = m)
\ENDTHEOREM
\THEOREM PRE\_SUB1 arithmetic
|- !m. PRE m = m - 1
\ENDTHEOREM
+\THEOREM PRE\_SUB arithmetic
+|- !m n. PRE(m - n) = (PRE m) - n
+\ENDTHEOREM
\THEOREM PRE\_SUC\_EQ arithmetic
|- !m n. 0 < n ==> ((m = PRE n) = (SUC m = n))
\ENDTHEOREM
@@ -1013,9 +1001,6 @@
(SIMP_REC x f 0 = x) /\
(!m. SIMP_REC x f(SUC m) = f(SIMP_REC x f m))
\ENDTHEOREM
-\THEOREM SUB arithmetic
-|- (!m. 0 - m = 0) /\ (!m n. (SUC m) - n = (m < n => 0 | SUC(m - n)))
-\ENDTHEOREM
\THEOREM SUB\_0 arithmetic
|- !m. (0 - m = 0) /\ (m - 0 = m)
\ENDTHEOREM
@@ -1025,8 +1010,8 @@
\THEOREM SUB\_CANCEL arithmetic
|- !p n m. n <= p /\ m <= p ==> ((p - n = p - m) = (n = m))
\ENDTHEOREM
-\THEOREM SUB\_EQUAL\_0 arithmetic
-|- !c. c - c = 0
+\THEOREM SUB arithmetic
+|- (!m. 0 - m = 0) /\ (!m n. (SUC m) - n = (m < n => 0 | SUC(m - n)))
\ENDTHEOREM
\THEOREM SUB\_EQ\_0 arithmetic
|- !m n. (m - n = 0) = m <= n
@@ -1034,6 +1019,9 @@
\THEOREM SUB\_EQ\_EQ\_0 arithmetic
|- !m n. (m - n = m) = (m = 0) \/ (n = 0)
\ENDTHEOREM
+\THEOREM SUB\_EQUAL\_0 arithmetic
+|- !c. c - c = 0
+\ENDTHEOREM
\THEOREM SUB\_LEFT\_ADD arithmetic
|- !m n p. m + (n - p) = (n <= p => m | (m + n) - p)
\ENDTHEOREM
@@ -1061,12 +1049,12 @@
\THEOREM SUB\_LESS\_0 arithmetic
|- !n m. m < n = 0 < (n - m)
\ENDTHEOREM
-\THEOREM SUB\_LESS\_EQ arithmetic
-|- !n m. (n - m) <= n
-\ENDTHEOREM
\THEOREM SUB\_LESS\_EQ\_ADD arithmetic
|- !m p. m <= p ==> (!n. (p - m) <= n = p <= (m + n))
\ENDTHEOREM
+\THEOREM SUB\_LESS\_EQ arithmetic
+|- !n m. (n - m) <= n
+\ENDTHEOREM
\THEOREM SUB\_LESS\_OR arithmetic
|- !m n. n < m ==> n <= (m - 1)
\ENDTHEOREM
@@ -1148,12 +1136,7 @@
\THEOREM ZERO\_REP\_DEF num
|- ZERO_REP = (@x. !y. ~(x = SUC_REP y))
\ENDTHEOREM
-\section{Theorems about lists}
-\THEOREM ALL\_EL list
-|- (!P. ALL_EL P[] = T) /\
- (!P x l. ALL_EL P(CONS x l) = P x /\ ALL_EL P l)
-\ENDTHEOREM
-\THEOREM ALL\_EL\_APPEND list
+\section{Theorems about lists}\THEOREM ALL\_EL\_APPEND list
|- !P l1 l2. ALL_EL P(APPEND l1 l2) = ALL_EL P l1 /\ ALL_EL P l2
\ENDTHEOREM
\THEOREM ALL\_EL\_BUTFIRSTN list
@@ -1166,6 +1149,10 @@
\THEOREM ALL\_EL\_CONJ list
|- !P Q l. ALL_EL(\x. P x /\ Q x)l = ALL_EL P l /\ ALL_EL Q l
\ENDTHEOREM
+\THEOREM ALL\_EL list
+|- (!P. ALL_EL P[] = T) /\
+ (!P x l. ALL_EL P(CONS x l) = P x /\ ALL_EL P l)
+\ENDTHEOREM
\THEOREM ALL\_EL\_FIRSTN list
|- !P l. ALL_EL P l ==> (!m. m <= (LENGTH l) ==> ALL_EL P(FIRSTN m l))
\ENDTHEOREM
@@ -1214,13 +1201,12 @@
(!h t l. AP(CONS h t)l = CONS(h(HD l))(AP t(TL l)))
\ENDTHEOREM
-\THEOREM APPEND list
-|- (!l. APPEND[]l = l) /\
- (!l1 l2 h. APPEND(CONS h l1)l2 = CONS h(APPEND l1 l2))
-\ENDTHEOREM
\THEOREM APPEND\_ASSOC list
|- !l1 l2 l3. APPEND l1(APPEND l2 l3) = APPEND(APPEND l1 l2)l3
\ENDTHEOREM
+\THEOREM APPEND\_BUTLAST\_LAST list
+|- !l. ~(l = []) ==> (APPEND(BUTLAST l)[LAST l] = l)
+\ENDTHEOREM
\THEOREM APPEND\_BUTLASTN\_BUTFIRSTN list
|- !m n l.
(m + n = LENGTH l) ==> (APPEND(BUTLASTN m l)(BUTFIRSTN n l) = l)
@@ -1228,8 +1214,9 @@
\THEOREM APPEND\_BUTLASTN\_LASTN list
|- !n l. n <= (LENGTH l) ==> (APPEND(BUTLASTN n l)(LASTN n l) = l)
\ENDTHEOREM
-\THEOREM APPEND\_BUTLAST\_LAST list
-|- !l. ~(l = []) ==> (APPEND(BUTLAST l)[LAST l] = l)
+\THEOREM APPEND list
+|- (!l. APPEND[]l = l) /\
+ (!l1 l2 h. APPEND(CONS h l1)l2 = CONS h(APPEND l1 l2))
\ENDTHEOREM
\THEOREM APPEND\_FIRSTN\_BUTFIRSTN list
|- !n l. n <= (LENGTH l) ==> (APPEND(FIRSTN n l)(BUTFIRSTN n l) = l)
@@ -1273,10 +1260,6 @@
LEFT_ID f e ==>
(!l. FOLDR f e(FLAT l) = FOLDR f e(MAP(FOLDR f e)l)))
\ENDTHEOREM
-\THEOREM BUTFIRSTN list
-|- (!l. BUTFIRSTN 0 l = l) /\
- (!n x l. BUTFIRSTN(SUC n)(CONS x l) = BUTFIRSTN n l)
-\ENDTHEOREM
\THEOREM BUTFIRSTN\_APPEND1 list
|- !n l1.
n <= (LENGTH l1) ==>
@@ -1292,6 +1275,10 @@
(n + m) <= (LENGTH l) ==>
(BUTFIRSTN n(BUTFIRSTN m l) = BUTFIRSTN(n + m)l)
\ENDTHEOREM
+\THEOREM BUTFIRSTN list
+|- (!l. BUTFIRSTN 0 l = l) /\
+ (!n x l. BUTFIRSTN(SUC n)(CONS x l) = BUTFIRSTN n l)
+\ENDTHEOREM
\THEOREM BUTFIRSTN\_LASTN list
|- !n l. n <= (LENGTH l) ==> (BUTFIRSTN n l = LASTN((LENGTH l) - n)l)
\ENDTHEOREM
@@ -1313,13 +1300,12 @@
n <= (LENGTH l) ==>
(!x. BUTFIRSTN n(SNOC x l) = SNOC x(BUTFIRSTN n l))
\ENDTHEOREM
+\THEOREM BUTLAST\_DEF list
+|- !l. BUTLAST l = SEG(PRE(LENGTH l))0 l
+\ENDTHEOREM
\THEOREM BUTLAST list
|- !x l. BUTLAST(SNOC x l) = l
\ENDTHEOREM
-\THEOREM BUTLASTN list
-|- (!l. BUTLASTN 0 l = l) /\
- (!n x l. BUTLASTN(SUC n)(SNOC x l) = BUTLASTN n l)
-\ENDTHEOREM
\THEOREM BUTLASTN\_1 list
|- !l. ~(l = []) ==> (BUTLASTN 1 l = BUTLAST l)
\ENDTHEOREM
@@ -1347,6 +1333,10 @@
n <= (LENGTH l) ==>
(!x. BUTLASTN n(CONS x l) = CONS x(BUTLASTN n l))
\ENDTHEOREM
+\THEOREM BUTLASTN list
+|- (!l. BUTLASTN 0 l = l) /\
+ (!n x l. BUTLASTN(SUC n)(SNOC x l) = BUTLASTN n l)
+\ENDTHEOREM
\THEOREM BUTLASTN\_FIRSTN list
|- !n l. n <= (LENGTH l) ==> (BUTLASTN n l = FIRSTN((LENGTH l) - n)l)
\ENDTHEOREM
@@ -1381,9 +1371,6 @@
\THEOREM BUTLASTN\_SUC\_BUTLAST list
|- !n l. n < (LENGTH l) ==> (BUTLASTN(SUC n)l = BUTLASTN n(BUTLAST l))
\ENDTHEOREM
-\THEOREM BUTLAST\_DEF list
-|- !l. BUTLAST l = SEG(PRE(LENGTH l))0 l
-\ENDTHEOREM
\THEOREM COMM\_ASSOC\_FOLDL\_REVERSE list
|- !f. COMM f ==> ASSOC f ==> (!e l. FOLDL f e(REVERSE l) = FOLDL f e l)
\ENDTHEOREM
@@ -1400,9 +1387,6 @@
COMM f ==>
(!e'. MONOID f e' ==> (!e l. FOLDR f e l = f e(FOLDR f e' l)))
\ENDTHEOREM
-\THEOREM CONS list
-|- !l. ~NULL l ==> (CONS(HD l)(TL l) = l)
-\ENDTHEOREM
\THEOREM CONS\_11 list
|- !h t h' t'. (CONS h t = CONS h' t') = (h = h') /\ (t = t')
\ENDTHEOREM
@@ -1415,11 +1399,28 @@
ABS_list
((\m. ((m = 0) => h | FST(REP_list t)(PRE m))),SUC(SND(REP_list t)))
\ENDTHEOREM
+\THEOREM CONS list
+|- !l. ~NULL l ==> (CONS(HD l)(TL l) = l)
+\ENDTHEOREM
+\THEOREM EL\_APPEND1 list
+|- !n l1 l2. n < (LENGTH l1) ==> (EL n(APPEND l1 l2) = EL n l1)
+\ENDTHEOREM
+\THEOREM EL\_APPEND2 list
+|- !l1 n.
+ (LENGTH l1) <= n ==>
+ (!l2. EL n(APPEND l1 l2) = EL(n - (LENGTH l1))l2)
+\ENDTHEOREM
+\THEOREM EL\_CONS list
+|- !n. 0 < n ==> (!x l. EL n(CONS x l) = EL(PRE n)l)
+\ENDTHEOREM
\THEOREM EL list
|- (!l. EL 0 l = HD l) /\ (!l n. EL(SUC n)l = EL n(TL l))
\ENDTHEOREM
-\THEOREM ELL list
-|- (!l. ELL 0 l = LAST l) /\ (!n l. ELL(SUC n)l = ELL n(BUTLAST l))
+\THEOREM EL\_ELL list
+|- !n l. n < (LENGTH l) ==> (EL n l = ELL(PRE((LENGTH l) - n))l)
+\ENDTHEOREM
+\THEOREM EL\_IS\_EL list
+|- !n l. n < (LENGTH l) ==> IS_EL(EL n l)l
\ENDTHEOREM
\THEOREM ELL\_0\_SNOC list
|- !l x. ELL 0(SNOC x l) = x
@@ -1435,9 +1436,18 @@
\THEOREM ELL\_CONS list
|- !n l. n < (LENGTH l) ==> (!x. ELL n(CONS x l) = ELL n l)
\ENDTHEOREM
+\THEOREM ELL list
+|- (!l. ELL 0 l = LAST l) /\ (!n l. ELL(SUC n)l = ELL n(BUTLAST l))
+\ENDTHEOREM
\THEOREM ELL\_EL list
|- !n l. n < (LENGTH l) ==> (ELL n l = EL(PRE((LENGTH l) - n))l)
\ENDTHEOREM
+\THEOREM EL\_LENGTH\_APPEND list
+|- !l2 l1. ~NULL l2 ==> (EL(LENGTH l1)(APPEND l1 l2) = HD l2)
+\ENDTHEOREM
+\THEOREM EL\_LENGTH\_SNOC list
+|- !l x. EL(LENGTH l)(SNOC x l) = x
+\ENDTHEOREM
\THEOREM ELL\_IS\_EL list
|- !n l. n < (LENGTH l) ==> IS_EL(EL n l)l
\ENDTHEOREM
@@ -1475,29 +1485,6 @@
\THEOREM ELL\_SUC\_SNOC list
|- !n x l. ELL(SUC n)(SNOC x l) = ELL n l
\ENDTHEOREM
-\THEOREM EL\_APPEND1 list
-|- !n l1 l2. n < (LENGTH l1) ==> (EL n(APPEND l1 l2) = EL n l1)
-\ENDTHEOREM
-\THEOREM EL\_APPEND2 list
-|- !l1 n.
- (LENGTH l1) <= n ==>
- (!l2. EL n(APPEND l1 l2) = EL(n - (LENGTH l1))l2)
-\ENDTHEOREM
-\THEOREM EL\_CONS list
-|- !n. 0 < n ==> (!x l. EL n(CONS x l) = EL(PRE n)l)
-\ENDTHEOREM
-\THEOREM EL\_ELL list
-|- !n l. n < (LENGTH l) ==> (EL n l = ELL(PRE((LENGTH l) - n))l)
-\ENDTHEOREM
-\THEOREM EL\_IS\_EL list
-|- !n l. n < (LENGTH l) ==> IS_EL(EL n l)l
-\ENDTHEOREM
-\THEOREM EL\_LENGTH\_APPEND list
-|- !l2 l1. ~NULL l2 ==> (EL(LENGTH l1)(APPEND l1 l2) = HD l2)
-\ENDTHEOREM
-\THEOREM EL\_LENGTH\_SNOC list
-|- !l x. EL(LENGTH l)(SNOC x l) = x
-\ENDTHEOREM
\THEOREM EL\_MAP list
|- !n l. n < (LENGTH l) ==> (!f. EL n(MAP f l) = f(EL n l))
\ENDTHEOREM
@@ -1548,17 +1535,17 @@
LEFT_ID g e ==>
(!l. FOLDR f e(FLAT l) = FOLDR g e(MAP(FOLDR f e)l)))
\ENDTHEOREM
-\THEOREM FILTER list
-|- (!P. FILTER P[] = []) /\
- (!P x l.
- FILTER P(CONS x l) = (P x => CONS x(FILTER P l) | FILTER P l))
-\ENDTHEOREM
\THEOREM FILTER\_APPEND list
|- !f l1 l2. FILTER f(APPEND l1 l2) = APPEND(FILTER f l1)(FILTER f l2)
\ENDTHEOREM
\THEOREM FILTER\_COMM list
|- !f1 f2 l. FILTER f1(FILTER f2 l) = FILTER f2(FILTER f1 l)
\ENDTHEOREM
+\THEOREM FILTER list
+|- (!P. FILTER P[] = []) /\
+ (!P x l.
+ FILTER P(CONS x l) = (P x => CONS x(FILTER P l) | FILTER P l))
+\ENDTHEOREM
\THEOREM FILTER\_FILTER list
|- !P Q l. FILTER P(FILTER Q l) = FILTER(\x. P x /\ Q x)l
\ENDTHEOREM
@@ -1583,10 +1570,6 @@
\THEOREM FILTER\_SNOC list
|- !P x l. FILTER P(SNOC x l) = (P x => SNOC x(FILTER P l) | FILTER P l)
\ENDTHEOREM
-\THEOREM FIRSTN list
-|- (!l. FIRSTN 0 l = []) /\
- (!n x l. FIRSTN(SUC n)(CONS x l) = CONS x(FIRSTN n l))
-\ENDTHEOREM
\THEOREM FIRSTN\_APPEND1 list
|- !n l1.
n <= (LENGTH l1) ==> (!l2. FIRSTN n(APPEND l1 l2) = FIRSTN n l1)
@@ -1599,6 +1582,10 @@
\THEOREM FIRSTN\_BUTLASTN list
|- !n l. n <= (LENGTH l) ==> (FIRSTN n l = BUTLASTN((LENGTH l) - n)l)
\ENDTHEOREM
+\THEOREM FIRSTN list
+|- (!l. FIRSTN 0 l = []) /\
+ (!n x l. FIRSTN(SUC n)(CONS x l) = CONS x(FIRSTN n l))
+\ENDTHEOREM
\THEOREM FIRSTN\_FIRSTN list
|- !m l.
m <= (LENGTH l) ==>
@@ -1619,12 +1606,12 @@
\THEOREM FIRSTN\_SNOC list
|- !n l. n <= (LENGTH l) ==> (!x. FIRSTN n(SNOC x l) = FIRSTN n l)
\ENDTHEOREM
-\THEOREM FLAT list
-|- (FLAT[] = []) /\ (!h t. FLAT(CONS h t) = APPEND h(FLAT t))
-\ENDTHEOREM
\THEOREM FLAT\_APPEND list
|- !l1 l2. FLAT(APPEND l1 l2) = APPEND(FLAT l1)(FLAT l2)
\ENDTHEOREM
+\THEOREM FLAT list
+|- (FLAT[] = []) /\ (!h t. FLAT(CONS h t) = APPEND h(FLAT t))
+\ENDTHEOREM
\THEOREM FLAT\_FLAT list
|- !l. FLAT(FLAT l) = FLAT(MAP FLAT l)
\ENDTHEOREM
@@ -1640,13 +1627,13 @@
\THEOREM FLAT\_SNOC list
|- !x l. FLAT(SNOC x l) = APPEND(FLAT l)x
\ENDTHEOREM
+\THEOREM FOLDL\_APPEND list
+|- !f e l1 l2. FOLDL f e(APPEND l1 l2) = FOLDL f(FOLDL f e l1)l2
+\ENDTHEOREM
\THEOREM FOLDL list
|- (!f e. FOLDL f e[] = e) /\
(!f e x l. FOLDL f e(CONS x l) = FOLDL f(f e x)l)
\ENDTHEOREM
-\THEOREM FOLDL\_APPEND list
-|- !f e l1 l2. FOLDL f e(APPEND l1 l2) = FOLDL f(FOLDL f e l1)l2
-\ENDTHEOREM
\THEOREM FOLDL\_FILTER list
|- !f e P l. FOLDL f e(FILTER P l) = FOLDL(\x y. (P y => f x y | x))e l
\ENDTHEOREM
@@ -1668,16 +1655,16 @@
\THEOREM FOLDL\_SNOC\_NIL list
|- !l. FOLDL(\xs x. SNOC x xs)[]l = l
\ENDTHEOREM
-\THEOREM FOLDR list
-|- (!f e. FOLDR f e[] = e) /\
- (!f e x l. FOLDR f e(CONS x l) = f x(FOLDR f e l))
-\ENDTHEOREM
\THEOREM FOLDR\_APPEND list
|- !f e l1 l2. FOLDR f e(APPEND l1 l2) = FOLDR f(FOLDR f e l2)l1
\ENDTHEOREM
\THEOREM FOLDR\_CONS\_NIL list
|- !l. FOLDR CONS[]l = l
\ENDTHEOREM
+\THEOREM FOLDR list
+|- (!f e. FOLDR f e[] = e) /\
+ (!f e x l. FOLDR f e(CONS x l) = f x(FOLDR f e l))
+\ENDTHEOREM
\THEOREM FOLDR\_FILTER list
|- !f e P l. FOLDR f e(FILTER P l) = FOLDR(\x y. (P x => f x y | y))e l
\ENDTHEOREM
@@ -1716,10 +1703,6 @@
\THEOREM HD list
|- !h t. HD(CONS h t) = h
\ENDTHEOREM
-\THEOREM IS\_EL list
-|- (!x. IS_EL x[] = F) /\
- (!y x l. IS_EL y(CONS x l) = (y = x) \/ IS_EL y l)
-\ENDTHEOREM
\THEOREM IS\_EL\_APPEND list
|- !l1 l2 x. IS_EL x(APPEND l1 l2) = IS_EL x l1 \/ IS_EL x l2
\ENDTHEOREM
@@ -1732,6 +1715,10 @@
\THEOREM IS\_EL\_DEF list
|- !x l. IS_EL x l = SOME_EL($= x)l
\ENDTHEOREM
+\THEOREM IS\_EL list
+|- (!x. IS_EL x[] = F) /\
+ (!y x l. IS_EL y(CONS x l) = (y = x) \/ IS_EL y l)
+\ENDTHEOREM
\THEOREM IS\_EL\_FILTER list
|- !P x. P x ==> (!l. IS_EL x(FILTER P l) = IS_EL x l)
\ENDTHEOREM
@@ -1772,15 +1759,15 @@
\THEOREM IS\_list\_REP list
|- !r. IS_list_REP r = (?f n. r = (\m. (m < n => f m | (@x. T))),n)
\ENDTHEOREM
+\THEOREM IS\_PREFIX\_APPEND list
+|- !l1 l2. IS_PREFIX l1 l2 = (?l. l1 = APPEND l2 l)
+\ENDTHEOREM
\THEOREM IS\_PREFIX list
|- (!l. IS_PREFIX l[] = T) /\
(!x l. IS_PREFIX[](CONS x l) = F) /\
(!x1 l1 x2 l2.
IS_PREFIX(CONS x1 l1)(CONS x2 l2) = (x1 = x2) /\ IS_PREFIX l1 l2)
\ENDTHEOREM
-\THEOREM IS\_PREFIX\_APPEND list
-|- !l1 l2. IS_PREFIX l1 l2 = (?l. l1 = APPEND l2 l)
-\ENDTHEOREM
\THEOREM IS\_PREFIX\_IS\_SUBLIST list
|- !l1 l2. IS_PREFIX l1 l2 ==> IS_SUBLIST l1 l2
\ENDTHEOREM
@@ -1790,6 +1777,9 @@
\THEOREM IS\_PREFIX\_REVERSE list
|- !l1 l2. IS_PREFIX(REVERSE l1)(REVERSE l2) = IS_SUFFIX l1 l2
\ENDTHEOREM
+\THEOREM IS\_SUBLIST\_APPEND list
+|- !l1 l2. IS_SUBLIST l1 l2 = (?l l'. l1 = APPEND l(APPEND l2 l'))
+\ENDTHEOREM
\THEOREM IS\_SUBLIST list
|- (!l. IS_SUBLIST l[] = T) /\
(!x l. IS_SUBLIST[](CONS x l) = F) /\
@@ -1797,33 +1787,32 @@
IS_SUBLIST(CONS x1 l1)(CONS x2 l2) =
(x1 = x2) /\ IS_PREFIX l1 l2 \/ IS_SUBLIST l1(CONS x2 l2))
\ENDTHEOREM
-\THEOREM IS\_SUBLIST\_APPEND list
-|- !l1 l2. IS_SUBLIST l1 l2 = (?l l'. l1 = APPEND l(APPEND l2 l'))
-\ENDTHEOREM
\THEOREM IS\_SUBLIST\_REVERSE list
|- !l1 l2. IS_SUBLIST(REVERSE l1)(REVERSE l2) = IS_SUBLIST l1 l2
\ENDTHEOREM
+\THEOREM IS\_SUFFIX\_APPEND list
+|- !l1 l2. IS_SUFFIX l1 l2 = (?l. l1 = APPEND l l2)
+\ENDTHEOREM
\THEOREM IS\_SUFFIX list
|- (!l. IS_SUFFIX l[] = T) /\
(!x l. IS_SUFFIX[](SNOC x l) = F) /\
(!x1 l1 x2 l2.
IS_SUFFIX(SNOC x1 l1)(SNOC x2 l2) = (x1 = x2) /\ IS_SUFFIX l1 l2)
\ENDTHEOREM
-\THEOREM IS\_SUFFIX\_APPEND list
-|- !l1 l2. IS_SUFFIX l1 l2 = (?l. l1 = APPEND l l2)
-\ENDTHEOREM
\THEOREM IS\_SUFFIX\_IS\_SUBLIST list
|- !l1 l2. IS_SUFFIX l1 l2 ==> IS_SUBLIST l1 l2
\ENDTHEOREM
\THEOREM IS\_SUFFIX\_REVERSE list
|- !l1 l2. IS_SUFFIX(REVERSE l1)(REVERSE l2) = IS_PREFIX l1 l2
\ENDTHEOREM
+\THEOREM LAST\_DEF list
+|- !l. LAST l = HD(SEG 1(PRE(LENGTH l))l)
+\ENDTHEOREM
\THEOREM LAST list
|- !x l. LAST(SNOC x l) = x
\ENDTHEOREM
-\THEOREM LASTN list
-|- (!l. LASTN 0 l = []) /\
- (!n x l. LASTN(SUC n)(SNOC x l) = SNOC x(LASTN n l))
+\THEOREM LAST\_LASTN\_LAST list
+|- !n l. n <= (LENGTH l) ==> 0 < n ==> (LAST(LASTN n l) = LAST l)
\ENDTHEOREM
\THEOREM LASTN\_1 list
|- !l. ~(l = []) ==> (LASTN 1 l = [LAST l])
@@ -1847,6 +1836,10 @@
\THEOREM LASTN\_CONS list
|- !n l. n <= (LENGTH l) ==> (!x. LASTN n(CONS x l) = LASTN n l)
\ENDTHEOREM
+\THEOREM LASTN list
+|- (!l. LASTN 0 l = []) /\
+ (!n x l. LASTN(SUC n)(SNOC x l) = SNOC x(LASTN n l))
+\ENDTHEOREM
\THEOREM LASTN\_LASTN list
|- !l n m.
m <= (LENGTH l) ==> n <= m ==> (LASTN n(LASTN m l) = LASTN n l)
@@ -1866,15 +1859,6 @@
\THEOREM LASTN\_SEG list
|- !n l. n <= (LENGTH l) ==> (LASTN n l = SEG n((LENGTH l) - n)l)
\ENDTHEOREM
-\THEOREM LAST\_DEF list
-|- !l. LAST l = HD(SEG 1(PRE(LENGTH l))l)
-\ENDTHEOREM
-\THEOREM LAST\_LASTN\_LAST list
-|- !n l. n <= (LENGTH l) ==> 0 < n ==> (LAST(LASTN n l) = LAST l)
-\ENDTHEOREM
-\THEOREM LENGTH list
-|- (LENGTH[] = 0) /\ (!h t. LENGTH(CONS h t) = SUC(LENGTH t))
-\ENDTHEOREM
\THEOREM LENGTH\_APPEND list
|- !l1 l2. LENGTH(APPEND l1 l2) = (LENGTH l1) + (LENGTH l2)
\ENDTHEOREM
@@ -1891,14 +1875,17 @@
|- !l n.
(LENGTH l = SUC n) = (?h l'. (LENGTH l' = n) /\ (l = CONS h l'))
\ENDTHEOREM
-\THEOREM LENGTH\_EQ list
-|- !x y. (x = y) ==> (LENGTH x = LENGTH y)
+\THEOREM LENGTH list
+|- (LENGTH[] = 0) /\ (!h t. LENGTH(CONS h t) = SUC(LENGTH t))
\ENDTHEOREM
\THEOREM LENGTH\_EQ\_CONS list
|- !P n.
(!l. (LENGTH l = SUC n) ==> P l) =
(!l. (LENGTH l = n) ==> (\l. !x. P(CONS x l))l)
\ENDTHEOREM
+\THEOREM LENGTH\_EQ list
+|- !x y. (x = y) ==> (LENGTH x = LENGTH y)
+\ENDTHEOREM
\THEOREM LENGTH\_EQ\_NIL list
|- !P. (!l. (LENGTH l = 0) ==> P l) = P[]
\ENDTHEOREM
@@ -1920,9 +1907,6 @@
\THEOREM LENGTH\_LASTN list
|- !n l. n <= (LENGTH l) ==> (LENGTH(LASTN n l) = n)
\ENDTHEOREM
-\THEOREM LENGTH\_MAP list
-|- !l f. LENGTH(MAP f l) = LENGTH l
-\ENDTHEOREM
\THEOREM LENGTH\_MAP2 list
|- !l1 l2.
(LENGTH l1 = LENGTH l2) ==>
@@ -1930,6 +1914,9 @@
(LENGTH(MAP2 f l1 l2) = LENGTH l1) /\
(LENGTH(MAP2 f l1 l2) = LENGTH l2))
\ENDTHEOREM
+\THEOREM LENGTH\_MAP list
+|- !l f. LENGTH(MAP f l) = LENGTH l
+\ENDTHEOREM
\THEOREM LENGTH\_NIL list
|- !l. (LENGTH l = 0) = (l = [])
\ENDTHEOREM
@@ -1984,9 +1971,6 @@
\THEOREM list\_TY\_DEF list
|- ?rep. TYPE_DEFINITION IS_list_REP rep
\ENDTHEOREM
-\THEOREM MAP list
-|- (!f. MAP f[] = []) /\ (!f h t. MAP f(CONS h t) = CONS(f h)(MAP f t))
-\ENDTHEOREM
\THEOREM MAP2 list
|- (!f. MAP2 f[][] = []) /\
(!f h1 t1 h2 t2.
@@ -2000,6 +1984,9 @@
\THEOREM MAP\_APPEND list
|- !f l1 l2. MAP f(APPEND l1 l2) = APPEND(MAP f l1)(MAP f l2)
\ENDTHEOREM
+\THEOREM MAP list
+|- (!f. MAP f[] = []) /\ (!f h t. MAP f(CONS h t) = CONS(f h)(MAP f t))
+\ENDTHEOREM
\THEOREM MAP\_FILTER list
|- !f P l.
(!x. P(f x) = P x) ==> (MAP f(FILTER P l) = FILTER P(MAP f l))
@@ -2052,12 +2039,12 @@
\THEOREM NOT\_SOME\_EL\_ALL\_EL list
|- !P l. ~SOME_EL P l = ALL_EL($~ o P)l
\ENDTHEOREM
-\THEOREM NULL list
-|- NULL[] /\ (!h t. ~NULL(CONS h t))
-\ENDTHEOREM
\THEOREM NULL\_DEF list
|- (NULL[] = T) /\ (!h t. NULL(CONS h t) = F)
\ENDTHEOREM
+\THEOREM NULL list
+|- NULL[] /\ (!h t. ~NULL(CONS h t))
+\ENDTHEOREM
\THEOREM NULL\_EQ\_NIL list
|- !l. NULL l = (l = [])
\ENDTHEOREM
@@ -2081,13 +2068,13 @@
(!n t l.
PART(CONS n t)l = CONS(FST(SPLIT n l))(PART t(SND(SPLIT n l))))
\ENDTHEOREM
+\THEOREM PREFIX\_DEF list
+|- !P l. PREFIX P l = FST(SPLITP($~ o P)l)
+\ENDTHEOREM
\THEOREM PREFIX list
|- (!P. PREFIX P[] = []) /\
(!P x l. PREFIX P(CONS x l) = (P x => CONS x(PREFIX P l) | []))
\ENDTHEOREM
-\THEOREM PREFIX\_DEF list
-|- !P l. PREFIX P l = FST(SPLITP($~ o P)l)
-\ENDTHEOREM
\THEOREM PREFIX\_FOLDR list
|- !P l. PREFIX P l = FOLDR(\x l'. (P x => CONS x l' | []))[]l
\ENDTHEOREM
@@ -2095,12 +2082,12 @@
|- (!x. REPLICATE 0 x = []) /\
(!n x. REPLICATE(SUC n)x = CONS x(REPLICATE n x))
\ENDTHEOREM
-\THEOREM REVERSE list
-|- (REVERSE[] = []) /\ (!x l. REVERSE(CONS x l) = SNOC x(REVERSE l))
-\ENDTHEOREM
\THEOREM REVERSE\_APPEND list
|- !l1 l2. REVERSE(APPEND l1 l2) = APPEND(REVERSE l2)(REVERSE l1)
\ENDTHEOREM
+\THEOREM REVERSE list
+|- (REVERSE[] = []) /\ (!x l. REVERSE(CONS x l) = SNOC x(REVERSE l))
+\ENDTHEOREM
\THEOREM REVERSE\_EQ\_NIL list
|- !l. (REVERSE l = []) = (l = [])
\ENDTHEOREM
@@ -2128,22 +2115,9 @@
(!f e x l.
SCANR f e(CONS x l) = CONS(f x(HD(SCANR f e l)))(SCANR f e l))
\ENDTHEOREM
-\THEOREM SEG list
-|- (!k l. SEG 0 k l = []) /\
- (!m x l. SEG(SUC m)0(CONS x l) = CONS x(SEG m 0 l)) /\
- (!m k x l. SEG(SUC m)(SUC k)(CONS x l) = SEG(SUC m)k l)
-\ENDTHEOREM
\THEOREM SEG\_0\_SNOC list
|- !m l x. m <= (LENGTH l) ==> (SEG m 0(SNOC x l) = SEG m 0 l)
\ENDTHEOREM
-\THEOREM SEG\_APPEND list
-|- !m l1 n l2.
- m < (LENGTH l1) /\
- (LENGTH l1) <= (n + m) /\
- (n + m) <= ((LENGTH l1) + (LENGTH l2)) ==>
- (SEG n m(APPEND l1 l2) =
- APPEND(SEG((LENGTH l1) - m)m l1)(SEG((n + m) - (LENGTH l1))0 l2))
-\ENDTHEOREM
\THEOREM SEG\_APPEND1 list
|- !n m l1.
(n + m) <= (LENGTH l1) ==> (!l2. SEG n m(APPEND l1 l2) = SEG n m l1)
@@ -2153,6 +2127,19 @@
(LENGTH l1) <= m /\ n <= (LENGTH l2) ==>
(SEG n m(APPEND l1 l2) = SEG n(m - (LENGTH l1))l2)
\ENDTHEOREM
+\THEOREM SEG\_APPEND list
+|- !m l1 n l2.
+ m < (LENGTH l1) /\
+ (LENGTH l1) <= (n + m) /\
+ (n + m) <= ((LENGTH l1) + (LENGTH l2)) ==>
+ (SEG n m(APPEND l1 l2) =
+ APPEND(SEG((LENGTH l1) - m)m l1)(SEG((n + m) - (LENGTH l1))0 l2))
+\ENDTHEOREM
+\THEOREM SEG list
+|- (!k l. SEG 0 k l = []) /\
+ (!m x l. SEG(SUC m)0(CONS x l) = CONS x(SEG m 0 l)) /\
+ (!m k x l. SEG(SUC m)(SUC k)(CONS x l) = SEG(SUC m)k l)
+\ENDTHEOREM
\THEOREM SEG\_FIRSTN\_BUTFISTN list
|- !n m l.
(n + m) <= (LENGTH l) ==> (SEG n m l = FIRSTN n(BUTFIRSTN m l))
@@ -2184,10 +2171,6 @@
\THEOREM SEG\_SUC\_CONS list
|- !m n l x. SEG m(SUC n)(CONS x l) = SEG m n l
\ENDTHEOREM
-\THEOREM SNOC list
-|- (!x. SNOC x[] = [x]) /\
- (!x x' l. SNOC x(CONS x' l) = CONS x'(SNOC x l))
-\ENDTHEOREM
\THEOREM SNOC\_11 list
|- !x l x' l'. (SNOC x l = SNOC x' l') = (x = x') /\ (l = l')
\ENDTHEOREM
@@ -2200,6 +2183,10 @@
\THEOREM SNOC\_CASES list
|- !l. (l = []) \/ (?l' x. l = SNOC x l')
\ENDTHEOREM
+\THEOREM SNOC list
+|- (!x. SNOC x[] = [x]) /\
+ (!x x' l. SNOC x(CONS x' l) = CONS x'(SNOC x l))
+\ENDTHEOREM
\THEOREM SNOC\_EQ\_LENGTH\_EQ list
|- !x1 l1 x2 l2. (SNOC x1 l1 = SNOC x2 l2) ==> (LENGTH l1 = LENGTH l2)
\ENDTHEOREM
@@ -2212,10 +2199,6 @@
\THEOREM SNOC\_REVERSE\_CONS list
|- !x l. SNOC x l = REVERSE(CONS x(REVERSE l))
\ENDTHEOREM
-\THEOREM SOME\_EL list
-|- (!P. SOME_EL P[] = F) /\
- (!P x l. SOME_EL P(CONS x l) = P x \/ SOME_EL P l)
-\ENDTHEOREM
\THEOREM SOME\_EL\_APPEND list
|- !P l1 l2. SOME_EL P(APPEND l1 l2) = SOME_EL P l1 \/ SOME_EL P l2
\ENDTHEOREM
@@ -2230,6 +2213,10 @@
\THEOREM SOME\_EL\_DISJ list
|- !P Q l. SOME_EL(\x. P x \/ Q x)l = SOME_EL P l \/ SOME_EL Q l
\ENDTHEOREM
+\THEOREM SOME\_EL list
+|- (!P. SOME_EL P[] = F) /\
+ (!P x l. SOME_EL P(CONS x l) = P x \/ SOME_EL P l)
+\ENDTHEOREM
\THEOREM SOME\_EL\_FIRSTN list
|- !m l. m <= (LENGTH l) ==> (!P. SOME_EL P(FIRSTN m l) ==> SOME_EL P l)
\ENDTHEOREM
@@ -2277,12 +2264,12 @@
\THEOREM SUFFIX\_DEF list
|- !P l. SUFFIX P l = FOLDL(\l' x. (P x => SNOC x l' | []))[]l
\ENDTHEOREM
-\THEOREM SUM list
-|- (SUM[] = 0) /\ (!h t. SUM(CONS h t) = h + (SUM t))
-\ENDTHEOREM
\THEOREM SUM\_APPEND list
|- !l1 l2. SUM(APPEND l1 l2) = (SUM l1) + (SUM l2)
\ENDTHEOREM
+\THEOREM SUM list
+|- (SUM[] = 0) /\ (!h t. SUM(CONS h t) = h + (SUM t))
+\ENDTHEOREM
\THEOREM SUM\_FLAT list
|- !l. SUM(FLAT l) = SUM(MAP SUM l)
\ENDTHEOREM
@@ -2336,8 +2323,7 @@
\THEOREM ZIP\_UNZIP list
|- !l. ZIP(UNZIP l) = l
\ENDTHEOREM
-\section{Theorems about trees}
-\THEOREM AP ltree
+\section{Theorems about trees}\THEOREM AP ltree
|- (!l. AP[]l = []) /\
(!h t l. AP(CONS h t)l = CONS(h(HD l))(AP t(TL l)))
\ENDTHEOREM
@@ -2372,21 +2358,21 @@
\THEOREM ltree\_TY\_DEF ltree
|- ?rep. TYPE_DEFINITION Is_ltree rep
\ENDTHEOREM
-\THEOREM Node ltree
-|- !v tl.
- Node v tl =
- ABS_ltree
- (node(MAP(FST o REP_ltree)tl),CONS v(FLAT(MAP(SND o REP_ltree)tl)))
-\ENDTHEOREM
-\THEOREM node tree
-|- !tl. node tl = ABS_tree(node_REP(MAP REP_tree tl))
+\THEOREM node\_11 tree
+|- !tl1 tl2. (node tl1 = node tl2) = (tl1 = tl2)
\ENDTHEOREM
\THEOREM Node\_11 ltree
|- !v1 v2 trl1 trl2.
(Node v1 trl1 = Node v2 trl2) = (v1 = v2) /\ (trl1 = trl2)
\ENDTHEOREM
-\THEOREM node\_11 tree
-|- !tl1 tl2. (node tl1 = node tl2) = (tl1 = tl2)
+\THEOREM node tree
+|- !tl. node tl = ABS_tree(node_REP(MAP REP_tree tl))
+\ENDTHEOREM
+\THEOREM Node ltree
+|- !v tl.
+ Node v tl =
+ ABS_ltree
+ (node(MAP(FST o REP_ltree)tl),CONS v(FLAT(MAP(SND o REP_ltree)tl)))
\ENDTHEOREM
\THEOREM Node\_onto ltree
|- !l. ?v trl. l = Node v trl
@@ -2426,8 +2412,7 @@
trf n f =
(@fn. !trl. (HT(node trl)) <= n ==> (fn(node trl) = f(MAP fn trl)))
\ENDTHEOREM
-\section{Theorems used to define types}
-\THEOREM ABS\_REP\_THM BASIC-HOL
+\section{Theorems used to define types}\THEOREM ABS\_REP\_THM BASIC-HOL
|- !P.
(?rep. TYPE_DEFINITION P rep) ==>
(?rep abs. (!a. abs(rep a) = a) /\ (!r. P r = (rep(abs r) = r)))
@@ -2435,17 +2420,11 @@
\THEOREM exists\_TRP tydefs
|- !P. (?v. P v[]) ==> (?t. TRP P t)
\ENDTHEOREM
-\THEOREM TRP tydefs
-|- !P v tl. TRP P(Node v tl) = P v tl /\ ALL_EL(TRP P)tl
-\ENDTHEOREM
\THEOREM TRP\_DEF tydefs
|- !P. TRP P = (@trp. !v tl. trp(Node v tl) = P v tl /\ ALL_EL trp tl)
\ENDTHEOREM
-\THEOREM TYPE\_DEFINITION bool
-|- !P rep.
- TYPE_DEFINITION P rep =
- (!x' x''. (rep x' = rep x'') ==> (x' = x'')) /\
- (!x. P x = (?x'. x = rep x'))
+\THEOREM TRP tydefs
+|- !P v tl. TRP P(Node v tl) = P v tl /\ ALL_EL(TRP P)tl
\ENDTHEOREM
\THEOREM TY\_DEF\_THM tydefs
|- !REP ABS P.
@@ -2456,3 +2435,9 @@
P v(MAP REP tl) ==>
(fn(ABS(Node v(MAP REP tl))) = f(MAP fn tl)v tl))
\ENDTHEOREM
+\THEOREM TYPE\_DEFINITION bool
+|- !P rep.
+ TYPE_DEFINITION P rep =
+ (!x' x''. (rep x' = rep x'') ==> (x' = x'')) /\
+ (!x. P x = (?x'. x = rep x'))
+\ENDTHEOREM
--- hol88-2.02.19940316.orig/Manual/Reference/reference.tex
+++ hol88-2.02.19940316/Manual/Reference/reference.tex
@@ -32,7 +32,7 @@
\include{title} % reference title page
\include{preface} % preface to reference manual
- \include{../LaTeX/ack} % global acknowledgements
+ \include{ack} % global acknowledgements
\include{contents} % table of contents
% ---------------------------------------------------------------------
--- hol88-2.02.19940316.orig/Manual/Reference/index.tex
+++ hol88-2.02.19940316/Manual/Reference/index.tex
@@ -1,1625 +1 @@
-\begin{theindex}
-
- \item {\ptt *}, 1
- \item {\ptt +}, 2
- \item {\ptt -}, 2
- \item {\ptt /}, 3
- \item {\ptt <}, 4
- \item {\ptt <<}, 4
- \item {\ptt =}, 4
- \item {\ptt >}, 6
- \item {\ptt \#}, 1
- \item {\ptt \char '056}, 2
- \item {\ptt \char '100}, 7
- \item {\ptt \char '136}, 3
-
- \indexspace
-
- \item {\ptt ABS}, 7
- \item {\ptt ABS\_CONV}, 8
- \item {\ptt abs\_goals}, 9
- \item {\ptt ABS\_REP\_THM}, 661
- \item {\ptt ABS\_SIMP}, 614
- \item {\ptt AC\_CONV}, 11
- \item {\ptt ACCEPT\_TAC}, 9
- \item {\ptt achieve\_first}, 10
- \item {\ptt achieves}, 10
- \item {\ptt aconv}, 10
- \item {\ptt activate\_binders}, 11
- \item {\ptt ADD}, 619
- \item {\ptt ADD1}, 619
- \item {\ptt ADD\_0}, 619
- \item {\ptt ADD\_ASSOC}, 619
- \item {\ptt ADD\_ASSUM}, 12
- \item {\ptt ADD\_CLAUSES}, 619
- \item {\ptt ADD\_CONV}, 13
- \item {\ptt ADD\_EQ\_0}, 619
- \item {\ptt ADD\_EQ\_SUB}, 619
- \item {\ptt ADD\_INV\_0}, 619
- \item {\ptt ADD\_INV\_0\_EQ}, 619
- \item {\ptt ADD\_MONO\_LESS\_EQ}, 619
- \item {\ptt ADD\_SUB}, 619
- \item {\ptt ADD\_SUC}, 619
- \item {\ptt ADD\_SYM}, 619
- \item {\ptt ALL\_CONV}, 15
- \item {\ptt ALL\_EL}, 634
- \item {\ptt ALL\_EL\_APPEND}, 634
- \item {\ptt ALL\_EL\_BUTFIRSTN}, 634
- \item {\ptt ALL\_EL\_BUTLASTN}, 634
- \item {\ptt ALL\_EL\_CONJ}, 634
- \item {\ptt ALL\_EL\_CONV}, 15
- \item {\ptt ALL\_EL\_FIRSTN}, 634
- \item {\ptt ALL\_EL\_FOLDL}, 634
- \item {\ptt ALL\_EL\_FOLDL\_MAP}, 634
- \item {\ptt ALL\_EL\_FOLDR}, 634
- \item {\ptt ALL\_EL\_FOLDR\_MAP}, 634
- \item {\ptt ALL\_EL\_LASTN}, 634
- \item {\ptt ALL\_EL\_MAP}, 634
- \item {\ptt ALL\_EL\_REPLICATE}, 634
- \item {\ptt ALL\_EL\_REVERSE}, 634
- \item {\ptt ALL\_EL\_SEG}, 635
- \item {\ptt ALL\_EL\_SNOC}, 635
- \item {\ptt ALL\_TAC}, 16
- \item {\ptt ALL\_THEN}, 17
- \item {\ptt allowed\_constant}, 14
- \item {\ptt ALPHA}, 17
- \item {\ptt ALPHA\_CONV}, 18
- \item {\ptt ancestors}, 19
- \item {\ptt ancestry}, 19
- \item {\ptt AND1\_THM}, 611
- \item {\ptt AND2\_THM}, 611
- \item {\ptt AND\_CLAUSES}, 611
- \item {\ptt AND\_DEF}, 609
- \item {\ptt AND\_EL\_DEF}, 635
- \item {\ptt AND\_EL\_FOLDL}, 635
- \item {\ptt AND\_EL\_FOLDR}, 635
- \item {\ptt AND\_EXISTS\_CONV}, 20
- \item {\ptt AND\_FORALL\_CONV}, 20
- \item {\ptt AND\_IMP\_INTRO}, 611
- \item {\ptt AND\_INTRO\_THM}, 611
- \item {\ptt ANTE\_CONJ\_CONV}, 21
- \item {\ptt ANTE\_RES\_THEN}, 21
- \item {\ptt AP}, 635, 659
- \item {\ptt AP\_TERM}, 25
- \item {\ptt AP\_TERM\_TAC}, 25
- \item {\ptt AP\_THM}, 26
- \item {\ptt AP\_THM\_TAC}, 26
- \item {\ptt APPEND}, 635
- \item {\ptt append}, 22
- \item {\ptt APPEND\_ASSOC}, 635
- \item {\ptt APPEND\_BUTLAST\_LAST}, 635
- \item {\ptt APPEND\_BUTLASTN\_BUTFIRSTN}, 635
- \item {\ptt APPEND\_BUTLASTN\_LASTN}, 635
- \item {\ptt APPEND\_CONV}, 23
- \item {\ptt APPEND\_FIRSTN\_BUTFIRSTN}, 635
- \item {\ptt APPEND\_FIRSTN\_LASTN}, 635
- \item {\ptt APPEND\_FOLDL}, 635
- \item {\ptt APPEND\_FOLDR}, 636
- \item {\ptt APPEND\_LENGTH\_EQ}, 636
- \item {\ptt APPEND\_NIL}, 636
- \item {\ptt append\_openw}, 23
- \item {\ptt APPEND\_SNOC}, 636
- \item {\ptt apply\_proof}, 24
- \item {\ptt ARB}, 610
- \item {\ptt arb\_term}, 27
- \item {\ptt ARB\_THM}, 610
- \item {\ptt arity}, 27
- \item {\ptt ascii}, 28
- \item {\ptt ascii\_code}, 28
- \item {\ptt ASM\_CASES\_TAC}, 29
- \item {\ptt ASM\_REWRITE\_RULE}, 29
- \item {\ptt ASM\_REWRITE\_TAC}, 30
- \item {\ptt assert}, 31
- \item {\ptt assignable\_print\_term}, 32
- \item {\ptt assoc}, 34
- \item {\ptt ASSOC\_ADD}, 619
- \item {\ptt ASSOC\_APPEND}, 636
- \item {\ptt ASSOC\_CONJ}, 614
- \item {\ptt ASSOC\_DEF}, 614
- \item {\ptt ASSOC\_DISJ}, 614
- \item {\ptt ASSOC\_FOLDL\_FLAT}, 636
- \item {\ptt ASSOC\_FOLDR\_FLAT}, 636
- \item {\ptt ASSOC\_MULT}, 620
- \item {\ptt associate\_restriction}, 34
- \item {\ptt ASSUM\_LIST}, 38
- \item {\ptt ASSUME}, 36
- \item {\ptt ASSUME\_TAC}, 37
- \item {\ptt attempt\_first}, 39
- \item {\ptt autoload}, 39
- \item {\ptt autoload\_theory}, 41
- \item {\ptt axiom}, 41
- \item {\ptt axiom\_lfn}, 43
- \item {\ptt axiom\_msg\_lfn}, 44
- \item {\ptt axioms}, 42
-
- \indexspace
-
- \item {\ptt B}, 44
- \item {\ptt b}, 45
- \item {\ptt backup}, 45
- \item {\ptt backup\_limit}, 47
- \item {\ptt backup\_list}, 50
- \item {\ptt basic\_rewrites}, 50
- \item {\ptt BETA\_CONV}, 52
- \item {\ptt BETA\_RULE}, 52
- \item {\ptt BETA\_TAC}, 53
- \item {\ptt bht}, 659
- \item {\ptt binders}, 54
- \item {\ptt bndvar}, 55
- \item {\ptt body}, 55
- \item {\ptt BODY\_CONJUNCTS}, 55
- \item {\ptt BOOL\_CASES\_AX}, 610
- \item {\ptt BOOL\_CASES\_TAC}, 56
- \item {\ptt bool\_EQ\_CONV}, 57
- \item {\ptt BOOL\_EQ\_DISTINCT}, 611
- \item {\ptt bool\_ty}, 58
- \item {\ptt BUTFIRSTN}, 636
- \item {\ptt BUTFIRSTN\_APPEND1}, 636
- \item {\ptt BUTFIRSTN\_APPEND2}, 636
- \item {\ptt BUTFIRSTN\_BUTFIRSTN}, 637
- \item {\ptt BUTFIRSTN\_CONV}, 58
- \item {\ptt BUTFIRSTN\_LASTN}, 637
- \item {\ptt BUTFIRSTN\_LENGTH\_APPEND}, 637
- \item {\ptt BUTFIRSTN\_LENGTH\_NIL}, 637
- \item {\ptt BUTFIRSTN\_REVERSE}, 637
- \item {\ptt BUTFIRSTN\_SEG}, 637
- \item {\ptt BUTFIRSTN\_SNOC}, 637
- \item {\ptt BUTLAST}, 637
- \item {\ptt butlast}, 59
- \item {\ptt BUTLAST\_CONV}, 60
- \item {\ptt BUTLAST\_DEF}, 639
- \item {\ptt BUTLASTN}, 637
- \item {\ptt BUTLASTN\_1}, 637
- \item {\ptt BUTLASTN\_APPEND1}, 637
- \item {\ptt BUTLASTN\_APPEND2}, 637
- \item {\ptt BUTLASTN\_BUTLAST}, 638
- \item {\ptt BUTLASTN\_BUTLASTN}, 638
- \item {\ptt BUTLASTN\_CONS}, 638
- \item {\ptt BUTLASTN\_CONV}, 59
- \item {\ptt BUTLASTN\_FIRSTN}, 638
- \item {\ptt BUTLASTN\_LASTN}, 638
- \item {\ptt BUTLASTN\_LASTN\_NIL}, 638
- \item {\ptt BUTLASTN\_LENGTH\_APPEND}, 638
- \item {\ptt BUTLASTN\_LENGTH\_CONS}, 638
- \item {\ptt BUTLASTN\_LENGTH\_NIL}, 638
- \item {\ptt BUTLASTN\_MAP}, 638
- \item {\ptt BUTLASTN\_REVERSE}, 638
- \item {\ptt BUTLASTN\_SEG}, 638
- \item {\ptt BUTLASTN\_SUC\_BUTLAST}, 638
-
- \indexspace
-
- \item {\ptt C}, 60
- \item {\ptt cached\_theories}, 61
- \item {\ptt can}, 61
- \item {\ptt CANCEL\_SUB}, 620
- \item {\ptt CASES\_THENL}, 62
- \item {\ptt CB}, 63
- \item {\ptt CCONTR}, 63
- \item {\ptt change\_state}, 65
- \item {\ptt CHANGED\_CONV}, 64
- \item {\ptt CHANGED\_TAC}, 65
- \item {\ptt CHECK\_ASSUME\_TAC}, 65
- \item {\ptt check\_lhs}, 66
- \item {\ptt check\_specification}, 66
- \item {\ptt check\_valid}, 67
- \item {\ptt check\_varstruct}, 67
- \item {\ptt chktac}, 67
- \item {\ptt CHOOSE}, 68
- \item {\ptt CHOOSE\_TAC}, 69
- \item {\ptt CHOOSE\_THEN}, 70
- \item {\ptt chop\_list}, 71
- \item {\ptt close}, 72
- \item {\ptt close\_theory}, 72
- \item {\ptt Co}, 73
- \item {\ptt com}, 73
- \item {\ptt combine}, 74
- \item {\ptt COMM\_ASSOC\_FOLDL\_REVERSE}, 639
- \item {\ptt COMM\_ASSOC\_FOLDR\_REVERSE}, 639
- \item {\ptt COMM\_DEF}, 615
- \item {\ptt COMM\_MONOID\_FOLDL}, 639
- \item {\ptt COMM\_MONOID\_FOLDR}, 639
- \item {\ptt COMMA\_DEF}, 617
- \item {\ptt compile}, 74
- \item {\ptt compilef}, 76
- \item {\ptt compilet}, 77
- \item {\ptt compiling}, 77
- \item {\ptt compiling\_stack}, 78
- \item {\ptt concat}, 79
- \item {\ptt concatl}, 79
- \item {\ptt concl}, 80
- \item {\ptt COND\_ABS}, 611
- \item {\ptt COND\_CASES\_TAC}, 80
- \item {\ptt COND\_CLAUSES}, 611
- \item {\ptt COND\_CONV}, 82
- \item {\ptt COND\_DEF}, 610
- \item {\ptt COND\_EXPAND}, 611
- \item {\ptt COND\_ID}, 611
- \item {\ptt COND\_RAND}, 611
- \item {\ptt COND\_RATOR}, 611
- \item {\ptt CONJ}, 82
- \item {\ptt CONJ\_ASSOC}, 611
- \item {\ptt CONJ\_DISCH}, 88
- \item {\ptt CONJ\_DISCHL}, 89
- \item {\ptt CONJ\_LIST}, 90
- \item {\ptt CONJ\_PAIR}, 91
- \item {\ptt CONJ\_SET\_CONV}, 92
- \item {\ptt CONJ\_SYM}, 612
- \item {\ptt CONJ\_TAC}, 92
- \item {\ptt CONJUNCT1}, 83
- \item {\ptt CONJUNCT2}, 83
- \item {\ptt CONJUNCTS}, 84
- \item {\ptt conjuncts}, 84
- \item {\ptt CONJUNCTS\_CONV}, 85
- \item {\ptt CONJUNCTS\_THEN}, 86
- \item {\ptt CONJUNCTS\_THEN2}, 87
- \item {\ptt CONS}, 639
- \item {\ptt CONS\_11}, 639
- \item {\ptt CONS\_APPEND}, 639
- \item {\ptt CONS\_DEF}, 639
- \item {\ptt constants}, 93
- \item {\ptt CONTR}, 94
- \item {\ptt CONTR\_TAC}, 95
- \item {\ptt CONTRAPOS}, 94
- \item {\ptt CONTRAPOS\_CONV}, 95
- \item {\ptt CONV\_RULE}, 96
- \item {\ptt CONV\_TAC}, 96
- \item {\ptt current\_theory}, 97
- \item {\ptt curry}, 98
- \item {\ptt CURRY\_DEF}, 617
-
- \indexspace
-
- \item {\ptt DA}, 620
- \item {\ptt DE\_MORGAN\_THM}, 612
- \item {\ptt DEF\_EXISTS\_RULE}, 108
- \item {\ptt define\_finite\_set\_syntax}, 99
- \item {\ptt define\_load\_lib\_function}, 100
- \item {\ptt define\_new\_type\_bijections}, 101
- \item {\ptt define\_set\_abstraction\_syntax}, 102
- \item {\ptt define\_type}, 103
- \item {\ptt definition}, 105
- \item {\ptt definition\_lfn}, 107
- \item {\ptt definition\_msg\_lfn}, 108
- \item {\ptt definitions}, 106
- \item {\ptt delete\_cache}, 109
- \item {\ptt delete\_thm}, 110
- \item {\ptt DEPTH\_CONV}, 111
- \item {\ptt dest\_abs}, 112
- \item {\ptt dest\_comb}, 113
- \item {\ptt dest\_cond}, 113
- \item {\ptt dest\_conj}, 114
- \item {\ptt dest\_cons}, 114
- \item {\ptt dest\_const}, 115
- \item {\ptt dest\_definition}, 115
- \item {\ptt dest\_disj}, 115
- \item {\ptt dest\_eq}, 116
- \item {\ptt dest\_exists}, 116
- \item {\ptt dest\_forall}, 117
- \item {\ptt dest\_form}, 117
- \item {\ptt dest\_imp}, 118
- \item {\ptt dest\_let}, 118
- \item {\ptt dest\_list}, 119
- \item {\ptt dest\_neg}, 119
- \item {\ptt dest\_neg\_imp}, 120
- \item {\ptt dest\_node}, 659
- \item {\ptt dest\_pabs}, 121
- \item {\ptt dest\_pair}, 121
- \item {\ptt dest\_pred}, 122
- \item {\ptt dest\_select}, 122
- \item {\ptt dest\_thm}, 123
- \item {\ptt dest\_type}, 123
- \item {\ptt dest\_var}, 124
- \item {\ptt dest\_vartype}, 124
- \item {\ptt DISCARD\_TAC}, 125
- \item {\ptt DISCH}, 126
- \item {\ptt disch}, 126
- \item {\ptt DISCH\_ALL}, 127
- \item {\ptt DISCH\_TAC}, 127
- \item {\ptt DISCH\_THEN}, 128
- \item {\ptt DISJ1}, 129
- \item {\ptt DISJ1\_TAC}, 130
- \item {\ptt DISJ2}, 131
- \item {\ptt DISJ2\_TAC}, 131
- \item {\ptt DISJ\_ASSOC}, 612
- \item {\ptt DISJ\_CASES}, 133
- \item {\ptt DISJ\_CASES\_TAC}, 134
- \item {\ptt DISJ\_CASES\_THEN}, 135
- \item {\ptt DISJ\_CASES\_THEN2}, 136
- \item {\ptt DISJ\_CASES\_THENL}, 138
- \item {\ptt DISJ\_CASES\_UNION}, 139
- \item {\ptt DISJ\_IMP}, 139
- \item {\ptt DISJ\_SYM}, 612
- \item {\ptt disjuncts}, 132
- \item {\ptt distinct}, 140
- \item {\ptt DIV\_LESS\_EQ}, 620
- \item {\ptt DIV\_MULT}, 620
- \item {\ptt DIV\_UNIQUE}, 620
- \item {\ptt DIVISION}, 620
- \item {\ptt do}, 141
- \item {\ptt draft\_mode}, 142
- \item {\ptt dropout}, 142
-
- \indexspace
-
- \item {\ptt e}, 143
- \item {\ptt EL}, 639
- \item {\ptt el}, 144
- \item {\ptt EL\_APPEND1}, 641
- \item {\ptt EL\_APPEND2}, 641
- \item {\ptt EL\_CONS}, 641
- \item {\ptt EL\_CONV}, 145
- \item {\ptt EL\_ELL}, 641
- \item {\ptt EL\_IS\_EL}, 641
- \item {\ptt EL\_LENGTH\_APPEND}, 641
- \item {\ptt EL\_LENGTH\_SNOC}, 641
- \item {\ptt EL\_MAP}, 641
- \item {\ptt EL\_PRE\_LENGTH}, 641
- \item {\ptt EL\_REVERSE}, 641
- \item {\ptt EL\_REVERSE\_ELL}, 641
- \item {\ptt EL\_SEG}, 641
- \item {\ptt EL\_SNOC}, 641
- \item {\ptt ELL}, 639
- \item {\ptt ELL\_0\_SNOC}, 639
- \item {\ptt ELL\_APPEND1}, 639
- \item {\ptt ELL\_APPEND2}, 640
- \item {\ptt ELL\_CONS}, 640
- \item {\ptt ELL\_CONV}, 145
- \item {\ptt ELL\_EL}, 640
- \item {\ptt ELL\_IS\_EL}, 640
- \item {\ptt ELL\_LAST}, 640
- \item {\ptt ELL\_LENGTH\_APPEND}, 640
- \item {\ptt ELL\_LENGTH\_CONS}, 640
- \item {\ptt ELL\_LENGTH\_SNOC}, 640
- \item {\ptt ELL\_MAP}, 640
- \item {\ptt ELL\_PRE\_LENGTH}, 640
- \item {\ptt ELL\_REVERSE}, 640
- \item {\ptt ELL\_REVERSE\_EL}, 640
- \item {\ptt ELL\_SEG}, 640
- \item {\ptt ELL\_SNOC}, 640
- \item {\ptt ELL\_SUC\_SNOC}, 640
- \item {\ptt end\_itlist}, 146
- \item {\ptt enter\_form\_rep}, 147
- \item {\ptt enter\_term}, 147
- \item {\ptt enter\_term\_rep}, 147
- \item {\ptt EQ\_CLAUSES}, 612
- \item {\ptt EQ\_EXPAND}, 612
- \item {\ptt EQ\_EXT}, 615
- \item {\ptt EQ\_IMP\_RULE}, 149
- \item {\ptt EQ\_IMP\_THM}, 612
- \item {\ptt EQ\_LENGTH\_INDUCT\_TAC}, 150
- \item {\ptt EQ\_LENGTH\_SNOC\_INDUCT\_TAC}, 151
- \item {\ptt EQ\_LESS}, 620
- \item {\ptt EQ\_LESS\_EQ}, 620
- \item {\ptt EQ\_LIST}, 641
- \item {\ptt EQ\_MONO\_ADD\_EQ}, 620
- \item {\ptt EQ\_MP}, 152
- \item {\ptt EQ\_REFL}, 612
- \item {\ptt EQ\_SYM}, 612
- \item {\ptt EQ\_SYM\_EQ}, 612
- \item {\ptt EQ\_TAC}, 152
- \item {\ptt EQ\_TRANS}, 612
- \item {\ptt EQF\_ELIM}, 147
- \item {\ptt EQF\_INTRO}, 148
- \item {\ptt EQT\_ELIM}, 148
- \item {\ptt EQT\_INTRO}, 149
- \item {\ptt ETA\_AX}, 610
- \item {\ptt ETA\_CONV}, 153
- \item {\ptt EVEN}, 620
- \item {\ptt EVEN\_ADD}, 620
- \item {\ptt EVEN\_AND\_ODD}, 620
- \item {\ptt EVEN\_DOUBLE}, 620
- \item {\ptt EVEN\_EXISTS}, 620
- \item {\ptt EVEN\_MULT}, 621
- \item {\ptt EVEN\_ODD}, 621
- \item {\ptt EVEN\_ODD\_EXISTS}, 621
- \item {\ptt EVEN\_OR\_ODD}, 621
- \item {\ptt EVERY}, 153
- \item {\ptt EVERY\_ASSUM}, 154
- \item {\ptt EVERY\_CONV}, 155
- \item {\ptt EVERY\_TCL}, 155
- \item {\ptt EXCLUDED\_MIDDLE}, 612
- \item {\ptt EXISTENCE}, 156
- \item {\ptt EXISTS}, 157
- \item {\ptt exists}, 157
- \item {\ptt EXISTS\_AND\_CONV}, 158
- \item {\ptt EXISTS\_DEF}, 609
- \item {\ptt EXISTS\_EQ}, 159
- \item {\ptt EXISTS\_GREATEST\_CONV}, 159
- \item {\ptt EXISTS\_IMP}, 160
- \item {\ptt EXISTS\_IMP\_CONV}, 160
- \item {\ptt EXISTS\_LEAST\_CONV}, 161
- \item {\ptt EXISTS\_NOT\_CONV}, 162
- \item {\ptt EXISTS\_OR\_CONV}, 162
- \item {\ptt EXISTS\_SIMP}, 612
- \item {\ptt EXISTS\_TAC}, 163
- \item {\ptt exists\_TRP}, 661
- \item {\ptt EXISTS\_UNIQUE\_CONV}, 164
- \item {\ptt EXISTS\_UNIQUE\_DEF}, 609
- \item {\ptt EXP}, 621
- \item {\ptt EXP\_ADD}, 621
- \item {\ptt expand}, 164
- \item {\ptt expandf}, 167
- \item {\ptt explode}, 169
- \item {\ptt EXT}, 169
- \item {\ptt extend\_theory}, 170
-
- \indexspace
-
- \item {\ptt F\_DEF}, 609
- \item {\ptt F\_IMP}, 613
- \item {\ptt FACT}, 621
- \item {\ptt FACT\_LESS}, 621
- \item {\ptt FAIL\_TAC}, 171
- \item {\ptt FALSITY}, 612
- \item {\ptt falsity}, 172
- \item {\ptt fast\_arith}, 172
- \item {\ptt FCOMM\_ASSOC}, 615
- \item {\ptt FCOMM\_DEF}, 615
- \item {\ptt FCOMM\_FOLDL\_APPEND}, 642
- \item {\ptt FCOMM\_FOLDL\_FLAT}, 642
- \item {\ptt FCOMM\_FOLDR\_APPEND}, 642
- \item {\ptt FCOMM\_FOLDR\_FLAT}, 642
- \item {\ptt FILTER}, 642
- \item {\ptt filter}, 173
- \item {\ptt FILTER\_APPEND}, 642
- \item {\ptt FILTER\_ASM\_REWRITE\_RULE}, 174
- \item {\ptt FILTER\_ASM\_REWRITE\_TAC}, 174
- \item {\ptt FILTER\_COMM}, 642
- \item {\ptt FILTER\_CONV}, 175
- \item {\ptt FILTER\_DISCH\_TAC}, 176
- \item {\ptt FILTER\_DISCH\_THEN}, 177
- \item {\ptt FILTER\_FILTER}, 642
- \item {\ptt FILTER\_FLAT}, 642
- \item {\ptt FILTER\_FOLDL}, 642
- \item {\ptt FILTER\_FOLDR}, 643
- \item {\ptt FILTER\_GEN\_TAC}, 178
- \item {\ptt FILTER\_IDEM}, 643
- \item {\ptt FILTER\_MAP}, 643
- \item {\ptt FILTER\_ONCE\_ASM\_REWRITE\_RULE}, 179
- \item {\ptt FILTER\_ONCE\_ASM\_REWRITE\_TAC}, 180
- \item {\ptt FILTER\_PURE\_ASM\_REWRITE\_RULE}, 180
- \item {\ptt FILTER\_PURE\_ASM\_REWRITE\_TAC}, 181
- \item {\ptt FILTER\_PURE\_ONCE\_ASM\_REWRITE\_RULE}, 182
- \item {\ptt FILTER\_PURE\_ONCE\_ASM\_REWRITE\_TAC}, 183
- \item {\ptt FILTER\_REVERSE}, 643
- \item {\ptt FILTER\_SNOC}, 643
- \item {\ptt FILTER\_STRIP\_TAC}, 183
- \item {\ptt FILTER\_STRIP\_THEN}, 185
- \item {\ptt find}, 186
- \item {\ptt find\_file}, 187
- \item {\ptt find\_match}, 187
- \item {\ptt find\_ml\_file}, 188
- \item {\ptt find\_term}, 189
- \item {\ptt find\_terms}, 190
- \item {\ptt find\_theory}, 190
- \item {\ptt FIRST}, 191
- \item {\ptt FIRST\_ASSUM}, 192
- \item {\ptt FIRST\_CONV}, 193
- \item {\ptt FIRST\_TCL}, 193
- \item {\ptt FIRSTN}, 643
- \item {\ptt FIRSTN\_APPEND1}, 643
- \item {\ptt FIRSTN\_APPEND2}, 643
- \item {\ptt FIRSTN\_BUTLASTN}, 643
- \item {\ptt FIRSTN\_CONV}, 191
- \item {\ptt FIRSTN\_FIRSTN}, 643
- \item {\ptt FIRSTN\_LENGTH\_APPEND}, 643
- \item {\ptt FIRSTN\_LENGTH\_ID}, 643
- \item {\ptt FIRSTN\_REVERSE}, 643
- \item {\ptt FIRSTN\_SEG}, 643
- \item {\ptt FIRSTN\_SNOC}, 644
- \item {\ptt flags}, 194
- \item {\ptt FLAT}, 644
- \item {\ptt flat}, 194
- \item {\ptt FLAT\_APPEND}, 644
- \item {\ptt FLAT\_CONV}, 195
- \item {\ptt FLAT\_FLAT}, 644
- \item {\ptt FLAT\_FOLDL}, 644
- \item {\ptt FLAT\_FOLDR}, 644
- \item {\ptt FLAT\_REVERSE}, 644
- \item {\ptt FLAT\_SNOC}, 644
- \item {\ptt FOLDL}, 644
- \item {\ptt FOLDL\_APPEND}, 644
- \item {\ptt FOLDL\_CONV}, 196
- \item {\ptt FOLDL\_FILTER}, 644
- \item {\ptt FOLDL\_FOLDR\_REVERSE}, 644
- \item {\ptt FOLDL\_MAP}, 644
- \item {\ptt FOLDL\_REVERSE}, 644
- \item {\ptt FOLDL\_SINGLE}, 644
- \item {\ptt FOLDL\_SNOC}, 645
- \item {\ptt FOLDL\_SNOC\_NIL}, 645
- \item {\ptt FOLDR}, 645
- \item {\ptt FOLDR\_APPEND}, 645
- \item {\ptt FOLDR\_CONS\_NIL}, 645
- \item {\ptt FOLDR\_CONV}, 197
- \item {\ptt FOLDR\_FILTER}, 645
- \item {\ptt FOLDR\_FILTER\_REVERSE}, 645
- \item {\ptt FOLDR\_FOLDL}, 645
- \item {\ptt FOLDR\_FOLDL\_REVERSE}, 645
- \item {\ptt FOLDR\_MAP}, 645
- \item {\ptt FOLDR\_MAP\_REVERSE}, 645
- \item {\ptt FOLDR\_REVERSE}, 645
- \item {\ptt FOLDR\_SINGLE}, 645
- \item {\ptt FOLDR\_SNOC}, 645
- \item {\ptt forall}, 198
- \item {\ptt FORALL\_AND\_CONV}, 199
- \item {\ptt FORALL\_DEF}, 609
- \item {\ptt FORALL\_EQ}, 199
- \item {\ptt FORALL\_IMP\_CONV}, 200
- \item {\ptt FORALL\_NOT\_CONV}, 201
- \item {\ptt FORALL\_OR\_CONV}, 201
- \item {\ptt FORALL\_SIMP}, 612
- \item {\ptt free\_in}, 205
- \item {\ptt frees}, 202
- \item {\ptt freesl}, 203
- \item {\ptt FREEZE\_THEN}, 203
- \item {\ptt FRONT\_CONJ\_CONV}, 205
- \item {\ptt FST}, 617
- \item {\ptt fst}, 206
- \item {\ptt FST\_DEF}, 617
- \item {\ptt FUN\_EQ\_CONV}, 207
- \item {\ptt FUN\_EQ\_LEMMA}, 615, 621
- \item {\ptt funpow}, 206
-
- \indexspace
-
- \item {\ptt g}, 208
- \item {\ptt GEN}, 209
- \item {\ptt GEN\_ALL}, 211
- \item {\ptt GEN\_ALPHA\_CONV}, 212
- \item {\ptt GEN\_BETA\_CONV}, 213
- \item {\ptt GEN\_REWRITE\_CONV}, 214
- \item {\ptt GEN\_REWRITE\_RULE}, 215
- \item {\ptt GEN\_REWRITE\_TAC}, 217
- \item {\ptt GEN\_TAC}, 219
- \item {\ptt GENL}, 210
- \item {\ptt GENLIST}, 646
- \item {\ptt genvar}, 210
- \item {\ptt get\_const\_type}, 220
- \item {\ptt get\_flag\_value}, 221
- \item {\ptt get\_state}, 221
- \item {\ptt get\_steps}, 222
- \item {\ptt get\_type}, 224
- \item {\ptt getenv}, 219
- \item {\ptt goals}, 224
- \item {\ptt GREATER}, 621
- \item {\ptt GREATER\_EQ}, 621
- \item {\ptt GREATER\_OR\_EQ}, 621
- \item {\ptt GSPEC}, 224
- \item {\ptt GSUBST\_TAC}, 225
- \item {\ptt GSYM}, 226
-
- \indexspace
-
- \item {\ptt HALF\_MK\_ABS}, 227
- \item {\ptt HD}, 646
- \item {\ptt hd}, 227
- \item {\ptt help}, 228
- \item {\ptt help\_search\_path}, 228
- \item {\ptt hide\_constant}, 229
- \item {\ptt hol\_pathname}, 229
- \item {\ptt host\_name}, 230
- \item {\ptt HT}, 659
- \item {\ptt hyp}, 231
- \item {\ptt hyp\_union}, 231
-
- \indexspace
-
- \item {\ptt I}, 232
- \item {\ptt I\_DEF}, 616
- \item {\ptt I\_o\_ID}, 616
- \item {\ptt I\_THM}, 616
- \item {\ptt IMP\_ANTISYM\_AX}, 610
- \item {\ptt IMP\_ANTISYM\_RULE}, 233
- \item {\ptt IMP\_CANON}, 234
- \item {\ptt IMP\_CLAUSES}, 613
- \item {\ptt IMP\_CONJ}, 234
- \item {\ptt IMP\_DISJ\_THM}, 613
- \item {\ptt IMP\_ELIM}, 235
- \item {\ptt IMP\_F}, 613
- \item {\ptt IMP\_F\_EQ\_F}, 613
- \item {\ptt IMP\_RES\_TAC}, 236
- \item {\ptt IMP\_RES\_THEN}, 237
- \item {\ptt IMP\_TRANS}, 238
- \item {\ptt implode}, 232
- \item {\ptt INDUCT}, 239
- \item {\ptt INDUCT\_TAC}, 240
- \item {\ptt INDUCT\_THEN}, 240
- \item {\ptt INDUCTION}, 621
- \item {\ptt INFINITY\_AX}, 610
- \item {\ptt infix\_variable}, 243
- \item {\ptt infixes}, 242
- \item {\ptt inject\_input}, 244
- \item {\ptt INL}, 618
- \item {\ptt inl}, 245
- \item {\ptt INL\_DEF}, 618
- \item {\ptt INR}, 618
- \item {\ptt inr}, 245
- \item {\ptt INR\_DEF}, 618
- \item {\ptt INST}, 246
- \item {\ptt inst}, 247
- \item {\ptt inst\_check}, 248
- \item {\ptt inst\_rename\_list}, 249
- \item {\ptt INST\_TY\_TERM}, 252
- \item {\ptt INST\_TYPE}, 250
- \item {\ptt inst\_type}, 251
- \item {\ptt install}, 248
- \item {\ptt int\_of\_string}, 254
- \item {\ptt int\_of\_term}, 254
- \item {\ptt interface\_map}, 252
- \item {\ptt intersect}, 253
- \item {\ptt INV\_PRE\_EQ}, 621
- \item {\ptt INV\_PRE\_LESS}, 621
- \item {\ptt INV\_PRE\_LESS\_EQ}, 621
- \item {\ptt INV\_SUC}, 622
- \item {\ptt INV\_SUC\_EQ}, 622
- \item {\ptt is\_abs}, 256
- \item {\ptt is\_alphanum}, 257
- \item {\ptt IS\_ASSUMPTION\_OF}, 613
- \item {\ptt is\_axiom}, 257
- \item {\ptt is\_binder}, 258
- \item {\ptt is\_binder\_type}, 259
- \item {\ptt is\_comb}, 259
- \item {\ptt is\_cond}, 260
- \item {\ptt is\_conj}, 260
- \item {\ptt is\_cons}, 261
- \item {\ptt is\_const}, 261
- \item {\ptt is\_constant}, 262
- \item {\ptt is\_definition}, 262
- \item {\ptt is\_disj}, 263
- \item {\ptt IS\_EL}, 646
- \item {\ptt IS\_EL\_APPEND}, 646
- \item {\ptt IS\_EL\_BUTFIRSTN}, 646
- \item {\ptt IS\_EL\_BUTLASTN}, 646
- \item {\ptt IS\_EL\_CONV}, 263
- \item {\ptt IS\_EL\_DEF}, 646
- \item {\ptt IS\_EL\_FILTER}, 646
- \item {\ptt IS\_EL\_FIRSTN}, 646
- \item {\ptt IS\_EL\_FOLDL}, 646
- \item {\ptt IS\_EL\_FOLDL\_MAP}, 646
- \item {\ptt IS\_EL\_FOLDR}, 646
- \item {\ptt IS\_EL\_FOLDR\_MAP}, 646
- \item {\ptt IS\_EL\_LASTN}, 646
- \item {\ptt IS\_EL\_REPLICATE}, 646
- \item {\ptt IS\_EL\_REVERSE}, 647
- \item {\ptt IS\_EL\_SEG}, 647
- \item {\ptt IS\_EL\_SNOC}, 647
- \item {\ptt IS\_EL\_SOME\_EL}, 647
- \item {\ptt is\_eq}, 264
- \item {\ptt is\_exists}, 264
- \item {\ptt is\_forall}, 265
- \item {\ptt is\_hidden}, 265
- \item {\ptt is\_imp}, 266
- \item {\ptt is\_infix}, 267
- \item {\ptt is\_infix\_type}, 267
- \item {\ptt is\_let}, 268
- \item {\ptt is\_letter}, 269
- \item {\ptt is\_list}, 269
- \item {\ptt IS\_list\_REP}, 647
- \item {\ptt Is\_ltree}, 659
- \item {\ptt is\_ml\_curried\_infix}, 270
- \item {\ptt is\_ml\_infix}, 270
- \item {\ptt is\_ml\_paired\_infix}, 271
- \item {\ptt is\_neg}, 271
- \item {\ptt is\_neg\_imp}, 272
- \item {\ptt IS\_NUM\_REP}, 622
- \item {\ptt is\_pabs}, 272
- \item {\ptt is\_pair}, 273
- \item {\ptt IS\_PAIR\_DEF}, 617
- \item {\ptt is\_pred}, 273
- \item {\ptt IS\_PREFIX}, 647
- \item {\ptt IS\_PREFIX\_APPEND}, 647
- \item {\ptt IS\_PREFIX\_IS\_SUBLIST}, 647
- \item {\ptt IS\_PREFIX\_PREFIX}, 647
- \item {\ptt IS\_PREFIX\_REVERSE}, 647
- \item {\ptt is\_recording\_proof}, 274
- \item {\ptt is\_select}, 274
- \item {\ptt IS\_SUBLIST}, 647
- \item {\ptt IS\_SUBLIST\_APPEND}, 647
- \item {\ptt IS\_SUBLIST\_REVERSE}, 647
- \item {\ptt IS\_SUFFIX}, 648
- \item {\ptt IS\_SUFFIX\_APPEND}, 648
- \item {\ptt IS\_SUFFIX\_IS\_SUBLIST}, 648
- \item {\ptt IS\_SUFFIX\_REVERSE}, 648
- \item {\ptt IS\_SUM\_REP}, 618
- \item {\ptt Is\_tree\_REP}, 659
- \item {\ptt is\_type}, 275
- \item {\ptt is\_var}, 275
- \item {\ptt is\_vartype}, 276
- \item {\ptt ISL}, 618
- \item {\ptt isl}, 255
- \item {\ptt ISL\_OR\_ISR}, 618
- \item {\ptt ISPEC}, 255
- \item {\ptt ISPECL}, 256
- \item {\ptt ISR}, 618
- \item {\ptt it}, 276
- \item {\ptt itlist}, 277
- \item {\ptt itlist2}, 278
-
- \indexspace
-
- \item {\ptt K}, 278
- \item {\ptt K\_DEF}, 616
- \item {\ptt K\_THM}, 616
- \item {\ptt KI}, 279
-
- \indexspace
-
- \item {\ptt LAST}, 648
- \item {\ptt last}, 279
- \item {\ptt LAST\_CONV}, 280
- \item {\ptt LAST\_DEF}, 649
- \item {\ptt LAST\_LASTN\_LAST}, 649
- \item {\ptt LASTN}, 648
- \item {\ptt LASTN\_1}, 648
- \item {\ptt LASTN\_APPEND1}, 648
- \item {\ptt LASTN\_APPEND2}, 648
- \item {\ptt LASTN\_BUTFIRSTN}, 648
- \item {\ptt LASTN\_BUTLASTN}, 648
- \item {\ptt LASTN\_CONS}, 648
- \item {\ptt LASTN\_CONV}, 280
- \item {\ptt LASTN\_LASTN}, 648
- \item {\ptt LASTN\_LENGTH\_APPEND}, 649
- \item {\ptt LASTN\_LENGTH\_ID}, 649
- \item {\ptt LASTN\_MAP}, 649
- \item {\ptt LASTN\_REVERSE}, 649
- \item {\ptt LASTN\_SEG}, 649
- \item {\ptt LEFT\_ADD\_DISTRIB}, 622
- \item {\ptt LEFT\_AND\_EXISTS\_CONV}, 281
- \item {\ptt LEFT\_AND\_FORALL\_CONV}, 281
- \item {\ptt LEFT\_AND\_OVER\_OR}, 613
- \item {\ptt LEFT\_ID\_ADD\_0}, 622
- \item {\ptt LEFT\_ID\_DEF}, 615
- \item {\ptt LEFT\_ID\_MULT\_1}, 622
- \item {\ptt LEFT\_IMP\_EXISTS\_CONV}, 282
- \item {\ptt LEFT\_IMP\_FORALL\_CONV}, 282
- \item {\ptt LEFT\_OR\_EXISTS\_CONV}, 283
- \item {\ptt LEFT\_OR\_FORALL\_CONV}, 283
- \item {\ptt LEFT\_OR\_OVER\_AND}, 613
- \item {\ptt LEFT\_SUB\_DISTRIB}, 622
- \item {\ptt LENGTH}, 649
- \item {\ptt length}, 284
- \item {\ptt LENGTH\_APPEND}, 649
- \item {\ptt LENGTH\_BUTFIRSTN}, 649
- \item {\ptt LENGTH\_BUTLAST}, 649
- \item {\ptt LENGTH\_BUTLASTN}, 649
- \item {\ptt LENGTH\_CONS}, 649
- \item {\ptt LENGTH\_CONV}, 284
- \item {\ptt LENGTH\_EQ}, 649
- \item {\ptt LENGTH\_EQ\_CONS}, 649
- \item {\ptt LENGTH\_EQ\_NIL}, 650
- \item {\ptt LENGTH\_FIRSTN}, 650
- \item {\ptt LENGTH\_FLAT}, 650
- \item {\ptt LENGTH\_FOLDL}, 650
- \item {\ptt LENGTH\_FOLDR}, 650
- \item {\ptt LENGTH\_GENLIST}, 650
- \item {\ptt LENGTH\_LASTN}, 650
- \item {\ptt LENGTH\_MAP}, 650
- \item {\ptt LENGTH\_MAP2}, 650
- \item {\ptt LENGTH\_NIL}, 650
- \item {\ptt LENGTH\_NOT\_NULL}, 650
- \item {\ptt LENGTH\_REPLICATE}, 650
- \item {\ptt LENGTH\_REVERSE}, 650
- \item {\ptt LENGTH\_SCANL}, 650
- \item {\ptt LENGTH\_SCANR}, 651
- \item {\ptt LENGTH\_SEG}, 651
- \item {\ptt LENGTH\_SNOC}, 651
- \item {\ptt LENGTH\_UNZIP\_FST}, 651
- \item {\ptt LENGTH\_UNZIP\_SND}, 651
- \item {\ptt LENGTH\_ZIP}, 651
- \item {\ptt LESS}, 622
- \item {\ptt LESS\_0}, 622
- \item {\ptt LESS\_0\_0}, 622
- \item {\ptt LESS\_0\_CASES}, 622
- \item {\ptt LESS\_ADD}, 622
- \item {\ptt LESS\_ADD\_1}, 622
- \item {\ptt LESS\_ADD\_NONZERO}, 622
- \item {\ptt LESS\_ADD\_SUC}, 622
- \item {\ptt LESS\_ANTISYM}, 623
- \item {\ptt LESS\_CASES}, 623
- \item {\ptt LESS\_CASES\_IMP}, 623
- \item {\ptt LESS\_EQ}, 623
- \item {\ptt LESS\_EQ\_0}, 623
- \item {\ptt LESS\_EQ\_ADD}, 623
- \item {\ptt LESS\_EQ\_ADD\_SUB}, 623
- \item {\ptt LESS\_EQ\_ANTISYM}, 623
- \item {\ptt LESS\_EQ\_CASES}, 623
- \item {\ptt LESS\_EQ\_EXISTS}, 623
- \item {\ptt LESS\_EQ\_IMP\_LESS\_SUC}, 623
- \item {\ptt LESS\_EQ\_LESS\_EQ\_MONO}, 623
- \item {\ptt LESS\_EQ\_LESS\_TRANS}, 623
- \item {\ptt LESS\_EQ\_MONO}, 623
- \item {\ptt LESS\_EQ\_MONO\_ADD\_EQ}, 624
- \item {\ptt LESS\_EQ\_REFL}, 624
- \item {\ptt LESS\_EQ\_SUB\_LESS}, 624
- \item {\ptt LESS\_EQ\_SUC\_REFL}, 624
- \item {\ptt LESS\_EQ\_TRANS}, 624
- \item {\ptt LESS\_EQUAL\_ADD}, 623
- \item {\ptt LESS\_EQUAL\_ANTISYM}, 623
- \item {\ptt LESS\_EXP\_SUC\_MONO}, 624
- \item {\ptt LESS\_IMP\_LESS\_ADD}, 624
- \item {\ptt LESS\_IMP\_LESS\_OR\_EQ}, 624
- \item {\ptt LESS\_LEMMA1}, 624
- \item {\ptt LESS\_LEMMA2}, 624
- \item {\ptt LESS\_LESS\_CASES}, 624
- \item {\ptt LESS\_LESS\_EQ\_TRANS}, 624
- \item {\ptt LESS\_LESS\_SUC}, 624
- \item {\ptt LESS\_MOD}, 624
- \item {\ptt LESS\_MONO}, 624
- \item {\ptt LESS\_MONO\_ADD}, 624
- \item {\ptt LESS\_MONO\_ADD\_EQ}, 625
- \item {\ptt LESS\_MONO\_ADD\_INV}, 625
- \item {\ptt LESS\_MONO\_EQ}, 625
- \item {\ptt LESS\_MONO\_MULT}, 625
- \item {\ptt LESS\_MONO\_REV}, 625
- \item {\ptt LESS\_MULT2}, 625
- \item {\ptt LESS\_MULT\_MONO}, 625
- \item {\ptt LESS\_NOT\_EQ}, 625
- \item {\ptt LESS\_NOT\_SUC}, 625
- \item {\ptt LESS\_OR}, 625
- \item {\ptt LESS\_OR\_EQ}, 625
- \item {\ptt LESS\_OR\_EQ\_ADD}, 625
- \item {\ptt LESS\_REFL}, 625
- \item {\ptt LESS\_SUB\_ADD\_LESS}, 625
- \item {\ptt LESS\_SUC}, 625
- \item {\ptt LESS\_SUC\_EQ\_COR}, 625
- \item {\ptt LESS\_SUC\_IMP}, 626
- \item {\ptt LESS\_SUC\_NOT}, 626
- \item {\ptt LESS\_SUC\_REFL}, 626
- \item {\ptt LESS\_SUC\_SUC}, 626
- \item {\ptt LESS\_THM}, 626
- \item {\ptt LESS\_TRANS}, 626
- \item {\ptt let\_after}, 285
- \item {\ptt let\_before}, 286
- \item {\ptt let\_CONV}, 287
- \item {\ptt LET\_DEF}, 610
- \item {\ptt lhs}, 289
- \item {\ptt libraries}, 290
- \item {\ptt library\_loader}, 290
- \item {\ptt library\_pathname}, 292
- \item {\ptt library\_search\_path}, 293
- \item {\ptt link}, 294
- \item {\ptt lisp}, 294
- \item {\ptt lisp\_dir\_pathname}, 295
- \item {\ptt list\_Axiom}, 651
- \item {\ptt LIST\_BETA\_CONV}, 296
- \item {\ptt list\_CASES}, 651
- \item {\ptt LIST\_CONJ}, 297
- \item {\ptt list\_EQ\_CONV}, 297
- \item {\ptt list\_FOLD\_CONV}, 298
- \item {\ptt LIST\_INDUCT}, 299
- \item {\ptt list\_INDUCT}, 651
- \item {\ptt LIST\_INDUCT\_TAC}, 300
- \item {\ptt list\_ISO\_DEF}, 651
- \item {\ptt list\_mk\_abs}, 301
- \item {\ptt list\_mk\_comb}, 301
- \item {\ptt list\_mk\_conj}, 302
- \item {\ptt list\_mk\_disj}, 303
- \item {\ptt LIST\_MK\_EXISTS}, 304
- \item {\ptt list\_mk\_exists}, 304
- \item {\ptt list\_mk\_forall}, 305
- \item {\ptt list\_mk\_imp}, 305
- \item {\ptt list\_mk\_pair}, 306
- \item {\ptt LIST\_MP}, 307
- \item {\ptt LIST\_NOT\_EQ}, 651
- \item {\ptt list\_of\_binders}, 307
- \item {\ptt list\_TY\_DEF}, 651
- \item {\ptt load}, 308
- \item {\ptt load\_axiom}, 310
- \item {\ptt load\_axioms}, 311
- \item {\ptt load\_definition}, 312
- \item {\ptt load\_definitions}, 313
- \item {\ptt load\_library}, 314
- \item {\ptt load\_theorem}, 315
- \item {\ptt load\_theorems}, 316
- \item {\ptt load\_theory}, 317
- \item {\ptt loadf}, 308
- \item {\ptt loadt}, 309
- \item {\ptt lookup\_form\_rep}, 318
- \item {\ptt lookup\_term}, 318
- \item {\ptt lookup\_term\_rep}, 318
- \item {\ptt lsp}, 319
- \item {\ptt ltree\_Axiom}, 659
- \item {\ptt ltree\_Induct}, 659
- \item {\ptt ltree\_ISO\_DEF}, 659
- \item {\ptt ltree\_TY\_DEF}, 660
-
- \indexspace
-
- \item {\ptt MAP}, 651
- \item {\ptt map}, 320
- \item {\ptt MAP2}, 651
- \item {\ptt map2}, 320
- \item {\ptt MAP2\_CONV}, 321
- \item {\ptt MAP2\_ZIP}, 652
- \item {\ptt MAP\_APPEND}, 652
- \item {\ptt MAP\_CONV}, 323
- \item {\ptt MAP\_EVERY}, 324
- \item {\ptt MAP\_FILTER}, 652
- \item {\ptt MAP\_FIRST}, 325
- \item {\ptt MAP\_FLAT}, 652
- \item {\ptt MAP\_FOLDL}, 652
- \item {\ptt MAP\_FOLDR}, 652
- \item {\ptt MAP\_MAP\_o}, 652
- \item {\ptt MAP\_o}, 652
- \item {\ptt MAP\_REVERSE}, 652
- \item {\ptt MAP\_SNOC}, 652
- \item {\ptt mapfilter}, 322
- \item {\ptt maptok}, 322
- \item {\ptt match}, 326
- \item {\ptt MATCH\_ACCEPT\_TAC}, 327
- \item {\ptt MATCH\_MP}, 328
- \item {\ptt MATCH\_MP\_TAC}, 329
- \item {\ptt max\_print\_depth}, 330
- \item {\ptt mem}, 331
- \item {\ptt merge\_nets\_rep}, 331
- \item {\ptt merge\_term\_nets}, 332
- \item {\ptt message}, 332
- \item {\ptt MK\_ABS}, 333
- \item {\ptt mk\_abs}, 333
- \item {\ptt MK\_COMB}, 334
- \item {\ptt mk\_comb}, 334
- \item {\ptt mk\_cond}, 335
- \item {\ptt mk\_conj}, 335
- \item {\ptt mk\_cons}, 336
- \item {\ptt mk\_const}, 336
- \item {\ptt mk\_conv\_net}, 337
- \item {\ptt mk\_definition}, 337
- \item {\ptt mk\_disj}, 337
- \item {\ptt mk\_eq}, 338
- \item {\ptt MK\_EXISTS}, 338
- \item {\ptt mk\_exists}, 339
- \item {\ptt mk\_forall}, 339
- \item {\ptt mk\_form}, 340
- \item {\ptt mk\_imp}, 340
- \item {\ptt mk\_let}, 340
- \item {\ptt mk\_list}, 341
- \item {\ptt mk\_neg}, 342
- \item {\ptt mk\_pabs}, 342
- \item {\ptt mk\_pair}, 342
- \item {\ptt mk\_pp\_thm}, 343
- \item {\ptt mk\_pred}, 343
- \item {\ptt mk\_primed\_var}, 344
- \item {\ptt mk\_select}, 345
- \item {\ptt mk\_thm}, 345
- \item {\ptt mk\_type}, 346
- \item {\ptt mk\_var}, 347
- \item {\ptt mk\_vartype}, 347
- \item {\ptt ml\_curried\_infix}, 348
- \item {\ptt ml\_dir\_pathname}, 349
- \item {\ptt ML\_eval}, 349
- \item {\ptt ml\_paired\_infix}, 350
- \item {\ptt MOD\_EQ\_0}, 626
- \item {\ptt MOD\_MOD}, 626
- \item {\ptt MOD\_MULT}, 626
- \item {\ptt MOD\_ONE}, 626
- \item {\ptt MOD\_PLUS}, 626
- \item {\ptt MOD\_TIMES}, 626
- \item {\ptt MOD\_UNIQUE}, 626
- \item {\ptt MONOID\_ADD\_0}, 626
- \item {\ptt MONOID\_APPEND\_NIL}, 652
- \item {\ptt MONOID\_CONJ\_T}, 615
- \item {\ptt MONOID\_DEF}, 615
- \item {\ptt MONOID\_DISJ\_F}, 615
- \item {\ptt MONOID\_MULT\_1}, 626
- \item {\ptt MP}, 351
- \item {\ptt MP\_TAC}, 351
- \item {\ptt MULT}, 626
- \item {\ptt MULT\_0}, 627
- \item {\ptt MULT\_ASSOC}, 627
- \item {\ptt MULT\_CLAUSES}, 627
- \item {\ptt MULT\_EQ\_0}, 627
- \item {\ptt MULT\_EXP\_MONO}, 627
- \item {\ptt MULT\_LEFT\_1}, 627
- \item {\ptt MULT\_LESS\_EQ\_SUC}, 627
- \item {\ptt MULT\_MONO\_EQ}, 627
- \item {\ptt MULT\_RIGHT\_1}, 627
- \item {\ptt MULT\_SUC}, 627
- \item {\ptt MULT\_SUC\_EQ}, 627
- \item {\ptt MULT\_SYM}, 627
-
- \indexspace
-
- \item {\ptt n\_strip\_quant}, 391
- \item {\ptt NEG\_DISCH}, 352
- \item {\ptt new\_alphanum}, 353
- \item {\ptt new\_axiom}, 354
- \item {\ptt new\_binder}, 355
- \item {\ptt new\_binder\_definition}, 355
- \item {\ptt new\_constant}, 357
- \item {\ptt new\_definition}, 358
- \item {\ptt new\_flag}, 359
- \item {\ptt new\_gen\_definition}, 360
- \item {\ptt new\_infix}, 361
- \item {\ptt new\_infix\_definition}, 362
- \item {\ptt new\_infix\_list\_rec\_definition}, 363
- \item {\ptt new\_infix\_prim\_rec\_definition}, 365
- \item {\ptt new\_letter}, 367
- \item {\ptt new\_list\_rec\_definition}, 367
- \item {\ptt new\_open\_axiom}, 369
- \item {\ptt new\_parent}, 369
- \item {\ptt new\_predicate}, 370
- \item {\ptt new\_prim\_rec\_definition}, 371
- \item {\ptt new\_recursive\_definition}, 372
- \item {\ptt new\_special\_symbol}, 375
- \item {\ptt new\_specification}, 376
- \item {\ptt new\_stack}, 377
- \item {\ptt new\_syntax\_block}, 378
- \item {\ptt new\_theory}, 379
- \item {\ptt new\_type}, 380
- \item {\ptt new\_type\_abbrev}, 381
- \item {\ptt new\_type\_definition}, 382
- \item {\ptt NIL\_DEF}, 652
- \item {\ptt nil\_term\_net}, 383
- \item {\ptt NO\_CONV}, 388
- \item {\ptt NO\_TAC}, 388
- \item {\ptt NO\_THEN}, 388
- \item {\ptt Node}, 660
- \item {\ptt node}, 660
- \item {\ptt Node\_11}, 660
- \item {\ptt node\_11}, 660
- \item {\ptt Node\_onto}, 660
- \item {\ptt node\_REP}, 660
- \item {\ptt not}, 384
- \item {\ptt NOT\_ALL\_EL\_SOME\_EL}, 652
- \item {\ptt NOT\_AND}, 613
- \item {\ptt NOT\_CLAUSES}, 613
- \item {\ptt NOT\_CONS\_NIL}, 652
- \item {\ptt NOT\_DEF}, 609
- \item {\ptt NOT\_ELIM}, 384
- \item {\ptt NOT\_EQ\_LIST}, 652
- \item {\ptt NOT\_EQ\_SYM}, 385
- \item {\ptt NOT\_EXISTS\_CONV}, 385
- \item {\ptt NOT\_EXP\_0}, 627
- \item {\ptt NOT\_F}, 613
- \item {\ptt NOT\_FORALL\_CONV}, 386
- \item {\ptt NOT\_GREATER}, 627
- \item {\ptt NOT\_GREATER\_EQ}, 628
- \item {\ptt NOT\_IMP}, 613
- \item {\ptt NOT\_INTRO}, 386
- \item {\ptt NOT\_LEQ}, 628
- \item {\ptt NOT\_LESS}, 628
- \item {\ptt NOT\_LESS\_0}, 628
- \item {\ptt NOT\_LESS\_EQ}, 628
- \item {\ptt NOT\_LESS\_EQUAL}, 628
- \item {\ptt NOT\_MP}, 387
- \item {\ptt NOT\_NIL\_CONS}, 653
- \item {\ptt NOT\_NIL\_SNOC}, 653
- \item {\ptt NOT\_NUM\_EQ}, 628
- \item {\ptt NOT\_ODD\_EQ\_EVEN}, 628
- \item {\ptt NOT\_SNOC\_NIL}, 653
- \item {\ptt NOT\_SOME\_EL\_ALL\_EL}, 653
- \item {\ptt NOT\_SUC}, 628
- \item {\ptt NOT\_SUC\_ADD\_LESS\_EQ}, 628
- \item {\ptt NOT\_SUC\_LESS\_EQ}, 628
- \item {\ptt NOT\_SUC\_LESS\_EQ\_0}, 628
- \item {\ptt NULL}, 653
- \item {\ptt null}, 389
- \item {\ptt NULL\_DEF}, 653
- \item {\ptt NULL\_EQ\_NIL}, 653
- \item {\ptt NULL\_FOLDL}, 653
- \item {\ptt NULL\_FOLDR}, 653
- \item {\ptt num\_Axiom}, 628
- \item {\ptt num\_CASES}, 628
- \item {\ptt num\_CONV}, 389
- \item {\ptt num\_EQ\_CONV}, 390
- \item {\ptt num\_ISO\_DEF}, 628
- \item {\ptt num\_TY\_DEF}, 629
-
- \indexspace
-
- \item {\ptt o}, 391
- \item {\ptt o\_ASSOC}, 616
- \item {\ptt o\_DEF}, 616
- \item {\ptt o\_THM}, 616
- \item {\ptt ODD}, 629
- \item {\ptt ODD\_ADD}, 629
- \item {\ptt ODD\_DOUBLE}, 629
- \item {\ptt ODD\_EVEN}, 629
- \item {\ptt ODD\_EXISTS}, 629
- \item {\ptt ODD\_MULT}, 629
- \item {\ptt ODD\_OR\_EVEN}, 629
- \item {\ptt ONCE\_ASM\_REWRITE\_RULE}, 392
- \item {\ptt ONCE\_ASM\_REWRITE\_TAC}, 392
- \item {\ptt ONCE\_DEPTH\_CONV}, 393
- \item {\ptt ONCE\_REW\_DEPTH\_CONV}, 397
- \item {\ptt ONCE\_REWRITE\_CONV}, 395
- \item {\ptt ONCE\_REWRITE\_RULE}, 395
- \item {\ptt ONCE\_REWRITE\_TAC}, 396
- \item {\ptt one}, 615
- \item {\ptt one\_Axiom}, 615
- \item {\ptt one\_axiom}, 616
- \item {\ptt one\_DEF}, 616
- \item {\ptt ONE\_ONE\_DEF}, 615
- \item {\ptt one\_TY\_DEF}, 616
- \item {\ptt ONTO\_DEF}, 615
- \item {\ptt oo}, 399
- \item {\ptt openi}, 399
- \item {\ptt openw}, 399
- \item {\ptt OR\_CLAUSES}, 613
- \item {\ptt OR\_DEF}, 609
- \item {\ptt OR\_EL\_DEF}, 653
- \item {\ptt OR\_EL\_FOLDL}, 653
- \item {\ptt OR\_EL\_FOLDR}, 653
- \item {\ptt OR\_ELIM\_THM}, 614
- \item {\ptt OR\_EXISTS\_CONV}, 402
- \item {\ptt OR\_FORALL\_CONV}, 402
- \item {\ptt OR\_IMP\_THM}, 614
- \item {\ptt OR\_INTRO\_THM1}, 614
- \item {\ptt OR\_INTRO\_THM2}, 614
- \item {\ptt OR\_LESS}, 629
- \item {\ptt ORELSE}, 400
- \item {\ptt ORELSE\_TCL}, 401
- \item {\ptt ORELSEC}, 401
- \item {\ptt OUTL}, 618
- \item {\ptt outl}, 403
- \item {\ptt OUTR}, 618
- \item {\ptt outr}, 403
-
- \indexspace
-
- \item {\ptt p}, 404
- \item {\ptt PAIR}, 617
- \item {\ptt pair}, 405
- \item {\ptt PAIR\_EQ}, 617
- \item {\ptt PAIR\_EXISTS}, 617
- \item {\ptt PAIRED\_BETA\_CONV}, 405
- \item {\ptt paired\_delete\_thm}, 407
- \item {\ptt PAIRED\_ETA\_CONV}, 407
- \item {\ptt paired\_new\_type}, 408
- \item {\ptt paired\_theorem}, 408
- \item {\ptt parents}, 409
- \item {\ptt parse\_as\_binder}, 410
- \item {\ptt PART}, 653, 660
- \item {\ptt PART\_MATCH}, 412
- \item {\ptt partition}, 411
- \item {\ptt POP\_ASSUM}, 413
- \item {\ptt POP\_ASSUM\_LIST}, 414
- \item {\ptt pop\_proofs}, 415
- \item {\ptt pop\_proofs\_print}, 416
- \item {\ptt pp\_axiom}, 416
- \item {\ptt PRE}, 629
- \item {\ptt PRE\_DEF}, 629
- \item {\ptt PRE\_SUB}, 629
- \item {\ptt PRE\_SUB1}, 629
- \item {\ptt PRE\_SUC\_EQ}, 629
- \item {\ptt PREFIX}, 653
- \item {\ptt PREFIX\_DEF}, 653
- \item {\ptt PREFIX\_FOLDR}, 654
- \item {\ptt preterm\_abs}, 416
- \item {\ptt preterm\_antiquot}, 417
- \item {\ptt preterm\_comb}, 418
- \item {\ptt preterm\_const}, 419
- \item {\ptt preterm\_to\_term}, 419
- \item {\ptt preterm\_typed}, 420
- \item {\ptt preterm\_var}, 421
- \item {\ptt PRIM\_REC}, 629
- \item {\ptt PRIM\_REC\_EQN}, 630
- \item {\ptt PRIM\_REC\_FUN}, 630
- \item {\ptt PRIM\_REC\_THM}, 630
- \item {\ptt print\_all\_thm}, 422
- \item {\ptt print\_begin}, 423
- \item {\ptt print\_bool}, 425
- \item {\ptt print\_break}, 425
- \item {\ptt print\_defined\_types}, 427
- \item {\ptt print\_end}, 427
- \item {\ptt print\_goal}, 428
- \item {\ptt print\_hyps}, 429
- \item {\ptt print\_ibegin}, 429
- \item {\ptt print\_int}, 430
- \item {\ptt print\_list}, 431
- \item {\ptt print\_newline}, 432
- \item {\ptt print\_stack}, 433
- \item {\ptt print\_state}, 433
- \item {\ptt print\_string}, 435
- \item {\ptt print\_subgoals}, 435
- \item {\ptt print\_term}, 435
- \item {\ptt print\_theory}, 436
- \item {\ptt print\_thm}, 437
- \item {\ptt print\_tok}, 437
- \item {\ptt print\_type}, 438
- \item {\ptt print\_unquoted\_term}, 439
- \item {\ptt print\_unquoted\_type}, 439
- \item {\ptt print\_void}, 440
- \item {\ptt prod\_TY\_DEF}, 617
- \item {\ptt prompt}, 441
- \item {\ptt PROVE}, 441
- \item {\ptt prove}, 442
- \item {\ptt prove\_abs\_fn\_one\_one}, 442
- \item {\ptt prove\_abs\_fn\_onto}, 443
- \item {\ptt prove\_cases\_thm}, 443
- \item {\ptt prove\_constructors\_distinct}, 444
- \item {\ptt prove\_constructors\_one\_one}, 445
- \item {\ptt PROVE\_HYP}, 446
- \item {\ptt prove\_induction\_thm}, 447
- \item {\ptt prove\_rec\_fn\_exists}, 448
- \item {\ptt prove\_rep\_fn\_one\_one}, 449
- \item {\ptt prove\_rep\_fn\_onto}, 449
- \item {\ptt prove\_thm}, 450
- \item {\ptt PURE\_ASM\_REWRITE\_RULE}, 451
- \item {\ptt PURE\_ASM\_REWRITE\_TAC}, 451
- \item {\ptt PURE\_ONCE\_ASM\_REWRITE\_RULE}, 452
- \item {\ptt PURE\_ONCE\_ASM\_REWRITE\_TAC}, 452
- \item {\ptt PURE\_ONCE\_REWRITE\_CONV}, 453
- \item {\ptt PURE\_ONCE\_REWRITE\_RULE}, 454
- \item {\ptt PURE\_ONCE\_REWRITE\_TAC}, 454
- \item {\ptt PURE\_REWRITE\_CONV}, 455
- \item {\ptt PURE\_REWRITE\_RULE}, 455
- \item {\ptt PURE\_REWRITE\_TAC}, 456
- \item {\ptt push\_fsubgoals}, 457
- \item {\ptt push\_print}, 457
- \item {\ptt push\_subgoals}, 458
-
- \indexspace
-
- \item {\ptt quit}, 458
-
- \indexspace
-
- \item {\ptt r}, 458
- \item {\ptt rand}, 459
- \item {\ptt RAND\_CONV}, 459
- \item {\ptt rator}, 460
- \item {\ptt RATOR\_CONV}, 460
- \item {\ptt read}, 461
- \item {\ptt record\_proof}, 463
- \item {\ptt RecordStep}, 462
- \item {\ptt REDEPTH\_CONV}, 464
- \item {\ptt REFL}, 466
- \item {\ptt REFL\_CLAUSE}, 614
- \item {\ptt REFL\_TAC}, 466
- \item {\ptt remove}, 467
- \item {\ptt remove\_sticky\_type}, 467
- \item {\ptt rep\_goals}, 470
- \item {\ptt REP\_prod}, 617
- \item {\ptt REPEAT}, 468
- \item {\ptt REPEAT\_GTCL}, 469
- \item {\ptt REPEAT\_TCL}, 469
- \item {\ptt REPEATC}, 468
- \item {\ptt REPLICATE}, 654
- \item {\ptt replicate}, 470
- \item {\ptt RES\_ABSTRACT}, 610
- \item {\ptt RES\_CANON}, 471
- \item {\ptt RES\_EXISTS}, 610
- \item {\ptt RES\_FORALL}, 610
- \item {\ptt RES\_SELECT}, 610
- \item {\ptt RES\_TAC}, 474
- \item {\ptt RES\_THEN}, 475
- \item {\ptt resume\_recording}, 471
- \item {\ptt rev}, 477
- \item {\ptt rev\_assoc}, 478
- \item {\ptt rev\_itlist}, 478
- \item {\ptt REVERSE}, 654
- \item {\ptt REVERSE\_APPEND}, 654
- \item {\ptt REVERSE\_CONV}, 477
- \item {\ptt REVERSE\_EQ\_NIL}, 654
- \item {\ptt REVERSE\_FLAT}, 654
- \item {\ptt REVERSE\_FOLDL}, 654
- \item {\ptt REVERSE\_FOLDR}, 654
- \item {\ptt REVERSE\_REVERSE}, 654
- \item {\ptt REVERSE\_SNOC}, 654
- \item {\ptt REW\_DEPTH\_CONV}, 485
- \item {\ptt REWR\_CONV}, 482
- \item {\ptt REWRITE\_CONV}, 479
- \item {\ptt REWRITE\_RULE}, 480
- \item {\ptt REWRITE\_TAC}, 481
- \item {\ptt rhs}, 487
- \item {\ptt RIGHT\_ADD\_DISTRIB}, 630
- \item {\ptt RIGHT\_AND\_EXISTS\_CONV}, 487
- \item {\ptt RIGHT\_AND\_FORALL\_CONV}, 488
- \item {\ptt RIGHT\_AND\_OVER\_OR}, 614
- \item {\ptt RIGHT\_BETA}, 488
- \item {\ptt RIGHT\_CONV\_RULE}, 489
- \item {\ptt RIGHT\_ID\_ADD\_0}, 630
- \item {\ptt RIGHT\_ID\_DEF}, 615
- \item {\ptt RIGHT\_ID\_MULT\_1}, 630
- \item {\ptt RIGHT\_IMP\_EXISTS\_CONV}, 490
- \item {\ptt RIGHT\_IMP\_FORALL\_CONV}, 490
- \item {\ptt RIGHT\_LIST\_BETA}, 491
- \item {\ptt RIGHT\_OR\_EXISTS\_CONV}, 491
- \item {\ptt RIGHT\_OR\_FORALL\_CONV}, 492
- \item {\ptt RIGHT\_OR\_OVER\_AND}, 614
- \item {\ptt RIGHT\_SUB\_DISTRIB}, 630
- \item {\ptt root\_goal}, 492
- \item {\ptt rotate}, 493
- \item {\ptt rotate\_goals}, 494
- \item {\ptt rotate\_top}, 495
- \item {\ptt RULE\_ASSUM\_TAC}, 495
-
- \indexspace
-
- \item {\ptt S}, 496
- \item {\ptt S\_DEF}, 616
- \item {\ptt S\_THM}, 616
- \item {\ptt save}, 496
- \item {\ptt save\_thm}, 497
- \item {\ptt save\_top\_thm}, 498
- \item {\ptt SCANL}, 654
- \item {\ptt SCANL\_CONV}, 499
- \item {\ptt SCANR}, 654
- \item {\ptt SCANR\_CONV}, 500
- \item {\ptt search\_path}, 501
- \item {\ptt SEG}, 654
- \item {\ptt SEG\_0\_SNOC}, 654
- \item {\ptt SEG\_APPEND}, 655
- \item {\ptt SEG\_APPEND1}, 655
- \item {\ptt SEG\_APPEND2}, 655
- \item {\ptt SEG\_CONV}, 502
- \item {\ptt SEG\_FIRSTN\_BUTFISTN}, 655
- \item {\ptt SEG\_LASTN\_BUTLASTN}, 655
- \item {\ptt SEG\_LENGTH\_ID}, 655
- \item {\ptt SEG\_LENGTH\_SNOC}, 655
- \item {\ptt SEG\_REVERSE}, 655
- \item {\ptt SEG\_SEG}, 655
- \item {\ptt SEG\_SNOC}, 655
- \item {\ptt SEG\_SUC\_CONS}, 655
- \item {\ptt SELECT\_AX}, 610
- \item {\ptt SELECT\_CONV}, 503
- \item {\ptt SELECT\_ELIM}, 504
- \item {\ptt SELECT\_EQ}, 505
- \item {\ptt SELECT\_INTRO}, 506
- \item {\ptt SELECT\_REFL}, 614
- \item {\ptt SELECT\_RULE}, 507
- \item {\ptt SELECT\_UNIQUE}, 614
- \item {\ptt set\_equal}, 509
- \item {\ptt set\_fail}, 509
- \item {\ptt set\_fail\_prefix}, 510
- \item {\ptt set\_flag}, 511
- \item {\ptt set\_goal}, 512
- \item {\ptt set\_help}, 513
- \item {\ptt set\_help\_search\_path}, 514
- \item {\ptt set\_interface\_map}, 514
- \item {\ptt set\_lambda}, 515
- \item {\ptt set\_library\_search\_path}, 516
- \item {\ptt set\_margin}, 517
- \item {\ptt set\_pretty\_mode}, 517
- \item {\ptt set\_prompt}, 518
- \item {\ptt set\_search\_path}, 519
- \item {\ptt set\_state}, 520
- \item {\ptt set\_sticky\_type}, 521
- \item {\ptt set\_string\_escape}, 522
- \item {\ptt set\_thm\_count}, 523
- \item {\ptt set\_turnstile}, 523
- \item {\ptt setify}, 508
- \item {\ptt show\_types}, 524
- \item {\ptt SIMP\_REC}, 630
- \item {\ptt SIMP\_REC\_EXISTS}, 630
- \item {\ptt SIMP\_REC\_FUN}, 630
- \item {\ptt SIMP\_REC\_FUN\_LEMMA}, 630
- \item {\ptt SIMP\_REC\_REL}, 630
- \item {\ptt SIMP\_REC\_THM}, 631
- \item {\ptt Size}, 660
- \item {\ptt SKOLEM\_CONV}, 525
- \item {\ptt SND}, 617
- \item {\ptt snd}, 526
- \item {\ptt SND\_DEF}, 617
- \item {\ptt SNOC}, 656
- \item {\ptt SNOC\_11}, 656
- \item {\ptt SNOC\_APPEND}, 656
- \item {\ptt SNOC\_Axiom}, 656
- \item {\ptt SNOC\_CASES}, 656
- \item {\ptt SNOC\_CONV}, 526
- \item {\ptt SNOC\_EQ\_LENGTH\_EQ}, 656
- \item {\ptt SNOC\_FOLDR}, 656
- \item {\ptt SNOC\_INDUCT}, 656
- \item {\ptt SNOC\_INDUCT\_TAC}, 527
- \item {\ptt SNOC\_REVERSE\_CONS}, 656
- \item {\ptt SOME\_EL}, 656
- \item {\ptt SOME\_EL\_APPEND}, 656
- \item {\ptt SOME\_EL\_BUTFIRSTN}, 656
- \item {\ptt SOME\_EL\_BUTLASTN}, 656
- \item {\ptt SOME\_EL\_CONV}, 528
- \item {\ptt SOME\_EL\_DISJ}, 656
- \item {\ptt SOME\_EL\_FIRSTN}, 657
- \item {\ptt SOME\_EL\_FOLDL}, 657
- \item {\ptt SOME\_EL\_FOLDL\_MAP}, 657
- \item {\ptt SOME\_EL\_FOLDR}, 657
- \item {\ptt SOME\_EL\_FOLDR\_MAP}, 657
- \item {\ptt SOME\_EL\_LASTN}, 657
- \item {\ptt SOME\_EL\_MAP}, 657
- \item {\ptt SOME\_EL\_REVERSE}, 657
- \item {\ptt SOME\_EL\_SEG}, 657
- \item {\ptt SOME\_EL\_SNOC}, 657
- \item {\ptt sort}, 529
- \item {\ptt SPEC}, 530
- \item {\ptt SPEC\_ALL}, 532
- \item {\ptt SPEC\_TAC}, 533
- \item {\ptt SPEC\_VAR}, 534
- \item {\ptt special\_symbols}, 531
- \item {\ptt SPECL}, 531
- \item {\ptt SPLIT}, 657, 660
- \item {\ptt split}, 534
- \item {\ptt SPLITP}, 657
- \item {\ptt splitp}, 535
- \item {\ptt sticky\_list}, 535
- \item {\ptt store\_binders}, 536
- \item {\ptt store\_definition}, 536
- \item {\ptt string\_of\_int}, 536
- \item {\ptt strip\_abs}, 537
- \item {\ptt STRIP\_ASSUME\_TAC}, 537
- \item {\ptt strip\_comb}, 539
- \item {\ptt strip\_exists}, 540
- \item {\ptt strip\_forall}, 540
- \item {\ptt STRIP\_GOAL\_THEN}, 541
- \item {\ptt strip\_imp}, 543
- \item {\ptt strip\_pair}, 543
- \item {\ptt STRIP\_TAC}, 544
- \item {\ptt STRIP\_THM\_THEN}, 545
- \item {\ptt STRUCT\_CASES\_TAC}, 547
- \item {\ptt SUB}, 631
- \item {\ptt SUB\_0}, 631
- \item {\ptt SUB\_ADD}, 631
- \item {\ptt SUB\_CANCEL}, 631
- \item {\ptt SUB\_CONV}, 563
- \item {\ptt SUB\_EQ\_0}, 631
- \item {\ptt SUB\_EQ\_EQ\_0}, 631
- \item {\ptt SUB\_EQUAL\_0}, 631
- \item {\ptt SUB\_LEFT\_ADD}, 631
- \item {\ptt SUB\_LEFT\_EQ}, 631
- \item {\ptt SUB\_LEFT\_GREATER}, 631
- \item {\ptt SUB\_LEFT\_GREATER\_EQ}, 631
- \item {\ptt SUB\_LEFT\_LESS}, 631
- \item {\ptt SUB\_LEFT\_LESS\_EQ}, 631
- \item {\ptt SUB\_LEFT\_SUB}, 631
- \item {\ptt SUB\_LEFT\_SUC}, 632
- \item {\ptt SUB\_LESS\_0}, 632
- \item {\ptt SUB\_LESS\_EQ}, 632
- \item {\ptt SUB\_LESS\_EQ\_ADD}, 632
- \item {\ptt SUB\_LESS\_OR}, 632
- \item {\ptt SUB\_MONO\_EQ}, 632
- \item {\ptt SUB\_PLUS}, 632
- \item {\ptt SUB\_RIGHT\_ADD}, 632
- \item {\ptt SUB\_RIGHT\_EQ}, 632
- \item {\ptt SUB\_RIGHT\_GREATER}, 632
- \item {\ptt SUB\_RIGHT\_GREATER\_EQ}, 632
- \item {\ptt SUB\_RIGHT\_LESS}, 632
- \item {\ptt SUB\_RIGHT\_LESS\_EQ}, 632
- \item {\ptt SUB\_RIGHT\_SUB}, 632
- \item {\ptt SUB\_SUB}, 632
- \item {\ptt SUBGOAL\_THEN}, 548
- \item {\ptt SUBS}, 549
- \item {\ptt SUBS\_OCCS}, 561
- \item {\ptt SUBST}, 551
- \item {\ptt subst}, 552
- \item {\ptt SUBST1\_TAC}, 553
- \item {\ptt SUBST\_ALL\_TAC}, 554
- \item {\ptt SUBST\_CONV}, 555
- \item {\ptt SUBST\_MATCH}, 557
- \item {\ptt subst\_occs}, 558
- \item {\ptt SUBST\_OCCS\_TAC}, 559
- \item {\ptt SUBST\_TAC}, 560
- \item {\ptt subtract}, 562
- \item {\ptt SUC\_ADD\_SYM}, 632
- \item {\ptt SUC\_DEF}, 633
- \item {\ptt SUC\_ID}, 633
- \item {\ptt SUC\_LESS}, 633
- \item {\ptt SUC\_NOT}, 633
- \item {\ptt SUC\_ONE\_ADD}, 633
- \item {\ptt SUC\_REP\_DEF}, 633
- \item {\ptt SUC\_SUB1}, 633
- \item {\ptt SUFFIX\_DEF}, 657
- \item {\ptt SUM}, 658
- \item {\ptt SUM\_APPEND}, 658
- \item {\ptt sum\_Axiom}, 618
- \item {\ptt sum\_axiom}, 618
- \item {\ptt SUM\_FLAT}, 658
- \item {\ptt SUM\_FOLDL}, 658
- \item {\ptt SUM\_FOLDR}, 658
- \item {\ptt sum\_ISO\_DEF}, 618
- \item {\ptt SUM\_REVERSE}, 658
- \item {\ptt SUM\_SNOC}, 658
- \item {\ptt sum\_TY\_DEF}, 618
- \item {\ptt suspend\_recording}, 564
- \item {\ptt SWAP\_EXISTS\_CONV}, 565
- \item {\ptt SYM}, 565
- \item {\ptt SYM\_CONV}, 566
- \item {\ptt syserror}, 566
- \item {\ptt system}, 567
-
- \indexspace
-
- \item {\ptt T\_DEF}, 609
- \item {\ptt TAC\_PROOF}, 567
- \item {\ptt term\_of\_int}, 568
- \item {\ptt THEN}, 568
- \item {\ptt THEN\_TCL}, 570
- \item {\ptt THENC}, 569
- \item {\ptt THENL}, 570
- \item {\ptt theorem}, 571
- \item {\ptt theorem\_lfn}, 573
- \item {\ptt theorem\_msg\_lfn}, 573
- \item {\ptt theorems}, 572
- \item {\ptt thm\_count}, 574
- \item {\ptt thm\_frees}, 575
- \item {\ptt timer}, 575
- \item {\ptt TIMES2}, 633
- \item {\ptt TL}, 658
- \item {\ptt tl}, 576
- \item {\ptt TL\_SNOC}, 658
- \item {\ptt TOP\_DEPTH\_CONV}, 577
- \item {\ptt top\_goal}, 578
- \item {\ptt top\_print}, 578
- \item {\ptt top\_proof}, 579
- \item {\ptt top\_thm}, 580
- \item {\ptt TRANS}, 580
- \item {\ptt tree\_Axiom}, 660
- \item {\ptt tree\_Induct}, 660
- \item {\ptt tree\_ISO\_DEF}, 661
- \item {\ptt tree\_TY\_DEF}, 661
- \item {\ptt trf}, 661
- \item {\ptt TRP}, 661
- \item {\ptt TRP\_DEF}, 661
- \item {\ptt TRUTH}, 614
- \item {\ptt TRY}, 581
- \item {\ptt TRY\_CONV}, 582
- \item {\ptt tryfind}, 582
- \item {\ptt tty\_read}, 583
- \item {\ptt tty\_write}, 583
- \item {\ptt TY\_DEF\_THM}, 661
- \item {\ptt type\_abbrevs}, 585
- \item {\ptt TYPE\_DEFINITION}, 661
- \item {\ptt type\_in}, 586
- \item {\ptt type\_in\_type}, 587
- \item {\ptt type\_of}, 587
- \item {\ptt type\_tyvars}, 588
- \item {\ptt types}, 584
- \item {\ptt tyvars}, 588
- \item {\ptt tyvarsl}, 589
-
- \indexspace
-
- \item {\ptt uncurry}, 590
- \item {\ptt UNCURRY\_DEF}, 617
- \item {\ptt UNDISCH}, 590
- \item {\ptt UNDISCH\_ALL}, 591
- \item {\ptt UNDISCH\_TAC}, 592
- \item {\ptt undo\_autoload}, 592
- \item {\ptt unhide\_constant}, 593
- \item {\ptt union}, 593
- \item {\ptt unlink}, 594
- \item {\ptt UNZIP}, 658
- \item {\ptt UNZIP\_FST\_DEF}, 658
- \item {\ptt UNZIP\_SND\_DEF}, 658
- \item {\ptt UNZIP\_SNOC}, 658
- \item {\ptt UNZIP\_ZIP}, 658
-
- \indexspace
-
- \item {\ptt VALID}, 594
- \item {\ptt variant}, 595
- \item {\ptt vars}, 596
- \item {\ptt varsl}, 597
- \item {\ptt version}, 598
-
- \indexspace
-
- \item {\ptt W}, 598
- \item {\ptt WOP}, 633
- \item {\ptt word\_separators}, 600
- \item {\ptt words}, 598
- \item {\ptt words2}, 599
- \item {\ptt write}, 600
-
- \indexspace
-
- \item {\ptt X\_CASES\_THEN}, 601
- \item {\ptt X\_CASES\_THENL}, 603
- \item {\ptt X\_CHOOSE\_TAC}, 604
- \item {\ptt X\_CHOOSE\_THEN}, 605
- \item {\ptt X\_FUN\_EQ\_CONV}, 607
- \item {\ptt X\_GEN\_TAC}, 607
- \item {\ptt X\_SKOLEM\_CONV}, 608
-
- \indexspace
-
- \item {\ptt ZERO\_DEF}, 633
- \item {\ptt ZERO\_DIV}, 633
- \item {\ptt ZERO\_LESS\_EQ}, 633
- \item {\ptt ZERO\_LESS\_EXP}, 633
- \item {\ptt ZERO\_MOD}, 633
- \item {\ptt ZERO\_REP\_DEF}, 633
- \item {\ptt ZIP}, 659
- \item {\ptt ZIP\_SNOC}, 659
- \item {\ptt ZIP\_UNZIP}, 659
-
-\end{theindex}
+\begin{theindex}\mbox{}\end{theindex}
\ No newline at end of file
--- hol88-2.02.19940316.orig/Manual/Reference/Makefile
+++ hol88-2.02.19940316/Manual/Reference/Makefile
@@ -19,46 +19,46 @@ default:
clean:
rm -f *.dvi *.aux *.toc *.log *.idx *.ilg
- @echo "\begin{theindex}" > index.tex
- @echo "\mbox{}" >> index.tex
- @echo "\end{theindex}" >> index.tex
+ @printf '\\begin{theindex}' > index.tex
+ @printf '\\mbox{}' >> index.tex
+ @printf '\\end{theindex}' >> index.tex
tex: ids theorems
@echo "TeX files made"
ids:
- @echo "\chapter{Pre-defined ML Identifiers}" > entries.tex
- @echo "\input{entries-intro}" >> entries.tex
+ @printf '\\chapter{Pre-defined ML Identifiers}' > entries.tex
+ @printf '\\input{entries-intro}' >> entries.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/ENTRIES entries.tex
theorems:
- @echo "\chapter{Pre-proved Theorems}" > theorems.tex
- @echo "\input{theorems-intro}" >> theorems.tex
- @echo "\section{Definitions of Basic Logical Constants}">>theorems.tex
+ @printf '\\chapter{Pre-proved Theorems}' > theorems.tex
+ @printf '\\input{theorems-intro}' >> theorems.tex
+ @printf '\\section{Definitions of Basic Logical Constants}'>>theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/basic-logic theorems.tex
- @echo "\section{Constants for syntactic abbreviations}" >> theorems.tex
+ @printf '\\section{Constants for syntactic abbreviations}' >> theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/syntax theorems.tex
- @echo "\section{Axioms}" >> theorems.tex
+ @printf '\\section{Axioms}' >> theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/axioms theorems.tex
- @echo "\section{Logical tautologies}" >> theorems.tex
+ @printf '\\section{Logical tautologies}' >> theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/logic theorems.tex
- @echo "\section{Theorems about functions}" >> theorems.tex
+ @printf '\\section{Theorems about functions}' >> theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/functions theorems.tex
- @echo "\section{Theorems about the type {\tt one}}" >> theorems.tex
+ @printf '\\section{Theorems about the type {\\tt one}}' >> theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/one theorems.tex
- @echo "\section{Theorems about combinators}" >> theorems.tex
+ @printf '\\section{Theorems about combinators}' >> theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/combin theorems.tex
- @echo "\section{Theorems about pairs}" >> theorems.tex
+ @printf '\\section{Theorems about pairs}' >> theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/pairs theorems.tex
- @echo "\section{Theorems about disjoint sums}" >> theorems.tex
+ @printf '\\section{Theorems about disjoint sums}' >> theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/sum theorems.tex
- @echo "\section{Theorems about arithmetic}" >> theorems.tex
+ @printf '\\section{Theorems about arithmetic}' >> theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/arith theorems.tex
- @echo "\section{Theorems about lists}" >> theorems.tex
+ @printf '\\section{Theorems about lists}' >> theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/list theorems.tex
- @echo "\section{Theorems about trees}" >> theorems.tex
+ @printf '\\section{Theorems about trees}' >> theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/tree theorems.tex
- @echo "\section{Theorems used to define types}" >> theorems.tex
+ @printf '\\section{Theorems used to define types}' >> theorems.tex
/bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/tydefs theorems.tex
reference:
--- hol88-2.02.19940316.orig/Manual/Reference/entries.tex
+++ hol88-2.02.19940316/Manual/Reference/entries.tex
@@ -1,1114 +1,882 @@
-\chapter{Pre-defined ML Identifiers}
-\input{entries-intro}
-\DOC{\#}
+\chapter{Pre-defined ML Identifiers}\input{entries-intro}\DOC{ABS\_CONV}
-\TYPE {\small\verb%$# : (((* -> **) # (*** -> ****)) -> (* # ***) -> (** # ****))%}\egroup
+\TYPE {\small\verb%ABS_CONV : (conv -> conv)%}\egroup
\SYNOPSIS
-Applies two functions to a pair: {\small\verb%(f # g) (x,y)%} = {\small\verb%(f x, g y)%}.
+Applies a conversion to the body of an abstraction.
+
+\DESCRIBE
+If {\small\verb%c%} is a conversion that maps a term {\small\verb%"t"%} to the theorem {\small\verb%|- t = t'%}, then
+the conversion {\small\verb%ABS_CONV c%} maps abstractions of the form {\small\verb%"\x.t"%} to theorems
+of the form:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ |- (\x.t) = (\x.t')
+\end{verbatim}
+}
+\noindent That is, {\small\verb%ABS_CONV c "\x.t"%} applies {\small\verb%c%} to the body of the
+abstraction {\small\verb%"\x.t"%}.
\FAILURE
-Never fails.
+{\small\verb%ABS_CONV c tm%} fails if {\small\verb%tm%} is not an abstraction or if {\small\verb%tm%} has the form
+{\small\verb%"\x.t"%} but the conversion {\small\verb%c%} fails when applied to the term {\small\verb%t%}. The
+function returned by {\small\verb%ABS_CONV c%} may also fail if the ML function
+{\small\verb%c:term->thm%} is not, in fact, a conversion (i.e. a function that maps a term
+{\small\verb%t%} to a theorem {\small\verb%|- t = t'%}).
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#ABS_CONV SYM_CONV "\x. 1 = x";;
+|- (\x. 1 = x) = (\x. x = 1)
+\end{verbatim}
+}
\SEEALSO
-B, C, CB, Co, I, K, KI, o, oo, S, W.
+RAND_CONV, RATOR_CONV, SUB_CONV.
\ENDDOC
-\DOC{*}
+\DOC{ABS}
-\TYPE {\small\verb%$* : ((int # int) -> int)%}\egroup
+\TYPE {\small\verb%ABS : (term -> thm -> thm)%}\egroup
\SYNOPSIS
-Performs multiplication on ML integers.
+Abstracts both sides of an equation.
+\DESCRIBE
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- t1 = t2
+ ------------------------ ABS "x" [Where x is not free in A]
+ A |- (\x.t1) = (\x.t2)
+\end{verbatim}
+}
\FAILURE
-Never fails.
+If the theorem is not an equation, or if the variable {\small\verb%x%} is free in the
+assumptions {\small\verb%A%}.
-\ENDDOC
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#ABS "m:num" (REFL "m:num");;
+|- (\m. m) = (\m. m)
+\end{verbatim}
+}
+\SEEALSO
+ETA_CONV, EXT, MK_ABS.
-\DOC{+}
+\ENDDOC
+\DOC{abs\_goals}
-\TYPE {\small\verb%$+ : ((int # int) -> int)%}\egroup
+\TYPE {\small\verb%abs_goals : (subgoals list -> goalstack)%}\egroup
\SYNOPSIS
-Performs addition on ML integers.
-
-\FAILURE
-Never fails.
+This function is for internal use only and is to be deleted from a future
+version of the system. It should not be used.
\ENDDOC
-\DOC{-}
+\DOC{ACCEPT\_TAC}
-\TYPE {\small\verb%$- : ((int # int) -> int)%}\egroup
+\TYPE {\small\verb%ACCEPT_TAC : thm_tactic%}\egroup
\SYNOPSIS
-Performs subtraction on ML integers.
+Solves a goal if supplied with the desired theorem (up to alpha-conversion).
+
+\DESCRIBE
+{\small\verb%ACCEPT_TAC%} maps a given theorem {\small\verb%th%} to a tactic that solves any goal whose
+conclusion is alpha-convertible to the conclusion of {\small\verb%th%}.
\FAILURE
-Never fails.
+{\small\verb%ACCEPT_TAC th (A,g)%} fails if the term {\small\verb%g%} is not alpha-convertible to the
+conclusion of the supplied theorem {\small\verb%th%}.
-\COMMENTS
-Unary {\small\verb%-%} exists as an internal parser object, but not as a function. So,
-whilst typing in {\small\verb%-1;;%} will work, {\small\verb%-;;%} will return a parse error.
+\EXAMPLE
+{\small\verb%ACCEPT_TAC%} applied to the axiom
+{\par\samepage\setseps\small
+\begin{verbatim}
+ BOOL_CASES_AX = |- !t. (t = T) \/ (t = F)
+\end{verbatim}
+}
+\noindent will solve the goal
+{\par\samepage\setseps\small
+\begin{verbatim}
+ ?- !x. (x = T) \/ (x = F)
+\end{verbatim}
+}
+\noindent but will fail on the goal
+{\par\samepage\setseps\small
+\begin{verbatim}
+ ?- !x. (x = F) \/ (x = T)
+\end{verbatim}
+}
+\USES
+Used for completing proofs by supplying an existing theorem, such as an axiom,
+or a lemma already proved.
+
+\SEEALSO
+MATCH_ACCEPT_TAC.
\ENDDOC
-\DOC{\char'056}
+\DOC{AC\_CONV}
-\TYPE {\small\verb%$. : ((* # * list) -> * list)%}\egroup
+\TYPE {\small\verb%AC_CONV : ((thm # thm) -> conv)%}\egroup
\SYNOPSIS
-Adds single element to the head of a list.
+Proves equality of terms using associative and commutative laws.
\DESCRIBE
-The {\small\verb%.%} operator is an infixed primitive list constructor, analogous to {\small\verb%CONS%}
-in LISP. Its effect is {\small\verb%x . [x1;....;xn]%} = {\small\verb%[x;x1;...;xn]%}.
+Suppose {\small\verb%_%} is a function, which is assumed to be infix in the following syntax,
+and {\small\verb%ath%} and {\small\verb%cth%} are theorems expressing its associativity and
+commutativity; they must be of the following form, except that any free
+variables may have arbitrary names and may be universally quantified:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ ath = |- m _ (n _ p) = (m _ n) _ p
+ cth = |- m _ n = n _ m
+\end{verbatim}
+}
+\noindent Then the conversion {\small\verb%AC_CONV(ath,cth)%} will prove equations whose
+left and right sides can be made identical using these associative and
+commutative laws.
\FAILURE
-Never fails.
+Fails if the associative or commutative law has an invalid form, or if the
+term is not an equation between AC-equivalent terms.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #AC_CONV(ADD_ASSOC,ADD_SYM)
+ # "x + (SUC t) + ((3 + y) + z) = 3 + (SUC t) + x + y + z";;
+ |- (x + ((SUC t) + ((3 + y) + z)) = 3 + ((SUC t) + (x + (y + z)))) = T
+\end{verbatim}
+}
+
+\COMMENTS
+Note that the preproved associative and commutative laws for the operators {\small\verb%+%},
+{\small\verb%*%}, {\small\verb%/\%} and {\small\verb%\/%} are already in the right form to give to {\small\verb%AC_CONV%}.
+
+\SEEALSO
+SYM_CONV.
\ENDDOC
-\DOC{/}
+\DOC{achieve\_first}
-\TYPE {\small\verb%$/ : ((int # int) -> int)%}\egroup
+\TYPE {\small\verb%achieve_first : (subgoals -> thm -> subgoals)%}\egroup
\SYNOPSIS
-Performs division on ML integers.
+This function is for internal use only and is to be deleted from a future
+version of the system. It should not be used.
-\FAILURE
-Fails on division by zero.
+\ENDDOC
+\DOC{achieves}
+
+\TYPE {\small\verb%achieves : (thm -> goal -> bool)%}\egroup
+
+\SYNOPSIS
+This function is for internal use only and is to be deleted from a future
+version of the system. It should not be used.
\ENDDOC
-\DOC{\char'136}
+\DOC{aconv}
-\TYPE {\small\verb%$^ : (string -> string -> string)%}\egroup
+\TYPE {\small\verb%aconv : (term -> term -> bool)%}\egroup
\SYNOPSIS
-Concatenates two ML strings.
+Tests for alpha-convertibility of terms.
\DESCRIBE
-The {\small\verb%^%} is the ML infix string concatenation operator.
-If {\small\verb%s1%} and {\small\verb%s2%} are strings, then {\small\verb%s1^s2%} gives a string which is their
-concatenation.
+When applied to two terms, {\small\verb%aconv%} returns {\small\verb%true%} if they are
+alpha-convertible, and {\small\verb%false%} otherwise.
\FAILURE
Never fails.
\EXAMPLE
+A simple case of alpha-convertibility is the renaming of a single quantified
+variable:
{\par\samepage\setseps\small
\begin{verbatim}
-#`Hello `^`world`;;
-`Hello world` : string
+ #aconv "?x. x=T" "?y. y=T";;
+ true : bool
\end{verbatim}
}
-\COMMENTS
-The ML role of the {\small\verb%^%} operator should not be confused with its use in
-quoted terms to introduce antiquotation (see DESCRIPTION for details).
-
\SEEALSO
-concat, concatl.
+ALPHA, ALPHA_CONV.
\ENDDOC
-\DOC{<}
+\DOC{activate\_binders}
-\TYPE {\small\verb%$< : ((int # int) -> bool)%}\egroup
+\TYPE {\small\verb%activate_binders : (string -> string list)%}\egroup
\SYNOPSIS
-Performs a less-than test on ML integers.
+Makes the quotation parser treat all binders in the current theory segment as
+such.
+
+\DESCRIBE
+The call
+{\par\samepage\setseps\small
+\begin{verbatim}
+ activate_binders `thy`
+\end{verbatim}
+}
+\noindent where {\small\verb%thy%} is an ancestor theory ({\small\verb%`-`%} stands for the current
+theory), will return a list of all binders on that theory, and make the parser
+treat them all as binders, that is, for each binder {\small\verb%b%}, will allow the
+syntactic sugaring {\small\verb%"b x. y"%} as a shorthand for {\small\verb%"b (\x. y)"%}. The special
+syntactic status may be suppressed by preceding {\small\verb%b%} with a dollar sign. The
+function returns a list of all the binders dealt with.
\FAILURE
Never fails.
+\COMMENTS
+This function is mainly intended for internal use. All binders declared by
+{\small\verb%new_binder%} or {\small\verb%new_binder_definition%} are always parsed as such anyway.
+
+\SEEALSO
+activate_all_binders, binders, new_binder, parse_as_binder.
+
\ENDDOC
-\DOC{<<}
+\DOC{ADD\_ASSUM}
-\TYPE {\small\verb%$<< : ((* # **) -> bool)%}\egroup
+\TYPE {\small\verb%ADD_ASSUM : (term -> thm -> thm)%}\egroup
\SYNOPSIS
-Performs a lexical comparison of values.
+Adds an assumption to a theorem.
\DESCRIBE
-{\small\verb%$<<%} performs a fast ordering on values. It is substitutive with
-respect to equality in ML (i.e. if {\small\verb%x << y%} and {\small\verb%x = x'%} and {\small\verb%y = y'%}
-then {\small\verb%x' << y'%}).
+When applied to a boolean term {\small\verb%s%} and a theorem {\small\verb%A |- t%}, the inference
+rule {\small\verb%ADD_ASSUM%} returns the theorem {\small\verb%A u {s} |- t%}.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- t
+ -------------- ADD_ASSUM "s"
+ A u {s} |- t
+\end{verbatim}
+}
+\noindent {\small\verb%ADD_ASSUM%} performs straightforward set union with the new
+assumption; it checks for identical assumptions, but not for alpha-equivalent
+ones. The position at which the new assumption is inserted into the assumption
+list should not be relied on.
\FAILURE
-Never fails.
-
-\USES
-It is often useful, for example in normalizing terms in some way, to be able to
-impose some arbitrary (but definite) ordering on ML values.
+Fails unless the given term has type {\small\verb%bool%}.
\SEEALSO
-=.
+ASSUME, UNDISCH.
\ENDDOC
-\DOC{=}
+\DOC{ADD\_CONV}
-\TYPE {\small\verb%$= : ((* # *) -> bool)%}\egroup
+\TYPE {\small\verb%ADD_CONV : conv%}\egroup
\SYNOPSIS
-Performs an equality test on two ML values.
+Computes the sum of two natural number constants.
\DESCRIBE
-{\small\verb%$=%} works as expected on non-function types. It may give unexpected results
-when applied to function types (or types containing them, such as a pair of
-functions), and should be considered unreliable in those situations.
+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
+{\small\verb%ADD_CONV "n + m"%} returns the theorem:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ |- n + m = s
+\end{verbatim}
+}
+\noindent where {\small\verb%s%} is the numeral that denotes the sum of the natural
+numbers denoted by {\small\verb%n%} and {\small\verb%m%}.
\FAILURE
-Never fails.
+{\small\verb%ADD_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"n + m"%}, where {\small\verb%n%} and
+{\small\verb%m%} are numerals.
\EXAMPLE
{\par\samepage\setseps\small
\begin{verbatim}
-#1 = 2;;
-false : bool
-
-#1 = 1;;
-true : bool
-
-#let f x = x + 1 and g x = x + 2;;
-f = - : (int -> int)
-g = - : (int -> int)
-
-#let f' = f and h x = f x and h' x = x + 1;;
-f' = - : (int -> int)
-h = - : (int -> int)
-h' = - : (int -> int)
-
-#f=f;;
-true : bool
-
-#f = f';;
-true : bool
-
-#f = g;;
-false : bool
-
-#f =h;;
-false : bool
-
-#f=h';;
-false : bool
-
-#h = h';;
-false : bool
+#ADD_CONV "75 + 25";;
+|- 75 + 25 = 100
\end{verbatim}
}
\ENDDOC
-\DOC{>}
-
-\TYPE {\small\verb%$> : ((int # int) -> bool)%}\egroup
-
-\SYNOPSIS
-Performs a greater-than test on ML integers.
-
-\FAILURE
-Never fails.
-
-\ENDDOC
-\DOC{\char'100}
+\DOC{ALL\_CONV}
-\TYPE {\small\verb%$@ : ((* list # * list) -> * list)%}\egroup
+\TYPE {\small\verb%ALL_CONV : conv%}\egroup
\SYNOPSIS
-Concatenates two lists.
+Conversion that always succeeds and leaves a term unchanged.
\DESCRIBE
-{\small\verb%@%} is an infix operator which concatenates two lists.
+When applied to a term {\small\verb%"t"%}, the conversion {\small\verb%ALL_CONV%} returns the
+theorem {\small\verb%|- t = t%}.
\FAILURE
Never fails.
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#[1;2;3] @ [4;5;6];;
-[1; 2; 3; 4; 5; 6] : int list
-\end{verbatim}
-}
+\USES
+Identity element for {\small\verb%THENC%}.
+
\SEEALSO
-append.
+NO_CONV, REFL.
\ENDDOC
-\DOC{ABS}
+\DOC{ALL\_EL\_CONV}
-\TYPE {\small\verb%ABS : (term -> thm -> thm)%}\egroup
+\TYPE {\small\verb%ALL_EL_CONV : conv -> conv%}\egroup
\SYNOPSIS
-Abstracts both sides of an equation.
+Computes by inference the result of applying a predicate to elements of a list.
\DESCRIBE
+{\small\verb%ALL_EL_CONV%} takes a conversion {\small\verb%conv%} and a term {\small\verb%tm%} in the following form:
{\par\samepage\setseps\small
\begin{verbatim}
- A |- t1 = t2
- ------------------------ ABS "x" [Where x is not free in A]
- A |- (\x.t1) = (\x.t2)
-\end{verbatim}
-}
-\FAILURE
-If the theorem is not an equation, or if the variable {\small\verb%x%} is free in the
-assumptions {\small\verb%A%}.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#ABS "m:num" (REFL "m:num");;
-|- (\m. m) = (\m. m)
+ ALL_EL P [x0;...xn]
\end{verbatim}
}
-\SEEALSO
-ETA_CONV, EXT, MK_ABS.
-
-\ENDDOC
-\DOC{ABS\_CONV}
-
-\TYPE {\small\verb%ABS_CONV : (conv -> conv)%}\egroup
-
-\SYNOPSIS
-Applies a conversion to the body of an abstraction.
-
-\DESCRIBE
-If {\small\verb%c%} is a conversion that maps a term {\small\verb%"t"%} to the theorem {\small\verb%|- t = t'%}, then
-the conversion {\small\verb%ABS_CONV c%} maps abstractions of the form {\small\verb%"\x.t"%} to theorems
-of the form:
+\noindent It returns the theorem
{\par\samepage\setseps\small
\begin{verbatim}
- |- (\x.t) = (\x.t')
+ |- ALL_EL P [x0;...xn] = T
\end{verbatim}
}
-\noindent That is, {\small\verb%ABS_CONV c "\x.t"%} applies {\small\verb%c%} to the body of the
-abstraction {\small\verb%"\x.t"%}.
-
-\FAILURE
-{\small\verb%ABS_CONV c tm%} fails if {\small\verb%tm%} is not an abstraction or if {\small\verb%tm%} has the form
-{\small\verb%"\x.t"%} but the conversion {\small\verb%c%} fails when applied to the term {\small\verb%t%}. The
-function returned by {\small\verb%ABS_CONV c%} may also fail if the ML function
-{\small\verb%c:term->thm%} is not, in fact, a conversion (i.e. a function that maps a term
-{\small\verb%t%} to a theorem {\small\verb%|- t = t'%}).
-
-\EXAMPLE
+\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
+{\small\verb%conv "P xi"%} returns the theorem {\small\verb%|- P xi = F%}, then it returns the theorem
{\par\samepage\setseps\small
\begin{verbatim}
-#ABS_CONV SYM_CONV "\x. 1 = x";;
-|- (\x. 1 = x) = (\x. x = 1)
+ |- ALL_EL P [x0;...xn] = F
\end{verbatim}
}
-\SEEALSO
-RAND_CONV, RATOR_CONV, SUB_CONV.
-
-\ENDDOC
-\DOC{abs\_goals}
-
-\TYPE {\small\verb%abs_goals : (subgoals list -> goalstack)%}\egroup
-
-\SYNOPSIS
-This function is for internal use only and is to be deleted from a future
-version of the system. It should not be used.
-
-\ENDDOC
-\DOC{ACCEPT\_TAC}
-
-\TYPE {\small\verb%ACCEPT_TAC : thm_tactic%}\egroup
-
-\SYNOPSIS
-Solves a goal if supplied with the desired theorem (up to alpha-conversion).
-
-\DESCRIBE
-{\small\verb%ACCEPT_TAC%} maps a given theorem {\small\verb%th%} to a tactic that solves any goal whose
-conclusion is alpha-convertible to the conclusion of {\small\verb%th%}.
\FAILURE
-{\small\verb%ACCEPT_TAC th (A,g)%} fails if the term {\small\verb%g%} is not alpha-convertible to the
-conclusion of the supplied theorem {\small\verb%th%}.
+{\small\verb%ALL_EL_CONV conv tm%} fails if {\small\verb%tm%} is not of the form described above, or
+failure occurs when evaluating {\small\verb%conv "P xi"%} for some {\small\verb%xi%}.
\EXAMPLE
-{\small\verb%ACCEPT_TAC%} applied to the axiom
+Evaluating
{\par\samepage\setseps\small
\begin{verbatim}
- BOOL_CASES_AX = |- !t. (t = T) \/ (t = F)
+ ALL_EL_CONV bool_EQ_CONV "ALL_EL ($= T) [T;F;T]";;
\end{verbatim}
}
-\noindent will solve the goal
+\noindent returns the following theorem:
{\par\samepage\setseps\small
\begin{verbatim}
- ?- !x. (x = T) \/ (x = F)
+ |- ALL_EL($= T)[T;F;T] = F
\end{verbatim}
}
-\noindent but will fail on the goal
+\noindent In general, if the predicate {\small\verb%P%} is an explicit lambda abstraction
+{\small\verb%(\x. P x)%}, the conversion should be in the form
{\par\samepage\setseps\small
\begin{verbatim}
- ?- !x. (x = F) \/ (x = T)
+ (BETA_CONV THENC conv')
\end{verbatim}
}
-\USES
-Used for completing proofs by supplying an existing theorem, such as an axiom,
-or a lemma already proved.
\SEEALSO
-MATCH_ACCEPT_TAC.
-
-\ENDDOC
-\DOC{achieves}
-
-\TYPE {\small\verb%achieves : (thm -> goal -> bool)%}\egroup
-
-\SYNOPSIS
-This function is for internal use only and is to be deleted from a future
-version of the system. It should not be used.
+SOME_EL_CONV, IS_EL_CONV, FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV.
\ENDDOC
-\DOC{achieve\_first}
-
-\TYPE {\small\verb%achieve_first : (subgoals -> thm -> subgoals)%}\egroup
-\SYNOPSIS
-This function is for internal use only and is to be deleted from a future
-version of the system. It should not be used.
-
-\ENDDOC
-\DOC{aconv}
+\DOC{allowed\_constant}
-\TYPE {\small\verb%aconv : (term -> term -> bool)%}\egroup
+\TYPE {\small\verb%allowed_constant : (string -> bool)%}\egroup
\SYNOPSIS
-Tests for alpha-convertibility of terms.
+Tests if a string has a permissible name for a constant.
\DESCRIBE
-When applied to two terms, {\small\verb%aconv%} returns {\small\verb%true%} if they are
-alpha-convertible, and {\small\verb%false%} otherwise.
+When applied to a string, {\small\verb%allowed_constant%} returns {\small\verb%true%} if the string is a
+permissible constant name, that is, if it is an identifier (see the DESCRIPTION
+for more details), and {\small\verb%false%} otherwise.
\FAILURE
Never fails.
\EXAMPLE
-A simple case of alpha-convertibility is the renaming of a single quantified
-variable:
+The following shows how the lexical rules can be altered:
{\par\samepage\setseps\small
\begin{verbatim}
- #aconv "?x. x=T" "?y. y=T";;
- true : bool
+ #map allowed_constant [`pi`; `@`; `a name`; `+++++`; `*`];;
+ [true; true; false; false; true] : bool list
+
+ #new_special_symbol `+++++`;;
+ () : void
+
+ #map allowed_constant [`pi`; `@`; `a name`; `+++++`; `*`];;
+ [true; true; false; true; true] : bool list
\end{verbatim}
}
+\COMMENTS
+Note that this function only performs a lexical test; it does not check whether
+there is already a constant of that name in the current theory.
+
\SEEALSO
-ALPHA, ALPHA_CONV.
+constants, is_constant, new_alphanum, new_special_symbol, special_symbols.
\ENDDOC
-\DOC{activate\_binders}
+\DOC{ALL\_TAC}
-\TYPE {\small\verb%activate_binders : (string -> string list)%}\egroup
+\TYPE {\small\verb%ALL_TAC : tactic%}\egroup
\SYNOPSIS
-Makes the quotation parser treat all binders in the current theory segment as
-such.
+Passes on a goal unchanged.
\DESCRIBE
-The call
-{\par\samepage\setseps\small
-\begin{verbatim}
- activate_binders `thy`
-\end{verbatim}
-}
-\noindent where {\small\verb%thy%} is an ancestor theory ({\small\verb%`-`%} stands for the current
-theory), will return a list of all binders on that theory, and make the parser
-treat them all as binders, that is, for each binder {\small\verb%b%}, will allow the
-syntactic sugaring {\small\verb%"b x. y"%} as a shorthand for {\small\verb%"b (\x. y)"%}. The special
-syntactic status may be suppressed by preceding {\small\verb%b%} with a dollar sign. The
-function returns a list of all the binders dealt with.
+{\small\verb%ALL_TAC%} applied to a goal {\small\verb%g%} simply produces the subgoal list {\small\verb%[g]%}. It is
+the identity for the {\small\verb%THEN%} tactical.
\FAILURE
Never fails.
-\COMMENTS
-This function is mainly intended for internal use. All binders declared by
-{\small\verb%new_binder%} or {\small\verb%new_binder_definition%} are always parsed as such anyway.
+\EXAMPLE
+The tactic {\small\verb%INDUCT_TAC THENL [ALL_TAC;tac]%}, applied to a goal {\small\verb%g%}, applies
+{\small\verb%INDUCT_TAC%} to {\small\verb%g%} to give a basis and step subgoal; it then returns the
+basis unchanged, along with the subgoals produced by applying {\small\verb%tac%} to the
+step.
+
+\USES
+Used to write tacticals such as {\small\verb%REPEAT%}.
+Often used as a place-holder in building compound tactics using tacticals
+such as {\small\verb%THENL%}.
\SEEALSO
-activate_all_binders, binders, new_binder, parse_as_binder.
+NO_TAC, REPEAT, THENL.
\ENDDOC
-\DOC{AC\_CONV}
+\DOC{ALL\_THEN}
-\TYPE {\small\verb%AC_CONV : ((thm # thm) -> conv)%}\egroup
+\TYPE {\small\verb%ALL_THEN : thm_tactical%}\egroup
\SYNOPSIS
-Proves equality of terms using associative and commutative laws.
+Passes a theorem unchanged to a theorem-tactic.
\DESCRIBE
-Suppose {\small\verb%_%} is a function, which is assumed to be infix in the following syntax,
-and {\small\verb%ath%} and {\small\verb%cth%} are theorems expressing its associativity and
-commutativity; they must be of the following form, except that any free
-variables may have arbitrary names and may be universally quantified:
-{\par\samepage\setseps\small
-\begin{verbatim}
- ath = |- m _ (n _ p) = (m _ n) _ p
- cth = |- m _ n = n _ m
-\end{verbatim}
-}
-\noindent Then the conversion {\small\verb%AC_CONV(ath,cth)%} will prove equations whose
-left and right sides can be made identical using these associative and
-commutative laws.
+For any theorem-tactic {\small\verb%ttac%} and theorem {\small\verb%th%}, the application {\small\verb%ALL_THEN ttac
+th%} results simply in {\small\verb%ttac th%}, that is, the theorem is passed unchanged to
+the theorem-tactic. {\small\verb%ALL_THEN%} is the identity theorem-tactical.
\FAILURE
-Fails if the associative or commutative law has an invalid form, or if the
-term is not an equation between AC-equivalent terms.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
- #AC_CONV(ADD_ASSOC,ADD_SYM)
- # "x + (SUC t) + ((3 + y) + z) = 3 + (SUC t) + x + y + z";;
- |- (x + ((SUC t) + ((3 + y) + z)) = 3 + ((SUC t) + (x + (y + z)))) = T
-\end{verbatim}
-}
+The application of {\small\verb%ALL_THEN%} to a theorem-tactic never fails. The resulting
+theorem-tactic fails under exactly the same conditions as the original one
-\COMMENTS
-Note that the preproved associative and commutative laws for the operators {\small\verb%+%},
-{\small\verb%*%}, {\small\verb%/\%} and {\small\verb%\/%} are already in the right form to give to {\small\verb%AC_CONV%}.
+\USES
+Writing compound tactics or tacticals, e.g. terminating list iterations
+of theorem-tacticals.
\SEEALSO
-SYM_CONV.
+ALL_TAC, FAIL_TAC, NO_TAC, NO_THEN, THEN_TCL, ORELSE_TCL.
\ENDDOC
-\DOC{ADD\_ASSUM}
+\DOC{ALPHA\_CONV}
-\TYPE {\small\verb%ADD_ASSUM : (term -> thm -> thm)%}\egroup
+\TYPE {\small\verb%ALPHA_CONV : (term -> conv)%}\egroup
\SYNOPSIS
-Adds an assumption to a theorem.
+Renames the bound variable of a lambda-abstraction.
\DESCRIBE
-When applied to a boolean term {\small\verb%s%} and a theorem {\small\verb%A |- t%}, the inference
-rule {\small\verb%ADD_ASSUM%} returns the theorem {\small\verb%A u {s} |- t%}.
+If {\small\verb%"x"%} is a variable of type {\small\verb%ty%} and {\small\verb%"\y.t"%} is an abstraction in which
+the bound variable {\small\verb%y%} also has type {\small\verb%ty%}, then {\small\verb%ALPHA_CONV "x" "\y.t"%}
+returns the theorem:
{\par\samepage\setseps\small
\begin{verbatim}
- A |- t
- -------------- ADD_ASSUM "s"
- A u {s} |- t
+ |- (\y.t) = (\x'. t[x'/y])
\end{verbatim}
}
-\noindent {\small\verb%ADD_ASSUM%} performs straightforward set union with the new
-assumption; it checks for identical assumptions, but not for alpha-equivalent
-ones. The position at which the new assumption is inserted into the assumption
-list should not be relied on.
+\noindent where the variable {\small\verb%x':ty%} is a primed variant of {\small\verb%x%} chosen so
+as not to be free in {\small\verb%"\y.t"%}.
\FAILURE
-Fails unless the given term has type {\small\verb%bool%}.
+{\small\verb%ALPHA_CONV "x" "tm"%} fails if {\small\verb%x%} is not a variable, if {\small\verb%tm%} is not an
+abstraction, or if {\small\verb%x%} is a variable {\small\verb%v%} and {\small\verb%tm%} is a lambda abstraction
+{\small\verb%\y.t%} but the types of {\small\verb%v%} and {\small\verb%y%} differ.
\SEEALSO
-ASSUME, UNDISCH.
+ALPHA, GEN_ALPHA_CONV.
\ENDDOC
-\DOC{ADD\_CONV}
+\DOC{ALPHA}
-\TYPE {\small\verb%ADD_CONV : conv%}\egroup
+\TYPE {\small\verb%ALPHA : (term -> term -> thm)%}\egroup
\SYNOPSIS
-Computes the sum of two natural number constants.
+Proves equality of alpha-equivalent terms.
\DESCRIBE
-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
-{\small\verb%ADD_CONV "n + m"%} returns the theorem:
+When applied to a pair of terms {\small\verb%t1%} and {\small\verb%t1'%} which are
+alpha-equivalent, {\small\verb%ALPHA%} returns the theorem {\small\verb%|- t1 = t1'%}.
{\par\samepage\setseps\small
\begin{verbatim}
- |- n + m = s
+
+ ------------- ALPHA "t1" "t1'"
+ |- t1 = t1'
\end{verbatim}
}
-\noindent where {\small\verb%s%} is the numeral that denotes the sum of the natural
-numbers denoted by {\small\verb%n%} and {\small\verb%m%}.
-
\FAILURE
-{\small\verb%ADD_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"n + m"%}, where {\small\verb%n%} and
-{\small\verb%m%} are numerals.
+Fails unless the terms provided are alpha-equivalent.
\EXAMPLE
{\par\samepage\setseps\small
\begin{verbatim}
-#ADD_CONV "75 + 25";;
-|- 75 + 25 = 100
+#ALPHA "!x:num. x = x" "!y:num. y = y";;
+|- (!x. x = x) = (!y. y = y)
\end{verbatim}
}
+\COMMENTS
+The system shows the type of {\small\verb%ALPHA%} as {\small\verb%term -> conv%}.
+
+\SEEALSO
+aconv, ALPHA_CONV, GEN_ALPHA_CONV.
+
\ENDDOC
-\DOC{allowed\_constant}
+\DOC{ancestors}
-\TYPE {\small\verb%allowed_constant : (string -> bool)%}\egroup
+\TYPE {\small\verb%ancestors : (string -> string list)%}\egroup
\SYNOPSIS
-Tests if a string has a permissible name for a constant.
+Gets a list of the (proper) ancestors of a theory.
\DESCRIBE
-When applied to a string, {\small\verb%allowed_constant%} returns {\small\verb%true%} if the string is a
-permissible constant name, that is, if it is an identifier (see the DESCRIPTION
-for more details), and {\small\verb%false%} otherwise.
+A call to {\small\verb%ancestors `th`%} returns a list of all the proper ancestors (i.e.
+parents, parents of parents, etc.) of the theory {\small\verb%th%}.
\FAILURE
-Never fails.
-
-\EXAMPLE
-The following shows how the lexical rules can be altered:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #map allowed_constant [`pi`; `@`; `a name`; `+++++`; `*`];;
- [true; true; false; false; true] : bool list
-
- #new_special_symbol `+++++`;;
- () : void
-
- #map allowed_constant [`pi`; `@`; `a name`; `+++++`; `*`];;
- [true; true; false; true; true] : bool list
-\end{verbatim}
-}
-\COMMENTS
-Note that this function only performs a lexical test; it does not check whether
-there is already a constant of that name in the current theory.
+Fails if `th` is not an ancestor of the current theory.
\SEEALSO
-constants, is_constant, new_alphanum, new_special_symbol, special_symbols.
+ancestry, parents.
\ENDDOC
-\DOC{ALL\_CONV}
+\DOC{ancestry}
-\TYPE {\small\verb%ALL_CONV : conv%}\egroup
+\TYPE {\small\verb%ancestry : (void -> string list)%}\egroup
\SYNOPSIS
-Conversion that always succeeds and leaves a term unchanged.
+Gets a list of the ancestors of the current theory.
\DESCRIBE
-When applied to a term {\small\verb%"t"%}, the conversion {\small\verb%ALL_CONV%} returns the
-theorem {\small\verb%|- t = t%}.
+A call {\small\verb%ancestry()%} returns a list of all the ancestors of the current theory,
+i.e. the current theory itself, its parents, parents of parents, etc.
\FAILURE
Never fails.
-\USES
-Identity element for {\small\verb%THENC%}.
+\COMMENTS
+The call {\small\verb%ancestry()%} is considerably more efficient than {\small\verb%ancestors `-`%}.
\SEEALSO
-NO_CONV, REFL.
+ancestors, parents.
\ENDDOC
-\DOC{ALL\_EL\_CONV}
+\DOC{AND\_EXISTS\_CONV}
-\TYPE {\small\verb%ALL_EL_CONV : conv -> conv%}\egroup
+\TYPE {\small\verb%AND_EXISTS_CONV : conv%}\egroup
\SYNOPSIS
-Computes by inference the result of applying a predicate to elements of a list.
+Moves an existential quantification outwards through a conjunction.
\DESCRIBE
-{\small\verb%ALL_EL_CONV%} takes a conversion {\small\verb%conv%} and a term {\small\verb%tm%} in the following form:
+When applied to a term of the form {\small\verb%(?x.P) /\ (?x.Q)%}, where {\small\verb%x%} is free
+in neither {\small\verb%P%} nor {\small\verb%Q%}, {\small\verb%AND_EXISTS_CONV%} returns the theorem:
{\par\samepage\setseps\small
\begin{verbatim}
- ALL_EL P [x0;...xn]
+ |- (?x. P) /\ (?x. Q) = (?x. P /\ Q)
\end{verbatim}
}
-\noindent It returns the theorem
+\FAILURE
+{\small\verb%AND_EXISTS_CONV%} fails if it is applied to a term not of the form
+{\small\verb%(?x.P) /\ (?x.Q)%}, or if it is applied to a term {\small\verb%(?x.P) /\ (?x.Q)%}
+in which the variable {\small\verb%x%} is free in either {\small\verb%P%} or {\small\verb%Q%}.
+
+\SEEALSO
+EXISTS_AND_CONV, LEFT_AND_EXISTS_CONV, RIGHT_AND_EXISTS_CONV.
+
+\ENDDOC
+\DOC{AND\_FORALL\_CONV}
+
+\TYPE {\small\verb%AND_FORALL_CONV : conv%}\egroup
+
+\SYNOPSIS
+Moves a universal quantification outwards through a conjunction.
+
+\DESCRIBE
+When applied to a term of the form {\small\verb%(!x.P) /\ (!x.Q)%}, the conversion
+{\small\verb%AND_FORALL_CONV%} returns the theorem:
{\par\samepage\setseps\small
\begin{verbatim}
- |- ALL_EL P [x0;...xn] = T
+ |- (!x.P) /\ (!x.Q) = (!x. P /\ Q)
\end{verbatim}
}
-\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
-{\small\verb%conv "P xi"%} returns the theorem {\small\verb%|- P xi = F%}, then it returns the theorem
+\FAILURE
+Fails if applied to a term not of the form {\small\verb%(!x.P) /\ (!x.Q)%}.
+
+\SEEALSO
+FORALL_AND_CONV, LEFT_AND_FORALL_CONV, RIGHT_AND_FORALL_CONV.
+
+\ENDDOC
+\DOC{ANTE\_CONJ\_CONV}
+
+\TYPE {\small\verb%ANTE_CONJ_CONV : conv%}\egroup
+
+\SYNOPSIS
+Eliminates a conjunctive antecedent in favour of implication.
+
+\DESCRIBE
+When applied to a term of the form {\small\verb%"(t1 /\ t2) ==> t"%}, the conversion
+{\small\verb%ANTE_CONJ_CONV%} returns the theorem:
{\par\samepage\setseps\small
\begin{verbatim}
- |- ALL_EL P [x0;...xn] = F
+ |- (t1 /\ t2 ==> t) = (t1 ==> t2 ==> t)
\end{verbatim}
}
-
\FAILURE
-{\small\verb%ALL_EL_CONV conv tm%} fails if {\small\verb%tm%} is not of the form described above, or
-failure occurs when evaluating {\small\verb%conv "P xi"%} for some {\small\verb%xi%}.
+Fails if applied to a term not of the form {\small\verb%"(t1 /\ t2) ==> t"%}.
-\EXAMPLE
-Evaluating
+\USES
+Somewhat ad-hoc, but can be used (with {\small\verb%CONV_TAC%}) to transform a goal of the
+form {\small\verb%?- (P /\ Q) ==> R%} into the subgoal {\small\verb%?- P ==> (Q ==> R)%}, so that only
+the antecedent {\small\verb%P%} is moved into the assumptions by {\small\verb%DISCH_TAC%}.
+
+\ENDDOC
+\DOC{ANTE\_RES\_THEN}
+
+\TYPE {\small\verb%ANTE_RES_THEN : thm_tactical%}\egroup
+
+\SYNOPSIS
+Resolves implicative assumptions with an antecedent.
+
+\DESCRIBE
+Given a theorem-tactic {\small\verb%ttac%} and a theorem {\small\verb%A |- t%}, the function
+{\small\verb%ANTE_RES_THEN%} produces a tactic that attempts to match {\small\verb%t%} to the antecedent
+of each implication
{\par\samepage\setseps\small
\begin{verbatim}
- ALL_EL_CONV bool_EQ_CONV "ALL_EL ($= T) [T;F;T]";;
+ Ai |- !x1...xn. ui ==> vi
\end{verbatim}
}
-\noindent returns the following theorem:
+\noindent (where {\small\verb%Ai%} is just {\small\verb%!x1...xn. ui ==> vi%}) that occurs among the
+assumptions of a goal. If the antecedent {\small\verb%ui%} of any implication matches {\small\verb%t%},
+then an instance of {\small\verb%Ai u A |- vi%} is obtained by specialization of the
+variables {\small\verb%x1%}, ..., {\small\verb%xn%} and type instantiation, followed by an application of
+modus ponens. Because all implicative assumptions are tried, this may result
+in several modus-ponens consequences of the supplied theorem and the
+assumptions. Tactics are produced using {\small\verb%ttac%} from all these theorems, and
+these tactics are applied in sequence to the goal. That is,
{\par\samepage\setseps\small
\begin{verbatim}
- |- ALL_EL($= T)[T;F;T] = F
+ ANTE_RES_THEN ttac (A |- t) g
\end{verbatim}
}
-\noindent In general, if the predicate {\small\verb%P%} is an explicit lambda abstraction
-{\small\verb%(\x. P x)%}, the conversion should be in the form
+\noindent has the effect of:
{\par\samepage\setseps\small
\begin{verbatim}
- (BETA_CONV THENC conv')
+ MAP_EVERY ttac [A1 u A |- v1; ...; Am u A |- vm] g
\end{verbatim}
}
-
-\SEEALSO
-SOME_EL_CONV, IS_EL_CONV, FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV.
-
-\ENDDOC
-
-\DOC{ALL\_TAC}
-
-\TYPE {\small\verb%ALL_TAC : tactic%}\egroup
-
-\SYNOPSIS
-Passes on a goal unchanged.
-
-\DESCRIBE
-{\small\verb%ALL_TAC%} applied to a goal {\small\verb%g%} simply produces the subgoal list {\small\verb%[g]%}. It is
-the identity for the {\small\verb%THEN%} tactical.
-
-\FAILURE
-Never fails.
-
-\EXAMPLE
-The tactic {\small\verb%INDUCT_TAC THENL [ALL_TAC;tac]%}, applied to a goal {\small\verb%g%}, applies
-{\small\verb%INDUCT_TAC%} to {\small\verb%g%} to give a basis and step subgoal; it then returns the
-basis unchanged, along with the subgoals produced by applying {\small\verb%tac%} to the
-step.
-
-\USES
-Used to write tacticals such as {\small\verb%REPEAT%}.
-Often used as a place-holder in building compound tactics using tacticals
-such as {\small\verb%THENL%}.
-
-\SEEALSO
-NO_TAC, REPEAT, THENL.
-
-\ENDDOC
-\DOC{ALL\_THEN}
-
-\TYPE {\small\verb%ALL_THEN : thm_tactical%}\egroup
-
-\SYNOPSIS
-Passes a theorem unchanged to a theorem-tactic.
-
-\DESCRIBE
-For any theorem-tactic {\small\verb%ttac%} and theorem {\small\verb%th%}, the application {\small\verb%ALL_THEN ttac
-th%} results simply in {\small\verb%ttac th%}, that is, the theorem is passed unchanged to
-the theorem-tactic. {\small\verb%ALL_THEN%} is the identity theorem-tactical.
+\noindent where the theorems {\small\verb%Ai u A |- vi%} are all the consequences that can
+be drawn by a (single) matching modus-ponens inference from the implications
+that occur among the assumptions of the goal {\small\verb%g%} and the supplied theorem
+{\small\verb%A |- t%}. Any negation {\small\verb%~v%} that appears among the assumptions of the goal is
+treated as an implication {\small\verb%v ==> F%}. The sequence in which the theorems
+{\small\verb%Ai u A |- vi%} are generated and the corresponding tactics applied is
+unspecified.
\FAILURE
-The application of {\small\verb%ALL_THEN%} to a theorem-tactic never fails. The resulting
-theorem-tactic fails under exactly the same conditions as the original one
-
-\USES
-Writing compound tactics or tacticals, e.g. terminating list iterations
-of theorem-tacticals.
+{\small\verb%ANTE_RES_THEN ttac (A |- t)%} fails when applied to a goal {\small\verb%g%} if any of the
+tactics produced by {\small\verb%ttac (Ai u A |- vi)%}, where {\small\verb%Ai u A |- vi%} is the {\small\verb%i%}th
+resolvent obtained from the theorem {\small\verb%A |- t%} and the assumptions of {\small\verb%g%}, fails
+when applied in sequence to {\small\verb%g%}.
\SEEALSO
-ALL_TAC, FAIL_TAC, NO_TAC, NO_THEN, THEN_TCL, ORELSE_TCL.
+IMP_RES_TAC, IMP_RES_THEN, MATCH_MP, RES_TAC, RES_THEN.
\ENDDOC
-\DOC{ALPHA}
+\DOC{APPEND\_CONV}
-\TYPE {\small\verb%ALPHA : (term -> term -> thm)%}\egroup
+\TYPE {\small\verb%APPEND_CONV : conv%}\egroup
\SYNOPSIS
-Proves equality of alpha-equivalent terms.
+Computes by inference the result of appending two object-language lists.
\DESCRIBE
-When applied to a pair of terms {\small\verb%t1%} and {\small\verb%t1'%} which are
-alpha-equivalent, {\small\verb%ALPHA%} returns the theorem {\small\verb%|- t1 = t1'%}.
+For any pair of object language lists of the form {\small\verb%"[x1;...;xn]"%} and
+{\small\verb%"[y1;...;ym]"%}, the result of evaluating
{\par\samepage\setseps\small
\begin{verbatim}
-
- ------------- ALPHA "t1" "t1'"
- |- t1 = t1'
+ APPEND_CONV "APPEND [x1;...;xn] [y1;...;ym]"
\end{verbatim}
}
-\FAILURE
-Fails unless the terms provided are alpha-equivalent.
-
-\EXAMPLE
+\noindent is the theorem
{\par\samepage\setseps\small
\begin{verbatim}
-#ALPHA "!x:num. x = x" "!y:num. y = y";;
-|- (!x. x = x) = (!y. y = y)
+ |- APPEND [x1;...;xn] [y1;...;ym] = [x1;...;xn;y1;...;ym]
\end{verbatim}
}
-\COMMENTS
-The system shows the type of {\small\verb%ALPHA%} as {\small\verb%term -> conv%}.
+\noindent The length of either list (or both) may be 0.
-\SEEALSO
-aconv, ALPHA_CONV, GEN_ALPHA_CONV.
+\FAILURE
+{\small\verb%APPEND_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"APPEND l1 l2"%}, where
+{\small\verb%l1%} and {\small\verb%l2%} are (possibly empty) object-language lists of the forms
+{\small\verb%"[x1;...;xn]"%} and {\small\verb%"[y1;...;ym]"%}.
\ENDDOC
-\DOC{ALPHA\_CONV}
-\TYPE {\small\verb%ALPHA_CONV : (term -> conv)%}\egroup
+\DOC{append}
+
+\TYPE {\small\verb%append : (* list -> * list -> * list)%}\egroup
\SYNOPSIS
-Renames the bound variable of a lambda-abstraction.
+Concatenates two lists.
\DESCRIBE
-If {\small\verb%"x"%} is a variable of type {\small\verb%ty%} and {\small\verb%"\y.t"%} is an abstraction in which
-the bound variable {\small\verb%y%} also has type {\small\verb%ty%}, then {\small\verb%ALPHA_CONV "x" "\y.t"%}
-returns the theorem:
-{\par\samepage\setseps\small
-\begin{verbatim}
- |- (\y.t) = (\x'. t[x'/y])
-\end{verbatim}
-}
-\noindent where the variable {\small\verb%x':ty%} is a primed variant of {\small\verb%x%} chosen so
-as not to be free in {\small\verb%"\y.t"%}.
+{\small\verb%append [x1;...;xn] [y1;...;ym]%} returns {\small\verb%[x1;...;xn;y1;...;ym]%}.
\FAILURE
-{\small\verb%ALPHA_CONV "x" "tm"%} fails if {\small\verb%x%} is not a variable, if {\small\verb%tm%} is not an
-abstraction, or if {\small\verb%x%} is a variable {\small\verb%v%} and {\small\verb%tm%} is a lambda abstraction
-{\small\verb%\y.t%} but the types of {\small\verb%v%} and {\small\verb%y%} differ.
+Never fails.
-\SEEALSO
-ALPHA, GEN_ALPHA_CONV.
+\COMMENTS
+Performs the same operation as {\small\verb%$@%}.
\ENDDOC
-\DOC{ancestors}
+\DOC{append\_openw}
-\TYPE {\small\verb%ancestors : (string -> string list)%}\egroup
+\TYPE {\small\verb%append_openw : (string -> string)%}\egroup
\SYNOPSIS
-Gets a list of the (proper) ancestors of a theory.
+Opens a port for appending to a named file.
\DESCRIBE
-A call to {\small\verb%ancestors `th`%} returns a list of all the proper ancestors (i.e.
-parents, parents of parents, etc.) of the theory {\small\verb%th%}.
-
-\FAILURE
-Fails if `th` is not an ancestor of the current theory.
+When applied to a filename {\small\verb%`name`%}, the function {\small\verb%append_openw%} opens the file
+{\small\verb%name%} for writing, such that existing contents are appended to rather than
+overwritten. It returns a port descriptor string, which can be used by {\small\verb%write%}
+to append to the file, and by {\small\verb%close%} to close it.
-\SEEALSO
-ancestry, parents.
+\EXAMPLE
+The following example assumes that HOL is being run under Unix. It will
+overwrite an existing file {\small\verb%test-file%} in the current directory.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #system `echo -n 'Hello ' >test-file`;;
+ 0 : int
-\ENDDOC
-\DOC{ancestry}
+ #let port = append_openw `test-file`;;
+ port = `%test-file` : string
-\TYPE {\small\verb%ancestry : (void -> string list)%}\egroup
+ #write(port,`world`);;
+ () : void
-\SYNOPSIS
-Gets a list of the ancestors of the current theory.
+ #close port;;
+ () : void
-\DESCRIBE
-A call {\small\verb%ancestry()%} returns a list of all the ancestors of the current theory,
-i.e. the current theory itself, its parents, parents of parents, etc.
+ #system `cat test-file`;;
+ Hello world0 : int
+\end{verbatim}
+}
+\SEEALSO
+close, openi, openw, read, write.
-\FAILURE
-Never fails.
+\ENDDOC
+\DOC{apply\_proof}
-\COMMENTS
-The call {\small\verb%ancestry()%} is considerably more efficient than {\small\verb%ancestors `-`%}.
+\TYPE {\small\verb%apply_proof : (subgoals -> thm)%}\egroup
-\SEEALSO
-ancestors, parents.
+\SYNOPSIS
+This function is for internal use only and is to be deleted from a future
+version of the system. It should not be used.
\ENDDOC
-\DOC{AND\_EXISTS\_CONV}
+\DOC{AP\_TERM}
-\TYPE {\small\verb%AND_EXISTS_CONV : conv%}\egroup
+\TYPE {\small\verb%AP_TERM : (term -> thm -> thm)%}\egroup
\SYNOPSIS
-Moves an existential quantification outwards through a conjunction.
+Applies a function to both sides of an equational theorem.
\DESCRIBE
-When applied to a term of the form {\small\verb%(?x.P) /\ (?x.Q)%}, where {\small\verb%x%} is free
-in neither {\small\verb%P%} nor {\small\verb%Q%}, {\small\verb%AND_EXISTS_CONV%} returns the theorem:
+When applied to a term {\small\verb%f%} and a theorem {\small\verb%A |- x = y%}, the
+inference rule {\small\verb%AP_TERM%} returns the theorem {\small\verb%A |- f x = f y%}.
{\par\samepage\setseps\small
\begin{verbatim}
- |- (?x. P) /\ (?x. Q) = (?x. P /\ Q)
+ A |- x = y
+ ---------------- AP_TERM "f"
+ A |- f x = f y
\end{verbatim}
}
\FAILURE
-{\small\verb%AND_EXISTS_CONV%} fails if it is applied to a term not of the form
-{\small\verb%(?x.P) /\ (?x.Q)%}, or if it is applied to a term {\small\verb%(?x.P) /\ (?x.Q)%}
-in which the variable {\small\verb%x%} is free in either {\small\verb%P%} or {\small\verb%Q%}.
+Fails unless the theorem is equational and the supplied term is a function
+whose domain type is the same as the type of both sides of the equation.
\SEEALSO
-EXISTS_AND_CONV, LEFT_AND_EXISTS_CONV, RIGHT_AND_EXISTS_CONV.
+AP_THM, MK_COMB.
\ENDDOC
-\DOC{AND\_FORALL\_CONV}
+\DOC{AP\_TERM\_TAC}
-\TYPE {\small\verb%AND_FORALL_CONV : conv%}\egroup
+\TYPE {\small\verb%AP_TERM_TAC : tactic%}\egroup
\SYNOPSIS
-Moves a universal quantification outwards through a conjunction.
+Strips a function application from both sides of an equational goal.
\DESCRIBE
-When applied to a term of the form {\small\verb%(!x.P) /\ (!x.Q)%}, the conversion
-{\small\verb%AND_FORALL_CONV%} returns the theorem:
+{\small\verb%AP_TERM_TAC%} reduces a goal of the form {\small\verb%A ?- f x = f y%} by stripping away
+the function applications, giving the new goal {\small\verb%A ?- x = y%}.
{\par\samepage\setseps\small
\begin{verbatim}
- |- (!x.P) /\ (!x.Q) = (!x. P /\ Q)
+ A ?- f x = f y
+ ================ AP_TERM_TAC
+ A ?- x = y
\end{verbatim}
}
\FAILURE
-Fails if applied to a term not of the form {\small\verb%(!x.P) /\ (!x.Q)%}.
+Fails unless the goal is equational, with both sides being applications
+of the same function.
\SEEALSO
-FORALL_AND_CONV, LEFT_AND_FORALL_CONV, RIGHT_AND_FORALL_CONV.
+AP_TERM, AP_THM.
\ENDDOC
-\DOC{ANTE\_CONJ\_CONV}
+\DOC{AP\_THM}
-\TYPE {\small\verb%ANTE_CONJ_CONV : conv%}\egroup
+\TYPE {\small\verb%AP_THM : (thm -> term -> thm)%}\egroup
\SYNOPSIS
-Eliminates a conjunctive antecedent in favour of implication.
+Proves equality of equal functions applied to a term.
\DESCRIBE
-When applied to a term of the form {\small\verb%"(t1 /\ t2) ==> t"%}, the conversion
-{\small\verb%ANTE_CONJ_CONV%} returns the theorem:
+When applied to a theorem {\small\verb%A |- f = g%} and a term {\small\verb%x%}, the inference
+rule {\small\verb%AP_THM%} returns the theorem {\small\verb%A |- f x = g x%}.
{\par\samepage\setseps\small
\begin{verbatim}
- |- (t1 /\ t2 ==> t) = (t1 ==> t2 ==> t)
+ A |- f = g
+ ---------------- AP_THM (A |- f = g) "x"
+ A |- f x = g x
\end{verbatim}
}
\FAILURE
-Fails if applied to a term not of the form {\small\verb%"(t1 /\ t2) ==> t"%}.
+Fails unless the conclusion of the theorem is an equation, both sides
+of which are functions whose domain type is the same as that of the
+supplied term.
-\USES
-Somewhat ad-hoc, but can be used (with {\small\verb%CONV_TAC%}) to transform a goal of the
-form {\small\verb%?- (P /\ Q) ==> R%} into the subgoal {\small\verb%?- P ==> (Q ==> R)%}, so that only
-the antecedent {\small\verb%P%} is moved into the assumptions by {\small\verb%DISCH_TAC%}.
+\COMMENTS
+The type of {\small\verb%AP_THM%} is shown by the system as {\small\verb%thm -> conv%}.
+
+\SEEALSO
+AP_TERM, ETA_CONV, EXT, MK_COMB.
\ENDDOC
-\DOC{ANTE\_RES\_THEN}
+\DOC{AP\_THM\_TAC}
-\TYPE {\small\verb%ANTE_RES_THEN : thm_tactical%}\egroup
+\TYPE {\small\verb%AP_THM_TAC : tactic%}\egroup
\SYNOPSIS
-Resolves implicative assumptions with an antecedent.
+Strips identical operands from functions on both sides of an equation.
\DESCRIBE
-Given a theorem-tactic {\small\verb%ttac%} and a theorem {\small\verb%A |- t%}, the function
-{\small\verb%ANTE_RES_THEN%} produces a tactic that attempts to match {\small\verb%t%} to the antecedent
-of each implication
+When applied to a goal of the form {\small\verb%A ?- f x = g x%}, the tactic {\small\verb%AP_THM_TAC%}
+strips away the operands of the function application:
{\par\samepage\setseps\small
\begin{verbatim}
- Ai |- !x1...xn. ui ==> vi
-\end{verbatim}
-}
-\noindent (where {\small\verb%Ai%} is just {\small\verb%!x1...xn. ui ==> vi%}) that occurs among the
-assumptions of a goal. If the antecedent {\small\verb%ui%} of any implication matches {\small\verb%t%},
-then an instance of {\small\verb%Ai u A |- vi%} is obtained by specialization of the
-variables {\small\verb%x1%}, ..., {\small\verb%xn%} and type instantiation, followed by an application of
-modus ponens. Because all implicative assumptions are tried, this may result
-in several modus-ponens consequences of the supplied theorem and the
-assumptions. Tactics are produced using {\small\verb%ttac%} from all these theorems, and
-these tactics are applied in sequence to the goal. That is,
-{\par\samepage\setseps\small
-\begin{verbatim}
- ANTE_RES_THEN ttac (A |- t) g
-\end{verbatim}
-}
-\noindent has the effect of:
-{\par\samepage\setseps\small
-\begin{verbatim}
- MAP_EVERY ttac [A1 u A |- v1; ...; Am u A |- vm] g
-\end{verbatim}
-}
-\noindent where the theorems {\small\verb%Ai u A |- vi%} are all the consequences that can
-be drawn by a (single) matching modus-ponens inference from the implications
-that occur among the assumptions of the goal {\small\verb%g%} and the supplied theorem
-{\small\verb%A |- t%}. Any negation {\small\verb%~v%} that appears among the assumptions of the goal is
-treated as an implication {\small\verb%v ==> F%}. The sequence in which the theorems
-{\small\verb%Ai u A |- vi%} are generated and the corresponding tactics applied is
-unspecified.
-
-\FAILURE
-{\small\verb%ANTE_RES_THEN ttac (A |- t)%} fails when applied to a goal {\small\verb%g%} if any of the
-tactics produced by {\small\verb%ttac (Ai u A |- vi)%}, where {\small\verb%Ai u A |- vi%} is the {\small\verb%i%}th
-resolvent obtained from the theorem {\small\verb%A |- t%} and the assumptions of {\small\verb%g%}, fails
-when applied in sequence to {\small\verb%g%}.
-
-\SEEALSO
-IMP_RES_TAC, IMP_RES_THEN, MATCH_MP, RES_TAC, RES_THEN.
-
-\ENDDOC
-\DOC{append}
-
-\TYPE {\small\verb%append : (* list -> * list -> * list)%}\egroup
-
-\SYNOPSIS
-Concatenates two lists.
-
-\DESCRIBE
-{\small\verb%append [x1;...;xn] [y1;...;ym]%} returns {\small\verb%[x1;...;xn;y1;...;ym]%}.
-
-\FAILURE
-Never fails.
-
-\COMMENTS
-Performs the same operation as {\small\verb%$@%}.
-
-\ENDDOC
-\DOC{APPEND\_CONV}
-
-\TYPE {\small\verb%APPEND_CONV : conv%}\egroup
-
-\SYNOPSIS
-Computes by inference the result of appending two object-language lists.
-
-\DESCRIBE
-For any pair of object language lists of the form {\small\verb%"[x1;...;xn]"%} and
-{\small\verb%"[y1;...;ym]"%}, the result of evaluating
-{\par\samepage\setseps\small
-\begin{verbatim}
- APPEND_CONV "APPEND [x1;...;xn] [y1;...;ym]"
-\end{verbatim}
-}
-\noindent is the theorem
-{\par\samepage\setseps\small
-\begin{verbatim}
- |- APPEND [x1;...;xn] [y1;...;ym] = [x1;...;xn;y1;...;ym]
-\end{verbatim}
-}
-\noindent The length of either list (or both) may be 0.
-
-\FAILURE
-{\small\verb%APPEND_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"APPEND l1 l2"%}, where
-{\small\verb%l1%} and {\small\verb%l2%} are (possibly empty) object-language lists of the forms
-{\small\verb%"[x1;...;xn]"%} and {\small\verb%"[y1;...;ym]"%}.
-
-\ENDDOC
-
-\DOC{append\_openw}
-
-\TYPE {\small\verb%append_openw : (string -> string)%}\egroup
-
-\SYNOPSIS
-Opens a port for appending to a named file.
-
-\DESCRIBE
-When applied to a filename {\small\verb%`name`%}, the function {\small\verb%append_openw%} opens the file
-{\small\verb%name%} for writing, such that existing contents are appended to rather than
-overwritten. It returns a port descriptor string, which can be used by {\small\verb%write%}
-to append to the file, and by {\small\verb%close%} to close it.
-
-\EXAMPLE
-The following example assumes that HOL is being run under Unix. It will
-overwrite an existing file {\small\verb%test-file%} in the current directory.
-{\par\samepage\setseps\small
-\begin{verbatim}
- #system `echo -n 'Hello ' >test-file`;;
- 0 : int
-
- #let port = append_openw `test-file`;;
- port = `%test-file` : string
-
- #write(port,`world`);;
- () : void
-
- #close port;;
- () : void
-
- #system `cat test-file`;;
- Hello world0 : int
-\end{verbatim}
-}
-\SEEALSO
-close, openi, openw, read, write.
-
-\ENDDOC
-\DOC{apply\_proof}
-
-\TYPE {\small\verb%apply_proof : (subgoals -> thm)%}\egroup
-
-\SYNOPSIS
-This function is for internal use only and is to be deleted from a future
-version of the system. It should not be used.
-
-\ENDDOC
-\DOC{AP\_TERM}
-
-\TYPE {\small\verb%AP_TERM : (term -> thm -> thm)%}\egroup
-
-\SYNOPSIS
-Applies a function to both sides of an equational theorem.
-
-\DESCRIBE
-When applied to a term {\small\verb%f%} and a theorem {\small\verb%A |- x = y%}, the
-inference rule {\small\verb%AP_TERM%} returns the theorem {\small\verb%A |- f x = f y%}.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- x = y
- ---------------- AP_TERM "f"
- A |- f x = f y
-\end{verbatim}
-}
-\FAILURE
-Fails unless the theorem is equational and the supplied term is a function
-whose domain type is the same as the type of both sides of the equation.
-
-\SEEALSO
-AP_THM, MK_COMB.
-
-\ENDDOC
-\DOC{AP\_TERM\_TAC}
-
-\TYPE {\small\verb%AP_TERM_TAC : tactic%}\egroup
-
-\SYNOPSIS
-Strips a function application from both sides of an equational goal.
-
-\DESCRIBE
-{\small\verb%AP_TERM_TAC%} reduces a goal of the form {\small\verb%A ?- f x = f y%} by stripping away
-the function applications, giving the new goal {\small\verb%A ?- x = y%}.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A ?- f x = f y
- ================ AP_TERM_TAC
- A ?- x = y
-\end{verbatim}
-}
-\FAILURE
-Fails unless the goal is equational, with both sides being applications
-of the same function.
-
-\SEEALSO
-AP_TERM, AP_THM.
-
-\ENDDOC
-\DOC{AP\_THM}
-
-\TYPE {\small\verb%AP_THM : (thm -> term -> thm)%}\egroup
-
-\SYNOPSIS
-Proves equality of equal functions applied to a term.
-
-\DESCRIBE
-When applied to a theorem {\small\verb%A |- f = g%} and a term {\small\verb%x%}, the inference
-rule {\small\verb%AP_THM%} returns the theorem {\small\verb%A |- f x = g x%}.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- f = g
- ---------------- AP_THM (A |- f = g) "x"
- A |- f x = g x
-\end{verbatim}
-}
-\FAILURE
-Fails unless the conclusion of the theorem is an equation, both sides
-of which are functions whose domain type is the same as that of the
-supplied term.
-
-\COMMENTS
-The type of {\small\verb%AP_THM%} is shown by the system as {\small\verb%thm -> conv%}.
-
-\SEEALSO
-AP_TERM, ETA_CONV, EXT, MK_COMB.
-
-\ENDDOC
-\DOC{AP\_THM\_TAC}
-
-\TYPE {\small\verb%AP_THM_TAC : tactic%}\egroup
-
-\SYNOPSIS
-Strips identical operands from functions on both sides of an equation.
-
-\DESCRIBE
-When applied to a goal of the form {\small\verb%A ?- f x = g x%}, the tactic {\small\verb%AP_THM_TAC%}
-strips away the operands of the function application:
-{\par\samepage\setseps\small
-\begin{verbatim}
- A ?- f x = g x
- ================ AP_THM_TAC
- A ?- f = g
+ A ?- f x = g x
+ ================ AP_THM_TAC
+ A ?- f = g
\end{verbatim}
}
\FAILURE
@@ -1149,41 +917,41 @@ can be 0), and otherwise fails.
is_type.
\ENDDOC
-\DOC{ascii}
+\DOC{ascii\_code}
-\TYPE {\small\verb%ascii : (int -> string)%}\egroup
+\TYPE {\small\verb%ascii_code : (string -> int)%}\egroup
\SYNOPSIS
-Maps an integer to the corresponding ASCII character.
+Maps a character to corresponding ASCII numeric code.
\DESCRIBE
-When given an integer, {\small\verb%ascii%} returns a string consisting of
-the single character corresponding to that integer under the ASCII
-encoding.
+When given a string, {\small\verb%ascii_code%} returns the numeric encoding in the
+ASCII character set of the first character of that string.
\FAILURE
-Fails unless the integer supplied is in the range {\small\verb%0 <= x < 128%}.
+Fails if the string is empty ({\small\verb%``%}).
\SEEALSO
-ascii_code, int_of_string, is_alphanum, is_letter, string_of_int.
+ascii, int_of_string, is_alphanum, is_letter, string_of_int.
\ENDDOC
-\DOC{ascii\_code}
+\DOC{ascii}
-\TYPE {\small\verb%ascii_code : (string -> int)%}\egroup
+\TYPE {\small\verb%ascii : (int -> string)%}\egroup
\SYNOPSIS
-Maps a character to corresponding ASCII numeric code.
+Maps an integer to the corresponding ASCII character.
\DESCRIBE
-When given a string, {\small\verb%ascii_code%} returns the numeric encoding in the
-ASCII character set of the first character of that string.
+When given an integer, {\small\verb%ascii%} returns a string consisting of
+the single character corresponding to that integer under the ASCII
+encoding.
\FAILURE
-Fails if the string is empty ({\small\verb%``%}).
+Fails unless the integer supplied is in the range {\small\verb%0 <= x < 128%}.
\SEEALSO
-ascii, int_of_string, is_alphanum, is_letter, string_of_int.
+ascii_code, int_of_string, is_alphanum, is_letter, string_of_int.
\ENDDOC
\DOC{ASM\_CASES\_TAC}
@@ -1813,41 +1581,6 @@ of the current theory. It will fail if t
axioms, definition, load_axiom, load_axioms, new_axiom, print_theory, theorem.
\ENDDOC
-\DOC{axioms}
-
-\TYPE {\small\verb%axioms : (string -> (string # thm) list)%}\egroup
-
-\SYNOPSIS
-Returns the axioms of a given theory segment of the current theory.
-
-\DESCRIBE
-A call {\small\verb%axioms `thy`%} returns the axioms of the theory segment {\small\verb%thy%} together
-with their names. The theory segment {\small\verb%thy%} must be part of the current theory.
-The names are those given to the axioms by the user when they were originally
-added to the theory segment (by a call to {\small\verb%new_axiom%}). The name of the current
-theory segment can be abbreviated by {\small\verb%`-`%}.
-
-\FAILURE
-The call {\small\verb%axioms `thy`%} will fail if the theory segment {\small\verb%thy%} is not
-part of the current theory.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#axioms `bool`;;
-[(`SELECT_AX`, |- !P x. P x ==> P($@ P));
- (`ETA_AX`, |- !t. (\x. t x) = t);
- (`IMP_ANTISYM_AX`,
- |- !t1 t2. (t1 ==> t2) ==> (t2 ==> t1) ==> (t1 = t2));
- (`BOOL_CASES_AX`, |- !t. (t = T) \/ (t = F));
- (`ARB_THM`, |- $= = $=)]
-: (string # thm) list
-\end{verbatim}
-}
-\SEEALSO
-axiom, definitions, load_axiom, load_axioms, new_axiom, print_theory, theorems.
-
-\ENDDOC
\DOC{axiom\_lfn}
\TYPE {\small\verb%axiom_lfn : (string list -> thm)%}\egroup
@@ -1922,41 +1655,39 @@ autoload, autoload_theory, axiom, axioms
undo_autoload.
\ENDDOC
-\DOC{B}
-
-\TYPE {\small\verb%B : ((* -> **) -> (*** -> *) -> *** -> **)%}\egroup
-
-\SYNOPSIS
-Performs curried function-composition: {\small\verb%B f g x%} = {\small\verb%f (g x)%}.
-
-\FAILURE
-Never fails.
-
-\SEEALSO
-\#, C, CB, Co, I, K, KI, o, oo, S, W.
-
-\ENDDOC
-\DOC{b}
+\DOC{axioms}
-\TYPE {\small\verb%b : (void -> void)%}\egroup
+\TYPE {\small\verb%axioms : (string -> (string # thm) list)%}\egroup
\SYNOPSIS
-Restores the proof state undoing the effects of a previous expansion.
+Returns the axioms of a given theory segment of the current theory.
\DESCRIBE
-The function {\small\verb%b%} is part of the subgoal package. It is an abbreviation for the
-function {\small\verb%backup%}. For a description of the subgoal package, see
-{\small\verb%set_goal%}.
+A call {\small\verb%axioms `thy`%} returns the axioms of the theory segment {\small\verb%thy%} together
+with their names. The theory segment {\small\verb%thy%} must be part of the current theory.
+The names are those given to the axioms by the user when they were originally
+added to the theory segment (by a call to {\small\verb%new_axiom%}). The name of the current
+theory segment can be abbreviated by {\small\verb%`-`%}.
\FAILURE
-As for {\small\verb%backup%}.
-
-\USES
-Back tracking in a goal-directed proof to undo errors or try different tactics.
+The call {\small\verb%axioms `thy`%} will fail if the theory segment {\small\verb%thy%} is not
+part of the current theory.
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#axioms `bool`;;
+[(`SELECT_AX`, |- !P x. P x ==> P($@ P));
+ (`ETA_AX`, |- !t. (\x. t x) = t);
+ (`IMP_ANTISYM_AX`,
+ |- !t1 t2. (t1 ==> t2) ==> (t2 ==> t1) ==> (t1 = t2));
+ (`BOOL_CASES_AX`, |- !t. (t = T) \/ (t = F));
+ (`ARB_THM`, |- $= = $=)]
+: (string # thm) list
+\end{verbatim}
+}
\SEEALSO
-backup, backup_limit, e, expand, expandf, g, get_state, p, print_state, r,
-rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
+axiom, definitions, load_axiom, load_axioms, new_axiom, print_theory, theorems.
\ENDDOC
\DOC{backup}
@@ -2183,6 +1914,43 @@ NOT_CLAUSES, OR_CLAUSES, PAIR, REFL_CLAU
SND.
\ENDDOC
+\DOC{b}
+
+\TYPE {\small\verb%b : (void -> void)%}\egroup
+
+\SYNOPSIS
+Restores the proof state undoing the effects of a previous expansion.
+
+\DESCRIBE
+The function {\small\verb%b%} is part of the subgoal package. It is an abbreviation for the
+function {\small\verb%backup%}. For a description of the subgoal package, see
+{\small\verb%set_goal%}.
+
+\FAILURE
+As for {\small\verb%backup%}.
+
+\USES
+Back tracking in a goal-directed proof to undo errors or try different tactics.
+
+\SEEALSO
+backup, backup_limit, e, expand, expandf, g, get_state, p, print_state, r,
+rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
+
+\ENDDOC
+\DOC{B}
+
+\TYPE {\small\verb%B : ((* -> **) -> (*** -> *) -> *** -> **)%}\egroup
+
+\SYNOPSIS
+Performs curried function-composition: {\small\verb%B f g x%} = {\small\verb%f (g x)%}.
+
+\FAILURE
+Never fails.
+
+\SEEALSO
+\#, C, CB, Co, I, K, KI, o, oo, S, W.
+
+\ENDDOC
\DOC{BETA\_CONV}
\TYPE {\small\verb%BETA_CONV : conv%}\egroup
@@ -2339,23 +2107,6 @@ Fails unless the term is an abstraction.
body, dest_abs.
\ENDDOC
-\DOC{body}
-
-\TYPE {\small\verb%body : (term -> term)%}\egroup
-
-\SYNOPSIS
-Returns the body of an abstraction.
-
-\DESCRIBE
-{\small\verb%body "\var. t"%} returns {\small\verb%"t"%}.
-
-\FAILURE
-Fails unless the term is an abstraction.
-
-\SEEALSO
-bndvar, dest_abs.
-
-\ENDDOC
\DOC{BODY\_CONJUNCTS}
\TYPE {\small\verb%BODY_CONJUNCTS : (thm -> thm list)%}\egroup
@@ -2393,6 +2144,23 @@ The following illustrates how a typical
CONJ, CONJUNCT1, CONJUNCT2, CONJUNCTS, CONJ_TAC.
\ENDDOC
+\DOC{body}
+
+\TYPE {\small\verb%body : (term -> term)%}\egroup
+
+\SYNOPSIS
+Returns the body of an abstraction.
+
+\DESCRIBE
+{\small\verb%body "\var. t"%} returns {\small\verb%"t"%}.
+
+\FAILURE
+Fails unless the term is an abstraction.
+
+\SEEALSO
+bndvar, dest_abs.
+
+\ENDDOC
\DOC{BOOL\_CASES\_TAC}
\TYPE {\small\verb%BOOL_CASES_TAC : (term -> tactic)%}\egroup
@@ -2523,6 +2291,34 @@ or {\small\verb%k%} is greater than the
\ENDDOC
+\DOC{BUTLAST\_CONV}
+
+\TYPE {\small\verb%BUTLAST_CONV : conv%}\egroup
+
+\SYNOPSIS
+Computes by inference the result of stripping the last element of a list.
+
+\DESCRIBE
+For any object language list of the form {\small\verb%"[x0;...x(n-1)]"%} ,
+the result of evaluating
+{\par\samepage\setseps\small
+\begin{verbatim}
+ BUTLAST_CONV "BUTLAST [x0;...;x(n-1)]"
+\end{verbatim}
+}
+\noindent is the theorem
+{\par\samepage\setseps\small
+\begin{verbatim}
+ |- BUTLAST [x0;...;x(n-1)] = [x0;...; x(n-2)]
+\end{verbatim}
+}
+
+
+\FAILURE
+{\small\verb%BUTLAST_CONV tm%} fails if {\small\verb%tm%} is an empty list.
+
+\ENDDOC
+
\DOC{butlast}
\TYPE {\small\verb%butlast : (* list -> * list)%}\egroup
@@ -2569,48 +2365,6 @@ or {\small\verb%k%} is greater than the
\ENDDOC
-\DOC{BUTLAST\_CONV}
-
-\TYPE {\small\verb%BUTLAST_CONV : conv%}\egroup
-
-\SYNOPSIS
-Computes by inference the result of stripping the last element of a list.
-
-\DESCRIBE
-For any object language list of the form {\small\verb%"[x0;...x(n-1)]"%} ,
-the result of evaluating
-{\par\samepage\setseps\small
-\begin{verbatim}
- BUTLAST_CONV "BUTLAST [x0;...;x(n-1)]"
-\end{verbatim}
-}
-\noindent is the theorem
-{\par\samepage\setseps\small
-\begin{verbatim}
- |- BUTLAST [x0;...;x(n-1)] = [x0;...; x(n-2)]
-\end{verbatim}
-}
-
-
-\FAILURE
-{\small\verb%BUTLAST_CONV tm%} fails if {\small\verb%tm%} is an empty list.
-
-\ENDDOC
-
-\DOC{C}
-
-\TYPE {\small\verb%C : ((* -> ** -> ***) -> ** -> * -> ***)%}\egroup
-
-\SYNOPSIS
-Permutes first two arguments to curried function: {\small\verb%C f x y%} = {\small\verb%f y x%}.
-
-\FAILURE
-Never fails.
-
-\SEEALSO
-\#, B, CB, Co, I, K, KI, o, oo, S, W.
-
-\ENDDOC
\DOC{cached\_theories}
\TYPE {\small\verb%cached_theories : (void -> (string # bool) list)%}\egroup
@@ -2756,6 +2510,20 @@ a contradiction, then {\small\verb%t%} m
CONTR, CONTRAPOS, CONTR_TAC, NOT_ELIM.
\ENDDOC
+\DOC{C}
+
+\TYPE {\small\verb%C : ((* -> ** -> ***) -> ** -> * -> ***)%}\egroup
+
+\SYNOPSIS
+Permutes first two arguments to curried function: {\small\verb%C f x y%} = {\small\verb%f y x%}.
+
+\FAILURE
+Never fails.
+
+\SEEALSO
+\#, B, CB, Co, I, K, KI, o, oo, S, W.
+
+\ENDDOC
\DOC{CHANGED\_CONV}
\TYPE {\small\verb%CHANGED_CONV : (conv -> conv)%}\egroup
@@ -3180,44 +2948,44 @@ Never fails.
\#, B, C, CB, I, K, KI, o, oo, S, W.
\ENDDOC
-\DOC{com}
+\DOC{combine}
-\TYPE {\small\verb%$com : ((* list # ** list) -> (* # **) list)%}\egroup
+\TYPE {\small\verb%combine : ((* list # ** list) -> (* # **) list)%}\egroup
\SYNOPSIS
-Converts a pair of lists into a list of pairs (infix version).
+Converts a pair of lists into a list of pairs.
\DESCRIBE
-{\small\verb%[x1;...;xn] com [y1;...;yn]%} returns {\small\verb%[(x1,y1);...;(xn,yn)]%}.
+{\small\verb%combine ([x1;...;xn],[y1;...;yn])%} returns {\small\verb%[(x1,y1);...;(xn,yn)]%}.
\FAILURE
Fails if the two lists are of different lengths.
\COMMENTS
-Has the same effect as {\small\verb%combine%}.
+Has the same effect as {\small\verb%com%}.
\SEEALSO
-combine, split.
+com, split.
\ENDDOC
-\DOC{combine}
+\DOC{com}
-\TYPE {\small\verb%combine : ((* list # ** list) -> (* # **) list)%}\egroup
+\TYPE {\small\verb%$com : ((* list # ** list) -> (* # **) list)%}\egroup
\SYNOPSIS
-Converts a pair of lists into a list of pairs.
+Converts a pair of lists into a list of pairs (infix version).
\DESCRIBE
-{\small\verb%combine ([x1;...;xn],[y1;...;yn])%} returns {\small\verb%[(x1,y1);...;(xn,yn)]%}.
+{\small\verb%[x1;...;xn] com [y1;...;yn]%} returns {\small\verb%[(x1,y1);...;(xn,yn)]%}.
\FAILURE
Fails if the two lists are of different lengths.
\COMMENTS
-Has the same effect as {\small\verb%com%}.
+Has the same effect as {\small\verb%combine%}.
\SEEALSO
-com, split.
+combine, split.
\ENDDOC
\DOC{compile}
@@ -3585,6 +3353,60 @@ The theorems returned in these three cas
{\small\verb%c%} is {\small\verb%T%} or {\small\verb%F%}, or {\small\verb%u%} and {\small\verb%v%} are alpha-equivalent.
\ENDDOC
+\DOC{CONJ\_DISCH}
+
+\TYPE {\small\verb%CONJ_DISCH : (term -> thm -> thm)%}\egroup
+
+\SYNOPSIS
+Discharges an assumption and conjoins it to both sides of an equation.
+
+\DESCRIBE
+Given an term {\small\verb%t%} and a theorem {\small\verb%A |- t1 = t2%}, which is an equation between
+boolean terms, {\small\verb%CONJ_DISCH%} returns {\small\verb%A - {t} |- (t /\ t1) = (t /\ t2)%}, i.e.
+conjoins {\small\verb%t%} to both sides of the equation, removing {\small\verb%t%} from the assumptions
+if it was there.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- t1 = t2
+ ------------------------------ CONJ_DISCH "t"
+ A - {t} |- t /\ t1 = t /\ t2
+\end{verbatim}
+}
+\FAILURE
+Fails unless the theorem is an equation, both sides of which, and the term
+provided are of type {\small\verb%bool%}.
+
+\SEEALSO
+CONJ_DISCHL.
+
+\ENDDOC
+\DOC{CONJ\_DISCHL}
+
+\TYPE {\small\verb%CONJ_DISCHL : (term list -> thm -> thm)%}\egroup
+
+\SYNOPSIS
+Conjoins multiple assumptions to both sides of an equation.
+
+\DESCRIBE
+Given a term list {\small\verb%[t1;...;tn]%} and a theorem whose conclusion is an equation
+between boolean terms, {\small\verb%CONJ_DISCHL%} conjoins all the terms
+in the list to both sides of the equation, and removes any of the terms which
+were in the assumption list.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- s = t
+ -------------------------------------------------------- CONJ_DISCHL
+ A - {t1,...,tn} |- (t1/\.../\tn/\s) = (t1/\.../\tn/\t) ["t1";...;"tn"]
+\end{verbatim}
+}
+\FAILURE
+Fails unless the theorem is an equation, both sides of which, and all the terms
+provided, are of type {\small\verb%bool%}.
+
+\SEEALSO
+CONJ_DISCH.
+
+\ENDDOC
\DOC{CONJ}
\TYPE {\small\verb%CONJ : (thm -> thm -> thm)%}\egroup
@@ -3607,6 +3429,148 @@ Never fails.
BODY_CONJUNCTS, CONJUNCT1, CONJUNCT2, CONJ_PAIR, LIST_CONJ, CONJ_LIST, CONJUNCTS.
\ENDDOC
+\DOC{CONJ\_LIST}
+
+\TYPE {\small\verb%CONJ_LIST : (int -> thm -> thm list)%}\egroup
+
+\SYNOPSIS
+Extracts a list of conjuncts from a theorem (non-flattening version).
+
+\DESCRIBE
+{\small\verb%CONJ_LIST%} is the proper inverse of {\small\verb%LIST_CONJ%}. Unlike {\small\verb%CONJUNCTS%} which
+recursively splits as many conjunctions as possible both to the left and to
+the right, {\small\verb%CONJ_LIST%} splits the top-level conjunction and then splits
+(recursively) only the right conjunct. The integer argument is required
+because the term {\small\verb%tn%} may itself be a conjunction. A list of {\small\verb%n%} theorems is
+returned.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- t1 /\ (t2 /\ ( ... /\ tn)...)
+ ------------------------------------ CONJ_LIST n (A |- t1 /\ ... /\ tn)
+ A |- t1 A |- t2 ... A |- tn
+\end{verbatim}
+}
+\FAILURE
+Fails if the integer argument ({\small\verb%n%}) is less than one, or if the input theorem
+has less than {\small\verb%n%} conjuncts.
+
+\EXAMPLE
+Suppose the identifier {\small\verb%th%} is bound to the theorem:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- (x /\ y) /\ z /\ w
+\end{verbatim}
+}
+\noindent Here are some applications of {\small\verb%CONJ_LIST%} to {\small\verb%th%}:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #CONJ_LIST 0 th;;
+ evaluation failed CONJ_LIST
+
+ #CONJ_LIST 1 th;;
+ [A |- (x /\ y) /\ z /\ w] : thm list
+
+ #CONJ_LIST 2 th;;
+ [A |- x /\ y; A |- z /\ w] : thm list
+
+ #CONJ_LIST 3 th;;
+ [A |- x /\ y; A |- z; A |- w] : thm list
+
+ #CONJ_LIST 4 th;;
+ evaluation failed CONJ_LIST
+\end{verbatim}
+}
+\SEEALSO
+BODY_CONJUNCTS, LIST_CONJ, CONJUNCTS, CONJ, CONJUNCT1, CONJUNCT2, CONJ_PAIR.
+
+\ENDDOC
+\DOC{CONJ\_PAIR}
+
+\TYPE {\small\verb%CONJ_PAIR : (thm -> (thm # thm))%}\egroup
+
+\SYNOPSIS
+Extracts both conjuncts of a conjunction.
+
+\DESCRIBE
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- t1 /\ t2
+ ---------------------- CONJ_PAIR
+ A |- t1 A |- t2
+\end{verbatim}
+}
+\noindent The two resultant theorems are returned as a pair.
+
+\FAILURE
+Fails if the input theorem is not a conjunction.
+
+\SEEALSO
+BODY_CONJUNCTS, CONJUNCT1, CONJUNCT2, CONJ, LIST_CONJ, CONJ_LIST, CONJUNCTS.
+
+\ENDDOC
+\DOC{CONJ\_SET\_CONV}
+
+\TYPE {\small\verb%CONJ_SET_CONV : (term list -> term list -> thm)%}\egroup
+
+\SYNOPSIS
+Proves the equivalence of the conjunctions of two equal sets of terms.
+
+\DESCRIBE
+The arguments to {\small\verb%CONJ_SET_CONV%} are two lists of terms {\small\verb%[t1;...;tn]%} and
+{\small\verb%[u1;...;um]%}. If these are equal when considered as sets, that is if the sets
+{\par\samepage\setseps\small
+\begin{verbatim}
+ {t1,...,tn} and {u1,...,um}
+\end{verbatim}
+}
+\noindent are equal, then {\small\verb%CONJ_SET_CONV%} returns the theorem:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ |- (t1 /\ ... /\ tn) = (u1 /\ ... /\ um)
+\end{verbatim}
+}
+\noindent Otherwise {\small\verb%CONJ_SET_CONV%} fails.
+
+\FAILURE
+{\small\verb%CONJ_SET_CONV [t1;...;tn] [u1;...;um]%} fails if {\small\verb%[t1,...,tn]%} and
+{\small\verb%[u1,...,um]%}, regarded as sets of terms, are not equal. Also fails
+if any {\small\verb%ti%} or {\small\verb%ui%} does not have type {\small\verb%bool%}.
+
+\USES
+Used to order conjuncts. First sort a list of conjuncts {\small\verb%l1%} into the
+desired order to get a new list {\small\verb%l2%}, then call {\small\verb%CONJ_SET_CONV l1 l2%}.
+
+\COMMENTS
+This is not a true conversion, so perhaps it ought to be called something else.
+
+\SEEALSO
+CONJUNCTS_CONV.
+
+\ENDDOC
+\DOC{CONJ\_TAC}
+
+\TYPE {\small\verb%CONJ_TAC : tactic%}\egroup
+
+\SYNOPSIS
+Reduces a conjunctive goal to two separate subgoals.
+
+\DESCRIBE
+When applied to a goal {\small\verb%A ?- t1 /\ t2%}, the tactic {\small\verb%CONJ_TAC%} reduces it to the
+two subgoals corresponding to each conjunct separately.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A ?- t1 /\ t2
+ ====================== CONJ_TAC
+ A ?- t1 A ?- t2
+\end{verbatim}
+}
+\FAILURE
+Fails unless the conclusion of the goal is a conjunction.
+
+\SEEALSO
+STRIP_TAC.
+
+\ENDDOC
\DOC{CONJUNCT1}
\TYPE {\small\verb%CONJUNCT1 : (thm -> thm)%}\egroup
@@ -3651,42 +3615,40 @@ Fails unless the input theorem is a conj
BODY_CONJUNCTS, CONJUNCT1, CONJ_PAIR, CONJ, LIST_CONJ, CONJ_LIST, CONJUNCTS.
\ENDDOC
-\DOC{CONJUNCTS}
+\DOC{CONJUNCTS\_CONV}
-\TYPE {\small\verb%CONJUNCTS : (thm -> thm list)%}\egroup
+\TYPE {\small\verb%CONJUNCTS_CONV : ((term # term) -> thm)%}\egroup
\SYNOPSIS
-Recursively splits conjunctions into a list of conjuncts.
+Prove equivalence under idempotence, symmetry and associativity of conjunction.
\DESCRIBE
-Flattens out all conjuncts, regardless of grouping. Returns a singleton list
-if the input theorem is not a conjunction.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- t1 /\ t2 /\ ... /\ tn
- ----------------------------------- CONJUNCTS
- A |- t1 A |- t2 ... A |- tn
-\end{verbatim}
-}
+{\small\verb%CONJUNCTS_CONV%} takes a pair of terms {\small\verb%"t1"%} and {\small\verb%"t2"%}, and proves
+{\small\verb%|- t1 = t2%} if {\small\verb%t1%} and {\small\verb%t2%} are equivalent up to idempotence, symmetry and
+associativity of conjunction. That is, if {\small\verb%t1%} and {\small\verb%t2%} are two (different)
+arbitrarily-nested conjunctions of the same set of terms, then {\small\verb%CONJUNCTS_CONV
+(t1,t2)%} returns {\small\verb%|- t1 = t2%}. Otherwise, it fails.
+
\FAILURE
-Never fails.
+Fails if {\small\verb%t1%} and {\small\verb%t2%} are not equivalent, as described above.
\EXAMPLE
-Suppose the identifier {\small\verb%th%} is bound to the theorem:
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- (x /\ y) /\ z /\ w
-\end{verbatim}
-}
-\noindent Application of {\small\verb%CONJUNCTS%} to {\small\verb%th%} returns the following list of
-theorems:
{\par\samepage\setseps\small
\begin{verbatim}
- [A |- x; A |- y; A |- z; A |- w] : thm list
+#CONJUNCTS_CONV ("(P /\ Q) /\ R", "R /\ (Q /\ R) /\ P");;
+|- (P /\ Q) /\ R = R /\ (Q /\ R) /\ P
\end{verbatim}
}
+\USES
+Used to reorder a conjunction. First sort the conjuncts in a term {\small\verb%t1%} into
+the desired order (e.g. lexicographic order, for normalization) to get a new
+term {\small\verb%t2%}, then call {\small\verb%CONJUNCTS_CONV(t1,t2)%}.
+
+\COMMENTS
+This is not a true conversion, so perhaps it ought to be called something else.
+
\SEEALSO
-BODY_CONJUNCTS, CONJ_LIST, LIST_CONJ, CONJ, CONJUNCT1, CONJUNCT2, CONJ_PAIR.
+CONJ_SET_CONV.
\ENDDOC
\DOC{conjuncts}
@@ -3739,40 +3701,90 @@ introduce {\small\verb%list_dest_conj%}
list_mk_conj, dest_conj.
\ENDDOC
-\DOC{CONJUNCTS\_CONV}
+\DOC{CONJUNCTS}
-\TYPE {\small\verb%CONJUNCTS_CONV : ((term # term) -> thm)%}\egroup
+\TYPE {\small\verb%CONJUNCTS : (thm -> thm list)%}\egroup
\SYNOPSIS
-Prove equivalence under idempotence, symmetry and associativity of conjunction.
+Recursively splits conjunctions into a list of conjuncts.
\DESCRIBE
-{\small\verb%CONJUNCTS_CONV%} takes a pair of terms {\small\verb%"t1"%} and {\small\verb%"t2"%}, and proves
-{\small\verb%|- t1 = t2%} if {\small\verb%t1%} and {\small\verb%t2%} are equivalent up to idempotence, symmetry and
-associativity of conjunction. That is, if {\small\verb%t1%} and {\small\verb%t2%} are two (different)
-arbitrarily-nested conjunctions of the same set of terms, then {\small\verb%CONJUNCTS_CONV
-(t1,t2)%} returns {\small\verb%|- t1 = t2%}. Otherwise, it fails.
-
+Flattens out all conjuncts, regardless of grouping. Returns a singleton list
+if the input theorem is not a conjunction.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- t1 /\ t2 /\ ... /\ tn
+ ----------------------------------- CONJUNCTS
+ A |- t1 A |- t2 ... A |- tn
+\end{verbatim}
+}
\FAILURE
-Fails if {\small\verb%t1%} and {\small\verb%t2%} are not equivalent, as described above.
+Never fails.
\EXAMPLE
+Suppose the identifier {\small\verb%th%} is bound to the theorem:
{\par\samepage\setseps\small
\begin{verbatim}
-#CONJUNCTS_CONV ("(P /\ Q) /\ R", "R /\ (Q /\ R) /\ P");;
-|- (P /\ Q) /\ R = R /\ (Q /\ R) /\ P
+ A |- (x /\ y) /\ z /\ w
\end{verbatim}
}
-\USES
-Used to reorder a conjunction. First sort the conjuncts in a term {\small\verb%t1%} into
-the desired order (e.g. lexicographic order, for normalization) to get a new
-term {\small\verb%t2%}, then call {\small\verb%CONJUNCTS_CONV(t1,t2)%}.
+\noindent Application of {\small\verb%CONJUNCTS%} to {\small\verb%th%} returns the following list of
+theorems:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ [A |- x; A |- y; A |- z; A |- w] : thm list
+\end{verbatim}
+}
+\SEEALSO
+BODY_CONJUNCTS, CONJ_LIST, LIST_CONJ, CONJ, CONJUNCT1, CONJUNCT2, CONJ_PAIR.
+
+\ENDDOC
+\DOC{CONJUNCTS\_THEN2}
+
+\TYPE {\small\verb%CONJUNCTS_THEN2 : (thm_tactic -> thm_tactic -> thm_tactic)%}\egroup
+
+\SYNOPSIS
+Applies two theorem-tactics to the corresponding conjuncts of a theorem.
+
+\DESCRIBE
+{\small\verb%CONJUNCTS_THEN2%} takes two theorem-tactics, {\small\verb%f1%} and {\small\verb%f2%}, and a theorem {\small\verb%t%}
+whose conclusion must be a conjunction. {\small\verb%CONJUNCTS_THEN2%} breaks {\small\verb%t%} into two
+new theorems, {\small\verb%t1%} and {\small\verb%t2%} which are {\small\verb%CONJUNCT1%} and {\small\verb%CONJUNCT2%} of {\small\verb%t%}
+respectively, and then returns the tactic {\small\verb%f1 t1 THEN f2 t2%}. Thus
+{\par\samepage\setseps\small
+\begin{verbatim}
+ CONJUNCTS_THEN2 f1 f2 (A |- l /\ r) = f1 (A |- l) THEN f2 (A |- r)
+\end{verbatim}
+}
+\noindent so if
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A1 ?- t1 A2 ?- t2
+ ========== f1 (A |- l) ========== f2 (A |- r)
+ A2 ?- t2 A3 ?- t3
+\end{verbatim}
+}
+\noindent then
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A1 ?- t1
+ ========== CONJUNCTS_THEN2 f1 f2 (A |- l /\ r)
+ A3 ?- t3
+\end{verbatim}
+}
+\FAILURE
+{\small\verb%CONJUNCTS_THEN f%} will fail if applied to a theorem whose conclusion is not a
+conjunction.
\COMMENTS
-This is not a true conversion, so perhaps it ought to be called something else.
+The system shows the type as {\small\verb%(thm_tactic -> thm_tactical)%}.
+
+\USES
+The construction of complex {\small\verb%tactical%}s like {\small\verb%CONJUNCTS_THEN%}.
\SEEALSO
-CONJ_SET_CONV.
+CONJUNCT1, CONJUNCT2, CONJUNCTS, CONJUNCTS_TAC, CONJUNCTS_THEN2,
+STRIP_THM_THEN.
\ENDDOC
\DOC{CONJUNCTS\_THEN}
@@ -3839,390 +3851,146 @@ CONJUNCT1, CONJUNCT2, CONJUNCTS, CONJUNC
STRIP_THM_THEN.
\ENDDOC
-\DOC{CONJUNCTS\_THEN2}
+\DOC{constants}
-\TYPE {\small\verb%CONJUNCTS_THEN2 : (thm_tactic -> thm_tactic -> thm_tactic)%}\egroup
+\TYPE {\small\verb%constants : (string -> term list)%}\egroup
\SYNOPSIS
-Applies two theorem-tactics to the corresponding conjuncts of a theorem.
+Returns a list of the constants defined in a named theory.
\DESCRIBE
-{\small\verb%CONJUNCTS_THEN2%} takes two theorem-tactics, {\small\verb%f1%} and {\small\verb%f2%}, and a theorem {\small\verb%t%}
-whose conclusion must be a conjunction. {\small\verb%CONJUNCTS_THEN2%} breaks {\small\verb%t%} into two
-new theorems, {\small\verb%t1%} and {\small\verb%t2%} which are {\small\verb%CONJUNCT1%} and {\small\verb%CONJUNCT2%} of {\small\verb%t%}
-respectively, and then returns the tactic {\small\verb%f1 t1 THEN f2 t2%}. Thus
-{\par\samepage\setseps\small
-\begin{verbatim}
- CONJUNCTS_THEN2 f1 f2 (A |- l /\ r) = f1 (A |- l) THEN f2 (A |- r)
-\end{verbatim}
-}
-\noindent so if
+The call
{\par\samepage\setseps\small
\begin{verbatim}
- A1 ?- t1 A2 ?- t2
- ========== f1 (A |- l) ========== f2 (A |- r)
- A2 ?- t2 A3 ?- t3
+ constants `thy`
\end{verbatim}
}
-\noindent then
+\noindent where {\small\verb%thy%} is an ancestor theory (the special string {\small\verb%`-`%} means the
+current theory), returns a list of all the constants in that theory.
+
+\FAILURE
+Fails if the named theory does not exist, or is not an ancestor of the
+current theory.
+
+\EXAMPLE
{\par\samepage\setseps\small
\begin{verbatim}
- A1 ?- t1
- ========== CONJUNCTS_THEN2 f1 f2 (A |- l /\ r)
- A3 ?- t3
+#constants `combin`;;
+["I"; "S"; "K"; "$o"] : term list
\end{verbatim}
}
-\FAILURE
-{\small\verb%CONJUNCTS_THEN f%} will fail if applied to a theorem whose conclusion is not a
-conjunction.
-
-\COMMENTS
-The system shows the type as {\small\verb%(thm_tactic -> thm_tactical)%}.
-
-\USES
-The construction of complex {\small\verb%tactical%}s like {\small\verb%CONJUNCTS_THEN%}.
-
\SEEALSO
-CONJUNCT1, CONJUNCT2, CONJUNCTS, CONJUNCTS_TAC, CONJUNCTS_THEN2,
-STRIP_THM_THEN.
+axioms, binders, definitions, infixes, theorems
\ENDDOC
-\DOC{CONJ\_DISCH}
+\DOC{CONTRAPOS\_CONV}
-\TYPE {\small\verb%CONJ_DISCH : (term -> thm -> thm)%}\egroup
+\TYPE {\small\verb%CONTRAPOS_CONV : conv%}\egroup
\SYNOPSIS
-Discharges an assumption and conjoins it to both sides of an equation.
+Proves the equivalence of an implication and its contrapositive.
\DESCRIBE
-Given an term {\small\verb%t%} and a theorem {\small\verb%A |- t1 = t2%}, which is an equation between
-boolean terms, {\small\verb%CONJ_DISCH%} returns {\small\verb%A - {t} |- (t /\ t1) = (t /\ t2)%}, i.e.
-conjoins {\small\verb%t%} to both sides of the equation, removing {\small\verb%t%} from the assumptions
-if it was there.
+When applied to an implication {\small\verb%P ==> Q%}, the conversion {\small\verb%CONTRAPOS_CONV%}
+returns the theorem:
{\par\samepage\setseps\small
\begin{verbatim}
- A |- t1 = t2
- ------------------------------ CONJ_DISCH "t"
- A - {t} |- t /\ t1 = t /\ t2
+ |- (P ==> Q) = (~Q ==> ~P)
\end{verbatim}
}
\FAILURE
-Fails unless the theorem is an equation, both sides of which, and the term
-provided are of type {\small\verb%bool%}.
+Fails if applied to a term that is not an implication.
\SEEALSO
-CONJ_DISCHL.
+CONTRAPOS.
\ENDDOC
-\DOC{CONJ\_DISCHL}
+\DOC{CONTRAPOS}
-\TYPE {\small\verb%CONJ_DISCHL : (term list -> thm -> thm)%}\egroup
+\TYPE {\small\verb%CONTRAPOS : (thm -> thm)%}\egroup
\SYNOPSIS
-Conjoins multiple assumptions to both sides of an equation.
+Deduces the contrapositive of an implication.
\DESCRIBE
-Given a term list {\small\verb%[t1;...;tn]%} and a theorem whose conclusion is an equation
-between boolean terms, {\small\verb%CONJ_DISCHL%} conjoins all the terms
-in the list to both sides of the equation, and removes any of the terms which
-were in the assumption list.
+When applied to a theorem {\small\verb%A |- s ==> t%}, the inference rule {\small\verb%CONTRAPOS%}
+returns its contrapositive, {\small\verb%A |- ~t ==> ~s%}.
{\par\samepage\setseps\small
\begin{verbatim}
- A |- s = t
- -------------------------------------------------------- CONJ_DISCHL
- A - {t1,...,tn} |- (t1/\.../\tn/\s) = (t1/\.../\tn/\t) ["t1";...;"tn"]
+ A |- s ==> t
+ ---------------- CONTRAPOS
+ A |- ~t ==> ~s
\end{verbatim}
}
\FAILURE
-Fails unless the theorem is an equation, both sides of which, and all the terms
-provided, are of type {\small\verb%bool%}.
+Fails unless the theorem is an implication.
\SEEALSO
-CONJ_DISCH.
+CCONTR, CONTR, CONTRAPOS_CONV, NOT_ELIM.
\ENDDOC
-\DOC{CONJ\_LIST}
+\DOC{CONTR}
-\TYPE {\small\verb%CONJ_LIST : (int -> thm -> thm list)%}\egroup
+\TYPE {\small\verb%CONTR : (term -> thm -> thm)%}\egroup
\SYNOPSIS
-Extracts a list of conjuncts from a theorem (non-flattening version).
+Implements the intuitionistic contradiction rule.
\DESCRIBE
-{\small\verb%CONJ_LIST%} is the proper inverse of {\small\verb%LIST_CONJ%}. Unlike {\small\verb%CONJUNCTS%} which
-recursively splits as many conjunctions as possible both to the left and to
-the right, {\small\verb%CONJ_LIST%} splits the top-level conjunction and then splits
-(recursively) only the right conjunct. The integer argument is required
-because the term {\small\verb%tn%} may itself be a conjunction. A list of {\small\verb%n%} theorems is
-returned.
+When applied to a term {\small\verb%t%} and a theorem {\small\verb%A |- F%}, the inference rule {\small\verb%CONTR%}
+returns the theorem {\small\verb%A |- t%}.
{\par\samepage\setseps\small
\begin{verbatim}
- A |- t1 /\ (t2 /\ ( ... /\ tn)...)
- ------------------------------------ CONJ_LIST n (A |- t1 /\ ... /\ tn)
- A |- t1 A |- t2 ... A |- tn
+ A |- F
+ -------- CONTR "t"
+ A |- t
\end{verbatim}
}
\FAILURE
-Fails if the integer argument ({\small\verb%n%}) is less than one, or if the input theorem
-has less than {\small\verb%n%} conjuncts.
-
-\EXAMPLE
-Suppose the identifier {\small\verb%th%} is bound to the theorem:
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- (x /\ y) /\ z /\ w
-\end{verbatim}
-}
-\noindent Here are some applications of {\small\verb%CONJ_LIST%} to {\small\verb%th%}:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #CONJ_LIST 0 th;;
- evaluation failed CONJ_LIST
-
- #CONJ_LIST 1 th;;
- [A |- (x /\ y) /\ z /\ w] : thm list
-
- #CONJ_LIST 2 th;;
- [A |- x /\ y; A |- z /\ w] : thm list
-
- #CONJ_LIST 3 th;;
- [A |- x /\ y; A |- z; A |- w] : thm list
+Fails unless the term has type {\small\verb%bool%} and the theorem has {\small\verb%F%} as its
+conclusion.
- #CONJ_LIST 4 th;;
- evaluation failed CONJ_LIST
-\end{verbatim}
-}
\SEEALSO
-BODY_CONJUNCTS, LIST_CONJ, CONJUNCTS, CONJ, CONJUNCT1, CONJUNCT2, CONJ_PAIR.
+CCONTR, CONTRAPOS, CONTR_TAC, NOT_ELIM.
\ENDDOC
-\DOC{CONJ\_PAIR}
+\DOC{CONTR\_TAC}
-\TYPE {\small\verb%CONJ_PAIR : (thm -> (thm # thm))%}\egroup
+\TYPE {\small\verb%CONTR_TAC : thm_tactic%}\egroup
\SYNOPSIS
-Extracts both conjuncts of a conjunction.
+Solves any goal from contradictory theorem.
\DESCRIBE
+When applied to a contradictory theorem {\small\verb%A' |- F%}, and a goal {\small\verb%A ?- t%},
+the tactic {\small\verb%CONTR_TAC%} completely solves the goal. This is an invalid
+tactic unless {\small\verb%A'%} is a subset of {\small\verb%A%}.
{\par\samepage\setseps\small
\begin{verbatim}
- A |- t1 /\ t2
- ---------------------- CONJ_PAIR
- A |- t1 A |- t2
+ A ?- t
+ ======== CONTR_TAC (A' |- F)
+
\end{verbatim}
}
-\noindent The two resultant theorems are returned as a pair.
-
\FAILURE
-Fails if the input theorem is not a conjunction.
+Fails unless the theorem is contradictory, i.e. has {\small\verb%F%} as its conclusion.
\SEEALSO
-BODY_CONJUNCTS, CONJUNCT1, CONJUNCT2, CONJ, LIST_CONJ, CONJ_LIST, CONJUNCTS.
+CHECK_ASSUME_TAC, CONTR, CCONTR, CONTRAPOS, NOT_ELIM.
\ENDDOC
-\DOC{CONJ\_SET\_CONV}
+\DOC{CONV\_RULE}
-\TYPE {\small\verb%CONJ_SET_CONV : (term list -> term list -> thm)%}\egroup
+\TYPE {\small\verb%CONV_RULE : (conv -> thm -> thm)%}\egroup
\SYNOPSIS
-Proves the equivalence of the conjunctions of two equal sets of terms.
+Makes an inference rule from a conversion.
\DESCRIBE
-The arguments to {\small\verb%CONJ_SET_CONV%} are two lists of terms {\small\verb%[t1;...;tn]%} and
-{\small\verb%[u1;...;um]%}. If these are equal when considered as sets, that is if the sets
-{\par\samepage\setseps\small
-\begin{verbatim}
- {t1,...,tn} and {u1,...,um}
-\end{verbatim}
-}
-\noindent are equal, then {\small\verb%CONJ_SET_CONV%} returns the theorem:
-{\par\samepage\setseps\small
-\begin{verbatim}
- |- (t1 /\ ... /\ tn) = (u1 /\ ... /\ um)
-\end{verbatim}
-}
-\noindent Otherwise {\small\verb%CONJ_SET_CONV%} fails.
-
-\FAILURE
-{\small\verb%CONJ_SET_CONV [t1;...;tn] [u1;...;um]%} fails if {\small\verb%[t1,...,tn]%} and
-{\small\verb%[u1,...,um]%}, regarded as sets of terms, are not equal. Also fails
-if any {\small\verb%ti%} or {\small\verb%ui%} does not have type {\small\verb%bool%}.
-
-\USES
-Used to order conjuncts. First sort a list of conjuncts {\small\verb%l1%} into the
-desired order to get a new list {\small\verb%l2%}, then call {\small\verb%CONJ_SET_CONV l1 l2%}.
-
-\COMMENTS
-This is not a true conversion, so perhaps it ought to be called something else.
-
-\SEEALSO
-CONJUNCTS_CONV.
-
-\ENDDOC
-\DOC{CONJ\_TAC}
-
-\TYPE {\small\verb%CONJ_TAC : tactic%}\egroup
-
-\SYNOPSIS
-Reduces a conjunctive goal to two separate subgoals.
-
-\DESCRIBE
-When applied to a goal {\small\verb%A ?- t1 /\ t2%}, the tactic {\small\verb%CONJ_TAC%} reduces it to the
-two subgoals corresponding to each conjunct separately.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A ?- t1 /\ t2
- ====================== CONJ_TAC
- A ?- t1 A ?- t2
-\end{verbatim}
-}
-\FAILURE
-Fails unless the conclusion of the goal is a conjunction.
-
-\SEEALSO
-STRIP_TAC.
-
-\ENDDOC
-\DOC{constants}
-
-\TYPE {\small\verb%constants : (string -> term list)%}\egroup
-
-\SYNOPSIS
-Returns a list of the constants defined in a named theory.
-
-\DESCRIBE
-The call
-{\par\samepage\setseps\small
-\begin{verbatim}
- constants `thy`
-\end{verbatim}
-}
-\noindent where {\small\verb%thy%} is an ancestor theory (the special string {\small\verb%`-`%} means the
-current theory), returns a list of all the constants in that theory.
-
-\FAILURE
-Fails if the named theory does not exist, or is not an ancestor of the
-current theory.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#constants `combin`;;
-["I"; "S"; "K"; "$o"] : term list
-\end{verbatim}
-}
-\SEEALSO
-axioms, binders, definitions, infixes, theorems
-
-\ENDDOC
-\DOC{CONTR}
-
-\TYPE {\small\verb%CONTR : (term -> thm -> thm)%}\egroup
-
-\SYNOPSIS
-Implements the intuitionistic contradiction rule.
-
-\DESCRIBE
-When applied to a term {\small\verb%t%} and a theorem {\small\verb%A |- F%}, the inference rule {\small\verb%CONTR%}
-returns the theorem {\small\verb%A |- t%}.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- F
- -------- CONTR "t"
- A |- t
-\end{verbatim}
-}
-\FAILURE
-Fails unless the term has type {\small\verb%bool%} and the theorem has {\small\verb%F%} as its
-conclusion.
-
-\SEEALSO
-CCONTR, CONTRAPOS, CONTR_TAC, NOT_ELIM.
-
-\ENDDOC
-\DOC{CONTRAPOS}
-
-\TYPE {\small\verb%CONTRAPOS : (thm -> thm)%}\egroup
-
-\SYNOPSIS
-Deduces the contrapositive of an implication.
-
-\DESCRIBE
-When applied to a theorem {\small\verb%A |- s ==> t%}, the inference rule {\small\verb%CONTRAPOS%}
-returns its contrapositive, {\small\verb%A |- ~t ==> ~s%}.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- s ==> t
- ---------------- CONTRAPOS
- A |- ~t ==> ~s
-\end{verbatim}
-}
-\FAILURE
-Fails unless the theorem is an implication.
-
-\SEEALSO
-CCONTR, CONTR, CONTRAPOS_CONV, NOT_ELIM.
-
-\ENDDOC
-\DOC{CONTRAPOS\_CONV}
-
-\TYPE {\small\verb%CONTRAPOS_CONV : conv%}\egroup
-
-\SYNOPSIS
-Proves the equivalence of an implication and its contrapositive.
-
-\DESCRIBE
-When applied to an implication {\small\verb%P ==> Q%}, the conversion {\small\verb%CONTRAPOS_CONV%}
-returns the theorem:
-{\par\samepage\setseps\small
-\begin{verbatim}
- |- (P ==> Q) = (~Q ==> ~P)
-\end{verbatim}
-}
-\FAILURE
-Fails if applied to a term that is not an implication.
-
-\SEEALSO
-CONTRAPOS.
-
-\ENDDOC
-\DOC{CONTR\_TAC}
-
-\TYPE {\small\verb%CONTR_TAC : thm_tactic%}\egroup
-
-\SYNOPSIS
-Solves any goal from contradictory theorem.
-
-\DESCRIBE
-When applied to a contradictory theorem {\small\verb%A' |- F%}, and a goal {\small\verb%A ?- t%},
-the tactic {\small\verb%CONTR_TAC%} completely solves the goal. This is an invalid
-tactic unless {\small\verb%A'%} is a subset of {\small\verb%A%}.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A ?- t
- ======== CONTR_TAC (A' |- F)
-
-\end{verbatim}
-}
-\FAILURE
-Fails unless the theorem is contradictory, i.e. has {\small\verb%F%} as its conclusion.
-
-\SEEALSO
-CHECK_ASSUME_TAC, CONTR, CCONTR, CONTRAPOS, NOT_ELIM.
-
-\ENDDOC
-\DOC{CONV\_RULE}
-
-\TYPE {\small\verb%CONV_RULE : (conv -> thm -> thm)%}\egroup
-
-\SYNOPSIS
-Makes an inference rule from a conversion.
-
-\DESCRIBE
-If {\small\verb%c%} is a conversion, then {\small\verb%CONV_RULE c%} is an inference rule that applies
-{\small\verb%c%} to the conclusion of a theorem. That is, if {\small\verb%c%} maps a term {\small\verb%"t"%} to the
-theorem {\small\verb%|- t = t'%}, then the rule {\small\verb%CONV_RULE c%} infers {\small\verb%|- t'%} from the
-theorem {\small\verb%|- t%}. More precisely, if {\small\verb%c "t"%} returns {\small\verb%A' |- t = t'%}, then:
+If {\small\verb%c%} is a conversion, then {\small\verb%CONV_RULE c%} is an inference rule that applies
+{\small\verb%c%} to the conclusion of a theorem. That is, if {\small\verb%c%} maps a term {\small\verb%"t"%} to the
+theorem {\small\verb%|- t = t'%}, then the rule {\small\verb%CONV_RULE c%} infers {\small\verb%|- t'%} from the
+theorem {\small\verb%|- t%}. More precisely, if {\small\verb%c "t"%} returns {\small\verb%A' |- t = t'%}, then:
{\par\samepage\setseps\small
\begin{verbatim}
A |- t
@@ -4353,6 +4121,41 @@ increment = - : (int -> int)
uncurry.
\ENDDOC
+\DOC{DEF\_EXISTS\_RULE}
+
+\TYPE {\small\verb%DEF_EXISTS_RULE : (term -> thm)%}\egroup
+
+\SYNOPSIS
+Proves that a function defined by a definitional equation exists.
+
+\DESCRIBE
+This rule accepts a term of the form {\small\verb%"c = ..."%} or {\small\verb%"f x1 ... xn = ..."%}, the
+variables of which may be universally quantified, and returns an existential
+theorem. The resulting theorem is typically used for generating HOL
+specifications.
+
+\FAILURE
+{\small\verb%DEF_EXISTS_RULE%} fails if the definition is not an equation, if there
+is any variable in the right-hand side which does not occur in the
+left-hand side, if the definition is recursive, if there is a free type
+variable, or if the name being defined by the function is not allowed.
+
+\EXAMPLE
+The effect of this rule can be understood more clearly through an
+example:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #DEF_EXISTS_RULE "max a b = ((a < b) => b | a)" ;;
+ |- ?max. !a b. max a b = (a < b => b | a)
+\end{verbatim}
+}
+\COMMENTS
+In later versions of HOL this function may be made internal.
+
+\SEEALSO
+new_definition, new_gen_definition, new_specification.
+
+\ENDDOC
\DOC{define\_finite\_set\_syntax}
\TYPE {\small\verb%define_finite_set_syntax : ((string # string) -> void)%}\egroup
@@ -4712,62 +4515,26 @@ definition of name {\small\verb%def%} in
axiom, definitions, load_definition, load_definitions, new_definition, print_theory, theorem.
\ENDDOC
-\DOC{definitions}
+\DOC{definition\_lfn}
-\TYPE {\small\verb%definitions : (string -> (string # thm) list)%}\egroup
+\TYPE {\small\verb%definition_lfn : (string list -> thm)%}\egroup
\SYNOPSIS
-Returns the constant definitions, type definitions and constant specifications
-of a given theory segment of the current theory.
+Loads a given definition from a given theory.
\DESCRIBE
-A call of {\small\verb%definitions `thy`%} returns the definitions of the theory segment
-{\small\verb%thy%} together with their names. Constant definitions, type definitions and
-constant specifications are all retrieved by the function {\small\verb%definitions%}. The
-theory segment {\small\verb%thy%} must be part of the current theory. The names are those
-given to the definitions by the user when they were originally added to the
-theory segment (by a call, for example, to {\small\verb%new_definition%}). The name of the
-current theory segment can be abbreviated by {\small\verb%`-`%}.
+If {\small\verb%thy%} is an ancestor theory, and {\small\verb%def%} one of its definitions, then the
+call
+{\par\samepage\setseps\small
+\begin{verbatim}
+ definition_lfn [`thy`;`def`]
+\end{verbatim}
+}
+\noindent will return that definition.
\FAILURE
-The call {\small\verb%definitions `thy`%} will fail if the theory segment {\small\verb%thy%} is not
-part of the current theory.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#definitions `combin`;;
-[(`I_DEF`, |- I = S K K);
- (`S_DEF`, |- S = (\f g x. f x(g x)));
- (`K_DEF`, |- K = (\x y. x));
- (`o_DEF`, |- !f g. f o g = (\x. f(g x)))]
-: (string # thm) list
-\end{verbatim}
-}
-\SEEALSO
-axioms, definition, load_definition, load_definitions, new_definition, print_theory, theorems.
-
-\ENDDOC
-\DOC{definition\_lfn}
-
-\TYPE {\small\verb%definition_lfn : (string list -> thm)%}\egroup
-
-\SYNOPSIS
-Loads a given definition from a given theory.
-
-\DESCRIBE
-If {\small\verb%thy%} is an ancestor theory, and {\small\verb%def%} one of its definitions, then the
-call
-{\par\samepage\setseps\small
-\begin{verbatim}
- definition_lfn [`thy`;`def`]
-\end{verbatim}
-}
-\noindent will return that definition.
-
-\FAILURE
-Fails if {\small\verb%thy%} is not an ancestor theory, or if {\small\verb%def%} is not one of its
-definitions.
+Fails if {\small\verb%thy%} is not an ancestor theory, or if {\small\verb%def%} is not one of its
+definitions.
\EXAMPLE
{\par\samepage\setseps\small
@@ -4824,39 +4591,40 @@ autoload, autoload_theory, definition, d
load_definition, load_definitions, undo_autoload.
\ENDDOC
-\DOC{DEF\_EXISTS\_RULE}
+\DOC{definitions}
-\TYPE {\small\verb%DEF_EXISTS_RULE : (term -> thm)%}\egroup
+\TYPE {\small\verb%definitions : (string -> (string # thm) list)%}\egroup
\SYNOPSIS
-Proves that a function defined by a definitional equation exists.
+Returns the constant definitions, type definitions and constant specifications
+of a given theory segment of the current theory.
\DESCRIBE
-This rule accepts a term of the form {\small\verb%"c = ..."%} or {\small\verb%"f x1 ... xn = ..."%}, the
-variables of which may be universally quantified, and returns an existential
-theorem. The resulting theorem is typically used for generating HOL
-specifications.
+A call of {\small\verb%definitions `thy`%} returns the definitions of the theory segment
+{\small\verb%thy%} together with their names. Constant definitions, type definitions and
+constant specifications are all retrieved by the function {\small\verb%definitions%}. The
+theory segment {\small\verb%thy%} must be part of the current theory. The names are those
+given to the definitions by the user when they were originally added to the
+theory segment (by a call, for example, to {\small\verb%new_definition%}). The name of the
+current theory segment can be abbreviated by {\small\verb%`-`%}.
\FAILURE
-{\small\verb%DEF_EXISTS_RULE%} fails if the definition is not an equation, if there
-is any variable in the right-hand side which does not occur in the
-left-hand side, if the definition is recursive, if there is a free type
-variable, or if the name being defined by the function is not allowed.
+The call {\small\verb%definitions `thy`%} will fail if the theory segment {\small\verb%thy%} is not
+part of the current theory.
\EXAMPLE
-The effect of this rule can be understood more clearly through an
-example:
{\par\samepage\setseps\small
\begin{verbatim}
- #DEF_EXISTS_RULE "max a b = ((a < b) => b | a)" ;;
- |- ?max. !a b. max a b = (a < b => b | a)
+#definitions `combin`;;
+[(`I_DEF`, |- I = S K K);
+ (`S_DEF`, |- S = (\f g x. f x(g x)));
+ (`K_DEF`, |- K = (\x y. x));
+ (`o_DEF`, |- !f g. f o g = (\x. f(g x)))]
+: (string # thm) list
\end{verbatim}
}
-\COMMENTS
-In later versions of HOL this function may be made internal.
-
\SEEALSO
-new_definition, new_gen_definition, new_specification.
+axioms, definition, load_definition, load_definitions, new_definition, print_theory, theorems.
\ENDDOC
\DOC{delete\_cache}
@@ -5582,31 +5350,34 @@ is not {\small\verb%T%} or already in th
POP_ASSUM, POP_ASSUM_LIST.
\ENDDOC
-\DOC{DISCH}
+\DOC{DISCH\_ALL}
-\TYPE {\small\verb%DISCH : (term -> thm -> thm)%}\egroup
+\TYPE {\small\verb%DISCH_ALL : (thm -> thm)%}\egroup
\SYNOPSIS
-Discharges an assumption.
+Discharges all hypotheses of a theorem.
\DESCRIBE
{\par\samepage\setseps\small
\begin{verbatim}
- A |- t
--------------------- DISCH "u"
- A - {u} |- u ==> t
+ A1, ..., An |- t
+ ---------------------------- DISCH_ALL
+ |- A1 ==> ... ==> An ==> t
\end{verbatim}
}
\FAILURE
-{\small\verb%DISCH%} will fail if {\small\verb%"u"%} is not boolean.
+{\small\verb%DISCH_ALL%} will not fail if there are no hypotheses to discharge, it will
+simply return the theorem unchanged.
\COMMENTS
-The term {\small\verb%"u"%} need not be a hypothesis. Discharging {\small\verb%"u"%} will remove all
-identical and alpha-equivalent hypotheses.
+Users should not rely on the hypotheses being discharged in any particular
+order. Two or more alpha-convertible hypotheses will be discharged by a
+single implication; users should not rely on which hypothesis appears in the
+implication.
\SEEALSO
-DISCH_ALL, DISCH_TAC, DISCH_THEN, FILTER_DISCH_TAC, FILTER_DISCH_THEN,
-NEG_DISCH, STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC.
+DISCH, DISCH_TAC, DISCH_THEN, NEG_DISCH, FILTER_DISCH_TAC, FILTER_DISCH_THEN,
+STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC.
\ENDDOC
\DOC{disch}
@@ -5632,34 +5403,31 @@ disch ("\x:bool.T",["A = T";"B = 3";"\y:
filter.
\ENDDOC
-\DOC{DISCH\_ALL}
+\DOC{DISCH}
-\TYPE {\small\verb%DISCH_ALL : (thm -> thm)%}\egroup
+\TYPE {\small\verb%DISCH : (term -> thm -> thm)%}\egroup
\SYNOPSIS
-Discharges all hypotheses of a theorem.
+Discharges an assumption.
\DESCRIBE
{\par\samepage\setseps\small
\begin{verbatim}
- A1, ..., An |- t
- ---------------------------- DISCH_ALL
- |- A1 ==> ... ==> An ==> t
+ A |- t
+-------------------- DISCH "u"
+ A - {u} |- u ==> t
\end{verbatim}
}
\FAILURE
-{\small\verb%DISCH_ALL%} will not fail if there are no hypotheses to discharge, it will
-simply return the theorem unchanged.
+{\small\verb%DISCH%} will fail if {\small\verb%"u"%} is not boolean.
\COMMENTS
-Users should not rely on the hypotheses being discharged in any particular
-order. Two or more alpha-convertible hypotheses will be discharged by a
-single implication; users should not rely on which hypothesis appears in the
-implication.
+The term {\small\verb%"u"%} need not be a hypothesis. Discharging {\small\verb%"u"%} will remove all
+identical and alpha-equivalent hypotheses.
\SEEALSO
-DISCH, DISCH_TAC, DISCH_THEN, NEG_DISCH, FILTER_DISCH_TAC, FILTER_DISCH_THEN,
-STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC.
+DISCH_ALL, DISCH_TAC, DISCH_THEN, FILTER_DISCH_TAC, FILTER_DISCH_THEN,
+NEG_DISCH, STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC.
\ENDDOC
\DOC{DISCH\_TAC}
@@ -5861,55 +5629,6 @@ Fails if the goal is not a disjunction.
DISJ1, DISJ1_TAC, DISJ2.
\ENDDOC
-\DOC{disjuncts}
-
-\TYPE {\small\verb%disjuncts : (term -> term list)%}\egroup
-
-\SYNOPSIS
-Iteratively breaks apart a disjunction.
-
-\DESCRIBE
-{\small\verb%disjuncts "t1 \/ ... \/ tn"%} returns {\small\verb%["t1";...;"tn"]%}.
-The argument term may be any tree of disjunctions;
-it need not have the form {\small\verb%"t1 \/ (t2 \/ ( ... \/ tn)...)"%}.
-A term that is not a disjunction is simply returned as the sole element of a
-list. Note that
-{\par\samepage\setseps\small
-\begin{verbatim}
- disjuncts(list_mk_disj(["t1";...;"tn"]))
-\end{verbatim}
-}
-\noindent will not return {\small\verb%["t1";...;"tn"]%} if any of {\small\verb%t1%},...,{\small\verb%tn%} are
-disjunctions.
-
-\FAILURE
-Never fails.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#list_mk_disj ["a \/ b";"c \/ d";"e \/ f"];;
-"(a \/ b) \/ (c \/ d) \/ e \/ f" : term
-
-#disjuncts it;;
-["a"; "b"; "c"; "d"; "e"; "f"] : term list
-
-#list_mk_disj it;;
-"a \/ b \/ c \/ d \/ e \/ f" : term
-
-#disjuncts "1";;
-["1"] : term list
-\end{verbatim}
-}
-\COMMENTS
-Because {\small\verb%disjuncts%} splits both the left and right sides of a disjunction,
-this operation is not the inverse of {\small\verb%list_mk_disj%}. It may be useful to
-introduce {\small\verb%list_dest_disj%} for splitting only the right tails of a disjunction.
-
-\SEEALSO
-list_mk_disj, dest_disj.
-
-\ENDDOC
\DOC{DISJ\_CASES}
\TYPE {\small\verb%DISJ_CASES : (thm -> thm -> thm -> thm)%}\egroup
@@ -6003,77 +5722,6 @@ Performing a case analysis according to
ASSUME_TAC, ASM_CASES_TAC, COND_CASES_TAC, DISJ_CASES_THEN, STRUCT_CASES_TAC.
\ENDDOC
-\DOC{DISJ\_CASES\_THEN}
-
-\TYPE {\small\verb%DISJ_CASES_THEN : thm_tactical%}\egroup
-
-\SYNOPSIS
-Applies a theorem-tactic to each disjunct of a disjunctive theorem.
-
-\DESCRIBE
-If the theorem-tactic {\small\verb%f:thm->tactic%} applied to either
-{\small\verb%ASSUME%}d disjunct produces results as follows when applied to a goal
-{\small\verb%(A ?- t)%}:
-{\par\samepage\setseps\small
-\begin{verbatim}
- A ?- t A ?- t
- ========= f (u |- u) and ========= f (v |- v)
- A ?- t1 A ?- t2
-\end{verbatim}
-}
-\noindent then applying {\small\verb%DISJ_CASES_THEN f (|- u \/ v)%}
-to the goal {\small\verb%(A ?- t)%} produces two subgoals.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A ?- t
- ====================== DISJ_CASES_THEN f (|- u \/ v)
- A ?- t1 A ?- t2
-\end{verbatim}
-}
-\FAILURE
-Fails if the theorem is not a disjunction. An invalid tactic is
-produced if the theorem has any hypothesis which is not
-alpha-convertible to an assumption of the goal.
-
-\EXAMPLE
-Given the theorem
-{\par\samepage\setseps\small
-\begin{verbatim}
- th = |- (m = 0) \/ (?n. m = SUC n)
-\end{verbatim}
-}
-\noindent and a goal of the form {\small\verb%?- (PRE m = m) = (m = 0)%},
-applying the tactic
-{\par\samepage\setseps\small
-\begin{verbatim}
- DISJ_CASES_THEN ASSUME_TAC th
-\end{verbatim}
-}
-\noindent produces two subgoals, each with one disjunct as an added
-assumption:
-{\par\samepage\setseps\small
-\begin{verbatim}
- ?n. m = SUC n ?- (PRE m = m) = (m = 0)
-
- m = 0 ?- (PRE m = m) = (m = 0)
-\end{verbatim}
-}
-\USES
-Building cases tactics. For example, {\small\verb%DISJ_CASES_TAC%} could be defined by:
-{\par\samepage\setseps\small
-\begin{verbatim}
- let DISJ_CASES_TAC = DISJ_CASES_THEN ASSUME_TAC
-\end{verbatim}
-}
-\COMMENTS
-Use {\small\verb%DISJ_CASES_THEN2%} to apply different tactic generating functions
-to each case.
-
-\SEEALSO
-STRIP_THM_THEN, CHOOSE_THEN, CONJUNCTS_THEN, CONJUNCTS_THEN2,
-DISJ_CASES_TAC, DISJ_CASES_THEN2, DISJ_CASES_THENL.
-
-\ENDDOC
\DOC{DISJ\_CASES\_THEN2}
\TYPE {\small\verb%DISJ_CASES_THEN2 : (thm_tactic -> thm_tactical)%}\egroup
@@ -6156,21 +5804,92 @@ STRIP_THM_THEN, CHOOSE_THEN, CONJUNCTS_T
DISJ_CASES_THEN, DISJ_CASES_THENL.
\ENDDOC
-\DOC{DISJ\_CASES\_THENL}
+\DOC{DISJ\_CASES\_THEN}
-\TYPE {\small\verb%DISJ_CASES_THENL : (thm_tactic list -> thm_tactic)%}\egroup
+\TYPE {\small\verb%DISJ_CASES_THEN : thm_tactical%}\egroup
\SYNOPSIS
-Applies theorem-tactics in a list to the corresponding disjuncts in a theorem.
+Applies a theorem-tactic to each disjunct of a disjunctive theorem.
\DESCRIBE
-If the theorem-tactics {\small\verb%f1...fn%} applied to the {\small\verb%ASSUME%}d disjuncts of a
-theorem
+If the theorem-tactic {\small\verb%f:thm->tactic%} applied to either
+{\small\verb%ASSUME%}d disjunct produces results as follows when applied to a goal
+{\small\verb%(A ?- t)%}:
{\par\samepage\setseps\small
\begin{verbatim}
- |- d1 \/ d2 \/...\/ dn
-\end{verbatim}
-}
+ A ?- t A ?- t
+ ========= f (u |- u) and ========= f (v |- v)
+ A ?- t1 A ?- t2
+\end{verbatim}
+}
+\noindent then applying {\small\verb%DISJ_CASES_THEN f (|- u \/ v)%}
+to the goal {\small\verb%(A ?- t)%} produces two subgoals.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A ?- t
+ ====================== DISJ_CASES_THEN f (|- u \/ v)
+ A ?- t1 A ?- t2
+\end{verbatim}
+}
+\FAILURE
+Fails if the theorem is not a disjunction. An invalid tactic is
+produced if the theorem has any hypothesis which is not
+alpha-convertible to an assumption of the goal.
+
+\EXAMPLE
+Given the theorem
+{\par\samepage\setseps\small
+\begin{verbatim}
+ th = |- (m = 0) \/ (?n. m = SUC n)
+\end{verbatim}
+}
+\noindent and a goal of the form {\small\verb%?- (PRE m = m) = (m = 0)%},
+applying the tactic
+{\par\samepage\setseps\small
+\begin{verbatim}
+ DISJ_CASES_THEN ASSUME_TAC th
+\end{verbatim}
+}
+\noindent produces two subgoals, each with one disjunct as an added
+assumption:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ ?n. m = SUC n ?- (PRE m = m) = (m = 0)
+
+ m = 0 ?- (PRE m = m) = (m = 0)
+\end{verbatim}
+}
+\USES
+Building cases tactics. For example, {\small\verb%DISJ_CASES_TAC%} could be defined by:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ let DISJ_CASES_TAC = DISJ_CASES_THEN ASSUME_TAC
+\end{verbatim}
+}
+\COMMENTS
+Use {\small\verb%DISJ_CASES_THEN2%} to apply different tactic generating functions
+to each case.
+
+\SEEALSO
+STRIP_THM_THEN, CHOOSE_THEN, CONJUNCTS_THEN, CONJUNCTS_THEN2,
+DISJ_CASES_TAC, DISJ_CASES_THEN2, DISJ_CASES_THENL.
+
+\ENDDOC
+\DOC{DISJ\_CASES\_THENL}
+
+\TYPE {\small\verb%DISJ_CASES_THENL : (thm_tactic list -> thm_tactic)%}\egroup
+
+\SYNOPSIS
+Applies theorem-tactics in a list to the corresponding disjuncts in a theorem.
+
+\DESCRIBE
+If the theorem-tactics {\small\verb%f1...fn%} applied to the {\small\verb%ASSUME%}d disjuncts of a
+theorem
+{\par\samepage\setseps\small
+\begin{verbatim}
+ |- d1 \/ d2 \/...\/ dn
+\end{verbatim}
+}
\noindent produce results as follows when applied to a goal {\small\verb%(A ?- t)%}:
{\par\samepage\setseps\small
\begin{verbatim}
@@ -6211,103 +5930,352 @@ DISJ_CASES_THEN, DISJ_CASES_THEN2, STRIP
\TYPE {\small\verb%DISJ_CASES_UNION : (thm -> thm -> thm -> thm)%}\egroup
\SYNOPSIS
-Makes an inference for each arm of a disjunct.
+Makes an inference for each arm of a disjunct.
+
+\DESCRIBE
+Given a disjunctive theorem, and two additional theorems each having one
+disjunct as a hypothesis, a new theorem with a conclusion that is the
+disjunction of the conclusions of the last two theorems is produced. The
+hypotheses include the union of hypotheses of all three theorems less the two
+disjuncts.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- t1 \/ t2 A1 u {t1} |- t3 A2 u {t2} |- t4
+ ------------------------------------------------------ DISJ_CASES_UNION
+ A u A1 u A2 |- t3 \/ t4
+\end{verbatim}
+}
+\FAILURE
+Fails if the first theorem is not a disjunction.
+
+\EXAMPLE
+The built-in theorem {\small\verb%LESS_CASES%} can be specialized to:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ th1 = |- m < n \/ n <= m
+\end{verbatim}
+}
+\noindent and used with two additional theorems:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ th2 = (m < n |- (m MOD n = m))
+ th3 = ({0 < n, n <= m} |- (m MOD n) = ((m - n) MOD n))
+\end{verbatim}
+}
+\noindent to derive a new theorem:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #DISJ_CASES_UNION th1 th2 th3;;
+ ["0 < n"] |- (m MOD n = m) \/ (m MOD n = (m - n) MOD n)
+\end{verbatim}
+}
+\SEEALSO
+DISJ_CASES, DISJ_CASES_TAC, DISJ1, DISJ2.
+
+\ENDDOC
+\DOC{DISJ\_IMP}
+
+\TYPE {\small\verb%DISJ_IMP : (thm -> thm)%}\egroup
+
+\SYNOPSIS
+Converts a disjunctive theorem to an equivalent implicative theorem.
+
+\DESCRIBE
+The left disjunct of a disjunctive theorem becomes the negated
+antecedent of the newly generated theorem.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- t1 \/ t2
+ ----------------- DISJ_IMP
+ A |- ~t1 ==> t2
+\end{verbatim}
+}
+\FAILURE
+Fails if the theorem is not a disjunction.
+
+\EXAMPLE
+Specializing the built-in theorem {\small\verb%LESS_CASES%} gives the theorem:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ th = |- m < n \/ n <= m
+\end{verbatim}
+}
+\noindent to which {\small\verb%DISJ_IMP%} may be applied:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #DISJ_IMP th;;
+ |- ~m < n ==> n <= m
+\end{verbatim}
+}
+\SEEALSO
+DISJ_CASES.
+
+\ENDDOC
+\DOC{disjuncts}
+
+\TYPE {\small\verb%disjuncts : (term -> term list)%}\egroup
+
+\SYNOPSIS
+Iteratively breaks apart a disjunction.
+
+\DESCRIBE
+{\small\verb%disjuncts "t1 \/ ... \/ tn"%} returns {\small\verb%["t1";...;"tn"]%}.
+The argument term may be any tree of disjunctions;
+it need not have the form {\small\verb%"t1 \/ (t2 \/ ( ... \/ tn)...)"%}.
+A term that is not a disjunction is simply returned as the sole element of a
+list. Note that
+{\par\samepage\setseps\small
+\begin{verbatim}
+ disjuncts(list_mk_disj(["t1";...;"tn"]))
+\end{verbatim}
+}
+\noindent will not return {\small\verb%["t1";...;"tn"]%} if any of {\small\verb%t1%},...,{\small\verb%tn%} are
+disjunctions.
+
+\FAILURE
+Never fails.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#list_mk_disj ["a \/ b";"c \/ d";"e \/ f"];;
+"(a \/ b) \/ (c \/ d) \/ e \/ f" : term
+
+#disjuncts it;;
+["a"; "b"; "c"; "d"; "e"; "f"] : term list
+
+#list_mk_disj it;;
+"a \/ b \/ c \/ d \/ e \/ f" : term
+
+#disjuncts "1";;
+["1"] : term list
+\end{verbatim}
+}
+\COMMENTS
+Because {\small\verb%disjuncts%} splits both the left and right sides of a disjunction,
+this operation is not the inverse of {\small\verb%list_mk_disj%}. It may be useful to
+introduce {\small\verb%list_dest_disj%} for splitting only the right tails of a disjunction.
+
+\SEEALSO
+list_mk_disj, dest_disj.
+
+\ENDDOC
+\DOC{distinct}
+
+\TYPE {\small\verb%distinct : (* list -> bool)%}\egroup
+
+\SYNOPSIS
+Checks whether the elements of a list are all distinct.
+
+\DESCRIBE
+If all the elements in a list are distinct, returns {\small\verb%true%}, otherwise returns
+{\small\verb%false%}.
+
+\FAILURE
+Never fails.
+
+\SEEALSO
+setify.
+
+\ENDDOC
+\DOC{/}
+
+\TYPE {\small\verb%$/ : ((int # int) -> int)%}\egroup
+
+\SYNOPSIS
+Performs division on ML integers.
+
+\FAILURE
+Fails on division by zero.
+
+\ENDDOC
+\DOC{<<}
+
+\TYPE {\small\verb%$<< : ((* # **) -> bool)%}\egroup
+
+\SYNOPSIS
+Performs a lexical comparison of values.
+
+\DESCRIBE
+{\small\verb%$<<%} performs a fast ordering on values. It is substitutive with
+respect to equality in ML (i.e. if {\small\verb%x << y%} and {\small\verb%x = x'%} and {\small\verb%y = y'%}
+then {\small\verb%x' << y'%}).
+
+\FAILURE
+Never fails.
+
+\USES
+It is often useful, for example in normalizing terms in some way, to be able to
+impose some arbitrary (but definite) ordering on ML values.
+
+\SEEALSO
+=.
+
+\ENDDOC
+\DOC{<}
+
+\TYPE {\small\verb%$< : ((int # int) -> bool)%}\egroup
+
+\SYNOPSIS
+Performs a less-than test on ML integers.
+
+\FAILURE
+Never fails.
+
+\ENDDOC
+\DOC{=}
+
+\TYPE {\small\verb%$= : ((* # *) -> bool)%}\egroup
+
+\SYNOPSIS
+Performs an equality test on two ML values.
+
+\DESCRIBE
+{\small\verb%$=%} works as expected on non-function types. It may give unexpected results
+when applied to function types (or types containing them, such as a pair of
+functions), and should be considered unreliable in those situations.
+
+\FAILURE
+Never fails.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#1 = 2;;
+false : bool
+
+#1 = 1;;
+true : bool
+
+#let f x = x + 1 and g x = x + 2;;
+f = - : (int -> int)
+g = - : (int -> int)
+
+#let f' = f and h x = f x and h' x = x + 1;;
+f' = - : (int -> int)
+h = - : (int -> int)
+h' = - : (int -> int)
+
+#f=f;;
+true : bool
+
+#f = f';;
+true : bool
+
+#f = g;;
+false : bool
+
+#f =h;;
+false : bool
+
+#f=h';;
+false : bool
+
+#h = h';;
+false : bool
+\end{verbatim}
+}
+\ENDDOC
+\DOC{>}
+
+\TYPE {\small\verb%$> : ((int # int) -> bool)%}\egroup
+
+\SYNOPSIS
+Performs a greater-than test on ML integers.
+
+\FAILURE
+Never fails.
+
+\ENDDOC
+\DOC{-}
+
+\TYPE {\small\verb%$- : ((int # int) -> int)%}\egroup
+
+\SYNOPSIS
+Performs subtraction on ML integers.
+
+\FAILURE
+Never fails.
+
+\COMMENTS
+Unary {\small\verb%-%} exists as an internal parser object, but not as a function. So,
+whilst typing in {\small\verb%-1;;%} will work, {\small\verb%-;;%} will return a parse error.
+
+\ENDDOC
+\DOC{\char'056}
+
+\TYPE {\small\verb%$. : ((* # * list) -> * list)%}\egroup
+
+\SYNOPSIS
+Adds single element to the head of a list.
+
+\DESCRIBE
+The {\small\verb%.%} operator is an infixed primitive list constructor, analogous to {\small\verb%CONS%}
+in LISP. Its effect is {\small\verb%x . [x1;....;xn]%} = {\small\verb%[x;x1;...;xn]%}.
+
+\FAILURE
+Never fails.
+
+\ENDDOC
+\DOC{\char'100}
+
+\TYPE {\small\verb%$@ : ((* list # * list) -> * list)%}\egroup
+
+\SYNOPSIS
+Concatenates two lists.
\DESCRIBE
-Given a disjunctive theorem, and two additional theorems each having one
-disjunct as a hypothesis, a new theorem with a conclusion that is the
-disjunction of the conclusions of the last two theorems is produced. The
-hypotheses include the union of hypotheses of all three theorems less the two
-disjuncts.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- t1 \/ t2 A1 u {t1} |- t3 A2 u {t2} |- t4
- ------------------------------------------------------ DISJ_CASES_UNION
- A u A1 u A2 |- t3 \/ t4
-\end{verbatim}
-}
+{\small\verb%@%} is an infix operator which concatenates two lists.
+
\FAILURE
-Fails if the first theorem is not a disjunction.
+Never fails.
\EXAMPLE
-The built-in theorem {\small\verb%LESS_CASES%} can be specialized to:
-{\par\samepage\setseps\small
-\begin{verbatim}
- th1 = |- m < n \/ n <= m
-\end{verbatim}
-}
-\noindent and used with two additional theorems:
-{\par\samepage\setseps\small
-\begin{verbatim}
- th2 = (m < n |- (m MOD n = m))
- th3 = ({0 < n, n <= m} |- (m MOD n) = ((m - n) MOD n))
-\end{verbatim}
-}
-\noindent to derive a new theorem:
{\par\samepage\setseps\small
\begin{verbatim}
- #DISJ_CASES_UNION th1 th2 th3;;
- ["0 < n"] |- (m MOD n = m) \/ (m MOD n = (m - n) MOD n)
+#[1;2;3] @ [4;5;6];;
+[1; 2; 3; 4; 5; 6] : int list
\end{verbatim}
}
\SEEALSO
-DISJ_CASES, DISJ_CASES_TAC, DISJ1, DISJ2.
+append.
\ENDDOC
-\DOC{DISJ\_IMP}
+\DOC{*}
-\TYPE {\small\verb%DISJ_IMP : (thm -> thm)%}\egroup
+\TYPE {\small\verb%$* : ((int # int) -> int)%}\egroup
\SYNOPSIS
-Converts a disjunctive theorem to an equivalent implicative theorem.
+Performs multiplication on ML integers.
-\DESCRIBE
-The left disjunct of a disjunctive theorem becomes the negated
-antecedent of the newly generated theorem.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- t1 \/ t2
- ----------------- DISJ_IMP
- A |- ~t1 ==> t2
-\end{verbatim}
-}
\FAILURE
-Fails if the theorem is not a disjunction.
-
-\EXAMPLE
-Specializing the built-in theorem {\small\verb%LESS_CASES%} gives the theorem:
-{\par\samepage\setseps\small
-\begin{verbatim}
- th = |- m < n \/ n <= m
-\end{verbatim}
-}
-\noindent to which {\small\verb%DISJ_IMP%} may be applied:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #DISJ_IMP th;;
- |- ~m < n ==> n <= m
-\end{verbatim}
-}
-\SEEALSO
-DISJ_CASES.
+Never fails.
\ENDDOC
-\DOC{distinct}
-\TYPE {\small\verb%distinct : (* list -> bool)%}\egroup
+\DOC{\#}
-\SYNOPSIS
-Checks whether the elements of a list are all distinct.
+\TYPE {\small\verb%$# : (((* -> **) # (*** -> ****)) -> (* # ***) -> (** # ****))%}\egroup
-\DESCRIBE
-If all the elements in a list are distinct, returns {\small\verb%true%}, otherwise returns
-{\small\verb%false%}.
+\SYNOPSIS
+Applies two functions to a pair: {\small\verb%(f # g) (x,y)%} = {\small\verb%(f x, g y)%}.
\FAILURE
Never fails.
\SEEALSO
-setify.
+B, C, CB, Co, I, K, KI, o, oo, S, W.
+
+\ENDDOC
+\DOC{+}
+
+\TYPE {\small\verb%$+ : ((int # int) -> int)%}\egroup
+
+\SYNOPSIS
+Performs addition on ML integers.
+
+\FAILURE
+Never fails.
\ENDDOC
\DOC{do}
@@ -6468,6 +6436,38 @@ b, backup, backup_limit, expand, expandf
rotate, save_top_thm, set_goal, set_state, top_goal, top_thm, VALID.
\ENDDOC
+\DOC{EL\_CONV}
+
+\TYPE {\small\verb%EL_CONV : conv%}\egroup
+
+\SYNOPSIS
+Computes by inference the result of indexing an element from a list.
+
+\DESCRIBE
+For any object language list of the form {\small\verb%"[x0;...xk;...;xn]"%} ,
+the result of evaluating
+{\par\samepage\setseps\small
+\begin{verbatim}
+ EL_CONV "EL k [x0;...xk;...;xn]"
+\end{verbatim}
+}
+\noindent is the theorem
+{\par\samepage\setseps\small
+\begin{verbatim}
+ |- EL k [x0;...;xk;...;xn] = xk
+\end{verbatim}
+}
+
+
+\FAILURE
+{\small\verb%EL_CONV tm%} fails if {\small\verb%tm%} is not of the form described above,
+or {\small\verb%k%} is not less than the length of the list.
+
+\SEEALSO
+ELL_CONV
+
+\ENDDOC
+
\DOC{el}
\TYPE {\small\verb%el : (int -> * list -> *)%}\egroup
@@ -6527,38 +6527,6 @@ EL_CONV
\ENDDOC
-\DOC{EL\_CONV}
-
-\TYPE {\small\verb%EL_CONV : conv%}\egroup
-
-\SYNOPSIS
-Computes by inference the result of indexing an element from a list.
-
-\DESCRIBE
-For any object language list of the form {\small\verb%"[x0;...xk;...;xn]"%} ,
-the result of evaluating
-{\par\samepage\setseps\small
-\begin{verbatim}
- EL_CONV "EL k [x0;...xk;...;xn]"
-\end{verbatim}
-}
-\noindent is the theorem
-{\par\samepage\setseps\small
-\begin{verbatim}
- |- EL k [x0;...;xk;...;xn] = xk
-\end{verbatim}
-}
-
-
-\FAILURE
-{\small\verb%EL_CONV tm%} fails if {\small\verb%tm%} is not of the form described above,
-or {\small\verb%k%} is not less than the length of the list.
-
-\SEEALSO
-ELL_CONV
-
-\ENDDOC
-
\DOC{end\_itlist}
\TYPE {\small\verb%end_itlist : ((* -> * -> *) -> * list -> *)%}\egroup
@@ -6656,51 +6624,6 @@ Fails if the argument theorem is not a n
EQF_ELIM, EQT_ELIM, EQT_INTRO.
\ENDDOC
-\DOC{EQT\_ELIM}
-
-\TYPE {\small\verb%EQT_ELIM : (thm -> thm)%}\egroup
-
-\SYNOPSIS
-Eliminates equality with {\small\verb%T%}.
-
-\DESCRIBE
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- tm = T
- ------------- EQT_ELIM
- A |- tm
-\end{verbatim}
-}
-\FAILURE
-Fails if the argument theorem is not of the form {\small\verb%A |- tm = T%}.
-
-\SEEALSO
-EQT_INTRO, EQF_ELIM, EQF_INTRO.
-
-\ENDDOC
-\DOC{EQT\_INTRO}
-
-\TYPE {\small\verb%EQT_INTRO : (thm -> thm)%}\egroup
-
-\SYNOPSIS
-Introduces equality with {\small\verb%T%}.
-
-\DESCRIBE
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- tm
- ------------- EQF_INTRO
- A |- tm = T
-\end{verbatim}
-}
-
-\FAILURE
-Never fails.
-
-\SEEALSO
-EQT_ELIM, EQF_ELIM, EQF_INTRO.
-
-\ENDDOC
\DOC{EQ\_IMP\_RULE}
\TYPE {\small\verb%EQ_IMP_RULE : (thm -> (thm # thm))%}\egroup
@@ -6840,37 +6763,82 @@ rule {\small\verb%EQ_MP%} returns the th
\end{verbatim}
}
\FAILURE
-Fails unless the first theorem is equational and its left side
-is the same as the conclusion of the second theorem (and is therefore
-of type {\small\verb%bool%}), up to alpha-conversion.
+Fails unless the first theorem is equational and its left side
+is the same as the conclusion of the second theorem (and is therefore
+of type {\small\verb%bool%}), up to alpha-conversion.
+
+\SEEALSO
+EQ_IMP_RULE, IMP_ANTISYM_RULE, MP.
+
+\ENDDOC
+\DOC{EQ\_TAC}
+
+\TYPE {\small\verb%EQ_TAC : tactic%}\egroup
+
+\SYNOPSIS
+Reduces goal of equality of boolean terms to forward and backward implication.
+
+\DESCRIBE
+When applied to a goal {\small\verb%A ?- t1 = t2%}, where {\small\verb%t1%} and {\small\verb%t2%} have type {\small\verb%bool%},
+the tactic {\small\verb%EQ_TAC%} returns the subgoals {\small\verb%A ?- t1 ==> t2%} and
+{\small\verb%A ?- t2 ==> t1%}.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A ?- t1 = t2
+ ================================= EQ_TAC
+ A ?- t1 ==> t2 A ?- t2 ==> t1
+\end{verbatim}
+}
+\FAILURE
+Fails unless the conclusion of the goal is an equation between boolean terms.
+
+\SEEALSO
+EQ_IMP_RULE, IMP_ANTISYM_RULE.
+
+\ENDDOC
+\DOC{EQT\_ELIM}
+
+\TYPE {\small\verb%EQT_ELIM : (thm -> thm)%}\egroup
+
+\SYNOPSIS
+Eliminates equality with {\small\verb%T%}.
+
+\DESCRIBE
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- tm = T
+ ------------- EQT_ELIM
+ A |- tm
+\end{verbatim}
+}
+\FAILURE
+Fails if the argument theorem is not of the form {\small\verb%A |- tm = T%}.
\SEEALSO
-EQ_IMP_RULE, IMP_ANTISYM_RULE, MP.
+EQT_INTRO, EQF_ELIM, EQF_INTRO.
\ENDDOC
-\DOC{EQ\_TAC}
+\DOC{EQT\_INTRO}
-\TYPE {\small\verb%EQ_TAC : tactic%}\egroup
+\TYPE {\small\verb%EQT_INTRO : (thm -> thm)%}\egroup
\SYNOPSIS
-Reduces goal of equality of boolean terms to forward and backward implication.
+Introduces equality with {\small\verb%T%}.
\DESCRIBE
-When applied to a goal {\small\verb%A ?- t1 = t2%}, where {\small\verb%t1%} and {\small\verb%t2%} have type {\small\verb%bool%},
-the tactic {\small\verb%EQ_TAC%} returns the subgoals {\small\verb%A ?- t1 ==> t2%} and
-{\small\verb%A ?- t2 ==> t1%}.
{\par\samepage\setseps\small
\begin{verbatim}
- A ?- t1 = t2
- ================================= EQ_TAC
- A ?- t1 ==> t2 A ?- t2 ==> t1
+ A |- tm
+ ------------- EQF_INTRO
+ A |- tm = T
\end{verbatim}
}
+
\FAILURE
-Fails unless the conclusion of the goal is an equation between boolean terms.
+Never fails.
\SEEALSO
-EQ_IMP_RULE, IMP_ANTISYM_RULE.
+EQT_ELIM, EQF_ELIM, EQF_INTRO.
\ENDDOC
\DOC{ETA\_CONV}
@@ -6888,37 +6856,6 @@ to the theorem {\small\verb%|- (\x. t x)
Fails if the input term is not an eta-redex.
\ENDDOC
-\DOC{EVERY}
-
-\TYPE {\small\verb%EVERY : (tactic list -> tactic)%}\egroup
-
-\SYNOPSIS
-Sequentially applies all the tactics in a given list of tactics.
-
-\DESCRIBE
-When applied to a list of tactics {\small\verb%[T1; ... ;Tn]%}, and a goal {\small\verb%g%}, the tactical
-{\small\verb%EVERY%} applies each tactic in sequence to every
-subgoal generated by the previous one. This can be represented as:
-{\par\samepage\setseps\small
-\begin{verbatim}
- EVERY [T1;...;Tn] = T1 THEN ... THEN Tn
-\end{verbatim}
-}
-\noindent If the tactic list is empty, the resulting tactic has no effect.
-
-\FAILURE
-The application of {\small\verb%EVERY%} to a tactic list never fails. The resulting
-tactic fails iff any of the component tactics do.
-
-\COMMENTS
-It is possible to use {\small\verb%EVERY%} instead of {\small\verb%THEN%}, but probably
-stylistically inferior. {\small\verb%EVERY%} is more useful when applied to a list of
-tactics generated by a function.
-
-\SEEALSO
-FIRST, MAP_EVERY, THEN.
-
-\ENDDOC
\DOC{EVERY\_ASSUM}
\TYPE {\small\verb%EVERY_ASSUM : (thm_tactic -> tactic)%}\egroup
@@ -6973,6 +6910,37 @@ is, {\small\verb%EVERY_CONV [] "t"%} ret
THENC.
\ENDDOC
+\DOC{EVERY}
+
+\TYPE {\small\verb%EVERY : (tactic list -> tactic)%}\egroup
+
+\SYNOPSIS
+Sequentially applies all the tactics in a given list of tactics.
+
+\DESCRIBE
+When applied to a list of tactics {\small\verb%[T1; ... ;Tn]%}, and a goal {\small\verb%g%}, the tactical
+{\small\verb%EVERY%} applies each tactic in sequence to every
+subgoal generated by the previous one. This can be represented as:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ EVERY [T1;...;Tn] = T1 THEN ... THEN Tn
+\end{verbatim}
+}
+\noindent If the tactic list is empty, the resulting tactic has no effect.
+
+\FAILURE
+The application of {\small\verb%EVERY%} to a tactic list never fails. The resulting
+tactic fails iff any of the component tactics do.
+
+\COMMENTS
+It is possible to use {\small\verb%EVERY%} instead of {\small\verb%THEN%}, but probably
+stylistically inferior. {\small\verb%EVERY%} is more useful when applied to a list of
+tactics generated by a function.
+
+\SEEALSO
+FIRST, MAP_EVERY, THEN.
+
+\ENDDOC
\DOC{EVERY\_TCL}
\TYPE {\small\verb%EVERY_TCL : (thm_tactical list -> thm_tactical)%}\egroup
@@ -7035,43 +7003,43 @@ Fails unless the conclusion of the theor
EXISTS_UNIQUE_CONV.
\ENDDOC
-\DOC{EXISTS}
+\DOC{EXISTS\_AND\_CONV}
-\TYPE {\small\verb%EXISTS : ((term # term) -> thm -> thm)%}\egroup
+\TYPE {\small\verb%EXISTS_AND_CONV : conv%}\egroup
\SYNOPSIS
-Introduces existential quantification given a particular witness.
+Moves an existential quantification inwards through a conjunction.
\DESCRIBE
-When applied to a pair of terms and a theorem, the first term an existentially
-quantified pattern indicating the desired form of the result, and the second a
-witness whose substitution for the quantified variable gives a term which is
-the same as the conclusion of the theorem, {\small\verb%EXISTS%} gives the desired theorem.
+When applied to a term of the form {\small\verb%?x. P /\ Q%}, where {\small\verb%x%} is not free in both
+{\small\verb%P%} and {\small\verb%Q%}, {\small\verb%EXISTS_AND_CONV%} returns a theorem of one of three forms,
+depending on occurrences of the variable {\small\verb%x%} in {\small\verb%P%} and {\small\verb%Q%}. If {\small\verb%x%} is free
+in {\small\verb%P%} but not in {\small\verb%Q%}, then the theorem:
{\par\samepage\setseps\small
\begin{verbatim}
- A |- p[u/x]
- ------------- EXISTS ("?x. p","u")
- A |- ?x. p
+ |- (?x. P /\ Q) = (?x.P) /\ Q
\end{verbatim}
}
-\FAILURE
-Fails unless the substituted pattern is the same as the conclusion of the
-theorem.
-
-\EXAMPLE
-The following examples illustrate how it is possible to deduce different
-things from the same theorem:
+\noindent is returned. If {\small\verb%x%} is free in {\small\verb%Q%} but not in {\small\verb%P%}, then the
+result is:
{\par\samepage\setseps\small
\begin{verbatim}
- #EXISTS ("?x. x=T","T") (REFL "T");;
- |- ?x. x = T
-
- #EXISTS ("?x:bool. x=x","T") (REFL "T");;
- |- ?x. x = x
+ |- (?x. P /\ Q) = P /\ (?x.Q)
+\end{verbatim}
+}
+\noindent And if {\small\verb%x%} is free in neither {\small\verb%P%} nor {\small\verb%Q%}, then the result is:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ |- (?x. P /\ Q) = (?x.P) /\ (?x.Q)
\end{verbatim}
}
+\FAILURE
+{\small\verb%EXISTS_AND_CONV%} fails if it is applied to a term not of the form
+{\small\verb%?x. P /\ Q%}, or if it is applied to a term {\small\verb%?x. P /\ Q%} in which the
+variable {\small\verb%x%} is free in both {\small\verb%P%} and {\small\verb%Q%}.
+
\SEEALSO
-CHOOSE, EXISTS_TAC.
+AND_EXISTS_CONV, LEFT_AND_EXISTS_CONV, RIGHT_AND_EXISTS_CONV.
\ENDDOC
\DOC{exists}
@@ -7093,43 +7061,43 @@ Never fails.
forall, find, tryfind, mem, assoc, rev_assoc.
\ENDDOC
-\DOC{EXISTS\_AND\_CONV}
+\DOC{EXISTS}
-\TYPE {\small\verb%EXISTS_AND_CONV : conv%}\egroup
+\TYPE {\small\verb%EXISTS : ((term # term) -> thm -> thm)%}\egroup
\SYNOPSIS
-Moves an existential quantification inwards through a conjunction.
+Introduces existential quantification given a particular witness.
\DESCRIBE
-When applied to a term of the form {\small\verb%?x. P /\ Q%}, where {\small\verb%x%} is not free in both
-{\small\verb%P%} and {\small\verb%Q%}, {\small\verb%EXISTS_AND_CONV%} returns a theorem of one of three forms,
-depending on occurrences of the variable {\small\verb%x%} in {\small\verb%P%} and {\small\verb%Q%}. If {\small\verb%x%} is free
-in {\small\verb%P%} but not in {\small\verb%Q%}, then the theorem:
-{\par\samepage\setseps\small
-\begin{verbatim}
- |- (?x. P /\ Q) = (?x.P) /\ Q
-\end{verbatim}
-}
-\noindent is returned. If {\small\verb%x%} is free in {\small\verb%Q%} but not in {\small\verb%P%}, then the
-result is:
+When applied to a pair of terms and a theorem, the first term an existentially
+quantified pattern indicating the desired form of the result, and the second a
+witness whose substitution for the quantified variable gives a term which is
+the same as the conclusion of the theorem, {\small\verb%EXISTS%} gives the desired theorem.
{\par\samepage\setseps\small
\begin{verbatim}
- |- (?x. P /\ Q) = P /\ (?x.Q)
+ A |- p[u/x]
+ ------------- EXISTS ("?x. p","u")
+ A |- ?x. p
\end{verbatim}
}
-\noindent And if {\small\verb%x%} is free in neither {\small\verb%P%} nor {\small\verb%Q%}, then the result is:
+\FAILURE
+Fails unless the substituted pattern is the same as the conclusion of the
+theorem.
+
+\EXAMPLE
+The following examples illustrate how it is possible to deduce different
+things from the same theorem:
{\par\samepage\setseps\small
\begin{verbatim}
- |- (?x. P /\ Q) = (?x.P) /\ (?x.Q)
+ #EXISTS ("?x. x=T","T") (REFL "T");;
+ |- ?x. x = T
+
+ #EXISTS ("?x:bool. x=x","T") (REFL "T");;
+ |- ?x. x = x
\end{verbatim}
}
-\FAILURE
-{\small\verb%EXISTS_AND_CONV%} fails if it is applied to a term not of the form
-{\small\verb%?x. P /\ Q%}, or if it is applied to a term {\small\verb%?x. P /\ Q%} in which the
-variable {\small\verb%x%} is free in both {\small\verb%P%} and {\small\verb%Q%}.
-
\SEEALSO
-AND_EXISTS_CONV, LEFT_AND_EXISTS_CONV, RIGHT_AND_EXISTS_CONV.
+CHOOSE, EXISTS_TAC.
\ENDDOC
\DOC{EXISTS\_EQ}
@@ -7191,32 +7159,6 @@ true' and `there is a greatest number su
EXISTS_LEAST_CONV.
\ENDDOC
-\DOC{EXISTS\_IMP}
-
-\TYPE {\small\verb%EXISTS_IMP : (term -> thm -> thm)%}\egroup
-
-\SYNOPSIS
-Existentially quantifies both the antecedent and consequent of an implication.
-
-\DESCRIBE
-When applied to a variable {\small\verb%x%} and a theorem {\small\verb%A |- t1 ==> t2%}, the
-inference rule {\small\verb%EXISTS_IMP%} returns the theorem {\small\verb%A |- (?x. t1) ==> (?x. t2)%},
-provided {\small\verb%x%} is not free in the assumptions.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- t1 ==> t2
- -------------------------- EXISTS_IMP "x" [where x is not free in A]
- A |- (?x.t1) ==> (?x.t2)
-\end{verbatim}
-}
-\FAILURE
-Fails if the theorem is not implicative, or if the term is not a variable, or
-if the term is a variable but is free in the assumption list.
-
-\SEEALSO
-EXISTS_EQ.
-
-\ENDDOC
\DOC{EXISTS\_IMP\_CONV}
\TYPE {\small\verb%EXISTS_IMP_CONV : conv%}\egroup
@@ -7256,6 +7198,32 @@ variable {\small\verb%x%} is free in bot
LEFT_IMP_FORALL_CONV, RIGHT_IMP_EXISTS_CONV.
\ENDDOC
+\DOC{EXISTS\_IMP}
+
+\TYPE {\small\verb%EXISTS_IMP : (term -> thm -> thm)%}\egroup
+
+\SYNOPSIS
+Existentially quantifies both the antecedent and consequent of an implication.
+
+\DESCRIBE
+When applied to a variable {\small\verb%x%} and a theorem {\small\verb%A |- t1 ==> t2%}, the
+inference rule {\small\verb%EXISTS_IMP%} returns the theorem {\small\verb%A |- (?x. t1) ==> (?x. t2)%},
+provided {\small\verb%x%} is not free in the assumptions.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- t1 ==> t2
+ -------------------------- EXISTS_IMP "x" [where x is not free in A]
+ A |- (?x.t1) ==> (?x.t2)
+\end{verbatim}
+}
+\FAILURE
+Fails if the theorem is not implicative, or if the term is not a variable, or
+if the term is a variable but is free in the assumption list.
+
+\SEEALSO
+EXISTS_EQ.
+
+\ENDDOC
\DOC{EXISTS\_LEAST\_CONV}
\TYPE {\small\verb%EXISTS_LEAST_CONV : conv%}\egroup
@@ -7779,30 +7747,12 @@ pow2 = - : (int -> int)
\end{verbatim}
}
\COMMENTS
-This function is extremely dependent on the version of Lisp used, and its
-behaviour should not be relied upon; it may not work at all in Lisps other than
-Franz. It is questionable whether it is ever worthwhile to use it anyway,
-because although it cannot compromise the consistency of the logic, it can
-lead to confusing failures if one is manipulating numbers larger than the word
-size of the machine.
-
-\ENDDOC
-\DOC{filter}
-
-\TYPE {\small\verb%filter : ((* -> bool) -> * list -> * list)%}\egroup
-
-\SYNOPSIS
-Filters a list to the sublist of elements satisfying a predicate.
-
-\DESCRIBE
-{\small\verb%filter p l%} applies {\small\verb%p%} to every element of {\small\verb%l%}, returning a list of those
-that satisfy {\small\verb%p%}, in the order they appeared in the original list.
-
-\FAILURE
-Never fails.
-
-\SEEALSO
-mapfilter, partition, remove.
+This function is extremely dependent on the version of Lisp used, and its
+behaviour should not be relied upon; it may not work at all in Lisps other than
+Franz. It is questionable whether it is ever worthwhile to use it anyway,
+because although it cannot compromise the consistency of the logic, it can
+lead to confusing failures if one is manipulating numbers larger than the word
+size of the machine.
\ENDDOC
\DOC{FILTER\_ASM\_REWRITE\_RULE}
@@ -8018,6 +7968,24 @@ DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN,
STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC.
\ENDDOC
+\DOC{filter}
+
+\TYPE {\small\verb%filter : ((* -> bool) -> * list -> * list)%}\egroup
+
+\SYNOPSIS
+Filters a list to the sublist of elements satisfying a predicate.
+
+\DESCRIBE
+{\small\verb%filter p l%} applies {\small\verb%p%} to every element of {\small\verb%l%}, returning a list of those
+that satisfy {\small\verb%p%}, in the order they appeared in the original list.
+
+\FAILURE
+Never fails.
+
+\SEEALSO
+mapfilter, partition, remove.
+
+\ENDDOC
\DOC{FILTER\_GEN\_TAC}
\TYPE {\small\verb%FILTER_GEN_TAC : (term -> tactic)%}\egroup
@@ -8587,61 +8555,6 @@ Fails if the named theory file cannot be
find_file, find_ml_file, search_path, set_search_path.
\ENDDOC
-\DOC{FIRST}
-
-\TYPE {\small\verb%FIRST : (tactic list -> tactic)%}\egroup
-
-\SYNOPSIS
-Applies the first tactic in a tactic list which succeeds.
-
-\DESCRIBE
-When applied to a list of tactics {\small\verb%[T1;...;Tn]%}, and a goal {\small\verb%g%}, the tactical
-{\small\verb%FIRST%} tries applying the tactics to the goal until one succeeds. If the
-first tactic which succeeds is {\small\verb%Tm%}, then the effect is the same as just {\small\verb%Tm%}.
-Thus {\small\verb%FIRST%} effectively behaves as follows:
-{\par\samepage\setseps\small
-\begin{verbatim}
- FIRST [T1;...;Tn] = T1 ORELSE ... ORELSE Tn
-\end{verbatim}
-}
-\FAILURE
-The application of {\small\verb%FIRST%} to a tactic list never fails. The resulting
-tactic fails iff all the component tactics do when applied to the goal,
-or if the tactic list is empty.
-
-\SEEALSO
-EVERY, ORELSE.
-
-\ENDDOC
-\DOC{FIRSTN\_CONV}
-
-\TYPE {\small\verb%FIRSTN_CONV : conv%}\egroup
-
-\SYNOPSIS
-Computes by inference the result of taking the initial n elements of a list.
-
-\DESCRIBE
-For any object language list of the form {\small\verb%"[x0;...x(n-k);...;x(n-1)]"%} ,
-the result of evaluating
-{\par\samepage\setseps\small
-\begin{verbatim}
- FIRSTN_CONV "FIRSTN k [x0;...x(n-k);...;x(n-1)]"
-\end{verbatim}
-}
-\noindent is the theorem
-{\par\samepage\setseps\small
-\begin{verbatim}
- |- FIRSTN k [x0;...;x(n-k);...;x(n-1)] = [x0;...;x(n-k)]
-\end{verbatim}
-}
-
-
-\FAILURE
-{\small\verb%FIRSTN_CONV tm%} fails if {\small\verb%tm%} is not of the form described above,
-or {\small\verb%k%} is greater than the length of the list.
-
-\ENDDOC
-
\DOC{FIRST\_ASSUM}
\TYPE {\small\verb%FIRST_ASSUM : (thm_tactic -> tactic)%}\egroup
@@ -8709,6 +8622,61 @@ empty list.
ORELSEC.
\ENDDOC
+\DOC{FIRST}
+
+\TYPE {\small\verb%FIRST : (tactic list -> tactic)%}\egroup
+
+\SYNOPSIS
+Applies the first tactic in a tactic list which succeeds.
+
+\DESCRIBE
+When applied to a list of tactics {\small\verb%[T1;...;Tn]%}, and a goal {\small\verb%g%}, the tactical
+{\small\verb%FIRST%} tries applying the tactics to the goal until one succeeds. If the
+first tactic which succeeds is {\small\verb%Tm%}, then the effect is the same as just {\small\verb%Tm%}.
+Thus {\small\verb%FIRST%} effectively behaves as follows:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ FIRST [T1;...;Tn] = T1 ORELSE ... ORELSE Tn
+\end{verbatim}
+}
+\FAILURE
+The application of {\small\verb%FIRST%} to a tactic list never fails. The resulting
+tactic fails iff all the component tactics do when applied to the goal,
+or if the tactic list is empty.
+
+\SEEALSO
+EVERY, ORELSE.
+
+\ENDDOC
+\DOC{FIRSTN\_CONV}
+
+\TYPE {\small\verb%FIRSTN_CONV : conv%}\egroup
+
+\SYNOPSIS
+Computes by inference the result of taking the initial n elements of a list.
+
+\DESCRIBE
+For any object language list of the form {\small\verb%"[x0;...x(n-k);...;x(n-1)]"%} ,
+the result of evaluating
+{\par\samepage\setseps\small
+\begin{verbatim}
+ FIRSTN_CONV "FIRSTN k [x0;...x(n-k);...;x(n-1)]"
+\end{verbatim}
+}
+\noindent is the theorem
+{\par\samepage\setseps\small
+\begin{verbatim}
+ |- FIRSTN k [x0;...;x(n-k);...;x(n-1)] = [x0;...;x(n-k)]
+\end{verbatim}
+}
+
+
+\FAILURE
+{\small\verb%FIRSTN_CONV tm%} fails if {\small\verb%tm%} is not of the form described above,
+or {\small\verb%k%} is greater than the length of the list.
+
+\ENDDOC
+
\DOC{FIRST\_TCL}
\TYPE {\small\verb%FIRST_TCL : (thm_tactical list -> thm_tactical)%}\egroup
@@ -8752,28 +8720,6 @@ A full explanation of the standard flags
set_flag.
\ENDDOC
-\DOC{flat}
-
-\TYPE {\small\verb%flat : (* list list -> * list)%}\egroup
-
-\SYNOPSIS
-Flattens a list of lists into one long list.
-
-\DESCRIBE
-{\small\verb%flat [l1;...;ln]%} returns {\small\verb%(l1 @ ... @ ln)%} where each li is a list and {\small\verb%@%}
-is list concatenation.
-
-\FAILURE
-Never fails.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#flat [[1;2];[3;4;5];[6]];;
-[1; 2; 3; 4; 5; 6] : int list
-\end{verbatim}
-}
-\ENDDOC
\DOC{FLAT\_CONV}
\TYPE {\small\verb%FLAT_CONV : conv%}\egroup
@@ -8819,6 +8765,28 @@ FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV.
\ENDDOC
+\DOC{flat}
+
+\TYPE {\small\verb%flat : (* list list -> * list)%}\egroup
+
+\SYNOPSIS
+Flattens a list of lists into one long list.
+
+\DESCRIBE
+{\small\verb%flat [l1;...;ln]%} returns {\small\verb%(l1 @ ... @ ln)%} where each li is a list and {\small\verb%@%}
+is list concatenation.
+
+\FAILURE
+Never fails.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#flat [[1;2];[3;4;5];[6]];;
+[1; 2; 3; 4; 5; 6] : int list
+\end{verbatim}
+}
+\ENDDOC
\DOC{FOLDL\_CONV}
\TYPE {\small\verb%FOLDL_CONV : conv -> conv%}\egroup
@@ -8953,25 +8921,6 @@ FOLDL_CONV, list_FOLD_CONV.
\ENDDOC
-\DOC{forall}
-
-\TYPE {\small\verb%forall : ((* -> bool) -> * list -> bool)%}\egroup
-
-\SYNOPSIS
-Tests a list to see if all its elements satisfy a predicate.
-
-\DESCRIBE
-{\small\verb%forall p [x1;...;xn]%} returns {\small\verb%true%} if {\small\verb%(p xi)%} is true for all {\small\verb%xi%} in the
-list. Otherwise it returns {\small\verb%false%}. If the list is empty, this function always
-returns true.
-
-\FAILURE
-Never fails.
-
-\SEEALSO
-exists, find, tryfind, mem, assoc, rev_assoc.
-
-\ENDDOC
\DOC{FORALL\_AND\_CONV}
\TYPE {\small\verb%FORALL_AND_CONV : conv%}\egroup
@@ -8994,6 +8943,25 @@ Fails if applied to a term not of the fo
AND_FORALL_CONV, LEFT_AND_FORALL_CONV, RIGHT_AND_FORALL_CONV.
\ENDDOC
+\DOC{forall}
+
+\TYPE {\small\verb%forall : ((* -> bool) -> * list -> bool)%}\egroup
+
+\SYNOPSIS
+Tests a list to see if all its elements satisfy a predicate.
+
+\DESCRIBE
+{\small\verb%forall p [x1;...;xn]%} returns {\small\verb%true%} if {\small\verb%(p xi)%} is true for all {\small\verb%xi%} in the
+list. Otherwise it returns {\small\verb%false%}. If the list is empty, this function always
+returns true.
+
+\FAILURE
+Never fails.
+
+\SEEALSO
+exists, find, tryfind, mem, assoc, rev_assoc.
+
+\ENDDOC
\DOC{FORALL\_EQ}
\TYPE {\small\verb%FORALL_EQ : (term -> thm -> thm)%}\egroup
@@ -9113,13 +9081,49 @@ result is:
|- (!x. P \/ Q) = (!x.P) \/ (!x.Q)
\end{verbatim}
}
-\FAILURE
-{\small\verb%FORALL_OR_CONV%} fails if it is applied to a term not of the form
-{\small\verb%!x. P \/ Q%}, or if it is applied to a term {\small\verb%!x. P \/ Q%} in which the
-variable {\small\verb%x%} is free in both {\small\verb%P%} and {\small\verb%Q%}.
-
+\FAILURE
+{\small\verb%FORALL_OR_CONV%} fails if it is applied to a term not of the form
+{\small\verb%!x. P \/ Q%}, or if it is applied to a term {\small\verb%!x. P \/ Q%} in which the
+variable {\small\verb%x%} is free in both {\small\verb%P%} and {\small\verb%Q%}.
+
+\SEEALSO
+OR_FORALL_CONV, LEFT_OR_FORALL_CONV, RIGHT_OR_FORALL_CONV.
+
+\ENDDOC
+\DOC{free\_in}
+
+\TYPE {\small\verb%free_in : (term -> term -> bool)%}\egroup
+
+\SYNOPSIS
+Tests if one term is free in another.
+
+\DESCRIBE
+When applied to two terms {\small\verb%t1%} and {\small\verb%t2%}, the function {\small\verb%free_in%} returns
+{\small\verb%true%} if {\small\verb%t1%} is free in {\small\verb%t2%}, and {\small\verb%false%} otherwise. It is not necessary
+that {\small\verb%t1%} be simply a variable.
+
+\FAILURE
+Never fails.
+
+\EXAMPLE
+In the following example {\small\verb%free_in%} returns {\small\verb%false%} because the {\small\verb%x%} in {\small\verb%SUC x%}
+in the second term is bound:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #free_in "SUC x" "!x. SUC x = x + 1";;
+ false : bool
+\end{verbatim}
+}
+\noindent whereas the following call returns {\small\verb%true%} because the first instance
+of {\small\verb%x%} in the second term is free, even though there is also a bound instance:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #free_in "x:bool" "x /\ (?x. x=T)";;
+ true : bool
+\end{verbatim}
+}
\SEEALSO
-OR_FORALL_CONV, LEFT_OR_FORALL_CONV, RIGHT_OR_FORALL_CONV.
+frees, freesl, thm_frees.
\ENDDOC
\DOC{frees}
@@ -9250,42 +9254,6 @@ resolution and rewriting.
ASSUME, IMP_RES_TAC, PROVE_HYP, RES_TAC, REWR_CONV.
\ENDDOC
-\DOC{free\_in}
-
-\TYPE {\small\verb%free_in : (term -> term -> bool)%}\egroup
-
-\SYNOPSIS
-Tests if one term is free in another.
-
-\DESCRIBE
-When applied to two terms {\small\verb%t1%} and {\small\verb%t2%}, the function {\small\verb%free_in%} returns
-{\small\verb%true%} if {\small\verb%t1%} is free in {\small\verb%t2%}, and {\small\verb%false%} otherwise. It is not necessary
-that {\small\verb%t1%} be simply a variable.
-
-\FAILURE
-Never fails.
-
-\EXAMPLE
-In the following example {\small\verb%free_in%} returns {\small\verb%false%} because the {\small\verb%x%} in {\small\verb%SUC x%}
-in the second term is bound:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #free_in "SUC x" "!x. SUC x = x + 1";;
- false : bool
-\end{verbatim}
-}
-\noindent whereas the following call returns {\small\verb%true%} because the first instance
-of {\small\verb%x%} in the second term is free, even though there is also a bound instance:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #free_in "x:bool" "x /\ (?x. x=T)";;
- true : bool
-\end{verbatim}
-}
-\SEEALSO
-frees, freesl, thm_frees.
-
-\ENDDOC
\DOC{FRONT\_CONJ\_CONV}
\TYPE {\small\verb%FRONT_CONJ_CONV: (term list -> term -> thm)%}\egroup
@@ -9330,6 +9298,36 @@ Never fails.
snd, pair.
\ENDDOC
+\DOC{FUN\_EQ\_CONV}
+
+\TYPE {\small\verb%FUN_EQ_CONV : conv%}\egroup
+
+\SYNOPSIS
+Equates normal and extensional equality for two functions.
+
+\DESCRIBE
+The conversion {\small\verb%FUN_EQ_CONV%} embodies the fact that two functions are equal
+precisely when they give the same results for all values to which they can be
+applied. When supplied with a term argument of the form {\small\verb%f = g%}, where {\small\verb%f%} and
+{\small\verb%g%} are functions of type {\small\verb%ty1->ty2%}, {\small\verb%FUN_EQ_CONV%} returns the theorem:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ |- (f = g) = (!x. f x = g x)
+\end{verbatim}
+}
+\noindent where {\small\verb%x%} is a variable of type {\small\verb%ty1%} chosen by the conversion.
+
+\FAILURE
+{\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%}
+are functions.
+
+\USES
+Used for proving equality of functions.
+
+\SEEALSO
+EXT, X_FUN_EQ_CONV.
+
+\ENDDOC
\DOC{funpow}
\TYPE {\small\verb%funpow : (int -> (* -> *) -> * -> *)%}\egroup
@@ -9384,36 +9382,6 @@ number of times, the application of {\sm
\end{verbatim}
}
\ENDDOC
-\DOC{FUN\_EQ\_CONV}
-
-\TYPE {\small\verb%FUN_EQ_CONV : conv%}\egroup
-
-\SYNOPSIS
-Equates normal and extensional equality for two functions.
-
-\DESCRIBE
-The conversion {\small\verb%FUN_EQ_CONV%} embodies the fact that two functions are equal
-precisely when they give the same results for all values to which they can be
-applied. When supplied with a term argument of the form {\small\verb%f = g%}, where {\small\verb%f%} and
-{\small\verb%g%} are functions of type {\small\verb%ty1->ty2%}, {\small\verb%FUN_EQ_CONV%} returns the theorem:
-{\par\samepage\setseps\small
-\begin{verbatim}
- |- (f = g) = (!x. f x = g x)
-\end{verbatim}
-}
-\noindent where {\small\verb%x%} is a variable of type {\small\verb%ty1%} chosen by the conversion.
-
-\FAILURE
-{\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%}
-are functions.
-
-\USES
-Used for proving equality of functions.
-
-\SEEALSO
-EXT, X_FUN_EQ_CONV.
-
-\ENDDOC
\DOC{g}
\TYPE {\small\verb%g : (term -> void)%}\egroup
@@ -9454,120 +9422,6 @@ b, backup, backup_limit, e, expand, expa
rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
\ENDDOC
-\DOC{GEN}
-
-\TYPE {\small\verb%GEN : (term -> thm -> thm)%}\egroup
-
-\SYNOPSIS
-Generalizes the conclusion of a theorem.
-
-\DESCRIBE
-When applied to a term {\small\verb%x%} and a theorem {\small\verb%A |- t%}, the inference rule
-{\small\verb%GEN%} returns the theorem {\small\verb%A |- !x. t%}, provided {\small\verb%x%} is a variable not
-free in any of the assumptions. There is no compulsion that {\small\verb%x%} should
-be free in {\small\verb%t%}.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- t
- ------------ GEN "x" [where x is not free in A]
- A |- !x. t
-\end{verbatim}
-}
-\FAILURE
-Fails if {\small\verb%x%} is not a variable, or if it is free in any of the assumptions.
-
-\EXAMPLE
-The following example shows how the above side-condition prevents
-the derivation of the theorem {\small\verb%x=T |- !x. x=T%}, which is clearly invalid.
-{\par\samepage\setseps\small
-\begin{verbatim}
- #top_print print_all_thm;;
- - : (thm -> void)
-
- #let t = ASSUME "x=T";;
- t = x = T |- x = T
-
- #GEN "x:bool" t;;
- evaluation failed GEN
-\end{verbatim}
-}
-\SEEALSO
-GENL, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC.
-
-\ENDDOC
-\DOC{GENL}
-
-\TYPE {\small\verb%GENL : (term list -> thm -> thm)%}\egroup
-
-\SYNOPSIS
-Generalizes zero or more variables in the conclusion of a theorem.
-
-\DESCRIBE
-When applied to a term list {\small\verb%[x1;...;xn]%} and a theorem {\small\verb%A |- t%}, the inference
-rule {\small\verb%GENL%} returns the theorem {\small\verb%A |- !x1...xn. t%}, provided none of the
-variables {\small\verb%xi%} are free in any of the assumptions. It is not necessary that
-any or all of the {\small\verb%xi%} should be free in {\small\verb%t%}.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- t
- ------------------ GENL "[x1;...;xn]" [where no xi is free in A]
- A |- !x1...xn. t
-\end{verbatim}
-}
-\FAILURE
-Fails unless all the terms in the list are variables, none of which are
-free in the assumption list.
-
-\SEEALSO
-GEN, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC.
-
-\ENDDOC
-\DOC{genvar}
-
-\TYPE {\small\verb%genvar : (type -> term)%}\egroup
-
-\SYNOPSIS
-Returns a variable whose name has not been used previously.
-
-\DESCRIBE
-When given a type, {\small\verb%genvar%} returns a variable of that type whose name has
-not been used for a variable or constant in the HOL session so far.
-
-\FAILURE
-Never fails.
-
-\EXAMPLE
-The following indicates the typical stylized form of the names (this should
-not be relied on, of course):
-{\par\samepage\setseps\small
-\begin{verbatim}
- #genvar ":bool";;
- "GEN%VAR%357" : term
-
- #genvar ":num";;
- "GEN%VAR%358" : term
-\end{verbatim}
-}
-\noindent Trying to anticipate {\small\verb%genvar%} doesn't work:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #let v = mk_var(`GEN%VAR%359`,":bool");;
- v = "GEN%VAR%359" : term
-
- #genvar ":bool";;
- "GEN%VAR%360" : term
-\end{verbatim}
-}
-\USES
-The unique variables are useful in writing derived rules, for specializing
-terms without having to worry about such things as free variable capture.
-If the names are to be visible to a typical user, the function {\small\verb%variant%} can
-provide rather more meaningful names.
-
-\SEEALSO
-GSPEC, variant.
-
-\ENDDOC
\DOC{GEN\_ALL}
\TYPE {\small\verb%GEN_ALL : (thm -> thm)%}\egroup
@@ -9670,21 +9524,89 @@ the following, it acts in the same way a
pair, so {\small\verb%FST%} and {\small\verb%SND%} are introduced:
{\par\samepage\setseps\small
\begin{verbatim}
- #GEN_BETA_CONV "(\(x,y). x + y) numpair";;
- |- (\(x,y). x + y)numpair = (FST numpair) + (SND numpair)
+ #GEN_BETA_CONV "(\(x,y). x + y) numpair";;
+ |- (\(x,y). x + y)numpair = (FST numpair) + (SND numpair)
+\end{verbatim}
+}
+\noindent The introduction of {\small\verb%FST%} and {\small\verb%SND%} will be done more than once as
+necessary:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #GEN_BETA_CONV "(\(w,x,y,z). w + x + y + z) (1,triple)";;
+ |- (\(w,x,y,z). w + (x + (y + z)))(1,triple) =
+ 1 + ((FST triple) + ((FST(SND triple)) + (SND(SND triple))))
+\end{verbatim}
+}
+\SEEALSO
+BETA_CONV, PAIRED_BETA_CONV.
+
+\ENDDOC
+\DOC{GEN}
+
+\TYPE {\small\verb%GEN : (term -> thm -> thm)%}\egroup
+
+\SYNOPSIS
+Generalizes the conclusion of a theorem.
+
+\DESCRIBE
+When applied to a term {\small\verb%x%} and a theorem {\small\verb%A |- t%}, the inference rule
+{\small\verb%GEN%} returns the theorem {\small\verb%A |- !x. t%}, provided {\small\verb%x%} is a variable not
+free in any of the assumptions. There is no compulsion that {\small\verb%x%} should
+be free in {\small\verb%t%}.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- t
+ ------------ GEN "x" [where x is not free in A]
+ A |- !x. t
+\end{verbatim}
+}
+\FAILURE
+Fails if {\small\verb%x%} is not a variable, or if it is free in any of the assumptions.
+
+\EXAMPLE
+The following example shows how the above side-condition prevents
+the derivation of the theorem {\small\verb%x=T |- !x. x=T%}, which is clearly invalid.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #top_print print_all_thm;;
+ - : (thm -> void)
+
+ #let t = ASSUME "x=T";;
+ t = x = T |- x = T
+
+ #GEN "x:bool" t;;
+ evaluation failed GEN
\end{verbatim}
}
-\noindent The introduction of {\small\verb%FST%} and {\small\verb%SND%} will be done more than once as
-necessary:
+\SEEALSO
+GENL, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC.
+
+\ENDDOC
+\DOC{GENL}
+
+\TYPE {\small\verb%GENL : (term list -> thm -> thm)%}\egroup
+
+\SYNOPSIS
+Generalizes zero or more variables in the conclusion of a theorem.
+
+\DESCRIBE
+When applied to a term list {\small\verb%[x1;...;xn]%} and a theorem {\small\verb%A |- t%}, the inference
+rule {\small\verb%GENL%} returns the theorem {\small\verb%A |- !x1...xn. t%}, provided none of the
+variables {\small\verb%xi%} are free in any of the assumptions. It is not necessary that
+any or all of the {\small\verb%xi%} should be free in {\small\verb%t%}.
{\par\samepage\setseps\small
\begin{verbatim}
- #GEN_BETA_CONV "(\(w,x,y,z). w + x + y + z) (1,triple)";;
- |- (\(w,x,y,z). w + (x + (y + z)))(1,triple) =
- 1 + ((FST triple) + ((FST(SND triple)) + (SND(SND triple))))
+ A |- t
+ ------------------ GENL "[x1;...;xn]" [where no xi is free in A]
+ A |- !x1...xn. t
\end{verbatim}
}
+\FAILURE
+Fails unless all the terms in the list are variables, none of which are
+free in the assumption list.
+
\SEEALSO
-BETA_CONV, PAIRED_BETA_CONV.
+GEN, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC.
\ENDDOC
\DOC{GEN\_REWRITE\_CONV}
@@ -9976,28 +9898,51 @@ FILTER_GEN_TAC, GEN, GENL, GEN_ALL, SPEC
X_GEN_TAC.
\ENDDOC
-\DOC{getenv}
+\DOC{genvar}
-\TYPE {\small\verb%getenv : (string -> string)%}\egroup
+\TYPE {\small\verb%genvar : (type -> term)%}\egroup
\SYNOPSIS
-Returns the value of a Unix environment variable.
+Returns a variable whose name has not been used previously.
\DESCRIBE
-{\small\verb%getenv x%} returns the value of {\small\verb%x%} from the current environment list; this
-will include shell environment variables set before {\small\verb%HOL%} is run.
+When given a type, {\small\verb%genvar%} returns a variable of that type whose name has
+not been used for a variable or constant in the HOL session so far.
\FAILURE
-If in a Unix environment, fails with {\small\verb%getenv%} if the variable is undefined,
-or has an empty value. In other environments, it will normally fail anyway.
+Never fails.
\EXAMPLE
+The following indicates the typical stylized form of the names (this should
+not be relied on, of course):
{\par\samepage\setseps\small
\begin{verbatim}
-#getenv `SHELL`;;
-`/bin/csh` : string
+ #genvar ":bool";;
+ "GEN%VAR%357" : term
+
+ #genvar ":num";;
+ "GEN%VAR%358" : term
+\end{verbatim}
+}
+\noindent Trying to anticipate {\small\verb%genvar%} doesn't work:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #let v = mk_var(`GEN%VAR%359`,":bool");;
+ v = "GEN%VAR%359" : term
+
+ #genvar ":bool";;
+ "GEN%VAR%360" : term
\end{verbatim}
}
+\USES
+The unique variables are useful in writing derived rules, for specializing
+terms without having to worry about such things as free variable capture.
+If the names are to be visible to a typical user, the function {\small\verb%variant%} can
+provide rather more meaningful names.
+
+\SEEALSO
+GSPEC, variant.
+
\ENDDOC
\DOC{get\_const\_type}
@@ -10023,6 +9968,29 @@ Gets the generic type of a constant from
dest_const, is_constant.
\ENDDOC
+\DOC{getenv}
+
+\TYPE {\small\verb%getenv : (string -> string)%}\egroup
+
+\SYNOPSIS
+Returns the value of a Unix environment variable.
+
+\DESCRIBE
+{\small\verb%getenv x%} returns the value of {\small\verb%x%} from the current environment list; this
+will include shell environment variables set before {\small\verb%HOL%} is run.
+
+\FAILURE
+If in a Unix environment, fails with {\small\verb%getenv%} if the variable is undefined,
+or has an empty value. In other environments, it will normally fail anyway.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#getenv `SHELL`;;
+`/bin/csh` : string
+\end{verbatim}
+}
+\ENDDOC
\DOC{get\_flag\_value}
\TYPE {\small\verb%get_flag_value : (string -> bool)%}\egroup
@@ -10330,6 +10298,36 @@ variable is free in that function.
ETA_CONV, MK_ABS, MK_COMB, MK_EXISTS.
\ENDDOC
+\DOC{\char'136}
+
+\TYPE {\small\verb%$^ : (string -> string -> string)%}\egroup
+
+\SYNOPSIS
+Concatenates two ML strings.
+
+\DESCRIBE
+The {\small\verb%^%} is the ML infix string concatenation operator.
+If {\small\verb%s1%} and {\small\verb%s2%} are strings, then {\small\verb%s1^s2%} gives a string which is their
+concatenation.
+
+\FAILURE
+Never fails.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#`Hello `^`world`;;
+`Hello world` : string
+\end{verbatim}
+}
+\COMMENTS
+The ML role of the {\small\verb%^%} operator should not be confused with its use in
+quoted terms to introduce antiquotation (see DESCRIPTION for details).
+
+\SEEALSO
+concat, concatl.
+
+\ENDDOC
\DOC{hd}
\TYPE {\small\verb%hd : (* list -> *)%}\egroup
@@ -10544,36 +10542,6 @@ Never fails.
\#, B, C, CB, Co, K, KI, o, oo, S, W.
\ENDDOC
-\DOC{implode}
-
-\TYPE {\small\verb%implode : (string list -> string)%}\egroup
-
-\SYNOPSIS
-Converts a list of single-character strings into one string.
-
-\DESCRIBE
-{\small\verb%implode [s1;...;sn]%} returns the string formed by concatenating the
-single-character strings {\small\verb%s1 ... sn%}. If {\small\verb%n%} is zero (the list is empty),
-then the empty string is returned.
-
-\FAILURE
-Fails if any of the strings in the argument list are null or longer than one
-character.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#implode [`e`;`x`;`a`;`m`;`p`;`l`;`e`];;
-`example` : string
-
-#implode [`ex`;`a`;`mpl`;``;`e`];;
-evaluation failed implode
-\end{verbatim}
-}
-\SEEALSO
-explode, concat, concatl.
-
-\ENDDOC
\DOC{IMP\_ANTISYM\_RULE}
\TYPE {\small\verb%IMP_ANTISYM_RULE : (thm -> thm -> thm)%}\egroup
@@ -10680,6 +10648,36 @@ Fails unless the theorem is implicative.
NOT_INTRO, NOT_ELIM.
\ENDDOC
+\DOC{implode}
+
+\TYPE {\small\verb%implode : (string list -> string)%}\egroup
+
+\SYNOPSIS
+Converts a list of single-character strings into one string.
+
+\DESCRIBE
+{\small\verb%implode [s1;...;sn]%} returns the string formed by concatenating the
+single-character strings {\small\verb%s1 ... sn%}. If {\small\verb%n%} is zero (the list is empty),
+then the empty string is returned.
+
+\FAILURE
+Fails if any of the strings in the argument list are null or longer than one
+character.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#implode [`e`;`x`;`a`;`m`;`p`;`l`;`e`];;
+`example` : string
+
+#implode [`ex`;`a`;`mpl`;``;`e`];;
+evaluation failed implode
+\end{verbatim}
+}
+\SEEALSO
+explode, concat, concatl.
+
+\ENDDOC
\DOC{IMP\_RES\_TAC}
\TYPE {\small\verb%IMP_RES_TAC : thm_tactic%}\egroup
@@ -11193,43 +11191,73 @@ y = inr 12 : (string + int)
inl, isl, outl, outr.
\ENDDOC
-\DOC{INST}
+\DOC{install}
-\TYPE {\small\verb%INST : ((term # term) list -> thm -> thm)%}\egroup
+\TYPE {\small\verb%install : (string -> void)%}\egroup
\SYNOPSIS
-Instantiates free variables in a theorem.
+Informs HOL of the absolute pathname to the hol distribution directory.
\DESCRIBE
-{\small\verb%INST%} is a rule for substituting arbitrary terms for free variables
-in a theorem:
+{\small\verb%install%} reconfigures a running HOL system to a new root directory. The
+string argument to {\small\verb%install%} should be the absolute path name to the
+directory in which the HOL system is located. Executing
{\par\samepage\setseps\small
\begin{verbatim}
- A |- t
- ----------------------------- INST [(t1,x1);...;(tn,xn)]
- A |- t[t1,...,tn/x1,...,xn]
+ install `/dir1/dir2/dir3/.../hol`;;
\end{verbatim}
}
-\noindent where the variables {\small\verb%x1, ..., xn%} are not free in the
-assumptions {\small\verb%A%}.
+\noindent sets the internal HOL search path to:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ [``; `~/`; `/dir1/dir2/dir3/.../hol/theories/`]
+\end{verbatim}
+}
+\noindent In addition, {\small\verb%install%} sets the internal search path used by HOL to
+find the standard online help files and the internal search path used by HOL to
+find libraries.
\FAILURE
-{\small\verb%INST%} fails if a variable being instantiated is free in the
-assumptions.
+Never fails.
-\EXAMPLE
-In the following example a theorem is instantiated for a specific term:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #CONJUNCT1 ADD_CLAUSES ;;
- |- 0 + m = m
+\COMMENTS
+The effect persists only for the current HOL session. To change the image
+permanently, use the {\small\verb%save%} function after installation.
- #INST [("2 * x","m:num")] (CONJUNCT1 ADD_CLAUSES) ;;
- |- 0 + (2 * x) = 2 * x
+\SEEALSO
+help_search_path, library_pathname, library_search_path, search_path,
+set_help_search_path, set_library_search_path, set_search_path.
+
+\ENDDOC
+\DOC{inst\_check}
+
+\TYPE {\small\verb%inst_check : (((type # type) list # term list) -> term list)%}\egroup
+
+\SYNOPSIS
+Checks the validity of type instantiations.
+
+\DESCRIBE
+If the {\small\verb%t1...tn%} are types (monomorphic or polymorphic), the {\small\verb%v1...vn%} type
+variables (e.g. {\small\verb%":*"%}), and {\small\verb%tm1...tmn%} terms, the call
+{\par\samepage\setseps\small
+\begin{verbatim}
+ inst_check ([(t1,v1);...;(tn,vn)],[tm1;...;tmn])
\end{verbatim}
}
+\noindent will return a list of the variables free in the {\small\verb%tm1...tmn%}, provided
+none of the type variables {\small\verb%v1...vn%} are free in {\small\verb%tm1...tmn%}. If this condition
+is not met, or any of the {\small\verb%v%}'s are not simply type variables, the call fails.
+
+\FAILURE
+Fails if any of the {\small\verb%v%}'s are not simple type variables, or if any of them are
+free in the terms {\small\verb%v1...vn%}.
+
+\USES
+Checking the validity of type instantiations (for example, if the terms are the
+hypotheses of a theorem).
+
\SEEALSO
-INST_TY_TERM, INST_TYPE, ISPEC, ISPECL, SPEC; SPECL, SUBS, subst, SUBST.
+inst, inst_rename_list, inst_type, INST_TYPE.
\ENDDOC
\DOC{inst}
@@ -11281,73 +11309,43 @@ Performing internal functions connected
inst_check, inst_rename_list, inst_type, INST_TYPE.
\ENDDOC
-\DOC{install}
+\DOC{INST}
-\TYPE {\small\verb%install : (string -> void)%}\egroup
+\TYPE {\small\verb%INST : ((term # term) list -> thm -> thm)%}\egroup
\SYNOPSIS
-Informs HOL of the absolute pathname to the hol distribution directory.
+Instantiates free variables in a theorem.
\DESCRIBE
-{\small\verb%install%} reconfigures a running HOL system to a new root directory. The
-string argument to {\small\verb%install%} should be the absolute path name to the
-directory in which the HOL system is located. Executing
-{\par\samepage\setseps\small
-\begin{verbatim}
- install `/dir1/dir2/dir3/.../hol`;;
-\end{verbatim}
-}
-\noindent sets the internal HOL search path to:
+{\small\verb%INST%} is a rule for substituting arbitrary terms for free variables
+in a theorem:
{\par\samepage\setseps\small
\begin{verbatim}
- [``; `~/`; `/dir1/dir2/dir3/.../hol/theories/`]
+ A |- t
+ ----------------------------- INST [(t1,x1);...;(tn,xn)]
+ A |- t[t1,...,tn/x1,...,xn]
\end{verbatim}
}
-\noindent In addition, {\small\verb%install%} sets the internal search path used by HOL to
-find the standard online help files and the internal search path used by HOL to
-find libraries.
+\noindent where the variables {\small\verb%x1, ..., xn%} are not free in the
+assumptions {\small\verb%A%}.
\FAILURE
-Never fails.
-
-\COMMENTS
-The effect persists only for the current HOL session. To change the image
-permanently, use the {\small\verb%save%} function after installation.
-
-\SEEALSO
-help_search_path, library_pathname, library_search_path, search_path,
-set_help_search_path, set_library_search_path, set_search_path.
-
-\ENDDOC
-\DOC{inst\_check}
-
-\TYPE {\small\verb%inst_check : (((type # type) list # term list) -> term list)%}\egroup
-
-\SYNOPSIS
-Checks the validity of type instantiations.
+{\small\verb%INST%} fails if a variable being instantiated is free in the
+assumptions.
-\DESCRIBE
-If the {\small\verb%t1...tn%} are types (monomorphic or polymorphic), the {\small\verb%v1...vn%} type
-variables (e.g. {\small\verb%":*"%}), and {\small\verb%tm1...tmn%} terms, the call
+\EXAMPLE
+In the following example a theorem is instantiated for a specific term:
{\par\samepage\setseps\small
\begin{verbatim}
- inst_check ([(t1,v1);...;(tn,vn)],[tm1;...;tmn])
+ #CONJUNCT1 ADD_CLAUSES ;;
+ |- 0 + m = m
+
+ #INST [("2 * x","m:num")] (CONJUNCT1 ADD_CLAUSES) ;;
+ |- 0 + (2 * x) = 2 * x
\end{verbatim}
}
-\noindent will return a list of the variables free in the {\small\verb%tm1...tmn%}, provided
-none of the type variables {\small\verb%v1...vn%} are free in {\small\verb%tm1...tmn%}. If this condition
-is not met, or any of the {\small\verb%v%}'s are not simply type variables, the call fails.
-
-\FAILURE
-Fails if any of the {\small\verb%v%}'s are not simple type variables, or if any of them are
-free in the terms {\small\verb%v1...vn%}.
-
-\USES
-Checking the validity of type instantiations (for example, if the terms are the
-hypotheses of a theorem).
-
\SEEALSO
-inst, inst_rename_list, inst_type, INST_TYPE.
+INST_TY_TERM, INST_TYPE, ISPEC, ISPECL, SPEC; SPECL, SUBS, subst, SUBST.
\ENDDOC
\DOC{inst\_rename\_list}
@@ -11395,6 +11393,51 @@ Checking the validity of type instantiat
inst, inst_check, inst_type, INST_TYPE.
\ENDDOC
+\DOC{inst\_type}
+
+\TYPE {\small\verb%inst_type : ((type # type) list -> type -> type)%}\egroup
+
+\SYNOPSIS
+Instantiates types in a type.
+
+\DESCRIBE
+If {\small\verb%[(t1',t1);...;(tn',tn)]%} is a list of type instantiations, where {\small\verb%t1...tn%}
+are the initial types, and {\small\verb%t1'...tn'%} the desired instantiations, and {\small\verb%ty%} is
+a type to instantiate, the call
+{\par\samepage\setseps\small
+\begin{verbatim}
+ inst_type [(t1',t1);...;(tn',tn)] ty
+\end{verbatim}
+}
+\noindent will appropriately instantiate the type {\small\verb%ty%}. The instantiations will
+be performed in parallel. If several of the type instantiations are applicable,
+the choice is undefined. In normal use the {\small\verb%t1...tn%} are type variables,
+although this is not essential. Neither is it necessary that any or all of the
+types {\small\verb%t1...tn%} should in fact appear in {\small\verb%ty%}.
+
+\FAILURE
+Never fails.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#inst_type [(":bool",":*")] ":* # **";;
+":bool # **" : type
+
+#inst_type [(":num",":* # **"); (":bool",":*")] ":* # **";;
+":num" : type
+
+#inst_type [(":bool",":*"); (":num",":* # **")] ":* # **";;
+":num" : type
+
+#inst_type [(":bool",":num"); (":num",":bool")] ":(bool)list";;
+":(num)list" : type
+\end{verbatim}
+}
+\SEEALSO
+inst, inst_check, inst_type, INST_TYPE.
+
+\ENDDOC
\DOC{INST\_TYPE}
\TYPE {\small\verb%INST_TYPE : ((type # type) list -> thm -> thm)%}\egroup
@@ -11446,51 +11489,6 @@ The desired specialization can be obtain
INST, INST_TY_TERM.
\ENDDOC
-\DOC{inst\_type}
-
-\TYPE {\small\verb%inst_type : ((type # type) list -> type -> type)%}\egroup
-
-\SYNOPSIS
-Instantiates types in a type.
-
-\DESCRIBE
-If {\small\verb%[(t1',t1);...;(tn',tn)]%} is a list of type instantiations, where {\small\verb%t1...tn%}
-are the initial types, and {\small\verb%t1'...tn'%} the desired instantiations, and {\small\verb%ty%} is
-a type to instantiate, the call
-{\par\samepage\setseps\small
-\begin{verbatim}
- inst_type [(t1',t1);...;(tn',tn)] ty
-\end{verbatim}
-}
-\noindent will appropriately instantiate the type {\small\verb%ty%}. The instantiations will
-be performed in parallel. If several of the type instantiations are applicable,
-the choice is undefined. In normal use the {\small\verb%t1...tn%} are type variables,
-although this is not essential. Neither is it necessary that any or all of the
-types {\small\verb%t1...tn%} should in fact appear in {\small\verb%ty%}.
-
-\FAILURE
-Never fails.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#inst_type [(":bool",":*")] ":* # **";;
-":bool # **" : type
-
-#inst_type [(":num",":* # **"); (":bool",":*")] ":* # **";;
-":num" : type
-
-#inst_type [(":bool",":*"); (":num",":* # **")] ":* # **";;
-":num" : type
-
-#inst_type [(":bool",":num"); (":num",":bool")] ":(bool)list";;
-":(num)list" : type
-\end{verbatim}
-}
-\SEEALSO
-inst, inst_check, inst_type, INST_TYPE.
-
-\ENDDOC
\DOC{INST\_TY\_TERM}
\TYPE {\small\verb%INST_TY_TERM : (((term # term) list # (type # type) list) -> thm -> thm)%}\egroup
@@ -11583,105 +11581,25 @@ ascii, ascii_code, string_of_int.
\TYPE {\small\verb%int_of_term : (term -> int)%}\egroup
\SYNOPSIS
-Maps a numeric term to the corresponding ML integer.
-
-\DESCRIBE
-Given a term representing a natural number, i.e., of type {\small\verb%:num%}
-{\small\verb%int_of_term%} returns the corresponding ML integer constant.
-
-\FAILURE
-Never fails.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
- #int_of_term "2";;
- 2 : int
-\end{verbatim}
-}
-
-\SEEALSO
-term_of_int, string_of_int, int_of_string.
-
-\ENDDOC
-\DOC{isl}
-
-\TYPE {\small\verb%isl : ((* + **) -> bool)%}\egroup
-
-\SYNOPSIS
-Tests for membership of left summand.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#let x = inl 1 and y = inr 2;;
-
-#isl x;;
-true : bool
-
-#isl y;;
-false : bool
-\end{verbatim}
-}
-\SEEALSO
-inl, inr
-
-\ENDDOC
-\DOC{ISPEC}
-
-\TYPE {\small\verb%ISPEC : (term -> thm -> thm)%}\egroup
-
-\SYNOPSIS
-Specializes a theorem, with type instantiation if necessary.
-
-\DESCRIBE
-This rule specializes a quantified variable as does {\small\verb%SPEC%}; it differs
-from it in also instantiating the type if needed:
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- !x:ty.tm
- ----------------------- ISPEC "t:ty'"
- A |- tm[t/x]
-\end{verbatim}
-}
-\noindent (where {\small\verb%t%} is free for {\small\verb%x%} in {\small\verb%tm%}, and {\small\verb%ty'%} is an instance
-of {\small\verb%ty%}).
-
-\FAILURE
-{\small\verb%ISPEC%} fails if the input theorem is not universally quantified, if
-the type of the given term is not an instance of the type of the
-quantified variable, or if the type variable is free in the
-assumptions.
-
-\SEEALSO
-INST_TY_TERM, INST_TYPE, ISPECL, SPEC, match.
-
-\ENDDOC
-\DOC{ISPECL}
-
-\TYPE {\small\verb%ISPECL : (term list -> thm -> thm)%}\egroup
-
-\SYNOPSIS
-Specializes a theorem zero or more times, with type instantiation if necessary.
+Maps a numeric term to the corresponding ML integer.
\DESCRIBE
-{\small\verb%ISPECL%} is an iterative version of {\small\verb%ISPEC%}
+Given a term representing a natural number, i.e., of type {\small\verb%:num%}
+{\small\verb%int_of_term%} returns the corresponding ML integer constant.
+
+\FAILURE
+Never fails.
+
+\EXAMPLE
{\par\samepage\setseps\small
\begin{verbatim}
- A |- !x1...xn.t
- ---------------------------- ISPECL ["t1",...,"tn"]
- A |- t[t1,...tn/x1,...,xn]
+ #int_of_term "2";;
+ 2 : int
\end{verbatim}
}
-\noindent (where {\small\verb%ti%} is free for {\small\verb%xi%} in {\small\verb%tm%}).
-
-\FAILURE
-{\small\verb%ISPECL%} fails if the list of terms is longer than the number of
-quantified variables in the term, if the type instantiation fails, or
-if the type variable being instantiated is free in the assumptions.
\SEEALSO
-INST_TYPE, INST_TY_TERM, ISPEC, MATCH, SPEC, SPECL.
+term_of_int, string_of_int, int_of_string.
\ENDDOC
\DOC{is\_abs}
@@ -11896,24 +11814,6 @@ Never fails.
mk_cons, dest_cons, mk_list, dest_list, is_list.
\ENDDOC
-\DOC{is\_const}
-
-\TYPE {\small\verb%is_const : (term -> bool)%}\egroup
-
-\SYNOPSIS
-Tests a term to see if it is a constant.
-
-\DESCRIBE
-{\small\verb%is_const "const:ty"%} returns {\small\verb%true%}. If the term is not a constant the
-result is {\small\verb%false%}.
-
-\FAILURE
-Never fails.
-
-\SEEALSO
-mk_const, dest_const, is_var, is_comb, is_abs.
-
-\ENDDOC
\DOC{is\_constant}
\TYPE {\small\verb%is_constant : (string -> bool)%}\egroup
@@ -11949,6 +11849,24 @@ false : bool
is_infix, is_binder
\ENDDOC
+\DOC{is\_const}
+
+\TYPE {\small\verb%is_const : (term -> bool)%}\egroup
+
+\SYNOPSIS
+Tests a term to see if it is a constant.
+
+\DESCRIBE
+{\small\verb%is_const "const:ty"%} returns {\small\verb%true%}. If the term is not a constant the
+result is {\small\verb%false%}.
+
+\FAILURE
+Never fails.
+
+\SEEALSO
+mk_const, dest_const, is_var, is_comb, is_abs.
+
+\ENDDOC
\DOC{is\_definition}
\TYPE {\small\verb%is_definition : (term -> bool)%}\egroup
@@ -12210,6 +12128,29 @@ false : bool
is_infix, is_type, is_binder_type
\ENDDOC
+\DOC{isl}
+
+\TYPE {\small\verb%isl : ((* + **) -> bool)%}\egroup
+
+\SYNOPSIS
+Tests for membership of left summand.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#let x = inl 1 and y = inr 2;;
+
+#isl x;;
+true : bool
+
+#isl y;;
+false : bool
+\end{verbatim}
+}
+\SEEALSO
+inl, inr
+
+\ENDDOC
\DOC{is\_let}
\TYPE {\small\verb%is_let : (term -> bool)%}\egroup
@@ -12407,6 +12348,63 @@ Never fails.
mk_pair, dest_pair.
\ENDDOC
+\DOC{ISPEC}
+
+\TYPE {\small\verb%ISPEC : (term -> thm -> thm)%}\egroup
+
+\SYNOPSIS
+Specializes a theorem, with type instantiation if necessary.
+
+\DESCRIBE
+This rule specializes a quantified variable as does {\small\verb%SPEC%}; it differs
+from it in also instantiating the type if needed:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- !x:ty.tm
+ ----------------------- ISPEC "t:ty'"
+ A |- tm[t/x]
+\end{verbatim}
+}
+\noindent (where {\small\verb%t%} is free for {\small\verb%x%} in {\small\verb%tm%}, and {\small\verb%ty'%} is an instance
+of {\small\verb%ty%}).
+
+\FAILURE
+{\small\verb%ISPEC%} fails if the input theorem is not universally quantified, if
+the type of the given term is not an instance of the type of the
+quantified variable, or if the type variable is free in the
+assumptions.
+
+\SEEALSO
+INST_TY_TERM, INST_TYPE, ISPECL, SPEC, match.
+
+\ENDDOC
+\DOC{ISPECL}
+
+\TYPE {\small\verb%ISPECL : (term list -> thm -> thm)%}\egroup
+
+\SYNOPSIS
+Specializes a theorem zero or more times, with type instantiation if necessary.
+
+\DESCRIBE
+{\small\verb%ISPECL%} is an iterative version of {\small\verb%ISPEC%}
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- !x1...xn.t
+ ---------------------------- ISPECL ["t1",...,"tn"]
+ A |- t[t1,...tn/x1,...,xn]
+\end{verbatim}
+}
+\noindent (where {\small\verb%ti%} is free for {\small\verb%xi%} in {\small\verb%tm%}).
+
+\FAILURE
+{\small\verb%ISPECL%} fails if the list of terms is longer than the number of
+quantified variables in the term, if the type instantiation fails, or
+if the type variable being instantiated is free in the assumptions.
+
+\SEEALSO
+INST_TYPE, INST_TY_TERM, ISPEC, MATCH, SPEC, SPECL.
+
+\ENDDOC
\DOC{is\_pred}
\TYPE {\small\verb%is_pred : (term -> bool)%}\egroup
@@ -12580,65 +12578,65 @@ Used in evaluating expressions that requ
expression.
\ENDDOC
-\DOC{itlist}
+\DOC{itlist2}
-\TYPE {\small\verb%itlist : ((* -> ** -> **) -> * list -> ** -> **)%}\egroup
+\TYPE {\small\verb%itlist2 : (((* # **) -> *** -> ***) -> (* list # ** list) -> *** -> ***)%}\egroup
\SYNOPSIS
-List iteration function. Applies a binary function between adjacent elements
-of a list.
+Applies a paired function between adjacent elements of 2 lists.
\DESCRIBE
-{\small\verb%itlist f [x1;...;xn] y%} returns
+{\small\verb%itlist2 f ([x1;...;xn],[y1;...;yn]) z%} returns
{\par\samepage\setseps\small
\begin{verbatim}
- f x1 (f x2 ... (f xn y)...)
+ f (x1,y1) (f (x2,y2) ... (f (xn,yn) z)...)
\end{verbatim}
}
-\noindent It returns {\small\verb%y%} if list is empty.
+\noindent It returns {\small\verb%z%} if both lists are empty.
\FAILURE
-Never fails.
+Fails with {\small\verb%itlist2%} if the two lists are of different lengths.
\EXAMPLE
{\par\samepage\setseps\small
\begin{verbatim}
-#itlist (\x y. x + y) [1;2;3;4] 0;;
-10 : int
+#itlist2 (\(x,y) z. (x * y) + z) ([1;2],[3;4]) 0;;
+11 : int
\end{verbatim}
}
\SEEALSO
-rev_itlist, end_itlist.
+itlist, rev_itlist, end_itlist, uncurry.
\ENDDOC
-\DOC{itlist2}
+\DOC{itlist}
-\TYPE {\small\verb%itlist2 : (((* # **) -> *** -> ***) -> (* list # ** list) -> *** -> ***)%}\egroup
+\TYPE {\small\verb%itlist : ((* -> ** -> **) -> * list -> ** -> **)%}\egroup
\SYNOPSIS
-Applies a paired function between adjacent elements of 2 lists.
+List iteration function. Applies a binary function between adjacent elements
+of a list.
\DESCRIBE
-{\small\verb%itlist2 f ([x1;...;xn],[y1;...;yn]) z%} returns
+{\small\verb%itlist f [x1;...;xn] y%} returns
{\par\samepage\setseps\small
\begin{verbatim}
- f (x1,y1) (f (x2,y2) ... (f (xn,yn) z)...)
+ f x1 (f x2 ... (f xn y)...)
\end{verbatim}
}
-\noindent It returns {\small\verb%z%} if both lists are empty.
+\noindent It returns {\small\verb%y%} if list is empty.
\FAILURE
-Fails with {\small\verb%itlist2%} if the two lists are of different lengths.
+Never fails.
\EXAMPLE
{\par\samepage\setseps\small
\begin{verbatim}
-#itlist2 (\(x,y) z. (x * y) + z) ([1;2],[3;4]) 0;;
-11 : int
+#itlist (\x y. x + y) [1;2;3;4] 0;;
+10 : int
\end{verbatim}
}
\SEEALSO
-itlist, rev_itlist, end_itlist, uncurry.
+rev_itlist, end_itlist.
\ENDDOC
\DOC{K}
@@ -12672,6 +12670,34 @@ Never fails.
\#, B, C, CB, Co, I, K, o, oo, S, W.
\ENDDOC
+\DOC{LAST\_CONV}
+
+\TYPE {\small\verb%LAST_CONV : conv%}\egroup
+
+\SYNOPSIS
+Computes by inference the result of taking the last element of a list.
+
+\DESCRIBE
+For any object language list of the form {\small\verb%"[x0;...x(n-1)]"%} ,
+the result of evaluating
+{\par\samepage\setseps\small
+\begin{verbatim}
+ LAST_CONV "LAST [x0;...;x(n-1)]"
+\end{verbatim}
+}
+\noindent is the theorem
+{\par\samepage\setseps\small
+\begin{verbatim}
+ |- LAST [x0;...;x(n-1)] = x(n-1)
+\end{verbatim}
+}
+
+
+\FAILURE
+{\small\verb%LAST_CONV tm%} fails if {\small\verb%tm%} is an empty list.
+
+\ENDDOC
+
\DOC{last}
\TYPE {\small\verb%last : (* list -> *)%}\egroup
@@ -12718,34 +12744,6 @@ or {\small\verb%k%} is greater than the
\ENDDOC
-\DOC{LAST\_CONV}
-
-\TYPE {\small\verb%LAST_CONV : conv%}\egroup
-
-\SYNOPSIS
-Computes by inference the result of taking the last element of a list.
-
-\DESCRIBE
-For any object language list of the form {\small\verb%"[x0;...x(n-1)]"%} ,
-the result of evaluating
-{\par\samepage\setseps\small
-\begin{verbatim}
- LAST_CONV "LAST [x0;...;x(n-1)]"
-\end{verbatim}
-}
-\noindent is the theorem
-{\par\samepage\setseps\small
-\begin{verbatim}
- |- LAST [x0;...;x(n-1)] = x(n-1)
-\end{verbatim}
-}
-
-
-\FAILURE
-{\small\verb%LAST_CONV tm%} fails if {\small\verb%tm%} is an empty list.
-
-\ENDDOC
-
\DOC{LEFT\_AND\_EXISTS\_CONV}
\TYPE {\small\verb%LEFT_AND_EXISTS_CONV : conv%}\egroup
@@ -12902,17 +12900,6 @@ Fails if applied to a term not of the fo
OR_FORALL_CONV, FORALL_OR_CONV, RIGHT_OR_FORALL_CONV.
\ENDDOC
-\DOC{length}
-
-\TYPE {\small\verb%length : (* list -> int)%}\egroup
-
-\SYNOPSIS
-Computes the length of a list: {\small\verb%length [x1;...;xn]%} returns {\small\verb%n%}.
-
-\FAILURE
-Never fails.
-
-\ENDDOC
\DOC{LENGTH\_CONV}
\TYPE {\small\verb%LENGTH_CONV : conv%}\egroup
@@ -12938,8 +12925,19 @@ For any object language list of the form
list.
\FAILURE
-{\small\verb%LENGTH_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"LENGTH [x1;x2;...;xn]"%} or
-{\small\verb%"LENGTH []"%}.
+{\small\verb%LENGTH_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"LENGTH [x1;x2;...;xn]"%} or
+{\small\verb%"LENGTH []"%}.
+
+\ENDDOC
+\DOC{length}
+
+\TYPE {\small\verb%length : (* list -> int)%}\egroup
+
+\SYNOPSIS
+Computes the length of a list: {\small\verb%length [x1;...;xn]%} returns {\small\verb%n%}.
+
+\FAILURE
+Never fails.
\ENDDOC
\DOC{let\_after}
@@ -13418,6 +13416,25 @@ systems.
system, unlink.
\ENDDOC
+\DOC{lisp\_dir\_pathname}
+
+\TYPE {\small\verb%lisp_dir_pathname : string%}\egroup
+
+\SYNOPSIS
+Absolute pathname to the HOL lisp sources.
+
+\DESCRIBE
+For implementation reasons, the ML variable {\small\verb%lisp_dir_pathname%} is bound when
+the system if built to a string giving the absolute pathname of the directory
+containing the HOL lisp sources. This value is not for general use.
+
+\FAILURE
+Evaluating {\small\verb%lisp_dir_pathname%} never fails.
+
+\SEEALSO
+ml_dir_pathname.
+
+\ENDDOC
\DOC{lisp}
\TYPE {\small\verb%lisp : (string -> void)%}\egroup
@@ -13464,25 +13481,6 @@ using it.
dropout, lsp.
\ENDDOC
-\DOC{lisp\_dir\_pathname}
-
-\TYPE {\small\verb%lisp_dir_pathname : string%}\egroup
-
-\SYNOPSIS
-Absolute pathname to the HOL lisp sources.
-
-\DESCRIBE
-For implementation reasons, the ML variable {\small\verb%lisp_dir_pathname%} is bound when
-the system if built to a string giving the absolute pathname of the directory
-containing the HOL lisp sources. This value is not for general use.
-
-\FAILURE
-Evaluating {\small\verb%lisp_dir_pathname%} never fails.
-
-\SEEALSO
-ml_dir_pathname.
-
-\ENDDOC
\DOC{LIST\_BETA\_CONV}
\TYPE {\small\verb%LIST_BETA_CONV : conv%}\egroup
@@ -13855,6 +13853,28 @@ evaluation failed list_mk_disj
disjuncts, mk_disj.
\ENDDOC
+\DOC{list\_mk\_exists}
+
+\TYPE {\small\verb%list_mk_exists : ((term list # term) -> term)%}\egroup
+
+\SYNOPSIS
+Iteratively constructs existential quantifications.
+
+\DESCRIBE
+{\small\verb%list_mk_exists(["x1";...;"xn"],"t")%} returns {\small\verb%"?x1 ... xn. t"%}.
+
+\FAILURE
+Fails with {\small\verb%list_mk_exists%} if the terms in the list are not variables or if
+{\small\verb%t%} is not of type {\small\verb%":bool"%} and the list of terms is non-empty. If the list
+of terms is empty the type of {\small\verb%t%} can be anything.
+
+\COMMENTS
+The system shows the type as {\small\verb%(goal -> term)%}.
+
+\SEEALSO
+strip_exists, mk_exists.
+
+\ENDDOC
\DOC{LIST\_MK\_EXISTS}
\TYPE {\small\verb%LIST_MK_EXISTS : (term list -> thm -> thm)%}\egroup
@@ -13884,28 +13904,6 @@ list, or if the theorem is not equationa
EXISTS_EQ, MK_EXISTS.
\ENDDOC
-\DOC{list\_mk\_exists}
-
-\TYPE {\small\verb%list_mk_exists : ((term list # term) -> term)%}\egroup
-
-\SYNOPSIS
-Iteratively constructs existential quantifications.
-
-\DESCRIBE
-{\small\verb%list_mk_exists(["x1";...;"xn"],"t")%} returns {\small\verb%"?x1 ... xn. t"%}.
-
-\FAILURE
-Fails with {\small\verb%list_mk_exists%} if the terms in the list are not variables or if
-{\small\verb%t%} is not of type {\small\verb%":bool"%} and the list of terms is non-empty. If the list
-of terms is empty the type of {\small\verb%t%} can be anything.
-
-\COMMENTS
-The system shows the type as {\small\verb%(goal -> term)%}.
-
-\SEEALSO
-strip_exists, mk_exists.
-
-\ENDDOC
\DOC{list\_mk\_forall}
\TYPE {\small\verb%list_mk_forall : ((term list # term) -> term)%}\egroup
@@ -14035,115 +14033,6 @@ is not for general use, and users should
Evaluating the assignable variable {\small\verb%list_of_binders%} never fails.
\ENDDOC
-\DOC{load}
-
-\TYPE {\small\verb%load : ((string # bool) -> void)%}\egroup
-
-\SYNOPSIS
-Loads ML phrases from the named file.
-
-\DESCRIBE
-A call {\small\verb%load(`file`,flag)%} will load ML phrases from the file described by
-{\small\verb%file%}. If the boolean value {\small\verb%flag%} is true, then toplevel printing of the
-system responses will occur, otherwise just a dot is printed for each toplevel
-phrase. The name {\small\verb%file%} is expanded into a real filename using the same
-mechanism as {\small\verb%find_ml_file%}.
-
-\FAILURE
-Fails if the appropriate file cannot be found on the search path, or if an
-error occurs in the ML which is being loaded.
-
-\COMMENTS
-It is usual to use either {\small\verb%loadf%} or {\small\verb%loadt%} rather than this function, which
-perform the same action with one or the other setting of the flag.
-
-\SEEALSO
-find_ml_file, loadf, loadt, search_path, set_search_path.
-
-\ENDDOC
-\DOC{loadf}
-
-\TYPE {\small\verb%loadf : (string -> void)%}\egroup
-
-\SYNOPSIS
-Loads an ML file with the verbose flag set to {\small\verb%false%}.
-
-\DESCRIBE
-The function {\small\verb%loadf%} takes a string indicating the ML file name as
-argument and loads it in the same manner as {\small\verb%load%}, except that the
-verbose flag is always set to false.
-
-\FAILURE
-{\small\verb%loadf%} will fail if the file named by the argument does not exist in
-the search path. It will fail in the same manner if the file is not a
-valid ML file. Failure in the ML file will terminate loading.
-
-\EXAMPLE
-If we have a ML file called {\small\verb%foo.ml%} which contains the line
-{\par\samepage\setseps\small
-\begin{verbatim}
- let x=2+2;;
-\end{verbatim}
-}
-\noindent this can be loaded as follows:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #loadf `foo.ml`;;
-\end{verbatim}
-}
-\noindent and the system would respond with:
-{\par\samepage\setseps\small
-\begin{verbatim}
- .() : void
-\end{verbatim}
-}
-\SEEALSO
-load, loadf.
-
-\ENDDOC
-\DOC{loadt}
-
-\TYPE {\small\verb%loadt : (string -> void)%}\egroup
-
-\SYNOPSIS
-{\small\verb%loadt%} loads an ML file with the verbose flag set to {\small\verb%true%}.
-
-\DESCRIBE
-The function {\small\verb%loadt%} takes a string indicating the ML file name as
-argument and loads it in the same manner as {\small\verb%load%}, except that the
-verbose flag is always set to {\small\verb%true%}.
-
-\FAILURE
-{\small\verb%loadt%} will fail if the file named by the argument does not exist in
-the search path. It will fail in the same manner if the file is not a
-valid ML file. Failure in the ML file will also terminate loading.
-
-\EXAMPLE
-If we have an ML file called {\small\verb%foo.ml%} which contains the line
-{\par\samepage\setseps\small
-\begin{verbatim}
- let x=2+2;;
-\end{verbatim}
-}
-\noindent this can be loaded as follows:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #loadt `foo.ml`;;
-\end{verbatim}
-}
-\noindent and the system would respond with:
-{\par\samepage\setseps\small
-\begin{verbatim}
- x = 4 : int
-
- File foo.ml loaded
- () : void
-\end{verbatim}
-}
-\SEEALSO
-load, loadf.
-
-\ENDDOC
\DOC{load\_axiom}
\TYPE {\small\verb%load_axiom : (string -> string -> void)%}\egroup
@@ -14320,7 +14209,73 @@ o_DEF = |- !f g. f o g = (\x. f(g x))
\end{verbatim}
}
\SEEALSO
-definitions, let_after, let_before, load_definition.
+definitions, let_after, let_before, load_definition.
+
+\ENDDOC
+\DOC{load}
+
+\TYPE {\small\verb%load : ((string # bool) -> void)%}\egroup
+
+\SYNOPSIS
+Loads ML phrases from the named file.
+
+\DESCRIBE
+A call {\small\verb%load(`file`,flag)%} will load ML phrases from the file described by
+{\small\verb%file%}. If the boolean value {\small\verb%flag%} is true, then toplevel printing of the
+system responses will occur, otherwise just a dot is printed for each toplevel
+phrase. The name {\small\verb%file%} is expanded into a real filename using the same
+mechanism as {\small\verb%find_ml_file%}.
+
+\FAILURE
+Fails if the appropriate file cannot be found on the search path, or if an
+error occurs in the ML which is being loaded.
+
+\COMMENTS
+It is usual to use either {\small\verb%loadf%} or {\small\verb%loadt%} rather than this function, which
+perform the same action with one or the other setting of the flag.
+
+\SEEALSO
+find_ml_file, loadf, loadt, search_path, set_search_path.
+
+\ENDDOC
+\DOC{loadf}
+
+\TYPE {\small\verb%loadf : (string -> void)%}\egroup
+
+\SYNOPSIS
+Loads an ML file with the verbose flag set to {\small\verb%false%}.
+
+\DESCRIBE
+The function {\small\verb%loadf%} takes a string indicating the ML file name as
+argument and loads it in the same manner as {\small\verb%load%}, except that the
+verbose flag is always set to false.
+
+\FAILURE
+{\small\verb%loadf%} will fail if the file named by the argument does not exist in
+the search path. It will fail in the same manner if the file is not a
+valid ML file. Failure in the ML file will terminate loading.
+
+\EXAMPLE
+If we have a ML file called {\small\verb%foo.ml%} which contains the line
+{\par\samepage\setseps\small
+\begin{verbatim}
+ let x=2+2;;
+\end{verbatim}
+}
+\noindent this can be loaded as follows:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #loadf `foo.ml`;;
+\end{verbatim}
+}
+\noindent and the system would respond with:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ .() : void
+\end{verbatim}
+}
+\SEEALSO
+load, loadf.
\ENDDOC
\DOC{load\_library}
@@ -14395,6 +14350,49 @@ libraries currently in the standard HOL
libraries, library_pathname, library_search_path, set_library_search_path.
\ENDDOC
+\DOC{loadt}
+
+\TYPE {\small\verb%loadt : (string -> void)%}\egroup
+
+\SYNOPSIS
+{\small\verb%loadt%} loads an ML file with the verbose flag set to {\small\verb%true%}.
+
+\DESCRIBE
+The function {\small\verb%loadt%} takes a string indicating the ML file name as
+argument and loads it in the same manner as {\small\verb%load%}, except that the
+verbose flag is always set to {\small\verb%true%}.
+
+\FAILURE
+{\small\verb%loadt%} will fail if the file named by the argument does not exist in
+the search path. It will fail in the same manner if the file is not a
+valid ML file. Failure in the ML file will also terminate loading.
+
+\EXAMPLE
+If we have an ML file called {\small\verb%foo.ml%} which contains the line
+{\par\samepage\setseps\small
+\begin{verbatim}
+ let x=2+2;;
+\end{verbatim}
+}
+\noindent this can be loaded as follows:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #loadt `foo.ml`;;
+\end{verbatim}
+}
+\noindent and the system would respond with:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ x = 4 : int
+
+ File foo.ml loaded
+ () : void
+\end{verbatim}
+}
+\SEEALSO
+load, loadf.
+
+\ENDDOC
\DOC{load\_theorem}
\TYPE {\small\verb%load_theorem : (string -> string -> void)%}\egroup
@@ -14584,54 +14582,6 @@ using it.
dropout, lisp.
\ENDDOC
-\DOC{map}
-
-\TYPE {\small\verb%map : ((* -> **) -> * list -> ** list)%}\egroup
-
-\SYNOPSIS
-Applies a function to every element of a list.
-
-\DESCRIBE
-{\small\verb%map f [x1;...;xn]%} returns {\small\verb%[(f x1);...;(f xn)]%}.
-
-\FAILURE
-Never fails.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#map (\x. x * 2) [];;
-[] : int list
-
-#map (\x. x * 2) [1;2;3];;
-[2; 4; 6] : int list
-\end{verbatim}
-}
-\ENDDOC
-\DOC{map2}
-
-\TYPE {\small\verb%map2 : (((* # **) -> ***) -> (* list # ** list) -> *** list)%}\egroup
-
-\SYNOPSIS
-Maps a binary function over two lists to create one new list.
-
-\DESCRIBE
-{\small\verb%map2 f ([x1;...;xn],[y1;...;yn])%} returns {\small\verb%[f(x1,y1);...;f(xn,yn)]%}.
-
-\FAILURE
-Fails with {\small\verb%map2%} if the two lists are of different lengths.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#map2 $+ ([1;2;3],[3;2;1]);;
-[4; 4; 4] : int list
-\end{verbatim}
-}
-\SEEALSO
-map, uncurry.
-
-\ENDDOC
\DOC{MAP2\_CONV}
\TYPE {\small\verb%MAP2_CONV : conv -> conv%}\egroup
@@ -14685,62 +14635,28 @@ MAP_CONV
\ENDDOC
-\DOC{mapfilter}
-
-\TYPE {\small\verb%mapfilter : ((* -> **) -> * list -> ** list)%}\egroup
-
-\SYNOPSIS
-Applies a function to every element of a list, returning a list of results
-for those elements for which application succeeds.
-
-\FAILURE
-Never fails.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#mapfilter hd [[1;2;3];[4;5];[];[6;7;8];[]];;
-[1; 4; 6] : int list
-\end{verbatim}
-}
-\SEEALSO
-filter, map.
-
-\ENDDOC
-\DOC{maptok}
+\DOC{map2}
-\TYPE {\small\verb%maptok : ((string -> *) -> string -> * list)%}\egroup
+\TYPE {\small\verb%map2 : (((* # **) -> ***) -> (* list # ** list) -> *** list)%}\egroup
\SYNOPSIS
-Maps a function over the constituent words of a string.
+Maps a binary function over two lists to create one new list.
\DESCRIBE
-{\small\verb%maptok f s%} first splits the string {\small\verb%s%} into a list of substrings, and then
-maps the function {\small\verb%f%} over that list. Splitting of the string occurs at each
-sequence of blanks and carriage returns (white space). This white space does
-not appear in the list of substrings. Leading and trailing white space in the
-input string is also thrown away.
+{\small\verb%map2 f ([x1;...;xn],[y1;...;yn])%} returns {\small\verb%[f(x1,y1);...;f(xn,yn)]%}.
\FAILURE
-Fails if one of the applications of {\small\verb%f%} to a substring fails.
+Fails with {\small\verb%map2%} if the two lists are of different lengths.
\EXAMPLE
{\par\samepage\setseps\small
\begin{verbatim}
-#maptok explode ` the cat sat `;;
-[[`t`; `h`; `e`]; [`c`; `a`; `t`]; [`s`; `a`; `t`]] : string list list
-\end{verbatim}
-}
-\USES
-Useful when wanting to map a function over a list of constant strings.
-Instead of using {\small\verb%map f [`string1`;...;`stringn`]%} one can use:
-{\par\samepage\setseps\small
-\begin{verbatim}
- (maptok f `string1 ... stringn`)
+#map2 $+ ([1;2;3],[3;2;1]);;
+[4; 4; 4] : int list
\end{verbatim}
}
\SEEALSO
-words, word_separators, words2, map.
+map, uncurry.
\ENDDOC
\DOC{MAP\_CONV}
@@ -14819,6 +14735,30 @@ evaluating {\small\verb%conv "f ti"%} re
\ENDDOC
+\DOC{map}
+
+\TYPE {\small\verb%map : ((* -> **) -> * list -> ** list)%}\egroup
+
+\SYNOPSIS
+Applies a function to every element of a list.
+
+\DESCRIBE
+{\small\verb%map f [x1;...;xn]%} returns {\small\verb%[(f x1);...;(f xn)]%}.
+
+\FAILURE
+Never fails.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#map (\x. x * 2) [];;
+[] : int list
+
+#map (\x. x * 2) [1;2;3];;
+[2; 4; 6] : int list
+\end{verbatim}
+}
+\ENDDOC
\DOC{MAP\_EVERY}
\TYPE {\small\verb%MAP_EVERY : ((* -> tactic) -> * list -> tactic)%}\egroup
@@ -14848,41 +14788,148 @@ resulting tactic fails iff any of the re
A convenient way of doing case analysis over several boolean variables is:
{\par\samepage\setseps\small
\begin{verbatim}
- MAP_EVERY BOOL_CASES_TAC ["var1:bool";...;"varn:bool"]
+ MAP_EVERY BOOL_CASES_TAC ["var1:bool";...;"varn:bool"]
+\end{verbatim}
+}
+\SEEALSO
+EVERY, FIRST, MAP_FIRST, THEN.
+
+\ENDDOC
+\DOC{mapfilter}
+
+\TYPE {\small\verb%mapfilter : ((* -> **) -> * list -> ** list)%}\egroup
+
+\SYNOPSIS
+Applies a function to every element of a list, returning a list of results
+for those elements for which application succeeds.
+
+\FAILURE
+Never fails.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#mapfilter hd [[1;2;3];[4;5];[];[6;7;8];[]];;
+[1; 4; 6] : int list
+\end{verbatim}
+}
+\SEEALSO
+filter, map.
+
+\ENDDOC
+\DOC{MAP\_FIRST}
+
+\TYPE {\small\verb%MAP_FIRST : ((* -> tactic) -> * list -> tactic)%}\egroup
+
+\SYNOPSIS
+Applies first tactic that succeeds in a list given by mapping a function over a
+list.
+
+\DESCRIBE
+When applied to a tactic-producing function {\small\verb%f%} and an operand list
+{\small\verb%[x1;...;xn]%}, the elements of which have the same type as {\small\verb%f%}'s domain
+type, {\small\verb%MAP_FIRST%} maps the function {\small\verb%f%} over the list, producing a list of
+tactics, then tries applying these tactics to the goal till one succeeds.
+If {\small\verb%f(xm)%} is the first to succeed, then the overall effect is the same
+as applying {\small\verb%f(xm)%}. Thus:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ MAP_FIRST f [x1;...;xn] = (f x1) ORELSE ... ORELSE (f xn)
+\end{verbatim}
+}
+\FAILURE
+The application of {\small\verb%MAP_FIRST%} to a function and tactic list fails iff
+the function does when applied to any of the elements of the list. The
+resulting tactic fails iff all the resulting tactics fail when
+applied to the goal.
+
+\SEEALSO
+EVERY, FIRST, MAP_EVERY, ORELSE.
+
+\ENDDOC
+\DOC{maptok}
+
+\TYPE {\small\verb%maptok : ((string -> *) -> string -> * list)%}\egroup
+
+\SYNOPSIS
+Maps a function over the constituent words of a string.
+
+\DESCRIBE
+{\small\verb%maptok f s%} first splits the string {\small\verb%s%} into a list of substrings, and then
+maps the function {\small\verb%f%} over that list. Splitting of the string occurs at each
+sequence of blanks and carriage returns (white space). This white space does
+not appear in the list of substrings. Leading and trailing white space in the
+input string is also thrown away.
+
+\FAILURE
+Fails if one of the applications of {\small\verb%f%} to a substring fails.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#maptok explode ` the cat sat `;;
+[[`t`; `h`; `e`]; [`c`; `a`; `t`]; [`s`; `a`; `t`]] : string list list
+\end{verbatim}
+}
+\USES
+Useful when wanting to map a function over a list of constant strings.
+Instead of using {\small\verb%map f [`string1`;...;`stringn`]%} one can use:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ (maptok f `string1 ... stringn`)
\end{verbatim}
}
\SEEALSO
-EVERY, FIRST, MAP_FIRST, THEN.
+words, word_separators, words2, map.
\ENDDOC
-\DOC{MAP\_FIRST}
+\DOC{MATCH\_ACCEPT\_TAC}
-\TYPE {\small\verb%MAP_FIRST : ((* -> tactic) -> * list -> tactic)%}\egroup
+\TYPE {\small\verb%MATCH_ACCEPT_TAC : thm_tactic%}\egroup
\SYNOPSIS
-Applies first tactic that succeeds in a list given by mapping a function over a
-list.
+Solves a goal which is an instance of the supplied theorem.
\DESCRIBE
-When applied to a tactic-producing function {\small\verb%f%} and an operand list
-{\small\verb%[x1;...;xn]%}, the elements of which have the same type as {\small\verb%f%}'s domain
-type, {\small\verb%MAP_FIRST%} maps the function {\small\verb%f%} over the list, producing a list of
-tactics, then tries applying these tactics to the goal till one succeeds.
-If {\small\verb%f(xm)%} is the first to succeed, then the overall effect is the same
-as applying {\small\verb%f(xm)%}. Thus:
+When given a theorem {\small\verb%A' |- t%} and a goal {\small\verb%A ?- t'%} where {\small\verb%t%} can be matched
+to {\small\verb%t'%} by instantiating variables which are either free or
+universally quantified at the outer level, including appropriate type
+instantiation, {\small\verb%MATCH_ACCEPT_TAC%} completely solves the goal.
{\par\samepage\setseps\small
\begin{verbatim}
- MAP_FIRST f [x1;...;xn] = (f x1) ORELSE ... ORELSE (f xn)
+ A ?- t'
+ ========= MATCH_ACCEPT_TAC (A' |- t)
+
\end{verbatim}
}
+\noindent Unless {\small\verb%A'%} is a subset of {\small\verb%A%}, this is an invalid tactic.
+
\FAILURE
-The application of {\small\verb%MAP_FIRST%} to a function and tactic list fails iff
-the function does when applied to any of the elements of the list. The
-resulting tactic fails iff all the resulting tactics fail when
-applied to the goal.
+Fails unless the theorem has a conclusion which is instantiable to match that
+of the goal.
+\EXAMPLE
+The following example shows variable and type instantiation at work. We can use
+the polymorphic list theorem {\small\verb%HD%}:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ HD = |- !h t. HD(CONS h t) = h
+\end{verbatim}
+}
+\noindent to solve the goal:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ ?- HD [1;2] = 1
+\end{verbatim}
+}
+\noindent simply by:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ MATCH_ACCEPT_TAC HD
+\end{verbatim}
+}
\SEEALSO
-EVERY, FIRST, MAP_EVERY, ORELSE.
+ACCEPT_TAC.
\ENDDOC
\DOC{match}
@@ -14946,55 +14993,6 @@ type) which need to be instantiated may
INST_TY_TERM, PART_MATCH.
\ENDDOC
-\DOC{MATCH\_ACCEPT\_TAC}
-
-\TYPE {\small\verb%MATCH_ACCEPT_TAC : thm_tactic%}\egroup
-
-\SYNOPSIS
-Solves a goal which is an instance of the supplied theorem.
-
-\DESCRIBE
-When given a theorem {\small\verb%A' |- t%} and a goal {\small\verb%A ?- t'%} where {\small\verb%t%} can be matched
-to {\small\verb%t'%} by instantiating variables which are either free or
-universally quantified at the outer level, including appropriate type
-instantiation, {\small\verb%MATCH_ACCEPT_TAC%} completely solves the goal.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A ?- t'
- ========= MATCH_ACCEPT_TAC (A' |- t)
-
-\end{verbatim}
-}
-\noindent Unless {\small\verb%A'%} is a subset of {\small\verb%A%}, this is an invalid tactic.
-
-\FAILURE
-Fails unless the theorem has a conclusion which is instantiable to match that
-of the goal.
-
-\EXAMPLE
-The following example shows variable and type instantiation at work. We can use
-the polymorphic list theorem {\small\verb%HD%}:
-{\par\samepage\setseps\small
-\begin{verbatim}
- HD = |- !h t. HD(CONS h t) = h
-\end{verbatim}
-}
-\noindent to solve the goal:
-{\par\samepage\setseps\small
-\begin{verbatim}
- ?- HD [1;2] = 1
-\end{verbatim}
-}
-\noindent simply by:
-{\par\samepage\setseps\small
-\begin{verbatim}
- MATCH_ACCEPT_TAC HD
-\end{verbatim}
-}
-\SEEALSO
-ACCEPT_TAC.
-
-\ENDDOC
\DOC{MATCH\_MP}
\TYPE {\small\verb%MATCH_MP : (thm -> thm -> thm)%}\egroup
@@ -15188,6 +15186,23 @@ This is an example
print_string, print_tok, print_begin, print_end, print_newline.
\ENDDOC
+\DOC{mk\_abs}
+
+\TYPE {\small\verb%mk_abs : ((term # term) -> term)%}\egroup
+
+\SYNOPSIS
+Constructs an abstraction.
+
+\DESCRIBE
+{\small\verb%mk_abs "var","t"%} returns the abstraction {\small\verb%"\var. t"%}.
+
+\FAILURE
+Fails with {\small\verb%mk_abs%} if first term is not a variable.
+
+\SEEALSO
+dest_abs, is_abs, list_mk_abs, mk_var, mk_const, mk_comb.
+
+\ENDDOC
\DOC{MK\_ABS}
\TYPE {\small\verb%MK_ABS : (thm -> thm)%}\egroup
@@ -15213,21 +15228,31 @@ Fails unless the theorem is a (singly) u
ABS, HALF_MK_ABS, MK_COMB, MK_EXISTS.
\ENDDOC
-\DOC{mk\_abs}
+\DOC{mk\_comb}
-\TYPE {\small\verb%mk_abs : ((term # term) -> term)%}\egroup
+\TYPE {\small\verb%mk_comb : ((term # term) -> term)%}\egroup
\SYNOPSIS
-Constructs an abstraction.
+Constructs a combination (function application).
\DESCRIBE
-{\small\verb%mk_abs "var","t"%} returns the abstraction {\small\verb%"\var. t"%}.
+{\small\verb%mk_comb "t1","t2"%} returns the combination {\small\verb%"t1 t2"%}.
\FAILURE
-Fails with {\small\verb%mk_abs%} if first term is not a variable.
+Fails with {\small\verb%mk_comb%} unless {\small\verb%t1%} is a function with domain type {\small\verb%t2%}.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#mk_comb("$~","T");;
+"~T" : term
+#mk_comb("T","T");;
+evaluation failed mk_comb
+\end{verbatim}
+}
\SEEALSO
-dest_abs, is_abs, list_mk_abs, mk_var, mk_const, mk_comb.
+dest_comb, is_comb, list_mk_comb, mk_var, mk_const, mk_abs.
\ENDDOC
\DOC{MK\_COMB}
@@ -15257,33 +15282,6 @@ respectively.
AP_TERM, AP_THM.
\ENDDOC
-\DOC{mk\_comb}
-
-\TYPE {\small\verb%mk_comb : ((term # term) -> term)%}\egroup
-
-\SYNOPSIS
-Constructs a combination (function application).
-
-\DESCRIBE
-{\small\verb%mk_comb "t1","t2"%} returns the combination {\small\verb%"t1 t2"%}.
-
-\FAILURE
-Fails with {\small\verb%mk_comb%} unless {\small\verb%t1%} is a function with domain type {\small\verb%t2%}.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#mk_comb("$~","T");;
-"~T" : term
-
-#mk_comb("T","T");;
-evaluation failed mk_comb
-\end{verbatim}
-}
-\SEEALSO
-dest_comb, is_comb, list_mk_comb, mk_var, mk_const, mk_abs.
-
-\ENDDOC
\DOC{mk\_cond}
\TYPE {\small\verb%mk_cond : ((term # term # term) -> term)%}\egroup
@@ -15421,6 +15419,24 @@ Fails with {\small\verb%mk_eq%} if {\sma
dest_eq, is_eq.
\ENDDOC
+\DOC{mk\_exists}
+
+\TYPE {\small\verb%mk_exists : ((term # term) -> term)%}\egroup
+
+\SYNOPSIS
+Constructs an existential quantification.
+
+\DESCRIBE
+{\small\verb%mk_exists("var","t")%} returns {\small\verb%"?var. t"%}.
+
+\FAILURE
+Fails with {\small\verb%mk_exists%} if first term is not a variable or if {\small\verb%t%} is not of
+type {\small\verb%":bool"%}.
+
+\SEEALSO
+dest_exists, is_exists, list_mk_exists.
+
+\ENDDOC
\DOC{MK\_EXISTS}
\TYPE {\small\verb%MK_EXISTS : (thm -> thm)%}\egroup
@@ -15446,24 +15462,6 @@ Fails unless the theorem is a singly uni
AP_TERM, EXISTS_EQ, GEN, LIST_MK_EXISTS, MK_ABS.
\ENDDOC
-\DOC{mk\_exists}
-
-\TYPE {\small\verb%mk_exists : ((term # term) -> term)%}\egroup
-
-\SYNOPSIS
-Constructs an existential quantification.
-
-\DESCRIBE
-{\small\verb%mk_exists("var","t")%} returns {\small\verb%"?var. t"%}.
-
-\FAILURE
-Fails with {\small\verb%mk_exists%} if first term is not a variable or if {\small\verb%t%} is not of
-type {\small\verb%":bool"%}.
-
-\SEEALSO
-dest_exists, is_exists, list_mk_exists.
-
-\ENDDOC
\DOC{mk\_forall}
\TYPE {\small\verb%mk_forall : ((term # term) -> term)%}\egroup
@@ -16111,58 +16109,23 @@ of that name in the current theory, or i
\EXAMPLE
{\par\samepage\setseps\small
\begin{verbatim}
-#new_theory `gurk`;;
-() : void
-
-#new_axiom(`untrue`,"x = 1");;
-|- !x. x = 1
-\end{verbatim}
-}
-\COMMENTS
-For most purposes, it is unnecessary to declare new axioms: all of classical
-mathematics can be derived by definitional extension alone. Proceeding by
-definition is not only more elegant, but also guarantees the consistency of the
-deductions made. However, there are certain entities which cannot be modelled
-in simple type theory without further axioms, such as higher transfinite
-ordinals.
-
-\SEEALSO
-mk_thm, new_definition.
-
-\ENDDOC
-\DOC{new\_binder}
-
-\TYPE {\small\verb%new_binder : ((string # type) -> void)%}\egroup
-
-\SYNOPSIS
-Sets up a new binder in the current theory.
-
-\DESCRIBE
-A call {\small\verb%new_binder(`bnd`,":ty")%} declares a new binder {\small\verb%bnd%} in the current
-theory. The type must be of the form {\small\verb%(* -> **) -> ***%}, because being a binder,
-{\small\verb%bnd%} will apply to an abstraction; for example {\small\verb%"!x:bool. (x=T) \/ (x=F)"%} is
-actually a prettyprinting of {\small\verb%"$! (\x. (x=T) \/ (x=F))"%}.
-
-\FAILURE
-Fails if HOL is not in draft mode, or there is already a constant of some sort
-of that name in the current theory, or if the type does not correspond to the
-above pattern.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#new_theory `anorak`;;
-() : void
-
-#new_binder(`!!`,":(bool->bool)->bool");;
+#new_theory `gurk`;;
() : void
-#"!!x. T";;
-"!! x. T" : term
+#new_axiom(`untrue`,"x = 1");;
+|- !x. x = 1
\end{verbatim}
}
+\COMMENTS
+For most purposes, it is unnecessary to declare new axioms: all of classical
+mathematics can be derived by definitional extension alone. Proceeding by
+definition is not only more elegant, but also guarantees the consistency of the
+deductions made. However, there are certain entities which cannot be modelled
+in simple type theory without further axioms, such as higher transfinite
+ordinals.
+
\SEEALSO
-binders, is_binder.
+mk_thm, new_definition.
\ENDDOC
\DOC{new\_binder\_definition}
@@ -16244,6 +16207,41 @@ new_infix_list_rec_definition, new_prim_
new_list_rec_definition, new_prim_rec_definition.
\ENDDOC
+\DOC{new\_binder}
+
+\TYPE {\small\verb%new_binder : ((string # type) -> void)%}\egroup
+
+\SYNOPSIS
+Sets up a new binder in the current theory.
+
+\DESCRIBE
+A call {\small\verb%new_binder(`bnd`,":ty")%} declares a new binder {\small\verb%bnd%} in the current
+theory. The type must be of the form {\small\verb%(* -> **) -> ***%}, because being a binder,
+{\small\verb%bnd%} will apply to an abstraction; for example {\small\verb%"!x:bool. (x=T) \/ (x=F)"%} is
+actually a prettyprinting of {\small\verb%"$! (\x. (x=T) \/ (x=F))"%}.
+
+\FAILURE
+Fails if HOL is not in draft mode, or there is already a constant of some sort
+of that name in the current theory, or if the type does not correspond to the
+above pattern.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#new_theory `anorak`;;
+() : void
+
+#new_binder(`!!`,":(bool->bool)->bool");;
+() : void
+
+#"!!x. T";;
+"!! x. T" : term
+\end{verbatim}
+}
+\SEEALSO
+binders, is_binder.
+
+\ENDDOC
\DOC{new\_constant}
\TYPE {\small\verb%new_constant : ((string # type) -> void)%}\egroup
@@ -16415,46 +16413,6 @@ DEF_EXISTS_RULE, new_binder_definition,
new_specification.
\ENDDOC
-\DOC{new\_infix}
-
-\TYPE {\small\verb%new_infix : ((string # type) -> void)%}\egroup
-
-\SYNOPSIS
-Declares a new infix constant in the current theory.
-
-\DESCRIBE
-A call {\small\verb%new_infix(`i`,":ty")%} makes {\small\verb%i%} an infix
-constant in the current theory. Note that it does not specifiy its value.
-The constant may have a polymorphic type, which may be arbitrarily
-instantiated. Like any other infix or binder, its special parse status may be
-suppressed by preceding it with a dollar sign.
-
-\FAILURE
-Fails if HOL is not in draft mode, or if the name is not a valid constant
-name, or there is already a constant of that name in the current theory.
-
-\EXAMPLE
-The following shows the use of the curried form as well as the infix:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #new_theory `groke`;;
- () : void
-
- #new_infix(`orelse`,":bool->bool->bool");;
- () : void
-
- #"T orelse F";;
- "T orelse F" : term
-
- #"$orelse T F";;
- "T orelse F" : term
-\end{verbatim}
-}
-\SEEALSO
-constants, infixes, is_constant, is_infix, new_constant, new_definition,
-new_infix_definition.
-
-\ENDDOC
\DOC{new\_infix\_definition}
\TYPE {\small\verb%new_infix_definition : ((string # term) -> thm)%}\egroup
@@ -16530,6 +16488,46 @@ new_infix_list_rec_definition, new_prim_
new_prim_rec_definition.
\ENDDOC
+\DOC{new\_infix}
+
+\TYPE {\small\verb%new_infix : ((string # type) -> void)%}\egroup
+
+\SYNOPSIS
+Declares a new infix constant in the current theory.
+
+\DESCRIBE
+A call {\small\verb%new_infix(`i`,":ty")%} makes {\small\verb%i%} an infix
+constant in the current theory. Note that it does not specifiy its value.
+The constant may have a polymorphic type, which may be arbitrarily
+instantiated. Like any other infix or binder, its special parse status may be
+suppressed by preceding it with a dollar sign.
+
+\FAILURE
+Fails if HOL is not in draft mode, or if the name is not a valid constant
+name, or there is already a constant of that name in the current theory.
+
+\EXAMPLE
+The following shows the use of the curried form as well as the infix:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #new_theory `groke`;;
+ () : void
+
+ #new_infix(`orelse`,":bool->bool->bool");;
+ () : void
+
+ #"T orelse F";;
+ "T orelse F" : term
+
+ #"$orelse T F";;
+ "T orelse F" : term
+\end{verbatim}
+}
+\SEEALSO
+constants, infixes, is_constant, is_infix, new_constant, new_definition,
+new_infix_definition.
+
+\ENDDOC
\DOC{new\_infix\_list\_rec\_definition}
\TYPE {\small\verb%new_infix_list_rec_definition : ((string # term) -> thm)%}\egroup
@@ -17401,43 +17399,6 @@ new_binder, new_constant, new_definition
new_specification, new_type, print_theory, save_thm, search_path.
\ENDDOC
-\DOC{new\_type}
-
-\TYPE {\small\verb%new_type : (int -> string -> void)%}\egroup
-
-\SYNOPSIS
-Declares a new type or type constructor.
-
-\DESCRIBE
-A call {\small\verb%new_type n `t`%} declares a new {\small\verb%n%}-ary type constructor called {\small\verb%t%} in
-the current theory segment. If {\small\verb%n%} is zero, this is just a new base type.
-
-\FAILURE
-Fails if HOL is not in draft mode, or if the name is not a valid type
-name, or there is already a type operator of that name in the current theory.
-
-\EXAMPLE
-A version of ZF set theory might declare a new type {\small\verb%set%} and start using it as
-follows:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #new_theory `ZF`;;
- () : void
-
- #new_type 0 `set`;;
- () : void
-
- #new_infix(`mem`,":set->set->bool");;
- () : void
-
- #new_axiom(`ext`,"(!z. z mem x = z mem y) ==> (x = y)");;
- |- !x y. (!z. z mem x = z mem y) ==> (x = y)
-\end{verbatim}
-}
-\SEEALSO
-types, type_abbrevs, new_type_abbrev.
-
-\ENDDOC
\DOC{new\_type\_abbrev}
\TYPE {\small\verb%new_type_abbrev : ((string # type) -> void)%}\egroup
@@ -17545,6 +17506,43 @@ define_new_type_bijections, prove_abs_fn
prove_rep_fn_one_one, prove_rep_fn_onto.
\ENDDOC
+\DOC{new\_type}
+
+\TYPE {\small\verb%new_type : (int -> string -> void)%}\egroup
+
+\SYNOPSIS
+Declares a new type or type constructor.
+
+\DESCRIBE
+A call {\small\verb%new_type n `t`%} declares a new {\small\verb%n%}-ary type constructor called {\small\verb%t%} in
+the current theory segment. If {\small\verb%n%} is zero, this is just a new base type.
+
+\FAILURE
+Fails if HOL is not in draft mode, or if the name is not a valid type
+name, or there is already a type operator of that name in the current theory.
+
+\EXAMPLE
+A version of ZF set theory might declare a new type {\small\verb%set%} and start using it as
+follows:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #new_theory `ZF`;;
+ () : void
+
+ #new_type 0 `set`;;
+ () : void
+
+ #new_infix(`mem`,":set->set->bool");;
+ () : void
+
+ #new_axiom(`ext`,"(!z. z mem x = z mem y) ==> (x = y)");;
+ |- !x y. (!z. z mem x = z mem y) ==> (x = y)
+\end{verbatim}
+}
+\SEEALSO
+types, type_abbrevs, new_type_abbrev.
+
+\ENDDOC
\DOC{nil\_term\_net}
\TYPE {\small\verb%nil_term_net : * term_net%}\egroup
@@ -17554,6 +17552,38 @@ This function is for internal use only a
version of the system. It should not be used.
\ENDDOC
+\DOC{NO\_CONV}
+
+\TYPE {\small\verb%NO_CONV : conv%}\egroup
+
+\SYNOPSIS
+Conversion that always fails.
+
+\FAILURE
+{\small\verb%NO_CONV%} always fails.
+
+\SEEALSO
+ALL_CONV.
+
+\ENDDOC
+\DOC{NO\_TAC}
+
+\TYPE {\small\verb%NO_TAC : tactic%}\egroup
+
+\SYNOPSIS
+Tactic which always fails.
+
+\DESCRIBE
+Whatever goal it is applied to, {\small\verb%NO_TAC%} always fails
+with string {\small\verb%`NO_TAC`%}.
+
+\FAILURE
+Always fails.
+
+\SEEALSO
+ALL_TAC, ALL_THEN, FAIL_TAC, NO_THEN.
+
+\ENDDOC
\DOC{not}
\TYPE {\small\verb%$not : (bool -> bool)%}\egroup
@@ -17660,7 +17690,29 @@ When applied to a term of the form {\sma
Fails if applied to a term not of the form {\small\verb%~(!x.P)%}.
\SEEALSO
-EXISTS_NOT_CONV, FORALL_NOT_CONV, NOT_EXISTS_CONV.
+EXISTS_NOT_CONV, FORALL_NOT_CONV, NOT_EXISTS_CONV.
+
+\ENDDOC
+\DOC{NO\_THEN}
+
+\TYPE {\small\verb%NO_THEN : thm_tactical%}\egroup
+
+\SYNOPSIS
+Theorem-tactical which always fails.
+
+\DESCRIBE
+When applied to a theorem-tactic and a theorem, the theorem-tactical
+{\small\verb%NO_THEN%} always fails with string {\small\verb%`NO_THEN`%}.
+
+\FAILURE
+Always fails when applied to a theorem-tactic and a theorem (note that it
+never gets as far as being applied to a goal!)
+
+\USES
+Writing compound tactics or tacticals.
+
+\SEEALSO
+ALL_TAC, ALL_THEN, FAIL_TAC, NO_TAC.
\ENDDOC
\DOC{NOT\_INTRO}
@@ -17733,58 +17785,13 @@ expected to be a negation, use {\small\v
MP, EQ_MP, LIST_MP, MATCH_MP, MATCH_MP_TAC, MP_TAC.
\ENDDOC
-\DOC{NO\_CONV}
-
-\TYPE {\small\verb%NO_CONV : conv%}\egroup
-
-\SYNOPSIS
-Conversion that always fails.
-
-\FAILURE
-{\small\verb%NO_CONV%} always fails.
-
-\SEEALSO
-ALL_CONV.
-
-\ENDDOC
-\DOC{NO\_TAC}
-
-\TYPE {\small\verb%NO_TAC : tactic%}\egroup
-
-\SYNOPSIS
-Tactic which always fails.
-
-\DESCRIBE
-Whatever goal it is applied to, {\small\verb%NO_TAC%} always fails
-with string {\small\verb%`NO_TAC`%}.
-
-\FAILURE
-Always fails.
-
-\SEEALSO
-ALL_TAC, ALL_THEN, FAIL_TAC, NO_THEN.
-
-\ENDDOC
-\DOC{NO\_THEN}
+\DOC{n\_strip\_quant}
-\TYPE {\small\verb%NO_THEN : thm_tactical%}\egroup
+\TYPE {\small\verb%n_strip_quant : ((* -> (** # *)) -> int -> * -> (** list # *))%}\egroup
\SYNOPSIS
-Theorem-tactical which always fails.
-
-\DESCRIBE
-When applied to a theorem-tactic and a theorem, the theorem-tactical
-{\small\verb%NO_THEN%} always fails with string {\small\verb%`NO_THEN`%}.
-
-\FAILURE
-Always fails when applied to a theorem-tactic and a theorem (note that it
-never gets as far as being applied to a goal!)
-
-\USES
-Writing compound tactics or tacticals.
-
-\SEEALSO
-ALL_TAC, ALL_THEN, FAIL_TAC, NO_TAC.
+This function is for internal use only and is to be deleted from a future
+version of the system. It should not be used.
\ENDDOC
\DOC{null}
@@ -17883,15 +17890,6 @@ and {\small\verb%m%} are syntactically i
\end{verbatim}
}
\ENDDOC
-\DOC{n\_strip\_quant}
-
-\TYPE {\small\verb%n_strip_quant : ((* -> (** # *)) -> int -> * -> (** list # *))%}\egroup
-
-\SYNOPSIS
-This function is for internal use only and is to be deleted from a future
-version of the system. It should not be used.
-
-\ENDDOC
\DOC{o}
\TYPE {\small\verb%$o : (((* -> **) # (*** -> *)) -> *** -> **)%}\egroup
@@ -18063,6 +18061,71 @@ happens to generate a failure with strin
DEPTH_CONV, REDEPTH_CONV, TOP_DEPTH_CONV, ONCE_REW_DEPTH_CONV.
\ENDDOC
+\DOC{ONCE\_REW\_DEPTH\_CONV}
+
+\TYPE {\small\verb%ONCE_REW_DEPTH_CONV : (conv -> conv)%}\egroup
+
+\SYNOPSIS
+Applies a conversion once to the first suitable sub-term(s) encountered in
+top-down order. For use in rewriting.
+
+\DESCRIBE
+{\small\verb%ONCE_REW_DEPTH_CONV c tm%} applies the conversion {\small\verb%c%} once to the first
+subterm or subterms encountered in a top-down `parallel' search of the term
+{\small\verb%tm%} for which {\small\verb%c%} succeeds. If the conversion {\small\verb%c%} fails on all subterms of
+{\small\verb%tm%}, the theorem returned is {\small\verb%|- tm = tm%}.
+
+{\small\verb%ONCE_REW_DEPTH_CONV%} is a special version of {\small\verb%ONCE_DEPTH_CONV%} for use by the
+rewriting conversions, rules and tactics. It differs from {\small\verb%ONCE_DEPTH_CONV%} as
+follows: If converting an abstraction fails due to the presence of the bound
+variable in the hypotheses of the theorem generated by converting the body,
+{\small\verb%ONCE_REW_DEPTH_CONV%} retries the conversion having renamed the bound variable
+of the abstraction. If successful the renaming is reversed.
+
+\FAILURE
+Never fails.
+
+\EXAMPLE
+The following example illustrates the difference between the functions
+{\small\verb%ONCE_REW_DEPTH_CONV%} and {\small\verb%ONCE_DEPTH_CONV%}. It is not intended to illustrate
+the full range of behaviour of the former. Both {\small\verb%ONCE_REW_DEPTH_CONV%} and
+{\small\verb%ONCE_DEPTH_CONV%} successfully apply the theorem {\small\verb%ADD_0%} inside an abstraction:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #ONCE_REW_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
+ |- (\n. n + 0) = (\n. n)
+
+ #ONCE_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
+ |- (\n. n + 0) = (\n. n)
+\end{verbatim}
+}
+\noindent However, if a hypothesis containing a free occurrence of the bound
+variable is added to the rewrite rule, it interferes with the operation of
+{\small\verb%ONCE_DEPTH_CONV%} but not that of {\small\verb%ONCE_REW_DEPTH_CONV%}:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #let th = ADD_ASSUM "n = 0" ADD_0;;
+ th = n = 0 |- !m. m + 0 = m
+
+ #ONCE_REW_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
+ n = 0 |- (\n. n + 0) = (\n. n)
+
+ #ONCE_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
+ |- (\n. n + 0) = (\n. n + 0)
+\end{verbatim}
+}
+\COMMENTS
+The implementation of this function uses failure to avoid rebuilding
+unchanged subterms. That is to say, during execution the failure string
+{\small\verb%`QCONV`%} may be generated and later trapped. The behaviour of the function
+is dependent on this use of failure. So, if the conversion given as argument
+happens to generate a failure with string {\small\verb%`QCONV`%}, the operation of
+{\small\verb%ONCE_REW_DEPTH_CONV%} will be unpredictable.
+
+\SEEALSO
+REW_DEPTH_CONV, ONCE_DEPTH_CONV.
+
+\ENDDOC
\DOC{ONCE\_REWRITE\_CONV}
\TYPE {\small\verb%ONCE_REWRITE_CONV : (thm list -> conv)%}\egroup
@@ -18176,71 +18239,6 @@ ASM_REWRITE_TAC, ONCE_ASM_REWRITE_TAC, P
PURE_ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWRITE_TAC, SUBST_TAC.
\ENDDOC
-\DOC{ONCE\_REW\_DEPTH\_CONV}
-
-\TYPE {\small\verb%ONCE_REW_DEPTH_CONV : (conv -> conv)%}\egroup
-
-\SYNOPSIS
-Applies a conversion once to the first suitable sub-term(s) encountered in
-top-down order. For use in rewriting.
-
-\DESCRIBE
-{\small\verb%ONCE_REW_DEPTH_CONV c tm%} applies the conversion {\small\verb%c%} once to the first
-subterm or subterms encountered in a top-down `parallel' search of the term
-{\small\verb%tm%} for which {\small\verb%c%} succeeds. If the conversion {\small\verb%c%} fails on all subterms of
-{\small\verb%tm%}, the theorem returned is {\small\verb%|- tm = tm%}.
-
-{\small\verb%ONCE_REW_DEPTH_CONV%} is a special version of {\small\verb%ONCE_DEPTH_CONV%} for use by the
-rewriting conversions, rules and tactics. It differs from {\small\verb%ONCE_DEPTH_CONV%} as
-follows: If converting an abstraction fails due to the presence of the bound
-variable in the hypotheses of the theorem generated by converting the body,
-{\small\verb%ONCE_REW_DEPTH_CONV%} retries the conversion having renamed the bound variable
-of the abstraction. If successful the renaming is reversed.
-
-\FAILURE
-Never fails.
-
-\EXAMPLE
-The following example illustrates the difference between the functions
-{\small\verb%ONCE_REW_DEPTH_CONV%} and {\small\verb%ONCE_DEPTH_CONV%}. It is not intended to illustrate
-the full range of behaviour of the former. Both {\small\verb%ONCE_REW_DEPTH_CONV%} and
-{\small\verb%ONCE_DEPTH_CONV%} successfully apply the theorem {\small\verb%ADD_0%} inside an abstraction:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #ONCE_REW_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
- |- (\n. n + 0) = (\n. n)
-
- #ONCE_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
- |- (\n. n + 0) = (\n. n)
-\end{verbatim}
-}
-\noindent However, if a hypothesis containing a free occurrence of the bound
-variable is added to the rewrite rule, it interferes with the operation of
-{\small\verb%ONCE_DEPTH_CONV%} but not that of {\small\verb%ONCE_REW_DEPTH_CONV%}:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #let th = ADD_ASSUM "n = 0" ADD_0;;
- th = n = 0 |- !m. m + 0 = m
-
- #ONCE_REW_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
- n = 0 |- (\n. n + 0) = (\n. n)
-
- #ONCE_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
- |- (\n. n + 0) = (\n. n + 0)
-\end{verbatim}
-}
-\COMMENTS
-The implementation of this function uses failure to avoid rebuilding
-unchanged subterms. That is to say, during execution the failure string
-{\small\verb%`QCONV`%} may be generated and later trapped. The behaviour of the function
-is dependent on this use of failure. So, if the conversion given as argument
-happens to generate a failure with string {\small\verb%`QCONV`%}, the operation of
-{\small\verb%ONCE_REW_DEPTH_CONV%} will be unpredictable.
-
-\SEEALSO
-REW_DEPTH_CONV, ONCE_DEPTH_CONV.
-
-\ENDDOC
\DOC{oo}
\TYPE {\small\verb%$oo : ((((* # **) -> ***) # (**** -> *) # (**** -> **)) -> **** -> ***)%}\egroup
@@ -18311,43 +18309,43 @@ contents of file foo
close, openi, read, write
\ENDDOC
-\DOC{ORELSE}
+\DOC{ORELSEC}
-\TYPE {\small\verb%$ORELSE : (tactic -> tactic -> tactic)%}\egroup
+\TYPE {\small\verb%$ORELSEC : (conv -> conv -> conv)%}\egroup
\SYNOPSIS
-Applies first tactic, and iff it fails, applies the second instead.
+Applies the first of two conversions that succeeds.
\DESCRIBE
-If {\small\verb%T1%} and {\small\verb%T2%} are tactics, {\small\verb%T1 ORELSE T2%} is a tactic which applies {\small\verb%T1%} to
-a goal, and iff it fails, applies {\small\verb%T2%} to the goal instead.
+{\small\verb%(c1 ORELSEC c2) "t"%} returns the result of applying the conversion {\small\verb%c1%} to
+the term {\small\verb%"t"%} if this succeeds. Otherwise {\small\verb%(c1 ORELSEC c2) "t"%} returns the
+result of applying the conversion {\small\verb%c2%} to the term {\small\verb%"t"%}.
\FAILURE
-The application of {\small\verb%ORELSE%} to a pair of tactics never fails.
-The resulting tactic fails if both {\small\verb%T1%} and {\small\verb%T2%} fail when applied to the
-relevant goal.
+{\small\verb%(c1 ORELSEC c2) "t"%} fails both {\small\verb%c1%} and {\small\verb%c2%} fail when applied to {\small\verb%"t"%}.
\SEEALSO
-EVERY, FIRST, THEN.
+FIRST_CONV.
\ENDDOC
-\DOC{ORELSEC}
+\DOC{ORELSE}
-\TYPE {\small\verb%$ORELSEC : (conv -> conv -> conv)%}\egroup
+\TYPE {\small\verb%$ORELSE : (tactic -> tactic -> tactic)%}\egroup
\SYNOPSIS
-Applies the first of two conversions that succeeds.
+Applies first tactic, and iff it fails, applies the second instead.
\DESCRIBE
-{\small\verb%(c1 ORELSEC c2) "t"%} returns the result of applying the conversion {\small\verb%c1%} to
-the term {\small\verb%"t"%} if this succeeds. Otherwise {\small\verb%(c1 ORELSEC c2) "t"%} returns the
-result of applying the conversion {\small\verb%c2%} to the term {\small\verb%"t"%}.
+If {\small\verb%T1%} and {\small\verb%T2%} are tactics, {\small\verb%T1 ORELSE T2%} is a tactic which applies {\small\verb%T1%} to
+a goal, and iff it fails, applies {\small\verb%T2%} to the goal instead.
\FAILURE
-{\small\verb%(c1 ORELSEC c2) "t"%} fails both {\small\verb%c1%} and {\small\verb%c2%} fail when applied to {\small\verb%"t"%}.
+The application of {\small\verb%ORELSE%} to a pair of tactics never fails.
+The resulting tactic fails if both {\small\verb%T1%} and {\small\verb%T2%} fail when applied to the
+relevant goal.
\SEEALSO
-FIRST_CONV.
+EVERY, FIRST, THEN.
\ENDDOC
\DOC{ORELSE\_TCL}
@@ -18482,29 +18480,6 @@ evaluation failed outr
outl, inl, inr, isl
\ENDDOC
-\DOC{p}
-
-\TYPE {\small\verb%p : (int -> void)%}\egroup
-
-\SYNOPSIS
-Prints the top levels of the subgoal package goal stack.
-
-\DESCRIBE
-The function {\small\verb%p%} is part of the subgoal package. It is an abbreviation for the
-function {\small\verb%print_state%}. For a description of the subgoal package, see
-{\small\verb%set_goal%}.
-
-\FAILURE
-Never fails.
-
-\USES
-Examining the proof state during an interactive proof session.
-
-\SEEALSO
-b, backup, backup_limit, e, expand, expandf, g, get_state, print_state, r,
-rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
-
-\ENDDOC
\DOC{pair}
\TYPE {\small\verb%pair : (* -> ** -> (* # **))%}\egroup
@@ -18878,7 +18853,30 @@ implication (the inbuilt specialization
quantifier), and matches it to {\small\verb%T%}.
\SEEALSO
-INST_TYPE, INST_TY_TERM, match.
+INST_TYPE, INST_TY_TERM, match.
+
+\ENDDOC
+\DOC{p}
+
+\TYPE {\small\verb%p : (int -> void)%}\egroup
+
+\SYNOPSIS
+Prints the top levels of the subgoal package goal stack.
+
+\DESCRIBE
+The function {\small\verb%p%} is part of the subgoal package. It is an abbreviation for the
+function {\small\verb%print_state%}. For a description of the subgoal package, see
+{\small\verb%set_goal%}.
+
+\FAILURE
+Never fails.
+
+\USES
+Examining the proof state during an interactive proof session.
+
+\SEEALSO
+b, backup, backup_limit, e, expand, expandf, g, get_state, print_state, r,
+rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
\ENDDOC
\DOC{POP\_ASSUM}
@@ -20153,56 +20151,6 @@ Never fails.
set_prompt.
\ENDDOC
-\DOC{PROVE}
-
-\TYPE {\small\verb%PROVE : ((term # tactic) -> thm)%}\egroup
-
-\SYNOPSIS
-Attempts to prove a boolean term using the supplied tactic.
-
-\DESCRIBE
-When applied to a term-tactic pair {\small\verb%(tm,tac)%}, the function {\small\verb%PROVE%} attempts to
-prove the goal {\small\verb%?- tm%}, that is, the term {\small\verb%tm%} with no assumptions, using the
-tactic {\small\verb%tac%}. If {\small\verb%PROVE%} succeeds, it returns the corresponding theorem
-{\small\verb%A |- tm%}, where the assumption list {\small\verb%A%} may not be empty if the tactic is
-invalid; {\small\verb%PROVE%} has no inbuilt validity-checking.
-
-\FAILURE
-Fails if the term is not of type {\small\verb%bool%} (and so cannot possibly be
-the conclusion of a theorem), or if the tactic cannot solve the goal.
-In the latter case {\small\verb%PROVE%} will list the unsolved goals to help the user.
-
-\SEEALSO
-TAC_PROOF, prove, prove_thm, VALID.
-
-\ENDDOC
-\DOC{prove}
-
-\TYPE {\small\verb%prove : ((term # tactic) -> thm)%}\egroup
-
-\SYNOPSIS
-Attempts to prove a boolean term using the supplied tactic.
-
-\DESCRIBE
-When applied to a term-tactic pair {\small\verb%(tm,tac)%}, the function {\small\verb%prove%} attempts to
-prove the goal {\small\verb%?- tm%}, that is, the term {\small\verb%tm%} with no assumptions, using the
-tactic {\small\verb%tac%}. If {\small\verb%prove%} succeeds, it returns the corresponding theorem
-{\small\verb%A |- tm%}, where the assumption list {\small\verb%A%} may not be empty if the tactic is
-invalid; {\small\verb%prove%} has no inbuilt validity-checking.
-
-\FAILURE
-Fails if the term is not of type {\small\verb%bool%} (and so cannot possibly be
-the conclusion of a theorem), or if the tactic cannot solve the goal.
-
-\COMMENTS
-The function {\small\verb%PROVE%} provides almost identical functionality, and will
-also list unsolved goals if the tactic fails. It is therefore preferable
-for most purposes.
-
-\SEEALSO
-PROVE, prove_thm, TAC_PROOF, VALID.
-
-\ENDDOC
\DOC{prove\_abs\_fn\_one\_one}
\TYPE {\small\verb%prove_abs_fn_one_one : (thm -> thm)%}\egroup
@@ -20398,6 +20346,56 @@ define_type, INDUCT_THEN, new_recursive_
prove_constructors_distinct, prove_induction_thm, prove_rec_fn_exists.
\ENDDOC
+\DOC{prove}
+
+\TYPE {\small\verb%prove : ((term # tactic) -> thm)%}\egroup
+
+\SYNOPSIS
+Attempts to prove a boolean term using the supplied tactic.
+
+\DESCRIBE
+When applied to a term-tactic pair {\small\verb%(tm,tac)%}, the function {\small\verb%prove%} attempts to
+prove the goal {\small\verb%?- tm%}, that is, the term {\small\verb%tm%} with no assumptions, using the
+tactic {\small\verb%tac%}. If {\small\verb%prove%} succeeds, it returns the corresponding theorem
+{\small\verb%A |- tm%}, where the assumption list {\small\verb%A%} may not be empty if the tactic is
+invalid; {\small\verb%prove%} has no inbuilt validity-checking.
+
+\FAILURE
+Fails if the term is not of type {\small\verb%bool%} (and so cannot possibly be
+the conclusion of a theorem), or if the tactic cannot solve the goal.
+
+\COMMENTS
+The function {\small\verb%PROVE%} provides almost identical functionality, and will
+also list unsolved goals if the tactic fails. It is therefore preferable
+for most purposes.
+
+\SEEALSO
+PROVE, prove_thm, TAC_PROOF, VALID.
+
+\ENDDOC
+\DOC{PROVE}
+
+\TYPE {\small\verb%PROVE : ((term # tactic) -> thm)%}\egroup
+
+\SYNOPSIS
+Attempts to prove a boolean term using the supplied tactic.
+
+\DESCRIBE
+When applied to a term-tactic pair {\small\verb%(tm,tac)%}, the function {\small\verb%PROVE%} attempts to
+prove the goal {\small\verb%?- tm%}, that is, the term {\small\verb%tm%} with no assumptions, using the
+tactic {\small\verb%tac%}. If {\small\verb%PROVE%} succeeds, it returns the corresponding theorem
+{\small\verb%A |- tm%}, where the assumption list {\small\verb%A%} may not be empty if the tactic is
+invalid; {\small\verb%PROVE%} has no inbuilt validity-checking.
+
+\FAILURE
+Fails if the term is not of type {\small\verb%bool%} (and so cannot possibly be
+the conclusion of a theorem), or if the tactic cannot solve the goal.
+In the latter case {\small\verb%PROVE%} will list the unsolved goals to help the user.
+
+\SEEALSO
+TAC_PROOF, prove, prove_thm, VALID.
+
+\ENDDOC
\DOC{PROVE\_HYP}
\TYPE {\small\verb%PROVE_HYP : (thm -> thm -> thm)%}\egroup
@@ -20940,45 +20938,6 @@ Evaluating {\small\verb%quit()%} termina
Never fails.
\ENDDOC
-\DOC{r}
-
-\TYPE {\small\verb%r : (int -> void)%}\egroup
-
-\SYNOPSIS
-Reorders the subgoals on top of the subgoal package goal stack.
-
-\DESCRIBE
-The function {\small\verb%r%} is part of the subgoal package. It is an abbreviation for
-{\small\verb%rotate%}. For a description of the subgoal package, see {\small\verb%set_goal%}.
-
-\FAILURE
-As for {\small\verb%rotate%}.
-
-\USES
-Proving subgoals in a different order to that generated by the subgoal package.
-
-\SEEALSO
-b, backup, backup_limit, e, expand, expandf, g, get_state, p, print_state,
-rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
-
-\ENDDOC
-\DOC{rand}
-
-\TYPE {\small\verb%rand : (term -> term)%}\egroup
-
-\SYNOPSIS
-Returns the operand from a combination (function application).
-
-\DESCRIBE
-{\small\verb%rand "t1 t2"%} returns {\small\verb%"t2"%}.
-
-\FAILURE
-Fails with {\small\verb%rand%} if term is not a combination.
-
-\SEEALSO
-rator, dest_comb.
-
-\ENDDOC
\DOC{RAND\_CONV}
\TYPE {\small\verb%RAND_CONV : (conv -> conv)%}\egroup
@@ -21016,21 +20975,21 @@ function returned by {\small\verb%RAND_C
ABS_CONV, RATOR_CONV, SUB_CONV.
\ENDDOC
-\DOC{rator}
+\DOC{rand}
-\TYPE {\small\verb%rator : (term -> term)%}\egroup
+\TYPE {\small\verb%rand : (term -> term)%}\egroup
\SYNOPSIS
-Returns the operator from a combination (function application).
+Returns the operand from a combination (function application).
\DESCRIBE
-{\small\verb%rator("t1 t2")%} returns {\small\verb%"t1"%}.
+{\small\verb%rand "t1 t2"%} returns {\small\verb%"t2"%}.
\FAILURE
-Fails with {\small\verb%rator%} if term is not a combination.
+Fails with {\small\verb%rand%} if term is not a combination.
\SEEALSO
-rand, dest_comb.
+rator, dest_comb.
\ENDDOC
\DOC{RATOR\_CONV}
@@ -21070,6 +21029,45 @@ function returned by {\small\verb%RATOR_
ABS_CONV, RAND_CONV, SUB_CONV.
\ENDDOC
+\DOC{rator}
+
+\TYPE {\small\verb%rator : (term -> term)%}\egroup
+
+\SYNOPSIS
+Returns the operator from a combination (function application).
+
+\DESCRIBE
+{\small\verb%rator("t1 t2")%} returns {\small\verb%"t1"%}.
+
+\FAILURE
+Fails with {\small\verb%rator%} if term is not a combination.
+
+\SEEALSO
+rand, dest_comb.
+
+\ENDDOC
+\DOC{r}
+
+\TYPE {\small\verb%r : (int -> void)%}\egroup
+
+\SYNOPSIS
+Reorders the subgoals on top of the subgoal package goal stack.
+
+\DESCRIBE
+The function {\small\verb%r%} is part of the subgoal package. It is an abbreviation for
+{\small\verb%rotate%}. For a description of the subgoal package, see {\small\verb%set_goal%}.
+
+\FAILURE
+As for {\small\verb%rotate%}.
+
+\USES
+Proving subgoals in a different order to that generated by the subgoal package.
+
+\SEEALSO
+b, backup, backup_limit, e, expand, expandf, g, get_state, p, print_state,
+rotate, save_top_thm, set_goal, set_state, top_goal, top_thm.
+
+\ENDDOC
\DOC{read}
\TYPE {\small\verb%read : (string -> string)%}\egroup
@@ -21091,63 +21089,26 @@ descriptor.
\EXAMPLE
The following assumes that HOL is being run under Unix. It will overwrite an
existing file {\small\verb%test-file%} in the current directory. Notice that the actual
-string returned by {\small\verb%openi%} may vary on other systems.
-{\par\samepage\setseps\small
-\begin{verbatim}
- #system `echo "Hi" >test-file`;;
- 0 : int
-
- #let port = openi `test-file`;;
- port = `%test-file` : string
-
- #read port, read port, read port, read port, read port;;
- (`H`, `i`, `
- `, `nil`, `nil`)
- : (string # string # string # string # string)
-
- #close port;;
- () : void
-\end{verbatim}
-}
-\SEEALSO
-append_openw, close, openi, openw, tty_read, tty_write, write.
-
-\ENDDOC
-\DOC{RecordStep}
-
-\TYPE {\small\verb%RecordStep : step -> void%}\egroup
-
-
-\SYNOPSIS
-Record a single inference step.
-
-\DESCRIBE
-A proof is a list of inference steps. After the proof recorder is
-enabled, every inference performed by the system is recorded and
-cumulated in an internal buffer. When a proof is completed, the raw
-records can then be processed and output to a disk file.
-
-{\small\verb%record_proof%} is a system function for recording a single proof step.
-The type {\small\verb%step%} represents a basic inference step. It contains all
-the necessary information of each inference. There are currently 52
-basic inferences which are being recorded. All other ML functions
-representing inference rules are implemented by these basic
-inferences.
-If the proof recorder is enabled when an inference is performed,
-{\small\verb%RecordStep%} will add a step into the internal buffer.
+string returned by {\small\verb%openi%} may vary on other systems.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #system `echo "Hi" >test-file`;;
+ 0 : int
-\FAILURE
-Never fail.
+ #let port = openi `test-file`;;
+ port = `%test-file` : string
-\COMMENTS
-This is a system function implementing the proof recorded. Users
-should not use this function directly. User functions are provided in
-the library {\small\verb%record_proof%}. When new basic inference rule
-is implemented, this function should be called to record the inference step.
+ #read port, read port, read port, read port, read port;;
+ (`H`, `i`, `
+ `, `nil`, `nil`)
+ : (string # string # string # string # string)
+ #close port;;
+ () : void
+\end{verbatim}
+}
\SEEALSO
-record_proof, is_recording_proof, get_steps,
-suspend_recording, resume_recording.
+append_openw, close, openi, openw, tty_read, tty_write, write.
\ENDDOC
\DOC{record\_proof}
@@ -21225,6 +21186,43 @@ new_proof_file, close_proof_file, begin_
TAC_PROOF, PROVE, prove, prove_thm.
\ENDDOC
+\DOC{RecordStep}
+
+\TYPE {\small\verb%RecordStep : step -> void%}\egroup
+
+
+\SYNOPSIS
+Record a single inference step.
+
+\DESCRIBE
+A proof is a list of inference steps. After the proof recorder is
+enabled, every inference performed by the system is recorded and
+cumulated in an internal buffer. When a proof is completed, the raw
+records can then be processed and output to a disk file.
+
+{\small\verb%record_proof%} is a system function for recording a single proof step.
+The type {\small\verb%step%} represents a basic inference step. It contains all
+the necessary information of each inference. There are currently 52
+basic inferences which are being recorded. All other ML functions
+representing inference rules are implemented by these basic
+inferences.
+If the proof recorder is enabled when an inference is performed,
+{\small\verb%RecordStep%} will add a step into the internal buffer.
+
+\FAILURE
+Never fail.
+
+\COMMENTS
+This is a system function implementing the proof recorded. Users
+should not use this function directly. User functions are provided in
+the library {\small\verb%record_proof%}. When new basic inference rule
+is implemented, this function should be called to record the inference step.
+
+\SEEALSO
+record_proof, is_recording_proof, get_steps,
+suspend_recording, resume_recording.
+
+\ENDDOC
\DOC{REDEPTH\_CONV}
\TYPE {\small\verb%REDEPTH_CONV : (conv -> conv)%}\egroup
@@ -21373,25 +21371,6 @@ Fails if the name was not associated wit
set_sticky_type, sticky_list.
\ENDDOC
-\DOC{REPEAT}
-
-\TYPE {\small\verb%REPEAT : (tactic -> tactic)%}\egroup
-
-\SYNOPSIS
-Repeatedly applies a tactic until it fails.
-
-\DESCRIBE
-The tactic {\small\verb%REPEAT T%} is a tactic which applies {\small\verb%T%} to a goal, and while it
-succeeds, continues applying it to all subgoals generated.
-
-\FAILURE
-The application of {\small\verb%REPEAT%} to a tactic never fails, and neither does the
-composite tactic, even if the basic tactic fails immediately.
-
-\SEEALSO
-EVERY, FIRST, ORELSE, THEN, THENL.
-
-\ENDDOC
\DOC{REPEATC}
\TYPE {\small\verb%REPEATC : (conv -> conv)%}\egroup
@@ -21412,6 +21391,25 @@ returns {\small\verb%|- t1 = t(n+1)%}. A
Never fails, but can diverge if the supplied conversion never fails.
\ENDDOC
+\DOC{REPEAT}
+
+\TYPE {\small\verb%REPEAT : (tactic -> tactic)%}\egroup
+
+\SYNOPSIS
+Repeatedly applies a tactic until it fails.
+
+\DESCRIBE
+The tactic {\small\verb%REPEAT T%} is a tactic which applies {\small\verb%T%} to a goal, and while it
+succeeds, continues applying it to all subgoals generated.
+
+\FAILURE
+The application of {\small\verb%REPEAT%} to a tactic never fails, and neither does the
+composite tactic, even if the basic tactic fails immediately.
+
+\SEEALSO
+EVERY, FIRST, ORELSE, THEN, THENL.
+
+\ENDDOC
\DOC{REPEAT\_GTCL}
\TYPE {\small\verb%REPEAT_GTCL : (thm_tactical -> thm_tactical)%}\egroup
@@ -21492,20 +21490,6 @@ example the following goal:
REPEAT_GTCL, THEN_TCL.
\ENDDOC
-\DOC{replicate}
-
-\TYPE {\small\verb%replicate : (* -> int -> * list)%}\egroup
-
-\SYNOPSIS
-Makes a list consisting of a value replicated a specified number of times.
-
-\DESCRIBE
-{\small\verb%replicate x n%} returns {\small\verb%[x;...;x]%}, a list of length {\small\verb%n%}.
-
-\FAILURE
-Fails if number of replications is less than zero.
-
-\ENDDOC
\DOC{rep\_goals}
\TYPE {\small\verb%rep_goals : (goalstack -> subgoals list)%}\egroup
@@ -21515,43 +21499,18 @@ This function is for internal use only a
version of the system. It should not be used.
\ENDDOC
-\DOC{resume\_recording}
-
-\TYPE {\small\verb%resume_recording : void -> void%}\egroup
+\DOC{replicate}
+\TYPE {\small\verb%replicate : (* -> int -> * list)%}\egroup
\SYNOPSIS
-Suspend proof recording temporarily.
+Makes a list consisting of a value replicated a specified number of times.
\DESCRIBE
-A proof is a list of inference steps. After the proof recorder is
-enabled, every inference performed by the system is recorded and
-cumulated in an internal buffer. When a proof is completed, the raw
-records can then be processed and output to a disk file.
-
-{\small\verb%resume_recording%} is a low level user function for managing the proof
-recorder. It resumes the proof recorder without clearing the internal
-inference step buffer. The proof recorder should be in the suspended state.
-Otherwise, this function does nothing.
-
-The current state of the proof recorder can interrogated using the
-function {\small\verb%is_recording_proof%}. A value of {\small\verb%false%} indicates the proof
-recorder is disabled.
+{\small\verb%replicate x n%} returns {\small\verb%[x;...;x]%}, a list of length {\small\verb%n%}.
\FAILURE
-Never fail.
-
-\COMMENTS
-This function is used to implement higher level user functions for
-recording proof in the library {\small\verb%record_proof%}. It is much more
-convenient to use those functions than the low level functions
-such as {\small\verb%resume_recording%} directly.
-
-\SEEALSO
-record_proof, is_recording_proof, RecordStep, get_steps, suspend_recording,
-current_proof, current_proof_file,
-new_proof_file, close_proof_file, begin_proof, end_proof,
-TAC_PROOF, PROVE, prove, prove_thm.
+Fails if number of replications is less than zero.
\ENDDOC
\DOC{RES\_CANON}
@@ -21757,60 +21716,126 @@ assumptions of a goal. {\small\verb%RES_
implications used for resolution are taken from the assumptions of the goal
itself, rather than supplied as an argument.
-When applied to a goal {\small\verb%A ?- g%}, the tactic {\small\verb%RES_THEN ttac%} uses {\small\verb%RES_CANON%} to
-obtain a set of implicative theorems in canonical form from the assumptions {\small\verb%A%}
-of the goal. Each of the resulting theorems (if there are any) will have the
-form:
-{\par\samepage\setseps\small
-\begin{verbatim}
- ai |- !x1...xn. ui ==> vi
-\end{verbatim}
-}
-\noindent where {\small\verb%ai%} is one of the assumptions of the goal. Having obtained
-these implications, {\small\verb%RES_THEN%} then attempts to match each antecedent {\small\verb%ui%} to
-each assumption {\small\verb%aj |- aj%} in the assumptions {\small\verb%A%}. If the antecedent {\small\verb%ui%} of
-any implication matches the conclusion {\small\verb%aj%} of any assumption, then an instance
-of the theorem {\small\verb%ai, aj |- vi%}, called a `resolvent', is obtained by
-specialization of the variables {\small\verb%x1%}, ..., {\small\verb%xn%} and type instantiation,
-followed by an application of modus ponens. There may be more than one
-canonical implication derivable from the assumptions of the goal and each
-such implication is tried against every assumption, so there may be several
-resolvents (or, indeed, none).
+When applied to a goal {\small\verb%A ?- g%}, the tactic {\small\verb%RES_THEN ttac%} uses {\small\verb%RES_CANON%} to
+obtain a set of implicative theorems in canonical form from the assumptions {\small\verb%A%}
+of the goal. Each of the resulting theorems (if there are any) will have the
+form:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ ai |- !x1...xn. ui ==> vi
+\end{verbatim}
+}
+\noindent where {\small\verb%ai%} is one of the assumptions of the goal. Having obtained
+these implications, {\small\verb%RES_THEN%} then attempts to match each antecedent {\small\verb%ui%} to
+each assumption {\small\verb%aj |- aj%} in the assumptions {\small\verb%A%}. If the antecedent {\small\verb%ui%} of
+any implication matches the conclusion {\small\verb%aj%} of any assumption, then an instance
+of the theorem {\small\verb%ai, aj |- vi%}, called a `resolvent', is obtained by
+specialization of the variables {\small\verb%x1%}, ..., {\small\verb%xn%} and type instantiation,
+followed by an application of modus ponens. There may be more than one
+canonical implication derivable from the assumptions of the goal and each
+such implication is tried against every assumption, so there may be several
+resolvents (or, indeed, none).
+
+Tactics are produced using the theorem-tactic {\small\verb%ttac%} from all these resolvents
+(failures of {\small\verb%ttac%} at this stage are filtered out) and these tactics are then
+applied in an unspecified sequence to the goal. That is,
+{\par\samepage\setseps\small
+\begin{verbatim}
+ RES_THEN ttac (A ?- g)
+\end{verbatim}
+}
+\noindent has the effect of:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ MAP_EVERY (mapfilter ttac [... ; (ai,aj |- vi) ; ...]) (A ?- g)
+\end{verbatim}
+}
+\noindent where the theorems {\small\verb%ai,aj |- vi%} are all the consequences that can be
+drawn by a (single) matching modus-ponens inference from the assumptions {\small\verb%A%}
+and the implications derived using {\small\verb%RES_CANON%} from the assumptions. The
+sequence in which the theorems {\small\verb%ai,aj |- vi%} are generated and the
+corresponding tactics applied is unspecified.
+
+\FAILURE
+Evaluating {\small\verb%RES_THEN ttac th%} fails with `{\small\verb%no implication%}' if no
+implication(s) can be derived from the assumptions of the goal by the
+transformation process described under the entry for {\small\verb%RES_CANON%}. Evaluating
+{\small\verb%RES_THEN ttac (A ?- g)%} fails with `{\small\verb%no resolvents%}' if no assumption of the
+goal {\small\verb%A ?- g%} can be resolved with the derived implication or implications.
+Evaluation also fails, with `{\small\verb%no tactics%}', if there are resolvents, but for
+every resolvent {\small\verb%ai,aj |- vi%} evaluating the application {\small\verb%ttac (ai,aj |- vi)%}
+fails---that is, if for every resolvent {\small\verb%ttac%} fails to produce a tactic.
+Finally, failure is propagated if any of the tactics that are produced from the
+resolvents by {\small\verb%ttac%} fails when applied in sequence to the goal.
+
+\SEEALSO
+IMP_RES_TAC, IMP_RES_THEN, MATCH_MP, RES_CANON, RES_TAC.
+
+\ENDDOC
+\DOC{resume\_recording}
+
+\TYPE {\small\verb%resume_recording : void -> void%}\egroup
+
+
+\SYNOPSIS
+Suspend proof recording temporarily.
+
+\DESCRIBE
+A proof is a list of inference steps. After the proof recorder is
+enabled, every inference performed by the system is recorded and
+cumulated in an internal buffer. When a proof is completed, the raw
+records can then be processed and output to a disk file.
+
+{\small\verb%resume_recording%} is a low level user function for managing the proof
+recorder. It resumes the proof recorder without clearing the internal
+inference step buffer. The proof recorder should be in the suspended state.
+Otherwise, this function does nothing.
+
+The current state of the proof recorder can interrogated using the
+function {\small\verb%is_recording_proof%}. A value of {\small\verb%false%} indicates the proof
+recorder is disabled.
+
+\FAILURE
+Never fail.
+
+\COMMENTS
+This function is used to implement higher level user functions for
+recording proof in the library {\small\verb%record_proof%}. It is much more
+convenient to use those functions than the low level functions
+such as {\small\verb%resume_recording%} directly.
+
+\SEEALSO
+record_proof, is_recording_proof, RecordStep, get_steps, suspend_recording,
+current_proof, current_proof_file,
+new_proof_file, close_proof_file, begin_proof, end_proof,
+TAC_PROOF, PROVE, prove, prove_thm.
+
+\ENDDOC
+\DOC{rev\_assoc}
+
+\TYPE {\small\verb%rev_assoc : (* -> (** # *) list -> (** # *))%}\egroup
+
+\SYNOPSIS
+Searches a list of pairs for a pair whose second component equals a specified
+value.
+
+\DESCRIBE
+{\small\verb%rev_assoc y [(x1,y1);...;(xn,yn)]%} returns the first {\small\verb%(xi,yi)%} in the list
+such that {\small\verb%yi%} equals {\small\verb%y%}.
+
+\FAILURE
+Fails if no matching pair is found. This will always be the case if the list
+is empty.
-Tactics are produced using the theorem-tactic {\small\verb%ttac%} from all these resolvents
-(failures of {\small\verb%ttac%} at this stage are filtered out) and these tactics are then
-applied in an unspecified sequence to the goal. That is,
-{\par\samepage\setseps\small
-\begin{verbatim}
- RES_THEN ttac (A ?- g)
-\end{verbatim}
-}
-\noindent has the effect of:
+\EXAMPLE
{\par\samepage\setseps\small
\begin{verbatim}
- MAP_EVERY (mapfilter ttac [... ; (ai,aj |- vi) ; ...]) (A ?- g)
+#rev_assoc 2 [(1,4);(3,2);(2,5);(2,6)];;
+(3, 2) : (int # int)
\end{verbatim}
}
-\noindent where the theorems {\small\verb%ai,aj |- vi%} are all the consequences that can be
-drawn by a (single) matching modus-ponens inference from the assumptions {\small\verb%A%}
-and the implications derived using {\small\verb%RES_CANON%} from the assumptions. The
-sequence in which the theorems {\small\verb%ai,aj |- vi%} are generated and the
-corresponding tactics applied is unspecified.
-
-\FAILURE
-Evaluating {\small\verb%RES_THEN ttac th%} fails with `{\small\verb%no implication%}' if no
-implication(s) can be derived from the assumptions of the goal by the
-transformation process described under the entry for {\small\verb%RES_CANON%}. Evaluating
-{\small\verb%RES_THEN ttac (A ?- g)%} fails with `{\small\verb%no resolvents%}' if no assumption of the
-goal {\small\verb%A ?- g%} can be resolved with the derived implication or implications.
-Evaluation also fails, with `{\small\verb%no tactics%}', if there are resolvents, but for
-every resolvent {\small\verb%ai,aj |- vi%} evaluating the application {\small\verb%ttac (ai,aj |- vi)%}
-fails---that is, if for every resolvent {\small\verb%ttac%} fails to produce a tactic.
-Finally, failure is propagated if any of the tactics that are produced from the
-resolvents by {\small\verb%ttac%} fails when applied in sequence to the goal.
-
\SEEALSO
-IMP_RES_TAC, IMP_RES_THEN, MATCH_MP, RES_CANON, RES_TAC.
+assoc, find, mem, tryfind, exists, forall.
\ENDDOC
\DOC{rev}
@@ -21871,33 +21896,6 @@ FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV.
\ENDDOC
-\DOC{rev\_assoc}
-
-\TYPE {\small\verb%rev_assoc : (* -> (** # *) list -> (** # *))%}\egroup
-
-\SYNOPSIS
-Searches a list of pairs for a pair whose second component equals a specified
-value.
-
-\DESCRIBE
-{\small\verb%rev_assoc y [(x1,y1);...;(xn,yn)]%} returns the first {\small\verb%(xi,yi)%} in the list
-such that {\small\verb%yi%} equals {\small\verb%y%}.
-
-\FAILURE
-Fails if no matching pair is found. This will always be the case if the list
-is empty.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#rev_assoc 2 [(1,4);(3,2);(2,5);(2,6)];;
-(3, 2) : (int # int)
-\end{verbatim}
-}
-\SEEALSO
-assoc, find, mem, tryfind, exists, forall.
-
-\ENDDOC
\DOC{rev\_itlist}
\TYPE {\small\verb%rev_itlist : ((* -> ** -> **) -> * list -> ** -> **)%}\egroup
@@ -21923,185 +21921,72 @@ Never fails.
itlist, end_itlist.
\ENDDOC
-\DOC{REWRITE\_CONV}
-
-\TYPE {\small\verb%REWRITE_CONV : (thm list -> conv)%}\egroup
-
-\SYNOPSIS
-Rewrites a term including built-in tautologies in the list of rewrites.
-
-\DESCRIBE
-Rewriting a term using {\small\verb%REWRITE_CONV%} utilizes as rewrites two sets
-of theorems: the tautologies in the ML list {\small\verb%basic_rewrites%} and the
-ones supplied by the user. The rule searches top-down and recursively
-for subterms which match the left-hand side of any of the possible
-rewrites, until none of the transformations are applicable. There is no
-ordering specified among the set of rewrites.
-
-Variants of this conversion allow changes in the set of equations used:
-{\small\verb%PURE_REWRITE_CONV%} and others in its family do not rewrite with the
-theorems in {\small\verb%basic_rewrites%}.
-
-The top-down recursive search for matches may not be desirable, as
-this may increase the number of inferences being made or may result in
-divergence. In this case other rewriting tools such as
-{\small\verb%ONCE_REWRITE_CONV%} and {\small\verb%GEN_REWRITE_CONV%} can be used, or the set of
-theorems given may be reduced.
-
-See {\small\verb%GEN_REWRITE_CONV%} for the general strategy for simplifying
-theorems in HOL using equational theorems.
-
-\FAILURE
-Does not fail, but may diverge if the sequence of rewrites is
-non-terminating.
-
-\USES
-Used to manipulate terms by rewriting them with theorems.
-While resulting in high degree of automation, {\small\verb%REWRITE_CONV%} can
-spawn a large number of inference steps. Thus, variants such
-as {\small\verb%PURE_REWRITE_CONV%}, or other rules such as {\small\verb%SUBST_CONV%}, may be used
-instead to improve efficiency.
-
-\SEEALSO
-basic_rewrites, GEN_REWRITE_CONV, ONCE_REWRITE_CONV,
-PURE_REWRITE_CONV, REWR_CONV, SUBST_CONV.
-
-\ENDDOC
-\DOC{REWRITE\_RULE}
-
-\TYPE {\small\verb%REWRITE_RULE : (thm list -> thm -> thm)%}\egroup
-
-\SYNOPSIS
-Rewrites a theorem including built-in tautologies in the list of rewrites.
-
-\DESCRIBE
-Rewriting a theorem using {\small\verb%REWRITE_RULE%} utilizes as rewrites two sets
-of theorems: the tautologies in the ML list {\small\verb%basic_rewrites%} and the
-ones supplied by the user. The rule searches top-down and recursively
-for subterms which match the left-hand side of any of the possible
-rewrites, until none of the transformations are applicable. There is no
-ordering specified among the set of rewrites.
-
-Variants of this rule allow changes in the set of equations used:
-{\small\verb%PURE_REWRITE_RULE%} and others in its family do not rewrite with the
-theorems in {\small\verb%basic_rewrites%}. Rules such as {\small\verb%ASM_REWRITE_RULE%} add the
-assumptions of the object theorem (or a specified subset of these assumptions)
-to the set of possible rewrites.
-
-The top-down recursive search for matches may not be desirable, as
-this may increase the number of inferences being made or may result in
-divergence. In this case other rewriting tools such as
-{\small\verb%ONCE_REWRITE_RULE%} and {\small\verb%GEN_REWRITE_RULE%} can be used, or the set of
-theorems given may be reduced.
-
-See {\small\verb%GEN_REWRITE_RULE%} for the general strategy for simplifying
-theorems in HOL using equational theorems.
-
-\FAILURE
-Does not fail, but may diverge if the sequence of rewrites is
-non-terminating.
-
-\USES
-Used to manipulate theorems by rewriting them with other theorems.
-While resulting in high degree of automation, {\small\verb%REWRITE_RULE%} can
-spawn a large number of inference steps. Thus, variants such
-as {\small\verb%PURE_REWRITE_RULE%}, or other rules such as {\small\verb%SUBST%}, may be used
-instead to improve efficiency.
-
-\SEEALSO
-ASM_REWRITE_RULE, basic_rewrites, GEN_REWRITE_RULE, ONCE_REWRITE_RULE,
-PURE_REWRITE_RULE, REWR_CONV, REWRITE_CONV, SUBST.
-
-\ENDDOC
-\DOC{REWRITE\_TAC}
+\DOC{REW\_DEPTH\_CONV}
-\TYPE {\small\verb%REWRITE_TAC : (thm list -> tactic)%}\egroup
+\TYPE {\small\verb%REW_DEPTH_CONV : (conv -> conv)%}\egroup
\SYNOPSIS
-Rewrites a goal including built-in tautologies in the list of rewrites.
+Applies a conversion top-down to all subterms, retraversing changed ones.
+For use in rewriting.
\DESCRIBE
-Rewriting tactics in HOL provide a recursive left-to-right matching
-and rewriting facility that automatically decomposes subgoals and
-justifies segments of proof in which equational theorems are used,
-singly or collectively. These include the unfolding of definitions,
-and the substitution of equals for equals. Rewriting is used either
-to advance or to complete the decomposition of subgoals.
-
-{\small\verb%REWRITE_TAC%} transforms (or solves) a goal by using as rewrite rules
-(i.e. as left-to-right replacement rules) the conclusions of the given
-list of (equational) theorems, as well as a set of built-in theorems
-(common tautologies) held in the ML variable {\small\verb%basic_rewrites%}.
-Recognition of a tautology often terminates the subgoaling process
-(i.e. solves the goal).
-
-The equational rewrites generated are applied recursively and to
-arbitrary depth, with matching and instantiation of variables and type
-variables. A list of rewrites can set off an infinite rewriting
-process, and it is not, of course, decidable in general whether a
-rewrite set has that property. The order in which the rewrite theorems
-are applied is unspecified, and the user should not depend on any
-ordering.
-
-See {\small\verb%GEN_REWRITE_TAC%} for more details on the rewriting process.
-Variants of {\small\verb%REWRITE_TAC%} allow the use of a different set of
-rewrites. Some of them, such as {\small\verb%PURE_REWRITE_TAC%}, exclude the basic
-tautologies from the possible transformations. {\small\verb%ASM_REWRITE_TAC%} and
-others include the assumptions at the goal in the set of possible
-rewrites.
+{\small\verb%REW_DEPTH_CONV c tm%} repeatedly applies the conversion {\small\verb%c%} to all the subterms
+of the term {\small\verb%tm%}, including the term {\small\verb%tm%} itself. The supplied conversion {\small\verb%c%}
+is applied to the subterms of {\small\verb%tm%} in top-down order and is applied repeatedly
+(zero or more times, as is done by {\small\verb%REPEATC%}) at each subterm until it fails.
+If a subterm {\small\verb%t%} is changed (up to alpha-equivalence) by virtue of the
+application of {\small\verb%c%} to its own subterms, then the term into which {\small\verb%t%} is
+transformed is retraversed by applying {\small\verb%REW_DEPTH_CONV c%} to it.
-Still other tactics allow greater control over the search for
-rewritable subterms. Several of them such as {\small\verb%ONCE_REWRITE_TAC%} do not
-apply rewrites recursively. {\small\verb%GEN_REWRITE_TAC%} allows a rewrite to be
-applied at a particular subterm.
+{\small\verb%REW_DEPTH_CONV%} is a special version of {\small\verb%TOP_DEPTH_CONV%} for use by the
+rewriting conversions, rules and tactics. It differs from {\small\verb%TOP_DEPTH_CONV%} as
+follows: If converting an abstraction fails due to the presence of the bound
+variable in the hypotheses of the theorem generated by converting the body,
+{\small\verb%REW_DEPTH_CONV%} retries the conversion having renamed the bound variable of
+the abstraction. If successful the renaming is reversed.
\FAILURE
-{\small\verb%REWRITE_TAC%} does not fail. Certain sets of rewriting theorems on
-certain goals may cause a non-terminating sequence of rewrites.
-Divergent rewriting behaviour results from a term {\small\verb%t%} being
-immediately or eventually rewritten to a term containing {\small\verb%t%} as a
-sub-term. The exact behaviour depends on the {\small\verb%HOL%} implementation; it
-may be possible (unfortunately) to fall into Lisp in this event.
+{\small\verb%REW_DEPTH_CONV c tm%} never fails but can diverge.
\EXAMPLE
-The arithmetic theorem {\small\verb%GREATER%}, {\small\verb%|- !m n. m > n = n < m%}, is used
-below to advance a goal:
+The following example illustrates the difference between the functions
+{\small\verb%REW_DEPTH_CONV%} and {\small\verb%TOP_DEPTH_CONV%}. It is not intended to illustrate the
+full range of behaviour of the former. Both {\small\verb%REW_DEPTH_CONV%} and
+{\small\verb%TOP_DEPTH_CONV%} successfully apply the theorem {\small\verb%ADD_0%} inside an abstraction:
{\par\samepage\setseps\small
\begin{verbatim}
- #REWRITE_TAC[GREATER]([],"5 > 4");;
- ([([], "4 < 5")], -) : subgoals
+ #REW_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
+ |- (\n. n + 0) = (\n. n)
+
+ #TOP_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
+ |- (\n. n + 0) = (\n. n)
\end{verbatim}
}
-\noindent It is used below with the theorem {\small\verb%LESS_0%},
-{\small\verb%|- !n. 0 < (SUC n)%}, to solve a goal:
+\noindent However, if a hypothesis containing a free occurrence of the bound
+variable is added to the rewrite rule, it interferes with the operation of
+{\small\verb%TOP_DEPTH_CONV%} but not that of {\small\verb%REW_DEPTH_CONV%}:
{\par\samepage\setseps\small
\begin{verbatim}
- #let gl,p = REWRITE_TAC[GREATER;LESS_0]([],"(SUC n) > 0");;
- gl = [] : goal list
- p = - : proof
+ #let th = ADD_ASSUM "n = 0" ADD_0;;
+ th = n = 0 |- !m. m + 0 = m
+
+ #REW_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
+ n = 0 |- (\n. n + 0) = (\n. n)
- #p[];;
- |- (SUC n) > 0
+ #TOP_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
+ |- (\n. n + 0) = (\n. n + 0)
\end{verbatim}
}
-\USES
-Rewriting is a powerful and general mechanism in HOL, and an
-important part of many proofs. It relieves the user of the burden of
-directing and justifying a large number of minor proof steps.
-{\small\verb%REWRITE_TAC%} fits a forward proof sequence smoothly into the general
-goal-oriented framework. That is, (within one subgoaling step) it
-produces and justifies certain forward inferences, none of which are
-necessarily on a direct path to the desired goal.
-
-{\small\verb%REWRITE_TAC%} may be more powerful a tactic than is needed in certain
-situations; if efficiency is at stake, alternatives might be
-considered.
+\COMMENTS
+The implementation of this function uses failure to avoid rebuilding
+unchanged subterms. That is to say, during execution the failure string
+{\small\verb%`QCONV`%} may be generated and later trapped. The behaviour of the function
+is dependent on this use of failure. So, if the conversion given as argument
+happens to generate a failure with string {\small\verb%`QCONV`%}, the operation of
+{\small\verb%REW_DEPTH_CONV%} will be unpredictable.
\SEEALSO
-ASM_REWRITE_TAC, GEN_REWRITE_TAC, FILTER_ASM_REWRITE_TAC,
-FILTER_ONCE_ASM_REWRITE_TAC, ONCE_ASM_REWRITE_TAC, ONCE_REWRITE_TAC,
-PURE_ASM_REWRITE_TAC, PURE_ONCE_ASM_REWRITE_TAC,
-PURE_ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWR_CONV, REWRITE_CONV, SUBST_TAC.
+ONCE_REW_DEPTH_CONV, TOP_DEPTH_CONV.
\ENDDOC
\DOC{REWR\_CONV}
@@ -22271,72 +22156,185 @@ must be instantiated in order to match t
REWRITE_CONV.
\ENDDOC
-\DOC{REW\_DEPTH\_CONV}
+\DOC{REWRITE\_CONV}
-\TYPE {\small\verb%REW_DEPTH_CONV : (conv -> conv)%}\egroup
+\TYPE {\small\verb%REWRITE_CONV : (thm list -> conv)%}\egroup
\SYNOPSIS
-Applies a conversion top-down to all subterms, retraversing changed ones.
-For use in rewriting.
+Rewrites a term including built-in tautologies in the list of rewrites.
\DESCRIBE
-{\small\verb%REW_DEPTH_CONV c tm%} repeatedly applies the conversion {\small\verb%c%} to all the subterms
-of the term {\small\verb%tm%}, including the term {\small\verb%tm%} itself. The supplied conversion {\small\verb%c%}
-is applied to the subterms of {\small\verb%tm%} in top-down order and is applied repeatedly
-(zero or more times, as is done by {\small\verb%REPEATC%}) at each subterm until it fails.
-If a subterm {\small\verb%t%} is changed (up to alpha-equivalence) by virtue of the
-application of {\small\verb%c%} to its own subterms, then the term into which {\small\verb%t%} is
-transformed is retraversed by applying {\small\verb%REW_DEPTH_CONV c%} to it.
+Rewriting a term using {\small\verb%REWRITE_CONV%} utilizes as rewrites two sets
+of theorems: the tautologies in the ML list {\small\verb%basic_rewrites%} and the
+ones supplied by the user. The rule searches top-down and recursively
+for subterms which match the left-hand side of any of the possible
+rewrites, until none of the transformations are applicable. There is no
+ordering specified among the set of rewrites.
-{\small\verb%REW_DEPTH_CONV%} is a special version of {\small\verb%TOP_DEPTH_CONV%} for use by the
-rewriting conversions, rules and tactics. It differs from {\small\verb%TOP_DEPTH_CONV%} as
-follows: If converting an abstraction fails due to the presence of the bound
-variable in the hypotheses of the theorem generated by converting the body,
-{\small\verb%REW_DEPTH_CONV%} retries the conversion having renamed the bound variable of
-the abstraction. If successful the renaming is reversed.
+Variants of this conversion allow changes in the set of equations used:
+{\small\verb%PURE_REWRITE_CONV%} and others in its family do not rewrite with the
+theorems in {\small\verb%basic_rewrites%}.
+
+The top-down recursive search for matches may not be desirable, as
+this may increase the number of inferences being made or may result in
+divergence. In this case other rewriting tools such as
+{\small\verb%ONCE_REWRITE_CONV%} and {\small\verb%GEN_REWRITE_CONV%} can be used, or the set of
+theorems given may be reduced.
+
+See {\small\verb%GEN_REWRITE_CONV%} for the general strategy for simplifying
+theorems in HOL using equational theorems.
\FAILURE
-{\small\verb%REW_DEPTH_CONV c tm%} never fails but can diverge.
+Does not fail, but may diverge if the sequence of rewrites is
+non-terminating.
+
+\USES
+Used to manipulate terms by rewriting them with theorems.
+While resulting in high degree of automation, {\small\verb%REWRITE_CONV%} can
+spawn a large number of inference steps. Thus, variants such
+as {\small\verb%PURE_REWRITE_CONV%}, or other rules such as {\small\verb%SUBST_CONV%}, may be used
+instead to improve efficiency.
+
+\SEEALSO
+basic_rewrites, GEN_REWRITE_CONV, ONCE_REWRITE_CONV,
+PURE_REWRITE_CONV, REWR_CONV, SUBST_CONV.
+
+\ENDDOC
+\DOC{REWRITE\_RULE}
+
+\TYPE {\small\verb%REWRITE_RULE : (thm list -> thm -> thm)%}\egroup
+
+\SYNOPSIS
+Rewrites a theorem including built-in tautologies in the list of rewrites.
+
+\DESCRIBE
+Rewriting a theorem using {\small\verb%REWRITE_RULE%} utilizes as rewrites two sets
+of theorems: the tautologies in the ML list {\small\verb%basic_rewrites%} and the
+ones supplied by the user. The rule searches top-down and recursively
+for subterms which match the left-hand side of any of the possible
+rewrites, until none of the transformations are applicable. There is no
+ordering specified among the set of rewrites.
+
+Variants of this rule allow changes in the set of equations used:
+{\small\verb%PURE_REWRITE_RULE%} and others in its family do not rewrite with the
+theorems in {\small\verb%basic_rewrites%}. Rules such as {\small\verb%ASM_REWRITE_RULE%} add the
+assumptions of the object theorem (or a specified subset of these assumptions)
+to the set of possible rewrites.
+
+The top-down recursive search for matches may not be desirable, as
+this may increase the number of inferences being made or may result in
+divergence. In this case other rewriting tools such as
+{\small\verb%ONCE_REWRITE_RULE%} and {\small\verb%GEN_REWRITE_RULE%} can be used, or the set of
+theorems given may be reduced.
+
+See {\small\verb%GEN_REWRITE_RULE%} for the general strategy for simplifying
+theorems in HOL using equational theorems.
+
+\FAILURE
+Does not fail, but may diverge if the sequence of rewrites is
+non-terminating.
+
+\USES
+Used to manipulate theorems by rewriting them with other theorems.
+While resulting in high degree of automation, {\small\verb%REWRITE_RULE%} can
+spawn a large number of inference steps. Thus, variants such
+as {\small\verb%PURE_REWRITE_RULE%}, or other rules such as {\small\verb%SUBST%}, may be used
+instead to improve efficiency.
+
+\SEEALSO
+ASM_REWRITE_RULE, basic_rewrites, GEN_REWRITE_RULE, ONCE_REWRITE_RULE,
+PURE_REWRITE_RULE, REWR_CONV, REWRITE_CONV, SUBST.
+
+\ENDDOC
+\DOC{REWRITE\_TAC}
+
+\TYPE {\small\verb%REWRITE_TAC : (thm list -> tactic)%}\egroup
+
+\SYNOPSIS
+Rewrites a goal including built-in tautologies in the list of rewrites.
+
+\DESCRIBE
+Rewriting tactics in HOL provide a recursive left-to-right matching
+and rewriting facility that automatically decomposes subgoals and
+justifies segments of proof in which equational theorems are used,
+singly or collectively. These include the unfolding of definitions,
+and the substitution of equals for equals. Rewriting is used either
+to advance or to complete the decomposition of subgoals.
+
+{\small\verb%REWRITE_TAC%} transforms (or solves) a goal by using as rewrite rules
+(i.e. as left-to-right replacement rules) the conclusions of the given
+list of (equational) theorems, as well as a set of built-in theorems
+(common tautologies) held in the ML variable {\small\verb%basic_rewrites%}.
+Recognition of a tautology often terminates the subgoaling process
+(i.e. solves the goal).
+
+The equational rewrites generated are applied recursively and to
+arbitrary depth, with matching and instantiation of variables and type
+variables. A list of rewrites can set off an infinite rewriting
+process, and it is not, of course, decidable in general whether a
+rewrite set has that property. The order in which the rewrite theorems
+are applied is unspecified, and the user should not depend on any
+ordering.
+
+See {\small\verb%GEN_REWRITE_TAC%} for more details on the rewriting process.
+Variants of {\small\verb%REWRITE_TAC%} allow the use of a different set of
+rewrites. Some of them, such as {\small\verb%PURE_REWRITE_TAC%}, exclude the basic
+tautologies from the possible transformations. {\small\verb%ASM_REWRITE_TAC%} and
+others include the assumptions at the goal in the set of possible
+rewrites.
+
+Still other tactics allow greater control over the search for
+rewritable subterms. Several of them such as {\small\verb%ONCE_REWRITE_TAC%} do not
+apply rewrites recursively. {\small\verb%GEN_REWRITE_TAC%} allows a rewrite to be
+applied at a particular subterm.
+
+\FAILURE
+{\small\verb%REWRITE_TAC%} does not fail. Certain sets of rewriting theorems on
+certain goals may cause a non-terminating sequence of rewrites.
+Divergent rewriting behaviour results from a term {\small\verb%t%} being
+immediately or eventually rewritten to a term containing {\small\verb%t%} as a
+sub-term. The exact behaviour depends on the {\small\verb%HOL%} implementation; it
+may be possible (unfortunately) to fall into Lisp in this event.
\EXAMPLE
-The following example illustrates the difference between the functions
-{\small\verb%REW_DEPTH_CONV%} and {\small\verb%TOP_DEPTH_CONV%}. It is not intended to illustrate the
-full range of behaviour of the former. Both {\small\verb%REW_DEPTH_CONV%} and
-{\small\verb%TOP_DEPTH_CONV%} successfully apply the theorem {\small\verb%ADD_0%} inside an abstraction:
+The arithmetic theorem {\small\verb%GREATER%}, {\small\verb%|- !m n. m > n = n < m%}, is used
+below to advance a goal:
{\par\samepage\setseps\small
\begin{verbatim}
- #REW_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
- |- (\n. n + 0) = (\n. n)
-
- #TOP_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";;
- |- (\n. n + 0) = (\n. n)
+ #REWRITE_TAC[GREATER]([],"5 > 4");;
+ ([([], "4 < 5")], -) : subgoals
\end{verbatim}
}
-\noindent However, if a hypothesis containing a free occurrence of the bound
-variable is added to the rewrite rule, it interferes with the operation of
-{\small\verb%TOP_DEPTH_CONV%} but not that of {\small\verb%REW_DEPTH_CONV%}:
+\noindent It is used below with the theorem {\small\verb%LESS_0%},
+{\small\verb%|- !n. 0 < (SUC n)%}, to solve a goal:
{\par\samepage\setseps\small
\begin{verbatim}
- #let th = ADD_ASSUM "n = 0" ADD_0;;
- th = n = 0 |- !m. m + 0 = m
-
- #REW_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
- n = 0 |- (\n. n + 0) = (\n. n)
+ #let gl,p = REWRITE_TAC[GREATER;LESS_0]([],"(SUC n) > 0");;
+ gl = [] : goal list
+ p = - : proof
- #TOP_DEPTH_CONV (REWR_CONV th) "\n. n + 0";;
- |- (\n. n + 0) = (\n. n + 0)
+ #p[];;
+ |- (SUC n) > 0
\end{verbatim}
}
-\COMMENTS
-The implementation of this function uses failure to avoid rebuilding
-unchanged subterms. That is to say, during execution the failure string
-{\small\verb%`QCONV`%} may be generated and later trapped. The behaviour of the function
-is dependent on this use of failure. So, if the conversion given as argument
-happens to generate a failure with string {\small\verb%`QCONV`%}, the operation of
-{\small\verb%REW_DEPTH_CONV%} will be unpredictable.
+\USES
+Rewriting is a powerful and general mechanism in HOL, and an
+important part of many proofs. It relieves the user of the burden of
+directing and justifying a large number of minor proof steps.
+{\small\verb%REWRITE_TAC%} fits a forward proof sequence smoothly into the general
+goal-oriented framework. That is, (within one subgoaling step) it
+produces and justifies certain forward inferences, none of which are
+necessarily on a direct path to the desired goal.
+
+{\small\verb%REWRITE_TAC%} may be more powerful a tactic than is needed in certain
+situations; if efficiency is at stake, alternatives might be
+considered.
\SEEALSO
-ONCE_REW_DEPTH_CONV, TOP_DEPTH_CONV.
+ASM_REWRITE_TAC, GEN_REWRITE_TAC, FILTER_ASM_REWRITE_TAC,
+FILTER_ONCE_ASM_REWRITE_TAC, ONCE_ASM_REWRITE_TAC, ONCE_REWRITE_TAC,
+PURE_ASM_REWRITE_TAC, PURE_ONCE_ASM_REWRITE_TAC,
+PURE_ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWR_CONV, REWRITE_CONV, SUBST_TAC.
\ENDDOC
\DOC{rhs}
@@ -22722,20 +22720,6 @@ It does not matter if the goal has no as
ASSUM_LIST, MAP_EVERY, MAP_FIRST, POP_ASSUM_LIST.
\ENDDOC
-\DOC{S}
-
-\TYPE {\small\verb%S : ((* -> ** -> ***) -> (* -> **) -> * -> ***)%}\egroup
-
-\SYNOPSIS
-Performs function composition: {\small\verb%S f g x%} = {\small\verb%f x (g x)%} (the {\small\verb%S%} combinator).
-
-\FAILURE
-Never fails.
-
-\SEEALSO
-\#, B, C, CB, Co, I, K, KI, o, oo, W.
-
-\ENDDOC
\DOC{save}
\TYPE {\small\verb%save : (string -> void)%}\egroup
@@ -22977,10 +22961,24 @@ To sum the elements of a list and save t
}
\SEEALSO
-SCANL_CONV, FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV.
+SCANL_CONV, FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV.
+
+\ENDDOC
+
+\DOC{S}
+
+\TYPE {\small\verb%S : ((* -> ** -> ***) -> (* -> **) -> * -> ***)%}\egroup
+
+\SYNOPSIS
+Performs function composition: {\small\verb%S f g x%} = {\small\verb%f x (g x)%} (the {\small\verb%S%} combinator).
+
+\FAILURE
+Never fails.
+
+\SEEALSO
+\#, B, C, CB, Co, I, K, KI, o, oo, W.
\ENDDOC
-
\DOC{search\_path}
\TYPE {\small\verb%search_path : (void -> string list)%}\egroup
@@ -23327,35 +23325,6 @@ constant defined using the epsilon opera
CHOOSE, SELECT_AX, SELECT_CONV, SELECT_ELIM, SELECT_INTRO.
\ENDDOC
-\DOC{setify}
-
-\TYPE {\small\verb%setify : (* list -> * list)%}\egroup
-
-\SYNOPSIS
-Removes repeated elements from a list. Makes a list into a `set'.
-
-\DESCRIBE
-{\small\verb%setify l%} removes repeated elements from {\small\verb%l%}, leaving the last occurrence of
-each duplicate in the list.
-
-\FAILURE
-Never fails.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#setify [1;2;3;1;4;3];;
-[2; 1; 4; 3] : int list
-\end{verbatim}
-}
-\COMMENTS
-Perhaps the first occurrence of each duplicate should be left in the list, not
-the last? However, other functions may rely on the ordering currently used.
-
-\SEEALSO
-distinct.
-
-\ENDDOC
\DOC{set\_equal}
\TYPE {\small\verb%set_equal : (* list -> * list -> bool)%}\egroup
@@ -23599,6 +23568,35 @@ Never fails.
help_search_path, install, search_path, set_search_path.
\ENDDOC
+\DOC{setify}
+
+\TYPE {\small\verb%setify : (* list -> * list)%}\egroup
+
+\SYNOPSIS
+Removes repeated elements from a list. Makes a list into a `set'.
+
+\DESCRIBE
+{\small\verb%setify l%} removes repeated elements from {\small\verb%l%}, leaving the last occurrence of
+each duplicate in the list.
+
+\FAILURE
+Never fails.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#setify [1;2;3;1;4;3];;
+[2; 1; 4; 3] : int list
+\end{verbatim}
+}
+\COMMENTS
+Perhaps the first occurrence of each duplicate should be left in the list, not
+the last? However, other functions may rely on the ordering currently used.
+
+\SEEALSO
+distinct.
+
+\ENDDOC
\DOC{set\_interface\_map}
\TYPE {\small\verb%set_interface_map : ((string # string) list -> (string # string) list)%}\egroup
@@ -24272,6 +24270,45 @@ that the `ordering' is not antisymmetric
\end{verbatim}
}
\ENDDOC
+\DOC{SPEC\_ALL}
+
+\TYPE {\small\verb%SPEC_ALL : (thm -> thm)%}\egroup
+
+\SYNOPSIS
+Specializes the conclusion of a theorem with its own quantified variables.
+
+\DESCRIBE
+When applied to a theorem {\small\verb%A |- !x1...xn. t%}, the inference rule {\small\verb%SPEC_ALL%}
+returns the theorem {\small\verb%A |- t[x1'/x1]...[xn'/xn]%} where the {\small\verb%xi'%} are distinct
+variants of the corresponding {\small\verb%xi%}, chosen to avoid clashes with any variables
+free in the assumption list and with the names of constants. Normally {\small\verb%xi'%} is
+just {\small\verb%xi%}, in which case {\small\verb%SPEC_ALL%} simply removes all universal quantifiers.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A |- !x1...xn. t
+ --------------------------- SPEC_ALL
+ A |- t[x1'/x1]...[xn'/xn]
+\end{verbatim}
+}
+\FAILURE
+Never fails.
+
+\EXAMPLE
+The following example shows how variables are also renamed to avoid clashing
+with the names of constants.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #let v=mk_var(`T`,":bool") in ASSUME "!^v. ^v \/ ~^v";;
+ !T. T \/ ~T |- !T. T \/ ~T
+
+ #SPEC_ALL it;;
+ !T. T \/ ~T |- T' \/ ~T'
+\end{verbatim}
+}
+\SEEALSO
+GEN, GENL, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC.
+
+\ENDDOC
\DOC{SPEC}
\TYPE {\small\verb%SPEC : (term -> thm -> thm)%}\egroup
@@ -24379,45 +24416,6 @@ The following is a specialization of a t
GEN, GENL, GEN_ALL, GEN_TAC, SPEC, SPEC_ALL, SPEC_TAC.
\ENDDOC
-\DOC{SPEC\_ALL}
-
-\TYPE {\small\verb%SPEC_ALL : (thm -> thm)%}\egroup
-
-\SYNOPSIS
-Specializes the conclusion of a theorem with its own quantified variables.
-
-\DESCRIBE
-When applied to a theorem {\small\verb%A |- !x1...xn. t%}, the inference rule {\small\verb%SPEC_ALL%}
-returns the theorem {\small\verb%A |- t[x1'/x1]...[xn'/xn]%} where the {\small\verb%xi'%} are distinct
-variants of the corresponding {\small\verb%xi%}, chosen to avoid clashes with any variables
-free in the assumption list and with the names of constants. Normally {\small\verb%xi'%} is
-just {\small\verb%xi%}, in which case {\small\verb%SPEC_ALL%} simply removes all universal quantifiers.
-{\par\samepage\setseps\small
-\begin{verbatim}
- A |- !x1...xn. t
- --------------------------- SPEC_ALL
- A |- t[x1'/x1]...[xn'/xn]
-\end{verbatim}
-}
-\FAILURE
-Never fails.
-
-\EXAMPLE
-The following example shows how variables are also renamed to avoid clashing
-with the names of constants.
-{\par\samepage\setseps\small
-\begin{verbatim}
- #let v=mk_var(`T`,":bool") in ASSUME "!^v. ^v \/ ~^v";;
- !T. T \/ ~T |- !T. T \/ ~T
-
- #SPEC_ALL it;;
- !T. T \/ ~T |- T' \/ ~T'
-\end{verbatim}
-}
-\SEEALSO
-GEN, GENL, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC.
-
-\ENDDOC
\DOC{SPEC\_TAC}
\TYPE {\small\verb%SPEC_TAC : ((term # term) -> tactic)%}\egroup
@@ -25123,6 +25121,50 @@ Generating a case split from the axioms
ASM_CASES_TAC, BOOL_CASES_TAC, COND_CASES_TAC, DISJ_CASES_TAC.
\ENDDOC
+\DOC{SUB\_CONV}
+
+\TYPE {\small\verb%SUB_CONV : (conv -> conv)%}\egroup
+
+\SYNOPSIS
+Applies a conversion to the top-level subterms of a term.
+
+\DESCRIBE
+For any conversion {\small\verb%c%}, the function returned by {\small\verb%SUB_CONV c%} is a conversion
+that applies {\small\verb%c%} to all the top-level subterms of a term. If the conversion
+{\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
+the theorem:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ |- (\x.t) = (\x.t')
+\end{verbatim}
+}
+\noindent That is, {\small\verb%SUB_CONV c "\x.t"%} applies {\small\verb%c%} to the body of the
+abstraction {\small\verb%"\x.t"%}. If {\small\verb%c%} is a conversion that maps {\small\verb%"t1"%} to the theorem
+{\small\verb%|- t1 = t1'%} and {\small\verb%"t2"%} to the theorem {\small\verb%|- t2 = t2'%}, then the conversion
+{\small\verb%SUB_CONV c%} maps an application {\small\verb%"t1 t2"%} to the theorem:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ |- (t1 t2) = (t1' t2')
+\end{verbatim}
+}
+\noindent That is, {\small\verb%SUB_CONV c "t1 t2"%} applies {\small\verb%c%} to the both the operator
+{\small\verb%t1%} and the operand {\small\verb%t2%} of the application {\small\verb%"t1 t2"%}. Finally, for any
+conversion {\small\verb%c%}, the function returned by {\small\verb%SUB_CONV c%} acts as the identity
+conversion on variables and constants. That is, if {\small\verb%"t"%} is a variable or
+constant, then {\small\verb%SUB_CONV c "t"%} returns {\small\verb%|- t = t%}.
+
+\FAILURE
+{\small\verb%SUB_CONV c tm%} fails if {\small\verb%tm%} is an abstraction {\small\verb%"\x.t"%} and the conversion {\small\verb%c%}
+fails when applied to {\small\verb%t%}, or if {\small\verb%tm%} is an application {\small\verb%"t1 t2"%} and the
+conversion {\small\verb%c%} fails when applied to either {\small\verb%t1%} or {\small\verb%t2%}. The function
+returned by {\small\verb%SUB_CONV c%} may also fail if the ML function {\small\verb%c:term->thm%} is not,
+in fact, a conversion (i.e. a function that maps a term {\small\verb%t%} to a theorem
+{\small\verb%|- t = t'%}).
+
+\SEEALSO
+ABS_CONV, RAND_CONV, RATOR_CONV.
+
+\ENDDOC
\DOC{SUBGOAL\_THEN}
\TYPE {\small\verb%SUBGOAL_THEN : (term -> thm_tactic -> tactic)%}\egroup
@@ -25220,141 +25262,80 @@ Substitutions are made with the theorems
\begin{verbatim}
#let thm1 = SPECL ["m:num"; "n:num"] ADD_SYM
#and thm2 = CONJUNCT1 ADD_CLAUSES;;
- thm1 = |- m + n = n + m
- thm2 = |- 0 + m = m
-\end{verbatim}
-}
-\noindent depending on the occurrence of free subterms
-{\par\samepage\setseps\small
-\begin{verbatim}
- #SUBS [thm1; thm2] (ASSUME "(n + 0) + (0 + m) = m + n");;
- . |- (n + 0) + m = n + m
-
- #SUBS [thm1; thm2] (ASSUME "!n. (n + 0) + (0 + m) = m + n");;
- . |- !n. (n + 0) + m = m + n
-\end{verbatim}
-}
-\USES
-{\small\verb%SUBS%} can sometimes be used when rewriting (for example, with {\small\verb%REWRITE_RULE%})
-would diverge and term instantiation is not needed. Moreover, applying the
-substitution rules is often much faster than using the rewriting rules.
-
-\SEEALSO
-ONCE_REWRITE_RULE, PURE_REWRITE_RULE, REWRITE_RULE, SUBST, SUBST_MATCH,
-SUBS_OCCS.
-
-\ENDDOC
-\DOC{SUBST}
-
-\TYPE {\small\verb%SUBST : ((thm # term) list -> term -> thm -> thm)%}\egroup
-
-\SYNOPSIS
-Makes a set of parallel substitutions in a theorem.
-
-\DESCRIBE
-Implements the following rule of simultaneous substitution
-{\par\samepage\setseps\small
-\begin{verbatim}
- A1 |- t1 = u1 , ... , An |- tn = un , A |- t[t1,...,tn]
- -------------------------------------------------------------
- A u A1 u ... u An |- t[ui]
-\end{verbatim}
-}
-\noindent Evaluating
-{\par\samepage\setseps\small
-\begin{verbatim}
- SUBST [((A1 |- t1=u1), x1); ... ;((An |- tn=un), xn)]
- t[x1,...,xn]
- (A |- t[t1,...,tn])
-\end{verbatim}
-}
-\noindent returns the theorem {\small\verb%A |- t[u1,...,un]%}. The term argument
-{\small\verb%t[x1,...,xn]%} is a template which should match the conclusion of the theorem
-being substituted into, with the variables {\small\verb%x1%}, ... , {\small\verb%xn%} marking those
-places where occurrences of {\small\verb%t1%}, ... , {\small\verb%tn%} are to be replaced by the terms
-{\small\verb%u1%}, ... , {\small\verb%un%}, respectively. The occurrence of {\small\verb%ti%} at the places marked by
-{\small\verb%xi%} must be free (i.e. {\small\verb%ti%} must not contain any bound variables). {\small\verb%SUBST%}
-automatically renames bound variables to prevent free variables in {\small\verb%ui%}
-becoming bound after substitution.
-
-{\small\verb%SUBST%} is a complex primitive because it performs both parallel simultaneous
-substitution and renaming of variables. This is for efficiency reasons, but it
-would be logically cleaner if {\small\verb%SUBST%} were simpler.
-
-\FAILURE
-If the template does not match the conclusion of the hypothesis, or the terms
-in the conclusion marked by the variables {\small\verb%x1%}, ... , {\small\verb%xn%} in the template are
-not identical to the left hand sides of the supplied equations (i.e. the terms
-{\small\verb%t1%}, ... , {\small\verb%tn%}).
-
-\EXAMPLE
+ thm1 = |- m + n = n + m
+ thm2 = |- 0 + m = m
+\end{verbatim}
+}
+\noindent depending on the occurrence of free subterms
{\par\samepage\setseps\small
\begin{verbatim}
-#let th0 = SPEC "0" ADD1 and th1 = SPEC "1" ADD1;;
-th0 = |- SUC 0 = 0 + 1
-th1 = |- SUC 1 = 1 + 1
-
-#SUBST [(th0,"x:num");(th1,"y:num")]
-# "(x+y) > SUC 0"
-# (ASSUME "(SUC 0 + SUC 1) > SUC 0");;
-. |- ((0 + 1) + (1 + 1)) > (SUC 0)
-
-#SUBST [(th0,"x:num");(th1,"y:num")]
-# "(SUC 0 + y) > SUC 0"
-# (ASSUME "(SUC 0 + SUC 1) > SUC 0");;
-. |- ((SUC 0) + (1 + 1)) > (SUC 0)
+ #SUBS [thm1; thm2] (ASSUME "(n + 0) + (0 + m) = m + n");;
+ . |- (n + 0) + m = n + m
-#SUBST [(th0,"x:num");(th1,"y:num")]
-# "(x+y) > x"
-# (ASSUME "(SUC 0 + SUC 1) > SUC 0");;
-. |- ((0 + 1) + (1 + 1)) > (0 + 1)
+ #SUBS [thm1; thm2] (ASSUME "!n. (n + 0) + (0 + m) = m + n");;
+ . |- !n. (n + 0) + m = m + n
\end{verbatim}
}
\USES
-For substituting at selected occurrences. Often useful
-for writing special purpose derived inference rules.
+{\small\verb%SUBS%} can sometimes be used when rewriting (for example, with {\small\verb%REWRITE_RULE%})
+would diverge and term instantiation is not needed. Moreover, applying the
+substitution rules is often much faster than using the rewriting rules.
\SEEALSO
-SUBS.
+ONCE_REWRITE_RULE, PURE_REWRITE_RULE, REWRITE_RULE, SUBST, SUBST_MATCH,
+SUBS_OCCS.
\ENDDOC
-\DOC{subst}
+\DOC{SUBS\_OCCS}
-\TYPE {\small\verb%subst : ((term # term) list -> term -> term)%}\egroup
+\TYPE {\small\verb%SUBS_OCCS : ((int list # thm) list -> thm -> thm)%}\egroup
\SYNOPSIS
-Substitutes terms in a term.
+Makes substitutions in a theorem at specific occurrences of a term, using a
+list of equational theorems.
\DESCRIBE
-Given a list of term pairs {\small\verb%[("a_1","b_1"),...,("a_n","b_n")]%}
-and a term {\small\verb%"c"%}, {\small\verb%subst%} attempts to substitute all free occurrences of
-{\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%}.
-
+Given a list {\small\verb%(l1,A1|-t1=v1),...,(ln,An|-tn=vn)%} and a theorem
+{\small\verb%(A|-t)%}, {\small\verb%SUBS_OCCS%} simultaneously replaces each {\small\verb%ti%} in {\small\verb%t%} with {\small\verb%vi%},
+at the occurrences specified by the integers
+in the list {\small\verb%li = [o1;...;ok]%} for each theorem {\small\verb%Ai|-ti=vi%}.
+{\par\samepage\setseps\small
+\begin{verbatim}
+ (l1,A1|-t1=v1) ... (ln,An|-tn=vn) A|-t
+ ------------------------------------------- SUBS_OCCS[(l1,A1|-t1=v1);...;
+ A1 u ... An u A |- t[v1,...,vn/t1,...,tn] (ln,An|-tn=vn)] (A|-t)
+\end{verbatim}
+}
\FAILURE
-Failure occurs if for some {\small\verb%i%} ranging between {\small\verb%1%} and {\small\verb%n%}, the substitution
-of {\small\verb%"b_i"%} by {\small\verb%"a_i"%} fails.
-The substitution of {\small\verb%"b_i"%} by {\small\verb%"a_i"%} fails for some {\small\verb%i%},
-if the types of {\small\verb%"a_i"%} and {\small\verb%"b_i"%} are not the same.
+{\small\verb%SUBS_OCCS [(l1,th1);...;(ln,thn)] (A|-t)%} fails if
+the conclusion of any theorem in the list is not an equation.
+No change is made to the theorem if the supplied occurrences {\small\verb%li%} of the
+left-hand side of the conclusion of {\small\verb%thi%} do not appear in {\small\verb%t%}.
\EXAMPLE
+The commutative law for addition
{\par\samepage\setseps\small
\begin{verbatim}
- #subst [("1","SUC 0")] "SUC(SUC 0)";;
- "SUC 1" : term
-
- #subst [("1","SUC 0");("2","SUC 1")] "SUC(SUC 0)";;
- "SUC 1" : term
-
- #subst [("1","SUC 0");("2","SUC 1")] "SUC(SUC 0) = SUC 1";;
- "SUC 1 = 2" : term
-
- #subst [("b:num","a:num")] "\a:num. (b:num)";;
- "\a. b" : term
-
- #subst [("foo:*","flip:*")] "waddle:*";;
- "waddle" : term
+ #let thm = SPECL ["m:num"; "n:num"] ADD_SYM;;
+ thm = |- m + n = n + m
+\end{verbatim}
+}
+\noindent can be used for substituting only the second occurrence of
+the subterm {\small\verb%m + n%}
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #SUBS_OCCS [([2],thm)] (ASSUME "(n + m) + (m + n) = (m + n) + (m + n)");;
+ . |- (n + m) + (m + n) = (n + m) + (m + n)
\end{verbatim}
}
+\USES
+{\small\verb%SUBS_OCCS%} is used when rewriting at specific occurrences of a term, and rules
+such as {\small\verb%REWRITE_RULE%}, {\small\verb%PURE_REWRITE_RULE%}, {\small\verb%ONCE_REWRITE_RULE%}, and {\small\verb%SUBS%}
+are too extensive or would diverge.
+
+\SEEALSO
+ONCE_REWRITE_RULE, PURE_REWRITE_RULE, REWRITE_RULE, SUBS, SUBST, SUBST_MATCH.
+
\ENDDOC
\DOC{SUBST1\_TAC}
@@ -25549,6 +25530,118 @@ and using rewriting rules/conversions is
REWR_CONV, SUBS, SUBST, SUBS_OCCS.
\ENDDOC
+\DOC{subst}
+
+\TYPE {\small\verb%subst : ((term # term) list -> term -> term)%}\egroup
+
+\SYNOPSIS
+Substitutes terms in a term.
+
+\DESCRIBE
+Given a list of term pairs {\small\verb%[("a_1","b_1"),...,("a_n","b_n")]%}
+and a term {\small\verb%"c"%}, {\small\verb%subst%} attempts to substitute all free occurrences of
+{\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%}.
+
+\FAILURE
+Failure occurs if for some {\small\verb%i%} ranging between {\small\verb%1%} and {\small\verb%n%}, the substitution
+of {\small\verb%"b_i"%} by {\small\verb%"a_i"%} fails.
+The substitution of {\small\verb%"b_i"%} by {\small\verb%"a_i"%} fails for some {\small\verb%i%},
+if the types of {\small\verb%"a_i"%} and {\small\verb%"b_i"%} are not the same.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #subst [("1","SUC 0")] "SUC(SUC 0)";;
+ "SUC 1" : term
+
+ #subst [("1","SUC 0");("2","SUC 1")] "SUC(SUC 0)";;
+ "SUC 1" : term
+
+ #subst [("1","SUC 0");("2","SUC 1")] "SUC(SUC 0) = SUC 1";;
+ "SUC 1 = 2" : term
+
+ #subst [("b:num","a:num")] "\a:num. (b:num)";;
+ "\a. b" : term
+
+ #subst [("foo:*","flip:*")] "waddle:*";;
+ "waddle" : term
+\end{verbatim}
+}
+\ENDDOC
+\DOC{SUBST}
+
+\TYPE {\small\verb%SUBST : ((thm # term) list -> term -> thm -> thm)%}\egroup
+
+\SYNOPSIS
+Makes a set of parallel substitutions in a theorem.
+
+\DESCRIBE
+Implements the following rule of simultaneous substitution
+{\par\samepage\setseps\small
+\begin{verbatim}
+ A1 |- t1 = u1 , ... , An |- tn = un , A |- t[t1,...,tn]
+ -------------------------------------------------------------
+ A u A1 u ... u An |- t[ui]
+\end{verbatim}
+}
+\noindent Evaluating
+{\par\samepage\setseps\small
+\begin{verbatim}
+ SUBST [((A1 |- t1=u1), x1); ... ;((An |- tn=un), xn)]
+ t[x1,...,xn]
+ (A |- t[t1,...,tn])
+\end{verbatim}
+}
+\noindent returns the theorem {\small\verb%A |- t[u1,...,un]%}. The term argument
+{\small\verb%t[x1,...,xn]%} is a template which should match the conclusion of the theorem
+being substituted into, with the variables {\small\verb%x1%}, ... , {\small\verb%xn%} marking those
+places where occurrences of {\small\verb%t1%}, ... , {\small\verb%tn%} are to be replaced by the terms
+{\small\verb%u1%}, ... , {\small\verb%un%}, respectively. The occurrence of {\small\verb%ti%} at the places marked by
+{\small\verb%xi%} must be free (i.e. {\small\verb%ti%} must not contain any bound variables). {\small\verb%SUBST%}
+automatically renames bound variables to prevent free variables in {\small\verb%ui%}
+becoming bound after substitution.
+
+{\small\verb%SUBST%} is a complex primitive because it performs both parallel simultaneous
+substitution and renaming of variables. This is for efficiency reasons, but it
+would be logically cleaner if {\small\verb%SUBST%} were simpler.
+
+\FAILURE
+If the template does not match the conclusion of the hypothesis, or the terms
+in the conclusion marked by the variables {\small\verb%x1%}, ... , {\small\verb%xn%} in the template are
+not identical to the left hand sides of the supplied equations (i.e. the terms
+{\small\verb%t1%}, ... , {\small\verb%tn%}).
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#let th0 = SPEC "0" ADD1 and th1 = SPEC "1" ADD1;;
+th0 = |- SUC 0 = 0 + 1
+th1 = |- SUC 1 = 1 + 1
+
+#SUBST [(th0,"x:num");(th1,"y:num")]
+# "(x+y) > SUC 0"
+# (ASSUME "(SUC 0 + SUC 1) > SUC 0");;
+. |- ((0 + 1) + (1 + 1)) > (SUC 0)
+
+#SUBST [(th0,"x:num");(th1,"y:num")]
+# "(SUC 0 + y) > SUC 0"
+# (ASSUME "(SUC 0 + SUC 1) > SUC 0");;
+. |- ((SUC 0) + (1 + 1)) > (SUC 0)
+
+#SUBST [(th0,"x:num");(th1,"y:num")]
+# "(x+y) > x"
+# (ASSUME "(SUC 0 + SUC 1) > SUC 0");;
+. |- ((0 + 1) + (1 + 1)) > (0 + 1)
+\end{verbatim}
+}
+\USES
+For substituting at selected occurrences. Often useful
+for writing special purpose derived inference rules.
+
+\SEEALSO
+SUBS.
+
+\ENDDOC
\DOC{SUBST\_MATCH}
\TYPE {\small\verb%SUBST_MATCH : (thm -> thm -> thm)%}\egroup
@@ -25738,89 +25831,38 @@ any {\small\verb%Ai%} is not a subset of
{\small\verb%vi%} becoming bound after substitution.
\FAILURE
-{\small\verb%SUBST_TAC [th1;...;thn] (A,t)%} fails if the conclusion of any theorem in the
-list is not an equation. No change is made to the goal if no occurrence of the
-left-hand side of the conclusion of {\small\verb%thi%} appears in {\small\verb%t%}.
-
-\EXAMPLE
-When trying to solve the goal
-{\par\samepage\setseps\small
-\begin{verbatim}
- ?- (n + 0) + (0 + m) = m + n
-\end{verbatim}
-}
-\noindent by substituting with the theorems
-{\par\samepage\setseps\small
-\begin{verbatim}
- #let thm1 = SPECL ["m:num"; "n:num"] ADD_SYM
- #and thm2 = CONJUNCT1 ADD_CLAUSES;;
- thm1 = |- m + n = n + m
- thm2 = |- 0 + m = m
-\end{verbatim}
-}
-\noindent applying {\small\verb%SUBST_TAC [thm1; thm2]%} results in the goal
-{\par\samepage\setseps\small
-\begin{verbatim}
- ?- (n + 0) + m = n + m
-\end{verbatim}
-}
-\USES
-{\small\verb%SUBST_TAC%} is used when rewriting (for example, with {\small\verb%REWRITE_TAC%}) is
-extensive or would diverge. Substituting is also much faster than rewriting.
-
-\SEEALSO
-ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWRITE_TAC, SUBST1_TAC, SUBST_ALL_TAC.
-
-\ENDDOC
-\DOC{SUBS\_OCCS}
-
-\TYPE {\small\verb%SUBS_OCCS : ((int list # thm) list -> thm -> thm)%}\egroup
-
-\SYNOPSIS
-Makes substitutions in a theorem at specific occurrences of a term, using a
-list of equational theorems.
-
-\DESCRIBE
-Given a list {\small\verb%(l1,A1|-t1=v1),...,(ln,An|-tn=vn)%} and a theorem
-{\small\verb%(A|-t)%}, {\small\verb%SUBS_OCCS%} simultaneously replaces each {\small\verb%ti%} in {\small\verb%t%} with {\small\verb%vi%},
-at the occurrences specified by the integers
-in the list {\small\verb%li = [o1;...;ok]%} for each theorem {\small\verb%Ai|-ti=vi%}.
+{\small\verb%SUBST_TAC [th1;...;thn] (A,t)%} fails if the conclusion of any theorem in the
+list is not an equation. No change is made to the goal if no occurrence of the
+left-hand side of the conclusion of {\small\verb%thi%} appears in {\small\verb%t%}.
+
+\EXAMPLE
+When trying to solve the goal
{\par\samepage\setseps\small
\begin{verbatim}
- (l1,A1|-t1=v1) ... (ln,An|-tn=vn) A|-t
- ------------------------------------------- SUBS_OCCS[(l1,A1|-t1=v1);...;
- A1 u ... An u A |- t[v1,...,vn/t1,...,tn] (ln,An|-tn=vn)] (A|-t)
+ ?- (n + 0) + (0 + m) = m + n
\end{verbatim}
}
-\FAILURE
-{\small\verb%SUBS_OCCS [(l1,th1);...;(ln,thn)] (A|-t)%} fails if
-the conclusion of any theorem in the list is not an equation.
-No change is made to the theorem if the supplied occurrences {\small\verb%li%} of the
-left-hand side of the conclusion of {\small\verb%thi%} do not appear in {\small\verb%t%}.
-
-\EXAMPLE
-The commutative law for addition
+\noindent by substituting with the theorems
{\par\samepage\setseps\small
\begin{verbatim}
- #let thm = SPECL ["m:num"; "n:num"] ADD_SYM;;
- thm = |- m + n = n + m
+ #let thm1 = SPECL ["m:num"; "n:num"] ADD_SYM
+ #and thm2 = CONJUNCT1 ADD_CLAUSES;;
+ thm1 = |- m + n = n + m
+ thm2 = |- 0 + m = m
\end{verbatim}
}
-\noindent can be used for substituting only the second occurrence of
-the subterm {\small\verb%m + n%}
+\noindent applying {\small\verb%SUBST_TAC [thm1; thm2]%} results in the goal
{\par\samepage\setseps\small
\begin{verbatim}
- #SUBS_OCCS [([2],thm)] (ASSUME "(n + m) + (m + n) = (m + n) + (m + n)");;
- . |- (n + m) + (m + n) = (n + m) + (m + n)
+ ?- (n + 0) + m = n + m
\end{verbatim}
}
\USES
-{\small\verb%SUBS_OCCS%} is used when rewriting at specific occurrences of a term, and rules
-such as {\small\verb%REWRITE_RULE%}, {\small\verb%PURE_REWRITE_RULE%}, {\small\verb%ONCE_REWRITE_RULE%}, and {\small\verb%SUBS%}
-are too extensive or would diverge.
+{\small\verb%SUBST_TAC%} is used when rewriting (for example, with {\small\verb%REWRITE_TAC%}) is
+extensive or would diverge. Substituting is also much faster than rewriting.
\SEEALSO
-ONCE_REWRITE_RULE, PURE_REWRITE_RULE, REWRITE_RULE, SUBS, SUBST, SUBST_MATCH.
+ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWRITE_TAC, SUBST1_TAC, SUBST_ALL_TAC.
\ENDDOC
\DOC{subtract}
@@ -25851,50 +25893,6 @@ Never fails.
setify, set_equal, union, intersect.
\ENDDOC
-\DOC{SUB\_CONV}
-
-\TYPE {\small\verb%SUB_CONV : (conv -> conv)%}\egroup
-
-\SYNOPSIS
-Applies a conversion to the top-level subterms of a term.
-
-\DESCRIBE
-For any conversion {\small\verb%c%}, the function returned by {\small\verb%SUB_CONV c%} is a conversion
-that applies {\small\verb%c%} to all the top-level subterms of a term. If the conversion
-{\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
-the theorem:
-{\par\samepage\setseps\small
-\begin{verbatim}
- |- (\x.t) = (\x.t')
-\end{verbatim}
-}
-\noindent That is, {\small\verb%SUB_CONV c "\x.t"%} applies {\small\verb%c%} to the body of the
-abstraction {\small\verb%"\x.t"%}. If {\small\verb%c%} is a conversion that maps {\small\verb%"t1"%} to the theorem
-{\small\verb%|- t1 = t1'%} and {\small\verb%"t2"%} to the theorem {\small\verb%|- t2 = t2'%}, then the conversion
-{\small\verb%SUB_CONV c%} maps an application {\small\verb%"t1 t2"%} to the theorem:
-{\par\samepage\setseps\small
-\begin{verbatim}
- |- (t1 t2) = (t1' t2')
-\end{verbatim}
-}
-\noindent That is, {\small\verb%SUB_CONV c "t1 t2"%} applies {\small\verb%c%} to the both the operator
-{\small\verb%t1%} and the operand {\small\verb%t2%} of the application {\small\verb%"t1 t2"%}. Finally, for any
-conversion {\small\verb%c%}, the function returned by {\small\verb%SUB_CONV c%} acts as the identity
-conversion on variables and constants. That is, if {\small\verb%"t"%} is a variable or
-constant, then {\small\verb%SUB_CONV c "t"%} returns {\small\verb%|- t = t%}.
-
-\FAILURE
-{\small\verb%SUB_CONV c tm%} fails if {\small\verb%tm%} is an abstraction {\small\verb%"\x.t"%} and the conversion {\small\verb%c%}
-fails when applied to {\small\verb%t%}, or if {\small\verb%tm%} is an application {\small\verb%"t1 t2"%} and the
-conversion {\small\verb%c%} fails when applied to either {\small\verb%t1%} or {\small\verb%t2%}. The function
-returned by {\small\verb%SUB_CONV c%} may also fail if the ML function {\small\verb%c:term->thm%} is not,
-in fact, a conversion (i.e. a function that maps a term {\small\verb%t%} to a theorem
-{\small\verb%|- t = t'%}).
-
-\SEEALSO
-ABS_CONV, RAND_CONV, RATOR_CONV.
-
-\ENDDOC
\DOC{suspend\_recording}
\TYPE {\small\verb%suspend_recording : void -> void%}\egroup
@@ -25958,50 +25956,50 @@ When applied to a term argument of the f
{\small\verb%?x y. P%}.
\ENDDOC
-\DOC{SYM}
+\DOC{SYM\_CONV}
-\TYPE {\small\verb%SYM : (thm -> thm)%}\egroup
+\TYPE {\small\verb%SYM_CONV : conv%}\egroup
\SYNOPSIS
-Swaps left-hand and right-hand sides of an equation.
+Interchanges the left and right-hand sides of an equation.
\DESCRIBE
-When applied to a theorem {\small\verb%A |- t1 = t2%}, the inference rule {\small\verb%SYM%} returns
-{\small\verb%A |- t2 = t1%}.
+When applied to an equational term {\small\verb%t1 = t2%}, the conversion
+{\small\verb%SYM_CONV%} returns the theorem:
{\par\samepage\setseps\small
\begin{verbatim}
- A |- t1 = t2
- -------------- SYM
- A |- t2 = t1
+ |- (t1 = t2) = (t2 = t1)
\end{verbatim}
}
\FAILURE
-Fails unless the theorem is equational.
+Fails if applied to a term that is not an equation.
\SEEALSO
-GSYM, NOT_EQ_SYM, REFL.
+SYM.
\ENDDOC
-\DOC{SYM\_CONV}
+\DOC{SYM}
-\TYPE {\small\verb%SYM_CONV : conv%}\egroup
+\TYPE {\small\verb%SYM : (thm -> thm)%}\egroup
\SYNOPSIS
-Interchanges the left and right-hand sides of an equation.
+Swaps left-hand and right-hand sides of an equation.
\DESCRIBE
-When applied to an equational term {\small\verb%t1 = t2%}, the conversion
-{\small\verb%SYM_CONV%} returns the theorem:
+When applied to a theorem {\small\verb%A |- t1 = t2%}, the inference rule {\small\verb%SYM%} returns
+{\small\verb%A |- t2 = t1%}.
{\par\samepage\setseps\small
\begin{verbatim}
- |- (t1 = t2) = (t2 = t1)
+ A |- t1 = t2
+ -------------- SYM
+ A |- t2 = t1
\end{verbatim}
}
\FAILURE
-Fails if applied to a term that is not an equation.
+Fails unless the theorem is equational.
\SEEALSO
-SYM.
+GSYM, NOT_EQ_SYM, REFL.
\ENDDOC
\DOC{syserror}
@@ -26100,6 +26098,31 @@ Fails if the argument is less than 0.
int_of_term, int_of_string, string_of_int.
\ENDDOC
+\DOC{THENC}
+
+\TYPE {\small\verb%$THENC : (conv -> conv -> conv)%}\egroup
+
+\SYNOPSIS
+Applies two conversions in sequence.
+
+\DESCRIBE
+If the conversion {\small\verb%c1%} returns {\small\verb%|- t = t'%} when applied to a term {\small\verb%"t"%}, and
+{\small\verb%c2%} returns {\small\verb%|- t' = t''%} when applied to {\small\verb%"t'"%}, then the composite
+conversion {\small\verb%(c1 THENC c2) "t"%} returns {\small\verb%|- t = t''%}. That is, {\small\verb%(c1 THENC c2)
+"t"%} has the effect of transforming the term {\small\verb%"t"%} first with the conversion
+{\small\verb%c1%} and then with the conversion {\small\verb%c2%}.
+
+\FAILURE
+{\small\verb%(c1 THENC c2) "t"%} fails if either the conversion {\small\verb%c1%} fails when applied to
+{\small\verb%"t"%}, or if {\small\verb%c1 "t"%} succeeds and returns {\small\verb%|- t = t'%} but {\small\verb%c2%} fails when
+applied to {\small\verb%"t'"%}. {\small\verb%(c1 THENC c2) "t"%} may also fail if either of {\small\verb%c1%} or {\small\verb%c2%}
+is not, in fact, a conversion (i.e. a function that maps a term {\small\verb%t%} to a
+theorem {\small\verb%|- t = t'%}).
+
+\SEEALSO
+EVERY_CONV.
+
+\ENDDOC
\DOC{THEN}
\TYPE {\small\verb%$THEN : (tactic -> tactic -> tactic)%}\egroup
@@ -26136,31 +26159,6 @@ to multiple subgoals; sequences like the
EVERY, ORELSE, THENL.
\ENDDOC
-\DOC{THENC}
-
-\TYPE {\small\verb%$THENC : (conv -> conv -> conv)%}\egroup
-
-\SYNOPSIS
-Applies two conversions in sequence.
-
-\DESCRIBE
-If the conversion {\small\verb%c1%} returns {\small\verb%|- t = t'%} when applied to a term {\small\verb%"t"%}, and
-{\small\verb%c2%} returns {\small\verb%|- t' = t''%} when applied to {\small\verb%"t'"%}, then the composite
-conversion {\small\verb%(c1 THENC c2) "t"%} returns {\small\verb%|- t = t''%}. That is, {\small\verb%(c1 THENC c2)
-"t"%} has the effect of transforming the term {\small\verb%"t"%} first with the conversion
-{\small\verb%c1%} and then with the conversion {\small\verb%c2%}.
-
-\FAILURE
-{\small\verb%(c1 THENC c2) "t"%} fails if either the conversion {\small\verb%c1%} fails when applied to
-{\small\verb%"t"%}, or if {\small\verb%c1 "t"%} succeeds and returns {\small\verb%|- t = t'%} but {\small\verb%c2%} fails when
-applied to {\small\verb%"t'"%}. {\small\verb%(c1 THENC c2) "t"%} may also fail if either of {\small\verb%c1%} or {\small\verb%c2%}
-is not, in fact, a conversion (i.e. a function that maps a term {\small\verb%t%} to a
-theorem {\small\verb%|- t = t'%}).
-
-\SEEALSO
-EVERY_CONV.
-
-\ENDDOC
\DOC{THENL}
\TYPE {\small\verb%$THENL : (tactic -> tactic list -> tactic)%}\egroup
@@ -26253,41 +26251,6 @@ axiom, definition, load_theorem, load_th
theorems.
\ENDDOC
-\DOC{theorems}
-
-\TYPE {\small\verb%theorems : (string -> (string # thm) list)%}\egroup
-
-\SYNOPSIS
-Returns the derived theorems of a given theory segment of the current theory.
-
-\DESCRIBE
-A call of {\small\verb%theorems `thy`%} returns the derived theorems of the theory segment
-{\small\verb%thy%} together with their names. The theory segment {\small\verb%thy%} must be part of
-the current theory. The names are those given to the theorems by the user when
-they were originally added to the theory segment (by, for example, a call to
-{\small\verb%save_thm%}). The name of the current theory segment can be abbreviated by {\small\verb%`-`%}.
-
-\FAILURE
-The call {\small\verb%theorems `thy`%} will fail if the theory segment {\small\verb%thy%} is not part
-of the current theory.
-
-\EXAMPLE
-{\par\samepage\setseps\small
-\begin{verbatim}
-#theorems `bool`;;
-[(`PAIR_EQ`, |- !x y a b. (x,y = a,b) = (x = a) /\ (y = b));
- (`SND`, |- !x y. SND(x,y) = y);
- (`FST`, |- !x y. FST(x,y) = x);
- (`PAIR`, |- !x. FST x,SND x = x);
- (`PAIR_EXISTS`, |- ?p. IS_PAIR p)]
-: (string # thm) list
-\end{verbatim}
-}
-\SEEALSO
-axioms, definitions, load_theorem, load_theorems, print_theory, save_thm,
-theorem.
-
-\ENDDOC
\DOC{theorem\_lfn}
\TYPE {\small\verb%theorem_lfn : (string list -> thm)%}\egroup
@@ -26362,6 +26325,41 @@ autoload, autoload_theory, theorem, theo
load_theorems, undo_autoload.
\ENDDOC
+\DOC{theorems}
+
+\TYPE {\small\verb%theorems : (string -> (string # thm) list)%}\egroup
+
+\SYNOPSIS
+Returns the derived theorems of a given theory segment of the current theory.
+
+\DESCRIBE
+A call of {\small\verb%theorems `thy`%} returns the derived theorems of the theory segment
+{\small\verb%thy%} together with their names. The theory segment {\small\verb%thy%} must be part of
+the current theory. The names are those given to the theorems by the user when
+they were originally added to the theory segment (by, for example, a call to
+{\small\verb%save_thm%}). The name of the current theory segment can be abbreviated by {\small\verb%`-`%}.
+
+\FAILURE
+The call {\small\verb%theorems `thy`%} will fail if the theory segment {\small\verb%thy%} is not part
+of the current theory.
+
+\EXAMPLE
+{\par\samepage\setseps\small
+\begin{verbatim}
+#theorems `bool`;;
+[(`PAIR_EQ`, |- !x y a b. (x,y = a,b) = (x = a) /\ (y = b));
+ (`SND`, |- !x y. SND(x,y) = y);
+ (`FST`, |- !x y. FST(x,y) = x);
+ (`PAIR`, |- !x. FST x,SND x = x);
+ (`PAIR_EXISTS`, |- ?p. IS_PAIR p)]
+: (string # thm) list
+\end{verbatim}
+}
+\SEEALSO
+axioms, definitions, load_theorem, load_theorems, print_theory, save_thm,
+theorem.
+
+\ENDDOC
\DOC{thm\_count}
\TYPE {\small\verb%thm_count : (void -> int)%}\egroup
@@ -26653,15 +26651,36 @@ The following shows identical uses of {\
t1 = . |- a = b
t2 = . |- b = c
- #TRANS t1 t2;;
- .. |- a = c
+ #TRANS t1 t2;;
+ .. |- a = c
+
+ #t1 TRANS t2;;
+ .. |- a = c
+\end{verbatim}
+}
+\SEEALSO
+EQ_MP, IMP_TRANS, REFL, SYM.
+
+\ENDDOC
+\DOC{TRY\_CONV}
+
+\TYPE {\small\verb%TRY_CONV : (conv -> conv)%}\egroup
+
+\SYNOPSIS
+Attempts to apply a conversion; applies identity conversion in case of failure.
+
+\DESCRIBE
+{\small\verb%TRY_CONV c "t"%} attempts to apply the conversion {\small\verb%c%} to the term {\small\verb%"t"%}; if
+this fails, then the identity conversion applied instead. That is, if {\small\verb%c%} is a
+conversion that maps a term {\small\verb%"t"%} to the theorem {\small\verb%|- t = t'%}, then the
+conversion {\small\verb%TRY_CONV c%} also maps {\small\verb%"t"%} to {\small\verb%|- t = t'%}. But if {\small\verb%c%} fails when
+applied to {\small\verb%"t"%}, then {\small\verb%TRY_CONV c "t"%} returns {\small\verb%|- t = t%}.
+
+\FAILURE
+Never fails.
- #t1 TRANS t2;;
- .. |- a = c
-\end{verbatim}
-}
\SEEALSO
-EQ_MP, IMP_TRANS, REFL, SYM.
+ALL_CONV.
\ENDDOC
\DOC{TRY}
@@ -26704,27 +26723,6 @@ in the list. This will always be the cas
find, mem, exists, forall, assoc, rev_assoc.
\ENDDOC
-\DOC{TRY\_CONV}
-
-\TYPE {\small\verb%TRY_CONV : (conv -> conv)%}\egroup
-
-\SYNOPSIS
-Attempts to apply a conversion; applies identity conversion in case of failure.
-
-\DESCRIBE
-{\small\verb%TRY_CONV c "t"%} attempts to apply the conversion {\small\verb%c%} to the term {\small\verb%"t"%}; if
-this fails, then the identity conversion applied instead. That is, if {\small\verb%c%} is a
-conversion that maps a term {\small\verb%"t"%} to the theorem {\small\verb%|- t = t'%}, then the
-conversion {\small\verb%TRY_CONV c%} also maps {\small\verb%"t"%} to {\small\verb%|- t = t'%}. But if {\small\verb%c%} fails when
-applied to {\small\verb%"t"%}, then {\small\verb%TRY_CONV c "t"%} returns {\small\verb%|- t = t%}.
-
-\FAILURE
-Never fails.
-
-\SEEALSO
-ALL_CONV.
-
-\ENDDOC
\DOC{tty\_read}
\TYPE {\small\verb%tty_read : (void -> string)%}\egroup
@@ -26780,53 +26778,6 @@ standard output cannot be written.
append_openw, close, openi, openw, read, tty_read, write.
\ENDDOC
-\DOC{types}
-
-\TYPE {\small\verb%types : (string -> (int # string) list)%}\egroup
-
-\SYNOPSIS
-Lists the types in the named theory.
-
-\DESCRIBE
-The function {\small\verb%types%} should be applied to a string which is the name of an
-ancestor theory (including the current theory; the special string {\small\verb%`-`%} is
-always interpreted as the current theory). It returns a list of all the
-type constructors declared in the named theory, in the form of arity-name
-pairs.
-
-\FAILURE
-Fails unless the named theory is an ancestor.
-
-\EXAMPLE
-The theory {\small\verb%HOL%} has no types declared:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #types `HOL`;;
- [] : (int # string) list
-\end{verbatim}
-}
-\noindent but its ancestors have the following types declared:
-{\par\samepage\setseps\small
-\begin{verbatim}
- #itlist union (map types (ancestors `HOL`)) [];;
- [(2, `fun`);
- (2, `prod`);
- (0, `bool`);
- (0, `ind`);
- (0, `num`);
- (1, `list`);
- (0, `tree`);
- (1, `ltree`);
- (2, `sum`);
- (0, `one`)]
- : (int # string) list
-\end{verbatim}
-}
-\SEEALSO
-ancestors, axioms, constants, definitions, infixes, new_type, new_type_abbrev,
-new_type_definition, parents.
-
-\ENDDOC
\DOC{type\_abbrevs}
\TYPE {\small\verb%type_abbrevs : (string -> (string # type) list)%}\egroup
@@ -26936,6 +26887,53 @@ Never fails.
\end{verbatim}
}
\ENDDOC
+\DOC{types}
+
+\TYPE {\small\verb%types : (string -> (int # string) list)%}\egroup
+
+\SYNOPSIS
+Lists the types in the named theory.
+
+\DESCRIBE
+The function {\small\verb%types%} should be applied to a string which is the name of an
+ancestor theory (including the current theory; the special string {\small\verb%`-`%} is
+always interpreted as the current theory). It returns a list of all the
+type constructors declared in the named theory, in the form of arity-name
+pairs.
+
+\FAILURE
+Fails unless the named theory is an ancestor.
+
+\EXAMPLE
+The theory {\small\verb%HOL%} has no types declared:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #types `HOL`;;
+ [] : (int # string) list
+\end{verbatim}
+}
+\noindent but its ancestors have the following types declared:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ #itlist union (map types (ancestors `HOL`)) [];;
+ [(2, `fun`);
+ (2, `prod`);
+ (0, `bool`);
+ (0, `ind`);
+ (0, `num`);
+ (1, `list`);
+ (0, `tree`);
+ (1, `ltree`);
+ (2, `sum`);
+ (0, `one`)]
+ : (int # string) list
+\end{verbatim}
+}
+\SEEALSO
+ancestors, axioms, constants, definitions, infixes, new_type, new_type_abbrev,
+new_type_definition, parents.
+
+\ENDDOC
\DOC{type\_tyvars}
\TYPE {\small\verb%type_tyvars : (type -> type list)%}\egroup
@@ -27051,68 +27049,68 @@ Never fails.
curry.
\ENDDOC
-\DOC{UNDISCH}
+\DOC{UNDISCH\_ALL}
-\TYPE {\small\verb%UNDISCH : (thm -> thm)%}\egroup
+\TYPE {\small\verb%UNDISCH_ALL : (thm -> thm)%}\egroup
\SYNOPSIS
-Undischarges the antecedent of an implicative theorem.
+Iteratively undischarges antecedents in a chain of implications.
\DESCRIBE
{\par\samepage\setseps\small
\begin{verbatim}
- A |- t1 ==> t2
- ---------------- UNDISCH
- A, t1 |- t2
+ A |- t1 ==> ... ==> tn ==> t
+ ------------------------------ UNDISCH_ALL
+ A, t1, ..., tn |- t
\end{verbatim}
}
-\noindent Note that {\small\verb%UNDISCH%} treats {\small\verb%"~u"%} as {\small\verb%"u ==> F"%}.
+\noindent Note that {\small\verb%UNDISCH_ALL%} treats {\small\verb%"~u"%} as {\small\verb%"u ==> F"%}.
\FAILURE
-{\small\verb%UNDISCH%} will fail on theorems which are not implications or negations.
+Unlike {\small\verb%UNDISCH%}, {\small\verb%UNDISCH_ALL%} will,
+when called on something other than an implication or negation,
+return its argument unchanged rather than failing.
\COMMENTS
-If the antecedent already appears in the hypotheses, it will not be duplicated.
-However, unlike {\small\verb%DISCH%},
-if the antecedent is alpha-equivalent to one of the hypotheses,
-it will still be added to the hypotheses.
+Identical terms which are repeated in {\small\verb%A, "t1", ..., "tn"%} will
+not be duplicated in the hypotheses of the resulting theorem.
+However, if two or more alpha-equivalent terms appear in {\small\verb%A, "t1", ..., "tn"%},
+then each distinct term will appear in the result.
\SEEALSO
-DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, FILTER_DISCH_TAC, FILTER_DISCH_THEN,
-NEG_DISCH, STRIP_TAC, UNDISCH_ALL, UNDISCH_TAC.
+DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, NEG_DISCH, FILTER_DISCH_TAC,
+FILTER_DISCH_THEN, STRIP_TAC, UNDISCH, UNDISCH_TAC.
\ENDDOC
-\DOC{UNDISCH\_ALL}
+\DOC{UNDISCH}
-\TYPE {\small\verb%UNDISCH_ALL : (thm -> thm)%}\egroup
+\TYPE {\small\verb%UNDISCH : (thm -> thm)%}\egroup
\SYNOPSIS
-Iteratively undischarges antecedents in a chain of implications.
+Undischarges the antecedent of an implicative theorem.
\DESCRIBE
{\par\samepage\setseps\small
\begin{verbatim}
- A |- t1 ==> ... ==> tn ==> t
- ------------------------------ UNDISCH_ALL
- A, t1, ..., tn |- t
+ A |- t1 ==> t2
+ ---------------- UNDISCH
+ A, t1 |- t2
\end{verbatim}
}
-\noindent Note that {\small\verb%UNDISCH_ALL%} treats {\small\verb%"~u"%} as {\small\verb%"u ==> F"%}.
+\noindent Note that {\small\verb%UNDISCH%} treats {\small\verb%"~u"%} as {\small\verb%"u ==> F"%}.
\FAILURE
-Unlike {\small\verb%UNDISCH%}, {\small\verb%UNDISCH_ALL%} will,
-when called on something other than an implication or negation,
-return its argument unchanged rather than failing.
+{\small\verb%UNDISCH%} will fail on theorems which are not implications or negations.
\COMMENTS
-Identical terms which are repeated in {\small\verb%A, "t1", ..., "tn"%} will
-not be duplicated in the hypotheses of the resulting theorem.
-However, if two or more alpha-equivalent terms appear in {\small\verb%A, "t1", ..., "tn"%},
-then each distinct term will appear in the result.
+If the antecedent already appears in the hypotheses, it will not be duplicated.
+However, unlike {\small\verb%DISCH%},
+if the antecedent is alpha-equivalent to one of the hypotheses,
+it will still be added to the hypotheses.
\SEEALSO
-DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, NEG_DISCH, FILTER_DISCH_TAC,
-FILTER_DISCH_THEN, STRIP_TAC, UNDISCH, UNDISCH_TAC.
+DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, FILTER_DISCH_TAC, FILTER_DISCH_THEN,
+NEG_DISCH, STRIP_TAC, UNDISCH_ALL, UNDISCH_TAC.
\ENDDOC
\DOC{UNDISCH\_TAC}
@@ -27424,18 +27422,21 @@ Never fails.
\#, B, C, CB, Co, I, K, KI, o, oo, S.
\ENDDOC
-\DOC{words}
+\DOC{words2}
-\TYPE {\small\verb%words : (string -> string list)%}\egroup
+\TYPE {\small\verb%words2 : (string -> string -> string list)%}\egroup
\SYNOPSIS
-Splits a string into a list of words.
+Splits a string into a list of substrings, breaking at occurrences of a
+specified character.
\DESCRIBE
-{\small\verb%words s%} splits the string {\small\verb%s%} into a list of substrings. Splitting occurs
-at each sequence of blanks and carriage returns (white space). This white
-space does not appear in the list of substrings. Leading and trailing white
-space in the input string is also thrown away.
+{\small\verb%words2 char s%} splits the string {\small\verb%s%} into a list of substrings. Splitting
+occurs at each occurrence of a sequence of the character {\small\verb%char%}. The {\small\verb%char%}
+characters do not appear in the list of substrings. Leading and trailing
+occurrences of {\small\verb%char%} are also thrown away. If {\small\verb%char%} is not a
+single-character string (its length is not 1), then {\small\verb%s%} will not be split and
+so the result will be the list {\small\verb%[s]%}.
\FAILURE
Never fails.
@@ -27443,37 +27444,29 @@ Never fails.
\EXAMPLE
{\par\samepage\setseps\small
\begin{verbatim}
-#words ` the cat sat on the mat `;;
+#words2 `/` `/the/cat//sat/on//the/mat/`;;
[`the`; `cat`; `sat`; `on`; `the`; `mat`] : string list
-\end{verbatim}
-}
-\USES
-Useful when wanting to map a function over a list of constant strings.
-Instead of using {\small\verb%[`string1`;...;`stringn`]%} one can use:
-{\par\samepage\setseps\small
-\begin{verbatim}
- (words `string1 ... stringn`)
+
+#words2 `//` `/the/cat//sat/on//the/mat/`;;
+[`/the/cat//sat/on//the/mat/`] : string list
\end{verbatim}
}
\SEEALSO
-words2, word_separators, maptok, explode.
+words, word_separators, explode.
\ENDDOC
-\DOC{words2}
+\DOC{words}
-\TYPE {\small\verb%words2 : (string -> string -> string list)%}\egroup
+\TYPE {\small\verb%words : (string -> string list)%}\egroup
\SYNOPSIS
-Splits a string into a list of substrings, breaking at occurrences of a
-specified character.
+Splits a string into a list of words.
\DESCRIBE
-{\small\verb%words2 char s%} splits the string {\small\verb%s%} into a list of substrings. Splitting
-occurs at each occurrence of a sequence of the character {\small\verb%char%}. The {\small\verb%char%}
-characters do not appear in the list of substrings. Leading and trailing
-occurrences of {\small\verb%char%} are also thrown away. If {\small\verb%char%} is not a
-single-character string (its length is not 1), then {\small\verb%s%} will not be split and
-so the result will be the list {\small\verb%[s]%}.
+{\small\verb%words s%} splits the string {\small\verb%s%} into a list of substrings. Splitting occurs
+at each sequence of blanks and carriage returns (white space). This white
+space does not appear in the list of substrings. Leading and trailing white
+space in the input string is also thrown away.
\FAILURE
Never fails.
@@ -27481,15 +27474,20 @@ Never fails.
\EXAMPLE
{\par\samepage\setseps\small
\begin{verbatim}
-#words2 `/` `/the/cat//sat/on//the/mat/`;;
+#words ` the cat sat on the mat `;;
[`the`; `cat`; `sat`; `on`; `the`; `mat`] : string list
-
-#words2 `//` `/the/cat//sat/on//the/mat/`;;
-[`/the/cat//sat/on//the/mat/`] : string list
+\end{verbatim}
+}
+\USES
+Useful when wanting to map a function over a list of constant strings.
+Instead of using {\small\verb%[`string1`;...;`stringn`]%} one can use:
+{\par\samepage\setseps\small
+\begin{verbatim}
+ (words `string1 ... stringn`)
\end{verbatim}
}
\SEEALSO
-words, word_separators, explode.
+words2, word_separators, maptok, explode.
\ENDDOC
\DOC{word\_separators}
--- hol88-2.02.19940316.orig/lisp/f-format.l
+++ hol88-2.02.19940316/lisp/f-format.l
@@ -131,8 +131,8 @@
(defun flush-output-buffer nil
;; Some data types (e.g. streams) cannot be catenated in franz, so
;; print out items in buffer separately.
- #+franz (mapc #'llprinc (nreverse %output-buffer))
- #-franz (llprinc (apply #'catenate (nreverse %output-buffer)))
+ #+(or franz gcl) (mapc #'llprinc (nreverse %output-buffer))
+ #-(or franz gcl) (llprinc (apply #'catenate (nreverse %output-buffer)))
(setq %output-buffer nil))
--- hol88-2.02.19940316.orig/lisp/f-cl.l
+++ hol88-2.02.19940316/lisp/f-cl.l
@@ -164,10 +164,11 @@
:gc t)
#+kcl
(progn
- (setf (symbol-function 'si:top-level)
- `(lambda nil (tml)))
+; (setf (symbol-function 'si:top-level)
+; `(lambda nil (tml)))
+ (setq si::*top-level-hook* (lambda nil (tml)))
(gbc t)
- (save file))
+ (si::save-system file))
#+allegro
(progn
(setf (symbol-function 'excl::copyright-banner)
@@ -569,10 +570,19 @@
(setq *standard-input* (pop inputstack))
(close current-input)))
+(defconstant +fast-digits+ 4)
+(defconstant +slow-digits+ (- (truncate (log most-positive-fixnum 10) 1.0) +fast-digits+))
+(defconstant +fast-mod+ (expt 10 +fast-digits+))
+(defconstant +slow-mod+ (expt 10 +slow-digits+))
+
(defun clock ()
;; Get absolute time - just for time-stamps
- (get-universal-time))
+ (let ((s (get-universal-time))
+ (m (si::gettimeofday)))
+ (+ (* +fast-mod+ (mod s +slow-mod+))
+ (mod (truncate (* +fast-mod+ m) 1.0) +fast-mod+))))
+; (get-universal-time))
;;; Add extension .o to a file name for output name in process of
--- /dev/null
+++ hol88-2.02.19940316/lisp/f-ol-syntax.h
@@ -0,0 +1,367 @@
+
+static void L1();
+static void L2();
+static void L3();
+static void L4();
+static void L5();
+static void L6();
+static void L7();
+static void L8();
+static void L9();
+static void L10();
+static void L11();
+static void L12();
+static void L13();
+static void L14();
+static void L15();
+static void L16();
+static void L17();
+static void L18();
+static void L19();
+static void L20();
+static void L21();
+static void L22();
+static void L23();
+static void L24();
+static void L25();
+static void L26();
+static void L27();
+static void L28();
+static void L29();
+static void L30();
+static void L31();
+static void L32();
+static void L33();
+static void L34();
+static void L35();
+static void L36();
+static void L37();
+static void L38();
+static void L39();
+static void L40();
+static void L41();
+static void L42();
+static void L43();
+static void L44();
+static void L45();
+static void L46();
+static void L47();
+static void L48();
+static void L49();
+static void L50();
+static void L51();
+static void L52();
+static void L53();
+static void L54();
+static void L55();
+static void L56();
+static void L57();
+static void L58();
+static void L59();
+static void L60();
+static void L61();
+static void L62();
+static void L63();
+static void L64();
+static void L65();
+static void L66();
+static void L67();
+static void L68();
+static void L69();
+static void L70();
+#define VC1
+#define VC2
+#define VC3
+#define VC4
+#define VC5
+#define VC6
+#define VC7
+#define VC8
+#define VC9
+#define VC10
+#define VC11
+#define VC12
+#define VC13
+#define VC14
+#define VC15
+#define VC16
+#define VC17
+#define VC18
+#define VC19
+#define VC20
+#define VC21
+#define VC22
+#define VC23 object V37 ,V36;
+#define VC24 object V43 ,V42;
+#define VC25 object V46;
+#define VC26
+#define VC27
+#define VC28 object V57 ,V56;
+#define VC29
+#define VC30
+#define VC31
+#define VC32 object V62;
+#define VC33 object V68 ,V67;
+#define VC34
+#define VC35
+#define VC36
+#define VC37 object V79 ,V78 ,V77 ,V76;
+#define VC38
+#define VC39 object V82;
+#define VC40 object V96 ,V95 ,V94 ,V93 ,V92 ,V91 ,V90 ,V89 ,V88 ,V87 ,V86 ,V85;
+#define VC41
+#define VC42 object V112 ,V111 ,V110 ,V109 ,V108 ,V107 ,V106 ,V105 ,V104 ,V103 ,V102 ,V101;
+#define VC43 object V117 ,V116;
+#define VC44
+#define VC45 object V131 ,V130 ,V129 ,V128;
+#define VC46 object V141 ,V140 ,V139 ,V136;
+#define VC47 object V148 ,V147 ,V145;
+#define VC48
+#define VC49
+#define VC50
+#define VC51 object V160 ,V159;
+#define VC52 object V169 ,V168;
+#define VC53
+#define VC54 object V173;
+#define VC55
+#define VC56
+#define VC57
+#define VC58 object V185 ,V184;
+#define VC59
+#define VC60
+#define VC61 object V192 ,V190;
+#define VC62
+#define VC63
+#define VC64 object V197;
+#define VC65
+#define VC66
+#define VC67
+#define VC68
+#define VC69
+#define VC70
+#define VM70 2
+#define VM69 2
+#define VM68 2
+#define VM67 2
+#define VM66 1
+#define VM65 2
+#define VM64 2
+#define VM63 2
+#define VM62 2
+#define VM61 3
+#define VM60 2
+#define VM59 2
+#define VM58 2
+#define VM57 7
+#define VM56 5
+#define VM55 5
+#define VM54 2
+#define VM53 2
+#define VM52 6
+#define VM51 5
+#define VM50 5
+#define VM49 2
+#define VM48 4
+#define VM47 3
+#define VM46 3
+#define VM45 2
+#define VM44 3
+#define VM43 3
+#define VM42 2
+#define VM41 4
+#define VM40 2
+#define VM39 2
+#define VM38 2
+#define VM37 3
+#define VM36 4
+#define VM35 2
+#define VM34 2
+#define VM33 6
+#define VM32 3
+#define VM31 2
+#define VM30 2
+#define VM29 4
+#define VM28 5
+#define VM27 2
+#define VM26 2
+#define VM25 3
+#define VM24 6
+#define VM23 6
+#define VM22 2
+#define VM21 2
+#define VM20 3
+#define VM19 4
+#define VM18 2
+#define VM17 2
+#define VM16 3
+#define VM15 4
+#define VM14 2
+#define VM13 2
+#define VM12 2
+#define VM11 3
+#define VM10 2
+#define VM9 2
+#define VM8 3
+#define VM7 2
+#define VM6 2
+#define VM5 3
+#define VM4 2
+#define VM3 2
+#define VM2 5
+#define VM1 2
+static void * VVi[109]={
+#define Cdata VV[108]
+(void *)(L1),
+(void *)(L2),
+(void *)(L3),
+(void *)(L4),
+(void *)(L5),
+(void *)(L6),
+(void *)(L7),
+(void *)(L8),
+(void *)(L9),
+(void *)(L10),
+(void *)(L11),
+(void *)(L12),
+(void *)(L13),
+(void *)(L14),
+(void *)(L15),
+(void *)(L16),
+(void *)(L17),
+(void *)(L18),
+(void *)(L19),
+(void *)(L20),
+(void *)(L21),
+(void *)(L22),
+(void *)(L23),
+(void *)(L24),
+(void *)(L25),
+(void *)(L26),
+(void *)(L27),
+(void *)(L28),
+(void *)(L29),
+(void *)(L30),
+(void *)(L31),
+(void *)(L32),
+(void *)(L33),
+(void *)(L34),
+(void *)(L35),
+(void *)(L36),
+(void *)(L37),
+(void *)(L38),
+(void *)(L39),
+(void *)(L40),
+(void *)(L41),
+(void *)(L42),
+(void *)(L43),
+(void *)(L44),
+(void *)(L45),
+(void *)(L46),
+(void *)(L47),
+(void *)(L48),
+(void *)(L49),
+(void *)(L50),
+(void *)(L51),
+(void *)(L52),
+(void *)(L53),
+(void *)(L54),
+(void *)(L55),
+(void *)(L56),
+(void *)(L57),
+(void *)(L58),
+(void *)(L59),
+(void *)(L60),
+(void *)(L61),
+(void *)(L62),
+(void *)(L63),
+(void *)(L64),
+(void *)(L65),
+(void *)(L66),
+(void *)(L67),
+(void *)(L68),
+(void *)(L69),
+(void *)(L70)
+};
+#define VV (VVi)
+static void LnkT107();
+static void (*Lnk107)() = LnkT107;
+static void LnkT106();
+static void (*Lnk106)() = LnkT106;
+static void LnkT105();
+static void (*Lnk105)() = LnkT105;
+static void LnkT104();
+static void (*Lnk104)() = LnkT104;
+static object LnkTLI103(object,...);
+static object (*LnkLI103)() = (object (*)()) LnkTLI103;
+static object LnkTLI102(object,...);
+static object (*LnkLI102)() = (object (*)()) LnkTLI102;
+static void LnkT101();
+static void (*Lnk101)() = LnkT101;
+static void LnkT100();
+static void (*Lnk100)() = LnkT100;
+static void LnkT99();
+static void (*Lnk99)() = LnkT99;
+static void LnkT98();
+static void (*Lnk98)() = LnkT98;
+static void LnkT97();
+static void (*Lnk97)() = LnkT97;
+static void LnkT96();
+static void (*Lnk96)() = LnkT96;
+static void LnkT95();
+static void (*Lnk95)() = LnkT95;
+static void LnkT94();
+static void (*Lnk94)() = LnkT94;
+static void LnkT93();
+static void (*Lnk93)() = LnkT93;
+static void LnkT92();
+static void (*Lnk92)() = LnkT92;
+static void LnkT91();
+static void (*Lnk91)() = LnkT91;
+static void LnkT90();
+static void (*Lnk90)() = LnkT90;
+static void LnkT89();
+static void (*Lnk89)() = LnkT89;
+static void LnkT88();
+static void (*Lnk88)() = LnkT88;
+static void LnkT87();
+static void (*Lnk87)() = LnkT87;
+static void LnkT86();
+static void (*Lnk86)() = LnkT86;
+static void LnkT85();
+static void (*Lnk85)() = LnkT85;
+static void LnkT84();
+static void (*Lnk84)() = LnkT84;
+static void LnkT83();
+static void (*Lnk83)() = LnkT83;
+static void LnkT81();
+static void (*Lnk81)() = LnkT81;
+static void LnkT80();
+static void (*Lnk80)() = LnkT80;
+static void LnkT79();
+static void (*Lnk79)() = LnkT79;
+static void LnkT78();
+static void (*Lnk78)() = LnkT78;
+static void LnkT77();
+static void (*Lnk77)() = LnkT77;
+static void LnkT76();
+static void (*Lnk76)() = LnkT76;
+static void LnkT75();
+static void (*Lnk75)() = LnkT75;
+static void LnkT74();
+static void (*Lnk74)() = LnkT74;
+static void LnkT73();
+static void (*Lnk73)() = LnkT73;
+static void LnkT72();
+static void (*Lnk72)() = LnkT72;
+static void LnkT71();
+static void (*Lnk71)() = LnkT71;
+static void LnkT70();
+static void (*Lnk70)() = LnkT70;
+static void LnkT69();
+static void (*Lnk69)() = LnkT69;
+static void LnkT68();
+static void (*Lnk68)() = LnkT68;
+static void LnkT67();
+static void (*Lnk67)() = LnkT67;
+static void LnkT66();
+static void (*Lnk66)() = LnkT66;
--- /dev/null
+++ hol88-2.02.19940316/lisp/f-ol-syntax.c
@@ -0,0 +1,7805 @@
+#define SGC
+
+#define EXTER extern
+/* h/gclincl.h. Generated from gclincl.h.in by configure. */
+/* h/gclincl.h.in. Generated from configure.in by autoheader. */
+/* define where the heap could begin. Normally should
+be the smallest value returned by sbrk(). Underestimating
+by 10-20 megabytes is not a problem. */
+
+#define DBEGIN 0x8000000 /* where data begins */
+
+
+/* the size of the page tables for gcl. Each page is PAGESIZE which
+is usually 4K or 8K bytes. From 1 to 3 bytes per page are
+preallocated in a table at compile time. this must be a power of 2 if
+SGC is enabled. */
+
+#define MAXPAGE (128*1024*(SIZEOF_LONG>>2)/(1<<(PAGEWIDTH-12)))
+#define VSSIZE 128*1024
+#define BDSSIZE 2*1024
+#define IHSSIZE 4*1024
+#define FRSSIZE 4*1024
+
+#define HOLEPAGE (MAXPAGE/10)
+
+/* check to see if getcwd exists
+*/
+#define HAVE_GETCWD 1
+
+
+/* if we dont have USEGETCWD, we will use GETWD unless following defined
+*/
+#define HAVE_GETWD 1
+
+
+/* no gettimeofday function */
+
+/* #undef NO_GETTOD */
+
+/* define if have <asm/signal.h> */
+#define HAVE_ASM_SIGNAL_H 1
+
+/* define if have <asm/sigcontext.h> */
+#define HAVE_ASM_SIGCONTEXT_H 1
+
+/* define if have struct sigcontext in one of above */
+/* #undef HAVE_SIGCONTEXT */
+
+
+/* define if have <sys/ioctl.h> */
+#define HAVE_SYS_IOCTL_H 1
+
+/* define if we can use the file nsocket.c */
+#define HAVE_NSOCKET 1
+
+#ifndef HAVE_ALLOCA
+/* define this if you have alloca */
+#define HAVE_ALLOCA 1
+#endif
+
+
+/* define if need alloca.h */
+/* #undef NEED_ALLOCA_H */
+
+#ifdef NEED_ALLOCA_H
+#include <alloca.h>
+#endif
+
+
+/* define LISTEN_USE_FCNTL if we can check for input using fcntl */
+#define LISTEN_USE_FCNTL 1
+
+/* if signal.h alone contains the stuff necessary for sgc */
+#define SIGNAL_H_HAS_SIGCONTEXT 1
+
+
+/* define if the profil system call is not defined in libc */
+/* #undef NO_PROFILE */
+
+
+/* define if the _cleanup() function exists and should be called
+ before saving */
+/* #define USE_CLEANUP */
+
+
+/* define if BIG_ENDIAN or LITTLE_ENDIAN is defined by including
+ the standard includes */
+/* #define ENDIAN_ALREADY_DEFINED */
+
+/* define if SV_ONSTACK is defined in signal.h */
+#define HAVE_SV_ONSTACK 1
+
+
+/*
+ define to be a typical stack address. We use this to decide
+ whether we can use a cheap test for NULL_OR_ON_C_STACK, or whether
+ it has to be more complex..
+
+*/
+
+#define CSTACK_ADDRESS -1075718936
+
+/* define if SIGSYS is defined in signal.h */
+
+#define HAVE_SIGSYS 1
+
+/* define if SIGEMT is defined in signal.h */
+
+/* #undef HAVE_SIGEMT */
+
+
+/* define if setenv is define */
+#define HAVE_SETENV 1
+
+/* define if putenv is define */
+/* #undef HAVE_PUTENV */
+
+
+/* define if long long int works to multiply to ints, */
+
+#define HAVE_LONG_LONG 1
+
+/* define if want to use GMP */
+#define GMP 1
+
+/* have a broken version of C compiler which makes bad code for -O4 */
+/* #undef BROKEN_O4_OPT */
+
+/* See if gettimeofday is declared in the <sys/time.h> header file. */
+/* if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can */
+/* declare it. */
+
+#define GETTOD_NOT_DECLARED 1
+
+/* #undef HAVE_BSDGETTIMEOFDAY */
+
+/* #undef NO_UNAME */
+
+/* FIONBIO vs. O_NONBLOCK for nonblocking I/O */
+/* #undef USE_FIONBIO */
+
+/* readline support */
+#define HAVE_READLINE 1
+
+/* bfd support */
+/* #undef HAVE_LIBBFD */
+/* #undef NEED_CONST */
+#define HAVE_BFD_BOOLEAN
+
+#ifdef HAVE_BFD_BOOLEAN
+#define MY_BFD_BOOLEAN bfd_boolean
+#define MY_BFD_FALSE FALSE
+#define MY_BFD_TRUE TRUE
+#else
+#define MY_BFD_BOOLEAN boolean
+#define MY_BFD_FALSE false
+#define MY_BFD_TRUE true
+#endif
+/* isnormal check */
+#define HAVE_ISNORMAL 1
+
+/* #undef HAVE_IEEEFP */
+
+#ifdef IN_NUM_CO
+#ifdef HAVE_ISNORMAL
+#define _GNU_SOURCE
+#include <math.h>
+#define ISNORMAL(a) isnormal(a)
+#else
+#ifdef HAVE_IEEEFP
+#include <ieeefp.h>
+#define ISNORMAL(a) (fpclass(a)>=FP_NZERO)
+#else
+#include <math.h>
+#define ISNORMAL(a) ((sizeof (a) == sizeof (float)) ? \
+ gcl_isnormal_float(a) : \
+ gcl_isnormal_double(a))
+#endif
+#endif
+#endif
+
+#define HAVE_ISFINITE 1
+/* #undef HAVE_FINITE */
+
+#ifdef NEED_ISFINITE
+#ifdef HAVE_ISFINITE
+#define _GNU_SOURCE
+#include <math.h>
+#define ISFINITE(a) isfinite(a)
+#else
+#ifdef HAVE_FINITE
+#include <math.h>
+#include <ieeefp.h>
+#define ISFINITE(a) finite(a)
+#else
+#error "No isfinite found"
+#endif
+#endif
+#endif
+
+#define HAVE_VALUES_H 1
+#define HAVE_FLOAT_H 1
+
+#ifdef IN_NUM_CO
+#ifdef HAVE_VALUES_H
+#include <values.h>
+#endif
+#ifdef HAVE_FLOAT_H
+#include <float.h>
+#endif
+#endif
+
+
+
+/* math.h for definitions in generated C code */
+#define HAVE_MATH_H 1
+
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+#define LITTLE_END 1
+
+#define PAGEWIDTH 12
+
+/* #ifdef PAGEWIDTH */
+/* #undef PAGESIZE */
+/* #define PAGESIZE (1<<PAGEWIDTH) */
+/* #endif */
+
+#define SIZEOF_LONG 4
+
+/* #undef USE_DLOPEN */
+
+#define MP_LIMB_BYTES 4
+
+/* #undef ANSI_COMMON_LISP */
+
+/* #undef __SHORT_LIMB */
+/* #undef __LONG_LONG_LIMB */
+
+/* #undef HAVE_JAPI_H */
+
+#define HAVE_XDR 1
+/* #undef ENDIAN_ALREADY_DEFINED */
+/* #undef USE_CLEANUP */
+#define SIZEOF_CONTBLOCK 8
+
+/* #undef GCL_GPROF */
+#define HAVE_DECL_RL_COMPLETION_MATCHES 1
+#define HAVE_RL_COMPENTRY_FUNC_T 1
+#define HAVE_GNU_LD 1
+#define CAN_UNRANDOMIZE_SBRK 1
+#define HOST_CPU "I486"
+#define HOST_KERNEL "LINUX"
+#define HOST_SYSTEM "GNU"
+/* #undef GCL_GPROF_START */
+#define HZ 100
+/* #undef ADDR_NO_RANDOMIZE */
+/* #undef LEADING_UNDERSCORE */
+#define HAVE_XGCL 1
+/* #undef HAVE_SYS_SOCKIO_H */
+/* #undef HAVE_MALLOC_MALLOC_H */
+/* #undef HAVE_OBJC_MALLOC_H */
+/* #undef HAVE_OUTPUT_BFD */
+#define HAVE_BUILTIN_CLEAR_CACHE 1
+
+/* Define to 1 if you have the <asm/sigcontext.h> header file. */
+#define HAVE_ASM_SIGCONTEXT_H 1
+
+/* Define to 1 if you have the <asm/signal.h> header file. */
+#define HAVE_ASM_SIGNAL_H 1
+
+/* Define to 1 if you have the <elf_abi.h> header file. */
+/* #undef HAVE_ELF_ABI_H */
+
+/* Define to 1 if you have the <elf.h> header file. */
+#define HAVE_ELF_H 1
+
+/* Have finite function */
+/* #undef HAVE_FINITE */
+
+/* Define to 1 if you have the <float.h> header file. */
+#define HAVE_FLOAT_H 1
+
+/* Define to 1 if you have the `getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* Define to 1 if you have the `getwd' function. */
+#define HAVE_GETWD 1
+
+/* Have ieeefp fpclass function */
+/* #undef HAVE_IEEEFP */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+/* #undef HAVE_INTTYPES_H */
+
+/* Have isfinite function */
+#define HAVE_ISFINITE 1
+
+/* Have isnormal function */
+#define HAVE_ISNORMAL 1
+
+/* Define to 1 if you have the <japi.h> header file. */
+/* #undef HAVE_JAPI_H */
+
+/* memalign element present */
+/* #undef HAVE_MALLOC_ZONE_MEMALIGN */
+
+/* Define to 1 if you have the <math.h> header file. */
+#define HAVE_MATH_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+/* #undef HAVE_MEMORY_H */
+
+/* Define to 1 if you have the <readline/readline.h> header file. */
+#define HAVE_READLINE_READLINE_H 1
+
+/* Define to 1 if you have the <rpc/rpc.h> header file. */
+/* #undef HAVE_RPC_RPC_H */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+/* #undef HAVE_STDINT_H */
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+/* #undef HAVE_STDLIB_H */
+
+/* Define to 1 if you have the <strings.h> header file. */
+/* #undef HAVE_STRINGS_H */
+
+/* Define to 1 if you have the <string.h> header file. */
+/* #undef HAVE_STRING_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+/* #undef HAVE_SYS_SOCKIO_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+/* #undef HAVE_SYS_STAT_H */
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+/* #undef HAVE_SYS_TYPES_H */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #undef HAVE_UNISTD_H */
+
+/* Define to 1 if you have the <values.h> header file. */
+#define HAVE_VALUES_H 1
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* staticly linked images */
+/* #undef STATIC_LINKING */
+
+/* Define to 1 if you have the ANSI C header files. */
+/* #undef STDC_HEADERS */
+#include <stdarg.h>
+#define _VA_LIST_DEFINED
+
+#include <setjmp.h>
+#include <stdio.h>
+
+/* #define endp(obje) endp1(obje) */
+
+#define STSET(type,x,i,val) do{SGC_TOUCH(x);STREF(type,x,i) = (val);} while(0)
+
+
+#ifndef NEW_LISP
+#define t_doublefloat t_longfloat
+#endif
+
+enum type {
+ t_cons,
+ t_start = 0,
+ t_fixnum,
+ t_bignum,
+ t_ratio,
+ t_shortfloat,
+ t_doublefloat,
+ t_complex,
+ t_character,
+ t_symbol,
+ t_package,
+ t_hashtable,
+ t_array,
+ t_vector,
+ t_string,
+ t_bitvector,
+ t_structure,
+ t_stream,
+ t_random,
+ t_readtable,
+ t_pathname,
+ t_cfun,
+ t_cclosure,
+ t_sfun,
+ t_gfun,
+ t_vfun,
+ t_afun,
+ t_closure,
+ t_cfdata,
+ t_spice,
+ t_end,
+ t_contiguous,
+ t_relocatable,
+ t_other
+};
+
+
+enum signals_allowed_values {
+ sig_none,
+ sig_normal,
+ sig_try_to_delay,
+ sig_safe,
+ sig_at_read,
+ sig_use_signals_allowed_value
+
+};
+
+
+#ifdef __SHORT_LIMB
+typedef unsigned int mp_limb_t;
+#else
+#ifdef __LONG_LONG_LIMB
+typedef unsigned long long int mp_limb_t;
+#else
+typedef unsigned long int mp_limb_t;
+#endif
+#endif
+
+typedef mp_limb_t * mp_ptr;
+
+typedef struct
+{
+ int _mp_alloc; /* Number of *limbs* allocated and pointed
+ to by the _mp_d field. */
+ int _mp_size; /* abs(_mp_size) is the number of limbs the
+ last field points to. If _mp_size is
+ negative this is a negative number. */
+ mp_limb_t *_mp_d; /* Pointer to the limbs. */
+} __mpz_struct;
+
+typedef __mpz_struct MP_INT;
+
+/*
+ Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
+
+This file is part of GNU Common Lisp, herein referred to as GCL
+
+GCL is free software; you can redistribute it and/or modify it under
+the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCL is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+License for more details.
+
+You should have received a copy of the GNU Library General Public License
+along with GCL; see the file COPYING. If not, write to the Free Software
+Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+/*
+ object.h
+*/
+
+/*
+ Some system constants.
+*/
+
+#define TRUE 1 /* boolean true value */
+#define FALSE 0 /* boolean false value */
+
+#define FIRSTWORD unsigned char t,flag; char s,m
+
+#define NBPP 4 /* number of bytes per pointer */
+
+#ifndef PAGEWIDTH
+#define PAGEWIDTH 11 /* page width */
+#endif
+ /* log2(PAGESIZE) */
+#undef PAGESIZE
+#define PAGESIZE (1 << PAGEWIDTH) /* page size in bytes */
+
+
+#define CHCODELIM 256 /* character code limit */
+ /* ASCII character set */
+#define CHFONTLIM 1 /* character font limit */
+#define CHBITSLIM 1 /* character bits limit */
+#define CHCODEFLEN 8 /* character code field length */
+#define CHFONTFLEN 0 /* character font field length */
+#define CHBITSFLEN 0 /* character bits field length */
+
+#define PHTABSIZE 512 /* number of entries */
+ /* in the package hash table */
+
+#define ARANKLIM 64 /* array rank limit */
+
+#define RTABSIZE CHCODELIM
+ /* read table size */
+
+#define CBMINSIZE 64 /* contiguous block minimal size */
+
+#ifndef CHAR_SIZE
+#define CHAR_SIZE 8 /* number of bits in a char */
+#endif
+
+#undef bool
+typedef int bool;
+typedef long fixnum;
+typedef unsigned long ufixnum;
+typedef float shortfloat;
+typedef double longfloat;
+typedef unsigned short fatchar;
+
+#ifndef plong
+#define plong int
+#endif
+
+
+#define SIGNED_CHAR(x) (((char ) -1) < (char )0 ? (char) x \
+ : (x >= (1<<(CHAR_SIZE-1)) ? \
+ x - (((int)(1<<(CHAR_SIZE-1))) << 1) \
+ : (char ) x))
+
+
+/*
+ Definition of the type of LISP objects.
+*/
+typedef union lispunion *object;
+
+typedef union int_object iobject;
+union int_object {object o; fixnum i;};
+
+/*
+ OBJect NULL value.
+ It should not coincide with any legal object value.
+*/
+#define OBJNULL ((object)NULL)
+
+/*
+ Definition of each implementation type.
+*/
+
+struct fixnum_struct {
+ FIRSTWORD;
+ fixnum FIXVAL; /* fixnum value */
+};
+#define Mfix(obje) (obje)->FIX.FIXVAL
+#define fix(x) Mfix(x)
+
+#define SMALL_FIXNUM_LIMIT 1024
+
+/* EXTER */
+/* struct fixnum_struct small_fixnum_table[2*SMALL_FIXNUM_LIMIT]; */
+
+/* #define small_fixnum(i) \ */
+/* (object)(small_fixnum_table+SMALL_FIXNUM_LIMIT+(i)) */
+
+struct shortfloat_struct {
+ FIRSTWORD;
+ shortfloat SFVAL; /* shortfloat value */
+};
+#define Msf(obje) (obje)->SF.SFVAL
+#define sf(x) Msf(x)
+
+struct longfloat_struct {
+ FIRSTWORD;
+ longfloat LFVAL; /* longfloat value */
+};
+#define Mlf(obje) (obje)->LF.LFVAL
+#define lf(x) Mlf(x)
+
+
+
+/* #ifdef _MP_H */
+
+/* #else */
+/* typedef struct */
+/* { */
+/* int _mp_alloc; Number of *limbs* allocated and pointed */
+/* to by the _mp_d field. */
+/* int _mp_size; abs(_mp_size) is the number of limbs the */
+/* last field points to. If _mp_size is */
+/* negative this is a negative number. */
+/* void *_mp_d; Pointer to the limbs. */
+/* } our_mpz_struct; */
+/* #endif */
+
+struct bignum {
+ FIRSTWORD;
+#ifdef GMP
+ __mpz_struct big_mpz_t;
+#else
+ plong *big_self; /* bignum body */
+ int big_length; /* bignum length */
+#endif
+};
+
+struct ratio {
+ FIRSTWORD;
+ object rat_den; /* denominator */
+ /* must be an integer */
+ object rat_num; /* numerator */
+ /* must be an integer */
+};
+
+struct complex {
+ FIRSTWORD;
+ object cmp_real; /* real part */
+ /* must be a number */
+ object cmp_imag; /* imaginary part */
+ /* must be a number */
+};
+
+struct character {
+ FIRSTWORD;
+ unsigned short ch_code; /* code */
+ unsigned char ch_font; /* font */
+ unsigned char ch_bits; /* bits */
+};
+
+
+
+/* struct character character_table1[256+128]; */
+/* EXTER */
+/* union lispunion character_table1[256+128]; */
+/* #define character_table (character_table1+128) */
+/* #define code_char(c) (object)(character_table+(c)) */
+/* #define char_code(obje) ((object)obje)->ch.ch_code */
+/* #define char_font(obje) ((object)obje)->ch.ch_font */
+/* #define char_bits(obje) ((object)obje)->ch.ch_bits */
+
+enum stype { /* symbol type */
+ stp_ordinary, /* ordinary */
+ stp_constant, /* constant */
+ stp_special /* special */
+};
+
+#define Cnil ((object)&Cnil_body)
+#define Ct ((object)&Ct_body)
+#define sLnil Cnil
+#define sLt Ct
+
+#define NOT_SPECIAL ((void (*)())Cnil)
+#define s_fillp st_fillp
+#define s_self st_self
+
+struct symbol {
+ FIRSTWORD;
+ object s_dbind; /* dynamic binding */
+ void (*s_sfdef)(); /* special form definition */
+ /* This field coincides with c_car */
+ char *s_self; /* print name */
+ /* These fields coincide with */
+ /* st_fillp and st_self. */
+ int s_fillp; /* print name length */
+
+ object s_gfdef; /* global function definition */
+ /* For a macro, */
+ /* its expansion function */
+ /* is to be stored. */
+ object s_plist; /* property list */
+ object s_hpack; /* home package */
+ /* Cnil for uninterned symbols */
+ short s_stype; /* symbol type */
+ /* of enum stype */
+ short s_mflag; /* macro flag */
+};
+EXTER
+/* struct symbol Cnil_body, Ct_body; */
+union lispunion Cnil_body, Ct_body;
+
+struct package {
+ FIRSTWORD;
+ object p_name; /* package name */
+ /* a string */
+ object p_nicknames; /* nicknames */
+ /* list of strings */
+ object p_shadowings; /* shadowing symbol list */
+ object p_uselist; /* use-list of packages */
+ object p_usedbylist; /* used-by-list of packages */
+ object *p_internal; /* hashtable for internal symbols */
+ object *p_external; /* hashtable for external symbols */
+ int p_internal_size; /* size of internal hash table*/
+ int p_external_size; /* size of external hash table */
+ int p_internal_fp; /* [rough] number of symbols */
+ int p_external_fp; /* [rough] number of symbols */
+ struct package
+ *p_link; /* package link */
+};
+
+/*
+ The values returned by intern and find_symbol.
+ File_symbol may return 0.
+*/
+#define INTERNAL 1
+#define EXTERNAL 2
+#define INHERITED 3
+
+/*
+ All the packages are linked through p_link.
+*/
+EXTER struct package *pack_pointer; /* package pointer */
+
+struct cons {
+ FIRSTWORD;
+ object c_cdr; /* cdr */
+ object c_car; /* car */
+};
+
+enum httest { /* hash table key test function */
+ htt_eq, /* eq */
+ htt_eql, /* eql */
+ htt_equal /* equal */
+};
+
+struct htent { /* hash table entry */
+ object hte_key; /* key */
+ object hte_value; /* value */
+};
+
+struct hashtable { /* hash table header */
+ FIRSTWORD;
+ struct htent
+ *ht_self; /* pointer to the hash table */
+ object ht_rhsize; /* rehash size */
+ object ht_rhthresh; /* rehash threshold */
+ int ht_nent; /* number of entries */
+ int ht_size; /* hash table size */
+ short ht_test; /* key test function */
+ /* of enum httest */
+};
+
+enum aelttype { /* array element type */
+ aet_object, /* t */
+ aet_ch, /* string-char */
+ aet_bit, /* bit */
+ aet_fix, /* fixnum */
+ aet_sf, /* short-float */
+ aet_lf, /* plong-float */
+ aet_char, /* signed char */
+ aet_uchar, /* unsigned char */
+ aet_short, /* signed short */
+ aet_ushort, /* unsigned short */
+ aet_last
+ };
+
+struct array { /* array header */
+ FIRSTWORD;
+ object a_displaced; /* displaced */
+ short a_rank; /* array rank */
+ short a_elttype; /* element type */
+ object *a_self; /* pointer to the array */
+ short a_adjustable; /* adjustable flag */
+ short a_offset; /* bitvector offset */
+ int a_dim; /* dimension */
+ int *a_dims; /* table of dimensions */
+
+};
+
+
+
+struct vector { /* vector header */
+ FIRSTWORD;
+ object v_displaced; /* displaced */
+ short v_hasfillp; /* has-fill-pointer flag */
+ short v_elttype; /* element type */
+
+ object *v_self; /* pointer to the vector */
+ int v_fillp; /* fill pointer */
+ /* For simple vectors, */
+ /* v_fillp is equal to v_dim. */
+ int v_dim; /* dimension */
+ short v_adjustable; /* adjustable flag */
+ short v_offset; /* not used */
+};
+
+struct string { /* string header */
+ FIRSTWORD;
+ object st_displaced; /* displaced */
+ short st_hasfillp; /* has-fill-pointer flag */
+ short st_adjustable; /* adjustable flag */
+ char *st_self; /* pointer to the string */
+ int st_fillp; /* fill pointer */
+ /* For simple strings, */
+ /* st_fillp is equal to st_dim. */
+ int st_dim; /* dimension */
+ /* string length */
+
+};
+
+struct ustring {
+ FIRSTWORD;
+ object ust_displaced;
+ short ust_hasfillp;
+ short ust_adjustable;
+ unsigned char *ust_self;
+ int ust_fillp;
+
+ int ust_dim;
+
+
+};
+
+#define USHORT_GCL(x,i) (((unsigned short *)(x)->ust.ust_self)[i])
+#define SHORT_GCL(x,i) ((( short *)(x)->ust.ust_self)[i])
+
+#define BV_OFFSET(x) ((type_of(x)==t_bitvector ? x->bv.bv_offset : \
+ type_of(x)== t_array ? x->a.a_offset : (abort(),0)))
+
+#define SET_BV_OFFSET(x,val) ((type_of(x)==t_bitvector ? x->bv.bv_offset = val : \
+ type_of(x)== t_array ? x->a.a_offset=val : (abort(),0)))
+
+
+
+
+struct bitvector { /* bitvector header */
+ FIRSTWORD;
+ object bv_displaced; /* displaced */
+ short bv_hasfillp; /* has-fill-pointer flag */
+ short bv_elttype; /* not used */
+ char *bv_self; /* pointer to the bitvector */
+ int bv_fillp; /* fill pointer */
+ /* For simple bitvectors, */
+ /* st_fillp is equal to st_dim. */
+ int bv_dim; /* dimension */
+ /* number of bits */
+ short bv_adjustable; /* adjustable flag */
+ short bv_offset; /* bitvector offset */
+ /* the position of the first bit */
+ /* in the first byte */
+};
+
+struct fixarray { /* fixnum array header */
+ FIRSTWORD;
+ object fixa_displaced; /* displaced */
+ short fixa_rank; /* array rank */
+ short fixa_elttype; /* element type */
+ fixnum *fixa_self; /* pointer to the array */
+ short fixa_adjustable;/* adjustable flag */
+ short fixa_offset; /* not used */
+ int fixa_dim; /* dimension */
+ int *fixa_dims; /* table of dimensions */
+
+};
+
+struct sfarray { /* short-float array header */
+ FIRSTWORD;
+ object sfa_displaced; /* displaced */
+ short sfa_rank; /* array rank */
+ short sfa_elttype; /* element type */
+ shortfloat
+ *sfa_self; /* pointer to the array */
+ short sfa_adjustable; /* adjustable flag */
+ short sfa_offset; /* not used */
+ int sfa_dim; /* dimension */
+
+ int *sfa_dims; /* table of dimensions */
+
+
+
+};
+
+struct lfarray { /* plong-float array header */
+ FIRSTWORD;
+ object lfa_displaced; /* displaced */
+ short lfa_rank; /* array rank */
+ short lfa_elttype; /* element type */
+ longfloat
+ *lfa_self; /* pointer to the array */
+ short lfa_adjustable; /* adjustable flag */
+ short lfa_offset; /* not used */
+ int lfa_dim; /* dimension */
+ int *lfa_dims; /* table of dimensions */
+
+
+};
+
+struct structure { /* structure header */
+ FIRSTWORD;
+ object str_def; /* structure definition (a structure) */
+ object *str_self; /* structure self */
+};
+
+struct s_data {object name;
+ fixnum length;
+ object raw;
+ object included;
+ object includes;
+ object staticp;
+ object print_function;
+ object slot_descriptions;
+ object slot_position;
+ fixnum size;
+ object has_holes;
+ };
+
+#define S_DATA(x) ((struct s_data *)((x)->str.str_self))
+#define SLOT_TYPE(def,i) (((S_DATA(def))->raw->ust.ust_self[i]))
+#define SLOT_POS(def,i) USHORT_GCL(S_DATA(def)->slot_position,i)
+#define STREF(type,x,i) (*((type *)(((char *)((x)->str.str_self))+(i))))
+
+
+
+enum smmode { /* stream mode */
+ smm_input, /* input */
+ smm_output, /* output */
+ smm_io, /* input-output */
+ smm_probe, /* probe */
+ smm_synonym, /* synonym */
+ smm_broadcast, /* broadcast */
+ smm_concatenated, /* concatenated */
+ smm_two_way, /* two way */
+ smm_echo, /* echo */
+ smm_string_input, /* string input */
+ smm_string_output, /* string output */
+ smm_user_defined, /* for user defined */
+ smm_socket /* Socket stream */
+};
+
+/* for any stream that takes writec_char, directly (not two_way or echo)
+ ie. smm_output,smm_io, smm_string_output, smm_socket
+ */
+#define STREAM_FILE_COLUMN(str) ((str)->sm.sm_int1)
+
+/* for smm_echo */
+#define ECHO_STREAM_N_UNREAD(strm) ((strm)->sm.sm_int0)
+
+/* file fd for socket */
+#define SOCKET_STREAM_FD(strm) ((strm)->sm.sm_fd)
+#define SOCKET_STREAM_BUFFER(strm) ((strm)->sm.sm_object1)
+
+/* for smm_string_input */
+#define STRING_INPUT_STREAM_NEXT(strm) ((strm)->sm.sm_int0)
+#define STRING_INPUT_STREAM_END(strm) ((strm)->sm.sm_int1)
+
+/* for smm_two_way and smm_echo */
+#define STREAM_OUTPUT_STREAM(strm) ((strm)->sm.sm_object1)
+#define STREAM_INPUT_STREAM(strm) ((strm)->sm.sm_object0)
+
+/* for smm_string_{input,output} */
+#define STRING_STREAM_STRING(strm) ((strm)->sm.sm_object0)
+
+struct stream {
+ FIRSTWORD;
+ FILE *sm_fp; /* file pointer */
+ object sm_object0; /* some object */
+ object sm_object1; /* some object */
+ int sm_int0; /* some int */
+ int sm_int1; /* column for input or output, stream */
+ char *sm_buffer; /* ptr to BUFSIZE block of storage */
+ char sm_mode; /* stream mode */
+ unsigned char sm_flags; /* flags from gcl_sm_flags */
+ short sm_fd; /* stream fd */
+
+};
+/* flags */
+#define GET_STREAM_FLAG(strm,name) ((strm)->sm.sm_flags & (1<<(name)))
+#define SET_STREAM_FLAG(strm,name,val) {if (val) (strm)->sm.sm_flags |= (1<<(name)); else (strm)->sm.sm_flags &= ~(1<<(name));}
+
+#define GCL_MODE_BLOCKING 1
+#define GCL_MODE_NON_BLOCKING 0
+#define GCL_TCP_ASYNC 1
+
+enum gcl_sm_flags {
+ gcl_sm_blocking=1,
+ gcl_sm_tcp_async,
+ gcl_sm_input,
+ gcl_sm_output,
+ gcl_sm_had_error
+
+
+};
+
+#ifdef BSD
+#ifdef SUN3
+#define BASEFF (unsigned char *)0xffffffff
+#else
+#define BASEFF (char *)0xffffffff
+#endif
+#endif
+
+#ifdef ATT
+#define BASEFF (unsigned char *)0xffffffff
+#endif
+
+#ifdef E15
+#define BASEFF (unsigned char *)0xffffffff
+#endif
+
+#ifdef MV
+
+
+#endif
+
+struct random {
+ FIRSTWORD;
+ unsigned rnd_value; /* random state value */
+};
+
+enum chattrib { /* character attribute */
+ cat_whitespace, /* whitespace */
+ cat_terminating, /* terminating macro */
+ cat_non_terminating, /* non-terminating macro */
+ cat_single_escape, /* single-escape */
+ cat_multiple_escape, /* multiple-escape */
+ cat_constituent /* constituent */
+};
+
+struct rtent { /* read table entry */
+ enum chattrib rte_chattrib; /* character attribute */
+ object rte_macro; /* macro function */
+ object *rte_dtab; /* pointer to the */
+ /* dispatch table */
+ /* NULL for */
+ /* non-dispatching */
+ /* macro character, or */
+ /* non-macro character */
+};
+
+struct readtable { /* read table */
+ FIRSTWORD;
+ struct rtent *rt_self; /* read table itself */
+};
+
+struct pathname {
+ FIRSTWORD;
+ object pn_host; /* host */
+ object pn_device; /* device */
+ object pn_directory; /* directory */
+ object pn_name; /* name */
+ object pn_type; /* type */
+ object pn_version; /* version */
+};
+
+struct cfun { /* compiled function header */
+ FIRSTWORD;
+ object cf_name; /* compiled function name */
+ void (*cf_self)(); /* entry address */
+ object cf_data; /* data the function uses */
+ /* for GBC */
+};
+
+struct cclosure { /* compiled closure header */
+ FIRSTWORD;
+ object cc_name; /* compiled closure name */
+ void (*cc_self)(); /* entry address */
+ object cc_env; /* environment */
+ object cc_data; /* data the closure uses */
+ /* for GBC */
+ int cc_envdim;
+ object *cc_turbo; /* turbo charger */
+};
+
+struct closure {
+ FIRSTWORD;
+ object cl_name; /* name */
+ object (*cl_self)(); /* C start address of code */
+ object cl_data; /* To object holding VV vector */
+ int cl_argd; /* description of args + number */
+ int cl_envdim; /* length of the environment vector */
+ object *cl_env; /* environment vector referenced by cl_self()*/
+};
+
+struct sfun {
+ FIRSTWORD;
+ object sfn_name; /* name */
+ object (*sfn_self)(); /* C start address of code */
+ object sfn_data; /* To object holding VV vector */
+ int sfn_argd; /* description of args + number */
+
+ };
+
+struct vfun {
+ FIRSTWORD;
+ object vfn_name; /* name */
+ object (*vfn_self)(); /* C start address of code */
+ object vfn_data; /* To object holding VV data */
+ unsigned short vfn_minargs; /* Min args and where varargs start */
+ unsigned short vfn_maxargs; /* Max number of args */
+ };
+struct cfdata {
+ FIRSTWORD;
+ char *cfd_start; /* beginning of contblock for fun */
+ int cfd_size; /* size of contblock */
+ int cfd_fillp; /* size of self */
+ object *cfd_self; /* body */
+ };
+
+struct spice {
+ FIRSTWORD;
+ int spc_dummy;
+};
+
+/*
+ dummy type
+*/
+struct dummy {
+ FIRSTWORD;
+};
+
+/*
+ Definition of lispunion.
+*/
+union lispunion {
+ struct fixnum_struct
+ FIX; /* fixnum */
+ struct bignum big; /* bignum */
+ struct ratio rat; /* ratio */
+ struct shortfloat_struct
+ SF; /* short floating-point number */
+ struct longfloat_struct
+ LF; /* plong floating-point number */
+ struct complex cmp; /* complex number */
+ struct character
+ ch; /* character */
+ struct symbol s; /* symbol */
+ struct package p; /* package */
+ struct cons c; /* cons */
+ struct hashtable
+ ht; /* hash table */
+ struct array a; /* array */
+ struct vector v; /* vector */
+ struct string st; /* string */
+ struct ustring ust;
+ struct bitvector
+ bv; /* bit-vector */
+ struct structure
+ str; /* structure */
+ struct stream sm; /* stream */
+ struct random rnd; /* random-states */
+ struct readtable
+ rt; /* read table */
+ struct pathname pn; /* path name */
+ struct cfun cf; /* compiled function uses value stack] */
+ struct cclosure cc; /* compiled closure uses value stack */
+ struct closure cl; /* compiled closure uses c stack */
+ struct sfun sfn; /* simple function */
+ struct vfun vfn; /* function with variable number of args */
+ struct cfdata cfd; /* compiled fun data */
+ struct spice spc; /* spice */
+
+ struct dummy d; /* dummy */
+
+ struct fixarray fixa; /* fixnum array */
+ struct sfarray sfa; /* short-float array */
+ struct lfarray lfa; /* plong-float array */
+};
+
+
+/* struct character character_table1[256+128]; */
+EXTER
+union lispunion character_table1[256+128];
+#define character_table (character_table1+128)
+#define code_char(c) (object)(character_table+(c))
+#define char_code(obje) ((object)obje)->ch.ch_code
+#define char_font(obje) ((object)obje)->ch.ch_font
+#define char_bits(obje) ((object)obje)->ch.ch_bits
+
+EXTER
+union lispunion small_fixnum_table[2*SMALL_FIXNUM_LIMIT];
+
+#define small_fixnum(i) \
+ (object)(small_fixnum_table+SMALL_FIXNUM_LIMIT+(i))
+
+
+
+#define address_int unsigned long
+
+/*
+ The struct of free lists.
+*/
+struct freelist {
+ FIRSTWORD;
+ address_int f_link;
+};
+#ifndef INT_TO_ADDRESS
+#define INT_TO_ADDRESS(x) ((object )(long )x)
+#endif
+
+#define F_LINK(x) ((struct freelist *)(long) x)->f_link
+#define FL_LINK F_LINK
+#define SET_LINK(x,val) F_LINK(x) = (address_int) (val)
+#define OBJ_LINK(x) ((object) INT_TO_ADDRESS(F_LINK(x)))
+
+#define FREE (-1) /* free object */
+
+/*
+ Type_of.
+*/
+#define type_of(obje) ((enum type)(((object)(obje))->d.t))
+
+/*
+ Storage manager for each type.
+*/
+struct typemanager {
+ enum type
+ tm_type; /* type */
+ short tm_size; /* element size in bytes */
+ short tm_nppage; /* number per page */
+ object tm_free; /* free list */
+ /* Note that it is of type object. */
+ long tm_nfree; /* number of free elements */
+ long tm_nused; /* number of elements used */
+ long tm_npage; /* number of pages */
+ long tm_maxpage; /* maximum number of pages */
+ char *tm_name; /* type name */
+ int tm_gbccount; /* GBC count */
+ object tm_alt_free; /* Alternate free list (swap with tm_free) */
+ long tm_alt_nfree; /* Alternate nfree (length of nfree) */
+ short tm_sgc; /* this type has at least this many
+ sgc pages */
+ short tm_sgc_minfree; /* number free on a page to qualify for
+ being an sgc page */
+ short tm_sgc_max; /* max on sgc pages */
+ short tm_min_grow; /* min amount to grow when growing */
+ short tm_max_grow; /* max amount to grow when growing */
+ short tm_growth_percent; /* percent to increase maxpages */
+ short tm_percent_free; /* percent which must be free after a gc for this type */
+ short tm_distinct; /* pages of this type are distinct */
+ float tm_adjgbccnt;
+ long tm_opt_maxpage;
+};
+
+
+/*
+ The table of type managers.
+*/
+EXTER struct typemanager tm_table[ 32 /* (int) t_relocatable */];
+
+#define tm_of(t) (&(tm_table[(int)tm_table[(int)(t)].tm_type]))
+
+/*
+ Contiguous block header.
+*/
+struct contblock { /* contiguous block header */
+ int cb_size; /* size in bytes */
+ struct contblock
+ *cb_link; /* contiguous block link */
+};
+
+/*
+ The pointer to the contiguous blocks.
+*/
+EXTER struct contblock *cb_pointer; /* contblock pointer */
+
+/* SGC cont pages: After SGC_start, old_cb_pointer will be a linked
+ list of free blocks on non-SGC pages, and cb_pointer will be
+ likewise for SGC pages. CM 20030827*/
+EXTER struct contblock *old_cb_pointer; /* old contblock pointer when in SGC */
+
+/* SGC cont pages: FIXME -- at some point, enable runtime disabling of
+ SGC cont pages. Right now, the tm_sgc variable for type contiguous
+ will govern only the possible attempt to get new pages for SGC.
+ Contiguous pages normally allocated when SGC is on will always be
+ marked with SGC_PAGE_FLAG, as the current GBC algorithm always uses
+ sgc_contblock_sweep_phase in this case. */
+/* #define SGC_CONT_ENABLED (sgc_enabled && tm_table[t_contiguous].tm_sgc) */
+#define SGC_CONT_ENABLED (sgc_enabled)
+
+/*
+ Variables for memory management.
+*/
+EXTER long ncb; /* number of contblocks */
+/* int ncbpage; number of contblock pages */
+#define ncbpage tm_table[t_contiguous].tm_npage
+#define maxcbpage tm_table[t_contiguous].tm_maxpage
+#define cbgbccount tm_table[t_contiguous].tm_gbccount
+
+
+/* int maxcbpage; maximum number of contblock pages */
+EXTER
+long holepage; /* hole pages */
+#define nrbpage tm_table[t_relocatable].tm_npage
+#define rbgbccount tm_table[t_relocatable].tm_gbccount
+/* int nrbpage; number of relblock pages */
+
+
+EXTER
+char *rb_start; /* relblock start */
+EXTER char *rb_end; /* relblock end */
+EXTER char *rb_limit; /* relblock limit */
+EXTER char *rb_pointer; /* relblock pointer */
+EXTER char *rb_start1; /* relblock start in copy space */
+EXTER char *rb_pointer1; /* relblock pointer in copy space */
+
+EXTER char *heap_end; /* heap end */
+EXTER char *core_end; /* core end */
+EXTER
+char *tmp_alloc;
+
+/* make f allocate enough extra, so that we can round
+ up, the address given to an even multiple. Special
+ case of size == 0 , in which case we just want an aligned
+ number in the address range
+ */
+
+#define ALLOC_ALIGNED(f, size,align) \
+ (align <= sizeof(plong) ? (char *)((f)(size)) : \
+ (tmp_alloc = (char *)((f)(size+(size ?(align)-1 : 0)))+(align)-1 , \
+ (char *)(align * (((unsigned long)tmp_alloc)/align))))
+#define AR_ALLOC(f,n,type) (type *) \
+ (ALLOC_ALIGNED(f,(n)*sizeof(type),sizeof(type)))
+
+
+/* FIXME Make all other page constants scale similarly by default. */
+#ifndef HOLEPAGE
+#define HOLEPAGE (MAXPAGE/10)
+#endif
+
+
+/* #define INIT_HOLEPAGE 150 */
+/* #define INIT_NRBPAGE 50 */
+/* #define RB_GETA 512 */
+
+#define INIT_HOLEPAGE (6*HOLEPAGE/5)
+#define INIT_NRBPAGE (INIT_HOLEPAGE/3)
+#define RB_GETA (10*INIT_NRBPAGE)
+
+
+#ifdef AV
+#define STATIC register
+#endif
+#ifdef MV
+
+#endif
+
+#define TIME_ZONE (-9)
+/* EXTER */
+/* fixnum FIXtemp; */
+
+/* For IEEEFLOAT, the double may have exponent in the second word
+(little endian) or first word.*/
+
+#if defined(I386) || defined(LITTLE_END)
+#define HIND 1 /* (int) of double where the exponent and most signif is */
+#define LIND 0 /* low part of a double */
+#else /* big endian */
+#define HIND 0
+#define LIND 1
+#endif
+#ifndef VOL
+#define VOL
+#endif
+
+
+#define isUpper(xxx) (((xxx)&0200) == 0 && isupper((int)xxx))
+#define isLower(xxx) (((xxx)&0200) == 0 && islower((int)xxx))
+#define isDigit(xxx) (((xxx)&0200) == 0 && isdigit((int)xxx))
+enum ftype {f_object,f_fixnum};
+EXTER
+char *alloca_val;
+/* ...xx|xx|xxxx|xxxx|
+ ret Narg */
+
+/* a9a8a7a6a5a4a3a4a3a2a1a0rrrrnnnnnnnn
+ ai=argtype(i) ret nargs
+ */
+#define SFUN_NARGS(x) (x & 0xff) /* 8 bits */
+#define RESTYPE(x) (x<<8) /* 3 bits */
+ /* set if the VFUN_NARGS = m ; has been set correctly */
+#define VFUN_NARG_BIT (1 <<11)
+#define ARGTYPE(i,x) ((x) <<(12+(i*2)))
+#define ARGTYPE1(x) (1 | ARGTYPE(0,x))
+#define ARGTYPE2(x,y) (2 | ARGTYPE(0,x) | ARGTYPE(1,y))
+#define ARGTYPE3(x,y,z) (3 | ARGTYPE(0,x) | ARGTYPE(1,y) | ARGTYPE(2,z))
+
+object make_si_sfun();
+EXTER object MVloc[10];
+
+/* Set new to be an (object *) whose [i]'th elmt is the
+ ith elmnt in a va_list
+ if
+ ((vl[0] == va_arg(ap,object)) ||
+ (vl[1] == va_arg(ap,object)) || .. vl[n-1] == va_arg(ap,object))
+ you may set
+ #define DONT_COPY_VA_LIST
+ In recent versions of gcc, i think the builtin_alist stuff does not
+ allow setting this.
+ */
+#ifdef DONT_COPY_VA_LIST
+#define COERCE_VA_LIST(new,vl,n) new = (object *) (vl)
+#else
+#define COERCE_VA_LIST(new,vl,n) \
+ object Xxvl[65]; \
+ {int i; \
+ new=Xxvl; \
+ if (n >= 65) FEerror("Too plong vl",0); \
+ for (i=0 ; i < (n); i++) new[i]=va_arg(vl,object);}
+#endif
+
+#ifdef DONT_COPY_VA_LIST
+#error Cannot set DONT_COPY_VA_LIST in ANSI C
+#else
+#define COERCE_VA_LIST_NEW(new,fst,vl,n) \
+ object Xxvl[65]; \
+ {int i; \
+ new=Xxvl; \
+ if (n >= 65) FEerror("va_list too long",0); \
+ for (i=0 ; i < (n); i++) new[i]=i ? va_arg(vl,object) : fst;}
+#endif
+
+
+
+#define make_si_vfun(s,f,min,max) \
+ make_si_vfun1(s,f,min | (max << 8))
+
+/* Number of args supplied to a variable arg t_vfun
+ Used by the C function to set optionals */
+
+struct call_data {
+ object fun;
+ int argd;
+ int nvalues;
+ object values[50];
+ double double_return;
+};
+EXTER struct call_data fcall;
+
+#define VFUN_NARGS fcall.argd
+#define RETURN2(x,y) do{/* object _x = (void *) x; */\
+ fcall.values[2]=y;fcall.nvalues=2; \
+ return (x) ;} while(0)
+#define RETURN1(x) do{fcall.nvalues=1; return (x) ;} while(0)
+#define RETURN0 do{fcall.nvalues=0; return Cnil ;} while(0)
+
+#define RV(x) (*_p++ = x)
+
+#define RETURNI(n,val1,listvals) RETURN(n,int,val1,listvals)
+#define RETURNO(n,val1,listvals) RETURN(n,object,val1,listvals)
+
+/* eg: RETURN(3,object,val1,(RV(val2),RV(val3))) */
+#define RETURN(n,typ,val1,listvals) \
+ do{typ _val1 = val1; object *_p=&fcall.values[1]; listvals; fcall.nvalues= n; return _val1;}while(0)
+/* #define CALL(n,form) (VFUN_NARGS=n,form) */
+
+
+
+/* we sometimes have to touch the header of arrays or structures
+ to make sure the page is writable */
+#ifdef SGC
+#define SGC_TOUCH(x) if ((x)->d.m) system_error(); (x)->d.m=0
+#else
+#define SGC_TOUCH(x)
+#endif
+
+object funcall_cfun(void(*)(),int,...);
+object clear_compiler_properties();
+EXTER object sSlambda_block_expanded;
+
+# ifdef __GNUC__
+# define assert(ex)\
+{if (!(ex)){(void)fprintf(stderr, \
+ "Assertion failed: file \"%s\", line %d\n", __FILE__, __LINE__);exit(1);}}
+# else
+# define assert(ex)
+# endif
+
+#ifndef FIX_PATH_STRING
+#define FIX_PATH_STRING(file) file
+#endif
+
+
+#define CHECK_INTERRUPT if (signals_pending) raise_pending_signals(sig_safe)
+
+#define BEGIN_NO_INTERRUPT \
+ plong old_signals_allowed = signals_allowed; \
+ signals_allowed = 0
+
+#define END_NO_INTERRUPT \
+ signals_allowed = old_signals_allowed
+/* could add: if (signals_pending)
+ raise_pending_signals(sig_use_signals_allowed_value) */
+
+
+#define END_NO_INTERRUPT_SAFE \
+ signals_allowed = old_signals_allowed; \
+ if (signals_pending) \
+ do{ if(signals_allowed ==0) /* should not get here*/abort(); \
+ raise_pending_signals(sig_safe)}while(0)
+
+void raise_pending_signals();
+
+EXTER unsigned plong signals_allowed, signals_pending ;
+
+EXTER struct symbol Dotnil_body;
+#define Dotnil ((object)&Dotnil_body)
+
+#define endp(x) ({\
+ static union lispunion s_my_dot={.c={t_cons,0,0,0,Dotnil,Dotnil}}; \
+ object _x=(x);\
+ bool _b=FALSE;\
+ \
+ if (type_of(_x)==t_cons) {\
+ if (type_of(_x->c.c_cdr)!=t_cons && _x->c.c_cdr!=Cnil)\
+ s_my_dot.c.c_car=_x->c.c_cdr;\
+ else \
+ s_my_dot.c.c_car=Dotnil;\
+ } else {\
+ if (_x==s_my_dot.c.c_car)\
+ x=&s_my_dot;\
+ else {\
+ s_my_dot.c.c_car=Dotnil;\
+ if (_x==Cnil || _x==Dotnil)\
+ _b=TRUE;\
+ else\
+ FEwrong_type_argument(sLlist, _x);\
+ }\
+ }\
+ _b;\
+ })
+
+#define endp_prop(a) (type_of(a)==t_cons ? FALSE : ((a)==Cnil ? TRUE : (FEwrong_type_argument(sLlist, (a)),FALSE)))
+
+#define proper_list(a) (type_of(a)==t_cons || (a)==Cnil)
+#define fix_dot(a) ((a) == Dotnil ? Cnil : (type_of(a)==t_cons && (a)->c.c_cdr==Dotnil ? (a)->c.c_car : (a)))
+/*
+ Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
+
+This file is part of GNU Common Lisp, herein referred to as GCL
+
+GCL is free software; you can redistribute it and/or modify it under
+the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCL is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+License for more details.
+
+You should have received a copy of the GNU Library General Public License
+along with GCL; see the file COPYING. If not, write to the Free Software
+Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+/*
+ vs.h
+
+ value stack
+*/
+
+EXTER object *vs_org;
+EXTER object *vs_limit; /* value stack limit */
+
+EXTER object *vs_base; /* value stack base */
+EXTER object *vs_top; /* value stack top */
+
+#define vs_push(obje) (*vs_top++ = (obje))
+
+#define vs_pop (*--vs_top)
+#define vs_popp (--vs_top)
+#define vs_head vs_top[-1]
+
+#define vs_mark object *old_vs_top = vs_top
+#define vs_reset vs_top = old_vs_top
+
+#define vs_check if (vs_top >= vs_limit) \
+ vs_overflow()
+
+#define vs_check_push(obje) \
+ (vs_top >= vs_limit ? \
+ (object)vs_overflow() : (*vs_top++ = (obje)))
+
+#define check_arg(n) \
+ if (vs_top - vs_base != (n)) \
+ check_arg_failed(n)
+
+#define CHECK_ARG_RANGE(n,m) if (VFUN_NARGS < n || VFUN_NARGS >m) \
+ check_arg_range(n,m)
+
+#define MMcheck_arg(n) \
+ if (vs_top - vs_base < (n)) \
+ too_few_arguments(); \
+ else if (vs_top - vs_base > (n)) \
+ too_many_arguments()
+
+#define vs_reserve(x) if(vs_base+(x) >= vs_limit) \
+ vs_overflow();
+/*
+ Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
+
+This file is part of GNU Common Lisp, herein referred to as GCL
+
+GCL is free software; you can redistribute it and/or modify it under
+the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCL is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+License for more details.
+
+You should have received a copy of the GNU Library General Public License
+along with GCL; see the file COPYING. If not, write to the Free Software
+Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+/*
+ bds.h
+
+ bind stack
+*/
+
+struct bds_bd {
+ object bds_sym; /* symbol */
+ object bds_val; /* previous value of the symbol */
+};
+
+
+typedef struct bds_bd *bds_ptr;
+
+EXTER bds_ptr bds_org;
+
+EXTER bds_ptr bds_limit;
+
+EXTER bds_ptr bds_top; /* bind stack top */
+
+#ifdef KCLOVM
+
+/* for multiprocessing */
+EXTER struct bds_bd save_bind_stack[BDSSIZE + BDSGETA + BDSGETA];
+EXTER bds_ptr bds_save_org;
+EXTER bds_ptr bds_save_limit;
+EXTER bds_ptr bds_save_top;
+
+#endif
+
+#define bds_check \
+ if (bds_top >= bds_limit) \
+ bds_overflow()
+
+/* do this so that an interrupt in the middle will leave the VALID
+ part of the bds stack ie (<= bds_top) in a valid state, so
+ that a throw out will be ok */
+#define bds_bind(sym, val) \
+ do {bds_ptr _b = bds_top+1; \
+ (_b)->bds_sym = (sym); \
+ _b->bds_val = ((object)sym)->s.s_dbind; \
+ ((object)sym)->s.s_dbind = (val); bds_top=_b;} while (0)
+
+#define bds_unwind1 \
+ ((bds_top->bds_sym)->s.s_dbind = bds_top->bds_val, --bds_top)
+
+
+/*
+ Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
+
+This file is part of GNU Common Lisp, herein referred to as GCL
+
+GCL is free software; you can redistribute it and/or modify it under
+the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCL is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+License for more details.
+
+You should have received a copy of the GNU Library General Public License
+along with GCL; see the file COPYING. If not, write to the Free Software
+Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+/*
+
+ frame.h
+
+ frame stack and non-local jump
+*/
+
+
+/* IHS Invocation History Stack */
+
+typedef struct invocation_history {
+ object ihs_function;
+ object *ihs_base;
+} *ihs_ptr;
+
+EXTER ihs_ptr ihs_org;
+
+EXTER ihs_ptr ihs_limit;
+
+EXTER ihs_ptr ihs_top;
+
+#define ihs_check \
+ if (ihs_top >= ihs_limit) \
+ ihs_overflow()
+
+#define ihs_push(function) \
+ (++ihs_top)->ihs_function = (function); \
+ ihs_top->ihs_base = vs_base
+#define ihs_push_base(function,base) \
+ (++ihs_top)->ihs_function = (function); \
+ ihs_top->ihs_base = base
+
+#define ihs_pop() (ihs_top--)
+
+
+#define make_nil_block() \
+{ \
+ object x; \
+ \
+ lex_copy(); \
+ x = alloc_frame_id(); \
+ vs_push(x); \
+ lex_block_bind(Cnil, x); \
+ vs_popp; \
+ frs_push(FRS_CATCH, x); \
+}
+
+
+/* Frame Stack */
+
+enum fr_class {
+ FRS_CATCH, /* for catch,block,tabbody */
+ FRS_CATCHALL, /* for catchall */
+ FRS_PROTECT /* for protect-all */
+};
+
+EXTER int in_signal_handler;
+struct frame {
+ jmp_buf frs_jmpbuf;
+ object *frs_lex;
+ bds_ptr frs_bds_top;
+ char frs_class;
+ char frs_in_signal_handler;
+ object frs_val;
+ ihs_ptr frs_ihs;
+};
+
+typedef struct frame *frame_ptr;
+
+#define alloc_frame_id() alloc_object(t_spice)
+
+/*
+frs_class | frs_value | frs_prev
+----------+--------------------------------------+--------------
+CATCH | frame-id, i.e. |
+ | throw-tag, |
+ | block-id (uninterned symbol), or | value of ihs_top
+ | tagbody-id (uninterned symbol) | when the frame
+----------+--------------------------------------| was pushed
+CATCHALL | NIL |
+----------+--------------------------------------|
+PROTECT | NIL |
+----------------------------------------------------------------
+*/
+
+
+EXTER frame_ptr frs_org;
+
+EXTER frame_ptr frs_limit;
+
+EXTER frame_ptr frs_top; /* frame stack top */
+
+
+#define frs_push(class, val) \
+ do { frame_ptr _frs_top = frs_top +1; \
+ if (_frs_top >= frs_limit) \
+ frs_overflow(); \
+ _frs_top->frs_lex = lex_env;\
+ _frs_top->frs_bds_top = bds_top; \
+ _frs_top->frs_class = (class); \
+ _frs_top->frs_in_signal_handler = in_signal_handler; \
+ _frs_top->frs_val = (val); \
+ _frs_top->frs_ihs = ihs_top; \
+ frs_top=_frs_top; \
+ setjmp(_frs_top->frs_jmpbuf); \
+ } while (0)
+
+#define frs_pop() frs_top--
+
+
+/* global variables used during non-local jump */
+
+EXTER bool nlj_active; /* true during non-local jump */
+EXTER frame_ptr nlj_fr; /* frame to return */
+EXTER object nlj_tag; /* throw-tag, block-id, or */
+ /* (tagbody-id . label). */
+
+
+/*
+(c) Copyright Taiichi Yuasa and Masami Hagiya, 1984. All rights reserved.
+Copying of this file is authorized to users who have executed the true and
+proper "License Agreement for Kyoto Common LISP" with SIGLISP.
+*/
+
+/*
+
+ lex.h
+
+ lexical environment
+*/
+
+
+EXTER object *lex_env;
+
+
+
+/*
+ VS
+ | |
+ |---------------|
+lex_env ------> | lex-var | : lex_env[0]
+ |---------------|
+ | lex-fd | : lex_env[1]
+ |---------------|
+ | lex-tag | : lex_env[2]
+ |---------------|
+ | |
+ | |
+ | |
+
+ lex-var: (symbol value) ; for local binding
+ (.... or ....)
+ (symbol) ; for special binding
+
+ lex-fd: (fun-name 'FUNCTION' function)
+ (.... or ...)
+ (macro-name 'MACRO' expansion-function)
+
+ lex-tag: (tag 'TAG' frame-id)
+ (.... or ....)
+ (block-name 'BLOCK' frame-id)
+
+where 'FUN' is the LISP object with pname FUN, etc.
+
+
+*/
+
+#define lex_copy() ihs_top->ihs_base = vs_top; \
+ vs_push(lex_env[0]); \
+ vs_push(lex_env[1]); \
+ vs_push(lex_env[2]); \
+ lex_env = vs_top - 3
+
+#define lex_new() ihs_top->ihs_base = vs_top; \
+ lex_env = vs_top; \
+ vs_top[0] = vs_top[1] = vs_top[2] = Cnil; \
+ vs_top += 3
+
+#define lex_var_sch(name) assoc_eq((name),lex_env[0])
+
+#define lex_fd_sch(name) assoc_eq((name),lex_env[1])
+
+/*
+ Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
+
+This file is part of GNU Common Lisp, herein referred to as GCL
+
+GCL is free software; you can redistribute it and/or modify it under
+the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCL is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+License for more details.
+
+You should have received a copy of the GNU Library General Public License
+along with GCL; see the file COPYING. If not, write to the Free Software
+Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+/*
+ eval.h
+*/
+
+
+/* C control stack */
+
+#define CSSIZE 20000
+#define CSGETA 4000
+
+EXTER int *cs_org;
+EXTER int *cs_limit;
+
+
+/* we catch the segmentation fault and check to warn of c stack overflow */
+#ifdef AV
+#ifndef cs_check
+#define cs_check(something) \
+ if ((int *)(&something) < cs_limit) \
+ cs_overflow()
+#endif
+#endif
+#ifdef MV
+
+
+
+#endif
+
+/* bind template */
+
+struct bind_temp {
+ object bt_var;
+ object bt_spp;
+ object bt_init;
+ object bt_aux;
+};
+
+
+#define check_symbol(x) \
+ if (type_of(x) != t_symbol) \
+ not_a_symbol(x)
+
+#define check_var(x) \
+ if (type_of(x) != t_symbol || \
+ (enum stype)(x)->s.s_stype == stp_constant) \
+ not_a_variable(x)
+
+
+#define eval_assign(to, form) \
+{ \
+ object *old_top = vs_top; \
+ \
+ eval(form); \
+ to = vs_base[0]; \
+ vs_top = old_top; \
+}
+
+
+#define MMcall(x) \
+ ihs_check; \
+ ihs_push(x); \
+ (*(x)->cf.cf_self)(); \
+ ihs_pop()
+
+#define MMccall(x, env_top) \
+ ihs_check; \
+ ihs_push(x); \
+ (*(x)->cc.cc_self)(env_top); \
+ ihs_pop()
+
+
+#define MMcons(a,d) make_cons((a),(d))
+
+
+#define MMcar(x) (x)->c.c_car
+#define MMcdr(x) (x)->c.c_cdr
+#define MMcaar(x) (x)->c.c_car->c.c_car
+#define MMcadr(x) (x)->c.c_cdr->c.c_car
+#define MMcdar(x) (x)->c.c_car->c.c_cdr
+#define MMcddr(x) (x)->c.c_cdr->c.c_cdr
+#define MMcaaar(x) (x)->c.c_car->c.c_car->c.c_car
+#define MMcaadr(x) (x)->c.c_cdr->c.c_car->c.c_car
+#define MMcadar(x) (x)->c.c_car->c.c_cdr->c.c_car
+#define MMcaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car
+#define MMcdaar(x) (x)->c.c_car->c.c_car->c.c_cdr
+#define MMcdadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr
+#define MMcddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr
+#define MMcdddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr
+#define MMcaaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_car
+#define MMcaaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_car
+#define MMcaadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_car
+#define MMcaaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_car
+#define MMcadaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_car
+#define MMcadadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_car
+#define MMcaddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_car
+#define MMcadddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_car
+#define MMcdaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_cdr
+#define MMcdaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_cdr
+#define MMcdadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_cdr
+#define MMcdaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_cdr
+#define MMcddaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_cdr
+#define MMcddadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_cdr
+#define MMcdddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_cdr
+#define MMcddddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_cdr
+
+
+#define MMnull(x) ((x)==Cnil)
+
+
+/* the link_desc, is an INT which carries the call information
+ for all uses of that link. It tells whether fcall.nargs is
+ set before the call, whether the VFUN_FUN is set, (to pass in
+ a closure function) or if the number of values is set after the
+ call. It gives the min and max number of args and the result
+ type expected. It describes the arg types.
+ enum F_arg_flags
+
+
+*/
+
+/*
+A link arg descriptor:
+ a6a5a4a3a2a1a0rrmmmmmmfffllllll
+ l = least number of args passed
+ m = max number of args passed
+ f = flags bits set according to F_arg_flags, There are F_end flag bits.
+ r = result type in F_arg_types
+ ai = i'th arg type in F_arg_types
+*/
+
+/* We allow 2 bits for encoding arg types and return type */
+#define F_TYPE_WIDTH 2
+#define F_MIN_ARGS(x) (x & MASK_RANGE(0,F_NARG_WIDTH))
+#define F_NARGS(x) F_MIN_ARGS(x)
+#define F_ARG_FLAGS_P(x,flag) (x & (1 << (F_NARG_WIDTH + flag)))
+#define F_ARG_FLAGS(x) ((x >> F_NARG_WIDTH) & MASK_RANGE(0,F_end))
+#define F_MAX_ARGS(x) ((x >> (F_NARG_WIDTH + F_end )) \
+ & MASK_RANGE(0,F_NARG_WIDTH))
+
+#define BITS_PER_CHAR 8
+#define MAX_ARGS 63
+#define F_TYPES(x) (((x) >> F_START_TYPES_POS ) \
+ & MASK_RANGE(0, sizeof(int)*BITS_PER_CHAR - F_START_TYPES_POS))
+#define F_RESULT_TYPE(x) (F_TYPES(x) & MASK_RANGE(0,F_TYPE_WIDTH))
+#define F_ARG_LIMIT ((1<< F_NARG_WIDTH) -1)
+
+/* make an argd slot
+ where flags and argtypes are already set up as fields
+ */
+#define F_ARGD(min,max,flags, argtypes) \
+ (min | ((flags | (max-min ? (1<<F_requires_nargs) : 0) \
+ << F_NARG_WIDTH)) \
+ | (max << (F_NARG_WIDTH+F_end)) \
+ | (argtypes<< (2* F_NARG_WIDTH + F_end )))
+
+#define ONE_VAL (1 << F_caller_sets_one_val)
+#define CLOS (1 << F_requires_fun_passed)
+#define VARARG (1 << F_requires_nargs)
+ /* the following may be used as an argument to DEFUN even in the case
+ of varargs, since the F_ARGD macro detects minargs<maxargs and sets this.*/
+#define NONE 0
+
+/* we dont want to define all these two letter macros... all the time */
+
+#ifndef NO_DEFUN
+#define OO (F_object | F_object << F_TYPE_WIDTH)
+#define OI (F_object | F_int << F_TYPE_WIDTH)
+#define OD (F_object | F_double_ptr << F_TYPE_WIDTH)
+#define IO (F_int | F_object << F_TYPE_WIDTH)
+#define II (F_int | F_int << F_TYPE_WIDTH)
+#define ID (F_int | F_double_ptr << F_TYPE_WIDTH)
+#define DO (F_double_ptr | F_object << F_TYPE_WIDTH)
+#define DI (F_double_ptr | F_int << F_TYPE_WIDTH)
+#define DD (F_double_ptr | F_double_ptr << F_TYPE_WIDTH)
+#endif
+
+#define ARGTYPES(a,b,c,d) \
+ (a | (b << (2* F_TYPE_WIDTH)) | (c << (4* F_TYPE_WIDTH)) | (d << (6*F_TYPE_WIDTH)))
+
+
+#define PUSH_FIRST_VAL(x) int nvals = 1 ; object result = (x)
+#define PUSH_VAL(x) if (nvals>=sizeof(fcall.values)/sizeof(*fcall.values) \
+ FEerror("Too many function call values"); \
+ else fcall.values[nvals++] = (x)
+#define RETURN_VALS fcall.nvalues= nvals; return result;} 0
+
+#define FUNCALL(n,form) (VFUN_NARGS=n,form)
+
+/*
+ Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
+
+This file is part of GNU Common Lisp, herein referred to as GCL
+
+GCL is free software; you can redistribute it and/or modify it under
+the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCL is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+License for more details.
+
+You should have received a copy of the GNU Library General Public License
+along with GCL; see the file COPYING. If not, write to the Free Software
+Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+#ifndef COM_LENG
+#define COM_LENG
+#endif
+
+/* alloc.c */
+char *alloc_page();
+object alloc_object();
+void *malloc(size_t);
+void *realloc(void *,size_t);
+/* void * memalign(size_t,size_t); */
+void *alloc_contblock(size_t);
+void *alloc_relblock(size_t);
+/* object fSallocate_contiguous_pages(); */
+/* object fSallocate_relocatable_pages(); */
+
+/* array.c */
+/* enum aelttype Iarray_element_type(); */
+object fLrow_major_aref();
+object fSaset1();
+EXTER object sLarray_dimension_limit;
+EXTER object sLarray_total_size_limit;
+object fSmake_array1();
+/* object fSmake_vector1(); */
+
+/* assignment.c */
+/* object setf(); */
+
+
+
+/* backq.c */
+EXTER int backq_level;
+EXTER object sLlistA;
+EXTER object sLappend;
+EXTER object sLnconc;
+
+
+/* bds.c */
+
+/* big.c */
+object make_integer_clear();
+object stretch_big();
+object copy_big();
+object copy_to_big();
+object big_minus();
+object big_plus();
+object big_times();
+object normalize_big_to_object();
+double big_to_double();
+EXTER struct bignum big_fixnum1_body,big_fixnum2_body;
+EXTER object big_fixnum1,big_fixnum2;
+object maybe_replace_big();
+
+
+
+
+/* bind.c */
+EXTER object ANDoptional;
+EXTER object ANDrest;
+EXTER object ANDkey;
+EXTER object ANDallow_other_keys;
+EXTER object ANDaux;
+EXTER object sKallow_other_keys;
+object find_special();
+object let_bind();
+object letA_bind();
+
+/* block.c */
+
+/* cfun.c */
+object make_cfun();
+object MF();
+/* object MM(); */
+/* object make_function_internal(); */
+/* object make_si_function_internal(); */
+/* object make_special_form_internal(); */
+object make_macro();
+object make_cclosure_new();
+
+/* character.d */
+EXTER object STreturn;
+EXTER object STspace;
+EXTER object STrubout;
+EXTER object STpage;
+EXTER object STtab;
+EXTER object STbackspace;
+EXTER object STlinefeed;
+EXTER object STnewline;
+object coerce_to_character();
+
+/* catch.c */
+
+/* cmpaux.c */
+char object_to_char();
+char *object_to_string();
+float object_to_float();
+double object_to_double();
+
+/* error.c */
+EXTER object sKerror;
+EXTER object sKwrong_type_argument;
+EXTER object sKcatch;
+EXTER object sKprotect;
+EXTER object sKcatchall;
+EXTER object sKtoo_few_arguments;
+EXTER object sKtoo_many_arguments;
+EXTER object sKunexpected_keyword;
+EXTER object sKinvalid_form;
+EXTER object sKunbound_variable;
+EXTER object sKinvalid_variable;
+EXTER object sKundefined_function;
+EXTER object sKinvalid_function;
+EXTER object sKpackage_error;
+object wrong_type_argument();
+EXTER object sSuniversal_error_handler;
+
+/* eval.c */
+EXTER object sLapply;
+EXTER object sLfuncall;
+object simple_lispcall();
+object simple_lispcall_no_event();
+object simple_symlispcall();
+object simple_symlispcall_no_event();
+EXTER object Vevalhook;
+EXTER object Vapplyhook;
+object ieval();
+object ifuncall(object,int,...);
+object ifuncall1();
+object ifuncall2();
+object ifuncall3();
+object fcalln1(object,...);
+#define fcalln ((object (*)())fcalln1)
+object Ieval();
+object Imacro_expand1();
+
+/* unixfasl.c fasload.c */
+
+/* file.d */
+EXTER object sKabort;
+EXTER object sKappend;
+EXTER object sKcreate;
+EXTER object sKdefault;
+EXTER object sKdirection;
+EXTER object sKelement_type;
+EXTER object sKif_does_not_exist;
+EXTER object sKif_exists;
+EXTER object sKinput;
+EXTER object sKio;
+EXTER object sKnew_version;
+EXTER object sKoutput;
+EXTER object sKoverwrite;
+EXTER object sKprint;
+EXTER object sKprobe;
+EXTER object sKrename;
+EXTER object sKrename_and_delete;
+EXTER object sKset_default_pathname;
+EXTER object sKsupersede;
+EXTER object sKverbose;
+
+EXTER object sLAstandard_inputA;
+EXTER object sLAstandard_outputA;
+EXTER object sLAerror_outputA;
+EXTER object sLAquery_ioA;
+EXTER object sLAdebug_ioA;
+EXTER object sLAterminal_ioA;
+EXTER object sLAtrace_outputA;
+EXTER object terminal_io;
+EXTER object standard_io;
+
+EXTER object sLAload_verboseA;
+EXTER object FASL_string;
+/* object stream_element_type(); */
+object open_stream();
+/* object make_two_way_stream(); */
+/* object make_echo_stream(); */
+object make_string_input_stream();
+object make_string_output_stream();
+/* object get_output_stream_string(); */
+object read_fasl_data();
+
+#ifdef UNIX
+/* unixfsys.c */
+FILE *backup_fopen();
+#else
+/* filesystem.c */
+FILE *backup_fopen();
+#endif
+
+/* frame.c */
+frame_ptr frs_sch();
+frame_ptr frs_sch_catch();
+
+/* gbc.c */
+EXTER bool GBC_enable;
+
+/* let.c */
+
+/* lex.c */
+object assoc_eq();
+object lex_tag_sch();
+object lex_block_sch();
+
+/* list.d */
+EXTER object sKtest;
+EXTER object sKtest_not;
+EXTER object sKkey;
+EXTER object sKrev;
+object car();
+object cdr();
+object kar();
+object kdr();
+object caar();
+object cadr();
+object cdar();
+object cddr();
+object caaar();
+object caadr();
+object cadar();
+object caddr();
+object cdaar();
+object cdadr();
+object cddar();
+object cdddr();
+object caaaar();
+object caaadr();
+object caadar();
+object caaddr();
+object cadaar();
+object cadadr();
+object caddar();
+object cadddr();
+object cdaaar();
+object cdaadr();
+object cdadar();
+object cdaddr();
+object cddaar();
+object cddadr();
+object cdddar();
+object cddddr();
+object nth();
+object nthcdr();
+object make_cons();
+object list(int,...);
+object listA(int,...);
+object append();
+object copy_list();
+object make_list();
+object nconc();
+object sublis1();
+
+/* macros.c */
+EXTER object sLAmacroexpand_hookA;
+EXTER object sSdefmacroA;
+object macro_expand();
+
+/* main.c */
+EXTER char* system_directory;
+EXTER int ARGC;
+EXTER char **ARGV;
+void error();
+#ifdef UNIX
+EXTER char **ENVP;
+#endif
+object vs_overflow(void);
+
+EXTER object sSAsystem_directoryA;
+#ifdef UNIX
+EXTER char *kcl_self;
+#endif
+#if !defined(IN_MAIN) || !defined(ATT)
+EXTER bool initflag,raw_image;
+#endif
+char *merge_system_directory();
+
+
+EXTER object sLquote;
+
+EXTER object sLlambda;
+
+EXTER object sLlambda_block;
+EXTER object sLlambda_closure;
+EXTER object sLlambda_block_closure;
+
+EXTER object sLfunction;
+EXTER object sLmacro;
+EXTER object sLtag;
+EXTER object sLblock;
+
+
+/* mapfun.c */
+
+/* multival.c */
+
+/* number.c */
+EXTER object shortfloat_zero;
+EXTER object longfloat_zero;
+#define make_fixnum(a) ({fixnum _a=(a);((_a+SMALL_FIXNUM_LIMIT)&(-2*SMALL_FIXNUM_LIMIT))==0?small_fixnum(_a):make_fixnum1(_a);})
+object make_fixnum1(long);
+object make_ratio();
+object make_shortfloat();
+object make_longfloat();
+object make_complex();
+double number_to_double();
+long fixint(object);
+/* num_pred.c */
+
+/* num_comp.c */
+
+/* num_arith */
+object bignum2();
+object bignum3();
+/* object number_to_complex(); */
+object complex_plus();
+object number_plus();
+object number_negate();
+object number_minus();
+object number_times();
+object number_divide();
+object number_expt();
+object integer_divide1();
+object get_gcd();
+object get_lcm();
+object one_plus();
+object one_minus();
+object fixnum_add();
+object fixnum_sub();
+object new_bignum();
+
+/* num_co.c */
+object double_to_integer();
+
+/* num_log.c */
+object shift_integer();
+
+/* package.d */
+EXTER object lisp_package;
+EXTER object user_package;
+#ifdef ANSI_COMMON_LISP
+EXTER object common_lisp_package;
+#endif
+EXTER object keyword_package;
+EXTER object system_package;
+EXTER object sLApackageA;
+EXTER object sKinternal;
+EXTER object sKexternal;
+EXTER object sKinherited;
+EXTER object sKnicknames;
+EXTER object sKuse;
+EXTER int intern_flag;
+EXTER object uninterned_list;
+/* object make_package(); */
+/* object in_package(); */
+/* object rename_package(); */
+object find_package();
+/* object coerce_to_package(); */
+object current_package();
+object intern();
+object find_symbol();
+
+/* pathname.d */
+EXTER object Vdefault_pathname_defaults;
+EXTER object sKwild;
+EXTER object sKnewest;
+EXTER object sKstart;
+EXTER object sKend;
+EXTER object sKjunk_allowed;
+EXTER object sKhost;
+EXTER object sKdevice;
+EXTER object sKdirectory;
+EXTER object sKname;
+EXTER object sKtype;
+EXTER object sKversion;
+EXTER object sKdefaults;
+EXTER object sKroot;
+EXTER object sKcurrent;
+EXTER object sKparent;
+EXTER object sKper;
+/* object parse_namestring(); */
+object coerce_to_pathname();
+/* object default_device(); */
+object merge_pathnames();
+object namestring();
+object coerce_to_namestring();
+
+/* prediate.c */
+
+int eql(),equal(),eq();
+
+/* print.d */
+EXTER object sKupcase;
+EXTER object sKdowncase;
+EXTER object sKcapitalize;
+EXTER object sKstream;
+EXTER object sKreadably;
+EXTER object sKescape;
+EXTER object sKpretty;
+EXTER object sKcircle;
+EXTER object sKbase;
+EXTER object sKradix;
+EXTER object sKcase;
+EXTER object sKgensym;
+EXTER object sKlevel;
+EXTER object sKlength;
+EXTER object sKarray;
+EXTER object sLAprint_readablyA;
+EXTER object sLAprint_escapeA;
+EXTER object sLAprint_prettyA;
+EXTER object sLAprint_circleA;
+EXTER object sLAprint_baseA;
+EXTER object sLAprint_radixA;
+EXTER object sLAprint_caseA;
+EXTER object sLAprint_gensymA;
+EXTER object sLAprint_levelA;
+EXTER object sLAprint_lengthA;
+EXTER object sLAprint_arrayA;
+EXTER object *PRINTvs_top;
+EXTER object *PRINTvs_limit;
+EXTER object PRINTstream;
+EXTER bool PRINTreadably;
+EXTER bool PRINTescape;
+EXTER bool PRINTpretty;
+EXTER bool PRINTcircle;
+EXTER int PRINTbase;
+EXTER bool PRINTradix;
+EXTER object PRINTcase;
+EXTER bool PRINTgensym;
+EXTER int PRINTlevel;
+EXTER int PRINTlength;
+EXTER bool PRINTarray;
+EXTER void (*write_ch_fun)(int);
+object princ();
+object prin1();
+object print();
+object terpri();
+EXTER object sSpretty_print_format;
+EXTER int line_length;
+
+/* Read.d */
+EXTER object standard_readtable;
+EXTER object Vreadtable;
+EXTER object sLAread_default_float_formatA;
+EXTER object sLAread_baseA;
+EXTER object sLAread_suppressA;
+EXTER object READtable;
+EXTER object read_byte1();
+EXTER int READdefault_float_format;
+EXTER int READbase;
+EXTER bool READsuppress;
+EXTER object siSsharp_comma;
+EXTER bool escape_flag;
+EXTER object delimiting_char;
+EXTER bool detect_eos_flag;
+/* bool in_list_flag; */
+EXTER bool dot_flag;
+EXTER bool preserving_whitespace_flag;
+EXTER object default_dispatch_macro;
+EXTER object big_register_0;
+EXTER int sharp_eq_context_max;
+object read_char();
+object read_char1(object,object);
+object peek_char();
+/* object read_object_recursive(); */
+object read_object_non_recursive();
+object standard_read_object_non_recursive();
+object read_object();
+/* object parse_number(); */
+/* object parse_integer(); */
+/* object copy_readtable(); */
+/* object current_readtable(); */
+/* object patch_sharp(); */
+object read_fasl_vector();
+
+/* fasdump.c */
+EXTER object sharing_table;
+
+/* reference.c */
+object symbol_function();
+
+
+/* sequence.d */
+object alloc_simple_vector();
+object alloc_simple_bitvector();
+object elt();
+object elt_set();
+object reverse();
+object nreverse();
+
+/* structure.c */
+EXTER object sSs_data;
+object structure_ref();
+object structure_set();
+object structure_to_list();
+
+/* string.d */
+object alloc_simple_string();
+object make_simple_string();
+object copy_simple_string();
+object coerce_to_string();
+EXTER int string_sign, string_boundary;
+
+/* symbol.d */
+EXTER object string_register;
+EXTER object gensym_prefix;
+/* EXTER int gensym_counter; */
+EXTER object sLgensym_counter;
+EXTER object gentemp_prefix;
+EXTER int gentemp_counter;
+EXTER object token;
+object make_symbol();
+object make_ordinary();
+object make_special();
+object make_constant();
+object make_si_ordinary();
+object make_si_special();
+object make_si_constant();
+object make_keyword();
+object symbol_value();
+object symbol_name();
+object getf();
+object get();
+object putf();
+object putprop();
+object sputprop();
+object remprop();
+object gensym(); /* to be deleted */
+
+#ifdef UNIX
+/* unixsys.c */
+#else
+/* sys.c */
+#endif
+
+#ifdef UNIX
+/* unixtime.c */
+object unix_time_to_universal_time();
+#else
+/* time.c */
+#endif
+
+/* toplevel.c */
+EXTER object sLspecial,sLdeclare;
+EXTER object sSvariable_documentation;
+EXTER object sSfunction_documentation;
+
+/* typespec.c */
+EXTER object sLcommon,sLnull,sLcons,sLlist,sLsymbol,sLarray,sLvector,sLbit_vector,sLstring;
+EXTER object sLsequence,sLsimple_array,sLsimple_vector,sLsimple_bit_vector,sLsimple_string;
+EXTER object sLcompiled_function,sLpathname,sLcharacter,sLnumber,sLrational,sLfloat,sLstring_char;
+EXTER object sLinteger,sLratio,sLshort_float,sLstandard_char,sLfixnum,sLpositive_fixnum, sLcomplex;
+EXTER object sLsingle_float,sLpackage,sLbignum,sLrandom_state,sLdouble_float,sLstream,sLbit,sLreadtable;
+EXTER object sLlong_float,sLhash_table,sLstructure,sLboolean;
+
+#ifdef ANSI_COMMON_LISP
+/* new ansi types */
+EXTER object sLarithmetic_error,sLbase_char,sLbase_string,sLbroadcast_stream,sLbuilt_in_class;
+EXTER object sLcell_error,sLclass,sLconcatenated_stream,sLcondition,sLcontrol_error,sLdivision_by_zero;
+EXTER object sLecho_stream,sLend_of_file,sLerror,sLextended_char,sLfile_error,sLfile_stream;
+EXTER object sLfloating_point_inexact,sLfloating_point_invalid_operation,sLfloating_point_overflow;
+EXTER object sLfloating_point_underflow,sLgeneric_function,sLlogical_pathname,sLmethod,sLpackage_error;
+EXTER object sLparse_error,sLprint_not_readable,sLprogram_error,sLreader_error,sLserious_condition;
+EXTER object sLsimple_base_string,sLsimple_condition,sLsimple_type_error,sLsimple_warning,sLstandard_class;
+EXTER object sLstandard_generic_function,sLstandard_method,sLstandard_object,sLstorage_condition;
+EXTER object sLstream_error,sLstring_stream,sLstructure_class,sLstyle_warning,sLsynonym_stream;
+EXTER object sLtwo_way_stream,sLtype_error,sLunbound_slot,sLunbound_variable,sLundefined_function,sLwarning;
+EXTER object sLmethod_combination,sLstructure_object;
+#endif
+
+EXTER object sLsatisfies;
+EXTER object sLmember;
+EXTER object sLnot;
+EXTER object sLor;
+EXTER object sLand;
+EXTER object sLvalues;
+EXTER object sLmod;
+EXTER object sLsigned_byte;
+EXTER object sLunsigned_byte;
+EXTER object sLsigned_char;
+EXTER object sLunsigned_char;
+EXTER object sLsigned_short;
+EXTER object sLunsigned_short;
+EXTER object sLA;
+EXTER object sLplusp;
+EXTER object TSor_symbol_string;
+EXTER object TSor_string_symbol;
+EXTER object TSor_symbol_string_package;
+EXTER object TSnon_negative_integer;
+EXTER object TSpositive_number;
+EXTER object TSor_integer_float;
+EXTER object TSor_rational_float;
+#ifdef UNIX
+EXTER object TSor_pathname_string_symbol;
+#endif
+EXTER object TSor_pathname_string_symbol_stream;
+
+EXTER int interrupt_flag; /* console interupt flag */
+EXTER int interrupt_enable; /* console interupt enable */
+
+/* CMPtemp */
+EXTER object CMPtemp;
+EXTER object CMPtemp1;
+EXTER object CMPtemp2;
+EXTER object CMPtemp3;
+
+EXTER object sLAlink_arrayA;
+
+/* nfunlink.c */
+object Icall_proc();
+float Icall_proc_float();
+/* object Icall_proc(); */
+float Icall_proc_float();
+object ImakeStructure();
+object list_vector();
+object list_vector_new();
+object Iapply_ap();
+object IisFboundp();
+object IapplyVector();
+object c_apply_n();
+EXTER object sSPmemory;
+EXTER object sSPinit;
+object sLfset();
+object MakeAfun();
+extern object Cstd_key_defaults[];
+extern object call_proc0();
+/* extern object call_proc(); */
+/* extern object call_vproc(); */
+object fLrow_major_aref();
+object Icheck_one_type();
+
+/* utils.c */
+object Iis_fixnum();
+object Iapply_fun_n(object,int,int,...);
+object Iapply_fun_n1(object (*)(),int,int,...);
+object Iapply_fun_n2(object,int,int,...);
+object Ifuncall_n(object,int,...);
+object Ivs_values();
+object Icheck_one_type();
+object fSincorrect_type();
+EXTER object fLbye (fixnum exitc);
+EXTER object fLquit (fixnum exitc);
+EXTER object sSAno_initA;
+EXTER object fLidentity (object x0);
+EXTER object fSgcl_compile_time (void);
+EXTER object fSldb1 (fixnum a,fixnum b, fixnum c);
+EXTER object fLlisp_implementation_version (void);
+EXTER object sSAlisp_maxpagesA;
+EXTER object sSAsystem_directoryA;
+EXTER object sSAmultiply_stacksA;
+EXTER object sStop_level;
+EXTER object sSAcommand_argsA;
+EXTER object sSAafter_gbc_hookA;
+EXTER object sSAignore_maximum_pagesA;
+EXTER object sSAoptimize_maximum_pagesA;
+EXTER object sSAnotify_optimize_maximum_pagesA;
+EXTER object fSallocated (object typ);
+EXTER object fSreset_number_used (object typ);
+EXTER object fSstaticp (object x);
+EXTER object fSallocate_sgc (object type,fixnum min,fixnum max,fixnum free_percent);
+EXTER object fSallocate_growth (object type,fixnum min,fixnum max,fixnum percent,fixnum percent_free);
+EXTER object fSallocate_contiguous_pages (fixnum npages,...);
+EXTER object fSallocated_contiguous_pages (void);
+EXTER object fSmaximum_contiguous_pages (void);
+EXTER object fSallocate_relocatable_pages (fixnum npages,...);
+EXTER object fSallocate (object type,fixnum npages,...);
+EXTER object fSallocated_relocatable_pages (void);
+EXTER object fSget_hole_size (void);
+EXTER object fSset_hole_size (fixnum npages,...);
+EXTER object fLgbc (object x0);
+EXTER object sSAnotify_gbcA;
+EXTER object sSAgbc_messageA;
+EXTER object sLcommon;
+EXTER object sLnull;
+EXTER object sLcons;
+EXTER object sLlist;
+EXTER object sLsymbol;
+EXTER object sLarray;
+EXTER object sLvector;
+EXTER object sLbit_vector;
+EXTER object sLstring;
+EXTER object sLsequence;
+EXTER object sLsimple_array;
+EXTER object sLsimple_vector;
+EXTER object sLsimple_bit_vector;
+EXTER object sLsimple_string;
+EXTER object sLfunction;
+EXTER object sLcompiled_function;
+EXTER object sLpathname;
+EXTER object sLcharacter;
+EXTER object sLnumber;
+EXTER object sLrational;
+EXTER object sLfloat;
+EXTER object sLstring_char;
+EXTER object sLinteger;
+EXTER object sLratio;
+EXTER object sLshort_float;
+EXTER object sLstandard_char;
+EXTER object sLboolean;
+EXTER object sLfixnum;
+EXTER object sLpositive_fixnum;
+EXTER object sLcomplex;
+EXTER object sLsingle_float;
+EXTER object sLpackage;
+EXTER object sLbignum;
+EXTER object sLrandom_state;
+EXTER object sLdouble_float;
+EXTER object sLstream;
+EXTER object sLbit;
+EXTER object sLreadtable;
+EXTER object sLlong_float;
+EXTER object sLhash_table;
+EXTER object sLkeyword;
+EXTER object sLstructure;
+EXTER object sLsatisfies;
+EXTER object sLmember;
+EXTER object sLnot;
+EXTER object sLor;
+EXTER object sLand;
+EXTER object sLvalues;
+EXTER object sLmod;
+EXTER object sLsigned_byte;
+EXTER object sLunsigned_byte;
+EXTER object sLsigned_char;
+EXTER object sLunsigned_char;
+EXTER object sLsigned_short;
+EXTER object sLunsigned_short;
+EXTER object sLA;
+EXTER object sLplusp;
+EXTER object sSchar_size;
+EXTER object sSshort_size;
+EXTER object fLfuncall (object fun,...);
+EXTER object fLapply (object fun,...);
+EXTER object fLeval (object x0);
+EXTER object fLconstantp (object x0);
+EXTER object sSlambda_block_expanded;
+EXTER object sSAbreak_pointsA;
+EXTER object sSAbreak_stepA;
+EXTER object fLmacroexpand (object form,...);
+EXTER object sLfuncall;
+EXTER object sLAmacroexpand_hookA;
+EXTER object sSdefmacroA;
+EXTER object sSAinhibit_macro_specialA;
+EXTER object fLnull (object x0);
+EXTER object fLnot (object x0);
+EXTER object fLsymbolp (object x0);
+EXTER object fLatom (object x0);
+EXTER object fLconsp (object x0);
+EXTER object fLlistp (object x0);
+EXTER object fLnumberp (object x0);
+EXTER object fLintegerp (object x0);
+EXTER object fLrationalp (object x0);
+EXTER object fLrealp (object x0);
+EXTER object fLfloatp (object x0);
+EXTER object fLcomplexp (object x0);
+EXTER object fLcharacterp (object x0);
+EXTER object fLstringp (object x0);
+EXTER object fLbit_vector_p (object x0);
+EXTER object fLvectorp (object x0);
+EXTER object fLsimple_string_p (object x0);
+EXTER object fLsimple_bit_vector_p (object x0);
+EXTER object fLsimple_vector_p (object x0);
+EXTER object fLarrayp (object x0);
+EXTER object fLpackagep (object x0);
+EXTER object fLfunctionp (object x0);
+EXTER object fLcompiled_function_p (object x0);
+EXTER object fLcommonp (object x0);
+EXTER object fLeq (object x0,object x1);
+EXTER object fLeql (object x0,object x1);
+EXTER object fLequal (object x0,object x1);
+EXTER object fLequalp (object x0,object x1);
+EXTER object fScontains_sharp_comma (object x0);
+EXTER object fSspicep (object x0);
+EXTER object fSfixnump (object x0);
+EXTER object fLset (object symbol,object value);
+EXTER object fSfset (object sym,object function);
+EXTER object fLmakunbound (object sym);
+EXTER object fLfmakunbound (object sym);
+EXTER object sSclear_compiler_properties;
+EXTER object fSclear_compiler_properties (object x0,object x1);
+EXTER object sLaref;
+EXTER object sLcar;
+EXTER object sLcdr;
+EXTER object sLchar;
+EXTER object sLdecf;
+EXTER object sLelt;
+EXTER object sLfill_pointer;
+EXTER object sLget;
+EXTER object sLgetf;
+EXTER object sLgethash;
+EXTER object sLincf;
+EXTER object sLpop;
+EXTER object sLpush;
+EXTER object sLschar;
+EXTER object sLsetf;
+EXTER object sSsetf_lambda;
+EXTER object sSstructure_access;
+EXTER object sLsvref;
+EXTER object sStraced;
+EXTER object sLvector;
+EXTER object sKallow_other_keys;
+EXTER object fSerror_set (volatile object x0);
+EXTER object sLgensym_counter;
+EXTER object fSmc (object name,object address);
+EXTER object fSmfsfun (object name,object address,object argd);
+EXTER object fSmfvfun (object name,object address,object argd);
+EXTER object fSmfvfun_key (object symbol,object address,object argd,object keys);
+EXTER object fSmf (object name,object addr);
+EXTER object fSmm (object name,object addr);
+EXTER object fScompiled_function_name (object fun);
+EXTER object fSturbo_closure (object funobj);
+EXTER object fSspecialp (object sym);
+EXTER object sSdebug;
+EXTER object fSdefvar1 (object sym,object val,...);
+EXTER object fSdebug (object sym,object val);
+EXTER object fSsetvv (object index,object val);
+EXTER object sSPmemory;
+EXTER object sSPinit;
+EXTER object fSinit_cmp_anon (void);
+EXTER object fSfind_init_name (object namestring);
+EXTER object sKexternal;
+EXTER object sKinherited;
+EXTER object sKinternal;
+EXTER object sKnicknames;
+EXTER object sKuse;
+EXTER object sLApackageA;
+EXTER object fSset_gmp_allocate_relocatable (object flag);
+EXTER object fSallocate_bigger_fixnum_range (fixnum min,fixnum max);
+EXTER object fScmod (object num);
+EXTER object fScplus (object x0,object x1);
+EXTER object fSctimes (object x0,object x1);
+EXTER object fScdifference (object x0,object x1);
+EXTER object fLnth (fixnum index,object list);
+EXTER object fLfirst (object x);
+EXTER object fLsecond (object x);
+EXTER object fLthird (object x);
+EXTER object fLfourth (object x);
+EXTER object fLfifth (object x);
+EXTER object fLsixth (object x);
+EXTER object fLseventh (object x);
+EXTER object fLeighth (object x);
+EXTER object fLninth (object x);
+EXTER object fLtenth (object x);
+EXTER object fSnext_hash_table_entry (object table,object ind);
+EXTER object fLhash_table_test (object table);
+EXTER object fLhash_table_size (object table);
+EXTER object sLarray_rank_limit;
+EXTER object sLarray_dimension_limit;
+EXTER object sLarray_total_size_limit;
+EXTER object sLbit;
+EXTER object fLaref (object x,fixnum i, ...);
+EXTER object fLsvref (object x,ufixnum i);
+EXTER object fLrow_major_aref (object x,fixnum i);
+EXTER object fSaset1 (object x, fixnum i,object val);
+EXTER object fSaset (object x,object ii,object y, ...);
+EXTER object fSsvset (object x,fixnum i,object val);
+EXTER object fSmake_vector1 (fixnum n,fixnum elt_type,object staticp,...);
+EXTER object fSget_aelttype (object x);
+EXTER object fSmake_vector (object x0,object x1,object x2,object x3,object x4,object x5,object x6,...);
+EXTER object fSmake_array1 (fixnum elt_type,object staticp,object initial_element,object displaced_to,fixnum displaced_index_offset, object dimensions);
+EXTER object fScopy_array_portion (object x,object y,fixnum i1,fixnum i2,object n1o);
+EXTER object fSfill_pointer_set (object x,fixnum i);
+EXTER object fLfill_pointer (object x);
+EXTER object fLarray_has_fill_pointer_p (object x);
+EXTER object fLarray_element_type (object x);
+EXTER object fLadjustable_array_p (object x);
+EXTER object fSdisplaced_array_p (object x);
+EXTER object fLarray_rank (object x);
+EXTER object fLarray_dimension (object x,fixnum i);
+EXTER object fSreplace_array (object old,object new);
+EXTER object fLarray_total_size (object x);
+EXTER object fSaset_by_cursor (object array,object val,object cursor);
+EXTER object sSAmatch_dataA;
+EXTER object sSAcase_fold_searchA;
+EXTER object fSmatch_beginning (fixnum i);
+EXTER object fSmatch_end (fixnum i);
+EXTER object fScompile_regexp (object p);
+EXTER object fSstring_match (object pattern,object string,...);
+EXTER object sSs_data;
+EXTER object sLcompile;
+EXTER object sKcompile_toplevel;
+EXTER object sLdeclare;
+EXTER object sLeval;
+EXTER object sKexecute;
+EXTER object sSfunction_documentation;
+EXTER object sLload;
+EXTER object sKload_toplevel;
+EXTER object sLprogn;
+EXTER object sLtypep;
+EXTER object sLvalues;
+EXTER object sSvariable_documentation;
+EXTER object sLwarn;
+EXTER object sSAallow_gzipped_fileA;
+EXTER object sSAcollect_binary_modulesA;
+EXTER object sSAbinary_modulesA;
+EXTER object sKmyaddr;
+EXTER object sKmyport;
+EXTER object sKasync;
+EXTER object sKhost;
+EXTER object sKserver;
+EXTER object sKdaemon;
+EXTER object sKpersistent;
+EXTER object sSsocket;
+EXTER object sLAstandard_inputA;
+EXTER object sLAstandard_outputA;
+EXTER object sLAerror_outputA;
+EXTER object sLAterminal_ioA;
+EXTER object sLAquery_ioA;
+EXTER object sLAdebug_ioA;
+EXTER object sLAtrace_outputA;
+EXTER object sSAignore_eof_on_terminal_ioA;
+EXTER object sSAload_pathnameA;
+EXTER object sLAload_verboseA;
+EXTER object sKabort;
+EXTER obje