diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet
index 832a02a..1e8bbac 100644
--- a/books/bookvol5.pamphlet
+++ b/books/bookvol5.pamphlet
@@ -49408,7 +49408,7 @@ Given \verb|("one" "two" "three")| generate \verb|"(one,two,three)"|
(setq options (cdr G167749))
(progn
(setq |$path| '(|functions| |cache|))
- (setq |htPage| (|htInitPage| (|mkSetTitle|) nil))
+ (setq htPage (|htInitPage| (|mkSetTitle|) nil))
(setq |$valueList| nil)
(|htMakePage|
'((|text|
@@ -50813,7 +50813,7 @@ There are 8 parts of an htPage:
(let (|$conformsAreDomains| lt1 kind name nargs args constring domname
conform conname heading data conlist attrlist oplist prefix page)
(declare (special |$conformsAreDomains|))
- (setq lt1 (|htpProperty| htPage '|TPDparts|))
+ (setq lt1 (|htpProperty| htPage '|parts|))
(setq kind (first lt1))
(setq name (second lt1))
(setq nargs (third lt1))
@@ -51047,6 +51047,378 @@ There are 8 parts of an htPage:
\end{chunk}
+\defun{kcPage}{kcPage}
+\calls{kcPage}{htpProperty}
+\calls{kcPage}{kDomainName}
+\calls{kcPage}{qcar}
+\calls{kcPage}{errorPage}
+\calls{kcPage}{opOf}
+\calls{kcPage}{form2HtString}
+\calls{kcPage}{htInitPage}
+\calls{kcPage}{htCopyProplist}
+\calls{kcPage}{htpSetProperty}
+\calls{kcPage}{dbpHasDefaultCategory?}
+\calls{kcPage}{htSay}
+\calls{kcPage}{brCon}
+\calls{kcPage}{htSayStandard}
+\calls{kcPage}{htBeginMenu}
+\calls{kcPage}{htMakePage}
+\calls{kcPage}{satBreak}
+\calls{kcPage}{asharpConstructorName?}
+\calls{kcPage}{nequal}
+\calls{kcPage}{hget}
+\calls{kcPage}{hasNewInfoAlist}
+\calls{kcPage}{htEndMenu}
+\calls{kcPage}{htShowPage}
+\usesdollar{kcPage}{defaultPackageNamesHT}
+\begin{chunk}{defun kcPage}
+(defun |kcPage| (htPage junk)
+ (declare (ignore junk))
+ (let (lt1 kind name nargs xpart domname conform conname heading page message)
+ (declare (special |$defaultPackageNamesHT|))
+ (setq lt1 (|htpProperty| htPage '|parts|))
+ (setq kind (first lt1))
+ (setq name (second lt1))
+ (setq nargs (third lt1))
+ (setq xpart (fourth lt1))
+ (setq domname (|kDomainName| htPage kind name nargs))
+ (cond
+ ((and (consp domname) (eq (qcar domname) '|error|))
+ (|errorPage| htPage domname))
+ (t
+ (setq conform (|htpProperty| htPage '|conform|))
+ (setq conname (|opOf| conform))
+ (setq heading
+ (if (null domname)
+ (|htpProperty| htPage '|heading|)
+ (list "{\\sf " (|form2HtString| domname nil t) "}")))
+ (setq page
+ (|htInitPage| (cons "Cross Reference for " heading)
+ (|htCopyProplist| htPage)))
+ (when domname
+ (|htpSetProperty| htPage '|domname| domname)
+ (|htpSetProperty| htPage '|heading| heading))
+ (when (and (string= kind "category")
+ (|dbpHasDefaultCategory?| xpart))
+ (|htSay| "This category has default package ")
+ (|bcCon| (concat name (|char| '&)) ""))
+ (|htSayStandard| "\\newline")
+ (|htBeginMenu| 3)
+ (|htSayStandard| "\\item ")
+ (setq message
+ (if (string= kind "category")
+ (list "Categories it directly extends")
+ (list "Categories the "
+ (if (string= kind "default package") "package" kind)
+ " belongs to by assertion")))
+ (|htMakePage|
+ (list
+ (list '|bcLinks|
+ (list "\\menuitemstyle{Parents}"
+ (list (list '|text| "\\tab{12}" message)) '|kcpPage| nil))))
+ (|satBreak|)
+ (setq message
+ (if (string= kind "category")
+ (list "All categories it is an extension of")
+ (list "All categories the " kind " belongs to")))
+ (|htMakePage|
+ (list
+ (list '|bcLinks|
+ (list "\\menuitemstyle{Ancestors}"
+ (list (list '|text| "\\tab{12}" message)) '|kcaPage| nil))))
+ (when (string= kind "category")
+ (|satBreak|)
+ (|htMakePage|
+ (list
+ (list '|bcLinks|
+ (list "\\menuitemstyle{Children}"
+ (list (list '|text| "\\tab{12}"
+ "Categories which directly extend this category"))))))
+ (|satBreak|)
+ (|htMakePage|
+ (list
+ (list '|bcLinks|
+ (list "\\menuitemstyle{Descendants}"
+ (list (list '|text| "\\tab{12}"
+ "All categories which extend this category")))))))
+ (unless (|asharpConstructorName?| conname)
+ (|satBreak|)
+ (setq message "Constructors mentioning this as an argument type")
+ (|htMakePage|
+ (list
+ (list '|bcLinks|
+ (list "\\menuitemstyle{Dependents}"
+ (list (list '|text| "\\tab{12}" message)) '|kcdePage| nil)))))
+ (when (and (null (|asharpConstructorName?| conname))
+ (nequal kind "category"))
+ (|satBreak|)
+ (|htMakePage|
+ (list
+ (list '|bcLinks|
+ (list "\\menuitemstyle{Lineage}"
+ "\\tab{12}Constructor hierarchy used for operation lookup"
+ '|ksPage| nil)))))
+ (unless (|asharpConstructorName?| conname)
+ (when (string= kind "category")
+ (|satBreak|)
+ (|htMakePage|
+ (list
+ (list '|bcLinks|
+ (list "\\menuitemstyle{Domains}"
+ (list (list '|text| "\\tab{12}"
+ "All domains which are of this category"))
+ '|kcdoPage| nil)))))
+ (unless (string= kind "category")
+ (|satBreak|)
+ (|htMakePage|
+ (list
+ (list '|bcLinks|
+ (list "\\menuitemstyle{Clients}" "\\tab{12}Constructors"
+ '|kcuPage| nil))))
+ (if (hget |$defaultPackageNamesHT| conname)
+ (|htSay| " which {\\em may use} this default package")
+ (|htSay| " which {\\em use} this " kind))))
+ (when (or (nequal kind "category") (|dbpHasDefaultCategory?| xpart))
+ (|satBreak|)
+ (setq message
+ (if (string= kind "category")
+ (list "Constructors {\\em used by} its default package")
+ (list "Constructors {\\em used by} the " kind)))
+ (|htMakePage|
+ (list
+ (list '|bcLinks|
+ (list "\\menuitemstyle{Benefactors}"
+ (list (list '|text| "\\tab{12}" message) '|kcnPage| nil))))))
+ (when (and (null (|asharpConstructorName?| conname))
+ (|hasNewInfoAlist| conname))
+ (|satBreak|)
+ (setq message (list "Cross reference for capsule implementation"))
+ (|htMakePage|
+ (list
+ (list '|bcLinks|
+ (list "\\menuitemstyle{CapsuleInfo}"
+ (list (list '|text| "\\tab{12}" message)) '|kciPage| nil)))))
+ (|htEndMenu| 3)
+ (|htShowPage|)))))
+
+\end{chunk}
+
+\defun{kcpPage}{kcpPage}
+\calls{kcpPage}{htpProperty}
+\calls{kcpPage}{kDomainName}
+\calls{kcpPage}{errorPage}
+\calls{kcpPage}{qcar}
+\calls{kcpPage}{form2HtString}
+\calls{kcpPage}{htpSetProperty}
+\calls{kcpPage}{opOf}
+\calls{kcpPage}{htInitPage}
+\calls{kcpPage}{htCopyProplist}
+\calls{kcpPage}{parentsOf}
+\calls{kcpPage}{sublislis}
+\calls{kcpPage}{dbShowCons}
+\begin{chunk}{defun kcpPage}
+(defun |kcpPage| (htPage junk)
+ (declare (ignore junk))
+ (let (lt1 kind name nargs domname heading conform conname page parents choice)
+ (setq lt1 (|htpProperty| htPage '|parts|))
+ (setq kind (first lt1))
+ (setq name (second lt1))
+ (setq nargs (third lt1))
+ (setq domname (|kDomainName| htPage kind name nargs))
+ (cond
+ ((and (consp domname) (eq (qcar domname) '|error|))
+ (|errorPage| htPage domname))
+ (t
+ (setq heading
+ (if (null domname)
+ (|htpProperty| htPage '|heading|)
+ (list "{\\sf " (|form2HtString| domname nil t) "}")))
+ (when domname
+ (|htpSetProperty| htPage '|domname| domname)
+ (|htpSetProperty| htPage '|heading| heading))
+ (setq conform (|htpProperty| htPage '|conform|))
+ (setq conname (|opOf| conform))
+ (setq page
+ (|htInitPage| (cons "Parents of " heading) (|htCopyProplist| htPage)))
+ (setq parents (|parentsOf| conname))
+ (when domname
+ (setq parents (sublislis (cdr domname) (cdr conform) parents)))
+ (|htpSetProperty| htPage '|cAlist| parents)
+ (|htpSetProperty| htPage '|thing| "parent")
+ (setq choice (if domname '|parameters| '|names|))
+ (|dbShowCons| htPage choice)))))
+
+\end{chunk}
+
+\defun{reduceAlistForDomain}{reduceAlistForDomain}
+\calls{reduceAlistForDomain}{sublislis}
+\calls{reduceAlistForDomain}{simpHasPred}
+\calls{reduceAlistForDomain}{nreverse0}
+\begin{chunk}{defun reduceAlistForDomain}
+(defun |reduceAlistForDomain| (alist domform conform)
+ (let (pred result)
+ (setq alist (sublislis (cdr domform) (cdr conform) alist))
+ (dolist (pair alist)
+ (rplacd pair (|simpHasPred| (cdr pair) domform)))
+ (dolist (pair alist (nreverse0 result))
+ (setq pred (cdr pair))
+ (when pred (setq result (cons pair result))))))
+
+\end{chunk}
+
+\defun{kcaPage}{kcaPage}
+\calls{kcaPage}{kcaPage1}
+\calls{kcaPage}{ancestorsOf}
+\begin{chunk}{defun kcaPage}
+(defun |kcaPage| (htPage junk)
+ (declare (ignore junk))
+ (|kcaPage1| htPage "category" " an "
+ "ancestor" (|function| |ancestorsOf|) nil))
+
+\end{chunk}
+
+\defun{kcdPage}{kcdPage}
+\calls{kcdPage}{kcaPage1}
+\calls{kcdPage}{descendantsOf}
+\begin{chunk}{defun kcdPage}
+(defun |kcdPage| (htPage junk)
+ (declare (ignore junk))
+ (|kcaPage1| htPage "category" " a "
+ "descendant" (|function| |descendantsOf|) t))
+
+\end{chunk}
+
+\defun{kcdoPage}{kcdoPage}
+\calls{kcdoPage}{kcdoPage}
+\calls{kcdoPage}{domainsOf}
+\begin{chunk}{defun kcdoPage}
+(defun |kcdoPage| (htPage junk)
+ (declare (ignore junk))
+ (|kcaPage1| htPage "domain" " a "
+ "descendant" (|function| |domainsOf|) nil))
+
+\end{chunk}
+
+\defun{kcaPage1}{kcaPage1}
+\calls{kcaPage1}{htpProperty}
+\calls{kcaPage1}{kDomainName}
+\calls{kcaPage1}{errorPage}
+\calls{kcaPage1}{form2HtString}
+\calls{kcaPage1}{htpSetProperty}
+\calls{kcaPage1}{opOf}
+\calls{kcaPage1}{augmentHasArgs}
+\calls{kcaPage1}{listSort}
+\calls{kcaPage1}{function}
+\calls{kcaPage1}{dbShowCons}
+\begin{chunk}{defun kcaPage1}
+(defun |kcaPage1| (htPage kind article whichever fn isCatDescendants?)
+ (declare (ignore article))
+ (let (lt1 name nargs domname heading conform conname ancestors choice)
+ (setq lt1 (|htpProperty| htPage '|parts|))
+ (setq kind (first lt1))
+ (setq name (second lt1))
+ (setq nargs (third lt1))
+ (setq domname (|kDomainName| htPage kind name nargs))
+ (cond
+ ((and (consp domname) (eq (qcar domname) '|error|))
+ (|errorPage| htPage domname))
+ (t
+ (setq heading
+ (if (null domname)
+ (|htpProperty| htPage '|heading|)
+ (list "{\\sf " (|form2HtString| domname nil t) "}")))
+ (when (and domname (null isCatDescendants?))
+ (|htpSetProperty| htPage '|domname| domname)
+ (|htpSetProperty| htPage '|heading| heading))
+ (setq conform (|htpProperty| htPage '|conform|))
+ (setq conname (|opOf| conform))
+ (setq ancestors (FUNCALL fn conform domname))
+ (unless (string= whichever "ancestor")
+ (setq ancestors (|augmentHasArgs| ancestors conform)))
+ (setq ancestors (|listSort| (|function| glesseqp) ancestors))
+ (|htpSetProperty| htPage '|cAlist| ancestors)
+ (|htpSetProperty| htPage '|thing| whichever)
+ (setq choice '|names|)
+ (|dbShowCons| htPage choice)))))
+
+\end{chunk}
+
+\defun{kccPage}{kccPage}
+\calls{kccPage}{htpProperty}
+\calls{kccPage}{kDomainName}
+\calls{kccPage}{qcar}
+\calls{kccPage}{errorPage}
+\calls{kccPage}{form2HtString}
+\calls{kccPage}{htpSetProperty}
+\calls{kccPage}{opOf}
+\calls{kccPage}{htInitPage}
+\calls{kccPage}{htCopyProplist}
+\calls{kccPage}{augmentHasArgs}
+\calls{kccPage}{childrenOf}
+\calls{kccPage}{reduceAlistForDomain}
+\calls{kccPage}{dbShowCons}
+\begin{chunk}{defun kccPage}
+(defun |kccPage| (htPage junk)
+ (declare (ignore junk))
+ (let (lt1 kind name nargs domname heading conform conname page children)
+ (setq lt1 (|htpProperty| htPage '|parts|))
+ (setq kind (first lt1))
+ (setq name (second lt1))
+ (setq nargs (third lt1))
+ (setq domname (|kDomainName| htPage kind name nargs))
+ (cond
+ ((and (consp domname) (eq (qcar domname) '|error|))
+ (|errorPage| htPage domname))
+ (t
+ (setq heading
+ (if (null domname)
+ (|htpProperty| htPage '|heading|)
+ (list "{\\sf " (|form2HtString| domname nil t) "}")))
+ (when domname
+ (|htpSetProperty| htPage '|domname| domname)
+ (|htpSetProperty| htPage '|heading| heading))
+ (setq conform (|htpProperty| htPage '|conform|))
+ (setq conname (|opOf| conform))
+ (setq page
+ (|htInitPage| (cons "Children of " heading) (|htCopyProplist| htPage)))
+ (setq children (|augmentHasArgs| (|childrenOf| conform) conform))
+ (when domname
+ (setq children (|reduceAlistForDomain| children domname conform)))
+ (|htpSetProperty| htPage '|cAlist| children)
+ (|htpSetProperty| htPage '|thing| "child")
+ (|dbShowCons| htPage '|names|)))))
+
+\end{chunk}
+
+\defun{augmentHasArgs}{augmentHasArgs}
+\calls{augmentHasArgs}{opOf}
+\calls{augmentHasArgs}{kdr}
+\calls{augmentHasArgs}{length}
+\calls{augmentHasArgs}{nreverse0}
+\calls{augmentHasArgs}{extractHasArgs}
+\calls{augmentHasArgs}{getConstructorForm}
+\begin{chunk}{defun augmentHasArgs}
+(defun |augmentHasArgs| (alist conform)
+ (let (conname args n name p result pred)
+ (setq conname (|opOf| conform))
+ (setq args (kdr conform))
+ (cond
+ (args
+ (setq n (|#| args))
+ (dolist (item alist (nreverse0 result))
+ (setq name (car item))
+ (setq p (cdr item))
+ (setq pred
+ (if (consp (|extractHasArgs| p))
+ p
+ (|quickAnd| p
+ (cons '|hasArgs|
+ (take n (kdr (|getConstructorForm| (|opOf| name))))))))
+ (setq result (cons (cons name pred) result))))
+ (t alist))))
+
+\end{chunk}
+
\chapter{The Interpreter}
\begin{chunk}{Interpreter}
(setq *print-array* nil)
@@ -51480,6 +51852,7 @@ There are 8 parts of an htPage:
\getchunk{defun alreadyOpened?}
\getchunk{defun apropos}
\getchunk{defun assertCond}
+\getchunk{defun augmentHasArgs}
\getchunk{defun augmentTraceNames}
\getchunk{defun basicLookup}
@@ -52014,6 +52387,13 @@ There are 8 parts of an htPage:
\getchunk{defun justifyMyType}
\getchunk{defun kArgPage}
+\getchunk{defun kcaPage}
+\getchunk{defun kcaPage1}
+\getchunk{defun kccPage}
+\getchunk{defun kcdPage}
+\getchunk{defun kcdoPage}
+\getchunk{defun kcPage}
+\getchunk{defun kcpPage}
\getchunk{defun kdPageInfo}
\getchunk{defun KeepPart?}
\getchunk{defun kePage}
@@ -52650,6 +53030,7 @@ There are 8 parts of an htPage:
\getchunk{defun recordNewValue0}
\getchunk{defun recordOldValue}
\getchunk{defun recordOldValue0}
+\getchunk{defun reduceAlistForDomain}
\getchunk{defun redundant}
\getchunk{defun regress}
\getchunk{defun remFile}
diff --git a/changelog b/changelog
index a1605e3..279b352 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,6 @@
+20130531 tpd src/axiom-website/patches.html 20130531.01.tpd.patch
+20130531 tpd src/interp/br-con.lisp move code to bookvol5
+20130531 tpd books/bookvol5 rewrite code from br-con
20130529 jzc src/axiom-website/patches.html 20130529.01.jzc.patch
20130529 jzc books/bookvol4 fix typos
20130529 jzc books/bookvol2 fix typos
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 86b590a..a6a89d7 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -4189,6 +4189,8 @@ books/bookvol5 incremental rewrite of br-con.lisp
books/bookvol* standardize the table of contents
20130529.01.jzc.patch
books/bookvol{0,1,2,4} fix typos
+20130531.01.tpd.patch
+books/bookvol5 rewrite code from br-con