--- hol88-2.02.19940316.orig/Makefile +++ hol88-2.02.19940316/Makefile @@ -150,7 +150,7 @@ LispType=cl Obj=o -Lisp=akcl +Lisp=gcl Liszt= LisztComm= Allegro=(set-case-mode :case-insensitive-upper) @@ -159,7 +159,7 @@ 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 @@ LispDir=${HOLdir}/lisp ExeName = hol -Version = 2.02 (SUN4/AKCL) +Version = 2.02 (GCL) # ===================================================================== # Default (from Phil Windley) @@ -221,6 +221,34 @@ # --------------------------------------------------------------------- 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 @@ '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 @@ 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 @@ # --------------------------------------------------------------------- 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 @@ '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 @@ # --------------------------------------------------------------------- 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 @@ '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/Library/more_arithmetic/Manual/entries.tex +++ hol88-2.02.19940316/Library/more_arithmetic/Manual/entries.tex @@ -1,6 +1,4 @@ -\chapter{ML Functions in the more\_arithmetic Library} -\input{entries-intro} -\DOC{GEN\_INDUCT\_RULE} +\chapter{ML Functions in the more\_arithmetic Library}\input{entries-intro}\DOC{GEN\_INDUCT\_RULE} \TYPE {\small\verb%GEN_INDUCT_RULE : (thm -> thm -> thm)%}\egroup --- hol88-2.02.19940316.orig/Library/more_arithmetic/Manual/theorems.tex +++ hol88-2.02.19940316/Library/more_arithmetic/Manual/theorems.tex @@ -1,7 +1,4 @@ -\chapter{Pre-proved Theorems}\label{thms} -\input{theorems-intro} -\section{Theorems about Inequalities} -\THEOREM GEN\_INDUCTION ineq +\chapter{Pre-proved Theorems}\label{thms}\input{theorems-intro}\section{Theorems about Inequalities}\THEOREM GEN\_INDUCTION ineq |- !P. P 0 /\ (!n. (!m. m < n ==> P m) ==> P n) ==> (!n. P n) \ENDTHEOREM \THEOREM GREATER\_EQ\_ANTISYM ineq @@ -19,8 +16,7 @@ \THEOREM NOT\_LESS\_AND\_GREATER ineq |- !n m. n < m ==> ~m < n \ENDTHEOREM -\section{Theorems about {\tt 0}} -\THEOREM GREATER\_NOT\_ZERO zero\_ineq +\section{Theorems about {\tt 0}}\THEOREM GREATER\_NOT\_ZERO zero\_ineq |- !x. 0 < x ==> ~(x = 0) \ENDTHEOREM \THEOREM LESS1EQ0 zero\_ineq @@ -38,8 +34,7 @@ \THEOREM NOT\_EQ\_0 zero\_ineq |- !m. ~(m = 0) ==> m >= 1 \ENDTHEOREM -\section{Theorems about {\tt SUC}} -\THEOREM LESS\_EQ\_LESS\_SUC suc +\section{Theorems about {\tt SUC}}\THEOREM LESS\_EQ\_LESS\_SUC suc |- !m n. m <= n = m < (SUC n) \ENDTHEOREM \THEOREM NOT\_0\_GREATER\_EQ\_SUC suc @@ -63,8 +58,7 @@ \THEOREM SUC\_NOT\_0 suc |- !n. ~(SUC n = 0) \ENDTHEOREM -\section{Theorems about {\tt PRE}} -\THEOREM LESS\_IMP\_LESS\_EQ\_PRE pre +\section{Theorems about {\tt PRE}}\THEOREM LESS\_IMP\_LESS\_EQ\_PRE pre |- !m n. 0 < n ==> (m < n = m <= (PRE n)) \ENDTHEOREM \THEOREM PRE\_ADD pre @@ -94,31 +88,30 @@ \THEOREM SUC\_PRE pre |- !n. 0 < n ==> (SUC(PRE n) = n) \ENDTHEOREM -\section{Theorems about Addition} +\section{Theorems about Addition}\THEOREM ADD\_EQ\_LESS\_EQ add +|- !m n p. (m + n = p) ==> m <= p +\ENDTHEOREM +\THEOREM ADD\_EQ\_LESS\_IMP\_LESS add +|- !n m k l. (k + m = l + n) /\ k < l ==> n < m +\ENDTHEOREM +\THEOREM ADD\_GREATER\_EQ add +|- !m n. (m + n) >= m +\ENDTHEOREM \THEOREM ADDL\_GREATER add |- !m n p. m < n ==> m < (p + n) \ENDTHEOREM \THEOREM ADDL\_GREATER\_EQ add |- !m n p. m <= n ==> m <= (p + n) \ENDTHEOREM +\THEOREM ADD\_MONO\_LESS add +|- !m n p. (m + p) < (m + n) = p < n +\ENDTHEOREM \THEOREM ADDR\_GREATER add |- !m n p. m < n ==> m < (n + p) \ENDTHEOREM \THEOREM ADDR\_GREATER\_EQ add |- !m n p. m <= n ==> m <= (n + p) \ENDTHEOREM -\THEOREM ADD\_EQ\_LESS\_EQ add -|- !m n p. (m + n = p) ==> m <= p -\ENDTHEOREM -\THEOREM ADD\_EQ\_LESS\_IMP\_LESS add -|- !n m k l. (k + m = l + n) /\ k < l ==> n < m -\ENDTHEOREM -\THEOREM ADD\_GREATER\_EQ add -|- !m n. (m + n) >= m -\ENDTHEOREM -\THEOREM ADD\_MONO\_LESS add -|- !m n p. (m + p) < (m + n) = p < n -\ENDTHEOREM \THEOREM ADD\_SUC\_0 add |- !m. SUC m = (SUC 0) + m \ENDTHEOREM @@ -174,8 +167,7 @@ \THEOREM SUM\_LESS add |- !m n p. (m + n) < p ==> m < p /\ n < p \ENDTHEOREM -\section{Theorems about Subtraction} -\THEOREM ADD\_EQ\_IMP\_SUB\_EQ sub +\section{Theorems about Subtraction}\THEOREM ADD\_EQ\_IMP\_SUB\_EQ sub |- !a b c. (a = b + c) ==> (a - b = c) \ENDTHEOREM \THEOREM ADD\_LESS\_EQ\_SUB sub @@ -253,6 +245,9 @@ \THEOREM SUB\_GREATER\_EQ\_ADD sub |- !n m p. p >= n ==> ((p - n) >= m = p >= (n + m)) \ENDTHEOREM +\THEOREM SUB\_LE\_ADD sub +|- !n m p. n <= p ==> (m <= (p - n) = (n + m) <= p) +\ENDTHEOREM \THEOREM SUB\_LESS\_BOTH\_SIDES sub |- !m n p. p <= m /\ m < n ==> (m - p) < (n - p) \ENDTHEOREM @@ -268,9 +263,6 @@ \THEOREM SUB\_LESS\_TO\_LESS\_ADDR sub |- !m n p. p <= m ==> ((m - p) < n = m < (n + p)) \ENDTHEOREM -\THEOREM SUB\_LE\_ADD sub -|- !n m p. n <= p ==> (m <= (p - n) = (n + m) <= p) -\ENDTHEOREM \THEOREM SUB\_PRE\_SUB\_1 sub |- !a b. 0 < b ==> ((a - (PRE b)) - 1 = a - b) \ENDTHEOREM @@ -288,8 +280,7 @@ (m < n ==> ((SUC m) - n = 0)) /\ (~m < n ==> ((SUC m) - n = SUC(m - n))) \ENDTHEOREM -\section{Theorems about Multiplication and Exponential Functions} -\THEOREM EXP1 mult +\section{Theorems about Multiplication and Exponential Functions}\THEOREM EXP1 mult |- !n. n EXP 1 = n \ENDTHEOREM \THEOREM LESS\_MONO\_MULT1 mult @@ -310,8 +301,7 @@ \THEOREM ZERO\_LESS\_TWO\_EXP mult |- !n. 0 < (2 EXP n) \ENDTHEOREM -\section{Theorems about Division} -\THEOREM ADD\_DIV\_ADD\_DIV div\_mod +\section{Theorems about Division}\THEOREM ADD\_DIV\_ADD\_DIV div\_mod |- !n. 0 < n ==> (!x r. ((x * n) + r) DIV n = x + (r DIV n)) \ENDTHEOREM \THEOREM ADD\_DIV\_SUC\_DIV div\_mod @@ -349,8 +339,7 @@ \THEOREM SUC\_MOD\_SELF div\_mod |- !n. (SUC n) MOD (SUC n) = 0 \ENDTHEOREM -\section{Theorems about Maximum and Minimum} -\THEOREM MAX\_0 min\_max +\section{Theorems about Maximum and Minimum}\THEOREM MAX\_0 min\_max |- !n. MAX 0 n = n \ENDTHEOREM \THEOREM MAX\_DEF min\_max @@ -386,8 +375,7 @@ \THEOREM SUC\_MIN min\_max |- !n p. MIN(SUC n)(SUC p) = SUC(MIN n p) \ENDTHEOREM -\section{Theorems about Odd and Even Numbers} -\THEOREM EVEN\_MULT odd\_even +\section{Theorems about Odd and Even Numbers}\THEOREM EVEN\_MULT odd\_even |- !n m. EVEN n \/ EVEN m ==> EVEN(n * m) \ENDTHEOREM \THEOREM EVEN\_ODD\_0 odd\_even --- hol88-2.02.19940316.orig/Library/sets/Manual/entries.tex +++ hol88-2.02.19940316/Library/sets/Manual/entries.tex @@ -1,7 +1,4 @@ -\chapter{ML Functions in the sets Library} -\label{entries} -\input{entries-intro} -\DOC{DELETE\_CONV} +\chapter{ML Functions in the sets Library}\label{entries}\input{entries-intro}\DOC{DELETE\_CONV} \TYPE {\small\verb%DELETE_CONV : conv -> conv%}\egroup @@ -204,6 +201,84 @@ \ENDDOC +\DOC{IN\_CONV} + +\TYPE {\small\verb%IN_CONV : conv -> conv%}\egroup + +\SYNOPSIS +Decision procedure for membership in finite sets. + +\DESCRIBE +The function {\small\verb%IN_CONV%} is a parameterized conversion for proving or disproving +membership assertions of the general form: +{\par\samepage\setseps\small +\begin{verbatim} + "t IN {t1,...,tn}" +\end{verbatim} +} +\noindent where {\small\verb%{t1,...,tn}%} is a set of type {\small\verb%(ty)set%} and {\small\verb%t%} is a value +of the base type {\small\verb%ty%}. The first argument to {\small\verb%IN_CONV%} is expected to be a +conversion that decides equality between values of the base type {\small\verb%ty%}. Given +an equation {\small\verb%"e1 = e2"%}, where {\small\verb%e1%} and {\small\verb%e2%} are terms of type {\small\verb%ty%}, this +conversion should return the theorem {\small\verb%|- (e1 = e2) = T%} or the theorem +{\small\verb%|- (e1 = e2) = F%}, as appropriate. + +Given such a conversion, the function {\small\verb%IN_CONV%} returns a conversion that +maps a term of the form {\small\verb%"t IN {t1,...,tn}"%} to the theorem +{\par\samepage\setseps\small +\begin{verbatim} + |- t IN {t1,...,tn} = T +\end{verbatim} +} + +\noindent if {\small\verb%t%} is alpha-equivalent to any {\small\verb%ti%}, or if the supplied conversion +proves {\small\verb%|- (t = ti) = T%} for any {\small\verb%ti%}. If the supplied conversion proves +{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}, then the result is the theorem +{\par\samepage\setseps\small +\begin{verbatim} + |- t IN {t1,...,tn} = F +\end{verbatim} +} +\noindent In all other cases, {\small\verb%IN_CONV%} will fail. + +\EXAMPLE +In the following example, the conversion {\small\verb%num_EQ_CONV%} is supplied as a +parameter and used to test equality of the candidate element {\small\verb%1%} with the +actual elements of the given set. +{\par\samepage\setseps\small +\begin{verbatim} + #IN_CONV num_EQ_CONV "2 IN {0,SUC 1,3}";; + |- 2 IN {0,SUC 1,3} = T +\end{verbatim} +} +\noindent The result is {\small\verb%T%} because {\small\verb%num_EQ_CONV%} is able to prove that {\small\verb%2%} is +equal to {\small\verb%SUC 1%}. An example of a negative result is: +{\par\samepage\setseps\small +\begin{verbatim} + #IN_CONV num_EQ_CONV "1 IN {0,2,3}";; + |- 1 IN {0,2,3} = F +\end{verbatim} +} +\noindent Finally the behaviour of the supplied conversion is irrelevant when +the value to be tested for membership is alpha-equivalent to an actual element: +{\par\samepage\setseps\small +\begin{verbatim} + #IN_CONV NO_CONV "1 IN {3,2,1}";; + |- 1 IN {3,2,1} = T +\end{verbatim} +} +\noindent The conversion {\small\verb%NO_CONV%} always fails, but {\small\verb%IN_CONV%} is nontheless +able in this case to prove the required result. + +\FAILURE +{\small\verb%IN_CONV conv%} fails if applied to a term that is not of the form {\small\verb%"t IN +{t1,...,tn}"%}. A call {\small\verb%IN_CONV conv "t IN {t1,...,tn}"%} fails unless the +term {\small\verb%t%} is alpha-equivalent to some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns +{\small\verb%|- (t = ti) = T%} for some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns +{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}. + +\ENDDOC + \DOC{INSERT\_CONV} \TYPE {\small\verb%INSERT_CONV : conv -> conv%}\egroup @@ -290,84 +365,6 @@ \ENDDOC -\DOC{IN\_CONV} - -\TYPE {\small\verb%IN_CONV : conv -> conv%}\egroup - -\SYNOPSIS -Decision procedure for membership in finite sets. - -\DESCRIBE -The function {\small\verb%IN_CONV%} is a parameterized conversion for proving or disproving -membership assertions of the general form: -{\par\samepage\setseps\small -\begin{verbatim} - "t IN {t1,...,tn}" -\end{verbatim} -} -\noindent where {\small\verb%{t1,...,tn}%} is a set of type {\small\verb%(ty)set%} and {\small\verb%t%} is a value -of the base type {\small\verb%ty%}. The first argument to {\small\verb%IN_CONV%} is expected to be a -conversion that decides equality between values of the base type {\small\verb%ty%}. Given -an equation {\small\verb%"e1 = e2"%}, where {\small\verb%e1%} and {\small\verb%e2%} are terms of type {\small\verb%ty%}, this -conversion should return the theorem {\small\verb%|- (e1 = e2) = T%} or the theorem -{\small\verb%|- (e1 = e2) = F%}, as appropriate. - -Given such a conversion, the function {\small\verb%IN_CONV%} returns a conversion that -maps a term of the form {\small\verb%"t IN {t1,...,tn}"%} to the theorem -{\par\samepage\setseps\small -\begin{verbatim} - |- t IN {t1,...,tn} = T -\end{verbatim} -} - -\noindent if {\small\verb%t%} is alpha-equivalent to any {\small\verb%ti%}, or if the supplied conversion -proves {\small\verb%|- (t = ti) = T%} for any {\small\verb%ti%}. If the supplied conversion proves -{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}, then the result is the theorem -{\par\samepage\setseps\small -\begin{verbatim} - |- t IN {t1,...,tn} = F -\end{verbatim} -} -\noindent In all other cases, {\small\verb%IN_CONV%} will fail. - -\EXAMPLE -In the following example, the conversion {\small\verb%num_EQ_CONV%} is supplied as a -parameter and used to test equality of the candidate element {\small\verb%1%} with the -actual elements of the given set. -{\par\samepage\setseps\small -\begin{verbatim} - #IN_CONV num_EQ_CONV "2 IN {0,SUC 1,3}";; - |- 2 IN {0,SUC 1,3} = T -\end{verbatim} -} -\noindent The result is {\small\verb%T%} because {\small\verb%num_EQ_CONV%} is able to prove that {\small\verb%2%} is -equal to {\small\verb%SUC 1%}. An example of a negative result is: -{\par\samepage\setseps\small -\begin{verbatim} - #IN_CONV num_EQ_CONV "1 IN {0,2,3}";; - |- 1 IN {0,2,3} = F -\end{verbatim} -} -\noindent Finally the behaviour of the supplied conversion is irrelevant when -the value to be tested for membership is alpha-equivalent to an actual element: -{\par\samepage\setseps\small -\begin{verbatim} - #IN_CONV NO_CONV "1 IN {3,2,1}";; - |- 1 IN {3,2,1} = T -\end{verbatim} -} -\noindent The conversion {\small\verb%NO_CONV%} always fails, but {\small\verb%IN_CONV%} is nontheless -able in this case to prove the required result. - -\FAILURE -{\small\verb%IN_CONV conv%} fails if applied to a term that is not of the form {\small\verb%"t IN -{t1,...,tn}"%}. A call {\small\verb%IN_CONV conv "t IN {t1,...,tn}"%} fails unless the -term {\small\verb%t%} is alpha-equivalent to some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns -{\small\verb%|- (t = ti) = T%} for some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns -{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}. - -\ENDDOC - \DOC{SET\_INDUCT\_TAC} \TYPE {\small\verb%SET_INDUCT_TAC : tactic%}\egroup --- hol88-2.02.19940316.orig/Library/sets/Manual/theorems.tex +++ hol88-2.02.19940316/Library/sets/Manual/theorems.tex @@ -1,22 +1,18 @@ -\chapter{Pre-proved Theorems} -\input{theorems-intro} -\section{The type definition} -\THEOREM set\_ISO\_DEF sets +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{The type definition}\THEOREM set\_ISO\_DEF sets |- (!a. SPEC(CHF a) = a) /\ (!r. (\p. T)r = (CHF(SPEC r) = r)) \ENDTHEOREM \THEOREM set\_TY\_DEF sets |- ?rep. TYPE_DEFINITION(\p. T)rep \ENDTHEOREM -\section{Membership, equality, and set specifications} -\THEOREM EXTENSION sets +\section{Membership, equality, and set specifications}\THEOREM EXTENSION sets |- !s t. (s = t) = (!x. x IN s = x IN t) \ENDTHEOREM -\THEOREM GSPECIFICATION sets -|- !f v. v IN (GSPEC f) = (?x. v,T = f x) -\ENDTHEOREM \THEOREM GSPEC\_DEF sets |- !f. GSPEC f = SPEC(\y. ?x. y,T = f x) \ENDTHEOREM +\THEOREM GSPECIFICATION sets +|- !f v. v IN (GSPEC f) = (?x. v,T = f x) +\ENDTHEOREM \THEOREM IN\_DEF sets |- !x s. x IN s = CHF s x \ENDTHEOREM @@ -32,8 +28,7 @@ \THEOREM SPECIFICATION sets |- !P x. x IN (SPEC P) = P x \ENDTHEOREM -\section{The empty and universal sets} -\THEOREM EMPTY\_DEF sets +\section{The empty and universal sets}\THEOREM EMPTY\_DEF sets |- {} = SPEC(\x. F) \ENDTHEOREM \THEOREM EMPTY\_NOT\_UNIV sets @@ -57,8 +52,7 @@ \THEOREM UNIV\_NOT\_EMPTY sets |- ~(UNIV = {}) \ENDTHEOREM -\section{Set inclusion} -\THEOREM EMPTY\_SUBSET sets +\section{Set inclusion}\THEOREM EMPTY\_SUBSET sets |- !s. {} SUBSET s \ENDTHEOREM \THEOREM NOT\_PSUBSET\_EMPTY sets @@ -103,10 +97,12 @@ \THEOREM UNIV\_SUBSET sets |- !s. UNIV SUBSET s = (s = UNIV) \ENDTHEOREM -\section{Intersection and union} -\THEOREM EMPTY\_UNION sets +\section{Intersection and union}\THEOREM EMPTY\_UNION sets |- !s t. (s UNION t = {}) = (s = {}) /\ (t = {}) \ENDTHEOREM +\THEOREM IN\_INTER sets +|- !s t x. x IN (s INTER t) = x IN s /\ x IN t +\ENDTHEOREM \THEOREM INTER\_ASSOC sets |- !s t u. (s INTER t) INTER u = s INTER (t INTER u) \ENDTHEOREM @@ -131,21 +127,18 @@ \THEOREM INTER\_UNIV sets |- (!s. UNIV INTER s = s) /\ (!s. s INTER UNIV = s) \ENDTHEOREM -\THEOREM IN\_INTER sets -|- !s t x. x IN (s INTER t) = x IN s /\ x IN t -\ENDTHEOREM \THEOREM IN\_UNION sets |- !s t x. x IN (s UNION t) = x IN s \/ x IN t \ENDTHEOREM \THEOREM SUBSET\_INTER\_ABSORPTION sets |- !s t. s SUBSET t = (s INTER t = s) \ENDTHEOREM -\THEOREM SUBSET\_UNION sets -|- (!s t. s SUBSET (s UNION t)) /\ (!s t. s SUBSET (t UNION s)) -\ENDTHEOREM \THEOREM SUBSET\_UNION\_ABSORPTION sets |- !s t. s SUBSET t = (s UNION t = t) \ENDTHEOREM +\THEOREM SUBSET\_UNION sets +|- (!s t. s SUBSET (s UNION t)) /\ (!s t. s SUBSET (t UNION s)) +\ENDTHEOREM \THEOREM UNION\_ASSOC sets |- !s t u. (s UNION t) UNION u = s UNION (t UNION u) \ENDTHEOREM @@ -167,8 +160,7 @@ \THEOREM UNION\_UNIV sets |- (!s. UNIV UNION s = UNIV) /\ (!s. s UNION UNIV = UNIV) \ENDTHEOREM -\section{Set difference} -\THEOREM DIFF\_DEF sets +\section{Set difference}\THEOREM DIFF\_DEF sets |- !s t. s DIFF t = {x | x IN s /\ ~x IN t} \ENDTHEOREM \THEOREM DIFF\_DIFF sets @@ -189,8 +181,7 @@ \THEOREM IN\_DIFF sets |- !s t x. x IN (s DIFF t) = x IN s /\ ~x IN t \ENDTHEOREM -\section{Disjoint sets} -\THEOREM DISJOINT\_DEF sets +\section{Disjoint sets}\THEOREM DISJOINT\_DEF sets |- !s t. DISJOINT s t = (s INTER t = {}) \ENDTHEOREM \THEOREM DISJOINT\_DELETE\_SYM sets @@ -212,8 +203,7 @@ \THEOREM IN\_DISJOINT sets |- !s t. DISJOINT s t = ~(?x. x IN s /\ x IN t) \ENDTHEOREM -\section{Insertion and deletion of an element} -\THEOREM ABSORPTION sets +\section{Insertion and deletion of an element}\THEOREM ABSORPTION sets |- !x s. x IN s = (x INSERT s = s) \ENDTHEOREM \THEOREM COMPONENT sets @@ -254,6 +244,16 @@ \THEOREM EMPTY\_DELETE sets |- !x. {} DELETE x = {} \ENDTHEOREM +\THEOREM IN\_DELETE sets +|- !s x y. x IN (s DELETE y) = x IN s /\ ~(x = y) +\ENDTHEOREM +\THEOREM IN\_DELETE\_EQ sets +|- !s x x'. + (x IN s = x' IN s) = (x IN (s DELETE x') = x' IN (s DELETE x)) +\ENDTHEOREM +\THEOREM IN\_INSERT sets +|- !x y s. x IN (y INSERT s) = (x = y) \/ x IN s +\ENDTHEOREM \THEOREM INSERT\_COMM sets |- !x y s. x INSERT (y INSERT s) = y INSERT (x INSERT s) \ENDTHEOREM @@ -287,16 +287,6 @@ \THEOREM INSERT\_UNIV sets |- !x. x INSERT UNIV = UNIV \ENDTHEOREM -\THEOREM IN\_DELETE sets -|- !s x y. x IN (s DELETE y) = x IN s /\ ~(x = y) -\ENDTHEOREM -\THEOREM IN\_DELETE\_EQ sets -|- !s x x'. - (x IN s = x' IN s) = (x IN (s DELETE x') = x' IN (s DELETE x)) -\ENDTHEOREM -\THEOREM IN\_INSERT sets -|- !x y s. x IN (y INSERT s) = (x = y) \/ x IN s -\ENDTHEOREM \THEOREM NOT\_EMPTY\_INSERT sets |- !x s. ~({} = x INSERT s) \ENDTHEOREM @@ -312,14 +302,13 @@ \THEOREM SUBSET\_DELETE sets |- !x s t. s SUBSET (t DELETE x) = ~x IN s /\ s SUBSET t \ENDTHEOREM -\THEOREM SUBSET\_INSERT sets -|- !x s. ~x IN s ==> (!t. s SUBSET (x INSERT t) = s SUBSET t) -\ENDTHEOREM \THEOREM SUBSET\_INSERT\_DELETE sets |- !x s t. s SUBSET (x INSERT t) = (s DELETE x) SUBSET t \ENDTHEOREM -\section{The {\tt CHOICE} and {\tt REST} functions} -\THEOREM CHOICE\_DEF sets +\THEOREM SUBSET\_INSERT sets +|- !x s. ~x IN s ==> (!t. s SUBSET (x INSERT t) = s SUBSET t) +\ENDTHEOREM +\section{The {\tt CHOICE} and {\tt REST} functions}\THEOREM CHOICE\_DEF sets |- !s. ~(s = {}) ==> (CHOICE s) IN s \ENDTHEOREM \THEOREM CHOICE\_INSERT\_REST sets @@ -346,8 +335,7 @@ \THEOREM SING\_IFF\_EMPTY\_REST sets |- !s. SING s = ~(s = {}) /\ (REST s = {}) \ENDTHEOREM -\section{Image of a function on a set} -\THEOREM IMAGE\_COMPOSE sets +\section{Image of a function on a set}\THEOREM IMAGE\_COMPOSE sets |- !f g s. IMAGE(f o g)s = IMAGE f(IMAGE g s) \ENDTHEOREM \THEOREM IMAGE\_DEF sets @@ -383,8 +371,7 @@ \THEOREM IN\_IMAGE sets |- !y s f. y IN (IMAGE f s) = (?x. (y = f x) /\ x IN s) \ENDTHEOREM -\section{Mappings between sets} -\THEOREM BIJ\_COMPOSE sets +\section{Mappings between sets}\THEOREM BIJ\_COMPOSE sets |- !f g s t u. BIJ f s t /\ BIJ g t u ==> BIJ(g o f)s u \ENDTHEOREM \THEOREM BIJ\_DEF sets @@ -435,8 +422,7 @@ \THEOREM SURJ\_ID sets |- !s. SURJ(\x. x)s s \ENDTHEOREM -\section{Singleton sets} -\THEOREM DELETE\_EQ\_SING sets +\section{Singleton sets}\THEOREM DELETE\_EQ\_SING sets |- !s x. x IN s ==> ((s DELETE x = {}) = (s = {x})) \ENDTHEOREM \THEOREM DISJOINT\_SING\_EMPTY sets @@ -460,20 +446,19 @@ \THEOREM NOT\_SING\_EMPTY sets |- !x. ~({x} = {}) \ENDTHEOREM -\THEOREM SING sets -|- !x. SING{x} -\ENDTHEOREM \THEOREM SING\_DEF sets |- !s. SING s = (?x. s = {x}) \ENDTHEOREM \THEOREM SING\_DELETE sets |- !x. {x} DELETE x = {} \ENDTHEOREM +\THEOREM SING sets +|- !x. SING{x} +\ENDTHEOREM \THEOREM SING\_FINITE sets |- !s. SING s ==> FINITE s \ENDTHEOREM -\section{Finite and infinite sets} -\THEOREM FINITE\_DEF sets +\section{Finite and infinite sets}\THEOREM FINITE\_DEF sets |- !s. FINITE s = (!P. P{} /\ (!s'. P s' ==> (!e. P(e INSERT s'))) ==> P s) \ENDTHEOREM @@ -531,12 +516,12 @@ |- INFINITE (UNIV:(*)set) = (?f:*->*. (!x y. (f x = f y) ==> (x = y)) /\ (?y. !x. ~(f x = y))) \ENDTHEOREM -\THEOREM INTER\_FINITE sets -|- !s. FINITE s ==> (!t. FINITE(s INTER t)) -\ENDTHEOREM \THEOREM IN\_INFINITE\_NOT\_FINITE sets |- !s t. INFINITE s /\ FINITE t ==> (?x. x IN s /\ ~x IN t) \ENDTHEOREM +\THEOREM INTER\_FINITE sets +|- !s. FINITE s ==> (!t. FINITE(s INTER t)) +\ENDTHEOREM \THEOREM NOT\_IN\_FINITE sets |- INFINITE UNIV = (!s. FINITE s ==> (?x. ~x IN s)) \ENDTHEOREM @@ -546,8 +531,7 @@ \THEOREM SUBSET\_FINITE sets |- !s. FINITE s ==> (!t. t SUBSET s ==> FINITE t) \ENDTHEOREM -\section{Cardinality of sets} -\THEOREM CARD\_DEF sets +\section{Cardinality of sets}\THEOREM CARD\_DEF sets |- (CARD{} = 0) /\ (!s. FINITE s ==> --- hol88-2.02.19940316.orig/Library/trs/Manual/entries.tex +++ hol88-2.02.19940316/Library/trs/Manual/entries.tex @@ -1,6 +1,4 @@ -\chapter{ML Functions in the trs Library} -\input{entries-intro} -\DOC{Ancestors} +\chapter{ML Functions in the trs Library}\input{entries-intro}\DOC{Ancestors} \TYPE {\small\verb%Ancestors : ((string list # string list) -> searchpath)%}\egroup --- hol88-2.02.19940316.orig/Library/reals/Manual/theorems.tex +++ hol88-2.02.19940316/Library/reals/Manual/theorems.tex @@ -1,18 +1,15 @@ -\chapter{Pre-proved Theorems} -\input{theorems-intro} -\section{HRAT} -\THEOREM hrat\_1 HRAT +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{HRAT}\THEOREM hrat\_1 HRAT |- hrat_1 = mk_hrat($trat_eq trat_1) \ENDTHEOREM +\THEOREM HRAT\_ADD\_ASSOC HRAT +|- !h i j. h hrat_add (i hrat_add j) = (h hrat_add i) hrat_add j +\ENDTHEOREM \THEOREM hrat\_add HRAT |- !g00014 g00015. g00014 hrat_add g00015 = mk_hrat ($trat_eq(($@(dest_hrat g00014)) trat_add ($@(dest_hrat g00015)))) \ENDTHEOREM -\THEOREM HRAT\_ADD\_ASSOC HRAT -|- !h i j. h hrat_add (i hrat_add j) = (h hrat_add i) hrat_add j -\ENDTHEOREM \THEOREM HRAT\_ADD\_SYM HRAT |- !h i. h hrat_add i = i hrat_add h \ENDTHEOREM @@ -30,15 +27,15 @@ |- !h i j. h hrat_mul (i hrat_add j) = (h hrat_mul i) hrat_add (h hrat_mul j) \ENDTHEOREM +\THEOREM HRAT\_MUL\_ASSOC HRAT +|- !h i j. h hrat_mul (i hrat_mul j) = (h hrat_mul i) hrat_mul j +\ENDTHEOREM \THEOREM hrat\_mul HRAT |- !g00016 g00017. g00016 hrat_mul g00017 = mk_hrat ($trat_eq(($@(dest_hrat g00016)) trat_mul ($@(dest_hrat g00017)))) \ENDTHEOREM -\THEOREM HRAT\_MUL\_ASSOC HRAT -|- !h i j. h hrat_mul (i hrat_mul j) = (h hrat_mul i) hrat_mul j -\ENDTHEOREM \THEOREM HRAT\_MUL\_LID HRAT |- !h. hrat_1 hrat_mul h = h \ENDTHEOREM @@ -51,13 +48,13 @@ \THEOREM HRAT\_NOZERO HRAT |- !h i. ~(h hrat_add i = h) \ENDTHEOREM +\THEOREM hrat\_sucint HRAT +|- !g00018. hrat_sucint g00018 = mk_hrat($trat_eq(trat_sucint g00018)) +\ENDTHEOREM \THEOREM HRAT\_SUCINT HRAT |- (hrat_sucint 0 = hrat_1) /\ (!n. hrat_sucint(SUC n) = (hrat_sucint n) hrat_add hrat_1) \ENDTHEOREM -\THEOREM hrat\_sucint HRAT -|- !g00018. hrat_sucint g00018 = mk_hrat($trat_eq(trat_sucint g00018)) -\ENDTHEOREM \THEOREM hrat\_tybij HRAT |- (!a. mk_hrat(dest_hrat a) = a) /\ (!r. (\c. ?x. c = $trat_eq x)r = (dest_hrat(mk_hrat r) = r)) @@ -68,16 +65,16 @@ \THEOREM trat\_1 HRAT |- trat_1 = 0,0 \ENDTHEOREM +\THEOREM TRAT\_ADD\_ASSOC HRAT +|- !h i j. + (h trat_add (i trat_add j)) trat_eq ((h trat_add i) trat_add j) +\ENDTHEOREM \THEOREM trat\_add HRAT |- !x y x' y'. (x,y) trat_add (x',y') = PRE(((SUC x) * (SUC y')) + ((SUC x') * (SUC y))), PRE((SUC y) * (SUC y')) \ENDTHEOREM -\THEOREM TRAT\_ADD\_ASSOC HRAT -|- !h i j. - (h trat_add (i trat_add j)) trat_eq ((h trat_add i) trat_add j) -\ENDTHEOREM \THEOREM TRAT\_ADD\_SYM HRAT |- !h i. (h trat_add i) trat_eq (i trat_add h) \ENDTHEOREM @@ -90,24 +87,24 @@ (?d. h trat_eq (i trat_add d)) \/ (?d. i trat_eq (h trat_add d)) \ENDTHEOREM -\THEOREM TRAT\_ADD\_WELLDEFINED HRAT -|- !p q r. p trat_eq q ==> (p trat_add r) trat_eq (q trat_add r) -\ENDTHEOREM \THEOREM TRAT\_ADD\_WELLDEFINED2 HRAT |- !p1 p2 q1 q2. p1 trat_eq p2 /\ q1 trat_eq q2 ==> (p1 trat_add q1) trat_eq (p2 trat_add q2) \ENDTHEOREM +\THEOREM TRAT\_ADD\_WELLDEFINED HRAT +|- !p q r. p trat_eq q ==> (p trat_add r) trat_eq (q trat_add r) +\ENDTHEOREM \THEOREM TRAT\_ARCH HRAT |- !h. ?n d. (trat_sucint n) trat_eq (h trat_add d) \ENDTHEOREM +\THEOREM TRAT\_EQ\_AP HRAT +|- !p q. (p = q) ==> p trat_eq q +\ENDTHEOREM \THEOREM trat\_eq HRAT |- !x y x' y'. (x,y) trat_eq (x',y') = ((SUC x) * (SUC y') = (SUC x') * (SUC y)) \ENDTHEOREM -\THEOREM TRAT\_EQ\_AP HRAT -|- !p q. (p = q) ==> p trat_eq q -\ENDTHEOREM \THEOREM TRAT\_EQ\_EQUIV HRAT |- !p q. p trat_eq q = ($trat_eq p = $trat_eq q) \ENDTHEOREM @@ -131,15 +128,15 @@ (h trat_mul (i trat_add j)) trat_eq ((h trat_mul i) trat_add (h trat_mul j)) \ENDTHEOREM +\THEOREM TRAT\_MUL\_ASSOC HRAT +|- !h i j. + (h trat_mul (i trat_mul j)) trat_eq ((h trat_mul i) trat_mul j) +\ENDTHEOREM \THEOREM trat\_mul HRAT |- !x y x' y'. (x,y) trat_mul (x',y') = PRE((SUC x) * (SUC x')),PRE((SUC y) * (SUC y')) \ENDTHEOREM -\THEOREM TRAT\_MUL\_ASSOC HRAT -|- !h i j. - (h trat_mul (i trat_mul j)) trat_eq ((h trat_mul i) trat_mul j) -\ENDTHEOREM \THEOREM TRAT\_MUL\_LID HRAT |- !h. (trat_1 trat_mul h) trat_eq h \ENDTHEOREM @@ -152,30 +149,29 @@ \THEOREM TRAT\_MUL\_SYM\_EQ HRAT |- !h i. h trat_mul i = i trat_mul h \ENDTHEOREM -\THEOREM TRAT\_MUL\_WELLDEFINED HRAT -|- !p q r. p trat_eq q ==> (p trat_mul r) trat_eq (q trat_mul r) -\ENDTHEOREM \THEOREM TRAT\_MUL\_WELLDEFINED2 HRAT |- !p1 p2 q1 q2. p1 trat_eq p2 /\ q1 trat_eq q2 ==> (p1 trat_mul q1) trat_eq (p2 trat_mul q2) \ENDTHEOREM +\THEOREM TRAT\_MUL\_WELLDEFINED HRAT +|- !p q r. p trat_eq q ==> (p trat_mul r) trat_eq (q trat_mul r) +\ENDTHEOREM \THEOREM TRAT\_NOZERO HRAT |- !h i. ~(h trat_add i) trat_eq h \ENDTHEOREM -\THEOREM TRAT\_SUCINT HRAT -|- (trat_sucint 0) trat_eq trat_1 /\ - (!n. (trat_sucint(SUC n)) trat_eq ((trat_sucint n) trat_add trat_1)) +\THEOREM TRAT\_SUCINT\_0 HRAT +|- !n. (trat_sucint n) trat_eq (n,0) \ENDTHEOREM \THEOREM trat\_sucint HRAT |- (trat_sucint 0 = trat_1) /\ (!n. trat_sucint(SUC n) = (trat_sucint n) trat_add trat_1) \ENDTHEOREM -\THEOREM TRAT\_SUCINT\_0 HRAT -|- !n. (trat_sucint n) trat_eq (n,0) +\THEOREM TRAT\_SUCINT HRAT +|- (trat_sucint 0) trat_eq trat_1 /\ + (!n. (trat_sucint(SUC n)) trat_eq ((trat_sucint n) trat_add trat_1)) \ENDTHEOREM -\section{HREAL} -\THEOREM CUT\_BOUNDED HREAL +\section{HREAL}\THEOREM CUT\_BOUNDED HREAL |- !X. ?x. ~cut X x \ENDTHEOREM \THEOREM CUT\_DOWN HREAL @@ -208,12 +204,12 @@ \THEOREM EQUAL\_CUTS HREAL |- !X Y. (cut X = cut Y) ==> (X = Y) \ENDTHEOREM -\THEOREM HRAT\_DOWN HREAL -|- !x. ?y. y hrat_lt x -\ENDTHEOREM \THEOREM HRAT\_DOWN2 HREAL |- !x y. ?z. z hrat_lt x /\ z hrat_lt y \ENDTHEOREM +\THEOREM HRAT\_DOWN HREAL +|- !x. ?y. y hrat_lt x +\ENDTHEOREM \THEOREM HRAT\_EQ\_LADD HREAL |- !x y z. (x hrat_add y = x hrat_add z) = (y = z) \ENDTHEOREM @@ -229,9 +225,6 @@ \THEOREM HRAT\_INV\_MUL HREAL |- !x y. hrat_inv(x hrat_mul y) = (hrat_inv x) hrat_mul (hrat_inv y) \ENDTHEOREM -\THEOREM hrat\_lt HREAL -|- !x y. x hrat_lt y = (?d. y = x hrat_add d) -\ENDTHEOREM \THEOREM HRAT\_LT\_ADD2 HREAL |- !u v x y. u hrat_lt x /\ v hrat_lt y ==> (u hrat_add v) hrat_lt (x hrat_add y) @@ -245,6 +238,9 @@ \THEOREM HRAT\_LT\_ANTISYM HREAL |- !x y. ~(x hrat_lt y /\ y hrat_lt x) \ENDTHEOREM +\THEOREM hrat\_lt HREAL +|- !x y. x hrat_lt y = (?d. y = x hrat_add d) +\ENDTHEOREM \THEOREM HRAT\_LT\_GT HREAL |- !x y. x hrat_lt y ==> ~y hrat_lt x \ENDTHEOREM @@ -254,12 +250,12 @@ \THEOREM HRAT\_LT\_LADD HREAL |- !x y z. (z hrat_add x) hrat_lt (z hrat_add y) = x hrat_lt y \ENDTHEOREM -\THEOREM HRAT\_LT\_LMUL HREAL -|- !x y z. (z hrat_mul x) hrat_lt (z hrat_mul y) = x hrat_lt y -\ENDTHEOREM \THEOREM HRAT\_LT\_LMUL1 HREAL |- !x y. (x hrat_mul y) hrat_lt y = x hrat_lt hrat_1 \ENDTHEOREM +\THEOREM HRAT\_LT\_LMUL HREAL +|- !x y z. (z hrat_mul x) hrat_lt (z hrat_mul y) = x hrat_lt y +\ENDTHEOREM \THEOREM HRAT\_LT\_MUL2 HREAL |- !u v x y. u hrat_lt x /\ v hrat_lt y ==> (u hrat_mul v) hrat_lt (x hrat_mul y) @@ -276,12 +272,12 @@ \THEOREM HRAT\_LT\_REFL HREAL |- !x. ~x hrat_lt x \ENDTHEOREM -\THEOREM HRAT\_LT\_RMUL HREAL -|- !x y z. (x hrat_mul z) hrat_lt (y hrat_mul z) = x hrat_lt y -\ENDTHEOREM \THEOREM HRAT\_LT\_RMUL1 HREAL |- !x y. (x hrat_mul y) hrat_lt x = y hrat_lt hrat_1 \ENDTHEOREM +\THEOREM HRAT\_LT\_RMUL HREAL +|- !x y z. (x hrat_mul z) hrat_lt (y hrat_mul z) = x hrat_lt y +\ENDTHEOREM \THEOREM HRAT\_LT\_TOTAL HREAL |- !x y. (x = y) \/ x hrat_lt y \/ y hrat_lt x \ENDTHEOREM @@ -307,14 +303,14 @@ \THEOREM hreal\_1 HREAL |- hreal_1 = hreal(cut_of_hrat hrat_1) \ENDTHEOREM +\THEOREM HREAL\_ADD\_ASSOC HREAL +|- !X Y Z. X hreal_add (Y hreal_add Z) = (X hreal_add Y) hreal_add Z +\ENDTHEOREM \THEOREM hreal\_add HREAL |- !X Y. X hreal_add Y = hreal(\w. ?x y. (w = x hrat_add y) /\ cut X x /\ cut Y y) \ENDTHEOREM -\THEOREM HREAL\_ADD\_ASSOC HREAL -|- !X Y Z. X hreal_add (Y hreal_add Z) = (X hreal_add Y) hreal_add Z -\ENDTHEOREM \THEOREM HREAL\_ADD\_ISACUT HREAL |- !X Y. isacut(\w. ?x y. (w = x hrat_add y) /\ cut X x /\ cut Y y) \ENDTHEOREM @@ -342,26 +338,26 @@ X hreal_mul (Y hreal_add Z) = (X hreal_mul Y) hreal_add (X hreal_mul Z) \ENDTHEOREM -\THEOREM HREAL\_LT HREAL -|- !X Y. X hreal_lt Y = (?D. Y = X hreal_add D) -\ENDTHEOREM \THEOREM hreal\_lt HREAL |- !X Y. X hreal_lt Y = ~(X = Y) /\ (!x. cut X x ==> cut Y x) \ENDTHEOREM +\THEOREM HREAL\_LT HREAL +|- !X Y. X hreal_lt Y = (?D. Y = X hreal_add D) +\ENDTHEOREM \THEOREM HREAL\_LT\_LEMMA HREAL |- !X Y. X hreal_lt Y ==> (?x. ~cut X x /\ cut Y x) \ENDTHEOREM \THEOREM HREAL\_LT\_TOTAL HREAL |- !X Y. (X = Y) \/ X hreal_lt Y \/ Y hreal_lt X \ENDTHEOREM +\THEOREM HREAL\_MUL\_ASSOC HREAL +|- !X Y Z. X hreal_mul (Y hreal_mul Z) = (X hreal_mul Y) hreal_mul Z +\ENDTHEOREM \THEOREM hreal\_mul HREAL |- !X Y. X hreal_mul Y = hreal(\w. ?x y. (w = x hrat_mul y) /\ cut X x /\ cut Y y) \ENDTHEOREM -\THEOREM HREAL\_MUL\_ASSOC HREAL -|- !X Y Z. X hreal_mul (Y hreal_mul Z) = (X hreal_mul Y) hreal_mul Z -\ENDTHEOREM \THEOREM HREAL\_MUL\_ISACUT HREAL |- !X Y. isacut(\w. ?x y. (w = x hrat_mul y) /\ cut X x /\ cut Y y) \ENDTHEOREM @@ -377,24 +373,24 @@ \THEOREM HREAL\_NOZERO HREAL |- !X Y. ~(X hreal_add Y = X) \ENDTHEOREM -\THEOREM hreal\_sub HREAL -|- !Y X. Y hreal_sub X = hreal(\w. ?x. ~cut X x /\ cut Y(x hrat_add w)) -\ENDTHEOREM \THEOREM HREAL\_SUB\_ADD HREAL |- !X Y. X hreal_lt Y ==> ((Y hreal_sub X) hreal_add X = Y) \ENDTHEOREM +\THEOREM hreal\_sub HREAL +|- !Y X. Y hreal_sub X = hreal(\w. ?x. ~cut X x /\ cut Y(x hrat_add w)) +\ENDTHEOREM \THEOREM HREAL\_SUB\_ISACUT HREAL |- !X Y. X hreal_lt Y ==> isacut(\w. ?x. ~cut X x /\ cut Y(x hrat_add w)) \ENDTHEOREM +\THEOREM hreal\_sup HREAL +|- !P. hreal_sup P = hreal(\w. ?X. P X /\ cut X w) +\ENDTHEOREM \THEOREM HREAL\_SUP HREAL |- !P. (?X. P X) /\ (?Y. !X. P X ==> X hreal_lt Y) ==> (!Y. (?X. P X /\ Y hreal_lt X) = Y hreal_lt (hreal_sup P)) \ENDTHEOREM -\THEOREM hreal\_sup HREAL -|- !P. hreal_sup P = hreal(\w. ?X. P X /\ cut X w) -\ENDTHEOREM \THEOREM HREAL\_SUP\_ISACUT HREAL |- !P. (?X. P X) /\ (?Y. !X. P X ==> X hreal_lt Y) ==> @@ -417,8 +413,7 @@ \THEOREM ISACUT\_HRAT HREAL |- !h. isacut(cut_of_hrat h) \ENDTHEOREM -\section{REALAX} -\THEOREM HREAL\_EQ\_ADDL REALAX +\section{REALAX}\THEOREM HREAL\_EQ\_ADDL REALAX |- !x y. ~(x = x hreal_add y) \ENDTHEOREM \THEOREM HREAL\_EQ\_ADDR REALAX @@ -470,15 +465,15 @@ \THEOREM REAL\_10 REALAX |- ~(r1 = r0) \ENDTHEOREM +\THEOREM REAL\_ADD\_ASSOC REALAX +|- !x y z. x + (y + z) = (x + y) + z +\ENDTHEOREM \THEOREM real\_add REALAX |- !g00025 g00026. g00025 + g00026 = mk_real ($treal_eq(($@(dest_real g00025)) treal_add ($@(dest_real g00026)))) \ENDTHEOREM -\THEOREM REAL\_ADD\_ASSOC REALAX -|- !x y z. x + (y + z) = (x + y) + z -\ENDTHEOREM \THEOREM REAL\_ADD\_LID REALAX |- !x. r0 + x = x \ENDTHEOREM @@ -518,15 +513,15 @@ \THEOREM REAL\_LT\_TRANS REALAX |- !x y z. x < y /\ y < z ==> x < z \ENDTHEOREM +\THEOREM REAL\_MUL\_ASSOC REALAX +|- !x y z. x * (y * z) = (x * y) * z +\ENDTHEOREM \THEOREM real\_mul REALAX |- !g00027 g00028. g00027 * g00028 = mk_real ($treal_eq(($@(dest_real g00027)) treal_mul ($@(dest_real g00028)))) \ENDTHEOREM -\THEOREM REAL\_MUL\_ASSOC REALAX -|- !x y z. x * (y * z) = (x * y) * z -\ENDTHEOREM \THEOREM REAL\_MUL\_LID REALAX |- !x. r1 * x = x \ENDTHEOREM @@ -578,19 +573,19 @@ \THEOREM treal\_0 REALAX |- treal_0 = hreal_1,hreal_1 \ENDTHEOREM +\THEOREM TREAL\_10 REALAX +|- ~treal_1 treal_eq treal_0 +\ENDTHEOREM \THEOREM treal\_1 REALAX |- treal_1 = hreal_1 hreal_add hreal_1,hreal_1 \ENDTHEOREM -\THEOREM TREAL\_10 REALAX -|- ~treal_1 treal_eq treal_0 +\THEOREM TREAL\_ADD\_ASSOC REALAX +|- !x y z. x treal_add (y treal_add z) = (x treal_add y) treal_add z \ENDTHEOREM \THEOREM treal\_add REALAX |- !x1 y1 x2 y2. (x1,y1) treal_add (x2,y2) = x1 hreal_add x2,y1 hreal_add y2 \ENDTHEOREM -\THEOREM TREAL\_ADD\_ASSOC REALAX -|- !x y z. x treal_add (y treal_add z) = (x treal_add y) treal_add z -\ENDTHEOREM \THEOREM TREAL\_ADD\_LID REALAX |- !x. (treal_0 treal_add x) treal_eq x \ENDTHEOREM @@ -617,13 +612,13 @@ \THEOREM TREAL\_BIJ\_WELLDEF REALAX |- !h i. h treal_eq i ==> (hreal_of_treal h = hreal_of_treal i) \ENDTHEOREM +\THEOREM TREAL\_EQ\_AP REALAX +|- !p q. (p = q) ==> p treal_eq q +\ENDTHEOREM \THEOREM treal\_eq REALAX |- !x1 y1 x2 y2. (x1,y1) treal_eq (x2,y2) = (x1 hreal_add y2 = x2 hreal_add y1) \ENDTHEOREM -\THEOREM TREAL\_EQ\_AP REALAX -|- !p q. (p = q) ==> p treal_eq q -\ENDTHEOREM \THEOREM TREAL\_EQ\_EQUIV REALAX |- !p q. p treal_eq q = ($treal_eq p = $treal_eq q) \ENDTHEOREM @@ -656,14 +651,14 @@ x treal_mul (y treal_add z) = (x treal_mul y) treal_add (x treal_mul z) \ENDTHEOREM +\THEOREM TREAL\_LT\_ADD REALAX +|- !x y z. y treal_lt z ==> (x treal_add y) treal_lt (x treal_add z) +\ENDTHEOREM \THEOREM treal\_lt REALAX |- !x1 y1 x2 y2. (x1,y1) treal_lt (x2,y2) = (x1 hreal_add y2) hreal_lt (x2 hreal_add y1) \ENDTHEOREM -\THEOREM TREAL\_LT\_ADD REALAX -|- !x y z. y treal_lt z ==> (x treal_add y) treal_lt (x treal_add z) -\ENDTHEOREM \THEOREM TREAL\_LT\_MUL REALAX |- !x y. treal_0 treal_lt x /\ treal_0 treal_lt y ==> @@ -689,15 +684,15 @@ \THEOREM TREAL\_LT\_WELLDEFR REALAX |- !x1 x2 y. x1 treal_eq x2 ==> (x1 treal_lt y = x2 treal_lt y) \ENDTHEOREM +\THEOREM TREAL\_MUL\_ASSOC REALAX +|- !x y z. x treal_mul (y treal_mul z) = (x treal_mul y) treal_mul z +\ENDTHEOREM \THEOREM treal\_mul REALAX |- !x1 y1 x2 y2. (x1,y1) treal_mul (x2,y2) = (x1 hreal_mul x2) hreal_add (y1 hreal_mul y2), (x1 hreal_mul y2) hreal_add (y1 hreal_mul x2) \ENDTHEOREM -\THEOREM TREAL\_MUL\_ASSOC REALAX -|- !x y z. x treal_mul (y treal_mul z) = (x treal_mul y) treal_mul z -\ENDTHEOREM \THEOREM TREAL\_MUL\_LID REALAX |- !x. (treal_1 treal_mul x) treal_eq x \ENDTHEOREM @@ -726,11 +721,7 @@ \THEOREM treal\_of\_hreal REALAX |- !x. treal_of_hreal x = x hreal_add hreal_1,hreal_1 \ENDTHEOREM -\section{REAL} -\THEOREM abs REAL -|- !x. abs x = ((& 0) <= x => x | -- x) -\ENDTHEOREM -\THEOREM REAL\_ABS\_0 REAL +\section{REAL}\THEOREM REAL\_ABS\_0 REAL |- abs(& 0) = & 0 \ENDTHEOREM \THEOREM REAL\_ABS\_1 REAL @@ -739,9 +730,6 @@ \THEOREM REAL\_ABS\_ABS REAL |- !x. abs(abs x) = abs x \ENDTHEOREM -\THEOREM REAL\_ABS\_BETWEEN REAL -|- !x y d. (& 0) < d /\ (x - d) < y /\ y < (x + d) = (abs(y - x)) < d -\ENDTHEOREM \THEOREM REAL\_ABS\_BETWEEN1 REAL |- !x y z. x < z /\ (abs(y - x)) < (z - x) ==> y < z \ENDTHEOREM @@ -752,6 +740,9 @@ (abs(y - y0)) < ((y0 - x0) / (& 2)) ==> x < y \ENDTHEOREM +\THEOREM REAL\_ABS\_BETWEEN REAL +|- !x y d. (& 0) < d /\ (x - d) < y /\ y < (x + d) = (abs(y - x)) < d +\ENDTHEOREM \THEOREM REAL\_ABS\_BOUND REAL |- !x y d. (abs(x - y)) < d ==> y < (x + d) \ENDTHEOREM @@ -767,6 +758,9 @@ \THEOREM REAL\_ABS\_DIV REAL |- !y. ~(y = & 0) ==> (!x. abs(x / y) = (abs x) / (abs y)) \ENDTHEOREM +\THEOREM abs REAL +|- !x. abs x = ((& 0) <= x => x | -- x) +\ENDTHEOREM \THEOREM REAL\_ABS\_INV REAL |- !x. ~(x = & 0) ==> (abs(inv x) = inv(abs x)) \ENDTHEOREM @@ -797,21 +791,21 @@ \THEOREM REAL\_ABS\_REFL REAL |- !x. (abs x = x) = (& 0) <= x \ENDTHEOREM -\THEOREM REAL\_ABS\_SIGN REAL -|- !x y. (abs(x - y)) < y ==> (& 0) < x -\ENDTHEOREM \THEOREM REAL\_ABS\_SIGN2 REAL |- !x y. (abs(x - y)) < (-- y) ==> x < (& 0) \ENDTHEOREM +\THEOREM REAL\_ABS\_SIGN REAL +|- !x y. (abs(x - y)) < y ==> (& 0) < x +\ENDTHEOREM \THEOREM REAL\_ABS\_STILLNZ REAL |- !x y. (abs(x - y)) < (abs y) ==> ~(x = & 0) \ENDTHEOREM -\THEOREM REAL\_ABS\_SUB REAL -|- !x y. abs(x - y) = abs(y - x) -\ENDTHEOREM \THEOREM REAL\_ABS\_SUB\_ABS REAL |- !x y. (abs((abs x) - (abs y))) <= (abs(x - y)) \ENDTHEOREM +\THEOREM REAL\_ABS\_SUB REAL +|- !x y. abs(x - y) = abs(y - x) +\ENDTHEOREM \THEOREM ABS\_SUM REAL |- !f m n. (abs(Sum(m,n)f)) <= (Sum(m,n)(\n'. abs(f n'))) \ENDTHEOREM @@ -821,9 +815,6 @@ \THEOREM REAL\_ABS\_ZERO REAL |- !x. (abs x = & 0) = (x = & 0) \ENDTHEOREM -\THEOREM pow REAL -|- (!x. x pow 0 = & 1) /\ (!x n. x pow (SUC n) = x * (x pow n)) -\ENDTHEOREM \THEOREM POW\_0 REAL |- !n. (& 0) pow (SUC n) = & 0 \ENDTHEOREM @@ -845,6 +836,9 @@ \THEOREM POW\_ADD REAL |- !c m n. c pow (m num_add n) = (c pow m) * (c pow n) \ENDTHEOREM +\THEOREM pow REAL +|- (!x. x pow 0 = & 1) /\ (!x n. x pow (SUC n) = x * (x pow n)) +\ENDTHEOREM \THEOREM POW\_INV REAL |- !c. ~(c = & 0) ==> (!n. inv(c pow n) = (inv c) pow n) \ENDTHEOREM @@ -872,20 +866,14 @@ \THEOREM POW\_POS\_LT REAL |- !x n. (& 0) < x ==> (& 0) < (x pow (SUC n)) \ENDTHEOREM -\THEOREM REAL REAL -|- !n. &(SUC n) = (& n) + (& 1) -\ENDTHEOREM \THEOREM REAL\_0 REAL |- r0 = & 0 \ENDTHEOREM -\THEOREM REAL\_1 REAL -|- r1 = & 1 -\ENDTHEOREM \THEOREM REAL\_10 REAL |- ~(& 1 = & 0) \ENDTHEOREM -\THEOREM REAL\_ADD REAL -|- !m n. (& m) + (& n) = &(m num_add n) +\THEOREM REAL\_1 REAL +|- r1 = & 1 \ENDTHEOREM \THEOREM REAL\_ADD2\_SUB2 REAL |- !a b c d. (a + b) - (c + d) = (a - c) + (b - d) @@ -893,6 +881,9 @@ \THEOREM REAL\_ADD\_ASSOC REAL |- !x y z. x + (y + z) = (x + y) + z \ENDTHEOREM +\THEOREM REAL\_ADD REAL +|- !m n. (& m) + (& n) = &(m num_add n) +\ENDTHEOREM \THEOREM REAL\_ADD\_LID REAL |- !x. (& 0) + x = x \ENDTHEOREM @@ -911,12 +902,12 @@ \THEOREM REAL\_ADD\_RINV REAL |- !x. x + (-- x) = & 0 \ENDTHEOREM -\THEOREM REAL\_ADD\_SUB REAL -|- !x y. (x + y) - x = y -\ENDTHEOREM \THEOREM REAL\_ADD\_SUB2 REAL |- !x y. x - (x + y) = -- y \ENDTHEOREM +\THEOREM REAL\_ADD\_SUB REAL +|- !x y. (x + y) - x = y +\ENDTHEOREM \THEOREM REAL\_ADD\_SYM REAL |- !x y. x + y = y + x \ENDTHEOREM @@ -949,15 +940,18 @@ \THEOREM REAL\_DIV\_RMUL REAL |- !x y. ~(y = & 0) ==> ((x / y) * y = x) \ENDTHEOREM +\THEOREM REAL REAL +|- !n. &(SUC n) = (& n) + (& 1) +\ENDTHEOREM \THEOREM REAL\_DOUBLE REAL |- !x. x + x = (& 2) * x \ENDTHEOREM -\THEOREM REAL\_DOWN REAL -|- !x. (& 0) < x ==> (?y. (& 0) < y /\ y < x) -\ENDTHEOREM \THEOREM REAL\_DOWN2 REAL |- !x y. (& 0) < x /\ (& 0) < y ==> (?z. (& 0) < z /\ z < x /\ z < y) \ENDTHEOREM +\THEOREM REAL\_DOWN REAL +|- !x. (& 0) < x ==> (?y. (& 0) < y /\ y < x) +\ENDTHEOREM \THEOREM REAL\_ENTIRE REAL |- !x y. (x * y = & 0) = (x = & 0) \/ (y = & 0) \ENDTHEOREM @@ -967,12 +961,12 @@ \THEOREM REAL\_EQ\_LADD REAL |- !x y z. (x + y = x + z) = (y = z) \ENDTHEOREM -\THEOREM REAL\_EQ\_LMUL REAL -|- !x y z. (x * y = x * z) = (x = & 0) \/ (y = z) -\ENDTHEOREM \THEOREM REAL\_EQ\_LMUL2 REAL |- !x y z. ~(x = & 0) ==> ((y = z) = (x * y = x * z)) \ENDTHEOREM +\THEOREM REAL\_EQ\_LMUL REAL +|- !x y z. (x * y = x * z) = (x = & 0) \/ (y = z) +\ENDTHEOREM \THEOREM REAL\_EQ\_LMUL\_IMP REAL |- !x y z. ~(x = & 0) /\ (x * y = x * z) ==> (y = z) \ENDTHEOREM @@ -1012,12 +1006,12 @@ \THEOREM REAL\_INV1 REAL |- inv(& 1) = & 1 \ENDTHEOREM -\THEOREM REAL\_INVINV REAL -|- !x. ~(x = & 0) ==> (inv(inv x) = x) -\ENDTHEOREM \THEOREM REAL\_INV\_1OVER REAL |- !x. inv x = (& 1) / x \ENDTHEOREM +\THEOREM REAL\_INVINV REAL +|- !x. ~(x = & 0) ==> (inv(inv x) = x) +\ENDTHEOREM \THEOREM REAL\_INV\_LT1 REAL |- !x. (& 0) < x /\ x < (& 1) ==> (& 1) < (inv x) \ENDTHEOREM @@ -1033,39 +1027,18 @@ \THEOREM REAL\_LDISTRIB REAL |- !x y z. x * (y + z) = (x * y) + (x * z) \ENDTHEOREM -\THEOREM REAL\_LE REAL -|- !m n. (& m) <= (& n) = m num_le n -\ENDTHEOREM -\THEOREM real\_le REAL -|- !x y. x <= y = ~y < x +\THEOREM REAL\_LE\_01 REAL +|- (& 0) <= (& 1) \ENDTHEOREM \THEOREM REAL\_LE1\_POW2 REAL |- !x. (& 1) <= x ==> (& 1) <= (x pow 2) \ENDTHEOREM -\THEOREM REAL\_LET\_ADD REAL -|- !x y. (& 0) <= x /\ (& 0) < y ==> (& 0) < (x + y) -\ENDTHEOREM -\THEOREM REAL\_LET\_ADD2 REAL -|- !w x y z. w <= x /\ y < z ==> (w + y) < (x + z) -\ENDTHEOREM -\THEOREM REAL\_LET\_ANTISYM REAL -|- !x y. ~(x < y /\ y <= x) -\ENDTHEOREM -\THEOREM REAL\_LET\_TOTAL REAL -|- !x y. x <= y \/ y < x -\ENDTHEOREM -\THEOREM REAL\_LET\_TRANS REAL -|- !x y z. x <= y /\ y < z ==> x < z -\ENDTHEOREM -\THEOREM REAL\_LE\_01 REAL -|- (& 0) <= (& 1) +\THEOREM REAL\_LE\_ADD2 REAL +|- !w x y z. w <= x /\ y <= z ==> (w + y) <= (x + z) \ENDTHEOREM \THEOREM REAL\_LE\_ADD REAL |- !x y. (& 0) <= x /\ (& 0) <= y ==> (& 0) <= (x + y) \ENDTHEOREM -\THEOREM REAL\_LE\_ADD2 REAL -|- !w x y z. w <= x /\ y <= z ==> (w + y) <= (x + z) -\ENDTHEOREM \THEOREM REAL\_LE\_ADDL REAL |- !x y. y <= (x + y) = (& 0) <= x \ENDTHEOREM @@ -1075,7 +1048,13 @@ \THEOREM REAL\_LE\_ANTISYM REAL |- !x y. x <= y /\ y <= x = (x = y) \ENDTHEOREM -\THEOREM REAL\_LE\_DOUBLE REAL +\THEOREM real\_le REAL +|- !x y. x <= y = ~y < x +\ENDTHEOREM +\THEOREM REAL\_LE REAL +|- !m n. (& m) <= (& n) = m num_le n +\ENDTHEOREM +\THEOREM REAL\_LE\_DOUBLE REAL |- !x. (& 0) <= (x + x) = (& 0) <= x \ENDTHEOREM \THEOREM REAL\_LE\_LADD REAL @@ -1093,14 +1072,14 @@ \THEOREM REAL\_LE\_LT REAL |- !x y. x <= y = x < y \/ (x = y) \ENDTHEOREM -\THEOREM REAL\_LE\_MUL REAL -|- !x y. (& 0) <= x /\ (& 0) <= y ==> (& 0) <= (x * y) -\ENDTHEOREM \THEOREM REAL\_LE\_MUL2 REAL |- !x1 x2 y1 y2. (& 0) <= x1 /\ (& 0) <= y1 /\ x1 <= x2 /\ y1 <= y2 ==> (x1 * y1) <= (x2 * y2) \ENDTHEOREM +\THEOREM REAL\_LE\_MUL REAL +|- !x y. (& 0) <= x /\ (& 0) <= y ==> (& 0) <= (x * y) +\ENDTHEOREM \THEOREM REAL\_LE\_NEG REAL |- !x y. (-- x) <= (-- y) = y <= x \ENDTHEOREM @@ -1140,47 +1119,41 @@ \THEOREM REAL\_LE\_SUB\_RADD REAL |- !x y z. (x - y) <= z = x <= (z + y) \ENDTHEOREM +\THEOREM REAL\_LET\_ADD2 REAL +|- !w x y z. w <= x /\ y < z ==> (w + y) < (x + z) +\ENDTHEOREM +\THEOREM REAL\_LET\_ADD REAL +|- !x y. (& 0) <= x /\ (& 0) < y ==> (& 0) < (x + y) +\ENDTHEOREM +\THEOREM REAL\_LET\_ANTISYM REAL +|- !x y. ~(x < y /\ y <= x) +\ENDTHEOREM \THEOREM REAL\_LE\_TOTAL REAL |- !x y. x <= y \/ y <= x \ENDTHEOREM \THEOREM REAL\_LE\_TRANS REAL |- !x y z. x <= y /\ y <= z ==> x <= z \ENDTHEOREM +\THEOREM REAL\_LET\_TOTAL REAL +|- !x y. x <= y \/ y < x +\ENDTHEOREM +\THEOREM REAL\_LET\_TRANS REAL +|- !x y z. x <= y /\ y < z ==> x < z +\ENDTHEOREM \THEOREM REAL\_LINV\_UNIQ REAL |- !x y. (x * y = & 1) ==> (x = inv y) \ENDTHEOREM \THEOREM REAL\_LNEG\_UNIQ REAL |- !x y. (x + y = & 0) = (x = -- y) \ENDTHEOREM -\THEOREM REAL\_LT REAL -|- !m n. (& m) < (& n) = m num_lt n -\ENDTHEOREM -\THEOREM REAL\_LT1\_POW2 REAL -|- !x. (& 1) < x ==> (& 1) < (x pow 2) -\ENDTHEOREM -\THEOREM REAL\_LTE\_ADD REAL -|- !x y. (& 0) < x /\ (& 0) <= y ==> (& 0) < (x + y) -\ENDTHEOREM -\THEOREM REAL\_LTE\_ADD2 REAL -|- !w x y z. w < x /\ y <= z ==> (w + y) < (x + z) -\ENDTHEOREM -\THEOREM REAL\_LTE\_ANTSYM REAL -|- !x y. ~(x <= y /\ y < x) -\ENDTHEOREM -\THEOREM REAL\_LTE\_TOTAL REAL -|- !x y. x < y \/ y <= x -\ENDTHEOREM -\THEOREM REAL\_LTE\_TRANS REAL -|- !x y z. x < y /\ y <= z ==> x < z -\ENDTHEOREM \THEOREM REAL\_LT\_01 REAL |- (& 0) < (& 1) \ENDTHEOREM \THEOREM REAL\_LT\_1 REAL |- !x y. (& 0) <= x /\ x < y ==> (x / y) < (& 1) \ENDTHEOREM -\THEOREM REAL\_LT\_ADD REAL -|- !x y. (& 0) < x /\ (& 0) < y ==> (& 0) < (x + y) +\THEOREM REAL\_LT1\_POW2 REAL +|- !x. (& 1) < x ==> (& 1) < (x pow 2) \ENDTHEOREM \THEOREM REAL\_LT\_ADD1 REAL |- !x y. x <= y ==> x < (y + (& 1)) @@ -1188,15 +1161,18 @@ \THEOREM REAL\_LT\_ADD2 REAL |- !w x y z. w < x /\ y < z ==> (w + y) < (x + z) \ENDTHEOREM +\THEOREM REAL\_LT\_ADD REAL +|- !x y. (& 0) < x /\ (& 0) < y ==> (& 0) < (x + y) +\ENDTHEOREM \THEOREM REAL\_LT\_ADDL REAL |- !x y. y < (x + y) = (& 0) < x \ENDTHEOREM -\THEOREM REAL\_LT\_ADDNEG REAL -|- !x y z. y < (x + (-- z)) = (y + z) < x -\ENDTHEOREM \THEOREM REAL\_LT\_ADDNEG2 REAL |- !x y z. (x + (-- y)) < z = x < (z + y) \ENDTHEOREM +\THEOREM REAL\_LT\_ADDNEG REAL +|- !x y z. y < (x + (-- z)) = (y + z) < x +\ENDTHEOREM \THEOREM REAL\_LT\_ADDR REAL |- !x y. x < (x + y) = (& 0) < y \ENDTHEOREM @@ -1206,12 +1182,30 @@ \THEOREM REAL\_LT\_ANTISYM REAL |- !x y. ~(x < y /\ y < x) \ENDTHEOREM -\THEOREM REAL\_LT\_FRACTION REAL -|- !n d. 1 num_lt n ==> ((d / (& n)) < d = (& 0) < d) +\THEOREM REAL\_LT REAL +|- !m n. (& m) < (& n) = m num_lt n +\ENDTHEOREM +\THEOREM REAL\_LTE\_ADD2 REAL +|- !w x y z. w < x /\ y <= z ==> (w + y) < (x + z) +\ENDTHEOREM +\THEOREM REAL\_LTE\_ADD REAL +|- !x y. (& 0) < x /\ (& 0) <= y ==> (& 0) < (x + y) +\ENDTHEOREM +\THEOREM REAL\_LTE\_ANTSYM REAL +|- !x y. ~(x <= y /\ y < x) +\ENDTHEOREM +\THEOREM REAL\_LTE\_TOTAL REAL +|- !x y. x < y \/ y <= x +\ENDTHEOREM +\THEOREM REAL\_LTE\_TRANS REAL +|- !x y z. x < y /\ y <= z ==> x < z \ENDTHEOREM \THEOREM REAL\_LT\_FRACTION\_0 REAL |- !n d. ~(n = 0) ==> ((& 0) < (d / (& n)) = (& 0) < d) \ENDTHEOREM +\THEOREM REAL\_LT\_FRACTION REAL +|- !n d. 1 num_lt n ==> ((d / (& n)) < d = (& 0) < d) +\ENDTHEOREM \THEOREM REAL\_LT\_GT REAL |- !x y. x < y ==> ~y < x \ENDTHEOREM @@ -1239,23 +1233,23 @@ \THEOREM REAL\_LT\_LE REAL |- !x y. x < y = x <= y /\ ~(x = y) \ENDTHEOREM -\THEOREM REAL\_LT\_LMUL REAL -|- !x y z. (& 0) < x ==> ((x * y) < (x * z) = y < z) -\ENDTHEOREM \THEOREM REAL\_LT\_LMUL\_0 REAL |- !x y. (& 0) < x ==> ((& 0) < (x * y) = (& 0) < y) \ENDTHEOREM +\THEOREM REAL\_LT\_LMUL REAL +|- !x y z. (& 0) < x ==> ((x * y) < (x * z) = y < z) +\ENDTHEOREM \THEOREM REAL\_LT\_LMUL\_IMP REAL |- !x y z. y < z /\ (& 0) < x ==> (x * y) < (x * z) \ENDTHEOREM -\THEOREM REAL\_LT\_MUL REAL -|- !x y. (& 0) < x /\ (& 0) < y ==> (& 0) < (x * y) -\ENDTHEOREM \THEOREM REAL\_LT\_MUL2 REAL |- !x1 x2 y1 y2. (& 0) <= x1 /\ (& 0) <= y1 /\ x1 < x2 /\ y1 < y2 ==> (x1 * y1) < (x2 * y2) \ENDTHEOREM +\THEOREM REAL\_LT\_MUL REAL +|- !x y. (& 0) < x /\ (& 0) < y ==> (& 0) < (x * y) +\ENDTHEOREM \THEOREM REAL\_LT\_MULTIPLE REAL |- !n d. 1 num_lt n ==> (d < ((& n) * d) = (& 0) < d) \ENDTHEOREM @@ -1271,21 +1265,21 @@ \THEOREM REAL\_LT\_RADD REAL |- !x y z. (x + z) < (y + z) = x < y \ENDTHEOREM -\THEOREM REAL\_LT\_RDIV REAL -|- !x y z. (& 0) < z ==> ((x / z) < (y / z) = x < y) -\ENDTHEOREM \THEOREM REAL\_LT\_RDIV\_0 REAL |- !y z. (& 0) < z ==> ((& 0) < (y / z) = (& 0) < y) \ENDTHEOREM +\THEOREM REAL\_LT\_RDIV REAL +|- !x y z. (& 0) < z ==> ((x / z) < (y / z) = x < y) +\ENDTHEOREM \THEOREM REAL\_LT\_REFL REAL |- !x. ~x < x \ENDTHEOREM -\THEOREM REAL\_LT\_RMUL REAL -|- !x y z. (& 0) < z ==> ((x * z) < (y * z) = x < y) -\ENDTHEOREM \THEOREM REAL\_LT\_RMUL\_0 REAL |- !x y. (& 0) < y ==> ((& 0) < (x * y) = (& 0) < x) \ENDTHEOREM +\THEOREM REAL\_LT\_RMUL REAL +|- !x y z. (& 0) < z ==> ((x * z) < (y * z) = x < y) +\ENDTHEOREM \THEOREM REAL\_LT\_RMUL\_IMP REAL |- !x y z. x < y /\ (& 0) < z ==> (x * z) < (y * z) \ENDTHEOREM @@ -1304,12 +1298,12 @@ \THEOREM REAL\_MEAN REAL |- !x y. x < y ==> (?z. x < z /\ z < y) \ENDTHEOREM -\THEOREM REAL\_MUL REAL -|- !m n. (& m) * (& n) = &(m num_mul n) -\ENDTHEOREM \THEOREM REAL\_MUL\_ASSOC REAL |- !x y z. x * (y * z) = (x * y) * z \ENDTHEOREM +\THEOREM REAL\_MUL REAL +|- !m n. (& m) * (& n) = &(m num_mul n) +\ENDTHEOREM \THEOREM REAL\_MUL\_LID REAL |- !x. (& 1) * x = x \ENDTHEOREM @@ -1331,21 +1325,18 @@ \THEOREM REAL\_MUL\_SYM REAL |- !x y. x * y = y * x \ENDTHEOREM -\THEOREM REAL\_NEGNEG REAL -|- !x. --(-- x) = x -\ENDTHEOREM \THEOREM REAL\_NEG\_0 REAL |- --(& 0) = & 0 \ENDTHEOREM \THEOREM REAL\_NEG\_ADD REAL |- !x y. --(x + y) = (-- x) + (-- y) \ENDTHEOREM -\THEOREM REAL\_NEG\_EQ REAL -|- !x y. (-- x = y) = (x = -- y) -\ENDTHEOREM \THEOREM REAL\_NEG\_EQ0 REAL |- !x. (-- x = & 0) = (x = & 0) \ENDTHEOREM +\THEOREM REAL\_NEG\_EQ REAL +|- !x y. (-- x = y) = (x = -- y) +\ENDTHEOREM \THEOREM REAL\_NEG\_GE0 REAL |- !x. (& 0) <= (-- x) = x <= (& 0) \ENDTHEOREM @@ -1370,6 +1361,9 @@ \THEOREM REAL\_NEG\_MUL2 REAL |- !x y. (-- x) * (-- y) = x * y \ENDTHEOREM +\THEOREM REAL\_NEGNEG REAL +|- !x. --(-- x) = x +\ENDTHEOREM \THEOREM REAL\_NEG\_RMUL REAL |- !x y. --(x * y) = x * (-- y) \ENDTHEOREM @@ -1412,20 +1406,20 @@ \THEOREM REAL\_RNEG\_UNIQ REAL |- !x y. (x + y = & 0) = (y = -- x) \ENDTHEOREM -\THEOREM real\_sub REAL -|- !x y. x - y = x + (-- y) -\ENDTHEOREM \THEOREM REAL\_SUB\_0 REAL |- !x y. (x - y = & 0) = (x = y) \ENDTHEOREM \THEOREM REAL\_SUB\_ABS REAL |- !x y. ((abs x) - (abs y)) <= (abs(x - y)) \ENDTHEOREM +\THEOREM REAL\_SUB\_ADD2 REAL +|- !x y. y + (x - y) = x +\ENDTHEOREM \THEOREM REAL\_SUB\_ADD REAL |- !x y. (x - y) + y = x \ENDTHEOREM -\THEOREM REAL\_SUB\_ADD2 REAL -|- !x y. y + (x - y) = x +\THEOREM real\_sub REAL +|- !x y. x - y = x + (-- y) \ENDTHEOREM \THEOREM REAL\_SUB\_INV2 REAL |- !x y. @@ -1461,28 +1455,28 @@ \THEOREM REAL\_SUB\_RZERO REAL |- !x. x - (& 0) = x \ENDTHEOREM -\THEOREM REAL\_SUB\_SUB REAL -|- !x y. (x - y) - x = -- y -\ENDTHEOREM \THEOREM REAL\_SUB\_SUB2 REAL |- !x y. x - (x - y) = y \ENDTHEOREM +\THEOREM REAL\_SUB\_SUB REAL +|- !x y. (x - y) - x = -- y +\ENDTHEOREM \THEOREM REAL\_SUB\_TRIANGLE REAL |- !a b c. (a - b) + (b - c) = a - c \ENDTHEOREM \THEOREM REAL\_SUMSQ REAL |- !x y. ((x * x) + (y * y) = & 0) = (x = & 0) /\ (y = & 0) \ENDTHEOREM -\THEOREM REAL\_SUP REAL -|- !P. - (?x. P x) /\ (?z. !x. P x ==> x < z) ==> - (!y. (?x. P x /\ y < x) = y < (sup P)) -\ENDTHEOREM \THEOREM REAL\_SUP\_ALLPOS REAL |- !P. (!x. P x ==> (& 0) < x) /\ (?x. P x) /\ (?z. !x. P x ==> x < z) ==> (?s. !y. (?x. P x /\ y < x) = y < s) \ENDTHEOREM +\THEOREM REAL\_SUP REAL +|- !P. + (?x. P x) /\ (?z. !x. P x ==> x < z) ==> + (!y. (?x. P x /\ y < x) = y < (sup P)) +\ENDTHEOREM \THEOREM REAL\_SUP\_EXISTS REAL |- !P. (?x. P x) /\ (?z. !x. P x ==> x < z) ==> @@ -1511,13 +1505,6 @@ (?x. P x) /\ (?z. !x. P x ==> x <= z) = (?x. P x) /\ (?z. !x. P x ==> x < z) \ENDTHEOREM -\THEOREM Sum REAL -|- (Sum(n,0)f = & 0) /\ (Sum(n,SUC m)f = (Sum(n,m)f) + (f(n num_add m))) -\ENDTHEOREM -\THEOREM sum REAL -|- (!n f. sum n 0 f = & 0) /\ - (!n m f. sum n(SUC m)f = (sum n m f) + (f(n num_add m))) -\ENDTHEOREM \THEOREM SUM\_0 REAL |- !m n. Sum(m,n)(\r. & 0) = & 0 \ENDTHEOREM @@ -1550,6 +1537,13 @@ \THEOREM SUM\_DIFF REAL |- !f m n. Sum(m,n)f = (Sum(0,m num_add n)f) - (Sum(0,m)f) \ENDTHEOREM +\THEOREM sum REAL +|- (!n f. sum n 0 f = & 0) /\ + (!n m f. sum n(SUC m)f = (sum n m f) + (f(n num_add m))) +\ENDTHEOREM +\THEOREM Sum REAL +|- (Sum(n,0)f = & 0) /\ (Sum(n,SUC m)f = (Sum(n,m)f) + (f(n num_add m))) +\ENDTHEOREM \THEOREM SUM\_EQ REAL |- !N. (!n. N num_le n ==> (f n = g n)) ==> (!n. Sum(N,n)f = Sum(N,n)g) \ENDTHEOREM @@ -1615,8 +1609,7 @@ \THEOREM SUP\_LEMMA3 REAL |- !d. (?z. !x. P x ==> x < z) ==> (?z. !x. (\x. P(x + d))x ==> x < z) \ENDTHEOREM -\section{TOPOLOGY} -\THEOREM ball TOPOLOGY +\section{TOPOLOGY}\THEOREM ball TOPOLOGY |- !m x e. B m(x,e) = (\y. (dist m(x,y)) < e) \ENDTHEOREM \THEOREM BALL\_NEIGH TOPOLOGY @@ -1689,9 +1682,6 @@ \THEOREM METRIC\_ZERO TOPOLOGY |- !m x y. (dist m(x,y) = & 0) = (x = y) \ENDTHEOREM -\THEOREM mr1 TOPOLOGY -|- mr1 = metric(\(x,y). abs(y - x)) -\ENDTHEOREM \THEOREM MR1\_ADD TOPOLOGY |- !x d. dist mr1(x,x + d) = abs d \ENDTHEOREM @@ -1707,6 +1697,9 @@ \THEOREM MR1\_DEF TOPOLOGY |- !x y. dist mr1(x,y) = abs(y - x) \ENDTHEOREM +\THEOREM mr1 TOPOLOGY +|- mr1 = metric(\(x,y). abs(y - x)) +\ENDTHEOREM \THEOREM MR1\_LIMPT TOPOLOGY |- !x. limpt(mtop mr1)x universe \ENDTHEOREM @@ -1759,12 +1752,12 @@ \THEOREM OPEN\_UNOPEN TOPOLOGY |- !S top. open top S = (Union(\P. open top P /\ P subset S) = S) \ENDTHEOREM -\THEOREM subset TOPOLOGY -|- !P Q. P subset Q = (!x. P x ==> Q x) -\ENDTHEOREM \THEOREM SUBSET\_ANTISYM TOPOLOGY |- !P Q. P subset Q /\ Q subset P = (P = Q) \ENDTHEOREM +\THEOREM subset TOPOLOGY +|- !P Q. P subset Q = (!x. P x ==> Q x) +\ENDTHEOREM \THEOREM SUBSET\_REFL TOPOLOGY |- !S. S subset S \ENDTHEOREM @@ -1788,17 +1781,16 @@ \THEOREM TOPOLOGY\_UNION TOPOLOGY |- !L P. P subset (open L) ==> open L(Union P) \ENDTHEOREM -\THEOREM Union TOPOLOGY -|- !S. Union S = (\x. ?s. S s /\ s x) -\ENDTHEOREM \THEOREM union\_def TOPOLOGY |- !P Q. P union Q = (\x. P x \/ Q x) \ENDTHEOREM +\THEOREM Union TOPOLOGY +|- !S. Union S = (\x. ?s. S s /\ s x) +\ENDTHEOREM \THEOREM universe TOPOLOGY |- universe = (\x. T) \ENDTHEOREM -\section{NETS} -\THEOREM bounded NETS +\section{NETS}\THEOREM bounded NETS |- !m g f. bounded(m,g)f = (?k x N. g N N /\ (!n. g n N ==> (dist m(f n,x)) real_lt k)) @@ -1823,7 +1815,7 @@ \THEOREM DORDER\_TENDSTO NETS |- !m x. dorder(tendsto(m,x)) \ENDTHEOREM -\THEOREM LIM\_TENDS NETS +\THEOREM LIM\_TENDS2 NETS |- !m1 m2 f x0 y0. limpt(mtop m1)x0 universe ==> ((f tends y0)(mtop m2,tendsto(m1,x0)) = @@ -1833,10 +1825,10 @@ (real_of_num 0) real_lt d /\ (!x. (real_of_num 0) real_lt (dist m1(x,x0)) /\ - (dist m1(x,x0)) real_le d ==> + (dist m1(x,x0)) real_lt d ==> (dist m2(f x,y0)) real_lt e)))) \ENDTHEOREM -\THEOREM LIM\_TENDS2 NETS +\THEOREM LIM\_TENDS NETS |- !m1 m2 f x0 y0. limpt(mtop m1)x0 universe ==> ((f tends y0)(mtop m2,tendsto(m1,x0)) = @@ -1846,7 +1838,7 @@ (real_of_num 0) real_lt d /\ (!x. (real_of_num 0) real_lt (dist m1(x,x0)) /\ - (dist m1(x,x0)) real_lt d ==> + (dist m1(x,x0)) real_le d ==> (dist m2(f x,y0)) real_lt e)))) \ENDTHEOREM \THEOREM MR1\_BOUNDED NETS @@ -1931,11 +1923,6 @@ (x tends x0)(mtop mr1,g) = ((\n. real_neg(x n)) tends (real_neg x0))(mtop mr1,g)) \ENDTHEOREM -\THEOREM NET\_NULL NETS -|- !g x x0. - (x tends x0)(mtop mr1,g) = - ((\n. (x n) real_sub x0) tends (real_of_num 0))(mtop mr1,g) -\ENDTHEOREM \THEOREM NET\_NULL\_ADD NETS |- !g. dorder g ==> @@ -1949,6 +1936,11 @@ (x tends (real_of_num 0))(mtop mr1,g) ==> ((\n. k real_mul (x n)) tends (real_of_num 0))(mtop mr1,g) \ENDTHEOREM +\THEOREM NET\_NULL NETS +|- !g x x0. + (x tends x0)(mtop mr1,g) = + ((\n. (x n) real_sub x0) tends (real_of_num 0))(mtop mr1,g) +\ENDTHEOREM \THEOREM NET\_NULL\_MUL NETS |- !g. dorder g ==> @@ -1981,8 +1973,7 @@ (real_of_num 0) real_lt (dist m(x,y)) /\ (dist m(x,y)) real_le (dist m(x,z)) \ENDTHEOREM -\section{LIM} -\THEOREM CHAIN\_LEMMA1 LIM +\section{LIM}\THEOREM CHAIN\_LEMMA1 LIM |- !f g x h. ((f(g(x + h))) - (f(g x))) / h = (((f(g(x + h))) - (f(g x))) / ((g(x + h)) - (g x))) * @@ -1991,27 +1982,21 @@ \THEOREM CHAIN\_LEMMA2 LIM |- !x y d. (abs(x - y)) < d ==> (abs x) < ((abs y) + d) \ENDTHEOREM -\THEOREM contl LIM -|- !f x. f contl x = ((\h. f(x + h)) --> (f x))(& 0) -\ENDTHEOREM -\THEOREM CONTL\_LIM LIM -|- !f x. f contl x = (f --> (f x))x -\ENDTHEOREM \THEOREM CONT\_ADD LIM |- !x. f contl x /\ g contl x ==> (\x. (f x) + (g x)) contl x \ENDTHEOREM -\THEOREM CONT\_ATTAINS LIM +\THEOREM CONT\_ATTAINS2 LIM |- !f a b. a <= b /\ (!x. a <= x /\ x <= b ==> f contl x) ==> (?M. - (!x. a <= x /\ x <= b ==> (f x) <= M) /\ + (!x. a <= x /\ x <= b ==> M <= (f x)) /\ (?x. a <= x /\ x <= b /\ (f x = M))) \ENDTHEOREM -\THEOREM CONT\_ATTAINS2 LIM +\THEOREM CONT\_ATTAINS LIM |- !f a b. a <= b /\ (!x. a <= x /\ x <= b ==> f contl x) ==> (?M. - (!x. a <= x /\ x <= b ==> M <= (f x)) /\ + (!x. a <= x /\ x <= b ==> (f x) <= M) /\ (?x. a <= x /\ x <= b /\ (f x = M))) \ENDTHEOREM \THEOREM CONT\_BOUNDED LIM @@ -2037,6 +2022,12 @@ \THEOREM CONT\_INV LIM |- !x. f contl x /\ ~(f x = & 0) ==> (\x. inv(f x)) contl x \ENDTHEOREM +\THEOREM contl LIM +|- !f x. f contl x = ((\h. f(x + h)) --> (f x))(& 0) +\ENDTHEOREM +\THEOREM CONTL\_LIM LIM +|- !f x. f contl x = (f --> (f x))x +\ENDTHEOREM \THEOREM CONT\_MUL LIM |- !x. f contl x /\ g contl x ==> (\x. (f x) * (g x)) contl x \ENDTHEOREM @@ -2046,12 +2037,6 @@ \THEOREM CONT\_SUB LIM |- !x. f contl x /\ g contl x ==> (\x. (f x) - (g x)) contl x \ENDTHEOREM -\THEOREM differentiable LIM -|- !f x. f differentiable x = (?l. (f diffl l)x) -\ENDTHEOREM -\THEOREM diffl LIM -|- !f l x. (f diffl l)x = ((\h. ((f(x + h)) - (f x)) / h) --> l)(& 0) -\ENDTHEOREM \THEOREM DIFF\_ADD LIM |- !f g l m x. (f diffl l)x /\ (g diffl m)x ==> @@ -2077,11 +2062,17 @@ (((l * (g x)) - (m * (f x))) / ((g x) pow 2))) x \ENDTHEOREM +\THEOREM differentiable LIM +|- !f x. f differentiable x = (?l. (f diffl l)x) +\ENDTHEOREM \THEOREM DIFF\_INV LIM |- !f l x. (f diffl l)x /\ ~(f x = & 0) ==> ((\x. inv(f x)) diffl (--(l / ((f x) pow 2))))x \ENDTHEOREM +\THEOREM DIFF\_ISCONST\_ALL LIM +|- !f. (!x. (f diffl (& 0))x) ==> (!x y. f x = f y) +\ENDTHEOREM \THEOREM DIFF\_ISCONST LIM |- !f a b. a < b /\ @@ -2089,9 +2080,6 @@ (!x. a < x /\ x < b ==> (f diffl (& 0))x) ==> (!x. a <= x /\ x <= b ==> (f x = f a)) \ENDTHEOREM -\THEOREM DIFF\_ISCONST\_ALL LIM -|- !f. (!x. (f diffl (& 0))x) ==> (!x y. f x = f y) -\ENDTHEOREM \THEOREM DIFF\_ISCONST\_END LIM |- !f a b. a < b /\ @@ -2110,6 +2098,9 @@ (f diffl l)x /\ l < (& 0) ==> (?d. (& 0) < d /\ (!h. (& 0) < h /\ h < d ==> (f x) < (f(x - h)))) \ENDTHEOREM +\THEOREM diffl LIM +|- !f l x. (f diffl l)x = ((\h. ((f(x + h)) - (f x)) / h) --> l)(& 0) +\ENDTHEOREM \THEOREM DIFF\_LINC LIM |- !f x l. (f diffl l)x /\ (& 0) < l ==> @@ -2164,27 +2155,20 @@ a < x /\ x < b ==> (?d. (& 0) < d /\ (!y. (abs(x - y)) < d ==> a <= y /\ y <= b)) \ENDTHEOREM -\THEOREM IVT LIM +\THEOREM IVT2 LIM |- !f a b y. a <= b /\ - ((f a) <= y /\ y <= (f b)) /\ + ((f b) <= y /\ y <= (f a)) /\ (!x. a <= x /\ x <= b ==> f contl x) ==> (?x. a <= x /\ x <= b /\ (f x = y)) \ENDTHEOREM -\THEOREM IVT2 LIM +\THEOREM IVT LIM |- !f a b y. a <= b /\ - ((f b) <= y /\ y <= (f a)) /\ + ((f a) <= y /\ y <= (f b)) /\ (!x. a <= x /\ x <= b ==> f contl x) ==> (?x. a <= x /\ x <= b /\ (f x = y)) \ENDTHEOREM -\THEOREM IVT\_SUPLEMMA LIM -|- a <= b /\ - ((f a) <= y /\ y <= (f b)) /\ - (!x. a <= x /\ x <= b ==> f contl x) ==> - (?x. (\x. a <= x /\ x <= b /\ (f x) <= y)x) /\ - (?z. !x. (\x. a <= x /\ x <= b /\ (f x) <= y)x ==> x <= z) -\ENDTHEOREM \THEOREM IVT\_SUPLEMMA2 LIM |- a <= b /\ ((f a) <= y /\ y <= (f b)) /\ @@ -2192,16 +2176,12 @@ a <= (sup(\x. a <= x /\ x <= b /\ (f x) <= y)) /\ (sup(\x. a <= x /\ x <= b /\ (f x) <= y)) <= b \ENDTHEOREM -\THEOREM LIM LIM -|- !f y0 x0. - (f --> y0)x0 = - (!e. - (& 0) < e ==> - (?d. - (& 0) < d /\ - (!x. - (& 0) < (abs(x - x0)) /\ (abs(x - x0)) < d ==> - (abs((f x) - y0)) < e))) +\THEOREM IVT\_SUPLEMMA LIM +|- a <= b /\ + ((f a) <= y /\ y <= (f b)) /\ + (!x. a <= x /\ x <= b ==> f contl x) ==> + (?x. (\x. a <= x /\ x <= b /\ (f x) <= y)x) /\ + (?z. !x. (\x. a <= x /\ x <= b /\ (f x) <= y)x ==> x <= z) \ENDTHEOREM \THEOREM LIM\_ADD LIM |- !f g l m. @@ -2221,6 +2201,17 @@ (f --> l)x /\ (g --> m)x /\ ~(m = & 0) ==> ((\x. (f x) / (g x)) --> (l / m))x \ENDTHEOREM +\THEOREM LIM LIM +|- !f y0 x0. + (f --> y0)x0 = + (!e. + (& 0) < e ==> + (?d. + (& 0) < d /\ + (!x. + (& 0) < (abs(x - x0)) /\ (abs(x - x0)) < d ==> + (abs((f x) - y0)) < e))) +\ENDTHEOREM \THEOREM LIM\_EQUAL LIM |- !f g l x0. (!x. ~(x = x0) ==> (f x = g x)) ==> ((f --> l)x0 = (g --> l)x0) @@ -2289,8 +2280,7 @@ \THEOREM tends\_real\_real LIM |- !f l x0. (f --> l)x0 = (f tends l)(mtop mr1,tendsto(mr1,x0)) \ENDTHEOREM -\section{SEQ} -\THEOREM ABS\_NEG\_LEMMA SEQ +\section{SEQ}\THEOREM ABS\_NEG\_LEMMA SEQ |- !c. c <= (& 0) ==> (!x y. (abs x) <= (c * (abs y)) ==> (x = & 0)) \ENDTHEOREM \THEOREM cauchy SEQ @@ -2326,11 +2316,6 @@ \THEOREM MONO\_SUC SEQ |- !f. mono f = (!n. (f(SUC n)) >= (f n)) \/ (!n. (f(SUC n)) <= (f n)) \ENDTHEOREM -\THEOREM SEQ SEQ -|- !x x0. - x --> x0 = - (!e. (& 0) < e ==> (?N. !n. n num_ge N ==> (abs((x n) - x0)) < e)) -\ENDTHEOREM \THEOREM SEQ\_ABS SEQ |- !f. (\n. abs(f n)) --> (& 0) = f --> (& 0) \ENDTHEOREM @@ -2364,18 +2349,23 @@ x --> x0 /\ y --> y0 /\ ~(y0 = & 0) ==> (\n. (x n) / (y n)) --> (x0 / y0) \ENDTHEOREM +\THEOREM SEQ SEQ +|- !x x0. + x --> x0 = + (!e. (& 0) < e ==> (?N. !n. n num_ge N ==> (abs((x n) - x0)) < e)) +\ENDTHEOREM \THEOREM SEQ\_ICONV SEQ |- !f. bounded(mr1,$num_ge)f /\ (!m n. m num_ge n ==> (f m) >= (f n)) ==> convergent f \ENDTHEOREM -\THEOREM SEQ\_INV SEQ -|- !x x0. x --> x0 /\ ~(x0 = & 0) ==> (\n. inv(x n)) --> (inv x0) -\ENDTHEOREM \THEOREM SEQ\_INV0 SEQ |- !f. (!y. ?N. !n. n num_ge N ==> (f n) > y) ==> (\n. inv(f n)) --> (& 0) \ENDTHEOREM +\THEOREM SEQ\_INV SEQ +|- !x x0. x --> x0 /\ ~(x0 = & 0) ==> (\n. inv(x n)) --> (inv x0) +\ENDTHEOREM \THEOREM SEQ\_LE SEQ |- !f g l m. f --> l /\ g --> m /\ (?N. !n. n num_ge N ==> (f n) <= (g n)) ==> @@ -2391,21 +2381,21 @@ |- !x x0 y y0. x --> x0 /\ y --> y0 ==> (\n. (x n) * (y n)) --> (x0 * y0) \ENDTHEOREM -\THEOREM SEQ\_NEG SEQ -|- !x x0. x --> x0 = (\n. --(x n)) --> (-- x0) -\ENDTHEOREM \THEOREM SEQ\_NEG\_BOUNDED SEQ |- !f. bounded(mr1,$num_ge)(\n. --(f n)) = bounded(mr1,$num_ge)f \ENDTHEOREM \THEOREM SEQ\_NEG\_CONV SEQ |- !f. convergent f = convergent(\n. --(f n)) \ENDTHEOREM -\THEOREM SEQ\_POWER SEQ -|- !c. (abs c) < (& 1) ==> (\n. c pow n) --> (& 0) +\THEOREM SEQ\_NEG SEQ +|- !x x0. x --> x0 = (\n. --(x n)) --> (-- x0) \ENDTHEOREM \THEOREM SEQ\_POWER\_ABS SEQ |- !c. (abs c) < (& 1) ==> (\n. (abs c) pow n) --> (& 0) \ENDTHEOREM +\THEOREM SEQ\_POWER SEQ +|- !c. (abs c) < (& 1) ==> (\n. c pow n) --> (& 0) +\ENDTHEOREM \THEOREM SEQ\_SBOUNDED SEQ |- !s f. bounded(mr1,$num_ge)s ==> bounded(mr1,$num_ge)(\n. s(f n)) \ENDTHEOREM @@ -2447,31 +2437,31 @@ \THEOREM SER\_CMUL SEQ |- !x x0 c. x sums x0 ==> (\n. c * (x n)) sums (c * x0) \ENDTHEOREM -\THEOREM SER\_COMPAR SEQ +\THEOREM SER\_COMPARA SEQ |- !f g. (?N. !n. n num_ge N ==> (abs(f n)) <= (g n)) /\ summable g ==> - summable f + summable(\k. abs(f k)) \ENDTHEOREM -\THEOREM SER\_COMPARA SEQ +\THEOREM SER\_COMPAR SEQ |- !f g. (?N. !n. n num_ge N ==> (abs(f n)) <= (g n)) /\ summable g ==> - summable(\k. abs(f k)) + summable f \ENDTHEOREM \THEOREM SER\_GROUP SEQ |- !f k. summable f /\ 0 num_lt k ==> (\n. Sum(n num_mul k,k)f) sums (suminf f) \ENDTHEOREM -\THEOREM SER\_LE SEQ -|- !f g. - (!n. (f n) <= (g n)) /\ summable f /\ summable g ==> - (suminf f) <= (suminf g) -\ENDTHEOREM \THEOREM SER\_LE2 SEQ |- !f g. (!n. (abs(f n)) <= (g n)) /\ summable g ==> summable f /\ (suminf f) <= (suminf g) \ENDTHEOREM +\THEOREM SER\_LE SEQ +|- !f g. + (!n. (f n) <= (g n)) /\ summable f /\ summable g ==> + (suminf f) <= (suminf g) +\ENDTHEOREM \THEOREM SER\_NEG SEQ |- !x x0. x sums x0 ==> (\n. --(x n)) sums (-- x0) \ENDTHEOREM @@ -2542,8 +2532,7 @@ \THEOREM tends\_num\_real SEQ |- !x x0. x --> x0 = (x tends x0)(mtop mr1,$num_ge) \ENDTHEOREM -\section{POWSER} -\THEOREM diffs POWSER +\section{POWSER}\THEOREM diffs POWSER |- !c. diffs c = (\n. (&(SUC n)) * (c(SUC n))) \ENDTHEOREM \THEOREM DIFFS\_EQUIV POWSER @@ -2552,18 +2541,18 @@ (\n. (& n) * ((c n) * (x pow (n num_sub 1)))) sums (suminf(\n. (diffs c n) * (x pow n))) \ENDTHEOREM -\THEOREM DIFFS\_LEMMA POWSER -|- !n c x. - Sum(0,n)(\n'. (diffs c n') * (x pow n')) = - (Sum(0,n)(\n'. (& n') * ((c n') * (x pow (n' num_sub 1))))) + - ((& n) * ((c n) * (x pow (n num_sub 1)))) -\ENDTHEOREM \THEOREM DIFFS\_LEMMA2 POWSER |- !n c x. Sum(0,n)(\n. (& n) * ((c n) * (x pow (n num_sub 1)))) = (Sum(0,n)(\n. (diffs c n) * (x pow n))) - ((& n) * ((c n) * (x pow (n num_sub 1)))) \ENDTHEOREM +\THEOREM DIFFS\_LEMMA POWSER +|- !n c x. + Sum(0,n)(\n'. (diffs c n') * (x pow n')) = + (Sum(0,n)(\n'. (& n') * ((c n') * (x pow (n' num_sub 1))))) + + ((& n) * ((c n) * (x pow (n num_sub 1)))) +\ENDTHEOREM \THEOREM DIFFS\_NEG POWSER |- !c. diffs(\n. --(c n)) = (\n. --(diffs c n)) \ENDTHEOREM @@ -2582,15 +2571,15 @@ Sum(0,SUC n)(\p. (x pow p) * (y pow (n num_sub p))) = Sum(0,SUC n)(\p. (x pow (n num_sub p)) * (y pow p)) \ENDTHEOREM -\THEOREM POWSER\_INSIDE POWSER +\THEOREM POWSER\_INSIDEA POWSER |- !f x z. summable(\n. (f n) * (x pow n)) /\ (abs z) < (abs x) ==> - summable(\n. (f n) * (z pow n)) + summable(\n. (abs(f n)) * (z pow n)) \ENDTHEOREM -\THEOREM POWSER\_INSIDEA POWSER +\THEOREM POWSER\_INSIDE POWSER |- !f x z. summable(\n. (f n) * (x pow n)) /\ (abs z) < (abs x) ==> - summable(\n. (abs(f n)) * (z pow n)) + summable(\n. (f n) * (z pow n)) \ENDTHEOREM \THEOREM TERMDIFF POWSER |- !c K. @@ -2649,69 +2638,58 @@ (!n. (abs(g h n)) <= ((f n) * (abs h)))) ==> ((\h. suminf(g h)) tends_real_real (& 0))(& 0) \ENDTHEOREM -\section{TRANSC} -\THEOREM ACS TRANSC +\section{TRANSC}\THEOREM ACS\_BOUNDS TRANSC |- !y. - (--(& 1)) <= y /\ y <= (& 1) ==> - (& 0) <= (acs y) /\ (acs y) <= pi /\ (cos(acs y) = y) + (--(& 1)) <= y /\ y <= (& 1) ==> (& 0) <= (acs y) /\ (acs y) <= pi +\ENDTHEOREM +\THEOREM ACS\_COS TRANSC +|- !y. (--(& 1)) <= y /\ y <= (& 1) ==> (cos(acs y) = y) \ENDTHEOREM \THEOREM acs TRANSC |- !y. acs y = (@x. (& 0) <= x /\ x <= pi /\ (cos x = y)) \ENDTHEOREM -\THEOREM ACS\_BOUNDS TRANSC +\THEOREM ACS TRANSC |- !y. - (--(& 1)) <= y /\ y <= (& 1) ==> (& 0) <= (acs y) /\ (acs y) <= pi -\ENDTHEOREM -\THEOREM ACS\_COS TRANSC -|- !y. (--(& 1)) <= y /\ y <= (& 1) ==> (cos(acs y) = y) + (--(& 1)) <= y /\ y <= (& 1) ==> + (& 0) <= (acs y) /\ (acs y) <= pi /\ (cos(acs y) = y) \ENDTHEOREM -\THEOREM ASN TRANSC +\THEOREM ASN\_BOUNDS TRANSC |- !y. (--(& 1)) <= y /\ y <= (& 1) ==> - (--(pi / (& 2))) <= (asn y) /\ - (asn y) <= (pi / (& 2)) /\ - (sin(asn y) = y) + (--(pi / (& 2))) <= (asn y) /\ (asn y) <= (pi / (& 2)) \ENDTHEOREM \THEOREM asn TRANSC |- !y. asn y = (@x. (--(pi / (& 2))) <= x /\ x <= (pi / (& 2)) /\ (sin x = y)) \ENDTHEOREM -\THEOREM ASN\_BOUNDS TRANSC +\THEOREM ASN TRANSC |- !y. (--(& 1)) <= y /\ y <= (& 1) ==> - (--(pi / (& 2))) <= (asn y) /\ (asn y) <= (pi / (& 2)) + (--(pi / (& 2))) <= (asn y) /\ + (asn y) <= (pi / (& 2)) /\ + (sin(asn y) = y) \ENDTHEOREM \THEOREM ASN\_SIN TRANSC |- !y. (--(& 1)) <= y /\ y <= (& 1) ==> (sin(asn y) = y) \ENDTHEOREM -\THEOREM ATN TRANSC -|- !y. - (--(pi / (& 2))) < (atn y) /\ - (atn y) < (pi / (& 2)) /\ - (tan(atn y) = y) +\THEOREM ATN\_BOUNDS TRANSC +|- !y. (--(pi / (& 2))) < (atn y) /\ (atn y) < (pi / (& 2)) \ENDTHEOREM \THEOREM atn TRANSC |- !y. atn y = (@x. (--(pi / (& 2))) < x /\ x < (pi / (& 2)) /\ (tan x = y)) \ENDTHEOREM -\THEOREM ATN\_BOUNDS TRANSC -|- !y. (--(pi / (& 2))) < (atn y) /\ (atn y) < (pi / (& 2)) +\THEOREM ATN TRANSC +|- !y. + (--(pi / (& 2))) < (atn y) /\ + (atn y) < (pi / (& 2)) /\ + (tan(atn y) = y) \ENDTHEOREM \THEOREM ATN\_TAN TRANSC |- !y. tan(atn y) = y \ENDTHEOREM -\THEOREM cos TRANSC -|- !x. - cos x = - suminf - (\n. - ((\n'. - (EVEN n' => ((--(& 1)) pow (n' DIV 2)) / (&(FACT n')) | & 0)) - n) * - (x pow n)) -\ENDTHEOREM \THEOREM COS\_0 TRANSC |- cos(& 0) = & 1 \ENDTHEOREM @@ -2737,6 +2715,16 @@ (x pow n)) sums (cos x) \ENDTHEOREM +\THEOREM cos TRANSC +|- !x. + cos x = + suminf + (\n. + ((\n'. + (EVEN n' => ((--(& 1)) pow (n' DIV 2)) / (&(FACT n')) | & 0)) + n) * + (x pow n)) +\ENDTHEOREM \THEOREM COS\_DOUBLE TRANSC |- !x. cos((& 2) * x) = ((cos x) pow 2) - ((sin x) pow 2) \ENDTHEOREM @@ -2772,18 +2760,18 @@ \THEOREM COS\_PERIODIC\_PI TRANSC |- !x. cos(x + pi) = --(cos x) \ENDTHEOREM -\THEOREM COS\_PI TRANSC -|- cos pi = --(& 1) -\ENDTHEOREM \THEOREM COS\_PI2 TRANSC |- cos(pi / (& 2)) = & 0 \ENDTHEOREM -\THEOREM COS\_POS\_PI TRANSC -|- !x. (--(pi / (& 2))) < x /\ x < (pi / (& 2)) ==> (& 0) < (cos x) +\THEOREM COS\_PI TRANSC +|- cos pi = --(& 1) \ENDTHEOREM \THEOREM COS\_POS\_PI2 TRANSC |- !x. (& 0) < x /\ x < (pi / (& 2)) ==> (& 0) < (cos x) \ENDTHEOREM +\THEOREM COS\_POS\_PI TRANSC +|- !x. (--(pi / (& 2))) < x /\ x < (pi / (& 2)) ==> (& 0) < (cos x) +\ENDTHEOREM \THEOREM COS\_SIN TRANSC |- !x. cos x = sin((pi / (& 2)) - x) \ENDTHEOREM @@ -2815,9 +2803,6 @@ \THEOREM DIFF\_TAN TRANSC |- !x. ~(cos x = & 0) ==> (tan diffl (inv((cos x) pow 2)))x \ENDTHEOREM -\THEOREM exp TRANSC -|- !x. exp x = suminf(\n. ((\n'. inv(&(FACT n')))n) * (x pow n)) -\ENDTHEOREM \THEOREM EXP\_0 TRANSC |- exp(& 0) = & 1 \ENDTHEOREM @@ -2830,6 +2815,9 @@ \THEOREM EXP\_CONVERGES TRANSC |- !x. (\n. ((\n. inv(&(FACT n)))n) * (x pow n)) sums (exp x) \ENDTHEOREM +\THEOREM exp TRANSC +|- !x. exp x = suminf(\n. ((\n'. inv(&(FACT n')))n) * (x pow n)) +\ENDTHEOREM \THEOREM EXP\_FDIFF TRANSC |- diffs(\n. inv(&(FACT n))) = (\n. inv(&(FACT n))) \ENDTHEOREM @@ -2860,12 +2848,12 @@ \THEOREM EXP\_NEG TRANSC |- !x. exp(-- x) = inv(exp x) \ENDTHEOREM -\THEOREM EXP\_NEG\_MUL TRANSC -|- !x. (exp x) * (exp(-- x)) = & 1 -\ENDTHEOREM \THEOREM EXP\_NEG\_MUL2 TRANSC |- !x. (exp(-- x)) * (exp x) = & 1 \ENDTHEOREM +\THEOREM EXP\_NEG\_MUL TRANSC +|- !x. (exp x) * (exp(-- x)) = & 1 +\ENDTHEOREM \THEOREM EXP\_NZ TRANSC |- !x. ~(exp x = & 0) \ENDTHEOREM @@ -2885,15 +2873,15 @@ |- !y. (& 1) <= y ==> (?x. (& 0) <= x /\ x <= (y - (& 1)) /\ (exp x = y)) \ENDTHEOREM -\THEOREM ln TRANSC -|- !x. ln x = (@u. exp u = x) -\ENDTHEOREM \THEOREM LN\_1 TRANSC |- ln(& 1) = & 0 \ENDTHEOREM \THEOREM LN\_DIV TRANSC |- !x. (& 0) < x /\ (& 0) < y ==> (ln(x / y) = (ln x) - (ln y)) \ENDTHEOREM +\THEOREM ln TRANSC +|- !x. ln x = (@u. exp u = x) +\ENDTHEOREM \THEOREM LN\_EXP TRANSC |- !x. ln(exp x) = x \ENDTHEOREM @@ -2915,27 +2903,27 @@ \THEOREM LN\_POW TRANSC |- !n x. (& 0) < x ==> (ln(x pow n) = (& n) * (ln x)) \ENDTHEOREM -\THEOREM pi TRANSC -|- pi = (& 2) * (@x. (& 0) <= x /\ x <= (& 2) /\ (cos x = & 0)) +\THEOREM PI2\_BOUNDS TRANSC +|- (& 0) < (pi / (& 2)) /\ (pi / (& 2)) < (& 2) \ENDTHEOREM \THEOREM PI2 TRANSC |- pi / (& 2) = (@x. (& 0) <= x /\ x <= (& 2) /\ (cos x = & 0)) \ENDTHEOREM -\THEOREM PI2\_BOUNDS TRANSC -|- (& 0) < (pi / (& 2)) /\ (pi / (& 2)) < (& 2) +\THEOREM pi TRANSC +|- pi = (& 2) * (@x. (& 0) <= x /\ x <= (& 2) /\ (cos x = & 0)) \ENDTHEOREM \THEOREM PI\_POS TRANSC |- (& 0) < pi \ENDTHEOREM -\THEOREM root TRANSC -|- !n x. root n x = (@u. ((& 0) < x ==> (& 0) < u) /\ (u pow n = x)) -\ENDTHEOREM \THEOREM ROOT\_0 TRANSC |- !n. root(SUC n)(& 0) = & 0 \ENDTHEOREM \THEOREM ROOT\_1 TRANSC |- !n. root(SUC n)(& 1) = & 1 \ENDTHEOREM +\THEOREM root TRANSC +|- !n x. root n x = (@u. ((& 0) < x ==> (& 0) < u) /\ (u pow n = x)) +\ENDTHEOREM \THEOREM ROOT\_LN TRANSC |- !n x. (& 0) < x ==> (!n. root(SUC n)x = exp((ln x) / (&(SUC n)))) \ENDTHEOREM @@ -2945,18 +2933,6 @@ \THEOREM ROOT\_POW\_POS TRANSC |- !n x. (& 0) <= x ==> ((root(SUC n)x) pow (SUC n) = x) \ENDTHEOREM -\THEOREM sin TRANSC -|- !x. - sin x = - suminf - (\n. - ((\n'. - (EVEN n' => - & 0 | - ((--(& 1)) pow ((n' num_sub 1) DIV 2)) / (&(FACT n')))) - n) * - (x pow n)) -\ENDTHEOREM \THEOREM SIN\_0 TRANSC |- sin(& 0) = & 0 \ENDTHEOREM @@ -2986,20 +2962,32 @@ (x pow n)) sums (sin x) \ENDTHEOREM -\THEOREM SIN\_COS TRANSC -|- !x. sin x = cos((pi / (& 2)) - x) -\ENDTHEOREM \THEOREM SIN\_COS\_ADD TRANSC |- !x y. (((sin(x + y)) - (((sin x) * (cos y)) + ((cos x) * (sin y)))) pow 2) + (((cos(x + y)) - (((cos x) * (cos y)) - ((sin x) * (sin y)))) pow 2) = & 0 \ENDTHEOREM +\THEOREM SIN\_COS TRANSC +|- !x. sin x = cos((pi / (& 2)) - x) +\ENDTHEOREM \THEOREM SIN\_COS\_NEG TRANSC |- !x. (((sin(-- x)) + (sin x)) pow 2) + (((cos(-- x)) - (cos x)) pow 2) = & 0 \ENDTHEOREM +\THEOREM sin TRANSC +|- !x. + sin x = + suminf + (\n. + ((\n'. + (EVEN n' => + & 0 | + ((--(& 1)) pow ((n' num_sub 1) DIV 2)) / (&(FACT n')))) + n) * + (x pow n)) +\ENDTHEOREM \THEOREM SIN\_DOUBLE TRANSC |- !x. sin((& 2) * x) = (& 2) * ((sin x) * (cos x)) \ENDTHEOREM @@ -3043,21 +3031,21 @@ \THEOREM SIN\_PERIODIC\_PI TRANSC |- !x. sin(x + pi) = --(sin x) \ENDTHEOREM -\THEOREM SIN\_PI TRANSC -|- sin pi = & 0 -\ENDTHEOREM \THEOREM SIN\_PI2 TRANSC |- sin(pi / (& 2)) = & 1 \ENDTHEOREM +\THEOREM SIN\_PI TRANSC +|- sin pi = & 0 +\ENDTHEOREM \THEOREM SIN\_POS TRANSC |- !x. (& 0) < x /\ x < (& 2) ==> (& 0) < (sin x) \ENDTHEOREM -\THEOREM SIN\_POS\_PI TRANSC -|- !x. (& 0) < x /\ x < pi ==> (& 0) < (sin x) -\ENDTHEOREM \THEOREM SIN\_POS\_PI2 TRANSC |- !x. (& 0) < x /\ x < (pi / (& 2)) ==> (& 0) < (sin x) \ENDTHEOREM +\THEOREM SIN\_POS\_PI TRANSC +|- !x. (& 0) < x /\ x < pi ==> (& 0) < (sin x) +\ENDTHEOREM \THEOREM SIN\_TOTAL TRANSC |- !y. (--(& 1)) <= y /\ y <= (& 1) ==> @@ -3074,21 +3062,18 @@ (& 0) <= x /\ (sin x = & 0) ==> (?n. EVEN n /\ (x = (& n) * (pi / (& 2)))) \ENDTHEOREM -\THEOREM sqrt TRANSC -|- !x. sqrt x = root 2 x -\ENDTHEOREM \THEOREM SQRT\_0 TRANSC |- sqrt(& 0) = & 0 \ENDTHEOREM \THEOREM SQRT\_1 TRANSC |- sqrt(& 1) = & 1 \ENDTHEOREM +\THEOREM sqrt TRANSC +|- !x. sqrt x = root 2 x +\ENDTHEOREM \THEOREM SQRT\_POW2 TRANSC |- !x. ((sqrt x) pow 2 = x) = (& 0) <= x \ENDTHEOREM -\THEOREM tan TRANSC -|- !x. tan x = (sin x) / (cos x) -\ENDTHEOREM \THEOREM TAN\_0 TRANSC |- tan(& 0) = & 0 \ENDTHEOREM @@ -3100,6 +3085,9 @@ \THEOREM TAN\_ATN TRANSC |- !x. (--(pi / (& 2))) < x /\ x < (pi / (& 2)) ==> (atn(tan x) = x) \ENDTHEOREM +\THEOREM tan TRANSC +|- !x. tan x = (sin x) / (cos x) +\ENDTHEOREM \THEOREM TAN\_DOUBLE TRANSC |- !x. ~(cos x = & 0) /\ ~(cos((& 2) * x) = & 0) ==> --- hol88-2.02.19940316.orig/Library/parser/Manual/entries.tex +++ hol88-2.02.19940316/Library/parser/Manual/entries.tex @@ -1,6 +1,4 @@ -\chapter{ML Functions in the parser Library} -\input{entries-intro} -\DOC{parse} +\chapter{ML Functions in the parser Library}\input{entries-intro}\DOC{parse} \TYPE {\small\verb%parse : (* -> void)%}\egroup --- hol88-2.02.19940316.orig/Library/parser/Manual/theorems.tex +++ hol88-2.02.19940316/Library/parser/Manual/theorems.tex @@ -1 +1 @@ -\chapter{Pre-proved Theorems} +\chapter{Pre-proved Theorems} \ No newline at end of file --- hol88-2.02.19940316.orig/Library/unwind/Manual/entries.tex +++ hol88-2.02.19940316/Library/unwind/Manual/entries.tex @@ -1,6 +1,4 @@ -\chapter{ML Functions in the unwind Library} -\input{entries-intro} -\DOC{CONJ\_FORALL\_CONV} +\chapter{ML Functions in the unwind Library}\input{entries-intro}\DOC{CONJ\_FORALL\_CONV} \TYPE {\small\verb%CONJ_FORALL_CONV : conv%}\egroup --- hol88-2.02.19940316.orig/Library/string/Manual/entries.tex +++ hol88-2.02.19940316/Library/string/Manual/entries.tex @@ -1,6 +1,4 @@ -\chapter{ML Functions in the string Library} -\input{entries-intro} -\DOC{ascii\_EQ\_CONV} +\chapter{ML Functions in the string Library}\input{entries-intro}\DOC{ascii\_EQ\_CONV} \TYPE {\small\verb%ascii_EQ_CONV : conv%}\egroup --- hol88-2.02.19940316.orig/Library/string/Manual/theorems.tex +++ hol88-2.02.19940316/Library/string/Manual/theorems.tex @@ -1,7 +1,4 @@ -\chapter{Pre-proved Theorems} -\input{theorems-intro} -\section{Definitions} -\THEOREM ASCII\_DEF ascii +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{Definitions}\THEOREM ASCII\_DEF ascii |- !b0 b1 b2 b3 b4 b5 b6 b7. ASCII b0 b1 b2 b3 b4 b5 b6 b7 = ABS_ascii(Node(b0,b1,b2,b3,b4,b5,b6,b7)[]) @@ -25,6 +22,9 @@ (LENGTH tl = 0))) rep \ENDTHEOREM +\THEOREM ``\_DEF string +|- `` = ABS_string(Node(INL one)[])) +\ENDTHEOREM \THEOREM STRING\_DEF string |- !a s. STRING a s = ABS_string(Node(INR a)[REP_string s]) \ENDTHEOREM @@ -47,11 +47,7 @@ (?a. v = INR a) /\ (LENGTH tl = SUC 0))) rep \ENDTHEOREM -\THEOREM ``\_DEF string -|- `` = ABS_string(Node(INL one)[])) -\ENDTHEOREM -\section{Theorems} -\THEOREM ASCII\_11 ascii +\section{Theorems}\THEOREM ASCII\_11 ascii |- !b0 b1 b2 b3 b4 b5 b6 b7 b0' b1' b2' b3' b4' b5' b6' b7'. (ASCII b0 b1 b2 b3 b4 b5 b6 b7 = ASCII b0' b1' b2' b3' b4' b5' b6' b7') = --- hol88-2.02.19940316.orig/Library/wellorder/Manual/theorems.tex +++ hol88-2.02.19940316/Library/wellorder/Manual/theorems.tex @@ -1,7 +1,4 @@ -\chapter{Pre-proved Theorems} -\input{theorems-intro} -\section{Basic definitions} -\THEOREM wo\_chain WELLORDER +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{Basic definitions}\THEOREM wo\_chain WELLORDER |- !l P. chain l P = (!x y. P x /\ P y ==> l(x,y) \/ l(y,x)) \ENDTHEOREM \THEOREM wo\_fl WELLORDER @@ -41,8 +38,7 @@ (!x. P x ==> fl l x) /\ (?x. P x) ==> (?y. P y /\ (!z. P z ==> l(y,z)))) \ENDTHEOREM -\section{Miscellaneous lemmas} -\THEOREM AGREE\_LEMMA WELLORDER +\section{Miscellaneous lemmas}\THEOREM AGREE\_LEMMA WELLORDER |- !l h ms m n f g z. woset l /\ (!x. fl l(ms x)) /\ @@ -152,44 +148,6 @@ \THEOREM UNION\_INSEG WELLORDER |- !P l. (!m. P m ==> m inseg l) ==> (Union P) inseg l \ENDTHEOREM -\THEOREM WOSET WELLORDER -|- !l. - woset l = - (!x y. l(x,y) /\ l(y,x) ==> (x = y)) /\ - (!P. - (!x. P x ==> fl l x) /\ (?x. P x) ==> - (?y. P y /\ (!z. P z ==> l(y,z)))) -\ENDTHEOREM -\THEOREM WOSET\_FLEQ WELLORDER -|- !l. woset l ==> (!x. fl l x = l(x,x)) -\ENDTHEOREM -\THEOREM WOSET\_NUM WELLORDER -|- woset(\(m,n). m <= n) -\ENDTHEOREM -\THEOREM WOSET\_POSET WELLORDER -|- !l. woset l ==> poset l -\ENDTHEOREM -\THEOREM WOSET\_TOTAL\_LE WELLORDER -|- !l. woset l ==> (!x y. fl l x /\ fl l y ==> l(x,y) \/ less l(y,x)) -\ENDTHEOREM -\THEOREM WOSET\_TOTAL\_LT WELLORDER -|- !l. - woset l ==> - (!x y. fl l x /\ fl l y ==> (x = y) \/ less l(x,y) \/ less l(y,x)) -\ENDTHEOREM -\THEOREM WOSET\_TRANS\_LE WELLORDER -|- !l. woset l ==> (!x y z. l(x,y) /\ less l(y,z) ==> less l(x,z)) -\ENDTHEOREM -\THEOREM WOSET\_TRANS\_LESS WELLORDER -|- !l. woset l ==> (!x y z. less l(x,y) /\ l(y,z) ==> less l(x,z)) -\ENDTHEOREM -\THEOREM WOSET\_WELL\_CONTRAPOS WELLORDER -|- !l. - woset l ==> - (!P. - (!x. P x ==> fl l x) /\ (?x. P x) ==> - (?y. P y /\ (!z. less l(z,y) ==> ~P z))) -\ENDTHEOREM \THEOREM WO\_FL\_RESTRICT WELLORDER |- !l. woset l ==> @@ -233,8 +191,45 @@ (!y. (ms y) < (ms x) ==> (f y = g y)) ==> (h f x = h g x)) ==> (?! f. !x. f x = h f x) \ENDTHEOREM -\section{Main theorems} -\THEOREM HP WELLORDER +\THEOREM WOSET WELLORDER +|- !l. + woset l = + (!x y. l(x,y) /\ l(y,x) ==> (x = y)) /\ + (!P. + (!x. P x ==> fl l x) /\ (?x. P x) ==> + (?y. P y /\ (!z. P z ==> l(y,z)))) +\ENDTHEOREM +\THEOREM WOSET\_FLEQ WELLORDER +|- !l. woset l ==> (!x. fl l x = l(x,x)) +\ENDTHEOREM +\THEOREM WOSET\_NUM WELLORDER +|- woset(\(m,n). m <= n) +\ENDTHEOREM +\THEOREM WOSET\_POSET WELLORDER +|- !l. woset l ==> poset l +\ENDTHEOREM +\THEOREM WOSET\_TOTAL\_LE WELLORDER +|- !l. woset l ==> (!x y. fl l x /\ fl l y ==> l(x,y) \/ less l(y,x)) +\ENDTHEOREM +\THEOREM WOSET\_TOTAL\_LT WELLORDER +|- !l. + woset l ==> + (!x y. fl l x /\ fl l y ==> (x = y) \/ less l(x,y) \/ less l(y,x)) +\ENDTHEOREM +\THEOREM WOSET\_TRANS\_LE WELLORDER +|- !l. woset l ==> (!x y z. l(x,y) /\ less l(y,z) ==> less l(x,z)) +\ENDTHEOREM +\THEOREM WOSET\_TRANS\_LESS WELLORDER +|- !l. woset l ==> (!x y z. less l(x,y) /\ l(y,z) ==> less l(x,z)) +\ENDTHEOREM +\THEOREM WOSET\_WELL\_CONTRAPOS WELLORDER +|- !l. + woset l ==> + (!P. + (!x. P x ==> fl l x) /\ (?x. P x) ==> + (?y. P y /\ (!z. less l(z,y) ==> ~P z))) +\ENDTHEOREM +\section{Main theorems}\THEOREM HP WELLORDER |- !l. poset l ==> (?P. chain l P /\ (!Q. chain l Q /\ P subset Q ==> (Q = P))) --- hol88-2.02.19940316.orig/Library/record_proof/Manual/entries.tex +++ hol88-2.02.19940316/Library/record_proof/Manual/entries.tex @@ -1,3 +1 @@ -\chapter{ML Functions in the {\tt record\_proof} Library} -\label{entries} -\input{entries-intro} +\chapter{ML Functions in the {\tt record\_proof} Library}\label{entries}\input{entries-intro} \ No newline at end of file --- hol88-2.02.19940316.orig/Library/arith/Manual/entries.tex +++ hol88-2.02.19940316/Library/arith/Manual/entries.tex @@ -1,6 +1,4 @@ -\chapter{ML Functions in the arith Library} -\input{entries-intro} -\DOC{ARITH\_CONV} +\chapter{ML Functions in the arith Library}\input{entries-intro}\DOC{ARITH\_CONV} \TYPE {\small\verb%ARITH_CONV : conv%}\egroup --- hol88-2.02.19940316.orig/Library/taut/Manual/entries.tex +++ hol88-2.02.19940316/Library/taut/Manual/entries.tex @@ -1,6 +1,4 @@ -\chapter{ML Functions in the taut Library} -\input{entries-intro} -\DOC{PTAUT\_CONV} +\chapter{ML Functions in the taut Library}\input{entries-intro}\DOC{PTAUT\_CONV} \TYPE {\small\verb%PTAUT_CONV : conv%}\egroup --- hol88-2.02.19940316.orig/Library/prettyp/Manual/entries.tex +++ hol88-2.02.19940316/Library/prettyp/Manual/entries.tex @@ -1,6 +1,4 @@ -\chapter{ML Functions in the prettyp Library} -\input{entries-intro} -\DOC{Address} +\chapter{ML Functions in the prettyp Library}\input{entries-intro}\DOC{Address} \TYPE {\small\verb%Address : (int list -> address)%}\egroup @@ -831,57 +829,6 @@ Hidden_types, Useful_types, All_types, term_to_print_tree. \ENDDOC -\DOC{pp} - -{\small -\begin{verbatim} -pp : (print_rule_function -> string -> (string # int) list -> - print_tree -> void) -\end{verbatim} -}\egroup - -\SYNOPSIS -One of the main pretty-printing functions. For use with the standard HOL -pretty-printer. - -\DESCRIBE -{\small\verb%pp%} invokes the pretty-printer. It can be used for merging output with text -produced by the standard HOL pretty-printer. Instead of ending each line of -text by printing a new-line, it sends its output to the standard HOL printer -in the form of a pretty-printing block. The arguments to the function are: -(1) pretty-printing rules expressed as a function, (2) the initial context, -(3) initial parameters, (4) tree to be printed. {\small\verb%pp%} uses as its maximum width -the width for the standard HOL printer, as specified by the function -{\small\verb%set_margin%}. The initial offset from the left margin is taken to be zero. - -\FAILURE -Failure or incorrect behaviour can be caused by mistakes in the pretty-printing -rules or by inappropriate arguments to the printing function. The most common -errors are use of uninitialised parameters and reference to unknown -metavariables. The latter are due to metavariables appearing in the format of a -rule, but not in the pattern. Errors also occur if a metavariable is used in a -place inappropriate for the value it is bound to. An example of this is an -attempt to compare a string with a metavariable that is bound to a tree rather -than a node-name. - -Use of negative indentations in formats may cause text to overflow the left -margin, and an exception to be raised. Any user defined function may also -cause a run-time error. - -The printing functions have been designed to trap exceptions and to print -{\small\verb%*error*%}. This does not indicate what caused the error, but it may give some -indication of where the error occurred. However, this is not the main reason -for trapping exceptions. The ML directive {\small\verb%top_print%} installs a user print -function. If an exception is raised within this function, it does not appear -at the top-level of ML. Instead, an obscure Lisp error is produced. Since the -pretty-printing functions are normally used with {\small\verb%top_print%}, it is best to -avoid raising exceptions. For this reason the printing functions display -{\small\verb%*error*%} instead. - -\SEEALSO -pretty_print, pp_write. - -\ENDDOC \DOC{pp\_convert\_all\_thm} \TYPE {\small\verb%pp_convert_all_thm : (thm -> print_tree)%}\egroup @@ -991,6 +938,57 @@ type_to_print_tree, pp_convert_term, pp_convert_thm, pp_convert_all_thm. \ENDDOC +\DOC{pp} + +{\small +\begin{verbatim} +pp : (print_rule_function -> string -> (string # int) list -> + print_tree -> void) +\end{verbatim} +}\egroup + +\SYNOPSIS +One of the main pretty-printing functions. For use with the standard HOL +pretty-printer. + +\DESCRIBE +{\small\verb%pp%} invokes the pretty-printer. It can be used for merging output with text +produced by the standard HOL pretty-printer. Instead of ending each line of +text by printing a new-line, it sends its output to the standard HOL printer +in the form of a pretty-printing block. The arguments to the function are: +(1) pretty-printing rules expressed as a function, (2) the initial context, +(3) initial parameters, (4) tree to be printed. {\small\verb%pp%} uses as its maximum width +the width for the standard HOL printer, as specified by the function +{\small\verb%set_margin%}. The initial offset from the left margin is taken to be zero. + +\FAILURE +Failure or incorrect behaviour can be caused by mistakes in the pretty-printing +rules or by inappropriate arguments to the printing function. The most common +errors are use of uninitialised parameters and reference to unknown +metavariables. The latter are due to metavariables appearing in the format of a +rule, but not in the pattern. Errors also occur if a metavariable is used in a +place inappropriate for the value it is bound to. An example of this is an +attempt to compare a string with a metavariable that is bound to a tree rather +than a node-name. + +Use of negative indentations in formats may cause text to overflow the left +margin, and an exception to be raised. Any user defined function may also +cause a run-time error. + +The printing functions have been designed to trap exceptions and to print +{\small\verb%*error*%}. This does not indicate what caused the error, but it may give some +indication of where the error occurred. However, this is not the main reason +for trapping exceptions. The ML directive {\small\verb%top_print%} installs a user print +function. If an exception is raised within this function, it does not appear +at the top-level of ML. Instead, an obscure Lisp error is produced. Since the +pretty-printing functions are normally used with {\small\verb%top_print%}, it is best to +avoid raising exceptions. For this reason the printing functions display +{\small\verb%*error*%} instead. + +\SEEALSO +pretty_print, pp_write. + +\ENDDOC \DOC{pp\_print\_all\_thm} \TYPE {\small\verb%pp_print_all_thm : (thm -> void)%}\egroup --- hol88-2.02.19940316.orig/Library/finite_sets/Manual/entries.tex +++ hol88-2.02.19940316/Library/finite_sets/Manual/entries.tex @@ -1,7 +1,4 @@ -\chapter{ML Functions in the Library} -\label{entries} -\input{entries-intro} -\DOC{DELETE\_CONV} +\chapter{ML Functions in the Library}\label{entries}\input{entries-intro}\DOC{DELETE\_CONV} \TYPE {\small\verb%DELETE_CONV : conv -> conv%}\egroup @@ -171,6 +168,84 @@ \ENDDOC +\DOC{IN\_CONV} + +\TYPE {\small\verb%IN_CONV : conv -> conv%}\egroup + +\SYNOPSIS +Decision procedure for membership in finite sets. + +\DESCRIBE +The function {\small\verb%IN_CONV%} is a parameterized conversion for proving or disproving +membership assertions of the general form: +{\par\samepage\setseps\small +\begin{verbatim} + "t IN {t1,...,tn}" +\end{verbatim} +} +\noindent where {\small\verb%{t1,...,tn}%} is a set of type {\small\verb%(ty)set%} and {\small\verb%t%} is a value +of the base type {\small\verb%ty%}. The first argument to {\small\verb%IN_CONV%} is expected to be a +conversion that decides equality between values of the base type {\small\verb%ty%}. Given +an equation {\small\verb%"e1 = e2"%}, where {\small\verb%e1%} and {\small\verb%e2%} are terms of type {\small\verb%ty%}, this +conversion should return the theorem {\small\verb%|- (e1 = e2) = T%} or the theorem +{\small\verb%|- (e1 = e2) = F%}, as appropriate. + +Given such a conversion, the function {\small\verb%IN_CONV%} returns a conversion that +maps a term of the form {\small\verb%"t IN {t1,...,tn}"%} to the theorem +{\par\samepage\setseps\small +\begin{verbatim} + |- t IN {t1,...,tn} = T +\end{verbatim} +} + +\noindent if {\small\verb%t%} is alpha-equivalent to any {\small\verb%ti%}, or if the supplied conversion +proves {\small\verb%|- (t = ti) = T%} for any {\small\verb%ti%}. If the supplied conversion proves +{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}, then the result is the theorem +{\par\samepage\setseps\small +\begin{verbatim} + |- t IN {t1,...,tn} = F +\end{verbatim} +} +\noindent In all other cases, {\small\verb%IN_CONV%} will fail. + +\EXAMPLE +In the following example, the conversion {\small\verb%num_EQ_CONV%} is supplied as a +parameter and used to test equality of the candidate element {\small\verb%1%} with the +actual elements of the given set. +{\par\samepage\setseps\small +\begin{verbatim} + #IN_CONV num_EQ_CONV "2 IN {0,SUC 1,3}";; + |- 2 IN {0,SUC 1,3} = T +\end{verbatim} +} +\noindent The result is {\small\verb%T%} because {\small\verb%num_EQ_CONV%} is able to prove that {\small\verb%2%} is +equal to {\small\verb%SUC 1%}. An example of a negative result is: +{\par\samepage\setseps\small +\begin{verbatim} + #IN_CONV num_EQ_CONV "1 IN {0,2,3}";; + |- 1 IN {0,2,3} = F +\end{verbatim} +} +\noindent Finally the behaviour of the supplied conversion is irrelevant when +the value to be tested for membership is alpha-equivalent to an actual element: +{\par\samepage\setseps\small +\begin{verbatim} + #IN_CONV NO_CONV "1 IN {3,2,1}";; + |- 1 IN {3,2,1} = T +\end{verbatim} +} +\noindent The conversion {\small\verb%NO_CONV%} always fails, but {\small\verb%IN_CONV%} is nontheless +able in this case to prove the required result. + +\FAILURE +{\small\verb%IN_CONV conv%} fails if applied to a term that is not of the form {\small\verb%"t IN +{t1,...,tn}"%}. A call {\small\verb%IN_CONV conv "t IN {t1,...,tn}"%} fails unless the +term {\small\verb%t%} is alpha-equivalent to some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns +{\small\verb%|- (t = ti) = T%} for some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns +{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}. + +\ENDDOC + \DOC{INSERT\_CONV} \TYPE {\small\verb%INSERT_CONV : conv -> conv%}\egroup @@ -257,84 +332,6 @@ \ENDDOC -\DOC{IN\_CONV} - -\TYPE {\small\verb%IN_CONV : conv -> conv%}\egroup - -\SYNOPSIS -Decision procedure for membership in finite sets. - -\DESCRIBE -The function {\small\verb%IN_CONV%} is a parameterized conversion for proving or disproving -membership assertions of the general form: -{\par\samepage\setseps\small -\begin{verbatim} - "t IN {t1,...,tn}" -\end{verbatim} -} -\noindent where {\small\verb%{t1,...,tn}%} is a set of type {\small\verb%(ty)set%} and {\small\verb%t%} is a value -of the base type {\small\verb%ty%}. The first argument to {\small\verb%IN_CONV%} is expected to be a -conversion that decides equality between values of the base type {\small\verb%ty%}. Given -an equation {\small\verb%"e1 = e2"%}, where {\small\verb%e1%} and {\small\verb%e2%} are terms of type {\small\verb%ty%}, this -conversion should return the theorem {\small\verb%|- (e1 = e2) = T%} or the theorem -{\small\verb%|- (e1 = e2) = F%}, as appropriate. - -Given such a conversion, the function {\small\verb%IN_CONV%} returns a conversion that -maps a term of the form {\small\verb%"t IN {t1,...,tn}"%} to the theorem -{\par\samepage\setseps\small -\begin{verbatim} - |- t IN {t1,...,tn} = T -\end{verbatim} -} - -\noindent if {\small\verb%t%} is alpha-equivalent to any {\small\verb%ti%}, or if the supplied conversion -proves {\small\verb%|- (t = ti) = T%} for any {\small\verb%ti%}. If the supplied conversion proves -{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}, then the result is the theorem -{\par\samepage\setseps\small -\begin{verbatim} - |- t IN {t1,...,tn} = F -\end{verbatim} -} -\noindent In all other cases, {\small\verb%IN_CONV%} will fail. - -\EXAMPLE -In the following example, the conversion {\small\verb%num_EQ_CONV%} is supplied as a -parameter and used to test equality of the candidate element {\small\verb%1%} with the -actual elements of the given set. -{\par\samepage\setseps\small -\begin{verbatim} - #IN_CONV num_EQ_CONV "2 IN {0,SUC 1,3}";; - |- 2 IN {0,SUC 1,3} = T -\end{verbatim} -} -\noindent The result is {\small\verb%T%} because {\small\verb%num_EQ_CONV%} is able to prove that {\small\verb%2%} is -equal to {\small\verb%SUC 1%}. An example of a negative result is: -{\par\samepage\setseps\small -\begin{verbatim} - #IN_CONV num_EQ_CONV "1 IN {0,2,3}";; - |- 1 IN {0,2,3} = F -\end{verbatim} -} -\noindent Finally the behaviour of the supplied conversion is irrelevant when -the value to be tested for membership is alpha-equivalent to an actual element: -{\par\samepage\setseps\small -\begin{verbatim} - #IN_CONV NO_CONV "1 IN {3,2,1}";; - |- 1 IN {3,2,1} = T -\end{verbatim} -} -\noindent The conversion {\small\verb%NO_CONV%} always fails, but {\small\verb%IN_CONV%} is nontheless -able in this case to prove the required result. - -\FAILURE -{\small\verb%IN_CONV conv%} fails if applied to a term that is not of the form {\small\verb%"t IN -{t1,...,tn}"%}. A call {\small\verb%IN_CONV conv "t IN {t1,...,tn}"%} fails unless the -term {\small\verb%t%} is alpha-equivalent to some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns -{\small\verb%|- (t = ti) = T%} for some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns -{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}. - -\ENDDOC - \DOC{SET\_INDUCT\_TAC} \TYPE {\small\verb%SET_INDUCT_TAC : tactic%}\egroup --- hol88-2.02.19940316.orig/Library/finite_sets/Manual/theorems.tex +++ hol88-2.02.19940316/Library/finite_sets/Manual/theorems.tex @@ -1,7 +1,4 @@ -\chapter{Pre-proved Theorems} -\input{theorems-intro} -\section{The type definition} -\THEOREM FINITE\_SET\_DEF finite\_sets +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{The type definition}\THEOREM FINITE\_SET\_DEF finite\_sets |- (!x. ~x IN {}) /\ (!x y s. x IN (y INSERT s) = (x = y) \/ x IN s) /\ (!x s. x INSERT (x INSERT s) = x INSERT s) /\ @@ -18,8 +15,7 @@ \THEOREM set\_TY\_DEF finite\_sets |- ?rep. TYPE_DEFINITION IS_SET_REP rep \ENDTHEOREM -\section{Basic properties of {\tt EMPTY}, {\tt INSERT}, and {\tt IN}} -\THEOREM ABSORPTION finite\_sets +\section{Basic properties of {\tt EMPTY}, {\tt INSERT}, and {\tt IN}}\THEOREM ABSORPTION finite\_sets |- !x s. x IN s = (x INSERT s = s) \ENDTHEOREM \THEOREM COMPONENT finite\_sets @@ -31,15 +27,15 @@ \THEOREM EXTENSION finite\_sets |- !s t. (s = t) = (!x. x IN s = x IN t) \ENDTHEOREM +\THEOREM IN\_INSERT finite\_sets +|- !x y s. x IN (y INSERT s) = (x = y) \/ x IN s +\ENDTHEOREM \THEOREM INSERT\_COMM finite\_sets |- !x y s. x INSERT (y INSERT s) = y INSERT (x INSERT s) \ENDTHEOREM \THEOREM INSERT\_INSERT finite\_sets |- !x s. x INSERT (x INSERT s) = x INSERT s \ENDTHEOREM -\THEOREM IN\_INSERT finite\_sets -|- !x y s. x IN (y INSERT s) = (x = y) \/ x IN s -\ENDTHEOREM \THEOREM MEMBER\_NOT\_EMPTY finite\_sets |- !s. (?x. x IN s) = ~(s = {}) \ENDTHEOREM @@ -49,12 +45,12 @@ \THEOREM NOT\_EQUAL\_SETS finite\_sets |- !s t. ~(s = t) = (?x. x IN t = ~x IN s) \ENDTHEOREM -\THEOREM NOT\_INSERT\_EMPTY finite\_sets -|- !x s. ~(x INSERT s = {}) -\ENDTHEOREM \THEOREM NOT\_IN\_EMPTY finite\_sets |- !x. ~x IN {} \ENDTHEOREM +\THEOREM NOT\_INSERT\_EMPTY finite\_sets +|- !x s. ~(x INSERT s = {}) +\ENDTHEOREM \THEOREM NUM\_SET\_WOP finite\_sets |- !s. (?n. n IN s) = (?n. n IN s /\ (!m. m IN s ==> n <= m)) \ENDTHEOREM @@ -68,8 +64,7 @@ \THEOREM SET\_MINIMUM finite\_sets |- !s M. (?x. x IN s) = (?x. x IN s /\ (!y. y IN s ==> (M x) <= (M y))) \ENDTHEOREM -\section{Set inclusion} -\THEOREM EMPTY\_SUBSET finite\_sets +\section{Set inclusion}\THEOREM EMPTY\_SUBSET finite\_sets |- !s. {} SUBSET s \ENDTHEOREM \THEOREM INSERT\_SUBSET finite\_sets @@ -111,13 +106,15 @@ \THEOREM SUBSET\_TRANS finite\_sets |- !s t u. s SUBSET t /\ t SUBSET u ==> s SUBSET u \ENDTHEOREM -\section{Intersection and union} -\THEOREM DELETE\_INTER finite\_sets +\section{Intersection and union}\THEOREM DELETE\_INTER finite\_sets |- !s t x. (s DELETE x) INTER t = (s INTER t) DELETE x \ENDTHEOREM \THEOREM EMPTY\_UNION finite\_sets |- !s t. (s UNION t = {}) = (s = {}) /\ (t = {}) \ENDTHEOREM +\THEOREM IN\_INTER finite\_sets +|- !s t x. x IN (s INTER t) = x IN s /\ x IN t +\ENDTHEOREM \THEOREM INSERT\_INTER finite\_sets |- !x s t. (x INSERT s) INTER t = (x IN t => x INSERT (s INTER t) | s INTER t) @@ -147,21 +144,18 @@ \THEOREM INTER\_SUBSET finite\_sets |- (!s t. (s INTER t) SUBSET s) /\ (!s t. (t INTER s) SUBSET s) \ENDTHEOREM -\THEOREM IN\_INTER finite\_sets -|- !s t x. x IN (s INTER t) = x IN s /\ x IN t -\ENDTHEOREM \THEOREM IN\_UNION finite\_sets |- !s t x. x IN (s UNION t) = x IN s \/ x IN t \ENDTHEOREM \THEOREM SUBSET\_INTER\_ABSORPTION finite\_sets |- !s t. s SUBSET t = (s INTER t = s) \ENDTHEOREM -\THEOREM SUBSET\_UNION finite\_sets -|- (!s t. s SUBSET (s UNION t)) /\ (!s t. s SUBSET (t UNION s)) -\ENDTHEOREM \THEOREM SUBSET\_UNION\_ABSORPTION finite\_sets |- !s t. s SUBSET t = (s UNION t = t) \ENDTHEOREM +\THEOREM SUBSET\_UNION finite\_sets +|- (!s t. s SUBSET (s UNION t)) /\ (!s t. s SUBSET (t UNION s)) +\ENDTHEOREM \THEOREM UNION\_ASSOC finite\_sets |- !s t u. (s UNION t) UNION u = s UNION (t UNION u) \ENDTHEOREM @@ -177,8 +171,7 @@ \THEOREM UNION\_OVER\_INTER finite\_sets |- !s t u. s INTER (t UNION u) = (s INTER t) UNION (s INTER u) \ENDTHEOREM -\section{Set difference} -\THEOREM DIFF\_DIFF finite\_sets +\section{Set difference}\THEOREM DIFF\_DIFF finite\_sets |- !s t. (s DIFF t) DIFF t = s DIFF t \ENDTHEOREM \THEOREM DIFF\_EMPTY finite\_sets @@ -193,8 +186,7 @@ \THEOREM IN\_DIFF finite\_sets |- !s t x. x IN (s DIFF t) = x IN s /\ ~x IN t \ENDTHEOREM -\section{Deletion of an element} -\THEOREM DELETE\_COMM finite\_sets +\section{Deletion of an element}\THEOREM DELETE\_COMM finite\_sets |- !x y s. (s DELETE x) DELETE y = (s DELETE y) DELETE x \ENDTHEOREM \THEOREM DELETE\_DEF finite\_sets @@ -220,9 +212,6 @@ \THEOREM EMPTY\_DELETE finite\_sets |- !x. {} DELETE x = {} \ENDTHEOREM -\THEOREM INSERT\_DELETE finite\_sets -|- !x s. x IN s ==> (x INSERT (s DELETE x) = s) -\ENDTHEOREM \THEOREM IN\_DELETE finite\_sets |- !s x y. x IN (s DELETE y) = x IN s /\ ~(x = y) \ENDTHEOREM @@ -230,14 +219,16 @@ |- !s x x'. (x IN s = x' IN s) = (x IN (s DELETE x') = x' IN (s DELETE x)) \ENDTHEOREM +\THEOREM INSERT\_DELETE finite\_sets +|- !x s. x IN s ==> (x INSERT (s DELETE x) = s) +\ENDTHEOREM \THEOREM SUBSET\_DELETE finite\_sets |- !x s t. s SUBSET (t DELETE x) = ~x IN s /\ s SUBSET t \ENDTHEOREM \THEOREM SUBSET\_INSERT\_DELETE finite\_sets |- !x s t. s SUBSET (x INSERT t) = (s DELETE x) SUBSET t \ENDTHEOREM -\section{Disjoint sets} -\THEOREM DISJOINT\_DEF finite\_sets +\section{Disjoint sets}\THEOREM DISJOINT\_DEF finite\_sets |- !s t. DISJOINT s t = (s INTER t = {}) \ENDTHEOREM \THEOREM DISJOINT\_DELETE\_SYM finite\_sets @@ -261,8 +252,7 @@ \THEOREM IN\_DISJOINT finite\_sets |- !s t. DISJOINT s t = ~(?x. x IN s /\ x IN t) \ENDTHEOREM -\section{The {\tt CHOICE} and {\tt REST} functions} -\THEOREM CHOICE\_DEF finite\_sets +\section{The {\tt CHOICE} and {\tt REST} functions}\THEOREM CHOICE\_DEF finite\_sets |- !s. ~(s = {}) ==> (CHOICE s) IN s \ENDTHEOREM \THEOREM CHOICE\_INSERT\_REST finite\_sets @@ -289,8 +279,7 @@ \THEOREM SING\_IFF\_EMPTY\_REST finite\_sets |- !s. SING s = ~(s = {}) /\ (REST s = {}) \ENDTHEOREM -\section{Image of a function on a set} -\THEOREM IMAGE\_COMPOSE finite\_sets +\section{Image of a function on a set}\THEOREM IMAGE\_COMPOSE finite\_sets |- !f g s. IMAGE(f o g)s = IMAGE f(IMAGE g s) \ENDTHEOREM \THEOREM IMAGE\_DELETE finite\_sets @@ -323,8 +312,7 @@ \THEOREM IN\_IMAGE finite\_sets |- !f s y. y IN (IMAGE f s) = (?x. (y = f x) /\ x IN s) \ENDTHEOREM -\section{Mappings between sets} -\THEOREM BIJ\_COMPOSE finite\_sets +\section{Mappings between sets}\THEOREM BIJ\_COMPOSE finite\_sets |- !f g s t u. BIJ f s t /\ BIJ g t u ==> BIJ(g o f)s u \ENDTHEOREM \THEOREM BIJ\_DEF finite\_sets @@ -375,8 +363,7 @@ \THEOREM SURJ\_ID finite\_sets |- !s. SURJ(\x. x)s s \ENDTHEOREM -\section{Singleton sets} -\THEOREM DELETE\_EQ\_SING finite\_sets +\section{Singleton sets}\THEOREM DELETE\_EQ\_SING finite\_sets |- !s x. x IN s ==> ((s DELETE x = {}) = (s = {x})) \ENDTHEOREM \THEOREM DISJOINT\_SING\_EMPTY finite\_sets @@ -397,17 +384,16 @@ \THEOREM NOT\_SING\_EMPTY finite\_sets |- !x. ~({x} = {}) \ENDTHEOREM -\THEOREM SING finite\_sets -|- !x. SING{x} -\ENDTHEOREM \THEOREM SING\_DEF finite\_sets |- !s. SING s = (?x. s = {x}) \ENDTHEOREM \THEOREM SING\_DELETE finite\_sets |- !x. {x} DELETE x = {} \ENDTHEOREM -\section{Cardinality of sets} -\THEOREM CARD\_DEF finite\_sets +\THEOREM SING finite\_sets +|- !x. SING{x} +\ENDTHEOREM +\section{Cardinality of sets}\THEOREM CARD\_DEF finite\_sets |- (CARD{} = 0) /\ (!s x. CARD(x INSERT s) = (x IN s => CARD s | SUC(CARD s))) \ENDTHEOREM --- hol88-2.02.19940316.orig/Library/window/Manual/theorems.tex +++ hol88-2.02.19940316/Library/window/Manual/theorems.tex @@ -1,11 +1,7 @@ -\chapter{Pre-proved Theorems} -\input{theorems-intro} -\section{Definitions} -\THEOREM PMI\_DEF win +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{Definitions}\THEOREM PMI\_DEF win |- !a b. a <== b = b ==> a \ENDTHEOREM -\section{Theorems} -\THEOREM IMP\_REFL\_THM win +\section{Theorems}\THEOREM IMP\_REFL\_THM win |- !x. x ==> x \ENDTHEOREM \THEOREM IMP\_TRANS\_THM win --- hol88-2.02.19940316.orig/Library/word/Manual/entries.tex +++ hol88-2.02.19940316/Library/word/Manual/entries.tex @@ -1,7 +1,4 @@ -\chapter{ML Functions in the {\tt word} Library} -\label{entries} -\input{entries-intro} -\DOC{BIT\_CONV} +\chapter{ML Functions in the {\tt word} Library}\label{entries}\input{entries-intro}\DOC{BIT\_CONV} \TYPE {\small\verb%BIT_CONV : conv%}\egroup --- hol88-2.02.19940316.orig/Library/word/Manual/theorems.tex +++ hol88-2.02.19940316/Library/word/Manual/theorems.tex @@ -1,7 +1,4 @@ -\chapter{Pre-proved Theorems} -\input{theorems-intro} -\section{The theory {\tt word\_base}} -\THEOREM BIT0 word\_base +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{The theory {\tt word\_base}}\THEOREM BIT0 word\_base |- !b. BIT 0(WORD[b]) = b \ENDTHEOREM \THEOREM BIT\_DEF word\_base @@ -33,20 +30,17 @@ !m k j. (m + k) <= n ==> j < m ==> (BIT j(WSEG m k w) = BIT(j + k)w) \ENDTHEOREM -\THEOREM LSB word\_base -|- !n. !w :: PWORDLEN n. 0 < n ==> (LSB w = BIT 0 w) -\ENDTHEOREM \THEOREM LSB\_DEF word\_base |- !l. LSB(WORD l) = LAST l \ENDTHEOREM -\THEOREM MSB word\_base -|- !n. !w :: PWORDLEN n. 0 < n ==> (MSB w = BIT(PRE n)w) +\THEOREM LSB word\_base +|- !n. !w :: PWORDLEN n. 0 < n ==> (LSB w = BIT 0 w) \ENDTHEOREM \THEOREM MSB\_DEF word\_base |- !l. MSB(WORD l) = HD l \ENDTHEOREM -\THEOREM PWORDLEN word\_base -|- !n w. PWORDLEN n w = (WORDLEN w = n) +\THEOREM MSB word\_base +|- !n. !w :: PWORDLEN n. 0 < n ==> (MSB w = BIT(PRE n)w) \ENDTHEOREM \THEOREM PWORDLEN0 word\_base |- !w. PWORDLEN 0 w ==> (w = WORD[]) @@ -57,6 +51,9 @@ \THEOREM PWORDLEN\_DEF word\_base |- !n l. PWORDLEN n(WORD l) = (n = LENGTH l) \ENDTHEOREM +\THEOREM PWORDLEN word\_base +|- !n w. PWORDLEN n w = (WORDLEN w = n) +\ENDTHEOREM \THEOREM WCAT0 word\_base |- !w. (WCAT(WORD[],w) = w) /\ (WCAT(w,WORD[]) = w) \ENDTHEOREM @@ -84,26 +81,6 @@ (m1 + (m2 + k)) <= n ==> (WCAT(WSEG m2(m1 + k)w,WSEG m1 k w) = WSEG(m1 + m2)k w) \ENDTHEOREM -\THEOREM WORDLEN\_DEF word\_base -|- !l. WORDLEN(WORD l) = LENGTH l -\ENDTHEOREM -\THEOREM WORDLEN\_SUC\_WCAT word\_base -|- !n w. - PWORDLEN(SUC n)w ==> - (?b :: PWORDLEN 1. ?w' :: PWORDLEN n. w = WCAT(b,w')) -\ENDTHEOREM -\THEOREM WORDLEN\_SUC\_WCAT\_BIT\_WSEG word\_base -|- !n. !w :: PWORDLEN(SUC n). w = WCAT(WORD[BIT n w],WSEG n 0 w) -\ENDTHEOREM -\THEOREM WORDLEN\_SUC\_WCAT\_BIT\_WSEG\_RIGHT word\_base -|- !n. !w :: PWORDLEN(SUC n). w = WCAT(WSEG n 1 w,WORD[BIT 0 w]) -\ENDTHEOREM -\THEOREM WORDLEN\_SUC\_WCAT\_WSEG\_WSEG word\_base -|- !w :: PWORDLEN(SUC n). w = WCAT(WSEG 1 n w,WSEG n 0 w) -\ENDTHEOREM -\THEOREM WORDLEN\_SUC\_WCAT\_WSEG\_WSEG\_RIGHT word\_base -|- !w :: PWORDLEN(SUC n). w = WCAT(WSEG n 1 w,WSEG 1 0 w) -\ENDTHEOREM \THEOREM WORD\_11 word\_base |- !l l'. (WORD l = WORD l') = (l = l') \ENDTHEOREM @@ -128,6 +105,26 @@ TRP(\v tl. (?l. v = l) /\ (LENGTH tl = 0))r = (REP_word(ABS_word r) = r)) \ENDTHEOREM +\THEOREM WORDLEN\_DEF word\_base +|- !l. WORDLEN(WORD l) = LENGTH l +\ENDTHEOREM +\THEOREM WORDLEN\_SUC\_WCAT\_BIT\_WSEG word\_base +|- !n. !w :: PWORDLEN(SUC n). w = WCAT(WORD[BIT n w],WSEG n 0 w) +\ENDTHEOREM +\THEOREM WORDLEN\_SUC\_WCAT\_BIT\_WSEG\_RIGHT word\_base +|- !n. !w :: PWORDLEN(SUC n). w = WCAT(WSEG n 1 w,WORD[BIT 0 w]) +\ENDTHEOREM +\THEOREM WORDLEN\_SUC\_WCAT word\_base +|- !n w. + PWORDLEN(SUC n)w ==> + (?b :: PWORDLEN 1. ?w' :: PWORDLEN n. w = WCAT(b,w')) +\ENDTHEOREM +\THEOREM WORDLEN\_SUC\_WCAT\_WSEG\_WSEG word\_base +|- !w :: PWORDLEN(SUC n). w = WCAT(WSEG 1 n w,WSEG n 0 w) +\ENDTHEOREM +\THEOREM WORDLEN\_SUC\_WCAT\_WSEG\_WSEG\_RIGHT word\_base +|- !w :: PWORDLEN(SUC n). w = WCAT(WSEG n 1 w,WSEG 1 0 w) +\ENDTHEOREM \THEOREM WORD\_PARTITION word\_base |- (!n. !w :: PWORDLEN n. !m. m <= n ==> (WCAT(WSPLIT m w) = w)) /\ (!n m. @@ -162,15 +159,6 @@ |- !n1 n2. !w1 :: PWORDLEN n1. !w2 :: PWORDLEN n2. WSEG n2 0(WCAT(w1,w2)) = w2 \ENDTHEOREM -\THEOREM WSEG\_WCAT\_WSEG word\_base -|- !n1 n2. - !w1 :: PWORDLEN n1. - !w2 :: PWORDLEN n2. - !m k. - (m + k) <= (n1 + n2) /\ k < n2 /\ n2 <= (m + k) ==> - (WSEG m k(WCAT(w1,w2)) = - WCAT(WSEG((m + k) - n2)0 w1,WSEG(n2 - k)k w2)) -\ENDTHEOREM \THEOREM WSEG\_WCAT\_WSEG1 word\_base |- !n1 n2. !w1 :: PWORDLEN n1. @@ -184,6 +172,15 @@ !w2 :: PWORDLEN n2. !m k. (m + k) <= n2 ==> (WSEG m k(WCAT(w1,w2)) = WSEG m k w2) \ENDTHEOREM +\THEOREM WSEG\_WCAT\_WSEG word\_base +|- !n1 n2. + !w1 :: PWORDLEN n1. + !w2 :: PWORDLEN n2. + !m k. + (m + k) <= (n1 + n2) /\ k < n2 /\ n2 <= (m + k) ==> + (WSEG m k(WCAT(w1,w2)) = + WCAT(WSEG((m + k) - n2)0 w1,WSEG(n2 - k)k w2)) +\ENDTHEOREM \THEOREM WSEG\_WORDLEN word\_base |- !n. !w :: PWORDLEN n. !m k. (m + k) <= n ==> (WORDLEN(WSEG m k w) = m) @@ -208,11 +205,6 @@ m <= n ==> PWORDLEN(n - m)(FST(WSPLIT m w)) /\ PWORDLEN m(SND(WSPLIT m w)) \ENDTHEOREM -\THEOREM WSPLIT\_WSEG word\_base -|- !n. - !w :: PWORDLEN n. - !k. k <= n ==> (WSPLIT k w = WSEG(n - k)k w,WSEG k 0 w) -\ENDTHEOREM \THEOREM WSPLIT\_WSEG1 word\_base |- !n. !w :: PWORDLEN n. !k. k <= n ==> (FST(WSPLIT k w) = WSEG(n - k)k w) @@ -220,13 +212,17 @@ \THEOREM WSPLIT\_WSEG2 word\_base |- !n. !w :: PWORDLEN n. !k. k <= n ==> (SND(WSPLIT k w) = WSEG k 0 w) \ENDTHEOREM -\section{The theory {\tt word\_bitop}} -\THEOREM EXISTSABIT word\_bitop -|- !n. !w :: PWORDLEN n. !P. EXISTSABIT P w = (?k. k < n /\ P(BIT k w)) +\THEOREM WSPLIT\_WSEG word\_base +|- !n. + !w :: PWORDLEN n. + !k. k <= n ==> (WSPLIT k w = WSEG(n - k)k w,WSEG k 0 w) \ENDTHEOREM -\THEOREM EXISTSABIT\_DEF word\_bitop +\section{The theory {\tt word\_bitop}}\THEOREM EXISTSABIT\_DEF word\_bitop |- !P l. EXISTSABIT P(WORD l) = SOME_EL P l \ENDTHEOREM +\THEOREM EXISTSABIT word\_bitop +|- !n. !w :: PWORDLEN n. !P. EXISTSABIT P w = (?k. k < n /\ P(BIT k w)) +\ENDTHEOREM \THEOREM EXISTSABIT\_WCAT word\_bitop |- !w1 w2 P. EXISTSABIT P(WCAT(w1,w2)) = EXISTSABIT P w1 \/ EXISTSABIT P w2 @@ -237,12 +233,12 @@ !m k. (m + k) <= n ==> (!P. EXISTSABIT P(WSEG m k w) ==> EXISTSABIT P w) \ENDTHEOREM -\THEOREM FORALLBITS word\_bitop -|- !n. !w :: PWORDLEN n. !P. FORALLBITS P w = (!k. k < n ==> P(BIT k w)) -\ENDTHEOREM \THEOREM FORALLBITS\_DEF word\_bitop |- !P l. FORALLBITS P(WORD l) = ALL_EL P l \ENDTHEOREM +\THEOREM FORALLBITS word\_bitop +|- !n. !w :: PWORDLEN n. !P. FORALLBITS P w = (!k. k < n ==> P(BIT k w)) +\ENDTHEOREM \THEOREM FORALLBITS\_WCAT word\_bitop |- !w1 w2 P. FORALLBITS P(WCAT(w1,w2)) = FORALLBITS P w1 /\ FORALLBITS P w2 @@ -316,6 +312,16 @@ BIT(PRE(WORDLEN w))w, WCAT(WSEG(PRE(WORDLEN w))0 w,(f => WSEG 1 0 w | WORD[b])) \ENDTHEOREM +\THEOREM SHL\_WSEG\_1F word\_bitop +|- !n. + !w :: PWORDLEN n. + !m k. + (m + k) <= n ==> + 0 < m ==> + (!b. + SHL F(WSEG m k w)b = + BIT(k + (m - 1))w,WCAT(WSEG(m - 1)k w,WORD[b])) +\ENDTHEOREM \THEOREM SHL\_WSEG word\_bitop |- !n. !w :: PWORDLEN n. @@ -329,16 +335,6 @@ WCAT(WSEG(m - 1)k w,WSEG 1 k w) | WCAT(WSEG(m - 1)k w,WORD[b]))) \ENDTHEOREM -\THEOREM SHL\_WSEG\_1F word\_bitop -|- !n. - !w :: PWORDLEN n. - !m k. - (m + k) <= n ==> - 0 < m ==> - (!b. - SHL F(WSEG m k w)b = - BIT(k + (m - 1))w,WCAT(WSEG(m - 1)k w,WORD[b])) -\ENDTHEOREM \THEOREM SHL\_WSEG\_NF word\_bitop |- !n. !w :: PWORDLEN n. @@ -356,26 +352,26 @@ ((f => WSEG 1(PRE(WORDLEN w))w | WORD[b]),WSEG(PRE(WORDLEN w))1 w), BIT 0 w \ENDTHEOREM -\THEOREM SHR\_WSEG word\_bitop +\THEOREM SHR\_WSEG\_1F word\_bitop |- !n. !w :: PWORDLEN n. !m k. (m + k) <= n ==> 0 < m ==> - (!f b. - SHR f b(WSEG m k w) = - (f => - WCAT(WSEG 1(k + (m - 1))w,WSEG(m - 1)(k + 1)w) | - WCAT(WORD[b],WSEG(m - 1)(k + 1)w)),BIT k w) + (!b. + SHR F b(WSEG m k w) = WCAT(WORD[b],WSEG(m - 1)(k + 1)w),BIT k w) \ENDTHEOREM -\THEOREM SHR\_WSEG\_1F word\_bitop +\THEOREM SHR\_WSEG word\_bitop |- !n. !w :: PWORDLEN n. !m k. (m + k) <= n ==> 0 < m ==> - (!b. - SHR F b(WSEG m k w) = WCAT(WORD[b],WSEG(m - 1)(k + 1)w),BIT k w) + (!f b. + SHR f b(WSEG m k w) = + (f => + WCAT(WSEG 1(k + (m - 1))w,WSEG(m - 1)(k + 1)w) | + WCAT(WORD[b],WSEG(m - 1)(k + 1)w)),BIT k w) \ENDTHEOREM \THEOREM SHR\_WSEG\_NF word\_bitop |- !n. @@ -413,13 +409,6 @@ !m k. (m + k) <= n ==> (!f. WMAP f(WSEG m k w) = WSEG m k(WMAP f w)) \ENDTHEOREM -\THEOREM WSEG\_SHL word\_bitop -|- !n. - !w :: PWORDLEN(SUC n). - !m k. - 0 < k /\ (m + k) <= (SUC n) ==> - (!b. WSEG m k(SND(SHL f w b)) = WSEG m(k - 1)w) -\ENDTHEOREM \THEOREM WSEG\_SHL\_0 word\_bitop |- !n. !w :: PWORDLEN(SUC n). @@ -428,15 +417,21 @@ (WSEG m 0(SND(SHL f w b)) = WCAT(WSEG(m - 1)0 w,(f => WSEG 1 0 w | WORD[b]))) \ENDTHEOREM -\section{The theory {\tt word\_num}} +\THEOREM WSEG\_SHL word\_bitop +|- !n. + !w :: PWORDLEN(SUC n). + !m k. + 0 < k /\ (m + k) <= (SUC n) ==> + (!b. WSEG m k(SND(SHL f w b)) = WSEG m(k - 1)w) +\ENDTHEOREM +\section{The theory {\tt word\_num}}\THEOREM LVAL\_DEF word\_num +|- !f b l. LVAL f b l = FOLDL(\e x. (b * e) + (f x))0 l +\ENDTHEOREM \THEOREM LVAL word\_num |- (!f b. LVAL f b[] = 0) /\ (!l f b x. LVAL f b(CONS x l) = ((f x) * (b EXP (LENGTH l))) + (LVAL f b l)) \ENDTHEOREM -\THEOREM LVAL\_DEF word\_num -|- !f b l. LVAL f b l = FOLDL(\e x. (b * e) + (f x))0 l -\ENDTHEOREM \THEOREM LVAL\_MAX word\_num |- !l f b. (!x. (f x) < b) ==> (LVAL f b l) < (b EXP (LENGTH l)) \ENDTHEOREM @@ -461,14 +456,6 @@ |- !f b. (!x. (f x) < b) ==> (!n. !w :: PWORDLEN n. (NVAL f b w) < (b EXP n)) \ENDTHEOREM -\THEOREM NVAL\_WCAT word\_num -|- !n m. - !w1 :: PWORDLEN n. - !w2 :: PWORDLEN m. - !f b. - NVAL f b(WCAT(w1,w2)) = - ((NVAL f b w1) * (b EXP m)) + (NVAL f b w2) -\ENDTHEOREM \THEOREM NVAL\_WCAT1 word\_num |- !w f b x. NVAL f b(WCAT(w,WORD[x])) = ((NVAL f b w) * b) + (f x) \ENDTHEOREM @@ -478,6 +465,14 @@ !f b x. NVAL f b(WCAT(WORD[x],w)) = ((f x) * (b EXP n)) + (NVAL f b w) \ENDTHEOREM +\THEOREM NVAL\_WCAT word\_num +|- !n m. + !w1 :: PWORDLEN n. + !w2 :: PWORDLEN m. + !f b. + NVAL f b(WCAT(w1,w2)) = + ((NVAL f b w1) * (b EXP m)) + (NVAL f b w2) +\ENDTHEOREM \THEOREM NVAL\_WORDLEN\_0 word\_num |- !w :: PWORDLEN 0. !fv r. NVAL fv r w = 0 \ENDTHEOREM @@ -490,8 +485,7 @@ \THEOREM NWORD\_PWORDLEN word\_num |- !n f b m. PWORDLEN n(NWORD n f b m) \ENDTHEOREM -\section{The theory {\tt bword\_bitop}} -\THEOREM PBITBOP\_WAND bword\_bitop +\section{The theory {\tt bword\_bitop}}\THEOREM PBITBOP\_WAND bword\_bitop |- PBITBOP $WAND \ENDTHEOREM \THEOREM PBITBOP\_WOR bword\_bitop @@ -523,8 +517,7 @@ \THEOREM WXOR\_DEF bword\_bitop |- !l1 l2. (WORD l1) WXOR (WORD l2) = WORD(MAP2(\x y. ~(x = y))l1 l2) \ENDTHEOREM -\section{The theory {\tt bword\_num}} -\THEOREM ADD\_BNVAL\_LEFT bword\_num +\section{The theory {\tt bword\_num}}\THEOREM ADD\_BNVAL\_LEFT bword\_num |- !n. !w1 w2 :: PWORDLEN(SUC n). (BNVAL w1) + (BNVAL w2) = @@ -570,12 +563,6 @@ \THEOREM BNVAL\_ONTO bword\_num |- !w. ?n. BNVAL w = n \ENDTHEOREM -\THEOREM BNVAL\_WCAT bword\_num -|- !n m. - !w1 :: PWORDLEN n. - !w2 :: PWORDLEN m. - BNVAL(WCAT(w1,w2)) = ((BNVAL w1) * (2 EXP m)) + (BNVAL w2) -\ENDTHEOREM \THEOREM BNVAL\_WCAT1 bword\_num |- !n. !w :: PWORDLEN n. @@ -586,6 +573,12 @@ !w :: PWORDLEN n. !x. BNVAL(WCAT(WORD[x],w)) = ((BV x) * (2 EXP n)) + (BNVAL w) \ENDTHEOREM +\THEOREM BNVAL\_WCAT bword\_num +|- !n m. + !w1 :: PWORDLEN n. + !w2 :: PWORDLEN m. + BNVAL(WCAT(w1,w2)) = ((BNVAL w1) * (2 EXP m)) + (BNVAL w2) +\ENDTHEOREM \THEOREM BV\_DEF bword\_num |- !b. BV b = (b => SUC 0 | 0) \ENDTHEOREM @@ -667,8 +660,7 @@ \THEOREM ZERO\_WORD\_VAL bword\_num |- !n. !w :: PWORDLEN n. (w = NBWORD n 0) = (BNVAL w = 0) \ENDTHEOREM -\section{The theory {\tt bword\_arith}} -\THEOREM ACARRY\_ACARRY\_WSEG bword\_arith +\section{The theory {\tt bword\_arith}}\THEOREM ACARRY\_ACARRY\_WSEG bword\_arith |- !n. !w1 w2 :: PWORDLEN n. !cin m k1 k2. --- hol88-2.02.19940316.orig/Library/numeral/Manual/theorems.tex +++ hol88-2.02.19940316/Library/numeral/Manual/theorems.tex @@ -1,13 +1,4 @@ -\chapter{Pre-proved Theorems} -\input{theorems-intro} -\section{Numeral theory} -\THEOREM BASEN numeral -|- (!radix. BASEN radix[] = 0) /\ - (!radix digit digits. - BASEN radix(CONS digit digits) = - (digit * (radix EXP (LENGTH digits))) + (BASEN radix digits)) -\ENDTHEOREM -\THEOREM BASEN\_11 numeral +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{Numeral theory}\THEOREM BASEN\_11 numeral |- !r l1 l2. 1 < r ==> IS_BASEN r l1 ==> @@ -24,14 +15,20 @@ \THEOREM BASEN\_CONS\_0 numeral |- !r l. BASEN r(CONS 0 l) = BASEN r l \ENDTHEOREM +\THEOREM BASEN\_DIGIT\_EQ\_DIGIT numeral +|- !r e. BASEN r[e] = e +\ENDTHEOREM \THEOREM BASEN\_DIGITS numeral |- !n m r. 1 < r ==> (LENGTH(BASEN_DIGITS r n m) = n) /\ (BASEN r(BASEN_DIGITS r n m) = m MOD (r EXP n)) \ENDTHEOREM -\THEOREM BASEN\_DIGIT\_EQ\_DIGIT numeral -|- !r e. BASEN r[e] = e +\THEOREM BASEN numeral +|- (!radix. BASEN radix[] = 0) /\ + (!radix digit digits. + BASEN radix(CONS digit digits) = + (digit * (radix EXP (LENGTH digits))) + (BASEN radix digits)) \ENDTHEOREM \THEOREM BASEN\_EMPTY\_EQ\_0 numeral |- !r l. 1 < r ==> IS_NORMALIZED l ==> ((BASEN r l = 0) = (l = [])) @@ -85,9 +82,6 @@ \THEOREM BASEN\_ZEROS numeral |- !r n. BASEN r(REPLICATE n 0) = 0 \ENDTHEOREM -\THEOREM BINARY numeral -|- BINARY = BASEN 2 -\ENDTHEOREM \THEOREM BINARY\_11 numeral |- !l1 l2. IS_BINARY l1 ==> @@ -102,6 +96,9 @@ \THEOREM BINARY\_DIGIT\_EQ\_DIGIT numeral |- !e. BINARY[e] = e \ENDTHEOREM +\THEOREM BINARY numeral +|- BINARY = BASEN 2 +\ENDTHEOREM \THEOREM BINARY\_EMPTY\_EQ\_0 numeral |- !l. IS_NORMALIZED l ==> ((BINARY l = 0) = (l = [])) \ENDTHEOREM @@ -134,9 +131,6 @@ \THEOREM BINARY\_ZEROS numeral |- !n. BINARY(REPLICATE n 0) = 0 \ENDTHEOREM -\THEOREM DECIMAL numeral -|- DECIMAL = BASEN 10 -\ENDTHEOREM \THEOREM DECIMAL\_11 numeral |- !l1 l2. IS_DECIMAL l1 ==> @@ -151,6 +145,9 @@ \THEOREM DECIMAL\_DIGIT\_EQ\_DIGIT numeral |- !e. DECIMAL[e] = e \ENDTHEOREM +\THEOREM DECIMAL numeral +|- DECIMAL = BASEN 10 +\ENDTHEOREM \THEOREM DECIMAL\_EMPTY\_EQ\_0 numeral |- !l. IS_NORMALIZED l ==> ((DECIMAL l = 0) = (l = [])) \ENDTHEOREM @@ -183,9 +180,6 @@ \THEOREM DECIMAL\_ZEROS numeral |- !n. DECIMAL(REPLICATE n 0) = 0 \ENDTHEOREM -\THEOREM HEX numeral -|- HEX = BASEN 16 -\ENDTHEOREM \THEOREM HEX\_11 numeral |- !l1 l2. IS_HEX l1 ==> @@ -200,6 +194,9 @@ \THEOREM HEX\_DIGIT\_EQ\_DIGIT numeral |- !e. HEX[e] = e \ENDTHEOREM +\THEOREM HEX numeral +|- HEX = BASEN 16 +\ENDTHEOREM \THEOREM HEX\_EMPTY\_EQ\_0 numeral |- !l. IS_NORMALIZED l ==> ((HEX l = 0) = (l = [])) \ENDTHEOREM @@ -232,9 +229,6 @@ \THEOREM HEX\_ZEROS numeral |- !n. HEX(REPLICATE n 0) = 0 \ENDTHEOREM -\THEOREM IS\_BASEN numeral -|- !radix digits. IS_BASEN radix digits = EVERY($> radix)digits -\ENDTHEOREM \THEOREM IS\_BASEN\_APPEND numeral |- !r l m. IS_BASEN r(APPEND l m) = IS_BASEN r l /\ IS_BASEN r m \ENDTHEOREM @@ -250,12 +244,12 @@ \THEOREM IS\_BASEN\_CONS\_IMP\_LESS numeral |- !r l e. 1 < r ==> IS_BASEN r(CONS e l) ==> e < r \ENDTHEOREM +\THEOREM IS\_BASEN numeral +|- !radix digits. IS_BASEN radix digits = EVERY($> radix)digits +\ENDTHEOREM \THEOREM IS\_BASEN\_NIL numeral |- !r. IS_BASEN r[] \ENDTHEOREM -\THEOREM IS\_BINARY numeral -|- IS_BINARY = IS_BASEN 2 -\ENDTHEOREM \THEOREM IS\_BINARY\_CONS numeral |- !l e. IS_BINARY(CONS e l) = e < 2 /\ IS_BINARY l \ENDTHEOREM @@ -265,6 +259,9 @@ \THEOREM IS\_BINARY\_CONS\_IMP\_LESS numeral |- !l e. IS_BINARY(CONS e l) ==> e < 2 \ENDTHEOREM +\THEOREM IS\_BINARY numeral +|- IS_BINARY = IS_BASEN 2 +\ENDTHEOREM \THEOREM IS\_BINARY\_NIL numeral |- IS_BINARY[] \ENDTHEOREM @@ -273,9 +270,6 @@ IS_BINARY_NORMALIZED digits = IS_BINARY digits /\ IS_NORMALIZED digits \ENDTHEOREM -\THEOREM IS\_DECIMAL numeral -|- IS_DECIMAL = IS_BASEN 10 -\ENDTHEOREM \THEOREM IS\_DECIMAL\_CONS numeral |- !l e. IS_DECIMAL(CONS e l) = e < 10 /\ IS_DECIMAL l \ENDTHEOREM @@ -285,6 +279,9 @@ \THEOREM IS\_DECIMAL\_CONS\_IMP\_LESS numeral |- !l e. IS_DECIMAL(CONS e l) ==> e < 10 \ENDTHEOREM +\THEOREM IS\_DECIMAL numeral +|- IS_DECIMAL = IS_BASEN 10 +\ENDTHEOREM \THEOREM IS\_DECIMAL\_NIL numeral |- IS_DECIMAL[] \ENDTHEOREM @@ -293,9 +290,6 @@ IS_DECIMAL_NORMALIZED digits = IS_DECIMAL digits /\ IS_NORMALIZED digits \ENDTHEOREM -\THEOREM IS\_HEX numeral -|- IS_HEX = IS_BASEN 16 -\ENDTHEOREM \THEOREM IS\_HEX\_CONS numeral |- !l e. IS_HEX(CONS e l) = e < 16 /\ IS_HEX l \ENDTHEOREM @@ -305,6 +299,9 @@ \THEOREM IS\_HEX\_CONS\_IMP\_LESS numeral |- !l e. IS_HEX(CONS e l) ==> e < 16 \ENDTHEOREM +\THEOREM IS\_HEX numeral +|- IS_HEX = IS_BASEN 16 +\ENDTHEOREM \THEOREM IS\_HEX\_NIL numeral |- IS_HEX[] \ENDTHEOREM @@ -312,18 +309,15 @@ |- !digits. IS_HEX_NORMALIZED digits = IS_HEX digits /\ IS_NORMALIZED digits \ENDTHEOREM -\THEOREM IS\_NORMALIZED numeral -|- !digits. IS_NORMALIZED digits = (digits = []) \/ 0 < (HD digits) -\ENDTHEOREM \THEOREM IS\_NORMALIZED\_CONS numeral |- !e l. IS_NORMALIZED(CONS e l) = 0 < e \ENDTHEOREM +\THEOREM IS\_NORMALIZED numeral +|- !digits. IS_NORMALIZED digits = (digits = []) \/ 0 < (HD digits) +\ENDTHEOREM \THEOREM IS\_NORMALIZED\_NIL numeral |- IS_NORMALIZED[] \ENDTHEOREM -\THEOREM IS\_OCTAL numeral -|- IS_OCTAL = IS_BASEN 8 -\ENDTHEOREM \THEOREM IS\_OCTAL\_CONS numeral |- !l e. IS_OCTAL(CONS e l) = e < 8 /\ IS_OCTAL l \ENDTHEOREM @@ -333,6 +327,9 @@ \THEOREM IS\_OCTAL\_CONS\_IMP\_LESS numeral |- !l e. IS_OCTAL(CONS e l) ==> e < 8 \ENDTHEOREM +\THEOREM IS\_OCTAL numeral +|- IS_OCTAL = IS_BASEN 8 +\ENDTHEOREM \THEOREM IS\_OCTAL\_NIL numeral |- IS_OCTAL[] \ENDTHEOREM @@ -340,12 +337,12 @@ |- !digits. IS_OCTAL_NORMALIZED digits = IS_OCTAL digits /\ IS_NORMALIZED digits \ENDTHEOREM -\THEOREM LOG numeral -|- !r n. LOG r n = (@x. (r EXP x) <= n /\ n < (r EXP (x + 1))) -\ENDTHEOREM \THEOREM LOG\_1 numeral |- !r. 1 < r ==> (LOG r 1 = 0) \ENDTHEOREM +\THEOREM LOG numeral +|- !r n. LOG r n = (@x. (r EXP x) <= n /\ n < (r EXP (x + 1))) +\ENDTHEOREM \THEOREM NORMALIZED\_BASEN\_11 numeral |- !l1 l2 r. 1 < r ==> @@ -376,9 +373,6 @@ (BASEN r l1 = BASEN r l2) /\ (LENGTH l1) < (LENGTH l2)) \ENDTHEOREM -\THEOREM OCTAL numeral -|- OCTAL = BASEN 8 -\ENDTHEOREM \THEOREM OCTAL\_11 numeral |- !l1 l2. IS_OCTAL l1 ==> @@ -393,6 +387,9 @@ \THEOREM OCTAL\_DIGIT\_EQ\_DIGIT numeral |- !e. OCTAL[e] = e \ENDTHEOREM +\THEOREM OCTAL numeral +|- OCTAL = BASEN 8 +\ENDTHEOREM \THEOREM OCTAL\_EMPTY\_EQ\_0 numeral |- !l. IS_NORMALIZED l ==> ((OCTAL l = 0) = (l = [])) \ENDTHEOREM --- hol88-2.02.19940316.orig/Library/pred_sets/Manual/entries.tex +++ hol88-2.02.19940316/Library/pred_sets/Manual/entries.tex @@ -1,7 +1,4 @@ -\chapter{ML Functions in the Library} -\label{entries} -\input{entries-intro} -\DOC{DELETE\_CONV} +\chapter{ML Functions in the Library}\label{entries}\input{entries-intro}\DOC{DELETE\_CONV} \TYPE {\small\verb%DELETE_CONV : conv -> conv%}\egroup @@ -204,6 +201,84 @@ \ENDDOC +\DOC{IN\_CONV} + +\TYPE {\small\verb%IN_CONV : conv -> conv%}\egroup + +\SYNOPSIS +Decision procedure for membership in finite sets. + +\DESCRIBE +The function {\small\verb%IN_CONV%} is a parameterized conversion for proving or disproving +membership assertions of the general form: +{\par\samepage\setseps\small +\begin{verbatim} + "t IN {t1,...,tn}" +\end{verbatim} +} +\noindent where {\small\verb%{t1,...,tn}%} is a set of type {\small\verb%ty->bool%} and {\small\verb%t%} is a value +of the base type {\small\verb%ty%}. The first argument to {\small\verb%IN_CONV%} is expected to be a +conversion that decides equality between values of the base type {\small\verb%ty%}. Given +an equation {\small\verb%"e1 = e2"%}, where {\small\verb%e1%} and {\small\verb%e2%} are terms of type {\small\verb%ty%}, this +conversion should return the theorem {\small\verb%|- (e1 = e2) = T%} or the theorem +{\small\verb%|- (e1 = e2) = F%}, as appropriate. + +Given such a conversion, the function {\small\verb%IN_CONV%} returns a conversion that +maps a term of the form {\small\verb%"t IN {t1,...,tn}"%} to the theorem +{\par\samepage\setseps\small +\begin{verbatim} + |- t IN {t1,...,tn} = T +\end{verbatim} +} + +\noindent if {\small\verb%t%} is alpha-equivalent to any {\small\verb%ti%}, or if the supplied conversion +proves {\small\verb%|- (t = ti) = T%} for any {\small\verb%ti%}. If the supplied conversion proves +{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}, then the result is the theorem +{\par\samepage\setseps\small +\begin{verbatim} + |- t IN {t1,...,tn} = F +\end{verbatim} +} +\noindent In all other cases, {\small\verb%IN_CONV%} will fail. + +\EXAMPLE +In the following example, the conversion {\small\verb%num_EQ_CONV%} is supplied as a +parameter and used to test equality of the candidate element {\small\verb%1%} with the +actual elements of the given set. +{\par\samepage\setseps\small +\begin{verbatim} + #IN_CONV num_EQ_CONV "2 IN {0,SUC 1,3}";; + |- 2 IN {0,SUC 1,3} = T +\end{verbatim} +} +\noindent The result is {\small\verb%T%} because {\small\verb%num_EQ_CONV%} is able to prove that {\small\verb%2%} is +equal to {\small\verb%SUC 1%}. An example of a negative result is: +{\par\samepage\setseps\small +\begin{verbatim} + #IN_CONV num_EQ_CONV "1 IN {0,2,3}";; + |- 1 IN {0,2,3} = F +\end{verbatim} +} +\noindent Finally the behaviour of the supplied conversion is irrelevant when +the value to be tested for membership is alpha-equivalent to an actual element: +{\par\samepage\setseps\small +\begin{verbatim} + #IN_CONV NO_CONV "1 IN {3,2,1}";; + |- 1 IN {3,2,1} = T +\end{verbatim} +} +\noindent The conversion {\small\verb%NO_CONV%} always fails, but {\small\verb%IN_CONV%} is nontheless +able in this case to prove the required result. + +\FAILURE +{\small\verb%IN_CONV conv%} fails if applied to a term that is not of the form {\small\verb%"t IN +{t1,...,tn}"%}. A call {\small\verb%IN_CONV conv "t IN {t1,...,tn}"%} fails unless the +term {\small\verb%t%} is alpha-equivalent to some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns +{\small\verb%|- (t = ti) = T%} for some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns +{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}. + +\ENDDOC + \DOC{INSERT\_CONV} \TYPE {\small\verb%INSERT_CONV : conv -> conv%}\egroup @@ -290,84 +365,6 @@ \ENDDOC -\DOC{IN\_CONV} - -\TYPE {\small\verb%IN_CONV : conv -> conv%}\egroup - -\SYNOPSIS -Decision procedure for membership in finite sets. - -\DESCRIBE -The function {\small\verb%IN_CONV%} is a parameterized conversion for proving or disproving -membership assertions of the general form: -{\par\samepage\setseps\small -\begin{verbatim} - "t IN {t1,...,tn}" -\end{verbatim} -} -\noindent where {\small\verb%{t1,...,tn}%} is a set of type {\small\verb%ty->bool%} and {\small\verb%t%} is a value -of the base type {\small\verb%ty%}. The first argument to {\small\verb%IN_CONV%} is expected to be a -conversion that decides equality between values of the base type {\small\verb%ty%}. Given -an equation {\small\verb%"e1 = e2"%}, where {\small\verb%e1%} and {\small\verb%e2%} are terms of type {\small\verb%ty%}, this -conversion should return the theorem {\small\verb%|- (e1 = e2) = T%} or the theorem -{\small\verb%|- (e1 = e2) = F%}, as appropriate. - -Given such a conversion, the function {\small\verb%IN_CONV%} returns a conversion that -maps a term of the form {\small\verb%"t IN {t1,...,tn}"%} to the theorem -{\par\samepage\setseps\small -\begin{verbatim} - |- t IN {t1,...,tn} = T -\end{verbatim} -} - -\noindent if {\small\verb%t%} is alpha-equivalent to any {\small\verb%ti%}, or if the supplied conversion -proves {\small\verb%|- (t = ti) = T%} for any {\small\verb%ti%}. If the supplied conversion proves -{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}, then the result is the theorem -{\par\samepage\setseps\small -\begin{verbatim} - |- t IN {t1,...,tn} = F -\end{verbatim} -} -\noindent In all other cases, {\small\verb%IN_CONV%} will fail. - -\EXAMPLE -In the following example, the conversion {\small\verb%num_EQ_CONV%} is supplied as a -parameter and used to test equality of the candidate element {\small\verb%1%} with the -actual elements of the given set. -{\par\samepage\setseps\small -\begin{verbatim} - #IN_CONV num_EQ_CONV "2 IN {0,SUC 1,3}";; - |- 2 IN {0,SUC 1,3} = T -\end{verbatim} -} -\noindent The result is {\small\verb%T%} because {\small\verb%num_EQ_CONV%} is able to prove that {\small\verb%2%} is -equal to {\small\verb%SUC 1%}. An example of a negative result is: -{\par\samepage\setseps\small -\begin{verbatim} - #IN_CONV num_EQ_CONV "1 IN {0,2,3}";; - |- 1 IN {0,2,3} = F -\end{verbatim} -} -\noindent Finally the behaviour of the supplied conversion is irrelevant when -the value to be tested for membership is alpha-equivalent to an actual element: -{\par\samepage\setseps\small -\begin{verbatim} - #IN_CONV NO_CONV "1 IN {3,2,1}";; - |- 1 IN {3,2,1} = T -\end{verbatim} -} -\noindent The conversion {\small\verb%NO_CONV%} always fails, but {\small\verb%IN_CONV%} is nontheless -able in this case to prove the required result. - -\FAILURE -{\small\verb%IN_CONV conv%} fails if applied to a term that is not of the form {\small\verb%"t IN -{t1,...,tn}"%}. A call {\small\verb%IN_CONV conv "t IN {t1,...,tn}"%} fails unless the -term {\small\verb%t%} is alpha-equivalent to some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns -{\small\verb%|- (t = ti) = T%} for some {\small\verb%ti%}, or {\small\verb%conv "t = ti"%} returns -{\small\verb%|- (t = ti) = F%} for every {\small\verb%ti%}. - -\ENDDOC - \DOC{SET\_INDUCT\_TAC} \TYPE {\small\verb%SET_INDUCT_TAC : tactic%}\egroup --- hol88-2.02.19940316.orig/Library/res_quan/Manual/entries.tex +++ hol88-2.02.19940316/Library/res_quan/Manual/entries.tex @@ -1,6 +1,142 @@ -\chapter{ML Functions in the {\tt res\_quan} Library} -\label{entries} -\input{entries-intro} +\chapter{ML Functions in the {\tt res\_quan} Library}\label{entries}\input{entries-intro}\DOC{COND\_REWR\_CANON} + +\TYPE {\small\verb%COND_REWR_CANON : thm -> thm%}\egroup + +\SYNOPSIS +Transform a theorem into a form accepted by {\small\verb%COND_REWR_TAC%}. + +\DESCRIBE +{\small\verb%COND_REWR_CANON%} transforms a theorem into a form accepted by {\small\verb%COND_REWR_TAC%}. +The input theorem should be an implication of the following form +{\par\samepage\setseps\small +\begin{verbatim} + !x1 ... xn. P1[xi] ==> ... ==> !y1 ... ym. Pr[xi,yi] ==> + (!z1 ... zk. u[xi,yi,zi] = v[xi,yi,zi]) +\end{verbatim} +} +\noindent where each antecedent {\small\verb%Pi%} itself may be a conjunction or +disjunction. The output theorem will have all universal quantifications +moved to the outer most level with possible renaming to prevent +variable capture, and have all antecedents which are a conjunction +transformed to implications. The output theorem will be in the +following form +{\par\samepage\setseps\small +\begin{verbatim} + !x1 ... xn y1 ... ym z1 ... zk. + P11[xi] ==> ... ==> P1p[xi] ==> ... ==> + Pr1[xi,yi] ==> ... ==> Prq[x1,yi] ==> (u[xi,yi,zi] = v[xi,yi,zi]) +\end{verbatim} +} + +\FAILURE +This function fails if the input theorem is not in the correct form. + +\EXAMPLE +{\small\verb%COND_REWR_CANON%} transforms the built-in theorem {\small\verb%CANCL_SUB%} into the +form for conditional rewriting: +{\par\samepage\setseps\small +\begin{verbatim} + #COND_REWR_CANON CANCEL_SUB;; + Theorem CANCEL_SUB autoloading from theory `arithmetic` ... + CANCEL_SUB = |- !p n m. p <= n /\ p <= m ==> ((n - p = m - p) = (n = m)) + + |- !p n m. p <= n ==> p <= m ==> ((n - p = m - p) = (n = m)) +\end{verbatim} +} + +\SEEALSO +COND_REWRITE1_TAC, COND_REWR_TAC, COND_REWRITE1_CONV, COND_REWR_CONV, +search_top_down. + +\ENDDOC + +\DOC{COND\_REWR\_CONV} + +{\small +\begin{verbatim} +COND_REWR_CONV : ((term -> term -> + ((term # term) list # (type # type) list) list) -> thm -> conv) +\end{verbatim} +}\egroup + +\SYNOPSIS +A lower level conversion implementing simple conditional rewriting. + +\DESCRIBE +{\small\verb%COND_REWR_CONV%} is one of the basic building blocks for the +implementation of the simple conditional rewriting conversions in the +HOL system. In particular, the conditional term replacement or +rewriting done by all the conditional +rewriting conversions in this library is ultimately done by applications of +{\small\verb%COND_REWR_CONV%}. The description given here for {\small\verb%COND_REWR_CONV%} may +therefore be taken as a specification of the atomic action of +replacing equals by equals in a term under certain conditions that +are used in all these higher level conditional rewriting conversions. + +The first argument to {\small\verb%COND_REWR_CONV%} is expected to be a function +which returns a list of matches. Each of these matches is in the form +of the value returned by the built-in function {\small\verb%match%}. It is used to +search the input term for instances which may be rewritten. + +The second argument to {\small\verb%COND_REWR_CONV%} is expected to be an +implicative theorem in the following form: +{\par\samepage\setseps\small +\begin{verbatim} + A |- !x1 ... xn. P1 ==> ... Pm ==> (Q[x1,...,xn] = R[x1,...,xn]) +\end{verbatim} +} +\noindent where {\small\verb%x1%}, ..., {\small\verb%xn%} are all the variables that occur free in the +left hand side of the conclusion of the theorem but do not occur free in the +assumptions. + +The last argument to {\small\verb%COND_REWR_CONV%} is the term to be rewritten. + +If {\small\verb%fn%} is a function and {\small\verb%th%} is an implicative theorem of the kind +shown above, then {\small\verb%COND_REWR_CONV fn th%} will be a conversion. +When applying to a term {\small\verb%tm%}, it will return a theorem +{\par\samepage\setseps\small +\begin{verbatim} + P1', ..., Pm' |- tm = tm[R'/Q'] +\end{verbatim} +} +\noindent if evaluating {\small\verb%fn Q[x1,...,xn] tm%} returns a +non-empty list of matches. +The assumptions of the resulting theorem are instances of the +antecedents of the input theorem {\small\verb%th%}. The right hand side of the +equation is obtained by rewriting the input term {\small\verb%tm%} with instances of +the conclusion of the input theorem. + +\FAILURE +{\small\verb%COND_REWR_CONV fn th%} fails if {\small\verb%th%} is not an implication of the form +described above. If {\small\verb%th%} is such an equation, but the function {\small\verb%fn%} +returns a null list of matches, or the function {\small\verb%fn%} returns a +non-empty list of matches, but the term or type instantiation fails. + +\EXAMPLE +The following example illustrates a straightforward use of {\small\verb%COND_REWR_CONV%}. +We use the built-in theorem {\small\verb%LESS_MOD%} as the input theorem, and the function +{\small\verb%search_top_down%} as the search function. +{\par\samepage\setseps\small +\begin{verbatim} + #LESS_MOD;; + Theorem LESS_MOD autoloading from theory `arithmetic` ... + LESS_MOD = |- !n k. k < n ==> (k MOD n = k) + + |- !n k. k < n ==> (k MOD n = k) + + #search_top_down;; + - : (term -> term -> ((term # term) list # (type # type) list) list) + + #COND_REWR_CONV search_top_down LESS_MOD "2 MOD 3";; + 2 < 3 |- 2 MOD 3 = 2 +\end{verbatim} +} + +\SEEALSO +COND_REWR_TAC, COND_REWRITE1_TAC, COND_REWRITE1_CONV, COND_REWR_CANON, +search_top_down. + +\ENDDOC \DOC{COND\_REWRITE1\_CONV} \TYPE {\small\verb%COND_REWRITE1_CONV : (thm list -> thm -> conv)%}\egroup @@ -147,145 +283,6 @@ \ENDDOC -\DOC{COND\_REWR\_CANON} - -\TYPE {\small\verb%COND_REWR_CANON : thm -> thm%}\egroup - -\SYNOPSIS -Transform a theorem into a form accepted by {\small\verb%COND_REWR_TAC%}. - -\DESCRIBE -{\small\verb%COND_REWR_CANON%} transforms a theorem into a form accepted by {\small\verb%COND_REWR_TAC%}. -The input theorem should be an implication of the following form -{\par\samepage\setseps\small -\begin{verbatim} - !x1 ... xn. P1[xi] ==> ... ==> !y1 ... ym. Pr[xi,yi] ==> - (!z1 ... zk. u[xi,yi,zi] = v[xi,yi,zi]) -\end{verbatim} -} -\noindent where each antecedent {\small\verb%Pi%} itself may be a conjunction or -disjunction. The output theorem will have all universal quantifications -moved to the outer most level with possible renaming to prevent -variable capture, and have all antecedents which are a conjunction -transformed to implications. The output theorem will be in the -following form -{\par\samepage\setseps\small -\begin{verbatim} - !x1 ... xn y1 ... ym z1 ... zk. - P11[xi] ==> ... ==> P1p[xi] ==> ... ==> - Pr1[xi,yi] ==> ... ==> Prq[x1,yi] ==> (u[xi,yi,zi] = v[xi,yi,zi]) -\end{verbatim} -} - -\FAILURE -This function fails if the input theorem is not in the correct form. - -\EXAMPLE -{\small\verb%COND_REWR_CANON%} transforms the built-in theorem {\small\verb%CANCL_SUB%} into the -form for conditional rewriting: -{\par\samepage\setseps\small -\begin{verbatim} - #COND_REWR_CANON CANCEL_SUB;; - Theorem CANCEL_SUB autoloading from theory `arithmetic` ... - CANCEL_SUB = |- !p n m. p <= n /\ p <= m ==> ((n - p = m - p) = (n = m)) - - |- !p n m. p <= n ==> p <= m ==> ((n - p = m - p) = (n = m)) -\end{verbatim} -} - -\SEEALSO -COND_REWRITE1_TAC, COND_REWR_TAC, COND_REWRITE1_CONV, COND_REWR_CONV, -search_top_down. - -\ENDDOC - -\DOC{COND\_REWR\_CONV} - -{\small -\begin{verbatim} -COND_REWR_CONV : ((term -> term -> - ((term # term) list # (type # type) list) list) -> thm -> conv) -\end{verbatim} -}\egroup - -\SYNOPSIS -A lower level conversion implementing simple conditional rewriting. - -\DESCRIBE -{\small\verb%COND_REWR_CONV%} is one of the basic building blocks for the -implementation of the simple conditional rewriting conversions in the -HOL system. In particular, the conditional term replacement or -rewriting done by all the conditional -rewriting conversions in this library is ultimately done by applications of -{\small\verb%COND_REWR_CONV%}. The description given here for {\small\verb%COND_REWR_CONV%} may -therefore be taken as a specification of the atomic action of -replacing equals by equals in a term under certain conditions that -are used in all these higher level conditional rewriting conversions. - -The first argument to {\small\verb%COND_REWR_CONV%} is expected to be a function -which returns a list of matches. Each of these matches is in the form -of the value returned by the built-in function {\small\verb%match%}. It is used to -search the input term for instances which may be rewritten. - -The second argument to {\small\verb%COND_REWR_CONV%} is expected to be an -implicative theorem in the following form: -{\par\samepage\setseps\small -\begin{verbatim} - A |- !x1 ... xn. P1 ==> ... Pm ==> (Q[x1,...,xn] = R[x1,...,xn]) -\end{verbatim} -} -\noindent where {\small\verb%x1%}, ..., {\small\verb%xn%} are all the variables that occur free in the -left hand side of the conclusion of the theorem but do not occur free in the -assumptions. - -The last argument to {\small\verb%COND_REWR_CONV%} is the term to be rewritten. - -If {\small\verb%fn%} is a function and {\small\verb%th%} is an implicative theorem of the kind -shown above, then {\small\verb%COND_REWR_CONV fn th%} will be a conversion. -When applying to a term {\small\verb%tm%}, it will return a theorem -{\par\samepage\setseps\small -\begin{verbatim} - P1', ..., Pm' |- tm = tm[R'/Q'] -\end{verbatim} -} -\noindent if evaluating {\small\verb%fn Q[x1,...,xn] tm%} returns a -non-empty list of matches. -The assumptions of the resulting theorem are instances of the -antecedents of the input theorem {\small\verb%th%}. The right hand side of the -equation is obtained by rewriting the input term {\small\verb%tm%} with instances of -the conclusion of the input theorem. - -\FAILURE -{\small\verb%COND_REWR_CONV fn th%} fails if {\small\verb%th%} is not an implication of the form -described above. If {\small\verb%th%} is such an equation, but the function {\small\verb%fn%} -returns a null list of matches, or the function {\small\verb%fn%} returns a -non-empty list of matches, but the term or type instantiation fails. - -\EXAMPLE -The following example illustrates a straightforward use of {\small\verb%COND_REWR_CONV%}. -We use the built-in theorem {\small\verb%LESS_MOD%} as the input theorem, and the function -{\small\verb%search_top_down%} as the search function. -{\par\samepage\setseps\small -\begin{verbatim} - #LESS_MOD;; - Theorem LESS_MOD autoloading from theory `arithmetic` ... - LESS_MOD = |- !n k. k < n ==> (k MOD n = k) - - |- !n k. k < n ==> (k MOD n = k) - - #search_top_down;; - - : (term -> term -> ((term # term) list # (type # type) list) list) - - #COND_REWR_CONV search_top_down LESS_MOD "2 MOD 3";; - 2 < 3 |- 2 MOD 3 = 2 -\end{verbatim} -} - -\SEEALSO -COND_REWR_TAC, COND_REWRITE1_TAC, COND_REWRITE1_CONV, COND_REWR_CANON, -search_top_down. - -\ENDDOC \DOC{COND\_REWR\_TAC} {\small @@ -553,6 +550,36 @@ mk_resq_select, is_resq_select, strip_resq_select. \ENDDOC +\DOC{GQSPEC\_ALL} + +\TYPE {\small\verb%GQSPEC_ALL : (thm -> thm)%}\egroup + +\SYNOPSIS +Specializes the conclusion of a theorem with its own quantified variables. + +\DESCRIBE +When applied to a theorem whose conclusion has zero or more +ordinary or restricted universal quantifications, +the inference rule {\small\verb%GQSPEC_ALL%} returns a theorem which is the result +of specializing the quantified variables with its own variables. If this +will cause name clashes, a variant of the variable is used instead. +Normally {\small\verb%xi'%} is just {\small\verb%xi%}, in which case {\small\verb%GQSPEC_ALL%} simply removes +all universal quantifiers. +{\par\samepage\setseps\small +\begin{verbatim} + A |- !x1::P1. ...!xk. ... !xn::Pn. t + ------------------------------------------------------ GQSPEC_ALL + A,P1 x1,...,Pn xn |- t[x1'/x1]...[xk'/xk]...[xn'/xn] +\end{verbatim} +} +\FAILURE +Never fails. + +\SEEALSO +GQSPEC, GQSPECL, SPEC, SPECL, SPEC_ALL, RESQ_GEN, RESQ_GENL, +RESQ_GEN_ALL, RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPECL, RESQ_SPEC_ALL. + +\ENDDOC \DOC{GQSPECL} \TYPE {\small\verb%GQSPECL : (term list -> thm -> thm)%}\egroup @@ -588,36 +615,6 @@ RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPECL, RESQ_SPEC_ALL. \ENDDOC -\DOC{GQSPEC\_ALL} - -\TYPE {\small\verb%GQSPEC_ALL : (thm -> thm)%}\egroup - -\SYNOPSIS -Specializes the conclusion of a theorem with its own quantified variables. - -\DESCRIBE -When applied to a theorem whose conclusion has zero or more -ordinary or restricted universal quantifications, -the inference rule {\small\verb%GQSPEC_ALL%} returns a theorem which is the result -of specializing the quantified variables with its own variables. If this -will cause name clashes, a variant of the variable is used instead. -Normally {\small\verb%xi'%} is just {\small\verb%xi%}, in which case {\small\verb%GQSPEC_ALL%} simply removes -all universal quantifiers. -{\par\samepage\setseps\small -\begin{verbatim} - A |- !x1::P1. ...!xk. ... !xn::Pn. t - ------------------------------------------------------ GQSPEC_ALL - A,P1 x1,...,Pn xn |- t[x1'/x1]...[xk'/xk]...[xn'/xn] -\end{verbatim} -} -\FAILURE -Never fails. - -\SEEALSO -GQSPEC, GQSPECL, SPEC, SPECL, SPEC_ALL, RESQ_GEN, RESQ_GENL, -RESQ_GEN_ALL, RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPECL, RESQ_SPEC_ALL. - -\ENDDOC \DOC{IMP\_RESQ\_FORALL\_CONV} \TYPE {\small\verb%IMP_RESQ_FORALL_CONV : conv%}\egroup @@ -1216,6 +1213,31 @@ RESQ_FORALL_CONV. \ENDDOC +\DOC{RESQ\_GEN\_ALL} + +\TYPE {\small\verb%RESQ_GEN_ALL : (thm -> thm)%}\egroup + +\SYNOPSIS +Generalizes the conclusion of a theorem over its own assumptions. + +\DESCRIBE +When applied to a theorem {\small\verb%A |- t%}, the inference rule {\small\verb%RESQ_GEN_ALL%} returns +the theorem {\small\verb%A' |- !x1::P1. ...!xn::Pn. t%}, where the {\small\verb%Pi xi%} are in the +assumptions. +{\par\samepage\setseps\small +\begin{verbatim} + A |- t + ------------------------------------------------ RESQ_GEN_ALL + A - (P1 x1,...,Pn xn) |- !x1::P1. ... !xn::Pn. t +\end{verbatim} +} +\FAILURE +Never fails. + +\SEEALSO +RESQ_GEN, RESQ_GENL, GEN_ALL, RESQ_SPEC, RESQ_SPECL, RESQ_SPEC_ALL. + +\ENDDOC \DOC{RESQ\_GEN} \TYPE {\small\verb%RESQ_GEN : ((term # term) -> thm -> thm)%}\egroup @@ -1274,31 +1296,6 @@ RESQ_GEN, RESQ_GEN_ALL, RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPECL, RESQ_SPEC_ALL. \ENDDOC -\DOC{RESQ\_GEN\_ALL} - -\TYPE {\small\verb%RESQ_GEN_ALL : (thm -> thm)%}\egroup - -\SYNOPSIS -Generalizes the conclusion of a theorem over its own assumptions. - -\DESCRIBE -When applied to a theorem {\small\verb%A |- t%}, the inference rule {\small\verb%RESQ_GEN_ALL%} returns -the theorem {\small\verb%A' |- !x1::P1. ...!xn::Pn. t%}, where the {\small\verb%Pi xi%} are in the -assumptions. -{\par\samepage\setseps\small -\begin{verbatim} - A |- t - ------------------------------------------------ RESQ_GEN_ALL - A - (P1 x1,...,Pn xn) |- !x1::P1. ... !xn::Pn. t -\end{verbatim} -} -\FAILURE -Never fails. - -\SEEALSO -RESQ_GEN, RESQ_GENL, GEN_ALL, RESQ_SPEC, RESQ_SPECL, RESQ_SPEC_ALL. - -\ENDDOC \DOC{RESQ\_GEN\_TAC} \TYPE {\small\verb%RESQ_GEN_TAC : tactic%}\egroup @@ -1571,6 +1568,40 @@ IMP_RES_THEN, IMP_RES_TAC, MATCH_MP, RES_CANON, RES_TAC, RES_THEN. \ENDDOC +\DOC{RESQ\_REWR\_CANON} + +\TYPE {\small\verb%RESQ_REWR_CANON : thm -> thm%}\egroup + +\SYNOPSIS +Transform a theorem into a form accepted for rewriting. + +\DESCRIBE +{\small\verb%RESQ_REWR_CANON%} transforms a theorem into a form accepted by {\small\verb%COND_REWR_TAC%}. +The input theorem should be headed by a series of restricted universal +quantifications in the following form +{\par\samepage\setseps\small +\begin{verbatim} + !x1::P1. ... !xn::Pn. u[xi] = v[xi]) +\end{verbatim} +} +\noindent Other variables occurring in {\small\verb%u%} and {\small\verb%v%} may be universally quantified. +The output theorem will have all ordinary universal quantifications +moved to the outer most level with possible renaming to prevent +variable capture, and have all restricted universal quantifications +converted to implications. The output theorem will be in the +form accepted by {\small\verb%COND_REWR_TAC%}. + +\FAILURE +This function fails is the input theorem is not in the correct form. + + +\SEEALSO +RESQ_REWRITE1_TAC, RESQ_REWRITE1_CONV, +COND_REWR_CANON, COND_REWR_TAC, COND_REWR_CONV,. + + +\ENDDOC + \DOC{RESQ\_REWRITE1\_CONV} \TYPE {\small\verb%RESQ_REWRITE1_CONV : thm list -> thm -> conv%}\egroup @@ -1656,40 +1687,38 @@ \ENDDOC -\DOC{RESQ\_REWR\_CANON} +\DOC{RESQ\_SPEC\_ALL} -\TYPE {\small\verb%RESQ_REWR_CANON : thm -> thm%}\egroup +\TYPE {\small\verb%RESQ_SPEC_ALL : (thm -> thm)%}\egroup \SYNOPSIS -Transform a theorem into a form accepted for rewriting. +Specializes the conclusion of a theorem with its own restricted +quantified variables. \DESCRIBE -{\small\verb%RESQ_REWR_CANON%} transforms a theorem into a form accepted by {\small\verb%COND_REWR_TAC%}. -The input theorem should be headed by a series of restricted universal -quantifications in the following form +When applied to a theorem {\small\verb%A |- !x1::P1. ...!xn::Pn. t%}, +the inference rule {\small\verb%RESQ_SPEC_ALL%} +returns the theorem {\small\verb%A,P1 x1',...,Pn xn' |- 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%RESQ_SPEC_ALL%} simply removes all restricted + universal quantifiers. {\par\samepage\setseps\small \begin{verbatim} - !x1::P1. ... !xn::Pn. u[xi] = v[xi]) + A |- !x1::P1. ... !xn::Pn. t + ------------------------------------------- RESQ_SPEC_ALL + A,P1 x1,...,Pn xn |- t[x1'/x1]...[xn'/xn] \end{verbatim} } -\noindent Other variables occurring in {\small\verb%u%} and {\small\verb%v%} may be universally quantified. -The output theorem will have all ordinary universal quantifications -moved to the outer most level with possible renaming to prevent -variable capture, and have all restricted universal quantifications -converted to implications. The output theorem will be in the -form accepted by {\small\verb%COND_REWR_TAC%}. \FAILURE -This function fails is the input theorem is not in the correct form. - +Never fails. \SEEALSO -RESQ_REWRITE1_TAC, RESQ_REWRITE1_CONV, -COND_REWR_CANON, COND_REWR_TAC, COND_REWR_CONV,. - +RESQ_GEN, RESQ_GENL, RESQ_GEN_ALL, RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPECL. \ENDDOC - \DOC{RESQ\_SPEC} \TYPE {\small\verb%RESQ_SPEC : (term -> thm -> thm)%}\egroup @@ -1769,38 +1798,6 @@ RESQ_GEN, RESQ_GENL, RESQ_GEN_ALL, RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPEC_ALL. \ENDDOC -\DOC{RESQ\_SPEC\_ALL} - -\TYPE {\small\verb%RESQ_SPEC_ALL : (thm -> thm)%}\egroup - -\SYNOPSIS -Specializes the conclusion of a theorem with its own restricted -quantified variables. - -\DESCRIBE -When applied to a theorem {\small\verb%A |- !x1::P1. ...!xn::Pn. t%}, -the inference rule {\small\verb%RESQ_SPEC_ALL%} -returns the theorem {\small\verb%A,P1 x1',...,Pn xn' |- 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%RESQ_SPEC_ALL%} simply removes all restricted - universal quantifiers. -{\par\samepage\setseps\small -\begin{verbatim} - A |- !x1::P1. ... !xn::Pn. t - ------------------------------------------- RESQ_SPEC_ALL - A,P1 x1,...,Pn xn |- t[x1'/x1]...[xn'/xn] -\end{verbatim} -} - -\FAILURE -Never fails. - -\SEEALSO -RESQ_GEN, RESQ_GENL, RESQ_GEN_ALL, RESQ_GEN_TAC, RESQ_SPEC, RESQ_SPECL. - -\ENDDOC \DOC{search\_top\_down} {\small --- hol88-2.02.19940316.orig/Library/res_quan/Manual/theorems.tex +++ hol88-2.02.19940316/Library/res_quan/Manual/theorems.tex @@ -1,6 +1,4 @@ -\chapter{Pre-proved Theorems} -\input{theorems-intro} -\THEOREM DISJ\_RESQ\_EXISTS\_DIST res\_quan +\chapter{Pre-proved Theorems}\input{theorems-intro}\THEOREM DISJ\_RESQ\_EXISTS\_DIST res\_quan |- !P Q R. (?i :: \i. P i \/ Q i. R i) = (?i :: P. R i) \/ (?i :: Q. R i) \ENDTHEOREM --- hol88-2.02.19940316.orig/debian/compat +++ hol88-2.02.19940316/debian/compat @@ -0,0 +1 @@ +5 --- hol88-2.02.19940316.orig/debian/gcl_patch.l +++ hol88-2.02.19940316/debian/gcl_patch.l @@ -0,0 +1,72 @@ +(in-package 'compiler) +(defun make-user-init (files outn) + + (let* ((c (pathname outn)) + (c (merge-pathnames c (make-pathname :directory '(:current)))) + (o (merge-pathnames (make-pathname :type "o") c)) + (c (merge-pathnames (make-pathname :type "c") c))) + + (with-open-file (st c :direction :output) + (format st "#include ~a~%~%" *cmpinclude*) + + (format st "#define load2(a) do {") + (format st "printf(\"Loading %s...\\n\",(a));") + (format st "load(a);") + (format st "printf(\"Finished %s...\\n\",(a));} while(0)~%~%") + + (let ((p nil)) + (dolist (tem files) + (when (equal (pathname-type tem) "o") + (let ((tem (namestring tem))) + (push (list (si::find-init-name tem) tem) p)))) + + (setq p (nreverse p)) + + (dolist (tem p) + (format st "extern void ~a(void);~%" (car tem))) + (format st "~%") + + (format st "typedef struct {void (*fn)(void);char *s;} Fnlst;~%") + (format st "#define NF ~a~%" (length p)) + (format st "static Fnlst my_fnlst[NF]={") + (dolist (tem p) + (when (not (eq tem (car p))) + (format st ",~%")) + (format st "{~a,\"~a\"}" (car tem) (cadr tem))) + (format st "};~%~%") + + (format st "static int user_init_run;~%") + (format st "#define my_load(a_,b_) {if (!user_init_run && (a_)) gcl_init_or_load1((a_),(b_));(a_)=0;}~%~%") + + (format st "object user_init(void) {~%") + (format st "user_init_run=1;~%") + (dolist (tem files) + (let ((tem (namestring tem))) + (cond ((equal (cadr (car p)) tem) + (format st "gcl_init_or_load1(~a,\"~a\");~%" + (car (car p)) tem) + (setq p (cdr p))) + (t + (format st "load2(\"~a\");~%" tem))))) + (format st "return Cnil;}~%~%") + + (format st "int user_match(const char *s,int n) {~%") + (format st " Fnlst *f;~%") + (format st " for (f=my_fnlst;fs,n)) {~%") + (format st " my_load(f->fn,f->s);~%") + (format st " return 1;~%") + (format st " }~%") + (format st " }~%") + (format st " return 0;~%") + (format st "}~%~%"))) + + (compiler-cc c o) +; (system (format nil "~a ~a" *cc* tem)) +; (with-open-file (s c) (si::copy-stream s *standard-output*)) + (delete-file c) + + o)) +(setq *default-system-p* t) +(in-package 'user) +(delete :native-reloc *features*) --- hol88-2.02.19940316.orig/debian/control +++ hol88-2.02.19940316/debian/control @@ -0,0 +1,104 @@ +Source: hol88 +Section: math +Priority: optional +Maintainer: Camm Maguire +Build-Depends: debhelper (>= 5), gcl (>= 2.6.7-62), texlive-latex-base, libgmp3-dev, libncurses5-dev, libreadline-dev, libxmu-dev, libxaw7-dev +Standards-Version: 3.9.1 + +Package: hol88 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Higher Order Logic, system image + The HOL System is an environment for interactive theorem proving in a + higher-order logic. Its most outstanding feature is its high degree + of programmability through the meta-language ML. The system has a + wide variety of uses from formalizing pure mathematics to + verification of industrial hardware. Academic and industrial sites + world-wide are using HOL. + +Package: hol88-source +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Higher Order Logic, source files + The HOL System is an environment for interactive theorem proving in a + higher-order logic. Its most outstanding feature is its high degree + of programmability through the meta-language ML. The system has a + wide variety of uses from formalizing pure mathematics to + verification of industrial hardware. Academic and industrial sites + world-wide are using HOL. + +Package: hol88-help +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Higher Order Logic, online help files + The HOL System is an environment for interactive theorem proving in a + higher-order logic. Its most outstanding feature is its high degree + of programmability through the meta-language ML. The system has a + wide variety of uses from formalizing pure mathematics to + verification of industrial hardware. Academic and industrial sites + world-wide are using HOL. + +Package: hol88-library +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Higher Order Logic, binary library modules + The HOL System is an environment for interactive theorem proving in a + higher-order logic. Its most outstanding feature is its high degree + of programmability through the meta-language ML. The system has a + wide variety of uses from formalizing pure mathematics to + verification of industrial hardware. Academic and industrial sites + world-wide are using HOL. + +Package: hol88-library-source +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Higher Order Logic, library source files + The HOL System is an environment for interactive theorem proving in a + higher-order logic. Its most outstanding feature is its high degree + of programmability through the meta-language ML. The system has a + wide variety of uses from formalizing pure mathematics to + verification of industrial hardware. Academic and industrial sites + world-wide are using HOL. + +Package: hol88-library-help +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Higher Order Logic, library online help files + The HOL System is an environment for interactive theorem proving in a + higher-order logic. Its most outstanding feature is its high degree + of programmability through the meta-language ML. The system has a + wide variety of uses from formalizing pure mathematics to + verification of industrial hardware. Academic and industrial sites + world-wide are using HOL. + +Package: hol88-contrib-source +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Higher Order Logic, user contributed source + The HOL System is an environment for interactive theorem proving in a + higher-order logic. Its most outstanding feature is its high degree + of programmability through the meta-language ML. The system has a + wide variety of uses from formalizing pure mathematics to + verification of industrial hardware. Academic and industrial sites + world-wide are using HOL. + +Package: hol88-contrib-help +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Higher Order Logic, user contributed online help files + The HOL System is an environment for interactive theorem proving in a + higher-order logic. Its most outstanding feature is its high degree + of programmability through the meta-language ML. The system has a + wide variety of uses from formalizing pure mathematics to + verification of industrial hardware. Academic and industrial sites + world-wide are using HOL. + +Package: hol88-doc +Architecture: all +Description: Documentation for hol88 + The HOL System is an environment for interactive theorem proving in a + higher-order logic. Its most outstanding feature is its high degree + of programmability through the meta-language ML. The system has a + wide variety of uses from formalizing pure mathematics to + verification of industrial hardware. Academic and industrial sites + world-wide are using HOL. --- hol88-2.02.19940316.orig/debian/hol88.manpages +++ hol88-2.02.19940316/debian/hol88.manpages @@ -0,0 +1 @@ +debian/hol88.1 --- hol88-2.02.19940316.orig/debian/hol88.1 +++ hol88-2.02.19940316/debian/hol88.1 @@ -0,0 +1,35 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH HOL88 1 "October 26, 2006" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +hol88 \- Higher Order Logic +.SH SYNOPSIS +.B hol88 +.SH DESCRIPTION +This manual page documents briefly the +.B hol88 +command. +This manual page was written for the Debian GNU/Linux distribution +because the original program does not have a manual page. Instead, it +has online documentation provided via the hol88-help and +hol88-library-help packages, and in dvi format as provided in the +hol88-doc package. The documentation can also be found at the +project's website, http://www.ftp.cl.cam.ac.uk/ftp/hvg/hol88, in +various forms. +.SH AUTHOR +This manual page was written by Camm Maguire, , +for the Debian GNU/Linux system (but may be used by others). --- hol88-2.02.19940316.orig/debian/rules +++ hol88-2.02.19940316/debian/rules @@ -0,0 +1,214 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. +# +# Modified to make a template file for a multi-binary package with separated +# build-arch and build-indep targets by Bill Allombert 2001 + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +PN:=hol88 +VR:=$(shell awk '{if (i) next;i=1;a=$$2;gsub("[()]","",a);split(a,A,"-");print A[1];}' debian/changelog) +PD:=$(PN)-$(VR) + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + cat debian/dash.p | patch -p1 + touch configure-stamp + + +build: build-arch build-indep + +build-arch: build-arch-stamp +build-arch-stamp: configure-stamp + + echo '#-native-reloc(bye -1)' | gcl || cat debian/gcl_patch.l debian/gcl_save.l | gcl + PATH=$$(pwd):$$PATH $(MAKE) all + find -name "raw_*_map" -exec rm {} \; + for i in $$(find -maxdepth 1 -name "*hol*"); do \ + printf 'install `'/usr/share/$(PD)'`;;\nlisp `(ml-save "foo")`;;\n' | ./$$i &&\ + mv foo $$i; done + touch $@ + +build-indep: build-indep-stamp +build-indep-stamp: configure-stamp + + + for i in Manual/Tutorial/ack.tex Manual/Reference/ack.tex Manual/Description/ack.tex; do\ + ln -snf ../Latex/ack.tex $$i ; done + for i in $$(find Library -name index.tex) Library/pred_sets/Manual/theorems.tex Library/record_proof/Manual/record_proof.ind ; do\ + [ -e $$i.sve ] || cp $$i $$i.sve ; done + $(MAKE) -C Manual all + touch $@ + +INSTALLA:=$(addprefix debian/,$(addsuffix .install,\ + hol88 hol88-library)) +INSTALLI:=$(addprefix debian/,$(addsuffix .install,\ + hol88-source hol88-help hol88-library-source\ + hol88-library-help hol88-contrib-source hol88-contrib-help hol88-doc)) +LINKS:=$(addprefix debian/,$(addsuffix .links,hol88 hol88-library)) + +clean: + dh_testdir + dh_testroot + + ! [ -e configure-stamp ] || cat debian/dash.p | patch -p1 -R + rm -f build-arch-stamp build-indep-stamp configure-stamp + + [ ! -f Makefile ] || $(MAKE) clean + [ ! -f Makefile ] || $(MAKE) clobber + for i in $$(find Library -name index.tex) Library/pred_sets/Manual/theorems.tex Library/record_proof/Manual/record_proof.ind ; do\ + [ -e $$i.sve ] || cp $$i $$i.sve ; done + [ ! -f Makefile ] || $(MAKE) -C Manual clean + + [ ! -f Makefile ] || for i in $$(find Library -name Manual); do $(MAKE) -C $$i clean ; done + find -name X.tex -exec rm -rf {} \; + + dh_clean -X./ml/site.ml.orig -X./contrib/tooltool/Makefile.orig \ + -X./contrib/tooltool/events.c.orig -X./contrib/tooltool/func_fix.c.orig \ + -X./contrib/tooltool/lex.c.orig -X./contrib/tooltool/parse.y.orig \ + -X./contrib/tooltool/patchlevel.h.orig -X./contrib/tooltool/windows.c.orig \ + -X./contrib/Xhelp/hol_apro.orig -X./contrib/Xhelp/hol_ref.orig \ + -X./contrib/Xhelp/xholhelp.h.orig -X./contrib/Xhelp/hol_thm.orig + + for i in $$(find Library -name "*.sve") ; do mv $$i $$(echo $$i | sed "s,\.sve,,1"); done + + rm -f $(INSTALLA) $(INSTALLI) $(LINKS) debian/hol88.sh + find -name "*.dvi" -exec rm {} \; + rm -f Manual/Tutorial/ack.tex Manual/Reference/ack.tex Manual/Description/ack.tex + rm -f Manual/Covers/titlepages.ps Manual/Covers/endpages.ps + rm -f bm.l foo* gcl + cp debian/site_ml_orig ml/site.ml.orig + + +debian/hol88.install:: + find -maxdepth 1 -name "*hol*" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/lib/$(PD)/%s\n",$$1,a);}' >>$@ + echo debian/hol88.sh usr/bin >>$@ +debian/hol88-source.install:: + find lisp -name "*.l" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@ + find ml -type f -name "*ml" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@ + find theories -type f -name "*ml" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@ + find theories -type f -name "*th" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@ +debian/hol88-help.install:: + find help -name "*.doc" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@ + +debian/hol88-library.install:: + find Library -name "*.o" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/lib/$(PD)/%s\n",$$1,a);}' >>$@ +debian/hol88-library-source.install:: + find Library -name "*.ml" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@ +debian/hol88-library-help.install:: + find Library -name "*.doc" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@ + +debian/hol88-contrib-source.install:: + find contrib -name "*.ml" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@ + find contrib -name "Makefile" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@ +debian/hol88-contrib-help.install:: + find contrib -name "*.doc" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@ + +debian/hol88-doc.install:: + find Manual -name "*dvi" | grep -v makeindex | grep -v psfig | \ + awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/doc/hol88-doc/%s\n",$$1,a);}' >>$@ + find Manual -name "*ps" | grep -v makeindex | grep -v psfig | \ + awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/doc/hol88-doc/%s\n",$$1,a);}' >>$@ + + +debian/hol88.links:: + find * -maxdepth 0 -name "*hol*" | awk '{printf("/usr/lib/$(PD)/%s usr/share/$(PD)/%s\n",$$1,$$1);}' >>$@ +debian/hol88-library.links:: + find Library -name "*.o" | awk '{printf("/usr/lib/$(PD)/%s usr/share/$(PD)/%s\n",$$1,$$1);}' >>$@ + + +debian/hol88.sh: + echo "#!/bin/bash" >$@ + echo >>$@ + echo "exec /usr/lib/$(PD)/hol" >>$@ + chmod 755 $@ + + +install: install-indep install-arch +install-indep: $(INSTALLI) + dh_testdir + dh_testroot + dh_clean -k -i -X./ml/site.ml.orig -X./contrib/tooltool/Makefile.orig \ + -X./contrib/tooltool/events.c.orig -X./contrib/tooltool/func_fix.c.orig \ + -X./contrib/tooltool/lex.c.orig -X./contrib/tooltool/parse.y.orig \ + -X./contrib/tooltool/patchlevel.h.orig -X./contrib/tooltool/windows.c.orig \ + -X./contrib/Xhelp/hol_apro.orig -X./contrib/Xhelp/hol_ref.orig \ + -X./contrib/Xhelp/xholhelp.h.orig -X./contrib/Xhelp/hol_thm.orig + + dh_installdirs -i + + dh_install -i + +install-arch: $(INSTALLA) $(LINKS) debian/hol88.sh + dh_testdir + dh_testroot + dh_clean -k -s -X./ml/site.ml.orig -X./contrib/tooltool/Makefile.orig \ + -X./contrib/tooltool/events.c.orig -X./contrib/tooltool/func_fix.c.orig \ + -X./contrib/tooltool/lex.c.orig -X./contrib/tooltool/parse.y.orig \ + -X./contrib/tooltool/patchlevel.h.orig -X./contrib/tooltool/windows.c.orig \ + -X./contrib/Xhelp/hol_apro.orig -X./contrib/Xhelp/hol_ref.orig \ + -X./contrib/Xhelp/xholhelp.h.orig -X./contrib/Xhelp/hol_thm.orig + + dh_installdirs -s + + dh_install -s + + mv debian/hol88/usr/bin/hol88.sh debian/hol88/usr/bin/hol88 + +binary-common: + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +# Build architecture independant packages using the common target. +binary-indep: build-indep install-indep + $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common + +# Build architecture dependant packages using the common target. +binary-arch: build-arch install-arch + $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure --- hol88-2.02.19940316.orig/debian/dash.p +++ hol88-2.02.19940316/debian/dash.p @@ -0,0 +1,931 @@ +--- a/Library/abs_theory/Manual/Makefile ++++ b/Library/abs_theory/Manual/Makefile +@@ -15,13 +15,13 @@ + + clean:; \ + rm -f *.dvi *.aux *.toc *.log *.idx *.ilg entries.tex; \ +- 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 + + ids:; \ +- echo "\chapter{ML Functions in the {\tt abs\_theory} Library}" >entries.tex; \ +- echo "\input{entries-intro}" >>entries.tex; \ ++ printf '\\chapter{ML Functions in the {\\tt abs\\_theory} Library}' >entries.tex; \ ++ printf '\\input{entries-intro}' >>entries.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + index:; \ +--- a/Library/arith/Manual/Makefile ++++ b/Library/arith/Manual/Makefile +@@ -26,16 +26,16 @@ + # --------------------------------------------------------------------- + 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 + @echo "TeX files made" + + ids: +- @echo "\chapter{ML Functions in the arith Library}">entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the arith Library}'>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + index: +--- a/Library/finite_sets/Manual/Makefile ++++ b/Library/finite_sets/Manual/Makefile +@@ -26,45 +26,45 @@ + # --------------------------------------------------------------------- + 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: theorems ids + @echo "TeX files made" + + ids: +- @echo "\chapter{ML Functions in the Library}">entries.tex +- @echo "\label{entries}">>entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the Library}'>entries.tex ++ @printf '\\label{entries}'>>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + theorems: +- @echo "\chapter{Pre-proved Theorems}" > theorems.tex +- @echo "\input{theorems-intro}" >> theorems.tex +- @echo "\section{The type definition}">>theorems.tex ++ @printf '\\chapter{Pre-proved Theorems}' > theorems.tex ++ @printf '\\input{theorems-intro}' >> theorems.tex ++ @printf '\\section{The type definition}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/sdef theorems.tex +- @echo "\section{Basic properties of {\tt EMPTY}, {\tt INSERT}, and {\tt IN}}">>theorems.tex ++ @printf '\\section{Basic properties of {\\tt EMPTY}, {\\tt INSERT}, and {\\tt IN}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/basic theorems.tex +- @echo "\section{Set inclusion}">>theorems.tex ++ @printf '\\section{Set inclusion}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/subs theorems.tex +- @echo "\section{Intersection and union}">>theorems.tex ++ @printf '\\section{Intersection and union}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/unin theorems.tex +- @echo "\section{Set difference}">>theorems.tex ++ @printf '\\section{Set difference}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/diff theorems.tex +- @echo "\section{Deletion of an element}">>theorems.tex ++ @printf '\\section{Deletion of an element}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/del theorems.tex +- @echo "\section{Disjoint sets}">>theorems.tex ++ @printf '\\section{Disjoint sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/disj theorems.tex +- @echo "\section{The {\tt CHOICE} and {\tt REST} functions}">>theorems.tex ++ @printf '\\section{The {\\tt CHOICE} and {\\tt REST} functions}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/chre theorems.tex +- @echo "\section{Image of a function on a set}">>theorems.tex ++ @printf '\\section{Image of a function on a set}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/image theorems.tex +- @echo "\section{Mappings between sets}">>theorems.tex ++ @printf '\\section{Mappings between sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/fun theorems.tex +- @echo "\section{Singleton sets}">>theorems.tex ++ @printf '\\section{Singleton sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/sing theorems.tex +- @echo "\section{Cardinality of sets}">>theorems.tex ++ @printf '\\section{Cardinality of sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/card theorems.tex + + index: +--- a/Library/latex-hol/Manual/Makefile ++++ b/Library/latex-hol/Manual/Makefile +@@ -28,16 +28,16 @@ + # --------------------------------------------------------------------- + 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 + @echo "TeX files made" + + ids: +- @echo "\chapter{ML Functions in the {\tt latex-hol} Library}">entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the {\\tt latex-hol} Library}'>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + +--- a/Library/more_arithmetic/Manual/Makefile ++++ b/Library/more_arithmetic/Manual/Makefile +@@ -26,40 +26,40 @@ + # --------------------------------------------------------------------- + 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{ML Functions in the more\_arithmetic Library}">entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the more\\_arithmetic Library}'>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + theorems: +- @echo "\chapter{Pre-proved Theorems}\label{thms}" > theorems.tex +- @echo "\input{theorems-intro}" >> theorems.tex +- @echo "\section{Theorems about Inequalities}">>theorems.tex ++ @printf '\\chapter{Pre-proved Theorems}\\label{thms}' > theorems.tex ++ @printf '\\input{theorems-intro}' >> theorems.tex ++ @printf '\\section{Theorems about Inequalities}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/ineq theorems.tex +- @echo "\section{Theorems about {\tt 0}}">>theorems.tex ++ @printf '\\section{Theorems about {\\tt 0}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/zero_ineq theorems.tex +- @echo "\section{Theorems about {\tt SUC}}">>theorems.tex ++ @printf '\\section{Theorems about {\\tt SUC}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/suc theorems.tex +- @echo "\section{Theorems about {\tt PRE}}">>theorems.tex ++ @printf '\\section{Theorems about {\\tt PRE}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/pre theorems.tex +- @echo "\section{Theorems about Addition}">>theorems.tex ++ @printf '\\section{Theorems about Addition}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/add theorems.tex +- @echo "\section{Theorems about Subtraction}">>theorems.tex ++ @printf '\\section{Theorems about Subtraction}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/sub theorems.tex +- @echo "\section{Theorems about Multiplication and Exponential Functions}">>theorems.tex ++ @printf '\\section{Theorems about Multiplication and Exponential Functions}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/mult theorems.tex +- @echo "\section{Theorems about Division}">>theorems.tex ++ @printf '\\section{Theorems about Division}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/div_mod theorems.tex +- @echo "\section{Theorems about Maximum and Minimum}">>theorems.tex ++ @printf '\\section{Theorems about Maximum and Minimum}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/min_max theorems.tex +- @echo "\section{Theorems about Odd and Even Numbers}">>theorems.tex ++ @printf '\\section{Theorems about Odd and Even Numbers}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/odd_even theorems.tex + + index: +--- a/Library/numeral/Manual/Makefile ++++ b/Library/numeral/Manual/Makefile +@@ -15,19 +15,19 @@ + + clean:; \ + rm -f *.dvi *.aux *.toc *.log *.idx *.ilg entries.tex; \ +- 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 + + ids:; \ +- echo "\chapter{ML Functions in the numeral Library}" >entries.tex; \ +- echo "\input{entries-intro}" >>entries.tex; \ ++ printf '\\chapter{ML Functions in the numeral Library}' >entries.tex; \ ++ printf '\\input{entries-intro}' >>entries.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + thms:; \ +- echo "\chapter{Pre-proved Theorems}" > theorems.tex; \ +- echo "\input{theorems-intro}" >> theorems.tex; \ +- echo "\section{Numeral theory}" >> theorems.tex; \ ++ printf '\\chapter{Pre-proved Theorems}' > theorems.tex; \ ++ printf '\\input{theorems-intro}' >> theorems.tex; \ ++ printf '\\section{Numeral theory}' >> theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/numeral theorems.tex + + index:; \ +--- a/Library/pair/Manual/Makefile ++++ b/Library/pair/Manual/Makefile +@@ -26,19 +26,19 @@ + # --------------------------------------------------------------------- + clean: + rm -f *.dvi *.aux *.toc *.log *.idx *.ilg entries.tex theorems.tex; \ +- 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 + + ids: +- echo "\chapter{ML Functions in the pair Library}" >entries.tex; \ +- echo "\input{entries-intro}" >>entries.tex; \ ++ printf '\\chapter{ML Functions in the pair Library}' >entries.tex; \ ++ printf '\\input{entries-intro}' >>entries.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + theorems: +- @echo "\chapter{Pre-proved Theorems}" > theorems.tex +- @echo "\input{theorems-intro}" >> theorems.tex +- @echo "\section{Theorems}">>theorems.tex ++ @printf '\\chapter{Pre-proved Theorems}' > theorems.tex ++ @printf '\\input{theorems-intro}' >> theorems.tex ++ @printf '\\section{Theorems}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms theorems.tex + + index: +--- a/Library/parser/Manual/Makefile ++++ b/Library/parser/Manual/Makefile +@@ -25,20 +25,20 @@ + # --------------------------------------------------------------------- + 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{ML Functions in the parser Library}">entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the parser Library}'>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + theorems: +- @echo "\chapter{Pre-proved Theorems}" > theorems.tex ++ @printf '\\chapter{Pre-proved Theorems}' > theorems.tex + + index: + ${MAKEINDEX} parser.idx index.tex +--- a/Library/pred_sets/Manual/Makefile ++++ b/Library/pred_sets/Manual/Makefile +@@ -25,47 +25,47 @@ + # --------------------------------------------------------------------- + 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: theorems ids + @echo "TeX files made" + + ids: +- @echo "\chapter{ML Functions in the Library}">entries.tex +- @echo "\label{entries}">>entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the Library}'>entries.tex ++ @printf '\\label{entries}'>>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + theorems: +- @echo "\chapter{Pre-proved Theorems}" > theorems.tex +- @echo "\input{theorems-intro}" >> theorems.tex +- @echo "\section{Membership, equality, and set specifications}">>theorems.tex ++ @printf '\\chapter{Pre-proved Theorems}' > theorems.tex ++ @printf '\\input{theorems-intro}' >> theorems.tex ++ @printf '\\section{Membership, equality, and set specifications}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/mem theorems.tex +- @echo "\section{The empty and universal sets}">>theorems.tex ++ @printf '\\section{The empty and universal sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/emuniv theorems.tex +- @echo "\section{Set inclusion}">>theorems.tex ++ @printf '\\section{Set inclusion}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/subs theorems.tex +- @echo "\section{Intersection and union}">>theorems.tex ++ @printf '\\section{Intersection and union}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/unin theorems.tex +- @echo "\section{Set difference}">>theorems.tex ++ @printf '\\section{Set difference}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/diff theorems.tex +- @echo "\section{Disjoint sets}">>theorems.tex ++ @printf '\\section{Disjoint sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/disj theorems.tex +- @echo "\section{Insertion and deletion of an element}">>theorems.tex ++ @printf '\\section{Insertion and deletion of an element}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/insdel theorems.tex +- @echo "\section{The {\tt CHOICE} and {\tt REST} functions}">>theorems.tex ++ @printf '\\section{The {\\tt CHOICE} and {\\tt REST} functions}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/chre theorems.tex +- @echo "\section{Image of a function on a set}">>theorems.tex ++ @printf '\\section{Image of a function on a set}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/image theorems.tex +- @echo "\section{Mappings between sets}">>theorems.tex ++ @printf '\\section{Mappings between sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/fun theorems.tex +- @echo "\section{Singleton sets}">>theorems.tex ++ @printf '\\section{Singleton sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/sing theorems.tex +- @echo "\section{Finite and infinite sets}">>theorems.tex ++ @printf '\\section{Finite and infinite sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/fin theorems.tex +- @echo "\section{Cardinality of sets}">>theorems.tex ++ @printf '\\section{Cardinality of sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/card theorems.tex + + index: +--- a/Library/prettyp/Manual/Makefile ++++ b/Library/prettyp/Manual/Makefile +@@ -26,16 +26,16 @@ + # --------------------------------------------------------------------- + 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 + @echo "TeX files made" + + ids: +- @echo "\chapter{ML Functions in the prettyp Library}">entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the prettyp Library}'>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + index: +--- a/Library/reals/Manual/Makefile ++++ b/Library/reals/Manual/Makefile +@@ -15,34 +15,34 @@ + + 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: theorems + + theorems:; \ +- echo "\chapter{Pre-proved Theorems}" >theorems.tex; \ +- echo "\input{theorems-intro}" >>theorems.tex; \ +- echo "\section{HRAT}" >>theorems.tex; \ ++ printf '\\chapter{Pre-proved Theorems}' >theorems.tex; \ ++ printf '\\input{theorems-intro}' >>theorems.tex; \ ++ printf '\\section{HRAT}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/HRAT theorems.tex; \ +- echo "\section{HREAL}" >>theorems.tex; \ ++ printf '\\section{HREAL}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/HREAL theorems.tex; \ +- echo "\section{REALAX}" >>theorems.tex; \ ++ printf '\\section{REALAX}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/REALAX theorems.tex; \ +- echo "\section{REAL}" >>theorems.tex; \ ++ printf '\\section{REAL}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/REAL theorems.tex; \ +- echo "\section{TOPOLOGY}" >>theorems.tex; \ ++ printf '\\section{TOPOLOGY}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/TOPOLOGY theorems.tex; \ +- echo "\section{NETS}" >>theorems.tex; \ ++ printf '\\section{NETS}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/NETS theorems.tex; \ +- echo "\section{LIM}" >>theorems.tex; \ ++ printf '\\section{LIM}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/LIM theorems.tex; \ +- echo "\section{SEQ}" >>theorems.tex; \ ++ printf '\\section{SEQ}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/SEQ theorems.tex; \ +- echo "\section{POWSER}" >>theorems.tex; \ ++ printf '\\section{POWSER}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/POWSER theorems.tex; \ +- echo "\section{TRANSC}" >>theorems.tex; \ ++ printf '\\section{TRANSC}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/TRANSC theorems.tex + + reals:; \ +--- a/Library/record_proof/Manual/Makefile ++++ b/Library/record_proof/Manual/Makefile +@@ -27,17 +27,17 @@ + # --------------------------------------------------------------------- + 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: functions + @echo "TeX files made" + + functions: +- @echo "\chapter{ML Functions in the {\tt record\_proof} Library}">entries.tex +- @echo "\label{entries}">>entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the {\\tt record\\_proof} Library}'>entries.tex ++ @printf '\\label{entries}'>>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help} entries.tex + + index: +--- a/Library/reduce/Manual/Makefile ++++ b/Library/reduce/Manual/Makefile +@@ -15,13 +15,13 @@ + + clean:; \ + rm -f *.dvi *.aux *.toc *.log *.idx *.ilg entries.tex; \ +- 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 + + ids:; \ +- echo "\chapter{ML Functions in the reduce Library}" >entries.tex; \ +- echo "\input{entries-intro}" >>entries.tex; \ ++ printf '\\chapter{ML Functions in the reduce Library}' >entries.tex; \ ++ printf '\\input{entries-intro}' >>entries.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + index:; \ +--- a/Library/res_quan/Manual/Makefile ++++ b/Library/res_quan/Manual/Makefile +@@ -27,22 +27,22 @@ + # --------------------------------------------------------------------- + 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: theorems functions + @echo "TeX files made" + + functions: +- @echo "\chapter{ML Functions in the {\tt res\_quan} Library}">entries.tex +- @echo "\label{entries}">>entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the {\\tt res\\_quan} Library}'>entries.tex ++ @printf '\\label{entries}'>>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + theorems: +- @echo "\chapter{Pre-proved Theorems}" > theorems.tex +- @echo "\input{theorems-intro}" >> theorems.tex ++ @printf '\\chapter{Pre-proved Theorems}' > theorems.tex ++ @printf '\\input{theorems-intro}' >> theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms theorems.tex + + index: +--- a/Library/sets/Manual/Makefile ++++ b/Library/sets/Manual/Makefile +@@ -26,49 +26,49 @@ + # --------------------------------------------------------------------- + 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: theorems ids + @echo "TeX files made" + + ids: +- @echo "\chapter{ML Functions in the sets Library}">entries.tex +- @echo "\label{entries}">>entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the sets Library}'>entries.tex ++ @printf '\\label{entries}'>>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + theorems: +- @echo "\chapter{Pre-proved Theorems}" > theorems.tex +- @echo "\input{theorems-intro}" >> theorems.tex +- @echo "\section{The type definition}">>theorems.tex ++ @printf '\\chapter{Pre-proved Theorems}' > theorems.tex ++ @printf '\\input{theorems-intro}' >> theorems.tex ++ @printf '\\section{The type definition}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/sdef theorems.tex +- @echo "\section{Membership, equality, and set specifications}">>theorems.tex ++ @printf '\\section{Membership, equality, and set specifications}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/mem theorems.tex +- @echo "\section{The empty and universal sets}">>theorems.tex ++ @printf '\\section{The empty and universal sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/emuniv theorems.tex +- @echo "\section{Set inclusion}">>theorems.tex ++ @printf '\\section{Set inclusion}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/subs theorems.tex +- @echo "\section{Intersection and union}">>theorems.tex ++ @printf '\\section{Intersection and union}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/unin theorems.tex +- @echo "\section{Set difference}">>theorems.tex ++ @printf '\\section{Set difference}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/diff theorems.tex +- @echo "\section{Disjoint sets}">>theorems.tex ++ @printf '\\section{Disjoint sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/disj theorems.tex +- @echo "\section{Insertion and deletion of an element}">>theorems.tex ++ @printf '\\section{Insertion and deletion of an element}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/insdel theorems.tex +- @echo "\section{The {\tt CHOICE} and {\tt REST} functions}">>theorems.tex ++ @printf '\\section{The {\\tt CHOICE} and {\\tt REST} functions}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/chre theorems.tex +- @echo "\section{Image of a function on a set}">>theorems.tex ++ @printf '\\section{Image of a function on a set}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/image theorems.tex +- @echo "\section{Mappings between sets}">>theorems.tex ++ @printf '\\section{Mappings between sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/fun theorems.tex +- @echo "\section{Singleton sets}">>theorems.tex ++ @printf '\\section{Singleton sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/sing theorems.tex +- @echo "\section{Finite and infinite sets}">>theorems.tex ++ @printf '\\section{Finite and infinite sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/fin theorems.tex +- @echo "\section{Cardinality of sets}">>theorems.tex ++ @printf '\\section{Cardinality of sets}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/card theorems.tex + + index: +--- a/Library/string/Manual/Makefile ++++ b/Library/string/Manual/Makefile +@@ -26,24 +26,24 @@ + # --------------------------------------------------------------------- + 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{ML Functions in the string Library}">entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the string Library}'>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + theorems: +- @echo "\chapter{Pre-proved Theorems}" > theorems.tex +- @echo "\input{theorems-intro}" >> theorems.tex +- @echo "\section{Definitions}">>theorems.tex ++ @printf '\\chapter{Pre-proved Theorems}' > theorems.tex ++ @printf '\\input{theorems-intro}' >> theorems.tex ++ @printf '\\section{Definitions}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/defs theorems.tex +- @echo "\section{Theorems}">>theorems.tex ++ @printf '\\section{Theorems}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms theorems.tex + + index: +--- a/Library/taut/Manual/Makefile ++++ b/Library/taut/Manual/Makefile +@@ -26,16 +26,16 @@ + # --------------------------------------------------------------------- + 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 + @echo "TeX files made" + + ids: +- @echo "\chapter{ML Functions in the taut Library}">entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the taut Library}'>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + index: +--- a/Library/trs/Manual/Makefile ++++ b/Library/trs/Manual/Makefile +@@ -26,16 +26,16 @@ + # --------------------------------------------------------------------- + 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 + @echo "TeX files made" + + ids: +- @echo "\chapter{ML Functions in the trs Library}">entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the trs Library}'>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + index: +--- a/Library/unwind/Manual/Makefile ++++ b/Library/unwind/Manual/Makefile +@@ -26,16 +26,16 @@ + # --------------------------------------------------------------------- + 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 + @echo "TeX files made" + + ids: +- @echo "\chapter{ML Functions in the unwind Library}">entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the unwind Library}'>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + index: +--- a/Library/wellorder/Manual/Makefile ++++ b/Library/wellorder/Manual/Makefile +@@ -14,26 +14,26 @@ + + clean:; \ + rm -f *.dvi *.aux *.toc *.log *.idx *.ilg entries.tex; \ +- 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: theorems ids + + ids:; \ +- echo "\chapter{ML Functions in the wellorder Library}" >entries.tex;\ +- echo "\label{entries}" >>entries.tex; \ +- echo "\input{entries-intro}" >>entries.tex; \ ++ printf '\\chapter{ML Functions in the wellorder Library}' >entries.tex;\ ++ printf '\\label{entries}' >>entries.tex; \ ++ printf '\\input{entries-intro}' >>entries.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + theorems:; \ +- echo "\chapter{Pre-proved Theorems}" >theorems.tex; \ +- echo "\input{theorems-intro}" >>theorems.tex; \ +- echo "\section{Basic definitions}" >>theorems.tex; \ ++ printf '\\chapter{Pre-proved Theorems}' >theorems.tex; \ ++ printf '\\input{theorems-intro}' >>theorems.tex; \ ++ printf '\\section{Basic definitions}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/defs theorems.tex; \ +- echo "\section{Miscellaneous lemmas}" >>theorems.tex; \ ++ printf '\\section{Miscellaneous lemmas}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/lemmas theorems.tex;\ +- echo "\section{Main theorems}" >>theorems.tex; \ ++ printf '\\section{Main theorems}' >>theorems.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/main theorems.tex + + wellorder:; \ +--- a/Library/window/Manual/Makefile ++++ b/Library/window/Manual/Makefile +@@ -26,24 +26,24 @@ + # --------------------------------------------------------------------- + clean: + rm -f *.dvi *.aux *.toc *.log *.idx *.ilg entries.tex *.bak; \ +- 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 makde" + + ids: +- echo "\chapter{ML Functions in the window Library}" >entries.tex; \ +- echo "\input{entries-intro}" >>entries.tex; \ ++ printf '\\chapter{ML Functions in the window Library}' >entries.tex; \ ++ printf '\\input{entries-intro}' >>entries.tex; \ + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + theorems: +- @echo "\chapter{Pre-proved Theorems}" > theorems.tex +- @echo "\input{theorems-intro}" >> theorems.tex +- @echo "\section{Definitions}">>theorems.tex ++ @printf '\\chapter{Pre-proved Theorems}' > theorems.tex ++ @printf '\\input{theorems-intro}' >> theorems.tex ++ @printf '\\section{Definitions}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/defs theorems.tex +- @echo "\section{Theorems}">>theorems.tex ++ @printf '\\section{Theorems}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms theorems.tex + + index: +--- a/Library/word/Manual/Makefile ++++ b/Library/word/Manual/Makefile +@@ -27,33 +27,33 @@ + # --------------------------------------------------------------------- + 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: theorems functions + @echo "TeX files made" + + functions: +- @echo "\chapter{ML Functions in the {\tt word} Library}">entries.tex +- @echo "\label{entries}">>entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the {\\tt word} Library}'>entries.tex ++ @printf '\\label{entries}'>>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/entries entries.tex + + theorems: +- @echo "\chapter{Pre-proved Theorems}" > theorems.tex +- @echo "\input{theorems-intro}" >> theorems.tex +- @echo "\section{The theory {\tt word\_base}}">>theorems.tex ++ @printf '\\chapter{Pre-proved Theorems}' > theorems.tex ++ @printf '\\input{theorems-intro}' >> theorems.tex ++ @printf '\\section{The theory {\\tt word\\_base}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/word_base theorems.tex +- @echo "\section{The theory {\tt word\_bitop}}">>theorems.tex ++ @printf '\\section{The theory {\\tt word\\_bitop}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/word_bitop theorems.tex +- @echo "\section{The theory {\tt word\_num}}">>theorems.tex ++ @printf '\\section{The theory {\\tt word\\_num}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/word_num theorems.tex +- @echo "\section{The theory {\tt bword\_bitop}}">>theorems.tex ++ @printf '\\section{The theory {\\tt bword\\_bitop}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/bword_bitop theorems.tex +- @echo "\section{The theory {\tt bword\_num}}">>theorems.tex ++ @printf '\\section{The theory {\\tt bword\\_num}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/bword_num theorems.tex +- @echo "\section{The theory {\tt bword\_arith}}">>theorems.tex ++ @printf '\\section{The theory {\\tt bword\\_arith}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/thms/bword_arith theorems.tex + + index: +--- a/Manual/Reference/Makefile ++++ b/Manual/Reference/Makefile +@@ -19,46 +19,46 @@ + + 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: +--- a/contrib/wordn/Manual/Makefile ++++ b/contrib/wordn/Manual/Makefile +@@ -26,27 +26,27 @@ + # --------------------------------------------------------------------- + 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: entries theorems + @echo "TeX files made" + + entries: +- @echo "\chapter{ML Functions in the wordn Library}">entries.tex +- @echo "\label{entries}">>entries.tex +- @echo "\input{entries-intro}" >> entries.tex ++ @printf '\\chapter{ML Functions in the wordn Library}'>entries.tex ++ @printf '\\label{entries}'>>entries.tex ++ @printf '\\input{entries-intro}' >> entries.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/ENTRIES entries.tex + + theorems: +- @echo "\chapter{Pre-proved Theorems}" > theorems.tex +- @echo "\input{theorems-intro}" >> theorems.tex +- @echo "\section{The theory {\tt wordn\_base}}">>theorems.tex ++ @printf '\\chapter{Pre-proved Theorems}' > theorems.tex ++ @printf '\\input{theorems-intro}' >> theorems.tex ++ @printf '\\section{The theory {\\tt wordn\\_base}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/THEOREMS/base theorems.tex +- @echo "\section{The theory {\tt wordn\_bitops}}">>theorems.tex ++ @printf '\\section{The theory {\\tt wordn\\_bitops}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/THEOREMS/bitops theorems.tex +- @echo "\section{The theory {\tt wordn\_num}}">>theorems.tex ++ @printf '\\section{The theory {\\tt wordn\\_num}}'>>theorems.tex + /bin/sh ${DOCTOTEX} ${DOCTOTEXSED} ${Help}/THEOREMS/num theorems.tex + + index: --- hol88-2.02.19940316.orig/debian/copyright +++ hol88-2.02.19940316/debian/copyright @@ -0,0 +1,32 @@ +This package was debianized by Camm Maguire on +Wed, 18 Oct 2006 13:36:15 -0400. + +It was downloaded from http://www.ftp.cl.cam.ac.uk/ftp/hvg/hol88/ + +Upstream Authors: Michael Gordon + University of Cambridge Computer Laboratory http://www.cl.cam.ac.uk/ + +Copyright: 1994 University of Edinburgh, University of Cambridge, INRIA + +License: + +public domain + +From http://www.cl.cam.ac.uk/~mjcg/papers/HolHistory.pdf: + +... + +6.1 HOL88 + +The core HOL system became stable in about 1988. A new release that +consolidated various changes and enhancements called HOL88 was issued +then.11 We were fortunate to receive support from DSTO Australia to +document HOL12 and from Hewlett Packard to port it from Franz Lisp to +Common Lisp (a job very ably done by John Carroll). The current +versions of HOL and its documentation are public domain13 and +available on the Internet +(http://lal.cs.byu.edu/lal/hol-documentation.html). + + +The Debian packaging is (C) 2006, Camm Maguire and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. --- hol88-2.02.19940316.orig/debian/site_ml_orig +++ hol88-2.02.19940316/debian/site_ml_orig @@ -0,0 +1,34 @@ +%=============================================================================% +% HOL 88 % +% % +% FILE NAME: site.ml.orig % +% % +% DESCRIPTION: Source file for site dependent information % +% % +% USES FILES: hol-lcf lisp files % +% % +% University of Cambridge % +% Hardware Verification Group % +% Computer Laboratory % +% New Museums Site % +% Pembroke Street % +% Cambridge CB2 3QG % +% England % +% % +% COPYRIGHT: University of Edinburgh % +% COPYRIGHT: University of Cambridge % +% COPYRIGHT: INRIA % +% % +% VERSION: 2.0 % +% REVISION HISTORY: 91.02.24 TFM % +%=============================================================================% + +% Must be compiled when other ml sources are compiled % + +let concat tok1 tok2 = implode( explode tok1 @ explode tok2);; + +let ml_dir_pathname = `ml/`;; +let lisp_dir_pathname = `lisp/`;; + +% No longer needed. [TFM 91.02.24] % +% let theories_dir_pathname = `theories/`;; % --- hol88-2.02.19940316.orig/debian/dirs +++ hol88-2.02.19940316/debian/dirs @@ -0,0 +1 @@ +usr/bin --- hol88-2.02.19940316.orig/debian/README.Debian +++ hol88-2.02.19940316/debian/README.Debian @@ -0,0 +1,10 @@ +hol88 for Debian +---------------- + +This package is built from the last lisp sources to the HOL theorem +proving system. More recent versions are written purely in ML. This +package is being provided here as a facility to combine ML and lisp +into one image, as well as to provide an instructive example in one of +the major milestones in the history of automated theorem proving. + + -- Camm Maguire , Wed, 18 Oct 2006 13:51:08 -0400 --- hol88-2.02.19940316.orig/debian/changelog +++ hol88-2.02.19940316/debian/changelog @@ -0,0 +1,114 @@ +hol88 (2.02.19940316-14) unstable; urgency=low + + * rebuild against latest gcl + + -- Camm Maguire Tue, 17 May 2011 15:01:32 +0000 + +hol88 (2.02.19940316-13.1) unstable; urgency=high + + * Non-maintainer upload. + * Revert build-depend bump, as that version of gcl will + not make it into Squeeze (Closes: #606293) + + -- Jonathan Wiltshire Tue, 14 Dec 2010 20:47:42 +0000 + +hol88 (2.02.19940316-13) unstable; urgency=low + + * build depend on latest gcl + + -- Camm Maguire Fri, 05 Nov 2010 16:09:55 +0000 + +hol88 (2.02.19940316-12) unstable; urgency=low + + * remove stray raw_*_map files + + -- Camm Maguire Thu, 21 Oct 2010 19:59:51 +0000 + +hol88 (2.02.19940316-11) unstable; urgency=low + + * build-dep on latest gcl + * Bug fix: "[mips] empty package", thanks to Jakub Wilk (Closes: + #597140). + * Bug fix: "FTBFS on mipsel: Unrecoverable error: Segmentation + violation..", thanks to Cyril Brulebois (Closes: #599986). + * Bug fix: "FTBFS on hppa: /bin/sh: ././raw_hol_map: Permission denied", + thanks to Cyril Brulebois (Closes: #599987). + + -- Camm Maguire Thu, 21 Oct 2010 14:34:13 +0000 + +hol88 (2.02.19940316-10) unstable; urgency=low + + * rebuild against newest gcl + + -- Camm Maguire Sat, 25 Sep 2010 15:19:33 +0000 + +hol88 (2.02.19940316-9) unstable; urgency=low + + * Bug fix: "replacing libreadline5-dev build dependency with + libreadline-dev", thanks to Matthias Klose (Closes: #553782). + * Bug fix: "hol88 crashes with segfault", thanks to Benedikt Ahrens + (Closes: #508908). + + -- Camm Maguire Sun, 03 Jan 2010 20:48:22 +0000 + +hol88 (2.02.19940316-8) unstable; urgency=low + + * Bug fix: "FTBFS: LaTeX Error: \begin{document} ended by + \end{theindex}", thanks to Chris Lamb (Closes: #484983). + * Bug fix: "hol88: bashism in debian/rules", thanks to Raphael Geissert + (Closes: #477583). + + -- Camm Maguire Sat, 02 Aug 2008 13:23:41 +0000 + +hol88 (2.02.19940316-7) unstable; urgency=low + + * Bug fix: "hol88: empty package on arm", thanks to Niko Tyni (Closes: + #448843). Rebuild against latest gcl + + -- Camm Maguire Mon, 03 Dec 2007 09:18:22 -0500 + +hol88 (2.02.19940316-6) unstable; urgency=low + + * build-depend on texlive-latex-base + * Bug fix: "hol88: package content changed if build twice or more times + in a row", thanks to Patrick Winnertz (Closes: #441710). preserve + debian/site_ml_orig + * Bug fix: "hol88: dangling symlinks", thanks to Ian Zimmerman (Closes: + #442282). write absolute paths in first entry in links files + + -- Camm Maguire Wed, 24 Oct 2007 14:01:30 -0400 + +hol88 (2.02.19940316-5) unstable; urgency=low + + * Fix patch mechanism for non native relocs + + -- Camm Maguire Mon, 4 Dec 2006 10:39:08 -0500 + +hol88 (2.02.19940316-4) unstable; urgency=low + + * Proper build deps for non-native-reloc arches + + -- Camm Maguire Sat, 2 Dec 2006 23:28:42 -0500 + +hol88 (2.02.19940316-3) unstable; urgency=low + + * Fix native-reloc target, Closes: #401321 + + -- Camm Maguire Sat, 2 Dec 2006 17:58:39 -0500 + +hol88 (2.02.19940316-2) unstable; urgency=low + + * redefine ml-save to use si::save-system, and si::*top-level-hook*. + Fixes amd64 and sparc builds + * patch Makefile and make-user-init function (from gcl cvs head) to + support build on systems without native object relocation. Closes: + #400063. + + -- Camm Maguire Tue, 28 Nov 2006 16:30:04 -0500 + +hol88 (2.02.19940316-1) unstable; urgency=low + + * Initial release + + -- Camm Maguire Wed, 18 Oct 2006 13:36:15 -0400 + --- hol88-2.02.19940316.orig/debian/gcl_save.l +++ hol88-2.02.19940316/debian/gcl_save.l @@ -0,0 +1 @@ +(si::save-system "gcl") --- hol88-2.02.19940316.orig/debian/hol88-doc.docs +++ hol88-2.02.19940316/debian/hol88-doc.docs @@ -0,0 +1,2 @@ +#DOCS# + --- 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 --- hol88-2.02.19940316.orig/lisp/f-iox-stand.l +++ hol88-2.02.19940316/lisp/f-iox-stand.l @@ -283,7 +283,7 @@ (defun find-file1 (dir name exts) (do - ((exts exts (cdr exts)) + ((exts (cons "" exts) (cdr exts)) (file nil)) ((null exts) nil) (setq file (catenate dir name (car exts))) --- 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/Manual/Makefile +++ hol88-2.02.19940316/Manual/Makefile @@ -41,3 +41,5 @@ 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/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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \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 @@ \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 @@ 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 @@ \#, 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 @@ {\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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \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 @@ 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 @@ \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 @@ 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 @@ \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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \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 @@ \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 @@ 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 @@ |- (!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 @@ 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 @@ 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 @@ \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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \#, 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \#, 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 @@ \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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \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, 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 @@ 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 @@ \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 @@ \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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \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_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 @@ 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_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_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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \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 @@ 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 @@ 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 @@ 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 @@ } \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 @@ 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 @@ 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 @@ \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 @@ 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 @@ 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 @@ \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 @@ 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 @@ {\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 @@ 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 @@ {\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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ \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 @@ 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 @@ \#, 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 @@ \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 @@ \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/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/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/index.tex +++ hol88-2.02.19940316/Manual/Reference/index.tex @@ -1,1625 +1,3 @@ -\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 - +egin{theindex} +\mbox{} \end{theindex} --- 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/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/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/Covers/Makefile +++ hol88-2.02.19940316/Manual/Covers/Makefile @@ -20,12 +20,12 @@ 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