diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index 00218bc..60b91af 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -6403,6 +6403,38 @@ output is an old-parser-style s-expression. @ +\defun{float2Sex}{Convert a float to an S-expression} +\usesdollar{float2Sex}{useBFasDefault} +<>= +(defun |float2Sex| (num) + (let (exp frac bfForm fracPartString intPart dotIndex expPart mantPart eIndex) + (declare (special |$useBFasDefault|)) + (setq eIndex (search "e" num)) + (if eIndex + (setq mantPart (subseq num 0 eIndex)) + (setq mantPart num)) + (if eIndex + (setq expPart (read-from-string (subseq num (+ eIndex 1)))) + (setq expPart 0)) + (setq dotIndex (search "." mantPart)) + (if dotIndex + (setq intPart (read-from-string (subseq mantPart 0 dotIndex))) + (setq intPart (read-from-string mantPart))) + (if dotIndex + (setq fracPartString (subseq mantPart (+ dotIndex 1))) + (setq fracPartString 0)) + (setq bfForm + (make-float intPart (read-from-string fracPartString) + (length fracPartString) expPart)) + (if |$useBFasDefault| + (progn + (setq frac (cadr bfForm)) + (setq exp (cddr bfForm)) + (list (list '|$elt| (list '|Float|) '|float|) frac exp 10)) + bfForm))) + +@ + \defun{pfApplication2Sex}{Change an Application node to an S-expression} \calls{pfApplication2Sex}{pfOp2Sex} \calls{pfApplication2Sex}{pfApplicationOp} @@ -6489,6 +6521,101 @@ output is an old-parser-style s-expression. @ +\defun{pfSuchThat2Sex}{Convert a SuchThat node to an S-expression} +\calls{pfSuchThat2Sex}{pf0TupleParts} +\calls{pfSuchThat2Sex}{pf2Sex1} +\calls{pfSuchThat2Sex}{pf2Sex} +\usesdollar{pfSuchThat2Sex}{predicateList} +<>= +(defun |pfSuchThat2Sex| (args) + (let (rhsSex lhsSex argList name) + (declare (special |$predicateList|)) + (setq name (gentemp)) + (setq argList (|pf0TupleParts| args)) + (setq lhsSex (|pf2Sex1| (car argList))) + (setq rhsSex (|pf2Sex| (cadr argList))) + (setq |$predicateList| + (cons (cons name (cons lhsSex rhsSex)) |$predicateList|)) + name)) + +@ + +\defun{pfOp2Sex}{pfOp2Sex} +\calls{pfOp2Sex}{pf2Sex1} +\calls{pfOp2Sex}{pmDontQuote?} +\calls{pfOp2Sex}{pfSymbol?} +\usesdollar{pfOp2Sex}{quotedOpList} +\usesdollar{pfOp2Sex}{insideRule} +<>= +(defun |pfOp2Sex| (pf) + (let (realOp tmp1 op alreadyQuoted) + (declare (special |$quotedOpList| |$insideRule|)) + (setq alreadyQuoted (|pfSymbol?| pf)) + (setq op (|pf2Sex1| pf)) + (cond + ((and (consp op) + (eq (car op) 'quote) + (progn + (setq tmp1 (cdr op)) + (and (consp tmp1) + (eq (cdr tmp1) nil) + (progn + (setq realOp (car tmp1)) t)))) + (cond + ((eq |$insideRule| '|left|) realOp) + ((eq |$insideRule| '|right|) + (cond + ((|pmDontQuote?| realOp) realOp) + (t + (setq |$quotedOpList| (cons op |$quotedOpList|)) + op))) + ((eq realOp '|\||) realOp) + ((eq realOp '|:|) realOp) + ((eq realOp '?) realOp) + (t op))) + (t op)))) + +@ + +\defun{pmDontQuote?}{pmDontQuote?} +\calls{pmDontQuote?}{memq} +<>= +(defun |pmDontQuote?| (sy) + (memq sy + '(+ - * ** ^ / |log| |exp| |pi| |sqrt| |ei| |li| |erf| |ci| + |si| |dilog| |sin| |cos| |tan| |cot| |sec| |csc| |asin| + |acos| |atan| |acot| |asec| |acsc| |sinh| |cosh| |tanh| + |coth| |sech| |csch| |asinh| |acosh| |atanh| |acoth| + |asech| |acsc|))) + +@ + +\defun{hasOptArgs?}{hasOptArgs?} +<>= +(defun |hasOptArgs?| (argSex) + (let (rhs lhs opt nonOpt tmp1 tmp2) + (dolist (|arg| argSex) + (cond + ((and (consp |arg|) + (eq (car |arg|) 'optarg) + (progn + (setq tmp1 (cdr |arg|)) + (and (consp tmp1) + (progn + (setq lhs (car tmp1)) + (setq tmp2 (cdr tmp1)) + (and (consp tmp2) + (eq (cdr tmp2) nil) + (progn + (setq rhs (car tmp2)) + t)))))) + (setq opt (cons (list lhs rhs) opt))) + (t (setq nonOpt (cons |arg| nonOpt))))) + (when opt + (nconc (nreverse nonOpt) (list (cons '|construct| (nreverse opt))))))) + +@ + \defun{pfSequence2Sex}{Convert a Sequence node to an S-expression} \calls{pfSequence2Sex}{pf2Sex1} \calls{pfSequence2Sex}{pf0SequenceArgs} @@ -6774,6 +6901,78 @@ output is an old-parser-style s-expression. @ +\defun{pfLambdaTran}{Convert a Lambda node to an S-expression} +\calls{pfLambdaTran}{pfLambda?} +\calls{pfLambdaTran}{pf0LambdaArgs} +\calls{pfLambdaTran}{pfTyped?} +\calls{pfLambdaTran}{pfCollectArgTran} +\calls{pfLambdaTran}{pfTypedId} +\calls{pfLambdaTran}{pfNothing?} +\calls{pfLambdaTran}{pfTypedType} +\calls{pfLambdaTran}{pf2Sex1} +\calls{pfLambdaTran}{systemError} +\calls{pfLambdaTran}{pfLambdaRets} +\calls{pfLambdaTran}{pfLambdaBody} +<>= +(defun |pfLambdaTran| (pf) + (let (retType argList argTypeList) + (cond + ((|pfLambda?| pf) + (dolist (arg (|pf0LambdaArgs| pf)) + (if (|pfTyped?| arg) + (progn + (setq argList + (cons (|pfCollectArgTran| (|pfTypedId| arg)) argList)) + (if (|pfNothing?| (|pfTypedType| arg)) + (setq argTypeList (cons nil argTypeList)) + (setq argTypeList + (cons (|pf2Sex1| (|pfTypedType| arg)) argTypeList)))) + (|systemError| "definition args should be typed"))) + (setq argList (nreverse argList)) + (unless (|pfNothing?| (|pfLambdaRets| pf)) + (setq retType (|pf2Sex1| (|pfLambdaRets| pf)))) + (setq argTypeList (cons retType (nreverse argTypeList))) + (cons argList + (list argTypeList + (mapcar #'(lambda (x) nil) argTypeList) + (|pf2Sex1| (|pfLambdaBody| pf))))) + (t (cons '|id| (list '(nil) '(nil) (|pf2Sex1| pf))))))) + +@ + +\defun{pfCollectArgTran}{pfCollectArgTran} +\calls{pfCollectArgTran}{pfCollect?} +\calls{pfCollectArgTran}{pf2sex1} +\calls{pfCollectArgTran}{pfParts} +\calls{pfCollectArgTran}{pfCollectIterators} +\calls{pfCollectArgTran}{pfCollectBody} +<>= +(defun |pfCollectArgTran| (pf) + (let (cond tmp2 tmp1 id conds) + (cond + ((|pfCollect?| pf) + (setq conds (mapcar #'|pf2sex1| (|pfParts| (|pfCollectIterators| pf)))) + (setq id (|pf2Sex1| (|pfCollectBody| pf))) + (cond + ((and (consp conds) ; conds is [ ["|", cond] ] + (eq (cdr conds) nil) + (progn + (setq tmp1 (car conds)) + (and (consp tmp1) + (eq (car tmp1) '|\||) + (progn + (setq tmp2 (cdr tmp1)) + (and (consp tmp2) + (eq (cdr tmp2) nil) + (progn + (setq cond (car tmp2)) + t)))))) + (list '|\|| id cond)) + (t (cons id conds)))) + (t (|pf2Sex1| pf))))) + +@ + \defun{pfLambda2Sex}{Convert a Lambda node to an S-expression} \calls{pfLambda2Sex}{pfLambdaTran} <>= @@ -6813,6 +7012,194 @@ output is an old-parser-style s-expression. @ +\defun{pfLhsRule2Sex}{Convert the Lhs of a Rule to an S-expression} +\calls{pfLhsRule2Sex}{pf2Sex1} +\usesdollar{pfLhsRule2Sex}{insideRule} +<>= +(defun |pfLhsRule2Sex| (lhs) + (let (|$insideRule|) + (declare (special |$insideRule|)) + (setq |$insideRule| '|left|) + (|pf2Sex1| lhs))) + +@ + +\defun{pfRhsRule2Sex}{Convert the Rhs of a Rule to an S-expression} +\calls{pfRhsRule2Sex}{pf2Sex1} +\usesdollar{pfRhsRule2Sex}{insideRule} +<>= +(defun |pfRhsRule2Sex| (rhs) + (let (|$insideRule|) + (declare (special |$insideRule|)) + (setq |$insideRule| '|right|) + (|pf2Sex1| rhs))) + +@ + +\defun{rulePredicateTran}{Convert a Rule predicate to an S-expression} +\begin{verbatim} +;rulePredicateTran rule == +; null $multiVarPredicateList => rule +; varList := patternVarsOf [rhs for [.,.,:rhs] in $multiVarPredicateList] +; predBody := +; CDR $multiVarPredicateList => +; ['AND, :[:pvarPredTran(rhs, varList) for [.,.,:rhs] in +; $multiVarPredicateList]] +; [ [.,.,:rhs],:.] := $multiVarPredicateList +; pvarPredTran(rhs, varList) +; ['suchThat, rule, +; ['construct, :[ ["QUOTE", var] for var in varList]], +; ['ADEF, '(predicateVariable), +; '((Boolean) (List (Expression (Integer)))), '(() ()), +; predBody]] +\end{verbatim} +\calls{rulePredicateTran}{patternVarsOf} +\calls{rulePredicateTran}{pvarPredTran} +\usesdollar{rulePredicateTran}{multiVarPredicateList} +<>= +(defun |rulePredicateTran| (rule) + (let (predBody varList rhs tmp1 result) + (declare (special |$multiVarPredicateList|)) + (if (null |$multiVarPredicateList|) + rule + (progn + (setq varList + (|patternVarsOf| + ((lambda (t1 t2 t3) + (loop + (cond + ((or (atom t2) + (progn + (setq t3 (car t2)) + nil)) + (return (nreverse t1))) + (t + (and (consp t3) + (progn + (setq tmp1 (cdr t3)) + (and (consp tmp1) + (progn + (setq rhs (cdr tmp1)) + t))) + (setq t1 (cons rhs t1))))) + (setq t2 (cdr t2)))) + nil |$multiVarPredicateList| nil))) + (setq predBody + (cond + ((cdr |$multiVarPredicateList|) + (cons 'and + ((lambda (t4 t5 t6) + (loop + (cond + ((or (atom t5) + (progn + (setq t6 (car t5)) + nil)) + (return (nreverse t4))) + (t + (and (consp t6) + (progn + (setq tmp1 (cdr t6)) + (and (consp tmp1) + (progn + (setq rhs (cdr tmp1)) + t))) + (setq t4 + (append (reverse (|pvarPredTran| rhs varList)) + t4))))) + (setq t5 (cdr t5)))) + nil |$multiVarPredicateList| nil))) + (t + (progn + (setq rhs (cddar |$multiVarPredicateList|)) + (|pvarPredTran| rhs varList))))) + (dolist (var varList) (push (list 'quote var) result)) + (list '|suchThat| rule + (cons '|construct| (nreverse result)) + (list 'adef '(|predicateVariable|) + '((|Boolean|) + (|List| (|Expression| (|Integer|)))) + '(nil nil) predBody)))))) + +@ + +\defun{patternVarsOf}{patternVarsOf} +\calls{patternVarsOf}{patternVarsOf1} +<>= +(defun |patternVarsOf| (expr) + (|patternVarsOf1| expr nil)) + +@ + +\defun{patternVarsOf1}{patternVarsOf1} +\calls{patternVarsOf1}{memq} +\calls{patternVarsOf1}{patternVarsOf1} +<>= +(defun |patternVarsOf1| (expr varList) + (let (argl op) + (cond + ((null expr) varList) + ((atom expr) + (cond + ((null (symbolp expr)) varList) + ((memq expr varList) varList) + (t (cons expr varList)))) + ((and (consp expr) + (progn + (setq op (car expr)) + (setq argl (cdr expr)) + t)) + (progn + (dolist (arg argl) + (setq varList (|patternVarsOf1| arg varList))) + varList)) + (t varList)))) + +@ + +\defun{pvarPredTran}{pvarPredTran} +<>= +(defun |pvarPredTran| (rhs varList) + (let ((i 0)) + (dolist (var varList rhs) + (setq rhs (nsubst (list '|elt| '|predicateVariable| (incf i)) var rhs))))) + +@ + +\defun{ruleLhsTran}{Convert the Lhs of a Rule node to an S-expression} +\calls{ruleLhsTran}{patternVarsOf} +\calls{ruleLhsTran}{nsubst} +\usesdollar{ruleLhsTran}{predicateList} +\usesdollar{ruleLhsTran}{multiVarPredicateList} +<>= +(defun |ruleLhsTran| (ruleLhs) + (let (predicate var vars predRhs predLhs name) + (declare (special |$predicateList| |$multiVarPredicateList|)) + (dolist (pred |$predicateList|) + (setq name (car pred)) + (setq predLhs (cadr pred)) + (setq predRhs (cddr pred)) + (setq vars (|patternVarsOf| predRhs)) + (cond + ((cdr vars) + (setq ruleLhs (nsubst predLhs name ruleLhs)) + (setq |$multiVarPredicateList| (cons pred |$multiVarPredicateList|))) + (t + (setq var (cadr predLhs)) + (setq predicate + (list '|suchThat| predLhs (list 'adef (list var) + '((|Boolean|) (|Expression| (|Integer|))) '(nil nil) predRhs))) + (setq ruleLhs (nsubst predicate name ruleLhs))))) + ruleLhs)) + +@ + +\defvar{dotdot} +<>= +(defvar |$dotdot| '|..|) + +@ + \defun{opTran}{Translate ops into internal symbols} \usesdollar{opTran}{dotdot} <>= @@ -7669,6 +8056,12 @@ Give message and throw to a recovery point. @ +\defvar{specificMsgTags} +<>= +(defvar |$specificMsgTags| nil) + +@ + \defun{isKeyQualityP}{isKeyQualityP} This seems dumb logic to me. There is nothing that iterates in the loop. Thus the value is either found immediate or never found at all. @@ -26804,38 +27197,38 @@ This reports the traced functions \calls{traceDomainConstructor}{traceDomainLocalOps} \usesdollar{traceDomainConstructor}{ConstructorCache} <>= -(defun |traceDomainConstructor| (|domainConstructor| options) - (prog (|listOfLocalOps| |argl| |domain| |innerDomainConstructor|) +(defun |traceDomainConstructor| (domainConstructor options) + (prog (listOfLocalOps argl domain innerDomainConstructor) (declare (special |$ConstructorCache|)) (return (seq (progn - (|loadFunctor| |domainConstructor|) - (setq |listOfLocalOps| (|getOption| 'local options)) - (when |listOfLocalOps| (|traceDomainLocalOps|)) + (|loadFunctor| domainConstructor) + (setq listOfLocalOps (|getOption| 'local options)) + (when listOfLocalOps (|traceDomainLocalOps|)) (cond - ((and |listOfLocalOps| (null (|getOption| 'ops options))) nil) + ((and listOfLocalOps (null (|getOption| 'ops options))) nil) (t - (do ((t2 (hget |$ConstructorCache| |domainConstructor|) (cdr t2)) + (do ((t2 (hget |$ConstructorCache| domainConstructor) (cdr t2)) (t3 nil)) ((or (atom t2) (progn (setq t3 (car t2)) nil) (progn (progn - (setq |argl| (car t3)) - (setq |domain| (cddr t3)) t3) + (setq argl (car t3)) + (setq domain (cddr t3)) t3) nil)) nil) (seq (exit - (|spadTrace| |domain| options)))) - (setq /tracenames (cons |domainConstructor| /tracenames)) - (setq |innerDomainConstructor| - (intern (concat |domainConstructor| ";"))) + (|spadTrace| domain options)))) + (setq /tracenames (cons domainConstructor /tracenames)) + (setq innerDomainConstructor + (intern (concat domainConstructor ";"))) (cond - ((fboundp |innerDomainConstructor|) - (setq |domainConstructor| |innerDomainConstructor|))) - (embed |domainConstructor| + ((fboundp innerDomainConstructor) + (setq domainConstructor innerDomainConstructor))) + (embed domainConstructor (cons 'lambda (cons (cons '&rest @@ -26843,18 +27236,18 @@ This reports the traced functions (cons (cons 'prog (cons - (cons '|domain| nil) + (cons 'domain nil) (cons (cons 'setq - (cons '|domain| + (cons 'domain (cons - (cons 'apply (cons |domainConstructor| + (cons 'apply (cons domainConstructor (cons 'args nil))) nil))) (cons (cons '|spadTrace| - (cons '|domain| + (cons 'domain (cons (mkq options) nil))) - (cons (cons 'return (cons '|domain| nil)) nil))))) + (cons (cons 'return (cons 'domain nil)) nil))))) nil))))))))))) @ @@ -26870,7 +27263,7 @@ This reports the traced functions \calls{untraceDomainConstructor,keepTraced?}{exit} \calls{untraceDomainConstructor,keepTraced?}{/untrace,0} <>= -(defun |untraceDomainConstructor,keepTraced?| (df |domainConstructor|) +(defun |untraceDomainConstructor,keepTraced?| (df domainConstructor) (prog (dc) (return (seq @@ -26878,7 +27271,7 @@ This reports the traced functions (and (and (pairp df) (progn (setq dc (qcar df)) t)) (|isDomainOrPackage| dc)) - (boot-equal (kar (|devaluate| dc)) |domainConstructor|)) + (boot-equal (kar (|devaluate| dc)) domainConstructor)) (exit (seq (|/UNTRACE,0| (cons dc nil)) (exit nil)))) (exit t))))) @@ -26893,8 +27286,8 @@ This reports the traced functions \calls{untraceDomainConstructor}{delete} \uses{untraceDomainConstructor}{/tracenames} <>= -(defun |untraceDomainConstructor| (|domainConstructor|) - (prog (|innerDomainConstructor|) +(defun |untraceDomainConstructor| (domainConstructor) + (prog (innerDomainConstructor) (declare (special /tracenames)) (return (seq @@ -26908,14 +27301,14 @@ This reports the traced functions (seq (exit (cond ((|untraceDomainConstructor,keepTraced?| - df |domainConstructor|) + df domainConstructor) (setq t0 (cons df t0)))))))))) - (setq |innerDomainConstructor| - (intern (concat |domainConstructor| ";"))) + (setq innerDomainConstructor + (intern (concat domainConstructor ";"))) (cond - ((fboundp |innerDomainConstructor|) (unembed |innerDomainConstructor|)) - (t (unembed |domainConstructor|))) - (setq /tracenames (|delete| |domainConstructor| /tracenames))))))) + ((fboundp innerDomainConstructor) (unembed innerDomainConstructor)) + (t (unembed domainConstructor))) + (setq /tracenames (|delete| domainConstructor /tracenames))))))) @ @@ -27440,7 +27833,7 @@ to convert the data into type "Expression" \usesdollar{spadUntrace}{letAssoc} \uses{spadUntrace}{/tracenames} <>= -(defun |spadUntrace| (|domain| options) +(defun |spadUntrace| (domain options) (prog (anyiftrue listofoperations domainid |pair| sigslotnumberalist op sig n |lv| |bpiPointer| tracename alias |assocPair| |newSigSlotNumberAlist|) @@ -27448,14 +27841,14 @@ to convert the data into type "Expression" (return (seq (cond - ((null (|isDomainOrPackage| |domain|)) + ((null (|isDomainOrPackage| domain)) (|userError| "bad argument to untrace")) (t (setq anyiftrue (null options)) (setq listofoperations (|getOption| '|ops:| options)) - (setq domainid (|devaluate| |domain|)) + (setq domainid (|devaluate| domain)) (cond - ((null (setq |pair| (|assoc| |domain| /tracenames))) + ((null (setq |pair| (|assoc| domain /tracenames))) (|sayMSG| (cons " No functions in" (append @@ -27484,7 +27877,7 @@ to convert the data into type "Expression" ((or anyiftrue (memq op listofoperations)) (progn (bpiuntrace tracename alias) - (rplac (car (elt |domain| n)) |bpiPointer|) + (rplac (car (elt domain n)) |bpiPointer|) (rplac (cdddr |pair|) nil) (cond ((setq |assocPair| @@ -27507,7 +27900,7 @@ to convert the data into type "Expression" (|newSigSlotNumberAlist| (rplac (cdr |pair|) |newSigSlotNumberAlist|)) (t - (setq /tracenames (delasc |domain| /tracenames)) + (setq /tracenames (delasc domain /tracenames)) (|spadReply|))))))))))) @ @@ -34134,6 +34527,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -34209,6 +34603,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -34489,6 +34884,8 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> +<> <> <> <> @@ -34506,6 +34903,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -34532,7 +34930,9 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> +<> <> <> <> @@ -34550,6 +34950,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -34562,6 +34963,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -34569,6 +34971,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -34608,6 +35011,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> <> @@ -34651,6 +35055,7 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> <> <> @@ -34702,6 +35107,8 @@ This needs to work off the internal exposure list, not the file. <> <> <> +<> +<> <> <> diff --git a/changelog b/changelog index e1d3591..02990d7 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +20100209 tpd src/axiom-website/patches.html 20100212.01.tpd.patch +20100212 tpd src/interp/pf2sex.lisp removed +20100212 tpd src/interp/Makefile remove pf2sex +20100212 tpd books/bookvol5 merge and remove pf2sex 20100209 tpd src/axiom-website/patches.html 20100209.01.tpd.patch 20100209 tpd src/interp/ptrees.lisp treeshake 20100209 tpd src/interp/pf2sex.lisp treeshake diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 93aec04..63f1439 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -2447,5 +2447,7 @@ books/bookvol5 treeshake ptrees, pf2sex
books/bookvol5 treeshake ptrees, pf2sex
20100209.01.tpd.patch books/bookvol5 treeshake ptrees, pf2sex
+20100212.01.tpd.patch +books/bookvol5 merge and remove pf2sex
diff --git a/src/interp/Makefile.pamphlet b/src/interp/Makefile.pamphlet index 56a2525..2a815a2 100644 --- a/src/interp/Makefile.pamphlet +++ b/src/interp/Makefile.pamphlet @@ -169,7 +169,6 @@ OBJS= ${OUT}/vmlisp.${O} \ ${OUT}/nrunfast.${O} \ ${OUT}/nrungo.${O} ${OUT}/nrunopt.${O} \ ${OUT}/nruntime.${O} \ - ${OUT}/pf2sex.${O} \ ${OUT}/posit.${O} \ ${OUT}/ptrees.${O} ${OUT}/ptrop.${O} \ ${OUT}/record.${O} ${OUT}/regress.${O} \ @@ -3343,29 +3342,6 @@ ${MID}/sfsfun-l.lisp: ${IN}/sfsfun-l.lisp.pamphlet @ -\subsection{pf2sex.lisp} -<>= -${OUT}/pf2sex.${O}: ${MID}/pf2sex.lisp - @ echo 136 making ${OUT}/pf2sex.${O} from ${MID}/pf2sex.lisp - @ ( cd ${MID} ; \ - if [ -z "${NOISE}" ] ; then \ - echo '(progn (compile-file "${MID}/pf2sex.lisp"' \ - ':output-file "${OUT}/pf2sex.${O}") (${BYE}))' | ${DEPSYS} ; \ - else \ - echo '(progn (compile-file "${MID}/pf2sex.lisp"' \ - ':output-file "${OUT}/pf2sex.${O}") (${BYE}))' | ${DEPSYS} \ - >${TMP}/trace ; \ - fi ) - -@ -<>= -${MID}/pf2sex.lisp: ${IN}/pf2sex.lisp.pamphlet - @ echo 137 making ${MID}/pf2sex.lisp from ${IN}/pf2sex.lisp.pamphlet - @ (cd ${MID} ; \ - ${TANGLE} ${IN}/pf2sex.lisp.pamphlet >pf2sex.lisp ) - -@ - \subsection{sfsfun.lisp} <>= ${OUT}/sfsfun.${O}: ${MID}/sfsfun.lisp @@ -3937,9 +3913,6 @@ clean: <> <> -<> -<> - <> <> diff --git a/src/interp/pf2sex.lisp.pamphlet b/src/interp/pf2sex.lisp.pamphlet deleted file mode 100644 index bd2e8f0..0000000 --- a/src/interp/pf2sex.lisp.pamphlet +++ /dev/null @@ -1,622 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/interp pf2sex.lisp} -\author{The Axiom Team} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{Changes} -In the function [[float2Sex]] we need to special case the return value -if the global variable [[$useBFasDefault]] is set to true. This variable -allows ``big'' floating point values. - -The change can be seen from this email from Greg Vanuxem: -\begin{verbatim} -Attached is the patch (pf2sex.patch) that allows the use -of DoubleFloat by default in the interpreter. Test it. - -(1) -> 1.7+7.2 - - (1) 8.9 - Type: Float -(2) -> 1.7-7.2 - - (2) - 5.5 - Type: Float -(3) -> -1.7-7.2 - - (3) - 8.9 - Type: Float -(4) -> )boot $useBFasDefault:=false - -(SPADLET |$useBFasDefault| NIL) -Value = NIL - -(4) -> 1.7+7.2 - - (4) 8.9000000000000004 - Type: DoubleFloat -(5) -> 1.7-7.2 - - (5) - 5.5 - Type: DoubleFloat -(6) -> -1.7-7.2 - - (6) - 8.9000000000000004 - Type: DoubleFloat - - - -\end{verbatim} -<<*>>= - -(IN-PACKAGE "BOOT") - -;$dotdot := INTERN('"..", '"BOOT") - -(EVAL-WHEN (EVAL LOAD) (SETQ |$dotdot| (INTERN ".." "BOOT"))) - -;$specificMsgTags := nil - -(EVAL-WHEN (EVAL LOAD) (SETQ |$specificMsgTags| NIL)) - -;pmDontQuote? sy == -; SymMemQ(sy, '(_+ _- _* _*_* _^ _/ log exp pi sqrt ei li erf ci si dilog _ -; sin cos tan cot sec csc asin acos atan acot asec acsc _ -; sinh cosh tanh coth sech csch asinh acosh atanh acoth asech acsc)) - -(DEFUN |pmDontQuote?| (|sy|) - (PROG () - (RETURN - (memq |sy| - '(+ - * ** ^ / |log| |exp| |pi| |sqrt| |ei| |li| |erf| |ci| - |si| |dilog| |sin| |cos| |tan| |cot| |sec| |csc| |asin| - |acos| |atan| |acot| |asec| |acsc| |sinh| |cosh| |tanh| - |coth| |sech| |csch| |asinh| |acosh| |atanh| |acoth| - |asech| |acsc|))))) - -;pfOp2Sex pf == -; alreadyQuoted := pfSymbol? pf -; op := pf2Sex1 pf -; op is ["QUOTE", realOp] => -; $insideRule = 'left => realOp -; $insideRule = 'right => -; pmDontQuote? realOp => realOp -; $quotedOpList := [op, :$quotedOpList] -; op -; symEqual(realOp, "|") => realOp -; symEqual(realOp, ":") => realOp -; symEqual(realOp, "?") => realOp -; op -; op - -(DEFUN |pfOp2Sex| (|pf|) - (PROG (|realOp| |ISTMP#1| |op| |alreadyQuoted|) - (DECLARE (SPECIAL |$quotedOpList| |$insideRule|)) - (RETURN - (PROGN - (SETQ |alreadyQuoted| (|pfSymbol?| |pf|)) - (SETQ |op| (|pf2Sex1| |pf|)) - (COND - ((AND (CONSP |op|) (EQ (CAR |op|) 'QUOTE) - (PROGN - (SETQ |ISTMP#1| (CDR |op|)) - (AND (CONSP |ISTMP#1|) (EQ (CDR |ISTMP#1|) NIL) - (PROGN (SETQ |realOp| (CAR |ISTMP#1|)) 'T)))) - (COND - ((EQ |$insideRule| '|left|) |realOp|) - ((EQ |$insideRule| '|right|) - (COND - ((|pmDontQuote?| |realOp|) |realOp|) - ('T - (PROGN - (SETQ |$quotedOpList| (CONS |op| |$quotedOpList|)) - |op|)))) - ((eq |realOp| '|\||) |realOp|) - ((eq |realOp| '|:|) |realOp|) - ((eq |realOp| '?) |realOp|) - ('T |op|))) - ('T |op|)))))) - -;hasOptArgs? argSex == -; nonOpt := nil -; opt := nil -; for arg in argSex repeat -; arg is ["OPTARG", lhs, rhs] => -; opt := [[lhs, rhs], :opt] -; nonOpt := [arg, :nonOpt] -; null opt => nil -; NCONC (nreverse nonOpt, [["construct", :nreverse opt]]) - -(DEFUN |hasOptArgs?| (|argSex|) - (PROG (|rhs| |ISTMP#2| |lhs| |ISTMP#1| |opt| |nonOpt|) - (RETURN - (PROGN - (SETQ |nonOpt| NIL) - (SETQ |opt| NIL) - ((LAMBDA (|bfVar#17| |arg|) - (LOOP - (COND - ((OR (ATOM |bfVar#17|) - (PROGN (SETQ |arg| (CAR |bfVar#17|)) NIL)) - (RETURN NIL)) - ('T - (COND - ((AND (CONSP |arg|) (EQ (CAR |arg|) 'OPTARG) - (PROGN - (SETQ |ISTMP#1| (CDR |arg|)) - (AND (CONSP |ISTMP#1|) - (PROGN - (SETQ |lhs| (CAR |ISTMP#1|)) - (SETQ |ISTMP#2| (CDR |ISTMP#1|)) - (AND (CONSP |ISTMP#2|) - (EQ (CDR |ISTMP#2|) NIL) - (PROGN - (SETQ |rhs| (CAR |ISTMP#2|)) - 'T)))))) - (SETQ |opt| (CONS (LIST |lhs| |rhs|) |opt|))) - ('T (SETQ |nonOpt| (CONS |arg| |nonOpt|)))))) - (SETQ |bfVar#17| (CDR |bfVar#17|)))) - |argSex| NIL) - (COND - ((NULL |opt|) NIL) - ('T - (NCONC (NREVERSE |nonOpt|) - (LIST (CONS '|construct| (NREVERSE |opt|)))))))))) - -;pfLambdaTran pf == -; pfLambda? pf => -; argTypeList := nil -; argList := nil -; for arg in pf0LambdaArgs pf repeat -; pfTyped? arg => -; argList := [pfCollectArgTran pfTypedId arg, :argList] -; pfNothing? pfTypedType arg => -; argTypeList := [nil, :argTypeList] -; argTypeList := [pf2Sex1 pfTypedType arg, :argTypeList] -; systemError '"definition args should be typed" -; argList := nreverse argList -; retType := -; pfNothing? pfLambdaRets pf => nil -; pf2Sex1 pfLambdaRets pf -; argTypeList := [retType, :nreverse argTypeList] -; [argList, :[argTypeList, [nil for arg in argTypeList], -; pf2Sex1 pfLambdaBody pf]] -; ['id, :['(()), '(()), pf2Sex1 pf]] - -(DEFUN |pfLambdaTran| (|pf|) - (PROG (|retType| |argList| |argTypeList|) - (RETURN - (COND - ((|pfLambda?| |pf|) - (PROGN - (SETQ |argTypeList| NIL) - (SETQ |argList| NIL) - ((LAMBDA (|bfVar#20| |arg|) - (LOOP - (COND - ((OR (ATOM |bfVar#20|) - (PROGN (SETQ |arg| (CAR |bfVar#20|)) NIL)) - (RETURN NIL)) - ('T - (COND - ((|pfTyped?| |arg|) - (PROGN - (SETQ |argList| - (CONS (|pfCollectArgTran| - (|pfTypedId| |arg|)) - |argList|)) - (COND - ((|pfNothing?| (|pfTypedType| |arg|)) - (SETQ |argTypeList| - (CONS NIL |argTypeList|))) - ('T - (SETQ |argTypeList| - (CONS (|pf2Sex1| - (|pfTypedType| |arg|)) - |argTypeList|)))))) - ('T - (|systemError| "definition args should be typed"))))) - (SETQ |bfVar#20| (CDR |bfVar#20|)))) - (|pf0LambdaArgs| |pf|) NIL) - (SETQ |argList| (NREVERSE |argList|)) - (SETQ |retType| - (COND - ((|pfNothing?| (|pfLambdaRets| |pf|)) NIL) - ('T (|pf2Sex1| (|pfLambdaRets| |pf|))))) - (SETQ |argTypeList| - (CONS |retType| (NREVERSE |argTypeList|))) - (CONS |argList| - (LIST |argTypeList| - ((LAMBDA (|bfVar#22| |bfVar#21| |arg|) - (LOOP - (COND - ((OR (ATOM |bfVar#21|) - (PROGN - (SETQ |arg| (CAR |bfVar#21|)) - NIL)) - (RETURN (NREVERSE |bfVar#22|))) - ('T - (SETQ |bfVar#22| (CONS NIL |bfVar#22|)))) - (SETQ |bfVar#21| (CDR |bfVar#21|)))) - NIL |argTypeList| NIL) - (|pf2Sex1| (|pfLambdaBody| |pf|)))))) - ('T (CONS '|id| (LIST '(NIL) '(NIL) (|pf2Sex1| |pf|)))))))) - -;pfCollectArgTran pf == -; pfCollect? pf => -; conds := [pf2Sex1 x for x in pfParts pfCollectIterators pf] -; id := pf2Sex1 pfCollectBody pf -; conds is [["|", cond]] => -; ["|", id, cond] -; [id, :conds] -; pf2Sex1 pf - -(DEFUN |pfCollectArgTran| (|pf|) - (PROG (|cond| |ISTMP#2| |ISTMP#1| |id| |conds|) - (RETURN - (COND - ((|pfCollect?| |pf|) - (PROGN - (SETQ |conds| - ((LAMBDA (|bfVar#24| |bfVar#23| |x|) - (LOOP - (COND - ((OR (ATOM |bfVar#23|) - (PROGN (SETQ |x| (CAR |bfVar#23|)) NIL)) - (RETURN (NREVERSE |bfVar#24|))) - ('T - (SETQ |bfVar#24| - (CONS (|pf2Sex1| |x|) |bfVar#24|)))) - (SETQ |bfVar#23| (CDR |bfVar#23|)))) - NIL (|pfParts| (|pfCollectIterators| |pf|)) NIL)) - (SETQ |id| (|pf2Sex1| (|pfCollectBody| |pf|))) - (COND - ((AND (CONSP |conds|) (EQ (CDR |conds|) NIL) - (PROGN - (SETQ |ISTMP#1| (CAR |conds|)) - (AND (CONSP |ISTMP#1|) (EQ (CAR |ISTMP#1|) '|\||) - (PROGN - (SETQ |ISTMP#2| (CDR |ISTMP#1|)) - (AND (CONSP |ISTMP#2|) - (EQ (CDR |ISTMP#2|) NIL) - (PROGN - (SETQ |cond| (CAR |ISTMP#2|)) - 'T)))))) - (LIST '|\|| |id| |cond|)) - ('T (CONS |id| |conds|))))) - ('T (|pf2Sex1| |pf|)))))) - -;float2Sex num == -; eIndex := SEARCH('"e", num) -; mantPart := -; eIndex => SUBSEQ(num, 0, eIndex) -; num -; expPart := (eIndex => READ_-FROM_-STRING SUBSEQ(num, eIndex+1); 0) -; dotIndex := SEARCH('".", mantPart) -; intPart := -; dotIndex => READ_-FROM_-STRING SUBSEQ(mantPart, 0, dotIndex) -; READ_-FROM_-STRING mantPart -; fracPartString := -; dotIndex => SUBSEQ(mantPart, dotIndex+1) -; '"0" -; bfForm := MAKE_-FLOAT(intPart, READ_-FROM_-STRING fracPartString, -; LENGTH fracPartString, expPart) -; $useBFasDefault => -; [., frac, :exp] := bfForm -; [["$elt", intNewFloat(), 'float], frac, exp, 10] -; bfForm - -(DEFUN |float2Sex| (|num|) - (PROG (|exp| |frac| |bfForm| |fracPartString| |intPart| |dotIndex| - |expPart| |mantPart| |eIndex|) - (DECLARE (SPECIAL |$useBFasDefault|)) - (RETURN - (PROGN - (SETQ |eIndex| (SEARCH "e" |num|)) - (SETQ |mantPart| - (COND (|eIndex| (SUBSEQ |num| 0 |eIndex|)) ('T |num|))) - (SETQ |expPart| - (COND - (|eIndex| - (READ-FROM-STRING (SUBSEQ |num| (+ |eIndex| 1)))) - ('T 0))) - (SETQ |dotIndex| (SEARCH "." |mantPart|)) - (SETQ |intPart| - (COND - (|dotIndex| - (READ-FROM-STRING (SUBSEQ |mantPart| 0 |dotIndex|))) - ('T (READ-FROM-STRING |mantPart|)))) - (SETQ |fracPartString| - (COND - (|dotIndex| (SUBSEQ |mantPart| (+ |dotIndex| 1))) - ('T "0"))) - (SETQ |bfForm| - (MAKE-FLOAT |intPart| (READ-FROM-STRING |fracPartString|) - (LENGTH |fracPartString|) |expPart|)) - (COND - (|$useBFasDefault| - (PROGN - (SETQ |frac| (CADR |bfForm|)) - (SETQ |exp| (CDDR |bfForm|)) - (LIST (LIST '|$elt| (list '|Float|) '|float|) |frac| - |exp| 10))) - ('T |bfForm|)))))) - - -;ruleLhsTran ruleLhs == -; for pred in $predicateList repeat -; [name, predLhs, :predRhs] := pred -; vars := patternVarsOf predRhs -; CDR vars => -- if there is more than one patternVariable -; ruleLhs := NSUBST(predLhs, name, ruleLhs) -; $multiVarPredicateList := [pred, :$multiVarPredicateList] -; predicate := -; [., var] := predLhs -; ["suchThat", predLhs, ["ADEF", [var], -; '((Boolean) (Expression (Integer))), '(() ()), predRhs]] -; ruleLhs := NSUBST(predicate, name, ruleLhs) -; ruleLhs - -(DEFUN |ruleLhsTran| (|ruleLhs|) - (PROG (|predicate| |var| |vars| |predRhs| |predLhs| |name|) - (DECLARE (SPECIAL |$predicateList| |$multiVarPredicateList|)) - (RETURN - (PROGN - ((LAMBDA (|bfVar#28| |pred|) - (LOOP - (COND - ((OR (ATOM |bfVar#28|) - (PROGN (SETQ |pred| (CAR |bfVar#28|)) NIL)) - (RETURN NIL)) - ('T - (PROGN - (SETQ |name| (CAR |pred|)) - (SETQ |predLhs| (CADR |pred|)) - (SETQ |predRhs| (CDDR |pred|)) - (SETQ |vars| (|patternVarsOf| |predRhs|)) - (COND - ((CDR |vars|) - (PROGN - (SETQ |ruleLhs| - (NSUBST |predLhs| |name| |ruleLhs|)) - (SETQ |$multiVarPredicateList| - (CONS |pred| |$multiVarPredicateList|)))) - ('T - (PROGN - (SETQ |predicate| - (PROGN - (SETQ |var| (CADR |predLhs|)) - (LIST '|suchThat| |predLhs| - (LIST 'ADEF (LIST |var|) - '((|Boolean|) - (|Expression| (|Integer|))) - '(NIL NIL) |predRhs|)))) - (SETQ |ruleLhs| - (NSUBST |predicate| |name| |ruleLhs|)))))))) - (SETQ |bfVar#28| (CDR |bfVar#28|)))) - |$predicateList| NIL) - |ruleLhs|)))) - -;rulePredicateTran rule == -; null $multiVarPredicateList => rule -; varList := patternVarsOf [rhs for [.,.,:rhs] in $multiVarPredicateList] -; predBody := -; CDR $multiVarPredicateList => -; ['AND, :[:pvarPredTran(rhs, varList) for [.,.,:rhs] in -; $multiVarPredicateList]] -; [[.,.,:rhs],:.] := $multiVarPredicateList -; pvarPredTran(rhs, varList) -; ['suchThat, rule, -; ['construct, :[["QUOTE", var] for var in varList]], -; ['ADEF, '(predicateVariable), -; '((Boolean) (List (Expression (Integer)))), '(() ()), -; predBody]] - -(DEFUN |rulePredicateTran| (|rule|) - (PROG (|predBody| |varList| |rhs| |ISTMP#1|) - (DECLARE (SPECIAL |$multiVarPredicateList|)) - (RETURN - (COND - ((NULL |$multiVarPredicateList|) |rule|) - ('T - (PROGN - (SETQ |varList| - (|patternVarsOf| - ((LAMBDA (|bfVar#31| |bfVar#30| |bfVar#29|) - (LOOP - (COND - ((OR (ATOM |bfVar#30|) - (PROGN - (SETQ |bfVar#29| (CAR |bfVar#30|)) - NIL)) - (RETURN (NREVERSE |bfVar#31|))) - ('T - (AND (CONSP |bfVar#29|) - (PROGN - (SETQ |ISTMP#1| (CDR |bfVar#29|)) - (AND (CONSP |ISTMP#1|) - (PROGN - (SETQ |rhs| (CDR |ISTMP#1|)) - 'T))) - (SETQ |bfVar#31| - (CONS |rhs| |bfVar#31|))))) - (SETQ |bfVar#30| (CDR |bfVar#30|)))) - NIL |$multiVarPredicateList| NIL))) - (SETQ |predBody| - (COND - ((CDR |$multiVarPredicateList|) - (CONS 'AND - ((LAMBDA (|bfVar#34| |bfVar#33| |bfVar#32|) - (LOOP - (COND - ((OR (ATOM |bfVar#33|) - (PROGN - (SETQ |bfVar#32| - (CAR |bfVar#33|)) - NIL)) - (RETURN (NREVERSE |bfVar#34|))) - ('T - (AND (CONSP |bfVar#32|) - (PROGN - (SETQ |ISTMP#1| - (CDR |bfVar#32|)) - (AND (CONSP |ISTMP#1|) - (PROGN - (SETQ |rhs| - (CDR |ISTMP#1|)) - 'T))) - (SETQ |bfVar#34| - (APPEND - (REVERSE - (|pvarPredTran| |rhs| - |varList|)) - |bfVar#34|))))) - (SETQ |bfVar#33| (CDR |bfVar#33|)))) - NIL |$multiVarPredicateList| NIL))) - ('T - (PROGN - (SETQ |rhs| (CDDAR |$multiVarPredicateList|)) - (|pvarPredTran| |rhs| |varList|))))) - (LIST '|suchThat| |rule| - (CONS '|construct| - ((LAMBDA (|bfVar#36| |bfVar#35| |var|) - (LOOP - (COND - ((OR (ATOM |bfVar#35|) - (PROGN - (SETQ |var| (CAR |bfVar#35|)) - NIL)) - (RETURN (NREVERSE |bfVar#36|))) - ('T - (SETQ |bfVar#36| - (CONS (LIST 'QUOTE |var|) - |bfVar#36|)))) - (SETQ |bfVar#35| (CDR |bfVar#35|)))) - NIL |varList| NIL)) - (LIST 'ADEF '(|predicateVariable|) - '((|Boolean|) - (|List| (|Expression| (|Integer|)))) - '(NIL NIL) |predBody|)))))))) - -;pvarPredTran(rhs, varList) == -; for var in varList for i in 1.. repeat -; rhs := NSUBST(['elt, 'predicateVariable, i], var, rhs) -; rhs - -(DEFUN |pvarPredTran| (|rhs| |varList|) - (PROG () - (RETURN - (PROGN - ((LAMBDA (|bfVar#37| |var| |i|) - (LOOP - (COND - ((OR (ATOM |bfVar#37|) - (PROGN (SETQ |var| (CAR |bfVar#37|)) NIL)) - (RETURN NIL)) - ('T - (SETQ |rhs| - (NSUBST (LIST '|elt| '|predicateVariable| |i|) - |var| |rhs|)))) - (SETQ |bfVar#37| (CDR |bfVar#37|)) - (SETQ |i| (+ |i| 1)))) - |varList| NIL 1) - |rhs|)))) - -;patternVarsOf expr == -; patternVarsOf1(expr, nil) - -(DEFUN |patternVarsOf| (|expr|) - (PROG () (RETURN (|patternVarsOf1| |expr| NIL)))) - -;patternVarsOf1(expr, varList) == -; NULL expr => varList -; ATOM expr => -; null SYMBOLP expr => varList -; SymMemQ(expr, varList) => varList -; [expr, :varList] -; expr is [op, :argl] => -; for arg in argl repeat -; varList := patternVarsOf1(arg, varList) -; varList -; varList - -(DEFUN |patternVarsOf1| (|expr| |varList|) - (PROG (|argl| |op|) - (RETURN - (COND - ((NULL |expr|) |varList|) - ((ATOM |expr|) - (COND - ((NULL (SYMBOLP |expr|)) |varList|) - ((memq |expr| |varList|) |varList|) - ('T (CONS |expr| |varList|)))) - ((AND (CONSP |expr|) - (PROGN - (SETQ |op| (CAR |expr|)) - (SETQ |argl| (CDR |expr|)) - 'T)) - (PROGN - ((LAMBDA (|bfVar#38| |arg|) - (LOOP - (COND - ((OR (ATOM |bfVar#38|) - (PROGN (SETQ |arg| (CAR |bfVar#38|)) NIL)) - (RETURN NIL)) - ('T - (SETQ |varList| (|patternVarsOf1| |arg| |varList|)))) - (SETQ |bfVar#38| (CDR |bfVar#38|)))) - |argl| NIL) - |varList|)) - ('T |varList|))))) - -;pfLhsRule2Sex lhs == -; $insideRule: local := 'left -; pf2Sex1 lhs - -(DEFUN |pfLhsRule2Sex| (|lhs|) - (PROG (|$insideRule|) - (DECLARE (SPECIAL |$insideRule|)) - (RETURN (PROGN (SETQ |$insideRule| '|left|) (|pf2Sex1| |lhs|))))) - -;pfRhsRule2Sex rhs == -; $insideRule: local := 'right -; pf2Sex1 rhs - -(DEFUN |pfRhsRule2Sex| (|rhs|) - (PROG (|$insideRule|) - (DECLARE (SPECIAL |$insideRule|)) - (RETURN (PROGN (SETQ |$insideRule| '|right|) (|pf2Sex1| |rhs|))))) - -;pfSuchThat2Sex args == -; name := GENTEMP() -; argList := pf0TupleParts args -; lhsSex := pf2Sex1 CAR argList -; rhsSex := pf2Sex CADR argList -; $predicateList := [[name, lhsSex, :rhsSex], :$predicateList] -; name - -(DEFUN |pfSuchThat2Sex| (|args|) - (PROG (|rhsSex| |lhsSex| |argList| |name|) - (DECLARE (SPECIAL |$predicateList|)) - (RETURN - (PROGN - (SETQ |name| (GENTEMP)) - (SETQ |argList| (|pf0TupleParts| |args|)) - (SETQ |lhsSex| (|pf2Sex1| (CAR |argList|))) - (SETQ |rhsSex| (|pf2Sex| (CADR |argList|))) - (SETQ |$predicateList| - (CONS (CONS |name| (CONS |lhsSex| |rhsSex|)) - |$predicateList|)) - |name|)))) - -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document}