debian/0000755000000000000000000000000012226255561007174 5ustar debian/gcl_save.l0000644000000000000000000000003011465026074011124 0ustar (si::save-system "gcl") debian/rules0000755000000000000000000001746611741354653010275 0ustar #!/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 ./lisp/f-ol-syntax.data 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_prep -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_prep -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 debian/compat0000644000000000000000000000000211741350716010371 0ustar 9 debian/hol88.manpages0000644000000000000000000000001711465026074011650 0ustar debian/hol88.1 debian/hol88.10000644000000000000000000000252511465026074010223 0ustar .\" 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). debian/dash.p0000644000000000000000000012524311465026074010302 0ustar --- 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: debian/copyright0000644000000000000000000000214411465026074011127 0ustar 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'. debian/gcl_patch.l0000644000000000000000000000456011465026074011301 0ustar (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*) debian/README.Debian0000644000000000000000000000070111465026074011232 0ustar 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 debian/source/0000755000000000000000000000000011741350407010470 5ustar debian/source/format0000644000000000000000000000001411741350407011676 0ustar 3.0 (quilt) debian/hol88-doc.docs0000644000000000000000000000001011465026074011541 0ustar #DOCS# debian/control0000644000000000000000000001077712241774575010623 0ustar Source: hol88 Section: math Priority: optional Maintainer: Camm Maguire Build-Depends: debhelper (>= 9), gcl (>= 2.6.10-1), texlive-latex-base, libgmp3-dev, libreadline-dev, libxmu-dev, libxaw7-dev Standards-Version: 3.9.4 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: ${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: ${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: ${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: ${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: ${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: ${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: ${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 Section: doc Depends: ${misc:Depends} 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. debian/patches/0000755000000000000000000000000011741351271010617 5ustar debian/patches/series0000644000000000000000000000002211741351271012026 0ustar quilt-source-init debian/patches/quilt-source-init0000644000000000000000000320744611741351271014157 0ustar Description: TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. . hol88 (2.02.19940316-15) unstable; urgency=low . * lintian fixes * 3.0 quilt source format Author: Camm Maguire --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: http://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: --- hol88-2.02.19940316.orig/Makefile +++ hol88-2.02.19940316/Makefile @@ -150,7 +150,7 @@ SHELL=/bin/sh LispType=cl Obj=o -Lisp=akcl +Lisp=gcl Liszt= LisztComm= Allegro=(set-case-mode :case-insensitive-upper) @@ -159,7 +159,7 @@ AllegroV4.0= $(Allegro) (setq *cltl1-in- AllegroV4.1= $(AllegroV4.0) (setq *enable-package-locked-errors* nil) AllegroStuff= (progn () $(AllegroV4.1)) -HOLdir=/usr/local/hol +HOLdir=$(shell pwd) Theory=$(HOLdir)/theories Library=$(HOLdir)/Library Help=$(HOLdir)/help/ENTRIES/ @@ -168,7 +168,7 @@ Hol=hol LispDir=${HOLdir}/lisp ExeName = hol -Version = 2.02 (SUN4/AKCL) +Version = 2.02 (GCL) # ===================================================================== # Default (from Phil Windley) @@ -221,6 +221,34 @@ HolMl=ml/load_thms.ml ml/numconv_ml.o ml # --------------------------------------------------------------------- hol: basic-hol ${Theory}/HOL.th $(HolMl) lisp/banner.$(Obj) lisp/akcl.l +# echo 'set_search_path[``; `${Theory}/`];;'\ +# 'load_theory `HOL`;;'\ +# 'loadf `ml/load_thms`;;'\ +# 'loadf `ml/lib_loader`;;'\ +# 'loadf `ml/numconv`;;'\ +# 'loadf `ml/tydefs`;;'\ +# 'loadf `ml/ind`;;'\ +# 'loadf `ml/prim_rec`;;'\ +# 'loadf `ml/tyfns`;;'\ +# 'loadf `ml/num`;;'\ +# 'loadf `ml/list`;;'\ +# 'map delete_cache [`arithmetic`;`sum`;`list`];;'\ +# 'map delete_cache [`tree`;`ltree`;`prim_rec`];;'\ +# 'lisp `(load "lisp/banner")`;;'\ +# 'lisp `(setq %system-name "HOL")`;;'\ +# 'lisp `(setq %hol-dir "$(HOLdir)")`;;'\ +# 'lisp `(setq %lib-dir "$(Library)")`;;'\ +# 'lisp `(setq %liszt "$(LisztComm)")`;;'\ +# 'lisp `(setq %version "$(Version)")`;;'\ +# 'set_flag(`abort_when_fail`,false);;'\ +# 'set_search_path[``; `~/`; `${Theory}/`];;'\ +# 'set_help_search_path (words `$(Help)`);;'\ +# 'set_library_search_path [`${Library}/`];;'\ +# 'lisp `(setup)`;;'\ +# 'save `${ExeName}`;;'\ +# 'set_thm_count 0;;'\ +# 'quit();;'\ +# | basic-hol echo 'set_search_path[``; `${Theory}/`];;'\ 'load_theory `HOL`;;'\ 'loadf `ml/load_thms`;;'\ @@ -244,12 +272,8 @@ hol: basic-hol ${Theory}/HOL.th $(HolMl) 'set_search_path[``; `~/`; `${Theory}/`];;'\ 'set_help_search_path (words `$(Help)`);;'\ 'set_library_search_path [`${Library}/`];;'\ - 'lisp `(load "lisp/akcl.l")`;;'\ - 'lisp `(setup)`;;'\ - 'save `${ExeName}`;;'\ - 'set_thm_count 0;;'\ - 'quit();;'\ - | basic-hol + 'lisp `(setup)`;;' >foo2 + echo 'lisp `(throw (quote eof) t)`;; #+native-reloc(progn (with-open-file (s "foo2") (let ((*standard-input* s)) (tml)))(ml-save "hol")) #-native-reloc(let ((si::*collect-binary-modules* t)(si::*binary-modules* (with-open-file (s "bm.l") (read s)))) (with-open-file (s "foo2") (let ((*standard-input* s)) (tml)))(compiler::link (remove-duplicates si::*binary-modules* :test (function equal)) "hol" "(progn (load \"debian/gcl_patch.l\")(load \"foo\")(with-open-file (s \"foo1\") (let ((*standard-input* s)) (tml)))(with-open-file (s \"foo2\") (let ((*standard-input* s)) (tml)))(ml-save \"hol\")(quit))" "" nil)(quit))`;;' | basic-hol make permissions @echo "=======> hol88 version $(Version) made" @@ -291,11 +315,12 @@ Exec=hol hol-lcf basic-hol Manual/LaTeX/ Manual/Reference/bin/mktex Manual/Reference/bin/typecheck permissions: - find . \( -type d -user $(USER) -exec chmod $(Dperm) {} \; \) -o\ - \( -type f -user $(USER) -exec chmod $(Tperm) {} \; \) - @for f in $(Exec) ; do\ - ( if [ -f $$f ]; then\ - find $$f \( -user $(USER) \) -exec chmod $(Eperm) {} \; ;fi) ; \ + find $$(ls -1 | grep -v debian) \ + \( -type d -exec chmod $(Dperm) {} \; \) -o\ + \( -type f -exec chmod $(Tperm) {} \; \) + for f in $(Exec) ; do\ + ( if [ -f $$f ] ; then\ + find $$f -exec chmod $(Eperm) {} \; ;fi) ; \ done @@ -482,6 +507,31 @@ BasicHolMl=ml/genfns_ml.o ml/hol-syn_ml. # --------------------------------------------------------------------- basic-hol: hol-lcf $(BasicHolLisp) ${Theory}/BASIC-HOL.th $(BasicHolMl) +# echo 'set_search_path[``; `${Theory}/`];;'\ +# 'load_theory `BASIC-HOL`;;'\ +# 'loadf `ml/hol-in-out`;;'\ +# 'loadf `ml/hol-rule`;;'\ +# 'loadf `ml/hol-drule`;;'\ +# 'loadf `ml/drul`;;'\ +# 'loadf `ml/tacticals`;;'\ +# 'loadf `ml/tacont`;;'\ +# 'loadf `ml/tactics`;;'\ +# 'loadf `ml/conv`;;'\ +# 'loadf `ml/hol-net`;;'\ +# 'loadf `ml/rewrite`;;'\ +# 'loadf `ml/resolve`;;'\ +# 'loadf `ml/hol-thyfn`;;'\ +# 'loadf `ml/goals`;;'\ +# 'loadf `ml/stack`;;'\ +# 'loadf `ml/abs-rep`;;'\ +# 'activate_binders `bool`;;'\ +# 'lisp `(setq %liszt "$(LisztComm)")`;;'\ +# 'lisp `(setq %version "$(Version)")`;;'\ +# 'lisp `(setq %system-name "BASIC-HOL")`;;'\ +# 'lisp `(setup)`;;'\ +# 'save `basic-hol`;;'\ +# 'quit();;'\ +# | hol-lcf echo 'set_search_path[``; `${Theory}/`];;'\ 'load_theory `BASIC-HOL`;;'\ 'loadf `ml/hol-in-out`;;'\ @@ -503,10 +553,8 @@ basic-hol: hol-lcf $(BasicHolLisp) ${The 'lisp `(setq %liszt "$(LisztComm)")`;;'\ 'lisp `(setq %version "$(Version)")`;;'\ 'lisp `(setq %system-name "BASIC-HOL")`;;'\ - 'lisp `(setup)`;;'\ - 'save `basic-hol`;;'\ - 'quit();;'\ - | hol-lcf + 'lisp `(setup)`;;' >foo1 + echo 'lisp `(throw (quote eof) t)`;; #+native-reloc(progn (with-open-file (s "foo1") (let ((*standard-input* s)) (tml)))(ml-save "basic-hol")) #-native-reloc(let ((si::*collect-binary-modules* t)(si::*binary-modules* (with-open-file (s "bm.l") (read s)))) (with-open-file (s "foo1") (let ((*standard-input* s)) (tml)))(compiler::link (remove-duplicates si::*binary-modules* :test (function equal)) "basic-hol" "(progn (load \"debian/gcl_patch.l\")(load \"foo\")(with-open-file (s \"foo1\") (let ((*standard-input* s)) (tml)))(ml-save \"basic-hol\")(quit))" "" nil)(with-open-file (s "bm.l" :direction :output) (prin1 si::*binary-modules* s))(quit))`;;' | hol-lcf @echo "=======> basic-hol88 made" # --------------------------------------------------------------------- @@ -780,6 +828,23 @@ HolLcfMl=ml/ml-curry_ml.o ml/lis_ml.o ml # --------------------------------------------------------------------- hol-lcf: $(HolLcfLisp) $(HolLcfMl) +# echo '#+allegro $(AllegroStuff)'\ +# '(load "lisp/mk-ml")'\ +# '(load "lisp/mk-hol-lcf")'\ +# '(setq %version "$(Version)")'\ +# '(set-make)'\ +# '(tml)'\ +# 'load(`ml/site`,false);;'\ +# 'load(`ml/ml-curry`,false);;'\ +# 'load(`ml/lis`,false);;'\ +# 'load(`ml/gen`,false);;'\ +# 'load(`ml/killpp`,false);;'\ +# 'lisp `(setq %system-name "HOL-LCF")`;;'\ +# 'lisp `(setq %liszt "$(LisztComm)")`;;'\ +# 'lisp `(setup)`;;'\ +# 'save `hol-lcf`;;'\ +# 'quit();;'\ +# | $(Lisp) echo '#+allegro $(AllegroStuff)'\ '(load "lisp/mk-ml")'\ '(load "lisp/mk-hol-lcf")'\ @@ -793,10 +858,8 @@ hol-lcf: $(HolLcfLisp) $(HolLcfMl) 'load(`ml/killpp`,false);;'\ 'lisp `(setq %system-name "HOL-LCF")`;;'\ 'lisp `(setq %liszt "$(LisztComm)")`;;'\ - 'lisp `(setup)`;;'\ - 'save `hol-lcf`;;'\ - 'quit();;'\ - | $(Lisp) + 'lisp `(setup)`;;' >foo + echo '#+native-reloc(progn (load "foo")(ml-save "hol-lcf"))#-native-reloc(let ((si::*collect-binary-modules* t)(si::*binary-modules* nil)) (load "foo")(compiler::link (remove-duplicates si::*binary-modules* :test (function equal)) "hol-lcf" "(load \"debian/gcl_patch.l\")(load \"foo\")(ml-save \"hol-lcf\")" "" nil)(with-open-file (s "bm.l" :direction :output) (prin1 si::*binary-modules* s)))(quit)' | $(Lisp) @echo "=======> hol-lcf made" # ===================================================================== --- hol88-2.02.19940316.orig/Manual/Makefile +++ hol88-2.02.19940316/Manual/Makefile @@ -41,3 +41,5 @@ all: make tutorial;make description; make reference;make libraries;make covers @echo "=======> MANUAL made" +clean: + for i in Tutorial Description Reference Libraries Covers ; do $(MAKE) -C $$i clean ; done --- hol88-2.02.19940316.orig/Manual/Description/description.tex +++ hol88-2.02.19940316/Manual/Description/description.tex @@ -34,7 +34,7 @@ \include{title} % description title page \include{preface} % preface to entire description - \include{../LaTeX/ack} % global acknowledgements + \include{ack} % global acknowledgements \include{contents} % table of contents --- hol88-2.02.19940316.orig/Manual/Tutorial/tutorial.tex +++ hol88-2.02.19940316/Manual/Tutorial/tutorial.tex @@ -38,7 +38,7 @@ \include{title} % tutorial title page \include{preface} % preface to entire tutorial - \include{../LaTeX/ack} % global acknowledgements + \include{ack} % global acknowledgements \include{contents} % table of contents \pagenumbering{arabic} % arabic page numbers --- hol88-2.02.19940316.orig/Manual/Covers/Makefile +++ hol88-2.02.19940316/Manual/Covers/Makefile @@ -20,12 +20,12 @@ default: endpages.dvi: CRC.ps DESCRIPTION.ps LANTERN.ps REFERENCE.ps TUTORIAL.ps \ arms.ps endpages.tex endpages.sty - $(LATEX) endpages + TEXINPUTS=$$(pwd)/psfig:$$TEXINPUTS $(LATEX) endpages @echo "===> endpages.dvi created" titlepages.dvi: CRC.ps DESCRIPTION.ps LANTERN.ps REFERENCE.ps TUTORIAL.ps \ arms.ps titlepages.tex titlepages.sty - $(LATEX) titlepages + TEXINPUTS=$$(pwd)/psfig:$$TEXINPUTS $(LATEX) titlepages @echo "===> titlepages.dvi created" dvi: endpages.dvi titlepages.dvi --- hol88-2.02.19940316.orig/Manual/LaTeX/ref-macros.tex +++ hol88-2.02.19940316/Manual/LaTeX/ref-macros.tex @@ -172,3 +172,8 @@ % --------------------------------------------------------------------- \def\none{{\it none}} + +\newcommand\nintt{\fontsize{9pt}{11pt}\normalfont\ttfamily} +\newcommand\tenrm{\fontsize{10pt}{12pt}\normalfont\rmfamily} +%\def\ptt{\fam\ttfam\nintt}\textfont\ttfam\nintt\scriptfont\ttfam\nintt\scriptscriptfont\ttfam\nintt +\def\ptt{\fam\ttfam\nintt}%\textfont\ttfam\nintt\scriptfont\ttfam\nintt\scriptscriptfont\ttfam\nintt --- hol88-2.02.19940316.orig/Manual/LaTeX/layout.sty +++ hol88-2.02.19940316/Manual/LaTeX/layout.sty @@ -52,9 +52,9 @@ % MATH INDENTATION. = \tabcolsep + three small verbatim spaces (!) % --------------------------------------------------------------------- \setlength{\mathindent}{\tabcolsep} -\addtolength{\mathindent}{\the\fontdimen2\elvtt} -\addtolength{\mathindent}{\the\fontdimen2\elvtt} -\addtolength{\mathindent}{\the\fontdimen2\elvtt} +%\addtolength{\mathindent}{\the\fontdimen2\elvtt} +%\addtolength{\mathindent}{\the\fontdimen2\elvtt} +%\addtolength{\mathindent}{\the\fontdimen2\elvtt} % --------------------------------------------------------------------- % HEAD: spacing to match header macro below. --- hol88-2.02.19940316.orig/Manual/Reference/theorems.tex +++ hol88-2.02.19940316/Manual/Reference/theorems.tex @@ -1,7 +1,4 @@ -\chapter{Pre-proved Theorems} -\input{theorems-intro} -\section{Definitions of Basic Logical Constants} -\THEOREM AND\_DEF bool +\chapter{Pre-proved Theorems}\input{theorems-intro}\section{Definitions of Basic Logical Constants}\THEOREM AND\_DEF bool |- $/\ = (\t1 t2. !t. (t1 ==> t2 ==> t) ==> t) \ENDTHEOREM \THEOREM EXISTS\_DEF bool @@ -10,12 +7,12 @@ \THEOREM EXISTS\_UNIQUE\_DEF bool |- $?! = (\P. $? P /\ (!x y. P x /\ P y ==> (x = y))) \ENDTHEOREM -\THEOREM FORALL\_DEF bool -|- $! = (\P. P = (\x. T)) -\ENDTHEOREM \THEOREM F\_DEF bool |- F = (!t. t) \ENDTHEOREM +\THEOREM FORALL\_DEF bool +|- $! = (\P. P = (\x. T)) +\ENDTHEOREM \THEOREM NOT\_DEF bool |- $~ = (\t. t ==> F) \ENDTHEOREM @@ -25,8 +22,7 @@ \THEOREM T\_DEF bool |- T = ((\x. x) = (\x. x)) \ENDTHEOREM -\section{Constants for syntactic abbreviations} -\THEOREM ARB bool +\section{Constants for syntactic abbreviations}\THEOREM ARB bool |- ARB = (@x. T) \ENDTHEOREM \THEOREM COND\_DEF bool @@ -49,8 +45,7 @@ \THEOREM RES\_SELECT bool |- !P B. RES_SELECT P B = (@x. P x /\ B x) \ENDTHEOREM -\section{Axioms} -\THEOREM ARB\_THM bool +\section{Axioms}\THEOREM ARB\_THM bool |- $= = $= \ENDTHEOREM \THEOREM BOOL\_CASES\_AX bool @@ -68,8 +63,7 @@ \THEOREM SELECT\_AX bool |- !P x. P x ==> P($@ P) \ENDTHEOREM -\section{Logical tautologies} -\THEOREM AND1\_THM {\none} +\section{Logical tautologies}\THEOREM AND1\_THM {\none} |- !t1 t2. t1 /\ t2 ==> t1 \ENDTHEOREM \THEOREM AND2\_THM {\none} @@ -171,13 +165,13 @@ \THEOREM FALSITY {\none} |- !t. F ==> t \ENDTHEOREM +\THEOREM F\_IMP {\none} +|- !t. ~t ==>(t ==> F) +\ENDTHEOREM \THEOREM FORALL\_SIMP {\none} |- !t. (!x. t) = t \ENDTHEOREM -\THEOREM F\_IMP {\none} -|- !t. ~t ==>(t ==> F) -\ENDTHEOREM \THEOREM IMP\_CLAUSES {\none} |- !t. (T ==> t) = t /\ (t ==> T) = T /\ @@ -258,8 +252,7 @@ \THEOREM TRUTH {\none} |- T \ENDTHEOREM -\section{Theorems about functions} -\THEOREM ABS\_SIMP {\none} +\section{Theorems about functions}\THEOREM ABS\_SIMP {\none} |- !t1 t2. (\x. t1)t2 = t1 \ENDTHEOREM @@ -309,24 +302,22 @@ \THEOREM RIGHT\_ID\_DEF fun |- !f e. RIGHT_ID f e = (!x. f x e = x) \ENDTHEOREM -\section{Theorems about the type {\tt one}} -\THEOREM one one -|- !v. v = one +\section{Theorems about the type {\tt one}}\THEOREM one\_axiom one +|- !f g. f = g \ENDTHEOREM \THEOREM one\_Axiom one |- !e. ?! fn. fn one = e \ENDTHEOREM -\THEOREM one\_axiom one -|- !f g. f = g -\ENDTHEOREM \THEOREM one\_DEF one |- one = (@x. T) \ENDTHEOREM +\THEOREM one one +|- !v. v = one +\ENDTHEOREM \THEOREM one\_TY\_DEF one |- ?rep. TYPE_DEFINITION(\b. b)rep \ENDTHEOREM -\section{Theorems about combinators} -\THEOREM I\_DEF combin +\section{Theorems about combinators}\THEOREM I\_DEF combin |- I = S K K \ENDTHEOREM \THEOREM I\_o\_ID combin @@ -356,19 +347,18 @@ \THEOREM S\_THM combin |- !f g x. S f g x = f x(g x) \ENDTHEOREM -\section{Theorems about pairs} -\THEOREM COMMA\_DEF bool +\section{Theorems about pairs}\THEOREM COMMA\_DEF bool |- !x y. x,y = (@p. REP_prod p = MK_PAIR x y) \ENDTHEOREM \THEOREM CURRY\_DEF bool |- !f x y. CURRY f x y = f(x,y) \ENDTHEOREM -\THEOREM FST bool -|- !x y. FST(x,y) = x -\ENDTHEOREM \THEOREM FST\_DEF bool |- !p. FST p = (@x. ?y. MK_PAIR x y = REP_prod p) \ENDTHEOREM +\THEOREM FST bool +|- !x y. FST(x,y) = x +\ENDTHEOREM \THEOREM IS\_PAIR\_DEF bool |- !p. IS_PAIR p = (?x y. p = MK_PAIR x y) \ENDTHEOREM @@ -390,28 +380,27 @@ (!p' p''. (rep p' = rep p'') ==> (p' = p'')) /\ (!p. IS_PAIR p = (?p'. p = rep p'))) \ENDTHEOREM -\THEOREM SND bool -|- !x y. SND(x,y) = y -\ENDTHEOREM \THEOREM SND\_DEF bool |- !p. SND p = (@y. ?x. MK_PAIR x y = REP_prod p) \ENDTHEOREM +\THEOREM SND bool +|- !x y. SND(x,y) = y +\ENDTHEOREM \THEOREM UNCURRY\_DEF bool |- !f x y. UNCURRY f(x,y) = f x y \ENDTHEOREM -\section{Theorems about disjoint sums} +\section{Theorems about disjoint sums}\THEOREM INL\_DEF sum +|- !e. INL e = ABS_sum(\b x y. (x = e) /\ b) +\ENDTHEOREM \THEOREM INL sum |- !x. ISL x ==> (INL(OUTL x) = x) \ENDTHEOREM -\THEOREM INL\_DEF sum -|- !e. INL e = ABS_sum(\b x y. (x = e) /\ b) +\THEOREM INR\_DEF sum +|- !e. INR e = ABS_sum(\b x y. (y = e) /\ ~b) \ENDTHEOREM \THEOREM INR sum |- !x. ISR x ==> (INR(OUTR x) = x) \ENDTHEOREM -\THEOREM INR\_DEF sum -|- !e. INR e = ABS_sum(\b x y. (y = e) /\ ~b) -\ENDTHEOREM \THEOREM ISL sum |- (!x. ISL(INL x)) /\ (!y. ~ISL(INR y)) \ENDTHEOREM @@ -433,12 +422,12 @@ \THEOREM OUTR sum |- !x. OUTR(INR x) = x \ENDTHEOREM -\THEOREM sum\_Axiom sum -|- !f g. ?! h. (!x. h(INL x) = f x) /\ (!x. h(INR x) = g x) -\ENDTHEOREM \THEOREM sum\_axiom sum |- !f g. ?! h. (h o INL = f) /\ (h o INR = g) \ENDTHEOREM +\THEOREM sum\_Axiom sum +|- !f g. ?! h. (!x. h(INL x) = f x) /\ (!x. h(INR x) = g x) +\ENDTHEOREM \THEOREM sum\_ISO\_DEF sum |- (!a. ABS_sum(REP_sum a) = a) /\ (!r. IS_SUM_REP r = (REP_sum(ABS_sum r) = r)) @@ -446,16 +435,12 @@ \THEOREM sum\_TY\_DEF sum |- ?rep. TYPE_DEFINITION IS_SUM_REP rep \ENDTHEOREM -\section{Theorems about arithmetic} -\THEOREM ADD arithmetic -|- (!n. 0 + n = n) /\ (!m n. (SUC m) + n = SUC(m + n)) +\section{Theorems about arithmetic}\THEOREM ADD\_0 arithmetic +|- !m. m + 0 = m \ENDTHEOREM \THEOREM ADD1 arithmetic |- !m. SUC m = m + 1 \ENDTHEOREM -\THEOREM ADD\_0 arithmetic -|- !m. m + 0 = m -\ENDTHEOREM \THEOREM ADD\_ASSOC arithmetic |- !m n p. m + (n + p) = (m + n) + p \ENDTHEOREM @@ -465,6 +450,9 @@ ((SUC m) + n = SUC(m + n)) /\ (m + (SUC n) = SUC(m + n)) \ENDTHEOREM +\THEOREM ADD arithmetic +|- (!n. 0 + n = n) /\ (!m n. (SUC m) + n = SUC(m + n)) +\ENDTHEOREM \THEOREM ADD\_EQ\_0 arithmetic |- !m n. (m + n = 0) = (m = 0) /\ (n = 0) \ENDTHEOREM @@ -523,15 +511,15 @@ \THEOREM EQ\_MONO\_ADD\_EQ arithmetic |- !m n p. (m + p = n + p) = (m = n) \ENDTHEOREM -\THEOREM EVEN arithmetic -|- (EVEN 0 = T) /\ (!n. EVEN(SUC n) = ~EVEN n) -\ENDTHEOREM \THEOREM EVEN\_ADD arithmetic |- !m n. EVEN(m + n) = (EVEN m = EVEN n) \ENDTHEOREM \THEOREM EVEN\_AND\_ODD arithmetic |- !n. ~(EVEN n /\ ODD n) \ENDTHEOREM +\THEOREM EVEN arithmetic +|- (EVEN 0 = T) /\ (!n. EVEN(SUC n) = ~EVEN n) +\ENDTHEOREM \THEOREM EVEN\_DOUBLE arithmetic |- !n. EVEN(2 * n) \ENDTHEOREM @@ -550,12 +538,12 @@ \THEOREM EVEN\_OR\_ODD arithmetic |- !n. EVEN n \/ ODD n \ENDTHEOREM -\THEOREM EXP arithmetic -|- (!m. m EXP 0 = 1) /\ (!m n. m EXP (SUC n) = m * (m EXP n)) -\ENDTHEOREM \THEOREM EXP\_ADD arithmetic |- !p q n. n EXP (p + q) = (n EXP p) * (n EXP q) \ENDTHEOREM +\THEOREM EXP arithmetic +|- (!m. m EXP 0 = 1) /\ (!m n. m EXP (SUC n) = m * (m EXP n)) +\ENDTHEOREM \THEOREM FACT arithmetic |- (FACT 0 = 1) /\ (!n. FACT(SUC n) = (SUC n) * (FACT n)) \ENDTHEOREM @@ -609,24 +597,21 @@ \THEOREM LEFT\_SUB\_DISTRIB arithmetic |- !m n p. p * (m - n) = (p * m) - (p * n) \ENDTHEOREM -\THEOREM LESS prim\_rec -|- !m n. m < n = (?P. (!n'. P(SUC n') ==> P n') /\ P m /\ ~P n) -\ENDTHEOREM -\THEOREM LESS\_0 prim\_rec -|- !n. 0 < (SUC n) -\ENDTHEOREM \THEOREM LESS\_0\_0 prim\_rec |- 0 < (SUC 0) \ENDTHEOREM \THEOREM LESS\_0\_CASES arithmetic |- !m. (0 = m) \/ 0 < m \ENDTHEOREM -\THEOREM LESS\_ADD arithmetic -|- !m n. n < m ==> (?p. p + n = m) +\THEOREM LESS\_0 prim\_rec +|- !n. 0 < (SUC n) \ENDTHEOREM \THEOREM LESS\_ADD\_1 arithmetic |- !m n. n < m ==> (?p. m = n + (p + 1)) \ENDTHEOREM +\THEOREM LESS\_ADD arithmetic +|- !m n. n < m ==> (?p. p + n = m) +\ENDTHEOREM \THEOREM LESS\_ADD\_NONZERO arithmetic |- !m n. ~(n = 0) ==> m < (m + n) \ENDTHEOREM @@ -642,14 +627,8 @@ \THEOREM LESS\_CASES\_IMP arithmetic |- !m n. ~m < n /\ ~(m = n) ==> n < m \ENDTHEOREM -\THEOREM LESS\_EQ arithmetic -|- !m n. m < n = (SUC m) <= n -\ENDTHEOREM -\THEOREM LESS\_EQUAL\_ADD arithmetic -|- !m n. m <= n ==> (?p. n = m + p) -\ENDTHEOREM -\THEOREM LESS\_EQUAL\_ANTISYM arithmetic -|- !n m. n <= m /\ m <= n ==> (n = m) +\THEOREM LESS prim\_rec +|- !m n. m < n = (?P. (!n'. P(SUC n') ==> P n') /\ P m /\ ~P n) \ENDTHEOREM \THEOREM LESS\_EQ\_0 arithmetic |- !n. n <= 0 = (n = 0) @@ -666,6 +645,9 @@ \THEOREM LESS\_EQ\_CASES arithmetic |- !m n. m <= n \/ n <= m \ENDTHEOREM +\THEOREM LESS\_EQ arithmetic +|- !m n. m < n = (SUC m) <= n +\ENDTHEOREM \THEOREM LESS\_EQ\_EXISTS arithmetic |- !m n. m <= n = (?p. n = m + p) \ENDTHEOREM @@ -678,12 +660,12 @@ \THEOREM LESS\_EQ\_LESS\_TRANS arithmetic |- !m n p. m <= n /\ n < p ==> m < p \ENDTHEOREM -\THEOREM LESS\_EQ\_MONO arithmetic -|- !n m. (SUC n) <= (SUC m) = n <= m -\ENDTHEOREM \THEOREM LESS\_EQ\_MONO\_ADD\_EQ arithmetic |- !m n p. (m + p) <= (n + p) = m <= n \ENDTHEOREM +\THEOREM LESS\_EQ\_MONO arithmetic +|- !n m. (SUC n) <= (SUC m) = n <= m +\ENDTHEOREM \THEOREM LESS\_EQ\_REFL arithmetic |- !m. m <= m \ENDTHEOREM @@ -696,6 +678,12 @@ \THEOREM LESS\_EQ\_TRANS arithmetic |- !m n p. m <= n /\ n <= p ==> m <= p \ENDTHEOREM +\THEOREM LESS\_EQUAL\_ADD arithmetic +|- !m n. m <= n ==> (?p. n = m + p) +\ENDTHEOREM +\THEOREM LESS\_EQUAL\_ANTISYM arithmetic +|- !n m. n <= m /\ m <= n ==> (n = m) +\ENDTHEOREM \THEOREM LESS\_EXP\_SUC\_MONO arithmetic |- !n m. ((SUC(SUC m)) EXP n) < ((SUC(SUC m)) EXP (SUC n)) \ENDTHEOREM @@ -723,9 +711,6 @@ \THEOREM LESS\_MOD arithmetic |- !n k. k < n ==> (k MOD n = k) \ENDTHEOREM -\THEOREM LESS\_MONO prim\_rec -|- !m n. m < n ==> (SUC m) < (SUC n) -\ENDTHEOREM \THEOREM LESS\_MONO\_ADD arithmetic |- !m n p. m < n ==> (m + p) < (n + p) \ENDTHEOREM @@ -735,6 +720,9 @@ \THEOREM LESS\_MONO\_ADD\_INV arithmetic |- !m n p. (m + p) < (n + p) ==> m < n \ENDTHEOREM +\THEOREM LESS\_MONO prim\_rec +|- !m n. m < n ==> (SUC m) < (SUC n) +\ENDTHEOREM \THEOREM LESS\_MONO\_EQ arithmetic |- !m n. (SUC m) < (SUC n) = m < n \ENDTHEOREM @@ -759,12 +747,12 @@ \THEOREM LESS\_OR arithmetic |- !m n. m < n ==> (SUC m) <= n \ENDTHEOREM -\THEOREM LESS\_OR\_EQ arithmetic -|- !m n. m <= n = m < n \/ (m = n) -\ENDTHEOREM \THEOREM LESS\_OR\_EQ\_ADD arithmetic |- !n m. n < m \/ (?p. n = p + m) \ENDTHEOREM +\THEOREM LESS\_OR\_EQ arithmetic +|- !m n. m <= n = m < n \/ (m = n) +\ENDTHEOREM \THEOREM LESS\_REFL prim\_rec |- !n. ~n < n \ENDTHEOREM @@ -822,9 +810,6 @@ \THEOREM MONOID\_MULT\_1 arithmetic |- MONOID $* 1 \ENDTHEOREM -\THEOREM MULT arithmetic -|- (!n. 0 * n = 0) /\ (!m n. (SUC m) * n = (m * n) + n) -\ENDTHEOREM \THEOREM MULT\_0 arithmetic |- !m. m * 0 = 0 \ENDTHEOREM @@ -840,6 +825,9 @@ ((SUC m) * n = (m * n) + n) /\ (m * (SUC n) = m + (m * n)) \ENDTHEOREM +\THEOREM MULT arithmetic +|- (!n. 0 * n = 0) /\ (!m n. (SUC m) * n = (m * n) + n) +\ENDTHEOREM \THEOREM MULT\_EQ\_0 arithmetic |- !m n. (m * n = 0) = (m = 0) \/ (n = 0) \ENDTHEOREM @@ -879,12 +867,12 @@ \THEOREM NOT\_LEQ arithmetic |- !m n. ~m <= n = (SUC n) <= m \ENDTHEOREM -\THEOREM NOT\_LESS arithmetic -|- !m n. ~m < n = n <= m -\ENDTHEOREM \THEOREM NOT\_LESS\_0 prim\_rec |- !n. ~n < 0 \ENDTHEOREM +\THEOREM NOT\_LESS arithmetic +|- !m n. ~m < n = n <= m +\ENDTHEOREM \THEOREM NOT\_LESS\_EQ prim\_rec |- !m n. (m = n) ==> ~m < n \ENDTHEOREM @@ -897,18 +885,18 @@ \THEOREM NOT\_ODD\_EQ\_EVEN arithmetic |- !n m. ~(SUC(n + n) = m + m) \ENDTHEOREM -\THEOREM NOT\_SUC num -|- !n. ~(SUC n = 0) -\ENDTHEOREM \THEOREM NOT\_SUC\_ADD\_LESS\_EQ arithmetic |- !m n. ~(SUC(m + n)) <= m \ENDTHEOREM -\THEOREM NOT\_SUC\_LESS\_EQ arithmetic -|- !n m. ~(SUC n) <= m = m <= n +\THEOREM NOT\_SUC num +|- !n. ~(SUC n = 0) \ENDTHEOREM \THEOREM NOT\_SUC\_LESS\_EQ\_0 arithmetic |- !n. ~(SUC n) <= 0 \ENDTHEOREM +\THEOREM NOT\_SUC\_LESS\_EQ arithmetic +|- !n m. ~(SUC n) <= m = m <= n +\ENDTHEOREM \THEOREM num\_Axiom prim\_rec |- !e f. ?! fn. (fn 0 = e) /\ (!n. fn(SUC n) = f(fn n)n) \ENDTHEOREM @@ -922,12 +910,12 @@ \THEOREM num\_TY\_DEF num |- ?rep. TYPE_DEFINITION IS_NUM_REP rep \ENDTHEOREM -\THEOREM ODD arithmetic -|- (ODD 0 = F) /\ (!n. ODD(SUC n) = ~ODD n) -\ENDTHEOREM \THEOREM ODD\_ADD arithmetic |- !m n. ODD(m + n) = ~(ODD m = ODD n) \ENDTHEOREM +\THEOREM ODD arithmetic +|- (ODD 0 = F) /\ (!n. ODD(SUC n) = ~ODD n) +\ENDTHEOREM \THEOREM ODD\_DOUBLE arithmetic |- !n. ODD(SUC(2 * n)) \ENDTHEOREM @@ -946,18 +934,18 @@ \THEOREM OR\_LESS arithmetic |- !m n. (SUC m) <= n ==> m < n \ENDTHEOREM -\THEOREM PRE prim\_rec -|- (PRE 0 = 0) /\ (!m. PRE(SUC m) = m) -\ENDTHEOREM \THEOREM PRE\_DEF prim\_rec |- !m. PRE m = ((m = 0) => 0 | (@n. m = SUC n)) \ENDTHEOREM -\THEOREM PRE\_SUB arithmetic -|- !m n. PRE(m - n) = (PRE m) - n +\THEOREM PRE prim\_rec +|- (PRE 0 = 0) /\ (!m. PRE(SUC m) = m) \ENDTHEOREM \THEOREM PRE\_SUB1 arithmetic |- !m. PRE m = m - 1 \ENDTHEOREM +\THEOREM PRE\_SUB arithmetic +|- !m n. PRE(m - n) = (PRE m) - n +\ENDTHEOREM \THEOREM PRE\_SUC\_EQ arithmetic |- !m n. 0 < n ==> ((m = PRE n) = (SUC m = n)) \ENDTHEOREM @@ -1013,9 +1001,6 @@ (SIMP_REC x f 0 = x) /\ (!m. SIMP_REC x f(SUC m) = f(SIMP_REC x f m)) \ENDTHEOREM -\THEOREM SUB arithmetic -|- (!m. 0 - m = 0) /\ (!m n. (SUC m) - n = (m < n => 0 | SUC(m - n))) -\ENDTHEOREM \THEOREM SUB\_0 arithmetic |- !m. (0 - m = 0) /\ (m - 0 = m) \ENDTHEOREM @@ -1025,8 +1010,8 @@ \THEOREM SUB\_CANCEL arithmetic |- !p n m. n <= p /\ m <= p ==> ((p - n = p - m) = (n = m)) \ENDTHEOREM -\THEOREM SUB\_EQUAL\_0 arithmetic -|- !c. c - c = 0 +\THEOREM SUB arithmetic +|- (!m. 0 - m = 0) /\ (!m n. (SUC m) - n = (m < n => 0 | SUC(m - n))) \ENDTHEOREM \THEOREM SUB\_EQ\_0 arithmetic |- !m n. (m - n = 0) = m <= n @@ -1034,6 +1019,9 @@ \THEOREM SUB\_EQ\_EQ\_0 arithmetic |- !m n. (m - n = m) = (m = 0) \/ (n = 0) \ENDTHEOREM +\THEOREM SUB\_EQUAL\_0 arithmetic +|- !c. c - c = 0 +\ENDTHEOREM \THEOREM SUB\_LEFT\_ADD arithmetic |- !m n p. m + (n - p) = (n <= p => m | (m + n) - p) \ENDTHEOREM @@ -1061,12 +1049,12 @@ \THEOREM SUB\_LESS\_0 arithmetic |- !n m. m < n = 0 < (n - m) \ENDTHEOREM -\THEOREM SUB\_LESS\_EQ arithmetic -|- !n m. (n - m) <= n -\ENDTHEOREM \THEOREM SUB\_LESS\_EQ\_ADD arithmetic |- !m p. m <= p ==> (!n. (p - m) <= n = p <= (m + n)) \ENDTHEOREM +\THEOREM SUB\_LESS\_EQ arithmetic +|- !n m. (n - m) <= n +\ENDTHEOREM \THEOREM SUB\_LESS\_OR arithmetic |- !m n. n < m ==> n <= (m - 1) \ENDTHEOREM @@ -1148,12 +1136,7 @@ \THEOREM ZERO\_REP\_DEF num |- ZERO_REP = (@x. !y. ~(x = SUC_REP y)) \ENDTHEOREM -\section{Theorems about lists} -\THEOREM ALL\_EL list -|- (!P. ALL_EL P[] = T) /\ - (!P x l. ALL_EL P(CONS x l) = P x /\ ALL_EL P l) -\ENDTHEOREM -\THEOREM ALL\_EL\_APPEND list +\section{Theorems about lists}\THEOREM ALL\_EL\_APPEND list |- !P l1 l2. ALL_EL P(APPEND l1 l2) = ALL_EL P l1 /\ ALL_EL P l2 \ENDTHEOREM \THEOREM ALL\_EL\_BUTFIRSTN list @@ -1166,6 +1149,10 @@ \THEOREM ALL\_EL\_CONJ list |- !P Q l. ALL_EL(\x. P x /\ Q x)l = ALL_EL P l /\ ALL_EL Q l \ENDTHEOREM +\THEOREM ALL\_EL list +|- (!P. ALL_EL P[] = T) /\ + (!P x l. ALL_EL P(CONS x l) = P x /\ ALL_EL P l) +\ENDTHEOREM \THEOREM ALL\_EL\_FIRSTN list |- !P l. ALL_EL P l ==> (!m. m <= (LENGTH l) ==> ALL_EL P(FIRSTN m l)) \ENDTHEOREM @@ -1214,13 +1201,12 @@ (!h t l. AP(CONS h t)l = CONS(h(HD l))(AP t(TL l))) \ENDTHEOREM -\THEOREM APPEND list -|- (!l. APPEND[]l = l) /\ - (!l1 l2 h. APPEND(CONS h l1)l2 = CONS h(APPEND l1 l2)) -\ENDTHEOREM \THEOREM APPEND\_ASSOC list |- !l1 l2 l3. APPEND l1(APPEND l2 l3) = APPEND(APPEND l1 l2)l3 \ENDTHEOREM +\THEOREM APPEND\_BUTLAST\_LAST list +|- !l. ~(l = []) ==> (APPEND(BUTLAST l)[LAST l] = l) +\ENDTHEOREM \THEOREM APPEND\_BUTLASTN\_BUTFIRSTN list |- !m n l. (m + n = LENGTH l) ==> (APPEND(BUTLASTN m l)(BUTFIRSTN n l) = l) @@ -1228,8 +1214,9 @@ \THEOREM APPEND\_BUTLASTN\_LASTN list |- !n l. n <= (LENGTH l) ==> (APPEND(BUTLASTN n l)(LASTN n l) = l) \ENDTHEOREM -\THEOREM APPEND\_BUTLAST\_LAST list -|- !l. ~(l = []) ==> (APPEND(BUTLAST l)[LAST l] = l) +\THEOREM APPEND list +|- (!l. APPEND[]l = l) /\ + (!l1 l2 h. APPEND(CONS h l1)l2 = CONS h(APPEND l1 l2)) \ENDTHEOREM \THEOREM APPEND\_FIRSTN\_BUTFIRSTN list |- !n l. n <= (LENGTH l) ==> (APPEND(FIRSTN n l)(BUTFIRSTN n l) = l) @@ -1273,10 +1260,6 @@ LEFT_ID f e ==> (!l. FOLDR f e(FLAT l) = FOLDR f e(MAP(FOLDR f e)l))) \ENDTHEOREM -\THEOREM BUTFIRSTN list -|- (!l. BUTFIRSTN 0 l = l) /\ - (!n x l. BUTFIRSTN(SUC n)(CONS x l) = BUTFIRSTN n l) -\ENDTHEOREM \THEOREM BUTFIRSTN\_APPEND1 list |- !n l1. n <= (LENGTH l1) ==> @@ -1292,6 +1275,10 @@ (n + m) <= (LENGTH l) ==> (BUTFIRSTN n(BUTFIRSTN m l) = BUTFIRSTN(n + m)l) \ENDTHEOREM +\THEOREM BUTFIRSTN list +|- (!l. BUTFIRSTN 0 l = l) /\ + (!n x l. BUTFIRSTN(SUC n)(CONS x l) = BUTFIRSTN n l) +\ENDTHEOREM \THEOREM BUTFIRSTN\_LASTN list |- !n l. n <= (LENGTH l) ==> (BUTFIRSTN n l = LASTN((LENGTH l) - n)l) \ENDTHEOREM @@ -1313,13 +1300,12 @@ n <= (LENGTH l) ==> (!x. BUTFIRSTN n(SNOC x l) = SNOC x(BUTFIRSTN n l)) \ENDTHEOREM +\THEOREM BUTLAST\_DEF list +|- !l. BUTLAST l = SEG(PRE(LENGTH l))0 l +\ENDTHEOREM \THEOREM BUTLAST list |- !x l. BUTLAST(SNOC x l) = l \ENDTHEOREM -\THEOREM BUTLASTN list -|- (!l. BUTLASTN 0 l = l) /\ - (!n x l. BUTLASTN(SUC n)(SNOC x l) = BUTLASTN n l) -\ENDTHEOREM \THEOREM BUTLASTN\_1 list |- !l. ~(l = []) ==> (BUTLASTN 1 l = BUTLAST l) \ENDTHEOREM @@ -1347,6 +1333,10 @@ n <= (LENGTH l) ==> (!x. BUTLASTN n(CONS x l) = CONS x(BUTLASTN n l)) \ENDTHEOREM +\THEOREM BUTLASTN list +|- (!l. BUTLASTN 0 l = l) /\ + (!n x l. BUTLASTN(SUC n)(SNOC x l) = BUTLASTN n l) +\ENDTHEOREM \THEOREM BUTLASTN\_FIRSTN list |- !n l. n <= (LENGTH l) ==> (BUTLASTN n l = FIRSTN((LENGTH l) - n)l) \ENDTHEOREM @@ -1381,9 +1371,6 @@ \THEOREM BUTLASTN\_SUC\_BUTLAST list |- !n l. n < (LENGTH l) ==> (BUTLASTN(SUC n)l = BUTLASTN n(BUTLAST l)) \ENDTHEOREM -\THEOREM BUTLAST\_DEF list -|- !l. BUTLAST l = SEG(PRE(LENGTH l))0 l -\ENDTHEOREM \THEOREM COMM\_ASSOC\_FOLDL\_REVERSE list |- !f. COMM f ==> ASSOC f ==> (!e l. FOLDL f e(REVERSE l) = FOLDL f e l) \ENDTHEOREM @@ -1400,9 +1387,6 @@ COMM f ==> (!e'. MONOID f e' ==> (!e l. FOLDR f e l = f e(FOLDR f e' l))) \ENDTHEOREM -\THEOREM CONS list -|- !l. ~NULL l ==> (CONS(HD l)(TL l) = l) -\ENDTHEOREM \THEOREM CONS\_11 list |- !h t h' t'. (CONS h t = CONS h' t') = (h = h') /\ (t = t') \ENDTHEOREM @@ -1415,11 +1399,28 @@ ABS_list ((\m. ((m = 0) => h | FST(REP_list t)(PRE m))),SUC(SND(REP_list t))) \ENDTHEOREM +\THEOREM CONS list +|- !l. ~NULL l ==> (CONS(HD l)(TL l) = l) +\ENDTHEOREM +\THEOREM EL\_APPEND1 list +|- !n l1 l2. n < (LENGTH l1) ==> (EL n(APPEND l1 l2) = EL n l1) +\ENDTHEOREM +\THEOREM EL\_APPEND2 list +|- !l1 n. + (LENGTH l1) <= n ==> + (!l2. EL n(APPEND l1 l2) = EL(n - (LENGTH l1))l2) +\ENDTHEOREM +\THEOREM EL\_CONS list +|- !n. 0 < n ==> (!x l. EL n(CONS x l) = EL(PRE n)l) +\ENDTHEOREM \THEOREM EL list |- (!l. EL 0 l = HD l) /\ (!l n. EL(SUC n)l = EL n(TL l)) \ENDTHEOREM -\THEOREM ELL list -|- (!l. ELL 0 l = LAST l) /\ (!n l. ELL(SUC n)l = ELL n(BUTLAST l)) +\THEOREM EL\_ELL list +|- !n l. n < (LENGTH l) ==> (EL n l = ELL(PRE((LENGTH l) - n))l) +\ENDTHEOREM +\THEOREM EL\_IS\_EL list +|- !n l. n < (LENGTH l) ==> IS_EL(EL n l)l \ENDTHEOREM \THEOREM ELL\_0\_SNOC list |- !l x. ELL 0(SNOC x l) = x @@ -1435,9 +1436,18 @@ \THEOREM ELL\_CONS list |- !n l. n < (LENGTH l) ==> (!x. ELL n(CONS x l) = ELL n l) \ENDTHEOREM +\THEOREM ELL list +|- (!l. ELL 0 l = LAST l) /\ (!n l. ELL(SUC n)l = ELL n(BUTLAST l)) +\ENDTHEOREM \THEOREM ELL\_EL list |- !n l. n < (LENGTH l) ==> (ELL n l = EL(PRE((LENGTH l) - n))l) \ENDTHEOREM +\THEOREM EL\_LENGTH\_APPEND list +|- !l2 l1. ~NULL l2 ==> (EL(LENGTH l1)(APPEND l1 l2) = HD l2) +\ENDTHEOREM +\THEOREM EL\_LENGTH\_SNOC list +|- !l x. EL(LENGTH l)(SNOC x l) = x +\ENDTHEOREM \THEOREM ELL\_IS\_EL list |- !n l. n < (LENGTH l) ==> IS_EL(EL n l)l \ENDTHEOREM @@ -1475,29 +1485,6 @@ \THEOREM ELL\_SUC\_SNOC list |- !n x l. ELL(SUC n)(SNOC x l) = ELL n l \ENDTHEOREM -\THEOREM EL\_APPEND1 list -|- !n l1 l2. n < (LENGTH l1) ==> (EL n(APPEND l1 l2) = EL n l1) -\ENDTHEOREM -\THEOREM EL\_APPEND2 list -|- !l1 n. - (LENGTH l1) <= n ==> - (!l2. EL n(APPEND l1 l2) = EL(n - (LENGTH l1))l2) -\ENDTHEOREM -\THEOREM EL\_CONS list -|- !n. 0 < n ==> (!x l. EL n(CONS x l) = EL(PRE n)l) -\ENDTHEOREM -\THEOREM EL\_ELL list -|- !n l. n < (LENGTH l) ==> (EL n l = ELL(PRE((LENGTH l) - n))l) -\ENDTHEOREM -\THEOREM EL\_IS\_EL list -|- !n l. n < (LENGTH l) ==> IS_EL(EL n l)l -\ENDTHEOREM -\THEOREM EL\_LENGTH\_APPEND list -|- !l2 l1. ~NULL l2 ==> (EL(LENGTH l1)(APPEND l1 l2) = HD l2) -\ENDTHEOREM -\THEOREM EL\_LENGTH\_SNOC list -|- !l x. EL(LENGTH l)(SNOC x l) = x -\ENDTHEOREM \THEOREM EL\_MAP list |- !n l. n < (LENGTH l) ==> (!f. EL n(MAP f l) = f(EL n l)) \ENDTHEOREM @@ -1548,17 +1535,17 @@ LEFT_ID g e ==> (!l. FOLDR f e(FLAT l) = FOLDR g e(MAP(FOLDR f e)l))) \ENDTHEOREM -\THEOREM FILTER list -|- (!P. FILTER P[] = []) /\ - (!P x l. - FILTER P(CONS x l) = (P x => CONS x(FILTER P l) | FILTER P l)) -\ENDTHEOREM \THEOREM FILTER\_APPEND list |- !f l1 l2. FILTER f(APPEND l1 l2) = APPEND(FILTER f l1)(FILTER f l2) \ENDTHEOREM \THEOREM FILTER\_COMM list |- !f1 f2 l. FILTER f1(FILTER f2 l) = FILTER f2(FILTER f1 l) \ENDTHEOREM +\THEOREM FILTER list +|- (!P. FILTER P[] = []) /\ + (!P x l. + FILTER P(CONS x l) = (P x => CONS x(FILTER P l) | FILTER P l)) +\ENDTHEOREM \THEOREM FILTER\_FILTER list |- !P Q l. FILTER P(FILTER Q l) = FILTER(\x. P x /\ Q x)l \ENDTHEOREM @@ -1583,10 +1570,6 @@ \THEOREM FILTER\_SNOC list |- !P x l. FILTER P(SNOC x l) = (P x => SNOC x(FILTER P l) | FILTER P l) \ENDTHEOREM -\THEOREM FIRSTN list -|- (!l. FIRSTN 0 l = []) /\ - (!n x l. FIRSTN(SUC n)(CONS x l) = CONS x(FIRSTN n l)) -\ENDTHEOREM \THEOREM FIRSTN\_APPEND1 list |- !n l1. n <= (LENGTH l1) ==> (!l2. FIRSTN n(APPEND l1 l2) = FIRSTN n l1) @@ -1599,6 +1582,10 @@ \THEOREM FIRSTN\_BUTLASTN list |- !n l. n <= (LENGTH l) ==> (FIRSTN n l = BUTLASTN((LENGTH l) - n)l) \ENDTHEOREM +\THEOREM FIRSTN list +|- (!l. FIRSTN 0 l = []) /\ + (!n x l. FIRSTN(SUC n)(CONS x l) = CONS x(FIRSTN n l)) +\ENDTHEOREM \THEOREM FIRSTN\_FIRSTN list |- !m l. m <= (LENGTH l) ==> @@ -1619,12 +1606,12 @@ \THEOREM FIRSTN\_SNOC list |- !n l. n <= (LENGTH l) ==> (!x. FIRSTN n(SNOC x l) = FIRSTN n l) \ENDTHEOREM -\THEOREM FLAT list -|- (FLAT[] = []) /\ (!h t. FLAT(CONS h t) = APPEND h(FLAT t)) -\ENDTHEOREM \THEOREM FLAT\_APPEND list |- !l1 l2. FLAT(APPEND l1 l2) = APPEND(FLAT l1)(FLAT l2) \ENDTHEOREM +\THEOREM FLAT list +|- (FLAT[] = []) /\ (!h t. FLAT(CONS h t) = APPEND h(FLAT t)) +\ENDTHEOREM \THEOREM FLAT\_FLAT list |- !l. FLAT(FLAT l) = FLAT(MAP FLAT l) \ENDTHEOREM @@ -1640,13 +1627,13 @@ \THEOREM FLAT\_SNOC list |- !x l. FLAT(SNOC x l) = APPEND(FLAT l)x \ENDTHEOREM +\THEOREM FOLDL\_APPEND list +|- !f e l1 l2. FOLDL f e(APPEND l1 l2) = FOLDL f(FOLDL f e l1)l2 +\ENDTHEOREM \THEOREM FOLDL list |- (!f e. FOLDL f e[] = e) /\ (!f e x l. FOLDL f e(CONS x l) = FOLDL f(f e x)l) \ENDTHEOREM -\THEOREM FOLDL\_APPEND list -|- !f e l1 l2. FOLDL f e(APPEND l1 l2) = FOLDL f(FOLDL f e l1)l2 -\ENDTHEOREM \THEOREM FOLDL\_FILTER list |- !f e P l. FOLDL f e(FILTER P l) = FOLDL(\x y. (P y => f x y | x))e l \ENDTHEOREM @@ -1668,16 +1655,16 @@ \THEOREM FOLDL\_SNOC\_NIL list |- !l. FOLDL(\xs x. SNOC x xs)[]l = l \ENDTHEOREM -\THEOREM FOLDR list -|- (!f e. FOLDR f e[] = e) /\ - (!f e x l. FOLDR f e(CONS x l) = f x(FOLDR f e l)) -\ENDTHEOREM \THEOREM FOLDR\_APPEND list |- !f e l1 l2. FOLDR f e(APPEND l1 l2) = FOLDR f(FOLDR f e l2)l1 \ENDTHEOREM \THEOREM FOLDR\_CONS\_NIL list |- !l. FOLDR CONS[]l = l \ENDTHEOREM +\THEOREM FOLDR list +|- (!f e. FOLDR f e[] = e) /\ + (!f e x l. FOLDR f e(CONS x l) = f x(FOLDR f e l)) +\ENDTHEOREM \THEOREM FOLDR\_FILTER list |- !f e P l. FOLDR f e(FILTER P l) = FOLDR(\x y. (P x => f x y | y))e l \ENDTHEOREM @@ -1716,10 +1703,6 @@ \THEOREM HD list |- !h t. HD(CONS h t) = h \ENDTHEOREM -\THEOREM IS\_EL list -|- (!x. IS_EL x[] = F) /\ - (!y x l. IS_EL y(CONS x l) = (y = x) \/ IS_EL y l) -\ENDTHEOREM \THEOREM IS\_EL\_APPEND list |- !l1 l2 x. IS_EL x(APPEND l1 l2) = IS_EL x l1 \/ IS_EL x l2 \ENDTHEOREM @@ -1732,6 +1715,10 @@ \THEOREM IS\_EL\_DEF list |- !x l. IS_EL x l = SOME_EL($= x)l \ENDTHEOREM +\THEOREM IS\_EL list +|- (!x. IS_EL x[] = F) /\ + (!y x l. IS_EL y(CONS x l) = (y = x) \/ IS_EL y l) +\ENDTHEOREM \THEOREM IS\_EL\_FILTER list |- !P x. P x ==> (!l. IS_EL x(FILTER P l) = IS_EL x l) \ENDTHEOREM @@ -1772,15 +1759,15 @@ \THEOREM IS\_list\_REP list |- !r. IS_list_REP r = (?f n. r = (\m. (m < n => f m | (@x. T))),n) \ENDTHEOREM +\THEOREM IS\_PREFIX\_APPEND list +|- !l1 l2. IS_PREFIX l1 l2 = (?l. l1 = APPEND l2 l) +\ENDTHEOREM \THEOREM IS\_PREFIX list |- (!l. IS_PREFIX l[] = T) /\ (!x l. IS_PREFIX[](CONS x l) = F) /\ (!x1 l1 x2 l2. IS_PREFIX(CONS x1 l1)(CONS x2 l2) = (x1 = x2) /\ IS_PREFIX l1 l2) \ENDTHEOREM -\THEOREM IS\_PREFIX\_APPEND list -|- !l1 l2. IS_PREFIX l1 l2 = (?l. l1 = APPEND l2 l) -\ENDTHEOREM \THEOREM IS\_PREFIX\_IS\_SUBLIST list |- !l1 l2. IS_PREFIX l1 l2 ==> IS_SUBLIST l1 l2 \ENDTHEOREM @@ -1790,6 +1777,9 @@ \THEOREM IS\_PREFIX\_REVERSE list |- !l1 l2. IS_PREFIX(REVERSE l1)(REVERSE l2) = IS_SUFFIX l1 l2 \ENDTHEOREM +\THEOREM IS\_SUBLIST\_APPEND list +|- !l1 l2. IS_SUBLIST l1 l2 = (?l l'. l1 = APPEND l(APPEND l2 l')) +\ENDTHEOREM \THEOREM IS\_SUBLIST list |- (!l. IS_SUBLIST l[] = T) /\ (!x l. IS_SUBLIST[](CONS x l) = F) /\ @@ -1797,33 +1787,32 @@ IS_SUBLIST(CONS x1 l1)(CONS x2 l2) = (x1 = x2) /\ IS_PREFIX l1 l2 \/ IS_SUBLIST l1(CONS x2 l2)) \ENDTHEOREM -\THEOREM IS\_SUBLIST\_APPEND list -|- !l1 l2. IS_SUBLIST l1 l2 = (?l l'. l1 = APPEND l(APPEND l2 l')) -\ENDTHEOREM \THEOREM IS\_SUBLIST\_REVERSE list |- !l1 l2. IS_SUBLIST(REVERSE l1)(REVERSE l2) = IS_SUBLIST l1 l2 \ENDTHEOREM +\THEOREM IS\_SUFFIX\_APPEND list +|- !l1 l2. IS_SUFFIX l1 l2 = (?l. l1 = APPEND l l2) +\ENDTHEOREM \THEOREM IS\_SUFFIX list |- (!l. IS_SUFFIX l[] = T) /\ (!x l. IS_SUFFIX[](SNOC x l) = F) /\ (!x1 l1 x2 l2. IS_SUFFIX(SNOC x1 l1)(SNOC x2 l2) = (x1 = x2) /\ IS_SUFFIX l1 l2) \ENDTHEOREM -\THEOREM IS\_SUFFIX\_APPEND list -|- !l1 l2. IS_SUFFIX l1 l2 = (?l. l1 = APPEND l l2) -\ENDTHEOREM \THEOREM IS\_SUFFIX\_IS\_SUBLIST list |- !l1 l2. IS_SUFFIX l1 l2 ==> IS_SUBLIST l1 l2 \ENDTHEOREM \THEOREM IS\_SUFFIX\_REVERSE list |- !l1 l2. IS_SUFFIX(REVERSE l1)(REVERSE l2) = IS_PREFIX l1 l2 \ENDTHEOREM +\THEOREM LAST\_DEF list +|- !l. LAST l = HD(SEG 1(PRE(LENGTH l))l) +\ENDTHEOREM \THEOREM LAST list |- !x l. LAST(SNOC x l) = x \ENDTHEOREM -\THEOREM LASTN list -|- (!l. LASTN 0 l = []) /\ - (!n x l. LASTN(SUC n)(SNOC x l) = SNOC x(LASTN n l)) +\THEOREM LAST\_LASTN\_LAST list +|- !n l. n <= (LENGTH l) ==> 0 < n ==> (LAST(LASTN n l) = LAST l) \ENDTHEOREM \THEOREM LASTN\_1 list |- !l. ~(l = []) ==> (LASTN 1 l = [LAST l]) @@ -1847,6 +1836,10 @@ \THEOREM LASTN\_CONS list |- !n l. n <= (LENGTH l) ==> (!x. LASTN n(CONS x l) = LASTN n l) \ENDTHEOREM +\THEOREM LASTN list +|- (!l. LASTN 0 l = []) /\ + (!n x l. LASTN(SUC n)(SNOC x l) = SNOC x(LASTN n l)) +\ENDTHEOREM \THEOREM LASTN\_LASTN list |- !l n m. m <= (LENGTH l) ==> n <= m ==> (LASTN n(LASTN m l) = LASTN n l) @@ -1866,15 +1859,6 @@ \THEOREM LASTN\_SEG list |- !n l. n <= (LENGTH l) ==> (LASTN n l = SEG n((LENGTH l) - n)l) \ENDTHEOREM -\THEOREM LAST\_DEF list -|- !l. LAST l = HD(SEG 1(PRE(LENGTH l))l) -\ENDTHEOREM -\THEOREM LAST\_LASTN\_LAST list -|- !n l. n <= (LENGTH l) ==> 0 < n ==> (LAST(LASTN n l) = LAST l) -\ENDTHEOREM -\THEOREM LENGTH list -|- (LENGTH[] = 0) /\ (!h t. LENGTH(CONS h t) = SUC(LENGTH t)) -\ENDTHEOREM \THEOREM LENGTH\_APPEND list |- !l1 l2. LENGTH(APPEND l1 l2) = (LENGTH l1) + (LENGTH l2) \ENDTHEOREM @@ -1891,14 +1875,17 @@ |- !l n. (LENGTH l = SUC n) = (?h l'. (LENGTH l' = n) /\ (l = CONS h l')) \ENDTHEOREM -\THEOREM LENGTH\_EQ list -|- !x y. (x = y) ==> (LENGTH x = LENGTH y) +\THEOREM LENGTH list +|- (LENGTH[] = 0) /\ (!h t. LENGTH(CONS h t) = SUC(LENGTH t)) \ENDTHEOREM \THEOREM LENGTH\_EQ\_CONS list |- !P n. (!l. (LENGTH l = SUC n) ==> P l) = (!l. (LENGTH l = n) ==> (\l. !x. P(CONS x l))l) \ENDTHEOREM +\THEOREM LENGTH\_EQ list +|- !x y. (x = y) ==> (LENGTH x = LENGTH y) +\ENDTHEOREM \THEOREM LENGTH\_EQ\_NIL list |- !P. (!l. (LENGTH l = 0) ==> P l) = P[] \ENDTHEOREM @@ -1920,9 +1907,6 @@ \THEOREM LENGTH\_LASTN list |- !n l. n <= (LENGTH l) ==> (LENGTH(LASTN n l) = n) \ENDTHEOREM -\THEOREM LENGTH\_MAP list -|- !l f. LENGTH(MAP f l) = LENGTH l -\ENDTHEOREM \THEOREM LENGTH\_MAP2 list |- !l1 l2. (LENGTH l1 = LENGTH l2) ==> @@ -1930,6 +1914,9 @@ (LENGTH(MAP2 f l1 l2) = LENGTH l1) /\ (LENGTH(MAP2 f l1 l2) = LENGTH l2)) \ENDTHEOREM +\THEOREM LENGTH\_MAP list +|- !l f. LENGTH(MAP f l) = LENGTH l +\ENDTHEOREM \THEOREM LENGTH\_NIL list |- !l. (LENGTH l = 0) = (l = []) \ENDTHEOREM @@ -1984,9 +1971,6 @@ \THEOREM list\_TY\_DEF list |- ?rep. TYPE_DEFINITION IS_list_REP rep \ENDTHEOREM -\THEOREM MAP list -|- (!f. MAP f[] = []) /\ (!f h t. MAP f(CONS h t) = CONS(f h)(MAP f t)) -\ENDTHEOREM \THEOREM MAP2 list |- (!f. MAP2 f[][] = []) /\ (!f h1 t1 h2 t2. @@ -2000,6 +1984,9 @@ \THEOREM MAP\_APPEND list |- !f l1 l2. MAP f(APPEND l1 l2) = APPEND(MAP f l1)(MAP f l2) \ENDTHEOREM +\THEOREM MAP list +|- (!f. MAP f[] = []) /\ (!f h t. MAP f(CONS h t) = CONS(f h)(MAP f t)) +\ENDTHEOREM \THEOREM MAP\_FILTER list |- !f P l. (!x. P(f x) = P x) ==> (MAP f(FILTER P l) = FILTER P(MAP f l)) @@ -2052,12 +2039,12 @@ \THEOREM NOT\_SOME\_EL\_ALL\_EL list |- !P l. ~SOME_EL P l = ALL_EL($~ o P)l \ENDTHEOREM -\THEOREM NULL list -|- NULL[] /\ (!h t. ~NULL(CONS h t)) -\ENDTHEOREM \THEOREM NULL\_DEF list |- (NULL[] = T) /\ (!h t. NULL(CONS h t) = F) \ENDTHEOREM +\THEOREM NULL list +|- NULL[] /\ (!h t. ~NULL(CONS h t)) +\ENDTHEOREM \THEOREM NULL\_EQ\_NIL list |- !l. NULL l = (l = []) \ENDTHEOREM @@ -2081,13 +2068,13 @@ (!n t l. PART(CONS n t)l = CONS(FST(SPLIT n l))(PART t(SND(SPLIT n l)))) \ENDTHEOREM +\THEOREM PREFIX\_DEF list +|- !P l. PREFIX P l = FST(SPLITP($~ o P)l) +\ENDTHEOREM \THEOREM PREFIX list |- (!P. PREFIX P[] = []) /\ (!P x l. PREFIX P(CONS x l) = (P x => CONS x(PREFIX P l) | [])) \ENDTHEOREM -\THEOREM PREFIX\_DEF list -|- !P l. PREFIX P l = FST(SPLITP($~ o P)l) -\ENDTHEOREM \THEOREM PREFIX\_FOLDR list |- !P l. PREFIX P l = FOLDR(\x l'. (P x => CONS x l' | []))[]l \ENDTHEOREM @@ -2095,12 +2082,12 @@ |- (!x. REPLICATE 0 x = []) /\ (!n x. REPLICATE(SUC n)x = CONS x(REPLICATE n x)) \ENDTHEOREM -\THEOREM REVERSE list -|- (REVERSE[] = []) /\ (!x l. REVERSE(CONS x l) = SNOC x(REVERSE l)) -\ENDTHEOREM \THEOREM REVERSE\_APPEND list |- !l1 l2. REVERSE(APPEND l1 l2) = APPEND(REVERSE l2)(REVERSE l1) \ENDTHEOREM +\THEOREM REVERSE list +|- (REVERSE[] = []) /\ (!x l. REVERSE(CONS x l) = SNOC x(REVERSE l)) +\ENDTHEOREM \THEOREM REVERSE\_EQ\_NIL list |- !l. (REVERSE l = []) = (l = []) \ENDTHEOREM @@ -2128,22 +2115,9 @@ (!f e x l. SCANR f e(CONS x l) = CONS(f x(HD(SCANR f e l)))(SCANR f e l)) \ENDTHEOREM -\THEOREM SEG list -|- (!k l. SEG 0 k l = []) /\ - (!m x l. SEG(SUC m)0(CONS x l) = CONS x(SEG m 0 l)) /\ - (!m k x l. SEG(SUC m)(SUC k)(CONS x l) = SEG(SUC m)k l) -\ENDTHEOREM \THEOREM SEG\_0\_SNOC list |- !m l x. m <= (LENGTH l) ==> (SEG m 0(SNOC x l) = SEG m 0 l) \ENDTHEOREM -\THEOREM SEG\_APPEND list -|- !m l1 n l2. - m < (LENGTH l1) /\ - (LENGTH l1) <= (n + m) /\ - (n + m) <= ((LENGTH l1) + (LENGTH l2)) ==> - (SEG n m(APPEND l1 l2) = - APPEND(SEG((LENGTH l1) - m)m l1)(SEG((n + m) - (LENGTH l1))0 l2)) -\ENDTHEOREM \THEOREM SEG\_APPEND1 list |- !n m l1. (n + m) <= (LENGTH l1) ==> (!l2. SEG n m(APPEND l1 l2) = SEG n m l1) @@ -2153,6 +2127,19 @@ (LENGTH l1) <= m /\ n <= (LENGTH l2) ==> (SEG n m(APPEND l1 l2) = SEG n(m - (LENGTH l1))l2) \ENDTHEOREM +\THEOREM SEG\_APPEND list +|- !m l1 n l2. + m < (LENGTH l1) /\ + (LENGTH l1) <= (n + m) /\ + (n + m) <= ((LENGTH l1) + (LENGTH l2)) ==> + (SEG n m(APPEND l1 l2) = + APPEND(SEG((LENGTH l1) - m)m l1)(SEG((n + m) - (LENGTH l1))0 l2)) +\ENDTHEOREM +\THEOREM SEG list +|- (!k l. SEG 0 k l = []) /\ + (!m x l. SEG(SUC m)0(CONS x l) = CONS x(SEG m 0 l)) /\ + (!m k x l. SEG(SUC m)(SUC k)(CONS x l) = SEG(SUC m)k l) +\ENDTHEOREM \THEOREM SEG\_FIRSTN\_BUTFISTN list |- !n m l. (n + m) <= (LENGTH l) ==> (SEG n m l = FIRSTN n(BUTFIRSTN m l)) @@ -2184,10 +2171,6 @@ \THEOREM SEG\_SUC\_CONS list |- !m n l x. SEG m(SUC n)(CONS x l) = SEG m n l \ENDTHEOREM -\THEOREM SNOC list -|- (!x. SNOC x[] = [x]) /\ - (!x x' l. SNOC x(CONS x' l) = CONS x'(SNOC x l)) -\ENDTHEOREM \THEOREM SNOC\_11 list |- !x l x' l'. (SNOC x l = SNOC x' l') = (x = x') /\ (l = l') \ENDTHEOREM @@ -2200,6 +2183,10 @@ \THEOREM SNOC\_CASES list |- !l. (l = []) \/ (?l' x. l = SNOC x l') \ENDTHEOREM +\THEOREM SNOC list +|- (!x. SNOC x[] = [x]) /\ + (!x x' l. SNOC x(CONS x' l) = CONS x'(SNOC x l)) +\ENDTHEOREM \THEOREM SNOC\_EQ\_LENGTH\_EQ list |- !x1 l1 x2 l2. (SNOC x1 l1 = SNOC x2 l2) ==> (LENGTH l1 = LENGTH l2) \ENDTHEOREM @@ -2212,10 +2199,6 @@ \THEOREM SNOC\_REVERSE\_CONS list |- !x l. SNOC x l = REVERSE(CONS x(REVERSE l)) \ENDTHEOREM -\THEOREM SOME\_EL list -|- (!P. SOME_EL P[] = F) /\ - (!P x l. SOME_EL P(CONS x l) = P x \/ SOME_EL P l) -\ENDTHEOREM \THEOREM SOME\_EL\_APPEND list |- !P l1 l2. SOME_EL P(APPEND l1 l2) = SOME_EL P l1 \/ SOME_EL P l2 \ENDTHEOREM @@ -2230,6 +2213,10 @@ \THEOREM SOME\_EL\_DISJ list |- !P Q l. SOME_EL(\x. P x \/ Q x)l = SOME_EL P l \/ SOME_EL Q l \ENDTHEOREM +\THEOREM SOME\_EL list +|- (!P. SOME_EL P[] = F) /\ + (!P x l. SOME_EL P(CONS x l) = P x \/ SOME_EL P l) +\ENDTHEOREM \THEOREM SOME\_EL\_FIRSTN list |- !m l. m <= (LENGTH l) ==> (!P. SOME_EL P(FIRSTN m l) ==> SOME_EL P l) \ENDTHEOREM @@ -2277,12 +2264,12 @@ \THEOREM SUFFIX\_DEF list |- !P l. SUFFIX P l = FOLDL(\l' x. (P x => SNOC x l' | []))[]l \ENDTHEOREM -\THEOREM SUM list -|- (SUM[] = 0) /\ (!h t. SUM(CONS h t) = h + (SUM t)) -\ENDTHEOREM \THEOREM SUM\_APPEND list |- !l1 l2. SUM(APPEND l1 l2) = (SUM l1) + (SUM l2) \ENDTHEOREM +\THEOREM SUM list +|- (SUM[] = 0) /\ (!h t. SUM(CONS h t) = h + (SUM t)) +\ENDTHEOREM \THEOREM SUM\_FLAT list |- !l. SUM(FLAT l) = SUM(MAP SUM l) \ENDTHEOREM @@ -2336,8 +2323,7 @@ \THEOREM ZIP\_UNZIP list |- !l. ZIP(UNZIP l) = l \ENDTHEOREM -\section{Theorems about trees} -\THEOREM AP ltree +\section{Theorems about trees}\THEOREM AP ltree |- (!l. AP[]l = []) /\ (!h t l. AP(CONS h t)l = CONS(h(HD l))(AP t(TL l))) \ENDTHEOREM @@ -2372,21 +2358,21 @@ \THEOREM ltree\_TY\_DEF ltree |- ?rep. TYPE_DEFINITION Is_ltree rep \ENDTHEOREM -\THEOREM Node ltree -|- !v tl. - Node v tl = - ABS_ltree - (node(MAP(FST o REP_ltree)tl),CONS v(FLAT(MAP(SND o REP_ltree)tl))) -\ENDTHEOREM -\THEOREM node tree -|- !tl. node tl = ABS_tree(node_REP(MAP REP_tree tl)) +\THEOREM node\_11 tree +|- !tl1 tl2. (node tl1 = node tl2) = (tl1 = tl2) \ENDTHEOREM \THEOREM Node\_11 ltree |- !v1 v2 trl1 trl2. (Node v1 trl1 = Node v2 trl2) = (v1 = v2) /\ (trl1 = trl2) \ENDTHEOREM -\THEOREM node\_11 tree -|- !tl1 tl2. (node tl1 = node tl2) = (tl1 = tl2) +\THEOREM node tree +|- !tl. node tl = ABS_tree(node_REP(MAP REP_tree tl)) +\ENDTHEOREM +\THEOREM Node ltree +|- !v tl. + Node v tl = + ABS_ltree + (node(MAP(FST o REP_ltree)tl),CONS v(FLAT(MAP(SND o REP_ltree)tl))) \ENDTHEOREM \THEOREM Node\_onto ltree |- !l. ?v trl. l = Node v trl @@ -2426,8 +2412,7 @@ trf n f = (@fn. !trl. (HT(node trl)) <= n ==> (fn(node trl) = f(MAP fn trl))) \ENDTHEOREM -\section{Theorems used to define types} -\THEOREM ABS\_REP\_THM BASIC-HOL +\section{Theorems used to define types}\THEOREM ABS\_REP\_THM BASIC-HOL |- !P. (?rep. TYPE_DEFINITION P rep) ==> (?rep abs. (!a. abs(rep a) = a) /\ (!r. P r = (rep(abs r) = r))) @@ -2435,17 +2420,11 @@ \THEOREM exists\_TRP tydefs |- !P. (?v. P v[]) ==> (?t. TRP P t) \ENDTHEOREM -\THEOREM TRP tydefs -|- !P v tl. TRP P(Node v tl) = P v tl /\ ALL_EL(TRP P)tl -\ENDTHEOREM \THEOREM TRP\_DEF tydefs |- !P. TRP P = (@trp. !v tl. trp(Node v tl) = P v tl /\ ALL_EL trp tl) \ENDTHEOREM -\THEOREM TYPE\_DEFINITION bool -|- !P rep. - TYPE_DEFINITION P rep = - (!x' x''. (rep x' = rep x'') ==> (x' = x'')) /\ - (!x. P x = (?x'. x = rep x')) +\THEOREM TRP tydefs +|- !P v tl. TRP P(Node v tl) = P v tl /\ ALL_EL(TRP P)tl \ENDTHEOREM \THEOREM TY\_DEF\_THM tydefs |- !REP ABS P. @@ -2456,3 +2435,9 @@ P v(MAP REP tl) ==> (fn(ABS(Node v(MAP REP tl))) = f(MAP fn tl)v tl)) \ENDTHEOREM +\THEOREM TYPE\_DEFINITION bool +|- !P rep. + TYPE_DEFINITION P rep = + (!x' x''. (rep x' = rep x'') ==> (x' = x'')) /\ + (!x. P x = (?x'. x = rep x')) +\ENDTHEOREM --- hol88-2.02.19940316.orig/Manual/Reference/reference.tex +++ hol88-2.02.19940316/Manual/Reference/reference.tex @@ -32,7 +32,7 @@ \include{title} % reference title page \include{preface} % preface to reference manual - \include{../LaTeX/ack} % global acknowledgements + \include{ack} % global acknowledgements \include{contents} % table of contents % --------------------------------------------------------------------- --- hol88-2.02.19940316.orig/Manual/Reference/index.tex +++ hol88-2.02.19940316/Manual/Reference/index.tex @@ -1,1625 +1 @@ -\begin{theindex} - - \item {\ptt *}, 1 - \item {\ptt +}, 2 - \item {\ptt -}, 2 - \item {\ptt /}, 3 - \item {\ptt <}, 4 - \item {\ptt <<}, 4 - \item {\ptt =}, 4 - \item {\ptt >}, 6 - \item {\ptt \#}, 1 - \item {\ptt \char '056}, 2 - \item {\ptt \char '100}, 7 - \item {\ptt \char '136}, 3 - - \indexspace - - \item {\ptt ABS}, 7 - \item {\ptt ABS\_CONV}, 8 - \item {\ptt abs\_goals}, 9 - \item {\ptt ABS\_REP\_THM}, 661 - \item {\ptt ABS\_SIMP}, 614 - \item {\ptt AC\_CONV}, 11 - \item {\ptt ACCEPT\_TAC}, 9 - \item {\ptt achieve\_first}, 10 - \item {\ptt achieves}, 10 - \item {\ptt aconv}, 10 - \item {\ptt activate\_binders}, 11 - \item {\ptt ADD}, 619 - \item {\ptt ADD1}, 619 - \item {\ptt ADD\_0}, 619 - \item {\ptt ADD\_ASSOC}, 619 - \item {\ptt ADD\_ASSUM}, 12 - \item {\ptt ADD\_CLAUSES}, 619 - \item {\ptt ADD\_CONV}, 13 - \item {\ptt ADD\_EQ\_0}, 619 - \item {\ptt ADD\_EQ\_SUB}, 619 - \item {\ptt ADD\_INV\_0}, 619 - \item {\ptt ADD\_INV\_0\_EQ}, 619 - \item {\ptt ADD\_MONO\_LESS\_EQ}, 619 - \item {\ptt ADD\_SUB}, 619 - \item {\ptt ADD\_SUC}, 619 - \item {\ptt ADD\_SYM}, 619 - \item {\ptt ALL\_CONV}, 15 - \item {\ptt ALL\_EL}, 634 - \item {\ptt ALL\_EL\_APPEND}, 634 - \item {\ptt ALL\_EL\_BUTFIRSTN}, 634 - \item {\ptt ALL\_EL\_BUTLASTN}, 634 - \item {\ptt ALL\_EL\_CONJ}, 634 - \item {\ptt ALL\_EL\_CONV}, 15 - \item {\ptt ALL\_EL\_FIRSTN}, 634 - \item {\ptt ALL\_EL\_FOLDL}, 634 - \item {\ptt ALL\_EL\_FOLDL\_MAP}, 634 - \item {\ptt ALL\_EL\_FOLDR}, 634 - \item {\ptt ALL\_EL\_FOLDR\_MAP}, 634 - \item {\ptt ALL\_EL\_LASTN}, 634 - \item {\ptt ALL\_EL\_MAP}, 634 - \item {\ptt ALL\_EL\_REPLICATE}, 634 - \item {\ptt ALL\_EL\_REVERSE}, 634 - \item {\ptt ALL\_EL\_SEG}, 635 - \item {\ptt ALL\_EL\_SNOC}, 635 - \item {\ptt ALL\_TAC}, 16 - \item {\ptt ALL\_THEN}, 17 - \item {\ptt allowed\_constant}, 14 - \item {\ptt ALPHA}, 17 - \item {\ptt ALPHA\_CONV}, 18 - \item {\ptt ancestors}, 19 - \item {\ptt ancestry}, 19 - \item {\ptt AND1\_THM}, 611 - \item {\ptt AND2\_THM}, 611 - \item {\ptt AND\_CLAUSES}, 611 - \item {\ptt AND\_DEF}, 609 - \item {\ptt AND\_EL\_DEF}, 635 - \item {\ptt AND\_EL\_FOLDL}, 635 - \item {\ptt AND\_EL\_FOLDR}, 635 - \item {\ptt AND\_EXISTS\_CONV}, 20 - \item {\ptt AND\_FORALL\_CONV}, 20 - \item {\ptt AND\_IMP\_INTRO}, 611 - \item {\ptt AND\_INTRO\_THM}, 611 - \item {\ptt ANTE\_CONJ\_CONV}, 21 - \item {\ptt ANTE\_RES\_THEN}, 21 - \item {\ptt AP}, 635, 659 - \item {\ptt AP\_TERM}, 25 - \item {\ptt AP\_TERM\_TAC}, 25 - \item {\ptt AP\_THM}, 26 - \item {\ptt AP\_THM\_TAC}, 26 - \item {\ptt APPEND}, 635 - \item {\ptt append}, 22 - \item {\ptt APPEND\_ASSOC}, 635 - \item {\ptt APPEND\_BUTLAST\_LAST}, 635 - \item {\ptt APPEND\_BUTLASTN\_BUTFIRSTN}, 635 - \item {\ptt APPEND\_BUTLASTN\_LASTN}, 635 - \item {\ptt APPEND\_CONV}, 23 - \item {\ptt APPEND\_FIRSTN\_BUTFIRSTN}, 635 - \item {\ptt APPEND\_FIRSTN\_LASTN}, 635 - \item {\ptt APPEND\_FOLDL}, 635 - \item {\ptt APPEND\_FOLDR}, 636 - \item {\ptt APPEND\_LENGTH\_EQ}, 636 - \item {\ptt APPEND\_NIL}, 636 - \item {\ptt append\_openw}, 23 - \item {\ptt APPEND\_SNOC}, 636 - \item {\ptt apply\_proof}, 24 - \item {\ptt ARB}, 610 - \item {\ptt arb\_term}, 27 - \item {\ptt ARB\_THM}, 610 - \item {\ptt arity}, 27 - \item {\ptt ascii}, 28 - \item {\ptt ascii\_code}, 28 - \item {\ptt ASM\_CASES\_TAC}, 29 - \item {\ptt ASM\_REWRITE\_RULE}, 29 - \item {\ptt ASM\_REWRITE\_TAC}, 30 - \item {\ptt assert}, 31 - \item {\ptt assignable\_print\_term}, 32 - \item {\ptt assoc}, 34 - \item {\ptt ASSOC\_ADD}, 619 - \item {\ptt ASSOC\_APPEND}, 636 - \item {\ptt ASSOC\_CONJ}, 614 - \item {\ptt ASSOC\_DEF}, 614 - \item {\ptt ASSOC\_DISJ}, 614 - \item {\ptt ASSOC\_FOLDL\_FLAT}, 636 - \item {\ptt ASSOC\_FOLDR\_FLAT}, 636 - \item {\ptt ASSOC\_MULT}, 620 - \item {\ptt associate\_restriction}, 34 - \item {\ptt ASSUM\_LIST}, 38 - \item {\ptt ASSUME}, 36 - \item {\ptt ASSUME\_TAC}, 37 - \item {\ptt attempt\_first}, 39 - \item {\ptt autoload}, 39 - \item {\ptt autoload\_theory}, 41 - \item {\ptt axiom}, 41 - \item {\ptt axiom\_lfn}, 43 - \item {\ptt axiom\_msg\_lfn}, 44 - \item {\ptt axioms}, 42 - - \indexspace - - \item {\ptt B}, 44 - \item {\ptt b}, 45 - \item {\ptt backup}, 45 - \item {\ptt backup\_limit}, 47 - \item {\ptt backup\_list}, 50 - \item {\ptt basic\_rewrites}, 50 - \item {\ptt BETA\_CONV}, 52 - \item {\ptt BETA\_RULE}, 52 - \item {\ptt BETA\_TAC}, 53 - \item {\ptt bht}, 659 - \item {\ptt binders}, 54 - \item {\ptt bndvar}, 55 - \item {\ptt body}, 55 - \item {\ptt BODY\_CONJUNCTS}, 55 - \item {\ptt BOOL\_CASES\_AX}, 610 - \item {\ptt BOOL\_CASES\_TAC}, 56 - \item {\ptt bool\_EQ\_CONV}, 57 - \item {\ptt BOOL\_EQ\_DISTINCT}, 611 - \item {\ptt bool\_ty}, 58 - \item {\ptt BUTFIRSTN}, 636 - \item {\ptt BUTFIRSTN\_APPEND1}, 636 - \item {\ptt BUTFIRSTN\_APPEND2}, 636 - \item {\ptt BUTFIRSTN\_BUTFIRSTN}, 637 - \item {\ptt BUTFIRSTN\_CONV}, 58 - \item {\ptt BUTFIRSTN\_LASTN}, 637 - \item {\ptt BUTFIRSTN\_LENGTH\_APPEND}, 637 - \item {\ptt BUTFIRSTN\_LENGTH\_NIL}, 637 - \item {\ptt BUTFIRSTN\_REVERSE}, 637 - \item {\ptt BUTFIRSTN\_SEG}, 637 - \item {\ptt BUTFIRSTN\_SNOC}, 637 - \item {\ptt BUTLAST}, 637 - \item {\ptt butlast}, 59 - \item {\ptt BUTLAST\_CONV}, 60 - \item {\ptt BUTLAST\_DEF}, 639 - \item {\ptt BUTLASTN}, 637 - \item {\ptt BUTLASTN\_1}, 637 - \item {\ptt BUTLASTN\_APPEND1}, 637 - \item {\ptt BUTLASTN\_APPEND2}, 637 - \item {\ptt BUTLASTN\_BUTLAST}, 638 - \item {\ptt BUTLASTN\_BUTLASTN}, 638 - \item {\ptt BUTLASTN\_CONS}, 638 - \item {\ptt BUTLASTN\_CONV}, 59 - \item {\ptt BUTLASTN\_FIRSTN}, 638 - \item {\ptt BUTLASTN\_LASTN}, 638 - \item {\ptt BUTLASTN\_LASTN\_NIL}, 638 - \item {\ptt BUTLASTN\_LENGTH\_APPEND}, 638 - \item {\ptt BUTLASTN\_LENGTH\_CONS}, 638 - \item {\ptt BUTLASTN\_LENGTH\_NIL}, 638 - \item {\ptt BUTLASTN\_MAP}, 638 - \item {\ptt BUTLASTN\_REVERSE}, 638 - \item {\ptt BUTLASTN\_SEG}, 638 - \item {\ptt BUTLASTN\_SUC\_BUTLAST}, 638 - - \indexspace - - \item {\ptt C}, 60 - \item {\ptt cached\_theories}, 61 - \item {\ptt can}, 61 - \item {\ptt CANCEL\_SUB}, 620 - \item {\ptt CASES\_THENL}, 62 - \item {\ptt CB}, 63 - \item {\ptt CCONTR}, 63 - \item {\ptt change\_state}, 65 - \item {\ptt CHANGED\_CONV}, 64 - \item {\ptt CHANGED\_TAC}, 65 - \item {\ptt CHECK\_ASSUME\_TAC}, 65 - \item {\ptt check\_lhs}, 66 - \item {\ptt check\_specification}, 66 - \item {\ptt check\_valid}, 67 - \item {\ptt check\_varstruct}, 67 - \item {\ptt chktac}, 67 - \item {\ptt CHOOSE}, 68 - \item {\ptt CHOOSE\_TAC}, 69 - \item {\ptt CHOOSE\_THEN}, 70 - \item {\ptt chop\_list}, 71 - \item {\ptt close}, 72 - \item {\ptt close\_theory}, 72 - \item {\ptt Co}, 73 - \item {\ptt com}, 73 - \item {\ptt combine}, 74 - \item {\ptt COMM\_ASSOC\_FOLDL\_REVERSE}, 639 - \item {\ptt COMM\_ASSOC\_FOLDR\_REVERSE}, 639 - \item {\ptt COMM\_DEF}, 615 - \item {\ptt COMM\_MONOID\_FOLDL}, 639 - \item {\ptt COMM\_MONOID\_FOLDR}, 639 - \item {\ptt COMMA\_DEF}, 617 - \item {\ptt compile}, 74 - \item {\ptt compilef}, 76 - \item {\ptt compilet}, 77 - \item {\ptt compiling}, 77 - \item {\ptt compiling\_stack}, 78 - \item {\ptt concat}, 79 - \item {\ptt concatl}, 79 - \item {\ptt concl}, 80 - \item {\ptt COND\_ABS}, 611 - \item {\ptt COND\_CASES\_TAC}, 80 - \item {\ptt COND\_CLAUSES}, 611 - \item {\ptt COND\_CONV}, 82 - \item {\ptt COND\_DEF}, 610 - \item {\ptt COND\_EXPAND}, 611 - \item {\ptt COND\_ID}, 611 - \item {\ptt COND\_RAND}, 611 - \item {\ptt COND\_RATOR}, 611 - \item {\ptt CONJ}, 82 - \item {\ptt CONJ\_ASSOC}, 611 - \item {\ptt CONJ\_DISCH}, 88 - \item {\ptt CONJ\_DISCHL}, 89 - \item {\ptt CONJ\_LIST}, 90 - \item {\ptt CONJ\_PAIR}, 91 - \item {\ptt CONJ\_SET\_CONV}, 92 - \item {\ptt CONJ\_SYM}, 612 - \item {\ptt CONJ\_TAC}, 92 - \item {\ptt CONJUNCT1}, 83 - \item {\ptt CONJUNCT2}, 83 - \item {\ptt CONJUNCTS}, 84 - \item {\ptt conjuncts}, 84 - \item {\ptt CONJUNCTS\_CONV}, 85 - \item {\ptt CONJUNCTS\_THEN}, 86 - \item {\ptt CONJUNCTS\_THEN2}, 87 - \item {\ptt CONS}, 639 - \item {\ptt CONS\_11}, 639 - \item {\ptt CONS\_APPEND}, 639 - \item {\ptt CONS\_DEF}, 639 - \item {\ptt constants}, 93 - \item {\ptt CONTR}, 94 - \item {\ptt CONTR\_TAC}, 95 - \item {\ptt CONTRAPOS}, 94 - \item {\ptt CONTRAPOS\_CONV}, 95 - \item {\ptt CONV\_RULE}, 96 - \item {\ptt CONV\_TAC}, 96 - \item {\ptt current\_theory}, 97 - \item {\ptt curry}, 98 - \item {\ptt CURRY\_DEF}, 617 - - \indexspace - - \item {\ptt DA}, 620 - \item {\ptt DE\_MORGAN\_THM}, 612 - \item {\ptt DEF\_EXISTS\_RULE}, 108 - \item {\ptt define\_finite\_set\_syntax}, 99 - \item {\ptt define\_load\_lib\_function}, 100 - \item {\ptt define\_new\_type\_bijections}, 101 - \item {\ptt define\_set\_abstraction\_syntax}, 102 - \item {\ptt define\_type}, 103 - \item {\ptt definition}, 105 - \item {\ptt definition\_lfn}, 107 - \item {\ptt definition\_msg\_lfn}, 108 - \item {\ptt definitions}, 106 - \item {\ptt delete\_cache}, 109 - \item {\ptt delete\_thm}, 110 - \item {\ptt DEPTH\_CONV}, 111 - \item {\ptt dest\_abs}, 112 - \item {\ptt dest\_comb}, 113 - \item {\ptt dest\_cond}, 113 - \item {\ptt dest\_conj}, 114 - \item {\ptt dest\_cons}, 114 - \item {\ptt dest\_const}, 115 - \item {\ptt dest\_definition}, 115 - \item {\ptt dest\_disj}, 115 - \item {\ptt dest\_eq}, 116 - \item {\ptt dest\_exists}, 116 - \item {\ptt dest\_forall}, 117 - \item {\ptt dest\_form}, 117 - \item {\ptt dest\_imp}, 118 - \item {\ptt dest\_let}, 118 - \item {\ptt dest\_list}, 119 - \item {\ptt dest\_neg}, 119 - \item {\ptt dest\_neg\_imp}, 120 - \item {\ptt dest\_node}, 659 - \item {\ptt dest\_pabs}, 121 - \item {\ptt dest\_pair}, 121 - \item {\ptt dest\_pred}, 122 - \item {\ptt dest\_select}, 122 - \item {\ptt dest\_thm}, 123 - \item {\ptt dest\_type}, 123 - \item {\ptt dest\_var}, 124 - \item {\ptt dest\_vartype}, 124 - \item {\ptt DISCARD\_TAC}, 125 - \item {\ptt DISCH}, 126 - \item {\ptt disch}, 126 - \item {\ptt DISCH\_ALL}, 127 - \item {\ptt DISCH\_TAC}, 127 - \item {\ptt DISCH\_THEN}, 128 - \item {\ptt DISJ1}, 129 - \item {\ptt DISJ1\_TAC}, 130 - \item {\ptt DISJ2}, 131 - \item {\ptt DISJ2\_TAC}, 131 - \item {\ptt DISJ\_ASSOC}, 612 - \item {\ptt DISJ\_CASES}, 133 - \item {\ptt DISJ\_CASES\_TAC}, 134 - \item {\ptt DISJ\_CASES\_THEN}, 135 - \item {\ptt DISJ\_CASES\_THEN2}, 136 - \item {\ptt DISJ\_CASES\_THENL}, 138 - \item {\ptt DISJ\_CASES\_UNION}, 139 - \item {\ptt DISJ\_IMP}, 139 - \item {\ptt DISJ\_SYM}, 612 - \item {\ptt disjuncts}, 132 - \item {\ptt distinct}, 140 - \item {\ptt DIV\_LESS\_EQ}, 620 - \item {\ptt DIV\_MULT}, 620 - \item {\ptt DIV\_UNIQUE}, 620 - \item {\ptt DIVISION}, 620 - \item {\ptt do}, 141 - \item {\ptt draft\_mode}, 142 - \item {\ptt dropout}, 142 - - \indexspace - - \item {\ptt e}, 143 - \item {\ptt EL}, 639 - \item {\ptt el}, 144 - \item {\ptt EL\_APPEND1}, 641 - \item {\ptt EL\_APPEND2}, 641 - \item {\ptt EL\_CONS}, 641 - \item {\ptt EL\_CONV}, 145 - \item {\ptt EL\_ELL}, 641 - \item {\ptt EL\_IS\_EL}, 641 - \item {\ptt EL\_LENGTH\_APPEND}, 641 - \item {\ptt EL\_LENGTH\_SNOC}, 641 - \item {\ptt EL\_MAP}, 641 - \item {\ptt EL\_PRE\_LENGTH}, 641 - \item {\ptt EL\_REVERSE}, 641 - \item {\ptt EL\_REVERSE\_ELL}, 641 - \item {\ptt EL\_SEG}, 641 - \item {\ptt EL\_SNOC}, 641 - \item {\ptt ELL}, 639 - \item {\ptt ELL\_0\_SNOC}, 639 - \item {\ptt ELL\_APPEND1}, 639 - \item {\ptt ELL\_APPEND2}, 640 - \item {\ptt ELL\_CONS}, 640 - \item {\ptt ELL\_CONV}, 145 - \item {\ptt ELL\_EL}, 640 - \item {\ptt ELL\_IS\_EL}, 640 - \item {\ptt ELL\_LAST}, 640 - \item {\ptt ELL\_LENGTH\_APPEND}, 640 - \item {\ptt ELL\_LENGTH\_CONS}, 640 - \item {\ptt ELL\_LENGTH\_SNOC}, 640 - \item {\ptt ELL\_MAP}, 640 - \item {\ptt ELL\_PRE\_LENGTH}, 640 - \item {\ptt ELL\_REVERSE}, 640 - \item {\ptt ELL\_REVERSE\_EL}, 640 - \item {\ptt ELL\_SEG}, 640 - \item {\ptt ELL\_SNOC}, 640 - \item {\ptt ELL\_SUC\_SNOC}, 640 - \item {\ptt end\_itlist}, 146 - \item {\ptt enter\_form\_rep}, 147 - \item {\ptt enter\_term}, 147 - \item {\ptt enter\_term\_rep}, 147 - \item {\ptt EQ\_CLAUSES}, 612 - \item {\ptt EQ\_EXPAND}, 612 - \item {\ptt EQ\_EXT}, 615 - \item {\ptt EQ\_IMP\_RULE}, 149 - \item {\ptt EQ\_IMP\_THM}, 612 - \item {\ptt EQ\_LENGTH\_INDUCT\_TAC}, 150 - \item {\ptt EQ\_LENGTH\_SNOC\_INDUCT\_TAC}, 151 - \item {\ptt EQ\_LESS}, 620 - \item {\ptt EQ\_LESS\_EQ}, 620 - \item {\ptt EQ\_LIST}, 641 - \item {\ptt EQ\_MONO\_ADD\_EQ}, 620 - \item {\ptt EQ\_MP}, 152 - \item {\ptt EQ\_REFL}, 612 - \item {\ptt EQ\_SYM}, 612 - \item {\ptt EQ\_SYM\_EQ}, 612 - \item {\ptt EQ\_TAC}, 152 - \item {\ptt EQ\_TRANS}, 612 - \item {\ptt EQF\_ELIM}, 147 - \item {\ptt EQF\_INTRO}, 148 - \item {\ptt EQT\_ELIM}, 148 - \item {\ptt EQT\_INTRO}, 149 - \item {\ptt ETA\_AX}, 610 - \item {\ptt ETA\_CONV}, 153 - \item {\ptt EVEN}, 620 - \item {\ptt EVEN\_ADD}, 620 - \item {\ptt EVEN\_AND\_ODD}, 620 - \item {\ptt EVEN\_DOUBLE}, 620 - \item {\ptt EVEN\_EXISTS}, 620 - \item {\ptt EVEN\_MULT}, 621 - \item {\ptt EVEN\_ODD}, 621 - \item {\ptt EVEN\_ODD\_EXISTS}, 621 - \item {\ptt EVEN\_OR\_ODD}, 621 - \item {\ptt EVERY}, 153 - \item {\ptt EVERY\_ASSUM}, 154 - \item {\ptt EVERY\_CONV}, 155 - \item {\ptt EVERY\_TCL}, 155 - \item {\ptt EXCLUDED\_MIDDLE}, 612 - \item {\ptt EXISTENCE}, 156 - \item {\ptt EXISTS}, 157 - \item {\ptt exists}, 157 - \item {\ptt EXISTS\_AND\_CONV}, 158 - \item {\ptt EXISTS\_DEF}, 609 - \item {\ptt EXISTS\_EQ}, 159 - \item {\ptt EXISTS\_GREATEST\_CONV}, 159 - \item {\ptt EXISTS\_IMP}, 160 - \item {\ptt EXISTS\_IMP\_CONV}, 160 - \item {\ptt EXISTS\_LEAST\_CONV}, 161 - \item {\ptt EXISTS\_NOT\_CONV}, 162 - \item {\ptt EXISTS\_OR\_CONV}, 162 - \item {\ptt EXISTS\_SIMP}, 612 - \item {\ptt EXISTS\_TAC}, 163 - \item {\ptt exists\_TRP}, 661 - \item {\ptt EXISTS\_UNIQUE\_CONV}, 164 - \item {\ptt EXISTS\_UNIQUE\_DEF}, 609 - \item {\ptt EXP}, 621 - \item {\ptt EXP\_ADD}, 621 - \item {\ptt expand}, 164 - \item {\ptt expandf}, 167 - \item {\ptt explode}, 169 - \item {\ptt EXT}, 169 - \item {\ptt extend\_theory}, 170 - - \indexspace - - \item {\ptt F\_DEF}, 609 - \item {\ptt F\_IMP}, 613 - \item {\ptt FACT}, 621 - \item {\ptt FACT\_LESS}, 621 - \item {\ptt FAIL\_TAC}, 171 - \item {\ptt FALSITY}, 612 - \item {\ptt falsity}, 172 - \item {\ptt fast\_arith}, 172 - \item {\ptt FCOMM\_ASSOC}, 615 - \item {\ptt FCOMM\_DEF}, 615 - \item {\ptt FCOMM\_FOLDL\_APPEND}, 642 - \item {\ptt FCOMM\_FOLDL\_FLAT}, 642 - \item {\ptt FCOMM\_FOLDR\_APPEND}, 642 - \item {\ptt FCOMM\_FOLDR\_FLAT}, 642 - \item {\ptt FILTER}, 642 - \item {\ptt filter}, 173 - \item {\ptt FILTER\_APPEND}, 642 - \item {\ptt FILTER\_ASM\_REWRITE\_RULE}, 174 - \item {\ptt FILTER\_ASM\_REWRITE\_TAC}, 174 - \item {\ptt FILTER\_COMM}, 642 - \item {\ptt FILTER\_CONV}, 175 - \item {\ptt FILTER\_DISCH\_TAC}, 176 - \item {\ptt FILTER\_DISCH\_THEN}, 177 - \item {\ptt FILTER\_FILTER}, 642 - \item {\ptt FILTER\_FLAT}, 642 - \item {\ptt FILTER\_FOLDL}, 642 - \item {\ptt FILTER\_FOLDR}, 643 - \item {\ptt FILTER\_GEN\_TAC}, 178 - \item {\ptt FILTER\_IDEM}, 643 - \item {\ptt FILTER\_MAP}, 643 - \item {\ptt FILTER\_ONCE\_ASM\_REWRITE\_RULE}, 179 - \item {\ptt FILTER\_ONCE\_ASM\_REWRITE\_TAC}, 180 - \item {\ptt FILTER\_PURE\_ASM\_REWRITE\_RULE}, 180 - \item {\ptt FILTER\_PURE\_ASM\_REWRITE\_TAC}, 181 - \item {\ptt FILTER\_PURE\_ONCE\_ASM\_REWRITE\_RULE}, 182 - \item {\ptt FILTER\_PURE\_ONCE\_ASM\_REWRITE\_TAC}, 183 - \item {\ptt FILTER\_REVERSE}, 643 - \item {\ptt FILTER\_SNOC}, 643 - \item {\ptt FILTER\_STRIP\_TAC}, 183 - \item {\ptt FILTER\_STRIP\_THEN}, 185 - \item {\ptt find}, 186 - \item {\ptt find\_file}, 187 - \item {\ptt find\_match}, 187 - \item {\ptt find\_ml\_file}, 188 - \item {\ptt find\_term}, 189 - \item {\ptt find\_terms}, 190 - \item {\ptt find\_theory}, 190 - \item {\ptt FIRST}, 191 - \item {\ptt FIRST\_ASSUM}, 192 - \item {\ptt FIRST\_CONV}, 193 - \item {\ptt FIRST\_TCL}, 193 - \item {\ptt FIRSTN}, 643 - \item {\ptt FIRSTN\_APPEND1}, 643 - \item {\ptt FIRSTN\_APPEND2}, 643 - \item {\ptt FIRSTN\_BUTLASTN}, 643 - \item {\ptt FIRSTN\_CONV}, 191 - \item {\ptt FIRSTN\_FIRSTN}, 643 - \item {\ptt FIRSTN\_LENGTH\_APPEND}, 643 - \item {\ptt FIRSTN\_LENGTH\_ID}, 643 - \item {\ptt FIRSTN\_REVERSE}, 643 - \item {\ptt FIRSTN\_SEG}, 643 - \item {\ptt FIRSTN\_SNOC}, 644 - \item {\ptt flags}, 194 - \item {\ptt FLAT}, 644 - \item {\ptt flat}, 194 - \item {\ptt FLAT\_APPEND}, 644 - \item {\ptt FLAT\_CONV}, 195 - \item {\ptt FLAT\_FLAT}, 644 - \item {\ptt FLAT\_FOLDL}, 644 - \item {\ptt FLAT\_FOLDR}, 644 - \item {\ptt FLAT\_REVERSE}, 644 - \item {\ptt FLAT\_SNOC}, 644 - \item {\ptt FOLDL}, 644 - \item {\ptt FOLDL\_APPEND}, 644 - \item {\ptt FOLDL\_CONV}, 196 - \item {\ptt FOLDL\_FILTER}, 644 - \item {\ptt FOLDL\_FOLDR\_REVERSE}, 644 - \item {\ptt FOLDL\_MAP}, 644 - \item {\ptt FOLDL\_REVERSE}, 644 - \item {\ptt FOLDL\_SINGLE}, 644 - \item {\ptt FOLDL\_SNOC}, 645 - \item {\ptt FOLDL\_SNOC\_NIL}, 645 - \item {\ptt FOLDR}, 645 - \item {\ptt FOLDR\_APPEND}, 645 - \item {\ptt FOLDR\_CONS\_NIL}, 645 - \item {\ptt FOLDR\_CONV}, 197 - \item {\ptt FOLDR\_FILTER}, 645 - \item {\ptt FOLDR\_FILTER\_REVERSE}, 645 - \item {\ptt FOLDR\_FOLDL}, 645 - \item {\ptt FOLDR\_FOLDL\_REVERSE}, 645 - \item {\ptt FOLDR\_MAP}, 645 - \item {\ptt FOLDR\_MAP\_REVERSE}, 645 - \item {\ptt FOLDR\_REVERSE}, 645 - \item {\ptt FOLDR\_SINGLE}, 645 - \item {\ptt FOLDR\_SNOC}, 645 - \item {\ptt forall}, 198 - \item {\ptt FORALL\_AND\_CONV}, 199 - \item {\ptt FORALL\_DEF}, 609 - \item {\ptt FORALL\_EQ}, 199 - \item {\ptt FORALL\_IMP\_CONV}, 200 - \item {\ptt FORALL\_NOT\_CONV}, 201 - \item {\ptt FORALL\_OR\_CONV}, 201 - \item {\ptt FORALL\_SIMP}, 612 - \item {\ptt free\_in}, 205 - \item {\ptt frees}, 202 - \item {\ptt freesl}, 203 - \item {\ptt FREEZE\_THEN}, 203 - \item {\ptt FRONT\_CONJ\_CONV}, 205 - \item {\ptt FST}, 617 - \item {\ptt fst}, 206 - \item {\ptt FST\_DEF}, 617 - \item {\ptt FUN\_EQ\_CONV}, 207 - \item {\ptt FUN\_EQ\_LEMMA}, 615, 621 - \item {\ptt funpow}, 206 - - \indexspace - - \item {\ptt g}, 208 - \item {\ptt GEN}, 209 - \item {\ptt GEN\_ALL}, 211 - \item {\ptt GEN\_ALPHA\_CONV}, 212 - \item {\ptt GEN\_BETA\_CONV}, 213 - \item {\ptt GEN\_REWRITE\_CONV}, 214 - \item {\ptt GEN\_REWRITE\_RULE}, 215 - \item {\ptt GEN\_REWRITE\_TAC}, 217 - \item {\ptt GEN\_TAC}, 219 - \item {\ptt GENL}, 210 - \item {\ptt GENLIST}, 646 - \item {\ptt genvar}, 210 - \item {\ptt get\_const\_type}, 220 - \item {\ptt get\_flag\_value}, 221 - \item {\ptt get\_state}, 221 - \item {\ptt get\_steps}, 222 - \item {\ptt get\_type}, 224 - \item {\ptt getenv}, 219 - \item {\ptt goals}, 224 - \item {\ptt GREATER}, 621 - \item {\ptt GREATER\_EQ}, 621 - \item {\ptt GREATER\_OR\_EQ}, 621 - \item {\ptt GSPEC}, 224 - \item {\ptt GSUBST\_TAC}, 225 - \item {\ptt GSYM}, 226 - - \indexspace - - \item {\ptt HALF\_MK\_ABS}, 227 - \item {\ptt HD}, 646 - \item {\ptt hd}, 227 - \item {\ptt help}, 228 - \item {\ptt help\_search\_path}, 228 - \item {\ptt hide\_constant}, 229 - \item {\ptt hol\_pathname}, 229 - \item {\ptt host\_name}, 230 - \item {\ptt HT}, 659 - \item {\ptt hyp}, 231 - \item {\ptt hyp\_union}, 231 - - \indexspace - - \item {\ptt I}, 232 - \item {\ptt I\_DEF}, 616 - \item {\ptt I\_o\_ID}, 616 - \item {\ptt I\_THM}, 616 - \item {\ptt IMP\_ANTISYM\_AX}, 610 - \item {\ptt IMP\_ANTISYM\_RULE}, 233 - \item {\ptt IMP\_CANON}, 234 - \item {\ptt IMP\_CLAUSES}, 613 - \item {\ptt IMP\_CONJ}, 234 - \item {\ptt IMP\_DISJ\_THM}, 613 - \item {\ptt IMP\_ELIM}, 235 - \item {\ptt IMP\_F}, 613 - \item {\ptt IMP\_F\_EQ\_F}, 613 - \item {\ptt IMP\_RES\_TAC}, 236 - \item {\ptt IMP\_RES\_THEN}, 237 - \item {\ptt IMP\_TRANS}, 238 - \item {\ptt implode}, 232 - \item {\ptt INDUCT}, 239 - \item {\ptt INDUCT\_TAC}, 240 - \item {\ptt INDUCT\_THEN}, 240 - \item {\ptt INDUCTION}, 621 - \item {\ptt INFINITY\_AX}, 610 - \item {\ptt infix\_variable}, 243 - \item {\ptt infixes}, 242 - \item {\ptt inject\_input}, 244 - \item {\ptt INL}, 618 - \item {\ptt inl}, 245 - \item {\ptt INL\_DEF}, 618 - \item {\ptt INR}, 618 - \item {\ptt inr}, 245 - \item {\ptt INR\_DEF}, 618 - \item {\ptt INST}, 246 - \item {\ptt inst}, 247 - \item {\ptt inst\_check}, 248 - \item {\ptt inst\_rename\_list}, 249 - \item {\ptt INST\_TY\_TERM}, 252 - \item {\ptt INST\_TYPE}, 250 - \item {\ptt inst\_type}, 251 - \item {\ptt install}, 248 - \item {\ptt int\_of\_string}, 254 - \item {\ptt int\_of\_term}, 254 - \item {\ptt interface\_map}, 252 - \item {\ptt intersect}, 253 - \item {\ptt INV\_PRE\_EQ}, 621 - \item {\ptt INV\_PRE\_LESS}, 621 - \item {\ptt INV\_PRE\_LESS\_EQ}, 621 - \item {\ptt INV\_SUC}, 622 - \item {\ptt INV\_SUC\_EQ}, 622 - \item {\ptt is\_abs}, 256 - \item {\ptt is\_alphanum}, 257 - \item {\ptt IS\_ASSUMPTION\_OF}, 613 - \item {\ptt is\_axiom}, 257 - \item {\ptt is\_binder}, 258 - \item {\ptt is\_binder\_type}, 259 - \item {\ptt is\_comb}, 259 - \item {\ptt is\_cond}, 260 - \item {\ptt is\_conj}, 260 - \item {\ptt is\_cons}, 261 - \item {\ptt is\_const}, 261 - \item {\ptt is\_constant}, 262 - \item {\ptt is\_definition}, 262 - \item {\ptt is\_disj}, 263 - \item {\ptt IS\_EL}, 646 - \item {\ptt IS\_EL\_APPEND}, 646 - \item {\ptt IS\_EL\_BUTFIRSTN}, 646 - \item {\ptt IS\_EL\_BUTLASTN}, 646 - \item {\ptt IS\_EL\_CONV}, 263 - \item {\ptt IS\_EL\_DEF}, 646 - \item {\ptt IS\_EL\_FILTER}, 646 - \item {\ptt IS\_EL\_FIRSTN}, 646 - \item {\ptt IS\_EL\_FOLDL}, 646 - \item {\ptt IS\_EL\_FOLDL\_MAP}, 646 - \item {\ptt IS\_EL\_FOLDR}, 646 - \item {\ptt IS\_EL\_FOLDR\_MAP}, 646 - \item {\ptt IS\_EL\_LASTN}, 646 - \item {\ptt IS\_EL\_REPLICATE}, 646 - \item {\ptt IS\_EL\_REVERSE}, 647 - \item {\ptt IS\_EL\_SEG}, 647 - \item {\ptt IS\_EL\_SNOC}, 647 - \item {\ptt IS\_EL\_SOME\_EL}, 647 - \item {\ptt is\_eq}, 264 - \item {\ptt is\_exists}, 264 - \item {\ptt is\_forall}, 265 - \item {\ptt is\_hidden}, 265 - \item {\ptt is\_imp}, 266 - \item {\ptt is\_infix}, 267 - \item {\ptt is\_infix\_type}, 267 - \item {\ptt is\_let}, 268 - \item {\ptt is\_letter}, 269 - \item {\ptt is\_list}, 269 - \item {\ptt IS\_list\_REP}, 647 - \item {\ptt Is\_ltree}, 659 - \item {\ptt is\_ml\_curried\_infix}, 270 - \item {\ptt is\_ml\_infix}, 270 - \item {\ptt is\_ml\_paired\_infix}, 271 - \item {\ptt is\_neg}, 271 - \item {\ptt is\_neg\_imp}, 272 - \item {\ptt IS\_NUM\_REP}, 622 - \item {\ptt is\_pabs}, 272 - \item {\ptt is\_pair}, 273 - \item {\ptt IS\_PAIR\_DEF}, 617 - \item {\ptt is\_pred}, 273 - \item {\ptt IS\_PREFIX}, 647 - \item {\ptt IS\_PREFIX\_APPEND}, 647 - \item {\ptt IS\_PREFIX\_IS\_SUBLIST}, 647 - \item {\ptt IS\_PREFIX\_PREFIX}, 647 - \item {\ptt IS\_PREFIX\_REVERSE}, 647 - \item {\ptt is\_recording\_proof}, 274 - \item {\ptt is\_select}, 274 - \item {\ptt IS\_SUBLIST}, 647 - \item {\ptt IS\_SUBLIST\_APPEND}, 647 - \item {\ptt IS\_SUBLIST\_REVERSE}, 647 - \item {\ptt IS\_SUFFIX}, 648 - \item {\ptt IS\_SUFFIX\_APPEND}, 648 - \item {\ptt IS\_SUFFIX\_IS\_SUBLIST}, 648 - \item {\ptt IS\_SUFFIX\_REVERSE}, 648 - \item {\ptt IS\_SUM\_REP}, 618 - \item {\ptt Is\_tree\_REP}, 659 - \item {\ptt is\_type}, 275 - \item {\ptt is\_var}, 275 - \item {\ptt is\_vartype}, 276 - \item {\ptt ISL}, 618 - \item {\ptt isl}, 255 - \item {\ptt ISL\_OR\_ISR}, 618 - \item {\ptt ISPEC}, 255 - \item {\ptt ISPECL}, 256 - \item {\ptt ISR}, 618 - \item {\ptt it}, 276 - \item {\ptt itlist}, 277 - \item {\ptt itlist2}, 278 - - \indexspace - - \item {\ptt K}, 278 - \item {\ptt K\_DEF}, 616 - \item {\ptt K\_THM}, 616 - \item {\ptt KI}, 279 - - \indexspace - - \item {\ptt LAST}, 648 - \item {\ptt last}, 279 - \item {\ptt LAST\_CONV}, 280 - \item {\ptt LAST\_DEF}, 649 - \item {\ptt LAST\_LASTN\_LAST}, 649 - \item {\ptt LASTN}, 648 - \item {\ptt LASTN\_1}, 648 - \item {\ptt LASTN\_APPEND1}, 648 - \item {\ptt LASTN\_APPEND2}, 648 - \item {\ptt LASTN\_BUTFIRSTN}, 648 - \item {\ptt LASTN\_BUTLASTN}, 648 - \item {\ptt LASTN\_CONS}, 648 - \item {\ptt LASTN\_CONV}, 280 - \item {\ptt LASTN\_LASTN}, 648 - \item {\ptt LASTN\_LENGTH\_APPEND}, 649 - \item {\ptt LASTN\_LENGTH\_ID}, 649 - \item {\ptt LASTN\_MAP}, 649 - \item {\ptt LASTN\_REVERSE}, 649 - \item {\ptt LASTN\_SEG}, 649 - \item {\ptt LEFT\_ADD\_DISTRIB}, 622 - \item {\ptt LEFT\_AND\_EXISTS\_CONV}, 281 - \item {\ptt LEFT\_AND\_FORALL\_CONV}, 281 - \item {\ptt LEFT\_AND\_OVER\_OR}, 613 - \item {\ptt LEFT\_ID\_ADD\_0}, 622 - \item {\ptt LEFT\_ID\_DEF}, 615 - \item {\ptt LEFT\_ID\_MULT\_1}, 622 - \item {\ptt LEFT\_IMP\_EXISTS\_CONV}, 282 - \item {\ptt LEFT\_IMP\_FORALL\_CONV}, 282 - \item {\ptt LEFT\_OR\_EXISTS\_CONV}, 283 - \item {\ptt LEFT\_OR\_FORALL\_CONV}, 283 - \item {\ptt LEFT\_OR\_OVER\_AND}, 613 - \item {\ptt LEFT\_SUB\_DISTRIB}, 622 - \item {\ptt LENGTH}, 649 - \item {\ptt length}, 284 - \item {\ptt LENGTH\_APPEND}, 649 - \item {\ptt LENGTH\_BUTFIRSTN}, 649 - \item {\ptt LENGTH\_BUTLAST}, 649 - \item {\ptt LENGTH\_BUTLASTN}, 649 - \item {\ptt LENGTH\_CONS}, 649 - \item {\ptt LENGTH\_CONV}, 284 - \item {\ptt LENGTH\_EQ}, 649 - \item {\ptt LENGTH\_EQ\_CONS}, 649 - \item {\ptt LENGTH\_EQ\_NIL}, 650 - \item {\ptt LENGTH\_FIRSTN}, 650 - \item {\ptt LENGTH\_FLAT}, 650 - \item {\ptt LENGTH\_FOLDL}, 650 - \item {\ptt LENGTH\_FOLDR}, 650 - \item {\ptt LENGTH\_GENLIST}, 650 - \item {\ptt LENGTH\_LASTN}, 650 - \item {\ptt LENGTH\_MAP}, 650 - \item {\ptt LENGTH\_MAP2}, 650 - \item {\ptt LENGTH\_NIL}, 650 - \item {\ptt LENGTH\_NOT\_NULL}, 650 - \item {\ptt LENGTH\_REPLICATE}, 650 - \item {\ptt LENGTH\_REVERSE}, 650 - \item {\ptt LENGTH\_SCANL}, 650 - \item {\ptt LENGTH\_SCANR}, 651 - \item {\ptt LENGTH\_SEG}, 651 - \item {\ptt LENGTH\_SNOC}, 651 - \item {\ptt LENGTH\_UNZIP\_FST}, 651 - \item {\ptt LENGTH\_UNZIP\_SND}, 651 - \item {\ptt LENGTH\_ZIP}, 651 - \item {\ptt LESS}, 622 - \item {\ptt LESS\_0}, 622 - \item {\ptt LESS\_0\_0}, 622 - \item {\ptt LESS\_0\_CASES}, 622 - \item {\ptt LESS\_ADD}, 622 - \item {\ptt LESS\_ADD\_1}, 622 - \item {\ptt LESS\_ADD\_NONZERO}, 622 - \item {\ptt LESS\_ADD\_SUC}, 622 - \item {\ptt LESS\_ANTISYM}, 623 - \item {\ptt LESS\_CASES}, 623 - \item {\ptt LESS\_CASES\_IMP}, 623 - \item {\ptt LESS\_EQ}, 623 - \item {\ptt LESS\_EQ\_0}, 623 - \item {\ptt LESS\_EQ\_ADD}, 623 - \item {\ptt LESS\_EQ\_ADD\_SUB}, 623 - \item {\ptt LESS\_EQ\_ANTISYM}, 623 - \item {\ptt LESS\_EQ\_CASES}, 623 - \item {\ptt LESS\_EQ\_EXISTS}, 623 - \item {\ptt LESS\_EQ\_IMP\_LESS\_SUC}, 623 - \item {\ptt LESS\_EQ\_LESS\_EQ\_MONO}, 623 - \item {\ptt LESS\_EQ\_LESS\_TRANS}, 623 - \item {\ptt LESS\_EQ\_MONO}, 623 - \item {\ptt LESS\_EQ\_MONO\_ADD\_EQ}, 624 - \item {\ptt LESS\_EQ\_REFL}, 624 - \item {\ptt LESS\_EQ\_SUB\_LESS}, 624 - \item {\ptt LESS\_EQ\_SUC\_REFL}, 624 - \item {\ptt LESS\_EQ\_TRANS}, 624 - \item {\ptt LESS\_EQUAL\_ADD}, 623 - \item {\ptt LESS\_EQUAL\_ANTISYM}, 623 - \item {\ptt LESS\_EXP\_SUC\_MONO}, 624 - \item {\ptt LESS\_IMP\_LESS\_ADD}, 624 - \item {\ptt LESS\_IMP\_LESS\_OR\_EQ}, 624 - \item {\ptt LESS\_LEMMA1}, 624 - \item {\ptt LESS\_LEMMA2}, 624 - \item {\ptt LESS\_LESS\_CASES}, 624 - \item {\ptt LESS\_LESS\_EQ\_TRANS}, 624 - \item {\ptt LESS\_LESS\_SUC}, 624 - \item {\ptt LESS\_MOD}, 624 - \item {\ptt LESS\_MONO}, 624 - \item {\ptt LESS\_MONO\_ADD}, 624 - \item {\ptt LESS\_MONO\_ADD\_EQ}, 625 - \item {\ptt LESS\_MONO\_ADD\_INV}, 625 - \item {\ptt LESS\_MONO\_EQ}, 625 - \item {\ptt LESS\_MONO\_MULT}, 625 - \item {\ptt LESS\_MONO\_REV}, 625 - \item {\ptt LESS\_MULT2}, 625 - \item {\ptt LESS\_MULT\_MONO}, 625 - \item {\ptt LESS\_NOT\_EQ}, 625 - \item {\ptt LESS\_NOT\_SUC}, 625 - \item {\ptt LESS\_OR}, 625 - \item {\ptt LESS\_OR\_EQ}, 625 - \item {\ptt LESS\_OR\_EQ\_ADD}, 625 - \item {\ptt LESS\_REFL}, 625 - \item {\ptt LESS\_SUB\_ADD\_LESS}, 625 - \item {\ptt LESS\_SUC}, 625 - \item {\ptt LESS\_SUC\_EQ\_COR}, 625 - \item {\ptt LESS\_SUC\_IMP}, 626 - \item {\ptt LESS\_SUC\_NOT}, 626 - \item {\ptt LESS\_SUC\_REFL}, 626 - \item {\ptt LESS\_SUC\_SUC}, 626 - \item {\ptt LESS\_THM}, 626 - \item {\ptt LESS\_TRANS}, 626 - \item {\ptt let\_after}, 285 - \item {\ptt let\_before}, 286 - \item {\ptt let\_CONV}, 287 - \item {\ptt LET\_DEF}, 610 - \item {\ptt lhs}, 289 - \item {\ptt libraries}, 290 - \item {\ptt library\_loader}, 290 - \item {\ptt library\_pathname}, 292 - \item {\ptt library\_search\_path}, 293 - \item {\ptt link}, 294 - \item {\ptt lisp}, 294 - \item {\ptt lisp\_dir\_pathname}, 295 - \item {\ptt list\_Axiom}, 651 - \item {\ptt LIST\_BETA\_CONV}, 296 - \item {\ptt list\_CASES}, 651 - \item {\ptt LIST\_CONJ}, 297 - \item {\ptt list\_EQ\_CONV}, 297 - \item {\ptt list\_FOLD\_CONV}, 298 - \item {\ptt LIST\_INDUCT}, 299 - \item {\ptt list\_INDUCT}, 651 - \item {\ptt LIST\_INDUCT\_TAC}, 300 - \item {\ptt list\_ISO\_DEF}, 651 - \item {\ptt list\_mk\_abs}, 301 - \item {\ptt list\_mk\_comb}, 301 - \item {\ptt list\_mk\_conj}, 302 - \item {\ptt list\_mk\_disj}, 303 - \item {\ptt LIST\_MK\_EXISTS}, 304 - \item {\ptt list\_mk\_exists}, 304 - \item {\ptt list\_mk\_forall}, 305 - \item {\ptt list\_mk\_imp}, 305 - \item {\ptt list\_mk\_pair}, 306 - \item {\ptt LIST\_MP}, 307 - \item {\ptt LIST\_NOT\_EQ}, 651 - \item {\ptt list\_of\_binders}, 307 - \item {\ptt list\_TY\_DEF}, 651 - \item {\ptt load}, 308 - \item {\ptt load\_axiom}, 310 - \item {\ptt load\_axioms}, 311 - \item {\ptt load\_definition}, 312 - \item {\ptt load\_definitions}, 313 - \item {\ptt load\_library}, 314 - \item {\ptt load\_theorem}, 315 - \item {\ptt load\_theorems}, 316 - \item {\ptt load\_theory}, 317 - \item {\ptt loadf}, 308 - \item {\ptt loadt}, 309 - \item {\ptt lookup\_form\_rep}, 318 - \item {\ptt lookup\_term}, 318 - \item {\ptt lookup\_term\_rep}, 318 - \item {\ptt lsp}, 319 - \item {\ptt ltree\_Axiom}, 659 - \item {\ptt ltree\_Induct}, 659 - \item {\ptt ltree\_ISO\_DEF}, 659 - \item {\ptt ltree\_TY\_DEF}, 660 - - \indexspace - - \item {\ptt MAP}, 651 - \item {\ptt map}, 320 - \item {\ptt MAP2}, 651 - \item {\ptt map2}, 320 - \item {\ptt MAP2\_CONV}, 321 - \item {\ptt MAP2\_ZIP}, 652 - \item {\ptt MAP\_APPEND}, 652 - \item {\ptt MAP\_CONV}, 323 - \item {\ptt MAP\_EVERY}, 324 - \item {\ptt MAP\_FILTER}, 652 - \item {\ptt MAP\_FIRST}, 325 - \item {\ptt MAP\_FLAT}, 652 - \item {\ptt MAP\_FOLDL}, 652 - \item {\ptt MAP\_FOLDR}, 652 - \item {\ptt MAP\_MAP\_o}, 652 - \item {\ptt MAP\_o}, 652 - \item {\ptt MAP\_REVERSE}, 652 - \item {\ptt MAP\_SNOC}, 652 - \item {\ptt mapfilter}, 322 - \item {\ptt maptok}, 322 - \item {\ptt match}, 326 - \item {\ptt MATCH\_ACCEPT\_TAC}, 327 - \item {\ptt MATCH\_MP}, 328 - \item {\ptt MATCH\_MP\_TAC}, 329 - \item {\ptt max\_print\_depth}, 330 - \item {\ptt mem}, 331 - \item {\ptt merge\_nets\_rep}, 331 - \item {\ptt merge\_term\_nets}, 332 - \item {\ptt message}, 332 - \item {\ptt MK\_ABS}, 333 - \item {\ptt mk\_abs}, 333 - \item {\ptt MK\_COMB}, 334 - \item {\ptt mk\_comb}, 334 - \item {\ptt mk\_cond}, 335 - \item {\ptt mk\_conj}, 335 - \item {\ptt mk\_cons}, 336 - \item {\ptt mk\_const}, 336 - \item {\ptt mk\_conv\_net}, 337 - \item {\ptt mk\_definition}, 337 - \item {\ptt mk\_disj}, 337 - \item {\ptt mk\_eq}, 338 - \item {\ptt MK\_EXISTS}, 338 - \item {\ptt mk\_exists}, 339 - \item {\ptt mk\_forall}, 339 - \item {\ptt mk\_form}, 340 - \item {\ptt mk\_imp}, 340 - \item {\ptt mk\_let}, 340 - \item {\ptt mk\_list}, 341 - \item {\ptt mk\_neg}, 342 - \item {\ptt mk\_pabs}, 342 - \item {\ptt mk\_pair}, 342 - \item {\ptt mk\_pp\_thm}, 343 - \item {\ptt mk\_pred}, 343 - \item {\ptt mk\_primed\_var}, 344 - \item {\ptt mk\_select}, 345 - \item {\ptt mk\_thm}, 345 - \item {\ptt mk\_type}, 346 - \item {\ptt mk\_var}, 347 - \item {\ptt mk\_vartype}, 347 - \item {\ptt ml\_curried\_infix}, 348 - \item {\ptt ml\_dir\_pathname}, 349 - \item {\ptt ML\_eval}, 349 - \item {\ptt ml\_paired\_infix}, 350 - \item {\ptt MOD\_EQ\_0}, 626 - \item {\ptt MOD\_MOD}, 626 - \item {\ptt MOD\_MULT}, 626 - \item {\ptt MOD\_ONE}, 626 - \item {\ptt MOD\_PLUS}, 626 - \item {\ptt MOD\_TIMES}, 626 - \item {\ptt MOD\_UNIQUE}, 626 - \item {\ptt MONOID\_ADD\_0}, 626 - \item {\ptt MONOID\_APPEND\_NIL}, 652 - \item {\ptt MONOID\_CONJ\_T}, 615 - \item {\ptt MONOID\_DEF}, 615 - \item {\ptt MONOID\_DISJ\_F}, 615 - \item {\ptt MONOID\_MULT\_1}, 626 - \item {\ptt MP}, 351 - \item {\ptt MP\_TAC}, 351 - \item {\ptt MULT}, 626 - \item {\ptt MULT\_0}, 627 - \item {\ptt MULT\_ASSOC}, 627 - \item {\ptt MULT\_CLAUSES}, 627 - \item {\ptt MULT\_EQ\_0}, 627 - \item {\ptt MULT\_EXP\_MONO}, 627 - \item {\ptt MULT\_LEFT\_1}, 627 - \item {\ptt MULT\_LESS\_EQ\_SUC}, 627 - \item {\ptt MULT\_MONO\_EQ}, 627 - \item {\ptt MULT\_RIGHT\_1}, 627 - \item {\ptt MULT\_SUC}, 627 - \item {\ptt MULT\_SUC\_EQ}, 627 - \item {\ptt MULT\_SYM}, 627 - - \indexspace - - \item {\ptt n\_strip\_quant}, 391 - \item {\ptt NEG\_DISCH}, 352 - \item {\ptt new\_alphanum}, 353 - \item {\ptt new\_axiom}, 354 - \item {\ptt new\_binder}, 355 - \item {\ptt new\_binder\_definition}, 355 - \item {\ptt new\_constant}, 357 - \item {\ptt new\_definition}, 358 - \item {\ptt new\_flag}, 359 - \item {\ptt new\_gen\_definition}, 360 - \item {\ptt new\_infix}, 361 - \item {\ptt new\_infix\_definition}, 362 - \item {\ptt new\_infix\_list\_rec\_definition}, 363 - \item {\ptt new\_infix\_prim\_rec\_definition}, 365 - \item {\ptt new\_letter}, 367 - \item {\ptt new\_list\_rec\_definition}, 367 - \item {\ptt new\_open\_axiom}, 369 - \item {\ptt new\_parent}, 369 - \item {\ptt new\_predicate}, 370 - \item {\ptt new\_prim\_rec\_definition}, 371 - \item {\ptt new\_recursive\_definition}, 372 - \item {\ptt new\_special\_symbol}, 375 - \item {\ptt new\_specification}, 376 - \item {\ptt new\_stack}, 377 - \item {\ptt new\_syntax\_block}, 378 - \item {\ptt new\_theory}, 379 - \item {\ptt new\_type}, 380 - \item {\ptt new\_type\_abbrev}, 381 - \item {\ptt new\_type\_definition}, 382 - \item {\ptt NIL\_DEF}, 652 - \item {\ptt nil\_term\_net}, 383 - \item {\ptt NO\_CONV}, 388 - \item {\ptt NO\_TAC}, 388 - \item {\ptt NO\_THEN}, 388 - \item {\ptt Node}, 660 - \item {\ptt node}, 660 - \item {\ptt Node\_11}, 660 - \item {\ptt node\_11}, 660 - \item {\ptt Node\_onto}, 660 - \item {\ptt node\_REP}, 660 - \item {\ptt not}, 384 - \item {\ptt NOT\_ALL\_EL\_SOME\_EL}, 652 - \item {\ptt NOT\_AND}, 613 - \item {\ptt NOT\_CLAUSES}, 613 - \item {\ptt NOT\_CONS\_NIL}, 652 - \item {\ptt NOT\_DEF}, 609 - \item {\ptt NOT\_ELIM}, 384 - \item {\ptt NOT\_EQ\_LIST}, 652 - \item {\ptt NOT\_EQ\_SYM}, 385 - \item {\ptt NOT\_EXISTS\_CONV}, 385 - \item {\ptt NOT\_EXP\_0}, 627 - \item {\ptt NOT\_F}, 613 - \item {\ptt NOT\_FORALL\_CONV}, 386 - \item {\ptt NOT\_GREATER}, 627 - \item {\ptt NOT\_GREATER\_EQ}, 628 - \item {\ptt NOT\_IMP}, 613 - \item {\ptt NOT\_INTRO}, 386 - \item {\ptt NOT\_LEQ}, 628 - \item {\ptt NOT\_LESS}, 628 - \item {\ptt NOT\_LESS\_0}, 628 - \item {\ptt NOT\_LESS\_EQ}, 628 - \item {\ptt NOT\_LESS\_EQUAL}, 628 - \item {\ptt NOT\_MP}, 387 - \item {\ptt NOT\_NIL\_CONS}, 653 - \item {\ptt NOT\_NIL\_SNOC}, 653 - \item {\ptt NOT\_NUM\_EQ}, 628 - \item {\ptt NOT\_ODD\_EQ\_EVEN}, 628 - \item {\ptt NOT\_SNOC\_NIL}, 653 - \item {\ptt NOT\_SOME\_EL\_ALL\_EL}, 653 - \item {\ptt NOT\_SUC}, 628 - \item {\ptt NOT\_SUC\_ADD\_LESS\_EQ}, 628 - \item {\ptt NOT\_SUC\_LESS\_EQ}, 628 - \item {\ptt NOT\_SUC\_LESS\_EQ\_0}, 628 - \item {\ptt NULL}, 653 - \item {\ptt null}, 389 - \item {\ptt NULL\_DEF}, 653 - \item {\ptt NULL\_EQ\_NIL}, 653 - \item {\ptt NULL\_FOLDL}, 653 - \item {\ptt NULL\_FOLDR}, 653 - \item {\ptt num\_Axiom}, 628 - \item {\ptt num\_CASES}, 628 - \item {\ptt num\_CONV}, 389 - \item {\ptt num\_EQ\_CONV}, 390 - \item {\ptt num\_ISO\_DEF}, 628 - \item {\ptt num\_TY\_DEF}, 629 - - \indexspace - - \item {\ptt o}, 391 - \item {\ptt o\_ASSOC}, 616 - \item {\ptt o\_DEF}, 616 - \item {\ptt o\_THM}, 616 - \item {\ptt ODD}, 629 - \item {\ptt ODD\_ADD}, 629 - \item {\ptt ODD\_DOUBLE}, 629 - \item {\ptt ODD\_EVEN}, 629 - \item {\ptt ODD\_EXISTS}, 629 - \item {\ptt ODD\_MULT}, 629 - \item {\ptt ODD\_OR\_EVEN}, 629 - \item {\ptt ONCE\_ASM\_REWRITE\_RULE}, 392 - \item {\ptt ONCE\_ASM\_REWRITE\_TAC}, 392 - \item {\ptt ONCE\_DEPTH\_CONV}, 393 - \item {\ptt ONCE\_REW\_DEPTH\_CONV}, 397 - \item {\ptt ONCE\_REWRITE\_CONV}, 395 - \item {\ptt ONCE\_REWRITE\_RULE}, 395 - \item {\ptt ONCE\_REWRITE\_TAC}, 396 - \item {\ptt one}, 615 - \item {\ptt one\_Axiom}, 615 - \item {\ptt one\_axiom}, 616 - \item {\ptt one\_DEF}, 616 - \item {\ptt ONE\_ONE\_DEF}, 615 - \item {\ptt one\_TY\_DEF}, 616 - \item {\ptt ONTO\_DEF}, 615 - \item {\ptt oo}, 399 - \item {\ptt openi}, 399 - \item {\ptt openw}, 399 - \item {\ptt OR\_CLAUSES}, 613 - \item {\ptt OR\_DEF}, 609 - \item {\ptt OR\_EL\_DEF}, 653 - \item {\ptt OR\_EL\_FOLDL}, 653 - \item {\ptt OR\_EL\_FOLDR}, 653 - \item {\ptt OR\_ELIM\_THM}, 614 - \item {\ptt OR\_EXISTS\_CONV}, 402 - \item {\ptt OR\_FORALL\_CONV}, 402 - \item {\ptt OR\_IMP\_THM}, 614 - \item {\ptt OR\_INTRO\_THM1}, 614 - \item {\ptt OR\_INTRO\_THM2}, 614 - \item {\ptt OR\_LESS}, 629 - \item {\ptt ORELSE}, 400 - \item {\ptt ORELSE\_TCL}, 401 - \item {\ptt ORELSEC}, 401 - \item {\ptt OUTL}, 618 - \item {\ptt outl}, 403 - \item {\ptt OUTR}, 618 - \item {\ptt outr}, 403 - - \indexspace - - \item {\ptt p}, 404 - \item {\ptt PAIR}, 617 - \item {\ptt pair}, 405 - \item {\ptt PAIR\_EQ}, 617 - \item {\ptt PAIR\_EXISTS}, 617 - \item {\ptt PAIRED\_BETA\_CONV}, 405 - \item {\ptt paired\_delete\_thm}, 407 - \item {\ptt PAIRED\_ETA\_CONV}, 407 - \item {\ptt paired\_new\_type}, 408 - \item {\ptt paired\_theorem}, 408 - \item {\ptt parents}, 409 - \item {\ptt parse\_as\_binder}, 410 - \item {\ptt PART}, 653, 660 - \item {\ptt PART\_MATCH}, 412 - \item {\ptt partition}, 411 - \item {\ptt POP\_ASSUM}, 413 - \item {\ptt POP\_ASSUM\_LIST}, 414 - \item {\ptt pop\_proofs}, 415 - \item {\ptt pop\_proofs\_print}, 416 - \item {\ptt pp\_axiom}, 416 - \item {\ptt PRE}, 629 - \item {\ptt PRE\_DEF}, 629 - \item {\ptt PRE\_SUB}, 629 - \item {\ptt PRE\_SUB1}, 629 - \item {\ptt PRE\_SUC\_EQ}, 629 - \item {\ptt PREFIX}, 653 - \item {\ptt PREFIX\_DEF}, 653 - \item {\ptt PREFIX\_FOLDR}, 654 - \item {\ptt preterm\_abs}, 416 - \item {\ptt preterm\_antiquot}, 417 - \item {\ptt preterm\_comb}, 418 - \item {\ptt preterm\_const}, 419 - \item {\ptt preterm\_to\_term}, 419 - \item {\ptt preterm\_typed}, 420 - \item {\ptt preterm\_var}, 421 - \item {\ptt PRIM\_REC}, 629 - \item {\ptt PRIM\_REC\_EQN}, 630 - \item {\ptt PRIM\_REC\_FUN}, 630 - \item {\ptt PRIM\_REC\_THM}, 630 - \item {\ptt print\_all\_thm}, 422 - \item {\ptt print\_begin}, 423 - \item {\ptt print\_bool}, 425 - \item {\ptt print\_break}, 425 - \item {\ptt print\_defined\_types}, 427 - \item {\ptt print\_end}, 427 - \item {\ptt print\_goal}, 428 - \item {\ptt print\_hyps}, 429 - \item {\ptt print\_ibegin}, 429 - \item {\ptt print\_int}, 430 - \item {\ptt print\_list}, 431 - \item {\ptt print\_newline}, 432 - \item {\ptt print\_stack}, 433 - \item {\ptt print\_state}, 433 - \item {\ptt print\_string}, 435 - \item {\ptt print\_subgoals}, 435 - \item {\ptt print\_term}, 435 - \item {\ptt print\_theory}, 436 - \item {\ptt print\_thm}, 437 - \item {\ptt print\_tok}, 437 - \item {\ptt print\_type}, 438 - \item {\ptt print\_unquoted\_term}, 439 - \item {\ptt print\_unquoted\_type}, 439 - \item {\ptt print\_void}, 440 - \item {\ptt prod\_TY\_DEF}, 617 - \item {\ptt prompt}, 441 - \item {\ptt PROVE}, 441 - \item {\ptt prove}, 442 - \item {\ptt prove\_abs\_fn\_one\_one}, 442 - \item {\ptt prove\_abs\_fn\_onto}, 443 - \item {\ptt prove\_cases\_thm}, 443 - \item {\ptt prove\_constructors\_distinct}, 444 - \item {\ptt prove\_constructors\_one\_one}, 445 - \item {\ptt PROVE\_HYP}, 446 - \item {\ptt prove\_induction\_thm}, 447 - \item {\ptt prove\_rec\_fn\_exists}, 448 - \item {\ptt prove\_rep\_fn\_one\_one}, 449 - \item {\ptt prove\_rep\_fn\_onto}, 449 - \item {\ptt prove\_thm}, 450 - \item {\ptt PURE\_ASM\_REWRITE\_RULE}, 451 - \item {\ptt PURE\_ASM\_REWRITE\_TAC}, 451 - \item {\ptt PURE\_ONCE\_ASM\_REWRITE\_RULE}, 452 - \item {\ptt PURE\_ONCE\_ASM\_REWRITE\_TAC}, 452 - \item {\ptt PURE\_ONCE\_REWRITE\_CONV}, 453 - \item {\ptt PURE\_ONCE\_REWRITE\_RULE}, 454 - \item {\ptt PURE\_ONCE\_REWRITE\_TAC}, 454 - \item {\ptt PURE\_REWRITE\_CONV}, 455 - \item {\ptt PURE\_REWRITE\_RULE}, 455 - \item {\ptt PURE\_REWRITE\_TAC}, 456 - \item {\ptt push\_fsubgoals}, 457 - \item {\ptt push\_print}, 457 - \item {\ptt push\_subgoals}, 458 - - \indexspace - - \item {\ptt quit}, 458 - - \indexspace - - \item {\ptt r}, 458 - \item {\ptt rand}, 459 - \item {\ptt RAND\_CONV}, 459 - \item {\ptt rator}, 460 - \item {\ptt RATOR\_CONV}, 460 - \item {\ptt read}, 461 - \item {\ptt record\_proof}, 463 - \item {\ptt RecordStep}, 462 - \item {\ptt REDEPTH\_CONV}, 464 - \item {\ptt REFL}, 466 - \item {\ptt REFL\_CLAUSE}, 614 - \item {\ptt REFL\_TAC}, 466 - \item {\ptt remove}, 467 - \item {\ptt remove\_sticky\_type}, 467 - \item {\ptt rep\_goals}, 470 - \item {\ptt REP\_prod}, 617 - \item {\ptt REPEAT}, 468 - \item {\ptt REPEAT\_GTCL}, 469 - \item {\ptt REPEAT\_TCL}, 469 - \item {\ptt REPEATC}, 468 - \item {\ptt REPLICATE}, 654 - \item {\ptt replicate}, 470 - \item {\ptt RES\_ABSTRACT}, 610 - \item {\ptt RES\_CANON}, 471 - \item {\ptt RES\_EXISTS}, 610 - \item {\ptt RES\_FORALL}, 610 - \item {\ptt RES\_SELECT}, 610 - \item {\ptt RES\_TAC}, 474 - \item {\ptt RES\_THEN}, 475 - \item {\ptt resume\_recording}, 471 - \item {\ptt rev}, 477 - \item {\ptt rev\_assoc}, 478 - \item {\ptt rev\_itlist}, 478 - \item {\ptt REVERSE}, 654 - \item {\ptt REVERSE\_APPEND}, 654 - \item {\ptt REVERSE\_CONV}, 477 - \item {\ptt REVERSE\_EQ\_NIL}, 654 - \item {\ptt REVERSE\_FLAT}, 654 - \item {\ptt REVERSE\_FOLDL}, 654 - \item {\ptt REVERSE\_FOLDR}, 654 - \item {\ptt REVERSE\_REVERSE}, 654 - \item {\ptt REVERSE\_SNOC}, 654 - \item {\ptt REW\_DEPTH\_CONV}, 485 - \item {\ptt REWR\_CONV}, 482 - \item {\ptt REWRITE\_CONV}, 479 - \item {\ptt REWRITE\_RULE}, 480 - \item {\ptt REWRITE\_TAC}, 481 - \item {\ptt rhs}, 487 - \item {\ptt RIGHT\_ADD\_DISTRIB}, 630 - \item {\ptt RIGHT\_AND\_EXISTS\_CONV}, 487 - \item {\ptt RIGHT\_AND\_FORALL\_CONV}, 488 - \item {\ptt RIGHT\_AND\_OVER\_OR}, 614 - \item {\ptt RIGHT\_BETA}, 488 - \item {\ptt RIGHT\_CONV\_RULE}, 489 - \item {\ptt RIGHT\_ID\_ADD\_0}, 630 - \item {\ptt RIGHT\_ID\_DEF}, 615 - \item {\ptt RIGHT\_ID\_MULT\_1}, 630 - \item {\ptt RIGHT\_IMP\_EXISTS\_CONV}, 490 - \item {\ptt RIGHT\_IMP\_FORALL\_CONV}, 490 - \item {\ptt RIGHT\_LIST\_BETA}, 491 - \item {\ptt RIGHT\_OR\_EXISTS\_CONV}, 491 - \item {\ptt RIGHT\_OR\_FORALL\_CONV}, 492 - \item {\ptt RIGHT\_OR\_OVER\_AND}, 614 - \item {\ptt RIGHT\_SUB\_DISTRIB}, 630 - \item {\ptt root\_goal}, 492 - \item {\ptt rotate}, 493 - \item {\ptt rotate\_goals}, 494 - \item {\ptt rotate\_top}, 495 - \item {\ptt RULE\_ASSUM\_TAC}, 495 - - \indexspace - - \item {\ptt S}, 496 - \item {\ptt S\_DEF}, 616 - \item {\ptt S\_THM}, 616 - \item {\ptt save}, 496 - \item {\ptt save\_thm}, 497 - \item {\ptt save\_top\_thm}, 498 - \item {\ptt SCANL}, 654 - \item {\ptt SCANL\_CONV}, 499 - \item {\ptt SCANR}, 654 - \item {\ptt SCANR\_CONV}, 500 - \item {\ptt search\_path}, 501 - \item {\ptt SEG}, 654 - \item {\ptt SEG\_0\_SNOC}, 654 - \item {\ptt SEG\_APPEND}, 655 - \item {\ptt SEG\_APPEND1}, 655 - \item {\ptt SEG\_APPEND2}, 655 - \item {\ptt SEG\_CONV}, 502 - \item {\ptt SEG\_FIRSTN\_BUTFISTN}, 655 - \item {\ptt SEG\_LASTN\_BUTLASTN}, 655 - \item {\ptt SEG\_LENGTH\_ID}, 655 - \item {\ptt SEG\_LENGTH\_SNOC}, 655 - \item {\ptt SEG\_REVERSE}, 655 - \item {\ptt SEG\_SEG}, 655 - \item {\ptt SEG\_SNOC}, 655 - \item {\ptt SEG\_SUC\_CONS}, 655 - \item {\ptt SELECT\_AX}, 610 - \item {\ptt SELECT\_CONV}, 503 - \item {\ptt SELECT\_ELIM}, 504 - \item {\ptt SELECT\_EQ}, 505 - \item {\ptt SELECT\_INTRO}, 506 - \item {\ptt SELECT\_REFL}, 614 - \item {\ptt SELECT\_RULE}, 507 - \item {\ptt SELECT\_UNIQUE}, 614 - \item {\ptt set\_equal}, 509 - \item {\ptt set\_fail}, 509 - \item {\ptt set\_fail\_prefix}, 510 - \item {\ptt set\_flag}, 511 - \item {\ptt set\_goal}, 512 - \item {\ptt set\_help}, 513 - \item {\ptt set\_help\_search\_path}, 514 - \item {\ptt set\_interface\_map}, 514 - \item {\ptt set\_lambda}, 515 - \item {\ptt set\_library\_search\_path}, 516 - \item {\ptt set\_margin}, 517 - \item {\ptt set\_pretty\_mode}, 517 - \item {\ptt set\_prompt}, 518 - \item {\ptt set\_search\_path}, 519 - \item {\ptt set\_state}, 520 - \item {\ptt set\_sticky\_type}, 521 - \item {\ptt set\_string\_escape}, 522 - \item {\ptt set\_thm\_count}, 523 - \item {\ptt set\_turnstile}, 523 - \item {\ptt setify}, 508 - \item {\ptt show\_types}, 524 - \item {\ptt SIMP\_REC}, 630 - \item {\ptt SIMP\_REC\_EXISTS}, 630 - \item {\ptt SIMP\_REC\_FUN}, 630 - \item {\ptt SIMP\_REC\_FUN\_LEMMA}, 630 - \item {\ptt SIMP\_REC\_REL}, 630 - \item {\ptt SIMP\_REC\_THM}, 631 - \item {\ptt Size}, 660 - \item {\ptt SKOLEM\_CONV}, 525 - \item {\ptt SND}, 617 - \item {\ptt snd}, 526 - \item {\ptt SND\_DEF}, 617 - \item {\ptt SNOC}, 656 - \item {\ptt SNOC\_11}, 656 - \item {\ptt SNOC\_APPEND}, 656 - \item {\ptt SNOC\_Axiom}, 656 - \item {\ptt SNOC\_CASES}, 656 - \item {\ptt SNOC\_CONV}, 526 - \item {\ptt SNOC\_EQ\_LENGTH\_EQ}, 656 - \item {\ptt SNOC\_FOLDR}, 656 - \item {\ptt SNOC\_INDUCT}, 656 - \item {\ptt SNOC\_INDUCT\_TAC}, 527 - \item {\ptt SNOC\_REVERSE\_CONS}, 656 - \item {\ptt SOME\_EL}, 656 - \item {\ptt SOME\_EL\_APPEND}, 656 - \item {\ptt SOME\_EL\_BUTFIRSTN}, 656 - \item {\ptt SOME\_EL\_BUTLASTN}, 656 - \item {\ptt SOME\_EL\_CONV}, 528 - \item {\ptt SOME\_EL\_DISJ}, 656 - \item {\ptt SOME\_EL\_FIRSTN}, 657 - \item {\ptt SOME\_EL\_FOLDL}, 657 - \item {\ptt SOME\_EL\_FOLDL\_MAP}, 657 - \item {\ptt SOME\_EL\_FOLDR}, 657 - \item {\ptt SOME\_EL\_FOLDR\_MAP}, 657 - \item {\ptt SOME\_EL\_LASTN}, 657 - \item {\ptt SOME\_EL\_MAP}, 657 - \item {\ptt SOME\_EL\_REVERSE}, 657 - \item {\ptt SOME\_EL\_SEG}, 657 - \item {\ptt SOME\_EL\_SNOC}, 657 - \item {\ptt sort}, 529 - \item {\ptt SPEC}, 530 - \item {\ptt SPEC\_ALL}, 532 - \item {\ptt SPEC\_TAC}, 533 - \item {\ptt SPEC\_VAR}, 534 - \item {\ptt special\_symbols}, 531 - \item {\ptt SPECL}, 531 - \item {\ptt SPLIT}, 657, 660 - \item {\ptt split}, 534 - \item {\ptt SPLITP}, 657 - \item {\ptt splitp}, 535 - \item {\ptt sticky\_list}, 535 - \item {\ptt store\_binders}, 536 - \item {\ptt store\_definition}, 536 - \item {\ptt string\_of\_int}, 536 - \item {\ptt strip\_abs}, 537 - \item {\ptt STRIP\_ASSUME\_TAC}, 537 - \item {\ptt strip\_comb}, 539 - \item {\ptt strip\_exists}, 540 - \item {\ptt strip\_forall}, 540 - \item {\ptt STRIP\_GOAL\_THEN}, 541 - \item {\ptt strip\_imp}, 543 - \item {\ptt strip\_pair}, 543 - \item {\ptt STRIP\_TAC}, 544 - \item {\ptt STRIP\_THM\_THEN}, 545 - \item {\ptt STRUCT\_CASES\_TAC}, 547 - \item {\ptt SUB}, 631 - \item {\ptt SUB\_0}, 631 - \item {\ptt SUB\_ADD}, 631 - \item {\ptt SUB\_CANCEL}, 631 - \item {\ptt SUB\_CONV}, 563 - \item {\ptt SUB\_EQ\_0}, 631 - \item {\ptt SUB\_EQ\_EQ\_0}, 631 - \item {\ptt SUB\_EQUAL\_0}, 631 - \item {\ptt SUB\_LEFT\_ADD}, 631 - \item {\ptt SUB\_LEFT\_EQ}, 631 - \item {\ptt SUB\_LEFT\_GREATER}, 631 - \item {\ptt SUB\_LEFT\_GREATER\_EQ}, 631 - \item {\ptt SUB\_LEFT\_LESS}, 631 - \item {\ptt SUB\_LEFT\_LESS\_EQ}, 631 - \item {\ptt SUB\_LEFT\_SUB}, 631 - \item {\ptt SUB\_LEFT\_SUC}, 632 - \item {\ptt SUB\_LESS\_0}, 632 - \item {\ptt SUB\_LESS\_EQ}, 632 - \item {\ptt SUB\_LESS\_EQ\_ADD}, 632 - \item {\ptt SUB\_LESS\_OR}, 632 - \item {\ptt SUB\_MONO\_EQ}, 632 - \item {\ptt SUB\_PLUS}, 632 - \item {\ptt SUB\_RIGHT\_ADD}, 632 - \item {\ptt SUB\_RIGHT\_EQ}, 632 - \item {\ptt SUB\_RIGHT\_GREATER}, 632 - \item {\ptt SUB\_RIGHT\_GREATER\_EQ}, 632 - \item {\ptt SUB\_RIGHT\_LESS}, 632 - \item {\ptt SUB\_RIGHT\_LESS\_EQ}, 632 - \item {\ptt SUB\_RIGHT\_SUB}, 632 - \item {\ptt SUB\_SUB}, 632 - \item {\ptt SUBGOAL\_THEN}, 548 - \item {\ptt SUBS}, 549 - \item {\ptt SUBS\_OCCS}, 561 - \item {\ptt SUBST}, 551 - \item {\ptt subst}, 552 - \item {\ptt SUBST1\_TAC}, 553 - \item {\ptt SUBST\_ALL\_TAC}, 554 - \item {\ptt SUBST\_CONV}, 555 - \item {\ptt SUBST\_MATCH}, 557 - \item {\ptt subst\_occs}, 558 - \item {\ptt SUBST\_OCCS\_TAC}, 559 - \item {\ptt SUBST\_TAC}, 560 - \item {\ptt subtract}, 562 - \item {\ptt SUC\_ADD\_SYM}, 632 - \item {\ptt SUC\_DEF}, 633 - \item {\ptt SUC\_ID}, 633 - \item {\ptt SUC\_LESS}, 633 - \item {\ptt SUC\_NOT}, 633 - \item {\ptt SUC\_ONE\_ADD}, 633 - \item {\ptt SUC\_REP\_DEF}, 633 - \item {\ptt SUC\_SUB1}, 633 - \item {\ptt SUFFIX\_DEF}, 657 - \item {\ptt SUM}, 658 - \item {\ptt SUM\_APPEND}, 658 - \item {\ptt sum\_Axiom}, 618 - \item {\ptt sum\_axiom}, 618 - \item {\ptt SUM\_FLAT}, 658 - \item {\ptt SUM\_FOLDL}, 658 - \item {\ptt SUM\_FOLDR}, 658 - \item {\ptt sum\_ISO\_DEF}, 618 - \item {\ptt SUM\_REVERSE}, 658 - \item {\ptt SUM\_SNOC}, 658 - \item {\ptt sum\_TY\_DEF}, 618 - \item {\ptt suspend\_recording}, 564 - \item {\ptt SWAP\_EXISTS\_CONV}, 565 - \item {\ptt SYM}, 565 - \item {\ptt SYM\_CONV}, 566 - \item {\ptt syserror}, 566 - \item {\ptt system}, 567 - - \indexspace - - \item {\ptt T\_DEF}, 609 - \item {\ptt TAC\_PROOF}, 567 - \item {\ptt term\_of\_int}, 568 - \item {\ptt THEN}, 568 - \item {\ptt THEN\_TCL}, 570 - \item {\ptt THENC}, 569 - \item {\ptt THENL}, 570 - \item {\ptt theorem}, 571 - \item {\ptt theorem\_lfn}, 573 - \item {\ptt theorem\_msg\_lfn}, 573 - \item {\ptt theorems}, 572 - \item {\ptt thm\_count}, 574 - \item {\ptt thm\_frees}, 575 - \item {\ptt timer}, 575 - \item {\ptt TIMES2}, 633 - \item {\ptt TL}, 658 - \item {\ptt tl}, 576 - \item {\ptt TL\_SNOC}, 658 - \item {\ptt TOP\_DEPTH\_CONV}, 577 - \item {\ptt top\_goal}, 578 - \item {\ptt top\_print}, 578 - \item {\ptt top\_proof}, 579 - \item {\ptt top\_thm}, 580 - \item {\ptt TRANS}, 580 - \item {\ptt tree\_Axiom}, 660 - \item {\ptt tree\_Induct}, 660 - \item {\ptt tree\_ISO\_DEF}, 661 - \item {\ptt tree\_TY\_DEF}, 661 - \item {\ptt trf}, 661 - \item {\ptt TRP}, 661 - \item {\ptt TRP\_DEF}, 661 - \item {\ptt TRUTH}, 614 - \item {\ptt TRY}, 581 - \item {\ptt TRY\_CONV}, 582 - \item {\ptt tryfind}, 582 - \item {\ptt tty\_read}, 583 - \item {\ptt tty\_write}, 583 - \item {\ptt TY\_DEF\_THM}, 661 - \item {\ptt type\_abbrevs}, 585 - \item {\ptt TYPE\_DEFINITION}, 661 - \item {\ptt type\_in}, 586 - \item {\ptt type\_in\_type}, 587 - \item {\ptt type\_of}, 587 - \item {\ptt type\_tyvars}, 588 - \item {\ptt types}, 584 - \item {\ptt tyvars}, 588 - \item {\ptt tyvarsl}, 589 - - \indexspace - - \item {\ptt uncurry}, 590 - \item {\ptt UNCURRY\_DEF}, 617 - \item {\ptt UNDISCH}, 590 - \item {\ptt UNDISCH\_ALL}, 591 - \item {\ptt UNDISCH\_TAC}, 592 - \item {\ptt undo\_autoload}, 592 - \item {\ptt unhide\_constant}, 593 - \item {\ptt union}, 593 - \item {\ptt unlink}, 594 - \item {\ptt UNZIP}, 658 - \item {\ptt UNZIP\_FST\_DEF}, 658 - \item {\ptt UNZIP\_SND\_DEF}, 658 - \item {\ptt UNZIP\_SNOC}, 658 - \item {\ptt UNZIP\_ZIP}, 658 - - \indexspace - - \item {\ptt VALID}, 594 - \item {\ptt variant}, 595 - \item {\ptt vars}, 596 - \item {\ptt varsl}, 597 - \item {\ptt version}, 598 - - \indexspace - - \item {\ptt W}, 598 - \item {\ptt WOP}, 633 - \item {\ptt word\_separators}, 600 - \item {\ptt words}, 598 - \item {\ptt words2}, 599 - \item {\ptt write}, 600 - - \indexspace - - \item {\ptt X\_CASES\_THEN}, 601 - \item {\ptt X\_CASES\_THENL}, 603 - \item {\ptt X\_CHOOSE\_TAC}, 604 - \item {\ptt X\_CHOOSE\_THEN}, 605 - \item {\ptt X\_FUN\_EQ\_CONV}, 607 - \item {\ptt X\_GEN\_TAC}, 607 - \item {\ptt X\_SKOLEM\_CONV}, 608 - - \indexspace - - \item {\ptt ZERO\_DEF}, 633 - \item {\ptt ZERO\_DIV}, 633 - \item {\ptt ZERO\_LESS\_EQ}, 633 - \item {\ptt ZERO\_LESS\_EXP}, 633 - \item {\ptt ZERO\_MOD}, 633 - \item {\ptt ZERO\_REP\_DEF}, 633 - \item {\ptt ZIP}, 659 - \item {\ptt ZIP\_SNOC}, 659 - \item {\ptt ZIP\_UNZIP}, 659 - -\end{theindex} +\begin{theindex}\mbox{}\end{theindex} \ No newline at end of file --- hol88-2.02.19940316.orig/Manual/Reference/Makefile +++ hol88-2.02.19940316/Manual/Reference/Makefile @@ -19,46 +19,46 @@ default: clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: ids theorems @echo "TeX files made" ids: - @echo "\chapter{Pre-defined ML Identifiers}" > entries.tex - @echo "\input{entries-intro}" >> entries.tex + @printf '\\chapter{Pre-defined ML Identifiers}' > entries.tex + @printf '\\input{entries-intro}' >> entries.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/ENTRIES entries.tex theorems: - @echo "\chapter{Pre-proved Theorems}" > theorems.tex - @echo "\input{theorems-intro}" >> theorems.tex - @echo "\section{Definitions of Basic Logical Constants}">>theorems.tex + @printf '\\chapter{Pre-proved Theorems}' > theorems.tex + @printf '\\input{theorems-intro}' >> theorems.tex + @printf '\\section{Definitions of Basic Logical Constants}'>>theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/basic-logic theorems.tex - @echo "\section{Constants for syntactic abbreviations}" >> theorems.tex + @printf '\\section{Constants for syntactic abbreviations}' >> theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/syntax theorems.tex - @echo "\section{Axioms}" >> theorems.tex + @printf '\\section{Axioms}' >> theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/axioms theorems.tex - @echo "\section{Logical tautologies}" >> theorems.tex + @printf '\\section{Logical tautologies}' >> theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/logic theorems.tex - @echo "\section{Theorems about functions}" >> theorems.tex + @printf '\\section{Theorems about functions}' >> theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/functions theorems.tex - @echo "\section{Theorems about the type {\tt one}}" >> theorems.tex + @printf '\\section{Theorems about the type {\\tt one}}' >> theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/one theorems.tex - @echo "\section{Theorems about combinators}" >> theorems.tex + @printf '\\section{Theorems about combinators}' >> theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/combin theorems.tex - @echo "\section{Theorems about pairs}" >> theorems.tex + @printf '\\section{Theorems about pairs}' >> theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/pairs theorems.tex - @echo "\section{Theorems about disjoint sums}" >> theorems.tex + @printf '\\section{Theorems about disjoint sums}' >> theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/sum theorems.tex - @echo "\section{Theorems about arithmetic}" >> theorems.tex + @printf '\\section{Theorems about arithmetic}' >> theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/arith theorems.tex - @echo "\section{Theorems about lists}" >> theorems.tex + @printf '\\section{Theorems about lists}' >> theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/list theorems.tex - @echo "\section{Theorems about trees}" >> theorems.tex + @printf '\\section{Theorems about trees}' >> theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/tree theorems.tex - @echo "\section{Theorems used to define types}" >> theorems.tex + @printf '\\section{Theorems used to define types}' >> theorems.tex /bin/sh bin/doc-to-tex ${D2TSED} ${Helpd}/THEOREMS/tydefs theorems.tex reference: --- hol88-2.02.19940316.orig/Manual/Reference/entries.tex +++ hol88-2.02.19940316/Manual/Reference/entries.tex @@ -1,1114 +1,882 @@ -\chapter{Pre-defined ML Identifiers} -\input{entries-intro} -\DOC{\#} +\chapter{Pre-defined ML Identifiers}\input{entries-intro}\DOC{ABS\_CONV} -\TYPE {\small\verb%$# : (((* -> **) # (*** -> ****)) -> (* # ***) -> (** # ****))%}\egroup +\TYPE {\small\verb%ABS_CONV : (conv -> conv)%}\egroup \SYNOPSIS -Applies two functions to a pair: {\small\verb%(f # g) (x,y)%} = {\small\verb%(f x, g y)%}. +Applies a conversion to the body of an abstraction. + +\DESCRIBE +If {\small\verb%c%} is a conversion that maps a term {\small\verb%"t"%} to the theorem {\small\verb%|- t = t'%}, then +the conversion {\small\verb%ABS_CONV c%} maps abstractions of the form {\small\verb%"\x.t"%} to theorems +of the form: +{\par\samepage\setseps\small +\begin{verbatim} + |- (\x.t) = (\x.t') +\end{verbatim} +} +\noindent That is, {\small\verb%ABS_CONV c "\x.t"%} applies {\small\verb%c%} to the body of the +abstraction {\small\verb%"\x.t"%}. \FAILURE -Never fails. +{\small\verb%ABS_CONV c tm%} fails if {\small\verb%tm%} is not an abstraction or if {\small\verb%tm%} has the form +{\small\verb%"\x.t"%} but the conversion {\small\verb%c%} fails when applied to the term {\small\verb%t%}. The +function returned by {\small\verb%ABS_CONV c%} may also fail if the ML function +{\small\verb%c:term->thm%} is not, in fact, a conversion (i.e. a function that maps a term +{\small\verb%t%} to a theorem {\small\verb%|- t = t'%}). +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#ABS_CONV SYM_CONV "\x. 1 = x";; +|- (\x. 1 = x) = (\x. x = 1) +\end{verbatim} +} \SEEALSO -B, C, CB, Co, I, K, KI, o, oo, S, W. +RAND_CONV, RATOR_CONV, SUB_CONV. \ENDDOC -\DOC{*} +\DOC{ABS} -\TYPE {\small\verb%$* : ((int # int) -> int)%}\egroup +\TYPE {\small\verb%ABS : (term -> thm -> thm)%}\egroup \SYNOPSIS -Performs multiplication on ML integers. +Abstracts both sides of an equation. +\DESCRIBE +{\par\samepage\setseps\small +\begin{verbatim} + A |- t1 = t2 + ------------------------ ABS "x" [Where x is not free in A] + A |- (\x.t1) = (\x.t2) +\end{verbatim} +} \FAILURE -Never fails. +If the theorem is not an equation, or if the variable {\small\verb%x%} is free in the +assumptions {\small\verb%A%}. -\ENDDOC +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#ABS "m:num" (REFL "m:num");; +|- (\m. m) = (\m. m) +\end{verbatim} +} +\SEEALSO +ETA_CONV, EXT, MK_ABS. -\DOC{+} +\ENDDOC +\DOC{abs\_goals} -\TYPE {\small\verb%$+ : ((int # int) -> int)%}\egroup +\TYPE {\small\verb%abs_goals : (subgoals list -> goalstack)%}\egroup \SYNOPSIS -Performs addition on ML integers. - -\FAILURE -Never fails. +This function is for internal use only and is to be deleted from a future +version of the system. It should not be used. \ENDDOC -\DOC{-} +\DOC{ACCEPT\_TAC} -\TYPE {\small\verb%$- : ((int # int) -> int)%}\egroup +\TYPE {\small\verb%ACCEPT_TAC : thm_tactic%}\egroup \SYNOPSIS -Performs subtraction on ML integers. +Solves a goal if supplied with the desired theorem (up to alpha-conversion). + +\DESCRIBE +{\small\verb%ACCEPT_TAC%} maps a given theorem {\small\verb%th%} to a tactic that solves any goal whose +conclusion is alpha-convertible to the conclusion of {\small\verb%th%}. \FAILURE -Never fails. +{\small\verb%ACCEPT_TAC th (A,g)%} fails if the term {\small\verb%g%} is not alpha-convertible to the +conclusion of the supplied theorem {\small\verb%th%}. -\COMMENTS -Unary {\small\verb%-%} exists as an internal parser object, but not as a function. So, -whilst typing in {\small\verb%-1;;%} will work, {\small\verb%-;;%} will return a parse error. +\EXAMPLE +{\small\verb%ACCEPT_TAC%} applied to the axiom +{\par\samepage\setseps\small +\begin{verbatim} + BOOL_CASES_AX = |- !t. (t = T) \/ (t = F) +\end{verbatim} +} +\noindent will solve the goal +{\par\samepage\setseps\small +\begin{verbatim} + ?- !x. (x = T) \/ (x = F) +\end{verbatim} +} +\noindent but will fail on the goal +{\par\samepage\setseps\small +\begin{verbatim} + ?- !x. (x = F) \/ (x = T) +\end{verbatim} +} +\USES +Used for completing proofs by supplying an existing theorem, such as an axiom, +or a lemma already proved. + +\SEEALSO +MATCH_ACCEPT_TAC. \ENDDOC -\DOC{\char'056} +\DOC{AC\_CONV} -\TYPE {\small\verb%$. : ((* # * list) -> * list)%}\egroup +\TYPE {\small\verb%AC_CONV : ((thm # thm) -> conv)%}\egroup \SYNOPSIS -Adds single element to the head of a list. +Proves equality of terms using associative and commutative laws. \DESCRIBE -The {\small\verb%.%} operator is an infixed primitive list constructor, analogous to {\small\verb%CONS%} -in LISP. Its effect is {\small\verb%x . [x1;....;xn]%} = {\small\verb%[x;x1;...;xn]%}. +Suppose {\small\verb%_%} is a function, which is assumed to be infix in the following syntax, +and {\small\verb%ath%} and {\small\verb%cth%} are theorems expressing its associativity and +commutativity; they must be of the following form, except that any free +variables may have arbitrary names and may be universally quantified: +{\par\samepage\setseps\small +\begin{verbatim} + ath = |- m _ (n _ p) = (m _ n) _ p + cth = |- m _ n = n _ m +\end{verbatim} +} +\noindent Then the conversion {\small\verb%AC_CONV(ath,cth)%} will prove equations whose +left and right sides can be made identical using these associative and +commutative laws. \FAILURE -Never fails. +Fails if the associative or commutative law has an invalid form, or if the +term is not an equation between AC-equivalent terms. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} + #AC_CONV(ADD_ASSOC,ADD_SYM) + # "x + (SUC t) + ((3 + y) + z) = 3 + (SUC t) + x + y + z";; + |- (x + ((SUC t) + ((3 + y) + z)) = 3 + ((SUC t) + (x + (y + z)))) = T +\end{verbatim} +} + +\COMMENTS +Note that the preproved associative and commutative laws for the operators {\small\verb%+%}, +{\small\verb%*%}, {\small\verb%/\%} and {\small\verb%\/%} are already in the right form to give to {\small\verb%AC_CONV%}. + +\SEEALSO +SYM_CONV. \ENDDOC -\DOC{/} +\DOC{achieve\_first} -\TYPE {\small\verb%$/ : ((int # int) -> int)%}\egroup +\TYPE {\small\verb%achieve_first : (subgoals -> thm -> subgoals)%}\egroup \SYNOPSIS -Performs division on ML integers. +This function is for internal use only and is to be deleted from a future +version of the system. It should not be used. -\FAILURE -Fails on division by zero. +\ENDDOC +\DOC{achieves} + +\TYPE {\small\verb%achieves : (thm -> goal -> bool)%}\egroup + +\SYNOPSIS +This function is for internal use only and is to be deleted from a future +version of the system. It should not be used. \ENDDOC -\DOC{\char'136} +\DOC{aconv} -\TYPE {\small\verb%$^ : (string -> string -> string)%}\egroup +\TYPE {\small\verb%aconv : (term -> term -> bool)%}\egroup \SYNOPSIS -Concatenates two ML strings. +Tests for alpha-convertibility of terms. \DESCRIBE -The {\small\verb%^%} is the ML infix string concatenation operator. -If {\small\verb%s1%} and {\small\verb%s2%} are strings, then {\small\verb%s1^s2%} gives a string which is their -concatenation. +When applied to two terms, {\small\verb%aconv%} returns {\small\verb%true%} if they are +alpha-convertible, and {\small\verb%false%} otherwise. \FAILURE Never fails. \EXAMPLE +A simple case of alpha-convertibility is the renaming of a single quantified +variable: {\par\samepage\setseps\small \begin{verbatim} -#`Hello `^`world`;; -`Hello world` : string + #aconv "?x. x=T" "?y. y=T";; + true : bool \end{verbatim} } -\COMMENTS -The ML role of the {\small\verb%^%} operator should not be confused with its use in -quoted terms to introduce antiquotation (see DESCRIPTION for details). - \SEEALSO -concat, concatl. +ALPHA, ALPHA_CONV. \ENDDOC -\DOC{<} +\DOC{activate\_binders} -\TYPE {\small\verb%$< : ((int # int) -> bool)%}\egroup +\TYPE {\small\verb%activate_binders : (string -> string list)%}\egroup \SYNOPSIS -Performs a less-than test on ML integers. +Makes the quotation parser treat all binders in the current theory segment as +such. + +\DESCRIBE +The call +{\par\samepage\setseps\small +\begin{verbatim} + activate_binders `thy` +\end{verbatim} +} +\noindent where {\small\verb%thy%} is an ancestor theory ({\small\verb%`-`%} stands for the current +theory), will return a list of all binders on that theory, and make the parser +treat them all as binders, that is, for each binder {\small\verb%b%}, will allow the +syntactic sugaring {\small\verb%"b x. y"%} as a shorthand for {\small\verb%"b (\x. y)"%}. The special +syntactic status may be suppressed by preceding {\small\verb%b%} with a dollar sign. The +function returns a list of all the binders dealt with. \FAILURE Never fails. +\COMMENTS +This function is mainly intended for internal use. All binders declared by +{\small\verb%new_binder%} or {\small\verb%new_binder_definition%} are always parsed as such anyway. + +\SEEALSO +activate_all_binders, binders, new_binder, parse_as_binder. + \ENDDOC -\DOC{<<} +\DOC{ADD\_ASSUM} -\TYPE {\small\verb%$<< : ((* # **) -> bool)%}\egroup +\TYPE {\small\verb%ADD_ASSUM : (term -> thm -> thm)%}\egroup \SYNOPSIS -Performs a lexical comparison of values. +Adds an assumption to a theorem. \DESCRIBE -{\small\verb%$<<%} performs a fast ordering on values. It is substitutive with -respect to equality in ML (i.e. if {\small\verb%x << y%} and {\small\verb%x = x'%} and {\small\verb%y = y'%} -then {\small\verb%x' << y'%}). +When applied to a boolean term {\small\verb%s%} and a theorem {\small\verb%A |- t%}, the inference +rule {\small\verb%ADD_ASSUM%} returns the theorem {\small\verb%A u {s} |- t%}. +{\par\samepage\setseps\small +\begin{verbatim} + A |- t + -------------- ADD_ASSUM "s" + A u {s} |- t +\end{verbatim} +} +\noindent {\small\verb%ADD_ASSUM%} performs straightforward set union with the new +assumption; it checks for identical assumptions, but not for alpha-equivalent +ones. The position at which the new assumption is inserted into the assumption +list should not be relied on. \FAILURE -Never fails. - -\USES -It is often useful, for example in normalizing terms in some way, to be able to -impose some arbitrary (but definite) ordering on ML values. +Fails unless the given term has type {\small\verb%bool%}. \SEEALSO -=. +ASSUME, UNDISCH. \ENDDOC -\DOC{=} +\DOC{ADD\_CONV} -\TYPE {\small\verb%$= : ((* # *) -> bool)%}\egroup +\TYPE {\small\verb%ADD_CONV : conv%}\egroup \SYNOPSIS -Performs an equality test on two ML values. +Computes the sum of two natural number constants. \DESCRIBE -{\small\verb%$=%} works as expected on non-function types. It may give unexpected results -when applied to function types (or types containing them, such as a pair of -functions), and should be considered unreliable in those situations. +If {\small\verb%n%} and {\small\verb%m%} are numeral constants (e.g. {\small\verb%0%}, {\small\verb%1%}, {\small\verb%2%}, {\small\verb%3%},...), then +{\small\verb%ADD_CONV "n + m"%} returns the theorem: +{\par\samepage\setseps\small +\begin{verbatim} + |- n + m = s +\end{verbatim} +} +\noindent where {\small\verb%s%} is the numeral that denotes the sum of the natural +numbers denoted by {\small\verb%n%} and {\small\verb%m%}. \FAILURE -Never fails. +{\small\verb%ADD_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"n + m"%}, where {\small\verb%n%} and +{\small\verb%m%} are numerals. \EXAMPLE {\par\samepage\setseps\small \begin{verbatim} -#1 = 2;; -false : bool - -#1 = 1;; -true : bool - -#let f x = x + 1 and g x = x + 2;; -f = - : (int -> int) -g = - : (int -> int) - -#let f' = f and h x = f x and h' x = x + 1;; -f' = - : (int -> int) -h = - : (int -> int) -h' = - : (int -> int) - -#f=f;; -true : bool - -#f = f';; -true : bool - -#f = g;; -false : bool - -#f =h;; -false : bool - -#f=h';; -false : bool - -#h = h';; -false : bool +#ADD_CONV "75 + 25";; +|- 75 + 25 = 100 \end{verbatim} } \ENDDOC -\DOC{>} - -\TYPE {\small\verb%$> : ((int # int) -> bool)%}\egroup - -\SYNOPSIS -Performs a greater-than test on ML integers. - -\FAILURE -Never fails. - -\ENDDOC -\DOC{\char'100} +\DOC{ALL\_CONV} -\TYPE {\small\verb%$@ : ((* list # * list) -> * list)%}\egroup +\TYPE {\small\verb%ALL_CONV : conv%}\egroup \SYNOPSIS -Concatenates two lists. +Conversion that always succeeds and leaves a term unchanged. \DESCRIBE -{\small\verb%@%} is an infix operator which concatenates two lists. +When applied to a term {\small\verb%"t"%}, the conversion {\small\verb%ALL_CONV%} returns the +theorem {\small\verb%|- t = t%}. \FAILURE Never fails. -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#[1;2;3] @ [4;5;6];; -[1; 2; 3; 4; 5; 6] : int list -\end{verbatim} -} +\USES +Identity element for {\small\verb%THENC%}. + \SEEALSO -append. +NO_CONV, REFL. \ENDDOC -\DOC{ABS} +\DOC{ALL\_EL\_CONV} -\TYPE {\small\verb%ABS : (term -> thm -> thm)%}\egroup +\TYPE {\small\verb%ALL_EL_CONV : conv -> conv%}\egroup \SYNOPSIS -Abstracts both sides of an equation. +Computes by inference the result of applying a predicate to elements of a list. \DESCRIBE +{\small\verb%ALL_EL_CONV%} takes a conversion {\small\verb%conv%} and a term {\small\verb%tm%} in the following form: {\par\samepage\setseps\small \begin{verbatim} - A |- t1 = t2 - ------------------------ ABS "x" [Where x is not free in A] - A |- (\x.t1) = (\x.t2) -\end{verbatim} -} -\FAILURE -If the theorem is not an equation, or if the variable {\small\verb%x%} is free in the -assumptions {\small\verb%A%}. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#ABS "m:num" (REFL "m:num");; -|- (\m. m) = (\m. m) + ALL_EL P [x0;...xn] \end{verbatim} } -\SEEALSO -ETA_CONV, EXT, MK_ABS. - -\ENDDOC -\DOC{ABS\_CONV} - -\TYPE {\small\verb%ABS_CONV : (conv -> conv)%}\egroup - -\SYNOPSIS -Applies a conversion to the body of an abstraction. - -\DESCRIBE -If {\small\verb%c%} is a conversion that maps a term {\small\verb%"t"%} to the theorem {\small\verb%|- t = t'%}, then -the conversion {\small\verb%ABS_CONV c%} maps abstractions of the form {\small\verb%"\x.t"%} to theorems -of the form: +\noindent It returns the theorem {\par\samepage\setseps\small \begin{verbatim} - |- (\x.t) = (\x.t') + |- ALL_EL P [x0;...xn] = T \end{verbatim} } -\noindent That is, {\small\verb%ABS_CONV c "\x.t"%} applies {\small\verb%c%} to the body of the -abstraction {\small\verb%"\x.t"%}. - -\FAILURE -{\small\verb%ABS_CONV c tm%} fails if {\small\verb%tm%} is not an abstraction or if {\small\verb%tm%} has the form -{\small\verb%"\x.t"%} but the conversion {\small\verb%c%} fails when applied to the term {\small\verb%t%}. The -function returned by {\small\verb%ABS_CONV c%} may also fail if the ML function -{\small\verb%c:term->thm%} is not, in fact, a conversion (i.e. a function that maps a term -{\small\verb%t%} to a theorem {\small\verb%|- t = t'%}). - -\EXAMPLE +\noindent if for every {\small\verb%xi%} occurred in the list, {\small\verb%conv "P xi"%} returns a theorem {\small\verb%|- P xi = T%}, otherwise, if for at least one {\small\verb%xi%}, evaluating +{\small\verb%conv "P xi"%} returns the theorem {\small\verb%|- P xi = F%}, then it returns the theorem {\par\samepage\setseps\small \begin{verbatim} -#ABS_CONV SYM_CONV "\x. 1 = x";; -|- (\x. 1 = x) = (\x. x = 1) + |- ALL_EL P [x0;...xn] = F \end{verbatim} } -\SEEALSO -RAND_CONV, RATOR_CONV, SUB_CONV. - -\ENDDOC -\DOC{abs\_goals} - -\TYPE {\small\verb%abs_goals : (subgoals list -> goalstack)%}\egroup - -\SYNOPSIS -This function is for internal use only and is to be deleted from a future -version of the system. It should not be used. - -\ENDDOC -\DOC{ACCEPT\_TAC} - -\TYPE {\small\verb%ACCEPT_TAC : thm_tactic%}\egroup - -\SYNOPSIS -Solves a goal if supplied with the desired theorem (up to alpha-conversion). - -\DESCRIBE -{\small\verb%ACCEPT_TAC%} maps a given theorem {\small\verb%th%} to a tactic that solves any goal whose -conclusion is alpha-convertible to the conclusion of {\small\verb%th%}. \FAILURE -{\small\verb%ACCEPT_TAC th (A,g)%} fails if the term {\small\verb%g%} is not alpha-convertible to the -conclusion of the supplied theorem {\small\verb%th%}. +{\small\verb%ALL_EL_CONV conv tm%} fails if {\small\verb%tm%} is not of the form described above, or +failure occurs when evaluating {\small\verb%conv "P xi"%} for some {\small\verb%xi%}. \EXAMPLE -{\small\verb%ACCEPT_TAC%} applied to the axiom +Evaluating {\par\samepage\setseps\small \begin{verbatim} - BOOL_CASES_AX = |- !t. (t = T) \/ (t = F) + ALL_EL_CONV bool_EQ_CONV "ALL_EL ($= T) [T;F;T]";; \end{verbatim} } -\noindent will solve the goal +\noindent returns the following theorem: {\par\samepage\setseps\small \begin{verbatim} - ?- !x. (x = T) \/ (x = F) + |- ALL_EL($= T)[T;F;T] = F \end{verbatim} } -\noindent but will fail on the goal +\noindent In general, if the predicate {\small\verb%P%} is an explicit lambda abstraction +{\small\verb%(\x. P x)%}, the conversion should be in the form {\par\samepage\setseps\small \begin{verbatim} - ?- !x. (x = F) \/ (x = T) + (BETA_CONV THENC conv') \end{verbatim} } -\USES -Used for completing proofs by supplying an existing theorem, such as an axiom, -or a lemma already proved. \SEEALSO -MATCH_ACCEPT_TAC. - -\ENDDOC -\DOC{achieves} - -\TYPE {\small\verb%achieves : (thm -> goal -> bool)%}\egroup - -\SYNOPSIS -This function is for internal use only and is to be deleted from a future -version of the system. It should not be used. +SOME_EL_CONV, IS_EL_CONV, FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV. \ENDDOC -\DOC{achieve\_first} - -\TYPE {\small\verb%achieve_first : (subgoals -> thm -> subgoals)%}\egroup -\SYNOPSIS -This function is for internal use only and is to be deleted from a future -version of the system. It should not be used. - -\ENDDOC -\DOC{aconv} +\DOC{allowed\_constant} -\TYPE {\small\verb%aconv : (term -> term -> bool)%}\egroup +\TYPE {\small\verb%allowed_constant : (string -> bool)%}\egroup \SYNOPSIS -Tests for alpha-convertibility of terms. +Tests if a string has a permissible name for a constant. \DESCRIBE -When applied to two terms, {\small\verb%aconv%} returns {\small\verb%true%} if they are -alpha-convertible, and {\small\verb%false%} otherwise. +When applied to a string, {\small\verb%allowed_constant%} returns {\small\verb%true%} if the string is a +permissible constant name, that is, if it is an identifier (see the DESCRIPTION +for more details), and {\small\verb%false%} otherwise. \FAILURE Never fails. \EXAMPLE -A simple case of alpha-convertibility is the renaming of a single quantified -variable: +The following shows how the lexical rules can be altered: {\par\samepage\setseps\small \begin{verbatim} - #aconv "?x. x=T" "?y. y=T";; - true : bool + #map allowed_constant [`pi`; `@`; `a name`; `+++++`; `*`];; + [true; true; false; false; true] : bool list + + #new_special_symbol `+++++`;; + () : void + + #map allowed_constant [`pi`; `@`; `a name`; `+++++`; `*`];; + [true; true; false; true; true] : bool list \end{verbatim} } +\COMMENTS +Note that this function only performs a lexical test; it does not check whether +there is already a constant of that name in the current theory. + \SEEALSO -ALPHA, ALPHA_CONV. +constants, is_constant, new_alphanum, new_special_symbol, special_symbols. \ENDDOC -\DOC{activate\_binders} +\DOC{ALL\_TAC} -\TYPE {\small\verb%activate_binders : (string -> string list)%}\egroup +\TYPE {\small\verb%ALL_TAC : tactic%}\egroup \SYNOPSIS -Makes the quotation parser treat all binders in the current theory segment as -such. +Passes on a goal unchanged. \DESCRIBE -The call -{\par\samepage\setseps\small -\begin{verbatim} - activate_binders `thy` -\end{verbatim} -} -\noindent where {\small\verb%thy%} is an ancestor theory ({\small\verb%`-`%} stands for the current -theory), will return a list of all binders on that theory, and make the parser -treat them all as binders, that is, for each binder {\small\verb%b%}, will allow the -syntactic sugaring {\small\verb%"b x. y"%} as a shorthand for {\small\verb%"b (\x. y)"%}. The special -syntactic status may be suppressed by preceding {\small\verb%b%} with a dollar sign. The -function returns a list of all the binders dealt with. +{\small\verb%ALL_TAC%} applied to a goal {\small\verb%g%} simply produces the subgoal list {\small\verb%[g]%}. It is +the identity for the {\small\verb%THEN%} tactical. \FAILURE Never fails. -\COMMENTS -This function is mainly intended for internal use. All binders declared by -{\small\verb%new_binder%} or {\small\verb%new_binder_definition%} are always parsed as such anyway. +\EXAMPLE +The tactic {\small\verb%INDUCT_TAC THENL [ALL_TAC;tac]%}, applied to a goal {\small\verb%g%}, applies +{\small\verb%INDUCT_TAC%} to {\small\verb%g%} to give a basis and step subgoal; it then returns the +basis unchanged, along with the subgoals produced by applying {\small\verb%tac%} to the +step. + +\USES +Used to write tacticals such as {\small\verb%REPEAT%}. +Often used as a place-holder in building compound tactics using tacticals +such as {\small\verb%THENL%}. \SEEALSO -activate_all_binders, binders, new_binder, parse_as_binder. +NO_TAC, REPEAT, THENL. \ENDDOC -\DOC{AC\_CONV} +\DOC{ALL\_THEN} -\TYPE {\small\verb%AC_CONV : ((thm # thm) -> conv)%}\egroup +\TYPE {\small\verb%ALL_THEN : thm_tactical%}\egroup \SYNOPSIS -Proves equality of terms using associative and commutative laws. +Passes a theorem unchanged to a theorem-tactic. \DESCRIBE -Suppose {\small\verb%_%} is a function, which is assumed to be infix in the following syntax, -and {\small\verb%ath%} and {\small\verb%cth%} are theorems expressing its associativity and -commutativity; they must be of the following form, except that any free -variables may have arbitrary names and may be universally quantified: -{\par\samepage\setseps\small -\begin{verbatim} - ath = |- m _ (n _ p) = (m _ n) _ p - cth = |- m _ n = n _ m -\end{verbatim} -} -\noindent Then the conversion {\small\verb%AC_CONV(ath,cth)%} will prove equations whose -left and right sides can be made identical using these associative and -commutative laws. +For any theorem-tactic {\small\verb%ttac%} and theorem {\small\verb%th%}, the application {\small\verb%ALL_THEN ttac +th%} results simply in {\small\verb%ttac th%}, that is, the theorem is passed unchanged to +the theorem-tactic. {\small\verb%ALL_THEN%} is the identity theorem-tactical. \FAILURE -Fails if the associative or commutative law has an invalid form, or if the -term is not an equation between AC-equivalent terms. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} - #AC_CONV(ADD_ASSOC,ADD_SYM) - # "x + (SUC t) + ((3 + y) + z) = 3 + (SUC t) + x + y + z";; - |- (x + ((SUC t) + ((3 + y) + z)) = 3 + ((SUC t) + (x + (y + z)))) = T -\end{verbatim} -} +The application of {\small\verb%ALL_THEN%} to a theorem-tactic never fails. The resulting +theorem-tactic fails under exactly the same conditions as the original one -\COMMENTS -Note that the preproved associative and commutative laws for the operators {\small\verb%+%}, -{\small\verb%*%}, {\small\verb%/\%} and {\small\verb%\/%} are already in the right form to give to {\small\verb%AC_CONV%}. +\USES +Writing compound tactics or tacticals, e.g. terminating list iterations +of theorem-tacticals. \SEEALSO -SYM_CONV. +ALL_TAC, FAIL_TAC, NO_TAC, NO_THEN, THEN_TCL, ORELSE_TCL. \ENDDOC -\DOC{ADD\_ASSUM} +\DOC{ALPHA\_CONV} -\TYPE {\small\verb%ADD_ASSUM : (term -> thm -> thm)%}\egroup +\TYPE {\small\verb%ALPHA_CONV : (term -> conv)%}\egroup \SYNOPSIS -Adds an assumption to a theorem. +Renames the bound variable of a lambda-abstraction. \DESCRIBE -When applied to a boolean term {\small\verb%s%} and a theorem {\small\verb%A |- t%}, the inference -rule {\small\verb%ADD_ASSUM%} returns the theorem {\small\verb%A u {s} |- t%}. +If {\small\verb%"x"%} is a variable of type {\small\verb%ty%} and {\small\verb%"\y.t"%} is an abstraction in which +the bound variable {\small\verb%y%} also has type {\small\verb%ty%}, then {\small\verb%ALPHA_CONV "x" "\y.t"%} +returns the theorem: {\par\samepage\setseps\small \begin{verbatim} - A |- t - -------------- ADD_ASSUM "s" - A u {s} |- t + |- (\y.t) = (\x'. t[x'/y]) \end{verbatim} } -\noindent {\small\verb%ADD_ASSUM%} performs straightforward set union with the new -assumption; it checks for identical assumptions, but not for alpha-equivalent -ones. The position at which the new assumption is inserted into the assumption -list should not be relied on. +\noindent where the variable {\small\verb%x':ty%} is a primed variant of {\small\verb%x%} chosen so +as not to be free in {\small\verb%"\y.t"%}. \FAILURE -Fails unless the given term has type {\small\verb%bool%}. +{\small\verb%ALPHA_CONV "x" "tm"%} fails if {\small\verb%x%} is not a variable, if {\small\verb%tm%} is not an +abstraction, or if {\small\verb%x%} is a variable {\small\verb%v%} and {\small\verb%tm%} is a lambda abstraction +{\small\verb%\y.t%} but the types of {\small\verb%v%} and {\small\verb%y%} differ. \SEEALSO -ASSUME, UNDISCH. +ALPHA, GEN_ALPHA_CONV. \ENDDOC -\DOC{ADD\_CONV} +\DOC{ALPHA} -\TYPE {\small\verb%ADD_CONV : conv%}\egroup +\TYPE {\small\verb%ALPHA : (term -> term -> thm)%}\egroup \SYNOPSIS -Computes the sum of two natural number constants. +Proves equality of alpha-equivalent terms. \DESCRIBE -If {\small\verb%n%} and {\small\verb%m%} are numeral constants (e.g. {\small\verb%0%}, {\small\verb%1%}, {\small\verb%2%}, {\small\verb%3%},...), then -{\small\verb%ADD_CONV "n + m"%} returns the theorem: +When applied to a pair of terms {\small\verb%t1%} and {\small\verb%t1'%} which are +alpha-equivalent, {\small\verb%ALPHA%} returns the theorem {\small\verb%|- t1 = t1'%}. {\par\samepage\setseps\small \begin{verbatim} - |- n + m = s + + ------------- ALPHA "t1" "t1'" + |- t1 = t1' \end{verbatim} } -\noindent where {\small\verb%s%} is the numeral that denotes the sum of the natural -numbers denoted by {\small\verb%n%} and {\small\verb%m%}. - \FAILURE -{\small\verb%ADD_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"n + m"%}, where {\small\verb%n%} and -{\small\verb%m%} are numerals. +Fails unless the terms provided are alpha-equivalent. \EXAMPLE {\par\samepage\setseps\small \begin{verbatim} -#ADD_CONV "75 + 25";; -|- 75 + 25 = 100 +#ALPHA "!x:num. x = x" "!y:num. y = y";; +|- (!x. x = x) = (!y. y = y) \end{verbatim} } +\COMMENTS +The system shows the type of {\small\verb%ALPHA%} as {\small\verb%term -> conv%}. + +\SEEALSO +aconv, ALPHA_CONV, GEN_ALPHA_CONV. + \ENDDOC -\DOC{allowed\_constant} +\DOC{ancestors} -\TYPE {\small\verb%allowed_constant : (string -> bool)%}\egroup +\TYPE {\small\verb%ancestors : (string -> string list)%}\egroup \SYNOPSIS -Tests if a string has a permissible name for a constant. +Gets a list of the (proper) ancestors of a theory. \DESCRIBE -When applied to a string, {\small\verb%allowed_constant%} returns {\small\verb%true%} if the string is a -permissible constant name, that is, if it is an identifier (see the DESCRIPTION -for more details), and {\small\verb%false%} otherwise. +A call to {\small\verb%ancestors `th`%} returns a list of all the proper ancestors (i.e. +parents, parents of parents, etc.) of the theory {\small\verb%th%}. \FAILURE -Never fails. - -\EXAMPLE -The following shows how the lexical rules can be altered: -{\par\samepage\setseps\small -\begin{verbatim} - #map allowed_constant [`pi`; `@`; `a name`; `+++++`; `*`];; - [true; true; false; false; true] : bool list - - #new_special_symbol `+++++`;; - () : void - - #map allowed_constant [`pi`; `@`; `a name`; `+++++`; `*`];; - [true; true; false; true; true] : bool list -\end{verbatim} -} -\COMMENTS -Note that this function only performs a lexical test; it does not check whether -there is already a constant of that name in the current theory. +Fails if `th` is not an ancestor of the current theory. \SEEALSO -constants, is_constant, new_alphanum, new_special_symbol, special_symbols. +ancestry, parents. \ENDDOC -\DOC{ALL\_CONV} +\DOC{ancestry} -\TYPE {\small\verb%ALL_CONV : conv%}\egroup +\TYPE {\small\verb%ancestry : (void -> string list)%}\egroup \SYNOPSIS -Conversion that always succeeds and leaves a term unchanged. +Gets a list of the ancestors of the current theory. \DESCRIBE -When applied to a term {\small\verb%"t"%}, the conversion {\small\verb%ALL_CONV%} returns the -theorem {\small\verb%|- t = t%}. +A call {\small\verb%ancestry()%} returns a list of all the ancestors of the current theory, +i.e. the current theory itself, its parents, parents of parents, etc. \FAILURE Never fails. -\USES -Identity element for {\small\verb%THENC%}. +\COMMENTS +The call {\small\verb%ancestry()%} is considerably more efficient than {\small\verb%ancestors `-`%}. \SEEALSO -NO_CONV, REFL. +ancestors, parents. \ENDDOC -\DOC{ALL\_EL\_CONV} +\DOC{AND\_EXISTS\_CONV} -\TYPE {\small\verb%ALL_EL_CONV : conv -> conv%}\egroup +\TYPE {\small\verb%AND_EXISTS_CONV : conv%}\egroup \SYNOPSIS -Computes by inference the result of applying a predicate to elements of a list. +Moves an existential quantification outwards through a conjunction. \DESCRIBE -{\small\verb%ALL_EL_CONV%} takes a conversion {\small\verb%conv%} and a term {\small\verb%tm%} in the following form: +When applied to a term of the form {\small\verb%(?x.P) /\ (?x.Q)%}, where {\small\verb%x%} is free +in neither {\small\verb%P%} nor {\small\verb%Q%}, {\small\verb%AND_EXISTS_CONV%} returns the theorem: {\par\samepage\setseps\small \begin{verbatim} - ALL_EL P [x0;...xn] + |- (?x. P) /\ (?x. Q) = (?x. P /\ Q) \end{verbatim} } -\noindent It returns the theorem +\FAILURE +{\small\verb%AND_EXISTS_CONV%} fails if it is applied to a term not of the form +{\small\verb%(?x.P) /\ (?x.Q)%}, or if it is applied to a term {\small\verb%(?x.P) /\ (?x.Q)%} +in which the variable {\small\verb%x%} is free in either {\small\verb%P%} or {\small\verb%Q%}. + +\SEEALSO +EXISTS_AND_CONV, LEFT_AND_EXISTS_CONV, RIGHT_AND_EXISTS_CONV. + +\ENDDOC +\DOC{AND\_FORALL\_CONV} + +\TYPE {\small\verb%AND_FORALL_CONV : conv%}\egroup + +\SYNOPSIS +Moves a universal quantification outwards through a conjunction. + +\DESCRIBE +When applied to a term of the form {\small\verb%(!x.P) /\ (!x.Q)%}, the conversion +{\small\verb%AND_FORALL_CONV%} returns the theorem: {\par\samepage\setseps\small \begin{verbatim} - |- ALL_EL P [x0;...xn] = T + |- (!x.P) /\ (!x.Q) = (!x. P /\ Q) \end{verbatim} } -\noindent if for every {\small\verb%xi%} occurred in the list, {\small\verb%conv "P xi"%} returns a theorem {\small\verb%|- P xi = T%}, otherwise, if for at least one {\small\verb%xi%}, evaluating -{\small\verb%conv "P xi"%} returns the theorem {\small\verb%|- P xi = F%}, then it returns the theorem +\FAILURE +Fails if applied to a term not of the form {\small\verb%(!x.P) /\ (!x.Q)%}. + +\SEEALSO +FORALL_AND_CONV, LEFT_AND_FORALL_CONV, RIGHT_AND_FORALL_CONV. + +\ENDDOC +\DOC{ANTE\_CONJ\_CONV} + +\TYPE {\small\verb%ANTE_CONJ_CONV : conv%}\egroup + +\SYNOPSIS +Eliminates a conjunctive antecedent in favour of implication. + +\DESCRIBE +When applied to a term of the form {\small\verb%"(t1 /\ t2) ==> t"%}, the conversion +{\small\verb%ANTE_CONJ_CONV%} returns the theorem: {\par\samepage\setseps\small \begin{verbatim} - |- ALL_EL P [x0;...xn] = F + |- (t1 /\ t2 ==> t) = (t1 ==> t2 ==> t) \end{verbatim} } - \FAILURE -{\small\verb%ALL_EL_CONV conv tm%} fails if {\small\verb%tm%} is not of the form described above, or -failure occurs when evaluating {\small\verb%conv "P xi"%} for some {\small\verb%xi%}. +Fails if applied to a term not of the form {\small\verb%"(t1 /\ t2) ==> t"%}. -\EXAMPLE -Evaluating +\USES +Somewhat ad-hoc, but can be used (with {\small\verb%CONV_TAC%}) to transform a goal of the +form {\small\verb%?- (P /\ Q) ==> R%} into the subgoal {\small\verb%?- P ==> (Q ==> R)%}, so that only +the antecedent {\small\verb%P%} is moved into the assumptions by {\small\verb%DISCH_TAC%}. + +\ENDDOC +\DOC{ANTE\_RES\_THEN} + +\TYPE {\small\verb%ANTE_RES_THEN : thm_tactical%}\egroup + +\SYNOPSIS +Resolves implicative assumptions with an antecedent. + +\DESCRIBE +Given a theorem-tactic {\small\verb%ttac%} and a theorem {\small\verb%A |- t%}, the function +{\small\verb%ANTE_RES_THEN%} produces a tactic that attempts to match {\small\verb%t%} to the antecedent +of each implication {\par\samepage\setseps\small \begin{verbatim} - ALL_EL_CONV bool_EQ_CONV "ALL_EL ($= T) [T;F;T]";; + Ai |- !x1...xn. ui ==> vi \end{verbatim} } -\noindent returns the following theorem: +\noindent (where {\small\verb%Ai%} is just {\small\verb%!x1...xn. ui ==> vi%}) that occurs among the +assumptions of a goal. If the antecedent {\small\verb%ui%} of any implication matches {\small\verb%t%}, +then an instance of {\small\verb%Ai u A |- vi%} is obtained by specialization of the +variables {\small\verb%x1%}, ..., {\small\verb%xn%} and type instantiation, followed by an application of +modus ponens. Because all implicative assumptions are tried, this may result +in several modus-ponens consequences of the supplied theorem and the +assumptions. Tactics are produced using {\small\verb%ttac%} from all these theorems, and +these tactics are applied in sequence to the goal. That is, {\par\samepage\setseps\small \begin{verbatim} - |- ALL_EL($= T)[T;F;T] = F + ANTE_RES_THEN ttac (A |- t) g \end{verbatim} } -\noindent In general, if the predicate {\small\verb%P%} is an explicit lambda abstraction -{\small\verb%(\x. P x)%}, the conversion should be in the form +\noindent has the effect of: {\par\samepage\setseps\small \begin{verbatim} - (BETA_CONV THENC conv') + MAP_EVERY ttac [A1 u A |- v1; ...; Am u A |- vm] g \end{verbatim} } - -\SEEALSO -SOME_EL_CONV, IS_EL_CONV, FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV. - -\ENDDOC - -\DOC{ALL\_TAC} - -\TYPE {\small\verb%ALL_TAC : tactic%}\egroup - -\SYNOPSIS -Passes on a goal unchanged. - -\DESCRIBE -{\small\verb%ALL_TAC%} applied to a goal {\small\verb%g%} simply produces the subgoal list {\small\verb%[g]%}. It is -the identity for the {\small\verb%THEN%} tactical. - -\FAILURE -Never fails. - -\EXAMPLE -The tactic {\small\verb%INDUCT_TAC THENL [ALL_TAC;tac]%}, applied to a goal {\small\verb%g%}, applies -{\small\verb%INDUCT_TAC%} to {\small\verb%g%} to give a basis and step subgoal; it then returns the -basis unchanged, along with the subgoals produced by applying {\small\verb%tac%} to the -step. - -\USES -Used to write tacticals such as {\small\verb%REPEAT%}. -Often used as a place-holder in building compound tactics using tacticals -such as {\small\verb%THENL%}. - -\SEEALSO -NO_TAC, REPEAT, THENL. - -\ENDDOC -\DOC{ALL\_THEN} - -\TYPE {\small\verb%ALL_THEN : thm_tactical%}\egroup - -\SYNOPSIS -Passes a theorem unchanged to a theorem-tactic. - -\DESCRIBE -For any theorem-tactic {\small\verb%ttac%} and theorem {\small\verb%th%}, the application {\small\verb%ALL_THEN ttac -th%} results simply in {\small\verb%ttac th%}, that is, the theorem is passed unchanged to -the theorem-tactic. {\small\verb%ALL_THEN%} is the identity theorem-tactical. +\noindent where the theorems {\small\verb%Ai u A |- vi%} are all the consequences that can +be drawn by a (single) matching modus-ponens inference from the implications +that occur among the assumptions of the goal {\small\verb%g%} and the supplied theorem +{\small\verb%A |- t%}. Any negation {\small\verb%~v%} that appears among the assumptions of the goal is +treated as an implication {\small\verb%v ==> F%}. The sequence in which the theorems +{\small\verb%Ai u A |- vi%} are generated and the corresponding tactics applied is +unspecified. \FAILURE -The application of {\small\verb%ALL_THEN%} to a theorem-tactic never fails. The resulting -theorem-tactic fails under exactly the same conditions as the original one - -\USES -Writing compound tactics or tacticals, e.g. terminating list iterations -of theorem-tacticals. +{\small\verb%ANTE_RES_THEN ttac (A |- t)%} fails when applied to a goal {\small\verb%g%} if any of the +tactics produced by {\small\verb%ttac (Ai u A |- vi)%}, where {\small\verb%Ai u A |- vi%} is the {\small\verb%i%}th +resolvent obtained from the theorem {\small\verb%A |- t%} and the assumptions of {\small\verb%g%}, fails +when applied in sequence to {\small\verb%g%}. \SEEALSO -ALL_TAC, FAIL_TAC, NO_TAC, NO_THEN, THEN_TCL, ORELSE_TCL. +IMP_RES_TAC, IMP_RES_THEN, MATCH_MP, RES_TAC, RES_THEN. \ENDDOC -\DOC{ALPHA} +\DOC{APPEND\_CONV} -\TYPE {\small\verb%ALPHA : (term -> term -> thm)%}\egroup +\TYPE {\small\verb%APPEND_CONV : conv%}\egroup \SYNOPSIS -Proves equality of alpha-equivalent terms. +Computes by inference the result of appending two object-language lists. \DESCRIBE -When applied to a pair of terms {\small\verb%t1%} and {\small\verb%t1'%} which are -alpha-equivalent, {\small\verb%ALPHA%} returns the theorem {\small\verb%|- t1 = t1'%}. +For any pair of object language lists of the form {\small\verb%"[x1;...;xn]"%} and +{\small\verb%"[y1;...;ym]"%}, the result of evaluating {\par\samepage\setseps\small \begin{verbatim} - - ------------- ALPHA "t1" "t1'" - |- t1 = t1' + APPEND_CONV "APPEND [x1;...;xn] [y1;...;ym]" \end{verbatim} } -\FAILURE -Fails unless the terms provided are alpha-equivalent. - -\EXAMPLE +\noindent is the theorem {\par\samepage\setseps\small \begin{verbatim} -#ALPHA "!x:num. x = x" "!y:num. y = y";; -|- (!x. x = x) = (!y. y = y) + |- APPEND [x1;...;xn] [y1;...;ym] = [x1;...;xn;y1;...;ym] \end{verbatim} } -\COMMENTS -The system shows the type of {\small\verb%ALPHA%} as {\small\verb%term -> conv%}. +\noindent The length of either list (or both) may be 0. -\SEEALSO -aconv, ALPHA_CONV, GEN_ALPHA_CONV. +\FAILURE +{\small\verb%APPEND_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"APPEND l1 l2"%}, where +{\small\verb%l1%} and {\small\verb%l2%} are (possibly empty) object-language lists of the forms +{\small\verb%"[x1;...;xn]"%} and {\small\verb%"[y1;...;ym]"%}. \ENDDOC -\DOC{ALPHA\_CONV} -\TYPE {\small\verb%ALPHA_CONV : (term -> conv)%}\egroup +\DOC{append} + +\TYPE {\small\verb%append : (* list -> * list -> * list)%}\egroup \SYNOPSIS -Renames the bound variable of a lambda-abstraction. +Concatenates two lists. \DESCRIBE -If {\small\verb%"x"%} is a variable of type {\small\verb%ty%} and {\small\verb%"\y.t"%} is an abstraction in which -the bound variable {\small\verb%y%} also has type {\small\verb%ty%}, then {\small\verb%ALPHA_CONV "x" "\y.t"%} -returns the theorem: -{\par\samepage\setseps\small -\begin{verbatim} - |- (\y.t) = (\x'. t[x'/y]) -\end{verbatim} -} -\noindent where the variable {\small\verb%x':ty%} is a primed variant of {\small\verb%x%} chosen so -as not to be free in {\small\verb%"\y.t"%}. +{\small\verb%append [x1;...;xn] [y1;...;ym]%} returns {\small\verb%[x1;...;xn;y1;...;ym]%}. \FAILURE -{\small\verb%ALPHA_CONV "x" "tm"%} fails if {\small\verb%x%} is not a variable, if {\small\verb%tm%} is not an -abstraction, or if {\small\verb%x%} is a variable {\small\verb%v%} and {\small\verb%tm%} is a lambda abstraction -{\small\verb%\y.t%} but the types of {\small\verb%v%} and {\small\verb%y%} differ. +Never fails. -\SEEALSO -ALPHA, GEN_ALPHA_CONV. +\COMMENTS +Performs the same operation as {\small\verb%$@%}. \ENDDOC -\DOC{ancestors} +\DOC{append\_openw} -\TYPE {\small\verb%ancestors : (string -> string list)%}\egroup +\TYPE {\small\verb%append_openw : (string -> string)%}\egroup \SYNOPSIS -Gets a list of the (proper) ancestors of a theory. +Opens a port for appending to a named file. \DESCRIBE -A call to {\small\verb%ancestors `th`%} returns a list of all the proper ancestors (i.e. -parents, parents of parents, etc.) of the theory {\small\verb%th%}. - -\FAILURE -Fails if `th` is not an ancestor of the current theory. +When applied to a filename {\small\verb%`name`%}, the function {\small\verb%append_openw%} opens the file +{\small\verb%name%} for writing, such that existing contents are appended to rather than +overwritten. It returns a port descriptor string, which can be used by {\small\verb%write%} +to append to the file, and by {\small\verb%close%} to close it. -\SEEALSO -ancestry, parents. +\EXAMPLE +The following example assumes that HOL is being run under Unix. It will +overwrite an existing file {\small\verb%test-file%} in the current directory. +{\par\samepage\setseps\small +\begin{verbatim} + #system `echo -n 'Hello ' >test-file`;; + 0 : int -\ENDDOC -\DOC{ancestry} + #let port = append_openw `test-file`;; + port = `%test-file` : string -\TYPE {\small\verb%ancestry : (void -> string list)%}\egroup + #write(port,`world`);; + () : void -\SYNOPSIS -Gets a list of the ancestors of the current theory. + #close port;; + () : void -\DESCRIBE -A call {\small\verb%ancestry()%} returns a list of all the ancestors of the current theory, -i.e. the current theory itself, its parents, parents of parents, etc. + #system `cat test-file`;; + Hello world0 : int +\end{verbatim} +} +\SEEALSO +close, openi, openw, read, write. -\FAILURE -Never fails. +\ENDDOC +\DOC{apply\_proof} -\COMMENTS -The call {\small\verb%ancestry()%} is considerably more efficient than {\small\verb%ancestors `-`%}. +\TYPE {\small\verb%apply_proof : (subgoals -> thm)%}\egroup -\SEEALSO -ancestors, parents. +\SYNOPSIS +This function is for internal use only and is to be deleted from a future +version of the system. It should not be used. \ENDDOC -\DOC{AND\_EXISTS\_CONV} +\DOC{AP\_TERM} -\TYPE {\small\verb%AND_EXISTS_CONV : conv%}\egroup +\TYPE {\small\verb%AP_TERM : (term -> thm -> thm)%}\egroup \SYNOPSIS -Moves an existential quantification outwards through a conjunction. +Applies a function to both sides of an equational theorem. \DESCRIBE -When applied to a term of the form {\small\verb%(?x.P) /\ (?x.Q)%}, where {\small\verb%x%} is free -in neither {\small\verb%P%} nor {\small\verb%Q%}, {\small\verb%AND_EXISTS_CONV%} returns the theorem: +When applied to a term {\small\verb%f%} and a theorem {\small\verb%A |- x = y%}, the +inference rule {\small\verb%AP_TERM%} returns the theorem {\small\verb%A |- f x = f y%}. {\par\samepage\setseps\small \begin{verbatim} - |- (?x. P) /\ (?x. Q) = (?x. P /\ Q) + A |- x = y + ---------------- AP_TERM "f" + A |- f x = f y \end{verbatim} } \FAILURE -{\small\verb%AND_EXISTS_CONV%} fails if it is applied to a term not of the form -{\small\verb%(?x.P) /\ (?x.Q)%}, or if it is applied to a term {\small\verb%(?x.P) /\ (?x.Q)%} -in which the variable {\small\verb%x%} is free in either {\small\verb%P%} or {\small\verb%Q%}. +Fails unless the theorem is equational and the supplied term is a function +whose domain type is the same as the type of both sides of the equation. \SEEALSO -EXISTS_AND_CONV, LEFT_AND_EXISTS_CONV, RIGHT_AND_EXISTS_CONV. +AP_THM, MK_COMB. \ENDDOC -\DOC{AND\_FORALL\_CONV} +\DOC{AP\_TERM\_TAC} -\TYPE {\small\verb%AND_FORALL_CONV : conv%}\egroup +\TYPE {\small\verb%AP_TERM_TAC : tactic%}\egroup \SYNOPSIS -Moves a universal quantification outwards through a conjunction. +Strips a function application from both sides of an equational goal. \DESCRIBE -When applied to a term of the form {\small\verb%(!x.P) /\ (!x.Q)%}, the conversion -{\small\verb%AND_FORALL_CONV%} returns the theorem: +{\small\verb%AP_TERM_TAC%} reduces a goal of the form {\small\verb%A ?- f x = f y%} by stripping away +the function applications, giving the new goal {\small\verb%A ?- x = y%}. {\par\samepage\setseps\small \begin{verbatim} - |- (!x.P) /\ (!x.Q) = (!x. P /\ Q) + A ?- f x = f y + ================ AP_TERM_TAC + A ?- x = y \end{verbatim} } \FAILURE -Fails if applied to a term not of the form {\small\verb%(!x.P) /\ (!x.Q)%}. +Fails unless the goal is equational, with both sides being applications +of the same function. \SEEALSO -FORALL_AND_CONV, LEFT_AND_FORALL_CONV, RIGHT_AND_FORALL_CONV. +AP_TERM, AP_THM. \ENDDOC -\DOC{ANTE\_CONJ\_CONV} +\DOC{AP\_THM} -\TYPE {\small\verb%ANTE_CONJ_CONV : conv%}\egroup +\TYPE {\small\verb%AP_THM : (thm -> term -> thm)%}\egroup \SYNOPSIS -Eliminates a conjunctive antecedent in favour of implication. +Proves equality of equal functions applied to a term. \DESCRIBE -When applied to a term of the form {\small\verb%"(t1 /\ t2) ==> t"%}, the conversion -{\small\verb%ANTE_CONJ_CONV%} returns the theorem: +When applied to a theorem {\small\verb%A |- f = g%} and a term {\small\verb%x%}, the inference +rule {\small\verb%AP_THM%} returns the theorem {\small\verb%A |- f x = g x%}. {\par\samepage\setseps\small \begin{verbatim} - |- (t1 /\ t2 ==> t) = (t1 ==> t2 ==> t) + A |- f = g + ---------------- AP_THM (A |- f = g) "x" + A |- f x = g x \end{verbatim} } \FAILURE -Fails if applied to a term not of the form {\small\verb%"(t1 /\ t2) ==> t"%}. +Fails unless the conclusion of the theorem is an equation, both sides +of which are functions whose domain type is the same as that of the +supplied term. -\USES -Somewhat ad-hoc, but can be used (with {\small\verb%CONV_TAC%}) to transform a goal of the -form {\small\verb%?- (P /\ Q) ==> R%} into the subgoal {\small\verb%?- P ==> (Q ==> R)%}, so that only -the antecedent {\small\verb%P%} is moved into the assumptions by {\small\verb%DISCH_TAC%}. +\COMMENTS +The type of {\small\verb%AP_THM%} is shown by the system as {\small\verb%thm -> conv%}. + +\SEEALSO +AP_TERM, ETA_CONV, EXT, MK_COMB. \ENDDOC -\DOC{ANTE\_RES\_THEN} +\DOC{AP\_THM\_TAC} -\TYPE {\small\verb%ANTE_RES_THEN : thm_tactical%}\egroup +\TYPE {\small\verb%AP_THM_TAC : tactic%}\egroup \SYNOPSIS -Resolves implicative assumptions with an antecedent. +Strips identical operands from functions on both sides of an equation. \DESCRIBE -Given a theorem-tactic {\small\verb%ttac%} and a theorem {\small\verb%A |- t%}, the function -{\small\verb%ANTE_RES_THEN%} produces a tactic that attempts to match {\small\verb%t%} to the antecedent -of each implication +When applied to a goal of the form {\small\verb%A ?- f x = g x%}, the tactic {\small\verb%AP_THM_TAC%} +strips away the operands of the function application: {\par\samepage\setseps\small \begin{verbatim} - Ai |- !x1...xn. ui ==> vi -\end{verbatim} -} -\noindent (where {\small\verb%Ai%} is just {\small\verb%!x1...xn. ui ==> vi%}) that occurs among the -assumptions of a goal. If the antecedent {\small\verb%ui%} of any implication matches {\small\verb%t%}, -then an instance of {\small\verb%Ai u A |- vi%} is obtained by specialization of the -variables {\small\verb%x1%}, ..., {\small\verb%xn%} and type instantiation, followed by an application of -modus ponens. Because all implicative assumptions are tried, this may result -in several modus-ponens consequences of the supplied theorem and the -assumptions. Tactics are produced using {\small\verb%ttac%} from all these theorems, and -these tactics are applied in sequence to the goal. That is, -{\par\samepage\setseps\small -\begin{verbatim} - ANTE_RES_THEN ttac (A |- t) g -\end{verbatim} -} -\noindent has the effect of: -{\par\samepage\setseps\small -\begin{verbatim} - MAP_EVERY ttac [A1 u A |- v1; ...; Am u A |- vm] g -\end{verbatim} -} -\noindent where the theorems {\small\verb%Ai u A |- vi%} are all the consequences that can -be drawn by a (single) matching modus-ponens inference from the implications -that occur among the assumptions of the goal {\small\verb%g%} and the supplied theorem -{\small\verb%A |- t%}. Any negation {\small\verb%~v%} that appears among the assumptions of the goal is -treated as an implication {\small\verb%v ==> F%}. The sequence in which the theorems -{\small\verb%Ai u A |- vi%} are generated and the corresponding tactics applied is -unspecified. - -\FAILURE -{\small\verb%ANTE_RES_THEN ttac (A |- t)%} fails when applied to a goal {\small\verb%g%} if any of the -tactics produced by {\small\verb%ttac (Ai u A |- vi)%}, where {\small\verb%Ai u A |- vi%} is the {\small\verb%i%}th -resolvent obtained from the theorem {\small\verb%A |- t%} and the assumptions of {\small\verb%g%}, fails -when applied in sequence to {\small\verb%g%}. - -\SEEALSO -IMP_RES_TAC, IMP_RES_THEN, MATCH_MP, RES_TAC, RES_THEN. - -\ENDDOC -\DOC{append} - -\TYPE {\small\verb%append : (* list -> * list -> * list)%}\egroup - -\SYNOPSIS -Concatenates two lists. - -\DESCRIBE -{\small\verb%append [x1;...;xn] [y1;...;ym]%} returns {\small\verb%[x1;...;xn;y1;...;ym]%}. - -\FAILURE -Never fails. - -\COMMENTS -Performs the same operation as {\small\verb%$@%}. - -\ENDDOC -\DOC{APPEND\_CONV} - -\TYPE {\small\verb%APPEND_CONV : conv%}\egroup - -\SYNOPSIS -Computes by inference the result of appending two object-language lists. - -\DESCRIBE -For any pair of object language lists of the form {\small\verb%"[x1;...;xn]"%} and -{\small\verb%"[y1;...;ym]"%}, the result of evaluating -{\par\samepage\setseps\small -\begin{verbatim} - APPEND_CONV "APPEND [x1;...;xn] [y1;...;ym]" -\end{verbatim} -} -\noindent is the theorem -{\par\samepage\setseps\small -\begin{verbatim} - |- APPEND [x1;...;xn] [y1;...;ym] = [x1;...;xn;y1;...;ym] -\end{verbatim} -} -\noindent The length of either list (or both) may be 0. - -\FAILURE -{\small\verb%APPEND_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"APPEND l1 l2"%}, where -{\small\verb%l1%} and {\small\verb%l2%} are (possibly empty) object-language lists of the forms -{\small\verb%"[x1;...;xn]"%} and {\small\verb%"[y1;...;ym]"%}. - -\ENDDOC - -\DOC{append\_openw} - -\TYPE {\small\verb%append_openw : (string -> string)%}\egroup - -\SYNOPSIS -Opens a port for appending to a named file. - -\DESCRIBE -When applied to a filename {\small\verb%`name`%}, the function {\small\verb%append_openw%} opens the file -{\small\verb%name%} for writing, such that existing contents are appended to rather than -overwritten. It returns a port descriptor string, which can be used by {\small\verb%write%} -to append to the file, and by {\small\verb%close%} to close it. - -\EXAMPLE -The following example assumes that HOL is being run under Unix. It will -overwrite an existing file {\small\verb%test-file%} in the current directory. -{\par\samepage\setseps\small -\begin{verbatim} - #system `echo -n 'Hello ' >test-file`;; - 0 : int - - #let port = append_openw `test-file`;; - port = `%test-file` : string - - #write(port,`world`);; - () : void - - #close port;; - () : void - - #system `cat test-file`;; - Hello world0 : int -\end{verbatim} -} -\SEEALSO -close, openi, openw, read, write. - -\ENDDOC -\DOC{apply\_proof} - -\TYPE {\small\verb%apply_proof : (subgoals -> thm)%}\egroup - -\SYNOPSIS -This function is for internal use only and is to be deleted from a future -version of the system. It should not be used. - -\ENDDOC -\DOC{AP\_TERM} - -\TYPE {\small\verb%AP_TERM : (term -> thm -> thm)%}\egroup - -\SYNOPSIS -Applies a function to both sides of an equational theorem. - -\DESCRIBE -When applied to a term {\small\verb%f%} and a theorem {\small\verb%A |- x = y%}, the -inference rule {\small\verb%AP_TERM%} returns the theorem {\small\verb%A |- f x = f y%}. -{\par\samepage\setseps\small -\begin{verbatim} - A |- x = y - ---------------- AP_TERM "f" - A |- f x = f y -\end{verbatim} -} -\FAILURE -Fails unless the theorem is equational and the supplied term is a function -whose domain type is the same as the type of both sides of the equation. - -\SEEALSO -AP_THM, MK_COMB. - -\ENDDOC -\DOC{AP\_TERM\_TAC} - -\TYPE {\small\verb%AP_TERM_TAC : tactic%}\egroup - -\SYNOPSIS -Strips a function application from both sides of an equational goal. - -\DESCRIBE -{\small\verb%AP_TERM_TAC%} reduces a goal of the form {\small\verb%A ?- f x = f y%} by stripping away -the function applications, giving the new goal {\small\verb%A ?- x = y%}. -{\par\samepage\setseps\small -\begin{verbatim} - A ?- f x = f y - ================ AP_TERM_TAC - A ?- x = y -\end{verbatim} -} -\FAILURE -Fails unless the goal is equational, with both sides being applications -of the same function. - -\SEEALSO -AP_TERM, AP_THM. - -\ENDDOC -\DOC{AP\_THM} - -\TYPE {\small\verb%AP_THM : (thm -> term -> thm)%}\egroup - -\SYNOPSIS -Proves equality of equal functions applied to a term. - -\DESCRIBE -When applied to a theorem {\small\verb%A |- f = g%} and a term {\small\verb%x%}, the inference -rule {\small\verb%AP_THM%} returns the theorem {\small\verb%A |- f x = g x%}. -{\par\samepage\setseps\small -\begin{verbatim} - A |- f = g - ---------------- AP_THM (A |- f = g) "x" - A |- f x = g x -\end{verbatim} -} -\FAILURE -Fails unless the conclusion of the theorem is an equation, both sides -of which are functions whose domain type is the same as that of the -supplied term. - -\COMMENTS -The type of {\small\verb%AP_THM%} is shown by the system as {\small\verb%thm -> conv%}. - -\SEEALSO -AP_TERM, ETA_CONV, EXT, MK_COMB. - -\ENDDOC -\DOC{AP\_THM\_TAC} - -\TYPE {\small\verb%AP_THM_TAC : tactic%}\egroup - -\SYNOPSIS -Strips identical operands from functions on both sides of an equation. - -\DESCRIBE -When applied to a goal of the form {\small\verb%A ?- f x = g x%}, the tactic {\small\verb%AP_THM_TAC%} -strips away the operands of the function application: -{\par\samepage\setseps\small -\begin{verbatim} - A ?- f x = g x - ================ AP_THM_TAC - A ?- f = g + A ?- f x = g x + ================ AP_THM_TAC + A ?- f = g \end{verbatim} } \FAILURE @@ -1149,41 +917,41 @@ can be 0), and otherwise fails. is_type. \ENDDOC -\DOC{ascii} +\DOC{ascii\_code} -\TYPE {\small\verb%ascii : (int -> string)%}\egroup +\TYPE {\small\verb%ascii_code : (string -> int)%}\egroup \SYNOPSIS -Maps an integer to the corresponding ASCII character. +Maps a character to corresponding ASCII numeric code. \DESCRIBE -When given an integer, {\small\verb%ascii%} returns a string consisting of -the single character corresponding to that integer under the ASCII -encoding. +When given a string, {\small\verb%ascii_code%} returns the numeric encoding in the +ASCII character set of the first character of that string. \FAILURE -Fails unless the integer supplied is in the range {\small\verb%0 <= x < 128%}. +Fails if the string is empty ({\small\verb%``%}). \SEEALSO -ascii_code, int_of_string, is_alphanum, is_letter, string_of_int. +ascii, int_of_string, is_alphanum, is_letter, string_of_int. \ENDDOC -\DOC{ascii\_code} +\DOC{ascii} -\TYPE {\small\verb%ascii_code : (string -> int)%}\egroup +\TYPE {\small\verb%ascii : (int -> string)%}\egroup \SYNOPSIS -Maps a character to corresponding ASCII numeric code. +Maps an integer to the corresponding ASCII character. \DESCRIBE -When given a string, {\small\verb%ascii_code%} returns the numeric encoding in the -ASCII character set of the first character of that string. +When given an integer, {\small\verb%ascii%} returns a string consisting of +the single character corresponding to that integer under the ASCII +encoding. \FAILURE -Fails if the string is empty ({\small\verb%``%}). +Fails unless the integer supplied is in the range {\small\verb%0 <= x < 128%}. \SEEALSO -ascii, int_of_string, is_alphanum, is_letter, string_of_int. +ascii_code, int_of_string, is_alphanum, is_letter, string_of_int. \ENDDOC \DOC{ASM\_CASES\_TAC} @@ -1813,41 +1581,6 @@ of the current theory. It will fail if t axioms, definition, load_axiom, load_axioms, new_axiom, print_theory, theorem. \ENDDOC -\DOC{axioms} - -\TYPE {\small\verb%axioms : (string -> (string # thm) list)%}\egroup - -\SYNOPSIS -Returns the axioms of a given theory segment of the current theory. - -\DESCRIBE -A call {\small\verb%axioms `thy`%} returns the axioms of the theory segment {\small\verb%thy%} together -with their names. The theory segment {\small\verb%thy%} must be part of the current theory. -The names are those given to the axioms by the user when they were originally -added to the theory segment (by a call to {\small\verb%new_axiom%}). The name of the current -theory segment can be abbreviated by {\small\verb%`-`%}. - -\FAILURE -The call {\small\verb%axioms `thy`%} will fail if the theory segment {\small\verb%thy%} is not -part of the current theory. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#axioms `bool`;; -[(`SELECT_AX`, |- !P x. P x ==> P($@ P)); - (`ETA_AX`, |- !t. (\x. t x) = t); - (`IMP_ANTISYM_AX`, - |- !t1 t2. (t1 ==> t2) ==> (t2 ==> t1) ==> (t1 = t2)); - (`BOOL_CASES_AX`, |- !t. (t = T) \/ (t = F)); - (`ARB_THM`, |- $= = $=)] -: (string # thm) list -\end{verbatim} -} -\SEEALSO -axiom, definitions, load_axiom, load_axioms, new_axiom, print_theory, theorems. - -\ENDDOC \DOC{axiom\_lfn} \TYPE {\small\verb%axiom_lfn : (string list -> thm)%}\egroup @@ -1922,41 +1655,39 @@ autoload, autoload_theory, axiom, axioms undo_autoload. \ENDDOC -\DOC{B} - -\TYPE {\small\verb%B : ((* -> **) -> (*** -> *) -> *** -> **)%}\egroup - -\SYNOPSIS -Performs curried function-composition: {\small\verb%B f g x%} = {\small\verb%f (g x)%}. - -\FAILURE -Never fails. - -\SEEALSO -\#, C, CB, Co, I, K, KI, o, oo, S, W. - -\ENDDOC -\DOC{b} +\DOC{axioms} -\TYPE {\small\verb%b : (void -> void)%}\egroup +\TYPE {\small\verb%axioms : (string -> (string # thm) list)%}\egroup \SYNOPSIS -Restores the proof state undoing the effects of a previous expansion. +Returns the axioms of a given theory segment of the current theory. \DESCRIBE -The function {\small\verb%b%} is part of the subgoal package. It is an abbreviation for the -function {\small\verb%backup%}. For a description of the subgoal package, see -{\small\verb%set_goal%}. +A call {\small\verb%axioms `thy`%} returns the axioms of the theory segment {\small\verb%thy%} together +with their names. The theory segment {\small\verb%thy%} must be part of the current theory. +The names are those given to the axioms by the user when they were originally +added to the theory segment (by a call to {\small\verb%new_axiom%}). The name of the current +theory segment can be abbreviated by {\small\verb%`-`%}. \FAILURE -As for {\small\verb%backup%}. - -\USES -Back tracking in a goal-directed proof to undo errors or try different tactics. +The call {\small\verb%axioms `thy`%} will fail if the theory segment {\small\verb%thy%} is not +part of the current theory. +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#axioms `bool`;; +[(`SELECT_AX`, |- !P x. P x ==> P($@ P)); + (`ETA_AX`, |- !t. (\x. t x) = t); + (`IMP_ANTISYM_AX`, + |- !t1 t2. (t1 ==> t2) ==> (t2 ==> t1) ==> (t1 = t2)); + (`BOOL_CASES_AX`, |- !t. (t = T) \/ (t = F)); + (`ARB_THM`, |- $= = $=)] +: (string # thm) list +\end{verbatim} +} \SEEALSO -backup, backup_limit, e, expand, expandf, g, get_state, p, print_state, r, -rotate, save_top_thm, set_goal, set_state, top_goal, top_thm. +axiom, definitions, load_axiom, load_axioms, new_axiom, print_theory, theorems. \ENDDOC \DOC{backup} @@ -2183,6 +1914,43 @@ NOT_CLAUSES, OR_CLAUSES, PAIR, REFL_CLAU SND. \ENDDOC +\DOC{b} + +\TYPE {\small\verb%b : (void -> void)%}\egroup + +\SYNOPSIS +Restores the proof state undoing the effects of a previous expansion. + +\DESCRIBE +The function {\small\verb%b%} is part of the subgoal package. It is an abbreviation for the +function {\small\verb%backup%}. For a description of the subgoal package, see +{\small\verb%set_goal%}. + +\FAILURE +As for {\small\verb%backup%}. + +\USES +Back tracking in a goal-directed proof to undo errors or try different tactics. + +\SEEALSO +backup, backup_limit, e, expand, expandf, g, get_state, p, print_state, r, +rotate, save_top_thm, set_goal, set_state, top_goal, top_thm. + +\ENDDOC +\DOC{B} + +\TYPE {\small\verb%B : ((* -> **) -> (*** -> *) -> *** -> **)%}\egroup + +\SYNOPSIS +Performs curried function-composition: {\small\verb%B f g x%} = {\small\verb%f (g x)%}. + +\FAILURE +Never fails. + +\SEEALSO +\#, C, CB, Co, I, K, KI, o, oo, S, W. + +\ENDDOC \DOC{BETA\_CONV} \TYPE {\small\verb%BETA_CONV : conv%}\egroup @@ -2339,23 +2107,6 @@ Fails unless the term is an abstraction. body, dest_abs. \ENDDOC -\DOC{body} - -\TYPE {\small\verb%body : (term -> term)%}\egroup - -\SYNOPSIS -Returns the body of an abstraction. - -\DESCRIBE -{\small\verb%body "\var. t"%} returns {\small\verb%"t"%}. - -\FAILURE -Fails unless the term is an abstraction. - -\SEEALSO -bndvar, dest_abs. - -\ENDDOC \DOC{BODY\_CONJUNCTS} \TYPE {\small\verb%BODY_CONJUNCTS : (thm -> thm list)%}\egroup @@ -2393,6 +2144,23 @@ The following illustrates how a typical CONJ, CONJUNCT1, CONJUNCT2, CONJUNCTS, CONJ_TAC. \ENDDOC +\DOC{body} + +\TYPE {\small\verb%body : (term -> term)%}\egroup + +\SYNOPSIS +Returns the body of an abstraction. + +\DESCRIBE +{\small\verb%body "\var. t"%} returns {\small\verb%"t"%}. + +\FAILURE +Fails unless the term is an abstraction. + +\SEEALSO +bndvar, dest_abs. + +\ENDDOC \DOC{BOOL\_CASES\_TAC} \TYPE {\small\verb%BOOL_CASES_TAC : (term -> tactic)%}\egroup @@ -2523,6 +2291,34 @@ or {\small\verb%k%} is greater than the \ENDDOC +\DOC{BUTLAST\_CONV} + +\TYPE {\small\verb%BUTLAST_CONV : conv%}\egroup + +\SYNOPSIS +Computes by inference the result of stripping the last element of a list. + +\DESCRIBE +For any object language list of the form {\small\verb%"[x0;...x(n-1)]"%} , +the result of evaluating +{\par\samepage\setseps\small +\begin{verbatim} + BUTLAST_CONV "BUTLAST [x0;...;x(n-1)]" +\end{verbatim} +} +\noindent is the theorem +{\par\samepage\setseps\small +\begin{verbatim} + |- BUTLAST [x0;...;x(n-1)] = [x0;...; x(n-2)] +\end{verbatim} +} + + +\FAILURE +{\small\verb%BUTLAST_CONV tm%} fails if {\small\verb%tm%} is an empty list. + +\ENDDOC + \DOC{butlast} \TYPE {\small\verb%butlast : (* list -> * list)%}\egroup @@ -2569,48 +2365,6 @@ or {\small\verb%k%} is greater than the \ENDDOC -\DOC{BUTLAST\_CONV} - -\TYPE {\small\verb%BUTLAST_CONV : conv%}\egroup - -\SYNOPSIS -Computes by inference the result of stripping the last element of a list. - -\DESCRIBE -For any object language list of the form {\small\verb%"[x0;...x(n-1)]"%} , -the result of evaluating -{\par\samepage\setseps\small -\begin{verbatim} - BUTLAST_CONV "BUTLAST [x0;...;x(n-1)]" -\end{verbatim} -} -\noindent is the theorem -{\par\samepage\setseps\small -\begin{verbatim} - |- BUTLAST [x0;...;x(n-1)] = [x0;...; x(n-2)] -\end{verbatim} -} - - -\FAILURE -{\small\verb%BUTLAST_CONV tm%} fails if {\small\verb%tm%} is an empty list. - -\ENDDOC - -\DOC{C} - -\TYPE {\small\verb%C : ((* -> ** -> ***) -> ** -> * -> ***)%}\egroup - -\SYNOPSIS -Permutes first two arguments to curried function: {\small\verb%C f x y%} = {\small\verb%f y x%}. - -\FAILURE -Never fails. - -\SEEALSO -\#, B, CB, Co, I, K, KI, o, oo, S, W. - -\ENDDOC \DOC{cached\_theories} \TYPE {\small\verb%cached_theories : (void -> (string # bool) list)%}\egroup @@ -2756,6 +2510,20 @@ a contradiction, then {\small\verb%t%} m CONTR, CONTRAPOS, CONTR_TAC, NOT_ELIM. \ENDDOC +\DOC{C} + +\TYPE {\small\verb%C : ((* -> ** -> ***) -> ** -> * -> ***)%}\egroup + +\SYNOPSIS +Permutes first two arguments to curried function: {\small\verb%C f x y%} = {\small\verb%f y x%}. + +\FAILURE +Never fails. + +\SEEALSO +\#, B, CB, Co, I, K, KI, o, oo, S, W. + +\ENDDOC \DOC{CHANGED\_CONV} \TYPE {\small\verb%CHANGED_CONV : (conv -> conv)%}\egroup @@ -3180,44 +2948,44 @@ Never fails. \#, B, C, CB, I, K, KI, o, oo, S, W. \ENDDOC -\DOC{com} +\DOC{combine} -\TYPE {\small\verb%$com : ((* list # ** list) -> (* # **) list)%}\egroup +\TYPE {\small\verb%combine : ((* list # ** list) -> (* # **) list)%}\egroup \SYNOPSIS -Converts a pair of lists into a list of pairs (infix version). +Converts a pair of lists into a list of pairs. \DESCRIBE -{\small\verb%[x1;...;xn] com [y1;...;yn]%} returns {\small\verb%[(x1,y1);...;(xn,yn)]%}. +{\small\verb%combine ([x1;...;xn],[y1;...;yn])%} returns {\small\verb%[(x1,y1);...;(xn,yn)]%}. \FAILURE Fails if the two lists are of different lengths. \COMMENTS -Has the same effect as {\small\verb%combine%}. +Has the same effect as {\small\verb%com%}. \SEEALSO -combine, split. +com, split. \ENDDOC -\DOC{combine} +\DOC{com} -\TYPE {\small\verb%combine : ((* list # ** list) -> (* # **) list)%}\egroup +\TYPE {\small\verb%$com : ((* list # ** list) -> (* # **) list)%}\egroup \SYNOPSIS -Converts a pair of lists into a list of pairs. +Converts a pair of lists into a list of pairs (infix version). \DESCRIBE -{\small\verb%combine ([x1;...;xn],[y1;...;yn])%} returns {\small\verb%[(x1,y1);...;(xn,yn)]%}. +{\small\verb%[x1;...;xn] com [y1;...;yn]%} returns {\small\verb%[(x1,y1);...;(xn,yn)]%}. \FAILURE Fails if the two lists are of different lengths. \COMMENTS -Has the same effect as {\small\verb%com%}. +Has the same effect as {\small\verb%combine%}. \SEEALSO -com, split. +combine, split. \ENDDOC \DOC{compile} @@ -3585,6 +3353,60 @@ The theorems returned in these three cas {\small\verb%c%} is {\small\verb%T%} or {\small\verb%F%}, or {\small\verb%u%} and {\small\verb%v%} are alpha-equivalent. \ENDDOC +\DOC{CONJ\_DISCH} + +\TYPE {\small\verb%CONJ_DISCH : (term -> thm -> thm)%}\egroup + +\SYNOPSIS +Discharges an assumption and conjoins it to both sides of an equation. + +\DESCRIBE +Given an term {\small\verb%t%} and a theorem {\small\verb%A |- t1 = t2%}, which is an equation between +boolean terms, {\small\verb%CONJ_DISCH%} returns {\small\verb%A - {t} |- (t /\ t1) = (t /\ t2)%}, i.e. +conjoins {\small\verb%t%} to both sides of the equation, removing {\small\verb%t%} from the assumptions +if it was there. +{\par\samepage\setseps\small +\begin{verbatim} + A |- t1 = t2 + ------------------------------ CONJ_DISCH "t" + A - {t} |- t /\ t1 = t /\ t2 +\end{verbatim} +} +\FAILURE +Fails unless the theorem is an equation, both sides of which, and the term +provided are of type {\small\verb%bool%}. + +\SEEALSO +CONJ_DISCHL. + +\ENDDOC +\DOC{CONJ\_DISCHL} + +\TYPE {\small\verb%CONJ_DISCHL : (term list -> thm -> thm)%}\egroup + +\SYNOPSIS +Conjoins multiple assumptions to both sides of an equation. + +\DESCRIBE +Given a term list {\small\verb%[t1;...;tn]%} and a theorem whose conclusion is an equation +between boolean terms, {\small\verb%CONJ_DISCHL%} conjoins all the terms +in the list to both sides of the equation, and removes any of the terms which +were in the assumption list. +{\par\samepage\setseps\small +\begin{verbatim} + A |- s = t + -------------------------------------------------------- CONJ_DISCHL + A - {t1,...,tn} |- (t1/\.../\tn/\s) = (t1/\.../\tn/\t) ["t1";...;"tn"] +\end{verbatim} +} +\FAILURE +Fails unless the theorem is an equation, both sides of which, and all the terms +provided, are of type {\small\verb%bool%}. + +\SEEALSO +CONJ_DISCH. + +\ENDDOC \DOC{CONJ} \TYPE {\small\verb%CONJ : (thm -> thm -> thm)%}\egroup @@ -3607,6 +3429,148 @@ Never fails. BODY_CONJUNCTS, CONJUNCT1, CONJUNCT2, CONJ_PAIR, LIST_CONJ, CONJ_LIST, CONJUNCTS. \ENDDOC +\DOC{CONJ\_LIST} + +\TYPE {\small\verb%CONJ_LIST : (int -> thm -> thm list)%}\egroup + +\SYNOPSIS +Extracts a list of conjuncts from a theorem (non-flattening version). + +\DESCRIBE +{\small\verb%CONJ_LIST%} is the proper inverse of {\small\verb%LIST_CONJ%}. Unlike {\small\verb%CONJUNCTS%} which +recursively splits as many conjunctions as possible both to the left and to +the right, {\small\verb%CONJ_LIST%} splits the top-level conjunction and then splits +(recursively) only the right conjunct. The integer argument is required +because the term {\small\verb%tn%} may itself be a conjunction. A list of {\small\verb%n%} theorems is +returned. +{\par\samepage\setseps\small +\begin{verbatim} + A |- t1 /\ (t2 /\ ( ... /\ tn)...) + ------------------------------------ CONJ_LIST n (A |- t1 /\ ... /\ tn) + A |- t1 A |- t2 ... A |- tn +\end{verbatim} +} +\FAILURE +Fails if the integer argument ({\small\verb%n%}) is less than one, or if the input theorem +has less than {\small\verb%n%} conjuncts. + +\EXAMPLE +Suppose the identifier {\small\verb%th%} is bound to the theorem: +{\par\samepage\setseps\small +\begin{verbatim} + A |- (x /\ y) /\ z /\ w +\end{verbatim} +} +\noindent Here are some applications of {\small\verb%CONJ_LIST%} to {\small\verb%th%}: +{\par\samepage\setseps\small +\begin{verbatim} + #CONJ_LIST 0 th;; + evaluation failed CONJ_LIST + + #CONJ_LIST 1 th;; + [A |- (x /\ y) /\ z /\ w] : thm list + + #CONJ_LIST 2 th;; + [A |- x /\ y; A |- z /\ w] : thm list + + #CONJ_LIST 3 th;; + [A |- x /\ y; A |- z; A |- w] : thm list + + #CONJ_LIST 4 th;; + evaluation failed CONJ_LIST +\end{verbatim} +} +\SEEALSO +BODY_CONJUNCTS, LIST_CONJ, CONJUNCTS, CONJ, CONJUNCT1, CONJUNCT2, CONJ_PAIR. + +\ENDDOC +\DOC{CONJ\_PAIR} + +\TYPE {\small\verb%CONJ_PAIR : (thm -> (thm # thm))%}\egroup + +\SYNOPSIS +Extracts both conjuncts of a conjunction. + +\DESCRIBE +{\par\samepage\setseps\small +\begin{verbatim} + A |- t1 /\ t2 + ---------------------- CONJ_PAIR + A |- t1 A |- t2 +\end{verbatim} +} +\noindent The two resultant theorems are returned as a pair. + +\FAILURE +Fails if the input theorem is not a conjunction. + +\SEEALSO +BODY_CONJUNCTS, CONJUNCT1, CONJUNCT2, CONJ, LIST_CONJ, CONJ_LIST, CONJUNCTS. + +\ENDDOC +\DOC{CONJ\_SET\_CONV} + +\TYPE {\small\verb%CONJ_SET_CONV : (term list -> term list -> thm)%}\egroup + +\SYNOPSIS +Proves the equivalence of the conjunctions of two equal sets of terms. + +\DESCRIBE +The arguments to {\small\verb%CONJ_SET_CONV%} are two lists of terms {\small\verb%[t1;...;tn]%} and +{\small\verb%[u1;...;um]%}. If these are equal when considered as sets, that is if the sets +{\par\samepage\setseps\small +\begin{verbatim} + {t1,...,tn} and {u1,...,um} +\end{verbatim} +} +\noindent are equal, then {\small\verb%CONJ_SET_CONV%} returns the theorem: +{\par\samepage\setseps\small +\begin{verbatim} + |- (t1 /\ ... /\ tn) = (u1 /\ ... /\ um) +\end{verbatim} +} +\noindent Otherwise {\small\verb%CONJ_SET_CONV%} fails. + +\FAILURE +{\small\verb%CONJ_SET_CONV [t1;...;tn] [u1;...;um]%} fails if {\small\verb%[t1,...,tn]%} and +{\small\verb%[u1,...,um]%}, regarded as sets of terms, are not equal. Also fails +if any {\small\verb%ti%} or {\small\verb%ui%} does not have type {\small\verb%bool%}. + +\USES +Used to order conjuncts. First sort a list of conjuncts {\small\verb%l1%} into the +desired order to get a new list {\small\verb%l2%}, then call {\small\verb%CONJ_SET_CONV l1 l2%}. + +\COMMENTS +This is not a true conversion, so perhaps it ought to be called something else. + +\SEEALSO +CONJUNCTS_CONV. + +\ENDDOC +\DOC{CONJ\_TAC} + +\TYPE {\small\verb%CONJ_TAC : tactic%}\egroup + +\SYNOPSIS +Reduces a conjunctive goal to two separate subgoals. + +\DESCRIBE +When applied to a goal {\small\verb%A ?- t1 /\ t2%}, the tactic {\small\verb%CONJ_TAC%} reduces it to the +two subgoals corresponding to each conjunct separately. +{\par\samepage\setseps\small +\begin{verbatim} + A ?- t1 /\ t2 + ====================== CONJ_TAC + A ?- t1 A ?- t2 +\end{verbatim} +} +\FAILURE +Fails unless the conclusion of the goal is a conjunction. + +\SEEALSO +STRIP_TAC. + +\ENDDOC \DOC{CONJUNCT1} \TYPE {\small\verb%CONJUNCT1 : (thm -> thm)%}\egroup @@ -3651,42 +3615,40 @@ Fails unless the input theorem is a conj BODY_CONJUNCTS, CONJUNCT1, CONJ_PAIR, CONJ, LIST_CONJ, CONJ_LIST, CONJUNCTS. \ENDDOC -\DOC{CONJUNCTS} +\DOC{CONJUNCTS\_CONV} -\TYPE {\small\verb%CONJUNCTS : (thm -> thm list)%}\egroup +\TYPE {\small\verb%CONJUNCTS_CONV : ((term # term) -> thm)%}\egroup \SYNOPSIS -Recursively splits conjunctions into a list of conjuncts. +Prove equivalence under idempotence, symmetry and associativity of conjunction. \DESCRIBE -Flattens out all conjuncts, regardless of grouping. Returns a singleton list -if the input theorem is not a conjunction. -{\par\samepage\setseps\small -\begin{verbatim} - A |- t1 /\ t2 /\ ... /\ tn - ----------------------------------- CONJUNCTS - A |- t1 A |- t2 ... A |- tn -\end{verbatim} -} +{\small\verb%CONJUNCTS_CONV%} takes a pair of terms {\small\verb%"t1"%} and {\small\verb%"t2"%}, and proves +{\small\verb%|- t1 = t2%} if {\small\verb%t1%} and {\small\verb%t2%} are equivalent up to idempotence, symmetry and +associativity of conjunction. That is, if {\small\verb%t1%} and {\small\verb%t2%} are two (different) +arbitrarily-nested conjunctions of the same set of terms, then {\small\verb%CONJUNCTS_CONV +(t1,t2)%} returns {\small\verb%|- t1 = t2%}. Otherwise, it fails. + \FAILURE -Never fails. +Fails if {\small\verb%t1%} and {\small\verb%t2%} are not equivalent, as described above. \EXAMPLE -Suppose the identifier {\small\verb%th%} is bound to the theorem: -{\par\samepage\setseps\small -\begin{verbatim} - A |- (x /\ y) /\ z /\ w -\end{verbatim} -} -\noindent Application of {\small\verb%CONJUNCTS%} to {\small\verb%th%} returns the following list of -theorems: {\par\samepage\setseps\small \begin{verbatim} - [A |- x; A |- y; A |- z; A |- w] : thm list +#CONJUNCTS_CONV ("(P /\ Q) /\ R", "R /\ (Q /\ R) /\ P");; +|- (P /\ Q) /\ R = R /\ (Q /\ R) /\ P \end{verbatim} } +\USES +Used to reorder a conjunction. First sort the conjuncts in a term {\small\verb%t1%} into +the desired order (e.g. lexicographic order, for normalization) to get a new +term {\small\verb%t2%}, then call {\small\verb%CONJUNCTS_CONV(t1,t2)%}. + +\COMMENTS +This is not a true conversion, so perhaps it ought to be called something else. + \SEEALSO -BODY_CONJUNCTS, CONJ_LIST, LIST_CONJ, CONJ, CONJUNCT1, CONJUNCT2, CONJ_PAIR. +CONJ_SET_CONV. \ENDDOC \DOC{conjuncts} @@ -3739,40 +3701,90 @@ introduce {\small\verb%list_dest_conj%} list_mk_conj, dest_conj. \ENDDOC -\DOC{CONJUNCTS\_CONV} +\DOC{CONJUNCTS} -\TYPE {\small\verb%CONJUNCTS_CONV : ((term # term) -> thm)%}\egroup +\TYPE {\small\verb%CONJUNCTS : (thm -> thm list)%}\egroup \SYNOPSIS -Prove equivalence under idempotence, symmetry and associativity of conjunction. +Recursively splits conjunctions into a list of conjuncts. \DESCRIBE -{\small\verb%CONJUNCTS_CONV%} takes a pair of terms {\small\verb%"t1"%} and {\small\verb%"t2"%}, and proves -{\small\verb%|- t1 = t2%} if {\small\verb%t1%} and {\small\verb%t2%} are equivalent up to idempotence, symmetry and -associativity of conjunction. That is, if {\small\verb%t1%} and {\small\verb%t2%} are two (different) -arbitrarily-nested conjunctions of the same set of terms, then {\small\verb%CONJUNCTS_CONV -(t1,t2)%} returns {\small\verb%|- t1 = t2%}. Otherwise, it fails. - +Flattens out all conjuncts, regardless of grouping. Returns a singleton list +if the input theorem is not a conjunction. +{\par\samepage\setseps\small +\begin{verbatim} + A |- t1 /\ t2 /\ ... /\ tn + ----------------------------------- CONJUNCTS + A |- t1 A |- t2 ... A |- tn +\end{verbatim} +} \FAILURE -Fails if {\small\verb%t1%} and {\small\verb%t2%} are not equivalent, as described above. +Never fails. \EXAMPLE +Suppose the identifier {\small\verb%th%} is bound to the theorem: {\par\samepage\setseps\small \begin{verbatim} -#CONJUNCTS_CONV ("(P /\ Q) /\ R", "R /\ (Q /\ R) /\ P");; -|- (P /\ Q) /\ R = R /\ (Q /\ R) /\ P + A |- (x /\ y) /\ z /\ w \end{verbatim} } -\USES -Used to reorder a conjunction. First sort the conjuncts in a term {\small\verb%t1%} into -the desired order (e.g. lexicographic order, for normalization) to get a new -term {\small\verb%t2%}, then call {\small\verb%CONJUNCTS_CONV(t1,t2)%}. +\noindent Application of {\small\verb%CONJUNCTS%} to {\small\verb%th%} returns the following list of +theorems: +{\par\samepage\setseps\small +\begin{verbatim} + [A |- x; A |- y; A |- z; A |- w] : thm list +\end{verbatim} +} +\SEEALSO +BODY_CONJUNCTS, CONJ_LIST, LIST_CONJ, CONJ, CONJUNCT1, CONJUNCT2, CONJ_PAIR. + +\ENDDOC +\DOC{CONJUNCTS\_THEN2} + +\TYPE {\small\verb%CONJUNCTS_THEN2 : (thm_tactic -> thm_tactic -> thm_tactic)%}\egroup + +\SYNOPSIS +Applies two theorem-tactics to the corresponding conjuncts of a theorem. + +\DESCRIBE +{\small\verb%CONJUNCTS_THEN2%} takes two theorem-tactics, {\small\verb%f1%} and {\small\verb%f2%}, and a theorem {\small\verb%t%} +whose conclusion must be a conjunction. {\small\verb%CONJUNCTS_THEN2%} breaks {\small\verb%t%} into two +new theorems, {\small\verb%t1%} and {\small\verb%t2%} which are {\small\verb%CONJUNCT1%} and {\small\verb%CONJUNCT2%} of {\small\verb%t%} +respectively, and then returns the tactic {\small\verb%f1 t1 THEN f2 t2%}. Thus +{\par\samepage\setseps\small +\begin{verbatim} + CONJUNCTS_THEN2 f1 f2 (A |- l /\ r) = f1 (A |- l) THEN f2 (A |- r) +\end{verbatim} +} +\noindent so if +{\par\samepage\setseps\small +\begin{verbatim} + A1 ?- t1 A2 ?- t2 + ========== f1 (A |- l) ========== f2 (A |- r) + A2 ?- t2 A3 ?- t3 +\end{verbatim} +} +\noindent then +{\par\samepage\setseps\small +\begin{verbatim} + A1 ?- t1 + ========== CONJUNCTS_THEN2 f1 f2 (A |- l /\ r) + A3 ?- t3 +\end{verbatim} +} +\FAILURE +{\small\verb%CONJUNCTS_THEN f%} will fail if applied to a theorem whose conclusion is not a +conjunction. \COMMENTS -This is not a true conversion, so perhaps it ought to be called something else. +The system shows the type as {\small\verb%(thm_tactic -> thm_tactical)%}. + +\USES +The construction of complex {\small\verb%tactical%}s like {\small\verb%CONJUNCTS_THEN%}. \SEEALSO -CONJ_SET_CONV. +CONJUNCT1, CONJUNCT2, CONJUNCTS, CONJUNCTS_TAC, CONJUNCTS_THEN2, +STRIP_THM_THEN. \ENDDOC \DOC{CONJUNCTS\_THEN} @@ -3839,390 +3851,146 @@ CONJUNCT1, CONJUNCT2, CONJUNCTS, CONJUNC STRIP_THM_THEN. \ENDDOC -\DOC{CONJUNCTS\_THEN2} +\DOC{constants} -\TYPE {\small\verb%CONJUNCTS_THEN2 : (thm_tactic -> thm_tactic -> thm_tactic)%}\egroup +\TYPE {\small\verb%constants : (string -> term list)%}\egroup \SYNOPSIS -Applies two theorem-tactics to the corresponding conjuncts of a theorem. +Returns a list of the constants defined in a named theory. \DESCRIBE -{\small\verb%CONJUNCTS_THEN2%} takes two theorem-tactics, {\small\verb%f1%} and {\small\verb%f2%}, and a theorem {\small\verb%t%} -whose conclusion must be a conjunction. {\small\verb%CONJUNCTS_THEN2%} breaks {\small\verb%t%} into two -new theorems, {\small\verb%t1%} and {\small\verb%t2%} which are {\small\verb%CONJUNCT1%} and {\small\verb%CONJUNCT2%} of {\small\verb%t%} -respectively, and then returns the tactic {\small\verb%f1 t1 THEN f2 t2%}. Thus -{\par\samepage\setseps\small -\begin{verbatim} - CONJUNCTS_THEN2 f1 f2 (A |- l /\ r) = f1 (A |- l) THEN f2 (A |- r) -\end{verbatim} -} -\noindent so if +The call {\par\samepage\setseps\small \begin{verbatim} - A1 ?- t1 A2 ?- t2 - ========== f1 (A |- l) ========== f2 (A |- r) - A2 ?- t2 A3 ?- t3 + constants `thy` \end{verbatim} } -\noindent then +\noindent where {\small\verb%thy%} is an ancestor theory (the special string {\small\verb%`-`%} means the +current theory), returns a list of all the constants in that theory. + +\FAILURE +Fails if the named theory does not exist, or is not an ancestor of the +current theory. + +\EXAMPLE {\par\samepage\setseps\small \begin{verbatim} - A1 ?- t1 - ========== CONJUNCTS_THEN2 f1 f2 (A |- l /\ r) - A3 ?- t3 +#constants `combin`;; +["I"; "S"; "K"; "$o"] : term list \end{verbatim} } -\FAILURE -{\small\verb%CONJUNCTS_THEN f%} will fail if applied to a theorem whose conclusion is not a -conjunction. - -\COMMENTS -The system shows the type as {\small\verb%(thm_tactic -> thm_tactical)%}. - -\USES -The construction of complex {\small\verb%tactical%}s like {\small\verb%CONJUNCTS_THEN%}. - \SEEALSO -CONJUNCT1, CONJUNCT2, CONJUNCTS, CONJUNCTS_TAC, CONJUNCTS_THEN2, -STRIP_THM_THEN. +axioms, binders, definitions, infixes, theorems \ENDDOC -\DOC{CONJ\_DISCH} +\DOC{CONTRAPOS\_CONV} -\TYPE {\small\verb%CONJ_DISCH : (term -> thm -> thm)%}\egroup +\TYPE {\small\verb%CONTRAPOS_CONV : conv%}\egroup \SYNOPSIS -Discharges an assumption and conjoins it to both sides of an equation. +Proves the equivalence of an implication and its contrapositive. \DESCRIBE -Given an term {\small\verb%t%} and a theorem {\small\verb%A |- t1 = t2%}, which is an equation between -boolean terms, {\small\verb%CONJ_DISCH%} returns {\small\verb%A - {t} |- (t /\ t1) = (t /\ t2)%}, i.e. -conjoins {\small\verb%t%} to both sides of the equation, removing {\small\verb%t%} from the assumptions -if it was there. +When applied to an implication {\small\verb%P ==> Q%}, the conversion {\small\verb%CONTRAPOS_CONV%} +returns the theorem: {\par\samepage\setseps\small \begin{verbatim} - A |- t1 = t2 - ------------------------------ CONJ_DISCH "t" - A - {t} |- t /\ t1 = t /\ t2 + |- (P ==> Q) = (~Q ==> ~P) \end{verbatim} } \FAILURE -Fails unless the theorem is an equation, both sides of which, and the term -provided are of type {\small\verb%bool%}. +Fails if applied to a term that is not an implication. \SEEALSO -CONJ_DISCHL. +CONTRAPOS. \ENDDOC -\DOC{CONJ\_DISCHL} +\DOC{CONTRAPOS} -\TYPE {\small\verb%CONJ_DISCHL : (term list -> thm -> thm)%}\egroup +\TYPE {\small\verb%CONTRAPOS : (thm -> thm)%}\egroup \SYNOPSIS -Conjoins multiple assumptions to both sides of an equation. +Deduces the contrapositive of an implication. \DESCRIBE -Given a term list {\small\verb%[t1;...;tn]%} and a theorem whose conclusion is an equation -between boolean terms, {\small\verb%CONJ_DISCHL%} conjoins all the terms -in the list to both sides of the equation, and removes any of the terms which -were in the assumption list. +When applied to a theorem {\small\verb%A |- s ==> t%}, the inference rule {\small\verb%CONTRAPOS%} +returns its contrapositive, {\small\verb%A |- ~t ==> ~s%}. {\par\samepage\setseps\small \begin{verbatim} - A |- s = t - -------------------------------------------------------- CONJ_DISCHL - A - {t1,...,tn} |- (t1/\.../\tn/\s) = (t1/\.../\tn/\t) ["t1";...;"tn"] + A |- s ==> t + ---------------- CONTRAPOS + A |- ~t ==> ~s \end{verbatim} } \FAILURE -Fails unless the theorem is an equation, both sides of which, and all the terms -provided, are of type {\small\verb%bool%}. +Fails unless the theorem is an implication. \SEEALSO -CONJ_DISCH. +CCONTR, CONTR, CONTRAPOS_CONV, NOT_ELIM. \ENDDOC -\DOC{CONJ\_LIST} +\DOC{CONTR} -\TYPE {\small\verb%CONJ_LIST : (int -> thm -> thm list)%}\egroup +\TYPE {\small\verb%CONTR : (term -> thm -> thm)%}\egroup \SYNOPSIS -Extracts a list of conjuncts from a theorem (non-flattening version). +Implements the intuitionistic contradiction rule. \DESCRIBE -{\small\verb%CONJ_LIST%} is the proper inverse of {\small\verb%LIST_CONJ%}. Unlike {\small\verb%CONJUNCTS%} which -recursively splits as many conjunctions as possible both to the left and to -the right, {\small\verb%CONJ_LIST%} splits the top-level conjunction and then splits -(recursively) only the right conjunct. The integer argument is required -because the term {\small\verb%tn%} may itself be a conjunction. A list of {\small\verb%n%} theorems is -returned. +When applied to a term {\small\verb%t%} and a theorem {\small\verb%A |- F%}, the inference rule {\small\verb%CONTR%} +returns the theorem {\small\verb%A |- t%}. {\par\samepage\setseps\small \begin{verbatim} - A |- t1 /\ (t2 /\ ( ... /\ tn)...) - ------------------------------------ CONJ_LIST n (A |- t1 /\ ... /\ tn) - A |- t1 A |- t2 ... A |- tn + A |- F + -------- CONTR "t" + A |- t \end{verbatim} } \FAILURE -Fails if the integer argument ({\small\verb%n%}) is less than one, or if the input theorem -has less than {\small\verb%n%} conjuncts. - -\EXAMPLE -Suppose the identifier {\small\verb%th%} is bound to the theorem: -{\par\samepage\setseps\small -\begin{verbatim} - A |- (x /\ y) /\ z /\ w -\end{verbatim} -} -\noindent Here are some applications of {\small\verb%CONJ_LIST%} to {\small\verb%th%}: -{\par\samepage\setseps\small -\begin{verbatim} - #CONJ_LIST 0 th;; - evaluation failed CONJ_LIST - - #CONJ_LIST 1 th;; - [A |- (x /\ y) /\ z /\ w] : thm list - - #CONJ_LIST 2 th;; - [A |- x /\ y; A |- z /\ w] : thm list - - #CONJ_LIST 3 th;; - [A |- x /\ y; A |- z; A |- w] : thm list +Fails unless the term has type {\small\verb%bool%} and the theorem has {\small\verb%F%} as its +conclusion. - #CONJ_LIST 4 th;; - evaluation failed CONJ_LIST -\end{verbatim} -} \SEEALSO -BODY_CONJUNCTS, LIST_CONJ, CONJUNCTS, CONJ, CONJUNCT1, CONJUNCT2, CONJ_PAIR. +CCONTR, CONTRAPOS, CONTR_TAC, NOT_ELIM. \ENDDOC -\DOC{CONJ\_PAIR} +\DOC{CONTR\_TAC} -\TYPE {\small\verb%CONJ_PAIR : (thm -> (thm # thm))%}\egroup +\TYPE {\small\verb%CONTR_TAC : thm_tactic%}\egroup \SYNOPSIS -Extracts both conjuncts of a conjunction. +Solves any goal from contradictory theorem. \DESCRIBE +When applied to a contradictory theorem {\small\verb%A' |- F%}, and a goal {\small\verb%A ?- t%}, +the tactic {\small\verb%CONTR_TAC%} completely solves the goal. This is an invalid +tactic unless {\small\verb%A'%} is a subset of {\small\verb%A%}. {\par\samepage\setseps\small \begin{verbatim} - A |- t1 /\ t2 - ---------------------- CONJ_PAIR - A |- t1 A |- t2 + A ?- t + ======== CONTR_TAC (A' |- F) + \end{verbatim} } -\noindent The two resultant theorems are returned as a pair. - \FAILURE -Fails if the input theorem is not a conjunction. +Fails unless the theorem is contradictory, i.e. has {\small\verb%F%} as its conclusion. \SEEALSO -BODY_CONJUNCTS, CONJUNCT1, CONJUNCT2, CONJ, LIST_CONJ, CONJ_LIST, CONJUNCTS. +CHECK_ASSUME_TAC, CONTR, CCONTR, CONTRAPOS, NOT_ELIM. \ENDDOC -\DOC{CONJ\_SET\_CONV} +\DOC{CONV\_RULE} -\TYPE {\small\verb%CONJ_SET_CONV : (term list -> term list -> thm)%}\egroup +\TYPE {\small\verb%CONV_RULE : (conv -> thm -> thm)%}\egroup \SYNOPSIS -Proves the equivalence of the conjunctions of two equal sets of terms. +Makes an inference rule from a conversion. \DESCRIBE -The arguments to {\small\verb%CONJ_SET_CONV%} are two lists of terms {\small\verb%[t1;...;tn]%} and -{\small\verb%[u1;...;um]%}. If these are equal when considered as sets, that is if the sets -{\par\samepage\setseps\small -\begin{verbatim} - {t1,...,tn} and {u1,...,um} -\end{verbatim} -} -\noindent are equal, then {\small\verb%CONJ_SET_CONV%} returns the theorem: -{\par\samepage\setseps\small -\begin{verbatim} - |- (t1 /\ ... /\ tn) = (u1 /\ ... /\ um) -\end{verbatim} -} -\noindent Otherwise {\small\verb%CONJ_SET_CONV%} fails. - -\FAILURE -{\small\verb%CONJ_SET_CONV [t1;...;tn] [u1;...;um]%} fails if {\small\verb%[t1,...,tn]%} and -{\small\verb%[u1,...,um]%}, regarded as sets of terms, are not equal. Also fails -if any {\small\verb%ti%} or {\small\verb%ui%} does not have type {\small\verb%bool%}. - -\USES -Used to order conjuncts. First sort a list of conjuncts {\small\verb%l1%} into the -desired order to get a new list {\small\verb%l2%}, then call {\small\verb%CONJ_SET_CONV l1 l2%}. - -\COMMENTS -This is not a true conversion, so perhaps it ought to be called something else. - -\SEEALSO -CONJUNCTS_CONV. - -\ENDDOC -\DOC{CONJ\_TAC} - -\TYPE {\small\verb%CONJ_TAC : tactic%}\egroup - -\SYNOPSIS -Reduces a conjunctive goal to two separate subgoals. - -\DESCRIBE -When applied to a goal {\small\verb%A ?- t1 /\ t2%}, the tactic {\small\verb%CONJ_TAC%} reduces it to the -two subgoals corresponding to each conjunct separately. -{\par\samepage\setseps\small -\begin{verbatim} - A ?- t1 /\ t2 - ====================== CONJ_TAC - A ?- t1 A ?- t2 -\end{verbatim} -} -\FAILURE -Fails unless the conclusion of the goal is a conjunction. - -\SEEALSO -STRIP_TAC. - -\ENDDOC -\DOC{constants} - -\TYPE {\small\verb%constants : (string -> term list)%}\egroup - -\SYNOPSIS -Returns a list of the constants defined in a named theory. - -\DESCRIBE -The call -{\par\samepage\setseps\small -\begin{verbatim} - constants `thy` -\end{verbatim} -} -\noindent where {\small\verb%thy%} is an ancestor theory (the special string {\small\verb%`-`%} means the -current theory), returns a list of all the constants in that theory. - -\FAILURE -Fails if the named theory does not exist, or is not an ancestor of the -current theory. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#constants `combin`;; -["I"; "S"; "K"; "$o"] : term list -\end{verbatim} -} -\SEEALSO -axioms, binders, definitions, infixes, theorems - -\ENDDOC -\DOC{CONTR} - -\TYPE {\small\verb%CONTR : (term -> thm -> thm)%}\egroup - -\SYNOPSIS -Implements the intuitionistic contradiction rule. - -\DESCRIBE -When applied to a term {\small\verb%t%} and a theorem {\small\verb%A |- F%}, the inference rule {\small\verb%CONTR%} -returns the theorem {\small\verb%A |- t%}. -{\par\samepage\setseps\small -\begin{verbatim} - A |- F - -------- CONTR "t" - A |- t -\end{verbatim} -} -\FAILURE -Fails unless the term has type {\small\verb%bool%} and the theorem has {\small\verb%F%} as its -conclusion. - -\SEEALSO -CCONTR, CONTRAPOS, CONTR_TAC, NOT_ELIM. - -\ENDDOC -\DOC{CONTRAPOS} - -\TYPE {\small\verb%CONTRAPOS : (thm -> thm)%}\egroup - -\SYNOPSIS -Deduces the contrapositive of an implication. - -\DESCRIBE -When applied to a theorem {\small\verb%A |- s ==> t%}, the inference rule {\small\verb%CONTRAPOS%} -returns its contrapositive, {\small\verb%A |- ~t ==> ~s%}. -{\par\samepage\setseps\small -\begin{verbatim} - A |- s ==> t - ---------------- CONTRAPOS - A |- ~t ==> ~s -\end{verbatim} -} -\FAILURE -Fails unless the theorem is an implication. - -\SEEALSO -CCONTR, CONTR, CONTRAPOS_CONV, NOT_ELIM. - -\ENDDOC -\DOC{CONTRAPOS\_CONV} - -\TYPE {\small\verb%CONTRAPOS_CONV : conv%}\egroup - -\SYNOPSIS -Proves the equivalence of an implication and its contrapositive. - -\DESCRIBE -When applied to an implication {\small\verb%P ==> Q%}, the conversion {\small\verb%CONTRAPOS_CONV%} -returns the theorem: -{\par\samepage\setseps\small -\begin{verbatim} - |- (P ==> Q) = (~Q ==> ~P) -\end{verbatim} -} -\FAILURE -Fails if applied to a term that is not an implication. - -\SEEALSO -CONTRAPOS. - -\ENDDOC -\DOC{CONTR\_TAC} - -\TYPE {\small\verb%CONTR_TAC : thm_tactic%}\egroup - -\SYNOPSIS -Solves any goal from contradictory theorem. - -\DESCRIBE -When applied to a contradictory theorem {\small\verb%A' |- F%}, and a goal {\small\verb%A ?- t%}, -the tactic {\small\verb%CONTR_TAC%} completely solves the goal. This is an invalid -tactic unless {\small\verb%A'%} is a subset of {\small\verb%A%}. -{\par\samepage\setseps\small -\begin{verbatim} - A ?- t - ======== CONTR_TAC (A' |- F) - -\end{verbatim} -} -\FAILURE -Fails unless the theorem is contradictory, i.e. has {\small\verb%F%} as its conclusion. - -\SEEALSO -CHECK_ASSUME_TAC, CONTR, CCONTR, CONTRAPOS, NOT_ELIM. - -\ENDDOC -\DOC{CONV\_RULE} - -\TYPE {\small\verb%CONV_RULE : (conv -> thm -> thm)%}\egroup - -\SYNOPSIS -Makes an inference rule from a conversion. - -\DESCRIBE -If {\small\verb%c%} is a conversion, then {\small\verb%CONV_RULE c%} is an inference rule that applies -{\small\verb%c%} to the conclusion of a theorem. That is, if {\small\verb%c%} maps a term {\small\verb%"t"%} to the -theorem {\small\verb%|- t = t'%}, then the rule {\small\verb%CONV_RULE c%} infers {\small\verb%|- t'%} from the -theorem {\small\verb%|- t%}. More precisely, if {\small\verb%c "t"%} returns {\small\verb%A' |- t = t'%}, then: +If {\small\verb%c%} is a conversion, then {\small\verb%CONV_RULE c%} is an inference rule that applies +{\small\verb%c%} to the conclusion of a theorem. That is, if {\small\verb%c%} maps a term {\small\verb%"t"%} to the +theorem {\small\verb%|- t = t'%}, then the rule {\small\verb%CONV_RULE c%} infers {\small\verb%|- t'%} from the +theorem {\small\verb%|- t%}. More precisely, if {\small\verb%c "t"%} returns {\small\verb%A' |- t = t'%}, then: {\par\samepage\setseps\small \begin{verbatim} A |- t @@ -4353,6 +4121,41 @@ increment = - : (int -> int) uncurry. \ENDDOC +\DOC{DEF\_EXISTS\_RULE} + +\TYPE {\small\verb%DEF_EXISTS_RULE : (term -> thm)%}\egroup + +\SYNOPSIS +Proves that a function defined by a definitional equation exists. + +\DESCRIBE +This rule accepts a term of the form {\small\verb%"c = ..."%} or {\small\verb%"f x1 ... xn = ..."%}, the +variables of which may be universally quantified, and returns an existential +theorem. The resulting theorem is typically used for generating HOL +specifications. + +\FAILURE +{\small\verb%DEF_EXISTS_RULE%} fails if the definition is not an equation, if there +is any variable in the right-hand side which does not occur in the +left-hand side, if the definition is recursive, if there is a free type +variable, or if the name being defined by the function is not allowed. + +\EXAMPLE +The effect of this rule can be understood more clearly through an +example: +{\par\samepage\setseps\small +\begin{verbatim} + #DEF_EXISTS_RULE "max a b = ((a < b) => b | a)" ;; + |- ?max. !a b. max a b = (a < b => b | a) +\end{verbatim} +} +\COMMENTS +In later versions of HOL this function may be made internal. + +\SEEALSO +new_definition, new_gen_definition, new_specification. + +\ENDDOC \DOC{define\_finite\_set\_syntax} \TYPE {\small\verb%define_finite_set_syntax : ((string # string) -> void)%}\egroup @@ -4712,62 +4515,26 @@ definition of name {\small\verb%def%} in axiom, definitions, load_definition, load_definitions, new_definition, print_theory, theorem. \ENDDOC -\DOC{definitions} +\DOC{definition\_lfn} -\TYPE {\small\verb%definitions : (string -> (string # thm) list)%}\egroup +\TYPE {\small\verb%definition_lfn : (string list -> thm)%}\egroup \SYNOPSIS -Returns the constant definitions, type definitions and constant specifications -of a given theory segment of the current theory. +Loads a given definition from a given theory. \DESCRIBE -A call of {\small\verb%definitions `thy`%} returns the definitions of the theory segment -{\small\verb%thy%} together with their names. Constant definitions, type definitions and -constant specifications are all retrieved by the function {\small\verb%definitions%}. The -theory segment {\small\verb%thy%} must be part of the current theory. The names are those -given to the definitions by the user when they were originally added to the -theory segment (by a call, for example, to {\small\verb%new_definition%}). The name of the -current theory segment can be abbreviated by {\small\verb%`-`%}. +If {\small\verb%thy%} is an ancestor theory, and {\small\verb%def%} one of its definitions, then the +call +{\par\samepage\setseps\small +\begin{verbatim} + definition_lfn [`thy`;`def`] +\end{verbatim} +} +\noindent will return that definition. \FAILURE -The call {\small\verb%definitions `thy`%} will fail if the theory segment {\small\verb%thy%} is not -part of the current theory. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#definitions `combin`;; -[(`I_DEF`, |- I = S K K); - (`S_DEF`, |- S = (\f g x. f x(g x))); - (`K_DEF`, |- K = (\x y. x)); - (`o_DEF`, |- !f g. f o g = (\x. f(g x)))] -: (string # thm) list -\end{verbatim} -} -\SEEALSO -axioms, definition, load_definition, load_definitions, new_definition, print_theory, theorems. - -\ENDDOC -\DOC{definition\_lfn} - -\TYPE {\small\verb%definition_lfn : (string list -> thm)%}\egroup - -\SYNOPSIS -Loads a given definition from a given theory. - -\DESCRIBE -If {\small\verb%thy%} is an ancestor theory, and {\small\verb%def%} one of its definitions, then the -call -{\par\samepage\setseps\small -\begin{verbatim} - definition_lfn [`thy`;`def`] -\end{verbatim} -} -\noindent will return that definition. - -\FAILURE -Fails if {\small\verb%thy%} is not an ancestor theory, or if {\small\verb%def%} is not one of its -definitions. +Fails if {\small\verb%thy%} is not an ancestor theory, or if {\small\verb%def%} is not one of its +definitions. \EXAMPLE {\par\samepage\setseps\small @@ -4824,39 +4591,40 @@ autoload, autoload_theory, definition, d load_definition, load_definitions, undo_autoload. \ENDDOC -\DOC{DEF\_EXISTS\_RULE} +\DOC{definitions} -\TYPE {\small\verb%DEF_EXISTS_RULE : (term -> thm)%}\egroup +\TYPE {\small\verb%definitions : (string -> (string # thm) list)%}\egroup \SYNOPSIS -Proves that a function defined by a definitional equation exists. +Returns the constant definitions, type definitions and constant specifications +of a given theory segment of the current theory. \DESCRIBE -This rule accepts a term of the form {\small\verb%"c = ..."%} or {\small\verb%"f x1 ... xn = ..."%}, the -variables of which may be universally quantified, and returns an existential -theorem. The resulting theorem is typically used for generating HOL -specifications. +A call of {\small\verb%definitions `thy`%} returns the definitions of the theory segment +{\small\verb%thy%} together with their names. Constant definitions, type definitions and +constant specifications are all retrieved by the function {\small\verb%definitions%}. The +theory segment {\small\verb%thy%} must be part of the current theory. The names are those +given to the definitions by the user when they were originally added to the +theory segment (by a call, for example, to {\small\verb%new_definition%}). The name of the +current theory segment can be abbreviated by {\small\verb%`-`%}. \FAILURE -{\small\verb%DEF_EXISTS_RULE%} fails if the definition is not an equation, if there -is any variable in the right-hand side which does not occur in the -left-hand side, if the definition is recursive, if there is a free type -variable, or if the name being defined by the function is not allowed. +The call {\small\verb%definitions `thy`%} will fail if the theory segment {\small\verb%thy%} is not +part of the current theory. \EXAMPLE -The effect of this rule can be understood more clearly through an -example: {\par\samepage\setseps\small \begin{verbatim} - #DEF_EXISTS_RULE "max a b = ((a < b) => b | a)" ;; - |- ?max. !a b. max a b = (a < b => b | a) +#definitions `combin`;; +[(`I_DEF`, |- I = S K K); + (`S_DEF`, |- S = (\f g x. f x(g x))); + (`K_DEF`, |- K = (\x y. x)); + (`o_DEF`, |- !f g. f o g = (\x. f(g x)))] +: (string # thm) list \end{verbatim} } -\COMMENTS -In later versions of HOL this function may be made internal. - \SEEALSO -new_definition, new_gen_definition, new_specification. +axioms, definition, load_definition, load_definitions, new_definition, print_theory, theorems. \ENDDOC \DOC{delete\_cache} @@ -5582,31 +5350,34 @@ is not {\small\verb%T%} or already in th POP_ASSUM, POP_ASSUM_LIST. \ENDDOC -\DOC{DISCH} +\DOC{DISCH\_ALL} -\TYPE {\small\verb%DISCH : (term -> thm -> thm)%}\egroup +\TYPE {\small\verb%DISCH_ALL : (thm -> thm)%}\egroup \SYNOPSIS -Discharges an assumption. +Discharges all hypotheses of a theorem. \DESCRIBE {\par\samepage\setseps\small \begin{verbatim} - A |- t --------------------- DISCH "u" - A - {u} |- u ==> t + A1, ..., An |- t + ---------------------------- DISCH_ALL + |- A1 ==> ... ==> An ==> t \end{verbatim} } \FAILURE -{\small\verb%DISCH%} will fail if {\small\verb%"u"%} is not boolean. +{\small\verb%DISCH_ALL%} will not fail if there are no hypotheses to discharge, it will +simply return the theorem unchanged. \COMMENTS -The term {\small\verb%"u"%} need not be a hypothesis. Discharging {\small\verb%"u"%} will remove all -identical and alpha-equivalent hypotheses. +Users should not rely on the hypotheses being discharged in any particular +order. Two or more alpha-convertible hypotheses will be discharged by a +single implication; users should not rely on which hypothesis appears in the +implication. \SEEALSO -DISCH_ALL, DISCH_TAC, DISCH_THEN, FILTER_DISCH_TAC, FILTER_DISCH_THEN, -NEG_DISCH, STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC. +DISCH, DISCH_TAC, DISCH_THEN, NEG_DISCH, FILTER_DISCH_TAC, FILTER_DISCH_THEN, +STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC. \ENDDOC \DOC{disch} @@ -5632,34 +5403,31 @@ disch ("\x:bool.T",["A = T";"B = 3";"\y: filter. \ENDDOC -\DOC{DISCH\_ALL} +\DOC{DISCH} -\TYPE {\small\verb%DISCH_ALL : (thm -> thm)%}\egroup +\TYPE {\small\verb%DISCH : (term -> thm -> thm)%}\egroup \SYNOPSIS -Discharges all hypotheses of a theorem. +Discharges an assumption. \DESCRIBE {\par\samepage\setseps\small \begin{verbatim} - A1, ..., An |- t - ---------------------------- DISCH_ALL - |- A1 ==> ... ==> An ==> t + A |- t +-------------------- DISCH "u" + A - {u} |- u ==> t \end{verbatim} } \FAILURE -{\small\verb%DISCH_ALL%} will not fail if there are no hypotheses to discharge, it will -simply return the theorem unchanged. +{\small\verb%DISCH%} will fail if {\small\verb%"u"%} is not boolean. \COMMENTS -Users should not rely on the hypotheses being discharged in any particular -order. Two or more alpha-convertible hypotheses will be discharged by a -single implication; users should not rely on which hypothesis appears in the -implication. +The term {\small\verb%"u"%} need not be a hypothesis. Discharging {\small\verb%"u"%} will remove all +identical and alpha-equivalent hypotheses. \SEEALSO -DISCH, DISCH_TAC, DISCH_THEN, NEG_DISCH, FILTER_DISCH_TAC, FILTER_DISCH_THEN, -STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC. +DISCH_ALL, DISCH_TAC, DISCH_THEN, FILTER_DISCH_TAC, FILTER_DISCH_THEN, +NEG_DISCH, STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC. \ENDDOC \DOC{DISCH\_TAC} @@ -5861,55 +5629,6 @@ Fails if the goal is not a disjunction. DISJ1, DISJ1_TAC, DISJ2. \ENDDOC -\DOC{disjuncts} - -\TYPE {\small\verb%disjuncts : (term -> term list)%}\egroup - -\SYNOPSIS -Iteratively breaks apart a disjunction. - -\DESCRIBE -{\small\verb%disjuncts "t1 \/ ... \/ tn"%} returns {\small\verb%["t1";...;"tn"]%}. -The argument term may be any tree of disjunctions; -it need not have the form {\small\verb%"t1 \/ (t2 \/ ( ... \/ tn)...)"%}. -A term that is not a disjunction is simply returned as the sole element of a -list. Note that -{\par\samepage\setseps\small -\begin{verbatim} - disjuncts(list_mk_disj(["t1";...;"tn"])) -\end{verbatim} -} -\noindent will not return {\small\verb%["t1";...;"tn"]%} if any of {\small\verb%t1%},...,{\small\verb%tn%} are -disjunctions. - -\FAILURE -Never fails. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#list_mk_disj ["a \/ b";"c \/ d";"e \/ f"];; -"(a \/ b) \/ (c \/ d) \/ e \/ f" : term - -#disjuncts it;; -["a"; "b"; "c"; "d"; "e"; "f"] : term list - -#list_mk_disj it;; -"a \/ b \/ c \/ d \/ e \/ f" : term - -#disjuncts "1";; -["1"] : term list -\end{verbatim} -} -\COMMENTS -Because {\small\verb%disjuncts%} splits both the left and right sides of a disjunction, -this operation is not the inverse of {\small\verb%list_mk_disj%}. It may be useful to -introduce {\small\verb%list_dest_disj%} for splitting only the right tails of a disjunction. - -\SEEALSO -list_mk_disj, dest_disj. - -\ENDDOC \DOC{DISJ\_CASES} \TYPE {\small\verb%DISJ_CASES : (thm -> thm -> thm -> thm)%}\egroup @@ -6003,77 +5722,6 @@ Performing a case analysis according to ASSUME_TAC, ASM_CASES_TAC, COND_CASES_TAC, DISJ_CASES_THEN, STRUCT_CASES_TAC. \ENDDOC -\DOC{DISJ\_CASES\_THEN} - -\TYPE {\small\verb%DISJ_CASES_THEN : thm_tactical%}\egroup - -\SYNOPSIS -Applies a theorem-tactic to each disjunct of a disjunctive theorem. - -\DESCRIBE -If the theorem-tactic {\small\verb%f:thm->tactic%} applied to either -{\small\verb%ASSUME%}d disjunct produces results as follows when applied to a goal -{\small\verb%(A ?- t)%}: -{\par\samepage\setseps\small -\begin{verbatim} - A ?- t A ?- t - ========= f (u |- u) and ========= f (v |- v) - A ?- t1 A ?- t2 -\end{verbatim} -} -\noindent then applying {\small\verb%DISJ_CASES_THEN f (|- u \/ v)%} -to the goal {\small\verb%(A ?- t)%} produces two subgoals. -{\par\samepage\setseps\small -\begin{verbatim} - A ?- t - ====================== DISJ_CASES_THEN f (|- u \/ v) - A ?- t1 A ?- t2 -\end{verbatim} -} -\FAILURE -Fails if the theorem is not a disjunction. An invalid tactic is -produced if the theorem has any hypothesis which is not -alpha-convertible to an assumption of the goal. - -\EXAMPLE -Given the theorem -{\par\samepage\setseps\small -\begin{verbatim} - th = |- (m = 0) \/ (?n. m = SUC n) -\end{verbatim} -} -\noindent and a goal of the form {\small\verb%?- (PRE m = m) = (m = 0)%}, -applying the tactic -{\par\samepage\setseps\small -\begin{verbatim} - DISJ_CASES_THEN ASSUME_TAC th -\end{verbatim} -} -\noindent produces two subgoals, each with one disjunct as an added -assumption: -{\par\samepage\setseps\small -\begin{verbatim} - ?n. m = SUC n ?- (PRE m = m) = (m = 0) - - m = 0 ?- (PRE m = m) = (m = 0) -\end{verbatim} -} -\USES -Building cases tactics. For example, {\small\verb%DISJ_CASES_TAC%} could be defined by: -{\par\samepage\setseps\small -\begin{verbatim} - let DISJ_CASES_TAC = DISJ_CASES_THEN ASSUME_TAC -\end{verbatim} -} -\COMMENTS -Use {\small\verb%DISJ_CASES_THEN2%} to apply different tactic generating functions -to each case. - -\SEEALSO -STRIP_THM_THEN, CHOOSE_THEN, CONJUNCTS_THEN, CONJUNCTS_THEN2, -DISJ_CASES_TAC, DISJ_CASES_THEN2, DISJ_CASES_THENL. - -\ENDDOC \DOC{DISJ\_CASES\_THEN2} \TYPE {\small\verb%DISJ_CASES_THEN2 : (thm_tactic -> thm_tactical)%}\egroup @@ -6156,21 +5804,92 @@ STRIP_THM_THEN, CHOOSE_THEN, CONJUNCTS_T DISJ_CASES_THEN, DISJ_CASES_THENL. \ENDDOC -\DOC{DISJ\_CASES\_THENL} +\DOC{DISJ\_CASES\_THEN} -\TYPE {\small\verb%DISJ_CASES_THENL : (thm_tactic list -> thm_tactic)%}\egroup +\TYPE {\small\verb%DISJ_CASES_THEN : thm_tactical%}\egroup \SYNOPSIS -Applies theorem-tactics in a list to the corresponding disjuncts in a theorem. +Applies a theorem-tactic to each disjunct of a disjunctive theorem. \DESCRIBE -If the theorem-tactics {\small\verb%f1...fn%} applied to the {\small\verb%ASSUME%}d disjuncts of a -theorem +If the theorem-tactic {\small\verb%f:thm->tactic%} applied to either +{\small\verb%ASSUME%}d disjunct produces results as follows when applied to a goal +{\small\verb%(A ?- t)%}: {\par\samepage\setseps\small \begin{verbatim} - |- d1 \/ d2 \/...\/ dn -\end{verbatim} -} + A ?- t A ?- t + ========= f (u |- u) and ========= f (v |- v) + A ?- t1 A ?- t2 +\end{verbatim} +} +\noindent then applying {\small\verb%DISJ_CASES_THEN f (|- u \/ v)%} +to the goal {\small\verb%(A ?- t)%} produces two subgoals. +{\par\samepage\setseps\small +\begin{verbatim} + A ?- t + ====================== DISJ_CASES_THEN f (|- u \/ v) + A ?- t1 A ?- t2 +\end{verbatim} +} +\FAILURE +Fails if the theorem is not a disjunction. An invalid tactic is +produced if the theorem has any hypothesis which is not +alpha-convertible to an assumption of the goal. + +\EXAMPLE +Given the theorem +{\par\samepage\setseps\small +\begin{verbatim} + th = |- (m = 0) \/ (?n. m = SUC n) +\end{verbatim} +} +\noindent and a goal of the form {\small\verb%?- (PRE m = m) = (m = 0)%}, +applying the tactic +{\par\samepage\setseps\small +\begin{verbatim} + DISJ_CASES_THEN ASSUME_TAC th +\end{verbatim} +} +\noindent produces two subgoals, each with one disjunct as an added +assumption: +{\par\samepage\setseps\small +\begin{verbatim} + ?n. m = SUC n ?- (PRE m = m) = (m = 0) + + m = 0 ?- (PRE m = m) = (m = 0) +\end{verbatim} +} +\USES +Building cases tactics. For example, {\small\verb%DISJ_CASES_TAC%} could be defined by: +{\par\samepage\setseps\small +\begin{verbatim} + let DISJ_CASES_TAC = DISJ_CASES_THEN ASSUME_TAC +\end{verbatim} +} +\COMMENTS +Use {\small\verb%DISJ_CASES_THEN2%} to apply different tactic generating functions +to each case. + +\SEEALSO +STRIP_THM_THEN, CHOOSE_THEN, CONJUNCTS_THEN, CONJUNCTS_THEN2, +DISJ_CASES_TAC, DISJ_CASES_THEN2, DISJ_CASES_THENL. + +\ENDDOC +\DOC{DISJ\_CASES\_THENL} + +\TYPE {\small\verb%DISJ_CASES_THENL : (thm_tactic list -> thm_tactic)%}\egroup + +\SYNOPSIS +Applies theorem-tactics in a list to the corresponding disjuncts in a theorem. + +\DESCRIBE +If the theorem-tactics {\small\verb%f1...fn%} applied to the {\small\verb%ASSUME%}d disjuncts of a +theorem +{\par\samepage\setseps\small +\begin{verbatim} + |- d1 \/ d2 \/...\/ dn +\end{verbatim} +} \noindent produce results as follows when applied to a goal {\small\verb%(A ?- t)%}: {\par\samepage\setseps\small \begin{verbatim} @@ -6211,103 +5930,352 @@ DISJ_CASES_THEN, DISJ_CASES_THEN2, STRIP \TYPE {\small\verb%DISJ_CASES_UNION : (thm -> thm -> thm -> thm)%}\egroup \SYNOPSIS -Makes an inference for each arm of a disjunct. +Makes an inference for each arm of a disjunct. + +\DESCRIBE +Given a disjunctive theorem, and two additional theorems each having one +disjunct as a hypothesis, a new theorem with a conclusion that is the +disjunction of the conclusions of the last two theorems is produced. The +hypotheses include the union of hypotheses of all three theorems less the two +disjuncts. +{\par\samepage\setseps\small +\begin{verbatim} + A |- t1 \/ t2 A1 u {t1} |- t3 A2 u {t2} |- t4 + ------------------------------------------------------ DISJ_CASES_UNION + A u A1 u A2 |- t3 \/ t4 +\end{verbatim} +} +\FAILURE +Fails if the first theorem is not a disjunction. + +\EXAMPLE +The built-in theorem {\small\verb%LESS_CASES%} can be specialized to: +{\par\samepage\setseps\small +\begin{verbatim} + th1 = |- m < n \/ n <= m +\end{verbatim} +} +\noindent and used with two additional theorems: +{\par\samepage\setseps\small +\begin{verbatim} + th2 = (m < n |- (m MOD n = m)) + th3 = ({0 < n, n <= m} |- (m MOD n) = ((m - n) MOD n)) +\end{verbatim} +} +\noindent to derive a new theorem: +{\par\samepage\setseps\small +\begin{verbatim} + #DISJ_CASES_UNION th1 th2 th3;; + ["0 < n"] |- (m MOD n = m) \/ (m MOD n = (m - n) MOD n) +\end{verbatim} +} +\SEEALSO +DISJ_CASES, DISJ_CASES_TAC, DISJ1, DISJ2. + +\ENDDOC +\DOC{DISJ\_IMP} + +\TYPE {\small\verb%DISJ_IMP : (thm -> thm)%}\egroup + +\SYNOPSIS +Converts a disjunctive theorem to an equivalent implicative theorem. + +\DESCRIBE +The left disjunct of a disjunctive theorem becomes the negated +antecedent of the newly generated theorem. +{\par\samepage\setseps\small +\begin{verbatim} + A |- t1 \/ t2 + ----------------- DISJ_IMP + A |- ~t1 ==> t2 +\end{verbatim} +} +\FAILURE +Fails if the theorem is not a disjunction. + +\EXAMPLE +Specializing the built-in theorem {\small\verb%LESS_CASES%} gives the theorem: +{\par\samepage\setseps\small +\begin{verbatim} + th = |- m < n \/ n <= m +\end{verbatim} +} +\noindent to which {\small\verb%DISJ_IMP%} may be applied: +{\par\samepage\setseps\small +\begin{verbatim} + #DISJ_IMP th;; + |- ~m < n ==> n <= m +\end{verbatim} +} +\SEEALSO +DISJ_CASES. + +\ENDDOC +\DOC{disjuncts} + +\TYPE {\small\verb%disjuncts : (term -> term list)%}\egroup + +\SYNOPSIS +Iteratively breaks apart a disjunction. + +\DESCRIBE +{\small\verb%disjuncts "t1 \/ ... \/ tn"%} returns {\small\verb%["t1";...;"tn"]%}. +The argument term may be any tree of disjunctions; +it need not have the form {\small\verb%"t1 \/ (t2 \/ ( ... \/ tn)...)"%}. +A term that is not a disjunction is simply returned as the sole element of a +list. Note that +{\par\samepage\setseps\small +\begin{verbatim} + disjuncts(list_mk_disj(["t1";...;"tn"])) +\end{verbatim} +} +\noindent will not return {\small\verb%["t1";...;"tn"]%} if any of {\small\verb%t1%},...,{\small\verb%tn%} are +disjunctions. + +\FAILURE +Never fails. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#list_mk_disj ["a \/ b";"c \/ d";"e \/ f"];; +"(a \/ b) \/ (c \/ d) \/ e \/ f" : term + +#disjuncts it;; +["a"; "b"; "c"; "d"; "e"; "f"] : term list + +#list_mk_disj it;; +"a \/ b \/ c \/ d \/ e \/ f" : term + +#disjuncts "1";; +["1"] : term list +\end{verbatim} +} +\COMMENTS +Because {\small\verb%disjuncts%} splits both the left and right sides of a disjunction, +this operation is not the inverse of {\small\verb%list_mk_disj%}. It may be useful to +introduce {\small\verb%list_dest_disj%} for splitting only the right tails of a disjunction. + +\SEEALSO +list_mk_disj, dest_disj. + +\ENDDOC +\DOC{distinct} + +\TYPE {\small\verb%distinct : (* list -> bool)%}\egroup + +\SYNOPSIS +Checks whether the elements of a list are all distinct. + +\DESCRIBE +If all the elements in a list are distinct, returns {\small\verb%true%}, otherwise returns +{\small\verb%false%}. + +\FAILURE +Never fails. + +\SEEALSO +setify. + +\ENDDOC +\DOC{/} + +\TYPE {\small\verb%$/ : ((int # int) -> int)%}\egroup + +\SYNOPSIS +Performs division on ML integers. + +\FAILURE +Fails on division by zero. + +\ENDDOC +\DOC{<<} + +\TYPE {\small\verb%$<< : ((* # **) -> bool)%}\egroup + +\SYNOPSIS +Performs a lexical comparison of values. + +\DESCRIBE +{\small\verb%$<<%} performs a fast ordering on values. It is substitutive with +respect to equality in ML (i.e. if {\small\verb%x << y%} and {\small\verb%x = x'%} and {\small\verb%y = y'%} +then {\small\verb%x' << y'%}). + +\FAILURE +Never fails. + +\USES +It is often useful, for example in normalizing terms in some way, to be able to +impose some arbitrary (but definite) ordering on ML values. + +\SEEALSO +=. + +\ENDDOC +\DOC{<} + +\TYPE {\small\verb%$< : ((int # int) -> bool)%}\egroup + +\SYNOPSIS +Performs a less-than test on ML integers. + +\FAILURE +Never fails. + +\ENDDOC +\DOC{=} + +\TYPE {\small\verb%$= : ((* # *) -> bool)%}\egroup + +\SYNOPSIS +Performs an equality test on two ML values. + +\DESCRIBE +{\small\verb%$=%} works as expected on non-function types. It may give unexpected results +when applied to function types (or types containing them, such as a pair of +functions), and should be considered unreliable in those situations. + +\FAILURE +Never fails. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#1 = 2;; +false : bool + +#1 = 1;; +true : bool + +#let f x = x + 1 and g x = x + 2;; +f = - : (int -> int) +g = - : (int -> int) + +#let f' = f and h x = f x and h' x = x + 1;; +f' = - : (int -> int) +h = - : (int -> int) +h' = - : (int -> int) + +#f=f;; +true : bool + +#f = f';; +true : bool + +#f = g;; +false : bool + +#f =h;; +false : bool + +#f=h';; +false : bool + +#h = h';; +false : bool +\end{verbatim} +} +\ENDDOC +\DOC{>} + +\TYPE {\small\verb%$> : ((int # int) -> bool)%}\egroup + +\SYNOPSIS +Performs a greater-than test on ML integers. + +\FAILURE +Never fails. + +\ENDDOC +\DOC{-} + +\TYPE {\small\verb%$- : ((int # int) -> int)%}\egroup + +\SYNOPSIS +Performs subtraction on ML integers. + +\FAILURE +Never fails. + +\COMMENTS +Unary {\small\verb%-%} exists as an internal parser object, but not as a function. So, +whilst typing in {\small\verb%-1;;%} will work, {\small\verb%-;;%} will return a parse error. + +\ENDDOC +\DOC{\char'056} + +\TYPE {\small\verb%$. : ((* # * list) -> * list)%}\egroup + +\SYNOPSIS +Adds single element to the head of a list. + +\DESCRIBE +The {\small\verb%.%} operator is an infixed primitive list constructor, analogous to {\small\verb%CONS%} +in LISP. Its effect is {\small\verb%x . [x1;....;xn]%} = {\small\verb%[x;x1;...;xn]%}. + +\FAILURE +Never fails. + +\ENDDOC +\DOC{\char'100} + +\TYPE {\small\verb%$@ : ((* list # * list) -> * list)%}\egroup + +\SYNOPSIS +Concatenates two lists. \DESCRIBE -Given a disjunctive theorem, and two additional theorems each having one -disjunct as a hypothesis, a new theorem with a conclusion that is the -disjunction of the conclusions of the last two theorems is produced. The -hypotheses include the union of hypotheses of all three theorems less the two -disjuncts. -{\par\samepage\setseps\small -\begin{verbatim} - A |- t1 \/ t2 A1 u {t1} |- t3 A2 u {t2} |- t4 - ------------------------------------------------------ DISJ_CASES_UNION - A u A1 u A2 |- t3 \/ t4 -\end{verbatim} -} +{\small\verb%@%} is an infix operator which concatenates two lists. + \FAILURE -Fails if the first theorem is not a disjunction. +Never fails. \EXAMPLE -The built-in theorem {\small\verb%LESS_CASES%} can be specialized to: -{\par\samepage\setseps\small -\begin{verbatim} - th1 = |- m < n \/ n <= m -\end{verbatim} -} -\noindent and used with two additional theorems: -{\par\samepage\setseps\small -\begin{verbatim} - th2 = (m < n |- (m MOD n = m)) - th3 = ({0 < n, n <= m} |- (m MOD n) = ((m - n) MOD n)) -\end{verbatim} -} -\noindent to derive a new theorem: {\par\samepage\setseps\small \begin{verbatim} - #DISJ_CASES_UNION th1 th2 th3;; - ["0 < n"] |- (m MOD n = m) \/ (m MOD n = (m - n) MOD n) +#[1;2;3] @ [4;5;6];; +[1; 2; 3; 4; 5; 6] : int list \end{verbatim} } \SEEALSO -DISJ_CASES, DISJ_CASES_TAC, DISJ1, DISJ2. +append. \ENDDOC -\DOC{DISJ\_IMP} +\DOC{*} -\TYPE {\small\verb%DISJ_IMP : (thm -> thm)%}\egroup +\TYPE {\small\verb%$* : ((int # int) -> int)%}\egroup \SYNOPSIS -Converts a disjunctive theorem to an equivalent implicative theorem. +Performs multiplication on ML integers. -\DESCRIBE -The left disjunct of a disjunctive theorem becomes the negated -antecedent of the newly generated theorem. -{\par\samepage\setseps\small -\begin{verbatim} - A |- t1 \/ t2 - ----------------- DISJ_IMP - A |- ~t1 ==> t2 -\end{verbatim} -} \FAILURE -Fails if the theorem is not a disjunction. - -\EXAMPLE -Specializing the built-in theorem {\small\verb%LESS_CASES%} gives the theorem: -{\par\samepage\setseps\small -\begin{verbatim} - th = |- m < n \/ n <= m -\end{verbatim} -} -\noindent to which {\small\verb%DISJ_IMP%} may be applied: -{\par\samepage\setseps\small -\begin{verbatim} - #DISJ_IMP th;; - |- ~m < n ==> n <= m -\end{verbatim} -} -\SEEALSO -DISJ_CASES. +Never fails. \ENDDOC -\DOC{distinct} -\TYPE {\small\verb%distinct : (* list -> bool)%}\egroup +\DOC{\#} -\SYNOPSIS -Checks whether the elements of a list are all distinct. +\TYPE {\small\verb%$# : (((* -> **) # (*** -> ****)) -> (* # ***) -> (** # ****))%}\egroup -\DESCRIBE -If all the elements in a list are distinct, returns {\small\verb%true%}, otherwise returns -{\small\verb%false%}. +\SYNOPSIS +Applies two functions to a pair: {\small\verb%(f # g) (x,y)%} = {\small\verb%(f x, g y)%}. \FAILURE Never fails. \SEEALSO -setify. +B, C, CB, Co, I, K, KI, o, oo, S, W. + +\ENDDOC +\DOC{+} + +\TYPE {\small\verb%$+ : ((int # int) -> int)%}\egroup + +\SYNOPSIS +Performs addition on ML integers. + +\FAILURE +Never fails. \ENDDOC \DOC{do} @@ -6468,6 +6436,38 @@ b, backup, backup_limit, expand, expandf rotate, save_top_thm, set_goal, set_state, top_goal, top_thm, VALID. \ENDDOC +\DOC{EL\_CONV} + +\TYPE {\small\verb%EL_CONV : conv%}\egroup + +\SYNOPSIS +Computes by inference the result of indexing an element from a list. + +\DESCRIBE +For any object language list of the form {\small\verb%"[x0;...xk;...;xn]"%} , +the result of evaluating +{\par\samepage\setseps\small +\begin{verbatim} + EL_CONV "EL k [x0;...xk;...;xn]" +\end{verbatim} +} +\noindent is the theorem +{\par\samepage\setseps\small +\begin{verbatim} + |- EL k [x0;...;xk;...;xn] = xk +\end{verbatim} +} + + +\FAILURE +{\small\verb%EL_CONV tm%} fails if {\small\verb%tm%} is not of the form described above, +or {\small\verb%k%} is not less than the length of the list. + +\SEEALSO +ELL_CONV + +\ENDDOC + \DOC{el} \TYPE {\small\verb%el : (int -> * list -> *)%}\egroup @@ -6527,38 +6527,6 @@ EL_CONV \ENDDOC -\DOC{EL\_CONV} - -\TYPE {\small\verb%EL_CONV : conv%}\egroup - -\SYNOPSIS -Computes by inference the result of indexing an element from a list. - -\DESCRIBE -For any object language list of the form {\small\verb%"[x0;...xk;...;xn]"%} , -the result of evaluating -{\par\samepage\setseps\small -\begin{verbatim} - EL_CONV "EL k [x0;...xk;...;xn]" -\end{verbatim} -} -\noindent is the theorem -{\par\samepage\setseps\small -\begin{verbatim} - |- EL k [x0;...;xk;...;xn] = xk -\end{verbatim} -} - - -\FAILURE -{\small\verb%EL_CONV tm%} fails if {\small\verb%tm%} is not of the form described above, -or {\small\verb%k%} is not less than the length of the list. - -\SEEALSO -ELL_CONV - -\ENDDOC - \DOC{end\_itlist} \TYPE {\small\verb%end_itlist : ((* -> * -> *) -> * list -> *)%}\egroup @@ -6656,51 +6624,6 @@ Fails if the argument theorem is not a n EQF_ELIM, EQT_ELIM, EQT_INTRO. \ENDDOC -\DOC{EQT\_ELIM} - -\TYPE {\small\verb%EQT_ELIM : (thm -> thm)%}\egroup - -\SYNOPSIS -Eliminates equality with {\small\verb%T%}. - -\DESCRIBE -{\par\samepage\setseps\small -\begin{verbatim} - A |- tm = T - ------------- EQT_ELIM - A |- tm -\end{verbatim} -} -\FAILURE -Fails if the argument theorem is not of the form {\small\verb%A |- tm = T%}. - -\SEEALSO -EQT_INTRO, EQF_ELIM, EQF_INTRO. - -\ENDDOC -\DOC{EQT\_INTRO} - -\TYPE {\small\verb%EQT_INTRO : (thm -> thm)%}\egroup - -\SYNOPSIS -Introduces equality with {\small\verb%T%}. - -\DESCRIBE -{\par\samepage\setseps\small -\begin{verbatim} - A |- tm - ------------- EQF_INTRO - A |- tm = T -\end{verbatim} -} - -\FAILURE -Never fails. - -\SEEALSO -EQT_ELIM, EQF_ELIM, EQF_INTRO. - -\ENDDOC \DOC{EQ\_IMP\_RULE} \TYPE {\small\verb%EQ_IMP_RULE : (thm -> (thm # thm))%}\egroup @@ -6840,37 +6763,82 @@ rule {\small\verb%EQ_MP%} returns the th \end{verbatim} } \FAILURE -Fails unless the first theorem is equational and its left side -is the same as the conclusion of the second theorem (and is therefore -of type {\small\verb%bool%}), up to alpha-conversion. +Fails unless the first theorem is equational and its left side +is the same as the conclusion of the second theorem (and is therefore +of type {\small\verb%bool%}), up to alpha-conversion. + +\SEEALSO +EQ_IMP_RULE, IMP_ANTISYM_RULE, MP. + +\ENDDOC +\DOC{EQ\_TAC} + +\TYPE {\small\verb%EQ_TAC : tactic%}\egroup + +\SYNOPSIS +Reduces goal of equality of boolean terms to forward and backward implication. + +\DESCRIBE +When applied to a goal {\small\verb%A ?- t1 = t2%}, where {\small\verb%t1%} and {\small\verb%t2%} have type {\small\verb%bool%}, +the tactic {\small\verb%EQ_TAC%} returns the subgoals {\small\verb%A ?- t1 ==> t2%} and +{\small\verb%A ?- t2 ==> t1%}. +{\par\samepage\setseps\small +\begin{verbatim} + A ?- t1 = t2 + ================================= EQ_TAC + A ?- t1 ==> t2 A ?- t2 ==> t1 +\end{verbatim} +} +\FAILURE +Fails unless the conclusion of the goal is an equation between boolean terms. + +\SEEALSO +EQ_IMP_RULE, IMP_ANTISYM_RULE. + +\ENDDOC +\DOC{EQT\_ELIM} + +\TYPE {\small\verb%EQT_ELIM : (thm -> thm)%}\egroup + +\SYNOPSIS +Eliminates equality with {\small\verb%T%}. + +\DESCRIBE +{\par\samepage\setseps\small +\begin{verbatim} + A |- tm = T + ------------- EQT_ELIM + A |- tm +\end{verbatim} +} +\FAILURE +Fails if the argument theorem is not of the form {\small\verb%A |- tm = T%}. \SEEALSO -EQ_IMP_RULE, IMP_ANTISYM_RULE, MP. +EQT_INTRO, EQF_ELIM, EQF_INTRO. \ENDDOC -\DOC{EQ\_TAC} +\DOC{EQT\_INTRO} -\TYPE {\small\verb%EQ_TAC : tactic%}\egroup +\TYPE {\small\verb%EQT_INTRO : (thm -> thm)%}\egroup \SYNOPSIS -Reduces goal of equality of boolean terms to forward and backward implication. +Introduces equality with {\small\verb%T%}. \DESCRIBE -When applied to a goal {\small\verb%A ?- t1 = t2%}, where {\small\verb%t1%} and {\small\verb%t2%} have type {\small\verb%bool%}, -the tactic {\small\verb%EQ_TAC%} returns the subgoals {\small\verb%A ?- t1 ==> t2%} and -{\small\verb%A ?- t2 ==> t1%}. {\par\samepage\setseps\small \begin{verbatim} - A ?- t1 = t2 - ================================= EQ_TAC - A ?- t1 ==> t2 A ?- t2 ==> t1 + A |- tm + ------------- EQF_INTRO + A |- tm = T \end{verbatim} } + \FAILURE -Fails unless the conclusion of the goal is an equation between boolean terms. +Never fails. \SEEALSO -EQ_IMP_RULE, IMP_ANTISYM_RULE. +EQT_ELIM, EQF_ELIM, EQF_INTRO. \ENDDOC \DOC{ETA\_CONV} @@ -6888,37 +6856,6 @@ to the theorem {\small\verb%|- (\x. t x) Fails if the input term is not an eta-redex. \ENDDOC -\DOC{EVERY} - -\TYPE {\small\verb%EVERY : (tactic list -> tactic)%}\egroup - -\SYNOPSIS -Sequentially applies all the tactics in a given list of tactics. - -\DESCRIBE -When applied to a list of tactics {\small\verb%[T1; ... ;Tn]%}, and a goal {\small\verb%g%}, the tactical -{\small\verb%EVERY%} applies each tactic in sequence to every -subgoal generated by the previous one. This can be represented as: -{\par\samepage\setseps\small -\begin{verbatim} - EVERY [T1;...;Tn] = T1 THEN ... THEN Tn -\end{verbatim} -} -\noindent If the tactic list is empty, the resulting tactic has no effect. - -\FAILURE -The application of {\small\verb%EVERY%} to a tactic list never fails. The resulting -tactic fails iff any of the component tactics do. - -\COMMENTS -It is possible to use {\small\verb%EVERY%} instead of {\small\verb%THEN%}, but probably -stylistically inferior. {\small\verb%EVERY%} is more useful when applied to a list of -tactics generated by a function. - -\SEEALSO -FIRST, MAP_EVERY, THEN. - -\ENDDOC \DOC{EVERY\_ASSUM} \TYPE {\small\verb%EVERY_ASSUM : (thm_tactic -> tactic)%}\egroup @@ -6973,6 +6910,37 @@ is, {\small\verb%EVERY_CONV [] "t"%} ret THENC. \ENDDOC +\DOC{EVERY} + +\TYPE {\small\verb%EVERY : (tactic list -> tactic)%}\egroup + +\SYNOPSIS +Sequentially applies all the tactics in a given list of tactics. + +\DESCRIBE +When applied to a list of tactics {\small\verb%[T1; ... ;Tn]%}, and a goal {\small\verb%g%}, the tactical +{\small\verb%EVERY%} applies each tactic in sequence to every +subgoal generated by the previous one. This can be represented as: +{\par\samepage\setseps\small +\begin{verbatim} + EVERY [T1;...;Tn] = T1 THEN ... THEN Tn +\end{verbatim} +} +\noindent If the tactic list is empty, the resulting tactic has no effect. + +\FAILURE +The application of {\small\verb%EVERY%} to a tactic list never fails. The resulting +tactic fails iff any of the component tactics do. + +\COMMENTS +It is possible to use {\small\verb%EVERY%} instead of {\small\verb%THEN%}, but probably +stylistically inferior. {\small\verb%EVERY%} is more useful when applied to a list of +tactics generated by a function. + +\SEEALSO +FIRST, MAP_EVERY, THEN. + +\ENDDOC \DOC{EVERY\_TCL} \TYPE {\small\verb%EVERY_TCL : (thm_tactical list -> thm_tactical)%}\egroup @@ -7035,43 +7003,43 @@ Fails unless the conclusion of the theor EXISTS_UNIQUE_CONV. \ENDDOC -\DOC{EXISTS} +\DOC{EXISTS\_AND\_CONV} -\TYPE {\small\verb%EXISTS : ((term # term) -> thm -> thm)%}\egroup +\TYPE {\small\verb%EXISTS_AND_CONV : conv%}\egroup \SYNOPSIS -Introduces existential quantification given a particular witness. +Moves an existential quantification inwards through a conjunction. \DESCRIBE -When applied to a pair of terms and a theorem, the first term an existentially -quantified pattern indicating the desired form of the result, and the second a -witness whose substitution for the quantified variable gives a term which is -the same as the conclusion of the theorem, {\small\verb%EXISTS%} gives the desired theorem. +When applied to a term of the form {\small\verb%?x. P /\ Q%}, where {\small\verb%x%} is not free in both +{\small\verb%P%} and {\small\verb%Q%}, {\small\verb%EXISTS_AND_CONV%} returns a theorem of one of three forms, +depending on occurrences of the variable {\small\verb%x%} in {\small\verb%P%} and {\small\verb%Q%}. If {\small\verb%x%} is free +in {\small\verb%P%} but not in {\small\verb%Q%}, then the theorem: {\par\samepage\setseps\small \begin{verbatim} - A |- p[u/x] - ------------- EXISTS ("?x. p","u") - A |- ?x. p + |- (?x. P /\ Q) = (?x.P) /\ Q \end{verbatim} } -\FAILURE -Fails unless the substituted pattern is the same as the conclusion of the -theorem. - -\EXAMPLE -The following examples illustrate how it is possible to deduce different -things from the same theorem: +\noindent is returned. If {\small\verb%x%} is free in {\small\verb%Q%} but not in {\small\verb%P%}, then the +result is: {\par\samepage\setseps\small \begin{verbatim} - #EXISTS ("?x. x=T","T") (REFL "T");; - |- ?x. x = T - - #EXISTS ("?x:bool. x=x","T") (REFL "T");; - |- ?x. x = x + |- (?x. P /\ Q) = P /\ (?x.Q) +\end{verbatim} +} +\noindent And if {\small\verb%x%} is free in neither {\small\verb%P%} nor {\small\verb%Q%}, then the result is: +{\par\samepage\setseps\small +\begin{verbatim} + |- (?x. P /\ Q) = (?x.P) /\ (?x.Q) \end{verbatim} } +\FAILURE +{\small\verb%EXISTS_AND_CONV%} fails if it is applied to a term not of the form +{\small\verb%?x. P /\ Q%}, or if it is applied to a term {\small\verb%?x. P /\ Q%} in which the +variable {\small\verb%x%} is free in both {\small\verb%P%} and {\small\verb%Q%}. + \SEEALSO -CHOOSE, EXISTS_TAC. +AND_EXISTS_CONV, LEFT_AND_EXISTS_CONV, RIGHT_AND_EXISTS_CONV. \ENDDOC \DOC{exists} @@ -7093,43 +7061,43 @@ Never fails. forall, find, tryfind, mem, assoc, rev_assoc. \ENDDOC -\DOC{EXISTS\_AND\_CONV} +\DOC{EXISTS} -\TYPE {\small\verb%EXISTS_AND_CONV : conv%}\egroup +\TYPE {\small\verb%EXISTS : ((term # term) -> thm -> thm)%}\egroup \SYNOPSIS -Moves an existential quantification inwards through a conjunction. +Introduces existential quantification given a particular witness. \DESCRIBE -When applied to a term of the form {\small\verb%?x. P /\ Q%}, where {\small\verb%x%} is not free in both -{\small\verb%P%} and {\small\verb%Q%}, {\small\verb%EXISTS_AND_CONV%} returns a theorem of one of three forms, -depending on occurrences of the variable {\small\verb%x%} in {\small\verb%P%} and {\small\verb%Q%}. If {\small\verb%x%} is free -in {\small\verb%P%} but not in {\small\verb%Q%}, then the theorem: -{\par\samepage\setseps\small -\begin{verbatim} - |- (?x. P /\ Q) = (?x.P) /\ Q -\end{verbatim} -} -\noindent is returned. If {\small\verb%x%} is free in {\small\verb%Q%} but not in {\small\verb%P%}, then the -result is: +When applied to a pair of terms and a theorem, the first term an existentially +quantified pattern indicating the desired form of the result, and the second a +witness whose substitution for the quantified variable gives a term which is +the same as the conclusion of the theorem, {\small\verb%EXISTS%} gives the desired theorem. {\par\samepage\setseps\small \begin{verbatim} - |- (?x. P /\ Q) = P /\ (?x.Q) + A |- p[u/x] + ------------- EXISTS ("?x. p","u") + A |- ?x. p \end{verbatim} } -\noindent And if {\small\verb%x%} is free in neither {\small\verb%P%} nor {\small\verb%Q%}, then the result is: +\FAILURE +Fails unless the substituted pattern is the same as the conclusion of the +theorem. + +\EXAMPLE +The following examples illustrate how it is possible to deduce different +things from the same theorem: {\par\samepage\setseps\small \begin{verbatim} - |- (?x. P /\ Q) = (?x.P) /\ (?x.Q) + #EXISTS ("?x. x=T","T") (REFL "T");; + |- ?x. x = T + + #EXISTS ("?x:bool. x=x","T") (REFL "T");; + |- ?x. x = x \end{verbatim} } -\FAILURE -{\small\verb%EXISTS_AND_CONV%} fails if it is applied to a term not of the form -{\small\verb%?x. P /\ Q%}, or if it is applied to a term {\small\verb%?x. P /\ Q%} in which the -variable {\small\verb%x%} is free in both {\small\verb%P%} and {\small\verb%Q%}. - \SEEALSO -AND_EXISTS_CONV, LEFT_AND_EXISTS_CONV, RIGHT_AND_EXISTS_CONV. +CHOOSE, EXISTS_TAC. \ENDDOC \DOC{EXISTS\_EQ} @@ -7191,32 +7159,6 @@ true' and `there is a greatest number su EXISTS_LEAST_CONV. \ENDDOC -\DOC{EXISTS\_IMP} - -\TYPE {\small\verb%EXISTS_IMP : (term -> thm -> thm)%}\egroup - -\SYNOPSIS -Existentially quantifies both the antecedent and consequent of an implication. - -\DESCRIBE -When applied to a variable {\small\verb%x%} and a theorem {\small\verb%A |- t1 ==> t2%}, the -inference rule {\small\verb%EXISTS_IMP%} returns the theorem {\small\verb%A |- (?x. t1) ==> (?x. t2)%}, -provided {\small\verb%x%} is not free in the assumptions. -{\par\samepage\setseps\small -\begin{verbatim} - A |- t1 ==> t2 - -------------------------- EXISTS_IMP "x" [where x is not free in A] - A |- (?x.t1) ==> (?x.t2) -\end{verbatim} -} -\FAILURE -Fails if the theorem is not implicative, or if the term is not a variable, or -if the term is a variable but is free in the assumption list. - -\SEEALSO -EXISTS_EQ. - -\ENDDOC \DOC{EXISTS\_IMP\_CONV} \TYPE {\small\verb%EXISTS_IMP_CONV : conv%}\egroup @@ -7256,6 +7198,32 @@ variable {\small\verb%x%} is free in bot LEFT_IMP_FORALL_CONV, RIGHT_IMP_EXISTS_CONV. \ENDDOC +\DOC{EXISTS\_IMP} + +\TYPE {\small\verb%EXISTS_IMP : (term -> thm -> thm)%}\egroup + +\SYNOPSIS +Existentially quantifies both the antecedent and consequent of an implication. + +\DESCRIBE +When applied to a variable {\small\verb%x%} and a theorem {\small\verb%A |- t1 ==> t2%}, the +inference rule {\small\verb%EXISTS_IMP%} returns the theorem {\small\verb%A |- (?x. t1) ==> (?x. t2)%}, +provided {\small\verb%x%} is not free in the assumptions. +{\par\samepage\setseps\small +\begin{verbatim} + A |- t1 ==> t2 + -------------------------- EXISTS_IMP "x" [where x is not free in A] + A |- (?x.t1) ==> (?x.t2) +\end{verbatim} +} +\FAILURE +Fails if the theorem is not implicative, or if the term is not a variable, or +if the term is a variable but is free in the assumption list. + +\SEEALSO +EXISTS_EQ. + +\ENDDOC \DOC{EXISTS\_LEAST\_CONV} \TYPE {\small\verb%EXISTS_LEAST_CONV : conv%}\egroup @@ -7779,30 +7747,12 @@ pow2 = - : (int -> int) \end{verbatim} } \COMMENTS -This function is extremely dependent on the version of Lisp used, and its -behaviour should not be relied upon; it may not work at all in Lisps other than -Franz. It is questionable whether it is ever worthwhile to use it anyway, -because although it cannot compromise the consistency of the logic, it can -lead to confusing failures if one is manipulating numbers larger than the word -size of the machine. - -\ENDDOC -\DOC{filter} - -\TYPE {\small\verb%filter : ((* -> bool) -> * list -> * list)%}\egroup - -\SYNOPSIS -Filters a list to the sublist of elements satisfying a predicate. - -\DESCRIBE -{\small\verb%filter p l%} applies {\small\verb%p%} to every element of {\small\verb%l%}, returning a list of those -that satisfy {\small\verb%p%}, in the order they appeared in the original list. - -\FAILURE -Never fails. - -\SEEALSO -mapfilter, partition, remove. +This function is extremely dependent on the version of Lisp used, and its +behaviour should not be relied upon; it may not work at all in Lisps other than +Franz. It is questionable whether it is ever worthwhile to use it anyway, +because although it cannot compromise the consistency of the logic, it can +lead to confusing failures if one is manipulating numbers larger than the word +size of the machine. \ENDDOC \DOC{FILTER\_ASM\_REWRITE\_RULE} @@ -8018,6 +7968,24 @@ DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, STRIP_TAC, UNDISCH, UNDISCH_ALL, UNDISCH_TAC. \ENDDOC +\DOC{filter} + +\TYPE {\small\verb%filter : ((* -> bool) -> * list -> * list)%}\egroup + +\SYNOPSIS +Filters a list to the sublist of elements satisfying a predicate. + +\DESCRIBE +{\small\verb%filter p l%} applies {\small\verb%p%} to every element of {\small\verb%l%}, returning a list of those +that satisfy {\small\verb%p%}, in the order they appeared in the original list. + +\FAILURE +Never fails. + +\SEEALSO +mapfilter, partition, remove. + +\ENDDOC \DOC{FILTER\_GEN\_TAC} \TYPE {\small\verb%FILTER_GEN_TAC : (term -> tactic)%}\egroup @@ -8587,61 +8555,6 @@ Fails if the named theory file cannot be find_file, find_ml_file, search_path, set_search_path. \ENDDOC -\DOC{FIRST} - -\TYPE {\small\verb%FIRST : (tactic list -> tactic)%}\egroup - -\SYNOPSIS -Applies the first tactic in a tactic list which succeeds. - -\DESCRIBE -When applied to a list of tactics {\small\verb%[T1;...;Tn]%}, and a goal {\small\verb%g%}, the tactical -{\small\verb%FIRST%} tries applying the tactics to the goal until one succeeds. If the -first tactic which succeeds is {\small\verb%Tm%}, then the effect is the same as just {\small\verb%Tm%}. -Thus {\small\verb%FIRST%} effectively behaves as follows: -{\par\samepage\setseps\small -\begin{verbatim} - FIRST [T1;...;Tn] = T1 ORELSE ... ORELSE Tn -\end{verbatim} -} -\FAILURE -The application of {\small\verb%FIRST%} to a tactic list never fails. The resulting -tactic fails iff all the component tactics do when applied to the goal, -or if the tactic list is empty. - -\SEEALSO -EVERY, ORELSE. - -\ENDDOC -\DOC{FIRSTN\_CONV} - -\TYPE {\small\verb%FIRSTN_CONV : conv%}\egroup - -\SYNOPSIS -Computes by inference the result of taking the initial n elements of a list. - -\DESCRIBE -For any object language list of the form {\small\verb%"[x0;...x(n-k);...;x(n-1)]"%} , -the result of evaluating -{\par\samepage\setseps\small -\begin{verbatim} - FIRSTN_CONV "FIRSTN k [x0;...x(n-k);...;x(n-1)]" -\end{verbatim} -} -\noindent is the theorem -{\par\samepage\setseps\small -\begin{verbatim} - |- FIRSTN k [x0;...;x(n-k);...;x(n-1)] = [x0;...;x(n-k)] -\end{verbatim} -} - - -\FAILURE -{\small\verb%FIRSTN_CONV tm%} fails if {\small\verb%tm%} is not of the form described above, -or {\small\verb%k%} is greater than the length of the list. - -\ENDDOC - \DOC{FIRST\_ASSUM} \TYPE {\small\verb%FIRST_ASSUM : (thm_tactic -> tactic)%}\egroup @@ -8709,6 +8622,61 @@ empty list. ORELSEC. \ENDDOC +\DOC{FIRST} + +\TYPE {\small\verb%FIRST : (tactic list -> tactic)%}\egroup + +\SYNOPSIS +Applies the first tactic in a tactic list which succeeds. + +\DESCRIBE +When applied to a list of tactics {\small\verb%[T1;...;Tn]%}, and a goal {\small\verb%g%}, the tactical +{\small\verb%FIRST%} tries applying the tactics to the goal until one succeeds. If the +first tactic which succeeds is {\small\verb%Tm%}, then the effect is the same as just {\small\verb%Tm%}. +Thus {\small\verb%FIRST%} effectively behaves as follows: +{\par\samepage\setseps\small +\begin{verbatim} + FIRST [T1;...;Tn] = T1 ORELSE ... ORELSE Tn +\end{verbatim} +} +\FAILURE +The application of {\small\verb%FIRST%} to a tactic list never fails. The resulting +tactic fails iff all the component tactics do when applied to the goal, +or if the tactic list is empty. + +\SEEALSO +EVERY, ORELSE. + +\ENDDOC +\DOC{FIRSTN\_CONV} + +\TYPE {\small\verb%FIRSTN_CONV : conv%}\egroup + +\SYNOPSIS +Computes by inference the result of taking the initial n elements of a list. + +\DESCRIBE +For any object language list of the form {\small\verb%"[x0;...x(n-k);...;x(n-1)]"%} , +the result of evaluating +{\par\samepage\setseps\small +\begin{verbatim} + FIRSTN_CONV "FIRSTN k [x0;...x(n-k);...;x(n-1)]" +\end{verbatim} +} +\noindent is the theorem +{\par\samepage\setseps\small +\begin{verbatim} + |- FIRSTN k [x0;...;x(n-k);...;x(n-1)] = [x0;...;x(n-k)] +\end{verbatim} +} + + +\FAILURE +{\small\verb%FIRSTN_CONV tm%} fails if {\small\verb%tm%} is not of the form described above, +or {\small\verb%k%} is greater than the length of the list. + +\ENDDOC + \DOC{FIRST\_TCL} \TYPE {\small\verb%FIRST_TCL : (thm_tactical list -> thm_tactical)%}\egroup @@ -8752,28 +8720,6 @@ A full explanation of the standard flags set_flag. \ENDDOC -\DOC{flat} - -\TYPE {\small\verb%flat : (* list list -> * list)%}\egroup - -\SYNOPSIS -Flattens a list of lists into one long list. - -\DESCRIBE -{\small\verb%flat [l1;...;ln]%} returns {\small\verb%(l1 @ ... @ ln)%} where each li is a list and {\small\verb%@%} -is list concatenation. - -\FAILURE -Never fails. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#flat [[1;2];[3;4;5];[6]];; -[1; 2; 3; 4; 5; 6] : int list -\end{verbatim} -} -\ENDDOC \DOC{FLAT\_CONV} \TYPE {\small\verb%FLAT_CONV : conv%}\egroup @@ -8819,6 +8765,28 @@ FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV. \ENDDOC +\DOC{flat} + +\TYPE {\small\verb%flat : (* list list -> * list)%}\egroup + +\SYNOPSIS +Flattens a list of lists into one long list. + +\DESCRIBE +{\small\verb%flat [l1;...;ln]%} returns {\small\verb%(l1 @ ... @ ln)%} where each li is a list and {\small\verb%@%} +is list concatenation. + +\FAILURE +Never fails. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#flat [[1;2];[3;4;5];[6]];; +[1; 2; 3; 4; 5; 6] : int list +\end{verbatim} +} +\ENDDOC \DOC{FOLDL\_CONV} \TYPE {\small\verb%FOLDL_CONV : conv -> conv%}\egroup @@ -8953,25 +8921,6 @@ FOLDL_CONV, list_FOLD_CONV. \ENDDOC -\DOC{forall} - -\TYPE {\small\verb%forall : ((* -> bool) -> * list -> bool)%}\egroup - -\SYNOPSIS -Tests a list to see if all its elements satisfy a predicate. - -\DESCRIBE -{\small\verb%forall p [x1;...;xn]%} returns {\small\verb%true%} if {\small\verb%(p xi)%} is true for all {\small\verb%xi%} in the -list. Otherwise it returns {\small\verb%false%}. If the list is empty, this function always -returns true. - -\FAILURE -Never fails. - -\SEEALSO -exists, find, tryfind, mem, assoc, rev_assoc. - -\ENDDOC \DOC{FORALL\_AND\_CONV} \TYPE {\small\verb%FORALL_AND_CONV : conv%}\egroup @@ -8994,6 +8943,25 @@ Fails if applied to a term not of the fo AND_FORALL_CONV, LEFT_AND_FORALL_CONV, RIGHT_AND_FORALL_CONV. \ENDDOC +\DOC{forall} + +\TYPE {\small\verb%forall : ((* -> bool) -> * list -> bool)%}\egroup + +\SYNOPSIS +Tests a list to see if all its elements satisfy a predicate. + +\DESCRIBE +{\small\verb%forall p [x1;...;xn]%} returns {\small\verb%true%} if {\small\verb%(p xi)%} is true for all {\small\verb%xi%} in the +list. Otherwise it returns {\small\verb%false%}. If the list is empty, this function always +returns true. + +\FAILURE +Never fails. + +\SEEALSO +exists, find, tryfind, mem, assoc, rev_assoc. + +\ENDDOC \DOC{FORALL\_EQ} \TYPE {\small\verb%FORALL_EQ : (term -> thm -> thm)%}\egroup @@ -9113,13 +9081,49 @@ result is: |- (!x. P \/ Q) = (!x.P) \/ (!x.Q) \end{verbatim} } -\FAILURE -{\small\verb%FORALL_OR_CONV%} fails if it is applied to a term not of the form -{\small\verb%!x. P \/ Q%}, or if it is applied to a term {\small\verb%!x. P \/ Q%} in which the -variable {\small\verb%x%} is free in both {\small\verb%P%} and {\small\verb%Q%}. - +\FAILURE +{\small\verb%FORALL_OR_CONV%} fails if it is applied to a term not of the form +{\small\verb%!x. P \/ Q%}, or if it is applied to a term {\small\verb%!x. P \/ Q%} in which the +variable {\small\verb%x%} is free in both {\small\verb%P%} and {\small\verb%Q%}. + +\SEEALSO +OR_FORALL_CONV, LEFT_OR_FORALL_CONV, RIGHT_OR_FORALL_CONV. + +\ENDDOC +\DOC{free\_in} + +\TYPE {\small\verb%free_in : (term -> term -> bool)%}\egroup + +\SYNOPSIS +Tests if one term is free in another. + +\DESCRIBE +When applied to two terms {\small\verb%t1%} and {\small\verb%t2%}, the function {\small\verb%free_in%} returns +{\small\verb%true%} if {\small\verb%t1%} is free in {\small\verb%t2%}, and {\small\verb%false%} otherwise. It is not necessary +that {\small\verb%t1%} be simply a variable. + +\FAILURE +Never fails. + +\EXAMPLE +In the following example {\small\verb%free_in%} returns {\small\verb%false%} because the {\small\verb%x%} in {\small\verb%SUC x%} +in the second term is bound: +{\par\samepage\setseps\small +\begin{verbatim} + #free_in "SUC x" "!x. SUC x = x + 1";; + false : bool +\end{verbatim} +} +\noindent whereas the following call returns {\small\verb%true%} because the first instance +of {\small\verb%x%} in the second term is free, even though there is also a bound instance: +{\par\samepage\setseps\small +\begin{verbatim} + #free_in "x:bool" "x /\ (?x. x=T)";; + true : bool +\end{verbatim} +} \SEEALSO -OR_FORALL_CONV, LEFT_OR_FORALL_CONV, RIGHT_OR_FORALL_CONV. +frees, freesl, thm_frees. \ENDDOC \DOC{frees} @@ -9250,42 +9254,6 @@ resolution and rewriting. ASSUME, IMP_RES_TAC, PROVE_HYP, RES_TAC, REWR_CONV. \ENDDOC -\DOC{free\_in} - -\TYPE {\small\verb%free_in : (term -> term -> bool)%}\egroup - -\SYNOPSIS -Tests if one term is free in another. - -\DESCRIBE -When applied to two terms {\small\verb%t1%} and {\small\verb%t2%}, the function {\small\verb%free_in%} returns -{\small\verb%true%} if {\small\verb%t1%} is free in {\small\verb%t2%}, and {\small\verb%false%} otherwise. It is not necessary -that {\small\verb%t1%} be simply a variable. - -\FAILURE -Never fails. - -\EXAMPLE -In the following example {\small\verb%free_in%} returns {\small\verb%false%} because the {\small\verb%x%} in {\small\verb%SUC x%} -in the second term is bound: -{\par\samepage\setseps\small -\begin{verbatim} - #free_in "SUC x" "!x. SUC x = x + 1";; - false : bool -\end{verbatim} -} -\noindent whereas the following call returns {\small\verb%true%} because the first instance -of {\small\verb%x%} in the second term is free, even though there is also a bound instance: -{\par\samepage\setseps\small -\begin{verbatim} - #free_in "x:bool" "x /\ (?x. x=T)";; - true : bool -\end{verbatim} -} -\SEEALSO -frees, freesl, thm_frees. - -\ENDDOC \DOC{FRONT\_CONJ\_CONV} \TYPE {\small\verb%FRONT_CONJ_CONV: (term list -> term -> thm)%}\egroup @@ -9330,6 +9298,36 @@ Never fails. snd, pair. \ENDDOC +\DOC{FUN\_EQ\_CONV} + +\TYPE {\small\verb%FUN_EQ_CONV : conv%}\egroup + +\SYNOPSIS +Equates normal and extensional equality for two functions. + +\DESCRIBE +The conversion {\small\verb%FUN_EQ_CONV%} embodies the fact that two functions are equal +precisely when they give the same results for all values to which they can be +applied. When supplied with a term argument of the form {\small\verb%f = g%}, where {\small\verb%f%} and +{\small\verb%g%} are functions of type {\small\verb%ty1->ty2%}, {\small\verb%FUN_EQ_CONV%} returns the theorem: +{\par\samepage\setseps\small +\begin{verbatim} + |- (f = g) = (!x. f x = g x) +\end{verbatim} +} +\noindent where {\small\verb%x%} is a variable of type {\small\verb%ty1%} chosen by the conversion. + +\FAILURE +{\small\verb%FUN_EQ_CONV tm%} fails if {\small\verb%tm%} is not an equation {\small\verb%f = g%}, where {\small\verb%f%} and {\small\verb%g%} +are functions. + +\USES +Used for proving equality of functions. + +\SEEALSO +EXT, X_FUN_EQ_CONV. + +\ENDDOC \DOC{funpow} \TYPE {\small\verb%funpow : (int -> (* -> *) -> * -> *)%}\egroup @@ -9384,36 +9382,6 @@ number of times, the application of {\sm \end{verbatim} } \ENDDOC -\DOC{FUN\_EQ\_CONV} - -\TYPE {\small\verb%FUN_EQ_CONV : conv%}\egroup - -\SYNOPSIS -Equates normal and extensional equality for two functions. - -\DESCRIBE -The conversion {\small\verb%FUN_EQ_CONV%} embodies the fact that two functions are equal -precisely when they give the same results for all values to which they can be -applied. When supplied with a term argument of the form {\small\verb%f = g%}, where {\small\verb%f%} and -{\small\verb%g%} are functions of type {\small\verb%ty1->ty2%}, {\small\verb%FUN_EQ_CONV%} returns the theorem: -{\par\samepage\setseps\small -\begin{verbatim} - |- (f = g) = (!x. f x = g x) -\end{verbatim} -} -\noindent where {\small\verb%x%} is a variable of type {\small\verb%ty1%} chosen by the conversion. - -\FAILURE -{\small\verb%FUN_EQ_CONV tm%} fails if {\small\verb%tm%} is not an equation {\small\verb%f = g%}, where {\small\verb%f%} and {\small\verb%g%} -are functions. - -\USES -Used for proving equality of functions. - -\SEEALSO -EXT, X_FUN_EQ_CONV. - -\ENDDOC \DOC{g} \TYPE {\small\verb%g : (term -> void)%}\egroup @@ -9454,120 +9422,6 @@ b, backup, backup_limit, e, expand, expa rotate, save_top_thm, set_goal, set_state, top_goal, top_thm. \ENDDOC -\DOC{GEN} - -\TYPE {\small\verb%GEN : (term -> thm -> thm)%}\egroup - -\SYNOPSIS -Generalizes the conclusion of a theorem. - -\DESCRIBE -When applied to a term {\small\verb%x%} and a theorem {\small\verb%A |- t%}, the inference rule -{\small\verb%GEN%} returns the theorem {\small\verb%A |- !x. t%}, provided {\small\verb%x%} is a variable not -free in any of the assumptions. There is no compulsion that {\small\verb%x%} should -be free in {\small\verb%t%}. -{\par\samepage\setseps\small -\begin{verbatim} - A |- t - ------------ GEN "x" [where x is not free in A] - A |- !x. t -\end{verbatim} -} -\FAILURE -Fails if {\small\verb%x%} is not a variable, or if it is free in any of the assumptions. - -\EXAMPLE -The following example shows how the above side-condition prevents -the derivation of the theorem {\small\verb%x=T |- !x. x=T%}, which is clearly invalid. -{\par\samepage\setseps\small -\begin{verbatim} - #top_print print_all_thm;; - - : (thm -> void) - - #let t = ASSUME "x=T";; - t = x = T |- x = T - - #GEN "x:bool" t;; - evaluation failed GEN -\end{verbatim} -} -\SEEALSO -GENL, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC. - -\ENDDOC -\DOC{GENL} - -\TYPE {\small\verb%GENL : (term list -> thm -> thm)%}\egroup - -\SYNOPSIS -Generalizes zero or more variables in the conclusion of a theorem. - -\DESCRIBE -When applied to a term list {\small\verb%[x1;...;xn]%} and a theorem {\small\verb%A |- t%}, the inference -rule {\small\verb%GENL%} returns the theorem {\small\verb%A |- !x1...xn. t%}, provided none of the -variables {\small\verb%xi%} are free in any of the assumptions. It is not necessary that -any or all of the {\small\verb%xi%} should be free in {\small\verb%t%}. -{\par\samepage\setseps\small -\begin{verbatim} - A |- t - ------------------ GENL "[x1;...;xn]" [where no xi is free in A] - A |- !x1...xn. t -\end{verbatim} -} -\FAILURE -Fails unless all the terms in the list are variables, none of which are -free in the assumption list. - -\SEEALSO -GEN, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC. - -\ENDDOC -\DOC{genvar} - -\TYPE {\small\verb%genvar : (type -> term)%}\egroup - -\SYNOPSIS -Returns a variable whose name has not been used previously. - -\DESCRIBE -When given a type, {\small\verb%genvar%} returns a variable of that type whose name has -not been used for a variable or constant in the HOL session so far. - -\FAILURE -Never fails. - -\EXAMPLE -The following indicates the typical stylized form of the names (this should -not be relied on, of course): -{\par\samepage\setseps\small -\begin{verbatim} - #genvar ":bool";; - "GEN%VAR%357" : term - - #genvar ":num";; - "GEN%VAR%358" : term -\end{verbatim} -} -\noindent Trying to anticipate {\small\verb%genvar%} doesn't work: -{\par\samepage\setseps\small -\begin{verbatim} - #let v = mk_var(`GEN%VAR%359`,":bool");; - v = "GEN%VAR%359" : term - - #genvar ":bool";; - "GEN%VAR%360" : term -\end{verbatim} -} -\USES -The unique variables are useful in writing derived rules, for specializing -terms without having to worry about such things as free variable capture. -If the names are to be visible to a typical user, the function {\small\verb%variant%} can -provide rather more meaningful names. - -\SEEALSO -GSPEC, variant. - -\ENDDOC \DOC{GEN\_ALL} \TYPE {\small\verb%GEN_ALL : (thm -> thm)%}\egroup @@ -9670,21 +9524,89 @@ the following, it acts in the same way a pair, so {\small\verb%FST%} and {\small\verb%SND%} are introduced: {\par\samepage\setseps\small \begin{verbatim} - #GEN_BETA_CONV "(\(x,y). x + y) numpair";; - |- (\(x,y). x + y)numpair = (FST numpair) + (SND numpair) + #GEN_BETA_CONV "(\(x,y). x + y) numpair";; + |- (\(x,y). x + y)numpair = (FST numpair) + (SND numpair) +\end{verbatim} +} +\noindent The introduction of {\small\verb%FST%} and {\small\verb%SND%} will be done more than once as +necessary: +{\par\samepage\setseps\small +\begin{verbatim} + #GEN_BETA_CONV "(\(w,x,y,z). w + x + y + z) (1,triple)";; + |- (\(w,x,y,z). w + (x + (y + z)))(1,triple) = + 1 + ((FST triple) + ((FST(SND triple)) + (SND(SND triple)))) +\end{verbatim} +} +\SEEALSO +BETA_CONV, PAIRED_BETA_CONV. + +\ENDDOC +\DOC{GEN} + +\TYPE {\small\verb%GEN : (term -> thm -> thm)%}\egroup + +\SYNOPSIS +Generalizes the conclusion of a theorem. + +\DESCRIBE +When applied to a term {\small\verb%x%} and a theorem {\small\verb%A |- t%}, the inference rule +{\small\verb%GEN%} returns the theorem {\small\verb%A |- !x. t%}, provided {\small\verb%x%} is a variable not +free in any of the assumptions. There is no compulsion that {\small\verb%x%} should +be free in {\small\verb%t%}. +{\par\samepage\setseps\small +\begin{verbatim} + A |- t + ------------ GEN "x" [where x is not free in A] + A |- !x. t +\end{verbatim} +} +\FAILURE +Fails if {\small\verb%x%} is not a variable, or if it is free in any of the assumptions. + +\EXAMPLE +The following example shows how the above side-condition prevents +the derivation of the theorem {\small\verb%x=T |- !x. x=T%}, which is clearly invalid. +{\par\samepage\setseps\small +\begin{verbatim} + #top_print print_all_thm;; + - : (thm -> void) + + #let t = ASSUME "x=T";; + t = x = T |- x = T + + #GEN "x:bool" t;; + evaluation failed GEN \end{verbatim} } -\noindent The introduction of {\small\verb%FST%} and {\small\verb%SND%} will be done more than once as -necessary: +\SEEALSO +GENL, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC. + +\ENDDOC +\DOC{GENL} + +\TYPE {\small\verb%GENL : (term list -> thm -> thm)%}\egroup + +\SYNOPSIS +Generalizes zero or more variables in the conclusion of a theorem. + +\DESCRIBE +When applied to a term list {\small\verb%[x1;...;xn]%} and a theorem {\small\verb%A |- t%}, the inference +rule {\small\verb%GENL%} returns the theorem {\small\verb%A |- !x1...xn. t%}, provided none of the +variables {\small\verb%xi%} are free in any of the assumptions. It is not necessary that +any or all of the {\small\verb%xi%} should be free in {\small\verb%t%}. {\par\samepage\setseps\small \begin{verbatim} - #GEN_BETA_CONV "(\(w,x,y,z). w + x + y + z) (1,triple)";; - |- (\(w,x,y,z). w + (x + (y + z)))(1,triple) = - 1 + ((FST triple) + ((FST(SND triple)) + (SND(SND triple)))) + A |- t + ------------------ GENL "[x1;...;xn]" [where no xi is free in A] + A |- !x1...xn. t \end{verbatim} } +\FAILURE +Fails unless all the terms in the list are variables, none of which are +free in the assumption list. + \SEEALSO -BETA_CONV, PAIRED_BETA_CONV. +GEN, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC. \ENDDOC \DOC{GEN\_REWRITE\_CONV} @@ -9976,28 +9898,51 @@ FILTER_GEN_TAC, GEN, GENL, GEN_ALL, SPEC X_GEN_TAC. \ENDDOC -\DOC{getenv} +\DOC{genvar} -\TYPE {\small\verb%getenv : (string -> string)%}\egroup +\TYPE {\small\verb%genvar : (type -> term)%}\egroup \SYNOPSIS -Returns the value of a Unix environment variable. +Returns a variable whose name has not been used previously. \DESCRIBE -{\small\verb%getenv x%} returns the value of {\small\verb%x%} from the current environment list; this -will include shell environment variables set before {\small\verb%HOL%} is run. +When given a type, {\small\verb%genvar%} returns a variable of that type whose name has +not been used for a variable or constant in the HOL session so far. \FAILURE -If in a Unix environment, fails with {\small\verb%getenv%} if the variable is undefined, -or has an empty value. In other environments, it will normally fail anyway. +Never fails. \EXAMPLE +The following indicates the typical stylized form of the names (this should +not be relied on, of course): {\par\samepage\setseps\small \begin{verbatim} -#getenv `SHELL`;; -`/bin/csh` : string + #genvar ":bool";; + "GEN%VAR%357" : term + + #genvar ":num";; + "GEN%VAR%358" : term +\end{verbatim} +} +\noindent Trying to anticipate {\small\verb%genvar%} doesn't work: +{\par\samepage\setseps\small +\begin{verbatim} + #let v = mk_var(`GEN%VAR%359`,":bool");; + v = "GEN%VAR%359" : term + + #genvar ":bool";; + "GEN%VAR%360" : term \end{verbatim} } +\USES +The unique variables are useful in writing derived rules, for specializing +terms without having to worry about such things as free variable capture. +If the names are to be visible to a typical user, the function {\small\verb%variant%} can +provide rather more meaningful names. + +\SEEALSO +GSPEC, variant. + \ENDDOC \DOC{get\_const\_type} @@ -10023,6 +9968,29 @@ Gets the generic type of a constant from dest_const, is_constant. \ENDDOC +\DOC{getenv} + +\TYPE {\small\verb%getenv : (string -> string)%}\egroup + +\SYNOPSIS +Returns the value of a Unix environment variable. + +\DESCRIBE +{\small\verb%getenv x%} returns the value of {\small\verb%x%} from the current environment list; this +will include shell environment variables set before {\small\verb%HOL%} is run. + +\FAILURE +If in a Unix environment, fails with {\small\verb%getenv%} if the variable is undefined, +or has an empty value. In other environments, it will normally fail anyway. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#getenv `SHELL`;; +`/bin/csh` : string +\end{verbatim} +} +\ENDDOC \DOC{get\_flag\_value} \TYPE {\small\verb%get_flag_value : (string -> bool)%}\egroup @@ -10330,6 +10298,36 @@ variable is free in that function. ETA_CONV, MK_ABS, MK_COMB, MK_EXISTS. \ENDDOC +\DOC{\char'136} + +\TYPE {\small\verb%$^ : (string -> string -> string)%}\egroup + +\SYNOPSIS +Concatenates two ML strings. + +\DESCRIBE +The {\small\verb%^%} is the ML infix string concatenation operator. +If {\small\verb%s1%} and {\small\verb%s2%} are strings, then {\small\verb%s1^s2%} gives a string which is their +concatenation. + +\FAILURE +Never fails. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#`Hello `^`world`;; +`Hello world` : string +\end{verbatim} +} +\COMMENTS +The ML role of the {\small\verb%^%} operator should not be confused with its use in +quoted terms to introduce antiquotation (see DESCRIPTION for details). + +\SEEALSO +concat, concatl. + +\ENDDOC \DOC{hd} \TYPE {\small\verb%hd : (* list -> *)%}\egroup @@ -10544,36 +10542,6 @@ Never fails. \#, B, C, CB, Co, K, KI, o, oo, S, W. \ENDDOC -\DOC{implode} - -\TYPE {\small\verb%implode : (string list -> string)%}\egroup - -\SYNOPSIS -Converts a list of single-character strings into one string. - -\DESCRIBE -{\small\verb%implode [s1;...;sn]%} returns the string formed by concatenating the -single-character strings {\small\verb%s1 ... sn%}. If {\small\verb%n%} is zero (the list is empty), -then the empty string is returned. - -\FAILURE -Fails if any of the strings in the argument list are null or longer than one -character. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#implode [`e`;`x`;`a`;`m`;`p`;`l`;`e`];; -`example` : string - -#implode [`ex`;`a`;`mpl`;``;`e`];; -evaluation failed implode -\end{verbatim} -} -\SEEALSO -explode, concat, concatl. - -\ENDDOC \DOC{IMP\_ANTISYM\_RULE} \TYPE {\small\verb%IMP_ANTISYM_RULE : (thm -> thm -> thm)%}\egroup @@ -10680,6 +10648,36 @@ Fails unless the theorem is implicative. NOT_INTRO, NOT_ELIM. \ENDDOC +\DOC{implode} + +\TYPE {\small\verb%implode : (string list -> string)%}\egroup + +\SYNOPSIS +Converts a list of single-character strings into one string. + +\DESCRIBE +{\small\verb%implode [s1;...;sn]%} returns the string formed by concatenating the +single-character strings {\small\verb%s1 ... sn%}. If {\small\verb%n%} is zero (the list is empty), +then the empty string is returned. + +\FAILURE +Fails if any of the strings in the argument list are null or longer than one +character. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#implode [`e`;`x`;`a`;`m`;`p`;`l`;`e`];; +`example` : string + +#implode [`ex`;`a`;`mpl`;``;`e`];; +evaluation failed implode +\end{verbatim} +} +\SEEALSO +explode, concat, concatl. + +\ENDDOC \DOC{IMP\_RES\_TAC} \TYPE {\small\verb%IMP_RES_TAC : thm_tactic%}\egroup @@ -11193,43 +11191,73 @@ y = inr 12 : (string + int) inl, isl, outl, outr. \ENDDOC -\DOC{INST} +\DOC{install} -\TYPE {\small\verb%INST : ((term # term) list -> thm -> thm)%}\egroup +\TYPE {\small\verb%install : (string -> void)%}\egroup \SYNOPSIS -Instantiates free variables in a theorem. +Informs HOL of the absolute pathname to the hol distribution directory. \DESCRIBE -{\small\verb%INST%} is a rule for substituting arbitrary terms for free variables -in a theorem: +{\small\verb%install%} reconfigures a running HOL system to a new root directory. The +string argument to {\small\verb%install%} should be the absolute path name to the +directory in which the HOL system is located. Executing {\par\samepage\setseps\small \begin{verbatim} - A |- t - ----------------------------- INST [(t1,x1);...;(tn,xn)] - A |- t[t1,...,tn/x1,...,xn] + install `/dir1/dir2/dir3/.../hol`;; \end{verbatim} } -\noindent where the variables {\small\verb%x1, ..., xn%} are not free in the -assumptions {\small\verb%A%}. +\noindent sets the internal HOL search path to: +{\par\samepage\setseps\small +\begin{verbatim} + [``; `~/`; `/dir1/dir2/dir3/.../hol/theories/`] +\end{verbatim} +} +\noindent In addition, {\small\verb%install%} sets the internal search path used by HOL to +find the standard online help files and the internal search path used by HOL to +find libraries. \FAILURE -{\small\verb%INST%} fails if a variable being instantiated is free in the -assumptions. +Never fails. -\EXAMPLE -In the following example a theorem is instantiated for a specific term: -{\par\samepage\setseps\small -\begin{verbatim} - #CONJUNCT1 ADD_CLAUSES ;; - |- 0 + m = m +\COMMENTS +The effect persists only for the current HOL session. To change the image +permanently, use the {\small\verb%save%} function after installation. - #INST [("2 * x","m:num")] (CONJUNCT1 ADD_CLAUSES) ;; - |- 0 + (2 * x) = 2 * x +\SEEALSO +help_search_path, library_pathname, library_search_path, search_path, +set_help_search_path, set_library_search_path, set_search_path. + +\ENDDOC +\DOC{inst\_check} + +\TYPE {\small\verb%inst_check : (((type # type) list # term list) -> term list)%}\egroup + +\SYNOPSIS +Checks the validity of type instantiations. + +\DESCRIBE +If the {\small\verb%t1...tn%} are types (monomorphic or polymorphic), the {\small\verb%v1...vn%} type +variables (e.g. {\small\verb%":*"%}), and {\small\verb%tm1...tmn%} terms, the call +{\par\samepage\setseps\small +\begin{verbatim} + inst_check ([(t1,v1);...;(tn,vn)],[tm1;...;tmn]) \end{verbatim} } +\noindent will return a list of the variables free in the {\small\verb%tm1...tmn%}, provided +none of the type variables {\small\verb%v1...vn%} are free in {\small\verb%tm1...tmn%}. If this condition +is not met, or any of the {\small\verb%v%}'s are not simply type variables, the call fails. + +\FAILURE +Fails if any of the {\small\verb%v%}'s are not simple type variables, or if any of them are +free in the terms {\small\verb%v1...vn%}. + +\USES +Checking the validity of type instantiations (for example, if the terms are the +hypotheses of a theorem). + \SEEALSO -INST_TY_TERM, INST_TYPE, ISPEC, ISPECL, SPEC; SPECL, SUBS, subst, SUBST. +inst, inst_rename_list, inst_type, INST_TYPE. \ENDDOC \DOC{inst} @@ -11281,73 +11309,43 @@ Performing internal functions connected inst_check, inst_rename_list, inst_type, INST_TYPE. \ENDDOC -\DOC{install} +\DOC{INST} -\TYPE {\small\verb%install : (string -> void)%}\egroup +\TYPE {\small\verb%INST : ((term # term) list -> thm -> thm)%}\egroup \SYNOPSIS -Informs HOL of the absolute pathname to the hol distribution directory. +Instantiates free variables in a theorem. \DESCRIBE -{\small\verb%install%} reconfigures a running HOL system to a new root directory. The -string argument to {\small\verb%install%} should be the absolute path name to the -directory in which the HOL system is located. Executing -{\par\samepage\setseps\small -\begin{verbatim} - install `/dir1/dir2/dir3/.../hol`;; -\end{verbatim} -} -\noindent sets the internal HOL search path to: +{\small\verb%INST%} is a rule for substituting arbitrary terms for free variables +in a theorem: {\par\samepage\setseps\small \begin{verbatim} - [``; `~/`; `/dir1/dir2/dir3/.../hol/theories/`] + A |- t + ----------------------------- INST [(t1,x1);...;(tn,xn)] + A |- t[t1,...,tn/x1,...,xn] \end{verbatim} } -\noindent In addition, {\small\verb%install%} sets the internal search path used by HOL to -find the standard online help files and the internal search path used by HOL to -find libraries. +\noindent where the variables {\small\verb%x1, ..., xn%} are not free in the +assumptions {\small\verb%A%}. \FAILURE -Never fails. - -\COMMENTS -The effect persists only for the current HOL session. To change the image -permanently, use the {\small\verb%save%} function after installation. - -\SEEALSO -help_search_path, library_pathname, library_search_path, search_path, -set_help_search_path, set_library_search_path, set_search_path. - -\ENDDOC -\DOC{inst\_check} - -\TYPE {\small\verb%inst_check : (((type # type) list # term list) -> term list)%}\egroup - -\SYNOPSIS -Checks the validity of type instantiations. +{\small\verb%INST%} fails if a variable being instantiated is free in the +assumptions. -\DESCRIBE -If the {\small\verb%t1...tn%} are types (monomorphic or polymorphic), the {\small\verb%v1...vn%} type -variables (e.g. {\small\verb%":*"%}), and {\small\verb%tm1...tmn%} terms, the call +\EXAMPLE +In the following example a theorem is instantiated for a specific term: {\par\samepage\setseps\small \begin{verbatim} - inst_check ([(t1,v1);...;(tn,vn)],[tm1;...;tmn]) + #CONJUNCT1 ADD_CLAUSES ;; + |- 0 + m = m + + #INST [("2 * x","m:num")] (CONJUNCT1 ADD_CLAUSES) ;; + |- 0 + (2 * x) = 2 * x \end{verbatim} } -\noindent will return a list of the variables free in the {\small\verb%tm1...tmn%}, provided -none of the type variables {\small\verb%v1...vn%} are free in {\small\verb%tm1...tmn%}. If this condition -is not met, or any of the {\small\verb%v%}'s are not simply type variables, the call fails. - -\FAILURE -Fails if any of the {\small\verb%v%}'s are not simple type variables, or if any of them are -free in the terms {\small\verb%v1...vn%}. - -\USES -Checking the validity of type instantiations (for example, if the terms are the -hypotheses of a theorem). - \SEEALSO -inst, inst_rename_list, inst_type, INST_TYPE. +INST_TY_TERM, INST_TYPE, ISPEC, ISPECL, SPEC; SPECL, SUBS, subst, SUBST. \ENDDOC \DOC{inst\_rename\_list} @@ -11395,6 +11393,51 @@ Checking the validity of type instantiat inst, inst_check, inst_type, INST_TYPE. \ENDDOC +\DOC{inst\_type} + +\TYPE {\small\verb%inst_type : ((type # type) list -> type -> type)%}\egroup + +\SYNOPSIS +Instantiates types in a type. + +\DESCRIBE +If {\small\verb%[(t1',t1);...;(tn',tn)]%} is a list of type instantiations, where {\small\verb%t1...tn%} +are the initial types, and {\small\verb%t1'...tn'%} the desired instantiations, and {\small\verb%ty%} is +a type to instantiate, the call +{\par\samepage\setseps\small +\begin{verbatim} + inst_type [(t1',t1);...;(tn',tn)] ty +\end{verbatim} +} +\noindent will appropriately instantiate the type {\small\verb%ty%}. The instantiations will +be performed in parallel. If several of the type instantiations are applicable, +the choice is undefined. In normal use the {\small\verb%t1...tn%} are type variables, +although this is not essential. Neither is it necessary that any or all of the +types {\small\verb%t1...tn%} should in fact appear in {\small\verb%ty%}. + +\FAILURE +Never fails. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#inst_type [(":bool",":*")] ":* # **";; +":bool # **" : type + +#inst_type [(":num",":* # **"); (":bool",":*")] ":* # **";; +":num" : type + +#inst_type [(":bool",":*"); (":num",":* # **")] ":* # **";; +":num" : type + +#inst_type [(":bool",":num"); (":num",":bool")] ":(bool)list";; +":(num)list" : type +\end{verbatim} +} +\SEEALSO +inst, inst_check, inst_type, INST_TYPE. + +\ENDDOC \DOC{INST\_TYPE} \TYPE {\small\verb%INST_TYPE : ((type # type) list -> thm -> thm)%}\egroup @@ -11446,51 +11489,6 @@ The desired specialization can be obtain INST, INST_TY_TERM. \ENDDOC -\DOC{inst\_type} - -\TYPE {\small\verb%inst_type : ((type # type) list -> type -> type)%}\egroup - -\SYNOPSIS -Instantiates types in a type. - -\DESCRIBE -If {\small\verb%[(t1',t1);...;(tn',tn)]%} is a list of type instantiations, where {\small\verb%t1...tn%} -are the initial types, and {\small\verb%t1'...tn'%} the desired instantiations, and {\small\verb%ty%} is -a type to instantiate, the call -{\par\samepage\setseps\small -\begin{verbatim} - inst_type [(t1',t1);...;(tn',tn)] ty -\end{verbatim} -} -\noindent will appropriately instantiate the type {\small\verb%ty%}. The instantiations will -be performed in parallel. If several of the type instantiations are applicable, -the choice is undefined. In normal use the {\small\verb%t1...tn%} are type variables, -although this is not essential. Neither is it necessary that any or all of the -types {\small\verb%t1...tn%} should in fact appear in {\small\verb%ty%}. - -\FAILURE -Never fails. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#inst_type [(":bool",":*")] ":* # **";; -":bool # **" : type - -#inst_type [(":num",":* # **"); (":bool",":*")] ":* # **";; -":num" : type - -#inst_type [(":bool",":*"); (":num",":* # **")] ":* # **";; -":num" : type - -#inst_type [(":bool",":num"); (":num",":bool")] ":(bool)list";; -":(num)list" : type -\end{verbatim} -} -\SEEALSO -inst, inst_check, inst_type, INST_TYPE. - -\ENDDOC \DOC{INST\_TY\_TERM} \TYPE {\small\verb%INST_TY_TERM : (((term # term) list # (type # type) list) -> thm -> thm)%}\egroup @@ -11583,105 +11581,25 @@ ascii, ascii_code, string_of_int. \TYPE {\small\verb%int_of_term : (term -> int)%}\egroup \SYNOPSIS -Maps a numeric term to the corresponding ML integer. - -\DESCRIBE -Given a term representing a natural number, i.e., of type {\small\verb%:num%} -{\small\verb%int_of_term%} returns the corresponding ML integer constant. - -\FAILURE -Never fails. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} - #int_of_term "2";; - 2 : int -\end{verbatim} -} - -\SEEALSO -term_of_int, string_of_int, int_of_string. - -\ENDDOC -\DOC{isl} - -\TYPE {\small\verb%isl : ((* + **) -> bool)%}\egroup - -\SYNOPSIS -Tests for membership of left summand. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#let x = inl 1 and y = inr 2;; - -#isl x;; -true : bool - -#isl y;; -false : bool -\end{verbatim} -} -\SEEALSO -inl, inr - -\ENDDOC -\DOC{ISPEC} - -\TYPE {\small\verb%ISPEC : (term -> thm -> thm)%}\egroup - -\SYNOPSIS -Specializes a theorem, with type instantiation if necessary. - -\DESCRIBE -This rule specializes a quantified variable as does {\small\verb%SPEC%}; it differs -from it in also instantiating the type if needed: -{\par\samepage\setseps\small -\begin{verbatim} - A |- !x:ty.tm - ----------------------- ISPEC "t:ty'" - A |- tm[t/x] -\end{verbatim} -} -\noindent (where {\small\verb%t%} is free for {\small\verb%x%} in {\small\verb%tm%}, and {\small\verb%ty'%} is an instance -of {\small\verb%ty%}). - -\FAILURE -{\small\verb%ISPEC%} fails if the input theorem is not universally quantified, if -the type of the given term is not an instance of the type of the -quantified variable, or if the type variable is free in the -assumptions. - -\SEEALSO -INST_TY_TERM, INST_TYPE, ISPECL, SPEC, match. - -\ENDDOC -\DOC{ISPECL} - -\TYPE {\small\verb%ISPECL : (term list -> thm -> thm)%}\egroup - -\SYNOPSIS -Specializes a theorem zero or more times, with type instantiation if necessary. +Maps a numeric term to the corresponding ML integer. \DESCRIBE -{\small\verb%ISPECL%} is an iterative version of {\small\verb%ISPEC%} +Given a term representing a natural number, i.e., of type {\small\verb%:num%} +{\small\verb%int_of_term%} returns the corresponding ML integer constant. + +\FAILURE +Never fails. + +\EXAMPLE {\par\samepage\setseps\small \begin{verbatim} - A |- !x1...xn.t - ---------------------------- ISPECL ["t1",...,"tn"] - A |- t[t1,...tn/x1,...,xn] + #int_of_term "2";; + 2 : int \end{verbatim} } -\noindent (where {\small\verb%ti%} is free for {\small\verb%xi%} in {\small\verb%tm%}). - -\FAILURE -{\small\verb%ISPECL%} fails if the list of terms is longer than the number of -quantified variables in the term, if the type instantiation fails, or -if the type variable being instantiated is free in the assumptions. \SEEALSO -INST_TYPE, INST_TY_TERM, ISPEC, MATCH, SPEC, SPECL. +term_of_int, string_of_int, int_of_string. \ENDDOC \DOC{is\_abs} @@ -11896,24 +11814,6 @@ Never fails. mk_cons, dest_cons, mk_list, dest_list, is_list. \ENDDOC -\DOC{is\_const} - -\TYPE {\small\verb%is_const : (term -> bool)%}\egroup - -\SYNOPSIS -Tests a term to see if it is a constant. - -\DESCRIBE -{\small\verb%is_const "const:ty"%} returns {\small\verb%true%}. If the term is not a constant the -result is {\small\verb%false%}. - -\FAILURE -Never fails. - -\SEEALSO -mk_const, dest_const, is_var, is_comb, is_abs. - -\ENDDOC \DOC{is\_constant} \TYPE {\small\verb%is_constant : (string -> bool)%}\egroup @@ -11949,6 +11849,24 @@ false : bool is_infix, is_binder \ENDDOC +\DOC{is\_const} + +\TYPE {\small\verb%is_const : (term -> bool)%}\egroup + +\SYNOPSIS +Tests a term to see if it is a constant. + +\DESCRIBE +{\small\verb%is_const "const:ty"%} returns {\small\verb%true%}. If the term is not a constant the +result is {\small\verb%false%}. + +\FAILURE +Never fails. + +\SEEALSO +mk_const, dest_const, is_var, is_comb, is_abs. + +\ENDDOC \DOC{is\_definition} \TYPE {\small\verb%is_definition : (term -> bool)%}\egroup @@ -12210,6 +12128,29 @@ false : bool is_infix, is_type, is_binder_type \ENDDOC +\DOC{isl} + +\TYPE {\small\verb%isl : ((* + **) -> bool)%}\egroup + +\SYNOPSIS +Tests for membership of left summand. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#let x = inl 1 and y = inr 2;; + +#isl x;; +true : bool + +#isl y;; +false : bool +\end{verbatim} +} +\SEEALSO +inl, inr + +\ENDDOC \DOC{is\_let} \TYPE {\small\verb%is_let : (term -> bool)%}\egroup @@ -12407,6 +12348,63 @@ Never fails. mk_pair, dest_pair. \ENDDOC +\DOC{ISPEC} + +\TYPE {\small\verb%ISPEC : (term -> thm -> thm)%}\egroup + +\SYNOPSIS +Specializes a theorem, with type instantiation if necessary. + +\DESCRIBE +This rule specializes a quantified variable as does {\small\verb%SPEC%}; it differs +from it in also instantiating the type if needed: +{\par\samepage\setseps\small +\begin{verbatim} + A |- !x:ty.tm + ----------------------- ISPEC "t:ty'" + A |- tm[t/x] +\end{verbatim} +} +\noindent (where {\small\verb%t%} is free for {\small\verb%x%} in {\small\verb%tm%}, and {\small\verb%ty'%} is an instance +of {\small\verb%ty%}). + +\FAILURE +{\small\verb%ISPEC%} fails if the input theorem is not universally quantified, if +the type of the given term is not an instance of the type of the +quantified variable, or if the type variable is free in the +assumptions. + +\SEEALSO +INST_TY_TERM, INST_TYPE, ISPECL, SPEC, match. + +\ENDDOC +\DOC{ISPECL} + +\TYPE {\small\verb%ISPECL : (term list -> thm -> thm)%}\egroup + +\SYNOPSIS +Specializes a theorem zero or more times, with type instantiation if necessary. + +\DESCRIBE +{\small\verb%ISPECL%} is an iterative version of {\small\verb%ISPEC%} +{\par\samepage\setseps\small +\begin{verbatim} + A |- !x1...xn.t + ---------------------------- ISPECL ["t1",...,"tn"] + A |- t[t1,...tn/x1,...,xn] +\end{verbatim} +} +\noindent (where {\small\verb%ti%} is free for {\small\verb%xi%} in {\small\verb%tm%}). + +\FAILURE +{\small\verb%ISPECL%} fails if the list of terms is longer than the number of +quantified variables in the term, if the type instantiation fails, or +if the type variable being instantiated is free in the assumptions. + +\SEEALSO +INST_TYPE, INST_TY_TERM, ISPEC, MATCH, SPEC, SPECL. + +\ENDDOC \DOC{is\_pred} \TYPE {\small\verb%is_pred : (term -> bool)%}\egroup @@ -12580,65 +12578,65 @@ Used in evaluating expressions that requ expression. \ENDDOC -\DOC{itlist} +\DOC{itlist2} -\TYPE {\small\verb%itlist : ((* -> ** -> **) -> * list -> ** -> **)%}\egroup +\TYPE {\small\verb%itlist2 : (((* # **) -> *** -> ***) -> (* list # ** list) -> *** -> ***)%}\egroup \SYNOPSIS -List iteration function. Applies a binary function between adjacent elements -of a list. +Applies a paired function between adjacent elements of 2 lists. \DESCRIBE -{\small\verb%itlist f [x1;...;xn] y%} returns +{\small\verb%itlist2 f ([x1;...;xn],[y1;...;yn]) z%} returns {\par\samepage\setseps\small \begin{verbatim} - f x1 (f x2 ... (f xn y)...) + f (x1,y1) (f (x2,y2) ... (f (xn,yn) z)...) \end{verbatim} } -\noindent It returns {\small\verb%y%} if list is empty. +\noindent It returns {\small\verb%z%} if both lists are empty. \FAILURE -Never fails. +Fails with {\small\verb%itlist2%} if the two lists are of different lengths. \EXAMPLE {\par\samepage\setseps\small \begin{verbatim} -#itlist (\x y. x + y) [1;2;3;4] 0;; -10 : int +#itlist2 (\(x,y) z. (x * y) + z) ([1;2],[3;4]) 0;; +11 : int \end{verbatim} } \SEEALSO -rev_itlist, end_itlist. +itlist, rev_itlist, end_itlist, uncurry. \ENDDOC -\DOC{itlist2} +\DOC{itlist} -\TYPE {\small\verb%itlist2 : (((* # **) -> *** -> ***) -> (* list # ** list) -> *** -> ***)%}\egroup +\TYPE {\small\verb%itlist : ((* -> ** -> **) -> * list -> ** -> **)%}\egroup \SYNOPSIS -Applies a paired function between adjacent elements of 2 lists. +List iteration function. Applies a binary function between adjacent elements +of a list. \DESCRIBE -{\small\verb%itlist2 f ([x1;...;xn],[y1;...;yn]) z%} returns +{\small\verb%itlist f [x1;...;xn] y%} returns {\par\samepage\setseps\small \begin{verbatim} - f (x1,y1) (f (x2,y2) ... (f (xn,yn) z)...) + f x1 (f x2 ... (f xn y)...) \end{verbatim} } -\noindent It returns {\small\verb%z%} if both lists are empty. +\noindent It returns {\small\verb%y%} if list is empty. \FAILURE -Fails with {\small\verb%itlist2%} if the two lists are of different lengths. +Never fails. \EXAMPLE {\par\samepage\setseps\small \begin{verbatim} -#itlist2 (\(x,y) z. (x * y) + z) ([1;2],[3;4]) 0;; -11 : int +#itlist (\x y. x + y) [1;2;3;4] 0;; +10 : int \end{verbatim} } \SEEALSO -itlist, rev_itlist, end_itlist, uncurry. +rev_itlist, end_itlist. \ENDDOC \DOC{K} @@ -12672,6 +12670,34 @@ Never fails. \#, B, C, CB, Co, I, K, o, oo, S, W. \ENDDOC +\DOC{LAST\_CONV} + +\TYPE {\small\verb%LAST_CONV : conv%}\egroup + +\SYNOPSIS +Computes by inference the result of taking the last element of a list. + +\DESCRIBE +For any object language list of the form {\small\verb%"[x0;...x(n-1)]"%} , +the result of evaluating +{\par\samepage\setseps\small +\begin{verbatim} + LAST_CONV "LAST [x0;...;x(n-1)]" +\end{verbatim} +} +\noindent is the theorem +{\par\samepage\setseps\small +\begin{verbatim} + |- LAST [x0;...;x(n-1)] = x(n-1) +\end{verbatim} +} + + +\FAILURE +{\small\verb%LAST_CONV tm%} fails if {\small\verb%tm%} is an empty list. + +\ENDDOC + \DOC{last} \TYPE {\small\verb%last : (* list -> *)%}\egroup @@ -12718,34 +12744,6 @@ or {\small\verb%k%} is greater than the \ENDDOC -\DOC{LAST\_CONV} - -\TYPE {\small\verb%LAST_CONV : conv%}\egroup - -\SYNOPSIS -Computes by inference the result of taking the last element of a list. - -\DESCRIBE -For any object language list of the form {\small\verb%"[x0;...x(n-1)]"%} , -the result of evaluating -{\par\samepage\setseps\small -\begin{verbatim} - LAST_CONV "LAST [x0;...;x(n-1)]" -\end{verbatim} -} -\noindent is the theorem -{\par\samepage\setseps\small -\begin{verbatim} - |- LAST [x0;...;x(n-1)] = x(n-1) -\end{verbatim} -} - - -\FAILURE -{\small\verb%LAST_CONV tm%} fails if {\small\verb%tm%} is an empty list. - -\ENDDOC - \DOC{LEFT\_AND\_EXISTS\_CONV} \TYPE {\small\verb%LEFT_AND_EXISTS_CONV : conv%}\egroup @@ -12902,17 +12900,6 @@ Fails if applied to a term not of the fo OR_FORALL_CONV, FORALL_OR_CONV, RIGHT_OR_FORALL_CONV. \ENDDOC -\DOC{length} - -\TYPE {\small\verb%length : (* list -> int)%}\egroup - -\SYNOPSIS -Computes the length of a list: {\small\verb%length [x1;...;xn]%} returns {\small\verb%n%}. - -\FAILURE -Never fails. - -\ENDDOC \DOC{LENGTH\_CONV} \TYPE {\small\verb%LENGTH_CONV : conv%}\egroup @@ -12938,8 +12925,19 @@ For any object language list of the form list. \FAILURE -{\small\verb%LENGTH_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"LENGTH [x1;x2;...;xn]"%} or -{\small\verb%"LENGTH []"%}. +{\small\verb%LENGTH_CONV tm%} fails if {\small\verb%tm%} is not of the form {\small\verb%"LENGTH [x1;x2;...;xn]"%} or +{\small\verb%"LENGTH []"%}. + +\ENDDOC +\DOC{length} + +\TYPE {\small\verb%length : (* list -> int)%}\egroup + +\SYNOPSIS +Computes the length of a list: {\small\verb%length [x1;...;xn]%} returns {\small\verb%n%}. + +\FAILURE +Never fails. \ENDDOC \DOC{let\_after} @@ -13418,6 +13416,25 @@ systems. system, unlink. \ENDDOC +\DOC{lisp\_dir\_pathname} + +\TYPE {\small\verb%lisp_dir_pathname : string%}\egroup + +\SYNOPSIS +Absolute pathname to the HOL lisp sources. + +\DESCRIBE +For implementation reasons, the ML variable {\small\verb%lisp_dir_pathname%} is bound when +the system if built to a string giving the absolute pathname of the directory +containing the HOL lisp sources. This value is not for general use. + +\FAILURE +Evaluating {\small\verb%lisp_dir_pathname%} never fails. + +\SEEALSO +ml_dir_pathname. + +\ENDDOC \DOC{lisp} \TYPE {\small\verb%lisp : (string -> void)%}\egroup @@ -13464,25 +13481,6 @@ using it. dropout, lsp. \ENDDOC -\DOC{lisp\_dir\_pathname} - -\TYPE {\small\verb%lisp_dir_pathname : string%}\egroup - -\SYNOPSIS -Absolute pathname to the HOL lisp sources. - -\DESCRIBE -For implementation reasons, the ML variable {\small\verb%lisp_dir_pathname%} is bound when -the system if built to a string giving the absolute pathname of the directory -containing the HOL lisp sources. This value is not for general use. - -\FAILURE -Evaluating {\small\verb%lisp_dir_pathname%} never fails. - -\SEEALSO -ml_dir_pathname. - -\ENDDOC \DOC{LIST\_BETA\_CONV} \TYPE {\small\verb%LIST_BETA_CONV : conv%}\egroup @@ -13855,6 +13853,28 @@ evaluation failed list_mk_disj disjuncts, mk_disj. \ENDDOC +\DOC{list\_mk\_exists} + +\TYPE {\small\verb%list_mk_exists : ((term list # term) -> term)%}\egroup + +\SYNOPSIS +Iteratively constructs existential quantifications. + +\DESCRIBE +{\small\verb%list_mk_exists(["x1";...;"xn"],"t")%} returns {\small\verb%"?x1 ... xn. t"%}. + +\FAILURE +Fails with {\small\verb%list_mk_exists%} if the terms in the list are not variables or if +{\small\verb%t%} is not of type {\small\verb%":bool"%} and the list of terms is non-empty. If the list +of terms is empty the type of {\small\verb%t%} can be anything. + +\COMMENTS +The system shows the type as {\small\verb%(goal -> term)%}. + +\SEEALSO +strip_exists, mk_exists. + +\ENDDOC \DOC{LIST\_MK\_EXISTS} \TYPE {\small\verb%LIST_MK_EXISTS : (term list -> thm -> thm)%}\egroup @@ -13884,28 +13904,6 @@ list, or if the theorem is not equationa EXISTS_EQ, MK_EXISTS. \ENDDOC -\DOC{list\_mk\_exists} - -\TYPE {\small\verb%list_mk_exists : ((term list # term) -> term)%}\egroup - -\SYNOPSIS -Iteratively constructs existential quantifications. - -\DESCRIBE -{\small\verb%list_mk_exists(["x1";...;"xn"],"t")%} returns {\small\verb%"?x1 ... xn. t"%}. - -\FAILURE -Fails with {\small\verb%list_mk_exists%} if the terms in the list are not variables or if -{\small\verb%t%} is not of type {\small\verb%":bool"%} and the list of terms is non-empty. If the list -of terms is empty the type of {\small\verb%t%} can be anything. - -\COMMENTS -The system shows the type as {\small\verb%(goal -> term)%}. - -\SEEALSO -strip_exists, mk_exists. - -\ENDDOC \DOC{list\_mk\_forall} \TYPE {\small\verb%list_mk_forall : ((term list # term) -> term)%}\egroup @@ -14035,115 +14033,6 @@ is not for general use, and users should Evaluating the assignable variable {\small\verb%list_of_binders%} never fails. \ENDDOC -\DOC{load} - -\TYPE {\small\verb%load : ((string # bool) -> void)%}\egroup - -\SYNOPSIS -Loads ML phrases from the named file. - -\DESCRIBE -A call {\small\verb%load(`file`,flag)%} will load ML phrases from the file described by -{\small\verb%file%}. If the boolean value {\small\verb%flag%} is true, then toplevel printing of the -system responses will occur, otherwise just a dot is printed for each toplevel -phrase. The name {\small\verb%file%} is expanded into a real filename using the same -mechanism as {\small\verb%find_ml_file%}. - -\FAILURE -Fails if the appropriate file cannot be found on the search path, or if an -error occurs in the ML which is being loaded. - -\COMMENTS -It is usual to use either {\small\verb%loadf%} or {\small\verb%loadt%} rather than this function, which -perform the same action with one or the other setting of the flag. - -\SEEALSO -find_ml_file, loadf, loadt, search_path, set_search_path. - -\ENDDOC -\DOC{loadf} - -\TYPE {\small\verb%loadf : (string -> void)%}\egroup - -\SYNOPSIS -Loads an ML file with the verbose flag set to {\small\verb%false%}. - -\DESCRIBE -The function {\small\verb%loadf%} takes a string indicating the ML file name as -argument and loads it in the same manner as {\small\verb%load%}, except that the -verbose flag is always set to false. - -\FAILURE -{\small\verb%loadf%} will fail if the file named by the argument does not exist in -the search path. It will fail in the same manner if the file is not a -valid ML file. Failure in the ML file will terminate loading. - -\EXAMPLE -If we have a ML file called {\small\verb%foo.ml%} which contains the line -{\par\samepage\setseps\small -\begin{verbatim} - let x=2+2;; -\end{verbatim} -} -\noindent this can be loaded as follows: -{\par\samepage\setseps\small -\begin{verbatim} - #loadf `foo.ml`;; -\end{verbatim} -} -\noindent and the system would respond with: -{\par\samepage\setseps\small -\begin{verbatim} - .() : void -\end{verbatim} -} -\SEEALSO -load, loadf. - -\ENDDOC -\DOC{loadt} - -\TYPE {\small\verb%loadt : (string -> void)%}\egroup - -\SYNOPSIS -{\small\verb%loadt%} loads an ML file with the verbose flag set to {\small\verb%true%}. - -\DESCRIBE -The function {\small\verb%loadt%} takes a string indicating the ML file name as -argument and loads it in the same manner as {\small\verb%load%}, except that the -verbose flag is always set to {\small\verb%true%}. - -\FAILURE -{\small\verb%loadt%} will fail if the file named by the argument does not exist in -the search path. It will fail in the same manner if the file is not a -valid ML file. Failure in the ML file will also terminate loading. - -\EXAMPLE -If we have an ML file called {\small\verb%foo.ml%} which contains the line -{\par\samepage\setseps\small -\begin{verbatim} - let x=2+2;; -\end{verbatim} -} -\noindent this can be loaded as follows: -{\par\samepage\setseps\small -\begin{verbatim} - #loadt `foo.ml`;; -\end{verbatim} -} -\noindent and the system would respond with: -{\par\samepage\setseps\small -\begin{verbatim} - x = 4 : int - - File foo.ml loaded - () : void -\end{verbatim} -} -\SEEALSO -load, loadf. - -\ENDDOC \DOC{load\_axiom} \TYPE {\small\verb%load_axiom : (string -> string -> void)%}\egroup @@ -14320,7 +14209,73 @@ o_DEF = |- !f g. f o g = (\x. f(g x)) \end{verbatim} } \SEEALSO -definitions, let_after, let_before, load_definition. +definitions, let_after, let_before, load_definition. + +\ENDDOC +\DOC{load} + +\TYPE {\small\verb%load : ((string # bool) -> void)%}\egroup + +\SYNOPSIS +Loads ML phrases from the named file. + +\DESCRIBE +A call {\small\verb%load(`file`,flag)%} will load ML phrases from the file described by +{\small\verb%file%}. If the boolean value {\small\verb%flag%} is true, then toplevel printing of the +system responses will occur, otherwise just a dot is printed for each toplevel +phrase. The name {\small\verb%file%} is expanded into a real filename using the same +mechanism as {\small\verb%find_ml_file%}. + +\FAILURE +Fails if the appropriate file cannot be found on the search path, or if an +error occurs in the ML which is being loaded. + +\COMMENTS +It is usual to use either {\small\verb%loadf%} or {\small\verb%loadt%} rather than this function, which +perform the same action with one or the other setting of the flag. + +\SEEALSO +find_ml_file, loadf, loadt, search_path, set_search_path. + +\ENDDOC +\DOC{loadf} + +\TYPE {\small\verb%loadf : (string -> void)%}\egroup + +\SYNOPSIS +Loads an ML file with the verbose flag set to {\small\verb%false%}. + +\DESCRIBE +The function {\small\verb%loadf%} takes a string indicating the ML file name as +argument and loads it in the same manner as {\small\verb%load%}, except that the +verbose flag is always set to false. + +\FAILURE +{\small\verb%loadf%} will fail if the file named by the argument does not exist in +the search path. It will fail in the same manner if the file is not a +valid ML file. Failure in the ML file will terminate loading. + +\EXAMPLE +If we have a ML file called {\small\verb%foo.ml%} which contains the line +{\par\samepage\setseps\small +\begin{verbatim} + let x=2+2;; +\end{verbatim} +} +\noindent this can be loaded as follows: +{\par\samepage\setseps\small +\begin{verbatim} + #loadf `foo.ml`;; +\end{verbatim} +} +\noindent and the system would respond with: +{\par\samepage\setseps\small +\begin{verbatim} + .() : void +\end{verbatim} +} +\SEEALSO +load, loadf. \ENDDOC \DOC{load\_library} @@ -14395,6 +14350,49 @@ libraries currently in the standard HOL libraries, library_pathname, library_search_path, set_library_search_path. \ENDDOC +\DOC{loadt} + +\TYPE {\small\verb%loadt : (string -> void)%}\egroup + +\SYNOPSIS +{\small\verb%loadt%} loads an ML file with the verbose flag set to {\small\verb%true%}. + +\DESCRIBE +The function {\small\verb%loadt%} takes a string indicating the ML file name as +argument and loads it in the same manner as {\small\verb%load%}, except that the +verbose flag is always set to {\small\verb%true%}. + +\FAILURE +{\small\verb%loadt%} will fail if the file named by the argument does not exist in +the search path. It will fail in the same manner if the file is not a +valid ML file. Failure in the ML file will also terminate loading. + +\EXAMPLE +If we have an ML file called {\small\verb%foo.ml%} which contains the line +{\par\samepage\setseps\small +\begin{verbatim} + let x=2+2;; +\end{verbatim} +} +\noindent this can be loaded as follows: +{\par\samepage\setseps\small +\begin{verbatim} + #loadt `foo.ml`;; +\end{verbatim} +} +\noindent and the system would respond with: +{\par\samepage\setseps\small +\begin{verbatim} + x = 4 : int + + File foo.ml loaded + () : void +\end{verbatim} +} +\SEEALSO +load, loadf. + +\ENDDOC \DOC{load\_theorem} \TYPE {\small\verb%load_theorem : (string -> string -> void)%}\egroup @@ -14584,54 +14582,6 @@ using it. dropout, lisp. \ENDDOC -\DOC{map} - -\TYPE {\small\verb%map : ((* -> **) -> * list -> ** list)%}\egroup - -\SYNOPSIS -Applies a function to every element of a list. - -\DESCRIBE -{\small\verb%map f [x1;...;xn]%} returns {\small\verb%[(f x1);...;(f xn)]%}. - -\FAILURE -Never fails. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#map (\x. x * 2) [];; -[] : int list - -#map (\x. x * 2) [1;2;3];; -[2; 4; 6] : int list -\end{verbatim} -} -\ENDDOC -\DOC{map2} - -\TYPE {\small\verb%map2 : (((* # **) -> ***) -> (* list # ** list) -> *** list)%}\egroup - -\SYNOPSIS -Maps a binary function over two lists to create one new list. - -\DESCRIBE -{\small\verb%map2 f ([x1;...;xn],[y1;...;yn])%} returns {\small\verb%[f(x1,y1);...;f(xn,yn)]%}. - -\FAILURE -Fails with {\small\verb%map2%} if the two lists are of different lengths. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#map2 $+ ([1;2;3],[3;2;1]);; -[4; 4; 4] : int list -\end{verbatim} -} -\SEEALSO -map, uncurry. - -\ENDDOC \DOC{MAP2\_CONV} \TYPE {\small\verb%MAP2_CONV : conv -> conv%}\egroup @@ -14685,62 +14635,28 @@ MAP_CONV \ENDDOC -\DOC{mapfilter} - -\TYPE {\small\verb%mapfilter : ((* -> **) -> * list -> ** list)%}\egroup - -\SYNOPSIS -Applies a function to every element of a list, returning a list of results -for those elements for which application succeeds. - -\FAILURE -Never fails. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#mapfilter hd [[1;2;3];[4;5];[];[6;7;8];[]];; -[1; 4; 6] : int list -\end{verbatim} -} -\SEEALSO -filter, map. - -\ENDDOC -\DOC{maptok} +\DOC{map2} -\TYPE {\small\verb%maptok : ((string -> *) -> string -> * list)%}\egroup +\TYPE {\small\verb%map2 : (((* # **) -> ***) -> (* list # ** list) -> *** list)%}\egroup \SYNOPSIS -Maps a function over the constituent words of a string. +Maps a binary function over two lists to create one new list. \DESCRIBE -{\small\verb%maptok f s%} first splits the string {\small\verb%s%} into a list of substrings, and then -maps the function {\small\verb%f%} over that list. Splitting of the string occurs at each -sequence of blanks and carriage returns (white space). This white space does -not appear in the list of substrings. Leading and trailing white space in the -input string is also thrown away. +{\small\verb%map2 f ([x1;...;xn],[y1;...;yn])%} returns {\small\verb%[f(x1,y1);...;f(xn,yn)]%}. \FAILURE -Fails if one of the applications of {\small\verb%f%} to a substring fails. +Fails with {\small\verb%map2%} if the two lists are of different lengths. \EXAMPLE {\par\samepage\setseps\small \begin{verbatim} -#maptok explode ` the cat sat `;; -[[`t`; `h`; `e`]; [`c`; `a`; `t`]; [`s`; `a`; `t`]] : string list list -\end{verbatim} -} -\USES -Useful when wanting to map a function over a list of constant strings. -Instead of using {\small\verb%map f [`string1`;...;`stringn`]%} one can use: -{\par\samepage\setseps\small -\begin{verbatim} - (maptok f `string1 ... stringn`) +#map2 $+ ([1;2;3],[3;2;1]);; +[4; 4; 4] : int list \end{verbatim} } \SEEALSO -words, word_separators, words2, map. +map, uncurry. \ENDDOC \DOC{MAP\_CONV} @@ -14819,6 +14735,30 @@ evaluating {\small\verb%conv "f ti"%} re \ENDDOC +\DOC{map} + +\TYPE {\small\verb%map : ((* -> **) -> * list -> ** list)%}\egroup + +\SYNOPSIS +Applies a function to every element of a list. + +\DESCRIBE +{\small\verb%map f [x1;...;xn]%} returns {\small\verb%[(f x1);...;(f xn)]%}. + +\FAILURE +Never fails. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#map (\x. x * 2) [];; +[] : int list + +#map (\x. x * 2) [1;2;3];; +[2; 4; 6] : int list +\end{verbatim} +} +\ENDDOC \DOC{MAP\_EVERY} \TYPE {\small\verb%MAP_EVERY : ((* -> tactic) -> * list -> tactic)%}\egroup @@ -14848,41 +14788,148 @@ resulting tactic fails iff any of the re A convenient way of doing case analysis over several boolean variables is: {\par\samepage\setseps\small \begin{verbatim} - MAP_EVERY BOOL_CASES_TAC ["var1:bool";...;"varn:bool"] + MAP_EVERY BOOL_CASES_TAC ["var1:bool";...;"varn:bool"] +\end{verbatim} +} +\SEEALSO +EVERY, FIRST, MAP_FIRST, THEN. + +\ENDDOC +\DOC{mapfilter} + +\TYPE {\small\verb%mapfilter : ((* -> **) -> * list -> ** list)%}\egroup + +\SYNOPSIS +Applies a function to every element of a list, returning a list of results +for those elements for which application succeeds. + +\FAILURE +Never fails. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#mapfilter hd [[1;2;3];[4;5];[];[6;7;8];[]];; +[1; 4; 6] : int list +\end{verbatim} +} +\SEEALSO +filter, map. + +\ENDDOC +\DOC{MAP\_FIRST} + +\TYPE {\small\verb%MAP_FIRST : ((* -> tactic) -> * list -> tactic)%}\egroup + +\SYNOPSIS +Applies first tactic that succeeds in a list given by mapping a function over a +list. + +\DESCRIBE +When applied to a tactic-producing function {\small\verb%f%} and an operand list +{\small\verb%[x1;...;xn]%}, the elements of which have the same type as {\small\verb%f%}'s domain +type, {\small\verb%MAP_FIRST%} maps the function {\small\verb%f%} over the list, producing a list of +tactics, then tries applying these tactics to the goal till one succeeds. +If {\small\verb%f(xm)%} is the first to succeed, then the overall effect is the same +as applying {\small\verb%f(xm)%}. Thus: +{\par\samepage\setseps\small +\begin{verbatim} + MAP_FIRST f [x1;...;xn] = (f x1) ORELSE ... ORELSE (f xn) +\end{verbatim} +} +\FAILURE +The application of {\small\verb%MAP_FIRST%} to a function and tactic list fails iff +the function does when applied to any of the elements of the list. The +resulting tactic fails iff all the resulting tactics fail when +applied to the goal. + +\SEEALSO +EVERY, FIRST, MAP_EVERY, ORELSE. + +\ENDDOC +\DOC{maptok} + +\TYPE {\small\verb%maptok : ((string -> *) -> string -> * list)%}\egroup + +\SYNOPSIS +Maps a function over the constituent words of a string. + +\DESCRIBE +{\small\verb%maptok f s%} first splits the string {\small\verb%s%} into a list of substrings, and then +maps the function {\small\verb%f%} over that list. Splitting of the string occurs at each +sequence of blanks and carriage returns (white space). This white space does +not appear in the list of substrings. Leading and trailing white space in the +input string is also thrown away. + +\FAILURE +Fails if one of the applications of {\small\verb%f%} to a substring fails. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#maptok explode ` the cat sat `;; +[[`t`; `h`; `e`]; [`c`; `a`; `t`]; [`s`; `a`; `t`]] : string list list +\end{verbatim} +} +\USES +Useful when wanting to map a function over a list of constant strings. +Instead of using {\small\verb%map f [`string1`;...;`stringn`]%} one can use: +{\par\samepage\setseps\small +\begin{verbatim} + (maptok f `string1 ... stringn`) \end{verbatim} } \SEEALSO -EVERY, FIRST, MAP_FIRST, THEN. +words, word_separators, words2, map. \ENDDOC -\DOC{MAP\_FIRST} +\DOC{MATCH\_ACCEPT\_TAC} -\TYPE {\small\verb%MAP_FIRST : ((* -> tactic) -> * list -> tactic)%}\egroup +\TYPE {\small\verb%MATCH_ACCEPT_TAC : thm_tactic%}\egroup \SYNOPSIS -Applies first tactic that succeeds in a list given by mapping a function over a -list. +Solves a goal which is an instance of the supplied theorem. \DESCRIBE -When applied to a tactic-producing function {\small\verb%f%} and an operand list -{\small\verb%[x1;...;xn]%}, the elements of which have the same type as {\small\verb%f%}'s domain -type, {\small\verb%MAP_FIRST%} maps the function {\small\verb%f%} over the list, producing a list of -tactics, then tries applying these tactics to the goal till one succeeds. -If {\small\verb%f(xm)%} is the first to succeed, then the overall effect is the same -as applying {\small\verb%f(xm)%}. Thus: +When given a theorem {\small\verb%A' |- t%} and a goal {\small\verb%A ?- t'%} where {\small\verb%t%} can be matched +to {\small\verb%t'%} by instantiating variables which are either free or +universally quantified at the outer level, including appropriate type +instantiation, {\small\verb%MATCH_ACCEPT_TAC%} completely solves the goal. {\par\samepage\setseps\small \begin{verbatim} - MAP_FIRST f [x1;...;xn] = (f x1) ORELSE ... ORELSE (f xn) + A ?- t' + ========= MATCH_ACCEPT_TAC (A' |- t) + \end{verbatim} } +\noindent Unless {\small\verb%A'%} is a subset of {\small\verb%A%}, this is an invalid tactic. + \FAILURE -The application of {\small\verb%MAP_FIRST%} to a function and tactic list fails iff -the function does when applied to any of the elements of the list. The -resulting tactic fails iff all the resulting tactics fail when -applied to the goal. +Fails unless the theorem has a conclusion which is instantiable to match that +of the goal. +\EXAMPLE +The following example shows variable and type instantiation at work. We can use +the polymorphic list theorem {\small\verb%HD%}: +{\par\samepage\setseps\small +\begin{verbatim} + HD = |- !h t. HD(CONS h t) = h +\end{verbatim} +} +\noindent to solve the goal: +{\par\samepage\setseps\small +\begin{verbatim} + ?- HD [1;2] = 1 +\end{verbatim} +} +\noindent simply by: +{\par\samepage\setseps\small +\begin{verbatim} + MATCH_ACCEPT_TAC HD +\end{verbatim} +} \SEEALSO -EVERY, FIRST, MAP_EVERY, ORELSE. +ACCEPT_TAC. \ENDDOC \DOC{match} @@ -14946,55 +14993,6 @@ type) which need to be instantiated may INST_TY_TERM, PART_MATCH. \ENDDOC -\DOC{MATCH\_ACCEPT\_TAC} - -\TYPE {\small\verb%MATCH_ACCEPT_TAC : thm_tactic%}\egroup - -\SYNOPSIS -Solves a goal which is an instance of the supplied theorem. - -\DESCRIBE -When given a theorem {\small\verb%A' |- t%} and a goal {\small\verb%A ?- t'%} where {\small\verb%t%} can be matched -to {\small\verb%t'%} by instantiating variables which are either free or -universally quantified at the outer level, including appropriate type -instantiation, {\small\verb%MATCH_ACCEPT_TAC%} completely solves the goal. -{\par\samepage\setseps\small -\begin{verbatim} - A ?- t' - ========= MATCH_ACCEPT_TAC (A' |- t) - -\end{verbatim} -} -\noindent Unless {\small\verb%A'%} is a subset of {\small\verb%A%}, this is an invalid tactic. - -\FAILURE -Fails unless the theorem has a conclusion which is instantiable to match that -of the goal. - -\EXAMPLE -The following example shows variable and type instantiation at work. We can use -the polymorphic list theorem {\small\verb%HD%}: -{\par\samepage\setseps\small -\begin{verbatim} - HD = |- !h t. HD(CONS h t) = h -\end{verbatim} -} -\noindent to solve the goal: -{\par\samepage\setseps\small -\begin{verbatim} - ?- HD [1;2] = 1 -\end{verbatim} -} -\noindent simply by: -{\par\samepage\setseps\small -\begin{verbatim} - MATCH_ACCEPT_TAC HD -\end{verbatim} -} -\SEEALSO -ACCEPT_TAC. - -\ENDDOC \DOC{MATCH\_MP} \TYPE {\small\verb%MATCH_MP : (thm -> thm -> thm)%}\egroup @@ -15188,6 +15186,23 @@ This is an example print_string, print_tok, print_begin, print_end, print_newline. \ENDDOC +\DOC{mk\_abs} + +\TYPE {\small\verb%mk_abs : ((term # term) -> term)%}\egroup + +\SYNOPSIS +Constructs an abstraction. + +\DESCRIBE +{\small\verb%mk_abs "var","t"%} returns the abstraction {\small\verb%"\var. t"%}. + +\FAILURE +Fails with {\small\verb%mk_abs%} if first term is not a variable. + +\SEEALSO +dest_abs, is_abs, list_mk_abs, mk_var, mk_const, mk_comb. + +\ENDDOC \DOC{MK\_ABS} \TYPE {\small\verb%MK_ABS : (thm -> thm)%}\egroup @@ -15213,21 +15228,31 @@ Fails unless the theorem is a (singly) u ABS, HALF_MK_ABS, MK_COMB, MK_EXISTS. \ENDDOC -\DOC{mk\_abs} +\DOC{mk\_comb} -\TYPE {\small\verb%mk_abs : ((term # term) -> term)%}\egroup +\TYPE {\small\verb%mk_comb : ((term # term) -> term)%}\egroup \SYNOPSIS -Constructs an abstraction. +Constructs a combination (function application). \DESCRIBE -{\small\verb%mk_abs "var","t"%} returns the abstraction {\small\verb%"\var. t"%}. +{\small\verb%mk_comb "t1","t2"%} returns the combination {\small\verb%"t1 t2"%}. \FAILURE -Fails with {\small\verb%mk_abs%} if first term is not a variable. +Fails with {\small\verb%mk_comb%} unless {\small\verb%t1%} is a function with domain type {\small\verb%t2%}. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#mk_comb("$~","T");; +"~T" : term +#mk_comb("T","T");; +evaluation failed mk_comb +\end{verbatim} +} \SEEALSO -dest_abs, is_abs, list_mk_abs, mk_var, mk_const, mk_comb. +dest_comb, is_comb, list_mk_comb, mk_var, mk_const, mk_abs. \ENDDOC \DOC{MK\_COMB} @@ -15257,33 +15282,6 @@ respectively. AP_TERM, AP_THM. \ENDDOC -\DOC{mk\_comb} - -\TYPE {\small\verb%mk_comb : ((term # term) -> term)%}\egroup - -\SYNOPSIS -Constructs a combination (function application). - -\DESCRIBE -{\small\verb%mk_comb "t1","t2"%} returns the combination {\small\verb%"t1 t2"%}. - -\FAILURE -Fails with {\small\verb%mk_comb%} unless {\small\verb%t1%} is a function with domain type {\small\verb%t2%}. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#mk_comb("$~","T");; -"~T" : term - -#mk_comb("T","T");; -evaluation failed mk_comb -\end{verbatim} -} -\SEEALSO -dest_comb, is_comb, list_mk_comb, mk_var, mk_const, mk_abs. - -\ENDDOC \DOC{mk\_cond} \TYPE {\small\verb%mk_cond : ((term # term # term) -> term)%}\egroup @@ -15421,6 +15419,24 @@ Fails with {\small\verb%mk_eq%} if {\sma dest_eq, is_eq. \ENDDOC +\DOC{mk\_exists} + +\TYPE {\small\verb%mk_exists : ((term # term) -> term)%}\egroup + +\SYNOPSIS +Constructs an existential quantification. + +\DESCRIBE +{\small\verb%mk_exists("var","t")%} returns {\small\verb%"?var. t"%}. + +\FAILURE +Fails with {\small\verb%mk_exists%} if first term is not a variable or if {\small\verb%t%} is not of +type {\small\verb%":bool"%}. + +\SEEALSO +dest_exists, is_exists, list_mk_exists. + +\ENDDOC \DOC{MK\_EXISTS} \TYPE {\small\verb%MK_EXISTS : (thm -> thm)%}\egroup @@ -15446,24 +15462,6 @@ Fails unless the theorem is a singly uni AP_TERM, EXISTS_EQ, GEN, LIST_MK_EXISTS, MK_ABS. \ENDDOC -\DOC{mk\_exists} - -\TYPE {\small\verb%mk_exists : ((term # term) -> term)%}\egroup - -\SYNOPSIS -Constructs an existential quantification. - -\DESCRIBE -{\small\verb%mk_exists("var","t")%} returns {\small\verb%"?var. t"%}. - -\FAILURE -Fails with {\small\verb%mk_exists%} if first term is not a variable or if {\small\verb%t%} is not of -type {\small\verb%":bool"%}. - -\SEEALSO -dest_exists, is_exists, list_mk_exists. - -\ENDDOC \DOC{mk\_forall} \TYPE {\small\verb%mk_forall : ((term # term) -> term)%}\egroup @@ -16111,58 +16109,23 @@ of that name in the current theory, or i \EXAMPLE {\par\samepage\setseps\small \begin{verbatim} -#new_theory `gurk`;; -() : void - -#new_axiom(`untrue`,"x = 1");; -|- !x. x = 1 -\end{verbatim} -} -\COMMENTS -For most purposes, it is unnecessary to declare new axioms: all of classical -mathematics can be derived by definitional extension alone. Proceeding by -definition is not only more elegant, but also guarantees the consistency of the -deductions made. However, there are certain entities which cannot be modelled -in simple type theory without further axioms, such as higher transfinite -ordinals. - -\SEEALSO -mk_thm, new_definition. - -\ENDDOC -\DOC{new\_binder} - -\TYPE {\small\verb%new_binder : ((string # type) -> void)%}\egroup - -\SYNOPSIS -Sets up a new binder in the current theory. - -\DESCRIBE -A call {\small\verb%new_binder(`bnd`,":ty")%} declares a new binder {\small\verb%bnd%} in the current -theory. The type must be of the form {\small\verb%(* -> **) -> ***%}, because being a binder, -{\small\verb%bnd%} will apply to an abstraction; for example {\small\verb%"!x:bool. (x=T) \/ (x=F)"%} is -actually a prettyprinting of {\small\verb%"$! (\x. (x=T) \/ (x=F))"%}. - -\FAILURE -Fails if HOL is not in draft mode, or there is already a constant of some sort -of that name in the current theory, or if the type does not correspond to the -above pattern. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#new_theory `anorak`;; -() : void - -#new_binder(`!!`,":(bool->bool)->bool");; +#new_theory `gurk`;; () : void -#"!!x. T";; -"!! x. T" : term +#new_axiom(`untrue`,"x = 1");; +|- !x. x = 1 \end{verbatim} } +\COMMENTS +For most purposes, it is unnecessary to declare new axioms: all of classical +mathematics can be derived by definitional extension alone. Proceeding by +definition is not only more elegant, but also guarantees the consistency of the +deductions made. However, there are certain entities which cannot be modelled +in simple type theory without further axioms, such as higher transfinite +ordinals. + \SEEALSO -binders, is_binder. +mk_thm, new_definition. \ENDDOC \DOC{new\_binder\_definition} @@ -16244,6 +16207,41 @@ new_infix_list_rec_definition, new_prim_ new_list_rec_definition, new_prim_rec_definition. \ENDDOC +\DOC{new\_binder} + +\TYPE {\small\verb%new_binder : ((string # type) -> void)%}\egroup + +\SYNOPSIS +Sets up a new binder in the current theory. + +\DESCRIBE +A call {\small\verb%new_binder(`bnd`,":ty")%} declares a new binder {\small\verb%bnd%} in the current +theory. The type must be of the form {\small\verb%(* -> **) -> ***%}, because being a binder, +{\small\verb%bnd%} will apply to an abstraction; for example {\small\verb%"!x:bool. (x=T) \/ (x=F)"%} is +actually a prettyprinting of {\small\verb%"$! (\x. (x=T) \/ (x=F))"%}. + +\FAILURE +Fails if HOL is not in draft mode, or there is already a constant of some sort +of that name in the current theory, or if the type does not correspond to the +above pattern. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#new_theory `anorak`;; +() : void + +#new_binder(`!!`,":(bool->bool)->bool");; +() : void + +#"!!x. T";; +"!! x. T" : term +\end{verbatim} +} +\SEEALSO +binders, is_binder. + +\ENDDOC \DOC{new\_constant} \TYPE {\small\verb%new_constant : ((string # type) -> void)%}\egroup @@ -16415,46 +16413,6 @@ DEF_EXISTS_RULE, new_binder_definition, new_specification. \ENDDOC -\DOC{new\_infix} - -\TYPE {\small\verb%new_infix : ((string # type) -> void)%}\egroup - -\SYNOPSIS -Declares a new infix constant in the current theory. - -\DESCRIBE -A call {\small\verb%new_infix(`i`,":ty")%} makes {\small\verb%i%} an infix -constant in the current theory. Note that it does not specifiy its value. -The constant may have a polymorphic type, which may be arbitrarily -instantiated. Like any other infix or binder, its special parse status may be -suppressed by preceding it with a dollar sign. - -\FAILURE -Fails if HOL is not in draft mode, or if the name is not a valid constant -name, or there is already a constant of that name in the current theory. - -\EXAMPLE -The following shows the use of the curried form as well as the infix: -{\par\samepage\setseps\small -\begin{verbatim} - #new_theory `groke`;; - () : void - - #new_infix(`orelse`,":bool->bool->bool");; - () : void - - #"T orelse F";; - "T orelse F" : term - - #"$orelse T F";; - "T orelse F" : term -\end{verbatim} -} -\SEEALSO -constants, infixes, is_constant, is_infix, new_constant, new_definition, -new_infix_definition. - -\ENDDOC \DOC{new\_infix\_definition} \TYPE {\small\verb%new_infix_definition : ((string # term) -> thm)%}\egroup @@ -16530,6 +16488,46 @@ new_infix_list_rec_definition, new_prim_ new_prim_rec_definition. \ENDDOC +\DOC{new\_infix} + +\TYPE {\small\verb%new_infix : ((string # type) -> void)%}\egroup + +\SYNOPSIS +Declares a new infix constant in the current theory. + +\DESCRIBE +A call {\small\verb%new_infix(`i`,":ty")%} makes {\small\verb%i%} an infix +constant in the current theory. Note that it does not specifiy its value. +The constant may have a polymorphic type, which may be arbitrarily +instantiated. Like any other infix or binder, its special parse status may be +suppressed by preceding it with a dollar sign. + +\FAILURE +Fails if HOL is not in draft mode, or if the name is not a valid constant +name, or there is already a constant of that name in the current theory. + +\EXAMPLE +The following shows the use of the curried form as well as the infix: +{\par\samepage\setseps\small +\begin{verbatim} + #new_theory `groke`;; + () : void + + #new_infix(`orelse`,":bool->bool->bool");; + () : void + + #"T orelse F";; + "T orelse F" : term + + #"$orelse T F";; + "T orelse F" : term +\end{verbatim} +} +\SEEALSO +constants, infixes, is_constant, is_infix, new_constant, new_definition, +new_infix_definition. + +\ENDDOC \DOC{new\_infix\_list\_rec\_definition} \TYPE {\small\verb%new_infix_list_rec_definition : ((string # term) -> thm)%}\egroup @@ -17401,43 +17399,6 @@ new_binder, new_constant, new_definition new_specification, new_type, print_theory, save_thm, search_path. \ENDDOC -\DOC{new\_type} - -\TYPE {\small\verb%new_type : (int -> string -> void)%}\egroup - -\SYNOPSIS -Declares a new type or type constructor. - -\DESCRIBE -A call {\small\verb%new_type n `t`%} declares a new {\small\verb%n%}-ary type constructor called {\small\verb%t%} in -the current theory segment. If {\small\verb%n%} is zero, this is just a new base type. - -\FAILURE -Fails if HOL is not in draft mode, or if the name is not a valid type -name, or there is already a type operator of that name in the current theory. - -\EXAMPLE -A version of ZF set theory might declare a new type {\small\verb%set%} and start using it as -follows: -{\par\samepage\setseps\small -\begin{verbatim} - #new_theory `ZF`;; - () : void - - #new_type 0 `set`;; - () : void - - #new_infix(`mem`,":set->set->bool");; - () : void - - #new_axiom(`ext`,"(!z. z mem x = z mem y) ==> (x = y)");; - |- !x y. (!z. z mem x = z mem y) ==> (x = y) -\end{verbatim} -} -\SEEALSO -types, type_abbrevs, new_type_abbrev. - -\ENDDOC \DOC{new\_type\_abbrev} \TYPE {\small\verb%new_type_abbrev : ((string # type) -> void)%}\egroup @@ -17545,6 +17506,43 @@ define_new_type_bijections, prove_abs_fn prove_rep_fn_one_one, prove_rep_fn_onto. \ENDDOC +\DOC{new\_type} + +\TYPE {\small\verb%new_type : (int -> string -> void)%}\egroup + +\SYNOPSIS +Declares a new type or type constructor. + +\DESCRIBE +A call {\small\verb%new_type n `t`%} declares a new {\small\verb%n%}-ary type constructor called {\small\verb%t%} in +the current theory segment. If {\small\verb%n%} is zero, this is just a new base type. + +\FAILURE +Fails if HOL is not in draft mode, or if the name is not a valid type +name, or there is already a type operator of that name in the current theory. + +\EXAMPLE +A version of ZF set theory might declare a new type {\small\verb%set%} and start using it as +follows: +{\par\samepage\setseps\small +\begin{verbatim} + #new_theory `ZF`;; + () : void + + #new_type 0 `set`;; + () : void + + #new_infix(`mem`,":set->set->bool");; + () : void + + #new_axiom(`ext`,"(!z. z mem x = z mem y) ==> (x = y)");; + |- !x y. (!z. z mem x = z mem y) ==> (x = y) +\end{verbatim} +} +\SEEALSO +types, type_abbrevs, new_type_abbrev. + +\ENDDOC \DOC{nil\_term\_net} \TYPE {\small\verb%nil_term_net : * term_net%}\egroup @@ -17554,6 +17552,38 @@ This function is for internal use only a version of the system. It should not be used. \ENDDOC +\DOC{NO\_CONV} + +\TYPE {\small\verb%NO_CONV : conv%}\egroup + +\SYNOPSIS +Conversion that always fails. + +\FAILURE +{\small\verb%NO_CONV%} always fails. + +\SEEALSO +ALL_CONV. + +\ENDDOC +\DOC{NO\_TAC} + +\TYPE {\small\verb%NO_TAC : tactic%}\egroup + +\SYNOPSIS +Tactic which always fails. + +\DESCRIBE +Whatever goal it is applied to, {\small\verb%NO_TAC%} always fails +with string {\small\verb%`NO_TAC`%}. + +\FAILURE +Always fails. + +\SEEALSO +ALL_TAC, ALL_THEN, FAIL_TAC, NO_THEN. + +\ENDDOC \DOC{not} \TYPE {\small\verb%$not : (bool -> bool)%}\egroup @@ -17660,7 +17690,29 @@ When applied to a term of the form {\sma Fails if applied to a term not of the form {\small\verb%~(!x.P)%}. \SEEALSO -EXISTS_NOT_CONV, FORALL_NOT_CONV, NOT_EXISTS_CONV. +EXISTS_NOT_CONV, FORALL_NOT_CONV, NOT_EXISTS_CONV. + +\ENDDOC +\DOC{NO\_THEN} + +\TYPE {\small\verb%NO_THEN : thm_tactical%}\egroup + +\SYNOPSIS +Theorem-tactical which always fails. + +\DESCRIBE +When applied to a theorem-tactic and a theorem, the theorem-tactical +{\small\verb%NO_THEN%} always fails with string {\small\verb%`NO_THEN`%}. + +\FAILURE +Always fails when applied to a theorem-tactic and a theorem (note that it +never gets as far as being applied to a goal!) + +\USES +Writing compound tactics or tacticals. + +\SEEALSO +ALL_TAC, ALL_THEN, FAIL_TAC, NO_TAC. \ENDDOC \DOC{NOT\_INTRO} @@ -17733,58 +17785,13 @@ expected to be a negation, use {\small\v MP, EQ_MP, LIST_MP, MATCH_MP, MATCH_MP_TAC, MP_TAC. \ENDDOC -\DOC{NO\_CONV} - -\TYPE {\small\verb%NO_CONV : conv%}\egroup - -\SYNOPSIS -Conversion that always fails. - -\FAILURE -{\small\verb%NO_CONV%} always fails. - -\SEEALSO -ALL_CONV. - -\ENDDOC -\DOC{NO\_TAC} - -\TYPE {\small\verb%NO_TAC : tactic%}\egroup - -\SYNOPSIS -Tactic which always fails. - -\DESCRIBE -Whatever goal it is applied to, {\small\verb%NO_TAC%} always fails -with string {\small\verb%`NO_TAC`%}. - -\FAILURE -Always fails. - -\SEEALSO -ALL_TAC, ALL_THEN, FAIL_TAC, NO_THEN. - -\ENDDOC -\DOC{NO\_THEN} +\DOC{n\_strip\_quant} -\TYPE {\small\verb%NO_THEN : thm_tactical%}\egroup +\TYPE {\small\verb%n_strip_quant : ((* -> (** # *)) -> int -> * -> (** list # *))%}\egroup \SYNOPSIS -Theorem-tactical which always fails. - -\DESCRIBE -When applied to a theorem-tactic and a theorem, the theorem-tactical -{\small\verb%NO_THEN%} always fails with string {\small\verb%`NO_THEN`%}. - -\FAILURE -Always fails when applied to a theorem-tactic and a theorem (note that it -never gets as far as being applied to a goal!) - -\USES -Writing compound tactics or tacticals. - -\SEEALSO -ALL_TAC, ALL_THEN, FAIL_TAC, NO_TAC. +This function is for internal use only and is to be deleted from a future +version of the system. It should not be used. \ENDDOC \DOC{null} @@ -17883,15 +17890,6 @@ and {\small\verb%m%} are syntactically i \end{verbatim} } \ENDDOC -\DOC{n\_strip\_quant} - -\TYPE {\small\verb%n_strip_quant : ((* -> (** # *)) -> int -> * -> (** list # *))%}\egroup - -\SYNOPSIS -This function is for internal use only and is to be deleted from a future -version of the system. It should not be used. - -\ENDDOC \DOC{o} \TYPE {\small\verb%$o : (((* -> **) # (*** -> *)) -> *** -> **)%}\egroup @@ -18063,6 +18061,71 @@ happens to generate a failure with strin DEPTH_CONV, REDEPTH_CONV, TOP_DEPTH_CONV, ONCE_REW_DEPTH_CONV. \ENDDOC +\DOC{ONCE\_REW\_DEPTH\_CONV} + +\TYPE {\small\verb%ONCE_REW_DEPTH_CONV : (conv -> conv)%}\egroup + +\SYNOPSIS +Applies a conversion once to the first suitable sub-term(s) encountered in +top-down order. For use in rewriting. + +\DESCRIBE +{\small\verb%ONCE_REW_DEPTH_CONV c tm%} applies the conversion {\small\verb%c%} once to the first +subterm or subterms encountered in a top-down `parallel' search of the term +{\small\verb%tm%} for which {\small\verb%c%} succeeds. If the conversion {\small\verb%c%} fails on all subterms of +{\small\verb%tm%}, the theorem returned is {\small\verb%|- tm = tm%}. + +{\small\verb%ONCE_REW_DEPTH_CONV%} is a special version of {\small\verb%ONCE_DEPTH_CONV%} for use by the +rewriting conversions, rules and tactics. It differs from {\small\verb%ONCE_DEPTH_CONV%} as +follows: If converting an abstraction fails due to the presence of the bound +variable in the hypotheses of the theorem generated by converting the body, +{\small\verb%ONCE_REW_DEPTH_CONV%} retries the conversion having renamed the bound variable +of the abstraction. If successful the renaming is reversed. + +\FAILURE +Never fails. + +\EXAMPLE +The following example illustrates the difference between the functions +{\small\verb%ONCE_REW_DEPTH_CONV%} and {\small\verb%ONCE_DEPTH_CONV%}. It is not intended to illustrate +the full range of behaviour of the former. Both {\small\verb%ONCE_REW_DEPTH_CONV%} and +{\small\verb%ONCE_DEPTH_CONV%} successfully apply the theorem {\small\verb%ADD_0%} inside an abstraction: +{\par\samepage\setseps\small +\begin{verbatim} + #ONCE_REW_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";; + |- (\n. n + 0) = (\n. n) + + #ONCE_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";; + |- (\n. n + 0) = (\n. n) +\end{verbatim} +} +\noindent However, if a hypothesis containing a free occurrence of the bound +variable is added to the rewrite rule, it interferes with the operation of +{\small\verb%ONCE_DEPTH_CONV%} but not that of {\small\verb%ONCE_REW_DEPTH_CONV%}: +{\par\samepage\setseps\small +\begin{verbatim} + #let th = ADD_ASSUM "n = 0" ADD_0;; + th = n = 0 |- !m. m + 0 = m + + #ONCE_REW_DEPTH_CONV (REWR_CONV th) "\n. n + 0";; + n = 0 |- (\n. n + 0) = (\n. n) + + #ONCE_DEPTH_CONV (REWR_CONV th) "\n. n + 0";; + |- (\n. n + 0) = (\n. n + 0) +\end{verbatim} +} +\COMMENTS +The implementation of this function uses failure to avoid rebuilding +unchanged subterms. That is to say, during execution the failure string +{\small\verb%`QCONV`%} may be generated and later trapped. The behaviour of the function +is dependent on this use of failure. So, if the conversion given as argument +happens to generate a failure with string {\small\verb%`QCONV`%}, the operation of +{\small\verb%ONCE_REW_DEPTH_CONV%} will be unpredictable. + +\SEEALSO +REW_DEPTH_CONV, ONCE_DEPTH_CONV. + +\ENDDOC \DOC{ONCE\_REWRITE\_CONV} \TYPE {\small\verb%ONCE_REWRITE_CONV : (thm list -> conv)%}\egroup @@ -18176,71 +18239,6 @@ ASM_REWRITE_TAC, ONCE_ASM_REWRITE_TAC, P PURE_ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWRITE_TAC, SUBST_TAC. \ENDDOC -\DOC{ONCE\_REW\_DEPTH\_CONV} - -\TYPE {\small\verb%ONCE_REW_DEPTH_CONV : (conv -> conv)%}\egroup - -\SYNOPSIS -Applies a conversion once to the first suitable sub-term(s) encountered in -top-down order. For use in rewriting. - -\DESCRIBE -{\small\verb%ONCE_REW_DEPTH_CONV c tm%} applies the conversion {\small\verb%c%} once to the first -subterm or subterms encountered in a top-down `parallel' search of the term -{\small\verb%tm%} for which {\small\verb%c%} succeeds. If the conversion {\small\verb%c%} fails on all subterms of -{\small\verb%tm%}, the theorem returned is {\small\verb%|- tm = tm%}. - -{\small\verb%ONCE_REW_DEPTH_CONV%} is a special version of {\small\verb%ONCE_DEPTH_CONV%} for use by the -rewriting conversions, rules and tactics. It differs from {\small\verb%ONCE_DEPTH_CONV%} as -follows: If converting an abstraction fails due to the presence of the bound -variable in the hypotheses of the theorem generated by converting the body, -{\small\verb%ONCE_REW_DEPTH_CONV%} retries the conversion having renamed the bound variable -of the abstraction. If successful the renaming is reversed. - -\FAILURE -Never fails. - -\EXAMPLE -The following example illustrates the difference between the functions -{\small\verb%ONCE_REW_DEPTH_CONV%} and {\small\verb%ONCE_DEPTH_CONV%}. It is not intended to illustrate -the full range of behaviour of the former. Both {\small\verb%ONCE_REW_DEPTH_CONV%} and -{\small\verb%ONCE_DEPTH_CONV%} successfully apply the theorem {\small\verb%ADD_0%} inside an abstraction: -{\par\samepage\setseps\small -\begin{verbatim} - #ONCE_REW_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";; - |- (\n. n + 0) = (\n. n) - - #ONCE_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";; - |- (\n. n + 0) = (\n. n) -\end{verbatim} -} -\noindent However, if a hypothesis containing a free occurrence of the bound -variable is added to the rewrite rule, it interferes with the operation of -{\small\verb%ONCE_DEPTH_CONV%} but not that of {\small\verb%ONCE_REW_DEPTH_CONV%}: -{\par\samepage\setseps\small -\begin{verbatim} - #let th = ADD_ASSUM "n = 0" ADD_0;; - th = n = 0 |- !m. m + 0 = m - - #ONCE_REW_DEPTH_CONV (REWR_CONV th) "\n. n + 0";; - n = 0 |- (\n. n + 0) = (\n. n) - - #ONCE_DEPTH_CONV (REWR_CONV th) "\n. n + 0";; - |- (\n. n + 0) = (\n. n + 0) -\end{verbatim} -} -\COMMENTS -The implementation of this function uses failure to avoid rebuilding -unchanged subterms. That is to say, during execution the failure string -{\small\verb%`QCONV`%} may be generated and later trapped. The behaviour of the function -is dependent on this use of failure. So, if the conversion given as argument -happens to generate a failure with string {\small\verb%`QCONV`%}, the operation of -{\small\verb%ONCE_REW_DEPTH_CONV%} will be unpredictable. - -\SEEALSO -REW_DEPTH_CONV, ONCE_DEPTH_CONV. - -\ENDDOC \DOC{oo} \TYPE {\small\verb%$oo : ((((* # **) -> ***) # (**** -> *) # (**** -> **)) -> **** -> ***)%}\egroup @@ -18311,43 +18309,43 @@ contents of file foo close, openi, read, write \ENDDOC -\DOC{ORELSE} +\DOC{ORELSEC} -\TYPE {\small\verb%$ORELSE : (tactic -> tactic -> tactic)%}\egroup +\TYPE {\small\verb%$ORELSEC : (conv -> conv -> conv)%}\egroup \SYNOPSIS -Applies first tactic, and iff it fails, applies the second instead. +Applies the first of two conversions that succeeds. \DESCRIBE -If {\small\verb%T1%} and {\small\verb%T2%} are tactics, {\small\verb%T1 ORELSE T2%} is a tactic which applies {\small\verb%T1%} to -a goal, and iff it fails, applies {\small\verb%T2%} to the goal instead. +{\small\verb%(c1 ORELSEC c2) "t"%} returns the result of applying the conversion {\small\verb%c1%} to +the term {\small\verb%"t"%} if this succeeds. Otherwise {\small\verb%(c1 ORELSEC c2) "t"%} returns the +result of applying the conversion {\small\verb%c2%} to the term {\small\verb%"t"%}. \FAILURE -The application of {\small\verb%ORELSE%} to a pair of tactics never fails. -The resulting tactic fails if both {\small\verb%T1%} and {\small\verb%T2%} fail when applied to the -relevant goal. +{\small\verb%(c1 ORELSEC c2) "t"%} fails both {\small\verb%c1%} and {\small\verb%c2%} fail when applied to {\small\verb%"t"%}. \SEEALSO -EVERY, FIRST, THEN. +FIRST_CONV. \ENDDOC -\DOC{ORELSEC} +\DOC{ORELSE} -\TYPE {\small\verb%$ORELSEC : (conv -> conv -> conv)%}\egroup +\TYPE {\small\verb%$ORELSE : (tactic -> tactic -> tactic)%}\egroup \SYNOPSIS -Applies the first of two conversions that succeeds. +Applies first tactic, and iff it fails, applies the second instead. \DESCRIBE -{\small\verb%(c1 ORELSEC c2) "t"%} returns the result of applying the conversion {\small\verb%c1%} to -the term {\small\verb%"t"%} if this succeeds. Otherwise {\small\verb%(c1 ORELSEC c2) "t"%} returns the -result of applying the conversion {\small\verb%c2%} to the term {\small\verb%"t"%}. +If {\small\verb%T1%} and {\small\verb%T2%} are tactics, {\small\verb%T1 ORELSE T2%} is a tactic which applies {\small\verb%T1%} to +a goal, and iff it fails, applies {\small\verb%T2%} to the goal instead. \FAILURE -{\small\verb%(c1 ORELSEC c2) "t"%} fails both {\small\verb%c1%} and {\small\verb%c2%} fail when applied to {\small\verb%"t"%}. +The application of {\small\verb%ORELSE%} to a pair of tactics never fails. +The resulting tactic fails if both {\small\verb%T1%} and {\small\verb%T2%} fail when applied to the +relevant goal. \SEEALSO -FIRST_CONV. +EVERY, FIRST, THEN. \ENDDOC \DOC{ORELSE\_TCL} @@ -18482,29 +18480,6 @@ evaluation failed outr outl, inl, inr, isl \ENDDOC -\DOC{p} - -\TYPE {\small\verb%p : (int -> void)%}\egroup - -\SYNOPSIS -Prints the top levels of the subgoal package goal stack. - -\DESCRIBE -The function {\small\verb%p%} is part of the subgoal package. It is an abbreviation for the -function {\small\verb%print_state%}. For a description of the subgoal package, see -{\small\verb%set_goal%}. - -\FAILURE -Never fails. - -\USES -Examining the proof state during an interactive proof session. - -\SEEALSO -b, backup, backup_limit, e, expand, expandf, g, get_state, print_state, r, -rotate, save_top_thm, set_goal, set_state, top_goal, top_thm. - -\ENDDOC \DOC{pair} \TYPE {\small\verb%pair : (* -> ** -> (* # **))%}\egroup @@ -18878,7 +18853,30 @@ implication (the inbuilt specialization quantifier), and matches it to {\small\verb%T%}. \SEEALSO -INST_TYPE, INST_TY_TERM, match. +INST_TYPE, INST_TY_TERM, match. + +\ENDDOC +\DOC{p} + +\TYPE {\small\verb%p : (int -> void)%}\egroup + +\SYNOPSIS +Prints the top levels of the subgoal package goal stack. + +\DESCRIBE +The function {\small\verb%p%} is part of the subgoal package. It is an abbreviation for the +function {\small\verb%print_state%}. For a description of the subgoal package, see +{\small\verb%set_goal%}. + +\FAILURE +Never fails. + +\USES +Examining the proof state during an interactive proof session. + +\SEEALSO +b, backup, backup_limit, e, expand, expandf, g, get_state, print_state, r, +rotate, save_top_thm, set_goal, set_state, top_goal, top_thm. \ENDDOC \DOC{POP\_ASSUM} @@ -20153,56 +20151,6 @@ Never fails. set_prompt. \ENDDOC -\DOC{PROVE} - -\TYPE {\small\verb%PROVE : ((term # tactic) -> thm)%}\egroup - -\SYNOPSIS -Attempts to prove a boolean term using the supplied tactic. - -\DESCRIBE -When applied to a term-tactic pair {\small\verb%(tm,tac)%}, the function {\small\verb%PROVE%} attempts to -prove the goal {\small\verb%?- tm%}, that is, the term {\small\verb%tm%} with no assumptions, using the -tactic {\small\verb%tac%}. If {\small\verb%PROVE%} succeeds, it returns the corresponding theorem -{\small\verb%A |- tm%}, where the assumption list {\small\verb%A%} may not be empty if the tactic is -invalid; {\small\verb%PROVE%} has no inbuilt validity-checking. - -\FAILURE -Fails if the term is not of type {\small\verb%bool%} (and so cannot possibly be -the conclusion of a theorem), or if the tactic cannot solve the goal. -In the latter case {\small\verb%PROVE%} will list the unsolved goals to help the user. - -\SEEALSO -TAC_PROOF, prove, prove_thm, VALID. - -\ENDDOC -\DOC{prove} - -\TYPE {\small\verb%prove : ((term # tactic) -> thm)%}\egroup - -\SYNOPSIS -Attempts to prove a boolean term using the supplied tactic. - -\DESCRIBE -When applied to a term-tactic pair {\small\verb%(tm,tac)%}, the function {\small\verb%prove%} attempts to -prove the goal {\small\verb%?- tm%}, that is, the term {\small\verb%tm%} with no assumptions, using the -tactic {\small\verb%tac%}. If {\small\verb%prove%} succeeds, it returns the corresponding theorem -{\small\verb%A |- tm%}, where the assumption list {\small\verb%A%} may not be empty if the tactic is -invalid; {\small\verb%prove%} has no inbuilt validity-checking. - -\FAILURE -Fails if the term is not of type {\small\verb%bool%} (and so cannot possibly be -the conclusion of a theorem), or if the tactic cannot solve the goal. - -\COMMENTS -The function {\small\verb%PROVE%} provides almost identical functionality, and will -also list unsolved goals if the tactic fails. It is therefore preferable -for most purposes. - -\SEEALSO -PROVE, prove_thm, TAC_PROOF, VALID. - -\ENDDOC \DOC{prove\_abs\_fn\_one\_one} \TYPE {\small\verb%prove_abs_fn_one_one : (thm -> thm)%}\egroup @@ -20398,6 +20346,56 @@ define_type, INDUCT_THEN, new_recursive_ prove_constructors_distinct, prove_induction_thm, prove_rec_fn_exists. \ENDDOC +\DOC{prove} + +\TYPE {\small\verb%prove : ((term # tactic) -> thm)%}\egroup + +\SYNOPSIS +Attempts to prove a boolean term using the supplied tactic. + +\DESCRIBE +When applied to a term-tactic pair {\small\verb%(tm,tac)%}, the function {\small\verb%prove%} attempts to +prove the goal {\small\verb%?- tm%}, that is, the term {\small\verb%tm%} with no assumptions, using the +tactic {\small\verb%tac%}. If {\small\verb%prove%} succeeds, it returns the corresponding theorem +{\small\verb%A |- tm%}, where the assumption list {\small\verb%A%} may not be empty if the tactic is +invalid; {\small\verb%prove%} has no inbuilt validity-checking. + +\FAILURE +Fails if the term is not of type {\small\verb%bool%} (and so cannot possibly be +the conclusion of a theorem), or if the tactic cannot solve the goal. + +\COMMENTS +The function {\small\verb%PROVE%} provides almost identical functionality, and will +also list unsolved goals if the tactic fails. It is therefore preferable +for most purposes. + +\SEEALSO +PROVE, prove_thm, TAC_PROOF, VALID. + +\ENDDOC +\DOC{PROVE} + +\TYPE {\small\verb%PROVE : ((term # tactic) -> thm)%}\egroup + +\SYNOPSIS +Attempts to prove a boolean term using the supplied tactic. + +\DESCRIBE +When applied to a term-tactic pair {\small\verb%(tm,tac)%}, the function {\small\verb%PROVE%} attempts to +prove the goal {\small\verb%?- tm%}, that is, the term {\small\verb%tm%} with no assumptions, using the +tactic {\small\verb%tac%}. If {\small\verb%PROVE%} succeeds, it returns the corresponding theorem +{\small\verb%A |- tm%}, where the assumption list {\small\verb%A%} may not be empty if the tactic is +invalid; {\small\verb%PROVE%} has no inbuilt validity-checking. + +\FAILURE +Fails if the term is not of type {\small\verb%bool%} (and so cannot possibly be +the conclusion of a theorem), or if the tactic cannot solve the goal. +In the latter case {\small\verb%PROVE%} will list the unsolved goals to help the user. + +\SEEALSO +TAC_PROOF, prove, prove_thm, VALID. + +\ENDDOC \DOC{PROVE\_HYP} \TYPE {\small\verb%PROVE_HYP : (thm -> thm -> thm)%}\egroup @@ -20940,45 +20938,6 @@ Evaluating {\small\verb%quit()%} termina Never fails. \ENDDOC -\DOC{r} - -\TYPE {\small\verb%r : (int -> void)%}\egroup - -\SYNOPSIS -Reorders the subgoals on top of the subgoal package goal stack. - -\DESCRIBE -The function {\small\verb%r%} is part of the subgoal package. It is an abbreviation for -{\small\verb%rotate%}. For a description of the subgoal package, see {\small\verb%set_goal%}. - -\FAILURE -As for {\small\verb%rotate%}. - -\USES -Proving subgoals in a different order to that generated by the subgoal package. - -\SEEALSO -b, backup, backup_limit, e, expand, expandf, g, get_state, p, print_state, -rotate, save_top_thm, set_goal, set_state, top_goal, top_thm. - -\ENDDOC -\DOC{rand} - -\TYPE {\small\verb%rand : (term -> term)%}\egroup - -\SYNOPSIS -Returns the operand from a combination (function application). - -\DESCRIBE -{\small\verb%rand "t1 t2"%} returns {\small\verb%"t2"%}. - -\FAILURE -Fails with {\small\verb%rand%} if term is not a combination. - -\SEEALSO -rator, dest_comb. - -\ENDDOC \DOC{RAND\_CONV} \TYPE {\small\verb%RAND_CONV : (conv -> conv)%}\egroup @@ -21016,21 +20975,21 @@ function returned by {\small\verb%RAND_C ABS_CONV, RATOR_CONV, SUB_CONV. \ENDDOC -\DOC{rator} +\DOC{rand} -\TYPE {\small\verb%rator : (term -> term)%}\egroup +\TYPE {\small\verb%rand : (term -> term)%}\egroup \SYNOPSIS -Returns the operator from a combination (function application). +Returns the operand from a combination (function application). \DESCRIBE -{\small\verb%rator("t1 t2")%} returns {\small\verb%"t1"%}. +{\small\verb%rand "t1 t2"%} returns {\small\verb%"t2"%}. \FAILURE -Fails with {\small\verb%rator%} if term is not a combination. +Fails with {\small\verb%rand%} if term is not a combination. \SEEALSO -rand, dest_comb. +rator, dest_comb. \ENDDOC \DOC{RATOR\_CONV} @@ -21070,6 +21029,45 @@ function returned by {\small\verb%RATOR_ ABS_CONV, RAND_CONV, SUB_CONV. \ENDDOC +\DOC{rator} + +\TYPE {\small\verb%rator : (term -> term)%}\egroup + +\SYNOPSIS +Returns the operator from a combination (function application). + +\DESCRIBE +{\small\verb%rator("t1 t2")%} returns {\small\verb%"t1"%}. + +\FAILURE +Fails with {\small\verb%rator%} if term is not a combination. + +\SEEALSO +rand, dest_comb. + +\ENDDOC +\DOC{r} + +\TYPE {\small\verb%r : (int -> void)%}\egroup + +\SYNOPSIS +Reorders the subgoals on top of the subgoal package goal stack. + +\DESCRIBE +The function {\small\verb%r%} is part of the subgoal package. It is an abbreviation for +{\small\verb%rotate%}. For a description of the subgoal package, see {\small\verb%set_goal%}. + +\FAILURE +As for {\small\verb%rotate%}. + +\USES +Proving subgoals in a different order to that generated by the subgoal package. + +\SEEALSO +b, backup, backup_limit, e, expand, expandf, g, get_state, p, print_state, +rotate, save_top_thm, set_goal, set_state, top_goal, top_thm. + +\ENDDOC \DOC{read} \TYPE {\small\verb%read : (string -> string)%}\egroup @@ -21091,63 +21089,26 @@ descriptor. \EXAMPLE The following assumes that HOL is being run under Unix. It will overwrite an existing file {\small\verb%test-file%} in the current directory. Notice that the actual -string returned by {\small\verb%openi%} may vary on other systems. -{\par\samepage\setseps\small -\begin{verbatim} - #system `echo "Hi" >test-file`;; - 0 : int - - #let port = openi `test-file`;; - port = `%test-file` : string - - #read port, read port, read port, read port, read port;; - (`H`, `i`, ` - `, `nil`, `nil`) - : (string # string # string # string # string) - - #close port;; - () : void -\end{verbatim} -} -\SEEALSO -append_openw, close, openi, openw, tty_read, tty_write, write. - -\ENDDOC -\DOC{RecordStep} - -\TYPE {\small\verb%RecordStep : step -> void%}\egroup - - -\SYNOPSIS -Record a single inference step. - -\DESCRIBE -A proof is a list of inference steps. After the proof recorder is -enabled, every inference performed by the system is recorded and -cumulated in an internal buffer. When a proof is completed, the raw -records can then be processed and output to a disk file. - -{\small\verb%record_proof%} is a system function for recording a single proof step. -The type {\small\verb%step%} represents a basic inference step. It contains all -the necessary information of each inference. There are currently 52 -basic inferences which are being recorded. All other ML functions -representing inference rules are implemented by these basic -inferences. -If the proof recorder is enabled when an inference is performed, -{\small\verb%RecordStep%} will add a step into the internal buffer. +string returned by {\small\verb%openi%} may vary on other systems. +{\par\samepage\setseps\small +\begin{verbatim} + #system `echo "Hi" >test-file`;; + 0 : int -\FAILURE -Never fail. + #let port = openi `test-file`;; + port = `%test-file` : string -\COMMENTS -This is a system function implementing the proof recorded. Users -should not use this function directly. User functions are provided in -the library {\small\verb%record_proof%}. When new basic inference rule -is implemented, this function should be called to record the inference step. + #read port, read port, read port, read port, read port;; + (`H`, `i`, ` + `, `nil`, `nil`) + : (string # string # string # string # string) + #close port;; + () : void +\end{verbatim} +} \SEEALSO -record_proof, is_recording_proof, get_steps, -suspend_recording, resume_recording. +append_openw, close, openi, openw, tty_read, tty_write, write. \ENDDOC \DOC{record\_proof} @@ -21225,6 +21186,43 @@ new_proof_file, close_proof_file, begin_ TAC_PROOF, PROVE, prove, prove_thm. \ENDDOC +\DOC{RecordStep} + +\TYPE {\small\verb%RecordStep : step -> void%}\egroup + + +\SYNOPSIS +Record a single inference step. + +\DESCRIBE +A proof is a list of inference steps. After the proof recorder is +enabled, every inference performed by the system is recorded and +cumulated in an internal buffer. When a proof is completed, the raw +records can then be processed and output to a disk file. + +{\small\verb%record_proof%} is a system function for recording a single proof step. +The type {\small\verb%step%} represents a basic inference step. It contains all +the necessary information of each inference. There are currently 52 +basic inferences which are being recorded. All other ML functions +representing inference rules are implemented by these basic +inferences. +If the proof recorder is enabled when an inference is performed, +{\small\verb%RecordStep%} will add a step into the internal buffer. + +\FAILURE +Never fail. + +\COMMENTS +This is a system function implementing the proof recorded. Users +should not use this function directly. User functions are provided in +the library {\small\verb%record_proof%}. When new basic inference rule +is implemented, this function should be called to record the inference step. + +\SEEALSO +record_proof, is_recording_proof, get_steps, +suspend_recording, resume_recording. + +\ENDDOC \DOC{REDEPTH\_CONV} \TYPE {\small\verb%REDEPTH_CONV : (conv -> conv)%}\egroup @@ -21373,25 +21371,6 @@ Fails if the name was not associated wit set_sticky_type, sticky_list. \ENDDOC -\DOC{REPEAT} - -\TYPE {\small\verb%REPEAT : (tactic -> tactic)%}\egroup - -\SYNOPSIS -Repeatedly applies a tactic until it fails. - -\DESCRIBE -The tactic {\small\verb%REPEAT T%} is a tactic which applies {\small\verb%T%} to a goal, and while it -succeeds, continues applying it to all subgoals generated. - -\FAILURE -The application of {\small\verb%REPEAT%} to a tactic never fails, and neither does the -composite tactic, even if the basic tactic fails immediately. - -\SEEALSO -EVERY, FIRST, ORELSE, THEN, THENL. - -\ENDDOC \DOC{REPEATC} \TYPE {\small\verb%REPEATC : (conv -> conv)%}\egroup @@ -21412,6 +21391,25 @@ returns {\small\verb%|- t1 = t(n+1)%}. A Never fails, but can diverge if the supplied conversion never fails. \ENDDOC +\DOC{REPEAT} + +\TYPE {\small\verb%REPEAT : (tactic -> tactic)%}\egroup + +\SYNOPSIS +Repeatedly applies a tactic until it fails. + +\DESCRIBE +The tactic {\small\verb%REPEAT T%} is a tactic which applies {\small\verb%T%} to a goal, and while it +succeeds, continues applying it to all subgoals generated. + +\FAILURE +The application of {\small\verb%REPEAT%} to a tactic never fails, and neither does the +composite tactic, even if the basic tactic fails immediately. + +\SEEALSO +EVERY, FIRST, ORELSE, THEN, THENL. + +\ENDDOC \DOC{REPEAT\_GTCL} \TYPE {\small\verb%REPEAT_GTCL : (thm_tactical -> thm_tactical)%}\egroup @@ -21492,20 +21490,6 @@ example the following goal: REPEAT_GTCL, THEN_TCL. \ENDDOC -\DOC{replicate} - -\TYPE {\small\verb%replicate : (* -> int -> * list)%}\egroup - -\SYNOPSIS -Makes a list consisting of a value replicated a specified number of times. - -\DESCRIBE -{\small\verb%replicate x n%} returns {\small\verb%[x;...;x]%}, a list of length {\small\verb%n%}. - -\FAILURE -Fails if number of replications is less than zero. - -\ENDDOC \DOC{rep\_goals} \TYPE {\small\verb%rep_goals : (goalstack -> subgoals list)%}\egroup @@ -21515,43 +21499,18 @@ This function is for internal use only a version of the system. It should not be used. \ENDDOC -\DOC{resume\_recording} - -\TYPE {\small\verb%resume_recording : void -> void%}\egroup +\DOC{replicate} +\TYPE {\small\verb%replicate : (* -> int -> * list)%}\egroup \SYNOPSIS -Suspend proof recording temporarily. +Makes a list consisting of a value replicated a specified number of times. \DESCRIBE -A proof is a list of inference steps. After the proof recorder is -enabled, every inference performed by the system is recorded and -cumulated in an internal buffer. When a proof is completed, the raw -records can then be processed and output to a disk file. - -{\small\verb%resume_recording%} is a low level user function for managing the proof -recorder. It resumes the proof recorder without clearing the internal -inference step buffer. The proof recorder should be in the suspended state. -Otherwise, this function does nothing. - -The current state of the proof recorder can interrogated using the -function {\small\verb%is_recording_proof%}. A value of {\small\verb%false%} indicates the proof -recorder is disabled. +{\small\verb%replicate x n%} returns {\small\verb%[x;...;x]%}, a list of length {\small\verb%n%}. \FAILURE -Never fail. - -\COMMENTS -This function is used to implement higher level user functions for -recording proof in the library {\small\verb%record_proof%}. It is much more -convenient to use those functions than the low level functions -such as {\small\verb%resume_recording%} directly. - -\SEEALSO -record_proof, is_recording_proof, RecordStep, get_steps, suspend_recording, -current_proof, current_proof_file, -new_proof_file, close_proof_file, begin_proof, end_proof, -TAC_PROOF, PROVE, prove, prove_thm. +Fails if number of replications is less than zero. \ENDDOC \DOC{RES\_CANON} @@ -21757,60 +21716,126 @@ assumptions of a goal. {\small\verb%RES_ implications used for resolution are taken from the assumptions of the goal itself, rather than supplied as an argument. -When applied to a goal {\small\verb%A ?- g%}, the tactic {\small\verb%RES_THEN ttac%} uses {\small\verb%RES_CANON%} to -obtain a set of implicative theorems in canonical form from the assumptions {\small\verb%A%} -of the goal. Each of the resulting theorems (if there are any) will have the -form: -{\par\samepage\setseps\small -\begin{verbatim} - ai |- !x1...xn. ui ==> vi -\end{verbatim} -} -\noindent where {\small\verb%ai%} is one of the assumptions of the goal. Having obtained -these implications, {\small\verb%RES_THEN%} then attempts to match each antecedent {\small\verb%ui%} to -each assumption {\small\verb%aj |- aj%} in the assumptions {\small\verb%A%}. If the antecedent {\small\verb%ui%} of -any implication matches the conclusion {\small\verb%aj%} of any assumption, then an instance -of the theorem {\small\verb%ai, aj |- vi%}, called a `resolvent', is obtained by -specialization of the variables {\small\verb%x1%}, ..., {\small\verb%xn%} and type instantiation, -followed by an application of modus ponens. There may be more than one -canonical implication derivable from the assumptions of the goal and each -such implication is tried against every assumption, so there may be several -resolvents (or, indeed, none). +When applied to a goal {\small\verb%A ?- g%}, the tactic {\small\verb%RES_THEN ttac%} uses {\small\verb%RES_CANON%} to +obtain a set of implicative theorems in canonical form from the assumptions {\small\verb%A%} +of the goal. Each of the resulting theorems (if there are any) will have the +form: +{\par\samepage\setseps\small +\begin{verbatim} + ai |- !x1...xn. ui ==> vi +\end{verbatim} +} +\noindent where {\small\verb%ai%} is one of the assumptions of the goal. Having obtained +these implications, {\small\verb%RES_THEN%} then attempts to match each antecedent {\small\verb%ui%} to +each assumption {\small\verb%aj |- aj%} in the assumptions {\small\verb%A%}. If the antecedent {\small\verb%ui%} of +any implication matches the conclusion {\small\verb%aj%} of any assumption, then an instance +of the theorem {\small\verb%ai, aj |- vi%}, called a `resolvent', is obtained by +specialization of the variables {\small\verb%x1%}, ..., {\small\verb%xn%} and type instantiation, +followed by an application of modus ponens. There may be more than one +canonical implication derivable from the assumptions of the goal and each +such implication is tried against every assumption, so there may be several +resolvents (or, indeed, none). + +Tactics are produced using the theorem-tactic {\small\verb%ttac%} from all these resolvents +(failures of {\small\verb%ttac%} at this stage are filtered out) and these tactics are then +applied in an unspecified sequence to the goal. That is, +{\par\samepage\setseps\small +\begin{verbatim} + RES_THEN ttac (A ?- g) +\end{verbatim} +} +\noindent has the effect of: +{\par\samepage\setseps\small +\begin{verbatim} + MAP_EVERY (mapfilter ttac [... ; (ai,aj |- vi) ; ...]) (A ?- g) +\end{verbatim} +} +\noindent where the theorems {\small\verb%ai,aj |- vi%} are all the consequences that can be +drawn by a (single) matching modus-ponens inference from the assumptions {\small\verb%A%} +and the implications derived using {\small\verb%RES_CANON%} from the assumptions. The +sequence in which the theorems {\small\verb%ai,aj |- vi%} are generated and the +corresponding tactics applied is unspecified. + +\FAILURE +Evaluating {\small\verb%RES_THEN ttac th%} fails with `{\small\verb%no implication%}' if no +implication(s) can be derived from the assumptions of the goal by the +transformation process described under the entry for {\small\verb%RES_CANON%}. Evaluating +{\small\verb%RES_THEN ttac (A ?- g)%} fails with `{\small\verb%no resolvents%}' if no assumption of the +goal {\small\verb%A ?- g%} can be resolved with the derived implication or implications. +Evaluation also fails, with `{\small\verb%no tactics%}', if there are resolvents, but for +every resolvent {\small\verb%ai,aj |- vi%} evaluating the application {\small\verb%ttac (ai,aj |- vi)%} +fails---that is, if for every resolvent {\small\verb%ttac%} fails to produce a tactic. +Finally, failure is propagated if any of the tactics that are produced from the +resolvents by {\small\verb%ttac%} fails when applied in sequence to the goal. + +\SEEALSO +IMP_RES_TAC, IMP_RES_THEN, MATCH_MP, RES_CANON, RES_TAC. + +\ENDDOC +\DOC{resume\_recording} + +\TYPE {\small\verb%resume_recording : void -> void%}\egroup + + +\SYNOPSIS +Suspend proof recording temporarily. + +\DESCRIBE +A proof is a list of inference steps. After the proof recorder is +enabled, every inference performed by the system is recorded and +cumulated in an internal buffer. When a proof is completed, the raw +records can then be processed and output to a disk file. + +{\small\verb%resume_recording%} is a low level user function for managing the proof +recorder. It resumes the proof recorder without clearing the internal +inference step buffer. The proof recorder should be in the suspended state. +Otherwise, this function does nothing. + +The current state of the proof recorder can interrogated using the +function {\small\verb%is_recording_proof%}. A value of {\small\verb%false%} indicates the proof +recorder is disabled. + +\FAILURE +Never fail. + +\COMMENTS +This function is used to implement higher level user functions for +recording proof in the library {\small\verb%record_proof%}. It is much more +convenient to use those functions than the low level functions +such as {\small\verb%resume_recording%} directly. + +\SEEALSO +record_proof, is_recording_proof, RecordStep, get_steps, suspend_recording, +current_proof, current_proof_file, +new_proof_file, close_proof_file, begin_proof, end_proof, +TAC_PROOF, PROVE, prove, prove_thm. + +\ENDDOC +\DOC{rev\_assoc} + +\TYPE {\small\verb%rev_assoc : (* -> (** # *) list -> (** # *))%}\egroup + +\SYNOPSIS +Searches a list of pairs for a pair whose second component equals a specified +value. + +\DESCRIBE +{\small\verb%rev_assoc y [(x1,y1);...;(xn,yn)]%} returns the first {\small\verb%(xi,yi)%} in the list +such that {\small\verb%yi%} equals {\small\verb%y%}. + +\FAILURE +Fails if no matching pair is found. This will always be the case if the list +is empty. -Tactics are produced using the theorem-tactic {\small\verb%ttac%} from all these resolvents -(failures of {\small\verb%ttac%} at this stage are filtered out) and these tactics are then -applied in an unspecified sequence to the goal. That is, -{\par\samepage\setseps\small -\begin{verbatim} - RES_THEN ttac (A ?- g) -\end{verbatim} -} -\noindent has the effect of: +\EXAMPLE {\par\samepage\setseps\small \begin{verbatim} - MAP_EVERY (mapfilter ttac [... ; (ai,aj |- vi) ; ...]) (A ?- g) +#rev_assoc 2 [(1,4);(3,2);(2,5);(2,6)];; +(3, 2) : (int # int) \end{verbatim} } -\noindent where the theorems {\small\verb%ai,aj |- vi%} are all the consequences that can be -drawn by a (single) matching modus-ponens inference from the assumptions {\small\verb%A%} -and the implications derived using {\small\verb%RES_CANON%} from the assumptions. The -sequence in which the theorems {\small\verb%ai,aj |- vi%} are generated and the -corresponding tactics applied is unspecified. - -\FAILURE -Evaluating {\small\verb%RES_THEN ttac th%} fails with `{\small\verb%no implication%}' if no -implication(s) can be derived from the assumptions of the goal by the -transformation process described under the entry for {\small\verb%RES_CANON%}. Evaluating -{\small\verb%RES_THEN ttac (A ?- g)%} fails with `{\small\verb%no resolvents%}' if no assumption of the -goal {\small\verb%A ?- g%} can be resolved with the derived implication or implications. -Evaluation also fails, with `{\small\verb%no tactics%}', if there are resolvents, but for -every resolvent {\small\verb%ai,aj |- vi%} evaluating the application {\small\verb%ttac (ai,aj |- vi)%} -fails---that is, if for every resolvent {\small\verb%ttac%} fails to produce a tactic. -Finally, failure is propagated if any of the tactics that are produced from the -resolvents by {\small\verb%ttac%} fails when applied in sequence to the goal. - \SEEALSO -IMP_RES_TAC, IMP_RES_THEN, MATCH_MP, RES_CANON, RES_TAC. +assoc, find, mem, tryfind, exists, forall. \ENDDOC \DOC{rev} @@ -21871,33 +21896,6 @@ FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV. \ENDDOC -\DOC{rev\_assoc} - -\TYPE {\small\verb%rev_assoc : (* -> (** # *) list -> (** # *))%}\egroup - -\SYNOPSIS -Searches a list of pairs for a pair whose second component equals a specified -value. - -\DESCRIBE -{\small\verb%rev_assoc y [(x1,y1);...;(xn,yn)]%} returns the first {\small\verb%(xi,yi)%} in the list -such that {\small\verb%yi%} equals {\small\verb%y%}. - -\FAILURE -Fails if no matching pair is found. This will always be the case if the list -is empty. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#rev_assoc 2 [(1,4);(3,2);(2,5);(2,6)];; -(3, 2) : (int # int) -\end{verbatim} -} -\SEEALSO -assoc, find, mem, tryfind, exists, forall. - -\ENDDOC \DOC{rev\_itlist} \TYPE {\small\verb%rev_itlist : ((* -> ** -> **) -> * list -> ** -> **)%}\egroup @@ -21923,185 +21921,72 @@ Never fails. itlist, end_itlist. \ENDDOC -\DOC{REWRITE\_CONV} - -\TYPE {\small\verb%REWRITE_CONV : (thm list -> conv)%}\egroup - -\SYNOPSIS -Rewrites a term including built-in tautologies in the list of rewrites. - -\DESCRIBE -Rewriting a term using {\small\verb%REWRITE_CONV%} utilizes as rewrites two sets -of theorems: the tautologies in the ML list {\small\verb%basic_rewrites%} and the -ones supplied by the user. The rule searches top-down and recursively -for subterms which match the left-hand side of any of the possible -rewrites, until none of the transformations are applicable. There is no -ordering specified among the set of rewrites. - -Variants of this conversion allow changes in the set of equations used: -{\small\verb%PURE_REWRITE_CONV%} and others in its family do not rewrite with the -theorems in {\small\verb%basic_rewrites%}. - -The top-down recursive search for matches may not be desirable, as -this may increase the number of inferences being made or may result in -divergence. In this case other rewriting tools such as -{\small\verb%ONCE_REWRITE_CONV%} and {\small\verb%GEN_REWRITE_CONV%} can be used, or the set of -theorems given may be reduced. - -See {\small\verb%GEN_REWRITE_CONV%} for the general strategy for simplifying -theorems in HOL using equational theorems. - -\FAILURE -Does not fail, but may diverge if the sequence of rewrites is -non-terminating. - -\USES -Used to manipulate terms by rewriting them with theorems. -While resulting in high degree of automation, {\small\verb%REWRITE_CONV%} can -spawn a large number of inference steps. Thus, variants such -as {\small\verb%PURE_REWRITE_CONV%}, or other rules such as {\small\verb%SUBST_CONV%}, may be used -instead to improve efficiency. - -\SEEALSO -basic_rewrites, GEN_REWRITE_CONV, ONCE_REWRITE_CONV, -PURE_REWRITE_CONV, REWR_CONV, SUBST_CONV. - -\ENDDOC -\DOC{REWRITE\_RULE} - -\TYPE {\small\verb%REWRITE_RULE : (thm list -> thm -> thm)%}\egroup - -\SYNOPSIS -Rewrites a theorem including built-in tautologies in the list of rewrites. - -\DESCRIBE -Rewriting a theorem using {\small\verb%REWRITE_RULE%} utilizes as rewrites two sets -of theorems: the tautologies in the ML list {\small\verb%basic_rewrites%} and the -ones supplied by the user. The rule searches top-down and recursively -for subterms which match the left-hand side of any of the possible -rewrites, until none of the transformations are applicable. There is no -ordering specified among the set of rewrites. - -Variants of this rule allow changes in the set of equations used: -{\small\verb%PURE_REWRITE_RULE%} and others in its family do not rewrite with the -theorems in {\small\verb%basic_rewrites%}. Rules such as {\small\verb%ASM_REWRITE_RULE%} add the -assumptions of the object theorem (or a specified subset of these assumptions) -to the set of possible rewrites. - -The top-down recursive search for matches may not be desirable, as -this may increase the number of inferences being made or may result in -divergence. In this case other rewriting tools such as -{\small\verb%ONCE_REWRITE_RULE%} and {\small\verb%GEN_REWRITE_RULE%} can be used, or the set of -theorems given may be reduced. - -See {\small\verb%GEN_REWRITE_RULE%} for the general strategy for simplifying -theorems in HOL using equational theorems. - -\FAILURE -Does not fail, but may diverge if the sequence of rewrites is -non-terminating. - -\USES -Used to manipulate theorems by rewriting them with other theorems. -While resulting in high degree of automation, {\small\verb%REWRITE_RULE%} can -spawn a large number of inference steps. Thus, variants such -as {\small\verb%PURE_REWRITE_RULE%}, or other rules such as {\small\verb%SUBST%}, may be used -instead to improve efficiency. - -\SEEALSO -ASM_REWRITE_RULE, basic_rewrites, GEN_REWRITE_RULE, ONCE_REWRITE_RULE, -PURE_REWRITE_RULE, REWR_CONV, REWRITE_CONV, SUBST. - -\ENDDOC -\DOC{REWRITE\_TAC} +\DOC{REW\_DEPTH\_CONV} -\TYPE {\small\verb%REWRITE_TAC : (thm list -> tactic)%}\egroup +\TYPE {\small\verb%REW_DEPTH_CONV : (conv -> conv)%}\egroup \SYNOPSIS -Rewrites a goal including built-in tautologies in the list of rewrites. +Applies a conversion top-down to all subterms, retraversing changed ones. +For use in rewriting. \DESCRIBE -Rewriting tactics in HOL provide a recursive left-to-right matching -and rewriting facility that automatically decomposes subgoals and -justifies segments of proof in which equational theorems are used, -singly or collectively. These include the unfolding of definitions, -and the substitution of equals for equals. Rewriting is used either -to advance or to complete the decomposition of subgoals. - -{\small\verb%REWRITE_TAC%} transforms (or solves) a goal by using as rewrite rules -(i.e. as left-to-right replacement rules) the conclusions of the given -list of (equational) theorems, as well as a set of built-in theorems -(common tautologies) held in the ML variable {\small\verb%basic_rewrites%}. -Recognition of a tautology often terminates the subgoaling process -(i.e. solves the goal). - -The equational rewrites generated are applied recursively and to -arbitrary depth, with matching and instantiation of variables and type -variables. A list of rewrites can set off an infinite rewriting -process, and it is not, of course, decidable in general whether a -rewrite set has that property. The order in which the rewrite theorems -are applied is unspecified, and the user should not depend on any -ordering. - -See {\small\verb%GEN_REWRITE_TAC%} for more details on the rewriting process. -Variants of {\small\verb%REWRITE_TAC%} allow the use of a different set of -rewrites. Some of them, such as {\small\verb%PURE_REWRITE_TAC%}, exclude the basic -tautologies from the possible transformations. {\small\verb%ASM_REWRITE_TAC%} and -others include the assumptions at the goal in the set of possible -rewrites. +{\small\verb%REW_DEPTH_CONV c tm%} repeatedly applies the conversion {\small\verb%c%} to all the subterms +of the term {\small\verb%tm%}, including the term {\small\verb%tm%} itself. The supplied conversion {\small\verb%c%} +is applied to the subterms of {\small\verb%tm%} in top-down order and is applied repeatedly +(zero or more times, as is done by {\small\verb%REPEATC%}) at each subterm until it fails. +If a subterm {\small\verb%t%} is changed (up to alpha-equivalence) by virtue of the +application of {\small\verb%c%} to its own subterms, then the term into which {\small\verb%t%} is +transformed is retraversed by applying {\small\verb%REW_DEPTH_CONV c%} to it. -Still other tactics allow greater control over the search for -rewritable subterms. Several of them such as {\small\verb%ONCE_REWRITE_TAC%} do not -apply rewrites recursively. {\small\verb%GEN_REWRITE_TAC%} allows a rewrite to be -applied at a particular subterm. +{\small\verb%REW_DEPTH_CONV%} is a special version of {\small\verb%TOP_DEPTH_CONV%} for use by the +rewriting conversions, rules and tactics. It differs from {\small\verb%TOP_DEPTH_CONV%} as +follows: If converting an abstraction fails due to the presence of the bound +variable in the hypotheses of the theorem generated by converting the body, +{\small\verb%REW_DEPTH_CONV%} retries the conversion having renamed the bound variable of +the abstraction. If successful the renaming is reversed. \FAILURE -{\small\verb%REWRITE_TAC%} does not fail. Certain sets of rewriting theorems on -certain goals may cause a non-terminating sequence of rewrites. -Divergent rewriting behaviour results from a term {\small\verb%t%} being -immediately or eventually rewritten to a term containing {\small\verb%t%} as a -sub-term. The exact behaviour depends on the {\small\verb%HOL%} implementation; it -may be possible (unfortunately) to fall into Lisp in this event. +{\small\verb%REW_DEPTH_CONV c tm%} never fails but can diverge. \EXAMPLE -The arithmetic theorem {\small\verb%GREATER%}, {\small\verb%|- !m n. m > n = n < m%}, is used -below to advance a goal: +The following example illustrates the difference between the functions +{\small\verb%REW_DEPTH_CONV%} and {\small\verb%TOP_DEPTH_CONV%}. It is not intended to illustrate the +full range of behaviour of the former. Both {\small\verb%REW_DEPTH_CONV%} and +{\small\verb%TOP_DEPTH_CONV%} successfully apply the theorem {\small\verb%ADD_0%} inside an abstraction: {\par\samepage\setseps\small \begin{verbatim} - #REWRITE_TAC[GREATER]([],"5 > 4");; - ([([], "4 < 5")], -) : subgoals + #REW_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";; + |- (\n. n + 0) = (\n. n) + + #TOP_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";; + |- (\n. n + 0) = (\n. n) \end{verbatim} } -\noindent It is used below with the theorem {\small\verb%LESS_0%}, -{\small\verb%|- !n. 0 < (SUC n)%}, to solve a goal: +\noindent However, if a hypothesis containing a free occurrence of the bound +variable is added to the rewrite rule, it interferes with the operation of +{\small\verb%TOP_DEPTH_CONV%} but not that of {\small\verb%REW_DEPTH_CONV%}: {\par\samepage\setseps\small \begin{verbatim} - #let gl,p = REWRITE_TAC[GREATER;LESS_0]([],"(SUC n) > 0");; - gl = [] : goal list - p = - : proof + #let th = ADD_ASSUM "n = 0" ADD_0;; + th = n = 0 |- !m. m + 0 = m + + #REW_DEPTH_CONV (REWR_CONV th) "\n. n + 0";; + n = 0 |- (\n. n + 0) = (\n. n) - #p[];; - |- (SUC n) > 0 + #TOP_DEPTH_CONV (REWR_CONV th) "\n. n + 0";; + |- (\n. n + 0) = (\n. n + 0) \end{verbatim} } -\USES -Rewriting is a powerful and general mechanism in HOL, and an -important part of many proofs. It relieves the user of the burden of -directing and justifying a large number of minor proof steps. -{\small\verb%REWRITE_TAC%} fits a forward proof sequence smoothly into the general -goal-oriented framework. That is, (within one subgoaling step) it -produces and justifies certain forward inferences, none of which are -necessarily on a direct path to the desired goal. - -{\small\verb%REWRITE_TAC%} may be more powerful a tactic than is needed in certain -situations; if efficiency is at stake, alternatives might be -considered. +\COMMENTS +The implementation of this function uses failure to avoid rebuilding +unchanged subterms. That is to say, during execution the failure string +{\small\verb%`QCONV`%} may be generated and later trapped. The behaviour of the function +is dependent on this use of failure. So, if the conversion given as argument +happens to generate a failure with string {\small\verb%`QCONV`%}, the operation of +{\small\verb%REW_DEPTH_CONV%} will be unpredictable. \SEEALSO -ASM_REWRITE_TAC, GEN_REWRITE_TAC, FILTER_ASM_REWRITE_TAC, -FILTER_ONCE_ASM_REWRITE_TAC, ONCE_ASM_REWRITE_TAC, ONCE_REWRITE_TAC, -PURE_ASM_REWRITE_TAC, PURE_ONCE_ASM_REWRITE_TAC, -PURE_ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWR_CONV, REWRITE_CONV, SUBST_TAC. +ONCE_REW_DEPTH_CONV, TOP_DEPTH_CONV. \ENDDOC \DOC{REWR\_CONV} @@ -22271,72 +22156,185 @@ must be instantiated in order to match t REWRITE_CONV. \ENDDOC -\DOC{REW\_DEPTH\_CONV} +\DOC{REWRITE\_CONV} -\TYPE {\small\verb%REW_DEPTH_CONV : (conv -> conv)%}\egroup +\TYPE {\small\verb%REWRITE_CONV : (thm list -> conv)%}\egroup \SYNOPSIS -Applies a conversion top-down to all subterms, retraversing changed ones. -For use in rewriting. +Rewrites a term including built-in tautologies in the list of rewrites. \DESCRIBE -{\small\verb%REW_DEPTH_CONV c tm%} repeatedly applies the conversion {\small\verb%c%} to all the subterms -of the term {\small\verb%tm%}, including the term {\small\verb%tm%} itself. The supplied conversion {\small\verb%c%} -is applied to the subterms of {\small\verb%tm%} in top-down order and is applied repeatedly -(zero or more times, as is done by {\small\verb%REPEATC%}) at each subterm until it fails. -If a subterm {\small\verb%t%} is changed (up to alpha-equivalence) by virtue of the -application of {\small\verb%c%} to its own subterms, then the term into which {\small\verb%t%} is -transformed is retraversed by applying {\small\verb%REW_DEPTH_CONV c%} to it. +Rewriting a term using {\small\verb%REWRITE_CONV%} utilizes as rewrites two sets +of theorems: the tautologies in the ML list {\small\verb%basic_rewrites%} and the +ones supplied by the user. The rule searches top-down and recursively +for subterms which match the left-hand side of any of the possible +rewrites, until none of the transformations are applicable. There is no +ordering specified among the set of rewrites. -{\small\verb%REW_DEPTH_CONV%} is a special version of {\small\verb%TOP_DEPTH_CONV%} for use by the -rewriting conversions, rules and tactics. It differs from {\small\verb%TOP_DEPTH_CONV%} as -follows: If converting an abstraction fails due to the presence of the bound -variable in the hypotheses of the theorem generated by converting the body, -{\small\verb%REW_DEPTH_CONV%} retries the conversion having renamed the bound variable of -the abstraction. If successful the renaming is reversed. +Variants of this conversion allow changes in the set of equations used: +{\small\verb%PURE_REWRITE_CONV%} and others in its family do not rewrite with the +theorems in {\small\verb%basic_rewrites%}. + +The top-down recursive search for matches may not be desirable, as +this may increase the number of inferences being made or may result in +divergence. In this case other rewriting tools such as +{\small\verb%ONCE_REWRITE_CONV%} and {\small\verb%GEN_REWRITE_CONV%} can be used, or the set of +theorems given may be reduced. + +See {\small\verb%GEN_REWRITE_CONV%} for the general strategy for simplifying +theorems in HOL using equational theorems. \FAILURE -{\small\verb%REW_DEPTH_CONV c tm%} never fails but can diverge. +Does not fail, but may diverge if the sequence of rewrites is +non-terminating. + +\USES +Used to manipulate terms by rewriting them with theorems. +While resulting in high degree of automation, {\small\verb%REWRITE_CONV%} can +spawn a large number of inference steps. Thus, variants such +as {\small\verb%PURE_REWRITE_CONV%}, or other rules such as {\small\verb%SUBST_CONV%}, may be used +instead to improve efficiency. + +\SEEALSO +basic_rewrites, GEN_REWRITE_CONV, ONCE_REWRITE_CONV, +PURE_REWRITE_CONV, REWR_CONV, SUBST_CONV. + +\ENDDOC +\DOC{REWRITE\_RULE} + +\TYPE {\small\verb%REWRITE_RULE : (thm list -> thm -> thm)%}\egroup + +\SYNOPSIS +Rewrites a theorem including built-in tautologies in the list of rewrites. + +\DESCRIBE +Rewriting a theorem using {\small\verb%REWRITE_RULE%} utilizes as rewrites two sets +of theorems: the tautologies in the ML list {\small\verb%basic_rewrites%} and the +ones supplied by the user. The rule searches top-down and recursively +for subterms which match the left-hand side of any of the possible +rewrites, until none of the transformations are applicable. There is no +ordering specified among the set of rewrites. + +Variants of this rule allow changes in the set of equations used: +{\small\verb%PURE_REWRITE_RULE%} and others in its family do not rewrite with the +theorems in {\small\verb%basic_rewrites%}. Rules such as {\small\verb%ASM_REWRITE_RULE%} add the +assumptions of the object theorem (or a specified subset of these assumptions) +to the set of possible rewrites. + +The top-down recursive search for matches may not be desirable, as +this may increase the number of inferences being made or may result in +divergence. In this case other rewriting tools such as +{\small\verb%ONCE_REWRITE_RULE%} and {\small\verb%GEN_REWRITE_RULE%} can be used, or the set of +theorems given may be reduced. + +See {\small\verb%GEN_REWRITE_RULE%} for the general strategy for simplifying +theorems in HOL using equational theorems. + +\FAILURE +Does not fail, but may diverge if the sequence of rewrites is +non-terminating. + +\USES +Used to manipulate theorems by rewriting them with other theorems. +While resulting in high degree of automation, {\small\verb%REWRITE_RULE%} can +spawn a large number of inference steps. Thus, variants such +as {\small\verb%PURE_REWRITE_RULE%}, or other rules such as {\small\verb%SUBST%}, may be used +instead to improve efficiency. + +\SEEALSO +ASM_REWRITE_RULE, basic_rewrites, GEN_REWRITE_RULE, ONCE_REWRITE_RULE, +PURE_REWRITE_RULE, REWR_CONV, REWRITE_CONV, SUBST. + +\ENDDOC +\DOC{REWRITE\_TAC} + +\TYPE {\small\verb%REWRITE_TAC : (thm list -> tactic)%}\egroup + +\SYNOPSIS +Rewrites a goal including built-in tautologies in the list of rewrites. + +\DESCRIBE +Rewriting tactics in HOL provide a recursive left-to-right matching +and rewriting facility that automatically decomposes subgoals and +justifies segments of proof in which equational theorems are used, +singly or collectively. These include the unfolding of definitions, +and the substitution of equals for equals. Rewriting is used either +to advance or to complete the decomposition of subgoals. + +{\small\verb%REWRITE_TAC%} transforms (or solves) a goal by using as rewrite rules +(i.e. as left-to-right replacement rules) the conclusions of the given +list of (equational) theorems, as well as a set of built-in theorems +(common tautologies) held in the ML variable {\small\verb%basic_rewrites%}. +Recognition of a tautology often terminates the subgoaling process +(i.e. solves the goal). + +The equational rewrites generated are applied recursively and to +arbitrary depth, with matching and instantiation of variables and type +variables. A list of rewrites can set off an infinite rewriting +process, and it is not, of course, decidable in general whether a +rewrite set has that property. The order in which the rewrite theorems +are applied is unspecified, and the user should not depend on any +ordering. + +See {\small\verb%GEN_REWRITE_TAC%} for more details on the rewriting process. +Variants of {\small\verb%REWRITE_TAC%} allow the use of a different set of +rewrites. Some of them, such as {\small\verb%PURE_REWRITE_TAC%}, exclude the basic +tautologies from the possible transformations. {\small\verb%ASM_REWRITE_TAC%} and +others include the assumptions at the goal in the set of possible +rewrites. + +Still other tactics allow greater control over the search for +rewritable subterms. Several of them such as {\small\verb%ONCE_REWRITE_TAC%} do not +apply rewrites recursively. {\small\verb%GEN_REWRITE_TAC%} allows a rewrite to be +applied at a particular subterm. + +\FAILURE +{\small\verb%REWRITE_TAC%} does not fail. Certain sets of rewriting theorems on +certain goals may cause a non-terminating sequence of rewrites. +Divergent rewriting behaviour results from a term {\small\verb%t%} being +immediately or eventually rewritten to a term containing {\small\verb%t%} as a +sub-term. The exact behaviour depends on the {\small\verb%HOL%} implementation; it +may be possible (unfortunately) to fall into Lisp in this event. \EXAMPLE -The following example illustrates the difference between the functions -{\small\verb%REW_DEPTH_CONV%} and {\small\verb%TOP_DEPTH_CONV%}. It is not intended to illustrate the -full range of behaviour of the former. Both {\small\verb%REW_DEPTH_CONV%} and -{\small\verb%TOP_DEPTH_CONV%} successfully apply the theorem {\small\verb%ADD_0%} inside an abstraction: +The arithmetic theorem {\small\verb%GREATER%}, {\small\verb%|- !m n. m > n = n < m%}, is used +below to advance a goal: {\par\samepage\setseps\small \begin{verbatim} - #REW_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";; - |- (\n. n + 0) = (\n. n) - - #TOP_DEPTH_CONV (REWR_CONV ADD_0) "\n. n + 0";; - |- (\n. n + 0) = (\n. n) + #REWRITE_TAC[GREATER]([],"5 > 4");; + ([([], "4 < 5")], -) : subgoals \end{verbatim} } -\noindent However, if a hypothesis containing a free occurrence of the bound -variable is added to the rewrite rule, it interferes with the operation of -{\small\verb%TOP_DEPTH_CONV%} but not that of {\small\verb%REW_DEPTH_CONV%}: +\noindent It is used below with the theorem {\small\verb%LESS_0%}, +{\small\verb%|- !n. 0 < (SUC n)%}, to solve a goal: {\par\samepage\setseps\small \begin{verbatim} - #let th = ADD_ASSUM "n = 0" ADD_0;; - th = n = 0 |- !m. m + 0 = m - - #REW_DEPTH_CONV (REWR_CONV th) "\n. n + 0";; - n = 0 |- (\n. n + 0) = (\n. n) + #let gl,p = REWRITE_TAC[GREATER;LESS_0]([],"(SUC n) > 0");; + gl = [] : goal list + p = - : proof - #TOP_DEPTH_CONV (REWR_CONV th) "\n. n + 0";; - |- (\n. n + 0) = (\n. n + 0) + #p[];; + |- (SUC n) > 0 \end{verbatim} } -\COMMENTS -The implementation of this function uses failure to avoid rebuilding -unchanged subterms. That is to say, during execution the failure string -{\small\verb%`QCONV`%} may be generated and later trapped. The behaviour of the function -is dependent on this use of failure. So, if the conversion given as argument -happens to generate a failure with string {\small\verb%`QCONV`%}, the operation of -{\small\verb%REW_DEPTH_CONV%} will be unpredictable. +\USES +Rewriting is a powerful and general mechanism in HOL, and an +important part of many proofs. It relieves the user of the burden of +directing and justifying a large number of minor proof steps. +{\small\verb%REWRITE_TAC%} fits a forward proof sequence smoothly into the general +goal-oriented framework. That is, (within one subgoaling step) it +produces and justifies certain forward inferences, none of which are +necessarily on a direct path to the desired goal. + +{\small\verb%REWRITE_TAC%} may be more powerful a tactic than is needed in certain +situations; if efficiency is at stake, alternatives might be +considered. \SEEALSO -ONCE_REW_DEPTH_CONV, TOP_DEPTH_CONV. +ASM_REWRITE_TAC, GEN_REWRITE_TAC, FILTER_ASM_REWRITE_TAC, +FILTER_ONCE_ASM_REWRITE_TAC, ONCE_ASM_REWRITE_TAC, ONCE_REWRITE_TAC, +PURE_ASM_REWRITE_TAC, PURE_ONCE_ASM_REWRITE_TAC, +PURE_ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWR_CONV, REWRITE_CONV, SUBST_TAC. \ENDDOC \DOC{rhs} @@ -22722,20 +22720,6 @@ It does not matter if the goal has no as ASSUM_LIST, MAP_EVERY, MAP_FIRST, POP_ASSUM_LIST. \ENDDOC -\DOC{S} - -\TYPE {\small\verb%S : ((* -> ** -> ***) -> (* -> **) -> * -> ***)%}\egroup - -\SYNOPSIS -Performs function composition: {\small\verb%S f g x%} = {\small\verb%f x (g x)%} (the {\small\verb%S%} combinator). - -\FAILURE -Never fails. - -\SEEALSO -\#, B, C, CB, Co, I, K, KI, o, oo, W. - -\ENDDOC \DOC{save} \TYPE {\small\verb%save : (string -> void)%}\egroup @@ -22977,10 +22961,24 @@ To sum the elements of a list and save t } \SEEALSO -SCANL_CONV, FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV. +SCANL_CONV, FOLDL_CONV, FOLDR_CONV, list_FOLD_CONV. + +\ENDDOC + +\DOC{S} + +\TYPE {\small\verb%S : ((* -> ** -> ***) -> (* -> **) -> * -> ***)%}\egroup + +\SYNOPSIS +Performs function composition: {\small\verb%S f g x%} = {\small\verb%f x (g x)%} (the {\small\verb%S%} combinator). + +\FAILURE +Never fails. + +\SEEALSO +\#, B, C, CB, Co, I, K, KI, o, oo, W. \ENDDOC - \DOC{search\_path} \TYPE {\small\verb%search_path : (void -> string list)%}\egroup @@ -23327,35 +23325,6 @@ constant defined using the epsilon opera CHOOSE, SELECT_AX, SELECT_CONV, SELECT_ELIM, SELECT_INTRO. \ENDDOC -\DOC{setify} - -\TYPE {\small\verb%setify : (* list -> * list)%}\egroup - -\SYNOPSIS -Removes repeated elements from a list. Makes a list into a `set'. - -\DESCRIBE -{\small\verb%setify l%} removes repeated elements from {\small\verb%l%}, leaving the last occurrence of -each duplicate in the list. - -\FAILURE -Never fails. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#setify [1;2;3;1;4;3];; -[2; 1; 4; 3] : int list -\end{verbatim} -} -\COMMENTS -Perhaps the first occurrence of each duplicate should be left in the list, not -the last? However, other functions may rely on the ordering currently used. - -\SEEALSO -distinct. - -\ENDDOC \DOC{set\_equal} \TYPE {\small\verb%set_equal : (* list -> * list -> bool)%}\egroup @@ -23599,6 +23568,35 @@ Never fails. help_search_path, install, search_path, set_search_path. \ENDDOC +\DOC{setify} + +\TYPE {\small\verb%setify : (* list -> * list)%}\egroup + +\SYNOPSIS +Removes repeated elements from a list. Makes a list into a `set'. + +\DESCRIBE +{\small\verb%setify l%} removes repeated elements from {\small\verb%l%}, leaving the last occurrence of +each duplicate in the list. + +\FAILURE +Never fails. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#setify [1;2;3;1;4;3];; +[2; 1; 4; 3] : int list +\end{verbatim} +} +\COMMENTS +Perhaps the first occurrence of each duplicate should be left in the list, not +the last? However, other functions may rely on the ordering currently used. + +\SEEALSO +distinct. + +\ENDDOC \DOC{set\_interface\_map} \TYPE {\small\verb%set_interface_map : ((string # string) list -> (string # string) list)%}\egroup @@ -24272,6 +24270,45 @@ that the `ordering' is not antisymmetric \end{verbatim} } \ENDDOC +\DOC{SPEC\_ALL} + +\TYPE {\small\verb%SPEC_ALL : (thm -> thm)%}\egroup + +\SYNOPSIS +Specializes the conclusion of a theorem with its own quantified variables. + +\DESCRIBE +When applied to a theorem {\small\verb%A |- !x1...xn. t%}, the inference rule {\small\verb%SPEC_ALL%} +returns the theorem {\small\verb%A |- t[x1'/x1]...[xn'/xn]%} where the {\small\verb%xi'%} are distinct +variants of the corresponding {\small\verb%xi%}, chosen to avoid clashes with any variables +free in the assumption list and with the names of constants. Normally {\small\verb%xi'%} is +just {\small\verb%xi%}, in which case {\small\verb%SPEC_ALL%} simply removes all universal quantifiers. +{\par\samepage\setseps\small +\begin{verbatim} + A |- !x1...xn. t + --------------------------- SPEC_ALL + A |- t[x1'/x1]...[xn'/xn] +\end{verbatim} +} +\FAILURE +Never fails. + +\EXAMPLE +The following example shows how variables are also renamed to avoid clashing +with the names of constants. +{\par\samepage\setseps\small +\begin{verbatim} + #let v=mk_var(`T`,":bool") in ASSUME "!^v. ^v \/ ~^v";; + !T. T \/ ~T |- !T. T \/ ~T + + #SPEC_ALL it;; + !T. T \/ ~T |- T' \/ ~T' +\end{verbatim} +} +\SEEALSO +GEN, GENL, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC. + +\ENDDOC \DOC{SPEC} \TYPE {\small\verb%SPEC : (term -> thm -> thm)%}\egroup @@ -24379,45 +24416,6 @@ The following is a specialization of a t GEN, GENL, GEN_ALL, GEN_TAC, SPEC, SPEC_ALL, SPEC_TAC. \ENDDOC -\DOC{SPEC\_ALL} - -\TYPE {\small\verb%SPEC_ALL : (thm -> thm)%}\egroup - -\SYNOPSIS -Specializes the conclusion of a theorem with its own quantified variables. - -\DESCRIBE -When applied to a theorem {\small\verb%A |- !x1...xn. t%}, the inference rule {\small\verb%SPEC_ALL%} -returns the theorem {\small\verb%A |- t[x1'/x1]...[xn'/xn]%} where the {\small\verb%xi'%} are distinct -variants of the corresponding {\small\verb%xi%}, chosen to avoid clashes with any variables -free in the assumption list and with the names of constants. Normally {\small\verb%xi'%} is -just {\small\verb%xi%}, in which case {\small\verb%SPEC_ALL%} simply removes all universal quantifiers. -{\par\samepage\setseps\small -\begin{verbatim} - A |- !x1...xn. t - --------------------------- SPEC_ALL - A |- t[x1'/x1]...[xn'/xn] -\end{verbatim} -} -\FAILURE -Never fails. - -\EXAMPLE -The following example shows how variables are also renamed to avoid clashing -with the names of constants. -{\par\samepage\setseps\small -\begin{verbatim} - #let v=mk_var(`T`,":bool") in ASSUME "!^v. ^v \/ ~^v";; - !T. T \/ ~T |- !T. T \/ ~T - - #SPEC_ALL it;; - !T. T \/ ~T |- T' \/ ~T' -\end{verbatim} -} -\SEEALSO -GEN, GENL, GEN_ALL, GEN_TAC, SPEC, SPECL, SPEC_ALL, SPEC_TAC. - -\ENDDOC \DOC{SPEC\_TAC} \TYPE {\small\verb%SPEC_TAC : ((term # term) -> tactic)%}\egroup @@ -25123,6 +25121,50 @@ Generating a case split from the axioms ASM_CASES_TAC, BOOL_CASES_TAC, COND_CASES_TAC, DISJ_CASES_TAC. \ENDDOC +\DOC{SUB\_CONV} + +\TYPE {\small\verb%SUB_CONV : (conv -> conv)%}\egroup + +\SYNOPSIS +Applies a conversion to the top-level subterms of a term. + +\DESCRIBE +For any conversion {\small\verb%c%}, the function returned by {\small\verb%SUB_CONV c%} is a conversion +that applies {\small\verb%c%} to all the top-level subterms of a term. If the conversion +{\small\verb%c%} maps {\small\verb%t%} to {\small\verb%|- t = t'%}, then {\small\verb%SUB_CONV c%} maps an abstraction {\small\verb%"\x.t"%} to +the theorem: +{\par\samepage\setseps\small +\begin{verbatim} + |- (\x.t) = (\x.t') +\end{verbatim} +} +\noindent That is, {\small\verb%SUB_CONV c "\x.t"%} applies {\small\verb%c%} to the body of the +abstraction {\small\verb%"\x.t"%}. If {\small\verb%c%} is a conversion that maps {\small\verb%"t1"%} to the theorem +{\small\verb%|- t1 = t1'%} and {\small\verb%"t2"%} to the theorem {\small\verb%|- t2 = t2'%}, then the conversion +{\small\verb%SUB_CONV c%} maps an application {\small\verb%"t1 t2"%} to the theorem: +{\par\samepage\setseps\small +\begin{verbatim} + |- (t1 t2) = (t1' t2') +\end{verbatim} +} +\noindent That is, {\small\verb%SUB_CONV c "t1 t2"%} applies {\small\verb%c%} to the both the operator +{\small\verb%t1%} and the operand {\small\verb%t2%} of the application {\small\verb%"t1 t2"%}. Finally, for any +conversion {\small\verb%c%}, the function returned by {\small\verb%SUB_CONV c%} acts as the identity +conversion on variables and constants. That is, if {\small\verb%"t"%} is a variable or +constant, then {\small\verb%SUB_CONV c "t"%} returns {\small\verb%|- t = t%}. + +\FAILURE +{\small\verb%SUB_CONV c tm%} fails if {\small\verb%tm%} is an abstraction {\small\verb%"\x.t"%} and the conversion {\small\verb%c%} +fails when applied to {\small\verb%t%}, or if {\small\verb%tm%} is an application {\small\verb%"t1 t2"%} and the +conversion {\small\verb%c%} fails when applied to either {\small\verb%t1%} or {\small\verb%t2%}. The function +returned by {\small\verb%SUB_CONV c%} may also fail if the ML function {\small\verb%c:term->thm%} is not, +in fact, a conversion (i.e. a function that maps a term {\small\verb%t%} to a theorem +{\small\verb%|- t = t'%}). + +\SEEALSO +ABS_CONV, RAND_CONV, RATOR_CONV. + +\ENDDOC \DOC{SUBGOAL\_THEN} \TYPE {\small\verb%SUBGOAL_THEN : (term -> thm_tactic -> tactic)%}\egroup @@ -25220,141 +25262,80 @@ Substitutions are made with the theorems \begin{verbatim} #let thm1 = SPECL ["m:num"; "n:num"] ADD_SYM #and thm2 = CONJUNCT1 ADD_CLAUSES;; - thm1 = |- m + n = n + m - thm2 = |- 0 + m = m -\end{verbatim} -} -\noindent depending on the occurrence of free subterms -{\par\samepage\setseps\small -\begin{verbatim} - #SUBS [thm1; thm2] (ASSUME "(n + 0) + (0 + m) = m + n");; - . |- (n + 0) + m = n + m - - #SUBS [thm1; thm2] (ASSUME "!n. (n + 0) + (0 + m) = m + n");; - . |- !n. (n + 0) + m = m + n -\end{verbatim} -} -\USES -{\small\verb%SUBS%} can sometimes be used when rewriting (for example, with {\small\verb%REWRITE_RULE%}) -would diverge and term instantiation is not needed. Moreover, applying the -substitution rules is often much faster than using the rewriting rules. - -\SEEALSO -ONCE_REWRITE_RULE, PURE_REWRITE_RULE, REWRITE_RULE, SUBST, SUBST_MATCH, -SUBS_OCCS. - -\ENDDOC -\DOC{SUBST} - -\TYPE {\small\verb%SUBST : ((thm # term) list -> term -> thm -> thm)%}\egroup - -\SYNOPSIS -Makes a set of parallel substitutions in a theorem. - -\DESCRIBE -Implements the following rule of simultaneous substitution -{\par\samepage\setseps\small -\begin{verbatim} - A1 |- t1 = u1 , ... , An |- tn = un , A |- t[t1,...,tn] - ------------------------------------------------------------- - A u A1 u ... u An |- t[ui] -\end{verbatim} -} -\noindent Evaluating -{\par\samepage\setseps\small -\begin{verbatim} - SUBST [((A1 |- t1=u1), x1); ... ;((An |- tn=un), xn)] - t[x1,...,xn] - (A |- t[t1,...,tn]) -\end{verbatim} -} -\noindent returns the theorem {\small\verb%A |- t[u1,...,un]%}. The term argument -{\small\verb%t[x1,...,xn]%} is a template which should match the conclusion of the theorem -being substituted into, with the variables {\small\verb%x1%}, ... , {\small\verb%xn%} marking those -places where occurrences of {\small\verb%t1%}, ... , {\small\verb%tn%} are to be replaced by the terms -{\small\verb%u1%}, ... , {\small\verb%un%}, respectively. The occurrence of {\small\verb%ti%} at the places marked by -{\small\verb%xi%} must be free (i.e. {\small\verb%ti%} must not contain any bound variables). {\small\verb%SUBST%} -automatically renames bound variables to prevent free variables in {\small\verb%ui%} -becoming bound after substitution. - -{\small\verb%SUBST%} is a complex primitive because it performs both parallel simultaneous -substitution and renaming of variables. This is for efficiency reasons, but it -would be logically cleaner if {\small\verb%SUBST%} were simpler. - -\FAILURE -If the template does not match the conclusion of the hypothesis, or the terms -in the conclusion marked by the variables {\small\verb%x1%}, ... , {\small\verb%xn%} in the template are -not identical to the left hand sides of the supplied equations (i.e. the terms -{\small\verb%t1%}, ... , {\small\verb%tn%}). - -\EXAMPLE + thm1 = |- m + n = n + m + thm2 = |- 0 + m = m +\end{verbatim} +} +\noindent depending on the occurrence of free subterms {\par\samepage\setseps\small \begin{verbatim} -#let th0 = SPEC "0" ADD1 and th1 = SPEC "1" ADD1;; -th0 = |- SUC 0 = 0 + 1 -th1 = |- SUC 1 = 1 + 1 - -#SUBST [(th0,"x:num");(th1,"y:num")] -# "(x+y) > SUC 0" -# (ASSUME "(SUC 0 + SUC 1) > SUC 0");; -. |- ((0 + 1) + (1 + 1)) > (SUC 0) - -#SUBST [(th0,"x:num");(th1,"y:num")] -# "(SUC 0 + y) > SUC 0" -# (ASSUME "(SUC 0 + SUC 1) > SUC 0");; -. |- ((SUC 0) + (1 + 1)) > (SUC 0) + #SUBS [thm1; thm2] (ASSUME "(n + 0) + (0 + m) = m + n");; + . |- (n + 0) + m = n + m -#SUBST [(th0,"x:num");(th1,"y:num")] -# "(x+y) > x" -# (ASSUME "(SUC 0 + SUC 1) > SUC 0");; -. |- ((0 + 1) + (1 + 1)) > (0 + 1) + #SUBS [thm1; thm2] (ASSUME "!n. (n + 0) + (0 + m) = m + n");; + . |- !n. (n + 0) + m = m + n \end{verbatim} } \USES -For substituting at selected occurrences. Often useful -for writing special purpose derived inference rules. +{\small\verb%SUBS%} can sometimes be used when rewriting (for example, with {\small\verb%REWRITE_RULE%}) +would diverge and term instantiation is not needed. Moreover, applying the +substitution rules is often much faster than using the rewriting rules. \SEEALSO -SUBS. +ONCE_REWRITE_RULE, PURE_REWRITE_RULE, REWRITE_RULE, SUBST, SUBST_MATCH, +SUBS_OCCS. \ENDDOC -\DOC{subst} +\DOC{SUBS\_OCCS} -\TYPE {\small\verb%subst : ((term # term) list -> term -> term)%}\egroup +\TYPE {\small\verb%SUBS_OCCS : ((int list # thm) list -> thm -> thm)%}\egroup \SYNOPSIS -Substitutes terms in a term. +Makes substitutions in a theorem at specific occurrences of a term, using a +list of equational theorems. \DESCRIBE -Given a list of term pairs {\small\verb%[("a_1","b_1"),...,("a_n","b_n")]%} -and a term {\small\verb%"c"%}, {\small\verb%subst%} attempts to substitute all free occurrences of -{\small\verb%"b_i"%} in {\small\verb%"c"%} by {\small\verb%"a_i"%} for all {\small\verb%i%} ranging between {\small\verb%1%} and {\small\verb%n%}. - +Given a list {\small\verb%(l1,A1|-t1=v1),...,(ln,An|-tn=vn)%} and a theorem +{\small\verb%(A|-t)%}, {\small\verb%SUBS_OCCS%} simultaneously replaces each {\small\verb%ti%} in {\small\verb%t%} with {\small\verb%vi%}, +at the occurrences specified by the integers +in the list {\small\verb%li = [o1;...;ok]%} for each theorem {\small\verb%Ai|-ti=vi%}. +{\par\samepage\setseps\small +\begin{verbatim} + (l1,A1|-t1=v1) ... (ln,An|-tn=vn) A|-t + ------------------------------------------- SUBS_OCCS[(l1,A1|-t1=v1);...; + A1 u ... An u A |- t[v1,...,vn/t1,...,tn] (ln,An|-tn=vn)] (A|-t) +\end{verbatim} +} \FAILURE -Failure occurs if for some {\small\verb%i%} ranging between {\small\verb%1%} and {\small\verb%n%}, the substitution -of {\small\verb%"b_i"%} by {\small\verb%"a_i"%} fails. -The substitution of {\small\verb%"b_i"%} by {\small\verb%"a_i"%} fails for some {\small\verb%i%}, -if the types of {\small\verb%"a_i"%} and {\small\verb%"b_i"%} are not the same. +{\small\verb%SUBS_OCCS [(l1,th1);...;(ln,thn)] (A|-t)%} fails if +the conclusion of any theorem in the list is not an equation. +No change is made to the theorem if the supplied occurrences {\small\verb%li%} of the +left-hand side of the conclusion of {\small\verb%thi%} do not appear in {\small\verb%t%}. \EXAMPLE +The commutative law for addition {\par\samepage\setseps\small \begin{verbatim} - #subst [("1","SUC 0")] "SUC(SUC 0)";; - "SUC 1" : term - - #subst [("1","SUC 0");("2","SUC 1")] "SUC(SUC 0)";; - "SUC 1" : term - - #subst [("1","SUC 0");("2","SUC 1")] "SUC(SUC 0) = SUC 1";; - "SUC 1 = 2" : term - - #subst [("b:num","a:num")] "\a:num. (b:num)";; - "\a. b" : term - - #subst [("foo:*","flip:*")] "waddle:*";; - "waddle" : term + #let thm = SPECL ["m:num"; "n:num"] ADD_SYM;; + thm = |- m + n = n + m +\end{verbatim} +} +\noindent can be used for substituting only the second occurrence of +the subterm {\small\verb%m + n%} +{\par\samepage\setseps\small +\begin{verbatim} + #SUBS_OCCS [([2],thm)] (ASSUME "(n + m) + (m + n) = (m + n) + (m + n)");; + . |- (n + m) + (m + n) = (n + m) + (m + n) \end{verbatim} } +\USES +{\small\verb%SUBS_OCCS%} is used when rewriting at specific occurrences of a term, and rules +such as {\small\verb%REWRITE_RULE%}, {\small\verb%PURE_REWRITE_RULE%}, {\small\verb%ONCE_REWRITE_RULE%}, and {\small\verb%SUBS%} +are too extensive or would diverge. + +\SEEALSO +ONCE_REWRITE_RULE, PURE_REWRITE_RULE, REWRITE_RULE, SUBS, SUBST, SUBST_MATCH. + \ENDDOC \DOC{SUBST1\_TAC} @@ -25549,6 +25530,118 @@ and using rewriting rules/conversions is REWR_CONV, SUBS, SUBST, SUBS_OCCS. \ENDDOC +\DOC{subst} + +\TYPE {\small\verb%subst : ((term # term) list -> term -> term)%}\egroup + +\SYNOPSIS +Substitutes terms in a term. + +\DESCRIBE +Given a list of term pairs {\small\verb%[("a_1","b_1"),...,("a_n","b_n")]%} +and a term {\small\verb%"c"%}, {\small\verb%subst%} attempts to substitute all free occurrences of +{\small\verb%"b_i"%} in {\small\verb%"c"%} by {\small\verb%"a_i"%} for all {\small\verb%i%} ranging between {\small\verb%1%} and {\small\verb%n%}. + +\FAILURE +Failure occurs if for some {\small\verb%i%} ranging between {\small\verb%1%} and {\small\verb%n%}, the substitution +of {\small\verb%"b_i"%} by {\small\verb%"a_i"%} fails. +The substitution of {\small\verb%"b_i"%} by {\small\verb%"a_i"%} fails for some {\small\verb%i%}, +if the types of {\small\verb%"a_i"%} and {\small\verb%"b_i"%} are not the same. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} + #subst [("1","SUC 0")] "SUC(SUC 0)";; + "SUC 1" : term + + #subst [("1","SUC 0");("2","SUC 1")] "SUC(SUC 0)";; + "SUC 1" : term + + #subst [("1","SUC 0");("2","SUC 1")] "SUC(SUC 0) = SUC 1";; + "SUC 1 = 2" : term + + #subst [("b:num","a:num")] "\a:num. (b:num)";; + "\a. b" : term + + #subst [("foo:*","flip:*")] "waddle:*";; + "waddle" : term +\end{verbatim} +} +\ENDDOC +\DOC{SUBST} + +\TYPE {\small\verb%SUBST : ((thm # term) list -> term -> thm -> thm)%}\egroup + +\SYNOPSIS +Makes a set of parallel substitutions in a theorem. + +\DESCRIBE +Implements the following rule of simultaneous substitution +{\par\samepage\setseps\small +\begin{verbatim} + A1 |- t1 = u1 , ... , An |- tn = un , A |- t[t1,...,tn] + ------------------------------------------------------------- + A u A1 u ... u An |- t[ui] +\end{verbatim} +} +\noindent Evaluating +{\par\samepage\setseps\small +\begin{verbatim} + SUBST [((A1 |- t1=u1), x1); ... ;((An |- tn=un), xn)] + t[x1,...,xn] + (A |- t[t1,...,tn]) +\end{verbatim} +} +\noindent returns the theorem {\small\verb%A |- t[u1,...,un]%}. The term argument +{\small\verb%t[x1,...,xn]%} is a template which should match the conclusion of the theorem +being substituted into, with the variables {\small\verb%x1%}, ... , {\small\verb%xn%} marking those +places where occurrences of {\small\verb%t1%}, ... , {\small\verb%tn%} are to be replaced by the terms +{\small\verb%u1%}, ... , {\small\verb%un%}, respectively. The occurrence of {\small\verb%ti%} at the places marked by +{\small\verb%xi%} must be free (i.e. {\small\verb%ti%} must not contain any bound variables). {\small\verb%SUBST%} +automatically renames bound variables to prevent free variables in {\small\verb%ui%} +becoming bound after substitution. + +{\small\verb%SUBST%} is a complex primitive because it performs both parallel simultaneous +substitution and renaming of variables. This is for efficiency reasons, but it +would be logically cleaner if {\small\verb%SUBST%} were simpler. + +\FAILURE +If the template does not match the conclusion of the hypothesis, or the terms +in the conclusion marked by the variables {\small\verb%x1%}, ... , {\small\verb%xn%} in the template are +not identical to the left hand sides of the supplied equations (i.e. the terms +{\small\verb%t1%}, ... , {\small\verb%tn%}). + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#let th0 = SPEC "0" ADD1 and th1 = SPEC "1" ADD1;; +th0 = |- SUC 0 = 0 + 1 +th1 = |- SUC 1 = 1 + 1 + +#SUBST [(th0,"x:num");(th1,"y:num")] +# "(x+y) > SUC 0" +# (ASSUME "(SUC 0 + SUC 1) > SUC 0");; +. |- ((0 + 1) + (1 + 1)) > (SUC 0) + +#SUBST [(th0,"x:num");(th1,"y:num")] +# "(SUC 0 + y) > SUC 0" +# (ASSUME "(SUC 0 + SUC 1) > SUC 0");; +. |- ((SUC 0) + (1 + 1)) > (SUC 0) + +#SUBST [(th0,"x:num");(th1,"y:num")] +# "(x+y) > x" +# (ASSUME "(SUC 0 + SUC 1) > SUC 0");; +. |- ((0 + 1) + (1 + 1)) > (0 + 1) +\end{verbatim} +} +\USES +For substituting at selected occurrences. Often useful +for writing special purpose derived inference rules. + +\SEEALSO +SUBS. + +\ENDDOC \DOC{SUBST\_MATCH} \TYPE {\small\verb%SUBST_MATCH : (thm -> thm -> thm)%}\egroup @@ -25738,89 +25831,38 @@ any {\small\verb%Ai%} is not a subset of {\small\verb%vi%} becoming bound after substitution. \FAILURE -{\small\verb%SUBST_TAC [th1;...;thn] (A,t)%} fails if the conclusion of any theorem in the -list is not an equation. No change is made to the goal if no occurrence of the -left-hand side of the conclusion of {\small\verb%thi%} appears in {\small\verb%t%}. - -\EXAMPLE -When trying to solve the goal -{\par\samepage\setseps\small -\begin{verbatim} - ?- (n + 0) + (0 + m) = m + n -\end{verbatim} -} -\noindent by substituting with the theorems -{\par\samepage\setseps\small -\begin{verbatim} - #let thm1 = SPECL ["m:num"; "n:num"] ADD_SYM - #and thm2 = CONJUNCT1 ADD_CLAUSES;; - thm1 = |- m + n = n + m - thm2 = |- 0 + m = m -\end{verbatim} -} -\noindent applying {\small\verb%SUBST_TAC [thm1; thm2]%} results in the goal -{\par\samepage\setseps\small -\begin{verbatim} - ?- (n + 0) + m = n + m -\end{verbatim} -} -\USES -{\small\verb%SUBST_TAC%} is used when rewriting (for example, with {\small\verb%REWRITE_TAC%}) is -extensive or would diverge. Substituting is also much faster than rewriting. - -\SEEALSO -ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWRITE_TAC, SUBST1_TAC, SUBST_ALL_TAC. - -\ENDDOC -\DOC{SUBS\_OCCS} - -\TYPE {\small\verb%SUBS_OCCS : ((int list # thm) list -> thm -> thm)%}\egroup - -\SYNOPSIS -Makes substitutions in a theorem at specific occurrences of a term, using a -list of equational theorems. - -\DESCRIBE -Given a list {\small\verb%(l1,A1|-t1=v1),...,(ln,An|-tn=vn)%} and a theorem -{\small\verb%(A|-t)%}, {\small\verb%SUBS_OCCS%} simultaneously replaces each {\small\verb%ti%} in {\small\verb%t%} with {\small\verb%vi%}, -at the occurrences specified by the integers -in the list {\small\verb%li = [o1;...;ok]%} for each theorem {\small\verb%Ai|-ti=vi%}. +{\small\verb%SUBST_TAC [th1;...;thn] (A,t)%} fails if the conclusion of any theorem in the +list is not an equation. No change is made to the goal if no occurrence of the +left-hand side of the conclusion of {\small\verb%thi%} appears in {\small\verb%t%}. + +\EXAMPLE +When trying to solve the goal {\par\samepage\setseps\small \begin{verbatim} - (l1,A1|-t1=v1) ... (ln,An|-tn=vn) A|-t - ------------------------------------------- SUBS_OCCS[(l1,A1|-t1=v1);...; - A1 u ... An u A |- t[v1,...,vn/t1,...,tn] (ln,An|-tn=vn)] (A|-t) + ?- (n + 0) + (0 + m) = m + n \end{verbatim} } -\FAILURE -{\small\verb%SUBS_OCCS [(l1,th1);...;(ln,thn)] (A|-t)%} fails if -the conclusion of any theorem in the list is not an equation. -No change is made to the theorem if the supplied occurrences {\small\verb%li%} of the -left-hand side of the conclusion of {\small\verb%thi%} do not appear in {\small\verb%t%}. - -\EXAMPLE -The commutative law for addition +\noindent by substituting with the theorems {\par\samepage\setseps\small \begin{verbatim} - #let thm = SPECL ["m:num"; "n:num"] ADD_SYM;; - thm = |- m + n = n + m + #let thm1 = SPECL ["m:num"; "n:num"] ADD_SYM + #and thm2 = CONJUNCT1 ADD_CLAUSES;; + thm1 = |- m + n = n + m + thm2 = |- 0 + m = m \end{verbatim} } -\noindent can be used for substituting only the second occurrence of -the subterm {\small\verb%m + n%} +\noindent applying {\small\verb%SUBST_TAC [thm1; thm2]%} results in the goal {\par\samepage\setseps\small \begin{verbatim} - #SUBS_OCCS [([2],thm)] (ASSUME "(n + m) + (m + n) = (m + n) + (m + n)");; - . |- (n + m) + (m + n) = (n + m) + (m + n) + ?- (n + 0) + m = n + m \end{verbatim} } \USES -{\small\verb%SUBS_OCCS%} is used when rewriting at specific occurrences of a term, and rules -such as {\small\verb%REWRITE_RULE%}, {\small\verb%PURE_REWRITE_RULE%}, {\small\verb%ONCE_REWRITE_RULE%}, and {\small\verb%SUBS%} -are too extensive or would diverge. +{\small\verb%SUBST_TAC%} is used when rewriting (for example, with {\small\verb%REWRITE_TAC%}) is +extensive or would diverge. Substituting is also much faster than rewriting. \SEEALSO -ONCE_REWRITE_RULE, PURE_REWRITE_RULE, REWRITE_RULE, SUBS, SUBST, SUBST_MATCH. +ONCE_REWRITE_TAC, PURE_REWRITE_TAC, REWRITE_TAC, SUBST1_TAC, SUBST_ALL_TAC. \ENDDOC \DOC{subtract} @@ -25851,50 +25893,6 @@ Never fails. setify, set_equal, union, intersect. \ENDDOC -\DOC{SUB\_CONV} - -\TYPE {\small\verb%SUB_CONV : (conv -> conv)%}\egroup - -\SYNOPSIS -Applies a conversion to the top-level subterms of a term. - -\DESCRIBE -For any conversion {\small\verb%c%}, the function returned by {\small\verb%SUB_CONV c%} is a conversion -that applies {\small\verb%c%} to all the top-level subterms of a term. If the conversion -{\small\verb%c%} maps {\small\verb%t%} to {\small\verb%|- t = t'%}, then {\small\verb%SUB_CONV c%} maps an abstraction {\small\verb%"\x.t"%} to -the theorem: -{\par\samepage\setseps\small -\begin{verbatim} - |- (\x.t) = (\x.t') -\end{verbatim} -} -\noindent That is, {\small\verb%SUB_CONV c "\x.t"%} applies {\small\verb%c%} to the body of the -abstraction {\small\verb%"\x.t"%}. If {\small\verb%c%} is a conversion that maps {\small\verb%"t1"%} to the theorem -{\small\verb%|- t1 = t1'%} and {\small\verb%"t2"%} to the theorem {\small\verb%|- t2 = t2'%}, then the conversion -{\small\verb%SUB_CONV c%} maps an application {\small\verb%"t1 t2"%} to the theorem: -{\par\samepage\setseps\small -\begin{verbatim} - |- (t1 t2) = (t1' t2') -\end{verbatim} -} -\noindent That is, {\small\verb%SUB_CONV c "t1 t2"%} applies {\small\verb%c%} to the both the operator -{\small\verb%t1%} and the operand {\small\verb%t2%} of the application {\small\verb%"t1 t2"%}. Finally, for any -conversion {\small\verb%c%}, the function returned by {\small\verb%SUB_CONV c%} acts as the identity -conversion on variables and constants. That is, if {\small\verb%"t"%} is a variable or -constant, then {\small\verb%SUB_CONV c "t"%} returns {\small\verb%|- t = t%}. - -\FAILURE -{\small\verb%SUB_CONV c tm%} fails if {\small\verb%tm%} is an abstraction {\small\verb%"\x.t"%} and the conversion {\small\verb%c%} -fails when applied to {\small\verb%t%}, or if {\small\verb%tm%} is an application {\small\verb%"t1 t2"%} and the -conversion {\small\verb%c%} fails when applied to either {\small\verb%t1%} or {\small\verb%t2%}. The function -returned by {\small\verb%SUB_CONV c%} may also fail if the ML function {\small\verb%c:term->thm%} is not, -in fact, a conversion (i.e. a function that maps a term {\small\verb%t%} to a theorem -{\small\verb%|- t = t'%}). - -\SEEALSO -ABS_CONV, RAND_CONV, RATOR_CONV. - -\ENDDOC \DOC{suspend\_recording} \TYPE {\small\verb%suspend_recording : void -> void%}\egroup @@ -25958,50 +25956,50 @@ When applied to a term argument of the f {\small\verb%?x y. P%}. \ENDDOC -\DOC{SYM} +\DOC{SYM\_CONV} -\TYPE {\small\verb%SYM : (thm -> thm)%}\egroup +\TYPE {\small\verb%SYM_CONV : conv%}\egroup \SYNOPSIS -Swaps left-hand and right-hand sides of an equation. +Interchanges the left and right-hand sides of an equation. \DESCRIBE -When applied to a theorem {\small\verb%A |- t1 = t2%}, the inference rule {\small\verb%SYM%} returns -{\small\verb%A |- t2 = t1%}. +When applied to an equational term {\small\verb%t1 = t2%}, the conversion +{\small\verb%SYM_CONV%} returns the theorem: {\par\samepage\setseps\small \begin{verbatim} - A |- t1 = t2 - -------------- SYM - A |- t2 = t1 + |- (t1 = t2) = (t2 = t1) \end{verbatim} } \FAILURE -Fails unless the theorem is equational. +Fails if applied to a term that is not an equation. \SEEALSO -GSYM, NOT_EQ_SYM, REFL. +SYM. \ENDDOC -\DOC{SYM\_CONV} +\DOC{SYM} -\TYPE {\small\verb%SYM_CONV : conv%}\egroup +\TYPE {\small\verb%SYM : (thm -> thm)%}\egroup \SYNOPSIS -Interchanges the left and right-hand sides of an equation. +Swaps left-hand and right-hand sides of an equation. \DESCRIBE -When applied to an equational term {\small\verb%t1 = t2%}, the conversion -{\small\verb%SYM_CONV%} returns the theorem: +When applied to a theorem {\small\verb%A |- t1 = t2%}, the inference rule {\small\verb%SYM%} returns +{\small\verb%A |- t2 = t1%}. {\par\samepage\setseps\small \begin{verbatim} - |- (t1 = t2) = (t2 = t1) + A |- t1 = t2 + -------------- SYM + A |- t2 = t1 \end{verbatim} } \FAILURE -Fails if applied to a term that is not an equation. +Fails unless the theorem is equational. \SEEALSO -SYM. +GSYM, NOT_EQ_SYM, REFL. \ENDDOC \DOC{syserror} @@ -26100,6 +26098,31 @@ Fails if the argument is less than 0. int_of_term, int_of_string, string_of_int. \ENDDOC +\DOC{THENC} + +\TYPE {\small\verb%$THENC : (conv -> conv -> conv)%}\egroup + +\SYNOPSIS +Applies two conversions in sequence. + +\DESCRIBE +If the conversion {\small\verb%c1%} returns {\small\verb%|- t = t'%} when applied to a term {\small\verb%"t"%}, and +{\small\verb%c2%} returns {\small\verb%|- t' = t''%} when applied to {\small\verb%"t'"%}, then the composite +conversion {\small\verb%(c1 THENC c2) "t"%} returns {\small\verb%|- t = t''%}. That is, {\small\verb%(c1 THENC c2) +"t"%} has the effect of transforming the term {\small\verb%"t"%} first with the conversion +{\small\verb%c1%} and then with the conversion {\small\verb%c2%}. + +\FAILURE +{\small\verb%(c1 THENC c2) "t"%} fails if either the conversion {\small\verb%c1%} fails when applied to +{\small\verb%"t"%}, or if {\small\verb%c1 "t"%} succeeds and returns {\small\verb%|- t = t'%} but {\small\verb%c2%} fails when +applied to {\small\verb%"t'"%}. {\small\verb%(c1 THENC c2) "t"%} may also fail if either of {\small\verb%c1%} or {\small\verb%c2%} +is not, in fact, a conversion (i.e. a function that maps a term {\small\verb%t%} to a +theorem {\small\verb%|- t = t'%}). + +\SEEALSO +EVERY_CONV. + +\ENDDOC \DOC{THEN} \TYPE {\small\verb%$THEN : (tactic -> tactic -> tactic)%}\egroup @@ -26136,31 +26159,6 @@ to multiple subgoals; sequences like the EVERY, ORELSE, THENL. \ENDDOC -\DOC{THENC} - -\TYPE {\small\verb%$THENC : (conv -> conv -> conv)%}\egroup - -\SYNOPSIS -Applies two conversions in sequence. - -\DESCRIBE -If the conversion {\small\verb%c1%} returns {\small\verb%|- t = t'%} when applied to a term {\small\verb%"t"%}, and -{\small\verb%c2%} returns {\small\verb%|- t' = t''%} when applied to {\small\verb%"t'"%}, then the composite -conversion {\small\verb%(c1 THENC c2) "t"%} returns {\small\verb%|- t = t''%}. That is, {\small\verb%(c1 THENC c2) -"t"%} has the effect of transforming the term {\small\verb%"t"%} first with the conversion -{\small\verb%c1%} and then with the conversion {\small\verb%c2%}. - -\FAILURE -{\small\verb%(c1 THENC c2) "t"%} fails if either the conversion {\small\verb%c1%} fails when applied to -{\small\verb%"t"%}, or if {\small\verb%c1 "t"%} succeeds and returns {\small\verb%|- t = t'%} but {\small\verb%c2%} fails when -applied to {\small\verb%"t'"%}. {\small\verb%(c1 THENC c2) "t"%} may also fail if either of {\small\verb%c1%} or {\small\verb%c2%} -is not, in fact, a conversion (i.e. a function that maps a term {\small\verb%t%} to a -theorem {\small\verb%|- t = t'%}). - -\SEEALSO -EVERY_CONV. - -\ENDDOC \DOC{THENL} \TYPE {\small\verb%$THENL : (tactic -> tactic list -> tactic)%}\egroup @@ -26253,41 +26251,6 @@ axiom, definition, load_theorem, load_th theorems. \ENDDOC -\DOC{theorems} - -\TYPE {\small\verb%theorems : (string -> (string # thm) list)%}\egroup - -\SYNOPSIS -Returns the derived theorems of a given theory segment of the current theory. - -\DESCRIBE -A call of {\small\verb%theorems `thy`%} returns the derived theorems of the theory segment -{\small\verb%thy%} together with their names. The theory segment {\small\verb%thy%} must be part of -the current theory. The names are those given to the theorems by the user when -they were originally added to the theory segment (by, for example, a call to -{\small\verb%save_thm%}). The name of the current theory segment can be abbreviated by {\small\verb%`-`%}. - -\FAILURE -The call {\small\verb%theorems `thy`%} will fail if the theory segment {\small\verb%thy%} is not part -of the current theory. - -\EXAMPLE -{\par\samepage\setseps\small -\begin{verbatim} -#theorems `bool`;; -[(`PAIR_EQ`, |- !x y a b. (x,y = a,b) = (x = a) /\ (y = b)); - (`SND`, |- !x y. SND(x,y) = y); - (`FST`, |- !x y. FST(x,y) = x); - (`PAIR`, |- !x. FST x,SND x = x); - (`PAIR_EXISTS`, |- ?p. IS_PAIR p)] -: (string # thm) list -\end{verbatim} -} -\SEEALSO -axioms, definitions, load_theorem, load_theorems, print_theory, save_thm, -theorem. - -\ENDDOC \DOC{theorem\_lfn} \TYPE {\small\verb%theorem_lfn : (string list -> thm)%}\egroup @@ -26362,6 +26325,41 @@ autoload, autoload_theory, theorem, theo load_theorems, undo_autoload. \ENDDOC +\DOC{theorems} + +\TYPE {\small\verb%theorems : (string -> (string # thm) list)%}\egroup + +\SYNOPSIS +Returns the derived theorems of a given theory segment of the current theory. + +\DESCRIBE +A call of {\small\verb%theorems `thy`%} returns the derived theorems of the theory segment +{\small\verb%thy%} together with their names. The theory segment {\small\verb%thy%} must be part of +the current theory. The names are those given to the theorems by the user when +they were originally added to the theory segment (by, for example, a call to +{\small\verb%save_thm%}). The name of the current theory segment can be abbreviated by {\small\verb%`-`%}. + +\FAILURE +The call {\small\verb%theorems `thy`%} will fail if the theory segment {\small\verb%thy%} is not part +of the current theory. + +\EXAMPLE +{\par\samepage\setseps\small +\begin{verbatim} +#theorems `bool`;; +[(`PAIR_EQ`, |- !x y a b. (x,y = a,b) = (x = a) /\ (y = b)); + (`SND`, |- !x y. SND(x,y) = y); + (`FST`, |- !x y. FST(x,y) = x); + (`PAIR`, |- !x. FST x,SND x = x); + (`PAIR_EXISTS`, |- ?p. IS_PAIR p)] +: (string # thm) list +\end{verbatim} +} +\SEEALSO +axioms, definitions, load_theorem, load_theorems, print_theory, save_thm, +theorem. + +\ENDDOC \DOC{thm\_count} \TYPE {\small\verb%thm_count : (void -> int)%}\egroup @@ -26653,15 +26651,36 @@ The following shows identical uses of {\ t1 = . |- a = b t2 = . |- b = c - #TRANS t1 t2;; - .. |- a = c + #TRANS t1 t2;; + .. |- a = c + + #t1 TRANS t2;; + .. |- a = c +\end{verbatim} +} +\SEEALSO +EQ_MP, IMP_TRANS, REFL, SYM. + +\ENDDOC +\DOC{TRY\_CONV} + +\TYPE {\small\verb%TRY_CONV : (conv -> conv)%}\egroup + +\SYNOPSIS +Attempts to apply a conversion; applies identity conversion in case of failure. + +\DESCRIBE +{\small\verb%TRY_CONV c "t"%} attempts to apply the conversion {\small\verb%c%} to the term {\small\verb%"t"%}; if +this fails, then the identity conversion applied instead. That is, if {\small\verb%c%} is a +conversion that maps a term {\small\verb%"t"%} to the theorem {\small\verb%|- t = t'%}, then the +conversion {\small\verb%TRY_CONV c%} also maps {\small\verb%"t"%} to {\small\verb%|- t = t'%}. But if {\small\verb%c%} fails when +applied to {\small\verb%"t"%}, then {\small\verb%TRY_CONV c "t"%} returns {\small\verb%|- t = t%}. + +\FAILURE +Never fails. - #t1 TRANS t2;; - .. |- a = c -\end{verbatim} -} \SEEALSO -EQ_MP, IMP_TRANS, REFL, SYM. +ALL_CONV. \ENDDOC \DOC{TRY} @@ -26704,27 +26723,6 @@ in the list. This will always be the cas find, mem, exists, forall, assoc, rev_assoc. \ENDDOC -\DOC{TRY\_CONV} - -\TYPE {\small\verb%TRY_CONV : (conv -> conv)%}\egroup - -\SYNOPSIS -Attempts to apply a conversion; applies identity conversion in case of failure. - -\DESCRIBE -{\small\verb%TRY_CONV c "t"%} attempts to apply the conversion {\small\verb%c%} to the term {\small\verb%"t"%}; if -this fails, then the identity conversion applied instead. That is, if {\small\verb%c%} is a -conversion that maps a term {\small\verb%"t"%} to the theorem {\small\verb%|- t = t'%}, then the -conversion {\small\verb%TRY_CONV c%} also maps {\small\verb%"t"%} to {\small\verb%|- t = t'%}. But if {\small\verb%c%} fails when -applied to {\small\verb%"t"%}, then {\small\verb%TRY_CONV c "t"%} returns {\small\verb%|- t = t%}. - -\FAILURE -Never fails. - -\SEEALSO -ALL_CONV. - -\ENDDOC \DOC{tty\_read} \TYPE {\small\verb%tty_read : (void -> string)%}\egroup @@ -26780,53 +26778,6 @@ standard output cannot be written. append_openw, close, openi, openw, read, tty_read, write. \ENDDOC -\DOC{types} - -\TYPE {\small\verb%types : (string -> (int # string) list)%}\egroup - -\SYNOPSIS -Lists the types in the named theory. - -\DESCRIBE -The function {\small\verb%types%} should be applied to a string which is the name of an -ancestor theory (including the current theory; the special string {\small\verb%`-`%} is -always interpreted as the current theory). It returns a list of all the -type constructors declared in the named theory, in the form of arity-name -pairs. - -\FAILURE -Fails unless the named theory is an ancestor. - -\EXAMPLE -The theory {\small\verb%HOL%} has no types declared: -{\par\samepage\setseps\small -\begin{verbatim} - #types `HOL`;; - [] : (int # string) list -\end{verbatim} -} -\noindent but its ancestors have the following types declared: -{\par\samepage\setseps\small -\begin{verbatim} - #itlist union (map types (ancestors `HOL`)) [];; - [(2, `fun`); - (2, `prod`); - (0, `bool`); - (0, `ind`); - (0, `num`); - (1, `list`); - (0, `tree`); - (1, `ltree`); - (2, `sum`); - (0, `one`)] - : (int # string) list -\end{verbatim} -} -\SEEALSO -ancestors, axioms, constants, definitions, infixes, new_type, new_type_abbrev, -new_type_definition, parents. - -\ENDDOC \DOC{type\_abbrevs} \TYPE {\small\verb%type_abbrevs : (string -> (string # type) list)%}\egroup @@ -26936,6 +26887,53 @@ Never fails. \end{verbatim} } \ENDDOC +\DOC{types} + +\TYPE {\small\verb%types : (string -> (int # string) list)%}\egroup + +\SYNOPSIS +Lists the types in the named theory. + +\DESCRIBE +The function {\small\verb%types%} should be applied to a string which is the name of an +ancestor theory (including the current theory; the special string {\small\verb%`-`%} is +always interpreted as the current theory). It returns a list of all the +type constructors declared in the named theory, in the form of arity-name +pairs. + +\FAILURE +Fails unless the named theory is an ancestor. + +\EXAMPLE +The theory {\small\verb%HOL%} has no types declared: +{\par\samepage\setseps\small +\begin{verbatim} + #types `HOL`;; + [] : (int # string) list +\end{verbatim} +} +\noindent but its ancestors have the following types declared: +{\par\samepage\setseps\small +\begin{verbatim} + #itlist union (map types (ancestors `HOL`)) [];; + [(2, `fun`); + (2, `prod`); + (0, `bool`); + (0, `ind`); + (0, `num`); + (1, `list`); + (0, `tree`); + (1, `ltree`); + (2, `sum`); + (0, `one`)] + : (int # string) list +\end{verbatim} +} +\SEEALSO +ancestors, axioms, constants, definitions, infixes, new_type, new_type_abbrev, +new_type_definition, parents. + +\ENDDOC \DOC{type\_tyvars} \TYPE {\small\verb%type_tyvars : (type -> type list)%}\egroup @@ -27051,68 +27049,68 @@ Never fails. curry. \ENDDOC -\DOC{UNDISCH} +\DOC{UNDISCH\_ALL} -\TYPE {\small\verb%UNDISCH : (thm -> thm)%}\egroup +\TYPE {\small\verb%UNDISCH_ALL : (thm -> thm)%}\egroup \SYNOPSIS -Undischarges the antecedent of an implicative theorem. +Iteratively undischarges antecedents in a chain of implications. \DESCRIBE {\par\samepage\setseps\small \begin{verbatim} - A |- t1 ==> t2 - ---------------- UNDISCH - A, t1 |- t2 + A |- t1 ==> ... ==> tn ==> t + ------------------------------ UNDISCH_ALL + A, t1, ..., tn |- t \end{verbatim} } -\noindent Note that {\small\verb%UNDISCH%} treats {\small\verb%"~u"%} as {\small\verb%"u ==> F"%}. +\noindent Note that {\small\verb%UNDISCH_ALL%} treats {\small\verb%"~u"%} as {\small\verb%"u ==> F"%}. \FAILURE -{\small\verb%UNDISCH%} will fail on theorems which are not implications or negations. +Unlike {\small\verb%UNDISCH%}, {\small\verb%UNDISCH_ALL%} will, +when called on something other than an implication or negation, +return its argument unchanged rather than failing. \COMMENTS -If the antecedent already appears in the hypotheses, it will not be duplicated. -However, unlike {\small\verb%DISCH%}, -if the antecedent is alpha-equivalent to one of the hypotheses, -it will still be added to the hypotheses. +Identical terms which are repeated in {\small\verb%A, "t1", ..., "tn"%} will +not be duplicated in the hypotheses of the resulting theorem. +However, if two or more alpha-equivalent terms appear in {\small\verb%A, "t1", ..., "tn"%}, +then each distinct term will appear in the result. \SEEALSO -DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, FILTER_DISCH_TAC, FILTER_DISCH_THEN, -NEG_DISCH, STRIP_TAC, UNDISCH_ALL, UNDISCH_TAC. +DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, NEG_DISCH, FILTER_DISCH_TAC, +FILTER_DISCH_THEN, STRIP_TAC, UNDISCH, UNDISCH_TAC. \ENDDOC -\DOC{UNDISCH\_ALL} +\DOC{UNDISCH} -\TYPE {\small\verb%UNDISCH_ALL : (thm -> thm)%}\egroup +\TYPE {\small\verb%UNDISCH : (thm -> thm)%}\egroup \SYNOPSIS -Iteratively undischarges antecedents in a chain of implications. +Undischarges the antecedent of an implicative theorem. \DESCRIBE {\par\samepage\setseps\small \begin{verbatim} - A |- t1 ==> ... ==> tn ==> t - ------------------------------ UNDISCH_ALL - A, t1, ..., tn |- t + A |- t1 ==> t2 + ---------------- UNDISCH + A, t1 |- t2 \end{verbatim} } -\noindent Note that {\small\verb%UNDISCH_ALL%} treats {\small\verb%"~u"%} as {\small\verb%"u ==> F"%}. +\noindent Note that {\small\verb%UNDISCH%} treats {\small\verb%"~u"%} as {\small\verb%"u ==> F"%}. \FAILURE -Unlike {\small\verb%UNDISCH%}, {\small\verb%UNDISCH_ALL%} will, -when called on something other than an implication or negation, -return its argument unchanged rather than failing. +{\small\verb%UNDISCH%} will fail on theorems which are not implications or negations. \COMMENTS -Identical terms which are repeated in {\small\verb%A, "t1", ..., "tn"%} will -not be duplicated in the hypotheses of the resulting theorem. -However, if two or more alpha-equivalent terms appear in {\small\verb%A, "t1", ..., "tn"%}, -then each distinct term will appear in the result. +If the antecedent already appears in the hypotheses, it will not be duplicated. +However, unlike {\small\verb%DISCH%}, +if the antecedent is alpha-equivalent to one of the hypotheses, +it will still be added to the hypotheses. \SEEALSO -DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, NEG_DISCH, FILTER_DISCH_TAC, -FILTER_DISCH_THEN, STRIP_TAC, UNDISCH, UNDISCH_TAC. +DISCH, DISCH_ALL, DISCH_TAC, DISCH_THEN, FILTER_DISCH_TAC, FILTER_DISCH_THEN, +NEG_DISCH, STRIP_TAC, UNDISCH_ALL, UNDISCH_TAC. \ENDDOC \DOC{UNDISCH\_TAC} @@ -27424,18 +27422,21 @@ Never fails. \#, B, C, CB, Co, I, K, KI, o, oo, S. \ENDDOC -\DOC{words} +\DOC{words2} -\TYPE {\small\verb%words : (string -> string list)%}\egroup +\TYPE {\small\verb%words2 : (string -> string -> string list)%}\egroup \SYNOPSIS -Splits a string into a list of words. +Splits a string into a list of substrings, breaking at occurrences of a +specified character. \DESCRIBE -{\small\verb%words s%} splits the string {\small\verb%s%} into a list of substrings. Splitting occurs -at each sequence of blanks and carriage returns (white space). This white -space does not appear in the list of substrings. Leading and trailing white -space in the input string is also thrown away. +{\small\verb%words2 char s%} splits the string {\small\verb%s%} into a list of substrings. Splitting +occurs at each occurrence of a sequence of the character {\small\verb%char%}. The {\small\verb%char%} +characters do not appear in the list of substrings. Leading and trailing +occurrences of {\small\verb%char%} are also thrown away. If {\small\verb%char%} is not a +single-character string (its length is not 1), then {\small\verb%s%} will not be split and +so the result will be the list {\small\verb%[s]%}. \FAILURE Never fails. @@ -27443,37 +27444,29 @@ Never fails. \EXAMPLE {\par\samepage\setseps\small \begin{verbatim} -#words ` the cat sat on the mat `;; +#words2 `/` `/the/cat//sat/on//the/mat/`;; [`the`; `cat`; `sat`; `on`; `the`; `mat`] : string list -\end{verbatim} -} -\USES -Useful when wanting to map a function over a list of constant strings. -Instead of using {\small\verb%[`string1`;...;`stringn`]%} one can use: -{\par\samepage\setseps\small -\begin{verbatim} - (words `string1 ... stringn`) + +#words2 `//` `/the/cat//sat/on//the/mat/`;; +[`/the/cat//sat/on//the/mat/`] : string list \end{verbatim} } \SEEALSO -words2, word_separators, maptok, explode. +words, word_separators, explode. \ENDDOC -\DOC{words2} +\DOC{words} -\TYPE {\small\verb%words2 : (string -> string -> string list)%}\egroup +\TYPE {\small\verb%words : (string -> string list)%}\egroup \SYNOPSIS -Splits a string into a list of substrings, breaking at occurrences of a -specified character. +Splits a string into a list of words. \DESCRIBE -{\small\verb%words2 char s%} splits the string {\small\verb%s%} into a list of substrings. Splitting -occurs at each occurrence of a sequence of the character {\small\verb%char%}. The {\small\verb%char%} -characters do not appear in the list of substrings. Leading and trailing -occurrences of {\small\verb%char%} are also thrown away. If {\small\verb%char%} is not a -single-character string (its length is not 1), then {\small\verb%s%} will not be split and -so the result will be the list {\small\verb%[s]%}. +{\small\verb%words s%} splits the string {\small\verb%s%} into a list of substrings. Splitting occurs +at each sequence of blanks and carriage returns (white space). This white +space does not appear in the list of substrings. Leading and trailing white +space in the input string is also thrown away. \FAILURE Never fails. @@ -27481,15 +27474,20 @@ Never fails. \EXAMPLE {\par\samepage\setseps\small \begin{verbatim} -#words2 `/` `/the/cat//sat/on//the/mat/`;; +#words ` the cat sat on the mat `;; [`the`; `cat`; `sat`; `on`; `the`; `mat`] : string list - -#words2 `//` `/the/cat//sat/on//the/mat/`;; -[`/the/cat//sat/on//the/mat/`] : string list +\end{verbatim} +} +\USES +Useful when wanting to map a function over a list of constant strings. +Instead of using {\small\verb%[`string1`;...;`stringn`]%} one can use: +{\par\samepage\setseps\small +\begin{verbatim} + (words `string1 ... stringn`) \end{verbatim} } \SEEALSO -words, word_separators, explode. +words2, word_separators, maptok, explode. \ENDDOC \DOC{word\_separators} --- hol88-2.02.19940316.orig/lisp/f-format.l +++ hol88-2.02.19940316/lisp/f-format.l @@ -131,8 +131,8 @@ (defun flush-output-buffer nil ;; Some data types (e.g. streams) cannot be catenated in franz, so ;; print out items in buffer separately. - #+franz (mapc #'llprinc (nreverse %output-buffer)) - #-franz (llprinc (apply #'catenate (nreverse %output-buffer))) + #+(or franz gcl) (mapc #'llprinc (nreverse %output-buffer)) + #-(or franz gcl) (llprinc (apply #'catenate (nreverse %output-buffer))) (setq %output-buffer nil)) --- hol88-2.02.19940316.orig/lisp/f-cl.l +++ hol88-2.02.19940316/lisp/f-cl.l @@ -164,10 +164,11 @@ :gc t) #+kcl (progn - (setf (symbol-function 'si:top-level) - `(lambda nil (tml))) +; (setf (symbol-function 'si:top-level) +; `(lambda nil (tml))) + (setq si::*top-level-hook* (lambda nil (tml))) (gbc t) - (save file)) + (si::save-system file)) #+allegro (progn (setf (symbol-function 'excl::copyright-banner) @@ -569,10 +570,19 @@ (setq *standard-input* (pop inputstack)) (close current-input))) +(defconstant +fast-digits+ 4) +(defconstant +slow-digits+ (- (truncate (log most-positive-fixnum 10) 1.0) +fast-digits+)) +(defconstant +fast-mod+ (expt 10 +fast-digits+)) +(defconstant +slow-mod+ (expt 10 +slow-digits+)) + (defun clock () ;; Get absolute time - just for time-stamps - (get-universal-time)) + (let ((s (get-universal-time)) + (m (si::gettimeofday))) + (+ (* +fast-mod+ (mod s +slow-mod+)) + (mod (truncate (* +fast-mod+ m) 1.0) +fast-mod+)))) +; (get-universal-time)) ;;; Add extension .o to a file name for output name in process of --- /dev/null +++ hol88-2.02.19940316/lisp/f-ol-syntax.h @@ -0,0 +1,367 @@ + +static void L1(); +static void L2(); +static void L3(); +static void L4(); +static void L5(); +static void L6(); +static void L7(); +static void L8(); +static void L9(); +static void L10(); +static void L11(); +static void L12(); +static void L13(); +static void L14(); +static void L15(); +static void L16(); +static void L17(); +static void L18(); +static void L19(); +static void L20(); +static void L21(); +static void L22(); +static void L23(); +static void L24(); +static void L25(); +static void L26(); +static void L27(); +static void L28(); +static void L29(); +static void L30(); +static void L31(); +static void L32(); +static void L33(); +static void L34(); +static void L35(); +static void L36(); +static void L37(); +static void L38(); +static void L39(); +static void L40(); +static void L41(); +static void L42(); +static void L43(); +static void L44(); +static void L45(); +static void L46(); +static void L47(); +static void L48(); +static void L49(); +static void L50(); +static void L51(); +static void L52(); +static void L53(); +static void L54(); +static void L55(); +static void L56(); +static void L57(); +static void L58(); +static void L59(); +static void L60(); +static void L61(); +static void L62(); +static void L63(); +static void L64(); +static void L65(); +static void L66(); +static void L67(); +static void L68(); +static void L69(); +static void L70(); +#define VC1 +#define VC2 +#define VC3 +#define VC4 +#define VC5 +#define VC6 +#define VC7 +#define VC8 +#define VC9 +#define VC10 +#define VC11 +#define VC12 +#define VC13 +#define VC14 +#define VC15 +#define VC16 +#define VC17 +#define VC18 +#define VC19 +#define VC20 +#define VC21 +#define VC22 +#define VC23 object V37 ,V36; +#define VC24 object V43 ,V42; +#define VC25 object V46; +#define VC26 +#define VC27 +#define VC28 object V57 ,V56; +#define VC29 +#define VC30 +#define VC31 +#define VC32 object V62; +#define VC33 object V68 ,V67; +#define VC34 +#define VC35 +#define VC36 +#define VC37 object V79 ,V78 ,V77 ,V76; +#define VC38 +#define VC39 object V82; +#define VC40 object V96 ,V95 ,V94 ,V93 ,V92 ,V91 ,V90 ,V89 ,V88 ,V87 ,V86 ,V85; +#define VC41 +#define VC42 object V112 ,V111 ,V110 ,V109 ,V108 ,V107 ,V106 ,V105 ,V104 ,V103 ,V102 ,V101; +#define VC43 object V117 ,V116; +#define VC44 +#define VC45 object V131 ,V130 ,V129 ,V128; +#define VC46 object V141 ,V140 ,V139 ,V136; +#define VC47 object V148 ,V147 ,V145; +#define VC48 +#define VC49 +#define VC50 +#define VC51 object V160 ,V159; +#define VC52 object V169 ,V168; +#define VC53 +#define VC54 object V173; +#define VC55 +#define VC56 +#define VC57 +#define VC58 object V185 ,V184; +#define VC59 +#define VC60 +#define VC61 object V192 ,V190; +#define VC62 +#define VC63 +#define VC64 object V197; +#define VC65 +#define VC66 +#define VC67 +#define VC68 +#define VC69 +#define VC70 +#define VM70 2 +#define VM69 2 +#define VM68 2 +#define VM67 2 +#define VM66 1 +#define VM65 2 +#define VM64 2 +#define VM63 2 +#define VM62 2 +#define VM61 3 +#define VM60 2 +#define VM59 2 +#define VM58 2 +#define VM57 7 +#define VM56 5 +#define VM55 5 +#define VM54 2 +#define VM53 2 +#define VM52 6 +#define VM51 5 +#define VM50 5 +#define VM49 2 +#define VM48 4 +#define VM47 3 +#define VM46 3 +#define VM45 2 +#define VM44 3 +#define VM43 3 +#define VM42 2 +#define VM41 4 +#define VM40 2 +#define VM39 2 +#define VM38 2 +#define VM37 3 +#define VM36 4 +#define VM35 2 +#define VM34 2 +#define VM33 6 +#define VM32 3 +#define VM31 2 +#define VM30 2 +#define VM29 4 +#define VM28 5 +#define VM27 2 +#define VM26 2 +#define VM25 3 +#define VM24 6 +#define VM23 6 +#define VM22 2 +#define VM21 2 +#define VM20 3 +#define VM19 4 +#define VM18 2 +#define VM17 2 +#define VM16 3 +#define VM15 4 +#define VM14 2 +#define VM13 2 +#define VM12 2 +#define VM11 3 +#define VM10 2 +#define VM9 2 +#define VM8 3 +#define VM7 2 +#define VM6 2 +#define VM5 3 +#define VM4 2 +#define VM3 2 +#define VM2 5 +#define VM1 2 +static void * VVi[109]={ +#define Cdata VV[108] +(void *)(L1), +(void *)(L2), +(void *)(L3), +(void *)(L4), +(void *)(L5), +(void *)(L6), +(void *)(L7), +(void *)(L8), +(void *)(L9), +(void *)(L10), +(void *)(L11), +(void *)(L12), +(void *)(L13), +(void *)(L14), +(void *)(L15), +(void *)(L16), +(void *)(L17), +(void *)(L18), +(void *)(L19), +(void *)(L20), +(void *)(L21), +(void *)(L22), +(void *)(L23), +(void *)(L24), +(void *)(L25), +(void *)(L26), +(void *)(L27), +(void *)(L28), +(void *)(L29), +(void *)(L30), +(void *)(L31), +(void *)(L32), +(void *)(L33), +(void *)(L34), +(void *)(L35), +(void *)(L36), +(void *)(L37), +(void *)(L38), +(void *)(L39), +(void *)(L40), +(void *)(L41), +(void *)(L42), +(void *)(L43), +(void *)(L44), +(void *)(L45), +(void *)(L46), +(void *)(L47), +(void *)(L48), +(void *)(L49), +(void *)(L50), +(void *)(L51), +(void *)(L52), +(void *)(L53), +(void *)(L54), +(void *)(L55), +(void *)(L56), +(void *)(L57), +(void *)(L58), +(void *)(L59), +(void *)(L60), +(void *)(L61), +(void *)(L62), +(void *)(L63), +(void *)(L64), +(void *)(L65), +(void *)(L66), +(void *)(L67), +(void *)(L68), +(void *)(L69), +(void *)(L70) +}; +#define VV (VVi) +static void LnkT107(); +static void (*Lnk107)() = LnkT107; +static void LnkT106(); +static void (*Lnk106)() = LnkT106; +static void LnkT105(); +static void (*Lnk105)() = LnkT105; +static void LnkT104(); +static void (*Lnk104)() = LnkT104; +static object LnkTLI103(object,...); +static object (*LnkLI103)() = (object (*)()) LnkTLI103; +static object LnkTLI102(object,...); +static object (*LnkLI102)() = (object (*)()) LnkTLI102; +static void LnkT101(); +static void (*Lnk101)() = LnkT101; +static void LnkT100(); +static void (*Lnk100)() = LnkT100; +static void LnkT99(); +static void (*Lnk99)() = LnkT99; +static void LnkT98(); +static void (*Lnk98)() = LnkT98; +static void LnkT97(); +static void (*Lnk97)() = LnkT97; +static void LnkT96(); +static void (*Lnk96)() = LnkT96; +static void LnkT95(); +static void (*Lnk95)() = LnkT95; +static void LnkT94(); +static void (*Lnk94)() = LnkT94; +static void LnkT93(); +static void (*Lnk93)() = LnkT93; +static void LnkT92(); +static void (*Lnk92)() = LnkT92; +static void LnkT91(); +static void (*Lnk91)() = LnkT91; +static void LnkT90(); +static void (*Lnk90)() = LnkT90; +static void LnkT89(); +static void (*Lnk89)() = LnkT89; +static void LnkT88(); +static void (*Lnk88)() = LnkT88; +static void LnkT87(); +static void (*Lnk87)() = LnkT87; +static void LnkT86(); +static void (*Lnk86)() = LnkT86; +static void LnkT85(); +static void (*Lnk85)() = LnkT85; +static void LnkT84(); +static void (*Lnk84)() = LnkT84; +static void LnkT83(); +static void (*Lnk83)() = LnkT83; +static void LnkT81(); +static void (*Lnk81)() = LnkT81; +static void LnkT80(); +static void (*Lnk80)() = LnkT80; +static void LnkT79(); +static void (*Lnk79)() = LnkT79; +static void LnkT78(); +static void (*Lnk78)() = LnkT78; +static void LnkT77(); +static void (*Lnk77)() = LnkT77; +static void LnkT76(); +static void (*Lnk76)() = LnkT76; +static void LnkT75(); +static void (*Lnk75)() = LnkT75; +static void LnkT74(); +static void (*Lnk74)() = LnkT74; +static void LnkT73(); +static void (*Lnk73)() = LnkT73; +static void LnkT72(); +static void (*Lnk72)() = LnkT72; +static void LnkT71(); +static void (*Lnk71)() = LnkT71; +static void LnkT70(); +static void (*Lnk70)() = LnkT70; +static void LnkT69(); +static void (*Lnk69)() = LnkT69; +static void LnkT68(); +static void (*Lnk68)() = LnkT68; +static void LnkT67(); +static void (*Lnk67)() = LnkT67; +static void LnkT66(); +static void (*Lnk66)() = LnkT66; --- /dev/null +++ hol88-2.02.19940316/lisp/f-ol-syntax.c @@ -0,0 +1,7805 @@ +#define SGC + +#define EXTER extern +/* h/gclincl.h. Generated from gclincl.h.in by configure. */ +/* h/gclincl.h.in. Generated from configure.in by autoheader. */ +/* define where the heap could begin. Normally should +be the smallest value returned by sbrk(). Underestimating +by 10-20 megabytes is not a problem. */ + +#define DBEGIN 0x8000000 /* where data begins */ + + +/* the size of the page tables for gcl. Each page is PAGESIZE which +is usually 4K or 8K bytes. From 1 to 3 bytes per page are +preallocated in a table at compile time. this must be a power of 2 if +SGC is enabled. */ + +#define MAXPAGE (128*1024*(SIZEOF_LONG>>2)/(1<<(PAGEWIDTH-12))) +#define VSSIZE 128*1024 +#define BDSSIZE 2*1024 +#define IHSSIZE 4*1024 +#define FRSSIZE 4*1024 + +#define HOLEPAGE (MAXPAGE/10) + +/* check to see if getcwd exists +*/ +#define HAVE_GETCWD 1 + + +/* if we dont have USEGETCWD, we will use GETWD unless following defined +*/ +#define HAVE_GETWD 1 + + +/* no gettimeofday function */ + +/* #undef NO_GETTOD */ + +/* define if have */ +#define HAVE_ASM_SIGNAL_H 1 + +/* define if have */ +#define HAVE_ASM_SIGCONTEXT_H 1 + +/* define if have struct sigcontext in one of above */ +/* #undef HAVE_SIGCONTEXT */ + + +/* define if have */ +#define HAVE_SYS_IOCTL_H 1 + +/* define if we can use the file nsocket.c */ +#define HAVE_NSOCKET 1 + +#ifndef HAVE_ALLOCA +/* define this if you have alloca */ +#define HAVE_ALLOCA 1 +#endif + + +/* define if need alloca.h */ +/* #undef NEED_ALLOCA_H */ + +#ifdef NEED_ALLOCA_H +#include +#endif + + +/* define LISTEN_USE_FCNTL if we can check for input using fcntl */ +#define LISTEN_USE_FCNTL 1 + +/* if signal.h alone contains the stuff necessary for sgc */ +#define SIGNAL_H_HAS_SIGCONTEXT 1 + + +/* define if the profil system call is not defined in libc */ +/* #undef NO_PROFILE */ + + +/* define if the _cleanup() function exists and should be called + before saving */ +/* #define USE_CLEANUP */ + + +/* define if BIG_ENDIAN or LITTLE_ENDIAN is defined by including + the standard includes */ +/* #define ENDIAN_ALREADY_DEFINED */ + +/* define if SV_ONSTACK is defined in signal.h */ +#define HAVE_SV_ONSTACK 1 + + +/* + define to be a typical stack address. We use this to decide + whether we can use a cheap test for NULL_OR_ON_C_STACK, or whether + it has to be more complex.. + +*/ + +#define CSTACK_ADDRESS -1075718936 + +/* define if SIGSYS is defined in signal.h */ + +#define HAVE_SIGSYS 1 + +/* define if SIGEMT is defined in signal.h */ + +/* #undef HAVE_SIGEMT */ + + +/* define if setenv is define */ +#define HAVE_SETENV 1 + +/* define if putenv is define */ +/* #undef HAVE_PUTENV */ + + +/* define if long long int works to multiply to ints, */ + +#define HAVE_LONG_LONG 1 + +/* define if want to use GMP */ +#define GMP 1 + +/* have a broken version of C compiler which makes bad code for -O4 */ +/* #undef BROKEN_O4_OPT */ + +/* See if gettimeofday is declared in the header file. */ +/* if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can */ +/* declare it. */ + +#define GETTOD_NOT_DECLARED 1 + +/* #undef HAVE_BSDGETTIMEOFDAY */ + +/* #undef NO_UNAME */ + +/* FIONBIO vs. O_NONBLOCK for nonblocking I/O */ +/* #undef USE_FIONBIO */ + +/* readline support */ +#define HAVE_READLINE 1 + +/* bfd support */ +/* #undef HAVE_LIBBFD */ +/* #undef NEED_CONST */ +#define HAVE_BFD_BOOLEAN + +#ifdef HAVE_BFD_BOOLEAN +#define MY_BFD_BOOLEAN bfd_boolean +#define MY_BFD_FALSE FALSE +#define MY_BFD_TRUE TRUE +#else +#define MY_BFD_BOOLEAN boolean +#define MY_BFD_FALSE false +#define MY_BFD_TRUE true +#endif +/* isnormal check */ +#define HAVE_ISNORMAL 1 + +/* #undef HAVE_IEEEFP */ + +#ifdef IN_NUM_CO +#ifdef HAVE_ISNORMAL +#define _GNU_SOURCE +#include +#define ISNORMAL(a) isnormal(a) +#else +#ifdef HAVE_IEEEFP +#include +#define ISNORMAL(a) (fpclass(a)>=FP_NZERO) +#else +#include +#define ISNORMAL(a) ((sizeof (a) == sizeof (float)) ? \ + gcl_isnormal_float(a) : \ + gcl_isnormal_double(a)) +#endif +#endif +#endif + +#define HAVE_ISFINITE 1 +/* #undef HAVE_FINITE */ + +#ifdef NEED_ISFINITE +#ifdef HAVE_ISFINITE +#define _GNU_SOURCE +#include +#define ISFINITE(a) isfinite(a) +#else +#ifdef HAVE_FINITE +#include +#include +#define ISFINITE(a) finite(a) +#else +#error "No isfinite found" +#endif +#endif +#endif + +#define HAVE_VALUES_H 1 +#define HAVE_FLOAT_H 1 + +#ifdef IN_NUM_CO +#ifdef HAVE_VALUES_H +#include +#endif +#ifdef HAVE_FLOAT_H +#include +#endif +#endif + + + +/* math.h for definitions in generated C code */ +#define HAVE_MATH_H 1 + +#ifdef HAVE_MATH_H +#include +#endif + +#define LITTLE_END 1 + +#define PAGEWIDTH 12 + +/* #ifdef PAGEWIDTH */ +/* #undef PAGESIZE */ +/* #define PAGESIZE (1< header file. */ +#define HAVE_ASM_SIGCONTEXT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ASM_SIGNAL_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ELF_ABI_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ELF_H 1 + +/* Have finite function */ +/* #undef HAVE_FINITE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FLOAT_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getwd' function. */ +#define HAVE_GETWD 1 + +/* Have ieeefp fpclass function */ +/* #undef HAVE_IEEEFP */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Have isfinite function */ +#define HAVE_ISFINITE 1 + +/* Have isnormal function */ +#define HAVE_ISNORMAL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_JAPI_H */ + +/* memalign element present */ +/* #undef HAVE_MALLOC_ZONE_MEMALIGN */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MATH_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_READLINE_READLINE_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_RPC_RPC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDLIB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRING_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKIO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TYPES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_VALUES_H 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* staticly linked images */ +/* #undef STATIC_LINKING */ + +/* Define to 1 if you have the ANSI C header files. */ +/* #undef STDC_HEADERS */ +#include +#define _VA_LIST_DEFINED + +#include +#include + +/* #define endp(obje) endp1(obje) */ + +#define STSET(type,x,i,val) do{SGC_TOUCH(x);STREF(type,x,i) = (val);} while(0) + + +#ifndef NEW_LISP +#define t_doublefloat t_longfloat +#endif + +enum type { + t_cons, + t_start = 0, + t_fixnum, + t_bignum, + t_ratio, + t_shortfloat, + t_doublefloat, + t_complex, + t_character, + t_symbol, + t_package, + t_hashtable, + t_array, + t_vector, + t_string, + t_bitvector, + t_structure, + t_stream, + t_random, + t_readtable, + t_pathname, + t_cfun, + t_cclosure, + t_sfun, + t_gfun, + t_vfun, + t_afun, + t_closure, + t_cfdata, + t_spice, + t_end, + t_contiguous, + t_relocatable, + t_other +}; + + +enum signals_allowed_values { + sig_none, + sig_normal, + sig_try_to_delay, + sig_safe, + sig_at_read, + sig_use_signals_allowed_value + +}; + + +#ifdef __SHORT_LIMB +typedef unsigned int mp_limb_t; +#else +#ifdef __LONG_LONG_LIMB +typedef unsigned long long int mp_limb_t; +#else +typedef unsigned long int mp_limb_t; +#endif +#endif + +typedef mp_limb_t * mp_ptr; + +typedef struct +{ + int _mp_alloc; /* Number of *limbs* allocated and pointed + to by the _mp_d field. */ + int _mp_size; /* abs(_mp_size) is the number of limbs the + last field points to. If _mp_size is + negative this is a negative number. */ + mp_limb_t *_mp_d; /* Pointer to the limbs. */ +} __mpz_struct; + +typedef __mpz_struct MP_INT; + +/* + Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa + +This file is part of GNU Common Lisp, herein referred to as GCL + +GCL is free software; you can redistribute it and/or modify it under +the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with GCL; see the file COPYING. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/* + object.h +*/ + +/* + Some system constants. +*/ + +#define TRUE 1 /* boolean true value */ +#define FALSE 0 /* boolean false value */ + +#define FIRSTWORD unsigned char t,flag; char s,m + +#define NBPP 4 /* number of bytes per pointer */ + +#ifndef PAGEWIDTH +#define PAGEWIDTH 11 /* page width */ +#endif + /* log2(PAGESIZE) */ +#undef PAGESIZE +#define PAGESIZE (1 << PAGEWIDTH) /* page size in bytes */ + + +#define CHCODELIM 256 /* character code limit */ + /* ASCII character set */ +#define CHFONTLIM 1 /* character font limit */ +#define CHBITSLIM 1 /* character bits limit */ +#define CHCODEFLEN 8 /* character code field length */ +#define CHFONTFLEN 0 /* character font field length */ +#define CHBITSFLEN 0 /* character bits field length */ + +#define PHTABSIZE 512 /* number of entries */ + /* in the package hash table */ + +#define ARANKLIM 64 /* array rank limit */ + +#define RTABSIZE CHCODELIM + /* read table size */ + +#define CBMINSIZE 64 /* contiguous block minimal size */ + +#ifndef CHAR_SIZE +#define CHAR_SIZE 8 /* number of bits in a char */ +#endif + +#undef bool +typedef int bool; +typedef long fixnum; +typedef unsigned long ufixnum; +typedef float shortfloat; +typedef double longfloat; +typedef unsigned short fatchar; + +#ifndef plong +#define plong int +#endif + + +#define SIGNED_CHAR(x) (((char ) -1) < (char )0 ? (char) x \ + : (x >= (1<<(CHAR_SIZE-1)) ? \ + x - (((int)(1<<(CHAR_SIZE-1))) << 1) \ + : (char ) x)) + + +/* + Definition of the type of LISP objects. +*/ +typedef union lispunion *object; + +typedef union int_object iobject; +union int_object {object o; fixnum i;}; + +/* + OBJect NULL value. + It should not coincide with any legal object value. +*/ +#define OBJNULL ((object)NULL) + +/* + Definition of each implementation type. +*/ + +struct fixnum_struct { + FIRSTWORD; + fixnum FIXVAL; /* fixnum value */ +}; +#define Mfix(obje) (obje)->FIX.FIXVAL +#define fix(x) Mfix(x) + +#define SMALL_FIXNUM_LIMIT 1024 + +/* EXTER */ +/* struct fixnum_struct small_fixnum_table[2*SMALL_FIXNUM_LIMIT]; */ + +/* #define small_fixnum(i) \ */ +/* (object)(small_fixnum_table+SMALL_FIXNUM_LIMIT+(i)) */ + +struct shortfloat_struct { + FIRSTWORD; + shortfloat SFVAL; /* shortfloat value */ +}; +#define Msf(obje) (obje)->SF.SFVAL +#define sf(x) Msf(x) + +struct longfloat_struct { + FIRSTWORD; + longfloat LFVAL; /* longfloat value */ +}; +#define Mlf(obje) (obje)->LF.LFVAL +#define lf(x) Mlf(x) + + + +/* #ifdef _MP_H */ + +/* #else */ +/* typedef struct */ +/* { */ +/* int _mp_alloc; Number of *limbs* allocated and pointed */ +/* to by the _mp_d field. */ +/* int _mp_size; abs(_mp_size) is the number of limbs the */ +/* last field points to. If _mp_size is */ +/* negative this is a negative number. */ +/* void *_mp_d; Pointer to the limbs. */ +/* } our_mpz_struct; */ +/* #endif */ + +struct bignum { + FIRSTWORD; +#ifdef GMP + __mpz_struct big_mpz_t; +#else + plong *big_self; /* bignum body */ + int big_length; /* bignum length */ +#endif +}; + +struct ratio { + FIRSTWORD; + object rat_den; /* denominator */ + /* must be an integer */ + object rat_num; /* numerator */ + /* must be an integer */ +}; + +struct complex { + FIRSTWORD; + object cmp_real; /* real part */ + /* must be a number */ + object cmp_imag; /* imaginary part */ + /* must be a number */ +}; + +struct character { + FIRSTWORD; + unsigned short ch_code; /* code */ + unsigned char ch_font; /* font */ + unsigned char ch_bits; /* bits */ +}; + + + +/* struct character character_table1[256+128]; */ +/* EXTER */ +/* union lispunion character_table1[256+128]; */ +/* #define character_table (character_table1+128) */ +/* #define code_char(c) (object)(character_table+(c)) */ +/* #define char_code(obje) ((object)obje)->ch.ch_code */ +/* #define char_font(obje) ((object)obje)->ch.ch_font */ +/* #define char_bits(obje) ((object)obje)->ch.ch_bits */ + +enum stype { /* symbol type */ + stp_ordinary, /* ordinary */ + stp_constant, /* constant */ + stp_special /* special */ +}; + +#define Cnil ((object)&Cnil_body) +#define Ct ((object)&Ct_body) +#define sLnil Cnil +#define sLt Ct + +#define NOT_SPECIAL ((void (*)())Cnil) +#define s_fillp st_fillp +#define s_self st_self + +struct symbol { + FIRSTWORD; + object s_dbind; /* dynamic binding */ + void (*s_sfdef)(); /* special form definition */ + /* This field coincides with c_car */ + char *s_self; /* print name */ + /* These fields coincide with */ + /* st_fillp and st_self. */ + int s_fillp; /* print name length */ + + object s_gfdef; /* global function definition */ + /* For a macro, */ + /* its expansion function */ + /* is to be stored. */ + object s_plist; /* property list */ + object s_hpack; /* home package */ + /* Cnil for uninterned symbols */ + short s_stype; /* symbol type */ + /* of enum stype */ + short s_mflag; /* macro flag */ +}; +EXTER +/* struct symbol Cnil_body, Ct_body; */ +union lispunion Cnil_body, Ct_body; + +struct package { + FIRSTWORD; + object p_name; /* package name */ + /* a string */ + object p_nicknames; /* nicknames */ + /* list of strings */ + object p_shadowings; /* shadowing symbol list */ + object p_uselist; /* use-list of packages */ + object p_usedbylist; /* used-by-list of packages */ + object *p_internal; /* hashtable for internal symbols */ + object *p_external; /* hashtable for external symbols */ + int p_internal_size; /* size of internal hash table*/ + int p_external_size; /* size of external hash table */ + int p_internal_fp; /* [rough] number of symbols */ + int p_external_fp; /* [rough] number of symbols */ + struct package + *p_link; /* package link */ +}; + +/* + The values returned by intern and find_symbol. + File_symbol may return 0. +*/ +#define INTERNAL 1 +#define EXTERNAL 2 +#define INHERITED 3 + +/* + All the packages are linked through p_link. +*/ +EXTER struct package *pack_pointer; /* package pointer */ + +struct cons { + FIRSTWORD; + object c_cdr; /* cdr */ + object c_car; /* car */ +}; + +enum httest { /* hash table key test function */ + htt_eq, /* eq */ + htt_eql, /* eql */ + htt_equal /* equal */ +}; + +struct htent { /* hash table entry */ + object hte_key; /* key */ + object hte_value; /* value */ +}; + +struct hashtable { /* hash table header */ + FIRSTWORD; + struct htent + *ht_self; /* pointer to the hash table */ + object ht_rhsize; /* rehash size */ + object ht_rhthresh; /* rehash threshold */ + int ht_nent; /* number of entries */ + int ht_size; /* hash table size */ + short ht_test; /* key test function */ + /* of enum httest */ +}; + +enum aelttype { /* array element type */ + aet_object, /* t */ + aet_ch, /* string-char */ + aet_bit, /* bit */ + aet_fix, /* fixnum */ + aet_sf, /* short-float */ + aet_lf, /* plong-float */ + aet_char, /* signed char */ + aet_uchar, /* unsigned char */ + aet_short, /* signed short */ + aet_ushort, /* unsigned short */ + aet_last + }; + +struct array { /* array header */ + FIRSTWORD; + object a_displaced; /* displaced */ + short a_rank; /* array rank */ + short a_elttype; /* element type */ + object *a_self; /* pointer to the array */ + short a_adjustable; /* adjustable flag */ + short a_offset; /* bitvector offset */ + int a_dim; /* dimension */ + int *a_dims; /* table of dimensions */ + +}; + + + +struct vector { /* vector header */ + FIRSTWORD; + object v_displaced; /* displaced */ + short v_hasfillp; /* has-fill-pointer flag */ + short v_elttype; /* element type */ + + object *v_self; /* pointer to the vector */ + int v_fillp; /* fill pointer */ + /* For simple vectors, */ + /* v_fillp is equal to v_dim. */ + int v_dim; /* dimension */ + short v_adjustable; /* adjustable flag */ + short v_offset; /* not used */ +}; + +struct string { /* string header */ + FIRSTWORD; + object st_displaced; /* displaced */ + short st_hasfillp; /* has-fill-pointer flag */ + short st_adjustable; /* adjustable flag */ + char *st_self; /* pointer to the string */ + int st_fillp; /* fill pointer */ + /* For simple strings, */ + /* st_fillp is equal to st_dim. */ + int st_dim; /* dimension */ + /* string length */ + +}; + +struct ustring { + FIRSTWORD; + object ust_displaced; + short ust_hasfillp; + short ust_adjustable; + unsigned char *ust_self; + int ust_fillp; + + int ust_dim; + + +}; + +#define USHORT_GCL(x,i) (((unsigned short *)(x)->ust.ust_self)[i]) +#define SHORT_GCL(x,i) ((( short *)(x)->ust.ust_self)[i]) + +#define BV_OFFSET(x) ((type_of(x)==t_bitvector ? x->bv.bv_offset : \ + type_of(x)== t_array ? x->a.a_offset : (abort(),0))) + +#define SET_BV_OFFSET(x,val) ((type_of(x)==t_bitvector ? x->bv.bv_offset = val : \ + type_of(x)== t_array ? x->a.a_offset=val : (abort(),0))) + + + + +struct bitvector { /* bitvector header */ + FIRSTWORD; + object bv_displaced; /* displaced */ + short bv_hasfillp; /* has-fill-pointer flag */ + short bv_elttype; /* not used */ + char *bv_self; /* pointer to the bitvector */ + int bv_fillp; /* fill pointer */ + /* For simple bitvectors, */ + /* st_fillp is equal to st_dim. */ + int bv_dim; /* dimension */ + /* number of bits */ + short bv_adjustable; /* adjustable flag */ + short bv_offset; /* bitvector offset */ + /* the position of the first bit */ + /* in the first byte */ +}; + +struct fixarray { /* fixnum array header */ + FIRSTWORD; + object fixa_displaced; /* displaced */ + short fixa_rank; /* array rank */ + short fixa_elttype; /* element type */ + fixnum *fixa_self; /* pointer to the array */ + short fixa_adjustable;/* adjustable flag */ + short fixa_offset; /* not used */ + int fixa_dim; /* dimension */ + int *fixa_dims; /* table of dimensions */ + +}; + +struct sfarray { /* short-float array header */ + FIRSTWORD; + object sfa_displaced; /* displaced */ + short sfa_rank; /* array rank */ + short sfa_elttype; /* element type */ + shortfloat + *sfa_self; /* pointer to the array */ + short sfa_adjustable; /* adjustable flag */ + short sfa_offset; /* not used */ + int sfa_dim; /* dimension */ + + int *sfa_dims; /* table of dimensions */ + + + +}; + +struct lfarray { /* plong-float array header */ + FIRSTWORD; + object lfa_displaced; /* displaced */ + short lfa_rank; /* array rank */ + short lfa_elttype; /* element type */ + longfloat + *lfa_self; /* pointer to the array */ + short lfa_adjustable; /* adjustable flag */ + short lfa_offset; /* not used */ + int lfa_dim; /* dimension */ + int *lfa_dims; /* table of dimensions */ + + +}; + +struct structure { /* structure header */ + FIRSTWORD; + object str_def; /* structure definition (a structure) */ + object *str_self; /* structure self */ +}; + +struct s_data {object name; + fixnum length; + object raw; + object included; + object includes; + object staticp; + object print_function; + object slot_descriptions; + object slot_position; + fixnum size; + object has_holes; + }; + +#define S_DATA(x) ((struct s_data *)((x)->str.str_self)) +#define SLOT_TYPE(def,i) (((S_DATA(def))->raw->ust.ust_self[i])) +#define SLOT_POS(def,i) USHORT_GCL(S_DATA(def)->slot_position,i) +#define STREF(type,x,i) (*((type *)(((char *)((x)->str.str_self))+(i)))) + + + +enum smmode { /* stream mode */ + smm_input, /* input */ + smm_output, /* output */ + smm_io, /* input-output */ + smm_probe, /* probe */ + smm_synonym, /* synonym */ + smm_broadcast, /* broadcast */ + smm_concatenated, /* concatenated */ + smm_two_way, /* two way */ + smm_echo, /* echo */ + smm_string_input, /* string input */ + smm_string_output, /* string output */ + smm_user_defined, /* for user defined */ + smm_socket /* Socket stream */ +}; + +/* for any stream that takes writec_char, directly (not two_way or echo) + ie. smm_output,smm_io, smm_string_output, smm_socket + */ +#define STREAM_FILE_COLUMN(str) ((str)->sm.sm_int1) + +/* for smm_echo */ +#define ECHO_STREAM_N_UNREAD(strm) ((strm)->sm.sm_int0) + +/* file fd for socket */ +#define SOCKET_STREAM_FD(strm) ((strm)->sm.sm_fd) +#define SOCKET_STREAM_BUFFER(strm) ((strm)->sm.sm_object1) + +/* for smm_string_input */ +#define STRING_INPUT_STREAM_NEXT(strm) ((strm)->sm.sm_int0) +#define STRING_INPUT_STREAM_END(strm) ((strm)->sm.sm_int1) + +/* for smm_two_way and smm_echo */ +#define STREAM_OUTPUT_STREAM(strm) ((strm)->sm.sm_object1) +#define STREAM_INPUT_STREAM(strm) ((strm)->sm.sm_object0) + +/* for smm_string_{input,output} */ +#define STRING_STREAM_STRING(strm) ((strm)->sm.sm_object0) + +struct stream { + FIRSTWORD; + FILE *sm_fp; /* file pointer */ + object sm_object0; /* some object */ + object sm_object1; /* some object */ + int sm_int0; /* some int */ + int sm_int1; /* column for input or output, stream */ + char *sm_buffer; /* ptr to BUFSIZE block of storage */ + char sm_mode; /* stream mode */ + unsigned char sm_flags; /* flags from gcl_sm_flags */ + short sm_fd; /* stream fd */ + +}; +/* flags */ +#define GET_STREAM_FLAG(strm,name) ((strm)->sm.sm_flags & (1<<(name))) +#define SET_STREAM_FLAG(strm,name,val) {if (val) (strm)->sm.sm_flags |= (1<<(name)); else (strm)->sm.sm_flags &= ~(1<<(name));} + +#define GCL_MODE_BLOCKING 1 +#define GCL_MODE_NON_BLOCKING 0 +#define GCL_TCP_ASYNC 1 + +enum gcl_sm_flags { + gcl_sm_blocking=1, + gcl_sm_tcp_async, + gcl_sm_input, + gcl_sm_output, + gcl_sm_had_error + + +}; + +#ifdef BSD +#ifdef SUN3 +#define BASEFF (unsigned char *)0xffffffff +#else +#define BASEFF (char *)0xffffffff +#endif +#endif + +#ifdef ATT +#define BASEFF (unsigned char *)0xffffffff +#endif + +#ifdef E15 +#define BASEFF (unsigned char *)0xffffffff +#endif + +#ifdef MV + + +#endif + +struct random { + FIRSTWORD; + unsigned rnd_value; /* random state value */ +}; + +enum chattrib { /* character attribute */ + cat_whitespace, /* whitespace */ + cat_terminating, /* terminating macro */ + cat_non_terminating, /* non-terminating macro */ + cat_single_escape, /* single-escape */ + cat_multiple_escape, /* multiple-escape */ + cat_constituent /* constituent */ +}; + +struct rtent { /* read table entry */ + enum chattrib rte_chattrib; /* character attribute */ + object rte_macro; /* macro function */ + object *rte_dtab; /* pointer to the */ + /* dispatch table */ + /* NULL for */ + /* non-dispatching */ + /* macro character, or */ + /* non-macro character */ +}; + +struct readtable { /* read table */ + FIRSTWORD; + struct rtent *rt_self; /* read table itself */ +}; + +struct pathname { + FIRSTWORD; + object pn_host; /* host */ + object pn_device; /* device */ + object pn_directory; /* directory */ + object pn_name; /* name */ + object pn_type; /* type */ + object pn_version; /* version */ +}; + +struct cfun { /* compiled function header */ + FIRSTWORD; + object cf_name; /* compiled function name */ + void (*cf_self)(); /* entry address */ + object cf_data; /* data the function uses */ + /* for GBC */ +}; + +struct cclosure { /* compiled closure header */ + FIRSTWORD; + object cc_name; /* compiled closure name */ + void (*cc_self)(); /* entry address */ + object cc_env; /* environment */ + object cc_data; /* data the closure uses */ + /* for GBC */ + int cc_envdim; + object *cc_turbo; /* turbo charger */ +}; + +struct closure { + FIRSTWORD; + object cl_name; /* name */ + object (*cl_self)(); /* C start address of code */ + object cl_data; /* To object holding VV vector */ + int cl_argd; /* description of args + number */ + int cl_envdim; /* length of the environment vector */ + object *cl_env; /* environment vector referenced by cl_self()*/ +}; + +struct sfun { + FIRSTWORD; + object sfn_name; /* name */ + object (*sfn_self)(); /* C start address of code */ + object sfn_data; /* To object holding VV vector */ + int sfn_argd; /* description of args + number */ + + }; + +struct vfun { + FIRSTWORD; + object vfn_name; /* name */ + object (*vfn_self)(); /* C start address of code */ + object vfn_data; /* To object holding VV data */ + unsigned short vfn_minargs; /* Min args and where varargs start */ + unsigned short vfn_maxargs; /* Max number of args */ + }; +struct cfdata { + FIRSTWORD; + char *cfd_start; /* beginning of contblock for fun */ + int cfd_size; /* size of contblock */ + int cfd_fillp; /* size of self */ + object *cfd_self; /* body */ + }; + +struct spice { + FIRSTWORD; + int spc_dummy; +}; + +/* + dummy type +*/ +struct dummy { + FIRSTWORD; +}; + +/* + Definition of lispunion. +*/ +union lispunion { + struct fixnum_struct + FIX; /* fixnum */ + struct bignum big; /* bignum */ + struct ratio rat; /* ratio */ + struct shortfloat_struct + SF; /* short floating-point number */ + struct longfloat_struct + LF; /* plong floating-point number */ + struct complex cmp; /* complex number */ + struct character + ch; /* character */ + struct symbol s; /* symbol */ + struct package p; /* package */ + struct cons c; /* cons */ + struct hashtable + ht; /* hash table */ + struct array a; /* array */ + struct vector v; /* vector */ + struct string st; /* string */ + struct ustring ust; + struct bitvector + bv; /* bit-vector */ + struct structure + str; /* structure */ + struct stream sm; /* stream */ + struct random rnd; /* random-states */ + struct readtable + rt; /* read table */ + struct pathname pn; /* path name */ + struct cfun cf; /* compiled function uses value stack] */ + struct cclosure cc; /* compiled closure uses value stack */ + struct closure cl; /* compiled closure uses c stack */ + struct sfun sfn; /* simple function */ + struct vfun vfn; /* function with variable number of args */ + struct cfdata cfd; /* compiled fun data */ + struct spice spc; /* spice */ + + struct dummy d; /* dummy */ + + struct fixarray fixa; /* fixnum array */ + struct sfarray sfa; /* short-float array */ + struct lfarray lfa; /* plong-float array */ +}; + + +/* struct character character_table1[256+128]; */ +EXTER +union lispunion character_table1[256+128]; +#define character_table (character_table1+128) +#define code_char(c) (object)(character_table+(c)) +#define char_code(obje) ((object)obje)->ch.ch_code +#define char_font(obje) ((object)obje)->ch.ch_font +#define char_bits(obje) ((object)obje)->ch.ch_bits + +EXTER +union lispunion small_fixnum_table[2*SMALL_FIXNUM_LIMIT]; + +#define small_fixnum(i) \ + (object)(small_fixnum_table+SMALL_FIXNUM_LIMIT+(i)) + + + +#define address_int unsigned long + +/* + The struct of free lists. +*/ +struct freelist { + FIRSTWORD; + address_int f_link; +}; +#ifndef INT_TO_ADDRESS +#define INT_TO_ADDRESS(x) ((object )(long )x) +#endif + +#define F_LINK(x) ((struct freelist *)(long) x)->f_link +#define FL_LINK F_LINK +#define SET_LINK(x,val) F_LINK(x) = (address_int) (val) +#define OBJ_LINK(x) ((object) INT_TO_ADDRESS(F_LINK(x))) + +#define FREE (-1) /* free object */ + +/* + Type_of. +*/ +#define type_of(obje) ((enum type)(((object)(obje))->d.t)) + +/* + Storage manager for each type. +*/ +struct typemanager { + enum type + tm_type; /* type */ + short tm_size; /* element size in bytes */ + short tm_nppage; /* number per page */ + object tm_free; /* free list */ + /* Note that it is of type object. */ + long tm_nfree; /* number of free elements */ + long tm_nused; /* number of elements used */ + long tm_npage; /* number of pages */ + long tm_maxpage; /* maximum number of pages */ + char *tm_name; /* type name */ + int tm_gbccount; /* GBC count */ + object tm_alt_free; /* Alternate free list (swap with tm_free) */ + long tm_alt_nfree; /* Alternate nfree (length of nfree) */ + short tm_sgc; /* this type has at least this many + sgc pages */ + short tm_sgc_minfree; /* number free on a page to qualify for + being an sgc page */ + short tm_sgc_max; /* max on sgc pages */ + short tm_min_grow; /* min amount to grow when growing */ + short tm_max_grow; /* max amount to grow when growing */ + short tm_growth_percent; /* percent to increase maxpages */ + short tm_percent_free; /* percent which must be free after a gc for this type */ + short tm_distinct; /* pages of this type are distinct */ + float tm_adjgbccnt; + long tm_opt_maxpage; +}; + + +/* + The table of type managers. +*/ +EXTER struct typemanager tm_table[ 32 /* (int) t_relocatable */]; + +#define tm_of(t) (&(tm_table[(int)tm_table[(int)(t)].tm_type])) + +/* + Contiguous block header. +*/ +struct contblock { /* contiguous block header */ + int cb_size; /* size in bytes */ + struct contblock + *cb_link; /* contiguous block link */ +}; + +/* + The pointer to the contiguous blocks. +*/ +EXTER struct contblock *cb_pointer; /* contblock pointer */ + +/* SGC cont pages: After SGC_start, old_cb_pointer will be a linked + list of free blocks on non-SGC pages, and cb_pointer will be + likewise for SGC pages. CM 20030827*/ +EXTER struct contblock *old_cb_pointer; /* old contblock pointer when in SGC */ + +/* SGC cont pages: FIXME -- at some point, enable runtime disabling of + SGC cont pages. Right now, the tm_sgc variable for type contiguous + will govern only the possible attempt to get new pages for SGC. + Contiguous pages normally allocated when SGC is on will always be + marked with SGC_PAGE_FLAG, as the current GBC algorithm always uses + sgc_contblock_sweep_phase in this case. */ +/* #define SGC_CONT_ENABLED (sgc_enabled && tm_table[t_contiguous].tm_sgc) */ +#define SGC_CONT_ENABLED (sgc_enabled) + +/* + Variables for memory management. +*/ +EXTER long ncb; /* number of contblocks */ +/* int ncbpage; number of contblock pages */ +#define ncbpage tm_table[t_contiguous].tm_npage +#define maxcbpage tm_table[t_contiguous].tm_maxpage +#define cbgbccount tm_table[t_contiguous].tm_gbccount + + +/* int maxcbpage; maximum number of contblock pages */ +EXTER +long holepage; /* hole pages */ +#define nrbpage tm_table[t_relocatable].tm_npage +#define rbgbccount tm_table[t_relocatable].tm_gbccount +/* int nrbpage; number of relblock pages */ + + +EXTER +char *rb_start; /* relblock start */ +EXTER char *rb_end; /* relblock end */ +EXTER char *rb_limit; /* relblock limit */ +EXTER char *rb_pointer; /* relblock pointer */ +EXTER char *rb_start1; /* relblock start in copy space */ +EXTER char *rb_pointer1; /* relblock pointer in copy space */ + +EXTER char *heap_end; /* heap end */ +EXTER char *core_end; /* core end */ +EXTER +char *tmp_alloc; + +/* make f allocate enough extra, so that we can round + up, the address given to an even multiple. Special + case of size == 0 , in which case we just want an aligned + number in the address range + */ + +#define ALLOC_ALIGNED(f, size,align) \ + (align <= sizeof(plong) ? (char *)((f)(size)) : \ + (tmp_alloc = (char *)((f)(size+(size ?(align)-1 : 0)))+(align)-1 , \ + (char *)(align * (((unsigned long)tmp_alloc)/align)))) +#define AR_ALLOC(f,n,type) (type *) \ + (ALLOC_ALIGNED(f,(n)*sizeof(type),sizeof(type))) + + +/* FIXME Make all other page constants scale similarly by default. */ +#ifndef HOLEPAGE +#define HOLEPAGE (MAXPAGE/10) +#endif + + +/* #define INIT_HOLEPAGE 150 */ +/* #define INIT_NRBPAGE 50 */ +/* #define RB_GETA 512 */ + +#define INIT_HOLEPAGE (6*HOLEPAGE/5) +#define INIT_NRBPAGE (INIT_HOLEPAGE/3) +#define RB_GETA (10*INIT_NRBPAGE) + + +#ifdef AV +#define STATIC register +#endif +#ifdef MV + +#endif + +#define TIME_ZONE (-9) +/* EXTER */ +/* fixnum FIXtemp; */ + +/* For IEEEFLOAT, the double may have exponent in the second word +(little endian) or first word.*/ + +#if defined(I386) || defined(LITTLE_END) +#define HIND 1 /* (int) of double where the exponent and most signif is */ +#define LIND 0 /* low part of a double */ +#else /* big endian */ +#define HIND 0 +#define LIND 1 +#endif +#ifndef VOL +#define VOL +#endif + + +#define isUpper(xxx) (((xxx)&0200) == 0 && isupper((int)xxx)) +#define isLower(xxx) (((xxx)&0200) == 0 && islower((int)xxx)) +#define isDigit(xxx) (((xxx)&0200) == 0 && isdigit((int)xxx)) +enum ftype {f_object,f_fixnum}; +EXTER +char *alloca_val; +/* ...xx|xx|xxxx|xxxx| + ret Narg */ + +/* a9a8a7a6a5a4a3a4a3a2a1a0rrrrnnnnnnnn + ai=argtype(i) ret nargs + */ +#define SFUN_NARGS(x) (x & 0xff) /* 8 bits */ +#define RESTYPE(x) (x<<8) /* 3 bits */ + /* set if the VFUN_NARGS = m ; has been set correctly */ +#define VFUN_NARG_BIT (1 <<11) +#define ARGTYPE(i,x) ((x) <<(12+(i*2))) +#define ARGTYPE1(x) (1 | ARGTYPE(0,x)) +#define ARGTYPE2(x,y) (2 | ARGTYPE(0,x) | ARGTYPE(1,y)) +#define ARGTYPE3(x,y,z) (3 | ARGTYPE(0,x) | ARGTYPE(1,y) | ARGTYPE(2,z)) + +object make_si_sfun(); +EXTER object MVloc[10]; + +/* Set new to be an (object *) whose [i]'th elmt is the + ith elmnt in a va_list + if + ((vl[0] == va_arg(ap,object)) || + (vl[1] == va_arg(ap,object)) || .. vl[n-1] == va_arg(ap,object)) + you may set + #define DONT_COPY_VA_LIST + In recent versions of gcc, i think the builtin_alist stuff does not + allow setting this. + */ +#ifdef DONT_COPY_VA_LIST +#define COERCE_VA_LIST(new,vl,n) new = (object *) (vl) +#else +#define COERCE_VA_LIST(new,vl,n) \ + object Xxvl[65]; \ + {int i; \ + new=Xxvl; \ + if (n >= 65) FEerror("Too plong vl",0); \ + for (i=0 ; i < (n); i++) new[i]=va_arg(vl,object);} +#endif + +#ifdef DONT_COPY_VA_LIST +#error Cannot set DONT_COPY_VA_LIST in ANSI C +#else +#define COERCE_VA_LIST_NEW(new,fst,vl,n) \ + object Xxvl[65]; \ + {int i; \ + new=Xxvl; \ + if (n >= 65) FEerror("va_list too long",0); \ + for (i=0 ; i < (n); i++) new[i]=i ? va_arg(vl,object) : fst;} +#endif + + + +#define make_si_vfun(s,f,min,max) \ + make_si_vfun1(s,f,min | (max << 8)) + +/* Number of args supplied to a variable arg t_vfun + Used by the C function to set optionals */ + +struct call_data { + object fun; + int argd; + int nvalues; + object values[50]; + double double_return; +}; +EXTER struct call_data fcall; + +#define VFUN_NARGS fcall.argd +#define RETURN2(x,y) do{/* object _x = (void *) x; */\ + fcall.values[2]=y;fcall.nvalues=2; \ + return (x) ;} while(0) +#define RETURN1(x) do{fcall.nvalues=1; return (x) ;} while(0) +#define RETURN0 do{fcall.nvalues=0; return Cnil ;} while(0) + +#define RV(x) (*_p++ = x) + +#define RETURNI(n,val1,listvals) RETURN(n,int,val1,listvals) +#define RETURNO(n,val1,listvals) RETURN(n,object,val1,listvals) + +/* eg: RETURN(3,object,val1,(RV(val2),RV(val3))) */ +#define RETURN(n,typ,val1,listvals) \ + do{typ _val1 = val1; object *_p=&fcall.values[1]; listvals; fcall.nvalues= n; return _val1;}while(0) +/* #define CALL(n,form) (VFUN_NARGS=n,form) */ + + + +/* we sometimes have to touch the header of arrays or structures + to make sure the page is writable */ +#ifdef SGC +#define SGC_TOUCH(x) if ((x)->d.m) system_error(); (x)->d.m=0 +#else +#define SGC_TOUCH(x) +#endif + +object funcall_cfun(void(*)(),int,...); +object clear_compiler_properties(); +EXTER object sSlambda_block_expanded; + +# ifdef __GNUC__ +# define assert(ex)\ +{if (!(ex)){(void)fprintf(stderr, \ + "Assertion failed: file \"%s\", line %d\n", __FILE__, __LINE__);exit(1);}} +# else +# define assert(ex) +# endif + +#ifndef FIX_PATH_STRING +#define FIX_PATH_STRING(file) file +#endif + + +#define CHECK_INTERRUPT if (signals_pending) raise_pending_signals(sig_safe) + +#define BEGIN_NO_INTERRUPT \ + plong old_signals_allowed = signals_allowed; \ + signals_allowed = 0 + +#define END_NO_INTERRUPT \ + signals_allowed = old_signals_allowed +/* could add: if (signals_pending) + raise_pending_signals(sig_use_signals_allowed_value) */ + + +#define END_NO_INTERRUPT_SAFE \ + signals_allowed = old_signals_allowed; \ + if (signals_pending) \ + do{ if(signals_allowed ==0) /* should not get here*/abort(); \ + raise_pending_signals(sig_safe)}while(0) + +void raise_pending_signals(); + +EXTER unsigned plong signals_allowed, signals_pending ; + +EXTER struct symbol Dotnil_body; +#define Dotnil ((object)&Dotnil_body) + +#define endp(x) ({\ + static union lispunion s_my_dot={.c={t_cons,0,0,0,Dotnil,Dotnil}}; \ + object _x=(x);\ + bool _b=FALSE;\ + \ + if (type_of(_x)==t_cons) {\ + if (type_of(_x->c.c_cdr)!=t_cons && _x->c.c_cdr!=Cnil)\ + s_my_dot.c.c_car=_x->c.c_cdr;\ + else \ + s_my_dot.c.c_car=Dotnil;\ + } else {\ + if (_x==s_my_dot.c.c_car)\ + x=&s_my_dot;\ + else {\ + s_my_dot.c.c_car=Dotnil;\ + if (_x==Cnil || _x==Dotnil)\ + _b=TRUE;\ + else\ + FEwrong_type_argument(sLlist, _x);\ + }\ + }\ + _b;\ + }) + +#define endp_prop(a) (type_of(a)==t_cons ? FALSE : ((a)==Cnil ? TRUE : (FEwrong_type_argument(sLlist, (a)),FALSE))) + +#define proper_list(a) (type_of(a)==t_cons || (a)==Cnil) +#define fix_dot(a) ((a) == Dotnil ? Cnil : (type_of(a)==t_cons && (a)->c.c_cdr==Dotnil ? (a)->c.c_car : (a))) +/* + Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa + +This file is part of GNU Common Lisp, herein referred to as GCL + +GCL is free software; you can redistribute it and/or modify it under +the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with GCL; see the file COPYING. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/* + vs.h + + value stack +*/ + +EXTER object *vs_org; +EXTER object *vs_limit; /* value stack limit */ + +EXTER object *vs_base; /* value stack base */ +EXTER object *vs_top; /* value stack top */ + +#define vs_push(obje) (*vs_top++ = (obje)) + +#define vs_pop (*--vs_top) +#define vs_popp (--vs_top) +#define vs_head vs_top[-1] + +#define vs_mark object *old_vs_top = vs_top +#define vs_reset vs_top = old_vs_top + +#define vs_check if (vs_top >= vs_limit) \ + vs_overflow() + +#define vs_check_push(obje) \ + (vs_top >= vs_limit ? \ + (object)vs_overflow() : (*vs_top++ = (obje))) + +#define check_arg(n) \ + if (vs_top - vs_base != (n)) \ + check_arg_failed(n) + +#define CHECK_ARG_RANGE(n,m) if (VFUN_NARGS < n || VFUN_NARGS >m) \ + check_arg_range(n,m) + +#define MMcheck_arg(n) \ + if (vs_top - vs_base < (n)) \ + too_few_arguments(); \ + else if (vs_top - vs_base > (n)) \ + too_many_arguments() + +#define vs_reserve(x) if(vs_base+(x) >= vs_limit) \ + vs_overflow(); +/* + Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa + +This file is part of GNU Common Lisp, herein referred to as GCL + +GCL is free software; you can redistribute it and/or modify it under +the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with GCL; see the file COPYING. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/* + bds.h + + bind stack +*/ + +struct bds_bd { + object bds_sym; /* symbol */ + object bds_val; /* previous value of the symbol */ +}; + + +typedef struct bds_bd *bds_ptr; + +EXTER bds_ptr bds_org; + +EXTER bds_ptr bds_limit; + +EXTER bds_ptr bds_top; /* bind stack top */ + +#ifdef KCLOVM + +/* for multiprocessing */ +EXTER struct bds_bd save_bind_stack[BDSSIZE + BDSGETA + BDSGETA]; +EXTER bds_ptr bds_save_org; +EXTER bds_ptr bds_save_limit; +EXTER bds_ptr bds_save_top; + +#endif + +#define bds_check \ + if (bds_top >= bds_limit) \ + bds_overflow() + +/* do this so that an interrupt in the middle will leave the VALID + part of the bds stack ie (<= bds_top) in a valid state, so + that a throw out will be ok */ +#define bds_bind(sym, val) \ + do {bds_ptr _b = bds_top+1; \ + (_b)->bds_sym = (sym); \ + _b->bds_val = ((object)sym)->s.s_dbind; \ + ((object)sym)->s.s_dbind = (val); bds_top=_b;} while (0) + +#define bds_unwind1 \ + ((bds_top->bds_sym)->s.s_dbind = bds_top->bds_val, --bds_top) + + +/* + Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa + +This file is part of GNU Common Lisp, herein referred to as GCL + +GCL is free software; you can redistribute it and/or modify it under +the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with GCL; see the file COPYING. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/* + + frame.h + + frame stack and non-local jump +*/ + + +/* IHS Invocation History Stack */ + +typedef struct invocation_history { + object ihs_function; + object *ihs_base; +} *ihs_ptr; + +EXTER ihs_ptr ihs_org; + +EXTER ihs_ptr ihs_limit; + +EXTER ihs_ptr ihs_top; + +#define ihs_check \ + if (ihs_top >= ihs_limit) \ + ihs_overflow() + +#define ihs_push(function) \ + (++ihs_top)->ihs_function = (function); \ + ihs_top->ihs_base = vs_base +#define ihs_push_base(function,base) \ + (++ihs_top)->ihs_function = (function); \ + ihs_top->ihs_base = base + +#define ihs_pop() (ihs_top--) + + +#define make_nil_block() \ +{ \ + object x; \ + \ + lex_copy(); \ + x = alloc_frame_id(); \ + vs_push(x); \ + lex_block_bind(Cnil, x); \ + vs_popp; \ + frs_push(FRS_CATCH, x); \ +} + + +/* Frame Stack */ + +enum fr_class { + FRS_CATCH, /* for catch,block,tabbody */ + FRS_CATCHALL, /* for catchall */ + FRS_PROTECT /* for protect-all */ +}; + +EXTER int in_signal_handler; +struct frame { + jmp_buf frs_jmpbuf; + object *frs_lex; + bds_ptr frs_bds_top; + char frs_class; + char frs_in_signal_handler; + object frs_val; + ihs_ptr frs_ihs; +}; + +typedef struct frame *frame_ptr; + +#define alloc_frame_id() alloc_object(t_spice) + +/* +frs_class | frs_value | frs_prev +----------+--------------------------------------+-------------- +CATCH | frame-id, i.e. | + | throw-tag, | + | block-id (uninterned symbol), or | value of ihs_top + | tagbody-id (uninterned symbol) | when the frame +----------+--------------------------------------| was pushed +CATCHALL | NIL | +----------+--------------------------------------| +PROTECT | NIL | +---------------------------------------------------------------- +*/ + + +EXTER frame_ptr frs_org; + +EXTER frame_ptr frs_limit; + +EXTER frame_ptr frs_top; /* frame stack top */ + + +#define frs_push(class, val) \ + do { frame_ptr _frs_top = frs_top +1; \ + if (_frs_top >= frs_limit) \ + frs_overflow(); \ + _frs_top->frs_lex = lex_env;\ + _frs_top->frs_bds_top = bds_top; \ + _frs_top->frs_class = (class); \ + _frs_top->frs_in_signal_handler = in_signal_handler; \ + _frs_top->frs_val = (val); \ + _frs_top->frs_ihs = ihs_top; \ + frs_top=_frs_top; \ + setjmp(_frs_top->frs_jmpbuf); \ + } while (0) + +#define frs_pop() frs_top-- + + +/* global variables used during non-local jump */ + +EXTER bool nlj_active; /* true during non-local jump */ +EXTER frame_ptr nlj_fr; /* frame to return */ +EXTER object nlj_tag; /* throw-tag, block-id, or */ + /* (tagbody-id . label). */ + + +/* +(c) Copyright Taiichi Yuasa and Masami Hagiya, 1984. All rights reserved. +Copying of this file is authorized to users who have executed the true and +proper "License Agreement for Kyoto Common LISP" with SIGLISP. +*/ + +/* + + lex.h + + lexical environment +*/ + + +EXTER object *lex_env; + + + +/* + VS + | | + |---------------| +lex_env ------> | lex-var | : lex_env[0] + |---------------| + | lex-fd | : lex_env[1] + |---------------| + | lex-tag | : lex_env[2] + |---------------| + | | + | | + | | + + lex-var: (symbol value) ; for local binding + (.... or ....) + (symbol) ; for special binding + + lex-fd: (fun-name 'FUNCTION' function) + (.... or ...) + (macro-name 'MACRO' expansion-function) + + lex-tag: (tag 'TAG' frame-id) + (.... or ....) + (block-name 'BLOCK' frame-id) + +where 'FUN' is the LISP object with pname FUN, etc. + + +*/ + +#define lex_copy() ihs_top->ihs_base = vs_top; \ + vs_push(lex_env[0]); \ + vs_push(lex_env[1]); \ + vs_push(lex_env[2]); \ + lex_env = vs_top - 3 + +#define lex_new() ihs_top->ihs_base = vs_top; \ + lex_env = vs_top; \ + vs_top[0] = vs_top[1] = vs_top[2] = Cnil; \ + vs_top += 3 + +#define lex_var_sch(name) assoc_eq((name),lex_env[0]) + +#define lex_fd_sch(name) assoc_eq((name),lex_env[1]) + +/* + Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa + +This file is part of GNU Common Lisp, herein referred to as GCL + +GCL is free software; you can redistribute it and/or modify it under +the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with GCL; see the file COPYING. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/* + eval.h +*/ + + +/* C control stack */ + +#define CSSIZE 20000 +#define CSGETA 4000 + +EXTER int *cs_org; +EXTER int *cs_limit; + + +/* we catch the segmentation fault and check to warn of c stack overflow */ +#ifdef AV +#ifndef cs_check +#define cs_check(something) \ + if ((int *)(&something) < cs_limit) \ + cs_overflow() +#endif +#endif +#ifdef MV + + + +#endif + +/* bind template */ + +struct bind_temp { + object bt_var; + object bt_spp; + object bt_init; + object bt_aux; +}; + + +#define check_symbol(x) \ + if (type_of(x) != t_symbol) \ + not_a_symbol(x) + +#define check_var(x) \ + if (type_of(x) != t_symbol || \ + (enum stype)(x)->s.s_stype == stp_constant) \ + not_a_variable(x) + + +#define eval_assign(to, form) \ +{ \ + object *old_top = vs_top; \ + \ + eval(form); \ + to = vs_base[0]; \ + vs_top = old_top; \ +} + + +#define MMcall(x) \ + ihs_check; \ + ihs_push(x); \ + (*(x)->cf.cf_self)(); \ + ihs_pop() + +#define MMccall(x, env_top) \ + ihs_check; \ + ihs_push(x); \ + (*(x)->cc.cc_self)(env_top); \ + ihs_pop() + + +#define MMcons(a,d) make_cons((a),(d)) + + +#define MMcar(x) (x)->c.c_car +#define MMcdr(x) (x)->c.c_cdr +#define MMcaar(x) (x)->c.c_car->c.c_car +#define MMcadr(x) (x)->c.c_cdr->c.c_car +#define MMcdar(x) (x)->c.c_car->c.c_cdr +#define MMcddr(x) (x)->c.c_cdr->c.c_cdr +#define MMcaaar(x) (x)->c.c_car->c.c_car->c.c_car +#define MMcaadr(x) (x)->c.c_cdr->c.c_car->c.c_car +#define MMcadar(x) (x)->c.c_car->c.c_cdr->c.c_car +#define MMcaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car +#define MMcdaar(x) (x)->c.c_car->c.c_car->c.c_cdr +#define MMcdadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr +#define MMcddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr +#define MMcdddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr +#define MMcaaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_car +#define MMcaaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_car +#define MMcaadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_car +#define MMcaaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_car +#define MMcadaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_car +#define MMcadadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_car +#define MMcaddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_car +#define MMcadddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_car +#define MMcdaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_cdr +#define MMcdaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_cdr +#define MMcdadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_cdr +#define MMcdaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_cdr +#define MMcddaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_cdr +#define MMcddadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_cdr +#define MMcdddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_cdr +#define MMcddddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_cdr + + +#define MMnull(x) ((x)==Cnil) + + +/* the link_desc, is an INT which carries the call information + for all uses of that link. It tells whether fcall.nargs is + set before the call, whether the VFUN_FUN is set, (to pass in + a closure function) or if the number of values is set after the + call. It gives the min and max number of args and the result + type expected. It describes the arg types. + enum F_arg_flags + + +*/ + +/* +A link arg descriptor: + a6a5a4a3a2a1a0rrmmmmmmfffllllll + l = least number of args passed + m = max number of args passed + f = flags bits set according to F_arg_flags, There are F_end flag bits. + r = result type in F_arg_types + ai = i'th arg type in F_arg_types +*/ + +/* We allow 2 bits for encoding arg types and return type */ +#define F_TYPE_WIDTH 2 +#define F_MIN_ARGS(x) (x & MASK_RANGE(0,F_NARG_WIDTH)) +#define F_NARGS(x) F_MIN_ARGS(x) +#define F_ARG_FLAGS_P(x,flag) (x & (1 << (F_NARG_WIDTH + flag))) +#define F_ARG_FLAGS(x) ((x >> F_NARG_WIDTH) & MASK_RANGE(0,F_end)) +#define F_MAX_ARGS(x) ((x >> (F_NARG_WIDTH + F_end )) \ + & MASK_RANGE(0,F_NARG_WIDTH)) + +#define BITS_PER_CHAR 8 +#define MAX_ARGS 63 +#define F_TYPES(x) (((x) >> F_START_TYPES_POS ) \ + & MASK_RANGE(0, sizeof(int)*BITS_PER_CHAR - F_START_TYPES_POS)) +#define F_RESULT_TYPE(x) (F_TYPES(x) & MASK_RANGE(0,F_TYPE_WIDTH)) +#define F_ARG_LIMIT ((1<< F_NARG_WIDTH) -1) + +/* make an argd slot + where flags and argtypes are already set up as fields + */ +#define F_ARGD(min,max,flags, argtypes) \ + (min | ((flags | (max-min ? (1<=sizeof(fcall.values)/sizeof(*fcall.values) \ + FEerror("Too many function call values"); \ + else fcall.values[nvals++] = (x) +#define RETURN_VALS fcall.nvalues= nvals; return result;} 0 + +#define FUNCALL(n,form) (VFUN_NARGS=n,form) + +/* + Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa + +This file is part of GNU Common Lisp, herein referred to as GCL + +GCL is free software; you can redistribute it and/or modify it under +the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public +License for more details. + +You should have received a copy of the GNU Library General Public License +along with GCL; see the file COPYING. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ +#ifndef COM_LENG +#define COM_LENG +#endif + +/* alloc.c */ +char *alloc_page(); +object alloc_object(); +void *malloc(size_t); +void *realloc(void *,size_t); +/* void * memalign(size_t,size_t); */ +void *alloc_contblock(size_t); +void *alloc_relblock(size_t); +/* object fSallocate_contiguous_pages(); */ +/* object fSallocate_relocatable_pages(); */ + +/* array.c */ +/* enum aelttype Iarray_element_type(); */ +object fLrow_major_aref(); +object fSaset1(); +EXTER object sLarray_dimension_limit; +EXTER object sLarray_total_size_limit; +object fSmake_array1(); +/* object fSmake_vector1(); */ + +/* assignment.c */ +/* object setf(); */ + + + +/* backq.c */ +EXTER int backq_level; +EXTER object sLlistA; +EXTER object sLappend; +EXTER object sLnconc; + + +/* bds.c */ + +/* big.c */ +object make_integer_clear(); +object stretch_big(); +object copy_big(); +object copy_to_big(); +object big_minus(); +object big_plus(); +object big_times(); +object normalize_big_to_object(); +double big_to_double(); +EXTER struct bignum big_fixnum1_body,big_fixnum2_body; +EXTER object big_fixnum1,big_fixnum2; +object maybe_replace_big(); + + + + +/* bind.c */ +EXTER object ANDoptional; +EXTER object ANDrest; +EXTER object ANDkey; +EXTER object ANDallow_other_keys; +EXTER object ANDaux; +EXTER object sKallow_other_keys; +object find_special(); +object let_bind(); +object letA_bind(); + +/* block.c */ + +/* cfun.c */ +object make_cfun(); +object MF(); +/* object MM(); */ +/* object make_function_internal(); */ +/* object make_si_function_internal(); */ +/* object make_special_form_internal(); */ +object make_macro(); +object make_cclosure_new(); + +/* character.d */ +EXTER object STreturn; +EXTER object STspace; +EXTER object STrubout; +EXTER object STpage; +EXTER object STtab; +EXTER object STbackspace; +EXTER object STlinefeed; +EXTER object STnewline; +object coerce_to_character(); + +/* catch.c */ + +/* cmpaux.c */ +char object_to_char(); +char *object_to_string(); +float object_to_float(); +double object_to_double(); + +/* error.c */ +EXTER object sKerror; +EXTER object sKwrong_type_argument; +EXTER object sKcatch; +EXTER object sKprotect; +EXTER object sKcatchall; +EXTER object sKtoo_few_arguments; +EXTER object sKtoo_many_arguments; +EXTER object sKunexpected_keyword; +EXTER object sKinvalid_form; +EXTER object sKunbound_variable; +EXTER object sKinvalid_variable; +EXTER object sKundefined_function; +EXTER object sKinvalid_function; +EXTER object sKpackage_error; +object wrong_type_argument(); +EXTER object sSuniversal_error_handler; + +/* eval.c */ +EXTER object sLapply; +EXTER object sLfuncall; +object simple_lispcall(); +object simple_lispcall_no_event(); +object simple_symlispcall(); +object simple_symlispcall_no_event(); +EXTER object Vevalhook; +EXTER object Vapplyhook; +object ieval(); +object ifuncall(object,int,...); +object ifuncall1(); +object ifuncall2(); +object ifuncall3(); +object fcalln1(object,...); +#define fcalln ((object (*)())fcalln1) +object Ieval(); +object Imacro_expand1(); + +/* unixfasl.c fasload.c */ + +/* file.d */ +EXTER object sKabort; +EXTER object sKappend; +EXTER object sKcreate; +EXTER object sKdefault; +EXTER object sKdirection; +EXTER object sKelement_type; +EXTER object sKif_does_not_exist; +EXTER object sKif_exists; +EXTER object sKinput; +EXTER object sKio; +EXTER object sKnew_version; +EXTER object sKoutput; +EXTER object sKoverwrite; +EXTER object sKprint; +EXTER object sKprobe; +EXTER object sKrename; +EXTER object sKrename_and_delete; +EXTER object sKset_default_pathname; +EXTER object sKsupersede; +EXTER object sKverbose; + +EXTER object sLAstandard_inputA; +EXTER object sLAstandard_outputA; +EXTER object sLAerror_outputA; +EXTER object sLAquery_ioA; +EXTER object sLAdebug_ioA; +EXTER object sLAterminal_ioA; +EXTER object sLAtrace_outputA; +EXTER object terminal_io; +EXTER object standard_io; + +EXTER object sLAload_verboseA; +EXTER object FASL_string; +/* object stream_element_type(); */ +object open_stream(); +/* object make_two_way_stream(); */ +/* object make_echo_stream(); */ +object make_string_input_stream(); +object make_string_output_stream(); +/* object get_output_stream_string(); */ +object read_fasl_data(); + +#ifdef UNIX +/* unixfsys.c */ +FILE *backup_fopen(); +#else +/* filesystem.c */ +FILE *backup_fopen(); +#endif + +/* frame.c */ +frame_ptr frs_sch(); +frame_ptr frs_sch_catch(); + +/* gbc.c */ +EXTER bool GBC_enable; + +/* let.c */ + +/* lex.c */ +object assoc_eq(); +object lex_tag_sch(); +object lex_block_sch(); + +/* list.d */ +EXTER object sKtest; +EXTER object sKtest_not; +EXTER object sKkey; +EXTER object sKrev; +object car(); +object cdr(); +object kar(); +object kdr(); +object caar(); +object cadr(); +object cdar(); +object cddr(); +object caaar(); +object caadr(); +object cadar(); +object caddr(); +object cdaar(); +object cdadr(); +object cddar(); +object cdddr(); +object caaaar(); +object caaadr(); +object caadar(); +object caaddr(); +object cadaar(); +object cadadr(); +object caddar(); +object cadddr(); +object cdaaar(); +object cdaadr(); +object cdadar(); +object cdaddr(); +object cddaar(); +object cddadr(); +object cdddar(); +object cddddr(); +object nth(); +object nthcdr(); +object make_cons(); +object list(int,...); +object listA(int,...); +object append(); +object copy_list(); +object make_list(); +object nconc(); +object sublis1(); + +/* macros.c */ +EXTER object sLAmacroexpand_hookA; +EXTER object sSdefmacroA; +object macro_expand(); + +/* main.c */ +EXTER char* system_directory; +EXTER int ARGC; +EXTER char **ARGV; +void error(); +#ifdef UNIX +EXTER char **ENVP; +#endif +object vs_overflow(void); + +EXTER object sSAsystem_directoryA; +#ifdef UNIX +EXTER char *kcl_self; +#endif +#if !defined(IN_MAIN) || !defined(ATT) +EXTER bool initflag,raw_image; +#endif +char *merge_system_directory(); + + +EXTER object sLquote; + +EXTER object sLlambda; + +EXTER object sLlambda_block; +EXTER object sLlambda_closure; +EXTER object sLlambda_block_closure; + +EXTER object sLfunction; +EXTER object sLmacro; +EXTER object sLtag; +EXTER object sLblock; + + +/* mapfun.c */ + +/* multival.c */ + +/* number.c */ +EXTER object shortfloat_zero; +EXTER object longfloat_zero; +#define make_fixnum(a) ({fixnum _a=(a);((_a+SMALL_FIXNUM_LIMIT)&(-2*SMALL_FIXNUM_LIMIT))==0?small_fixnum(_a):make_fixnum1(_a);}) +object make_fixnum1(long); +object make_ratio(); +object make_shortfloat(); +object make_longfloat(); +object make_complex(); +double number_to_double(); +long fixint(object); +/* num_pred.c */ + +/* num_comp.c */ + +/* num_arith */ +object bignum2(); +object bignum3(); +/* object number_to_complex(); */ +object complex_plus(); +object number_plus(); +object number_negate(); +object number_minus(); +object number_times(); +object number_divide(); +object number_expt(); +object integer_divide1(); +object get_gcd(); +object get_lcm(); +object one_plus(); +object one_minus(); +object fixnum_add(); +object fixnum_sub(); +object new_bignum(); + +/* num_co.c */ +object double_to_integer(); + +/* num_log.c */ +object shift_integer(); + +/* package.d */ +EXTER object lisp_package; +EXTER object user_package; +#ifdef ANSI_COMMON_LISP +EXTER object common_lisp_package; +#endif +EXTER object keyword_package; +EXTER object system_package; +EXTER object sLApackageA; +EXTER object sKinternal; +EXTER object sKexternal; +EXTER object sKinherited; +EXTER object sKnicknames; +EXTER object sKuse; +EXTER int intern_flag; +EXTER object uninterned_list; +/* object make_package(); */ +/* object in_package(); */ +/* object rename_package(); */ +object find_package(); +/* object coerce_to_package(); */ +object current_package(); +object intern(); +object find_symbol(); + +/* pathname.d */ +EXTER object Vdefault_pathname_defaults; +EXTER object sKwild; +EXTER object sKnewest; +EXTER object sKstart; +EXTER object sKend; +EXTER object sKjunk_allowed; +EXTER object sKhost; +EXTER object sKdevice; +EXTER object sKdirectory; +EXTER object sKname; +EXTER object sKtype; +EXTER object sKversion; +EXTER object sKdefaults; +EXTER object sKroot; +EXTER object sKcurrent; +EXTER object sKparent; +EXTER object sKper; +/* object parse_namestring(); */ +object coerce_to_pathname(); +/* object default_device(); */ +object merge_pathnames(); +object namestring(); +object coerce_to_namestring(); + +/* prediate.c */ + +int eql(),equal(),eq(); + +/* print.d */ +EXTER object sKupcase; +EXTER object sKdowncase; +EXTER object sKcapitalize; +EXTER object sKstream; +EXTER object sKreadably; +EXTER object sKescape; +EXTER object sKpretty; +EXTER object sKcircle; +EXTER object sKbase; +EXTER object sKradix; +EXTER object sKcase; +EXTER object sKgensym; +EXTER object sKlevel; +EXTER object sKlength; +EXTER object sKarray; +EXTER object sLAprint_readablyA; +EXTER object sLAprint_escapeA; +EXTER object sLAprint_prettyA; +EXTER object sLAprint_circleA; +EXTER object sLAprint_baseA; +EXTER object sLAprint_radixA; +EXTER object sLAprint_caseA; +EXTER object sLAprint_gensymA; +EXTER object sLAprint_levelA; +EXTER object sLAprint_lengthA; +EXTER object sLAprint_arrayA; +EXTER object *PRINTvs_top; +EXTER object *PRINTvs_limit; +EXTER object PRINTstream; +EXTER bool PRINTreadably; +EXTER bool PRINTescape; +EXTER bool PRINTpretty; +EXTER bool PRINTcircle; +EXTER int PRINTbase; +EXTER bool PRINTradix; +EXTER object PRINTcase; +EXTER bool PRINTgensym; +EXTER int PRINTlevel; +EXTER int PRINTlength; +EXTER bool PRINTarray; +EXTER void (*write_ch_fun)(int); +object princ(); +object prin1(); +object print(); +object terpri(); +EXTER object sSpretty_print_format; +EXTER int line_length; + +/* Read.d */ +EXTER object standard_readtable; +EXTER object Vreadtable; +EXTER object sLAread_default_float_formatA; +EXTER object sLAread_baseA; +EXTER object sLAread_suppressA; +EXTER object READtable; +EXTER object read_byte1(); +EXTER int READdefault_float_format; +EXTER int READbase; +EXTER bool READsuppress; +EXTER object siSsharp_comma; +EXTER bool escape_flag; +EXTER object delimiting_char; +EXTER bool detect_eos_flag; +/* bool in_list_flag; */ +EXTER bool dot_flag; +EXTER bool preserving_whitespace_flag; +EXTER object default_dispatch_macro; +EXTER object big_register_0; +EXTER int sharp_eq_context_max; +object read_char(); +object read_char1(object,object); +object peek_char(); +/* object read_object_recursive(); */ +object read_object_non_recursive(); +object standard_read_object_non_recursive(); +object read_object(); +/* object parse_number(); */ +/* object parse_integer(); */ +/* object copy_readtable(); */ +/* object current_readtable(); */ +/* object patch_sharp(); */ +object read_fasl_vector(); + +/* fasdump.c */ +EXTER object sharing_table; + +/* reference.c */ +object symbol_function(); + + +/* sequence.d */ +object alloc_simple_vector(); +object alloc_simple_bitvector(); +object elt(); +object elt_set(); +object reverse(); +object nreverse(); + +/* structure.c */ +EXTER object sSs_data; +object structure_ref(); +object structure_set(); +object structure_to_list(); + +/* string.d */ +object alloc_simple_string(); +object make_simple_string(); +object copy_simple_string(); +object coerce_to_string(); +EXTER int string_sign, string_boundary; + +/* symbol.d */ +EXTER object string_register; +EXTER object gensym_prefix; +/* EXTER int gensym_counter; */ +EXTER object sLgensym_counter; +EXTER object gentemp_prefix; +EXTER int gentemp_counter; +EXTER object token; +object make_symbol(); +object make_ordinary(); +object make_special(); +object make_constant(); +object make_si_ordinary(); +object make_si_special(); +object make_si_constant(); +object make_keyword(); +object symbol_value(); +object symbol_name(); +object getf(); +object get(); +object putf(); +object putprop(); +object sputprop(); +object remprop(); +object gensym(); /* to be deleted */ + +#ifdef UNIX +/* unixsys.c */ +#else +/* sys.c */ +#endif + +#ifdef UNIX +/* unixtime.c */ +object unix_time_to_universal_time(); +#else +/* time.c */ +#endif + +/* toplevel.c */ +EXTER object sLspecial,sLdeclare; +EXTER object sSvariable_documentation; +EXTER object sSfunction_documentation; + +/* typespec.c */ +EXTER object sLcommon,sLnull,sLcons,sLlist,sLsymbol,sLarray,sLvector,sLbit_vector,sLstring; +EXTER object sLsequence,sLsimple_array,sLsimple_vector,sLsimple_bit_vector,sLsimple_string; +EXTER object sLcompiled_function,sLpathname,sLcharacter,sLnumber,sLrational,sLfloat,sLstring_char; +EXTER object sLinteger,sLratio,sLshort_float,sLstandard_char,sLfixnum,sLpositive_fixnum, sLcomplex; +EXTER object sLsingle_float,sLpackage,sLbignum,sLrandom_state,sLdouble_float,sLstream,sLbit,sLreadtable; +EXTER object sLlong_float,sLhash_table,sLstructure,sLboolean; + +#ifdef ANSI_COMMON_LISP +/* new ansi types */ +EXTER object sLarithmetic_error,sLbase_char,sLbase_string,sLbroadcast_stream,sLbuilt_in_class; +EXTER object sLcell_error,sLclass,sLconcatenated_stream,sLcondition,sLcontrol_error,sLdivision_by_zero; +EXTER object sLecho_stream,sLend_of_file,sLerror,sLextended_char,sLfile_error,sLfile_stream; +EXTER object sLfloating_point_inexact,sLfloating_point_invalid_operation,sLfloating_point_overflow; +EXTER object sLfloating_point_underflow,sLgeneric_function,sLlogical_pathname,sLmethod,sLpackage_error; +EXTER object sLparse_error,sLprint_not_readable,sLprogram_error,sLreader_error,sLserious_condition; +EXTER object sLsimple_base_string,sLsimple_condition,sLsimple_type_error,sLsimple_warning,sLstandard_class; +EXTER object sLstandard_generic_function,sLstandard_method,sLstandard_object,sLstorage_condition; +EXTER object sLstream_error,sLstring_stream,sLstructure_class,sLstyle_warning,sLsynonym_stream; +EXTER object sLtwo_way_stream,sLtype_error,sLunbound_slot,sLunbound_variable,sLundefined_function,sLwarning; +EXTER object sLmethod_combination,sLstructure_object; +#endif + +EXTER object sLsatisfies; +EXTER object sLmember; +EXTER object sLnot; +EXTER object sLor; +EXTER object sLand; +EXTER object sLvalues; +EXTER object sLmod; +EXTER object sLsigned_byte; +EXTER object sLunsigned_byte; +EXTER object sLsigned_char; +EXTER object sLunsigned_char; +EXTER object sLsigned_short; +EXTER object sLunsigned_short; +EXTER object sLA; +EXTER object sLplusp; +EXTER object TSor_symbol_string; +EXTER object TSor_string_symbol; +EXTER object TSor_symbol_string_package; +EXTER object TSnon_negative_integer; +EXTER object TSpositive_number; +EXTER object TSor_integer_float; +EXTER object TSor_rational_float; +#ifdef UNIX +EXTER object TSor_pathname_string_symbol; +#endif +EXTER object TSor_pathname_string_symbol_stream; + +EXTER int interrupt_flag; /* console interupt flag */ +EXTER int interrupt_enable; /* console interupt enable */ + +/* CMPtemp */ +EXTER object CMPtemp; +EXTER object CMPtemp1; +EXTER object CMPtemp2; +EXTER object CMPtemp3; + +EXTER object sLAlink_arrayA; + +/* nfunlink.c */ +object Icall_proc(); +float Icall_proc_float(); +/* object Icall_proc(); */ +float Icall_proc_float(); +object ImakeStructure(); +object list_vector(); +object list_vector_new(); +object Iapply_ap(); +object IisFboundp(); +object IapplyVector(); +object c_apply_n(); +EXTER object sSPmemory; +EXTER object sSPinit; +object sLfset(); +object MakeAfun(); +extern object Cstd_key_defaults[]; +extern object call_proc0(); +/* extern object call_proc(); */ +/* extern object call_vproc(); */ +object fLrow_major_aref(); +object Icheck_one_type(); + +/* utils.c */ +object Iis_fixnum(); +object Iapply_fun_n(object,int,int,...); +object Iapply_fun_n1(object (*)(),int,int,...); +object Iapply_fun_n2(object,int,int,...); +object Ifuncall_n(object,int,...); +object Ivs_values(); +object Icheck_one_type(); +object fSincorrect_type(); +EXTER object fLbye (fixnum exitc); +EXTER object fLquit (fixnum exitc); +EXTER object sSAno_initA; +EXTER object fLidentity (object x0); +EXTER object fSgcl_compile_time (void); +EXTER object fSldb1 (fixnum a,fixnum b, fixnum c); +EXTER object fLlisp_implementation_version (void); +EXTER object sSAlisp_maxpagesA; +EXTER object sSAsystem_directoryA; +EXTER object sSAmultiply_stacksA; +EXTER object sStop_level; +EXTER object sSAcommand_argsA; +EXTER object sSAafter_gbc_hookA; +EXTER object sSAignore_maximum_pagesA; +EXTER object sSAoptimize_maximum_pagesA; +EXTER object sSAnotify_optimize_maximum_pagesA; +EXTER object fSallocated (object typ); +EXTER object fSreset_number_used (object typ); +EXTER object fSstaticp (object x); +EXTER object fSallocate_sgc (object type,fixnum min,fixnum max,fixnum free_percent); +EXTER object fSallocate_growth (object type,fixnum min,fixnum max,fixnum percent,fixnum percent_free); +EXTER object fSallocate_contiguous_pages (fixnum npages,...); +EXTER object fSallocated_contiguous_pages (void); +EXTER object fSmaximum_contiguous_pages (void); +EXTER object fSallocate_relocatable_pages (fixnum npages,...); +EXTER object fSallocate (object type,fixnum npages,...); +EXTER object fSallocated_relocatable_pages (void); +EXTER object fSget_hole_size (void); +EXTER object fSset_hole_size (fixnum npages,...); +EXTER object fLgbc (object x0); +EXTER object sSAnotify_gbcA; +EXTER object sSAgbc_messageA; +EXTER object sLcommon; +EXTER object sLnull; +EXTER object sLcons; +EXTER object sLlist; +EXTER object sLsymbol; +EXTER object sLarray; +EXTER object sLvector; +EXTER object sLbit_vector; +EXTER object sLstring; +EXTER object sLsequence; +EXTER object sLsimple_array; +EXTER object sLsimple_vector; +EXTER object sLsimple_bit_vector; +EXTER object sLsimple_string; +EXTER object sLfunction; +EXTER object sLcompiled_function; +EXTER object sLpathname; +EXTER object sLcharacter; +EXTER object sLnumber; +EXTER object sLrational; +EXTER object sLfloat; +EXTER object sLstring_char; +EXTER object sLinteger; +EXTER object sLratio; +EXTER object sLshort_float; +EXTER object sLstandard_char; +EXTER object sLboolean; +EXTER object sLfixnum; +EXTER object sLpositive_fixnum; +EXTER object sLcomplex; +EXTER object sLsingle_float; +EXTER object sLpackage; +EXTER object sLbignum; +EXTER object sLrandom_state; +EXTER object sLdouble_float; +EXTER object sLstream; +EXTER object sLbit; +EXTER object sLreadtable; +EXTER object sLlong_float; +EXTER object sLhash_table; +EXTER object sLkeyword; +EXTER object sLstructure; +EXTER object sLsatisfies; +EXTER object sLmember; +EXTER object sLnot; +EXTER object sLor; +EXTER object sLand; +EXTER object sLvalues; +EXTER object sLmod; +EXTER object sLsigned_byte; +EXTER object sLunsigned_byte; +EXTER object sLsigned_char; +EXTER object sLunsigned_char; +EXTER object sLsigned_short; +EXTER object sLunsigned_short; +EXTER object sLA; +EXTER object sLplusp; +EXTER object sSchar_size; +EXTER object sSshort_size; +EXTER object fLfuncall (object fun,...); +EXTER object fLapply (object fun,...); +EXTER object fLeval (object x0); +EXTER object fLconstantp (object x0); +EXTER object sSlambda_block_expanded; +EXTER object sSAbreak_pointsA; +EXTER object sSAbreak_stepA; +EXTER object fLmacroexpand (object form,...); +EXTER object sLfuncall; +EXTER object sLAmacroexpand_hookA; +EXTER object sSdefmacroA; +EXTER object sSAinhibit_macro_specialA; +EXTER object fLnull (object x0); +EXTER object fLnot (object x0); +EXTER object fLsymbolp (object x0); +EXTER object fLatom (object x0); +EXTER object fLconsp (object x0); +EXTER object fLlistp (object x0); +EXTER object fLnumberp (object x0); +EXTER object fLintegerp (object x0); +EXTER object fLrationalp (object x0); +EXTER object fLrealp (object x0); +EXTER object fLfloatp (object x0); +EXTER object fLcomplexp (object x0); +EXTER object fLcharacterp (object x0); +EXTER object fLstringp (object x0); +EXTER object fLbit_vector_p (object x0); +EXTER object fLvectorp (object x0); +EXTER object fLsimple_string_p (object x0); +EXTER object fLsimple_bit_vector_p (object x0); +EXTER object fLsimple_vector_p (object x0); +EXTER object fLarrayp (object x0); +EXTER object fLpackagep (object x0); +EXTER object fLfunctionp (object x0); +EXTER object fLcompiled_function_p (object x0); +EXTER object fLcommonp (object x0); +EXTER object fLeq (object x0,object x1); +EXTER object fLeql (object x0,object x1); +EXTER object fLequal (object x0,object x1); +EXTER object fLequalp (object x0,object x1); +EXTER object fScontains_sharp_comma (object x0); +EXTER object fSspicep (object x0); +EXTER object fSfixnump (object x0); +EXTER object fLset (object symbol,object value); +EXTER object fSfset (object sym,object function); +EXTER object fLmakunbound (object sym); +EXTER object fLfmakunbound (object sym); +EXTER object sSclear_compiler_properties; +EXTER object fSclear_compiler_properties (object x0,object x1); +EXTER object sLaref; +EXTER object sLcar; +EXTER object sLcdr; +EXTER object sLchar; +EXTER object sLdecf; +EXTER object sLelt; +EXTER object sLfill_pointer; +EXTER object sLget; +EXTER object sLgetf; +EXTER object sLgethash; +EXTER object sLincf; +EXTER object sLpop; +EXTER object sLpush; +EXTER object sLschar; +EXTER object sLsetf; +EXTER object sSsetf_lambda; +EXTER object sSstructure_access; +EXTER object sLsvref; +EXTER object sStraced; +EXTER object sLvector; +EXTER object sKallow_other_keys; +EXTER object fSerror_set (volatile object x0); +EXTER object sLgensym_counter; +EXTER object fSmc (object name,object address); +EXTER object fSmfsfun (object name,object address,object argd); +EXTER object fSmfvfun (object name,object address,object argd); +EXTER object fSmfvfun_key (object symbol,object address,object argd,object keys); +EXTER object fSmf (object name,object addr); +EXTER object fSmm (object name,object addr); +EXTER object fScompiled_function_name (object fun); +EXTER object fSturbo_closure (object funobj); +EXTER object fSspecialp (object sym); +EXTER object sSdebug; +EXTER object fSdefvar1 (object sym,object val,...); +EXTER object fSdebug (object sym,object val); +EXTER object fSsetvv (object index,object val); +EXTER object sSPmemory; +EXTER object sSPinit; +EXTER object fSinit_cmp_anon (void); +EXTER object fSfind_init_name (object namestring); +EXTER object sKexternal; +EXTER object sKinherited; +EXTER object sKinternal; +EXTER object sKnicknames; +EXTER object sKuse; +EXTER object sLApackageA; +EXTER object fSset_gmp_allocate_relocatable (object flag); +EXTER object fSallocate_bigger_fixnum_range (fixnum min,fixnum max); +EXTER object fScmod (object num); +EXTER object fScplus (object x0,object x1); +EXTER object fSctimes (object x0,object x1); +EXTER object fScdifference (object x0,object x1); +EXTER object fLnth (fixnum index,object list); +EXTER object fLfirst (object x); +EXTER object fLsecond (object x); +EXTER object fLthird (object x); +EXTER object fLfourth (object x); +EXTER object fLfifth (object x); +EXTER object fLsixth (object x); +EXTER object fLseventh (object x); +EXTER object fLeighth (object x); +EXTER object fLninth (object x); +EXTER object fLtenth (object x); +EXTER object fSnext_hash_table_entry (object table,object ind); +EXTER object fLhash_table_test (object table); +EXTER object fLhash_table_size (object table); +EXTER object sLarray_rank_limit; +EXTER object sLarray_dimension_limit; +EXTER object sLarray_total_size_limit; +EXTER object sLbit; +EXTER object fLaref (object x,fixnum i, ...); +EXTER object fLsvref (object x,ufixnum i); +EXTER object fLrow_major_aref (object x,fixnum i); +EXTER object fSaset1 (object x, fixnum i,object val); +EXTER object fSaset (object x,object ii,object y, ...); +EXTER object fSsvset (object x,fixnum i,object val); +EXTER object fSmake_vector1 (fixnum n,fixnum elt_type,object staticp,...); +EXTER object fSget_aelttype (object x); +EXTER object fSmake_vector (object x0,object x1,object x2,object x3,object x4,object x5,object x6,...); +EXTER object fSmake_array1 (fixnum elt_type,object staticp,object initial_element,object displaced_to,fixnum displaced_index_offset, object dimensions); +EXTER object fScopy_array_portion (object x,object y,fixnum i1,fixnum i2,object n1o); +EXTER object fSfill_pointer_set (object x,fixnum i); +EXTER object fLfill_pointer (object x); +EXTER object fLarray_has_fill_pointer_p (object x); +EXTER object fLarray_element_type (object x); +EXTER object fLadjustable_array_p (object x); +EXTER object fSdisplaced_array_p (object x); +EXTER object fLarray_rank (object x); +EXTER object fLarray_dimension (object x,fixnum i); +EXTER object fSreplace_array (object old,object new); +EXTER object fLarray_total_size (object x); +EXTER object fSaset_by_cursor (object array,object val,object cursor); +EXTER object sSAmatch_dataA; +EXTER object sSAcase_fold_searchA; +EXTER object fSmatch_beginning (fixnum i); +EXTER object fSmatch_end (fixnum i); +EXTER object fScompile_regexp (object p); +EXTER object fSstring_match (object pattern,object string,...); +EXTER object sSs_data; +EXTER object sLcompile; +EXTER object sKcompile_toplevel; +EXTER object sLdeclare; +EXTER object sLeval; +EXTER object sKexecute; +EXTER object sSfunction_documentation; +EXTER object sLload; +EXTER object sKload_toplevel; +EXTER object sLprogn; +EXTER object sLtypep; +EXTER object sLvalues; +EXTER object sSvariable_documentation; +EXTER object sLwarn; +EXTER object sSAallow_gzipped_fileA; +EXTER object sSAcollect_binary_modulesA; +EXTER object sSAbinary_modulesA; +EXTER object sKmyaddr; +EXTER object sKmyport; +EXTER object sKasync; +EXTER object sKhost; +EXTER object sKserver; +EXTER object sKdaemon; +EXTER object sKpersistent; +EXTER object sSsocket; +EXTER object sLAstandard_inputA; +EXTER object sLAstandard_outputA; +EXTER object sLAerror_outputA; +EXTER object sLAterminal_ioA; +EXTER object sLAquery_ioA; +EXTER object sLAdebug_ioA; +EXTER object sLAtrace_outputA; +EXTER object sSAignore_eof_on_terminal_ioA; +EXTER object sSAload_pathnameA; +EXTER object sLAload_verboseA; +EXTER object sKabort; +EXTER object sKappend; +EXTER object sKcreate; +EXTER object sKdefault; +EXTER object sKdirection; +EXTER object sKelement_type; +EXTER object sKerror; +EXTER object sKif_does_not_exist; +EXTER object sKif_exists; +EXTER object sKinput; +EXTER object sKio; +EXTER object sKnew_version; +EXTER object sKoutput; +EXTER object sKoverwrite; +EXTER object sKprint; +EXTER object sKprobe; +EXTER object sKrename; +EXTER object sKrename_and_delete; +EXTER object sKset_default_pathname; +EXTER object sKsupersede; +EXTER object sKverbose; +EXTER object sLAread_default_float_formatA; +EXTER object sLAread_baseA; +EXTER object sLAread_suppressA; +EXTER object sSY; +EXTER object sSYB; +EXTER object sSYZ; +EXTER object sLlistA; +EXTER object sLappend; +EXTER object sLnconc; +EXTER object sLapply; +EXTER object sLvector; +EXTER object sKupcase; +EXTER object sKdowncase; +EXTER object sKcapitalize; +EXTER object sKstream; +EXTER object sKescape; +EXTER object sKreadably; +EXTER object sKpretty; +EXTER object sKcircle; +EXTER object sKbase; +EXTER object sKradix; +EXTER object sKcase; +EXTER object sKgensym; +EXTER object sKlevel; +EXTER object sKlength; +EXTER object sKarray; +EXTER object sLAprint_escapeA; +EXTER object sLAprint_readablyA; +EXTER object sLAprint_prettyA; +EXTER object sLAprint_circleA; +EXTER object sLAprint_baseA; +EXTER object sLAprint_radixA; +EXTER object sLAprint_caseA; +EXTER object sLAprint_gensymA; +EXTER object sLAprint_levelA; +EXTER object sLAprint_lengthA; +EXTER object sLAprint_arrayA; +EXTER object sSAprint_packageA; +EXTER object sSAprint_structureA; +EXTER object sSpretty_print_format; +EXTER object sSAprint_nansA; +EXTER object fLformat (object strm, object control,...); +EXTER object sSAindent_formatted_outputA; +EXTER object sKdirectory; +EXTER object sKlink; +EXTER object sKfile; +EXTER object fSstat (object path); +EXTER object fSsetenv (object variable,object value); +EXTER object fLdelete_file (object path); +EXTER object fLerror (object fmt_string,...); +EXTER object fLspecific_error (object error_name,object fmt_string,...); +EXTER object fLspecific_correctable_error (object error_name,object fmt_string,...); +EXTER object fLcerror (object continue_fmt_string,object fmt_string,...); +EXTER object fSihs_top (void); +EXTER object fSihs_fun (object x0); +EXTER object fSihs_vs (object x0); +EXTER object fSfrs_top (void); +EXTER object fSfrs_vs (object x0); +EXTER object fSfrs_bds (object x0); +EXTER object fSfrs_class (object x0); +EXTER object fSfrs_tag (object x0); +EXTER object fSfrs_ihs (object x0); +EXTER object fSbds_top (void); +EXTER object fSbds_var (object x0); +EXTER object fSbds_val (object x0); +EXTER object fSvs_top (void); +EXTER object fSvs (object x0); +EXTER object fSsch_frs_base (object x0,object x1); +EXTER object fSinternal_super_go (object tag,object x1,object x2); +EXTER object sSuniversal_error_handler; +EXTER object fSuniversal_error_handler (object x0,object x1,object x2,object x3,object error_fmt_string); +EXTER object sSterminal_interrupt; +EXTER object sKwrong_type_argument; +EXTER object sKtoo_few_arguments; +EXTER object sKtoo_many_arguments; +EXTER object sKunexpected_keyword; +EXTER object sKinvalid_form; +EXTER object sKunbound_variable; +EXTER object sKinvalid_variable; +EXTER object sKundefined_function; +EXTER object sKinvalid_function; +EXTER object sKpackage_error; +EXTER object sKcatch; +EXTER object sKprotect; +EXTER object sKcatchall; +EXTER object fLget_universal_time (void); +EXTER object fSgettimeofday (void); +EXTER object fLget_internal_real_time (void); +EXTER object sSAdefault_time_zoneA; +EXTER object fSgetpid (void); +EXTER object sSAload_with_freadA; +EXTER object fSuse_fast_links (object flag,...); +EXTER object sScdefn; +EXTER object sLAlink_arrayA; +EXTER object fSprofile (object start_address,object scale); +EXTER object fSfunction_start (object funobj); +EXTER object fSset_up_combined (object first,...); +EXTER object fSdisplay_profile (object start_addr,object scal); +EXTER object fSarray_adress (object array); +EXTER object sSAprofile_arrayA; +EXTER object sSAinterrupt_enableA; +EXTER object sSsigusr1_interrupt; +EXTER object sSsigio_interrupt; +EXTER object sSsignal_safety_required (fixnum signo,fixnum safety); +EXTER object fSallow_signal (fixnum n); +EXTER object fSinitfun (object sym,object addr_ind,object argd,...); +EXTER object fSinitmacro (object first,...); +EXTER object fSset_key_struct (object key_struct_ind); +EXTER object fSinvoke (object x); +EXTER object fSopen_named_socket (fixnum port); +EXTER object fSclose_fd (fixnum fd); +EXTER object fSclose_sfd (object sfd); +EXTER object fSaccept_socket_connection (object named_socket); +EXTER object fShostname_to_hostid (object host); +EXTER object fSgethostname (void); +EXTER object fShostid_to_hostname (object host_id); +EXTER object fScheck_fd_for_input (fixnum fd,fixnum timeout); +EXTER object fSclear_connection (fixnum fd); +EXTER object fSconnection_state_fd (object sfd); +EXTER object fSour_write (object sfd,object buffer,fixnum nbytes); +EXTER object fSour_read_with_offset (object fd,object buffer,fixnum offset,fixnum nbytes,fixnum timeout); +EXTER object fSprint_to_string1 (object str,object x,object the_code); +EXTER object fSset_sigio_for_fd (fixnum fd); +EXTER object fSreset_string_input_stream (object strm,object string,fixnum start,fixnum end); +EXTER object fScheck_state_input (object osfd,fixnum timeout); +EXTER object fSclear_connection_state (object osfd); +EXTER object fSgetpeername (object sock); +EXTER object fSgetsockname (object sock); +EXTER object fSset_blocking (object sock,object setBlocking); +EXTER object sSAreadline_prefixA; +/* if already mp.h has been included skip */ +#ifdef GMP +#define save_avma +#define restore_avma +#endif + +#ifdef _MP_H +#ifdef GMP + +#else /* no gmp */ + +typedef plong *GEN1; +/* if genpari.h not loaded */ +#ifndef MAXBLOC +typedef plong *GEN; +GEN1 addii(),mulii(),mulsi(),powerii(),shifti(),stoi(),dvmdii(),subii(); +int cmpii(); +plong itos(); +#define signe(x) (((GEN1)(x))[1]>>24) +#define lg(x) (((GEN1)(x))[0]&0xffff) +#define setlg(x,s) (((GEN1)(x))[0]=(((GEN1)(x))[0]&0xffff0000)+s) +#define lgef(x) (((GEN1)(x))[1]&0xffff) +#define setlgef(x,s) (((GEN1)(x))[1]=(((GEN1)(x))[1]&0xffff0000)+s) + +#define our_ulong unsigned plong +#endif /* end MAXBLOC */ + + +EXTER int in_saved_avma ; +EXTER unsigned plong avma; +EXTER GEN1 gzero; +EXTER GEN1 icopy_x; +/* #define DEBUG_AVMA */ + +#ifdef DEBUG_AVMA +#define save_avma long lvma = (in_saved_avma = 1, avma) +#define restore_avma avma = (in_saved_avma = 0, lvma) +#else +#define save_avma long lvma = avma +#define restore_avma avma = lvma +#endif + +#endif /* NO GMP */ +#endif /* _MP_H */ + + /* copy x to y, increasing space by factor of 2 */ +object make_integer(); + +#define Mcar(x) (x)->c.c_car +#define Mcdr(x) (x)->c.c_cdr +#define Mcaar(x) (x)->c.c_car->c.c_car +#define Mcadr(x) (x)->c.c_cdr->c.c_car +#define Mcdar(x) (x)->c.c_car->c.c_cdr +#define Mcddr(x) (x)->c.c_cdr->c.c_cdr +#define Mcaaar(x) (x)->c.c_car->c.c_car->c.c_car +#define Mcaadr(x) (x)->c.c_cdr->c.c_car->c.c_car +#define Mcadar(x) (x)->c.c_car->c.c_cdr->c.c_car +#define Mcaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car +#define Mcdaar(x) (x)->c.c_car->c.c_car->c.c_cdr +#define Mcdadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr +#define Mcddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr +#define Mcdddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr +#define Mcaaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_car +#define Mcaaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_car +#define Mcaadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_car +#define Mcaaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_car +#define Mcadaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_car +#define Mcadadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_car +#define Mcaddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_car +#define Mcadddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_car +#define Mcdaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_cdr +#define Mcdaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_cdr +#define Mcdadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_cdr +#define Mcdaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_cdr +#define Mcddaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_cdr +#define Mcddadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_cdr +#define Mcdddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_cdr +#define Mcddddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_cdr + +/* for cmp */ + +#define CMPcar(x) (x)->c.c_car +#define CMPcdr(x) (x)->c.c_cdr +#define CMPcaar(x) (x)->c.c_car->c.c_car +#define CMPcadr(x) (x)->c.c_cdr->c.c_car +#define CMPcdar(x) (x)->c.c_car->c.c_cdr +#define CMPcddr(x) (x)->c.c_cdr->c.c_cdr +#define CMPcaaar(x) (x)->c.c_car->c.c_car->c.c_car +#define CMPcaadr(x) (x)->c.c_cdr->c.c_car->c.c_car +#define CMPcadar(x) (x)->c.c_car->c.c_cdr->c.c_car +#define CMPcaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car +#define CMPcdaar(x) (x)->c.c_car->c.c_car->c.c_cdr +#define CMPcdadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr +#define CMPcddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr +#define CMPcdddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr +#define CMPcaaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_car +#define CMPcaaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_car +#define CMPcaadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_car +#define CMPcaaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_car +#define CMPcadaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_car +#define CMPcadadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_car +#define CMPcaddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_car +#define CMPcadddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_car +#define CMPcdaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_cdr +#define CMPcdaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_cdr +#define CMPcdadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_cdr +#define CMPcdaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_cdr +#define CMPcddaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_cdr +#define CMPcddadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_cdr +#define CMPcdddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_cdr +#define CMPcddddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_cdr +#define CMPfuncall funcall +#define Creturn(v) return((vs_top=vs,(v))) +/* end for cmp*/ + +/* 2^6 is the limit on the number of args */ +#define F_NARG_WIDTH 6 +#define F_START_TYPES_POS (2* F_NARG_WIDTH + F_end ) +enum F_arg_flags +{ F_requires_nargs, /* if set, then caller must store VFUN_NARGS with number + of args passed. F_ARGD is used to set up the argd, + and it sets this if minargs < maxargs. */ + F_caller_sets_one_val, /* If set, then the CALLER will look after setting the + fcall.nvalues to 1, if necessary (eg the call is at the + end of a function, or if multiple-values-list invokes + the function.) If foo is proclaimed to return exactly + one value, then the CALLER might set this flag in the + link argd, or it might do it in the case we have (setq + x (foo)) or (values (foo)). + + If this flag is not set, then the CALLED function is + responsible for setting the number of values in + fcall.nvalues, and also for always returning as C value + Cnil, in the case that it sets fcall.nvalues == 0. */ + F_requires_fun_passed, /* if set, the caller must set VFUN_FUN to the + calling function. This is used by closures, but + could be used by other things i suppose. */ + F_end /* 1 bigger than the largest flag */ + }; +enum F_arg_types +{ F_object, + F_int, + F_double_ptr, + F_shortfloat + }; + +/* Make a mask for bits i < j, masking j-i bits */ +#define MASK_RANGE(i,j) ((~(~0 << (j-i)))<< i) + +#define F_PLAIN(x) (((x) & MASK_RANGE( F_START_TYPES_POS,31)) == 0) +#define ARG_LIMIT 63 + +EXTER object MVloc[10]; + +#define TYPEP(x,t) (type_of(x) == (t)) + + +#ifdef HAVE_ALLOCA +/* #ifndef alloca */ +/* char *alloca(); */ +/* #endif */ +#include +EXTER char *alloca_val; +#define OUR_ALLOCA(n) alloca(n) +#define ALLOCA_FREE(n) + +#define ALLOCA_CONS(n) (alloca_val=alloca((n)*sizeof(struct cons))) +#define ON_STACK_CONS(x,y) (alloca_val=alloca(sizeof(struct cons)), on_stack_cons(x,y)) +#define ON_STACK_LIST on_stack_list +#define ON_STACK_LIST_VECTOR on_stack_list_vector +#define ON_STACK_LIST_VECTOR_NEW on_stack_list_vector_new +#define ON_STACK_MAKE_LIST on_stack_make_list +object on_stack_cons(); +object on_stack_list(int,...); +/* object on_stack_list_vector(int,va_list); */ +object on_stack_list_vector_new(int,object,va_list); +object on_stack_make_list(); +#else /* no HAVE_ALLOCA */ +#define OUR_ALLOCA(n) malloc(n) +#define ALLOCA_FREE(n) free(n) +#define ALLOCA_CONS(n) 0 +#define ON_STACK_CONS(x,y) MMcons(x,y) +#define ON_STACK_LIST list +#define ON_STACK_LIST_VECTOR list_vector +#define ON_STACK_MAKE_LIST make_list +#endif +#ifndef KEYTYPE +#define KEYTYPE void * +#endif + + + +#define Scons sLcons +#define aref1 fLrow_major_aref +#define aref fLrow_major_aref +/* #define aset1 fSaset1 */ +#define aset aset1 +#define siSPinit sSPinit +#define siSPmemory sSPmemory +#define siSdefmacroA sSdefmacroA +#define siSfunction_documentation sSfunction_documentation +#define siSlambda_block_expanded sSlambda_block_expanded +#define siSpretty_print_format sSpretty_print_format +#define IdoInit(x,y) do_init(y) +/* #define siSsharp_comma */ +#define siSvariable_documentation sSvariable_documentation + + +#define EQ(x,y) ((x)==(y)) + +#define CMPmake_fixnum(x) make_fixnum(x) + +object make_integer(); + /* copy x to y, increasing space by factor of 2 */ + +#ifndef GMP +GEN otoi(); +/* +object integ_temp; +#define otoi(x) (integ_temp = (x) , (type_of(integ_temp) == t_bignum \ + ? MP(integ_temp) :stoi(fix(integ_temp)))) +*/ +#define ISETQ_FIX(a,b,c) isetq_fix(a,c) +void isetq_fix(); +#ifdef HAVE_ALLOCA +#define SETQ_II(var,alloc,val) \ + do{GEN _xx =(val) ; \ + int _n = replace_copy1(_xx,var); \ + if(_n) var = replace_copy2(_xx,alloca(_n));}while(0) + +#define SETQ_IO(var,alloc,val) {object _xx =(val) ; \ + int _n = obj_replace_copy1(_xx,var); \ + if(_n) var = obj_replace_copy2(_xx,alloca(_n));} +#define IDECL(a,b,c) our_ulong b[4];a =(b[0]=0x1010000 +4,b) ; object c +#else +GEN setq_io(),setq_ii(); +#define SETQ_IO(x,alloc,val) (x)=setq_io(x,&alloc,val) +#define SETQ_II(x,alloc,val) (x)=setq_ii(x,&alloc,val) +#define IDECL(a,b,c) our_ulong b[4];a =(b[0]=0x1010000 +4,b);object c +#endif + +#else + +typedef MP_INT * GEN; + +int obj_to_mpz(object,MP_INT *); +int obj_to_mpz1(object,MP_INT *,void *); +int mpz_to_mpz(MP_INT *,MP_INT *); +int mpz_to_mpz1(MP_INT *,MP_INT *,void *); +void isetq_fix(MP_INT *,int); +MP_INT * otoi(object x); + +#ifndef HAVE_ALLOCA +#error Need alloca for GMP +#endif + +/* Add fourth argument af to the SETQ macros to allow for malloc allocation */ +/* inside setjmp frames, and faster alloca allocation otherwise.*/ +/* FIXME, verify that IDECL need not be changed, improve logic behind malloc */ +/* selection, e.g. closure boundaries. CM 20031201*/ +#define IDECL(a,b,c) mp_limb_t *c=(mp_limb_t *)alloca(1*sizeof(mp_limb_t));MP_INT b={1,1,c}; a = &b +#define SETQ_IO(var,alloc,val,af) { object _xx = (val); \ + int _n; \ + if ((_n=obj_to_mpz(_xx,(var)))) {\ + obj_to_mpz1(_xx,(var),af(_n));}} +#define SETQ_II(var,alloc,val,af) { MP_INT * _xx = (val); \ + int _n; \ + if ((_n=mpz_to_mpz(_xx,(var)))) {\ + mpz_to_mpz1(_xx,(var),af(_n));}} +#define ISETQ_FIX(a,b,c) isetq_fix(a,c) + + +/* #define IDECL(a,b,c) MP_INT b; a = (mpz_init(&b),&b) ; object c */ +/* #define SETQ_IO(var,alloc,val) { object _xx = (val); \ */ +/* obj_to_mpz(_xx,(var));} */ +/* #define SETQ_II(var,alloc,val) { MP_INT * _xx = (val); \ */ +/* mpz_to_mpz(_xx,(var));} */ +/* #define ISETQ_FIX(a,b,c) isetq_fix(a,c) */ + + +#endif /* end no GMP */ + +#define cclosure_call funcall + +#ifndef _REGEXP +#define _REGEXP 1 + +#define NSUBEXP 10 +typedef struct regexp { + char *startp[NSUBEXP]; + char *endp[NSUBEXP]; + char regstart; /* Internal use only. */ + char reganch; /* Internal use only. */ + char *regmust; /* Internal use only. */ + int regmlen; /* Internal use only. */ + unsigned char regmaybe_boyer; + char program[1]; /* Unwarranted chumminess with compiler. */ +} regexp; + +#if __STDC__ == 1 +#define _ANSI_ARGS_(x) x +#else +#define _ANSI_ARGS_(x) () +#endif + +/* extern regexp *regcomp _ANSI_ARGS_((char *exp)); */ +/* extern int regexec _ANSI_ARGS_((regexp *prog, char *string, char *start,int length )); */ +extern void regsub _ANSI_ARGS_((regexp *prog, char *source, char *dest)); +#ifndef regerror +extern void regerror _ANSI_ARGS_((char *msg)); +#endif + +#endif /* REGEXP */ +/* alloc.c:89:OF */ extern char *alloc_page (long n); /* (n) int n; */ +/* alloc.c:149:OF */ extern void add_page_to_freelist (char *p, struct typemanager *tm); /* (p, tm) char *p; struct typemanager *tm; */ +/* alloc.c:196:OF */ extern object type_name (int t); /* (t) int t; */ +/* alloc.c:213:OF */ extern object alloc_object (enum type t); /* (t) enum type t; */ +/* alloc.c:296:OF */ extern object make_cons (object a, object d); /* (a, d) object a; object d; */ +/* alloc.c:364:OF */ extern object on_stack_cons (object x, object y); /* (x, y) object x; object y; */ +/* alloc.c:376:OF */ extern object fSallocated (object typ); /* (typ) object typ; */ +/* alloc.c:401:OF */ extern object fSreset_number_used (object typ); /* (typ) object typ; */ +/* alloc.c:480:OF */ extern void insert_contblock (char *p, int s); /* (p, s) char *p; int s; */ +/* alloc.c:480:OF */ extern void insert_maybe_sgc_contblock (char *p, int s); /* (p, s) char *p; int s; */ +/* alloc.c:611:OF */ extern void set_maxpage (void); /* () */ +/* alloc.c:635:OF */ extern void gcl_init_alloc (void); /* () */ +/* alloc.c:737:OF */ extern object fSstaticp (object x); /* (x) object x; */ +/* alloc.c:822:OF */ extern object fSallocate_sgc (object type,fixnum min,fixnum max,fixnum free_percent); /* (type, min, max, free_percent) object type; int min; int max; int free_percent; */ +/* alloc.c:846:OF */ extern object fSallocate_growth (object type,fixnum min,fixnum max,fixnum percent,fixnum percent_free); /* (type, min, max, percent, percent_free) object type; int min; int max; int percent; int percent_free; */ +/* alloc.c:911:OF */ extern object fSallocated_contiguous_pages (void); /* () */ +/* alloc.c:918:OF */ extern object fSmaximum_contiguous_pages (void); /* () */ +/* alloc.c:958:OF */ extern object fSallocated_relocatable_pages (void); /* () */ +/* alloc.c:965:OF */ extern object fSget_hole_size (void); /* () */ +/* alloc.c:1000:OF */ extern void gcl_init_alloc_function (void); /* () */ +/* alloc.c:1126:OF */ extern void free (void *ptr); /* (ptr) void *ptr; */ +/* array.c:57:OF */ extern void Laref (void); /* () */ +/* array.c:126:OF */ extern object fLsvref (object x, ufixnum i); /* (x, i) object x; unsigned int i; */ +/* array.c:142:OF */ extern object fLrow_major_aref (object x,fixnum i); /* (x, i) object x; int i; */ +/* array.c:190:OF */ extern object fSaset1 (object x,fixnum i, object val); /* (x, i, val) object x; int i; object val; */ +/* array.c:262:OF */ extern void siLaset (void); /* () */ +/* array.c:321:OF */ extern void siLsvset (void); /* () */ +/* array.c:324:OF */ extern object fSsvset (object x,fixnum i, object val); /* (x, i, val) object x; int i; object val; */ +/* array.c:461:OF */ extern object fSget_aelttype (object x); /* (x) object x; */ +/* array.c:480:OF */ extern void siLmake_vector (void); /* () */ +/* array.c:519:OF */ extern object fSmake_array1 (fixnum elt_type, object staticp, object initial_element, object displaced_to,fixnum displaced_index_offset, object dimensions); /* (elt_type, staticp, initial_element, displaced_to, displaced_index_offset, dimensions) int elt_type; object staticp; object initial_element; object displaced_to; int displaced_index_offset; object dimensions; */ +/* array.c::OF */ extern object fSmake_vector1_1 (fixnum n,fixnum elt_type,object staticp); +/* array.c:738:OF */ extern void adjust_displaced (object x, long diff); /* (x, diff) object x; int diff; */ +/* array.c:790:OF */ extern void gset (void *p1, void *val, int n, int typ); /* (p1, val, n, typ) char *p1; char *val; int n; int typ; */ +/* array.c:831:OF */ extern object fScopy_array_portion (object x, object y,fixnum i1,fixnum i2, object n1); /* (x, y, i1, i2, n1) object x; object y; int i1; int i2; int n1; */ +/* array.c:879:OF */ extern void array_allocself (object x, int staticp, object dflt); /* (x, staticp, dflt) object x; int staticp; object dflt; */ +/* array.c:920:OF */ extern void siLfill_pointer_set (void); /* () */ +/* array.c:923:OF */ extern object fSfill_pointer_set (object x,fixnum i); /* (x, i) object x; int i; */ +/* array.c:944:OF */ extern void Lfill_pointer (void); /* () */ +/* array.c:947:OF */ extern object fLfill_pointer (object x); /* (x) object x; */ +/* array.c:965:OF */ extern object fLarray_has_fill_pointer_p (object x); /* (x) object x; */ +/* array.c:986:OF */ extern void Larray_element_type (void); /* () */ +/* array.c:989:OF */ extern object fLarray_element_type (object x); /* (x) object x; */ +/* array.c:995:OF */ extern void Ladjustable_array_p (void); /* () */ +/* array.c:998:OF */ extern object fLadjustable_array_p (object x); /* (x) object x; */ +/* array.c:1002:OF */ extern void siLdisplaced_array_p (void); /* () */ +/* array.c:1005:OF */ extern object fSdisplaced_array_p (object x); /* (x) object x; */ +/* array.c:1010:OF */ extern void Larray_rank (void); /* () */ +/* array.c:1013:OF */ extern object fLarray_rank (object x); /* (x) object x; */ +/* array.c:1020:OF */ extern void Larray_dimension (void); /* () */ +/* array.c:1023:OF */ extern object fLarray_dimension (object x,fixnum i); /* (x, i) object x; int i; */ +/* array.c:1090:OF */ extern void siLreplace_array (void); /* () */ +/* array.c:1093:OF */ extern object fSreplace_array (object old, object new); /* (old, new) object old; object new; */ +/* array.c:1132:OF */ extern object fLarray_total_size (object x); /* (x) object x; */ +/* array.c:1140:OF */ extern object fSaset_by_cursor (object array, object val, object cursor); /* (array, val, cursor) object array; object val; object cursor; */ +/* array.c:1160:OF */ extern void gcl_init_array_function (void); /* () */ +/* assignment.c:62:OF */ extern void setq (object sym, object val); /* (sym, val) object sym; object val; */ +/* assignment.c:128:OF */ extern void Lset (void); /* () */ +/* assignment.c:130:OF */ extern object fLset (object symbol, object value); /* (symbol, value) object symbol; object value; */ +/* assignment.c:142:OF */ extern void siLfset (void); /* () */ +/* assignment.c:144:OF */ extern object fSfset (object sym, object function); /* (sym, function) object sym; object function; */ +/* assignment.c:214:OF */ extern object fLmakunbound (object sym); /* (sym) object sym; */ +/* assignment.c:228:OF */ extern void Lfmakunbound (void); /* () */ +/* assignment.c:230:OF */ extern object fLfmakunbound (object sym); /* (sym) object sym; */ +/* assignment.c:547:OF */ extern object clear_compiler_properties (object sym, object code); /* (sym, code) object sym; object code; */ +/* assignment.c:563:OF */ extern object fSclear_compiler_properties (object x0, object x1); /* (x0, x1) object x0; object x1; */ +/* assignment.c:591:OF */ extern void gcl_init_assignment (void); /* () */ +/* backq.c:259:OF */ extern int backq_car (object x); /* (x) object x; */ +/* backq.c:381:OF */ extern void gcl_init_backq (void); /* () */ +/* bds.c:31:OF */ extern void bds_unwind (bds_ptr new_bds_top); /* (new_bds_top) bds_ptr new_bds_top; */ +/* big.c:53:OF */ extern object fSset_gmp_allocate_relocatable (object flag); /* (flag) object flag; */ +/* gmp_big.c:96:OF */ extern void gcl_init_big1 (void); /* () */ +/* gmp_big.c:108:OF */ extern object new_bignum (void); /* () */ +/* gmp_big.c:161:OF */ extern object make_integer (__mpz_struct *u); /* (u) __mpz_struct *u; */ +/* gmp_big.c:207:OF */ extern int big_compare (object x, object y); /* (x, y) object x; object y; */ +/* gmp_big.c:214:OF */ extern object normalize_big_to_object (object x); /* (x) object x; */ +/* gmp_big.c:230:OF */ extern void add_int_big (int i, object x); /* (i, x) int i; object x; */ +/* gmp_big.c:244:OF */ extern void mul_int_big (int i, object x); /* (i, x) int i; object x; */ +/* gmp_big.c:289:OF */ extern object normalize_big (object x); /* (x) object x; */ +/* gmp_big.c:302:OF */ extern object big_minus (object x); /* (x) object x; */ +/* gmp_big.c:324:OF */ extern double big_to_double (object x); /* (x) object x; */ +/* gmp_big.c:454:OF */ extern object maybe_replace_big (object x); /* (x) object x; */ +/* gmp_big.c:472:OF */ extern object bignum2 (unsigned int h, unsigned int l); /* (h, l) unsigned int h; unsigned int l; */ +/* gmp_big.c:482:OF */ extern void integer_quotient_remainder_1 (object x, object y, object *qp, object *rp); /* (x, y, qp, rp) object x; object y; object *qp; object *rp; */ +/* gmp_big.c:502:OF */ extern object coerce_big_to_string (object x, int printbase); /* (x, printbase) object x; int printbase; */ +/* gmp_big.c:521:OF */ extern void gcl_init_big (void); /* () */ +/* big.c:72:OF */ extern int big_sign (object x); /* (x) object x; */ +/* big.c:78:OF */ extern void set_big_sign (object x, int sign); /* (x, sign) object x; int sign; */ +/* big.c:85:OF */ extern void zero_big (object x); /* (x) object x; */ +/* bind.c:74:OF */ extern void lambda_bind (object *arg_top); /* (arg_top) object *arg_top; */ +/* bind.c:564:OF */ extern void bind_var (object var, object val, object spp); /* (var, val, spp) object var; object val; object spp; */ +/* bind.c:610:OF */ extern object find_special (object body, struct bind_temp *start, struct bind_temp *end); /* (body, start, end) object body; struct bind_temp *start; struct bind_temp *end; */ +/* bind.c:670:OF */ extern object let_bind (object body, struct bind_temp *start, struct bind_temp *end); /* (body, start, end) object body; struct bind_temp *start; struct bind_temp *end; */ +/* bind.c:688:OF */ extern object letA_bind (object body, struct bind_temp *start, struct bind_temp *end); /* (body, start, end) object body; struct bind_temp *start; struct bind_temp *end; */ +/* bind.c:712:OF */ extern void parse_key (object *base, bool rest, bool allow_other_keys, register int n, ... ); +/* bind.c:820:OF */ extern void check_other_key (object l, int n, ...); +struct key {short n,allow_other_keys; + iobject *defaults; + iobject keys[1]; + }; + +/* bind.c:866:OF */ extern int parse_key_new_new (int n, object *base, struct key *keys, object first, va_list ap); /* (n, base, keys, ap) int n; object *base; struct key *keys; va_list ap; */ +/* bind.c:916:OF */ extern int parse_key_rest_new (object rest, int n, object *base, struct key *keys, object first, va_list ap); /* (rest, n, base, keys, ap) object rest; int n; object *base; struct key *keys; va_list ap; */ +/* bind.c:975:OF */ extern void set_key_struct (struct key *ks, object data); /* (ks, data) struct key *ks; object data; */ +/* bind.c:995:OF */ extern void gcl_init_bind (void); /* () */ +/* block.c:121:OF */ extern void gcl_init_block (void); /* () */ +/* bsearch.c:5:OF */ extern void *bsearch (const void *key, const void *base, size_t nel, size_t keysize, int (*compar) (const void *,const void *)); /* (key, base, nel, keysize, compar) char *key; char *base; unsigned int nel; unsigned int keysize; int (*compar)(); */ +#if defined (__MINGW32__) +/* bzero.c:3:OF */ /* extern void bzero (char *b, size_t length); */ /* (b, length) char *b; int length; */ +#endif +/* catch.c:61:OF */ extern object fSerror_set (object x0); /* (x0) object x0; */ +/* catch.c:166:OF */ extern void gcl_init_catch (void); /* () */ +/* cfun.c:37:OF */ extern object make_cfun (void (*self)(), object name, object data, char *start, int size); /* (self, name, data, start, size) int (*self)(); object name; object data; char *start; int size; */ +/* cfun.c:56:OF */ extern object make_sfun (object name, object (*self)(), int argd, object data); /* (name, self, argd, data) object name; int (*self)(); int argd; object data; */ +/* cfun.c:91:OF */ extern object make_cclosure_new (void (*self)(), object name, object env, object data); /* (self, name, env, data) int (*self)(); object name; object env; object data; */ +/* cfun.c:108:OF */ extern object make_cclosure (void (*self)(), object name, object env, object data, char *start, int size); /* (self, name, env, data, start, size) int (*self)(); object name; object env; object data; char *start; int size; */ +/* cfun.c:124:OF */ extern object fSmc (object name, object address); /* (name, address) object name; object address; */ +/* cfun.c:150:OF */ extern object fSmfsfun (object name, object address, object argd); /* (name, address, argd) object name; object address; object argd; */ +/* cfun.c:174:OF */ extern object fSmfvfun (object name, object address, object argd); /* (name, address, argd) object name; object address; object argd; */ +/* cfun.c:193:OF */ extern object fSmfvfun_key (object symbol, object address, object argd, object keys); /* (symbol, address, argd, keys) object symbol; object address; object argd; object keys; */ +/* cfun.c:221:OF */ extern object fSmf (object name, object addr); /* (name, addr) object name; object addr; */ +/* cfun.c:269:OF */ extern object fSmm (object name, object addr); /* (name, addr) object name; object addr; */ +/* cfun.c:283:OF */ extern object make_function_internal (char *s, void(*f)()); /* (s, f) char *s; int (*f)(); */ +/* cfun.c:299:OF */ extern object make_si_sfun_internal (char *s, object (*f)(), int argd); /* (s, f, argd) char *s; int (*f)(); int argd; */ +/* cfun.c:322:OF */ extern object make_si_function_internal (char *s, void (*f) ()); /* (s, f) char *s; int (*f)(); */ +/* cfun.c:341:OF */ extern object make_special_form_internal (char *s, void (*f)()); /* (s, f) char *s; int (*f)(); */ +/* cfun.c:352:OF */ extern object fScompiled_function_name (object fun); /* (fun) object fun; */ +/* cfun.c:371:OF */ extern void turbo_closure (object fun); /* (fun) object fun; */ +/* cfun.c:392:OF */ extern object fSturbo_closure (object funobj); /* (funobj) object funobj; */ +/* cfun.c:403:OF */ extern void gcl_init_cfun (void); /* () */ +/* cmac.c:147:OF */ extern object fScmod (object num); /* (num) object num; */ +/* cmac.c:156:OF */ extern object fScplus (object x0, object x1); /* (x0, x1) object x0; object x1; */ +/* cmac.c:165:OF */ extern object fSctimes (object x0, object x1); /* (x0, x1) object x0; object x1; */ +/* cmac.c:175:OF */ extern object fScdifference (object x0, object x1); /* (x0, x1) object x0; object x1; */ +/* cmac.c:191:OF */ extern void gcl_init_cmac (void); /* () */ +/* cmpaux.c:33:OF */ extern void siLspecialp (void); /* () */ +/* cmpaux.c:35:OF */ extern object fSspecialp (object sym); /* (sym) object sym; */ +/* cmpaux.c:73:OF */ extern object fSdebug (object sym, object val); /* (sym, val) object sym; object val; */ +/* cmpaux.c:82:OF */ extern object fSsetvv (object index, object val); /* (index, val) object index; object val; */ +/* cmpaux.c:95:OF */ extern void gcl_init_cmpaux (void); /* () */ +/* cmpaux.c:106:OF */ /* extern int ifloor (int x, int y); */ /* (x, y) int x; int y; */ +/* cmpaux.c:124:OF */ /* extern int imod (int x, int y); */ /* (x, y) int x; int y; */ +/* cmpaux.c:185:OF */ extern int object_to_int (object x); /* (x) object x; */ +/* cmpaux.c:185:OF */ extern fixnum object_to_fixnum (object x); /* (x) object x; */ +/* cmpaux.c:263:OF */ extern char *object_to_string (object x); /* (x) object x; */ +typedef int (*FUNC)(); +/* cmpaux.c:294:OF */ extern void call_init (int init_address, object memory, object fasl_vec, FUNC fptr); /* (init_address, memory, fasl_vec, fptr) int init_address; object memory; object fasl_vec; FUNC fptr; */ +/* cmpaux.c:339:OF */ extern void do_init (object *statVV); /* (statVV) object *statVV; */ +/* cmpaux.c:416:OF */ extern void gcl_init_or_load1 (void (*fn) (void), const char *file); /* (fn, file) int (*fn)(); char *file; */ +/* conditional.c:200:OF */ extern void gcl_init_conditional (void); /* () */ +/* error.c:38:OF */ extern void terminal_interrupt (int correctable); /* (correctable) int correctable; */ +/* error.c:147:OF */ extern void Lerror (void); /* () */ +/* error.c:164:OF */ extern void Lcerror (void); /* () */ +/* error.c:184:OF */ extern void FEerror (char *s, int num, ... ); /* (s, num, arg1, arg2, arg3, arg4) char *s; int num; object arg1; object arg2; object arg3; object arg4; */ +/* error.c:203:OF */ extern void FEwrong_type_argument (object type, object value); /* (type, value) object type; object value; */ +/* error.c:210:OF */ extern void FEtoo_few_arguments (object *base, object *top); /* (base, top) object *base; object *top; */ +/* error.c:219:OF */ extern void FEtoo_few_argumentsF (object args); /* (args) object args; */ +/* error.c:227:OF */ extern void FEtoo_many_arguments (object *base, object *top); /* (base, top) object *base; object *top; */ +/* error.c:234:OF */ extern void FEtoo_many_argumentsF (object args); /* (args) object args; */ +/* error.c:247:OF */ extern void FEunexpected_keyword (object key); /* (key) object key; */ +/* error.c:258:OF */ extern void FEinvalid_form (char *s, object form); /* (s, form) char *s; object form; */ +/* error.c:266:OF */ extern void FEunbound_variable (object sym); /* (sym) object sym; */ +/* error.c:273:OF */ extern void FEinvalid_variable (char *s, object obj); /* (s, obj) char *s; object obj; */ +/* error.c:280:OF */ extern void FEundefined_function (object fname); /* (fname) object fname; */ +/* error.c:287:OF */ extern void FEinvalid_function (object obj); /* (obj) object obj; */ +/* error.c:297:OF */ extern object CEerror (char *error_str, char *cont_str, int num, object arg1, object arg2, object arg3, object arg4); /* (error_str, cont_str, num, arg1, arg2, arg3, arg4) char *error_str; char *cont_str; int num; object arg1; object arg2; object arg3; object arg4; */ +/* error.c:330:OF */ extern object fSihs_top (void); /* () */ +/* error.c:337:OF */ extern object fSihs_fun (object x0); /* (x0) object x0; */ +/* error.c:346:OF */ extern object fSihs_vs (object x0); /* (x0) object x0; */ +/* error.c:371:OF */ extern object fSfrs_top (void); /* () */ +/* error.c:378:OF */ extern object fSfrs_vs (object x0); /* (x0) object x0; */ +/* error.c:387:OF */ extern object fSfrs_bds (object x0); /* (x0) object x0; */ +/* error.c:397:OF */ extern object fSfrs_class (object x0); /* (x0) object x0; */ +/* error.c:413:OF */ extern object fSfrs_tag (object x0); /* (x0) object x0; */ +/* error.c:422:OF */ extern object fSfrs_ihs (object x0); /* (x0) object x0; */ +/* error.c:448:OF */ extern object fSbds_top (void); /* () */ +/* error.c:455:OF */ extern object fSbds_var (object x0); /* (x0) object x0; */ +/* error.c:464:OF */ extern object fSbds_val (object x0); /* (x0) object x0; */ +/* error.c:487:OF */ extern object fSvs_top (void); /* () */ +/* error.c:496:OF */ extern object fSvs (object x0); /* (x0) object x0; */ +/* error.c:505:OF */ extern object fSsch_frs_base (object x0, object x1); /* (x0, x1) object x0; object x1; */ +/* error.c:523:OF */ extern object fSinternal_super_go (object tag, object x1, object x2); /* (tag, x1, x2) object tag; object x1; object x2; */ +/* error.c:549:OF */ extern object fSuniversal_error_handler (object x0, object x1, object x2, object x3, object error_fmt_string); /* (x0, x1, x2, x3, error_fmt_string) object x0; object x1; object x2; object x3; object error_fmt_string; */ +/* error.c:561:OF */ extern void check_arg_failed (int n); /* (n) int n; */ +/* error.c:568:OF */ extern void too_few_arguments (void); /* () */ +/* error.c:573:OF */ extern void too_many_arguments (void); /* () */ +/* error.c:586:OF */ extern void ck_larg_exactly (int n, object x); /* (n, x) int n; object x; */ +/* error.c:595:OF */ extern void invalid_macro_call (void); /* () */ +/* error.c:618:OF */ extern object wrong_type_argument (object typ, object obj); /* (typ, obj) object typ; object obj; */ +/* error.c:625:OF */ extern void illegal_declare (object form); /* (form) int form; */ +/* error.c:635:OF */ extern void not_a_string_or_symbol (object x); /* (x) object x; */ +/* error.c:641:OF */ extern void not_a_symbol (object obj); /* (obj) object obj; */ +/* error.c:647:OF */ extern int not_a_variable (object obj); /* (obj) object obj; */ +/* error.c:653:OF */ extern void illegal_index (object x, object i); /* (x, i) object x; object i; */ +/* error.c:660:OF */ extern void check_socket (object x); /* (x) object x; */ +/* error.c:670:OF */ extern void check_stream (object strm); /* (strm) object strm; */ +/* error.c:697:OF */ extern void check_arg_range (int n, int m); /* (n, m) int n; int m; */ +/* error.c:727:OF */ extern void gcl_init_error (void); /* () */ +/* eval.c:143:OF */ extern void funcall (object fun); /* (fun) object fun; */ +/* eval.c:375:OF */ extern void lispcall (object *funp, int narg); /* (funp, narg) object *funp; int narg; */ +/* eval.c:461:OF */ extern void symlispcall (object sym, object *base, int narg); /* (sym, base, narg) object sym; object *base; int narg; */ +/* eval.c:549:OF */ extern object simple_lispcall (object *funp, int narg); /* (funp, narg) object *funp; int narg; */ +/* eval.c:645:OF */ extern object simple_symlispcall (object sym, object *base, int narg); /* (sym, base, narg) object sym; object *base; int narg; */ +/* eval.c:739:OF */ extern void super_funcall (object fun); /* (fun) object fun; */ +/* eval.c:752:OF */ extern void super_funcall_no_event (object fun); /* (fun) object fun; */ +/* eval.c:936:OF */ extern object Ieval (object form); /* (form) object form; */ +/* eval.c:944:OF */ extern void eval (object form); /* (form) object form; */ +/* eval.c:1189:OF */ extern void Leval (void); /* () */ +/* eval.c:1191:OF */ extern object fLeval (object x0); /* (x0) object x0; */ +/* eval.c:1203:OF */ extern void Levalhook (void); /* () */ +/* eval.c:1269:OF */ extern void Lconstantp (void); /* () */ +/* eval.c:1271:OF */ extern object fLconstantp (object x0); /* (x0) object x0; */ +/* eval.c:1293:OF */ extern object ieval (object x); /* (x) object x; */ +/* eval.c:1309:OF */ extern object ifuncall1 (object fun, object arg1); /* (fun, arg1) object fun; object arg1; */ +/* eval.c:1328:OF */ extern object ifuncall2 (object fun, object arg1, object arg2); /* (fun, arg1, arg2) object fun; object arg1; object arg2; */ +/* eval.c:1348:OF */ extern object ifuncall3 (object fun, object arg1, object arg2, object arg3); /* (fun, arg1, arg2, arg3) object fun; object arg1; object arg2; object arg3; */ +typedef void (*funcvoid)(void); +/* eval.c:1545:OF */ extern void gcl_init_eval (void); /* () */ +/* fasdump.c:1465:OF */ extern object read_fasl_vector (object in); /* (in) object in; */ +/* fat_string.c:29:OF */ extern object fSprofile (object start_address, object scale); /* (start_address, scale) object start_address; object scale; */ +/* fat_string.c:46:OF */ extern object fSfunction_start (object funobj); /* (funobj) object funobj; */ +/* fat_string.c:331:OF */ extern object fSdisplay_profile (object start_addr, object scal); /* (start_addr, scal) object start_addr; object scal; */ +/* fat_string.c:394:OF */ extern object fSarray_adress (object array); /* (array) object array; */ +/* fat_string.c:435:OF */ extern void gcl_init_fat_string (void); /* () */ +/* sfasli.c::OF */ extern void gcl_init_sfasl (void); /* () */ +/* format.c::OF */ extern object fLformat_1(object strm, object control,object x); +/* format.c:2084:OF */ extern void Lformat (void); /* () */ +/* format.c:2171:OF */ extern void gcl_init_format (void); /* () */ +/* frame.c:32:OF */ extern void unwind (frame_ptr fr, object tag); /* (fr, tag) frame_ptr fr; object tag; */ +/* frame.c:58:OF */ extern frame_ptr frs_sch (object frame_id); /* (frame_id) object frame_id; */ +/* frame.c:69:OF */ extern frame_ptr frs_sch_catch (object frame_id); /* (frame_id) object frame_id; */ +/* funlink.c:19:OF */ extern void call_or_link (object sym, void **link); /* (sym, link) object sym; void **link; */ +/* funlink.c:41:OF */ extern void call_or_link_closure (object sym, void **link, void **ptr); /* (sym, link, ptr) object sym; void **link; object *ptr; */ +/* funlink.c:230:OF */ extern object c_apply_n (object (*fn)(), int n, object *x); /* (fn, n, x) long int (*fn)(); int n; object *x; */ +/* funlink.c:696:OF */ extern object call_proc0 (object sym, void *link); /* (sym, link) object sym; void *link; */ +/* funlink.c:784:OF */ extern int clear_stack (object *beg, object *limit); /* (beg, limit) object *beg; object *limit; */ +/* funlink.c:821:OF */ extern void gcl_init_links (void); /* () */ +/* gbc.c:151:OF */ extern void enter_mark_origin (object *p); /* (p) object *p; */ +/* gbc.c:938:OF */ extern void GBC (enum type t); /* (t) enum type t; */ +/* gbc.c:1326:OF */ extern object fLgbc (object x0); /* (x0) object x0; */ +/* sgbc.c:924:OF */ extern int sgc_count_type (int t); /* (t) int t; */ +/* sgbc.c:938:OF */ extern int sgc_start (void); /* () */ +/* sgbc.c:1068:OF */ extern int sgc_quit (void); /* () */ +/* sgbc.c:1131:OF */ extern void make_writable (unsigned long beg, unsigned long i); /* (beg, i) int beg; int i; */ +#ifndef __MINGW32__ +/* #include */ +#endif +/* sgbc.c:1246:OF */ extern void memory_protect (int on); /* (on) int on; */ +/* sgbc.c:1306:OF */ extern void perm_writable (char *p, long n); /* (p, n) char *p; int n; */ +/* sgbc.c:1321:OF */ extern void system_error (void); /* () */ +/* gbc.c:1357:OF */ extern void gcl_init_GBC (void); /* () */ +/* gnumalloc.c:286:OF */ extern void malloc_init (char *start, void (*warnfun) (/* ??? */)); /* (start, warnfun) char *start; void (*warnfun)(); */ +/* gnumalloc.c:301:OF */ extern int malloc_usable_size (char *mem); /* (mem) char *mem; */ +/* gnumalloc.c:461:OF */ /* extern void *malloc (size_t n); */ /* (n) unsigned int n; */ +/* gnumalloc.c:529:OF */ /* extern int free (char *mem); */ /* (mem) char *mem; */ +/* gnumalloc.c:577:OF */ /* extern char *realloc (char *mem, register unsigned int n); */ /* (mem, n) char *mem; register unsigned int n; */ +/* gnumalloc.c:639:OF */ /* extern char *memalign (unsigned int alignment, unsigned int size); */ /* (alignment, size) unsigned int alignment; unsigned int size; */ +/* gnumalloc.c:737:OF */ extern int get_lim_data (void); /* () */ +/* grab_defs.c:35:OF */ extern int read_some (char *buf, int n, int start_ch, int copy); /* (buf, n, start_ch, copy) char *buf; int n; int start_ch; int copy; */ +/* grab_defs.c:71:OF */ /* extern int main (void); */ /* () */ +/* iteration.c:457:OF */ extern void gcl_init_iteration (void); /* () */ +/* let.c:29:OF */ extern void let_var_list (object var_list); /* (var_list) object var_list; */ +/* let.c:321:OF */ extern void gcl_init_let (void); /* () */ +/* lex.c:34:OF */ extern object assoc_eq (object key, object alist); /* (key, alist) object key; object alist; */ +/* lex.c:47:OF */ extern void lex_fun_bind (object name, object fun); /* (name, fun) object name; object fun; */ +/* lex.c:59:OF */ extern void lex_macro_bind (object name, object exp_fun); /* (name, exp_fun) object name; object exp_fun; */ +/* lex.c:70:OF */ extern void lex_tag_bind (object tag, object id); /* (tag, id) object tag; object id; */ +/* lex.c:82:OF */ extern void lex_block_bind (object name, object id); /* (name, id) object name; object id; */ +/* lex.c:95:OF */ extern object lex_tag_sch (object tag); /* (tag) object tag; */ +/* lex.c:110:OF */ extern object lex_block_sch (object name); /* (name) object name; */ +/* lex.c:125:OF */ extern void gcl_init_lex (void); /* () */ +/* littleXwin.c:32:OF */ /* extern Window open_window (void); */ /* () */ +/* littleXwin.c:102:OF */ /* extern int close_window (Window the_window); */ /* (the_window) Window the_window; */ +/* littleXwin.c:110:OF */ /* extern int draw_line (Window the_window, int x1, int y1, int x2, int y2); */ /* (the_window, x1, y1, x2, y2) Window the_window; int x1; int y1; int x2; int y2; */ +/* littleXwin.c:119:OF */ /* extern int draw_arc (Window the_window, int x, int y, int width, int height, int angle1, int angle2); *//* (the_window, x, y, width, height, angle1, angle2) Window the_window; int x; int y; int width; int height; int angle1; int angle2; */ +/* littleXwin.c:129:OF */ /* extern int fill_arc (Window the_window, int x, int y, int width, int height, int angle1, int angle2); */ /* (the_window, x, y, width, height, angle1, angle2) Window the_window; int x; int y; int width; int height; int angle1; int angle2; */ +/* littleXwin.c:139:OF */ /* extern int clear_arc (Window the_window, int x, int y, int width, int height, int angle1, int angle2); *//* (the_window, x, y, width, height, angle1, angle2) Window the_window; int x; int y; int width; int height; int angle1; int angle2; */ +/* littleXwin.c:149:OF */ /* extern int set_arc_mode (int pie_or_chord); */ /* (pie_or_chord) int pie_or_chord; */ +/* littleXwin.c:162:OF */ /* extern int erase_line (Window the_window, int x1, int y1, int x2, int y2); *//* (the_window, x1, y1, x2, y2) Window the_window; int x1; int y1; int x2; int y2; */ +/* littleXwin.c:171:OF */ /* extern int draw_text (Window the_window, char *string, int x, int y); */ /* (the_window, string, x, y) Window the_window; char *string; int x; int y; */ +/* littleXwin.c:182:OF */ /* extern int erase_text (Window the_window, char *string, int x, int y); */ /* (the_window, string, x, y) Window the_window; char *string; int x; int y; */ +/* littleXwin.c:193:OF */ /* extern int clear_window (Window the_window); */ /* (the_window) Window the_window; */ +/* littleXwin.c:201:OF */ /* extern int resize_window (Window the_window, int width, int height); */ /* (the_window, width, height) Window the_window; int width; int height; */ +/* littleXwin.c:210:OF */ /* extern int raise_window (Window the_window); */ /* (the_window) Window the_window; */ +/* littleXwin.c:218:OF */ /* extern int use_font (char *font_name); */ /* (font_name) char *font_name; */ +/* littleXwin.c:233:OF */ /* extern int set_background (Window the_window, char *color_string); */ /* (the_window, color_string) Window the_window; char *color_string; */ +/* littleXwin.c:251:OF */ /* extern int set_foreground (char *color_string); */ /* (color_string) char *color_string; */ +/* macros.c:139:OF */ extern object Imacro_expand1 (object exp_fun, object form); /* (exp_fun, form) object exp_fun; object form; */ +/* macros.c:173:OF */ extern void Lmacroexpand (void); /* () */ +/* macros.c:224:OF */ extern void Lmacroexpand_1 (void); /* () */ +/* macros.c:265:OF */ extern object macro_expand (object form); /* (form) object form; */ +/* macros.c:344:OF */ extern void gcl_init_macros (void); /* () */ +/* main.c:111:OF */ extern int main (int argc, char **argv, char **envp); /* (argc, argv, envp) int argc; char **argv; char **envp; */ +/* main.c:346:OF */ extern void install_segmentation_catcher (void); /* () */ +/* main.c:359:OF */ extern void error (char *s); /* (s) char *s; */ +/* main.c:519:OF */ extern object vs_overflow (void); /* () */ +/* main.c:528:OF */ extern void bds_overflow (void); /* () */ +/* main.c:537:OF */ extern void frs_overflow (void); /* () */ +/* main.c:546:OF */ extern void ihs_overflow (void); /* () */ +/* main.c:556:OF */ extern void segmentation_catcher (int); /* () */ +/* main.c:587:OF */ extern void Lby (void); /* () */ +/* main.c:607:OF */ extern void Lquit(void); /* () */ +/* main.c:612:OF */ extern void Lexit(void); /* () */ +/* main.c:619:OF */ extern int c_trace (void); /* () */ +/* main.c:695:OF */ extern void siLreset_stack_limits (void); /* (arg) int arg; */ +/* main.c:797:OF */ extern void Lidentity(void); /* () */ +/* main.c:799:OF */ extern object fLidentity (object x0); /* (x0) object x0; */ +/* main.c:805:OF */ extern void Llisp_implementation_version(void); /* () */ +/* main.c:807:OF */ extern object fLlisp_implementation_version (void); /* () */ +/* makefun.c:10:OF */ extern object MakeAfun (object (*addr)(object,object), unsigned int argd, object data); /* (addr, argd, data) int (*addr)(); unsigned int argd; object data; */ +/* makefun.c:113:OF */ extern object fSset_key_struct (object key_struct_ind); /* (key_struct_ind) object key_struct_ind; */ +/* makefun.c:122:OF */ extern void SI_makefun (char *strg, object (*fn) (/* ??? */), unsigned int argd); /* (strg, fn, argd) char *strg; object (*fn)(); unsigned int argd; */ +/* makefun.c:131:OF */ extern void LISP_makefun (char *strg, object (*fn) (/* ??? */), unsigned int argd); /* (strg, fn, argd) char *strg; object (*fn)(); unsigned int argd; */ +/* makefun.c:167:OF */ extern object fSinvoke (object x); /* (x) object x; */ +/* mapfun.c:324:OF */ extern void gcl_init_mapfun (void); /* () */ +/* multival.c:32:OF */ extern void Lvalues (void); /* () */ +/* multival.c:37:OF */ extern void Lvalues_list (void); /* () */ +/* multival.c:134:OF */ extern void gcl_init_multival (void); /* () */ +/* nfunlink.c:190:OF */ extern object IapplyVector (object fun, int nargs, object *base); /* (fun, nargs, base) object fun; int nargs; object *base; */ +/* nfunlink.c:269:OF */ extern void Iinvoke_c_function_from_value_stack (object (*f)(), int fargd); /* (f, fargd) object (*f)(); int fargd; */ +/* nsocket.c:190:OF */ extern int CreateSocket (int port, char *host, int server, char *myaddr, int myport, int async); /* (port, host, server, myaddr, myport, async) int port; char *host; int server; char *myaddr; int myport; int async; */ +/* nsocket.c:329:OF */ extern object fSgetpeername (object sock); /* (sock) object sock; */ +/* nsocket.c:353:OF */ extern object fSgetsockname (object sock); /* (sock) object sock; */ +/* nsocket.c:385:OF */ extern object fSset_blocking (object sock, object setBlocking); /* (sock, setBlocking) object sock; object setBlocking; */ +/* nsocket.c:484:OF */ extern int getOneChar (FILE *fp); /* (fp) FILE *fp; */ +/* nsocket.c:539:OF */ extern void ungetCharGclSocket (int c, object strm); /* (c, strm) int c; object strm; */ +#ifndef __MINGW32__ +/* nsocket.c:592:OF */ extern void tcpCloseSocket (int fd); /* (fd) int fd; */ +/* nsocket.c:575:OF */ extern int TcpOutputProc (int fd, char *buf, int toWrite, int *errorCodePtr); /* (fd, buf, toWrite, errorCodePtr) int fd; char *buf; int toWrite; int *errorCodePtr; */ +#endif +/* nsocket.c:619:OF */ extern int getCharGclSocket (object strm, object block); /* (strm, block) object strm; object block; */ +/* num_arith.c:31:OF */ extern object fixnum_add (fixnum i, fixnum j); /* (i, j) int i; int j; */ +/* num_arith.c:48:OF */ extern object fixnum_sub (fixnum i, fixnum j); /* (i, j) int i; int j; */ +/* num_arith.c:100:OF */ extern object number_plus (object x, object y); /* (x, y) object x; object y; */ +/* num_arith.c:246:OF */ extern object one_plus (object x); /* (x) object x; */ +/* num_arith.c:292:OF */ extern object number_minus (object x, object y); /* (x, y) object x; object y; */ +/* num_arith.c:438:OF */ extern object one_minus (object x); /* (x) object x; */ +/* num_arith.c:478:OF */ extern object number_negate (object x); /* (x) object x; */ +/* num_arith.c:520:OF */ extern object number_times (object x, object y); /* (x, y) object x; object y; */ +/* num_arith.c:670:OF */ extern object number_divide (object x, object y); /* (x, y) object x; object y; */ +/* num_arith.c:818:OF */ extern object integer_divide1 (object x, object y); /* (x, y) object x; object y; */ +/* num_arith.c:828:OF */ extern object get_gcd (object x, object y); /* (x, y) object x; object y; */ +/* num_arith.c:873:OF */ extern void Lplus (void); /* () */ +/* num_arith.c:889:OF */ extern void Lminus (void); /* () */ +/* num_arith.c:907:OF */ extern void Ltimes (void); /* () */ +/* num_arith.c:923:OF */ extern void Ldivide (void); /* () */ +/* num_arith.c:1029:OF */ extern void gcl_init_num_arith (void); /* () */ +/* num_co.c:292:OF */ extern object double_to_integer (double d); /* (d) double d; */ +/* num_co.c:372:OF */ extern void Lfloat (void); /* () */ +/* num_co.c:424:OF */ extern void Lnumerator (void); /* () */ +/* num_co.c:432:OF */ extern void Ldenominator (void); /* () */ +/* num_co.c:442:OF */ extern void Lfloor (void); /* () */ +/* num_co.c:563:OF */ extern void Lceiling (void); /* () */ +/* num_co.c:684:OF */ extern void Ltruncate (void); /* () */ +/* num_co.c:766:OF */ extern void Lround (void); /* () */ +/* num_co.c:896:OF */ extern void Lmod (void); /* () */ +/* num_co.c:987:OF */ extern void Lfloat_radix (void); /* () */ +/* num_co.c:1089:OF */ extern void Linteger_decode_float (void); /* () */ +/* num_co.c:1114:OF */ extern void Lcomplex (void); /* () */ +/* num_co.c:1136:OF */ extern void Lrealpart (void); /* () */ +/* num_co.c:1147:OF */ extern void Limagpart (void); /* () */ +/* num_co.c:1185:OF */ extern void gcl_init_num_co (void); /* () */ +/* num_comp.c:40:OF */ extern int number_compare (object x, object y); /* (x, y) object x; object y; */ +/* num_comp.c:269:OF */ extern void Lmonotonically_increasing (void); /* () */ +/* num_comp.c:271:OF */ extern void Lmonotonically_nondecreasing (void); /* () */ +/* num_comp.c:272:OF */ extern void Lmonotonically_nonincreasing (void); /* () */ +/* num_comp.c:292:OF */ extern void Lmin (void); /* () */ +/* num_comp.c:309:OF */ extern void gcl_init_num_comp (void); /* () */ +/* num_log.c:224:OF */ extern object shift_integer (object x, int w); /* (x, w) object x; int w; */ +/* num_log.c:258:OF */ extern void Llogior (void); /* () */ +/* num_log.c:279:OF */ extern void Llogxor (void); /* () */ +/* num_log.c:299:OF */ extern void Llogand (void); /* () */ +/* num_log.c:339:OF */ extern void Lboole (void); /* () */ +/* num_log.c:380:OF */ extern void Llogbitp (void); /* () */ +/* num_log.c:420:OF */ extern void Lash (void); /* () */ +/* num_log.c:482:OF */ extern void Linteger_length (void); /* () */ +/* num_log.c:549:OF */ extern void gcl_init_num_log (void); /* () */ +/* num_log.c:585:OF */ extern void siLbit_array_op (void); /* () */ +/* num_pred.c:31:OF */ extern int number_zerop (object x); /* (x) object x; */ +/* num_pred.c:67:OF */ extern int number_plusp (object x); /* (x) object x; */ +/* num_pred.c:107:OF */ extern int number_minusp (object x); /* (x) object x; */ +/* num_pred.c:147:OF */ extern int number_oddp (object x); /* (x) object x; */ +/* num_pred.c:161:OF */ extern int number_evenp (object x); /* (x) object x; */ +/* num_pred.c:240:OF */ extern void gcl_init_num_pred (void); /* () */ +/* num_rand.c:111:OF */ extern void Lrandom (void); /* () */ +/* num_rand.c:151:OF */ extern void gcl_init_num_rand (void); /* () */ +/* num_sfun.c:91:OF */ extern object number_expt (object x, object y); /* (x, y) object x; object y; */ +/* num_sfun.c:453:OF */ extern void Lexp (void); /* () */ +/* num_sfun.c:469:OF */ extern void Llog (void); /* () */ +/* num_sfun.c:488:OF */ extern void Lsqrt (void); /* () */ +/* num_sfun.c:495:OF */ extern void Lsin (void); /* () */ +/* num_sfun.c:502:OF */ extern void Lcos (void); /* () */ +/* num_sfun.c:516:OF */ extern void Latan (void); /* () */ +/* num_sfun.c:535:OF */ extern void gcl_init_num_sfun (void); /* () */ +/* number.c:35:OF */ extern long int fixint (object x); /* (x) object x; */ +/* number.c:44:OF */ extern int fixnnint (object x); /* (x) object x; */ +/* number.c:59:OF */ extern object fSallocate_bigger_fixnum_range (fixnum min,fixnum max); /* (min, max) int min; int max; */ +/* number.c:81:OF */ extern object make_fixnum1 (long i); /* (i) int i; */ +/* number.c:102:OF */ extern object make_ratio (object num, object den); /* (num, den) object num; object den; */ +/* number.c:144:OF */ extern object make_shortfloat (double f); /* (f) double f; */ +/* number.c:157:OF */ extern object make_longfloat (longfloat f); /* (f) longfloat f; */ +/* number.c:170:OF */ extern object make_complex (object r, object i); /* (r, i) object r; object i; */ +/* number.c:229:OF */ extern double number_to_double (object x); /* (x) object x; */ +/* number.c:254:OF */ extern void gcl_init_number (void); /* () */ +/* peculiar.c:14:OF */ /* extern int main (void); */ /* () */ +/* predicate.c:35:OF */ extern object fLnot (object x0); /* (x0) object x0; */ +/* predicate.c:46:OF */ extern void Lsymbolp (void); /* () */ +/* predicate.c:48:OF */ extern object fLsymbolp (object x0); /* (x0) object x0; */ +/* predicate.c:61:OF */ extern object fLatom (object x0); /* (x0) object x0; */ +/* predicate.c:74:OF */ extern object fLconsp (object x0); /* (x0) object x0; */ +/* predicate.c:87:OF */ extern object fLlistp (object x0); /* (x0) object x0; */ +/* predicate.c:100:OF */ extern object fLnumberp (object x0); /* (x0) object x0; */ +/* predicate.c:117:OF */ extern object fLintegerp (object x0); /* (x0) object x0; */ +/* predicate.c:132:OF */ extern object fLrationalp (object x0); /* (x0) object x0; */ +/* predicate.c:148:OF */ extern object fLrealp (object x0); /* (x0) object x0; */ +/* predicate.c:164:OF */ extern object fLfloatp (object x0); /* (x0) object x0; */ +/* predicate.c:176:OF */ extern void Lcomplexp (void); /* () */ +/* predicate.c:178:OF */ extern object fLcomplexp (object x0); /* (x0) object x0; */ +/* predicate.c:190:OF */ extern object fLcharacterp (object x0); /* (x0) object x0; */ +/* predicate.c:202:OF */ extern object fLstringp (object x0); /* (x0) object x0; */ +/* predicate.c:214:OF */ extern object fLbit_vector_p (object x0); /* (x0) object x0; */ +/* predicate.c:226:OF */ extern object fLvectorp (object x0); /* (x0) object x0; */ +/* predicate.c:238:OF */ extern void Lsimple_string_p (void); /* () */ +/* predicate.c:240:OF */ extern object fLsimple_string_p (object x0); /* (x0) object x0; */ +/* predicate.c:253:OF */ extern void Lsimple_bit_vector_p (void); /* () */ +/* predicate.c:255:OF */ extern object fLsimple_bit_vector_p (object x0); /* (x0) object x0; */ +/* predicate.c:268:OF */ extern void Lsimple_vector_p (void); /* () */ +/* predicate.c:270:OF */ extern object fLsimple_vector_p (object x0); /* (x0) object x0; */ +/* predicate.c:288:OF */ extern object fLarrayp (object x0); /* (x0) object x0; */ +/* predicate.c:301:OF */ extern void Lpackagep (void); /* () */ +/* predicate.c:303:OF */ extern object fLpackagep (object x0); /* (x0) object x0; */ +/* predicate.c:313:OF */ extern void Lfunctionp (void); /* () */ +/* predicate.c:315:OF */ extern object fLfunctionp (object x0); /* (x0) object x0; */ +/* predicate.c:344:OF */ extern void Lcompiled_function_p (void); /* () */ +/* predicate.c:346:OF */ extern object fLcompiled_function_p (object x0); /* (x0) object x0; */ +/* predicate.c:367:OF */ extern object fLcommonp (object x0); /* (x0) object x0; */ +/* predicate.c:379:OF */ extern object fLeq (object x0, object x1); /* (x0, x1) object x0; object x1; */ +/* predicate.c:393:OF */ extern int eql (object x, object y); /* (x, y) object x; object y; */ +/* predicate.c:455:OF */ extern object fLeql (object x0, object x1); /* (x0, x1) object x0; object x1; */ +/* predicate.c:469:OF */ extern int equal (register object x, register object y); /* (x, y) register object x; register object y; */ +/* predicate.c:543:OF */ extern object fLequal (object x0, object x1); /* (x0, x1) object x0; object x1; */ +/* predicate.c:557:OF */ extern bool equalp (object x, object y); /* (x, y) object x; object y; */ +/* predicate.c:681:OF */ extern object fLequalp (object x0, object x1); /* (x0, x1) object x0; object x1; */ +/* predicate.c:750:OF */ extern bool contains_sharp_comma (object x); /* (x) object x; */ +/* predicate.c:797:OF */ extern object fScontains_sharp_comma (object x0); /* (x0) object x0; */ +/* predicate.c:810:OF */ extern object fSspicep (object x0); /* (x0) object x0; */ +/* predicate.c:822:OF */ extern object fSfixnump (object x0); /* (x0) object x0; */ +/* predicate.c:833:OF */ extern void gcl_init_predicate_function (void); /* () */ +/* prog.c:48:OF */ extern void Ftagbody (object body); /* (body) object body; */ +/* prog.c:246:OF */ extern void Fprogn (object body); /* (body) object body; */ +/* prog.c:303:OF */ extern void gcl_init_prog (void); /* () */ +/* reference.c:32:OF */ extern void Lfboundp (void); /* () */ +/* reference.c:49:OF */ extern object symbol_function (object sym); /* (sym) object sym; */ +/* reference.c:69:OF */ extern void Lsymbol_function (void); /* () */ +/* reference.c:143:OF */ extern void Lsymbol_value (void); /* () */ +/* reference.c:156:OF */ extern void Lboundp (void); /* () */ +/* reference.c:169:OF */ extern void Lmacro_function (void); /* () */ +/* reference.c:180:OF */ extern void Lspecial_form_p (void); /* () */ +/* reference.c:191:OF */ extern void gcl_init_reference (void); /* () */ +/* #include "regexp.h" */ +/* regexp.c:1588:OF */ extern void regerror (char *s); /* (s) char *s; */ +/* regexpr.c:48:OF */ extern object fSmatch_beginning (fixnum i); /* (i) int i; */ +/* regexpr.c:57:OF */ extern object fSmatch_end (fixnum i); /* (i) int i; */ +/* save.c:17:OF */ extern void Lsave (void); /* () */ +#include +/* sbrk.c:9:OF */ /* extern void * sbrk (int n); */ /* (n) int n; */ +/* strcspn.c:3:OF */ /* extern size_t strcspn (const char *s1, const char *s2); */ /* (s1, s2) char *s1; char *s2; */ +/* structure.c:59:OF */ extern object structure_ref (object x, object name, int i); /* (x, name, i) object x; object name; int i; */ +/* structure.c:107:OF */ extern object structure_set (object x, object name, int i, object v); /* (x, name, i, v) object x; object name; int i; object v; */ +/* structure.c:164:OF */ extern object structure_to_list (object x); /* (x) object x; */ +/* structure.c:188:OF */ extern void siLmake_structure (void); /* () */ +/* structure.c:281:OF */ extern void siLstructure_set (void); /* () */ +/* structure.c:326:OF */ extern void siLlist_nth (void); /* () */ +/* structure.c:439:OF */ extern void gcl_init_structure_function (void); /* () */ +/* toplevel.c:211:OF */ extern void gcl_init_toplevel (void); /* () */ +/* typespec.c:38:OF */ extern void check_type_integer (object *p); /* (p) object *p; */ +/* typespec.c:47:OF */ extern void check_type_non_negative_integer (object *p); /* (p) object *p; */ +/* typespec.c:65:OF */ extern void check_type_rational (object *p); /* (p) object *p; */ +/* typespec.c:75:OF */ extern void check_type_float (object *p); /* (p) object *p; */ +/* typespec.c:94:OF */ extern void check_type_or_rational_float (object *p); /* (p) object *p; */ +/* typespec.c:104:OF */ extern void check_type_number (object *p); /* (p) object *p; */ +/* typespec.c:123:OF */ extern void check_type_character (object *p); /* (p) object *p; */ +/* typespec.c:139:OF */ extern void check_type_symbol (object *p); /* (p) object *p; */ +/* typespec.c:146:OF */ extern void check_type_or_symbol_string (object *p); /* (p) object *p; */ +/* typespec.c:153:OF */ extern void check_type_or_string_symbol (object *p); /* (p) object *p; */ +/* typespec.c:170:OF */ extern void check_type_package (object *p); /* (p) object *p; */ +/* typespec.c:177:OF */ extern void check_type_string (object *p); /* (p) object *p; */ +/* typespec.c:191:OF */ extern void check_type_cons (object *p); /* (p) object *p; */ +/* typespec.c:198:OF */ extern void check_type_stream (object *p); /* (p) object *p; */ +/* typespec.c:205:OF */ extern void check_type_readtable (object *p); /* (p) object *p; */ +/* typespec.c:213:OF */ extern void check_type_or_Pathname_string_symbol (object *p); /* (p) object *p; */ +/* typespec.c:225:OF */ extern void check_type_or_pathname_string_symbol_stream (object *p); /* (p) object *p; */ +/* typespec.c:236:OF */ extern void check_type_random_state (object *p); /* (p) object *p; */ +/* typespec.c:243:OF */ extern void check_type_hash_table (object *p); /* (p) object *p; */ +/* typespec.c:250:OF */ extern void check_type_array (object *p); /* (p) object *p; */ +/* typespec.c:284:OF */ extern void check_type (object x, int t); /* (x, t) object x; int t; */ +/* typespec.c:294:OF */ extern void Ltype_of (void); /* () */ +/* typespec.c:493:OF */ extern void gcl_init_typespec (void); /* () */ +/* typespec.c:497:OF */ extern void gcl_init_typespec_function (void); /* () */ +/* unexec-19.29.c:1016:OF */ extern int write_segment (int new, register char *ptr, register char *end); /* (new, ptr, end) int new; register char *ptr; register char *end; */ +/* unexec.c:1016:OF */ extern int write_segment (int new, register char *ptr, register char *end); /* (new, ptr, end) int new; register char *ptr; register char *end; */ +/* unexlin.c:808:OF */ extern int write_segment (int new, register char *ptr, register char *end); /* (new, ptr, end) int new; register char *ptr; register char *end; */ +/* unixfasl.c:409:OF */ extern void gcl_init_unixfasl (void); /* () */ +/* unixfsys.c:145:OF */ extern char *getwd (char *buffer); /* (buffer) char *buffer; */ +/* unixfsys.c:209:OF */ extern void coerce_to_filename (object pathname, char *p); /* (pathname, p) object pathname; char *p; */ +/* unixfsys.c:329:OF */ extern bool file_exists (object file); /* (file) object file; */ +/* unixfsys.c:359:OF */ extern FILE *backup_fopen (char *filename, char *option); /* (filename, option) char *filename; char *option; */ +/* unixfsys.c:359:OF */ extern FILE *fopen_not_dir (char *filename, char *option); /* (filename, option) char *filename; char *option; */ +/* unixfsys.c:372:OF */ extern int file_len (FILE *fp); /* (fp) FILE *fp; */ +/* unixfsys.c:382:OF */ extern object truename (object); /* () */ +/* unixfsys.c:382:OF */ extern void Ltruename (void); /* () */ +/* unixfsys.c:418:OF */ extern object fSsetenv (object variable, object value); /* (variable, value) object variable; object value; */ +/* unixfsys.c:442:OF */ extern object fLdelete_file (object path); /* (path) object path; */ +/* unixfsys.c:456:OF */ extern void Lprobe_file (void); /* () */ +/* unixfsys.c:533:OF */ extern void Ldirectory (void); /* () */ +/* unixfsys.c:777:OF */ extern void gcl_init_unixfsys (void); /* () */ +/* unixsave.c:173:OF */ extern void gcl_init_unixsave (void); /* () */ +/* unixsys.c:83:OF */ extern object fSgetpid (void); /* () */ +/* unixsys.c:87:OF */ extern void gcl_init_unixsys (void); /* () */ +/* unixtime.c:67:OF */ extern int runtime (void); /* () */ +/* unixtime.c:82:OF */ extern object unix_time_to_universal_time (int i); /* (i) int i; */ +/* unixtime.c:99:OF */ extern object fLget_universal_time (void); /* () */ +/* unixtime.c:144:OF */ extern object fLget_internal_real_time (void); /* () */ +/* unixtime.c:173:OF */ extern void gcl_init_unixtime (void); /* () */ +/* user_init.c:2:OF */ extern object user_init (void); /* () */ +/* user_init.c:2:OF */ extern int user_match (const char *,int n); /* () */ +/* usig.c:49:OF */ extern void gcl_signal (int signo, void (*handler) (/* ??? */)); /* (signo, handler) int signo; void (*handler)(); */ +/* usig.c:92:OF */ extern int unblock_signals (int n, int m); /* (n, m) int n; int m; */ +/* usig.c:119:OF */ extern void unblock_sigusr_sigio (void); /* () */ +/* usig.c:182:OF */ extern void install_default_signals (void); /* () */ +/* usig2.c:142:OF */ extern void gcl_init_safety (void); /* () */ +/* usig2.c:158:OF */ extern object sSsignal_safety_required (fixnum signo,fixnum safety); /* (signo, safety) int signo; int safety; */ +#ifdef __MINGW32__ +/* usig2.c:167:OF */ extern void main_signal_handler (int signo); /* (signo) int signo */ +#else +/* usig2.c:167:OF */ extern void main_signal_handler (int signo, int a, int b); /* (signo, a, b) int signo; int a; int b; */ +#endif +/* usig2.c:375:OF */ extern void raise_pending_signals (int cond); /* (cond) int cond; */ +/* usig2.c:407:OF */ extern object fSallow_signal (fixnum n); /* (n) int n; */ +/* utils.c:12:OF */ extern object IisSymbol (object f); /* (f) object f; */ +/* utils.c:20:OF */ extern object IisFboundp (object f); /* (f) object f; */ +/* utils.c:30:OF */ extern object IisArray (object f); /* (f) object f; */ +/* utils.c:44:OF */ extern object Iis_fixnum (object f); /* (f) object f; */ +/* utils.c:61:OF */ extern object Iapply_ap_new (object (*f) (/* ??? */), object first, va_list ap); /* (f, ap) object (*f)(); va_list ap; */ +/* utils.c:178:OF */ extern object Icheck_one_type (object x, enum type t); /* (x, t) object x; enum type t; */ +/* utils.c:189:OF */ extern object fSincorrect_type (object val, object type); /* (val, type) object val; object type; */ +/* utils.c:202:OF */ extern object Ivs_values (void); /* () */ +/* utils.c:227:OF */ extern char *lisp_copy_to_null_terminated (object string, char *buf, int n); /* (string, buf, n) object string; char *buf; int n; */ + + +/* readline.d */ +extern int readline_on; +void +gcl_init_readline_function(void); + +/* sys_gcl.c */ +void +gcl_init_init(void); + +/* misc */ +void +gcl_init_symbol(void); + +void +gcl_init_package(void); + +void +gcl_init_character(void); + +void +gcl_init_read(void); + +void +gcl_init_pathname(void); + +void +gcl_init_print(void); + +void +gcl_init_character_function(void); + +void +gcl_init_file_function(void); + +void +gcl_init_list_function(void); + +void +gcl_init_package_function(void); + +void +gcl_init_pathname_function(void); + +void +gcl_init_print_function(void); + +void +gcl_init_read_function(void); + +void +gcl_init_sequence_function(void); + +void +gcl_init_string_function(void); + +void +gcl_init_symbol_function(void); + +void +gcl_init_socket_function(void); + +void +gcl_init_hash(void); + +void +import(object,object); + +void +export(object,object); + +void +NewInit(void); + +void +gcl_init_system(object); + +void +set_up_string_register(char *); + +bool +endp1(object); + +void +stack_cons(void); + +bool +char_equal(object,object); + +bool +string_equal(object,object); + +bool +string_eq(object,object); + +bool +remf(object *,object); + +bool +keywordp(object); + +int +pack_hash(object); + +void +load(const char *); + +bool +member_eq(object,object); + +void +delete_eq(object,object *); + +int +length(object); + +int +rl_getc_em(FILE *); + +void +setupPRINTdefault(object); + +void +write_str(char *); + +void +write_object(object,int); + +void +cleanupPRINT(void); + +int +fasload(object); + +int +readc_stream(object); + +void +unreadc_stream(int,object); + +void +end_of_stream(object); + +bool +stream_at_end(object); + +int +digitp(int,int); + +bool +char_eq(object,object); + +bool +listen_stream(object); + +void +get_string_start_end(object,object,object,int *,int *); + +int +file_column(object); + +int +writec_stream(int,object); + +int +digit_weight(int,int); + +void +flush_stream(object); + +void +writestr_stream(char *,object); + +void +write_string(object,object); + +void +edit_double(int, double, int *, char *, int *); + +void +sethash(object,object,object); + +int +file_position(object); + +int +file_position_set(object, int); + +void +princ_str(char *s, object); + +void +close_stream(object); + +void +build_symbol_table(void); + +void +gcl_init_file(void); + +object +aset1(object,fixnum,object); + +void +dfprintf(FILE *,char *,...); + +void +Lmake_list(void); + +void +Llast(void); + +void +Lgensym(void); + +void +Lldiff(void); + +void +Lintern(void); + +void +Lgensym(void); + +void +Lldiff(void); + +void +Lgensym(void); + +void +Lintern(void); + +void +Lintern(void); + +void +Lreconc(void); + +void +Lmember(void); + +void +Ladjoin(void); + +void +Llist(void); + +void +Lappend(void); + +void +Lread(void); + +void +Lread_char(void); + +void +Lchar_eq(void); + +void +Lwrite_char(void); + +void +Lforce_output(void); + +void +Lchar_neq(void); + +void +Llist(void); + +void +Lwrite(void); + +void +Lfresh_line(void); + +void +Lsymbol_package(void); + +void +Lfind_package(void); + +void +Lfind_symbol(void); + +void +Lpackage_name(void); + +void +Lsymbol_plist(void); + +void +Lpackage_nicknames(void); + +void +Lpackage_use_list(void); + +void +Lpackage_used_by_list(void); + +void +Lstandard_char_p(void); + +void +Lstring_char_p(void); + +void +Lchar_code(void); + +void +Lchar_bits(void); + +void +Lchar_font(void); + +void +Lread_line(void); + +void +siLpackage_internal(void); + +void +siLpackage_external(void); + +void +Llist_all_packages(void); + +void +Lgensym(void); + +void +Lread(void); + +void +Lwrite(void); + +void +Lstring_equal(void); + +void +Lclose(void); + +void +Lnamestring(void); + +void +Lmake_echo_stream(void); + +void +Lmake_broadcast_stream(void); + +void +Lmake_two_way_stream(void); + +void +Lbutlast(void); + +void +Ladjoin(void); + +void +Lstring_downcase(void); + +void +Lmember(void); + +void +Lgensym(void); + +void +Llist_all_packages(void); + +void +Lfind_symbol(void); + +void +Lstring_equal(void); + +void +Lfind_package(void); + +void +siLpackage_internal(void); + +void +siLpackage_external(void); + +void +Lpackage_use_list(void); + +void +Lreconc(void); + +void +Lstandard_char_p(void); + +void +Lstring_char_p(void); + +void +Lcharacter(void); + +void +Llength(void); + +void +Lreconc(void); + +void +Llength(void); + +void +Lgensym(void); + +void +Llist_length(void); + +void +Lgensym(void); + +void +Lbutlast(void); + +void +Lnconc(void); + +void +Lfind_package(void); + +void +Lpackage_name(void); + +void +Llist(void); + +void +Lfresh_line(void); + +void +Lread_char(void); + +void +Lunread_char(void); + +void +Lread_line(void); + +void +Lread(void); + +void +Lforce_output(void); + +void +Lwrite(void); + +void +Lmember(void); + +void +siLpackage_internal(void); + +void +siLpackage_external(void); + +void +Lmake_pathname(void); + +void +Lnamestring(void); + +void +Lclose(void); + +void +Lgensym(void); + +void +Lfresh_line(void); + +void +Llist(void); + +void +Lread_char(void); + +void +Lchar_eq(void); + +void +Lfinish_output(void); + +void +Lchar_neq(void); + +void +Lwrite(void); + +void +Lgensym(void); + +void +Lmember(void); + +void +Lappend(void); + +void +Lcopy_tree(void); + +void +Ladjoin(void); + +void +Lgetf(void); + +void +Lsubst(void); + +void +Lsymbol_package(void); + +void +Lcopy_list(void); + +void +Lintern(void); + +void +Lfind_package(void); + +void +LlistA(void); + +void +Llist(void); + +void +Lgetf(void); + +void +Lstreamp(void); + +void +Lpeek_char(void); + +void +Lread_char(void); + +void +Lread_line(void); + +void +Lset_macro_character(void); + +void +Lclrhash(void); + +void +siLhash_set(void); + +void +Lgethash(void); + +void +Lremhash(void); + +void +Llist_all_packages(void); + +void +Lintern(void); + +void +Lunintern(void); + +void +Lsubseq(void); + +void +Lsymbol_package(void); + +void +Lfind_package(void); + +void +siLpackage_internal(void); + +void +siLpackage_external(void); + +void +Lread_char(void); + +void +Lfile_length(void); + +void +Lfile_position(void); + +void +Lclose(void); + +void +Lsubseq(void); + +void +Lnamestring(void); + +void +Lmerge_pathnames(void); + +void +Lcopy_list(void); + +void +Lread_line(void); + +void +Lgensym(void); + +void +Lcopy_list(void); + +void +Lintern(void); + +void +Lappend(void); + +void +Lgensym(void); + +void +Lcopy_list(void); + +void +Lmember(void); + +void +Lintern(void); + +void +Lappend(void); + +void +Lfind_package(void); + +void +Lpackage_name(void); + +void +Lpackage_nicknames(void); + +void +Lpackage_use_list(void); + +void +siLpackage_external(void); + +void +siLpackage_internal(void); + +void +Lsymbol_package(void); + +void +Lappend(void); + +void +Lgentemp(void); + +void +Lgensym(void); + +void +Lassoc(void); + +void +Ladjoin(void); + +void +Lstring_eq(void); + +void +Lmember(void); + +void +Lgethash(void); + +void +Lfinish_output(void); + +void +Lread(void); + +void +Lmake_hash_table(void); + +void +siLhash_set(void); + +void +Lrevappend(void); + +void +Lreconc(void); + +void +Lcopy_list(void); + +void +LlistA(void); + +void +Lfind_package(void); + +void +siLpackage_internal(void); + +void +siLpackage_external(void); + +void +princ_char(int,object); + +void +Ldigit_char_p(void); + +void +Lwrite_byte(void); + +void +unlink_loaded_files(void); + +void +FEpackage_error(object,const char *s); + +int +system_time_zone_helper(void); + +object +call_proc_new(object,void **,int,object,va_list); + +object +call_vproc_new(object,void *,object,va_list); + +void +funcall_with_catcher(object, object); + +void +siLset_symbol_plist(void); + +void +Lhash_table_p(void); + +void +Lreadtablep(void); + +int +fixnum_expt(int, int); + +void +check_alist(object); + +void +ck_larg_at_least(int,object); + +void +vfun_wrong_number_of_args(object); + +/* FIXME from lfun_list.lsp -- should be automatically generated */ +void Lgensym(void); +void Lsubseq(void); +void Lminusp(void); +void Linteger_decode_float(void); +void Lminus(void); +void Lint_char(void); +void Lchar_int(void); +void Lall_different(void); +void Lcopy_seq(void); +void Lkeywordp(void); +void Lname_char(void); +void Lchar_name(void); +void Lrassoc_if(void); +void Lmake_list(void); +void Lhost_namestring(void); +void Lmake_echo_stream(void); +void Lnth(void); +void Lsin(void); +void Lnumerator(void); +void Larray_rank(void); +void Lcaar(void); +void Lboth_case_p(void); +void Lnull(void); +void Lrename_file(void); +void Lfile_author(void); +void Lstring_capitalize(void); +void Lmacroexpand(void); +void Lnconc(void); +void Lboole(void); +void Ltailp(void); +void Lconsp(void); +void Llistp(void); +void Lmapcan(void); +void Llength(void); +void Lrassoc(void); +void Lpprint(void); +void Lpathname_host(void); +void Lnsubst_if_not(void); +void Lfile_position(void); +void Lstring_l(void); +void Lreverse(void); +void Lstreamp(void); +void siLputprop(void); +void Lremprop(void); +void Lsymbol_package(void); +void Lnstring_upcase(void); +void Lstring_ge(void); +void Lrealpart(void); +void Lnbutlast(void); +void Larray_dimension(void); +void Lcdr(void); +void Leql(void); +void Llog(void); +void Ldirectory(void); +void Lstring_not_equal(void); +void Lshadowing_import(void); +void Lmapc(void); +void Lmapl(void); +void Lmakunbound(void); +void Lcons(void); +void Llist(void); +void Luse_package(void); +void Lfile_length(void); +void Lmake_symbol(void); +void Lstring_right_trim(void); +void Lenough_namestring(void); +void Lprint(void); +void Lcddaar(void); +void Lcdadar(void); +void Lcdaadr(void); +void Lcaddar(void); +void Lcadadr(void); +void Lcaaddr(void); +void Lset_macro_character(void); +void Lforce_output(void); +void Lnthcdr(void); +void Llogior(void); +void Lchar_downcase(void); +void Lstring_char_p(void); +void Lstream_element_type(void); +void Lpackage_used_by_list(void); +void Ldivide(void); +void Lmaphash(void); +void Lstring_eq(void); +void Lpairlis(void); +void Lsymbolp(void); +void Lchar_not_lessp(void); +void Lone_plus(void); +void Lby(void); +void Lnsubst_if(void); +void Lcopy_list(void); +void Ltan(void); +void Lset(void); +void Lfunctionp(void); +void Lwrite_byte(void); +void Llast(void); +void Lmake_string(void); +void Lcaaar(void); +void Llist_length(void); +void Lcdddr(void); +void Lprin1(void); +void Lprinc(void); +void Llower_case_p(void); +void Lchar_le(void); +void Lstring_equal(void); +void Lclear_output(void); +void CERROR(void); +void Lterpri(void); +void Lnsubst(void); +void Lunuse_package(void); +void Lstring_not_greaterp(void); +void Lstring_g(void); +void Lfinish_output(void); +void Lspecial_form_p(void); +void Lstringp(void); +void Lget_internal_run_time(void); +void Ltruncate(void); +void Lcode_char(void); +void Lchar_code(void); +void Lsimple_string_p(void); +void Lrevappend(void); +void Lhash_table_count(void); +void Lpackage_use_list(void); +void Lrem(void); +void Lmin(void); +void Lapplyhook(void); +void Lexp(void); +void Lchar_lessp(void); +void Lcdar(void); +void Lcadr(void); +void Llist_all_packages(void); +void Lcdr(void); +void Lcopy_symbol(void); +void Lacons(void); +void Ladjustable_array_p(void); +void Lsvref(void); +void Lapply(void); +void Ldecode_float(void); +void Lsubst_if_not(void); +void Lrplaca(void); +void Lsymbol_plist(void); +void Lwrite_string(void); +void Llogeqv(void); +void Lstring(void); +void Lstring_upcase(void); +void Lceiling(void); +void Lgethash(void); +void Ltype_of(void); +void Lbutlast(void); +void Lone_minus(void); +void Lmake_hash_table(void); +void Lstring_neq(void); +void Lmonotonically_nondecreasing(void); +void Lmake_broadcast_stream(void); +void Limagpart(void); +void Lintegerp(void); +void Lread_char(void); +void Lpeek_char(void); +void Lchar_font(void); +void Lstring_greaterp(void); +void Loutput_stream_p(void); +void Lash(void); +void Llcm(void); +void Lelt(void); +void Lcos(void); +void Lnstring_downcase(void); +void Lcopy_alist(void); +void Latan(void); +void Ldelete_file(void); +void Lfloat_radix(void); +void Lsymbol_name(void); +void Lclear_input(void); +void Lfind_symbol(void); +void Lchar_l(void); +void Lhash_table_p(void); +void Levenp(void); +void siLcmod(void); +void siLcplus(void); +void siLctimes(void); +void siLcdifference(void); +void Lzerop(void); +void Lcaaaar(void); +void Lchar_ge(void); +void Lcdddar(void); +void Lcddadr(void); +void Lcdaddr(void); +void Lcadddr(void); +void Lfill_pointer(void); +void Lmapcar(void); +void Lfloatp(void); +void Lshadow(void); +void Lmacroexpand_1(void); +void Lsxhash(void); +void Llisten(void); +void Larrayp(void); +void Lmake_pathname(void); +void Lpathname_type(void); +void Lfuncall(void); +void Lclrhash(void); +void Lgraphic_char_p(void); +void Lfboundp(void); +void Lnsublis(void); +void Lchar_not_equal(void); +void Lmacro_function(void); +void Lsubst_if(void); +void Lcomplexp(void); +void Lread_line(void); +void Lpathnamep(void); +void Lmax(void); +void Lin_package(void); +void Lreadtablep(void); +void Lfloat_sign(void); +void Lcharacterp(void); +void Lread(void); +void Lnamestring(void); +void Lunread_char(void); +void Lcdaar(void); +void Lcadar(void); +void Lcaadr(void); +void Lchar_eq(void); +void Lalpha_char_p(void); +void Lstring_trim(void); +void Lmake_package(void); +void Lclose(void); +void Ldenominator(void); +void Lfloat(void); +void Lcar(void); +void Lround(void); +void Lsubst(void); +void Lupper_case_p(void); +void Larray_element_type(void); +void Ladjoin(void); +void Llogand(void); +void Lmapcon(void); +void Lintern(void); +void Lvalues(void); +void Lexport(void); +void Ltimes(void); +void Lmonotonically_increasing(void); +void Lcomplex(void); +void Lset_syntax_from_char(void); +void Lchar_bit(void); +void Linteger_length(void); +void Lpackagep(void); +void Linput_stream_p(void); +void Lmonotonically_nonincreasing(void); +void Lpathname(void); +void Leq(void); +void Lmake_char(void); +void Lfile_namestring(void); +void Lcharacter(void); +void Lsymbol_function(void); +void Lconstantp(void); +void Lchar_equal(void); +void Ltree_equal(void); +void Lcddr(void); +void Lgetf(void); +void Lsave(void); +void Lmake_random_state(void); +void Lchar_not_greaterp(void); +void Lexpt(void); +void Lsqrt(void); +void Lscale_float(void); +void Lchar_g(void); +void Lldiff(void); +void Lassoc_if_not(void); +void Lbit_vector_p(void); +void Lnstring_capitalize(void); +void Lsymbol_value(void); +void Lrplacd(void); +void Lboundp(void); +void Lequalp(void); +void Lsimple_bit_vector_p(void); +void Lmember_if_not(void); +void Lmake_two_way_stream(void); +void Lparse_integer(void); +void Lplus(void); +void Lall_the_same(void); +void Lgentemp(void); +void Lrename_package(void); +void Lcommonp(void); +void Lnumberp(void); +void Lcopy_readtable(void); +void Lrandom_state_p(void); +void Ldirectory_namestring(void); +void Lstandard_char_p(void); +void Ltruename(void); +void Lidentity(void); +void Lnreverse(void); +void Lpathname_device(void); +void Lunintern(void); +void Lunexport(void); +void Lfloat_precision(void); +void Lstring_downcase(void); +void Lcar(void); +void Lconjugate(void); +void Lnull(void); +void Lread_char_no_hang(void); +void Lfresh_line(void); +void Lwrite_char(void); +void Lparse_namestring(void); +void Lstring_not_lessp(void); +void Lchar(void); +void Laref(void); +void Lpackage_nicknames(void); +void Lendp(void); +void Loddp(void); +void Lchar_upcase(void); +void LlistA(void); +void Lvalues_list(void); +void Lequal(void); +void Ldigit_char_p(void); +void ERROR(void); +void Lchar_neq(void); +void Lpathname_directory(void); +void Lcdaaar(void); +void Lcadaar(void); +void Lcaadar(void); +void Lcaaadr(void); +void Lcddddr(void); +void Lget_macro_character(void); +void Lformat(void); +void Lcompiled_function_p(void); +void Lsublis(void); +void Lpathname_name(void); +void Limport(void); +void Llogxor(void); +void Lrassoc_if_not(void); +void Lchar_greaterp(void); +void Lmake_synonym_stream(void); +void Lalphanumericp(void); +void Lremhash(void); +void Lreconc(void); +void Lmonotonically_decreasing(void); +void Llogbitp(void); +void Lmaplist(void); +void Lvectorp(void); +void Lassoc_if(void); +void Lget_properties(void); +void Lstring_le(void); +void Levalhook(void); +void Lfile_write_date(void); +void Llogcount(void); +void Lmerge_pathnames(void); +void Lmember_if(void); +void Lread_byte(void); +void Lsimple_vector_p(void); +void Lchar_bits(void); +void Lcopy_tree(void); +void Lgcd(void); +void Lby(void); +void Lget(void); +void Lmod(void); +void Ldigit_char(void); +void Lprobe_file(void); +void Lstring_left_trim(void); +void Lpathname_version(void); +void Lwrite_line(void); +void Leval(void); +void Latom(void); +void Lcddar(void); +void Lcdadr(void); +void Lcaddr(void); +void Lfmakunbound(void); +void Lsleep(void); +void Lpackage_name(void); +void Lfind_package(void); +void Lassoc(void); +void Lset_char_bit(void); +void Lfloor(void); +void Lwrite(void); +void Lplusp(void); +void Lfloat_digits(void); +void Lread_delimited_list(void); +void Lappend(void); +void Lmember(void); +void Lstring_lessp(void); +void Lrandom(void); +void siLspecialp(void); +void siLoutput_stream_string(void); +void siLstructurep(void); +void siLcopy_stream(void); +void siLinit_system(void); +void siLstring_to_object(void); +void siLreset_stack_limits(void); +void siLdisplaced_array_p(void); +void siLrplaca_nthcdr(void); +void siLlist_nth(void); +void siLmake_vector(void); +void siLaset(void); +void siLsvset(void); +void siLfill_pointer_set(void); +void siLreplace_array(void); +void siLfset(void); +void siLhash_set(void); +void Lboole(void); +void siLpackage_internal(void); +void siLpackage_external(void); +void siLelt_set(void); +void siLchar_set(void); +void siLmake_structure(void); +void siLstructure_name(void); +void siLstructure_ref(void); +void siLstructure_set(void); +void siLput_f(void); +void siLrem_f(void); +void siLset_symbol_plist(void); +void siLbit_array_op(void); + +object +cmod(object); +object +ctimes(object,object); +object +cdifference(object,object); +object +cplus(object,object); + +object +Icall_error_handler(object,object,int,...); + +void * +gcl_gmp_alloc(size_t); + +int +my_plt(const char *,unsigned long *); + +int +parse_plt(void); + +int +sgc_count_read_only_type(int); + +int +gcl_isnormal_double(double); + +int +gcl_isnormal_float(float); + +object +find_init_name1(char *,unsigned); + +#ifdef SGC +void +memprotect_test_reset(void); +#endif + + +#if defined (__MINGW32__) +int bcmp ( const void *s1, const void *s2, size_t n ); +void bcopy ( const void *s1, void *s2, size_t n ); +void bzero(void *b, size_t length); +int TcpOutputProc ( int fd, char *buf, int toWrite, int *errorCodePtr, int block ); +void recreate_heap1 ( void ); +void gcl_init_shared_memory ( void ); +void fix_filename ( object pathname, char *filename1 ); +void alarm ( int n ); +void *sbrk ( unsigned long increment ); +void sigemptyset( sigset_t *set); +void sigaddset ( sigset_t *set, int n); +int sigismember ( sigset_t *set, int n ); +int sigprocmask ( int how, const sigset_t *set, sigset_t *oldset ); +#endif + +#ifdef GCL_GPROF +void +gprof_cleanup(void); +#endif + +int +msystem(const char *); + +void +assert_error(const char *,unsigned,const char *,const char *); + +#ifdef _WIN32 +void +detect_wine(void); + +void +init_shared_memory(void); + +void * +alloca(size_t); + +object +find_init_string(const char *); + +#endif + +void * +get_mmap(FILE *,void **); + +int +un_mmap(void *,void *); + +object +fSuse_fast_links_2(object,object); + +MP_INT * +otoi(object); +void +isetq_fix(MP_INT *,int); +int +mpz_to_mpz1(MP_INT *,MP_INT *,void *); +int +mpz_to_mpz(MP_INT *,MP_INT *); +int +obj_to_mpz1(object,MP_INT *,void *); +int +obj_to_mpz(object,MP_INT *); + + +#include "f-ol-syntax.h" +void init_code(){do_init((void *)VV);} +/* function definition for Q-MK_ANTIQUOT */ + +static void L1() +{register object *base=vs_base; + register object *sup=base+VM1; VC1 + vs_check; + {object V1; + V1=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= make_cons(((object)VV[0]),(V1)); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for Q-MK_PRED */ + +static void L2() +{register object *base=vs_base; + register object *sup=base+VM2; VC2 + vs_check; + {object V2; + object V3; + V2=(base[0]); + V3=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + base[4]= (V2); + vs_top=(vs_base=base+4)+1; + (void) (*Lnk66)(); + vs_top=sup; + base[3]= vs_base[0]; + vs_top=(vs_base=base+3)+1; + (void) (*Lnk67)(); + vs_top=sup; + base[2]= vs_base[0]; + base[4]= (V3); + vs_top=(vs_base=base+4)+1; + (void) (*Lnk68)(); + vs_top=sup; + base[3]= vs_base[0]; + vs_top=(vs_base=base+2)+2; + (void) (*Lnk69)(); + vs_top=sup; + if((vs_base[0])==Cnil){ + goto T2;} + base[2]= listA(3,((object)VV[1]),(V2),(V3)); + vs_top=(vs_base=base+2)+1; + return; + goto T2; +T2:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[2]= ((object)VV[3]); + vs_top=(vs_base=base+2)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for ML-IS_PRED */ + +static void L3() +{register object *base=vs_base; + register object *sup=base+VM3; VC3 + vs_check; + {object V4; + V4=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= ((CMPcar((V4)))==(((object)VV[1]))?Ct:Cnil); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-DEST_PRED */ + +static void L4() +{register object *base=vs_base; + register object *sup=base+VM4; VC4 + vs_check; + {object V5; + V5=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!(eql(CMPcar((V5)),((object)VV[1])))){ + goto T11;} + base[1]= CMPcdr((V5)); + vs_top=(vs_base=base+1)+1; + return; + goto T11; +T11:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[4]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for Q-MK_CONJ */ + +static void L5() +{register object *base=vs_base; + register object *sup=base+VM5; VC5 + vs_check; + {object V6; + object V7; + V6=(base[0]); + V7=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + base[2]= listA(3,((object)VV[5]),(V6),(V7)); + vs_top=(vs_base=base+2)+1; + return; + } +} +/* function definition for ML-IS_CONJ */ + +static void L6() +{register object *base=vs_base; + register object *sup=base+VM6; VC6 + vs_check; + {object V8; + V8=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= ((CMPcar((V8)))==(((object)VV[5]))?Ct:Cnil); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-DEST_CONJ */ + +static void L7() +{register object *base=vs_base; + register object *sup=base+VM7; VC7 + vs_check; + {object V9; + V9=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!(eql(CMPcar((V9)),((object)VV[5])))){ + goto T15;} + base[1]= CMPcdr((V9)); + vs_top=(vs_base=base+1)+1; + return; + goto T15; +T15:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[6]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for Q-MK_DISJ */ + +static void L8() +{register object *base=vs_base; + register object *sup=base+VM8; VC8 + vs_check; + {object V10; + object V11; + V10=(base[0]); + V11=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + base[2]= listA(3,((object)VV[7]),(V10),(V11)); + vs_top=(vs_base=base+2)+1; + return; + } +} +/* function definition for ML-IS_DISJ */ + +static void L9() +{register object *base=vs_base; + register object *sup=base+VM9; VC9 + vs_check; + {object V12; + V12=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= ((CMPcar((V12)))==(((object)VV[7]))?Ct:Cnil); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-DEST_DISJ */ + +static void L10() +{register object *base=vs_base; + register object *sup=base+VM10; VC10 + vs_check; + {object V13; + V13=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!(eql(CMPcar((V13)),((object)VV[7])))){ + goto T19;} + base[1]= CMPcdr((V13)); + vs_top=(vs_base=base+1)+1; + return; + goto T19; +T19:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[8]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for Q-MK_IMP */ + +static void L11() +{register object *base=vs_base; + register object *sup=base+VM11; VC11 + vs_check; + {object V14; + object V15; + V14=(base[0]); + V15=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + base[2]= listA(3,((object)VV[9]),(V14),(V15)); + vs_top=(vs_base=base+2)+1; + return; + } +} +/* function definition for ML-IS_IMP */ + +static void L12() +{register object *base=vs_base; + register object *sup=base+VM12; VC12 + vs_check; + {object V16; + V16=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= ((CMPcar((V16)))==(((object)VV[9]))?Ct:Cnil); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-DEST_IMP */ + +static void L13() +{register object *base=vs_base; + register object *sup=base+VM13; VC13 + vs_check; + {object V17; + V17=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!(eql(CMPcar((V17)),((object)VV[9])))){ + goto T23;} + base[1]= CMPcdr((V17)); + vs_top=(vs_base=base+1)+1; + return; + goto T23; +T23:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[10]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for Q-MK_NEG */ + +static void L14() +{register object *base=vs_base; + register object *sup=base+VM14; VC14 + vs_check; + {object V18; + V18=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= listA(3,((object)VV[9]),(V18),(((object)VV[11])->s.s_dbind)); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for Q-MK_FORALL */ + +static void L15() +{register object *base=vs_base; + register object *sup=base+VM15; VC15 + vs_check; + {object V19; + object V20; + V19=(base[0]); + V20=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + {object V21; + base[2]= (V19); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk70)(); + vs_top=sup; + V21= vs_base[0]; + base[2]= (V21); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk71)(); + vs_top=sup; + base[2]= (V21); + base[3]= (V20); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk72)(); + return;} + } +} +/* function definition for ML-MK_FORALL */ + +static void L16() +{register object *base=vs_base; + register object *sup=base+VM16; VC16 + vs_check; + {object V22; + object V23; + V22=(base[0]); + V23=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + if(!((CMPcar((V22)))==(((object)VV[12])))){ + goto T33;} + base[2]= listA(3,((object)VV[13]),(V22),(V23)); + vs_top=(vs_base=base+2)+1; + return; + goto T33; +T33:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[2]= ((object)VV[14]); + vs_top=(vs_base=base+2)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for ML-IS_FORALL */ + +static void L17() +{register object *base=vs_base; + register object *sup=base+VM17; VC17 + vs_check; + {object V24; + V24=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= ((CMPcar((V24)))==(((object)VV[13]))?Ct:Cnil); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-DEST_FORALL */ + +static void L18() +{register object *base=vs_base; + register object *sup=base+VM18; VC18 + vs_check; + {object V25; + V25=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!(eql(CMPcar((V25)),((object)VV[13])))){ + goto T37;} + base[1]= CMPcdr((V25)); + vs_top=(vs_base=base+1)+1; + return; + goto T37; +T37:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[15]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for Q-MK_EXISTS */ + +static void L19() +{register object *base=vs_base; + register object *sup=base+VM19; VC19 + vs_check; + {object V26; + object V27; + V26=(base[0]); + V27=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + {object V28; + base[2]= (V26); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk70)(); + vs_top=sup; + V28= vs_base[0]; + base[2]= (V28); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk71)(); + vs_top=sup; + base[2]= (V28); + base[3]= (V27); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk73)(); + return;} + } +} +/* function definition for ML-MK_EXISTS */ + +static void L20() +{register object *base=vs_base; + register object *sup=base+VM20; VC20 + vs_check; + {object V29; + object V30; + V29=(base[0]); + V30=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + if(!((CMPcar((V29)))==(((object)VV[12])))){ + goto T47;} + base[2]= listA(3,((object)VV[16]),(V29),(V30)); + vs_top=(vs_base=base+2)+1; + return; + goto T47; +T47:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[2]= ((object)VV[17]); + vs_top=(vs_base=base+2)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for ML-IS_EXISTS */ + +static void L21() +{register object *base=vs_base; + register object *sup=base+VM21; VC21 + vs_check; + {object V31; + V31=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= ((CMPcar((V31)))==(((object)VV[16]))?Ct:Cnil); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-DEST_EXISTS */ + +static void L22() +{register object *base=vs_base; + register object *sup=base+VM22; VC22 + vs_check; + {object V32; + V32=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!(eql(CMPcar((V32)),((object)VV[16])))){ + goto T51;} + base[1]= CMPcdr((V32)); + vs_top=(vs_base=base+1)+1; + return; + goto T51; +T51:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[18]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for Q-MK_EQUIV */ + +static void L23() +{register object *VOL base=vs_base; + register object *VOL sup=base+VM23; VC23 + vs_check; + {VOL object V33; + VOL object V34; + V33=(base[0]); + V34=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + {VOL object V35; + frs_push(FRS_CATCH,((object)VV[2])); + if(nlj_active) + {nlj_active=FALSE;frs_pop(); + vs_top=sup; + V35= vs_base[0]; + goto T54;} + else{ + base[2]= ((object)VV[19]); + base[4]= (V33); + base[5]= (V34); + vs_top=(vs_base=base+4)+2; + (void) (*Lnk74)(); + vs_top=sup; + base[3]= vs_base[0]; + vs_top=(vs_base=base+2)+2; + (void) (*Lnk75)(); + vs_top=sup; + V36= vs_base[0]; + V37= make_cons(V36,Cnil); + frs_pop(); + V35= V37;} + goto T54; +T54:; + if(!(type_of((V35))!=t_cons)){ + goto T62;} + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[2]= ((object)VV[20]); + vs_top=(vs_base=base+2)+1; + unwind(fr,((object)VV[2]));} + goto T62; +T62:; + base[2]= CMPcar((V35)); + vs_top=(vs_base=base+2)+1; + return;} + } +} +/* function definition for Q-MK_INEQUIV */ + +static void L24() +{register object *VOL base=vs_base; + register object *VOL sup=base+VM24; VC24 + vs_check; + {VOL object V39; + VOL object V40; + V39=(base[0]); + V40=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + {VOL object V41; + frs_push(FRS_CATCH,((object)VV[2])); + if(nlj_active) + {nlj_active=FALSE;frs_pop(); + vs_top=sup; + V41= vs_base[0]; + goto T65;} + else{ + base[2]= ((object)VV[21]); + base[4]= (V39); + base[5]= (V40); + vs_top=(vs_base=base+4)+2; + (void) (*Lnk74)(); + vs_top=sup; + base[3]= vs_base[0]; + vs_top=(vs_base=base+2)+2; + (void) (*Lnk75)(); + vs_top=sup; + V42= vs_base[0]; + V43= make_cons(V42,Cnil); + frs_pop(); + V41= V43;} + goto T65; +T65:; + if(!(type_of((V41))!=t_cons)){ + goto T73;} + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[2]= ((object)VV[22]); + vs_top=(vs_base=base+2)+1; + unwind(fr,((object)VV[2]));} + goto T73; +T73:; + base[2]= CMPcar((V41)); + vs_top=(vs_base=base+2)+1; + return;} + } +} +/* function definition for Q-MK_VAR */ + +static void L25() +{register object *base=vs_base; + register object *sup=base+VM25; VC25 + vs_check; + {object V45; + V45=(base[0]); + vs_top=sup; + goto TTL; +TTL:;{object V47; + base[1]= (V45); + base[2]= (((object)VV[23])->s.s_dbind); + vs_top=(vs_base=base+1)+2; + (void) (*Lnk76)(); + vs_top=sup; + V47= vs_base[0]; + if(V47==Cnil)goto T77; + V46= V47; + goto T76; + goto T77; +T77:;} + base[1]= (V45); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk77)(); + vs_top=sup; + V46= vs_base[0]; + goto T76; +T76:; + base[1]= listA(3,((object)VV[12]),(V45),V46); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for NEW-VAR-TYPE */ + +static void L26() +{register object *base=vs_base; + register object *sup=base+VM26; VC26 + vs_check; + {object V48; + V48=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {object V49; + vs_base=vs_top; + (void) (*Lnk78)(); + vs_top=sup; + V49= vs_base[0]; + {object V50; + V50= make_cons((V48),(V49)); + (((object)VV[23])->s.s_dbind)= make_cons((V50),(((object)VV[23])->s.s_dbind));} + base[1]= (V49); + vs_top=(vs_base=base+1)+1; + return;} + } +} +/* function definition for Q-FREE-VAR */ + +static void L27() +{register object *base=vs_base; + register object *sup=base+VM27; VC27 + vs_check; + {object V51; + V51=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!((CMPcar((V51)))==(((object)VV[12])))){ + goto T87;} + base[1]= CMPcadr((V51)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk77)(); + return; + goto T87; +T87:; + base[1]= Cnil; + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for MK_REALVAR */ + +static void L28() +{register object *base=vs_base; + register object *sup=base+VM28; VC28 + vs_check; + {object V52; + object V53; + V52=(base[0]); + V53=(base[1]); + vs_top=sup; + goto TTL; +TTL:;{object V54; + base[2]= (V53); + {object V55 =((V52))->s.s_plist; + object ind= ((object)VV[24]); + while(V55!=Cnil){ + if(V55->c.c_car==ind){ + base[3]= (V55->c.c_cdr->c.c_car); + goto T93; + }else V55=V55->c.c_cdr->c.c_cdr;} + base[3]= Cnil;} + goto T93; +T93:; + vs_top=(vs_base=base+2)+2; + (void) (*Lnk76)(); + vs_top=sup; + V54= vs_base[0]; + if(V54==Cnil)goto T90; + base[2]= V54; + vs_top=(vs_base=base+2)+1; + return; + goto T90; +T90:;} + base[2]= (V52); + V57= listA(3,((object)VV[12]),(V52),(V53)); + base[3]= make_cons((V53),/* INLINE-ARGS */V57); + base[4]= ((object)VV[24]); + vs_top=(vs_base=base+2)+3; + (void) (*Lnk79)(); + vs_top=sup; + V56= vs_base[0]; + base[2]= CMPcdr(V56); + vs_top=(vs_base=base+2)+1; + return; + } +} +/* function definition for ML-GENVAR */ + +static void L29() +{register object *base=vs_base; + register object *sup=base+VM29; VC29 + vs_check; + {object V58; + V58=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[2]= ((object)VV[25]); + base[3]= ((object)VV[12]); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk80)(); + vs_top=sup; + base[1]= vs_base[0]; + base[2]= (V58); + vs_top=(vs_base=base+1)+2; + (void) (*Lnk81)(); + return; + } +} +/* function definition for ML-IS_VAR */ + +static void L30() +{register object *base=vs_base; + register object *sup=base+VM30; VC30 + vs_check; + {object V59; + V59=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= ((CMPcar((V59)))==(((object)VV[12]))?Ct:Cnil); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-DEST_VAR */ + +static void L31() +{register object *base=vs_base; + register object *sup=base+VM31; VC31 + vs_check; + {object V60; + V60=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!(eql(CMPcar((V60)),((object)VV[12])))){ + goto T103;} + base[1]= CMPcdr((V60)); + vs_top=(vs_base=base+1)+1; + return; + goto T103; +T103:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[26]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for Q-MK_CONST */ + +static void L32() +{register object *base=vs_base; + register object *sup=base+VM32; VC32 + vs_check; + {object V61; + V61=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[2]= (V61); + base[1]= simple_symlispcall(((object)VV[82]),base+2,1); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk67)(); + vs_top=sup; + V62= vs_base[0]; + base[1]= listA(3,((object)VV[27]),(V61),V62); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-MK_CONST */ + +static void L33() +{register object *base=vs_base; + register object *sup=base+VM33; VC33 + vs_check; + {register object V63; + register object V64; + V63=(base[0]); + V64=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + {object V65; + base[2]= (V64); + {object V66 =((V63))->s.s_plist; + object ind= ((object)VV[28]); + while(V66!=Cnil){ + if(V66->c.c_car==ind){ + base[3]= (V66->c.c_cdr->c.c_car); + goto T111; + }else V66=V66->c.c_cdr->c.c_cdr;} + base[3]= Cnil;} + goto T111; +T111:; + vs_top=(vs_base=base+2)+2; + (void) (*Lnk76)(); + vs_top=sup; + V65= vs_base[0]; + if(((V65))==Cnil){ + goto T113;} + base[2]= (V65); + vs_top=(vs_base=base+2)+1; + return; + goto T113; +T113:; + base[2]= (V63); + if((simple_symlispcall(((object)VV[82]),base+2,1))==Cnil){ + goto T116;} + base[2]= (V64); + base[5]= (V63); + base[4]= simple_symlispcall(((object)VV[82]),base+5,1); + vs_top=(vs_base=base+4)+1; + (void) (*Lnk67)(); + vs_top=sup; + base[3]= vs_base[0]; + vs_top=(vs_base=base+2)+2; + (void) (*Lnk69)(); + vs_top=sup; + if((vs_base[0])==Cnil){ + goto T116;} + base[2]= (V63); + V68= listA(3,((object)VV[27]),(V63),(V64)); + base[3]= make_cons((V64),/* INLINE-ARGS */V68); + base[4]= ((object)VV[28]); + vs_top=(vs_base=base+2)+3; + (void) (*Lnk79)(); + vs_top=sup; + V67= vs_base[0]; + base[2]= CMPcdr(V67); + vs_top=(vs_base=base+2)+1; + return; + goto T116; +T116:; + base[2]= (V63); + if((simple_symlispcall(((object)VV[82]),base+2,1))!=Cnil){ + goto T130;} + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[2]= ((object)VV[29]); + base[3]= (V63); + base[4]= ((object)VV[30]); + vs_top=(vs_base=base+2)+3; + (void) (*Lnk83)(); + unwind(fr,((object)VV[2]));} + goto T130; +T130:; + base[2]= (V64); + base[5]= (V63); + base[4]= simple_symlispcall(((object)VV[82]),base+5,1); + vs_top=(vs_base=base+4)+1; + (void) (*Lnk67)(); + vs_top=sup; + base[3]= vs_base[0]; + vs_top=(vs_base=base+2)+2; + (void) (*Lnk69)(); + vs_top=sup; + if((vs_base[0])!=Cnil){ + goto T138;} + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[2]= ((object)VV[31]); + base[3]= (V63); + base[4]= ((object)VV[32]); + vs_top=(vs_base=base+2)+3; + (void) (*Lnk83)(); + unwind(fr,((object)VV[2]));} + goto T138; +T138:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[2]= ((object)VV[33]); + vs_top=(vs_base=base+2)+1; + unwind(fr,((object)VV[2]));}} + } +} +/* function definition for ML-IS_CONST */ + +static void L34() +{register object *base=vs_base; + register object *sup=base+VM34; VC34 + vs_check; + {object V69; + V69=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= ((CMPcar((V69)))==(((object)VV[27]))?Ct:Cnil); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-DEST_CONST */ + +static void L35() +{register object *base=vs_base; + register object *sup=base+VM35; VC35 + vs_check; + {object V70; + V70=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!(eql(CMPcar((V70)),((object)VV[27])))){ + goto T150;} + base[1]= CMPcdr((V70)); + vs_top=(vs_base=base+1)+1; + return; + goto T150; +T150:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[34]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for Q-MK_ABS */ + +static void L36() +{register object *base=vs_base; + register object *sup=base+VM36; VC36 + vs_check; + {object V71; + object V72; + V71=(base[0]); + V72=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + {object V73; + base[2]= (V71); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk70)(); + vs_top=sup; + V73= vs_base[0]; + base[2]= (V73); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk71)(); + vs_top=sup; + base[2]= (V73); + base[3]= (V72); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk84)(); + return;} + } +} +/* function definition for ML-MK_ABS */ + +static void L37() +{register object *base=vs_base; + register object *sup=base+VM37; VC37 + vs_check; + {object V74; + object V75; + V74=(base[0]); + V75=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + if(!((CMPcar((V74)))==(((object)VV[12])))){ + goto T160;} + V76= make_cons((V74),(V75)); + base[2]= (V74); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk68)(); + vs_top=sup; + V77= vs_base[0]; + base[2]= (V75); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk68)(); + vs_top=sup; + V78= vs_base[0]; + V79= list(2,V77,V78); + base[2]= listA(3,((object)VV[35]),/* INLINE-ARGS */V76,make_cons(((object)VV[36]),/* INLINE-ARGS */V79)); + vs_top=(vs_base=base+2)+1; + return; + goto T160; +T160:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[2]= ((object)VV[37]); + vs_top=(vs_base=base+2)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for ML-IS_ABS */ + +static void L38() +{register object *base=vs_base; + register object *sup=base+VM38; VC38 + vs_check; + {object V80; + V80=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= ((CMPcar((V80)))==(((object)VV[35]))?Ct:Cnil); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-DEST_ABS */ + +static void L39() +{register object *base=vs_base; + register object *sup=base+VM39; VC39 + vs_check; + {object V81; + V81=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!(eql(CMPcar((V81)),((object)VV[35])))){ + goto T169;} + V82= CMPcdr((V81)); + goto T167; + goto T169; +T169:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[38]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));} + goto T167; +T167:; + base[1]= CMPcar(V82); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for PREP-TERM-FN */ + +static void L40() +{register object *base=vs_base; + register object *sup=base+VM40; VC40 + vs_check; + {register object V83; + V83=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {object V84= CMPcar((V83)); + if((V84!= ((object)VV[12])))goto T172; + V85= CMPcadr((V83)); + base[1]= CMPcddr((V83)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk85)(); + vs_top=sup; + V86= vs_base[0]; + base[1]= listA(3,((object)VV[12]),/* INLINE-ARGS */V85,V86); + vs_top=(vs_base=base+1)+1; + return; + goto T172; +T172:; + if((V84!= ((object)VV[27])))goto T175; + V87= CMPcadr((V83)); + base[1]= CMPcddr((V83)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk85)(); + vs_top=sup; + V88= vs_base[0]; + base[1]= listA(3,((object)VV[27]),/* INLINE-ARGS */V87,V88); + vs_top=(vs_base=base+1)+1; + return; + goto T175; +T175:; + if((V84!= ((object)VV[39])))goto T178; + base[1]= CMPcaadr((V83)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk86)(); + vs_top=sup; + V89= vs_base[0]; + base[1]= CMPcdadr((V83)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk86)(); + vs_top=sup; + V90= vs_base[0]; + V91= make_cons(V89,V90); + base[1]= CMPcddr((V83)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk85)(); + vs_top=sup; + V92= vs_base[0]; + base[1]= listA(3,((object)VV[39]),/* INLINE-ARGS */V91,V92); + vs_top=(vs_base=base+1)+1; + return; + goto T178; +T178:; + if((V84!= ((object)VV[35])))goto T185; + base[1]= CMPcaadr((V83)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk86)(); + vs_top=sup; + V93= vs_base[0]; + base[1]= CMPcdadr((V83)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk86)(); + vs_top=sup; + V94= vs_base[0]; + V95= make_cons(V93,V94); + base[1]= CMPcddr((V83)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk85)(); + vs_top=sup; + V96= vs_base[0]; + base[1]= listA(3,((object)VV[35]),/* INLINE-ARGS */V95,V96); + vs_top=(vs_base=base+1)+1; + return; + goto T185; +T185:; + if((V84!= ((object)VV[0])))goto T192; + V83= CMPcdr((V83)); + goto TTL; + goto T192; +T192:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[40]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));}} + } +} +/* function definition for PREP-TERM-FOR-PRINT */ + +static void L41() +{register object *base=vs_base; + register object *sup=base+VM41; VC41 + vs_check; + bds_check; + {object V97; + V97=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {object V98; + base[1]= (V97); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk87)(); + vs_top=sup; + V98= vs_base[0]; + base[3]= (V98); + vs_top=(vs_base=base+3)+1; + (void) (*Lnk88)(); + vs_top=sup; + base[2]= vs_base[0]; + vs_top=(vs_base=base+2)+1; + (void) (*Lnk89)(); + vs_top=sup; + base[1]= vs_base[0]; + bds_bind(((object)VV[41]),base[1]); + base[2]= (V98); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk86)(); + bds_unwind1; + return;} + } +} +/* function definition for ADD-TERM-LINKS */ + +static void L42() +{register object *base=vs_base; + register object *sup=base+VM42; VC42 + vs_check; + {register object V99; + V99=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {object V100= CMPcar((V99)); + if((V100!= ((object)VV[12])))goto T202; + V101= CMPcadr((V99)); + base[1]= CMPcddr((V99)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk90)(); + vs_top=sup; + V102= vs_base[0]; + base[1]= listA(3,((object)VV[12]),/* INLINE-ARGS */V101,V102); + vs_top=(vs_base=base+1)+1; + return; + goto T202; +T202:; + if((V100!= ((object)VV[27])))goto T205; + V103= CMPcadr((V99)); + base[1]= CMPcddr((V99)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk90)(); + vs_top=sup; + V104= vs_base[0]; + base[1]= listA(3,((object)VV[27]),/* INLINE-ARGS */V103,V104); + vs_top=(vs_base=base+1)+1; + return; + goto T205; +T205:; + if((V100!= ((object)VV[39])))goto T208; + base[1]= CMPcaadr((V99)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk87)(); + vs_top=sup; + V105= vs_base[0]; + base[1]= CMPcdadr((V99)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk87)(); + vs_top=sup; + V106= vs_base[0]; + V107= make_cons(V105,V106); + base[1]= CMPcddr((V99)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk90)(); + vs_top=sup; + V108= vs_base[0]; + base[1]= listA(3,((object)VV[39]),/* INLINE-ARGS */V107,V108); + vs_top=(vs_base=base+1)+1; + return; + goto T208; +T208:; + if((V100!= ((object)VV[35])))goto T215; + base[1]= CMPcaadr((V99)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk87)(); + vs_top=sup; + V109= vs_base[0]; + base[1]= CMPcdadr((V99)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk87)(); + vs_top=sup; + V110= vs_base[0]; + V111= make_cons(V109,V110); + base[1]= CMPcddr((V99)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk90)(); + vs_top=sup; + V112= vs_base[0]; + base[1]= listA(3,((object)VV[35]),/* INLINE-ARGS */V111,V112); + vs_top=(vs_base=base+1)+1; + return; + goto T215; +T215:; + if((V100!= ((object)VV[0])))goto T222; + V99= CMPcdr((V99)); + goto TTL; + goto T222; +T222:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[42]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));}} + } +} +/* function definition for ADD-TYPE-LINKS */ + +static void L43() +{register object *base=vs_base; + register object *sup=base+VM43; VC43 + vs_check; + {register object V113; + V113=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {object V114= CMPcar((V113)); + if((V114!= ((object)VV[0])))goto T226; + base[1]= CMPcdr((V113)); + vs_top=(vs_base=base+1)+1; + return; + goto T226; +T226:; + if((V114!= ((object)VV[47])))goto T227; + base[1]= (V113); + vs_top=(vs_base=base+1)+1; + return; + goto T227; +T227:; + if((V114!= ((object)VV[43])))goto T228; + {object V115= CMPcdr((V113)); + if(!(type_of(V115)==t_fixnum|| +type_of(V115)==t_bignum|| +type_of(V115)==t_ratio|| +type_of(V115)==t_shortfloat|| +type_of(V115)==t_longfloat|| +type_of(V115)==t_complex)){ + goto T230;}} + base[1]= (V113); + vs_top=(vs_base=base+1)+1; + return; + goto T230; +T230:; + if((CMPcdr((V113)))!=Cnil){ + goto T233;} + (((object)VV[44])->s.s_dbind)= number_plus((((object)VV[44])->s.s_dbind),small_fixnum(1)); + base[1]= make_cons(((object)VV[43]),(((object)VV[44])->s.s_dbind)); + vs_top=(vs_base=base+1)+1; + return; + goto T233; +T233:; + V113= CMPcdr((V113)); + goto TTL; + goto T228; +T228:; + V116= CMPcar((V113)); + {object V118; + object V119= CMPcdr((V113)); + if(V119==Cnil){ + V117= Cnil; + goto T238;} + base[1]=V118=MMcons(Cnil,Cnil); + goto T239; +T239:; + base[2]= (V119->c.c_car); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk90)(); + vs_top=sup; + (V118->c.c_car)= vs_base[0]; + if((V119=MMcdr(V119))==Cnil){ + V117= base[1]; + goto T238;} + V118=MMcdr(V118)=MMcons(Cnil,Cnil); + goto T239;} + goto T238; +T238:; + base[1]= make_cons(/* INLINE-ARGS */V116,V117); + vs_top=(vs_base=base+1)+1; + return;} + } +} +/* function definition for GET-TYPE-LINKS */ + +static void L44() +{register object *base=vs_base; + register object *sup=base+VM44; VC44 + vs_check; + {register object V120; + V120=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {object V121= CMPcar((V120)); + if((V121!= ((object)VV[0])) + && (V121!= ((object)VV[47])))goto T242; + base[1]= Cnil; + vs_top=(vs_base=base+1)+1; + return; + goto T242; +T242:; + if((V121!= ((object)VV[43])))goto T243; + {object V122= CMPcdr((V120)); + if(!(type_of(V122)==t_fixnum|| +type_of(V122)==t_bignum|| +type_of(V122)==t_ratio|| +type_of(V122)==t_shortfloat|| +type_of(V122)==t_longfloat|| +type_of(V122)==t_complex)){ + goto T245;}} + base[1]= make_cons(CMPcdr((V120)),Cnil); + vs_top=(vs_base=base+1)+1; + return; + goto T245; +T245:; + V120= CMPcdr((V120)); + goto TTL; + goto T243; +T243:; + {object V123; + {object V124; + object V125= CMPcdr((V120)); + if(V125==Cnil){ + V123= Cnil; + goto T249;} + base[1]=V124=MMcons(Cnil,Cnil); + goto T250; +T250:; + base[2]= (V125->c.c_car); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk91)(); + vs_top=sup; + (V124->c.c_car)= vs_base[0]; + if((V125=MMcdr(V125))==Cnil){ + V123= base[1]; + goto T249;} + V124=MMcdr(V124)=MMcons(Cnil,Cnil); + goto T250;} + goto T249; +T249:; + vs_top=base+1; + while(V123!=Cnil) + {vs_push((V123)->c.c_car);V123=(V123)->c.c_cdr;} + vs_base=base+1;} + Lappend(); + return;} + } +} +/* function definition for GET-TERM-LINKS */ + +static void L45() +{register object *base=vs_base; + register object *sup=base+VM45; VC45 + vs_check; + {register object V126; + V126=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {object V127= CMPcar((V126)); + if((V127!= ((object)VV[12])))goto T253; + base[1]= CMPcddr((V126)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk91)(); + return; + goto T253; +T253:; + if((V127!= ((object)VV[27])))goto T255; + base[1]= CMPcddr((V126)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk91)(); + return; + goto T255; +T255:; + if((V127!= ((object)VV[39])))goto T257; + base[1]= CMPcaadr((V126)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk88)(); + vs_top=sup; + V128= vs_base[0]; + base[1]= CMPcdadr((V126)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk88)(); + vs_top=sup; + V129= vs_base[0]; + base[1]= append(V128,V129); + vs_top=(vs_base=base+1)+1; + return; + goto T257; +T257:; + if((V127!= ((object)VV[35])))goto T262; + base[1]= CMPcaadr((V126)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk88)(); + vs_top=sup; + V130= vs_base[0]; + base[1]= CMPcdadr((V126)); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk88)(); + vs_top=sup; + V131= vs_base[0]; + base[1]= append(V130,V131); + vs_top=(vs_base=base+1)+1; + return; + goto T262; +T262:; + if((V127!= ((object)VV[0])))goto T267; + V126= CMPcdr((V126)); + goto TTL; + goto T267; +T267:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[45]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));}} + } +} +/* function definition for MAKE-LINK-NAMES */ + +static void L46() +{register object *base=vs_base; + register object *sup=base+VM46; VC46 + vs_check; + {object V132; + V132=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {register object V133; + register object V134; + register object V135; + V133= Cnil; + V134= Cnil; + V135= Cnil; + if(((V132))!=Cnil){ + goto T275;} + base[1]= make_cons(Cnil,Cnil); + vs_top=(vs_base=base+1)+1; + return; + goto T275; +T275:; + if(!(((long)length((V132)))==((long)1))){ + goto T273;} + V136= make_cons(CMPcar((V132)),((object)VV[46])); + base[1]= make_cons(/* INLINE-ARGS */V136,Cnil); + vs_top=(vs_base=base+1)+1; + return; + goto T273; +T273:; + V135= small_fixnum(1); + V133= (V132); + V134= Cnil; + goto T272; +T272:; + if(((V133))!=Cnil){ + goto T286;} + base[1]= (V134); + vs_top=(vs_base=base+1)+1; + return; + goto T286; +T286:; + {object V137; + {register object x= CMPcar((V133)),V138= (V134); + while(V138!=Cnil) + if(equal(x,V138->c.c_car->c.c_car) &&V138->c.c_car != Cnil){ + V137= (V138->c.c_car); + goto T288; + }else V138=V138->c.c_cdr; + V137= Cnil;} + goto T288; +T288:; + if(((V137))==Cnil){ + goto T290;} + goto T284; + goto T290; +T290:; + V139= CMPcar((V133)); + base[1]= ((object)VV[46]); + base[2]= (V135); + vs_top=(vs_base=base+1)+2; + (void) (*Lnk83)(); + vs_top=sup; + V140= vs_base[0]; + V141= make_cons(/* INLINE-ARGS */V139,V140); + V134= make_cons(/* INLINE-ARGS */V141,(V134)); + V135= one_plus((V135));} + goto T284; +T284:; + V133= CMPcdr((V133)); + goto T272;} + } +} +/* function definition for PREP-TY-FN */ + +static void L47() +{register object *base=vs_base; + register object *sup=base+VM47; VC47 + vs_check; + {register object V142; + V142=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {object V143= CMPcar((V142)); + if((V143!= ((object)VV[0])))goto T301; + base[1]= CMPcdr((V142)); + vs_top=(vs_base=base+1)+1; + return; + goto T301; +T301:; + if((V143!= ((object)VV[47])))goto T302; + base[1]= (V142); + vs_top=(vs_base=base+1)+1; + return; + goto T302; +T302:; + if((V143!= ((object)VV[43])))goto T303; + {object V144= CMPcdr((V142)); + if(!(type_of(V144)==t_fixnum|| +type_of(V144)==t_bignum|| +type_of(V144)==t_ratio|| +type_of(V144)==t_shortfloat|| +type_of(V144)==t_longfloat|| +type_of(V144)==t_complex)){ + goto T305;}} + {register object x= CMPcdr((V142)),V146= (((object)VV[41])->s.s_dbind); + while(V146!=Cnil) + if(equal(x,V146->c.c_car->c.c_car) &&V146->c.c_car != Cnil){ + V145= (V146->c.c_car); + goto T307; + }else V146=V146->c.c_cdr; + V145= Cnil;} + goto T307; +T307:; + base[1]= make_cons(((object)VV[47]),CMPcdr(V145)); + vs_top=(vs_base=base+1)+1; + return; + goto T305; +T305:; + V142= CMPcdr((V142)); + goto TTL; + goto T303; +T303:; + V147= CMPcar((V142)); + {object V149; + object V150= CMPcdr((V142)); + if(V150==Cnil){ + V148= Cnil; + goto T310;} + base[1]=V149=MMcons(Cnil,Cnil); + goto T311; +T311:; + base[2]= (V150->c.c_car); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk85)(); + vs_top=sup; + (V149->c.c_car)= vs_base[0]; + if((V150=MMcdr(V150))==Cnil){ + V148= base[1]; + goto T310;} + V149=MMcdr(V149)=MMcons(Cnil,Cnil); + goto T311;} + goto T310; +T310:; + base[1]= make_cons(/* INLINE-ARGS */V147,V148); + vs_top=(vs_base=base+1)+1; + return;} + } +} +/* function definition for PREP-TY-FOR-PRINT */ + +static void L48() +{register object *base=vs_base; + register object *sup=base+VM48; VC48 + vs_check; + bds_check; + {object V151; + V151=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {object V152; + base[1]= (V151); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk90)(); + vs_top=sup; + V152= vs_base[0]; + base[3]= (V152); + vs_top=(vs_base=base+3)+1; + (void) (*Lnk91)(); + vs_top=sup; + base[2]= vs_base[0]; + vs_top=(vs_base=base+2)+1; + (void) (*Lnk89)(); + vs_top=sup; + base[1]= vs_base[0]; + bds_bind(((object)VV[41]),base[1]); + base[2]= (V152); + vs_top=(vs_base=base+2)+1; + (void) (*Lnk85)(); + bds_unwind1; + return;} + } +} +/* function definition for PREP-TERM-TY */ + +static void L49() +{register object *base=vs_base; + register object *sup=base+VM49; VC49 + vs_check; + {object V153; + V153=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!((CMPcar((V153)))==(((object)VV[0])))){ + goto T321;} + base[1]= CMPcddr(CMPcdr((V153))); + vs_top=(vs_base=base+1)+1; + return; + goto T321; +T321:; + base[1]= CMPcddr((V153)); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for PRINT-MK_COMB-ERROR */ + +static void L50() +{register object *base=vs_base; + register object *sup=base+VM50; VC50 + vs_check; + {object V154; + object V155; + V154=(base[0]); + V155=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + base[2]= ((object)VV[48]); + base[3]= small_fixnum(27); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk92)(); + vs_top=sup; + base[2]= small_fixnum(2); + base[3]= small_fixnum(4); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk93)(); + vs_top=sup; + base[3]= (V154); + vs_top=(vs_base=base+3)+1; + (void) (*Lnk94)(); + vs_top=sup; + base[2]= vs_base[0]; + vs_top=(vs_base=base+2)+1; + (void) (*Lnk95)(); + vs_top=sup; + vs_base=vs_top; + (void) (*Lnk96)(); + vs_top=sup; + base[2]= ((object)VV[49]); + base[3]= small_fixnum(27); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk92)(); + vs_top=sup; + base[2]= small_fixnum(2); + base[3]= small_fixnum(4); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk93)(); + vs_top=sup; + base[4]= (V154); + vs_top=(vs_base=base+4)+1; + (void) (*Lnk97)(); + vs_top=sup; + base[3]= vs_base[0]; + vs_top=(vs_base=base+3)+1; + (void) (*Lnk98)(); + vs_top=sup; + base[2]= vs_base[0]; + vs_top=(vs_base=base+2)+1; + (void) (*Lnk99)(); + vs_top=sup; + vs_base=vs_top; + (void) (*Lnk96)(); + vs_top=sup; + base[2]= ((object)VV[50]); + base[3]= small_fixnum(27); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk92)(); + vs_top=sup; + base[2]= small_fixnum(2); + base[3]= small_fixnum(4); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk93)(); + vs_top=sup; + base[3]= (V155); + vs_top=(vs_base=base+3)+1; + (void) (*Lnk94)(); + vs_top=sup; + base[2]= vs_base[0]; + vs_top=(vs_base=base+2)+1; + (void) (*Lnk95)(); + vs_top=sup; + vs_base=vs_top; + (void) (*Lnk96)(); + vs_top=sup; + base[2]= ((object)VV[51]); + base[3]= small_fixnum(27); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk92)(); + vs_top=sup; + base[2]= small_fixnum(2); + base[3]= small_fixnum(4); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk93)(); + vs_top=sup; + base[4]= (V155); + vs_top=(vs_base=base+4)+1; + (void) (*Lnk97)(); + vs_top=sup; + base[3]= vs_base[0]; + vs_top=(vs_base=base+3)+1; + (void) (*Lnk98)(); + vs_top=sup; + base[2]= vs_base[0]; + vs_top=(vs_base=base+2)+1; + (void) (*Lnk99)(); + vs_top=sup; + vs_base=vs_top; + (void) (*Lnk96)(); + vs_top=sup; + vs_base=vs_top; + (void) (*Lnk96)(); + return; + } +} +/* function definition for Q-MK_COMB */ + +static void L51() +{register object *base=vs_base; + register object *sup=base+VM51; VC51 + vs_check; + {object V156; + object V157; + V156=(base[0]); + V157=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + {object V158; + vs_base=vs_top; + (void) (*Lnk78)(); + vs_top=sup; + V158= vs_base[0]; + base[3]= (V156); + vs_top=(vs_base=base+3)+1; + (void) (*Lnk68)(); + vs_top=sup; + base[2]= vs_base[0]; + base[4]= (V157); + vs_top=(vs_base=base+4)+1; + (void) (*Lnk68)(); + vs_top=sup; + V159= vs_base[0]; + V160= list(2,V159,(V158)); + base[3]= make_cons(((object)VV[36]),/* INLINE-ARGS */V160); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk69)(); + vs_top=sup; + if((vs_base[0])==Cnil){ + goto T367;} + base[2]= listA(3,((object)VV[39]),make_cons((V156),(V157)),(V158)); + vs_top=(vs_base=base+2)+1; + return; + goto T367; +T367:; + if(((((object)VV[52])->s.s_dbind))==Cnil){ + goto T374;} + base[2]= (V156); + base[3]= (V157); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk100)(); + vs_top=sup; + goto T374; +T374:; + {object V161; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[2]= ((object)VV[53]); + vs_top=(vs_base=base+2)+1; + unwind(fr,((object)VV[2]));} + base[2]= (V161); + vs_top=(vs_base=base+2)+1; + return;}} + } +} +/* function definition for ML-MK_COMB */ + +static void L52() +{register object *VOL base=vs_base; + register object *VOL sup=base+VM52; VC52 + vs_check; + {VOL object V162; + VOL object V163; + V162=(base[0]); + V163=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + {VOL object V164; + VOL object V165; + VOL object V166; + {VOL object V167; + frs_push(FRS_CATCH,((object)VV[2])); + if(nlj_active) + {nlj_active=FALSE;frs_pop(); + vs_top=sup; + V167= vs_base[0]; + goto T382;} + else{ + base[5]= CMPcddr((V162)); + vs_top=(vs_base=base+5)+1; + (void) (*Lnk101)(); + vs_top=sup; + V168= vs_base[0]; + V169= make_cons(V168,Cnil); + frs_pop(); + V167= V169;} + goto T382; +T382:; + if(!(type_of((V167))!=t_cons)){ + goto T387;} + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[5]= ((object)VV[53]); + vs_top=(vs_base=base+5)+1; + unwind(fr,((object)VV[2]));} + goto T387; +T387:; + V164= CMPcar((V167));} + V165= CMPcar((V164)); + V166= CMPcdr((V164)); + if(!(((V165))==(((object)VV[36])))){ + goto T393;} + if(!(equal(CMPcar((V166)),CMPcddr((V163))))){ + goto T393;} + base[5]= listA(3,((object)VV[39]),make_cons((V162),(V163)),CMPcadr((V166))); + vs_top=(vs_base=base+5)+1; + return; + goto T393; +T393:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[5]= ((object)VV[53]); + vs_top=(vs_base=base+5)+1; + unwind(fr,((object)VV[2]));}} + } +} +/* function definition for ML-IS_COMB */ + +static void L53() +{register object *base=vs_base; + register object *sup=base+VM53; VC53 + vs_check; + {object V171; + V171=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= ((CMPcar((V171)))==(((object)VV[39]))?Ct:Cnil); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-DEST_COMB */ + +static void L54() +{register object *base=vs_base; + register object *sup=base+VM54; VC54 + vs_check; + {object V172; + V172=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!(eql(CMPcar((V172)),((object)VV[39])))){ + goto T400;} + V173= CMPcdr((V172)); + goto T398; + goto T400; +T400:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[54]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));} + goto T398; +T398:; + base[1]= CMPcar(V173); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for Q-MK_TYPED */ + +static void L55() +{register object *base=vs_base; + register object *sup=base+VM55; VC55 + vs_check; + {object V174; + object V175; + V174=(base[0]); + V175=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + base[3]= (V174); + vs_top=(vs_base=base+3)+1; + (void) (*Lnk68)(); + vs_top=sup; + base[2]= vs_base[0]; + base[4]= (V175); + vs_top=(vs_base=base+4)+1; + (void) (*Lnk104)(); + vs_top=sup; + base[3]= vs_base[0]; + vs_top=(vs_base=base+2)+2; + (void) (*Lnk69)(); + vs_top=sup; + if((vs_base[0])==Cnil){ + goto T404;} + base[2]= (V174); + vs_top=(vs_base=base+2)+1; + return; + goto T404; +T404:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[2]= ((object)VV[55]); + vs_top=(vs_base=base+2)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for Q-MK_PAIR */ + +static void L56() +{register object *base=vs_base; + register object *sup=base+VM56; VC56 + vs_check; + {object V176; + object V177; + V176=(base[0]); + V177=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + base[4]= ((object)VV[56]); + vs_top=(vs_base=base+4)+1; + (void) (*Lnk105)(); + vs_top=sup; + base[3]= vs_base[0]; + base[4]= (V176); + vs_top=(vs_base=base+3)+2; + (void) (*Lnk106)(); + vs_top=sup; + base[2]= vs_base[0]; + base[3]= (V177); + vs_top=(vs_base=base+2)+2; + (void) (*Lnk106)(); + return; + } +} +/* function definition for Q-MK_COND */ + +static void L57() +{register object *base=vs_base; + register object *sup=base+VM57; VC57 + vs_check; + {object V178; + object V179; + object V180; + V178=(base[0]); + V179=(base[1]); + V180=(base[2]); + vs_top=sup; + goto TTL; +TTL:; + base[6]= ((object)VV[57]); + vs_top=(vs_base=base+6)+1; + (void) (*Lnk105)(); + vs_top=sup; + base[5]= vs_base[0]; + base[6]= (V178); + vs_top=(vs_base=base+5)+2; + (void) (*Lnk106)(); + vs_top=sup; + base[4]= vs_base[0]; + base[5]= (V179); + vs_top=(vs_base=base+4)+2; + (void) (*Lnk106)(); + vs_top=sup; + base[3]= vs_base[0]; + base[4]= (V180); + vs_top=(vs_base=base+3)+2; + (void) (*Lnk106)(); + return; + } +} +/* function definition for Q-MK_VARTYPE */ + +static void L58() +{register object *base=vs_base; + register object *sup=base+VM58; VC58 + vs_check; + {register object V181; + V181=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {object V182; + {object V183 =((V181))->s.s_plist; + object ind= ((object)VV[58]); + while(V183!=Cnil){ + if(V183->c.c_car==ind){ + V182= (V183->c.c_cdr->c.c_car); + goto T423; + }else V183=V183->c.c_cdr->c.c_cdr;} + V182= Cnil;} + goto T423; +T423:; + if(((V182))==Cnil){ + goto T425;} + base[1]= (V182); + vs_top=(vs_base=base+1)+1; + return; + goto T425; +T425:; + base[1]= (V181); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk107)(); + vs_top=sup; + V184= vs_base[0]; + if(!(number_compare(CMPcar(V184),small_fixnum(42))==0)){ + goto T428;} + V185= make_cons(((object)VV[47]),(V181)); + base[1]= sputprop((V181),((object)VV[58]),/* INLINE-ARGS */V185); + vs_top=(vs_base=base+1)+1; + return; + goto T428; +T428:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[58]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));}} + } +} +/* function definition for ML-IS_VARTYPE */ + +static void L59() +{register object *base=vs_base; + register object *sup=base+VM59; VC59 + vs_check; + {object V186; + V186=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= ((CMPcar((V186)))==(((object)VV[47]))?Ct:Cnil); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-DEST_VARTYPE */ + +static void L60() +{register object *base=vs_base; + register object *sup=base+VM60; VC60 + vs_check; + {object V187; + V187=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!((CMPcar((V187)))==(((object)VV[47])))){ + goto T434;} + base[1]= CMPcdr((V187)); + vs_top=(vs_base=base+1)+1; + return; + goto T434; +T434:; + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[59]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));} + } +} +/* function definition for Q-MK_TYPE */ + +static void L61() +{register object *base=vs_base; + register object *sup=base+VM61; VC61 + vs_check; + {object V188; + object V189; + V188=(base[0]); + V189=(base[1]); + vs_top=sup; + goto TTL; +TTL:; + {object V191 =((V188))->s.s_plist; + object ind= ((object)VV[60]); + while(V191!=Cnil){ + if(V191->c.c_car==ind){ + V190= (V191->c.c_cdr->c.c_car); + goto T440; + }else V191=V191->c.c_cdr->c.c_cdr;} + V190= Cnil;} + goto T440; +T440:; + V192 = CMPmake_fixnum((long)length((V189))); + if(equal(V190,V192)){ + goto T438;} + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[2]= ((object)VV[61]); + vs_top=(vs_base=base+2)+1; + unwind(fr,((object)VV[2]));} + goto T438; +T438:; + if(((V189))!=Cnil){ + goto T443;} + {object V193 =((V188))->s.s_plist; + object ind= ((object)VV[62]); + while(V193!=Cnil){ + if(V193->c.c_car==ind){ + base[2]= (V193->c.c_cdr->c.c_car); + vs_top=(vs_base=base+2)+1; + return; + }else V193=V193->c.c_cdr->c.c_cdr;} + base[2]= Cnil; + vs_top=(vs_base=base+2)+1; + return;} + goto T443; +T443:; + base[2]= make_cons((V188),(V189)); + vs_top=(vs_base=base+2)+1; + return; + } +} +/* function definition for ML-DEST_TYPE */ + +static void L62() +{register object *base=vs_base; + register object *sup=base+VM62; VC62 + vs_check; + {object V194; + V194=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + if(!((CMPcar((V194)))==(((object)VV[47])))){ + goto T446;} + {frame_ptr fr; + fr=frs_sch_catch(((object)VV[2])); + if(fr==NULL) FEerror("The tag ~s is undefined.",1,((object)VV[2])); + base[1]= ((object)VV[63]); + vs_top=(vs_base=base+1)+1; + unwind(fr,((object)VV[2]));} + goto T446; +T446:; + base[1]= (V194); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-TYPE_OF */ + +static void L63() +{register object *base=vs_base; + register object *sup=base+VM63; VC63 + vs_check; + {object V195; + V195=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= CMPcddr((V195)); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for Q-TYPEOF */ + +static void L64() +{register object *base=vs_base; + register object *sup=base+VM64; VC64 + vs_check; + {object V196; + V196=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= (V196); + vs_top=(vs_base=base+1)+1; + (void) (*Lnk70)(); + vs_top=sup; + V197= vs_base[0]; + base[1]= CMPcddr(V197); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for STRIP-ANTIQUOT */ + +static void L65() +{register object *base=vs_base; + register object *sup=base+VM65; VC65 + vs_check; + {register object V198; + V198=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + goto T453; +T453:; + if(!((CMPcar((V198)))==(((object)VV[0])))){ + goto T456;} + V198= CMPcdr((V198)); + goto T453; + goto T456; +T456:; + goto T451; + goto T451; + goto T451; +T451:; + base[1]= (V198); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-THM_COUNT */ + +static void L66() +{register object *base=vs_base; + register object *sup=base+VM66; VC66 + vs_check; + vs_top=sup; + goto TTL; +TTL:; + base[0]= (((object)VV[64])->s.s_dbind); + vs_top=(vs_base=base+0)+1; + return; +} +/* function definition for ML-MK_THM */ + +static void L67() +{register object *base=vs_base; + register object *sup=base+VM67; VC67 + vs_check; + {object V199; + V199=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + (((object)VV[64])->s.s_dbind)= number_plus((((object)VV[64])->s.s_dbind),small_fixnum(1)); + base[1]= (V199); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for ML-DEST_THM */ + +static void L68() +{register object *base=vs_base; + register object *sup=base+VM68; VC68 + vs_check; + {object V200; + V200=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + base[1]= (V200); + vs_top=(vs_base=base+1)+1; + return; + } +} +/* function definition for PREDICATEP */ + +static void L69() +{register object *base=vs_base; + register object *sup=base+VM69; VC69 + vs_check; + {object V201; + V201=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {object V202 =((V201))->s.s_plist; + object ind= ((object)VV[65]); + while(V202!=Cnil){ + if(V202->c.c_car==ind){ + base[1]= (V202->c.c_cdr->c.c_car); + vs_top=(vs_base=base+1)+1; + return; + }else V202=V202->c.c_cdr->c.c_cdr;} + base[1]= Cnil; + vs_top=(vs_base=base+1)+1; + return;} + } +} +/* function definition for CONSTP */ + +static void L70() +{register object *base=vs_base; + register object *sup=base+VM70; VC70 + vs_check; + {object V203; + V203=(base[0]); + vs_top=sup; + goto TTL; +TTL:; + {object V204 =((V203))->s.s_plist; + object ind= ((object)VV[27]); + while(V204!=Cnil){ + if(V204->c.c_car==ind){ + base[1]= (V204->c.c_cdr->c.c_car); + vs_top=(vs_base=base+1)+1; + return; + }else V204=V204->c.c_cdr->c.c_cdr;} + base[1]= Cnil; + vs_top=(vs_base=base+1)+1; + return;} + } +} +static void LnkT107(){ call_or_link(((object)VV[107]),(void **)(void *)&Lnk107);} /* EXPLODEN */ +static void LnkT106(){ call_or_link(((object)VV[106]),(void **)(void *)&Lnk106);} /* Q-MK_COMB */ +static void LnkT105(){ call_or_link(((object)VV[105]),(void **)(void *)&Lnk105);} /* Q-MK_CONST */ +static void LnkT104(){ call_or_link(((object)VV[104]),(void **)(void *)&Lnk104);} /* Q-MK_ANTIQUOT */ +static object LnkTLI103(object first,...){object V1;va_list ap;va_start(ap,first);V1=call_proc_new(((object)VV[103]),(void **)(void *)&LnkLI103,1,first,ap);va_end(ap);return V1;} /* SECOND */ +static object LnkTLI102(object first,...){object V1;va_list ap;va_start(ap,first);V1=call_proc_new(((object)VV[102]),(void **)(void *)&LnkLI102,1,first,ap);va_end(ap);return V1;} /* FIRST */ +static void LnkT101(){ call_or_link(((object)VV[101]),(void **)(void *)&Lnk101);} /* ML-DEST_TYPE */ +static void LnkT100(){ call_or_link(((object)VV[100]),(void **)(void *)&Lnk100);} /* PRINT-MK_COMB-ERROR */ +static void LnkT99(){ call_or_link(((object)VV[99]),(void **)(void *)&Lnk99);} /* ML-PRINT_TYPE */ +static void LnkT98(){ call_or_link(((object)VV[98]),(void **)(void *)&Lnk98);} /* PREP-TY-FOR-PRINT */ +static void LnkT97(){ call_or_link(((object)VV[97]),(void **)(void *)&Lnk97);} /* PREP-TERM-TY */ +static void LnkT96(){ call_or_link(((object)VV[96]),(void **)(void *)&Lnk96);} /* PNEWLINE */ +static void LnkT95(){ call_or_link(((object)VV[95]),(void **)(void *)&Lnk95);} /* ML-PRINT_TERM */ +static void LnkT94(){ call_or_link(((object)VV[94]),(void **)(void *)&Lnk94);} /* PREP-TERM-FOR-PRINT */ +static void LnkT93(){ call_or_link(((object)VV[93]),(void **)(void *)&Lnk93);} /* PBREAK */ +static void LnkT92(){ call_or_link(((object)VV[92]),(void **)(void *)&Lnk92);} /* PSTRINGLEN */ +static void LnkT91(){ call_or_link(((object)VV[91]),(void **)(void *)&Lnk91);} /* GET-TYPE-LINKS */ +static void LnkT90(){ call_or_link(((object)VV[90]),(void **)(void *)&Lnk90);} /* ADD-TYPE-LINKS */ +static void LnkT89(){ call_or_link(((object)VV[89]),(void **)(void *)&Lnk89);} /* MAKE-LINK-NAMES */ +static void LnkT88(){ call_or_link(((object)VV[88]),(void **)(void *)&Lnk88);} /* GET-TERM-LINKS */ +static void LnkT87(){ call_or_link(((object)VV[87]),(void **)(void *)&Lnk87);} /* ADD-TERM-LINKS */ +static void LnkT86(){ call_or_link(((object)VV[86]),(void **)(void *)&Lnk86);} /* PREP-TERM-FN */ +static void LnkT85(){ call_or_link(((object)VV[85]),(void **)(void *)&Lnk85);} /* PREP-TY-FN */ +static void LnkT84(){ call_or_link(((object)VV[84]),(void **)(void *)&Lnk84);} /* ML-MK_ABS */ +static void LnkT83(){ call_or_link(((object)VV[83]),(void **)(void *)&Lnk83);} /* CONCAT */ +static void LnkT81(){ call_or_link(((object)VV[81]),(void **)(void *)&Lnk81);} /* MK_REALVAR */ +static void LnkT80(){ call_or_link(((object)VV[80]),(void **)(void *)&Lnk80);} /* UNIQUESYM */ +static void LnkT79(){ call_or_link(((object)VV[79]),(void **)(void *)&Lnk79);} /* CONSPROP */ +static void LnkT78(){ call_or_link(((object)VV[78]),(void **)(void *)&Lnk78);} /* GENLINK */ +static void LnkT77(){ call_or_link(((object)VV[77]),(void **)(void *)&Lnk77);} /* NEW-VAR-TYPE */ +static void LnkT76(){ call_or_link(((object)VV[76]),(void **)(void *)&Lnk76);} /* ASSOC1 */ +static void LnkT75(){ call_or_link(((object)VV[75]),(void **)(void *)&Lnk75);} /* Q-MK_PRED */ +static void LnkT74(){ call_or_link(((object)VV[74]),(void **)(void *)&Lnk74);} /* Q-MK_PAIR */ +static void LnkT73(){ call_or_link(((object)VV[73]),(void **)(void *)&Lnk73);} /* ML-MK_EXISTS */ +static void LnkT72(){ call_or_link(((object)VV[72]),(void **)(void *)&Lnk72);} /* ML-MK_FORALL */ +static void LnkT71(){ call_or_link(((object)VV[71]),(void **)(void *)&Lnk71);} /* Q-FREE-VAR */ +static void LnkT70(){ call_or_link(((object)VV[70]),(void **)(void *)&Lnk70);} /* STRIP-ANTIQUOT */ +static void LnkT69(){ call_or_link(((object)VV[69]),(void **)(void *)&Lnk69);} /* UNIFY */ +static void LnkT68(){ call_or_link(((object)VV[68]),(void **)(void *)&Lnk68);} /* Q-TYPEOF */ +static void LnkT67(){ call_or_link(((object)VV[67]),(void **)(void *)&Lnk67);} /* OMUTANT */ +static void LnkT66(){ call_or_link(((object)VV[66]),(void **)(void *)&Lnk66);} /* PREDICATEP */ --- 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/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/numeral/Manual/Makefile +++ hol88-2.02.19940316/Library/numeral/Manual/Makefile @@ -15,19 +15,19 @@ all:; make clean; make thms; make ids; m 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:; \ --- hol88-2.02.19940316.orig/Library/latex-hol/Manual/Makefile +++ hol88-2.02.19940316/Library/latex-hol/Manual/Makefile @@ -28,16 +28,16 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: ids @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 --- 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/string/Manual/Makefile +++ hol88-2.02.19940316/Library/string/Manual/Makefile @@ -26,24 +26,24 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: ids theorems @echo "TeX files made" ids: - @echo "\chapter{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: --- 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/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/wellorder/Manual/Makefile +++ hol88-2.02.19940316/Library/wellorder/Manual/Makefile @@ -14,26 +14,26 @@ all:; make clean; make tex; make wellord 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:; \ --- hol88-2.02.19940316.orig/Library/reduce/Manual/Makefile +++ hol88-2.02.19940316/Library/reduce/Manual/Makefile @@ -15,13 +15,13 @@ all:; make clean; make ids; make reduce; 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:; \ --- 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/finite_sets/Manual/Makefile +++ hol88-2.02.19940316/Library/finite_sets/Manual/Makefile @@ -26,45 +26,45 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: 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: --- 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 @@ for some {\small\verb%ri%}. \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 @@ DELETE_CONV. \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/pair/Manual/Makefile +++ hol88-2.02.19940316/Library/pair/Manual/Makefile @@ -26,19 +26,19 @@ default: # --------------------------------------------------------------------- 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: --- 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/window/Manual/Makefile +++ hol88-2.02.19940316/Library/window/Manual/Makefile @@ -26,24 +26,24 @@ default: # --------------------------------------------------------------------- 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: --- 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/parser/Manual/Makefile +++ hol88-2.02.19940316/Library/parser/Manual/Makefile @@ -25,20 +25,20 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: ids theorems @echo "TeX files made" ids: - @echo "\chapter{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 --- 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/record_proof/Manual/Makefile +++ hol88-2.02.19940316/Library/record_proof/Manual/Makefile @@ -27,17 +27,17 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: 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: --- 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/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/word/Manual/Makefile +++ hol88-2.02.19940316/Library/word/Manual/Makefile @@ -27,33 +27,33 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: 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: --- 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/pred_sets/Manual/Makefile +++ hol88-2.02.19940316/Library/pred_sets/Manual/Makefile @@ -25,47 +25,47 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: 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: --- 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 @@ for some {\small\verb%ri%}. \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 @@ DELETE_CONV. \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/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/reals/Manual/Makefile +++ hol88-2.02.19940316/Library/reals/Manual/Makefile @@ -15,34 +15,34 @@ all:; make clean; make tex; make reals; 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:; \ --- hol88-2.02.19940316.orig/Library/prettyp/Manual/Makefile +++ hol88-2.02.19940316/Library/prettyp/Manual/Makefile @@ -26,16 +26,16 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: ids @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: --- 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 @@ function to include no type information 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 @@ Never fails. 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/taut/Manual/Makefile +++ hol88-2.02.19940316/Library/taut/Manual/Makefile @@ -26,16 +26,16 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: ids @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: --- 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/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/sets/Manual/Makefile +++ hol88-2.02.19940316/Library/sets/Manual/Makefile @@ -26,49 +26,49 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: 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: --- 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 @@ for some {\small\verb%ri%}. \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 @@ DELETE_CONV. \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/unwind/Manual/Makefile +++ hol88-2.02.19940316/Library/unwind/Manual/Makefile @@ -26,16 +26,16 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: ids @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: --- 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/abs_theory/Manual/Makefile +++ hol88-2.02.19940316/Library/abs_theory/Manual/Makefile @@ -15,13 +15,13 @@ all:; make clean; make ids; make abs_the 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:; \ --- hol88-2.02.19940316.orig/Library/arith/Manual/Makefile +++ hol88-2.02.19940316/Library/arith/Manual/Makefile @@ -26,16 +26,16 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: ids @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: --- 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/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/Library/res_quan/Manual/Makefile +++ hol88-2.02.19940316/Library/res_quan/Manual/Makefile @@ -27,22 +27,22 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: 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: --- 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 @@ COND_REWR_CANON, search_top_down. \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 @@ choice quantification. 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 @@ GQSPEC, GQSPEC_ALL, SPECL, GENL, RESQ_GE 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 @@ Fails if applied to a term not of the co 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 @@ free in the assumption list except in {\ 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 @@ RESQ_IMP_RES_TAC, RESQ_IMP_RES_THEN, RES 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 @@ COND_REWRITE1_CONV, COND_REWR_CONV, COND \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 @@ restricted universally quantified variab 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/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/more_arithmetic/Manual/Makefile +++ hol88-2.02.19940316/Library/more_arithmetic/Manual/Makefile @@ -26,40 +26,40 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: ids theorems @echo "TeX files made" ids: - @echo "\chapter{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: --- 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/trs/Manual/Makefile +++ hol88-2.02.19940316/Library/trs/Manual/Makefile @@ -26,16 +26,16 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: ids @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: --- 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/contrib/wordn/Manual/Makefile +++ hol88-2.02.19940316/contrib/wordn/Manual/Makefile @@ -26,27 +26,27 @@ default: # --------------------------------------------------------------------- clean: rm -f *.dvi *.aux *.toc *.log *.idx *.ilg - @echo "\begin{theindex}" > index.tex - @echo "\mbox{}" >> index.tex - @echo "\end{theindex}" >> index.tex + @printf '\\begin{theindex}' > index.tex + @printf '\\mbox{}' >> index.tex + @printf '\\end{theindex}' >> index.tex tex: 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: debian/dirs0000644000000000000000000000001011465026074010046 0ustar usr/bin debian/site_ml_orig0000644000000000000000000000422611465026074011576 0ustar %=============================================================================% % 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/`;; % debian/changelog0000644000000000000000000001020512241774657011055 0ustar hol88 (2.02.19940316-19) unstable; urgency=low * build against latest gcl -- Camm Maguire Sat, 16 Nov 2013 18:01:29 +0000 hol88 (2.02.19940316-18) unstable; urgency=low * build against latest gcl -- Camm Maguire Sat, 12 Oct 2013 14:23:29 +0000 hol88 (2.02.19940316-17) unstable; urgency=low * build against latest gcl -- Camm Maguire Tue, 24 Sep 2013 18:57:50 +0000 hol88 (2.02.19940316-16) unstable; urgency=low * build against latest gcl -- Camm Maguire Wed, 07 Aug 2013 21:26:12 +0000 hol88 (2.02.19940316-15) unstable; urgency=low * lintian fixes * 3.0 quilt source format -- Camm Maguire Wed, 11 Apr 2012 18:43:47 +0000 hol88 (2.02.19940316-14) unstable; urgency=low * rebuild against latest gcl -- Camm Maguire Tue, 17 Jan 2012 19:45:44 +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