diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet
index cef4206..306f3eb 100644
--- a/books/bookvol5.pamphlet
+++ b/books/bookvol5.pamphlet
@@ -50421,6 +50421,360 @@ Given \verb|("one" "two" "three")| generate \verb|"(one,two,three)"|
\end{chunk}
+\chapter{Browser Support Code}
+\calls{conPage}{form2HtString}
+\calls{conPage}{downcase}
+\calls{conPage}{lassq}
+\calls{conPage}{downlink}
+\calls{conPage}{conPageFastPath}
+\calls{conPage}{kPage}
+\calls{conPage}{ySearch}
+\usesdollar{conPage}{conArgstrings}
+\defun{conPage}{conPage}
+\begin{chunk}{defun conPage}
+(defun |conPage| (&rest arglist)
+ (let (|$conArgstrings| form da pageName line a b)
+ (declare (special |$conArgstrings|))
+ (setq a (car arglist))
+ (setq b (cdr arglist))
+ (setq form (cond ((atom a) (cons a b)) (t a)))
+ (setq |$conArgstrings| (loop for x in (cdr a) collect (|form2HtString| x)))
+ (cond ((null (atom a)) (setq a (car a))))
+ (setq da (downcase a))
+ (cond
+ ((setq pageName
+ (lassq da
+ '((|type| . |CategoryType|)
+ (|union| . |DomainUnion|)
+ (|record| . |DomainRecord|)
+ (|mapping| . |DomainMapping|)
+ (|enumeration| . |DomainEnumeration|))))
+ (|downlink| pageName))
+ ((setq line (|conPageFastPath| da)) (|kPage| line form))
+ ((setq line (|conPageFastPath| (upcase a))) (|kPage| line form))
+ (t (|ySearch| a)))))
+
+\end{chunk}
+
+\defun{conPageFastPath}{gets line quickly for constructor name or abbreviation}
+\calls{conPageFastPath}{length}
+\calls{conPageFastPath}{stringimage}
+\calls{conPageFastPath}{charPosition}
+\calls{conPageFastPath}{lassq}
+\calls{conPageFastPath}{dbRead}
+\calls{conPageFastPath}{conPageConEntry}
+\usesdollar{conPageFastPath}{lowerCaseConTb}
+\begin{chunk}{defun conPageFastPath}
+(defun |conPageFastPath| (x)
+ (let (s name entry lineNumber)
+ (declare (special |$lowerCaseConTb|))
+ (setq s (stringimage x))
+ (unless (> (|#| s) (|charPosition| #\* s 0)) ; quit if name has * in it
+ (setq name (cond ((stringp x) (intern x)) (t x)))
+ (setq entry (hget |$lowerCaseConTb| name))
+ (when entry
+ ;'dbLineNumbers property is set by function dbAugmentConstructorDataTable
+ (if (setq lineNumber (lassq '|dbLineNumber| (cddr entry)))
+ (|dbRead| lineNumber)
+ (|conPageConEntry| (car entry)))))))
+
+\end{chunk}
+
+\defun{conPageConEntry}{conPageConEntry}
+\calls{conPageConEntry}{buildLIbdbConEntry}
+\usesdollar{conPageConEntry}{conname}
+\usesdollar{conPageConEntry}{conform}
+\usesdollar{conPageConEntry}{exposed?}
+\usesdollar{conPageConEntry}{doc}
+\usesdollar{conPageConEntry}{kind}
+\begin{chunk}{defun conPageConEntry}
+(defun |conPageConEntry| (entry)
+ (let (|$conname| |$conform| |$exposed?| |$doc| |$kind|)
+ (declare (special |$conname| |$conform| |$exposed?| |$doc| |$kind|))
+ (setq |$conname| nil)
+ (setq |$conform| nil)
+ (setq |$exposed?| nil)
+ (setq |$doc| nil)
+ (setq |$kind| nil)
+ (|buildLibdbConEntry| entry)))))
+
+\end{chunk}
+
+\defun{kdPageInfo}{kdPageInfo}
+\calls{kdPageInfo}{htSay}
+\calls{kdPageInfo}{nequal}
+\calls{kdPageInfo}{bcHt}
+\calls{kdPageInfo}{stringimage}
+\calls{kdPageInfo}{htSaturnBreak}
+\calls{kdPageInfo}{htSayStandard}
+\calls{kdPageInfo}{kPageArgs}
+\calls{kdPageInfo}{length}
+\calls{kdPageInfo}{extractFileNameFromPath}
+\calls{kdPageInfo}{subseq}
+\calls{kdPageInfo}{getdatabase}
+\calls{kdPageInfo}{htSay}
+\calls{kdPageInfo}{htMakePage}
+\begin{chunk}{defun kdPageInfo}
+(defun |kdPageInfo| (name abbrev nargs conform signature file?)
+ (let (sourceFileName filename)
+ (|htSay| '|{\\sf | name "}")
+ (when (nequal abbrev name) (|bcHt| (list '| has abbreviation | abbrev)))
+ (when file? (|bcHt| (list " is a source file.")))
+ (cond
+ ((eql nargs 0)
+ (when (nequal abbrev name) (|bcHt| ".")))
+ (t
+ (when (nequal abbrev name) (|bcHt| " and"))
+ (|bcHt|
+ (if (eql nargs 1)
+ " takes one argument:"
+ (list '| takes | (stringimage nargs) '| arguments:|)))))
+ (|htSaturnBreak|)
+ (|htSayStandard| "\\indentrel{2}")
+ (when (> nargs 0) (|kPageArgs| conform signature))
+ (|htSayStandard| "\\indentrel{-2}")
+ (when (char= (elt name (1- (|#| name))) #\&)
+ (setq name (subseq name 0 (1- (|#| name)))))
+ (setq sourceFileName (getdatabase (intern name) 'sourcefile))
+ (setq filename (|extractFileNameFromPath| sourceFileName))
+ (when (nequal filename "")
+ (|htSayStandard| "\\newline{}")
+ (|htSay| "The source code for the constructor is found in "))
+ (|htMakePage|
+ (list (list '|text| "\\unixcommand{" filename "}{\\$AXIOM/lib/SPADEDIT "
+ sourceFileName " " name "}")))
+ (when (nequal nargs 0) (|htSay| "."))
+ (|htSaturnBreak|)))
+
+\end{chunk}
+
+\defun{kArgPage}{kArgPage}
+\calls{kArgPage}{htpProperty}
+\calls{kArgPage}{getConstructorModemap}
+\calls{kArgPage}{position}
+\calls{kArgPage}{sublisFormal}
+\calls{kArgPage}{mkDomTypeForm}
+\calls{kArgPage}{domainDescendantsOf}
+\calls{kArgPage}{htpSetProperty}
+\calls{kArgPage}{dbShowCons}
+\begin{chunk}{defun kArgPage}
+(defun |kArgPage| (htPage arg)
+ (let (conform op args domname source n typeForm domTypeForm descendants rank)
+ (setq conform (|htpProperty| htPage '|conform|))
+ (setq op (car conform))
+ (setq args (cdr conform))
+ (setq domname (|htpProperty| htPage '|domname|))
+ (setq source (cddar (|getConstructorModemap| op)))
+ (setq n (|position| arg args))
+ (setq typeForm (|sublisFormal| args (elt source n)))
+ (setq domTypeForm (|mkDomTypeForm| typeForm conform domname))
+ (setq descendants (|domainDescendantsOf| typeForm domTypeForm))
+ (|htpSetProperty| htPage '|cAlist| descendants)
+ (setq rank
+ (unless (> n 4) (elt '(|First| |Second| |Third| |Fourth| |Fifth|) n)))
+ (|htpSetProperty| htPage '|rank| rank)
+ (|htpSetProperty| htPage '|thing| "argument")
+ (|dbShowCons| htPage '|names|)))
+
+\end{chunk}
+
+\defun{reportCategory}{reportCategory}
+\calls{reportCategory}{htSay}
+\calls{reportCategory}{categoryParts}
+\calls{reportCategory}{bcConform}
+\calls{reportCategory}{bcPred}
+\calls{reportCategory}{bcConPredTable}
+\calls{reportCategory}{reportAO}
+\begin{chunk}{defun reportCategory}
+(defun |reportCategory| (conform typeForm arg)
+ (let (lt1 conlist attrlist oplist)
+ (|htSay| "Argument {\\em " arg "}")
+ (setq lt1 (|categoryParts| conform typeForm t))
+ (setq conlist (car lt1))
+ (setq attrlist (cadr lt1))
+ (setq oplist (cddr lt1))
+ (|htSay| " must ")
+ (cond
+ (conlist
+ (|htSay| "belong to ")
+ (cond
+ ((and (consp conlist) (eq (qcdr conlist) nil))
+ (|htSay| "category ")
+ (|bcConform| (caar conlist))
+ (|bcPred| (cdar conlist)))
+ (t
+ (|htSay| "categories:")
+ (|bcConPredTable| conlist (|opOf| conform))
+ (|htSay| "\\newline ")))))
+ (cond
+ (attrlist
+ (when conlist (|htSay| " and "))
+ (|reportAO| "attribute" attrlist)
+ (|htSay| "\\newline ")))
+ (cond
+ (oplist
+ (when (or conlist attrlist) (|htSay| " and "))
+ (|reportAO| "operation" oplist)))))
+
+\end{chunk}
+
+\defun{reportAO}{reportAO}
+\calls{reportAO}{htSay}
+\calls{reportAO}{satDownLink}
+\calls{reportAO}{escapeSpecialChars}
+\calls{reportAO}{form2HtString}
+\calls{reportAO}{bcConform}
+\begin{chunk}{defun reportAO}
+(defun |reportAO| (kind oplist)
+ (let (op sig pred attr ops sigs)
+ (|htSay| "have " kind ":")
+ (dolist (item oplist)
+ (setq op (car item))
+ (setq sig (cadr item))
+ (setq pred (cddr item))
+ (|htSay| "\\newline ")
+ (when (eql (|#| oplist) 1) (|htSay| "\\centerline{"))
+ (cond
+ ((string= kind "attribute")
+ (setq attr (|form2String| (cons op sig)))
+ (|satDownLink| attr (list "(|attrPage| '|" attr "|)" )))
+ (t
+ (setq ops (|escapeSpecialChars| (stringimage op)))
+ (setq sigs (|form2HtString| (cons '|Mapping| sig)))
+ (|satDownLink| ops (list "(|opPage| '|" ops "| |" sigs "|)"))
+ (|htSay| ": ")
+ (|bcConform| (cons '|Mapping| sig))))
+ (when (eql (|#| oplist) 1) (|htSay| "}")))
+ (|htSay| "\\newline ")))
+
+\end{chunk}
+
+\defun{mkDomTypeForm}{mkDomTypeForm}
+\calls{mkDomTypeForm}{sublislis}
+\calls{mkDomTypeForm}{mkDomTypeForm}
+\calls{mkDomTypeForm}{hasIndent}
+\begin{chunk}{defun mkDomTypeForm}
+(defun |mkDomTypeForm| (typeForm conform domname)
+ (cond
+ (domname (sublislis (cdr domname) (cdr conform) typeForm))
+ ((and (consp typeForm) (eq (qcar typeForm) '|Join|))
+ (cons '|Join|
+ (loop for t1 in (qcdr typeForm) collect
+ (|mkDomTypeForm| t1 conform domname))))
+ ((null (|hasIdent| typeForm)) typeForm)))
+
+\end{chunk}
+
+\defun{domainDescendantsOf}{domainDescendantsOf}
+\calls{domainDescendantsOf}{systemError}
+\calls{domainDescendantsOf}{simpHasPred}
+\calls{domainDescendantsOf}{quickAnd}
+\calls{domainDescendantsOf}{domainsOf}
+\calls{domainDescendantsOf}{ifcdr}
+\calls{domainDescendantsOf}{qcar}
+\calls{domainDescendantsOf}{qcdr}
+\calls{domainDescendantsOf}{assoc}
+\calls{domainDescendantsOf}{listSort}
+\calls{domainDescendantsOf}{function}
+\calls{domainDescendantsOf}{delete}
+\begin{chunk}{defun domainDescendantsOf}
+(defun |domainDescendantsOf| (conform domform)
+ (labels (
+ (catScreen (r alist)
+ (let (t1 item pred pred1 npred)
+ (dolist (x r)
+ (unless (and (consp x) (member (qcar x) '(attribute signature)))
+ (|systemError| x))
+ (setq alist
+ (dolist (anitem alist (nreverse0 t1))
+ (setq item (car anitem))
+ (setq pred (cdr anitem))
+ (when (and
+ (setq pred1 (|simpHasPred| (list '|has| item x)))
+ (setq npred (|quickAnd| pred1 pred)))
+ (setq t1 (cons (cons item npred) t1))))))
+ alist))
+ ; keep only those domains that appear in ALL parts of Join
+ (jfn (arg domlist)
+ (let (y r item pred u keepList alist)
+ (setq y (car arg))
+ (setq r (cdr arg))
+ (setq alist (|domainsOf| y (ifcar domlist)))
+ (dolist (x r)
+ (setq domlist (ifcdr domlist))
+ (when (and (consp x) (eq (qcar x) 'category) (consp (qcdr x)))
+ (setq alist (catScreen (cddr x) alist)))
+ (setq keepList nil)
+ (dolist (dom (|domainsOf| x (ifcar domlist)))
+ (setq item (car dom))
+ (setq pred (cdr dom))
+ (when (setq u (|assoc| item alist))
+ (setq keepList
+ (cons (cons item (|quickAnd| (cdr u) pred)) keepList))))
+ (setq alist keepList))
+ (dolist (pair alist)
+ (rplacd pair (|simpHasPred| (cdr pair))))
+ (|listSort| (|function| glesseqp) alist))))
+ (if (consp conform)
+ (cond
+ ((eq (qcar conform) '|Join|)
+ (jfn
+ (|delete| '(|Type| |Object|) (qcdr conform))
+ (|delete| '(|Type| |Object|) (ifcdr domform))))
+ ((eq (qcar conform) 'category) nil)
+ (t (|domainsOf| conform domform)))
+ (|domainsOf| conform domform))))
+
+\end{chunk}
+
+There are 8 parts of an htPage:
+\begin{enumerate}
+\item kind
+\item name
+\item nargs
+\item xflag
+\item sig
+\item args
+\item abbrev
+\item comments
+\end{enumerate}
+
+\defun{kiPage}{kiPage}
+\calls{kiPage}{htpProperty}
+\calls{kiPage}{mkConform}
+\calls{kiPage}{kDomainName}
+\calls{kiPage}{errorPage}
+\calls{kiPage}{capitalize}
+\calls{kiPage}{htInitPage}
+\calls{kiPage}{htCopyProplist}
+\calls{kiPage}{dbShowConsDoc1}
+\calls{kiPage}{htShowPage}
+\usesdollar{kiPage}{conformsAreDomains}
+\begin{chunk}{defun kiPage}
+(defun |kiPage| (htPage junk)
+ (declare (ignore junk))
+ (let (lt1 kind name nargs args conform domname heading page)
+ (declare (special |$conformsAreDomains|))
+ (setq lt1 (|htpProperty| htPage '|parts|))
+ (setq kind (first lt1))
+ (setq name (second lt1))
+ (setq nargs (third lt1))
+ (setq args (sixth lt1))
+ (setq conform (|mkConform| kind name args))
+ (setq domname (|kDomainName| htPage kind name nargs))
+ (cond
+ ((and (consp domname) (eq (qcar domname) '|error|))
+ (|errorPage| htPage domname))
+ (t
+ (setq heading
+ (list "Description of " (|capitalize| kind) " {\\sf " name args "}"))
+ (setq page (|htInitPage| heading (|htCopyProplist| htPage)))
+ (setq |$conformsAreDomains| domname)
+ (|dbShowConsDoc1| htPage conform nil)
+ (|htShowPage|)))))
+
+\end{chunk}
+
\chapter{The Interpreter}
\begin{chunk}{Interpreter}
(setq *print-array* nil)
@@ -51005,6 +51359,9 @@ Given \verb|("one" "two" "three")| generate \verb|"(one,two,three)"|
\getchunk{defun compressOpen}
\getchunk{defun computeDomainVariableAlist}
\getchunk{defun condErrorMsg}
+\getchunk{defun conPage}
+\getchunk{defun conPageConEntry}
+\getchunk{defun conPageFastPath}
\getchunk{defun constoken}
\getchunk{defun constructSubst}
\getchunk{defun containsVars}
@@ -51065,6 +51422,7 @@ Given \verb|("one" "two" "three")| generate \verb|"(one,two,three)"|
\getchunk{defun displayValue}
\getchunk{defun displayWorkspaceNames}
\getchunk{defun doDoitButton}
+\getchunk{defun domainDescendantsOf}
\getchunk{defun domainToGenvar}
\getchunk{defun domArg}
\getchunk{defun domArg2}
@@ -51382,7 +51740,10 @@ Given \verb|("one" "two" "three")| generate \verb|"(one,two,three)"|
\getchunk{defun justifyMyType}
+\getchunk{defun kArgPage}
+\getchunk{defun kdPageInfo}
\getchunk{defun KeepPart?}
+\getchunk{defun kiPage}
\getchunk{defun lassocSub}
\getchunk{defun lastTokPosn}
@@ -51452,6 +51813,7 @@ Given \verb|("one" "two" "three")| generate \verb|"(one,two,three)"|
\getchunk{defun messageprint-2}
\getchunk{defun mkCurryFun}
\getchunk{defun mkDomPvar}
+\getchunk{defun mkDomTypeForm}
\getchunk{defun mkEvalable}
\getchunk{defun mkEvalableMapping}
\getchunk{defun mkEvalableRecord}
@@ -52024,6 +52386,8 @@ Given \verb|("one" "two" "three")| generate \verb|"(one,two,three)"|
\getchunk{defun replacePercentByDollar,fn}
\getchunk{defun replacePercentByDollar}
\getchunk{defun replaceSharps}
+\getchunk{defun reportAO}
+\getchunk{defun reportCategory}
\getchunk{defun reportOperations}
\getchunk{defun reportOpsFromLisplib}
\getchunk{defun reportOpsFromLisplib0}
diff --git a/changelog b/changelog
index f5314f6..7c5d723 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,6 @@
+20130526 tpd src/axiom-website/patches.html 20130526.03.tpd.patch
+20130526 tpd src/interp/br-con.lisp incremental rewrite of br-con.lisp
+20130526 tpd books/bookvol5 incremental rewrite of br-con.lisp
20130526 tpd src/axiom-website/patches.html 20130526.02.tpd.patch
20130526 tpd src/interp/regress.lisp improve diff output
20130526 tpd src/axiom-website/patches.html 20130526.01.tpd.patch
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index c289427..04bc71b 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -4183,6 +4183,8 @@ buglist remove error message for deleted files
books/bookvol10.* fix failing test cases
20130526.02.tpd.patch
src/interp/regress.lisp improve diff output
+20130526.03.tpd.patch
+books/bookvol5 incremental rewrite of br-con.lisp