From ab8cc85adde879fb963c94d15675783f2cf4b183 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 14 Aug 2007 05:14:52 +0000 Subject: Initial population. --- src/interp/ChangeLog | 1078 ++++++++ src/interp/Makefile.in | 1113 +++++++++ src/interp/Makefile.pamphlet | 2835 +++++++++++++++++++++ src/interp/alql.boot.pamphlet | 78 + src/interp/anna.boot.pamphlet | 1932 ++++++++++++++ src/interp/apply.boot.pamphlet | 276 ++ src/interp/as.boot.pamphlet | 1223 +++++++++ src/interp/astr.boot.pamphlet | 99 + src/interp/ax.boot.pamphlet | 428 ++++ src/interp/axext_l.lisp.pamphlet | 230 ++ src/interp/bc-matrix.boot.pamphlet | 175 ++ src/interp/bc-misc.boot.pamphlet | 946 +++++++ src/interp/bc-solve.boot.pamphlet | 384 +++ src/interp/bc-util.boot.pamphlet | 147 ++ src/interp/bits.lisp.pamphlet | 99 + src/interp/bookvol5.pamphlet | 1659 +++++++++++++ src/interp/bootfuns.lisp.pamphlet | 601 +++++ src/interp/bootlex.lisp.pamphlet | 488 ++++ src/interp/br-con.boot.pamphlet | 1407 +++++++++++ src/interp/br-data.boot.pamphlet | 809 ++++++ src/interp/br-op1.boot.pamphlet | 1161 +++++++++ src/interp/br-op2.boot.pamphlet | 790 ++++++ src/interp/br-prof.boot.pamphlet | 288 +++ src/interp/br-saturn.boot.pamphlet | 1916 ++++++++++++++ src/interp/br-search.boot.pamphlet | 1040 ++++++++ src/interp/br-util.boot.pamphlet | 738 ++++++ src/interp/buildom.boot.pamphlet | 384 +++ src/interp/c-doc.boot.pamphlet | 1298 ++++++++++ src/interp/c-util.boot.pamphlet | 2088 ++++++++++++++++ src/interp/category.boot.pamphlet | 624 +++++ src/interp/cattable.boot.pamphlet | 527 ++++ src/interp/ccl-depsys.lsp.pamphlet | 89 + src/interp/cformat.boot.pamphlet | 108 + src/interp/cfuns.lisp.pamphlet | 123 + src/interp/clam.boot.pamphlet | 729 ++++++ src/interp/clammed.boot.pamphlet | 229 ++ src/interp/comp.lisp.pamphlet | 437 ++++ src/interp/compat.boot.pamphlet | 111 + src/interp/compiler.boot.pamphlet | 1461 +++++++++++ src/interp/compress.boot.pamphlet | 89 + src/interp/construc.lisp.pamphlet | 861 +++++++ src/interp/cparse.boot.pamphlet | 941 +++++++ src/interp/cstream.boot.pamphlet | 145 ++ src/interp/daase.lisp.pamphlet | 2043 +++++++++++++++ src/interp/database.boot.pamphlet | 697 ++++++ src/interp/debug.lisp.pamphlet | 1235 +++++++++ src/interp/debugsys.lisp.pamphlet | 268 ++ src/interp/def.lisp.pamphlet | 692 ++++++ src/interp/define.boot.pamphlet | 1535 ++++++++++++ src/interp/domain.lisp.pamphlet | 247 ++ src/interp/dq.boot.pamphlet | 100 + src/interp/fname.lisp.pamphlet | 122 + src/interp/fnewmeta.lisp.pamphlet | 1008 ++++++++ src/interp/foam_l.lisp.pamphlet | 945 +++++++ src/interp/format.boot.pamphlet | 802 ++++++ src/interp/fortcall.boot.pamphlet | 820 ++++++ src/interp/functor.boot.pamphlet | 1009 ++++++++ src/interp/g-boot.boot.pamphlet | 485 ++++ src/interp/g-cndata.boot.pamphlet | 262 ++ src/interp/g-error.boot.pamphlet | 223 ++ src/interp/g-opt.boot.pamphlet | 421 ++++ src/interp/g-timer.boot.pamphlet | 292 +++ src/interp/g-util.boot.pamphlet | 658 +++++ src/interp/ggreater.lisp.pamphlet | 234 ++ src/interp/guess.boot.pamphlet | 369 +++ src/interp/hash.lisp.pamphlet | 147 ++ src/interp/hashcode.boot.pamphlet | 131 + src/interp/ht-root.boot.pamphlet | 311 +++ src/interp/ht-util.boot.pamphlet | 753 ++++++ src/interp/htcheck.boot.pamphlet | 153 ++ src/interp/htsetvar.boot.pamphlet | 500 ++++ src/interp/hypertex.boot.pamphlet | 142 ++ src/interp/i-analy.boot.pamphlet | 832 +++++++ src/interp/i-code.boot.pamphlet | 164 ++ src/interp/i-coerce.boot.pamphlet | 1454 +++++++++++ src/interp/i-coerfn.boot.pamphlet | 2309 +++++++++++++++++ src/interp/i-eval.boot.pamphlet | 474 ++++ src/interp/i-funsel.boot.pamphlet | 1833 ++++++++++++++ src/interp/i-intern.boot.pamphlet | 818 ++++++ src/interp/i-map.boot.pamphlet | 1185 +++++++++ src/interp/i-output.boot.pamphlet | 2467 ++++++++++++++++++ src/interp/i-resolv.boot.pamphlet | 860 +++++++ src/interp/i-spec1.boot.pamphlet | 1300 ++++++++++ src/interp/i-spec2.boot.pamphlet | 1202 +++++++++ src/interp/i-syscmd.boot.pamphlet | 3103 +++++++++++++++++++++++ src/interp/i-toplev.boot.pamphlet | 360 +++ src/interp/i-util.boot.pamphlet | 308 +++ src/interp/incl.boot.pamphlet | 447 ++++ src/interp/info.boot.pamphlet | 305 +++ src/interp/int-top.boot.pamphlet | 497 ++++ src/interp/interop.boot.pamphlet | 933 +++++++ src/interp/interp-fix.boot.pamphlet | 99 + src/interp/interp-proclaims.lisp | 3391 +++++++++++++++++++++++++ src/interp/intfile.boot.pamphlet | 83 + src/interp/intint.lisp.pamphlet | 168 ++ src/interp/iterator.boot.pamphlet | 319 +++ src/interp/lisplib.boot.pamphlet | 712 ++++++ src/interp/macex.boot.pamphlet | 211 ++ src/interp/macros.lisp.pamphlet | 1732 +++++++++++++ src/interp/mark.boot.pamphlet | 1520 ++++++++++++ src/interp/match.boot.pamphlet | 242 ++ src/interp/metalex.lisp.pamphlet | 332 +++ src/interp/metameta.lisp.pamphlet | 384 +++ src/interp/modemap.boot.pamphlet | 379 +++ src/interp/monitor.lisp.pamphlet | 806 ++++++ src/interp/msg.boot.pamphlet | 577 +++++ src/interp/msgdb.boot.pamphlet | 1076 ++++++++ src/interp/nag-c02.boot.pamphlet | 316 +++ src/interp/nag-c05.boot.pamphlet | 424 ++++ src/interp/nag-c06.boot.pamphlet | 1854 ++++++++++++++ src/interp/nag-d01.boot.pamphlet | 1359 ++++++++++ src/interp/nag-d02.boot.pamphlet | 2168 ++++++++++++++++ src/interp/nag-d03.boot.pamphlet | 661 +++++ src/interp/nag-e01.boot.pamphlet | 1780 +++++++++++++ src/interp/nag-e02.boot.pamphlet | 4693 +++++++++++++++++++++++++++++++++++ src/interp/nag-e02b.boot.pamphlet | 1757 +++++++++++++ src/interp/nag-e04.boot.pamphlet | 2520 +++++++++++++++++++ src/interp/nag-f01.boot.pamphlet | 2252 +++++++++++++++++ src/interp/nag-f02.boot.pamphlet | 2755 ++++++++++++++++++++ src/interp/nag-f04.boot.pamphlet | 2331 +++++++++++++++++ src/interp/nag-f07.boot.pamphlet | 726 ++++++ src/interp/nag-s.boot.pamphlet | 1604 ++++++++++++ src/interp/nci.lisp.pamphlet | 107 + src/interp/newaux.lisp.pamphlet | 251 ++ src/interp/newfort.boot.pamphlet | 967 ++++++++ src/interp/nhyper.boot.pamphlet | 141 ++ src/interp/nlib.lisp.pamphlet | 537 ++++ src/interp/nocompil.lisp.pamphlet | 104 + src/interp/nruncomp.boot.pamphlet | 769 ++++++ src/interp/nrunfast.boot.pamphlet | 692 ++++++ src/interp/nrungo.boot.pamphlet | 417 ++++ src/interp/nrunopt.boot.pamphlet | 929 +++++++ src/interp/nruntime.boot.pamphlet | 80 + src/interp/nspadaux.lisp.pamphlet | 139 ++ src/interp/obey.lisp.pamphlet | 86 + src/interp/osyscmd.boot.pamphlet | 75 + src/interp/package.boot.pamphlet | 300 +++ src/interp/packtran.boot.pamphlet | 86 + src/interp/parini.boot.pamphlet | 206 ++ src/interp/parse.boot.pamphlet | 571 +++++ src/interp/parsing.lisp.pamphlet | 1088 ++++++++ src/interp/patches.lisp.pamphlet | 450 ++++ src/interp/pathname.boot.pamphlet | 165 ++ src/interp/pf2atree.boot.pamphlet | 575 +++++ src/interp/pf2sex.boot.pamphlet | 526 ++++ src/interp/pile.boot.pamphlet | 176 ++ src/interp/posit.boot.pamphlet | 200 ++ src/interp/postpar.boot.pamphlet | 552 ++++ src/interp/postprop.lisp.pamphlet | 152 ++ src/interp/preparse.lisp.pamphlet | 416 ++++ src/interp/profile.boot.pamphlet | 111 + src/interp/property.lisp.pamphlet | 639 +++++ src/interp/pspad1.boot.pamphlet | 768 ++++++ src/interp/pspad2.boot.pamphlet | 683 +++++ src/interp/ptrees.boot.pamphlet | 788 ++++++ src/interp/ptrop.boot.pamphlet | 98 + src/interp/record.boot.pamphlet | 300 +++ src/interp/redefs.boot.pamphlet | 92 + src/interp/rulesets.boot.pamphlet | 325 +++ src/interp/scan.boot.pamphlet | 565 +++++ src/interp/serror.boot.pamphlet | 164 ++ src/interp/server.boot.pamphlet | 240 ++ src/interp/setq.lisp.pamphlet | 807 ++++++ src/interp/setvars.boot.pamphlet | 1829 ++++++++++++++ src/interp/setvart.boot.pamphlet | 2387 ++++++++++++++++++ src/interp/sfsfun-l.lisp.pamphlet | 91 + src/interp/sfsfun.boot.pamphlet | 1031 ++++++++ src/interp/showimp.boot.pamphlet | 278 +++ src/interp/simpbool.boot.pamphlet | 225 ++ src/interp/slam.boot.pamphlet | 359 +++ src/interp/sockio.lisp.pamphlet | 263 ++ src/interp/spad.lisp.pamphlet | 813 ++++++ src/interp/spaderror.lisp.pamphlet | 141 ++ src/interp/template.boot.pamphlet | 359 +++ src/interp/termrw.boot.pamphlet | 197 ++ src/interp/topics.boot.pamphlet | 263 ++ src/interp/trace.boot.pamphlet | 853 +++++++ src/interp/union.lisp.pamphlet | 185 ++ src/interp/unlisp.lisp.pamphlet | 1149 +++++++++ src/interp/util.lisp.pamphlet | 1683 +++++++++++++ src/interp/varini.boot.pamphlet | 281 +++ src/interp/vmlisp.lisp.pamphlet | 2115 ++++++++++++++++ src/interp/wi1.boot.pamphlet | 1288 ++++++++++ src/interp/wi2.boot.pamphlet | 1256 ++++++++++ src/interp/word.boot.pamphlet | 422 ++++ src/interp/xrun.boot.pamphlet | 518 ++++ src/interp/xruncomp.boot.pamphlet | 354 +++ 187 files changed, 143547 insertions(+) create mode 100644 src/interp/ChangeLog create mode 100644 src/interp/Makefile.in create mode 100644 src/interp/Makefile.pamphlet create mode 100644 src/interp/alql.boot.pamphlet create mode 100644 src/interp/anna.boot.pamphlet create mode 100644 src/interp/apply.boot.pamphlet create mode 100644 src/interp/as.boot.pamphlet create mode 100644 src/interp/astr.boot.pamphlet create mode 100644 src/interp/ax.boot.pamphlet create mode 100644 src/interp/axext_l.lisp.pamphlet create mode 100644 src/interp/bc-matrix.boot.pamphlet create mode 100644 src/interp/bc-misc.boot.pamphlet create mode 100644 src/interp/bc-solve.boot.pamphlet create mode 100644 src/interp/bc-util.boot.pamphlet create mode 100644 src/interp/bits.lisp.pamphlet create mode 100644 src/interp/bookvol5.pamphlet create mode 100644 src/interp/bootfuns.lisp.pamphlet create mode 100644 src/interp/bootlex.lisp.pamphlet create mode 100644 src/interp/br-con.boot.pamphlet create mode 100644 src/interp/br-data.boot.pamphlet create mode 100644 src/interp/br-op1.boot.pamphlet create mode 100644 src/interp/br-op2.boot.pamphlet create mode 100644 src/interp/br-prof.boot.pamphlet create mode 100644 src/interp/br-saturn.boot.pamphlet create mode 100644 src/interp/br-search.boot.pamphlet create mode 100644 src/interp/br-util.boot.pamphlet create mode 100644 src/interp/buildom.boot.pamphlet create mode 100644 src/interp/c-doc.boot.pamphlet create mode 100644 src/interp/c-util.boot.pamphlet create mode 100644 src/interp/category.boot.pamphlet create mode 100644 src/interp/cattable.boot.pamphlet create mode 100644 src/interp/ccl-depsys.lsp.pamphlet create mode 100644 src/interp/cformat.boot.pamphlet create mode 100644 src/interp/cfuns.lisp.pamphlet create mode 100644 src/interp/clam.boot.pamphlet create mode 100644 src/interp/clammed.boot.pamphlet create mode 100644 src/interp/comp.lisp.pamphlet create mode 100644 src/interp/compat.boot.pamphlet create mode 100644 src/interp/compiler.boot.pamphlet create mode 100644 src/interp/compress.boot.pamphlet create mode 100644 src/interp/construc.lisp.pamphlet create mode 100644 src/interp/cparse.boot.pamphlet create mode 100644 src/interp/cstream.boot.pamphlet create mode 100644 src/interp/daase.lisp.pamphlet create mode 100644 src/interp/database.boot.pamphlet create mode 100644 src/interp/debug.lisp.pamphlet create mode 100644 src/interp/debugsys.lisp.pamphlet create mode 100644 src/interp/def.lisp.pamphlet create mode 100644 src/interp/define.boot.pamphlet create mode 100644 src/interp/domain.lisp.pamphlet create mode 100644 src/interp/dq.boot.pamphlet create mode 100644 src/interp/fname.lisp.pamphlet create mode 100644 src/interp/fnewmeta.lisp.pamphlet create mode 100644 src/interp/foam_l.lisp.pamphlet create mode 100644 src/interp/format.boot.pamphlet create mode 100644 src/interp/fortcall.boot.pamphlet create mode 100644 src/interp/functor.boot.pamphlet create mode 100644 src/interp/g-boot.boot.pamphlet create mode 100644 src/interp/g-cndata.boot.pamphlet create mode 100644 src/interp/g-error.boot.pamphlet create mode 100644 src/interp/g-opt.boot.pamphlet create mode 100644 src/interp/g-timer.boot.pamphlet create mode 100644 src/interp/g-util.boot.pamphlet create mode 100644 src/interp/ggreater.lisp.pamphlet create mode 100644 src/interp/guess.boot.pamphlet create mode 100644 src/interp/hash.lisp.pamphlet create mode 100644 src/interp/hashcode.boot.pamphlet create mode 100644 src/interp/ht-root.boot.pamphlet create mode 100644 src/interp/ht-util.boot.pamphlet create mode 100644 src/interp/htcheck.boot.pamphlet create mode 100644 src/interp/htsetvar.boot.pamphlet create mode 100644 src/interp/hypertex.boot.pamphlet create mode 100644 src/interp/i-analy.boot.pamphlet create mode 100644 src/interp/i-code.boot.pamphlet create mode 100644 src/interp/i-coerce.boot.pamphlet create mode 100644 src/interp/i-coerfn.boot.pamphlet create mode 100644 src/interp/i-eval.boot.pamphlet create mode 100644 src/interp/i-funsel.boot.pamphlet create mode 100644 src/interp/i-intern.boot.pamphlet create mode 100644 src/interp/i-map.boot.pamphlet create mode 100644 src/interp/i-output.boot.pamphlet create mode 100644 src/interp/i-resolv.boot.pamphlet create mode 100644 src/interp/i-spec1.boot.pamphlet create mode 100644 src/interp/i-spec2.boot.pamphlet create mode 100644 src/interp/i-syscmd.boot.pamphlet create mode 100644 src/interp/i-toplev.boot.pamphlet create mode 100644 src/interp/i-util.boot.pamphlet create mode 100644 src/interp/incl.boot.pamphlet create mode 100644 src/interp/info.boot.pamphlet create mode 100644 src/interp/int-top.boot.pamphlet create mode 100644 src/interp/interop.boot.pamphlet create mode 100644 src/interp/interp-fix.boot.pamphlet create mode 100644 src/interp/interp-proclaims.lisp create mode 100644 src/interp/intfile.boot.pamphlet create mode 100644 src/interp/intint.lisp.pamphlet create mode 100644 src/interp/iterator.boot.pamphlet create mode 100644 src/interp/lisplib.boot.pamphlet create mode 100644 src/interp/macex.boot.pamphlet create mode 100644 src/interp/macros.lisp.pamphlet create mode 100644 src/interp/mark.boot.pamphlet create mode 100644 src/interp/match.boot.pamphlet create mode 100644 src/interp/metalex.lisp.pamphlet create mode 100644 src/interp/metameta.lisp.pamphlet create mode 100644 src/interp/modemap.boot.pamphlet create mode 100644 src/interp/monitor.lisp.pamphlet create mode 100644 src/interp/msg.boot.pamphlet create mode 100644 src/interp/msgdb.boot.pamphlet create mode 100644 src/interp/nag-c02.boot.pamphlet create mode 100644 src/interp/nag-c05.boot.pamphlet create mode 100644 src/interp/nag-c06.boot.pamphlet create mode 100644 src/interp/nag-d01.boot.pamphlet create mode 100644 src/interp/nag-d02.boot.pamphlet create mode 100644 src/interp/nag-d03.boot.pamphlet create mode 100644 src/interp/nag-e01.boot.pamphlet create mode 100644 src/interp/nag-e02.boot.pamphlet create mode 100644 src/interp/nag-e02b.boot.pamphlet create mode 100644 src/interp/nag-e04.boot.pamphlet create mode 100644 src/interp/nag-f01.boot.pamphlet create mode 100644 src/interp/nag-f02.boot.pamphlet create mode 100644 src/interp/nag-f04.boot.pamphlet create mode 100644 src/interp/nag-f07.boot.pamphlet create mode 100644 src/interp/nag-s.boot.pamphlet create mode 100644 src/interp/nci.lisp.pamphlet create mode 100644 src/interp/newaux.lisp.pamphlet create mode 100644 src/interp/newfort.boot.pamphlet create mode 100644 src/interp/nhyper.boot.pamphlet create mode 100644 src/interp/nlib.lisp.pamphlet create mode 100644 src/interp/nocompil.lisp.pamphlet create mode 100644 src/interp/nruncomp.boot.pamphlet create mode 100644 src/interp/nrunfast.boot.pamphlet create mode 100644 src/interp/nrungo.boot.pamphlet create mode 100644 src/interp/nrunopt.boot.pamphlet create mode 100644 src/interp/nruntime.boot.pamphlet create mode 100644 src/interp/nspadaux.lisp.pamphlet create mode 100644 src/interp/obey.lisp.pamphlet create mode 100644 src/interp/osyscmd.boot.pamphlet create mode 100644 src/interp/package.boot.pamphlet create mode 100644 src/interp/packtran.boot.pamphlet create mode 100644 src/interp/parini.boot.pamphlet create mode 100644 src/interp/parse.boot.pamphlet create mode 100644 src/interp/parsing.lisp.pamphlet create mode 100644 src/interp/patches.lisp.pamphlet create mode 100644 src/interp/pathname.boot.pamphlet create mode 100644 src/interp/pf2atree.boot.pamphlet create mode 100644 src/interp/pf2sex.boot.pamphlet create mode 100644 src/interp/pile.boot.pamphlet create mode 100644 src/interp/posit.boot.pamphlet create mode 100644 src/interp/postpar.boot.pamphlet create mode 100644 src/interp/postprop.lisp.pamphlet create mode 100644 src/interp/preparse.lisp.pamphlet create mode 100644 src/interp/profile.boot.pamphlet create mode 100644 src/interp/property.lisp.pamphlet create mode 100644 src/interp/pspad1.boot.pamphlet create mode 100644 src/interp/pspad2.boot.pamphlet create mode 100644 src/interp/ptrees.boot.pamphlet create mode 100644 src/interp/ptrop.boot.pamphlet create mode 100644 src/interp/record.boot.pamphlet create mode 100644 src/interp/redefs.boot.pamphlet create mode 100644 src/interp/rulesets.boot.pamphlet create mode 100644 src/interp/scan.boot.pamphlet create mode 100644 src/interp/serror.boot.pamphlet create mode 100644 src/interp/server.boot.pamphlet create mode 100644 src/interp/setq.lisp.pamphlet create mode 100644 src/interp/setvars.boot.pamphlet create mode 100644 src/interp/setvart.boot.pamphlet create mode 100644 src/interp/sfsfun-l.lisp.pamphlet create mode 100644 src/interp/sfsfun.boot.pamphlet create mode 100644 src/interp/showimp.boot.pamphlet create mode 100644 src/interp/simpbool.boot.pamphlet create mode 100644 src/interp/slam.boot.pamphlet create mode 100644 src/interp/sockio.lisp.pamphlet create mode 100644 src/interp/spad.lisp.pamphlet create mode 100644 src/interp/spaderror.lisp.pamphlet create mode 100644 src/interp/template.boot.pamphlet create mode 100644 src/interp/termrw.boot.pamphlet create mode 100644 src/interp/topics.boot.pamphlet create mode 100644 src/interp/trace.boot.pamphlet create mode 100644 src/interp/union.lisp.pamphlet create mode 100644 src/interp/unlisp.lisp.pamphlet create mode 100644 src/interp/util.lisp.pamphlet create mode 100644 src/interp/varini.boot.pamphlet create mode 100644 src/interp/vmlisp.lisp.pamphlet create mode 100644 src/interp/wi1.boot.pamphlet create mode 100644 src/interp/wi2.boot.pamphlet create mode 100644 src/interp/word.boot.pamphlet create mode 100644 src/interp/xrun.boot.pamphlet create mode 100644 src/interp/xruncomp.boot.pamphlet (limited to 'src/interp') diff --git a/src/interp/ChangeLog b/src/interp/ChangeLog new file mode 100644 index 00000000..ec6554e2 --- /dev/null +++ b/src/interp/ChangeLog @@ -0,0 +1,1078 @@ +2007-08-08 Gabriel Dos Reis + + * union.lisp.pamphlet: Import vmlisp. + * ggreater.lisp.pamphlet ("vmlisp"): Import vmlisp. + * Makefile.pamphlet + (DEP): Remove ggreater.lisp, hash.lisp, and union.lisp. + (ggreater.$(FASLEXT)): New rule. + (union.$(FASLEXT)): Likewise. + (${DEPSYS}): Load compiled form of ggreater and union. + * Makefile.in: Regenerate. + +2007-08-08 Gabriel Dos Reis + + * util.lisp.pamphlet: Import vmlisp. + * Makefile.pamphlet (depsys_lisp_noncompiled_sources): Remove. + (${DEPSYS}): Load compiled form of util. + (util.$(FASLEXT)): New rule. + * Makefile.in: Regenerate. + +2007-08-08 Gabriel Dos Reis + + * bookvol5.pamphlet (spad, runspad, ncToplevel, ncIntLoop, + intloop, SpadInterpretStream, intloopReadConsole): Move original + Boot code into int-top.boot.pamphlet. Delete translated Lisp + code. + (makeInitialModemapFrame,$historyFileType, $oldHistoryFileName, + $internalHistoryTable, $useInternalHistoryTable, makeHistFileName, + oldHistFileName, histFileName, histInputFileName, initHist, + initHistList, history, historySpad2Cmd, setHistoryCore, + writeInputLines, resetInCoreHist, changeHistListLen, updateHist, + updateInCoreHist, putHist, recordNewValue, recordNewValue0, + recordOldValue, recordOldValue0, undoInCore, undoChanges, + undoFromFile, saveHistory, restoreHistory, showHistory, + setIOIndex, showInput, showInOut, fetchOutput, readHifi, + writeHifi, disableHist, writeHistModesAndValues, SPADWRITE0, + SPADWRITE, SPADREAD, unwritable? writifyComplain, safeWritify, + writify, spadClosure?, dewritify, ScanOrPairVec, histFileErase, + frameName, frameNames, frameEnvironment, emptyInterpreterFrame, + createCurrentInterpreterFrame, updateFromCurrentInterpreterFrame, + findFrameInRing, updateCurrentInterpreterFrame, + initializeInterpreterFrame, nextInterpreterFrame, + changeToNamedInterpreterFrame, previousInterpreterFrame, + addNewInterpreterFrame, closeInterpreterFrame, displayFrameNames, + importFromFrame, frame, frameSpad2Cmd, $undoFlag, $frameRecord, + $previousBindings, undo, recordFrame, diffAlist, reportUndo, + clearFrame, undoCount, undoSteps, undoSingleStep, + undoLocalModemapHack, removeUndoLines): Move original Boot code + back to i-syscmd.boot.pamphlet. Delete translated Lisp code. + (charDigitVal, gensymInt): Move original Boot code to + g-util.boot.pamphlet. + + * g-util.boot.pamphlet (charDigitVal, gensymInt): Move Boot code + from bookvol5.pamphlet. + + * i-syscmd.boot.pamphlet (makeInitialModemapFrame, + $historyFileType, $oldHistoryFileName, + $internalHistoryTable, $useInternalHistoryTable, makeHistFileName, + oldHistFileName, histFileName, histInputFileName, initHist, + initHistList, history, historySpad2Cmd, setHistoryCore, + writeInputLines, resetInCoreHist, changeHistListLen, updateHist, + updateInCoreHist, putHist, recordNewValue, recordNewValue0, + recordOldValue, recordOldValue0, undoInCore, undoChanges, + undoFromFile, saveHistory, restoreHistory, showHistory, + setIOIndex, showInput, showInOut, fetchOutput, readHifi, + writeHifi, disableHist, writeHistModesAndValues, SPADWRITE0, + SPADWRITE, SPADREAD, unwritable? writifyComplain, safeWritify, + writify, spadClosure?, dewritify, ScanOrPairVec, histFileErase, + frameName, frameNames, frameEnvironment, emptyInterpreterFrame, + createCurrentInterpreterFrame, updateFromCurrentInterpreterFrame, + findFrameInRing, updateCurrentInterpreterFrame, + initializeInterpreterFrame, nextInterpreterFrame, + changeToNamedInterpreterFrame, previousInterpreterFrame, + addNewInterpreterFrame, closeInterpreterFrame, displayFrameNames, + importFromFrame, frame, frameSpad2Cmd, $undoFlag, $frameRecord, + $previousBindings, undo, recordFrame, diffAlist, reportUndo, + clearFrame, undoCount, undoSteps, undoSingleStep, + undoLocalModemapHack, removeUndoLines): Move Boot code from + bookvol5.pamphlet. + + * Makefile.pamphlet (${DEPSYS}): Load compiled form of bookvol5. + (bookvol5.$(FASLEXT)): New. + * Makefile.in: Regenerate. + +2007-08-07 Gabriel Dos Reis + + * Makefile.pamphlet (${DEPSYS}): Load compiled form of nocompil. + * Makefile.in: Regenerate. + +2007-08-07 Gabriel Dos Reis + + * Makefile.pamphlet (OBJS): Replace setq.lisp and property.lisp + with their compiled forms, thus making all codes in interpsys and + AXIOMsys compiled. + (interpsys_modules, IN_modules, AS_modules): New. + (makeint.lisp): Use them. + * Makefile.in: Regenerate. + + * util.lisp.pamphlet (build-interpsys): Use importModule instead + of pain LOAD. + +2007-08-07 Gabriel Dos Reis + + * util.lisp.pamphlet: Stop hijacking BOOTTRAN::BOOTTOCL. + (OLD-BOOT::BOOT): Rename from BOOTTRAN::BOOTTOCL. Unconditionally + define. + (build-depsys): Don't push :OLDBOOT. It is no longer needed. + (build-interpsys): Likewise. + * Makefile.pamphlet: Rename BOOTTRAN::BOOTTOCL to OLD-BOOT::BOOT + throughout. + (${DEPSYS}): Don't push :OLDBOOT. + * Makefile.in: Regenerate. + +2007-08-07 Gabriel Dos Reis + + * vmlisp.lisp.pamphlet ("VMLISP"): Use AxiomCore. + (EQUABLE): Defin in compile, load, and execution situations. + Needed to compile macro EQCAR. + * hash.lisp.pamphlet: Import "vmlisp". + * g-util.boot.pamphlet (AxiomCore::$sysScope): New. + * bootfuns.lisp.pamphlet ("BOOT"): Import "hash. Use VMLISP and + AxiomCore. + * Makefile.pamphlet (BOOT_TO_LISP, COMPILE_LISP): Simplify. + (<>): Now use --load-directory to resolve + dependencies. + (${DEPSYS}): Now depend on vmlisp.$(FASLEXT), hash.$(FASLEXT), and + bootfuns.$(FASLEXT). Use them instead of source form. + (bootfuns.$(FASLEXT)): New rule. Compile with $(BOOTSYS) instead + of $(DEPSYS). + (hash.$(FASLEXT)): Likewise. + (vmlisp.$(FASLEXT)): Likewise. + (makeint.lisp): Use |importModule| instead of plain load. + (${SAVESYS}): Use --load-directory to resolve dependencies. + (${AXIOMSYS}): Likewise. + * Makefile.in: Regenerate. + +2007-08-06 Gabriel Dos Reis + + * Makefile.pamphlet (${DEPSYS}): Remove existing makedep.lisp. + (makeint.lisp): Likewise. + * Makefile.in: Regenerate. + +2007-08-05 Gabriel Dos Reis + + * hypertex.boot.pamphlet ($SendXEventToHyperTeX): Don't set + here. It is a constant variable. + + * Makefile.pamphlet (${SAVESYS}): Tidy. + (${AXIOMSYS}): Likewise. + (<>): Likewise. + (${DEBUGSYS}): Likewise. + * Makefile.in: Regenerate. + +2007-08-04 Gabriel Dos Reis + + * Makefile.pamphlet (depsys_lisp_noncompiled_sources): Dont' + reference sys-pkg.lisp. + (PROCLAIMS): Remove. + (${DEPSYS}): Don't depend on sys-pkg.lisp. Explicitly load + vmlisp.lisp, hash.lisp, and bootfuns.lisp. + (makeint.lisp): Don't depend on sys-pkg.lisp. + (DEP): Remove vmlisp.lisp, bootfuns.lisp, and hash.lisp. + (makeint.lisp): Explicitly load "vmlisp", "hash", and "bootfuns". + * Makefile.in: Regenerate. + * sys-pkg.lisp.pamphlet: Move BOOT package definition to + bootfuns.lisp.pamphlet. + Move VMLISP package definition to vmlisp.lisp.pamphlet. + Delete. + * bootfuns.lisp.pamphlet: Define package BOOT. + * vmlisp.lisp.pamphlet: Define package VMLISP. + +2007-08-04 Gabriel Dos Reis + + * sys-pkg.lisp.pamphlet: Remove BOOT imports and exports. Add + more VMLISP export. + * nlib.lisp.pamphlet (directory?): Explicilty qualify directoryp + by BOOT. + * bookvol5.pamphlet (spad-save): Don't define in package "USER". + * Makefile.pamphlet (${AXIOMSYS}): User boot::spad-save, not + user::spad-save. + (${DEBUGSYS}): Likewise. + * Makefile.in: Regenerate. + +2007-08-04 Gabriel Dos Reis + + * vmlisp.lisp.pamphlet (<>, <>, <>, <>, <>): Move + to... + * bootfuns.lisp.pamphlet(<>, <>, <>, <>, <>): ...here. + +2007-08-04 Gabriel Dos Reis + + * unlisp.lisp.pamphlet (|ListMember?|): Move to... + * msg.boot.pamphlet (ListMember?): ...here. Rewrite in Boot. + * vmlisp.lisp.pamphlet (|ListMember?|): Remove duplicate. + (|stringLE1|, |sortCarString|, |insertString|): Remove unused + functions. + (|AlistAssocQ|): Remove duplicate. + +2007-08-04 Gabriel Dos Reis + + * sys-pkg.lisp.pamphlet ("FOAM", "FOAM-USER"): Move to ... + * foam_l.lisp.pamphlet ("FOAM", "FOAM-USER"): ...here. + * cparse.boot.pamphlet: Tidy. + * Makefile.pamphlet (OBJS): Include foam_l.$(FASLEXT) because + daase.lisp references it. + (PROCLAIMS): Disable cached proclaims for now. + +2007-08-04 Gabriel Dos Reis + + * vmlisp.lisp.pamphlet ($npPParg, npPPff, npPPf, npPPg, npPP, + $npPCff, npPCff, npPCg, npPC): Move to ... + * cparse.boot.pamphlet ($npPParg, npPPff, npPPf, npPPg, npPP, + $npPCff, npPCff, npPCg, npPC): ... here. Rewrite back in Boot. + +2007-08-04 Gabriel Dos Reis + + * vmlisp.lisp.pamphlet (|$npPCff|): Rename from *npPCff*. + (npPCff): Adjust. + +2007-08-04 Gabriel Dos Reis + + * cparse.boot.pamphlet: Tidy formatting. + * vmlisp.lisp.pamphlet (|$npPParg|): Rename from *npPParg* to + follow general Boot naming convention. + (npPPff, |npPP|): Adjust. + +2007-08-03 Gabriel Dos Reis + + * sys-pkg.lisp.pamphlet: Push into user package before defining + packages. That way, we don't suffer from suddenly hidden + symbols such as defpackage::defpackage in inventive Lisps. Create + packages with defpackage. + +2007-08-03 Gabriel Dos Reis + + * sys-pkg.lisp.pamphlet: Remove imports that have been commented + out. + +2007-08-03 Gabriel Dos Reis + + * macros.lisp.pamphlet (|shoeConsole|): Move from + vmlisp.lisp.pamphlet. + (|shoeInputFile|): Likewise. + (|shoeread-line|): Likewise. + * sys-pkg.lisp.pamphlet (vmlisp::|shoeConsole|): Don't import into + BOOT anymore. + (vmlisp::|shoeread-line|): Likewise. + (vmlisp::|shoeInputFile|): Likewise. + +2007-08-03 Gabriel Dos Reis + + * macros.lisp.pamphlet: Tidy formatting. + * foam_l.lisp.pamphlet: Likewise. + * nlib.lisp.pamphlet: Likewise. + * ggreater.lisp.pamphlet: Likewise. + * union.lisp.pamphlet: Likewise. + * comp.lisp.pamphlet: Likewise. + * spaderror.lisp.pamphlet: Likewise. + * spad.lisp.pamphlet: Likewise. + * bits.lisp.pamphlet: Likewise. + * unlisp.lisp.pamphlet: Likewise. + * axext_l.lisp.pamphlet: Likewise. + +2007-07-01 Gabriel Dos Reis + + * vmlisp.lisp.pamphlet (MACRO-MISSINGARGS): Fix thinko in case + statement. + +2007-06-30 Gabriel Dos Reis + + * vmlisp.lisp.pamphlet (MACRO-MISSINGARGS): Fix thinko. + +2007-06-25 Gabriel Dos Reis + + * Makefile.pamphlet (${SAVESYS}): Use --mode=link to produce + executable. + (<>): Likewise. + * Makefile.in: Regenerate. + +2007-06-20 Gabriel Dos Reis + + * br-data.boot.pamphlet (dbHasExamplePage): Fix HyperTex page + pathname. + * ht-root.boot.pamphlet (htTutorialSearch): Likewise. + * htcheck.boot.pamphlet (buildHtMacroTable): Likewise. + * util.lisp.pamphlet ($relative-directory-list): Fix path to catalogs. + +2007-05-31 Gabriel Dos Reis + + * Makefile.pamphlet: Remove use of NOISE throughout. + * Makefile.in: Regenerate. + +2007-05-19 Gabriel Dos Reis + + * spad.lisp.pamphlet (S-PROCESS): Reformat. Enable Lisp pretty + printing. + +2007-05-12 Gabriel Dos Reis + + * metalex.lisp.pamphlet (make-adjustable-string): Use character as + string element type, not string-char. + * parsing.lisp.pamphlet (underscore, make-string-adjustable): + Likewise. + * unlisp.lisp.pamphlet (c-to-lisp-string, |ByteFileReadLine|, + |FullString|): Likewise. + * vmlisp.lisp.pamphlet (make-cvec): Likewise. + +2007-05-12 Gabriel Dos Reis + + * bootfuns.lisp.pamphlet: Work around non-portable codes. + * foam_l.lisp.pamphlet: Replace type "string-char" with type + "character". + Replace "0.0d0" with "0.0l0" because DFlo is actually long-float, + not double-float. Revisit the definition of DFlo in a broader + context. + +2007-05-12 Gabriel Dos Reis + + * vmlisp.lisp.pamphlet (equable): Move definition before use. + Spell BOOT package name in all caps. + +2007-05-04 Gabriel Dos Reis + + * c-doc.boot.pamphlet (checkRecordHash): Use GET instead of GETL. + (checkTransformFirsts): Likewise. + * format.boot.pamphlet (formatOpSymbol): Likewise. + * i-output.boot.pamphlet (exptNeedsPren): Likewise. + (charyTrouble1): Likewise. + * postpar.boot.pamphlet (postForm): Likewise. + * pspad1.boot.pamphlet (format, getOp, formatSelectionOp, + formatPrefixOp): Likewise. + * pspad2.boot.pamphlet (isNewspadOperator): Likewise. + * i-map.boot.pamphlet (getUserIdentifiersIn): Likewise. + Non-atomic objects don't have Nud or Led properties. + +2007-05-01 Gabriel Dos Reis + + * as.boot.pamphlet: Replace UNION with union + * br-con.boot.pamphlet: Likewise. + * br-data.boot.pamphlet: Likewise. + * br-saturn.boot.pamphlet: Likewise. + * br-search.boot.pamphlet: Likewise. + * category.boot.pamphlet: Likewise. + * database.boot.pamphlet: Likewise. + * define.boot.pamphlet: Likewise. + * functor.boot.pamphlet: Likewise. + * i-map.boot.pamphlet: Likewise. + * i-resolv.boot.pamphlet: Likewise. + * lisplib.boot.pamphlet: Likewise. + * mark.boot.pamphlet: Likewise. + * nruncomp.boot.pamphlet: Likewise. + * nrunopt.boot.pamphlet: Likewise. + * package.boot.pamphlet: Likewise. + * pspad1.boot.pamphlet: Likewise. + * showimp.boot.pamphlet: Likewise. + * trace.boot.pamphlet: Likewise. + * wi1.boot.pamphlet: Likewise. + +2007-05-01 Gabriel Dos Reis + + * database.boot.pamphlet: Replace INTERSECTION with intersection. + * i-coerfn.boot.pamphlet: Likewise. + * i-resolv.boot.pamphlet: Likewise. + * mark.boot.pamphlet: Likewise. + * topics.boot.pamphlet: Likewise. + * trace.boot.pamphlet: Likewise. + +2007-04-30 Gabriel Dos Reis + + * Makefile.pamphlet (<>): Remove. + * interop.boot.pamphlet (<>): Likewise. + +2007-04-29 Gabriel Dos Reis + + * apply.boot.pamphlet: Replace MEMBER with member. + * br-con.boot.pamphlet: Likewise. + * br-op1.boot.pamphlet: Likewise. + * br-op2.boot.pamphlet: Likewise. + * br-saturn.boot.pamphlet: Likewise. + * br-search.boot.pamphlet: Likewise. + * br-util.boot.pamphlet: Likewise. + * category.boot.pamphlet: Likewise. + * cattable.boot.pamphlet: Likewise. + * c-doc.boot.pamphlet: Likewise. + * compiler.boot.pamphlet: Likewise. + * c-util.boot.pamphlet: Likewise. + * database.boot.pamphlet: Likewise. + * define.boot.pamphlet: Likewise. + * functor.boot.pamphlet: Likewise. + * g-error.boot.pamphlet: Likewise. + * g-util.boot.pamphlet: Likewise. + * htcheck.boot.pamphlet: Likewise. + * i-coerce.boot.pamphlet: Likewise. + * i-coerfn.boot.pamphlet: Likewise. + * i-funsel.boot.pamphlet: Likewise. + * i-map.boot.pamphlet: Likewise. + * incl.boot.pamphlet: Likewise. + * info.boot.pamphlet: Likewise. + * interop.boot.pamphlet: Likewise. + * i-output.boot.pamphlet: Likewise. + * i-resolv.boot.pamphlet: Likewise. + * i-syscmd.boot.pamphlet: Likewise. + * iterator.boot.pamphlet: Likewise. + * i-util.boot.pamphlet: Likewise. + * mark.boot.pamphlet: Likewise. + * modemap.boot.pamphlet: Likewise. + * msg.boot.pamphlet: Likewise. + * msgdb.boot.pamphlet: Likewise. + * nruncomp.boot.pamphlet: Likewise. + * nrunopt.boot.pamphlet: Likewise. + * record.boot.pamphlet: Likewise. + * trace.boot.pamphlet: Likewise. + * wi1.boot.pamphlet: Likewise. + * wi2.boot.pamphlet: Likewise. + * xruncomp.boot.pamphlet: Likewise. + +2007-04-29 Gabriel Dos Reis + + * apply.boot.pamphlet (compApplication, applyMapping, + compApplyModemap, compMapCond''): Use lower case member instead of + uppercase MEMBER. + * g-error.boot.pamphlet (errorSupervisor1): Likewise. + * incl.boot.pamphlet (incActive?, incNConsoles): Likewise. + * interop.boot.pamphlet (isDomain, getFunctionFromDomain): Likewise. + * mark.boot.pamphlet (markCoerceByModemap, markFinish1, + markExtractLeadingMacros, markRemImportsAndLeadingMacros, + buildNewDefinition): Likewise. + * msg.boot.pamphlet (redundant, initToWhere, getMsgTag?, + getMsgFTTag?): Likewise. + * wi1.boot.pamphlet (compAtom, compSymbol, compColon, + coerceExtraHard, comp3): Likewise. + * wi2.boot.pamphlet (compDefineCapsuleFunction, mkUnion, + getInverseEnvironment, applyMapping, compApplyModemap, + compMapCond'', genDeltaEntry, chaseInferences, doItLet1): Likewise. + +2007-04-29 Gabriel Dos Reis + + * br-con.boot.pamphlet (domainDescendantsOf): Use uppercase delete + instead of uppercase DELETE. + * br-op2.boot.pamphlet (dbChooseOperandName): Likewise. + * category.boot.pamphlet (mkCategory, SigListUnion, mkOr2, + mkAnd2, FindFundAncs, JoinInner): Likewise. + * compiler.boot.pamphlet (getInverseEnvironment, modeEqual): Likewise. + * database.boot.pamphlet (orderPredTran): + * define.boot.pamphlet (compDefWhereClause, getSignature): Likewise. + * format.boot.pamphlet (findSubstitutionOrder?, removeIsDomainD): + Likewise. + * functor.boot.pamphlet (DescendCodeAdd1, ICformat): Likewise. + * i-coerfn.boot.pamphlet (Mp2Up): Likewise. + * i-map.boot.pamphlet (clearDep1): Likewise. + * info.boot.pamphlet (chaseInferences): Likewise. + * i-spec1.boot.pamphlet (checkForFreeVariables): Likewise. + * i-syscmd.boot.pamphlet (workfilesSpad2Cmd): Likewise. + * mark.boot.pamphlet (markFinish1, moveTruePred2End): Likewise. + * modemap.boot.pamphlet (putDomainsInScope): Likewise. + * nrunopt.boot.pamphlet (orderByContainment, depthAssocList): Likewise. + * setvars.boot.pamphlet (setExposeAddConstr, setExposeDropGroup, + setExposeDropConstr): Likewise. + * trace.boot.pamphlet (trace1, untraceDomainConstructor, tracelet, + breaklet): Likewise. + * wi2.boot.pamphlet (getInverseEnvironment, chaseInferences): Likewise. + +2007-04-29 Gabriel Dos Reis + + * c-doc.boot.pamphlet (checkBalance): Use lowercase rassoc instead + of uppercase RASSOC. + * c-util.boot.pamphlet (sublisR): Likewise. + * database.boot.pamphlet (modemapPattern): Likewise. + * mark.boot.pamphlet (reduceImports1): Likewise. + * pspad2.boot.pamphlet (formatDeftranIf): Likewise. + * trace.boot.pamphlet (saveMapSig, rassocSub): Likewise. + +2007-04-29 Gabriel Dos Reis + + * as.boot.pamphlet (asytranForm1, asyTypeUnit): Replace GET with + GETL. + * br-con.boot.pamphlet (dbShowConsDoc1, dbSpecialOperations, + dbSpecialExports): Likewise. + * br-op1.boot.pamphlet (niladicHack): Likewise. + * br-util.boot.pamphlet (dbInfovec, isLoaded?): Likewise. + * buildom.boot.pamphlet (constructorCategory): Likewise. + * category.boot.pamphlet (SourceLevelSubset, MachineLevelSubset): + Likewise. + * c-doc.boot.pamphlet (checkRecordHash, checkTransformFirsts): + Likewise. + * clam.boot.pamphlet (clearClam, reportCircularCacheStats, + reportHashCacheStats, clamStats): Likewise. + * cparse.boot.pamphlet (npPushId, npInfixOp): Likewise. + * c-util.boot.pamphlet (isFunction,, isSubset): Likewise. + * database.boot.pamphlet (updateDatabase): Likewise. + * define.boot.pamphlet (mustInstantiate): Likewise. + * format.boot.pamphlet (formatOpSymbol): Likewise. + * g-opt.boot.pamphlet (optimize, optSpecialCall): Likewise. + * g-timer.boot.pamphlet (printNamedStatsByProperty, + makeLongStatStringByProperty, updateTimedName, + computeElapsedTime): Likewise. + * i-analy.boot.pamphlet (bottomUp): Likewise. + * i-coerce.boot.pamphlet (coerceRetract, coerceIntCommute): Likewise. + * i-funsel.boot.pamphlet (findFunctionInCategory): Likewise. + * i-map.boot.pamphlet (getUserIdentifiersIn): Likewise. + * interop.boot.pamphlet (instantiate, hashNewLookupInCategories): + Likewise. + * i-output.boot.pamphlet (APP, exptNeedsPren, needStar, appSum, + appInfix, putWidth, opWidth, outputOp, charyTrouble1, split2, + subspan, superspan): Likewise. + * i-syscmd.boot.pamphlet(reportOpsFromUnitDirectly): Likewise. + * iterator.boot.pamphlet (getIdentity): Likewise. + * i-util.boot.pamphlet (mkPredList): Likewise. + * lisplib.boot.pamphlet (loadLibIfNotLoaded, loadLibIfNecessary, + autoLoad, augModemapsFromDomain1): Likewise. + * mark.boot.pamphlet (markPathsEqual, markPartOp?, markWrapPart): + Likewise. + * modemap.boot.pamphlet (compCat, addConstructorModemaps): Likewise. + * nruncomp.boot.pamphlet (NOTES): Likewise. + * nrunfast.boot.pamphlet (newLookupInCategories, + newLookupInCategories1): Likewise. + * nrunopt.boot.pamphlet (stuffDomainSlots, getInfovec, dcSizeAll): + Likewise. + * parse.boot.pamphlet (parseTran): Likewise. + * pathname.boot.pamphlet (getFunctionSourceFile1): Likewise. + * postpar.boot.pamphlet (postTran, postForm): Likewise. + * pspad1.boot.pamphlet (format, getOp, formatDollar, + formatDollar1, formatFunctionCall1, formatSelectionOp, + formatPrefixOp, formatOpBindingPower): Likewise. + * pspad2.boot.pamphlet (isNewspadOperator): Likewise. + * wi1.boot.pamphlet (compExpression): Likewise. + * wi2.boot.pamphlet (optDeltaEntry): Likewise. + * xrun.boot.pamphlet (findFunctionInCategory): Likewise. + * xruncomp.boot.pamphlet (addConstructorModemaps): Likewise. + +2007-04-29 Gabriel Dos Reis + + * i-coerfn.boot.pamphlet (Dmp2Up): Use lowercase "remove" instead + or uppercase REMOVE. + +2007-04-28 Gabriel Dos Reis + + * interop.boot.pamphlet (hashNewLookupInTable): Instead + ^= instead of NE. + +2007-04-13 Gabriel Dos Reis + + * Makefile.pamphlet (<>): Remove. + * Makefile.in: Regenerate. + +2007-04-13 Gabriel Dos Reis + + * parse.boot.pamphlet: Push into package BOOT. Consistently + double-quote AST tags. Remove cached Lisp translation. + +2007-04-12 Gabriel Dos Reis + + * postpar.boot.pamphlet: Double-qoute AST tags. + (<>): Remove. + * Makefile.pamphlet (<>): Remove. + * Makefile.in: Regenerate. + +2007-04-08 Gabriel Dos Reis + + * i-output.boot.pamphlet (checkArgs): Remove bogus comments. + +2007-04-07 Gabriel Dos Reis + + * Makefile.pamphlet (<>): Delete. + (<>): Likewise. + * Makefile.in: Regenerate. + + * pathname.boot.pamphlet: Push into package BOOT. + (pathnameDirectory): Use LispKeyword. + * package.boot.pamphlet: Push into package BOOT. Use + lowercase for DELETE, NREVERSE. + +2007-04-07 Gabriel Dos Reis + + * Makefile.pamphlet (<>): Remove. + * Makefile.in: Regenerate. + * simpbool.boot.pamphlet: Push into package "BOOT". + Use lowercase for NREVERSE, MKPF, MEMBER. + +2007-04-06 Gabriel Dos Reis + + * compress.boot.pamphlet: Push into package "BOOT". + * Makefile.pamphlet: Remove explicit stanzas for translating and + compiling compress.boot. + * Makefile.in: Regenerate. + +2007-04-02 Gabriel Dos Reis + + * Makefile.pamphlet (<>): Remove. + (<>): Likewise. + (<>): Likewise. + (<>): Likewise. + (<>): Likewise. + (<>): Likewise. + (<>): Likewise. + (<>): Likewise. + (<>): Likewise. + * Makefile.in: Regenerate. + +2007-04-02 Gabriel Dos Reis + + * setvars.boot.pamphlet: Push into package "BOOT". + Remove cached Lisp translation. + * Makefile.pamphlet (<>): Remove + (<>): Likewise. + (<>): Likewise + (<>): Likewise. + * Makefile.in: Regenerate. + +2007-04-01 Gabriel Dos Reis + + * Makefile.pamphlet (${DEPSYS}): Require g-boot.clisp. + <>: Remove. + <>: Likewise. + * Makefile.in: Regenerate. + * g-boot.boot.pamphlet: Push into package BOOT. + Remove cached Lisp translation. + +2007-04-01 Gabriel Dos Reis + + * Makefile.pamphlet (${DEPSYS}): Require clam.clisp. Remove + reference to clam.${LISP}. + <>: Remove. + <>: Likewise. + * clam.boot.pamphlet: Push into package "BOOT". Remove cached + Lisp translation. + +2007-04-01 Gabriel Dos Reis + + * Makefile.pamphlet (DEPSYS): Point to depsys in build-dir. + (SAVESYS): Likewise + (${AUTO}/wi1.$(FASLEXT)): Copy from build-dir version. + (${AUTO}/wi2.$(FASLEXT)): Likewise. + (${AUTO}/pspad1.$(FASLEXT)): Likewise. + (${AUTO}/pspad2.$(FASLEXT)): Likewise. + (${AUTO}/mark.$(FASLEXT)): Likewise. + * Makefile.in: Regenerate. + +2007-03-31 Gabriel Dos Reis + + * Makefile.pamphlet (${DEPSYS}): Remove fasl file after depsys it + built. + * Makefile.in: Regenerate. + +2007-03-31 Gabriel Dos Reis + + * g-error.boot.pamphlet: Explicitly puch into package "BOOT". + + * Makefile.pamphlet (${DEPSYS}): Add g-error.clisp to + requirements. Load it g-error.$(FASLEXT) too. + (depsys_objects): Include g-error.$(FASLEXT). + (depsys_boot_sources): Icnlude g-error.boot. + (<>): Remove. + * Makefile.in: Regenerate. + +2007-03-31 Gabriel Dos Reis + + * g-util.boot.pamphlet: Remove cached Lisp translation. Push into + package "BOOT" at the beginning. + * Makefile.pamphlet (${DEPSYS}): Require g-util.clisp, not + g-util.${LISP}. + Remove explicit stanzas for g-util.clisp and g-util.{LISP}. + * Makefile.in: Regenerate. + +2007-03-31 Gabriel Dos Reis + + * slam.boot.pamphlet: Remove cached Lisp translation. Push into + package "BOOT" at the beginning. + * Makefile.pamphlet (${DEPSYS}): Require slam.clisp, not + slam.${LISP}. + Remove explicit stanzas for slam.clisp and slam.{LISP}. + * Makefile.in: Regenerate. + +2007-03-30 Gabriel Dos Reis + + * def.lisp.pamphlet (|defLETdcq|): Use a gensym'd variable name + instead of special character control-b. + +2007-03-28 Gabriel Dos Reis + + * Makefile.pamphlet (mostlyclean-local): Remove .lib files too. + * Makefile.in: Regenerate. + * vmlisp.lisp.pamphlet: Fix various typos. + * nocompil.lisp.pamphlet: Fix trailing parenthesis typo. + +2007-03-28 Gabriel Dos Reis + + * Makefile.pamphlet: Replace $(OBJECT) with $(FASLEXT). + * Makefile.in: Regenerate. + +2007-03-26 Gabriel Dos Reis + + * sys-pkg.lisp.pamphlet (GCL.PNAME): Remove. + +2007-03-26 Gabriel Dos Reis + + * sys-pkg.lisp.pamphlet (GCL.MEMQ): Remove. + +2007-03-26 Gabriel Dos Reis + + * util.lisp.pamphlet (boottocl): Remove prefix. Do pretty print + translations. + * sys-pkg.lisp.pamphlet (BOOTTRAN): Don't define here. + * interp-proclaims.lisp (BOOT::|findStringInFile|): Comment out + proclamation. + * cfuns.lisp.pamphlet (|findString|): Comment out external linkage + declaration. + (|findStringInFile|): Comment out definition. + * Makefile.pamphlet: Use implicit rules to compiler .clisp files + to native object codes. Remove redundant special cased rules. + (YEARWEEK): Qualify symbols names. + (<>): Use local Lisp image. + (makeint.lisp): Remove in-package declaration. Qualify symbol + names. Turn on stratified garbage collection. + (${SAVESYS}): Use axiom_build_document to build interpsys. + (${AXIOMSYS}): Garbage collection is already turned on in + makeint.lisp. + * Makefile.in: Regenerate. + +2007-03-25 Gabriel Dos Reis + + * Makefile.pamphlet (${DEPSYS}): Adjust call to build-depsys. + * Makefile.in: Regenerate. + * util.lisp.pamphlet (make-depsys): Remove. + (build-depsys): Adjust. + +2007-03-24 Gabriel Dos Reis + + * Makefile.pamphlet: Document Lisp files needed + to make depsys. + Remove obsolete Make rules for building documentation. + * Makefile.in: Regenerate. + + * vmlisp.lisp.pamphlet (define-macro): Likewise. + * sys-pkg.lisp.pamphlet: Remove dead packages SCRATCHPAD_COMPILER + and SPECFNSF. + (define-macro): Remove. + Remove explicit import of GCL's system::getenv. + +2007-03-24 Gabriel Dos Reis + + * Makefile.pamphlet (${DEPSYS}): Don't load proclamations. + * Makefile.in: Regenerate. + +2007-03-13 Gabriel Dos Reis + + * Makefile.pamphlet (BOOT_TO_LISP): Adjust. + (COMPILE_LISP): Likewise. + * Makefile.in: Regenerate. + +2007-01-11 Gabriel Dos Reis + + * ptrees.boot.pamphlet (pfExpr?): Don't duplicate test for + Typing and Sequence. They are part of DeclPart. + +2006-12-26 Gabriel Dos Reis + + * Makefile.pamphlet: Eradicate use of ENV. + +2006-12-21 Vanuxem Gregory + + * patches.lisp.pamphlet: Set $saturn to nil on Windows too. + +2006-12-16 Gabriel Dos Reis + + * Makefile.pamphlet (warm.data): Extract into ../algebra. + (makeint.lisp): Adjust dependency. + +2006-12-12 Gabriel Dos Reis + + * Makefile.pamphlet: Use general implicit rules to extract Boot + source code from pamphlets. Refrain from excessive sub-shells + creation. + * Makefile.in: Regenerate. + +2006-12-11 Gabriel Dos Reis + + * alql.boot.pamphlet (getBrowseDatabase): Directly call member. + +2006-12-10 Gabriel Dos Reis + + * util.lisp.pamphlet (gazonk-name): Special-case Win32 too. + + * patches.lisp.pamphlet (|xdrOpen|): Special-case for DOS and + Windows platforms when using GCL. + (|xrdRead|): Likewise. + (|xrdWrite|): Likewise. + +2006-12-10 Gabriel Dos Reis + + * Makefile.pamphlet: Put object files in the current build + directory. + * Makefile.in: Regenerate. +2006-12-10 Gabriel Dos Reis + + * Makefile.pamphlet: Extract source code into current build + directory. + * Makefile.in: Regenerate. + +2006-12-08 Gabriel Dos Reis + + * util.lisp.pamphlet (boottran::boottocl): Create the file + containing the translated program in the same directory as the + input file. + +2006-12-06 Gabriel Dos Reis + + * Makefile.pamphlet (YEARWEEK): Use PACKAGE_STRING. + * Makefile.in: Regenerate. + +2006-12-01 Waldek Hebisch + + * src/interp/alql.boot.pamphlet: Add FUNCALL to fix problem + with previous patch. + +2006-12-01 Waldek Hebisch + + Port from wh-sandbox. + * src/interp/alql.boot.pamphlet: Add package declaration, + getBrowseDatabase: modify to work with shoe. + +2006-11-26 Gabriel Dos Reis + + * Makefile.pamphlet: Add support for OS that require extension for + exectuble files. + * Makefile.in: Regenerate. + +2006-11-24 Gabriel Dos Reis + + * Makefile.pamphlet (all-axiomsys): Rename from axiomsys. + (all-debugsys, all-depsys): Likewise. + * Makefile.in: Regenerate. + +2006-11-21 Gabriel Dos Reis + + * ccl-debugsys.lsp.pamphlet: Move from ../boot. + +2006-11-21 Gabriel Dos Reis + + * Makefile.pamphlet (BOOT_TO_LISP): Use $(axiom_build_document) + for translation from Boot. + (COMPILE_LISP): Use $(axiom_build_document) to compile Lisp code. + * Makefile.in: Regenerate. + +2006-11-20 Gabriel Dos Reis + + * as.boot.pamphlet (displayDatabase): Properly escape end-of-line + in multi-line list. + +2006-11-19 Gabriel Dos Reis + + * Makefile.pamphlet (alql.boot): Translate with bootsys. + * Makefile.in: Regenerate. + +2006-11-18 Gabriel Dos Reis + + * Makefile.pamphlet (BOOT_TO_LISP): Use boottoclc. + +2006-11-15 Waldek Hebisch + + * daase.lisp.pamphlet: Document preloading of databases. + * Makefile.pamphlet (axiomsys): Add separate rule needed + to implement it. + * Makefile.in: Regenerate. + +2006-11-05 Gabriel Dos Reis + + * daase.lisp.pamphlet: Sync with silver (revision 247). + * setq.lisp.pamphlet: Likewise. + +2006-11-05 Waldek Hebisch + + * libdb.text, temp.text: remove + +2006-11-03 Waldek Hebisch + + * sockio.lisp.pamphlet (sock_get_string_buf_wrapper): new + function + (sock_get_string_buf): call it + +2006-10-31 Gabriel Dos Reis + + * Makefile.pamphlet: Make extracted Boot .PRECIOUS. + * Makefile.in: Regenerate. + +2006-10-30 Gabriel Dos Reis + + * trace.boot.pamphlet (ptimers): Fix string literals that + accidently spreads over two lines. + +2006-10-28 Gabriel Dos Reis + + * Makefile.pamphlet: Explain why def.$(OBJEXT) may be loaded + twice. + +2006-10-28 Gabriel Dos Reis + + * newfort.boot.pamphlet (updateSymbolTable): Escape ! in names. + +2006-10-27 Gabriel Dos Reis + + * debugsys.lisp.pamphlet: Adjust path to Common Lisp source files, + to reflect changes in Makefile. + + * Makefile.pamphlet (depsys_lisp_noncompiled_sources): Fix typo. + (DEP): Adjust paths to Lisp source files. + (OBJS): Have Lisp source filenames end with the extension .lisp. + (AXIOMsys_noncompiled_lisp_sources): New. + (AXIOMsys_compiled_lisp_sources): Likewise. + (OPOBJS): Use compiled form of postprop. + (<>): New. + (PROCLAIMS): Adjust path to sys-pkg. + (${DEPSYS}): Adjust path to Lisp source files. + (${SAVESYS}): Likewise. + + Remove indivudial rules for compiling Common Lisp source files. + We now use the implicit rules from <>. + +2006-10-26 Gabriel Dos Reis + + * debugsys.lisp.pamphlet (build-interpsys): Load def.lisp only once. + +2006-10-26 Vanuexm Grégory + + * bookvol5.pamphlet (|importFromFrame|): Fix typo. + +2006-10-26 Camm Maguire + + * sockio.lisp.pamphlet: Fix second argument-type for + sock_send_float defentry. + +2006-10-25 Gabriel Dos Reis + + * debugsys.lisp.pamphlet (build-interpsys): Adjust pathname to + files that are local to the current build directory. + + * Makefile.pamphlet: Remove individual rules for making object + codes out of Boot pamphlet using bootsys. + (BOOT_TO_LISP, COMPILE_LISP): New. + (AXIOMsys_boot_sources): Likewise. List core Boot files here. + (<>): New chunk. Abstract over special + individual rules to translate Boot to object code, using bootsys. + * Makefile.in: Regenerate. + +2006-10-25 Gabriel Dos Reis + + * bookvol5.pamphlet (\subsection{*default-pathname-defaults*}): Remove. + (restart): Don't set *default-pathname-defaults*. + (reroot): Likewise. + * patches.lisp.pamphlet (|cd|): Likewise. + +2006-10-20 Waldek Hebisch + + * Makefile.pamphlet: Correct misleading information about + TRANOBJS + +2006-10-16 Gabriel Dos Reis + + * g-util.boot.pamphlet (str2Tex): Change local variable name "of" + to "outf". + +2006-10-12 Gabriel Dos Reis + + * Makefile.pamphlet (depsys_lisp_noncompiled_sources, + depsys_lisp_compiled_sources): New. + (depsys_lisp_sources): USe them. + (depsys_boot_sources): New. + (depsys_lisp_macro_sources): Rename from depsys_lisp_sources. + (makedep.lisp): Create in builddir. + +2006-10-10 Gabriel Dos Reis + + * Makefile.pamphlet (all-ax): Depend on $(MID) and $(AUTO). + +2006-10-08 Gabriel Dos Reis + + * Makefile.pamphlet: Remove references to ${MNT} throughout. + * Makefile.in: Regenerate. + +2006-10-05 Gabriel Dos Reis + + * Makefile.pamphlet (<>): Remove. + +2006-10-07 Gabriel Dos Reis + + * Makefile.pamphlet (all): Rework. Always keep stamp up-to-date + with respect to dependencies. + * Makefile.in: Regenerate. + +2006-10-02 Gabriel Dos Reis + + * debugsys.lisp.pamphlet: Fix misplaced parenthesis. + +2006-10-02 Gabriel Dos Reis + + * Makefile.pamphlet (AXIOMSYS): Leave dirname to ${MNT}/${SYS}/bin + for the moment. + * Makefile.in: Regenerate. + +2006-09-29 Gabriel Dos Reis + + * Makefile.pamphlet (BOOTSYS): Adjust definition. + (SAVESYS, AXIOMSYS): Likewise. + (<>): Use "$@". + ($(DEPSYS), $(SAVESYS)): Add dependency on $(axiom_build_bindir). + * Makefile.in: Regenerate. + +2006-09-28 Gabriel Dos Reis + + * util.lisp.pamphlet (build-depsys): Replace last six parameters + with only indicating the build directory. + (make_depsys): Likewise. + (build-interpsys): Lose last six parameters. + * Makefile.pamphlet (${DEPSYS}): Adjust call to build-depsys. + ($(SAVESYS)) Adjust call to build-interpsys. + * debugsys.lisp.pamphlet: Likewise. + +2006-09-26 Gabriel Dos Reis + + * Makefile.pamphlet (all): Create stamp file. + * Makefile.in: Regenerate. + +2006-09-25 Gabriel Dos Reis + + * debugsys.lisp.pamphlet: Don't load interp/sockio.o twice. + +2006-09-19 Gabriel Dos Reis + + * Makefile.pamphlet (all): Don't build $(DOCFILES) yet. + +2006-09-18 Gabriel Dos Reis + + * Makefile.pamphlet (subdir): New. + * Makefile.in: Regenerate. + +2006-09-17 Gabriel Dos Reis + + * Makefile.pamphlet (LISPSYS, LOADSYS): Point to + $(axiom_build_bindir)/lisp. + * Makefile.in: Regenerate. + +2006-09-13 Gabriel Dos Reis + + * Makefile.pamphlet: Throughout replace {O} with (OBJEXT). OBJEXT + is Autoconf-detected. + * Makefile.in: Regenerate. + +2006-09-11 Gabriel Dos Reis + + * Makefile.pamphlet (${SAVESYS}): Don't set + si::*system-directory*. + * Makefile.in: Regenerate. + +2006-09-09 Gabriel Dos Reis + + * Makefile.pamphlet: Throughout, substitute $(srcdir) for ${IN}. + Use $(axiom_build_document) --tangle in lieu of ${TANGLE}. + Use $(axiom_src_srcdir) in lieu of ${SRC}. + Use simplify ${SRC}/doc to $(axiom_src_docdir). + + +2006-09-03 Gabriel Dos Reis + + * Makefile.pamphlet: Throughout, remove special rules for making + DVI files. Use generic rules. + * Makefile.in: New. + +2006-08-27 Gabriel Dos Reis + + * Makefile.pamphlet: Don't overwrite $(TMP)/trace; append instead. + +2006-08-26 Camm Maguire + + * hash.lisp.pamphlet (mem_value): no longer static. + * sockio.lisp.pamphlet (sock_get_float): Value type is now a double. + * cfuns.lisp.pamphlet (MYCOMBINE): Now take ints and return an int. + diff --git a/src/interp/Makefile.in b/src/interp/Makefile.in new file mode 100644 index 00000000..876e13cc --- /dev/null +++ b/src/interp/Makefile.in @@ -0,0 +1,1113 @@ + +subdir = src/interp/ + +IN=$(srcdir) +DOC=$(axiom_target_docdir)/src/interp +BOOK=$(axiom_target_docdir) + +# Command to translate Boot to Common Lisp +BOOT_TO_LISP = $(BOOTSYS) -- --translate $< + +# Command to translate Common Lisp to native object code +COMPILE_LISP = $(DEPSYS) -- --compile --output=$@ $< +AUTO=$(axiom_targetdir)/autoload + +autoload_objects = + +# Build platform-dependent Lisp image, at the base of other +# derived Lisp images (depsys, interpsys, AXIOMsys) +LISPSYS= $(axiom_build_bindir)/lisp + +BOOTSYS= $(axiom_build_bindir)/bootsys + +DEPSYS = ./depsys +depsys_lisp_compiled_sources += parsing.lisp metalex.lisp bootlex.lisp \ + newaux.lisp preparse.lisp postprop.lisp def.lisp metameta.lisp \ + fnewmeta.lisp + +depsys_lisp_sources = $(depsys_lisp_noncompiled_sources) \ + $(depsys_lisp_compiled_sources) + +depsys_boot_sources = postpar.boot parse.boot clam.boot slam.boot \ + g-boot.boot g-error.boot c-util.boot g-util.boot +DEP= nlib.lisp \ + macros.lisp comp.lisp \ + spaderror.lisp debug.lisp \ + spad.lisp bits.lisp \ + setq.lisp property.lisp \ + unlisp.lisp foam_l.lisp \ + axext_l.lisp + +depsys_lisp_macro_sources = vmlisp.lisp ggreater.lisp hash.lisp \ + bootfuns.lisp union.lisp nlib.lisp macros.lisp \ + comp.lisp spaderror.lisp debug.lisp \ + spad.lisp bits.lisp setq.lisp property.lisp \ + unlisp.lisp foam_l.lisp axext_l.lisp + +depsys_lisp_noncompiled_sources += $(depsys_lisp_macro_sources) +depsys_lisp_SOURCES = $(addsuffix .pamphlet, $(depsys_lisp_sources)) +LOADSYS= $(axiom_build_bindir)/lisp$(EXEEXT) +SAVESYS= interpsys$(EXEEXT) +AXIOMSYS= $(axiom_target_bindir)/AXIOMsys$(EXEEXT) + +DEBUGSYS=$(axiom_build_bindir)/debugsys$(EXEEXT) + +OBJS= vmlisp.$(FASLEXT) hash.$(FASLEXT) \ + bootfuns.$(FASLEXT) macros.$(FASLEXT) \ + unlisp.$(FASLEXT) setq.$(FASLEXT) \ + astr.$(FASLEXT) bits.$(FASLEXT) \ + alql.$(FASLEXT) buildom.$(FASLEXT) \ + cattable.$(FASLEXT) \ + cformat.$(FASLEXT) cfuns.$(FASLEXT) \ + clam.$(FASLEXT) clammed.$(FASLEXT) \ + comp.$(FASLEXT) foam_l.$(FASLEXT) \ + compat.$(FASLEXT) compress.$(FASLEXT) \ + cparse.$(FASLEXT) cstream.$(FASLEXT) \ + database.$(FASLEXT) \ + debug.$(FASLEXT) dq.$(FASLEXT) \ + fname.$(FASLEXT) format.$(FASLEXT) \ + g-boot.$(FASLEXT) g-cndata.$(FASLEXT) \ + g-error.$(FASLEXT) g-opt.$(FASLEXT) \ + g-timer.$(FASLEXT) g-util.$(FASLEXT) \ + ggreater.$(FASLEXT) \ + hypertex.$(FASLEXT) i-analy.$(FASLEXT) \ + i-code.$(FASLEXT) i-coerce.$(FASLEXT) \ + i-coerfn.$(FASLEXT) i-eval.$(FASLEXT) \ + i-funsel.$(FASLEXT) bookvol5.$(FASLEXT) \ + i-intern.$(FASLEXT) i-map.$(FASLEXT) \ + i-output.$(FASLEXT) i-resolv.$(FASLEXT) \ + i-spec1.$(FASLEXT) \ + i-spec2.$(FASLEXT) i-syscmd.$(FASLEXT) \ + i-toplev.$(FASLEXT) i-util.$(FASLEXT) \ + incl.$(FASLEXT) int-top.$(FASLEXT) \ + intfile.$(FASLEXT) \ + lisplib.$(FASLEXT) macex.$(FASLEXT) \ + match.$(FASLEXT) \ + monitor.$(FASLEXT) msg.$(FASLEXT) \ + msgdb.$(FASLEXT) nci.$(FASLEXT) \ + newaux.$(FASLEXT) newfort.$(FASLEXT) \ + nlib.$(FASLEXT) nrunfast.$(FASLEXT) \ + nrungo.$(FASLEXT) nrunopt.$(FASLEXT) \ + nruntime.$(FASLEXT) osyscmd.$(FASLEXT) \ + packtran.$(FASLEXT) pathname.$(FASLEXT) \ + pf2sex.$(FASLEXT) pile.$(FASLEXT) \ + posit.$(FASLEXT) property.$(FASLEXT) \ + ptrees.$(FASLEXT) ptrop.$(FASLEXT) \ + record.$(FASLEXT) \ + rulesets.$(FASLEXT) \ + scan.$(FASLEXT) serror.$(FASLEXT) \ + server.$(FASLEXT) \ + setvars.$(FASLEXT) \ + sfsfun-l.$(FASLEXT) sfsfun.$(FASLEXT) \ + simpbool.$(FASLEXT) slam.$(FASLEXT) \ + sockio.$(FASLEXT) spad.$(FASLEXT) \ + spaderror.$(FASLEXT) \ + template.$(FASLEXT) termrw.$(FASLEXT) \ + trace.$(FASLEXT) \ + union.$(FASLEXT) daase.$(FASLEXT) \ + fortcall.$(FASLEXT) + +interpsys_modules = $(patsubst %.$(FASLEXT), "%", $(OBJS)) + +AXIOMsys_noncompiled_lisp_sources = bootfuns.lisp nocompil.lisp \ + postprop.lisp property.lisp setq.lisp + +AXIOMsys_compiled_lisp_sources = bits.lisp \ + bootlex.lisp cfuns.lisp comp.lisp construc.lisp daase.lisp \ + debug.lisp def.lisp fname.lisp fnewmeta.lisp ggreater.lisp \ + hash.lisp macros.lisp metalex.lisp monitor.lisp newaux.lisp \ + nlib.lisp nspadaux.lisp parsing.lisp \ + patches.lisp preparse.lisp \ + sockio.lisp spad.lisp spaderror.lisp \ + union.lisp util.lisp vmlisp.lisp obey.lisp \ + unlisp.lisp intint.lisp nci.lisp sfsfun-l.lisp \ + axext_l.lisp foam_l.lisp + +AXIOMsys_boot_sources = astr.boot alql.boot buildom.boot cattable.boot \ + cformat.boot clam.boot clammed.boot compat.boot compress.boot \ + cparse.boot cstream.boot database.boot dq.boot format.boot \ + g-boot.boot g-cndata.boot g-error.boot g-opt.boot g-timer.boot \ + g-util.boot hypertex.boot i-analy.boot i-code.boot i-coerce.boot \ + i-coerfn.boot i-eval.boot i-funsel.boot i-intern.boot i-map.boot \ + i-output.boot i-resolv.boot i-spec1.boot i-spec2.boot \ + i-syscmd.boot i-toplev.boot i-util.boot incl.boot int-top.boot \ + intfile.boot lisplib.boot macex.boot match.boot msg.boot \ + msgdb.boot newfort.boot nrunfast.boot nrungo.boot nrunopt.boot \ + nruntime.boot osyscmd.boot packtran.boot pathname.boot \ + pf2sex.boot pile.boot posit.boot ptrees.boot ptrop.boot \ + record.boot rulesets.boot scan.boot serror.boot server.boot \ + setvars.boot sfsfun.boot simpbool.boot slam.boot template.boot \ + termrw.boot trace.boot fortcall.boot +INOBJS= varini.$(FASLEXT) parini.$(FASLEXT) \ + setvart.$(FASLEXT) intint.$(FASLEXT) \ + xrun.$(FASLEXT) interop.$(FASLEXT) \ + patches.$(FASLEXT) + +IN_modules = $(patsubst %.$(FASLEXT), "%", $(INOBJS)) + +# These are autloaded old parser files +OPOBJS= ${AUTO}/parsing.$(FASLEXT) ${AUTO}/bootlex.$(FASLEXT) \ + ${AUTO}/def.$(FASLEXT) \ + ${AUTO}/fnewmeta.$(FASLEXT) ${AUTO}/metalex.$(FASLEXT) \ + ${AUTO}/metameta.$(FASLEXT) \ + ${AUTO}/parse.$(FASLEXT) ${AUTO}/postpar.$(FASLEXT) \ + ${AUTO}/postprop.$(FASLEXT) ${AUTO}/preparse.$(FASLEXT) + +autoload_objects += $(OPBJS) +OCOBJS= ${AUTO}/apply.$(FASLEXT) ${AUTO}/c-doc.$(FASLEXT) \ + ${AUTO}/c-util.$(FASLEXT) ${AUTO}/profile.$(FASLEXT) \ + ${AUTO}/category.$(FASLEXT) ${AUTO}/compiler.$(FASLEXT) \ + ${AUTO}/define.$(FASLEXT) ${AUTO}/functor.$(FASLEXT) \ + ${AUTO}/info.$(FASLEXT) ${AUTO}/iterator.$(FASLEXT) \ + ${AUTO}/modemap.$(FASLEXT) ${AUTO}/nruncomp.$(FASLEXT) \ + ${AUTO}/package.$(FASLEXT) ${AUTO}/htcheck.$(FASLEXT) \ + ${AUTO}/xruncomp.$(FASLEXT) + +autoload_objects += $(OCOBJS) + +BROBJS= ${AUTO}/bc-matrix.$(FASLEXT) \ + ${AUTO}/bc-misc.$(FASLEXT) ${AUTO}/bc-solve.$(FASLEXT) \ + ${AUTO}/bc-util.$(FASLEXT) \ + ${AUTO}/ht-util.$(FASLEXT) ${AUTO}/htsetvar.$(FASLEXT) \ + ${AUTO}/ht-root.$(FASLEXT) \ + ${AUTO}/br-con.$(FASLEXT) \ + ${AUTO}/br-data.$(FASLEXT) ${AUTO}/showimp.$(FASLEXT) \ + ${AUTO}/br-op1.$(FASLEXT) ${AUTO}/br-op2.$(FASLEXT) \ + ${AUTO}/br-search.$(FASLEXT) ${AUTO}/br-util.$(FASLEXT) \ + ${AUTO}/topics.$(FASLEXT) ${AUTO}/br-prof.$(FASLEXT) \ + ${AUTO}/br-saturn.$(FASLEXT) + +autoload_objects += $(BFOBJS) + +TRANOBJS= ${AUTO}/wi1.$(FASLEXT) ${AUTO}/wi2.$(FASLEXT) ${AUTO}/pspad1.$(FASLEXT) \ + ${AUTO}/pspad2.$(FASLEXT) ${AUTO}/mark.$(FASLEXT) ${AUTO}/nspadaux.$(FASLEXT) \ + ${AUTO}/def.$(FASLEXT) + +autoload_objects += $(TRANOBJS) + +NAGBROBJS= ${AUTO}/nag-c02.$(FASLEXT) ${AUTO}/nag-c05.$(FASLEXT) \ + ${AUTO}/nag-c06.$(FASLEXT) ${AUTO}/nag-d01.$(FASLEXT) \ + ${AUTO}/nag-d02.$(FASLEXT) ${AUTO}/nag-d03.$(FASLEXT) \ + ${AUTO}/nag-e01.$(FASLEXT) ${AUTO}/nag-e02.$(FASLEXT) \ + ${AUTO}/nag-e04.$(FASLEXT) ${AUTO}/nag-f01.$(FASLEXT) \ + ${AUTO}/nag-f02.$(FASLEXT) ${AUTO}/nag-f04.$(FASLEXT) \ + ${AUTO}/nag-f07.$(FASLEXT) ${AUTO}/nag-s.$(FASLEXT) + +autoload_objects += $(NAGBROBJS) + +ASCOMP= hashcode.$(FASLEXT) as.$(FASLEXT) \ + foam_l.$(FASLEXT) axext_l.$(FASLEXT) + +AS_modules = $(patsubst %.$(FASLEXT), "%", $(ASCOMP)) + +ASAUTO= ${AUTO}/ax.$(FASLEXT) + +autoload_objects += $(ASAUTO) +TIMESTAMP=$(axiom_targetdir)/timestamp +YEARWEEK=(progn (setq boot::timestamp "${TIMESTAMP}") \ + (setq boot::*build-version* "$(PACKAGE_STRING)") \ + (boot::yearweek)) + + +.PRECIOUS: ${DEPSYS} +.PRECIOUS: ${SAVESYS} +.PRECIOUS: ${AXIOMSYS} + +UNUSED= ${DOC}/anna.boot.dvi ${DOC}/construc.lisp.dvi \ + ${DOC}/domain.lisp.dvi ${DOC}/guess.boot.dvi \ + ${DOC}/interp-fix.boot.dvi \ + ${DOC}/nhyper.boot.dvi ${DOC}/pf2atree.boot.dvi \ + ${DOC}/redefs.boot.dvi ${DOC}/word.boot.dvi + + +.SUFFIXES: +.SUFFIXES: .boot .clisp .lisp .pamphlet + +.PHONY: all all-ax all-depsys all-interpsys all-axiomsys all-debugsys + +all: all-ax + +all-ax: stamp + @echo finished $(srcdir) + +stamp: $(AUTO) remove-stamp build-images + $(STAMP) stamp + +.PHONY: remove-stamp +remove-stamp: + -rm -f stamp + +.PHONY: build-images +build-images: remove-stamp all-interpsys all-debugsys + +all-interpsys: all-depsys + $(mkinstalldirs) $(AUTO) + $(MAKE) $(SAVESYS) + +all-axiomsys: all-depsys + $(MAKE) $(AXIOMSYS) + +all-debugsys: all-interpsys + $(MAKE) $(DEBUGSYS) + +all-depsys: $(DEPSYS) + +.PRECIOUS: %.boot +%.boot: $(srcdir)/%.boot.pamphlet + $(axiom_build_document) --tangle --output=$@ $< +.PRECIOUS: %.clisp +%.clisp: %.boot + $(BOOT_TO_LISP) +.PRECIOUS: %.$(FASLEXT) +%.$(FASLEXT): %.clisp + $(COMPILE_LISP) +# Extract and compile the part of the interpreter written +# in Common Lisp +.PRECIOUS: %.lisp +%.$(FASLEXT): %.lisp + $(COMPILE_LISP) + +%.lisp: $(srcdir)/%.lisp.pamphlet + $(axiom_build_document) --tangle --output=$@ $< + +mostlyclean-local: + @rm -f *.fn *.data *.$(FASLEXT) *.lib + +clean-local: mostlyclean-local + @rm -f *.clisp *.lsp + +distclean-local: clean-local + +makeint.lisp: ${DEPSYS} ${OBJS} bookvol5.$(FASLEXT) util.$(FASLEXT) \ + nocompil.lisp \ + ${OUTINTERP} ${OCOBJS} ${OPOBJS} ${BROBJS} obey.$(FASLEXT) \ + database.date ${INOBJS} ${ASCOMP} ${ASAUTO} \ + ${NAGBROBJS} ${TRANOBJS} \ + ${LOADSYS} \ + $(axiom_targetdir)/algebra/exposed.$(FASLEXT) \ + $(axiom_src_docdir)/msgs/s2-us.msgs \ + ../algebra/warm.data + @ echo 5 invoking make in `pwd` with parms: + @rm -f makeint.lisp + @ echo SYS= ${SYS} + @ echo LISP=${LISP} BYE=${BYE} + $(mkinstalldirs) $(axiom_target_datadir)/msgs + $(INSTALL_DATA) $(axiom_src_docdir)/msgs/s2-us.msgs \ + $(axiom_target_datadir)/msgs + @ echo '(|importModule| "vmlisp")' >> makeint.lisp + @ echo '(|importModule| "hash")' >> makeint.lisp + @ echo '(|importModule| "bootfuns")' >> makeint.lisp + @ echo '(gbc t)' >> makeint.lisp + @ echo '(load "nocompil.lisp")' >> makeint.lisp + @ echo '(|importModule| "bookvol5")' >> makeint.lisp + @ echo '(|importModule| "util")' >> makeint.lisp + @ echo '(in-package "BOOT")' >> makeint.lisp + @ touch ${TIMESTAMP} + @ echo '${YEARWEEK}' >> makeint.lisp + @ echo '(boot::build-interpsys (append (quote ($(interpsys_modules))) (quote ($(AS_modules))) (quote ($(IN_modules)))) (quote ($(patsubst %, "%", ${OPOBJS}))) (quote ($(patsubst %, "%", ${OCOBJS}))) (quote ($(patsubst %, "%", ${BROBJS}))) (quote ($(patsubst %, "%", ${TRANOBJS}))) (quote ($(patsubst %, "%", ${NAGBROBJS}))) (quote ($(patsubst %, "%", ${ASAUTO}))) "${AXIOM}")' >> makeint.lisp + @ echo '(boot::set-restart-hook)' >> makeint.lisp + @ echo '(in-package "BOOT")' >> makeint.lisp + @ echo '(load "../algebra/warm.data")' >> makeint.lisp + @ echo '(boot::|clearClams|)' >> makeint.lisp + @ echo '(load "obey")' >> makeint.lisp + @ echo '#+:akcl (setq compiler::*suppress-compiler-notes* t)' >> makeint.lisp + @ echo '#+:akcl (si::gbc-time 0)' >> makeint.lisp + @ echo '(gbc t)' >> makeint.lisp + +${SAVESYS}: makeint.lisp + AXIOM="$(AXIOM)" DAASE="$(axiom_src_datadir)" \ + $(LOADSYS) -- --make --output=$@ --main="BOOT::RESTART" \ + --load-directory=. makeint.lisp + @ echo 6 ${SAVESYS} created + $(mkinstalldirs) $(axiom_target_bindir) +depsys_lisp_sources += parsing.lisp metalex.lisp bootlex.lisp \ + newaux.lisp preparse.lisp postprop.lisp \ + metameta.lisp fnewmeta.lisp + +depsys_boot_sources = postpar.boot parse.boot clam.boot slam.boot \ + g-boot.boot g-error.boot c-util.boot g-util.boot + +depsys_SOURCES = $(depsys_lisp_SOURCES) $(depsys_boot_SOURCES) + +depsys_objects = nocompil.$(FASLEXT) bookvol5.$(FASLEXT) g-error.$(FASLEXT) \ + util.$(FASLEXT) postpar.$(FASLEXT) parse.$(FASLEXT) \ + parsing.$(FASLEXT) metalex.$(FASLEXT) bootlex.$(FASLEXT) \ + newaux.$(FASLEXT) preparse.$(FASLEXT) postprop.$(FASLEXT) \ + metameta.$(FASLEXT) fnewmeta.$(FASLEXT) clam.$(FASLEXT) \ + slam.$(FASLEXT) g-boot.$(FASLEXT) c-util.$(FASLEXT) \ + g-util.$(FASLEXT) + +${DEPSYS}: vmlisp.$(FASLEXT) \ + hash.$(FASLEXT) \ + ggreater.$(FASLEXT) \ + union.$(FASLEXT) \ + bootfuns.$(FASLEXT) \ + ${DEP} \ + nocompil.$(FASLEXT) \ + bookvol5.$(FASLEXT)\ + util.$(FASLEXT) \ + postpar.clisp parse.clisp \ + parsing.lisp metalex.lisp \ + bootlex.lisp newaux.lisp \ + preparse.lisp \ + postprop.lisp def.lisp \ + metameta.lisp fnewmeta.lisp \ + g-error.clisp \ + g-boot.clisp c-util.${LISP} \ + g-util.clisp \ + clam.clisp \ + slam.clisp + @ echo 3 making ${DEPSYS} + @ rm -f makedep.lisp + @ $(mkinstalldirs) $(axiom_build_bindir) + @ echo '(|importModule| "vmlisp")' >> makedep.lisp + @ echo '(|importModule| "hash")' >> makedep.lisp + @ echo '(|importModule| "ggreater")' >> makedep.lisp + @ echo '(|importModule| "union")' >> makedep.lisp + @ echo '(|importModule| "bootfuns")' >> makedep.lisp + @ echo '(|importModule| "nocompil")' >> makedep.lisp + @ echo '(|importModule| "bookvol5")' >> makedep.lisp + @ echo '(|importModule| "util")' >> makedep.lisp + @ echo '(in-package "BOOT")' >> makedep.lisp + @ echo '(build-depsys (quote ($(patsubst %, "%", ${DEP}))) "${AXIOM}")' >> makedep.lisp + @ echo '(unless (probe-file "postpar.$(FASLEXT)") (compile-file "postpar.clisp" :output-file "postpar.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "postpar")' >> makedep.lisp + @ echo '(unless (probe-file "parse.$(FASLEXT)") (compile-file "parse.clisp" :output-file "parse.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "parse")' >> makedep.lisp + @ echo '(unless (probe-file "parsing.$(FASLEXT)") (compile-file "parsing.lisp" :output-file "parsing.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "parsing")' >> makedep.lisp + @ echo '(unless (probe-file "metalex.$(FASLEXT)") (compile-file "metalex.lisp" :output-file "metalex.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "metalex")' >> makedep.lisp + @ echo '(unless (probe-file "bootlex.$(FASLEXT)") (compile-file "bootlex.lisp" :output-file "bootlex.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "bootlex")' >> makedep.lisp + @ echo '(unless (probe-file "newaux.$(FASLEXT)") (compile-file "newaux.lisp" :output-file "newaux.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "newaux")' >> makedep.lisp + @ echo '(unless (probe-file "preparse.$(FASLEXT)") (compile-file "preparse.lisp" :output-file "preparse.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "preparse")' >> makedep.lisp + @ echo '(unless (probe-file "postprop.$(FASLEXT)") (compile-file "postprop.lisp" :output-file "postprop.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "postprop")' >> makedep.lisp + @ echo '(unless (probe-file "def.$(FASLEXT)") (compile-file "def.lisp" :output-file "def.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "def")' >> makedep.lisp + @ echo '(unless (probe-file "metameta.$(FASLEXT)") (compile-file "metameta.lisp" :output-file "metameta.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "metameta")' >> makedep.lisp + @ echo '(unless (probe-file "fnewmeta.$(FASLEXT)") (compile-file "fnewmeta.lisp" :output-file "fnewmeta.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "fnewmeta")' >> makedep.lisp + @ echo '(unless (probe-file "clam.$(FASLEXT)") (compile-file "clam.clisp" :output-file "clam.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "clam")' >> makedep.lisp + @ echo '(unless (probe-file "slam.$(FASLEXT)") (compile-file "slam.clisp" :output-file "slam.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "slam")' >> makedep.lisp + @ echo '(unless (probe-file "g-error.$(FASLEXT)") (compile-file "g-error.clisp" :output-file "g-error.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "g-error")' >> makedep.lisp + @ echo '(unless (probe-file "g-boot.$(FASLEXT)") (compile-file "g-boot.clisp" :output-file "g-boot.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "g-boot")' >> makedep.lisp + @ echo '(unless (probe-file "c-util.$(FASLEXT)") (compile-file "c-util.${LISP}" :output-file "c-util.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "c-util")' >> makedep.lisp + @ echo '(unless (probe-file "g-util.$(FASLEXT)") (compile-file "g-util.clisp" :output-file "g-util.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "g-util")' >> makedep.lisp + ../lisp/base-lisp$(EXEEXT) -- --make --output=$@ \ + --load-directory=. makedep.lisp + @rm $(addsuffix .$(FASLEXT), \ + postpar parse parsing metalex bootlex newaux preparse \ + postprop def metameta fnewmeta clam slam g-error \ + g-boot c-util g-util) + @ echo 4 ${DEPSYS} created + + +util.$(FASLEXT): util.lisp bootfuns.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +bookvol5.$(FASLEXT): bookvol5.lisp bootfuns.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +nocompil.$(FASLEXT): nocompil.lisp bootfuns.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +bootfuns.$(FASLEXT): bootfuns.lisp hash.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +hash.$(FASLEXT): hash.lisp vmlisp.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +union.$(FASLEXT): union.lisp vmlisp.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +ggreater.$(FASLEXT): ggreater.lisp vmlisp.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +vmlisp.$(FASLEXT): vmlisp.lisp + $(BOOTSYS) -- --compile --output=$@ $< + +.PHONY: all-axiomsys + +all-axiomsys: ${AXIOMSYS} + +${AXIOMSYS}: makeint.lisp + AXIOM="$(AXIOM)" DAASE="$(axiom_targetdir)" \ + $(LOADSYS) -- --make --output=$@ --main="BOOT::RESTART" \ + --load-directory=. makeint.lisp + @ echo 6a ${AXIOMSYS} created +${DEBUGSYS}: debugsys.lisp + @ echo 7 building debugsys + @ echo '(progn (gbc t) (load "debugsys.lisp") (in-package "BOOT") (spad-save "$@"))' | ${LISPSYS} + @ echo 8 ${DEBUGSYS} created + +exposed.lsp: $(axiom_src_algdir)/exposed.lsp.pamphlet + @ echo 615 making exposed.lsp from $(axiom_src_algdir)/exposed.lsp.pamphlet + $(axiom_build_document) --tangle --output=$@ $< + +$(axiom_targetdir)/algebra/exposed.$(FASLEXT) : exposed.lsp ${LISPSYS} + @ echo 616 making $@ from exposed.lsp + $(mkinstalldirs) $(axiom_targetdir)/algebra + @ echo '(progn (compile-file "exposed.lsp" :output-file "$(axiom_targetdir)/algebra/exposed.$(FASLEXT)"))' | ${LISPSYS} + +database.date: + @ echo 617 the database was updated...remaking interpsys + @ touch database.date + + +${AUTO}/apply.$(FASLEXT): apply.$(FASLEXT) + @ echo 9 making ${AUTO}/apply.$(FASLEXT) from apply.$(FASLEXT) + @ cp apply.$(FASLEXT) ${AUTO} + + +as.clisp: as.boot + @ echo 417 making $@ from $< + @ echo '(progn (old-boot::boot "as.boot"))' | ${DEPSYS} + +${AUTO}/ax.$(FASLEXT): ax.$(FASLEXT) + @ echo 461 making ${AUTO}/ax.$(FASLEXT) from ax.$(FASLEXT) + @ cp ax.$(FASLEXT) ${AUTO} + +ax.clisp: ax.boot + @ echo 463 making $@ $< + @ echo '(progn (old-boot::boot "ax.boot"))' | ${DEPSYS} + +${AUTO}/bc-matrix.$(FASLEXT): bc-matrix.$(FASLEXT) + @ echo 422 making ${AUTO}/bc-matrix.$(FASLEXT) from bc-matrix.$(FASLEXT) + @ cp bc-matrix.$(FASLEXT) ${AUTO} + +bc-matrix.clisp: bc-matrix.boot + @ echo 424 making $@ from $< + @ echo '(progn (old-boot::boot "bc-matrix.boot"))' | ${DEPSYS} + +${AUTO}/bc-misc.$(FASLEXT): bc-misc.$(FASLEXT) + @ echo 426 making ${AUTO}/bc-misc.$(FASLEXT) from bc-misc.$(FASLEXT) + @ cp bc-misc.$(FASLEXT) ${AUTO} + +bc-misc.clisp: bc-misc.boot + @ echo 428 making $@ from $< + @ echo '(progn (old-boot::boot "bc-misc.boot"))' | ${DEPSYS} + +${AUTO}/bc-solve.$(FASLEXT): bc-solve.$(FASLEXT) + @ echo 430 making ${AUTO}/bc-solve.$(FASLEXT) from bc-solve.$(FASLEXT) + @ cp bc-solve.$(FASLEXT) ${AUTO} + +bc-solve.clisp: bc-solve.boot + @ echo 432 making $@ from $< + @ echo '(progn (old-boot::boot "bc-solve.boot"))' | ${DEPSYS} + +${AUTO}/bc-util.$(FASLEXT): bc-util.$(FASLEXT) + @ echo 434 making ${AUTO}/bc-util.$(FASLEXT) from bc-util.$(FASLEXT) + @ cp bc-util.$(FASLEXT) ${AUTO} + +bc-util.clisp: bc-util.boot + @ echo 436 making $@ from $< + @ echo '(progn (old-boot::boot "bc-util.boot"))' | ${DEPSYS} + +${AUTO}/bootlex.$(FASLEXT): bootlex.$(FASLEXT) + @ echo 19 making ${AUTO}/bootlex.$(FASLEXT) from bootlex.$(FASLEXT) + @ cp bootlex.$(FASLEXT) ${AUTO} + + +${AUTO}/br-con.$(FASLEXT): br-con.$(FASLEXT) + @ echo 465 making ${AUTO}/br-con.$(FASLEXT) from br-con.$(FASLEXT) + @ cp br-con.$(FASLEXT) ${AUTO} + +br-con.clisp: br-con.boot + @ echo 467 making $@ from $< + @ echo '(progn (old-boot::boot "br-con.boot"))' | ${DEPSYS} + +${AUTO}/br-data.$(FASLEXT): br-data.$(FASLEXT) + @ echo 481 making ${AUTO}/br-data.$(FASLEXT) from br-data.$(FASLEXT) + @ cp br-data.$(FASLEXT) ${AUTO} + +br-data.clisp: br-data.boot + @ echo 483 making $@ from $< + @ echo '(progn (old-boot::boot "br-data.boot"))' | ${DEPSYS} + +${AUTO}/br-op1.$(FASLEXT): br-op1.$(FASLEXT) + @ echo 473 making ${AUTO}/br-op1.$(FASLEXT) from br-op1.$(FASLEXT) + @ cp br-op1.$(FASLEXT) ${AUTO} + +br-op1.clisp: br-op1.boot + @ echo 475 making $@ from $< + @ echo '(progn (old-boot::boot "br-op1.boot"))' | ${DEPSYS} + +${AUTO}/br-op2.$(FASLEXT): br-op2.$(FASLEXT) + @ echo 477 making ${AUTO}/br-op2.$(FASLEXT) from br-op2.$(FASLEXT) + @ cp br-op2.$(FASLEXT) ${AUTO} + +br-op2.clisp: br-op2.boot + @ echo 479 making $@ from $< + @ echo '(progn (old-boot::boot "br-op2.boot"))' | ${DEPSYS} + +${AUTO}/br-prof.$(FASLEXT): br-prof.$(FASLEXT) + @ echo 497 making ${AUTO}/br-prof.$(FASLEXT) from br-prof.$(FASLEXT) + @ cp br-prof.$(FASLEXT) ${AUTO} + +br-prof.clisp: br-prof.boot + @ echo 499 making $@ from $< + @ ($(axiom_build_document) --tangle --output=br-prof.boot $< ;\ + echo '(progn (old-boot::boot "br-prof.boot"))' | ${DEPSYS}; \ + rm br-prof.boot ) + + +${AUTO}/br-saturn.$(FASLEXT): br-saturn.$(FASLEXT) + @ echo 489 making ${AUTO}/br-saturn.$(FASLEXT) from br-saturn.$(FASLEXT) + @ cp br-saturn.$(FASLEXT) ${AUTO} + +br-saturn.clisp: br-saturn.boot + @ echo 491 making $@ from $< + @ echo '(progn (old-boot::boot "br-saturn.boot"))' | ${DEPSYS} + +${AUTO}/br-search.$(FASLEXT): br-search.$(FASLEXT) + @ echo 469 making ${AUTO}/br-search.$(FASLEXT) from br-search.$(FASLEXT) + @ cp br-search.$(FASLEXT) ${AUTO} + +br-search.clisp: br-search.boot + @ echo 471 making $@ from $< + @ echo '(progn (old-boot::boot "br-search.boot"))' | ${DEPSYS} + +${AUTO}/br-util.$(FASLEXT): br-util.$(FASLEXT) + @ echo 485 making ${AUTO}/br-util.$(FASLEXT) from br-util.$(FASLEXT) + @ cp br-util.$(FASLEXT) ${AUTO} + +br-util.clisp: br-util.boot + @ echo 487 making $@ from $< + @ echo '(progn (old-boot::boot "br-util.boot"))' | ${DEPSYS} + +buildom.clisp: buildom.boot + @ echo 143 making $@ from $< + @ echo '(progn (old-boot::boot "buildom.boot"))' | ${DEPSYS} + + +${AUTO}/category.$(FASLEXT): category.$(FASLEXT) + @ echo 210 making ${AUTO}/ category.$(FASLEXT) from category.$(FASLEXT) + @ cp category.$(FASLEXT) ${AUTO} + +category.clisp: category.boot + @ echo 212 making $@ from $< + @ echo '(progn (old-boot::boot "category.boot"))' | ${DEPSYS} + +cattable.clisp: cattable.boot + @ echo 215 making $@ from $< + @ echo '(progn (old-boot::boot "cattable.boot"))' | ${DEPSYS} + +${AUTO}/c-doc.$(FASLEXT): c-doc.$(FASLEXT) + @ echo 217 making ${AUTO}/c-doc.$(FASLEXT) from c-doc.$(FASLEXT) + @ cp c-doc.$(FASLEXT) ${AUTO} + +c-doc.clisp: c-doc.boot + @ echo 219 making $@ from $< + @ echo '(progn (old-boot::boot "c-doc.boot"))' | ${DEPSYS} + +clammed.clisp: clammed.boot + @ echo 226 making $@ from $< + @ echo '(progn (old-boot::boot "clammed.boot"))' | ${DEPSYS} + +compat.clisp: compat.boot + @ echo 229 making $@ from $< + @ echo '(progn (old-boot::boot "compat.boot"))' | ${DEPSYS} + +${AUTO}/compiler.$(FASLEXT): compiler.$(FASLEXT) + @ echo 231 making ${AUTO}/compiler.$(FASLEXT) from compiler.$(FASLEXT) + @ cp compiler.$(FASLEXT) ${AUTO} + +compiler.clisp: compiler.boot + @ echo 233 making $@ from $< + @ echo '(progn (old-boot::boot "compiler.boot"))' | ${DEPSYS} + +${AUTO}/c-util.$(FASLEXT): c-util.$(FASLEXT) + @ echo 145 making ${AUTO}/c-util.$(FASLEXT) from c-util.$(FASLEXT) + @ cp c-util.$(FASLEXT) ${AUTO} + +c-util.${LISP}: $(srcdir)/c-util.boot.pamphlet + @ echo 146 making c-util.${LISP} from $(srcdir)/c-util.boot.pamphlet + @ rm -f c-util.$(FASLEXT) + $(axiom_build_document) --tangle=c-util.clisp --output=$@ $< + +c-util.clisp: c-util.boot + @ echo 148 making $@ from $< + @ echo '(progn (old-boot::boot "c-util.boot"))' | ${DEPSYS} + + +database.clisp: database.boot + @ echo 243 making $@ from $< + @ echo '(progn (old-boot::boot "database.boot"))' | ${DEPSYS} + +debugsys.lisp: $(srcdir)/debugsys.lisp.pamphlet + $(axiom_build_document) --tangle --output=$@ $< + +${AUTO}/def.$(FASLEXT): def.$(FASLEXT) + @ echo 41 making ${AUTO}/def.$(FASLEXT) from def.$(FASLEXT) + @ cp def.$(FASLEXT) ${AUTO} + + +${AUTO}/define.$(FASLEXT): define.$(FASLEXT) + @ echo 245 making ${AUTO}/define.$(FASLEXT) from define.$(FASLEXT) + @ cp define.$(FASLEXT) ${AUTO} + +define.clisp: define.boot + @ echo 247 making $@ from $< + @ echo '(progn (old-boot::boot "define.boot"))' | ${DEPSYS} + +${AUTO}/fnewmeta.$(FASLEXT): fnewmeta.$(FASLEXT) + @ echo 49 making ${AUTO}/fnewmeta.$(FASLEXT) from fnewmeta.$(FASLEXT) + @ cp fnewmeta.$(FASLEXT) ${AUTO} + + +format.clisp: format.boot + @ echo 250 making $@ from $< + @ echo '(progn (old-boot::boot "format.boot"))' | ${DEPSYS} + +fortcall.clisp: fortcall.boot + @ echo 55 making $@ from $< + @ echo '(progn (old-boot::boot "fortcall.boot"))' | ${DEPSYS} + + +${AUTO}/functor.$(FASLEXT): functor.$(FASLEXT) + @ echo 252 making ${AUTO}/functor.$(FASLEXT) from functor.$(FASLEXT) + @ cp functor.$(FASLEXT) ${AUTO} + +functor.clisp: functor.boot + @ echo 254 making $@ from $< + @ echo '(progn (old-boot::boot "functor.boot"))' | ${DEPSYS} + +g-cndata.clisp: g-cndata.boot + @ echo 261 making $@ from $< + @ echo '(progn (old-boot::boot "g-cndata.boot"))' | ${DEPSYS} + +g-opt.clisp: g-opt.boot + @ echo 267 making $@ from $< + @ echo '(progn (old-boot::boot "g-opt.boot"))' | ${DEPSYS} + +g-timer.clisp: g-timer.boot + @ echo 270 making $@ from $< + @ echo '(progn (old-boot::boot "g-timer.boot"))' | ${DEPSYS} + +${AUTO}/htcheck.$(FASLEXT): htcheck.$(FASLEXT) + @ echo 453 making ${AUTO}/htcheck.$(FASLEXT) from htcheck.$(FASLEXT) + @ cp htcheck.$(FASLEXT) ${AUTO} + +htcheck.clisp: htcheck.boot + @ echo 455 making $@ from $< + @ echo '(progn (old-boot::boot "htcheck.boot"))' | ${DEPSYS} + +${AUTO}/ht-root.$(FASLEXT): ht-root.$(FASLEXT) + @ echo 449 making ${AUTO}/ht-root.$(FASLEXT) from ht-root.$(FASLEXT) + @ cp ht-root.$(FASLEXT) ${AUTO} + +ht-root.clisp: ht-root.boot + @ echo 451 making $@ from $< + @ echo '(progn (old-boot::boot "ht-root.boot"))' | ${DEPSYS} + +${AUTO}/htsetvar.$(FASLEXT): htsetvar.$(FASLEXT) + @ echo 442 making ${AUTO}/htsetvar.$(FASLEXT) from htsetvar.$(FASLEXT) + @ cp htsetvar.$(FASLEXT) ${AUTO} + +htsetvar.clisp: htsetvar.boot + @ echo 444 making $@ from $< + @ echo '(progn (old-boot::boot "htsetvar.boot"))' | ${DEPSYS} + +${AUTO}/ht-util.$(FASLEXT): ht-util.$(FASLEXT) + @ echo 438 making ${AUTO}/ht-util.$(FASLEXT) from ht-util.$(FASLEXT) + @ cp ht-util.$(FASLEXT) ${AUTO} + +ht-util.clisp: ht-util.boot + @ echo 440 making $@ from $< + @ echo '(progn (old-boot::boot "ht-util.boot"))' | ${DEPSYS} + +hypertex.clisp: hypertex.boot + @ echo 277 making $@ from $< + @ echo '(progn (old-boot::boot "hypertex.boot"))' | ${DEPSYS} + +i-analy.clisp: i-analy.boot + @ echo 280 making $@ from $< + @ echo '(progn (old-boot::boot "i-analy.boot"))' | ${DEPSYS} + +i-code.clisp: i-code.boot + @ echo 283 making $@ from $< + @ echo '(progn (old-boot::boot "i-code.boot"))' | ${DEPSYS} + +i-coerce.clisp: i-coerce.boot + @ echo 286 making $@ from $< + @ echo '(progn (old-boot::boot "i-coerce.boot"))' | ${DEPSYS} + +i-coerfn.clisp: i-coerfn.boot + @ echo 289 making $@ from $< + @ echo '(progn (old-boot::boot "i-coerfn.boot"))' | ${DEPSYS} + +i-eval.clisp: i-eval.boot + @ echo 292 making $@ from $< + @ echo '(progn (old-boot::boot "i-eval.boot"))' | ${DEPSYS} + +i-funsel.clisp: i-funsel.boot + @ echo 295 making $@ from $< + @ echo '(progn (old-boot::boot "i-funsel.boot"))' | ${DEPSYS} + +bookvol5.lisp: $(srcdir)/bookvol5.pamphlet + @ echo 298 making $@ from $< + $(axiom_build_document) --tangle=Interpreter --output=$@ $< + +i-intern.clisp: i-intern.boot + @ echo 301 making $@ from $< + @ echo '(progn (old-boot::boot "i-intern.boot"))' | ${DEPSYS} + +i-map.clisp: i-map.boot + @ echo 304 making $@ from $< + @ echo '(progn (old-boot::boot "i-map.boot"))' | ${DEPSYS} + +${AUTO}/info.$(FASLEXT): info.$(FASLEXT) + @ echo 327 making ${AUTO}/info.$(FASLEXT) from info.$(FASLEXT) + @ cp info.$(FASLEXT) ${AUTO} + +info.clisp: info.boot + @ echo 329 making $@ from $< + @ echo '(progn (old-boot::boot "info.boot"))' | ${DEPSYS} + +i-output.clisp: i-output.boot + @ echo 307 making $@ from $< + @ echo '(progn (old-boot::boot "i-output.boot"))' | ${DEPSYS} + +i-resolv.clisp: i-resolv.boot + @ echo 310 making $@ from $< + @ echo '(progn (old-boot::boot "i-resolv.boot"))' | ${DEPSYS} + +i-spec1.clisp: i-spec1.boot + @ echo 313 making $@ from $< + @ echo '(progn (old-boot::boot "i-spec1.boot"))' | ${DEPSYS} + +i-spec2.clisp: i-spec2.boot + @ echo 316 making $@ from i-spec2.boot + @ echo '(progn (old-boot::boot "i-spec2.boot"))' | ${DEPSYS} + +i-syscmd.clisp: i-syscmd.boot + @ echo 319 making $@ from $< + @ echo '(progn (old-boot::boot "i-syscmd.boot"))' | ${DEPSYS} + +${AUTO}/iterator.$(FASLEXT): iterator.$(FASLEXT) + @ echo 331 making ${AUTO}/iterator.$(FASLEXT) from iterator.$(FASLEXT) + @ cp iterator.$(FASLEXT) ${AUTO} + +iterator.clisp: iterator.boot + @ echo 333 making $@ from $< + @ echo '(progn (old-boot::boot "iterator.boot"))' | ${DEPSYS} + +i-toplev.clisp: i-toplev.boot + @ echo 322 making $@ from $< + @ echo '(progn (old-boot::boot "i-toplev.boot"))' | ${DEPSYS} + +i-util.clisp: i-util.boot + @ echo 325 making $@ from $< + @ echo '(progn (old-boot::boot "i-util.boot"))' | ${DEPSYS} + +lisplib.clisp: lisplib.boot + @ echo 336 making $@ from $< + @ echo '(progn (old-boot::boot "lisplib.boot"))' | ${DEPSYS} + +${AUTO}/mark.$(FASLEXT): mark.$(FASLEXT) + @ cp $< $@ + + +match.clisp: match.boot + @ echo 339 making $@ from $< + @ echo '(progn (old-boot::boot "match.boot"))' | ${DEPSYS} + +${AUTO}/metalex.$(FASLEXT): metalex.$(FASLEXT) + @ echo 66 making ${AUTO}/metalex.$(FASLEXT) from metalex.$(FASLEXT) + @ cp metalex.$(FASLEXT) ${AUTO} + + +${AUTO}/metameta.$(FASLEXT): metameta.$(FASLEXT) + @ echo 71 making ${AUTO}/metameta.$(FASLEXT) from metameta.$(FASLEXT) + @ cp metameta.$(FASLEXT) ${AUTO} + + +${AUTO}/modemap.$(FASLEXT): modemap.$(FASLEXT) + @ echo 341 making ${AUTO}/modemap.$(FASLEXT) from modemap.$(FASLEXT) + @ cp modemap.$(FASLEXT) ${AUTO} + +modemap.clisp: modemap.boot + @ echo 343 making $@ from $< + @ echo '(progn (old-boot::boot "modemap.boot"))' | ${DEPSYS} + +msgdb.clisp: msgdb.boot + @ echo 346 making $@ from $< + @ echo '(progn (old-boot::boot "msgdb.boot"))' | ${DEPSYS} + +${AUTO}/nag-c02.$(FASLEXT): nag-c02.$(FASLEXT) + @ echo 150 making${AUTO}/nag-c02.$(FASLEXT) from nag-c02.$(FASLEXT) + @ cp nag-c02.$(FASLEXT) ${AUTO} + +nag-c02.clisp: nag-c02.boot + @ echo 152 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-c02.boot"))' | ${DEPSYS} + + +${AUTO}/nag-c05.$(FASLEXT): nag-c05.$(FASLEXT) + @ echo 154 making ${AUTO}/nag-c05.$(FASLEXT) from nag-c05.$(FASLEXT) + @ cp nag-c05.$(FASLEXT) ${AUTO} + +nag-c05.clisp: nag-c05.boot + @ echo 156 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-c05.boot"))' | ${DEPSYS} + + +${AUTO}/nag-c06.$(FASLEXT): nag-c06.$(FASLEXT) + @ echo 158 making${AUTO}/nag-c06.$(FASLEXT) from nag-c06.$(FASLEXT) + @ cp nag-c06.$(FASLEXT) ${AUTO} + +nag-c06.clisp: nag-c06.boot + @ echo 160 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-c06.boot"))' | ${DEPSYS} + + +${AUTO}/nag-d01.$(FASLEXT): nag-d01.$(FASLEXT) + @ echo 162 making${AUTO}/nag-d01.$(FASLEXT) from nag-d01.$(FASLEXT) + @ cp nag-d01.$(FASLEXT) ${AUTO} + +nag-d01.clisp: nag-d01.boot + @ echo 164 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-d01.boot"))' | ${DEPSYS} + + +${AUTO}/nag-d02.$(FASLEXT): nag-d02.$(FASLEXT) + @ echo 166 making${AUTO}/nag-d02.$(FASLEXT) from nag-d02.$(FASLEXT) + @ cp nag-d02.$(FASLEXT) ${AUTO} + +nag-d02.clisp: nag-d02.boot + @ echo 168 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-d02.boot"))' | ${DEPSYS} + + +${AUTO}/nag-d03.$(FASLEXT): nag-d03.$(FASLEXT) + @ echo 170 making${AUTO}/nag-d03.$(FASLEXT) from nag-d03.$(FASLEXT) + @ cp nag-d03.$(FASLEXT) ${AUTO} + +nag-d03.clisp: nag-d03.boot + @ echo 172 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-d03.boot"))' | ${DEPSYS} + + +${AUTO}/nag-e01.$(FASLEXT): nag-e01.$(FASLEXT) + @ echo 174 making ${AUTO}/nag-e01.$(FASLEXT) from nag-e01.$(FASLEXT) + @ cp nag-e01.$(FASLEXT) ${AUTO} + +nag-e01.clisp: nag-e01.boot + @ echo 176 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-e01.boot"))' | ${DEPSYS} + + +${AUTO}/nag-e02.$(FASLEXT): nag-e02.$(FASLEXT) + @ echo 182 making ${AUTO}/nag-e02.$(FASLEXT) from nag-e02.$(FASLEXT) + @ cp nag-e02.$(FASLEXT) ${AUTO} + +nag-e02.clisp: nag-e02.boot + @ echo 184 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-e02.boot"))' | ${DEPSYS} + + +${AUTO}/nag-e04.$(FASLEXT): nag-e04.$(FASLEXT) + @ echo 186 making ${AUTO}/nag-e04.$(FASLEXT) from nag-e04.$(FASLEXT) + @ cp nag-e04.$(FASLEXT) ${AUTO} + +nag-e04.clisp: nag-e04.boot + @ echo 188 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-e04.boot"))' | ${DEPSYS} + + +${AUTO}/nag-f01.$(FASLEXT): nag-f01.$(FASLEXT) + @ echo 190 making ${AUTO}/nag-f01.$(FASLEXT) from nag-f01.$(FASLEXT) + @ cp nag-f01.$(FASLEXT) ${AUTO} + +nag-f01.clisp: nag-f01.boot + @ echo 192 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-f01.boot"))' | ${DEPSYS} + + +${AUTO}/nag-f02.$(FASLEXT): nag-f02.$(FASLEXT) + @ echo 194 making ${AUTO}/nag-f02.$(FASLEXT) from nag-f02.$(FASLEXT) + @ cp nag-f02.$(FASLEXT) ${AUTO} + +nag-f02.clisp: nag-f02.boot + @ echo 196 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-f02.boot"))' | ${DEPSYS} + + +${AUTO}/nag-f04.$(FASLEXT): nag-f04.$(FASLEXT) + @ echo 198 making ${AUTO}/nag-f04.$(FASLEXT) from nag-f04.$(FASLEXT) + @ cp nag-f04.$(FASLEXT) ${AUTO} + +nag-f04.clisp: nag-f04.boot + @ echo 200 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-f04.boot"))' | ${DEPSYS} + + +${AUTO}/nag-f07.$(FASLEXT): nag-f07.$(FASLEXT) + @ echo 202 making ${AUTO}/nag-f07.$(FASLEXT) from nag-f07.$(FASLEXT) + @ cp nag-f07.$(FASLEXT) ${AUTO} + +nag-f07.clisp: nag-f07.boot + @ echo 204 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-f07.boot"))' | ${DEPSYS} + + +${AUTO}/nag-s.$(FASLEXT): nag-s.$(FASLEXT) + @ echo 206 making ${AUTO}/nag-s.$(FASLEXT) from nag-s.$(FASLEXT) + @ cp nag-s.$(FASLEXT) ${AUTO} + +nag-s.clisp: nag-s.boot + @ echo 208 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-s.boot"))' | ${DEPSYS} + + +newfort.clisp: newfort.boot + @ echo 349 making $@ from $< + @ echo '(progn (old-boot::boot "newfort.boot"))' | ${DEPSYS} + +${AUTO}/nruncomp.$(FASLEXT): nruncomp.$(FASLEXT) + @ echo 351 making ${AUTO}/nruncomp.$(FASLEXT) from nruncomp.$(FASLEXT) + @ cp nruncomp.$(FASLEXT) ${AUTO} + +nruncomp.clisp: nruncomp.boot + @ echo 353 making $@ from $< + @ echo '(progn (old-boot::boot "nruncomp.boot"))' | ${DEPSYS} + +nrunfast.clisp: nrunfast.boot + @ echo 356 making $@ from $< + @ echo '(progn (old-boot::boot "nrunfast.boot"))' | ${DEPSYS} + +nrungo.clisp: nrungo.boot + @ echo 359 making $@ from $< + @ echo '(progn (old-boot::boot "nrungo.boot"))' | ${DEPSYS} + +nruntime.clisp: nruntime.boot + @ echo 362 making $@ from $< + @ echo '(progn (old-boot::boot "nruntime.boot"))' | ${DEPSYS} + +nrunopt.clisp: nrunopt.boot + @ echo 365 making $@ from $< + @ echo '(progn (old-boot::boot "nrunopt.boot"))' | ${DEPSYS} + +${AUTO}/nspadaux.$(FASLEXT): nspadaux.$(FASLEXT) + @ echo 89 making ${AUTO}/nspadaux.$(FASLEXT) from nspadaux.$(FASLEXT) + @ cp nspadaux.$(FASLEXT) ${AUTO} + + +${AUTO}/package.$(FASLEXT): package.$(FASLEXT) + @ echo 370 making ${AUTO}/package.$(FASLEXT) from package.$(FASLEXT) + @ cp package.$(FASLEXT) ${AUTO} + + +${AUTO}/parse.$(FASLEXT): parse.$(FASLEXT) + @ echo 374 making ${AUTO}/parse.$(FASLEXT) from parse.$(FASLEXT) + @ cp parse.$(FASLEXT) ${AUTO} + + +${AUTO}/parsing.$(FASLEXT): parsing.$(FASLEXT) + @ echo 94 making ${AUTO}/parsing.$(FASLEXT) from parsing.$(FASLEXT) + @ cp parsing.$(FASLEXT) ${AUTO} + + +${AUTO}/postpar.$(FASLEXT): postpar.$(FASLEXT) + @ echo 382 making ${AUTO}/postpar.$(FASLEXT) from postpar.$(FASLEXT) + @ cp postpar.$(FASLEXT) ${AUTO} + + +${AUTO}/postprop.$(FASLEXT): postprop.$(FASLEXT) + @ echo 102 making $@ from $< + @ cp $< ${AUTO} + + +${AUTO}/preparse.$(FASLEXT): preparse.$(FASLEXT) + @ echo 106 making ${AUTO}/preparse.$(FASLEXT) from preparse.$(FASLEXT) + @ cp preparse.$(FASLEXT) ${AUTO} + + +${AUTO}/profile.$(FASLEXT): profile.$(FASLEXT) + @ echo 235 making ${AUTO}/profile.$(FASLEXT) from profile.$(FASLEXT) + @ cp profile.$(FASLEXT) ${AUTO} + +profile.clisp: profile.boot + @ echo 237 making $@ from $< + @ echo '(progn (old-boot::boot "profile.boot"))' | ${DEPSYS} + +${AUTO}/pspad1.$(FASLEXT): pspad1.$(FASLEXT) + @ cp $< $@ + +${AUTO}/pspad2.$(FASLEXT): pspad2.$(FASLEXT) + @ cp $< $@ + +record.clisp: record.boot + @ echo 447 making $@ $< + @ echo '(progn (old-boot::boot "record.boot"))' | ${DEPSYS} + +rulesets.clisp: rulesets.boot + @ echo 388 making $@ from $< + @ echo '(progn (old-boot::boot "rulesets.boot"))' | ${DEPSYS} + +server.clisp: server.boot + @ echo 391 making $@ from $< + @ echo '(progn (old-boot::boot "server.boot"))' | ${DEPSYS} + +setvart.clisp: setvart.boot + @ echo 398 making $@ from $< + @ echo '(progn (old-boot::boot "setvart.boot"))' | ${DEPSYS} + +${AUTO}/showimp.$(FASLEXT): showimp.$(FASLEXT) + @ echo 579 making ${AUTO}/showimp.$(FASLEXT) from showimp.$(FASLEXT) + @ cp showimp.$(FASLEXT) ${AUTO} + + +template.clisp: template.boot + @ echo 408 making $@ from $< + @ echo '(progn (old-boot::boot "template.boot"))' | ${DEPSYS} + +termrw.clisp: termrw.boot + @ echo 411 making $@ from $< + @ echo '(progn (old-boot::boot "termrw.boot"))' | ${DEPSYS} + +${AUTO}/topics.$(FASLEXT): topics.$(FASLEXT) + @ echo 493 making ${AUTO}/topics.$(FASLEXT) from topics.$(FASLEXT) + @ cp topics.$(FASLEXT) ${AUTO} + +topics.clisp: topics.boot + @ echo 495 making $@ from $< + @ echo '(progn (old-boot::boot "topics.boot"))' | ${DEPSYS} + +trace.clisp: trace.boot + @ echo 414 making $@ from $< + @ echo '(progn (old-boot::boot "trace.boot"))' | ${DEPSYS} + +../algebra/warm.data: $(srcdir)/Makefile.pamphlet + @ echo 2 building warm.data + $(axiom_build_document) --tangle=warm.data --output=$@ $< + + +${AUTO}/wi1.$(FASLEXT): wi1.$(FASLEXT) + @ cp $< $@ + +${AUTO}/wi2.$(FASLEXT): wi2.$(FASLEXT) + @ cp $< $@ + +${AUTO}/xruncomp.$(FASLEXT): xruncomp.$(FASLEXT) + @ echo 457 making ${AUTO}/xruncomp.$(FASLEXT) from xruncomp.$(FASLEXT) + @ cp xruncomp.$(FASLEXT) ${AUTO} + +xruncomp.clisp: xruncomp.boot + @ echo 459 making $@ from $< + @ echo '(progn (old-boot::boot "xruncomp.boot"))' | ${DEPSYS} + +$(axiom_build_texdir)/diagrams.tex: $(axiom_src_docdir)/diagrams.tex + $(INSTALL_DATA) $< $@ + diff --git a/src/interp/Makefile.pamphlet b/src/interp/Makefile.pamphlet new file mode 100644 index 00000000..a5024ddb --- /dev/null +++ b/src/interp/Makefile.pamphlet @@ -0,0 +1,2835 @@ +%% Oh Emacs, this is a -*- Makefile -*-, so give me tabs. +\documentclass{article} +\usepackage{axiom} + +\title{\File{src/interp/Makefile} Pamphlet} +\author{Timothy Daly \and Gabriel Dos~Reis} + +\begin{document} +\maketitle + +\begin{abstract} +\end{abstract} + +\tableofcontents +\eject + +\begin{verbatim} +notes for understanding this makefile: +re: postpar.clisp and parse.clisp stanzas: +NOTE: the .clisp file is copies back into the src directory so that +it is possible to create a new obootsys system from scratch for a +new platform. parse.clisp needs to be compiled in a depsys. +one thing need to be done to create an obootsys by hand: + parse and postpar must be loaded along with the depsys files + into a bare lisp system. +if these two things are done then a obootsys image can be bootstrapped +to a new platform. + +IMPORTANT: all source file names in this Makefile must be lowercase + This is for cross-platform compatibility and also makes getting + them into Lisp much easier at the Makefile level. + +\end{verbatim} + + +\section{The Environment} + +We define 3 directories for this build. The first two are +the traditional {\bf IN}, which is where the source pamphlets are, +and {\bf OUT} which is where we will put the binaries. + +In this case the {\bf IN} files are usually written in Boot \cite{2}. +These will be compiled in a \Tool{bootsys} image to translate from +Boot to Common Lisp. + +\subsection{Documentation} + +The dvi files will be generated from the pamphlet files in the +final ship \File{doc/src/} directory. Since they are system independent +but machine generated and part of the final ship they will exist +in the [[\$(axiom_target_docdir)/src/interp/]] directory. + +<>= +IN=$(srcdir) +DOC=$(axiom_target_docdir)/src/interp +BOOK=$(axiom_target_docdir) + +# Command to translate Boot to Common Lisp +BOOT_TO_LISP = $(BOOTSYS) -- --translate $< + +# Command to translate Common Lisp to native object code +COMPILE_LISP = $(DEPSYS) -- --compile --output=$@ $< +@ + + +\subsection{Autloload} + +In order to minimize the size of the Axiom image at load time +we put some of the compiled files into a separate directory +that will be autoloaded on demand. This directory of code +will be shipped with the final system and so it belongs in +the [[$(axiom_targetdir)]] subtree. +<>= +AUTO=$(axiom_targetdir)/autoload + +autoload_objects = + +@ + + +\subsection{Initial Lisp image} + +We need a raw Lisp image --- running on the build platform --- +that we can use as a base to construct +the other images. This is called {\bf LISPSYS} and is located in the +build platform sub-directory. +<>= +# Build platform-dependent Lisp image, at the base of other +# derived Lisp images (depsys, interpsys, AXIOMsys) +LISPSYS= $(axiom_build_bindir)/lisp + +@ + +\subsection{Boot translator} + +Most of the interpreter is written in the Boot programming language. +Thus we need a program to translate Boot to Common +Lisp. That program is called the {\bf BOOTSYS} image (because the +translator is written in {\bf boot} and needs to translate +itself to bootstrap the system). This image is assumed to +have been built (on the build platform) by a previous step in the +make process. +<>= +BOOTSYS= $(axiom_build_bindir)/bootsys + +@ + +Note also that another translator (built into [[depsys]]) translates +a variant og Boot (called ``old Boot'') to Common Lisp. + + +\subsection{The old Boot translator} + +<>= +DEPSYS = ./depsys +@ + +Some of the Common Lisp code we compile uses macros which +are assumed to be available at compile time. The [[DEPSYS]] +image is created to contain the compile time environment +and saved. Furthermore, it is also used to translate codes written +in ``old Boot'' to Common Lisp. That translator is in the process of +being phased out in favor of the ``new Boot'' translator found in +\File{src/boot/}. + +\subsubsection{Structure of [[depsys]]} + +The [[depsys]] image is made of the following Lisp source files + +\begin{description} +\item[Interpreted Lisp source files] + The following files are currently part of [[depsys]] in interpreted + form. The exact reasons for that are not well articulated. + + \begin{description} + \item[\File{nocompil.lisp}] This file defines obscure functions + that seem to be there only for obscure reasons. Most of them are not + really needed for translating Boot codes. + + \item[\File{bookvol5.lisp}] This file defines functions for + the Spad interpreter. None of which seems relevant for translating + Boot codes to Common Lisp. + + \item[\File{util.lisp}] This file defines various ``system-level'' + helper functions, for building [[depsys]], [[interpsys]], etc. + + \item[\File{vmlisp.lisp}] This is a collection of various utility + functions, encapsulations of variabilities of Lisp implementations. + All those symbols are defined in the package [[VMLISP]]. + It needs some strip down, and possibly have its contents moved + to the package [[BOOT]]. + + \item[\File{ggreater.lisp}] This file defines various orderings + on collections and other aggregates. Its content is defined in the + package [[VMLISP]]. + + \item[\File{hash.lisp}] This file defines a ``hash table'' module. + Its content is defined in package [[VMLISP]]. + + \item[\File{bootfuns.lisp}] This file collects forward references + of functions that are needed in the [[BOOT]] package, to be defined + latter. It is not at all clear that this file is needed to + build the Boot to Common Lisp translator. Its content is + defined in package [[BOOT]]. + + \item[\File{union.lisp}] This file defines functions that + compute set-theoretic operations (union, difference, intersection, etc.). + Its content is in package [[VMLISP]]. + + \item[\File{nlib.lisp}] This file defines to work around problems + with GCL when compiling Spad files. It is not necessary for + translating Boot codes to Common Lisp. Its content is in package + [[VMLISP]]. + + \item[\File{macros.lisp}] This file collects various helper macros + and functions for Boot and Spad codes. + + \item[\File{comp.lisp}] This file defines several functions that + desugar Boot and Spad codes; in particular, they infer local + variables from their position in assignment expressions. Its + content is defined in package [[BOOT]]. + + \item[\File{spaderror.lisp}] This file defines error handling functions + that are useful only for Spad codes -- not for translating Boot codes. + Its content is defined in package [[BOOT]]. + + \item[\File{debug.lisp}] This file defines debug utilities for + essentially Spad codes. Its content is defined in package [[BOOT]]. + + \item[\File{spad.lisp}] This files defines the entry points for + processing Spad and Boot codes. Its content is defined in package + [[BOOT]]. + + \item[\File{bits.lisp}] This file implements a ``bit vector'' + data type. Its content is in package [[BOOT]]. + + \item[\File{setq.lisp}] This file defines several global + variables. Its content is defined in package [[BOOT]]. + + \item[\File{property.lisp}] This file defines properties of + Spad and Boot tokens, as well as several constructors. Its + content is defined in package [[BOOT]]. + + \item[\File{unlisp.lisp}] This file attempts to define interfaces + to the Operating System, that are not found in strict ANSI + Common Lisp (though they may be present as extensions with + varying spellings.). Its content is defined in package [[BOOT]]. + + \item[\File{foam\_l.lisp}] This file defines the FOAM functions. + The packages [[FOAM]] and [[FOAM-USER]] are defined here. + It is not needed for translating Boot codes to Common Lisp. + + \item[\File{axext\_l.lisp}] This file defines various macros and + functions for interoperability between Aldor and Axiom. Not needed + for translating Boot codes to Common Lisp. + \end{description} + +\item[Compiled Lisp source files] + \begin{description} + \item[\File{parsing.lisp}] + + \item[\File{metalex.lisp}] + + \item[\File{bootlex.lisp}] + + \item[\File{newaux.lisp}] + + \item[\File{preparse.lisp}] + + \item[\File{postprop.lisp}] + + \item[\File{def.lisp}] + + \item[\File{metameta.lisp}] + + \item[\File{fnewmeta.lisp}] + \end{description} + +\item[Compiled Boot source files] + \begin{description} + \item[\File{postpar.boot}] + + \item[\File{parse.boot}] + + \item[\File{clam.boot}] + + \item[\File{slam.boot}] + + \item[\File{g-boot.boot}] + + \item[\File{c-util.boot}] + + \item[\File{g-util.boot}] + \end{description} + +\end{description} + +% +<>= +depsys_lisp_compiled_sources += parsing.lisp metalex.lisp bootlex.lisp \ + newaux.lisp preparse.lisp postprop.lisp def.lisp metameta.lisp \ + fnewmeta.lisp + +depsys_lisp_sources = $(depsys_lisp_noncompiled_sources) \ + $(depsys_lisp_compiled_sources) + +depsys_boot_sources = postpar.boot parse.boot clam.boot slam.boot \ + g-boot.boot g-error.boot c-util.boot g-util.boot +@ + +The {\bf DEP} variable contains the list of files that +will be loaded into {\bf DEPSYS}. Notice that these files +are loaded in interpreted form. We are not concerned about +the compile time performance so we can use interpreted code. +We do, however, care about the macros as these will be +expanded in later compiles. All macros are assumed to be +in this list of files. +<>= +DEP= nlib.lisp \ + macros.lisp comp.lisp \ + spaderror.lisp debug.lisp \ + spad.lisp bits.lisp \ + setq.lisp property.lisp \ + unlisp.lisp foam_l.lisp \ + axext_l.lisp + +depsys_lisp_macro_sources = vmlisp.lisp ggreater.lisp hash.lisp \ + bootfuns.lisp union.lisp nlib.lisp macros.lisp \ + comp.lisp spaderror.lisp debug.lisp \ + spad.lisp bits.lisp setq.lisp property.lisp \ + unlisp.lisp foam_l.lisp axext_l.lisp + +depsys_lisp_noncompiled_sources += $(depsys_lisp_macro_sources) +depsys_lisp_SOURCES = $(addsuffix .pamphlet, $(depsys_lisp_sources)) +@ + +Once we've compile all of the Common Lisp files we fire up +a clean lisp image called {\bf LOADSYS} (from the build platform), load all +of the +final executable code and save it out as {\bf SAVESYS}. This image +is used to bootstrap the Algebra files and generate the +databases. +The {\bf SAVESYS} image is copied to the [[$(axiom_target_bindir)]] +subdirectory and becomes the axiom executable image. Technically, that is +not right because the host plaform may not be the same as the build +platform. However, we don't yet support cross compilation, so that +is alright for the time being. +<>= +LOADSYS= $(axiom_build_bindir)/lisp$(EXEEXT) +SAVESYS= interpsys$(EXEEXT) +AXIOMSYS= $(axiom_target_bindir)/AXIOMsys$(EXEEXT) + +@ + +\subsection{Debugging [[depsys]]} + +Occasionally we need to really get into the system internals. +The best way to do this is to run almost all of the lisp code +interpreted rather than compiled (note that cfuns.lisp and sockio.lisp +still need to be loaded in compiled form as they depend on the +loader to link with lisp internals). This image is nothing more +than a load of the file \File{src/interp/debugsys.lisp.pamphlet}. If +you need to make test modifications you can add code to that +file and it will show up here. +<>= +DEBUGSYS=$(axiom_build_bindir)/debugsys$(EXEEXT) + +@ + +These are the files that need to be compiled (in {\bf BOOTSYS}), +loaded into a clean lisp image ({\bf LOADSYS}) and saved as +a runnable \Tool{Axiom} interpreter ({\bf SAVESYS}) usually named +\Tool{interpsys}. Most of these files +are translated from Boot to Common Lisp and then +compiled. There are two exceptions, \File{bootfuns.lisp} +and \File{setq.lisp}. The \File{bootfuns.lisp} \cite{3} file +contains forward references for Boot code. The \File{setq.lisp} +file contains constant initialization code which gains nothing +by being compiled. + +\subsection{The Spad interpreter and compiler} + +The value of the variable [[AXIOMsys_boot_sources]] is the (currently +partial) list of Boot source files that make up the interpreter. +Similarly, the value of the variable [[AXIOMsys_compiled_lisp_sources]] +is the list of Common Lisp source files that are compiled into +the interpreter. Notice that some of these files are loaded (\eg{}, +interpreted) in [[depsys]]. + +<>= +OBJS= vmlisp.$(FASLEXT) hash.$(FASLEXT) \ + bootfuns.$(FASLEXT) macros.$(FASLEXT) \ + unlisp.$(FASLEXT) setq.$(FASLEXT) \ + astr.$(FASLEXT) bits.$(FASLEXT) \ + alql.$(FASLEXT) buildom.$(FASLEXT) \ + cattable.$(FASLEXT) \ + cformat.$(FASLEXT) cfuns.$(FASLEXT) \ + clam.$(FASLEXT) clammed.$(FASLEXT) \ + comp.$(FASLEXT) foam_l.$(FASLEXT) \ + compat.$(FASLEXT) compress.$(FASLEXT) \ + cparse.$(FASLEXT) cstream.$(FASLEXT) \ + database.$(FASLEXT) \ + debug.$(FASLEXT) dq.$(FASLEXT) \ + fname.$(FASLEXT) format.$(FASLEXT) \ + g-boot.$(FASLEXT) g-cndata.$(FASLEXT) \ + g-error.$(FASLEXT) g-opt.$(FASLEXT) \ + g-timer.$(FASLEXT) g-util.$(FASLEXT) \ + ggreater.$(FASLEXT) \ + hypertex.$(FASLEXT) i-analy.$(FASLEXT) \ + i-code.$(FASLEXT) i-coerce.$(FASLEXT) \ + i-coerfn.$(FASLEXT) i-eval.$(FASLEXT) \ + i-funsel.$(FASLEXT) bookvol5.$(FASLEXT) \ + i-intern.$(FASLEXT) i-map.$(FASLEXT) \ + i-output.$(FASLEXT) i-resolv.$(FASLEXT) \ + i-spec1.$(FASLEXT) \ + i-spec2.$(FASLEXT) i-syscmd.$(FASLEXT) \ + i-toplev.$(FASLEXT) i-util.$(FASLEXT) \ + incl.$(FASLEXT) int-top.$(FASLEXT) \ + intfile.$(FASLEXT) \ + lisplib.$(FASLEXT) macex.$(FASLEXT) \ + match.$(FASLEXT) \ + monitor.$(FASLEXT) msg.$(FASLEXT) \ + msgdb.$(FASLEXT) nci.$(FASLEXT) \ + newaux.$(FASLEXT) newfort.$(FASLEXT) \ + nlib.$(FASLEXT) nrunfast.$(FASLEXT) \ + nrungo.$(FASLEXT) nrunopt.$(FASLEXT) \ + nruntime.$(FASLEXT) osyscmd.$(FASLEXT) \ + packtran.$(FASLEXT) pathname.$(FASLEXT) \ + pf2sex.$(FASLEXT) pile.$(FASLEXT) \ + posit.$(FASLEXT) property.$(FASLEXT) \ + ptrees.$(FASLEXT) ptrop.$(FASLEXT) \ + record.$(FASLEXT) \ + rulesets.$(FASLEXT) \ + scan.$(FASLEXT) serror.$(FASLEXT) \ + server.$(FASLEXT) \ + setvars.$(FASLEXT) \ + sfsfun-l.$(FASLEXT) sfsfun.$(FASLEXT) \ + simpbool.$(FASLEXT) slam.$(FASLEXT) \ + sockio.$(FASLEXT) spad.$(FASLEXT) \ + spaderror.$(FASLEXT) \ + template.$(FASLEXT) termrw.$(FASLEXT) \ + trace.$(FASLEXT) \ + union.$(FASLEXT) daase.$(FASLEXT) \ + fortcall.$(FASLEXT) + +interpsys_modules = $(patsubst %.$(FASLEXT), "%", $(OBJS)) + +AXIOMsys_noncompiled_lisp_sources = bootfuns.lisp nocompil.lisp \ + postprop.lisp property.lisp setq.lisp + +AXIOMsys_compiled_lisp_sources = bits.lisp \ + bootlex.lisp cfuns.lisp comp.lisp construc.lisp daase.lisp \ + debug.lisp def.lisp fname.lisp fnewmeta.lisp ggreater.lisp \ + hash.lisp macros.lisp metalex.lisp monitor.lisp newaux.lisp \ + nlib.lisp nspadaux.lisp parsing.lisp \ + patches.lisp preparse.lisp \ + sockio.lisp spad.lisp spaderror.lisp \ + union.lisp util.lisp vmlisp.lisp obey.lisp \ + unlisp.lisp intint.lisp nci.lisp sfsfun-l.lisp \ + axext_l.lisp foam_l.lisp + +AXIOMsys_boot_sources = astr.boot alql.boot buildom.boot cattable.boot \ + cformat.boot clam.boot clammed.boot compat.boot compress.boot \ + cparse.boot cstream.boot database.boot dq.boot format.boot \ + g-boot.boot g-cndata.boot g-error.boot g-opt.boot g-timer.boot \ + g-util.boot hypertex.boot i-analy.boot i-code.boot i-coerce.boot \ + i-coerfn.boot i-eval.boot i-funsel.boot i-intern.boot i-map.boot \ + i-output.boot i-resolv.boot i-spec1.boot i-spec2.boot \ + i-syscmd.boot i-toplev.boot i-util.boot incl.boot int-top.boot \ + intfile.boot lisplib.boot macex.boot match.boot msg.boot \ + msgdb.boot newfort.boot nrunfast.boot nrungo.boot nrunopt.boot \ + nruntime.boot osyscmd.boot packtran.boot pathname.boot \ + pf2sex.boot pile.boot posit.boot ptrees.boot ptrop.boot \ + record.boot rulesets.boot scan.boot serror.boot server.boot \ + setvars.boot sfsfun.boot simpbool.boot slam.boot template.boot \ + termrw.boot trace.boot fortcall.boot +@ + +Before we save the {\bf SAVESYS} image we need to run some +initialization code. These files perform initialization +for various parts of the system. The {\bf patches.lisp} \cite{5} +file contains last-minute changes to various functions and +constants. +<>= +INOBJS= varini.$(FASLEXT) parini.$(FASLEXT) \ + setvart.$(FASLEXT) intint.$(FASLEXT) \ + xrun.$(FASLEXT) interop.$(FASLEXT) \ + patches.$(FASLEXT) + +IN_modules = $(patsubst %.$(FASLEXT), "%", $(INOBJS)) + +@ + +Certain functions do not need to be in the running system. +If the running image never calls the compiler or does not +use the hypertex browser we will never call the functions +in these files. The code that calls these functions in the +running system will autoload the appropriate files the +first time they are called. Loading the files overwrites +the autoload function call and re-calls the function. +Any subsequent calls will run the compiled code. + +The {\bf OPOBJS} list contains files from the old parser. The use of +``old'' is something of a subtle concept as there were several +generations of ``old'' and all meaning of the term is lost. + +Notice that the object file [[def.$(FASLEXT)]] appears on both the +[[OPBJS]] and [[TRANOBJS]] lists. In normal situation, parsing +precedes translation; consequently the file [[def]] is loaded by the +parser, so that it does not need to be reloaded by the translator. +However, it may theoretically be that a translation could happen without +prior parsing (in case someone types in a parse tree for SPAD code). +Consequently, it must be ensured that [[def.]] is still loaded in that +configuration. In the long term, the autoload machinery need +rethinking. + +<>= +# These are autloaded old parser files +OPOBJS= ${AUTO}/parsing.$(FASLEXT) ${AUTO}/bootlex.$(FASLEXT) \ + ${AUTO}/def.$(FASLEXT) \ + ${AUTO}/fnewmeta.$(FASLEXT) ${AUTO}/metalex.$(FASLEXT) \ + ${AUTO}/metameta.$(FASLEXT) \ + ${AUTO}/parse.$(FASLEXT) ${AUTO}/postpar.$(FASLEXT) \ + ${AUTO}/postprop.$(FASLEXT) ${AUTO}/preparse.$(FASLEXT) + +autoload_objects += $(OPBJS) +@ + +The {\bf OCOBJS} list contains files from the old compiler. Again, +``old'' is meaningless. These files should probably be autoloaded. +<>= +OCOBJS= ${AUTO}/apply.$(FASLEXT) ${AUTO}/c-doc.$(FASLEXT) \ + ${AUTO}/c-util.$(FASLEXT) ${AUTO}/profile.$(FASLEXT) \ + ${AUTO}/category.$(FASLEXT) ${AUTO}/compiler.$(FASLEXT) \ + ${AUTO}/define.$(FASLEXT) ${AUTO}/functor.$(FASLEXT) \ + ${AUTO}/info.$(FASLEXT) ${AUTO}/iterator.$(FASLEXT) \ + ${AUTO}/modemap.$(FASLEXT) ${AUTO}/nruncomp.$(FASLEXT) \ + ${AUTO}/package.$(FASLEXT) ${AUTO}/htcheck.$(FASLEXT) \ + ${AUTO}/xruncomp.$(FASLEXT) + +autoload_objects += $(OCOBJS) + +@ + +The {\bf BROBJS} list contains files only used by the hypertex +browser. These files should probably be autoloaded. +<>= +BROBJS= ${AUTO}/bc-matrix.$(FASLEXT) \ + ${AUTO}/bc-misc.$(FASLEXT) ${AUTO}/bc-solve.$(FASLEXT) \ + ${AUTO}/bc-util.$(FASLEXT) \ + ${AUTO}/ht-util.$(FASLEXT) ${AUTO}/htsetvar.$(FASLEXT) \ + ${AUTO}/ht-root.$(FASLEXT) \ + ${AUTO}/br-con.$(FASLEXT) \ + ${AUTO}/br-data.$(FASLEXT) ${AUTO}/showimp.$(FASLEXT) \ + ${AUTO}/br-op1.$(FASLEXT) ${AUTO}/br-op2.$(FASLEXT) \ + ${AUTO}/br-search.$(FASLEXT) ${AUTO}/br-util.$(FASLEXT) \ + ${AUTO}/topics.$(FASLEXT) ${AUTO}/br-prof.$(FASLEXT) \ + ${AUTO}/br-saturn.$(FASLEXT) + +autoload_objects += $(BFOBJS) + +@ + +The {\bf TRANOBJS} list contains files used by Spad to Aldor convertor. +The files probably are also used by the {\bf boot} +to Common Lisp translator and are probably never used by anyone +but the developers. + +When a user requests converting a file from Spad to Aldor the +function +[[spad2AsTranslatorAutoloadOnceTrigger]] is called triggering +load of this group of files. Loading [[$TRANOBJS]] in turn replaces +many compiler functions by versions contain in this files. + These files should probably be autoloaded +(at least [[${AUTO}/wi1.$(FASLEXT)]] and [[${AUTO}/wi2.$(FASLEXT)]] +(which replace compiler functions) {\em must} be autoloaded). +<>= +TRANOBJS= ${AUTO}/wi1.$(FASLEXT) ${AUTO}/wi2.$(FASLEXT) ${AUTO}/pspad1.$(FASLEXT) \ + ${AUTO}/pspad2.$(FASLEXT) ${AUTO}/mark.$(FASLEXT) ${AUTO}/nspadaux.$(FASLEXT) \ + ${AUTO}/def.$(FASLEXT) + +autoload_objects += $(TRANOBJS) + +@ + +The {\bf NAGBROBJS} list contains files used to access the +Numerical Algorithms Group (NAG) fortran libraries. +These files should probably be autoloaded. +Note that [[${AUTO}/nag-e02a.$(FASLEXT)]] is not included in this +list as it is a subset of [[${AUTO}/nag-e02.$(FASLEXT)]]. +<>= +NAGBROBJS= ${AUTO}/nag-c02.$(FASLEXT) ${AUTO}/nag-c05.$(FASLEXT) \ + ${AUTO}/nag-c06.$(FASLEXT) ${AUTO}/nag-d01.$(FASLEXT) \ + ${AUTO}/nag-d02.$(FASLEXT) ${AUTO}/nag-d03.$(FASLEXT) \ + ${AUTO}/nag-e01.$(FASLEXT) ${AUTO}/nag-e02.$(FASLEXT) \ + ${AUTO}/nag-e04.$(FASLEXT) ${AUTO}/nag-f01.$(FASLEXT) \ + ${AUTO}/nag-f02.$(FASLEXT) ${AUTO}/nag-f04.$(FASLEXT) \ + ${AUTO}/nag-f07.$(FASLEXT) ${AUTO}/nag-s.$(FASLEXT) + +autoload_objects += $(NAGBROBJS) + +@ + +The {\bf ASCOMP} list contains files used by the {\bf Aldor} +\cite{5} compiler. These files should probably be autoloaded. +<>= +ASCOMP= hashcode.$(FASLEXT) as.$(FASLEXT) \ + foam_l.$(FASLEXT) axext_l.$(FASLEXT) + +AS_modules = $(patsubst %.$(FASLEXT), "%", $(ASCOMP)) + +@ + +The {\bf ASAUTO} list contains files used by the {\bf Aldor} +\cite{5} compiler. These files are autoloaded as needed. +<>= +ASAUTO= ${AUTO}/ax.$(FASLEXT) + +autoload_objects += $(ASAUTO) +@ + +Axiom versions are given as a string of the form: +"Sunday September 21, 2003 at 20:38:05 " +which describe the day, date, and time of the build. +This is used for reporting bugs. It is only partially useful +in identifying which source code was used. Ideally we could create +a tar file of all of the date/time stamps of all of the source files +and use the MD5 hash of that file as the version stamp. Ultimately +though, this would be chasing the elusive "perfect information" idea. + +A new variable [[boot::*build-version*]] is set here and used by the +[[yearweek]] function to display the version number of the Axiom build. +This information is set by hand in the top level Makefile. +<>= +TIMESTAMP=$(axiom_targetdir)/timestamp +YEARWEEK=(progn (setq boot::timestamp "${TIMESTAMP}") \ + (setq boot::*build-version* "$(PACKAGE_STRING)") \ + (boot::yearweek)) + +@ + +The {\bf .PRECIOUS} setting will keep make from deleting these +images if the build is stopped. Since once they are built they +are likely to be useable we don't need to redo the work if they +exist. +<>= + +.PRECIOUS: ${DEPSYS} +.PRECIOUS: ${SAVESYS} +.PRECIOUS: ${AXIOMSYS} + +@ + +\section{Codes from Pamphlets} + +As noted earlier, the Boot codes are first extrated from the pamphlet +files: +<>= +.PRECIOUS: %.boot +%.boot: $(srcdir)/%.boot.pamphlet + $(axiom_build_document) --tangle --output=$@ $< +@ + +The extracted Boot codes are then fed into \Tool{bootsys} which translates +them into Common Lisp codes: +<>= +.PRECIOUS: %.clisp +%.clisp: %.boot + $(BOOT_TO_LISP) +@ + +The resulting Common Lips codes are, in turn, compiled to object codes +using the \Tool{depsys} image. +<>= +.PRECIOUS: %.$(FASLEXT) +%.$(FASLEXT): %.clisp + $(COMPILE_LISP) +@ + +Part of the interpreter is written directly in Common Lisp (instead of the +sugared dialect Boot). That part is extracted from the pamphlet files +and compiled to native object code, as usual. +<>= +# Extract and compile the part of the interpreter written +# in Common Lisp +.PRECIOUS: %.lisp +%.$(FASLEXT): %.lisp + $(COMPILE_LISP) + +%.lisp: $(srcdir)/%.lisp.pamphlet + $(axiom_build_document) --tangle --output=$@ $< +@ + +\section{Proclaim optimization} + +\Tool{GCL}, and possibly other common lisps, can generate much better +code if the function argument types and return values are proclaimed. + +In theory what we should do is scan all of the functions in the system +and create a file of proclaim definitions. These proclaim definitions +should be loaded into the image before we do any compiles so they can +allow the compiler to optimize function calling. + +\Tool{GCL} has an approximation to this scanning which we use here. + +The first step is to build a version of GCL that includes [[gcl_collectfn]]. +This file contains code that enhances the lisp compiler and creates a +hash table of structs. Each struct in the hash table describes information +that about the types of the function being compiled and the types of its +arguments. At the end of the compile-file this hash table is written out +to a ".fn" file. + +The second step is to build axiom images (depsys, interpsys, AXIOMsys) +which contain the [[gcl_collectfn]] code. + +The third step is to build the system. This generates a .fn file for +each lisp file that gets compiled. + +The fourth step is to build the proclaims.lisp files. There is one +proclaims.lisp file for +boot (boot-proclaims.lisp), +interp (interp-proclaims.lisp), and +algebra (algebra-proclaims.lisp). + +To build the proclaims file (e.g. for interp) we: +\begin{verbatim} +(a) cd to obj/linux/interp +(b) (yourpath)/axiom/obj/linux/bin/lisp +(c) (load "sys-pkg.lsp") +(d) (mapcar #'load (directory "*.fn")) +(e) (with-open-file (out "interp-proclaims.lisp" :direction :output) + (compiler::make-proclaims out)) +\end{verbatim} +Note that step (c) is only used for interp, not for boot. + +The fifth step is to copy the newly constructed proclaims file back +into the src/interp diretory (or boot, algebra). + +\section{The warm.data file} + +This is a file of commands that will be loaded into interpsys +at the last minute. It execute functions that will likely be +used in a running system so all of the required routines will +be in the lisp image thus minimizing their startup time. +<>= +../algebra/warm.data: $(srcdir)/Makefile.pamphlet + @ echo 2 building warm.data + $(axiom_build_document) --tangle=warm.data --output=$@ $< + +@ + +<>= +(in-package 'boot) +(setq |$topicHash| (make-hash-table)) +(setf (gethash '|basic| |$topicHash|) 2) +(setf (gethash '|algebraic| |$topicHash|) 4) +(setf (gethash '|miscellaneous| |$topicHash|) 13) +(setf (gethash '|extraction| |$topicHash|) 6) +(setf (gethash '|conversion| |$topicHash|) 7) +(setf (gethash '|hidden| |$topicHash|) 3) +(setf (gethash '|extended| |$topicHash|) 1) +(setf (gethash '|destructive| |$topicHash|) 5) +(setf (gethash '|transformation| |$topicHash|) 10) +(setf (gethash '|hyperbolic| |$topicHash|) 12) +(setf (gethash '|construct| |$topicHash|) 9) +(setf (gethash '|predicate| |$topicHash|) 8) +(setf (gethash '|trignometric| |$topicHash|) 11) + +@ + +\section{UNUSED} + +These files were in the interp distribution from NAG but have +no purpose at the moment. This belief is no doubt due to my +lack of understanding. Rather than erase them they are documented +here for future reference. [[${DOC}/nag-e02a.boot.dvi]] and +[[${DOC}/nag-e02b.boot.dvi]] appear to be two halfs of the file +[[${DOC}/nag-e02.boot.dvi]] and have been removed. +<>= +UNUSED= ${DOC}/anna.boot.dvi ${DOC}/construc.lisp.dvi \ + ${DOC}/domain.lisp.dvi ${DOC}/guess.boot.dvi \ + ${DOC}/interp-fix.boot.dvi \ + ${DOC}/nhyper.boot.dvi ${DOC}/pf2atree.boot.dvi \ + ${DOC}/redefs.boot.dvi ${DOC}/word.boot.dvi + +@ + +\section{Building DEPSYS} + +\begin{verbatim} +NOTES: depsys proceeds all else. it is the compile-time environment +for all interpreter code. +[[OLD-BOOT::BOOT]] emulates the new boot parser command [[BOOTTOCL]]. since +we eventually plan to move to the new boot parser this function +should disappear. +the load of postpar and parse (without extensions) allows the .${LISP} form +to be loaded in a virgin system. however, if depsys is recreated then +the compiled form will get loaded. +\end{verbatim} + +\subsection{save depsys image} + +Once the appropriate commands are in the [[makedep.lisp]] file +we can load the file into an initial Lisp image and save it. +In freebsd we cannot do this so we have to use +a much more complicated procedure. +This code used to read: +\begin{verbatim} +<>= + ../lisp/base-lisp$(EXEEXT) -- --make --output=$@ \ + --load-directory=. makedep.lisp +@ +\end{verbatim} + +Now game is much more difficult. +\begin{verbatim} + + '(progn \ + +\end{verbatim} + +[[si::*collect-binary-modules*]] instructs GCL to build a list of +binary object modules loaded into the current session with (load ...) +The list will be stored in [[si::*binary-modules*]]. +\begin{verbatim} + + (setq si::*collect-binary-modules* t) \ + (load "makedep.lisp") \ + +\end{verbatim} + +[[compiler::link]] is a lisp interface to the ``ld'' C-based system linker. +The first argumet is a list of [[.o]] binary object modules to link into a +fresh gcl image. The second argument is the name of the new output +image. The third argument is a string containing an initialization +command to run in the new image to reinitialize the heap. The fourth +argument is a list of external C libraries, either static or dynamic, +that one wishes to link into the fresh image. The last argument is a +flag which indicates whether GCL should initialize all of the freshly +linked in new lisp modules, or whether it should transparently +redirect load calls in the new image to initialization calls for the +already linked in module. + +Some lisp systems, such as acl2, have a complex heap initialization, +in which load calls must be interspersed with other form evaluation +comprising the logic of the heap construction. Others, such as +maxima, have no such complex initialization sequence. +\begin{verbatim} + + (compiler::link \ + +\end{verbatim} +[[si::*binary-modules*]] here has the list of compiled lisp binary module +.o files loaded by makedep.lsp above. +\begin{verbatim} + + (remove-duplicates si::*binary-modules* :test (quote equal)) \ + +\end{verbatim} + +The name of the output image. +\begin{verbatim} + + "$(DEPSYS)" \ + +\end{verbatim} + +This will be run in the newly linked sub-image. +\begin{verbatim} + + (format nil "\ + +\end{verbatim} + +Collect loaded binary modules again to make sure that there are none, +as all should be already linked in via ld. For error checking +purposes. +\begin{verbatim} + +(setq si::*collect-binary-modules* t) \ + +\end{verbatim} + +We need to find [[gcl_collectfn.lsp]], so set the [[*load-path*]], and make +sure the source, not the binary, form is loaded here, as we're only +using this entire sequence on machines which cannot load binary object +modules and preserve them in saved images. +\begin{verbatim} + +(let ((si::*load-path* (cons ~S si::*load-path*))\ + (si::*load-types* ~S))\ + +\end{verbatim} + +Turn on function analyzation and autoload thereby [[gcl_collectfn.lsp]]. +\begin{verbatim} + +(compiler::emit-fn t))\ + +\end{verbatim} + +Load the heap creation sequence again in the fresh new image, this +time transparently redirecting all calls to load of binary modules +invoked thereby into initialization calls for the already linkned in +module. + +Load has code in it to recognize when a module is already linked in, +and to forgo in this case the actual load and replace with a mere +initialization call instead. +\begin{verbatim} + +(load \"makedep.lisp\")\ + +(gbc t)\ + +\end{verbatim} + +It is an error to load a binary module. Calling load will not +reload them but only run initialization. +Throw an error if we've actually loaded any binary modules. +\begin{verbatim} + +(when si::*binary-modules* \ +(error si::*binary-modules*))\ + +\end{verbatim} + +Unset the binary module collection flags. +\begin{verbatim} + +(setq si::collect-binary-modules* nil si::*binary-modules* nil)\ +(gbc t)\ + +\end{verbatim} + +Turn on SGC (Stratified Garbage Collection) in the final image. This +is a optional gbc algorithm which is suitable for images which will +not grow much further. It marks a large fraction of the heap +read-only, eliminating such pages from the time-consuming gbc +processing. When writes are actually made to such pages, a segfault +is triggered which is handled by a function which remarks the pages +read-write and continues. +\begin{verbatim} + +(when (fboundp (quote si::sgc-on)) (si::sgc-on t))\ + +\end{verbatim} + +This is a flag which instructs the GCL compiler to make unique +initialzation function C names. This is necessary when using ld, as +all function names must be unique. +\begin{verbatim} + +(setq compiler::*default-system-p* t)\ + +si::*system-directory* goes into the *load-path*, and .lsp in the *load-types*. + +" si::*system-directory* (quote (list ".lsp")))\ + +\end{verbatim} +No C libraries to link in here. +\begin{verbatim} + +"" \ + +\end{verbatim} + +Do not run the initialization code for the newly linked in lisp +modules ``by hand'', but rather rely on the transparent load redirection +described above to initialize at the proper moment in the heap +initialization sequence. +\begin{verbatim} + +nil))' | $(LISPSYS)) + +\end{verbatim} +The [[save depsys image]] was supposed to read: +\begin{verbatim} + @ (cd ${OBJ}/${SYS}/bin ; \ + echo '(progn \ + (setq si::*collect-binary-modules* t) \ + (load "makedep.lisp") \ + (compiler::link \ + (remove-duplicates si::*binary-modules* :test (quote equal)) \ + "$(DEPSYS)" \ + (format nil "\ + (setq si::*collect-binary-modules* t) \ + (let ((si::*load-path* (cons ~S si::*load-path*))\ + (si::*load-types* ~S))\ + (compiler::emit-fn t))\ + (load \"makedep.lisp\")\ + (gbc t)\ + (when si::*binary-modules* \ + (error si::*binary-modules*))\ + (setq si::collect-binary-modules* nil si::*binary-modules* nil)\ + (gbc t)\ + (when (fboundp (quote si::sgc-on)) (si::sgc-on t))\ + (setq compiler::*default-system-p* t)\ + " si::*system-directory* (quote (list ".lsp")))\ + "" \ + nil))' | $(LISPSYS)) +\end{verbatim} + +This scheme does not work. It fails during loading with multiple messages +of the form: +\begin{verbatim} +/home/axiom--main--1--patch-33/obj/linux/interp/parse.o(.text+0x5660): In function `init_code': +: multiple definition of `init_code' +/home/axiom--main--1--patch-33/obj/linux/interp/postpar.o(.text+0x4e78): first defined here +\end{verbatim} + +<>= +depsys_lisp_sources += parsing.lisp metalex.lisp bootlex.lisp \ + newaux.lisp preparse.lisp postprop.lisp \ + metameta.lisp fnewmeta.lisp + +depsys_boot_sources = postpar.boot parse.boot clam.boot slam.boot \ + g-boot.boot g-error.boot c-util.boot g-util.boot + +depsys_SOURCES = $(depsys_lisp_SOURCES) $(depsys_boot_SOURCES) + +depsys_objects = nocompil.$(FASLEXT) bookvol5.$(FASLEXT) g-error.$(FASLEXT) \ + util.$(FASLEXT) postpar.$(FASLEXT) parse.$(FASLEXT) \ + parsing.$(FASLEXT) metalex.$(FASLEXT) bootlex.$(FASLEXT) \ + newaux.$(FASLEXT) preparse.$(FASLEXT) postprop.$(FASLEXT) \ + metameta.$(FASLEXT) fnewmeta.$(FASLEXT) clam.$(FASLEXT) \ + slam.$(FASLEXT) g-boot.$(FASLEXT) c-util.$(FASLEXT) \ + g-util.$(FASLEXT) + +${DEPSYS}: vmlisp.$(FASLEXT) \ + hash.$(FASLEXT) \ + ggreater.$(FASLEXT) \ + union.$(FASLEXT) \ + bootfuns.$(FASLEXT) \ + ${DEP} \ + nocompil.$(FASLEXT) \ + bookvol5.$(FASLEXT)\ + util.$(FASLEXT) \ + postpar.clisp parse.clisp \ + parsing.lisp metalex.lisp \ + bootlex.lisp newaux.lisp \ + preparse.lisp \ + postprop.lisp def.lisp \ + metameta.lisp fnewmeta.lisp \ + g-error.clisp \ + g-boot.clisp c-util.${LISP} \ + g-util.clisp \ + clam.clisp \ + slam.clisp + @ echo 3 making ${DEPSYS} + @ rm -f makedep.lisp + @ $(mkinstalldirs) $(axiom_build_bindir) + @ echo '(|importModule| "vmlisp")' >> makedep.lisp + @ echo '(|importModule| "hash")' >> makedep.lisp + @ echo '(|importModule| "ggreater")' >> makedep.lisp + @ echo '(|importModule| "union")' >> makedep.lisp + @ echo '(|importModule| "bootfuns")' >> makedep.lisp + @ echo '(|importModule| "nocompil")' >> makedep.lisp + @ echo '(|importModule| "bookvol5")' >> makedep.lisp + @ echo '(|importModule| "util")' >> makedep.lisp + @ echo '(in-package "BOOT")' >> makedep.lisp + @ echo '(build-depsys (quote ($(patsubst %, "%", ${DEP}))) "${AXIOM}")' >> makedep.lisp + @ echo '(unless (probe-file "postpar.$(FASLEXT)") (compile-file "postpar.clisp" :output-file "postpar.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "postpar")' >> makedep.lisp + @ echo '(unless (probe-file "parse.$(FASLEXT)") (compile-file "parse.clisp" :output-file "parse.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "parse")' >> makedep.lisp + @ echo '(unless (probe-file "parsing.$(FASLEXT)") (compile-file "parsing.lisp" :output-file "parsing.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "parsing")' >> makedep.lisp + @ echo '(unless (probe-file "metalex.$(FASLEXT)") (compile-file "metalex.lisp" :output-file "metalex.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "metalex")' >> makedep.lisp + @ echo '(unless (probe-file "bootlex.$(FASLEXT)") (compile-file "bootlex.lisp" :output-file "bootlex.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "bootlex")' >> makedep.lisp + @ echo '(unless (probe-file "newaux.$(FASLEXT)") (compile-file "newaux.lisp" :output-file "newaux.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "newaux")' >> makedep.lisp + @ echo '(unless (probe-file "preparse.$(FASLEXT)") (compile-file "preparse.lisp" :output-file "preparse.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "preparse")' >> makedep.lisp + @ echo '(unless (probe-file "postprop.$(FASLEXT)") (compile-file "postprop.lisp" :output-file "postprop.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "postprop")' >> makedep.lisp + @ echo '(unless (probe-file "def.$(FASLEXT)") (compile-file "def.lisp" :output-file "def.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "def")' >> makedep.lisp + @ echo '(unless (probe-file "metameta.$(FASLEXT)") (compile-file "metameta.lisp" :output-file "metameta.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "metameta")' >> makedep.lisp + @ echo '(unless (probe-file "fnewmeta.$(FASLEXT)") (compile-file "fnewmeta.lisp" :output-file "fnewmeta.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "fnewmeta")' >> makedep.lisp + @ echo '(unless (probe-file "clam.$(FASLEXT)") (compile-file "clam.clisp" :output-file "clam.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "clam")' >> makedep.lisp + @ echo '(unless (probe-file "slam.$(FASLEXT)") (compile-file "slam.clisp" :output-file "slam.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "slam")' >> makedep.lisp + @ echo '(unless (probe-file "g-error.$(FASLEXT)") (compile-file "g-error.clisp" :output-file "g-error.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "g-error")' >> makedep.lisp + @ echo '(unless (probe-file "g-boot.$(FASLEXT)") (compile-file "g-boot.clisp" :output-file "g-boot.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "g-boot")' >> makedep.lisp + @ echo '(unless (probe-file "c-util.$(FASLEXT)") (compile-file "c-util.${LISP}" :output-file "c-util.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "c-util")' >> makedep.lisp + @ echo '(unless (probe-file "g-util.$(FASLEXT)") (compile-file "g-util.clisp" :output-file "g-util.$(FASLEXT)"))' >> makedep.lisp + @ echo '(load "g-util")' >> makedep.lisp +<> + @rm $(addsuffix .$(FASLEXT), \ + postpar parse parsing metalex bootlex newaux preparse \ + postprop def metameta fnewmeta clam slam g-error \ + g-boot c-util g-util) + @ echo 4 ${DEPSYS} created + + +util.$(FASLEXT): util.lisp bootfuns.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +bookvol5.$(FASLEXT): bookvol5.lisp bootfuns.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +nocompil.$(FASLEXT): nocompil.lisp bootfuns.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +bootfuns.$(FASLEXT): bootfuns.lisp hash.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +hash.$(FASLEXT): hash.lisp vmlisp.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +union.$(FASLEXT): union.lisp vmlisp.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +ggreater.$(FASLEXT): ggreater.lisp vmlisp.$(FASLEXT) + $(BOOTSYS) -- --compile --output=$@ --load-directory=. $< + +vmlisp.$(FASLEXT): vmlisp.lisp + $(BOOTSYS) -- --compile --output=$@ $< + +@ + +\section{Building SAVESYS and AXIOMSYS} + +GCL likes to tell you when it has replaced a function call by a +tail-recursive call. This happens when the last form in a function +is a call to the same function. In general, we don't care so we set +compiler::*suppress-compiler-notes* to true in order to reduce the noise. + +Notice that when Axiom uses GCL as the Lisp platform, it is usually not +a good idea to mess with GCL's internal variables. In particular, GCL +has its own idea about what to do with [[si::*system-directory*]], which +should not be set here just because we happen to save an GCL-based image. +Doing otherwise causes havoc. + +<>= +makeint.lisp: ${DEPSYS} ${OBJS} bookvol5.$(FASLEXT) util.$(FASLEXT) \ + nocompil.lisp \ + ${OUTINTERP} ${OCOBJS} ${OPOBJS} ${BROBJS} obey.$(FASLEXT) \ + database.date ${INOBJS} ${ASCOMP} ${ASAUTO} \ + ${NAGBROBJS} ${TRANOBJS} \ + ${LOADSYS} \ + $(axiom_targetdir)/algebra/exposed.$(FASLEXT) \ + $(axiom_src_docdir)/msgs/s2-us.msgs \ + ../algebra/warm.data + @ echo 5 invoking make in `pwd` with parms: + @rm -f makeint.lisp + @ echo SYS= ${SYS} + @ echo LISP=${LISP} BYE=${BYE} + $(mkinstalldirs) $(axiom_target_datadir)/msgs + $(INSTALL_DATA) $(axiom_src_docdir)/msgs/s2-us.msgs \ + $(axiom_target_datadir)/msgs + @ echo '(|importModule| "vmlisp")' >> makeint.lisp + @ echo '(|importModule| "hash")' >> makeint.lisp + @ echo '(|importModule| "bootfuns")' >> makeint.lisp + @ echo '(gbc t)' >> makeint.lisp + @ echo '(load "nocompil.lisp")' >> makeint.lisp + @ echo '(|importModule| "bookvol5")' >> makeint.lisp + @ echo '(|importModule| "util")' >> makeint.lisp + @ echo '(in-package "BOOT")' >> makeint.lisp + @ touch ${TIMESTAMP} + @ echo '${YEARWEEK}' >> makeint.lisp + @ echo '(boot::build-interpsys (append (quote ($(interpsys_modules))) (quote ($(AS_modules))) (quote ($(IN_modules)))) (quote ($(patsubst %, "%", ${OPOBJS}))) (quote ($(patsubst %, "%", ${OCOBJS}))) (quote ($(patsubst %, "%", ${BROBJS}))) (quote ($(patsubst %, "%", ${TRANOBJS}))) (quote ($(patsubst %, "%", ${NAGBROBJS}))) (quote ($(patsubst %, "%", ${ASAUTO}))) "${AXIOM}")' >> makeint.lisp + @ echo '(boot::set-restart-hook)' >> makeint.lisp + @ echo '(in-package "BOOT")' >> makeint.lisp + @ echo '(load "../algebra/warm.data")' >> makeint.lisp + @ echo '(boot::|clearClams|)' >> makeint.lisp + @ echo '(load "obey")' >> makeint.lisp + @ echo '#+:akcl (setq compiler::*suppress-compiler-notes* t)' >> makeint.lisp + @ echo '#+:akcl (si::gbc-time 0)' >> makeint.lisp + @ echo '(gbc t)' >> makeint.lisp + +${SAVESYS}: makeint.lisp + AXIOM="$(AXIOM)" DAASE="$(axiom_src_datadir)" \ + $(LOADSYS) -- --make --output=$@ --main="BOOT::RESTART" \ + --load-directory=. makeint.lisp + @ echo 6 ${SAVESYS} created + $(mkinstalldirs) $(axiom_target_bindir) +@ + +\section{Building SAVESYS and AXIOMSYS} + +We want to cache database data in the final image, so we dump it only +after databases are build. +Note that having dependency on databases is not enough, since databases +are re-generated after leaving \File{interp/} directory. + +<>= +.PHONY: all-axiomsys + +all-axiomsys: ${AXIOMSYS} + +${AXIOMSYS}: makeint.lisp + AXIOM="$(AXIOM)" DAASE="$(axiom_targetdir)" \ + $(LOADSYS) -- --make --output=$@ --main="BOOT::RESTART" \ + --load-directory=. makeint.lisp + @ echo 6a ${AXIOMSYS} created +@ + +\section{Building debugsys} + +Note that we assume you've already built interpsys so all of the +files are known to exist and be up to date. We don't list any of +the preconditions here. +<>= +${DEBUGSYS}: debugsys.lisp + @ echo 7 building debugsys + @ echo '(progn (gbc t) (load "debugsys.lisp") (in-package "BOOT") (spad-save "$@"))' | ${LISPSYS} + @ echo 8 ${DEBUGSYS} created + +@ + +\section{The Interpreter files} + +\subsection{DVI files from pmaphlet files} + +<>= +$(axiom_build_texdir)/diagrams.tex: $(axiom_src_docdir)/diagrams.tex + $(INSTALL_DATA) $< $@ +@ + +\subsection{apply.boot \cite{7}} + +<>= +${AUTO}/apply.$(FASLEXT): apply.$(FASLEXT) + @ echo 9 making ${AUTO}/apply.$(FASLEXT) from apply.$(FASLEXT) + @ cp apply.$(FASLEXT) ${AUTO} + +@ + +\subsection{bootlex.lisp \cite{9}} + +<>= +${AUTO}/bootlex.$(FASLEXT): bootlex.$(FASLEXT) + @ echo 19 making ${AUTO}/bootlex.$(FASLEXT) from bootlex.$(FASLEXT) + @ cp bootlex.$(FASLEXT) ${AUTO} + +@ + +\subsection{debugsys.lisp \cite{14}} + +The {\bf debugsys.lisp} file is used to create a {\bf debugsys} runnable image. +This image contains almost all of the lisp code that make up the axiom +interpreter in lisp form. It is useful for deep system debugging but +otherwise worthless. This file is certain to drift over time as changes +are made elsewhere to add or remove files. It is assumed that you know +what you are doing if you change this file or use debugsys. + +This file is basically the same as the one created during the build of +interpsys. See the echo lines in the {\bf SAVESYS} block above. These +are echoed into a temporary file which gets loaded into the lisp image. +We simply captured that temporary file, replaced the .o files with .lisp +files (or .lsp or .clisp) and saved it here. +<>= +debugsys.lisp: $(srcdir)/debugsys.lisp.pamphlet + $(axiom_build_document) --tangle --output=$@ $< +@ + +\subsection{def.lisp \cite{15}} + +<>= +${AUTO}/def.$(FASLEXT): def.$(FASLEXT) + @ echo 41 making ${AUTO}/def.$(FASLEXT) from def.$(FASLEXT) + @ cp def.$(FASLEXT) ${AUTO} + +@ + +\subsection{fnewmeta.lisp \cite{18}} + +<>= +${AUTO}/fnewmeta.$(FASLEXT): fnewmeta.$(FASLEXT) + @ echo 49 making ${AUTO}/fnewmeta.$(FASLEXT) from fnewmeta.$(FASLEXT) + @ cp fnewmeta.$(FASLEXT) ${AUTO} + +@ + +\subsection{fortcall.boot \cite{16}} + +<>= +fortcall.clisp: fortcall.boot + @ echo 55 making $@ from $< + @ echo '(progn (old-boot::boot "fortcall.boot"))' | ${DEPSYS} + +@ + +\subsection{metalex.lisp \cite{22}} + +<>= +${AUTO}/metalex.$(FASLEXT): metalex.$(FASLEXT) + @ echo 66 making ${AUTO}/metalex.$(FASLEXT) from metalex.$(FASLEXT) + @ cp metalex.$(FASLEXT) ${AUTO} + +@ + +\subsection{metameta.lisp \cite{23}} + +<>= +${AUTO}/metameta.$(FASLEXT): metameta.$(FASLEXT) + @ echo 71 making ${AUTO}/metameta.$(FASLEXT) from metameta.$(FASLEXT) + @ cp metameta.$(FASLEXT) ${AUTO} + +@ + +\subsection{nspadaux.lisp \cite{28}} + +<>= +${AUTO}/nspadaux.$(FASLEXT): nspadaux.$(FASLEXT) + @ echo 89 making ${AUTO}/nspadaux.$(FASLEXT) from nspadaux.$(FASLEXT) + @ cp nspadaux.$(FASLEXT) ${AUTO} + +@ + +\subsection{parsing.lisp \cite{29}} + +<>= +${AUTO}/parsing.$(FASLEXT): parsing.$(FASLEXT) + @ echo 94 making ${AUTO}/parsing.$(FASLEXT) from parsing.$(FASLEXT) + @ cp parsing.$(FASLEXT) ${AUTO} + +@ + +\subsection{postprop.lisp \cite{30}} + +<>= +${AUTO}/postprop.$(FASLEXT): postprop.$(FASLEXT) + @ echo 102 making $@ from $< + @ cp $< ${AUTO} + +@ + +\subsection{preparse.lisp \cite{31}} + +<>= +${AUTO}/preparse.$(FASLEXT): preparse.$(FASLEXT) + @ echo 106 making ${AUTO}/preparse.$(FASLEXT) from preparse.$(FASLEXT) + @ cp preparse.$(FASLEXT) ${AUTO} + +@ + +\subsection{buildom.boot \cite{41}} + +<>= +buildom.clisp: buildom.boot + @ echo 143 making $@ from $< + @ echo '(progn (old-boot::boot "buildom.boot"))' | ${DEPSYS} + +@ + +\subsection{c-util.boot \cite{42}} + +<>= +${AUTO}/c-util.$(FASLEXT): c-util.$(FASLEXT) + @ echo 145 making ${AUTO}/c-util.$(FASLEXT) from c-util.$(FASLEXT) + @ cp c-util.$(FASLEXT) ${AUTO} + +@ +Note that the {\bf c-util.boot.pamphlet} file contains both the +original {\bf boot} code and a saved copy of the {\bf c-util.clisp} +code. We need to keep the translated code around so we can bootstrap +the system. In other words, we need this boot code translated so we +can build the boot translator. + +{\bf NOTE WELL: IF YOU CHANGE THE BOOT CODE IN C-UTIL.BOOT.PAMPHLET +YOU MUST TRANSLATE THIS CODE TO LISP AND STORE THE RESULTING LISP +CODE BACK INTO THE C-UTIL.BOOT.PAMPHLET FILE. THIS IS NOT AUTOMATED.} +<>= +c-util.${LISP}: $(srcdir)/c-util.boot.pamphlet + @ echo 146 making c-util.${LISP} from $(srcdir)/c-util.boot.pamphlet + @ rm -f c-util.$(FASLEXT) + $(axiom_build_document) --tangle=c-util.clisp --output=$@ $< + +@ +<>= +c-util.clisp: c-util.boot + @ echo 148 making $@ from $< + @ echo '(progn (old-boot::boot "c-util.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-c02.boot \cite{43}} + +<>= +${AUTO}/nag-c02.$(FASLEXT): nag-c02.$(FASLEXT) + @ echo 150 making${AUTO}/nag-c02.$(FASLEXT) from nag-c02.$(FASLEXT) + @ cp nag-c02.$(FASLEXT) ${AUTO} + +@ +<>= +nag-c02.clisp: nag-c02.boot + @ echo 152 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-c02.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-c05.boot \cite{44}} + +<>= +${AUTO}/nag-c05.$(FASLEXT): nag-c05.$(FASLEXT) + @ echo 154 making ${AUTO}/nag-c05.$(FASLEXT) from nag-c05.$(FASLEXT) + @ cp nag-c05.$(FASLEXT) ${AUTO} + +@ +<>= +nag-c05.clisp: nag-c05.boot + @ echo 156 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-c05.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-c06.boot \cite{45}} + +<>= +${AUTO}/nag-c06.$(FASLEXT): nag-c06.$(FASLEXT) + @ echo 158 making${AUTO}/nag-c06.$(FASLEXT) from nag-c06.$(FASLEXT) + @ cp nag-c06.$(FASLEXT) ${AUTO} + +@ +<>= +nag-c06.clisp: nag-c06.boot + @ echo 160 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-c06.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-d01.boot \cite{46}} + +<>= +${AUTO}/nag-d01.$(FASLEXT): nag-d01.$(FASLEXT) + @ echo 162 making${AUTO}/nag-d01.$(FASLEXT) from nag-d01.$(FASLEXT) + @ cp nag-d01.$(FASLEXT) ${AUTO} + +@ +<>= +nag-d01.clisp: nag-d01.boot + @ echo 164 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-d01.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-d02.boot \cite{47}} + +<>= +${AUTO}/nag-d02.$(FASLEXT): nag-d02.$(FASLEXT) + @ echo 166 making${AUTO}/nag-d02.$(FASLEXT) from nag-d02.$(FASLEXT) + @ cp nag-d02.$(FASLEXT) ${AUTO} + +@ +<>= +nag-d02.clisp: nag-d02.boot + @ echo 168 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-d02.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-d03.boot \cite{48}} + +<>= +${AUTO}/nag-d03.$(FASLEXT): nag-d03.$(FASLEXT) + @ echo 170 making${AUTO}/nag-d03.$(FASLEXT) from nag-d03.$(FASLEXT) + @ cp nag-d03.$(FASLEXT) ${AUTO} + +@ +<>= +nag-d03.clisp: nag-d03.boot + @ echo 172 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-d03.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-e01.boot \cite{49}} + +<>= +${AUTO}/nag-e01.$(FASLEXT): nag-e01.$(FASLEXT) + @ echo 174 making ${AUTO}/nag-e01.$(FASLEXT) from nag-e01.$(FASLEXT) + @ cp nag-e01.$(FASLEXT) ${AUTO} + +@ +<>= +nag-e01.clisp: nag-e01.boot + @ echo 176 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-e01.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-e02.boot \cite{51}} + +<>= +${AUTO}/nag-e02.$(FASLEXT): nag-e02.$(FASLEXT) + @ echo 182 making ${AUTO}/nag-e02.$(FASLEXT) from nag-e02.$(FASLEXT) + @ cp nag-e02.$(FASLEXT) ${AUTO} + +@ +<>= +nag-e02.clisp: nag-e02.boot + @ echo 184 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-e02.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-e04.boot \cite{52}} + +<>= +${AUTO}/nag-e04.$(FASLEXT): nag-e04.$(FASLEXT) + @ echo 186 making ${AUTO}/nag-e04.$(FASLEXT) from nag-e04.$(FASLEXT) + @ cp nag-e04.$(FASLEXT) ${AUTO} + +@ +<>= +nag-e04.clisp: nag-e04.boot + @ echo 188 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-e04.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-f01.boot \cite{53}} + +<>= +${AUTO}/nag-f01.$(FASLEXT): nag-f01.$(FASLEXT) + @ echo 190 making ${AUTO}/nag-f01.$(FASLEXT) from nag-f01.$(FASLEXT) + @ cp nag-f01.$(FASLEXT) ${AUTO} + +@ +<>= +nag-f01.clisp: nag-f01.boot + @ echo 192 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-f01.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-f02.boot \cite{54}} + +<>= +${AUTO}/nag-f02.$(FASLEXT): nag-f02.$(FASLEXT) + @ echo 194 making ${AUTO}/nag-f02.$(FASLEXT) from nag-f02.$(FASLEXT) + @ cp nag-f02.$(FASLEXT) ${AUTO} + +@ +<>= +nag-f02.clisp: nag-f02.boot + @ echo 196 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-f02.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-f04.boot \cite{55}} + +<>= +${AUTO}/nag-f04.$(FASLEXT): nag-f04.$(FASLEXT) + @ echo 198 making ${AUTO}/nag-f04.$(FASLEXT) from nag-f04.$(FASLEXT) + @ cp nag-f04.$(FASLEXT) ${AUTO} + +@ +<>= +nag-f04.clisp: nag-f04.boot + @ echo 200 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-f04.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-f07.boot \cite{56}} + +<>= +${AUTO}/nag-f07.$(FASLEXT): nag-f07.$(FASLEXT) + @ echo 202 making ${AUTO}/nag-f07.$(FASLEXT) from nag-f07.$(FASLEXT) + @ cp nag-f07.$(FASLEXT) ${AUTO} + +@ +<>= +nag-f07.clisp: nag-f07.boot + @ echo 204 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-f07.boot"))' | ${DEPSYS} + +@ + +\subsection{nag-s.boot \cite{57}} + +<>= +${AUTO}/nag-s.$(FASLEXT): nag-s.$(FASLEXT) + @ echo 206 making ${AUTO}/nag-s.$(FASLEXT) from nag-s.$(FASLEXT) + @ cp nag-s.$(FASLEXT) ${AUTO} + +@ +<>= +nag-s.clisp: nag-s.boot + @ echo 208 making $@ from $< + @ echo '(progn (boot::reroot "${AXIOM}") (old-boot::boot "nag-s.boot"))' | ${DEPSYS} + +@ + +\subsection{category.boot \cite{58}} + +<>= +${AUTO}/category.$(FASLEXT): category.$(FASLEXT) + @ echo 210 making ${AUTO}/ category.$(FASLEXT) from category.$(FASLEXT) + @ cp category.$(FASLEXT) ${AUTO} + +@ +<>= +category.clisp: category.boot + @ echo 212 making $@ from $< + @ echo '(progn (old-boot::boot "category.boot"))' | ${DEPSYS} +@ + +\subsection{cattable.boot \cite{59}} + +<>= +cattable.clisp: cattable.boot + @ echo 215 making $@ from $< + @ echo '(progn (old-boot::boot "cattable.boot"))' | ${DEPSYS} +@ + +\subsection{c-doc.boot \cite{60}} + +<>= +${AUTO}/c-doc.$(FASLEXT): c-doc.$(FASLEXT) + @ echo 217 making ${AUTO}/c-doc.$(FASLEXT) from c-doc.$(FASLEXT) + @ cp c-doc.$(FASLEXT) ${AUTO} + +@ +<>= +c-doc.clisp: c-doc.boot + @ echo 219 making $@ from $< + @ echo '(progn (old-boot::boot "c-doc.boot"))' | ${DEPSYS} +@ + + +\subsection{clammed.boot \cite{62}} + +<>= +clammed.clisp: clammed.boot + @ echo 226 making $@ from $< + @ echo '(progn (old-boot::boot "clammed.boot"))' | ${DEPSYS} +@ + +\subsection{compat.boot \cite{63}} + +<>= +compat.clisp: compat.boot + @ echo 229 making $@ from $< + @ echo '(progn (old-boot::boot "compat.boot"))' | ${DEPSYS} +@ + +\subsection{compiler.boot \cite{64}} + +<>= +${AUTO}/compiler.$(FASLEXT): compiler.$(FASLEXT) + @ echo 231 making ${AUTO}/compiler.$(FASLEXT) from compiler.$(FASLEXT) + @ cp compiler.$(FASLEXT) ${AUTO} + +@ +<>= +compiler.clisp: compiler.boot + @ echo 233 making $@ from $< + @ echo '(progn (old-boot::boot "compiler.boot"))' | ${DEPSYS} +@ + +\subsection{profile.boot \cite{65}} + +<>= +${AUTO}/profile.$(FASLEXT): profile.$(FASLEXT) + @ echo 235 making ${AUTO}/profile.$(FASLEXT) from profile.$(FASLEXT) + @ cp profile.$(FASLEXT) ${AUTO} + +@ +<>= +profile.clisp: profile.boot + @ echo 237 making $@ from $< + @ echo '(progn (old-boot::boot "profile.boot"))' | ${DEPSYS} +@ + +\subsection{database.boot \cite{67}} + +<>= +database.clisp: database.boot + @ echo 243 making $@ from $< + @ echo '(progn (old-boot::boot "database.boot"))' | ${DEPSYS} +@ + +\subsection{define.boot} + +<>= +${AUTO}/define.$(FASLEXT): define.$(FASLEXT) + @ echo 245 making ${AUTO}/define.$(FASLEXT) from define.$(FASLEXT) + @ cp define.$(FASLEXT) ${AUTO} + +@ +<>= +define.clisp: define.boot + @ echo 247 making $@ from $< + @ echo '(progn (old-boot::boot "define.boot"))' | ${DEPSYS} +@ + +\subsection{format.boot} + +<>= +format.clisp: format.boot + @ echo 250 making $@ from $< + @ echo '(progn (old-boot::boot "format.boot"))' | ${DEPSYS} +@ + +\subsection{functor.boot} + +<>= +${AUTO}/functor.$(FASLEXT): functor.$(FASLEXT) + @ echo 252 making ${AUTO}/functor.$(FASLEXT) from functor.$(FASLEXT) + @ cp functor.$(FASLEXT) ${AUTO} + +@ +<>= +functor.clisp: functor.boot + @ echo 254 making $@ from $< + @ echo '(progn (old-boot::boot "functor.boot"))' | ${DEPSYS} +@ + +\subsection{g-cndata.boot} + +<>= +g-cndata.clisp: g-cndata.boot + @ echo 261 making $@ from $< + @ echo '(progn (old-boot::boot "g-cndata.boot"))' | ${DEPSYS} +@ + +\subsection{g-opt.boot} + +<>= +g-opt.clisp: g-opt.boot + @ echo 267 making $@ from $< + @ echo '(progn (old-boot::boot "g-opt.boot"))' | ${DEPSYS} +@ + +\subsection{g-timer.boot} + +<>= +g-timer.clisp: g-timer.boot + @ echo 270 making $@ from $< + @ echo '(progn (old-boot::boot "g-timer.boot"))' | ${DEPSYS} +@ + + +\subsection{hypertex.boot} + +<>= +hypertex.clisp: hypertex.boot + @ echo 277 making $@ from $< + @ echo '(progn (old-boot::boot "hypertex.boot"))' | ${DEPSYS} +@ + +\subsection{i-analy.boot} + +<>= +i-analy.clisp: i-analy.boot + @ echo 280 making $@ from $< + @ echo '(progn (old-boot::boot "i-analy.boot"))' | ${DEPSYS} +@ + +\subsection{i-code.boot} + +<>= +i-code.clisp: i-code.boot + @ echo 283 making $@ from $< + @ echo '(progn (old-boot::boot "i-code.boot"))' | ${DEPSYS} +@ + +\subsection{i-coerce.boot} + +<>= +i-coerce.clisp: i-coerce.boot + @ echo 286 making $@ from $< + @ echo '(progn (old-boot::boot "i-coerce.boot"))' | ${DEPSYS} +@ + +\subsection{i-coerfn.boot} + +<>= +i-coerfn.clisp: i-coerfn.boot + @ echo 289 making $@ from $< + @ echo '(progn (old-boot::boot "i-coerfn.boot"))' | ${DEPSYS} +@ + +\subsection{i-eval.boot} + +<>= +i-eval.clisp: i-eval.boot + @ echo 292 making $@ from $< + @ echo '(progn (old-boot::boot "i-eval.boot"))' | ${DEPSYS} +@ + +\subsection{i-funsel.boot} + +<>= +i-funsel.clisp: i-funsel.boot + @ echo 295 making $@ from $< + @ echo '(progn (old-boot::boot "i-funsel.boot"))' | ${DEPSYS} +@ + +\subsection{bookvol5.lsp} + + +<>= +bookvol5.lisp: $(srcdir)/bookvol5.pamphlet + @ echo 298 making $@ from $< + $(axiom_build_document) --tangle=Interpreter --output=$@ $< +@ + +\subsection{i-intern.boot} + +<>= +i-intern.clisp: i-intern.boot + @ echo 301 making $@ from $< + @ echo '(progn (old-boot::boot "i-intern.boot"))' | ${DEPSYS} +@ + +\subsection{i-map.boot} + +<>= +i-map.clisp: i-map.boot + @ echo 304 making $@ from $< + @ echo '(progn (old-boot::boot "i-map.boot"))' | ${DEPSYS} +@ + +\subsection{i-output.boot} + +<>= +i-output.clisp: i-output.boot + @ echo 307 making $@ from $< + @ echo '(progn (old-boot::boot "i-output.boot"))' | ${DEPSYS} +@ + +\subsection{i-resolv.boot} + +<>= +i-resolv.clisp: i-resolv.boot + @ echo 310 making $@ from $< + @ echo '(progn (old-boot::boot "i-resolv.boot"))' | ${DEPSYS} +@ + +\subsection{i-spec1.boot} + +<>= +i-spec1.clisp: i-spec1.boot + @ echo 313 making $@ from $< + @ echo '(progn (old-boot::boot "i-spec1.boot"))' | ${DEPSYS} +@ + +\subsection{i-spec2.boot} + +<>= +i-spec2.clisp: i-spec2.boot + @ echo 316 making $@ from i-spec2.boot + @ echo '(progn (old-boot::boot "i-spec2.boot"))' | ${DEPSYS} +@ + +\subsection{i-syscmd.boot} + +<>= +i-syscmd.clisp: i-syscmd.boot + @ echo 319 making $@ from $< + @ echo '(progn (old-boot::boot "i-syscmd.boot"))' | ${DEPSYS} +@ + +\subsection{i-toplev.boot} + +<>= +i-toplev.clisp: i-toplev.boot + @ echo 322 making $@ from $< + @ echo '(progn (old-boot::boot "i-toplev.boot"))' | ${DEPSYS} +@ + +\subsection{i-util.boot} + +<>= +i-util.clisp: i-util.boot + @ echo 325 making $@ from $< + @ echo '(progn (old-boot::boot "i-util.boot"))' | ${DEPSYS} +@ + +\subsection{info.boot} + +<>= +${AUTO}/info.$(FASLEXT): info.$(FASLEXT) + @ echo 327 making ${AUTO}/info.$(FASLEXT) from info.$(FASLEXT) + @ cp info.$(FASLEXT) ${AUTO} + +@ +<>= +info.clisp: info.boot + @ echo 329 making $@ from $< + @ echo '(progn (old-boot::boot "info.boot"))' | ${DEPSYS} +@ + +\subsection{iterator.boot} + +<>= +${AUTO}/iterator.$(FASLEXT): iterator.$(FASLEXT) + @ echo 331 making ${AUTO}/iterator.$(FASLEXT) from iterator.$(FASLEXT) + @ cp iterator.$(FASLEXT) ${AUTO} + +@ +<>= +iterator.clisp: iterator.boot + @ echo 333 making $@ from $< + @ echo '(progn (old-boot::boot "iterator.boot"))' | ${DEPSYS} +@ + +\subsection{lisplib.boot} + +<>= +lisplib.clisp: lisplib.boot + @ echo 336 making $@ from $< + @ echo '(progn (old-boot::boot "lisplib.boot"))' | ${DEPSYS} +@ + +\subsection{match.boot} + +<>= +match.clisp: match.boot + @ echo 339 making $@ from $< + @ echo '(progn (old-boot::boot "match.boot"))' | ${DEPSYS} +@ + +\subsection{modemap.boot} + +<>= +${AUTO}/modemap.$(FASLEXT): modemap.$(FASLEXT) + @ echo 341 making ${AUTO}/modemap.$(FASLEXT) from modemap.$(FASLEXT) + @ cp modemap.$(FASLEXT) ${AUTO} + +@ +<>= +modemap.clisp: modemap.boot + @ echo 343 making $@ from $< + @ echo '(progn (old-boot::boot "modemap.boot"))' | ${DEPSYS} +@ + +\subsection{msgdb.boot} + +<>= +msgdb.clisp: msgdb.boot + @ echo 346 making $@ from $< + @ echo '(progn (old-boot::boot "msgdb.boot"))' | ${DEPSYS} +@ + +\subsection{newfort.boot} + +<>= +newfort.clisp: newfort.boot + @ echo 349 making $@ from $< + @ echo '(progn (old-boot::boot "newfort.boot"))' | ${DEPSYS} +@ + +\subsection{nruncomp.boot} + +<>= +${AUTO}/nruncomp.$(FASLEXT): nruncomp.$(FASLEXT) + @ echo 351 making ${AUTO}/nruncomp.$(FASLEXT) from nruncomp.$(FASLEXT) + @ cp nruncomp.$(FASLEXT) ${AUTO} + +@ +<>= +nruncomp.clisp: nruncomp.boot + @ echo 353 making $@ from $< + @ echo '(progn (old-boot::boot "nruncomp.boot"))' | ${DEPSYS} +@ + +\subsection{nrunfast.boot} + +<>= +nrunfast.clisp: nrunfast.boot + @ echo 356 making $@ from $< + @ echo '(progn (old-boot::boot "nrunfast.boot"))' | ${DEPSYS} +@ + +\subsection{nrungo.boot} + +<>= +nrungo.clisp: nrungo.boot + @ echo 359 making $@ from $< + @ echo '(progn (old-boot::boot "nrungo.boot"))' | ${DEPSYS} +@ + +\subsection{nruntime.boot} + +<>= +nruntime.clisp: nruntime.boot + @ echo 362 making $@ from $< + @ echo '(progn (old-boot::boot "nruntime.boot"))' | ${DEPSYS} +@ + +\subsection{nrunopt.boot} + +<>= +nrunopt.clisp: nrunopt.boot + @ echo 365 making $@ from $< + @ echo '(progn (old-boot::boot "nrunopt.boot"))' | ${DEPSYS} +@ + +\subsection{package.boot} + +<>= +${AUTO}/package.$(FASLEXT): package.$(FASLEXT) + @ echo 370 making ${AUTO}/package.$(FASLEXT) from package.$(FASLEXT) + @ cp package.$(FASLEXT) ${AUTO} + +@ + +\subsection{parse.boot} + +\begin{verbatim} +NOTE: this is used to build a depsys on a virgin copy of the system +\end{verbatim} +<>= +${AUTO}/parse.$(FASLEXT): parse.$(FASLEXT) + @ echo 374 making ${AUTO}/parse.$(FASLEXT) from parse.$(FASLEXT) + @ cp parse.$(FASLEXT) ${AUTO} + +@ + +\subsection{pathname.boot} + +\begin{verbatim} +NOTE: the .clisp file is copies back into the src directory so that +it is possible to create a new obootsys system from scratch for a +new platform. parse.clisp needs to be compiled in a depsys. +One thing need to be done to create an obootsys by hand: + parse and postpar must be loaded along with the depsys files + into a bare lisp system. +if these two things are done then a obootsys image can be bootstrapped +to a new platform. +\end{verbatim} +<>= +pathname.clisp: pathname.boot + @ echo 380 making $@ from $< + @ echo '(progn (old-boot::boot "pathname.boot"))' | ${DEPSYS} +@ + +\subsection{postpar.boot} + +\begin{verbatim} +NOTE: this is used to build a depsys on a virgin copy of the system +\end{verbatim} +<>= +${AUTO}/postpar.$(FASLEXT): postpar.$(FASLEXT) + @ echo 382 making ${AUTO}/postpar.$(FASLEXT) from postpar.$(FASLEXT) + @ cp postpar.$(FASLEXT) ${AUTO} + +@ + +\begin{verbatim} +NOTE: One thing need to be done to create an DEPSYS by hand: + parse and postpar must be loaded along with the depsys files + into a bare lisp system. +if these two things are done then a DEPSYS image can be bootstrapped +to a new platform. +\end{verbatim} + +\subsection{rulesets.boot} + +<>= +rulesets.clisp: rulesets.boot + @ echo 388 making $@ from $< + @ echo '(progn (old-boot::boot "rulesets.boot"))' | ${DEPSYS} +@ + +\subsection{server.boot} + +<>= +server.clisp: server.boot + @ echo 391 making $@ from $< + @ echo '(progn (old-boot::boot "server.boot"))' | ${DEPSYS} +@ + + +\subsection{setvart.boot} + +<>= +setvart.clisp: setvart.boot + @ echo 398 making $@ from $< + @ echo '(progn (old-boot::boot "setvart.boot"))' | ${DEPSYS} +@ + +\subsection{template.boot} + +<>= +template.clisp: template.boot + @ echo 408 making $@ from $< + @ echo '(progn (old-boot::boot "template.boot"))' | ${DEPSYS} +@ + +\subsection{termrw.boot} + +<>= +termrw.clisp: termrw.boot + @ echo 411 making $@ from $< + @ echo '(progn (old-boot::boot "termrw.boot"))' | ${DEPSYS} +@ + +\subsection{trace.boot} + +<>= +trace.clisp: trace.boot + @ echo 414 making $@ from $< + @ echo '(progn (old-boot::boot "trace.boot"))' | ${DEPSYS} +@ + +\subsection{as.boot} + +<>= +as.clisp: as.boot + @ echo 417 making $@ from $< + @ echo '(progn (old-boot::boot "as.boot"))' | ${DEPSYS} +@ + +\subsection{bc-matrix.boot} + +<>= +${AUTO}/bc-matrix.$(FASLEXT): bc-matrix.$(FASLEXT) + @ echo 422 making ${AUTO}/bc-matrix.$(FASLEXT) from bc-matrix.$(FASLEXT) + @ cp bc-matrix.$(FASLEXT) ${AUTO} + +@ +<>= +bc-matrix.clisp: bc-matrix.boot + @ echo 424 making $@ from $< + @ echo '(progn (old-boot::boot "bc-matrix.boot"))' | ${DEPSYS} +@ + +\subsection{bc-misc.boot} + +<>= +${AUTO}/bc-misc.$(FASLEXT): bc-misc.$(FASLEXT) + @ echo 426 making ${AUTO}/bc-misc.$(FASLEXT) from bc-misc.$(FASLEXT) + @ cp bc-misc.$(FASLEXT) ${AUTO} + +@ +<>= +bc-misc.clisp: bc-misc.boot + @ echo 428 making $@ from $< + @ echo '(progn (old-boot::boot "bc-misc.boot"))' | ${DEPSYS} +@ + +\subsection{bc-solve.boot} + +<>= +${AUTO}/bc-solve.$(FASLEXT): bc-solve.$(FASLEXT) + @ echo 430 making ${AUTO}/bc-solve.$(FASLEXT) from bc-solve.$(FASLEXT) + @ cp bc-solve.$(FASLEXT) ${AUTO} + +@ +<>= +bc-solve.clisp: bc-solve.boot + @ echo 432 making $@ from $< + @ echo '(progn (old-boot::boot "bc-solve.boot"))' | ${DEPSYS} +@ + +\subsection{bc-util.boot} + +<>= +${AUTO}/bc-util.$(FASLEXT): bc-util.$(FASLEXT) + @ echo 434 making ${AUTO}/bc-util.$(FASLEXT) from bc-util.$(FASLEXT) + @ cp bc-util.$(FASLEXT) ${AUTO} + +@ +<>= +bc-util.clisp: bc-util.boot + @ echo 436 making $@ from $< + @ echo '(progn (old-boot::boot "bc-util.boot"))' | ${DEPSYS} +@ + +\subsection{ht-util.boot} + +<>= +${AUTO}/ht-util.$(FASLEXT): ht-util.$(FASLEXT) + @ echo 438 making ${AUTO}/ht-util.$(FASLEXT) from ht-util.$(FASLEXT) + @ cp ht-util.$(FASLEXT) ${AUTO} + +@ +<>= +ht-util.clisp: ht-util.boot + @ echo 440 making $@ from $< + @ echo '(progn (old-boot::boot "ht-util.boot"))' | ${DEPSYS} +@ + +\subsection{htsetvar.boot} + +<>= +${AUTO}/htsetvar.$(FASLEXT): htsetvar.$(FASLEXT) + @ echo 442 making ${AUTO}/htsetvar.$(FASLEXT) from htsetvar.$(FASLEXT) + @ cp htsetvar.$(FASLEXT) ${AUTO} + +@ +<>= +htsetvar.clisp: htsetvar.boot + @ echo 444 making $@ from $< + @ echo '(progn (old-boot::boot "htsetvar.boot"))' | ${DEPSYS} +@ + +\subsection{record.boot} + +<>= +record.clisp: record.boot + @ echo 447 making $@ $< + @ echo '(progn (old-boot::boot "record.boot"))' | ${DEPSYS} +@ + +\subsection{ht-root.boot} + +<>= +${AUTO}/ht-root.$(FASLEXT): ht-root.$(FASLEXT) + @ echo 449 making ${AUTO}/ht-root.$(FASLEXT) from ht-root.$(FASLEXT) + @ cp ht-root.$(FASLEXT) ${AUTO} + +@ +<>= +ht-root.clisp: ht-root.boot + @ echo 451 making $@ from $< + @ echo '(progn (old-boot::boot "ht-root.boot"))' | ${DEPSYS} +@ + +\subsection{htcheck.boot} + +<>= +${AUTO}/htcheck.$(FASLEXT): htcheck.$(FASLEXT) + @ echo 453 making ${AUTO}/htcheck.$(FASLEXT) from htcheck.$(FASLEXT) + @ cp htcheck.$(FASLEXT) ${AUTO} + +@ +<>= +htcheck.clisp: htcheck.boot + @ echo 455 making $@ from $< + @ echo '(progn (old-boot::boot "htcheck.boot"))' | ${DEPSYS} +@ + +\subsection{xruncomp.boot} + +<>= +${AUTO}/xruncomp.$(FASLEXT): xruncomp.$(FASLEXT) + @ echo 457 making ${AUTO}/xruncomp.$(FASLEXT) from xruncomp.$(FASLEXT) + @ cp xruncomp.$(FASLEXT) ${AUTO} + +@ +<>= +xruncomp.clisp: xruncomp.boot + @ echo 459 making $@ from $< + @ echo '(progn (old-boot::boot "xruncomp.boot"))' | ${DEPSYS} +@ + +\subsection{ax.boot} + +<>= +${AUTO}/ax.$(FASLEXT): ax.$(FASLEXT) + @ echo 461 making ${AUTO}/ax.$(FASLEXT) from ax.$(FASLEXT) + @ cp ax.$(FASLEXT) ${AUTO} + +@ +<>= +ax.clisp: ax.boot + @ echo 463 making $@ $< + @ echo '(progn (old-boot::boot "ax.boot"))' | ${DEPSYS} +@ + +\subsection{br-con.boot} + +<>= +${AUTO}/br-con.$(FASLEXT): br-con.$(FASLEXT) + @ echo 465 making ${AUTO}/br-con.$(FASLEXT) from br-con.$(FASLEXT) + @ cp br-con.$(FASLEXT) ${AUTO} + +@ +<>= +br-con.clisp: br-con.boot + @ echo 467 making $@ from $< + @ echo '(progn (old-boot::boot "br-con.boot"))' | ${DEPSYS} +@ + +\subsection{br-search.boot} + +<>= +${AUTO}/br-search.$(FASLEXT): br-search.$(FASLEXT) + @ echo 469 making ${AUTO}/br-search.$(FASLEXT) from br-search.$(FASLEXT) + @ cp br-search.$(FASLEXT) ${AUTO} + +@ +<>= +br-search.clisp: br-search.boot + @ echo 471 making $@ from $< + @ echo '(progn (old-boot::boot "br-search.boot"))' | ${DEPSYS} +@ + +\subsection{br-op1.boot} + +<>= +${AUTO}/br-op1.$(FASLEXT): br-op1.$(FASLEXT) + @ echo 473 making ${AUTO}/br-op1.$(FASLEXT) from br-op1.$(FASLEXT) + @ cp br-op1.$(FASLEXT) ${AUTO} + +@ +<>= +br-op1.clisp: br-op1.boot + @ echo 475 making $@ from $< + @ echo '(progn (old-boot::boot "br-op1.boot"))' | ${DEPSYS} +@ + +\subsection{br-op2.boot} + +<>= +${AUTO}/br-op2.$(FASLEXT): br-op2.$(FASLEXT) + @ echo 477 making ${AUTO}/br-op2.$(FASLEXT) from br-op2.$(FASLEXT) + @ cp br-op2.$(FASLEXT) ${AUTO} + +@ +<>= +br-op2.clisp: br-op2.boot + @ echo 479 making $@ from $< + @ echo '(progn (old-boot::boot "br-op2.boot"))' | ${DEPSYS} +@ + +\subsection{br-data.boot} + +<>= +${AUTO}/br-data.$(FASLEXT): br-data.$(FASLEXT) + @ echo 481 making ${AUTO}/br-data.$(FASLEXT) from br-data.$(FASLEXT) + @ cp br-data.$(FASLEXT) ${AUTO} + +@ +<>= +br-data.clisp: br-data.boot + @ echo 483 making $@ from $< + @ echo '(progn (old-boot::boot "br-data.boot"))' | ${DEPSYS} +@ + +\subsection{br-util.boot} + +<>= +${AUTO}/br-util.$(FASLEXT): br-util.$(FASLEXT) + @ echo 485 making ${AUTO}/br-util.$(FASLEXT) from br-util.$(FASLEXT) + @ cp br-util.$(FASLEXT) ${AUTO} + +@ +<>= +br-util.clisp: br-util.boot + @ echo 487 making $@ from $< + @ echo '(progn (old-boot::boot "br-util.boot"))' | ${DEPSYS} +@ + +\subsection{br-saturn.boot} + +<>= +${AUTO}/br-saturn.$(FASLEXT): br-saturn.$(FASLEXT) + @ echo 489 making ${AUTO}/br-saturn.$(FASLEXT) from br-saturn.$(FASLEXT) + @ cp br-saturn.$(FASLEXT) ${AUTO} + +@ +<>= +br-saturn.clisp: br-saturn.boot + @ echo 491 making $@ from $< + @ echo '(progn (old-boot::boot "br-saturn.boot"))' | ${DEPSYS} +@ + +\subsection{topics.boot} + +<>= +${AUTO}/topics.$(FASLEXT): topics.$(FASLEXT) + @ echo 493 making ${AUTO}/topics.$(FASLEXT) from topics.$(FASLEXT) + @ cp topics.$(FASLEXT) ${AUTO} + +@ +<>= +topics.clisp: topics.boot + @ echo 495 making $@ from $< + @ echo '(progn (old-boot::boot "topics.boot"))' | ${DEPSYS} +@ + +\subsection{br-prof.boot} + +<>= +${AUTO}/br-prof.$(FASLEXT): br-prof.$(FASLEXT) + @ echo 497 making ${AUTO}/br-prof.$(FASLEXT) from br-prof.$(FASLEXT) + @ cp br-prof.$(FASLEXT) ${AUTO} + +@ +<>= +br-prof.clisp: br-prof.boot + @ echo 499 making $@ from $< + @ ($(axiom_build_document) --tangle --output=br-prof.boot $< ;\ + echo '(progn (old-boot::boot "br-prof.boot"))' | ${DEPSYS}; \ + rm br-prof.boot ) + +@ + +\subsection{showimp.boot} + +system level hacking files +<>= +${AUTO}/showimp.$(FASLEXT): showimp.$(FASLEXT) + @ echo 579 making ${AUTO}/showimp.$(FASLEXT) from showimp.$(FASLEXT) + @ cp showimp.$(FASLEXT) ${AUTO} + +@ + +\subsection{wi1.boot} + +translate files +<>= +${AUTO}/wi1.$(FASLEXT): wi1.$(FASLEXT) + @ cp $< $@ +@ + +\subsection{wi2.boot} + +<>= +${AUTO}/wi2.$(FASLEXT): wi2.$(FASLEXT) + @ cp $< $@ +@ + +\subsection{pspad1.boot} + +<>= +${AUTO}/pspad1.$(FASLEXT): pspad1.$(FASLEXT) + @ cp $< $@ +@ + +\subsection{pspad2.boot} + +<>= +${AUTO}/pspad2.$(FASLEXT): pspad2.$(FASLEXT) + @ cp $< $@ +@ + +\subsection{mark.boot} + +<>= +${AUTO}/mark.$(FASLEXT): mark.$(FASLEXT) + @ cp $< $@ + +@ + +\section{The databases} + +\begin{verbatim} + autoload dependencies + + if you are adding a file which is to be autoloaded the following step + information is useful: + there are 2 cases: + 1) adding files to currently autoloaded parts + (as of 2/92: browser old parser and old compiler) + 2) adding new files + case 1: + a) you have to add the file to the list of files currently there + (e.g. see BROBJS above) + b) add an autolaod rule + (e.g. ${AUTO}/parsing.$(FASLEXT): parsing.$(FASLEXT)) + c) edit util.lisp to add the 'external' function (those that + should trigger the autoload + case 2: + build-interpsys (in util.lisp) needs an extra argument for the + new autoload things and several functions in util.lisp need hacking. + + database.date is a marker file used to force a rebuild of interpsys if the + database is rebuilt (src/algebra/Makefile). + +\end{verbatim} +<>= +exposed.lsp: $(axiom_src_algdir)/exposed.lsp.pamphlet + @ echo 615 making exposed.lsp from $(axiom_src_algdir)/exposed.lsp.pamphlet + $(axiom_build_document) --tangle --output=$@ $< + +$(axiom_targetdir)/algebra/exposed.$(FASLEXT) : exposed.lsp ${LISPSYS} + @ echo 616 making $@ from exposed.lsp + $(mkinstalldirs) $(axiom_targetdir)/algebra + @ echo '(progn (compile-file "exposed.lsp" :output-file "$(axiom_targetdir)/algebra/exposed.$(FASLEXT)"))' | ${LISPSYS} + +database.date: + @ echo 617 the database was updated...remaking interpsys + @ touch database.date + +@ + +\section{The Makefile} +<<*>>= + +subdir = src/interp/ + +<> + +.SUFFIXES: +.SUFFIXES: .boot .clisp .lisp .pamphlet + +.PHONY: all all-ax all-depsys all-interpsys all-axiomsys all-debugsys + +all: all-ax + +all-ax: stamp + @echo finished $(srcdir) + +stamp: $(AUTO) remove-stamp build-images + $(STAMP) stamp + +.PHONY: remove-stamp +remove-stamp: + -rm -f stamp + +.PHONY: build-images +build-images: remove-stamp all-interpsys all-debugsys + +all-interpsys: all-depsys + $(mkinstalldirs) $(AUTO) + $(MAKE) $(SAVESYS) + +all-axiomsys: all-depsys + $(MAKE) $(AXIOMSYS) + +all-debugsys: all-interpsys + $(MAKE) $(DEBUGSYS) + +all-depsys: $(DEPSYS) + +<> + +mostlyclean-local: + @rm -f *.fn *.data *.$(FASLEXT) *.lib + +clean-local: mostlyclean-local + @rm -f *.clisp *.lsp + +distclean-local: clean-local + +<> +<> +<> +<> +<> + +<> + +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> + +<> +<> + +<> + +<> +<> + +<> + +<> + +<> +<> + +<> +<> +<> + +<> + +<> + +<> + +<> +<> + +<> + +<> + +<> + +<> +<> + +<> + +<> + +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> +<> + +<> + +<> + +<> + +<> + +<> + +<> +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> +<> + +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> +<> + +<> + +<> +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> + +<> +<> + +<> + +<> + +<> + +<> + +<> +<> + +<> + +@ +pp +\eject +\begin{thebibliography}{99} +\bibitem{1} \File{Makefile.pamphlet} +\bibitem{2} \File{src/boot/Makefile.pamphlet} +\bibitem{3} \File{src/interp/bootfuns.lisp.pamphlet} +\bibitem{4} \File{src/interp/setq.lisp.pamphlet} +\bibitem{5} \File{src/interp/patches.lisp.pamphlet} +\bibitem{6} {\bf www.aldor.org} +\bibitem{7} \File{src/interp/apply.boot.pamphlet} +\bibitem{8} \File{src/interp/bits.lisp.pamphlet} +\bibitem{9} \File{src/interp/bootlex.lisp.pamphlet} +\bibitem{10} \File{src/interp/cfuns.lisp.pamphlet} +\bibitem{11} \File{src/interp/comp.lisp.pamphlet} +\bibitem{12} \File{src/interp/construc.lisp.pamphlet} +\bibitem{13} \File{src/interp/daase.lisp.pamphlet} +\bibitem{14} \File{src/interp/debug.lisp.pamphlet} +\bibitem{15} \File{src/interp/def.lisp.pamphlet} +\bibitem{16} \File{src/interp/fortcall.boot.pamphlet} +\bibitem{17} \File{src/interp/fname.lisp.pamphlet} +\bibitem{18} \File{src/interp/fnewmeta.lisp.pamphlet} +\bibitem{19} \File{src/interp/ggreater.lisp.pamphlet} +\bibitem{20} \File{src/interp/hash.lisp.pamphlet} +\bibitem{21} \File{src/interp/macros.lisp.pamphlet} +\bibitem{22} \File{src/interp/metalex.lisp.pamphlet} +\bibitem{23} \File{src/interp/metameta.lisp.pamphlet} +\bibitem{24} \File{src/interp/monitor.lisp.pamphlet} +\bibitem{25} \File{src/interp/newaux.lisp.pamphlet} +\bibitem{26} \File{src/interp/nlib.lisp.pamphlet} +\bibitem{27} \File{src/interp/nocompil.lisp.pamphlet} +\bibitem{28} \File{src/interp/nspadaux.lisp.pamphlet} +\bibitem{29} \File{src/interp/parsing.lisp.pamphlet} +\bibitem{30} \File{src/interp/postprop.lisp.pamphlet} +\bibitem{31} \File{src/interp/preparse.lisp.pamphlet} +\bibitem{32} \File{src/interp/property.lisp.pamphlet} +\bibitem{33} \File{src/interp/sockio.lisp.pamphlet} +\bibitem{34} \File{src/interp/spad.lisp.pamphlet} +\bibitem{35} \File{src/interp/spaderror.lisp.pamphlet} +\bibitem{37} \File{src/interp/union.lisp.pamphlet} +\bibitem{38} \File{src/interp/util.lisp.pamphlet} +\bibitem{39} \File{src/interp/vmlisp.lisp.pamphlet} +\bibitem{40} \File{src/interp/alql.boot.pamphlet} +\bibitem{41} \File{src/interp/buildom.boot.pamphlet} +\bibitem{42} \File{src/interp/c-util.boot.pamphlet} +\bibitem{43} \File{src/interp/nag-c02.boot.pamphlet} +\bibitem{44} \File{src/interp/nag-c05.boot.pamphlet} +\bibitem{45} \File{src/interp/nag-c06.boot.pamphlet} +\bibitem{46} \File{src/interp/nag-d01.boot.pamphlet} +\bibitem{47} \File{src/interp/nag-d02.boot.pamphlet} +\bibitem{48} \File{src/interp/nag-d03.boot.pamphlet} +\bibitem{49} \File{src/interp/nag-e01.boot.pamphlet} +\bibitem{51} \File{src/interp/nag-e02.boot.pamphlet} +\bibitem{52} \File{src/interp/nag-e04.boot.pamphlet} +\bibitem{53} \File{src/interp/nag-f01.boot.pamphlet} +\bibitem{54} \File{src/interp/nag-f02.boot.pamphlet} +\bibitem{55} \File{src/interp/nag-f04.boot.pamphlet} +\bibitem{56} \File{src/interp/nag-f07.boot.pamphlet} +\bibitem{57} \File{src/interp/nag-s.boot.pamphlet} +\bibitem{58} \File{src/interp/category.boot.pamphlet} +\bibitem{59} \File{src/interp/cattable.boot.pamphlet} +\bibitem{60} \File{src/interp/c-doc.boot.pamphlet} +\bibitem{61} \File{src/interp/clam.boot.pamphlet} +\bibitem{62} \File{src/interp/clammed.boot.pamphlet} +\bibitem{63} \File{src/interp/compat.boot.pamphlet} +\bibitem{64} \File{src/interp/compiler.boot.pamphlet} +\bibitem{65} \File{src/interp/profile.boot.pamphlet} +\bibitem{66} \File{src/interp/compress.boot.pamphlet} +\bibitem{67} \File{src/interp/database.boot.pamphlet} +\end{thebibliography} +\end{document} diff --git a/src/interp/alql.boot.pamphlet b/src/interp/alql.boot.pamphlet new file mode 100644 index 00000000..2a19727f --- /dev/null +++ b/src/interp/alql.boot.pamphlet @@ -0,0 +1,78 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/interp alql.boot} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\section{License} +<>= +-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are +-- met: +-- +-- - Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- +-- - Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in +-- the documentation and/or other materials provided with the +-- distribution. +-- +-- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- names of its contributors may be used to endorse or promote products +-- derived from this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +-- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + +)package "BOOT" + +getBrowseDatabase(kind) == + $includeUnexposed? : local := true + not member(kind,'("o" "k" "c" "d" "p")) => nil + grepConstruct('"*",INTERN kind) + +stringMatches?(pattern,subject) == + FIXP basicMatch?(pattern,subject) => true + false +alqlGetKindString(x) == + x.0 = char 'a or x.0 = char 'o => SUBSTRING(dbPart(x,5,1),0,1) + SUBSTRING(x,0,1) +alqlGetOrigin(x) == + field :=dbPart(x,5,1) + k := charPosition(char '_(,field,2) + SUBSTRING(field,1,k-1) +alqlGetParams(x) == + field :=dbPart(x,5,1) + k := charPosition(char '_(,field,2) + SUBSTRING(field,k,nil) + + + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/anna.boot.pamphlet b/src/interp/anna.boot.pamphlet new file mode 100644 index 00000000..4a7ef6e7 --- /dev/null +++ b/src/interp/anna.boot.pamphlet @@ -0,0 +1,1932 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/interp anna.boot} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\section{License} +<>= +-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are +-- met: +-- +-- - Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- +-- - Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in +-- the documentation and/or other materials provided with the +-- distribution. +-- +-- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- names of its contributors may be used to endorse or promote products +-- derived from this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +-- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + +annaGen command == + htInitPage('"AXIOM/NAG Expert System Command",nil) + string := + #command < 50 => STRCONC('"{\centerline{\tt ",command,'" }}") + STRCONC('"{\tt ",command,'" }") + htMakePage [ + '(text + "\center{{\em Here is the AXIOM command}}" + "\center{{\em you could have issued to compute this result:}}" + "\vspace{2}\newline "), + ['text,: string]] + htMakeDoitButton('"Do It", command) + htShowPage() + +annaInt() == + htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\blankline ") + (text . "Analyses the function for various attributes, chooses and ") + (text . "then uses a suitable integration routine to ") + (text . "evaluate the finite, semi-infinite or infinite integral ") + (text . "\blankline ") + (text . "\tab{22} \space{1} \vspace{-32} ") + (text . "\inputbitmap{\htbmdir{}/ing.bitmap} \vspace{-34} f(x) dx ") + (text . "\blankline ") + (text . "\newline") + (text . "\newline \menuitemstyle{} \tab{2} {\em Lower} bound of the interval {\em a}: ") + (radioButtons lower + ("" " Finite" lowerFinite) + ("" " Minus Infinity" lowerInfinite)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{} \tab{2} {\em Upper} bound of the interval {\em b}: ") + (radioButtons upper + ("" " Finite" upperFinite) + ("" " Plus Infinity" upperInfinite))) + htMakeDoneButton('"Continue",'annaIntSolve) + htShowPage() + +annaDan() == + + page := htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f to be integrated: \newline \tab{2} ") + (bcStrings (50 "(log(2-x)*log(x))/((2-x)^(2/3)*sqrt(x))" expression EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline {\em Lower} bound of the interval {\em a}: ") + (text . "\tab{30} \menuitemstyle{}\tab{32} ") + (text . "{\em Upper} bound of the interval {\em b}:") + (text . "\newline\tab{2} ") + (bcStrings (15 "0.0" lower EM)) + (text . "\tab{32} ") + (bcStrings (15 "2.0" upper EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-6" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaIntGen) + htShowPage() + +annaBar() == + + page := htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f to be integrated: \newline \tab{2} ") + (bcStrings (50 "exp(-y)/sqrt(y)" expression EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline {\em Lower} bound of the interval {\em a}: ") + (text . "\tab{30} \menuitemstyle{}\tab{32} ") + (text . "{\em Upper} bound of the interval {\em b}:") + (text . "\newline\tab{2} ") + (bcStrings (15 "0.0" lower EM)) + (text . "\tab{32} ") + (bcStrings (15 "%plusInfinity" upper EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-6" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaIntGen) + htShowPage() + +annaFoo() == + + page := htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f to be integrated: \newline \tab{2} ") + (bcStrings (50 "(exp(-x^3)+exp(-3*x^2))/sqrt(x)" expression EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline {\em Lower} bound of the interval {\em a}: ") + (text . "\tab{30} \menuitemstyle{}\tab{32} ") + (text . "{\em Upper} bound of the interval {\em b}:") + (text . "\newline\tab{2} ") + (bcStrings (15 "0.0" lower EM)) + (text . "\tab{32} ") + (bcStrings (15 "%plusInfinity" upper EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-6" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaIntGen) + htShowPage() + +annaBlah() == + + page := htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f to be integrated: \newline \tab{2} ") + (bcStrings (50 "exp(-omega)/((omega-5)*(omega-1/2))" expression EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline {\em Lower} bound of the interval {\em a}: ") + (text . "\tab{30} \menuitemstyle{}\tab{32} ") + (text . "{\em Upper} bound of the interval {\em b}:") + (text . "\newline\tab{2} ") + (bcStrings (15 "0.0" lower EM)) + (text . "\tab{32} ") + (bcStrings (15 "%plusInfinity" upper EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-6" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaIntGen) + htShowPage() + +annaJoe() == + + page := htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f to be integrated: \newline \tab{2} ") + (bcStrings (50 "(exp(-x^3)+exp(-3*x^2))/(x^2-2)" expression EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline {\em Lower} bound of the interval {\em a}: ") + (text . "\tab{30} \menuitemstyle{}\tab{32} ") + (text . "{\em Upper} bound of the interval {\em b}:") + (text . "\newline\tab{2} ") + (bcStrings (15 "0.0" lower EM)) + (text . "\tab{32} ") + (bcStrings (15 "2.0" upper EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-6" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaIntGen) + htShowPage() + +annaSue() == + + page := htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f to be integrated: \newline \tab{2} ") + (bcStrings (50 "1/(x^6-1)" expression EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline {\em Lower} bound of the interval {\em a}: ") + (text . "\tab{30} \menuitemstyle{}\tab{32} ") + (text . "{\em Upper} bound of the interval {\em b}:") + (text . "\newline\tab{2} ") + (bcStrings (15 "0.0" lower EM)) + (text . "\tab{32} ") + (bcStrings (15 "2.0" upper EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-6" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaIntGen) + htShowPage() + +annaAnn() == + + page := htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f to be integrated: \newline \tab{2} ") + (bcStrings (50 "cos(t^2)+sin(t)+cos(sin(t^3))" expression EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline {\em Lower} bound of the interval {\em a}: ") + (text . "\tab{30} \menuitemstyle{}\tab{32} ") + (text . "{\em Upper} bound of the interval {\em b}:") + (text . "\newline\tab{2} ") + (bcStrings (15 "-%pi" lower EM)) + (text . "\tab{32} ") + (bcStrings (15 "%pi" upper EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-6" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaIntGen) + htShowPage() + +annaBab() == + + page := htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f to be integrated: \newline \tab{2} ") + (bcStrings (50 "x*product(x-i/10,i=-4..4)" expression EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline {\em Lower} bound of the interval {\em a}: ") + (text . "\tab{30} \menuitemstyle{}\tab{32} ") + (text . "{\em Upper} bound of the interval {\em b}:") + (text . "\newline\tab{2} ") + (bcStrings (15 "-1" lower EM)) + (text . "\tab{32} ") + (bcStrings (15 "1" upper EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-6" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaIntGen) + htShowPage() + +annaFnar() == + + page := htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f to be integrated: \newline \tab{2} ") + (bcStrings (50 "cos(20*rho)*(sin(rho^2) + cos(rho^2))" expression EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline {\em Lower} bound of the interval {\em a}: ") + (text . "\tab{30} \menuitemstyle{}\tab{32} ") + (text . "{\em Upper} bound of the interval {\em b}:") + (text . "\newline\tab{2} ") + (bcStrings (15 "0" lower EM)) + (text . "\tab{32} ") + (bcStrings (15 "1" upper EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-6" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaIntGen) + htShowPage() + +annaTub() == + + page := htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f to be integrated: \newline \tab{2} ") + (bcStrings (50 "exp(-z^2/2)/sqrt(2*%pi)" expression EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline {\em Lower} bound of the interval {\em a}: ") + (text . "\tab{30} \menuitemstyle{}\tab{32} ") + (text . "{\em Upper} bound of the interval {\em b}:") + (text . "\newline\tab{2} ") + (bcStrings (15 "%minusInfinity" lower EM)) + (text . "\tab{32} ") + (bcStrings (15 "%plusInfinity" upper EM)) + (text . "\blankline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-6" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaIntGen) + htShowPage() + +annaRats() == + + page := htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f to be integrated: \newline \tab{2} ") + (bcStrings (50 "log(u*u)" expression EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline {\em Lower} bound of the interval {\em a}: ") + (text . "\tab{30} \menuitemstyle{}\tab{32} ") + (text . "{\em Upper} bound of the interval {\em b}:") + (text . "\newline\tab{2} ") + (bcStrings (15 "-1" lower EM)) + (text . "\tab{32} ") + (bcStrings (15 "1" upper EM)) + (text . "\blankline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-6" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaIntGen) + htShowPage() + +annaIntSolve htPage == + + l := htpButtonValue(htPage,'lower) + u := htpButtonValue(htPage,'upper) + a := + l = 'lowerFinite => '"finite" + '"%minusInfinity" + b := + u = 'upperFinite => '"finite" + '"%plusInfinity" + (a = b) => annaDan() + a = '"finite" => annaFoo() + b = '"%plusInfinity" => annaTub() + page := htInitPage('"Integration using AXIOM/NAG Expert System",htPage) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f to be integrated: \newline \tab{2} ") + (bcStrings (45 "exp(-x^2/2)/sqrt(2*%pi)" expression EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline {\em Lower} bound of the interval {\em a}: ") + (text . "\tab{30} \menuitemstyle{}\tab{32} ") + (text . "{\em Upper} bound of the interval {\em b}:") + (text . "\newline\tab{2} ") + (bcStrings (15 "%minusInfinity" lower EM)) + (text . "\tab{32} ") + (bcStrings (15 "0.0" upper EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-6" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaIntGen) + htpSetProperty(page,'inputArea, htpInputAreaAlist htPage) + htShowPage() + + +annaIntGen htPage == + lower := htpLabelInputString(htPage,'lower) + upper := htpLabelInputString(htPage,'upper) + expression := htpLabelInputString(htPage,'expression) + epsabs := htpLabelInputString(htPage,'epsabs) + epsrel := htpLabelInputString(htPage,'epsrel) + annaGen STRCONC('"integrate(",expression,", ",lower,"..",upper,", ",epsabs,", ",epsrel,")") + +annaMInt() == + htInitPage('"Integration using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "Analyses the function for various attributes, chooses and ") + (text . "then uses a suitable integration routine ") + (text . "\blankline ") + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the {\em function} f of the form: ") + (text . "\center{\inputbitmap{\htbmdir{}/d01fcf.bitmap}} ") + (text . "\newline ") + (text . "to be integrated in terms of subscripted ") + (text . "variables e.g. X[1]...X[n]: \newline \tab{2} ") + (bcStrings (58 "4.0*X[1]*X[3]*X[3]*exp(2.0*X[1]*X[3])/((1.0+X[2]+X[4])**2)" expression EM)) + (text . "\blankline ") + (text . "\menuitemstyle{}\tab{2} ") + (text . "Number of dimensions n in the integral, 2 \htbitmap{less=} ") + (text . "{\it N} \htbitmap{less=} 15: ") + (text . "\newline\tab{2} ") + (bcStrings (2 4 n PI)) + (text . "\blankline ") + (text . "\blankline ")) + htMakeDoneButton('"Continue", 'annaMIntSolve) + htShowPage() + +annaMIntSolve htPage == + n := + $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'n) + objValUnwrap htpLabelSpadValue(htPage, 'n) + n = '4 => annaMIntDefaultSolve(htPage) + expression := htpLabelInputString(htPage,'expression) + rangeList := + "append"/[f(i,n) for i in 1..n] where f(i,n) == + prefix := ('"\newline a") + prefix := STRCONC(prefix,STRINGIMAGE i,'"\space{1}") + post := ('"\tab{30} b") + post := STRCONC(post,STRINGIMAGE i,'"\space{1}") + rnam := INTERN STRCONC ('"x",STRINGIMAGE i) + inam := INTERN STRCONC ('"y",STRINGIMAGE i) + [['text,:prefix],['bcStrings,[5, 0.0, rnam, 'EM]], + ['text,:post],['bcStrings,[5, 1.0, inam, 'EM]]] + errList := + errtext := ('"\newline \blankline \menuitemstyle{}\tab{2}") + errtext := STRCONC(errtext,'"Absolute accuracy required:") + errtext := STRCONC(errtext,'"\tab{30} \menuitemstyle{}\tab{32}") + errtext := STRCONC(errtext,'"Relative accuracy required: \newline\tab{2} ") + [['text,:errtext],['bcStrings,[10, 0.0, 'abserr, 'F]], + ['text,"\tab{32} "],['bcStrings,[10, 1.0e-4, 'relerr, 'F]]] + equationPart := [ + '(domainConditions + (isDomain EM ($EmptyMode)) + (isDomain F (Float)) + (isDomain S (String)) + (isDomain PI (PositiveInteger))), + :rangeList,:errList] + page := htInitPage("AXIOM/NAG Multiple Integration", htpPropertyList htPage) + htSay '"Please enter the limits of integration:- " + htSay '"\blankline \menuitemstyle{} \tab{2} " + htSay '"Lower Limits: \tab{30} \menuitemstyle{} \tab{32} " + htSay '"Upper Limits: \newline " + htMakePage equationPart + htMakeDoneButton('"Continue",'annaMIntGen) + htpSetProperty(page,'expression,expression) + htpSetProperty(page,'inputArea, htpInputAreaAlist htPage) + htShowPage() + +annaMIntDefaultSolve (htPage) == + + page := htInitPage('"AXIOM/NAG Multiple Integration",nil) + expression := htpLabelInputString(htPage,'expression) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain EM $EmptyMode)) + (text . "\newline ") + (text . "Please enter the limits of integration:- ") + (text . "\blankline ") + (text . "\newline \menuitemstyle{} \tab{2} ") + (text . "Lower limits: \tab{30} ") + (text . "\menuitemstyle{} \tab{32} Upper limits: ") + (text . "\newline a1 ") + (bcStrings (10 "0.0" a1 F)) + (text . "\tab{30} b1 ") + (bcStrings (10 "1.0" b1 F)) + (text . "\newline a2 ") + (bcStrings (10 "0.0" a2 F)) + (text . "\tab{30} b2 ") + (bcStrings (10 "1.0" b2 F)) + (text . "\newline a3 ") + (bcStrings (10 "0.0" a3 F)) + (text . "\tab{30} b3 ") + (bcStrings (10 "1.0" b3 F)) + (text . "\newline a4 ") + (bcStrings (10 "0.0" a4 F)) + (text . "\tab{30} b4 ") + (bcStrings (10 "1.0" b4 F)) + (text . "\newline ") + (text . "\blankline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Absolute accuracy required:") + (text . "\tab{30} \menuitemstyle{}\tab{32}") + (text . "Relative accuracy required:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" epsabs F)) + (text . "\tab{32} ") + (bcStrings (10 "1.0e-4" epsrel F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaMIntGen) + htpSetProperty(page,'expression,expression) + htpSetProperty(page,'inputArea, htpInputAreaAlist htPage) + htShowPage() + + +annaMIntGen htPage == + expression := htpProperty(htPage,'expression) + alist := htpInputAreaAlist htPage + y := alist + epsrel := STRCONC((first y).1,'"") + y := rest y + epsabs := STRCONC((first y).1,'"") + y := rest y + while y repeat + right := STRCONC((first y).1,'"") + y := rest y + left := STRCONC((first y).1,"..") + y := rest y + rangelist := [STRCONC(left,right),:rangelist] + rangestring := bcwords2liststring rangelist + annaGen STRCONC ('"integrate( ",expression,", ",rangestring,", ",epsabs,", ",epsrel,")") + +annaOde() == + htInitPage('"Solution of Initial Value Problems of Ordinary Differential Equations using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "Analyses the function for various attributes, chooses and ") + (text . "then uses a suitable ODE solver to provide a ") + (text . "solution to the system of n ODEs \center{\htbitmap{d02gaf},}" ) + (text . "for i = 1,2,...,n.") + (text . "\blankline ") + (text . "\newline \menuitemstyle{} \tab{2} Is there any stopping criteria (i.e. some function ") + (text . "G(X,Y) such that the algorithm should stop when G(X,Y) = 0)? ") + (radioButtons stoppingCriteria + ("" " No \space{1} If No, G(X,Y) is set to 1.0" nostop) + ("" " Yes" stop)) + (text . "\blankline") + (text . "\newline \menuitemstyle{} \tab{2} Are intermediate values required? ") + (radioButtons intermediateValues + ("" " No" noint) + ("" " Yes" int)) + (text . "\blankline ") + (text . "\menuitemstyle{}\tab{2} ") + (text . "\newline Size of the system of equations:\space{1}") + (bcStrings (3 3 n PI)) + (text . "\newline")) + htMakeDoneButton('"Continue",'annaOdeSolve) + htShowPage() + +annaOdeSolve htPage == + + s := htpButtonValue(htPage,'stoppingCriteria) + i := htpButtonValue(htPage,'intermediateValues) + stoppingCriteria := + s = 'nostop => '"no" + '"stopping" + intermediateValues := + i = 'noint => '"no" + '"intervals" + n := + $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'n) + objValUnwrap htpLabelSpadValue(htPage, 'n) + (n = '3) => + (stoppingCriteria = intermediateValues) => annaOdeDefaultSolve() + (stoppingCriteria = '"stopping") => + (intermediateValues = '"intervals") => annaOdeDefaultSolve1() + annaOdeDefaultSolve2() + annaOdeDefaultSolve3() + expressionList := + "append"/[fe(i,n) for i in 1..n] where fe(i,n) == + prefix := ('"\blankline \newline Y") + prefix := STRCONC(prefix,STRINGIMAGE i,'"'\space{1}") + expression := INTERN STRCONC ('"Y",STRINGIMAGE i) + [['text,:prefix], + ['bcStrings,[45, STRCONC ('"Y[",STRINGIMAGE i,'"]"), expression, 'EM]]] + xList := + prefix := ('"\blankline \newline \menuitemstyle{} \tab{2} Initial Value for X: ") + middle := ('"\tab{24} \menuitemstyle{} \tab{26} Final Value for X: ") + [['text,:prefix],['bcStrings,[5, "0.0", "xinit", 'EM]], + ['text,:middle],['bcStrings,[5, "10.0", "xend", 'EM]]] + middle := ('"\blankline \menuitemstyle{} \tab{2} Initial Value for Y[i]: ") + middle := STRCONC(middle,"\newline ") + yinitList := + "append"/[fy(i,n) for i in 1..n] where fy(i,n) == + prefix := ('"\newline Y") + prefix := STRCONC(prefix,STRINGIMAGE i,'"\space{1}") + yinit := INTERN STRCONC ('"y",STRINGIMAGE i) + [['text,:prefix],['bcStrings,[10, '"0.0", yinit, 'EM]]] + yinitList := [['text,:middle],:yinitList] + if stoppingCriteria = '"no" then + sExpression := [] + else + sText := '"\blankline \newline \menuitemstyle{} \tab{2}" + sText := STRCONC(sText,'"\newline Enter the function G(x,y) (The Stopping Criteria): ") + sText := STRCONC(sText,'"\newline \tab{2}") + sExpression := [['bcStrings,[15, '"Y[1]", "stop", 'EM]]] + sExpression := [['text,sText],:sExpression] + if intermediateValues = '"no" then + ilist := [] + else + iText := '"\blankline \newline \menuitemstyle{} \tab{2}" + iText := STRCONC(iText,'"Enter the list of Intermediate Values required: ") + iText := STRCONC(iText,"\newline \tab{2}") + iList := [['bcStrings,[15, '"[2,4,6,8]", "ivals", 'EM]]] + iList := [['text,iText],:iList] + tolList := + tolText := '"\blankline \newline \menuitemstyle{} \tab{2}" + tolText := STRCONC(tolText,'"Relative accuracy required:\space{1}") + [['text,tolText],['bcStrings,[10, '"1.0e-4", "relerr", 'F]]] + expressionPart := [ + '(domainConditions + (isDomain EM ($EmptyMode)) + (isDomain F (Float)) + (isDomain S (String)) + (isDomain PI (PositiveInteger))), + :expressionList,:xList,:yinitList,:sExpression,:iList,:tolList] + page := htInitPage("AXIOM/NAG ODE Solvers", htpPropertyList htPage) + htSay '"\menuitemstyle{} \tab{2} Enter the list of ODE's (i.e.~the derivatives " + htSay '"Y[1]'..Y[n]') in terms of Y[1]..Y[n]: " + htSay '"\newline " + htMakePage expressionPart + htMakeDoneButton('"Continue",'annaOdeGen) + htpSetProperty(page,'n,n) + htpSetProperty(page,'stoppingCriteria,stoppingCriteria) + htpSetProperty(page,'intermediateValues,intermediateValues) + htShowPage() + + +annaOdeDefaultSolve() == + + n := '3 + stoppingCriteria := '"no" + intermediateValues := '"no" + page := htInitPage('"Solution of Initial Value Problems of Ordinary Differential Equations using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{} \tab{2} Enter the list of ODE's (i.e. the derivatives Y[1]'..Y[n]') ") + (text . "in terms of Y[1]..Y[n]: ") + (text . "\blankline ") + (text . "\newline \tab{2} {\em Y[1]':} \space{1}") + (bcStrings (42 "tan(Y[3])" Y1 EM)) + (text . "\blankline ") + (text . "\newline \tab{2} {\em Y[2]':} \space{1}") + (bcStrings (42 "-0.032*tan(Y[3])/Y[2]-0.02*Y[2]/cos(Y[3])" Y2 EM)) + (text . "\blankline ") + (text . "\newline \tab{2} {\em Y[3]':} \space{1}") + (bcStrings (42 "-0.032/(Y[2]**2)" Y3 EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline Initial Value for X: ") + (text . "\tab{24} \menuitemstyle{}\tab{26} ") + (text . "Final Value for X:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" xinit EM)) + (text . "\tab{26} ") + (bcStrings (10 "10.0" xend EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline Initial Value for Y[i]: ") + (text . "\newline \tab{2} {\em Y[1]:} \space{1}") + (bcStrings (10 "0.5" y1 EM)) + (text . "\newline \tab{2} {\em Y[2]:} \space{1}") + (bcStrings (10 "0.5" y2 EM)) + (text . "\newline \tab{2} {\em Y[3]:} \space{1}") + (bcStrings (10 "%pi*0.2" y3 EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "Relative accuracy required:\space{1}") + (bcStrings (10 "1.0e-4" tol F)) + (text . "\blankline ")) + htMakeDoneButton('"Continue",'annaOdeGen) + htpSetProperty(page,'stoppingCriteria,stoppingCriteria) + htpSetProperty(page,'intermediateValues,intermediateValues) + htpSetProperty(page,'n,n) + htShowPage() + +annaOdeDefaultSolve3() == + + n := '3 + stoppingCriteria := '"no" + intermediateValues := '"intervals" + page := htInitPage('"Solution of Initial Value Problems of Ordinary Differential Equations using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{} \tab{2} Enter the list of ODE's (i.e. the derivatives Y[1]'..Y[n]') ") + (text . "in terms of Y[1]..Y[n]: ") + (text . "\blankline ") + (text . "\newline \tab{2} {\em Y[1]':} \space{1}") + (bcStrings (42 "-0.04*Y[1]+1.0e4*Y[2]*Y[3]" Y1 EM)) + (text . "\blankline ") + (text . "\newline \tab{2} {\em Y[2]':} \space{1}") + (bcStrings (42 "0.04*Y[1]-1.0e4*Y[2]*Y[3]-3.0e7*Y[2]*Y[2]" Y2 EM)) + (text . "\blankline ") + (text . "\newline \tab{2} {\em Y[3]':} \space{1}") + (bcStrings (42 "3.0e7*Y[2]*Y[2]" Y3 EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline Initial Value for X: ") + (text . "\tab{24} \menuitemstyle{}\tab{26} ") + (text . "Final Value for X:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" xinit EM)) + (text . "\tab{26} ") + (bcStrings (10 "10.0" xend EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline Initial Value for Y[i]: ") + (text . "\newline \tab{2} {\em Y[1]:} \space{1}") + (bcStrings (10 "1.0" y1 EM)) + (text . "\newline \tab{2} {\em Y[2]:} \space{1}") + (bcStrings (10 "0.0" y2 EM)) + (text . "\newline \tab{2} {\em Y[3]:} \space{1}") + (bcStrings (10 "0.0" y3 EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline Enter the list of Intermediate Values required: ") + (bcStrings (10 "[2,4,6,8]" intvals EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "Relative accuracy required:\space{1}") + (bcStrings (10 "1.0e-4" tol F)) + (text . "\blankline ")) + htMakeDoneButton('"Continue",'annaOdeGen) + htpSetProperty(page,'stoppingCriteria,stoppingCriteria) + htpSetProperty(page,'intermediateValues,intermediateValues) + htpSetProperty(page,'n,n) + htShowPage() + +annaOdeDefaultSolve2() == + + n := '3 + stoppingCriteria := '"stopping" + intermediateValues := '"no" + page := htInitPage('"Solution of Initial Value Problems of Ordinary Differential Equations using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{} \tab{2} Enter the list of ODE's (i.e. the derivatives Y[1]'..Y[n]') ") + (text . "in terms of Y[1]..Y[n]: ") + (text . "\blankline ") + (text . "\newline \tab{2} {\em Y[1]':} \space{1}") + (bcStrings (42 "tan(Y[3])" Y1 EM)) + (text . "\blankline ") + (text . "\newline \tab{2} {\em Y[2]':} \space{1}") + (bcStrings (42 "-0.032*tan(Y[3])/Y[2]-0.02*Y[2]/cos(Y[3])" Y2 EM)) + (text . "\blankline ") + (text . "\newline \tab{2} {\em Y[3]':} \space{1}") + (bcStrings (42 "-0.032/(Y[2]**2)" Y3 EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline Initial Value for X: ") + (text . "\tab{24} \menuitemstyle{}\tab{26} ") + (text . "Final Value for X:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" xinit EM)) + (text . "\tab{26} ") + (bcStrings (10 "10.0" xend EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline Initial Value for Y[i]: ") + (text . "\newline \tab{2} {\em Y[1]:} \space{1}") + (bcStrings (10 "0.5" y1 EM)) + (text . "\newline \tab{2} {\em Y[2]:} \space{1}") + (bcStrings (10 "0.5" y2 EM)) + (text . "\newline \tab{2} {\em Y[3]:} \space{1}") + (bcStrings (10 "%pi*0.2" y3 EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline Enter the function G(x,y) (The Stopping Criteria): ") + (bcStrings (10 "Y[1]" g EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "Relative accuracy required:\space{1}") + (bcStrings (10 "1.0e-4" tol F)) + (text . "\blankline ")) + htMakeDoneButton('"Continue",'annaOdeGen) + htpSetProperty(page,'stoppingCriteria,stoppingCriteria) + htpSetProperty(page,'intermediateValues,intermediateValues) + htpSetProperty(page,'n,n) + htShowPage() + +annaOdeDefaultSolve1() == + + n := '3 + stoppingCriteria := '"stopping" + intermediateValues := '"intervals" + page := htInitPage('"Solution of Initial Value Problems of Ordinary Differential Equations using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain PI (PositiveInteger)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{} \tab{2} Enter the list of ODE's (i.e. the derivatives Y[1]'..Y[n]') ") + (text . "in terms of Y[1]..Y[n]: ") + (text . "\blankline ") + (text . "\newline \tab{2} {\em Y[1]':} \space{1}") + (bcStrings (42 "-0.04*Y[1]+1.0e4*Y[2]*Y[3]" Y1 EM)) + (text . "\blankline ") + (text . "\newline \tab{2} {\em Y[2]':} \space{1}") + (bcStrings (42 "0.04*Y[1]-1.0e4*Y[2]*Y[3]-3.0e7*Y[2]*Y[2]" Y2 EM)) + (text . "\blankline ") + (text . "\newline \tab{2} {\em Y[3]':} \space{1}") + (bcStrings (42 "3.0e7*Y[2]*Y[2]" Y3 EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline Initial Value for X: ") + (text . "\tab{24} \menuitemstyle{}\tab{26} ") + (text . "Final Value for X:") + (text . "\newline\tab{2} ") + (bcStrings (10 "0.0" xinit EM)) + (text . "\tab{26} ") + (bcStrings (10 "10.0" xend EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline Initial Value for Y[i]: ") + (text . "\newline \tab{2} {\em Y[1]:} \space{1}") + (bcStrings (10 "1.0" y1 EM)) + (text . "\newline \tab{2} {\em Y[2]:} \space{1}") + (bcStrings (10 "0.0" y2 EM)) + (text . "\newline \tab{2} {\em Y[3]:} \space{1}") + (bcStrings (10 "0.0" y3 EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline Enter the function G(x,y) (The Stopping Criteria): ") + (bcStrings (10 "Y[1]-0.9" g EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "\newline Enter the list of Intermediate Values required: ") + (bcStrings (10 "[2,4,6,8]" intvals EM)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{}\tab{2} ") + (text . "Relative accuracy required:\space{1}") + (bcStrings (10 "1.0e-4" tol F)) + (text . "\blankline ")) + htMakeDoneButton('"Continue",'annaOdeGen) + htpSetProperty(page,'stoppingCriteria,stoppingCriteria) + htpSetProperty(page,'intermediateValues,intermediateValues) + htpSetProperty(page,'n,n) + htShowPage() + +annaOdeGen htPage == + + n := htpProperty(htPage,'n) + stoppingCriteria := htpProperty(htPage,'stoppingCriteria) + intermediateValues := htpProperty(htPage,'intermediateValues) + alist := htpInputAreaAlist htPage + y := alist + epsrel := STRCONC((first y).1,'"") + epsrelString := STRCONC(", ",epsrel) + y := rest y + if intermediateValues = '"no" then + intvalsString := '"" + else + intvals := STRCONC((first y).1,'"") + intvalsString := STRCONC(", ",intvals) + y := rest y + if stoppingCriteria = '"no" then + gString := '"" + else + g := STRCONC((first y).1,'"") + gString := STRCONC(", ",g) + y := rest y + for i in 1..n repeat + yi := STRCONC((first y).1,'"") + yiList := [yi,:yiList] + y := rest y + yiString := bcwords2liststring yiList + xend := STRCONC((first y).1,'"") + y := rest y + xinit := STRCONC((first y).1,'"") + y := rest y + for i in 1..n repeat + fi := STRCONC((first y).1,'"") + fiList := [fi,:fiList] + y := rest y + fiString := bcwords2liststring fiList + prefix := STRCONC('"solve(",fiString,", ", xinit,", ", xend,", ") + prefix := STRCONC(prefix,yiString,gString,intvalsString,epsrelString) + prefix := STRCONC(prefix,")") + annaGen prefix + +--d03fafVariables() == +-- htInitPage('"Helmholtz Equation in 3-D, Cartesian Coordinates",nil) +-- htMakePage '( +-- (domainConditions +-- (isDomain F (Float)) +-- (isDomain S (String))) +-- (text . "Descretizing the PDE:") +-- (text . "\newline\centerline{\inputbitmap{\htbmdir{}/d03faf.xbm}}") +-- (text . "\newline and solving the resulting seven-diagonal finite ") +-- (text . "difference equations using a method based on the Fast ") +-- (text . "Fourier Transform.\blankline Entering the names of pre-prepared ") +-- (text . "variables for xCond, yCond, zCond and f(x,y,z)") +-- (text . "\blankline Please enter the names of the condition variables") +-- (text . "\blankline \menuitemstyle{}\tab{2} xCond:\space{1} ") +-- (bcStrings (10 "xCond" x S)) +-- (text . "\newline \menuitemstyle{}\tab{2} yCond:\space{1} ") +-- (bcStrings (10 "yCond" y S)) +-- (text . "\newline \menuitemstyle{}\tab{2} zCond:\space{1} ") +-- (bcStrings (10 "zCond" z S)) +-- (text . "\blankline \menuitemstyle{}\tab{2} Please enter the value of lambda:\space{1} ") +-- (bcStrings (8 "-1.0" lambda F)) +-- (text . "\blankline \menuitemstyle{}\tab{2} Please enter the name of the variable for f(x,y,z):") +-- (text . "\space{1} ") +-- (bcStrings (10 "foo" f S)) +-- (text . "\blankline ")) +-- htMakeDoneButton('"Continue",'annaOptSolve) +-- htShowPage() + +annaPDESolve() == + htInitPage('"Second Order Elliptic Partial Differential Equation",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain S (String)) + (isDomain EM $EmptyMode)) + (text . "Descretizing the PDE:") + (text . "\newline\centerline{\inputbitmap{\htbmdir{}/d03eef.xbm}}") + (text . "\newline defined on a rectangular region with boundary conditions of the form ") + (text . "\centerline{\inputbitmap{\htbmdir{}/d03eef1.bitmap}} ") + (text . " and solving the resulting seven-diagonal finite ") + (text . "difference equations using a multigrid technique. \blankline ") + (text . "\menuitemstyle{} \tab{2} Enter the rectangle on which to discretize the PDE : \newline ") + (text . "\tab{11} Start \tab{20} Number of grid lines \tab{41} End ") + (text . " \newline \tab{6} X : \space{1} " ) + (bcStrings(7 "0.0" xmin F)) + (text . "\space{7} ") + (bcStrings(3 "9" ngx I)) + (text . "\space{7} ") + (bcStrings(7 "1.0" xmax F)) + (text . "\newline \tab{6} Y : \space{1} " ) + (bcStrings(7 "0.0" ymin F)) + (text . "\space{7} ") + (bcStrings(3 "9" ngy I)) + (text . "\space{7} ") + (bcStrings(7 "1.0" ymax F)) + (text . "\blankline \menuitemstyle{} Enter the values of the expressions\space{1}") + (text . " \inputbitmap{\htbmdir{}/alpha.xbm}(X,Y) to\space{1}") + (text . " \inputbitmap{\htbmdir{}/psi.xbm}(X,Y) : ") + (text . "\blankline \tab{3} \inputbitmap{\htbmdir{}/alpha.xbm}(X,Y) : ") + (bcStrings (36 "1" alpha EM)) + (text . "\newline \tab{3} \inputbitmap{\htbmdir{}/beta.xbm}(X,Y) : ") + (bcStrings (36 "0" beta EM)) + (text . "\newline \tab{3} \inputbitmap{\htbmdir{}/gamma.xbm}(X,Y) : ") + (bcStrings (36 "1" gamma EM)) + (text . "\newline \tab{3} \inputbitmap{\htbmdir{}/delta.xbm}(X,Y) : ") + (bcStrings (36 "50" delta EM)) + (text . "\newline \tab{3} \inputbitmap{\htbmdir{}/epsilon.xbm}(X,Y) : ") + (bcStrings (36 "50" epsilon EM)) + (text . "\newline \tab{3} \inputbitmap{\htbmdir{}/phi.xbm}(X,Y) : ") + (bcStrings (36 "0" phi EM)) + (text . "\newline \tab{3} \inputbitmap{\htbmdir{}/psi.xbm}(X,Y) : ") + (bcStrings (36 "-2*sin(X)*sin(Y) + 50*cos(X)*sin(Y) + 50*sin(X)*cos(Y)" psi EM)) + (text . "\blankline \menuitemstyle{} Enter the values of the boundary ") + (text . " condition expressions for the bottom, top, left and right sides : ") + (text . " \blankline \tab{2} \menuitemstyle{} Bottom boundary conditions :") + (text . " (Y := \inputbitmap{\htbmdir{}/ys.xbm})") + (text . "\newline \tab{4} a(X,Y) : ") + (bcStrings (34 "0" ba EM)) + (text . "\newline \tab{4} b(X,Y) : ") + (bcStrings (34 "1" bb EM)) + (text . "\newline \tab{4} c(X,Y) : ") + (bcStrings (34 "-sin(X)" bc EM)) + (text . " \blankline \tab{2} \menuitemstyle{} Top boundary conditions :") + (text . " (Y := \inputbitmap{\htbmdir{}/ye.xbm})") + (text . "\newline \tab{4} a(X,Y) : ") + (bcStrings (34 "1" ta EM)) + (text . "\newline \tab{4} b(X,Y) : ") + (bcStrings (34 "0" tb EM)) + (text . "\newline \tab{4} c(X,Y) : ") + (bcStrings (34 "sin(X)*sin(Y)" tc EM)) + (text . " \blankline \tab{2} \menuitemstyle{} Left boundary conditions :") + (text . " (X := \inputbitmap{\htbmdir{}/xs.xbm})") + (text . "\newline \tab{4} a(X,Y) : ") + (bcStrings (34 "0" la EM)) + (text . "\newline \tab{4} b(X,Y) : ") + (bcStrings (34 "1" lb EM)) + (text . "\newline \tab{4} c(X,Y) : ") + (bcStrings (34 "-sin(Y)" lc EM)) + (text . " \blankline \tab{2} \menuitemstyle{} Right boundary conditions :") + (text . " (Y := \inputbitmap{\htbmdir{}/xe.xbm})") + (text . "\newline \tab{4} a(X,Y) : ") + (bcStrings (34 "1" ra EM)) + (text . "\newline \tab{4} b(X,Y) : ") + (bcStrings (34 "0" rb EM)) + (text . "\newline \tab{4} c(X,Y) : ") + (bcStrings (34 "sin(X)*sin(Y)" rc EM)) + (text . "\blankline \menuitemstyle{} Do you know that the PDE described is elliptic? \space{2}") + (text . "\newline \tab{6} ") + (bcRadioButtons ell + ("" " Yes \space{2} " yes) + ("" " Unknown" no)) + (text . "\blankline \menuitemstyle{} Required Tolerance : ") + (bcStrings (10 "1.0e-4" tol F)) + (text . " \newline ")) + htMakeDoneButton('"Continue",'annaPDESolve2) + htShowPage() + +annaPDESolve2 htPage == + e := htpButtonValue(htPage,'ell) + ell := + e = 'yes => '"elliptic" + '"unknown" + xmin := htpLabelInputString(htPage,'xmin) + ngx := htpLabelInputString(htPage,'ngx) + xmax := htpLabelInputString(htPage,'xmax) + ymin := htpLabelInputString(htPage,'ymin) + ngy := htpLabelInputString(htPage,'ngy) + ymax := htpLabelInputString(htPage,'ymax) + alpha := htpLabelInputString(htPage,'alpha) + beta := htpLabelInputString(htPage,'beta) + gamma := htpLabelInputString(htPage,'gamma) + delta := htpLabelInputString(htPage,'delta) + epsilon := htpLabelInputString(htPage,'epsilon) + phi := htpLabelInputString(htPage,'phi) + psi := htpLabelInputString(htPage,'psi) + ba := htpLabelInputString(htPage,'ba) + bb := htpLabelInputString(htPage,'bb) + bc := htpLabelInputString(htPage,'bc) + ta := htpLabelInputString(htPage,'ta) + tb := htpLabelInputString(htPage,'tb) + tc := htpLabelInputString(htPage,'tc) + la := htpLabelInputString(htPage,'la) + lb := htpLabelInputString(htPage,'lb) + lc := htpLabelInputString(htPage,'lc) + ra := htpLabelInputString(htPage,'ra) + rb := htpLabelInputString(htPage,'rb) + rc := htpLabelInputString(htPage,'rc) + tol := htpLabelInputString(htPage,'tol) + bCond := STRCONC('"[[ ", ba, '", ", bb, '", ", bc, '"],") + bCond := STRCONC(bCond, '"[ ", ra, '", ", rb, '", ", rc, '"],") + bCond := STRCONC(bCond, '"[ ", ta, '", ", tb, '", ", tc, '"],") + bCond := STRCONC(bCond, '"[ ", la, '", ", lb, '", ", lc, '"]]") + pde := STRCONC('"[", alpha, '", ", beta, '", ", gamma, '", ", delta) + pde := STRCONC( pde, '", ", epsilon, '", ", phi, '", ", psi, '"]") + outputString := STRCONC('"solve(", xmin, '", ", xmax, '", ", ymin, '", ", ymax, '", ") + outputString := STRCONC(outputString , ngx, '", ", ngy, '", ", pde, '", ") + outputString := STRCONC(outputString , bCond, '", _"", ell ,'"_", ", tol, " )") + annaGen outputString + +annaOpt() == + htInitPage('"Minimization of a Multivariate Function using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain NNI (NonNegativeInteger)) + (isDomain S (String)) + (isDomain PI (PositiveInteger)) + (isDomain I (Integer)) + (isDomain EM $EmptyMode)) + (text . "Analyses the function for various attributes, chooses and ") + (text . "then uses a suitable optimization routine for finding the ") + (text . "minimum of a nonlinear function {\it F(x)} of {\it n} variables.") + (text . "\newline {\bf Minimize F(x)} where \center{\htbitmap{e04fdf1}} possibly subject to linear or non-linear ") + (text . "constraints on the variables. ") + (text . "\blankline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Number of variables \htbitmap{xj}, {\it n}:") + (text . "\space{1} ") + (bcStrings (2 4 n PI)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{} \tab{2} Are there any constraints ") + (text . "on the function?") + (radioButtons constraints + (" " " No" nocons) + (" " " Yes" cFunctions)) + (text . "\blankline \menuitemstyle{}") + (text . "Number of linear and/or non-linear constraint functions:\space{1}") + (bcStrings (2 "0" cons NNI)) + (text . "\blankline ")) + htMakeDoneButton('"Continue",'annaOptSolve) + htShowPage() + +annaOptSolve htPage == + n := + $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'n) + objValUnwrap htpLabelSpadValue(htPage, 'n) + c := htpButtonValue(htPage,'constraints) + constraints := + c = 'nocons => '"none" + '"cf" + cons := + $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'cons) + objValUnwrap htpLabelSpadValue(htPage, 'cons) + constraints = '"none" => annaOptSolve1(n) + ((n = '4) and (cons = '0)) => annaOptDefaultSolve2() + ((n = '4) and (cons = '3)) => annaOptDefaultSolve3() + ((n = '7) and (cons = '7)) => annaOptDefaultSolve4() + cText := ('"\blankline \menuitemstyle{}\tab{2} Enter lower and upper ") + cText := STRCONC(cText,'"boundary conditions {\it bl(n)} and {\it bu(n)}: ") + cText := STRCONC(cText,'"\newline \tab{5} Lower \tab{25} Constraint ") + cText := STRCONC(cText,'"\tab{45} Upper ") + cList := + "append"/[fc(i) for i in 1..n] where fc(i) == + prefix := ('"\newline \tab{2}") + xn := INTERN STRCONC ("\tab{27}",'"X",STRINGIMAGE i,"\tab{42}") + blnam := INTERN STRCONC ('"bl",STRINGIMAGE i) + bunam := INTERN STRCONC ('"bu",STRINGIMAGE i) + [['text,:prefix],['bcStrings,[8, '"-1.0", blnam, 'F]],['text,:xn], + ['bcStrings,[8, '"1.0", bunam, 'F]]] + consList := + "append"/[fe(i) for i in n+1..n+cons] where fe(i) == + lineEnd := ('"\newline\tab{2}") + space := ('"\space{1}") + space2 := ('"\tab{42}") + cnam := INTERN STRCONC ('"c",STRINGIMAGE i) + blnam := INTERN STRCONC ('"bl",STRINGIMAGE i) + bunam := INTERN STRCONC ('"bu",STRINGIMAGE i) + [['text,:lineEnd],['bcStrings,[8, '"-1.0", blnam, 'F]],['text,:space], + ['bcStrings,[26, '"X[1]", cnam, 'EM]],['text,:space2], + ['bcStrings,[8, '"1.0", bunam, 'F]]] + cList := [['text,:cText],:cList,:consList] + funcList := [['bcStrings,[48, '"X[1]", 'f, 'EM]]] + xmiddle := ('"\blankline \menuitemstyle{}\tab{2} Enter initial guess of the") + xmiddle := STRCONC(xmiddle,'" solution vector {\it x(n)}: ") + xList := + "append"/[fg(i) for i in 1..n] where fg(i) == + xnam := INTERN STRCONC ('"x",STRINGIMAGE i) + [['text,'"\newline\tab{2}"],['bcStrings,[8, '"0.0", xnam, 'F]]] + xList := [['text,:xmiddle],:xList] + equationPart := [ + '(domainConditions + (isDomain EM $EmptyMode) + (isDomain F (Float))), + :funcList,:cList,:xList] + page := htInitPage('"Minimization of a Multivariate Function using AXIOM/NAG Expert System", nil) + htSay '"\menuitemstyle{}\tab{2} " + htSay '"Enter the objective function, {\it F(x)} in terms of X[1]...X[n]: " + htSay '"\newline \tab{2} " + htMakePage equationPart + htMakeDoneButton('"Continue",'annaOptGen) + htpSetProperty(page,'constraints,constraints) + htpSetProperty(page,'cons,cons) + htpSetProperty(page,'n,n) + htShowPage() + +annaOptSolve1(n) == + + n = '2 => annaOptDefaultSolve1() + constraints := '"none" + cons := '0 + funcList := [['bcStrings,[48, "X[1]", 'f, 'EM]]] + xmiddle := ('"\blankline \menuitemstyle{}\tab{2} Enter initial guess of the") + xmiddle := STRCONC(xmiddle,'" solution vector {\it x(n)}: ") + xList := + "append"/[fg(i) for i in 1..n] where fg(i) == + xnam := INTERN STRCONC ('"x",STRINGIMAGE i) + [['text,'"\newline\tab{2}"],['bcStrings,[8, '"0.0", xnam, 'F]]] + xList := [['text,:xmiddle],:xList] + equationPart := [ + '(domainConditions + (isDomain EM $EmptyMode) + (isDomain F (Float))), + :funcList,:xList] + page := htInitPage('"Minimization of a Multivariate Function using AXIOM/NAG Expert System", nil) + htSay '"\menuitemstyle{}\tab{2} " + htSay '"Enter the objective function, {\it F(x)} in terms of X[1]...X[n]: " + htSay '"\newline \tab{2} " + htMakePage equationPart + htMakeDoneButton('"Continue",'annaOptGen) + htpSetProperty(page,'constraints,constraints) + htpSetProperty(page,'cons,cons) + htpSetProperty(page,'n,n) + htShowPage() + +annaOptDefaultSolve5() == + n := '7 + constraints := '"cf" + cons := '7 + page := htInitPage('"Minimization of a Multivariate Function using AXIOM/NAG Expert System", nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the objective function, {\it F(x)} in terms of X[1]...X[n]: ") + (text . "\newline \tab{2} ") + (bcStrings (51 "(X[1]-0.02)*X[1]+(X[2]-0.2)*X[2]+(X[3]-0.2)*X[3]+(X[4]+2*X[3]-0.2)*X[4]+(X[5]-0.2)*X[5]+(0.04-X[6])*X[6]+(0.04-2*X[6]-X[7])*X[7]" f EM)) + (text . "\blankline \menuitemstyle{}\tab{2} Enter lower and upper ") + (text . "boundary conditions {\it bl(n)} and {\it bu(n)}: ") + (text . "\newline \tab{5} Lower \tab{25} Constraint \tab{45} Upper ") + (text . "\newline \tab{2}") + (bcStrings (8 "-0.01" bl1 F)) + (text . "\tab{27} X1 \tab{42}") + (bcStrings (8 "0.01" bu1 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.1" bl2 F)) + (text . "\tab{27} X2 \tab{42}") + (bcStrings (8 "0.15" bu2 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.01" bl3 F)) + (text . "\tab{27} X3 \tab{42}") + (bcStrings (8 "0.03" bu3 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.04" bl4 F)) + (text . "\tab{27} X4 \tab{42}") + (bcStrings (8 "0.04" bu4 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.1" bl5 F)) + (text . "\tab{27} X5 \tab{42}") + (bcStrings (8 "0.05" bu5 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.01" bl6 F)) + (text . "\tab{27} X6 \tab{42}") + (bcStrings (8 "1.0E21" bu6 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.01" bl7 F)) + (text . "\tab{27} X7 \tab{42}") + (bcStrings (8 "1.0E21" bu7 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.13" bl8 F)) + (text . "\space{1}") + (bcStrings (26 "X[1]+X[2]+X[3]+X[4]+X[5]+X[6]+X[7]" c8 EM)) + (text . "\tab{42}") + (bcStrings (8 "-0.13" bu8 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-1.0E21" bl9 F)) + (text . "\space{1}") + (bcStrings (26 "0.15*X[1]+0.04*X[2]+0.02*X[3]+0.04*X[4]+0.02*X[5]+0.01*X[6]+0.03*X[7]" c9 EM)) + (text . "\tab{42}") + (bcStrings (8 "-0.0049" bu9 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-1.0E21" bl10 F)) + (text . "\space{1}") + (bcStrings (26 "0.03*X[1]+0.05*X[2]+0.08*X[3]+0.02*X[4]+0.06*X[5]+0.01*X[6]" c10 EM)) + (text . "\tab{42}") + (bcStrings (8 "-0.0064" bu10 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-1.0E21" bl11 F)) + (text . "\space{1}") + (bcStrings (26 "0.02*X[1]+0.04*X[2]+0.01*X[3]+0.02*X[4]+0.02*X[5]" c11 EM)) + (text . "\tab{42}") + (bcStrings (8 "-0.0037" bu11 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-1.0E21" bl12 F)) + (text . "\space{1}") + (bcStrings (26 "0.02*X[1]+0.03*X[2]+0.01*X[5]" c12 EM)) + (text . "\tab{42}") + (bcStrings (8 "-0.0012" bu12 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.0992" bl13 F)) + (text . "\space{1}") + (bcStrings (26 "0.7*X[1]+0.75*X[2]+0.8*X[3]+0.75*X[4]+0.8*X[5]+0.97*X[6]" c13 EM)) + (text . "\tab{42}") + (bcStrings (8 "1.0E21" bu13 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.003" bl14 F)) + (text . "\space{1}") + (bcStrings (26 "0.02*X[1]+0.06*X[2]+0.08*X[3]+0.12*X[4]+0.02*X[5]+0.01*X[6]+0.97*X[7]" c14 EM)) + (text . "\tab{42}") + (bcStrings (8 "0.002" bu14 F)) + (text . "\blankline \menuitemstyle{}\tab{2} Enter initial guess of the") + (text . " solution vector {\it x(n)}: \newline \tab{2} ") + (bcStrings (8 "-0.01" x1 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "-0.03" x2 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "0.0" x3 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "-0.01" x4 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "-0.1" x5 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "0.02" x6 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "0.01" x7 F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaOptGen) + htpSetProperty(page,'constraints,constraints) + htpSetProperty(page,'cons,cons) + htpSetProperty(page,'n,n) + htShowPage() + +annaOptDefaultSolve4() == + n := '7 + constraints := '"cf" + cons := '7 + page := htInitPage('"Minimization of a Multivariate Function using AXIOM/NAG Expert System", nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the objective function, {\it F(x)} in terms of X[1]...X[n]: ") + (text . "\newline \tab{2} ") + (bcStrings (51 "-0.2*(0.1*X[1]+X[2]+X[3]+X[4]+X[5]-0.2*(X[6]+X[7]))" f EM)) + (text . "\blankline \menuitemstyle{}\tab{2} Enter lower and upper ") + (text . "boundary conditions {\it bl(n)} and {\it bu(n)}: ") + (text . "\newline \tab{5} Lower \tab{25} Constraint \tab{45} Upper ") + (text . "\newline \tab{2}") + (bcStrings (8 "-0.01" bl1 F)) + (text . "\tab{27} X1 \tab{42}") + (bcStrings (8 "0.01" bu1 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.1" bl2 F)) + (text . "\tab{27} X2 \tab{42}") + (bcStrings (8 "0.15" bu2 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.01" bl3 F)) + (text . "\tab{27} X3 \tab{42}") + (bcStrings (8 "0.03" bu3 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.04" bl4 F)) + (text . "\tab{27} X4 \tab{42}") + (bcStrings (8 "0.04" bu4 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.1" bl5 F)) + (text . "\tab{27} X5 \tab{42}") + (bcStrings (8 "0.05" bu5 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.01" bl6 F)) + (text . "\tab{27} X6 \tab{42}") + (bcStrings (8 "1.0E21" bu6 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.01" bl7 F)) + (text . "\tab{27} X7 \tab{42}") + (bcStrings (8 "1.0E21" bu7 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.13" bl8 F)) + (text . "\space{1}") + (bcStrings (26 "X[1]+X[2]+X[3]+X[4]+X[5]+X[6]+X[7]" c8 EM)) + (text . "\tab{42}") + (bcStrings (8 "-0.13" bu8 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-1.0E21" bl9 F)) + (text . "\space{1}") + (bcStrings (26 "0.15*X[1]+0.04*X[2]+0.02*X[3]+0.04*X[4]+0.02*X[5]+0.01*X[6]+0.03*X[7]" c9 EM)) + (text . "\tab{42}") + (bcStrings (8 "-0.0049" bu9 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-1.0E21" bl10 F)) + (text . "\space{1}") + (bcStrings (26 "0.03*X[1]+0.05*X[2]+0.08*X[3]+0.02*X[4]+0.06*X[5]+0.01*X[6]" c10 EM)) + (text . "\tab{42}") + (bcStrings (8 "-0.0064" bu10 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-1.0E21" bl11 F)) + (text . "\space{1}") + (bcStrings (26 "0.02*X[1]+0.04*X[2]+0.01*X[3]+0.02*X[4]+0.02*X[5]" c11 EM)) + (text . "\tab{42}") + (bcStrings (8 "-0.0037" bu11 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-1.0E21" bl12 F)) + (text . "\space{1}") + (bcStrings (26 "0.02*X[1]+0.03*X[2]+0.01*X[5]" c12 EM)) + (text . "\tab{42}") + (bcStrings (8 "-0.0012" bu12 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.0992" bl13 F)) + (text . "\space{1}") + (bcStrings (26 "0.7*X[1]+0.75*X[2]+0.8*X[3]+0.75*X[4]+0.8*X[5]+0.97*X[6]" c13 EM)) + (text . "\tab{42}") + (bcStrings (8 "1.0E21" bu13 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-0.003" bl14 F)) + (text . "\space{1}") + (bcStrings (26 "0.02*X[1]+0.06*X[2]+0.08*X[3]+0.12*X[4]+0.02*X[5]+0.01*X[6]+0.97*X[7]" c14 EM)) + (text . "\tab{42}") + (bcStrings (8 "0.002" bu14 F)) + (text . "\blankline \menuitemstyle{}\tab{2} Enter initial guess of the") + (text . " solution vector {\it x(n)}: \newline \tab{2} ") + (bcStrings (8 "-0.01" x1 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "-0.03" x2 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "0.0" x3 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "-0.01" x4 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "-0.1" x5 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "0.02" x6 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "0.01" x7 F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaOptGen) + htpSetProperty(page,'constraints,constraints) + htpSetProperty(page,'cons,cons) + htpSetProperty(page,'n,n) + htShowPage() + +annaOptDefaultSolve3() == + n := '4 + constraints := '"cf" + cons := '3 + page := htInitPage('"Minimization of a Multivariate Function using AXIOM/NAG Expert System", nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the objective function, {\it F(x)} in terms of X[1]...X[n]: ") + (text . "\newline \tab{2} ") + (bcStrings (48 "X[1]*X[4]*(X[1]+X[2]+X[3])+X[3]" f EM)) + (text . "\blankline \menuitemstyle{}\tab{2} Enter lower and upper ") + (text . "boundary conditions {\it bl(n)} and {\it bu(n)}: ") + (text . "\newline \tab{5} Lower \tab{25} Constraint \tab{45} Upper ") + (text . "\newline \tab{2}") + (bcStrings (8 "1.0" bl1 F)) + (text . "\tab{27} X1 \tab{42}") + (bcStrings (8 "5.0" bu1 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "1.0" bl2 F)) + (text . "\tab{27} X2 \tab{42}") + (bcStrings (8 "5.0" bu2 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "1.0" bl3 F)) + (text . "\tab{27} X3 \tab{42}") + (bcStrings (8 "5.0" bu3 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "1.0" bl4 F)) + (text . "\tab{27} X4 \tab{42}") + (bcStrings (8 "5.0" bu4 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-1.E25" bl5 F)) + (text . "\space{1}") + (bcStrings (26 "X[1]+X[2]+X[3]+X[4]" c5 EM)) + (text . "\tab{42}") + (bcStrings (8 "20.0" bu5 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-1.E25" bl6 F)) + (text . "\space{1}") + (bcStrings (26 "X[1]**2+X[2]**2+X[3]**2+X[4]**2" c6 EM)) + (text . "\tab{42}") + (bcStrings (8 "40.0" bu6 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "25.0" bl7 F)) + (text . "\space{1}") + (bcStrings (26 "X[1]*X[2]*X[3]*X[4]" c7 EM)) + (text . "\tab{42}") + (bcStrings (8 "1.E25" bu7 F)) + (text . "\blankline \menuitemstyle{}\tab{2} Enter initial guess of the") + (text . " solution vector {\it x(n)}: \newline \tab{2} ") + (bcStrings (8 "1.0" x1 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "5.0" x2 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "5.0" x3 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "1.0" x4 F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaOptGen) + htpSetProperty(page,'constraints,constraints) + htpSetProperty(page,'cons,cons) + htpSetProperty(page,'n,n) + htShowPage() + +annaOptDefaultSolve2() == + n := '4 + constraints := '"cf" + cons := '0 + page := htInitPage('"Minimization of a Multivariate Function using AXIOM/NAG Expert System", nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{}\tab{2} ") + (text . "Enter the objective function, {\it F(x)} in terms of X[1]...X[n]: ") + (text . "\newline \tab{2} ") + (bcStrings (70 "(X[1]+10*X[2])**2+5*(X[3]-X[4])**2+(X[2]-2*X[3])**4+10*(X[1]-X[4])**4" f EM)) + (text . "\blankline \menuitemstyle{}\tab{2} Enter lower and upper ") + (text . "boundary conditions {\it bl(n)} and {\it bu(n)}: ") + (text . "\newline \tab{5} Lower \tab{25} Constraint \tab{45} Upper ") + (text . "\newline \tab{2}") + (bcStrings (8 "1" bl1 F)) + (text . "\tab{27} X1 \tab{42}") + (bcStrings (8 "3" bu1 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-2" bl2 F)) + (text . "\tab{27} X2 \tab{42}") + (bcStrings (8 "0" bu2 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "-1.0E-6" bl3 F)) + (text . "\tab{27} X3 \tab{42}") + (bcStrings (8 "1.0E6" bu3 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "1" bl4 F)) + (text . "\tab{27} X4 \tab{42}") + (bcStrings (8 "3" bu4 F)) + (text . "\blankline \menuitemstyle{}\tab{2} Enter initial guess of the") + (text . " solution vector {\it x(n)}: \newline \tab{2} ") + (bcStrings (8 "3" x1 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "-1" x2 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "0" x3 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "1" x4 F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaOptGen) + htpSetProperty(page,'constraints,constraints) + htpSetProperty(page,'cons,cons) + htpSetProperty(page,'n,n) + htShowPage() + +annaOptDefaultSolve1() == + + n := '2 + constraints := '"none" + cons := '0 + page := htInitPage('"Minimization of a Multivariate Function using AXIOM/NAG Expert System", nil) + htMakePage '( + (domainConditions + (isDomain F (Float)) + (isDomain EM $EmptyMode)) + (text . "\menuitemstyle{} \tab{2} Enter the objective function,") + (text . " {\it F(x)} in terms of X[1]...X[n]: \newline \tab{2} ") + (bcStrings (52 "exp(X[1])*(4*X[1]**2+2*X[2]**2+4*X[1]*X[2]+2*X[2]+1)" f EM)) + (text . "\blankline \menuitemstyle{} \tab{2} Enter initial guess of the ") + (text . "solution vector {\it x(n)}: \newline\tab{2}") + (bcStrings (8 "-1.0" x1 F)) + (text . "\newline\tab{2}") + (bcStrings (8 "1.0" x2 F)) + (text . "\blankline")) + htMakeDoneButton('"Continue",'annaOptGen) + htpSetProperty(page,'constraints,constraints) + htpSetProperty(page,'cons,cons) + htpSetProperty(page,'n,n) + htShowPage() + +annaOptGen htPage == + n := htpProperty(htPage,'n) + cons := htpProperty(htPage,'cons) + constraints := htpProperty(htPage,'constraints) + alist := htpInputAreaAlist htPage + y := alist + for i in 1..n repeat + init := STRCONC((first y).1,'"") + initList := [init,:initList] + y := rest y + initString := bcwords2liststring initList + if constraints = '"cf" then + for i in 1..cons repeat + upper := STRCONC((first y).1,'"") + uList := [upper,:uList] + y := rest y + con := STRCONC((first y).1," ") + cList := [con,:cList] + y := rest y + lower := STRCONC((first y).1,'"") + lList := [lower,:lList] + y := rest y + for i in 1..n repeat + upper := STRCONC((first y).1,'"") + uList := [upper,:uList] + y := rest y + lower := STRCONC((first y).1,'"") + lList := [lower,:lList] + y := rest y + uString := bcwords2liststring uList + cString := bcwords2liststring cList + lString := bcwords2liststring lList + f := STRCONC((first y).1,'"") + prefix := STRCONC('"optimize(",f,", ") + if constraints = '"none" then + midfix := initString + else + if cons = '0 then + midfix := STRCONC(initString,", ",lString,", ",uString) + else + midfix := STRCONC(initString,", ",lString,", ",cString,", ",uString) + suffix := STRCONC(prefix, midfix,")") + annaGen suffix + +annaOpt2() == + htInitPage('"Minimization of a Sum of Squares using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain PI (PositiveInteger))) + (text . "Analyses the functions for various attributes, chooses and ") + (text . "then uses a suitable optimization routine for finding the ") + (text . "minimum of a sum of squares of {\it m} nonlinear functions in ") + (text . "{\it n} variables ({\it m} \htbitmap{great=} {\it n}), i.e., it ") + (text . "is applicable to problems of the form ") + (text . "\center{\htbitmap{e04fdf}} where \center{\htbitmap{e04fdf1}}") + (text . "The routines are intended for ") + (text . "functions which have continous first and second derivatives, ") + (text . "though they will usually work if the derivatives have occasional ") + (text . "discontinuities. ") + (text . "\blankline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Number of functions {\it \htbitmap{fi}(x)}, {\it m}:") + (text . "\newline\tab{2} ") + (bcStrings (5 15 m PI)) + (text . "\blankline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Number of variables \htbitmap{xj}, {\it n}:") + (text . "\newline\tab{2} ") + (bcStrings (5 3 n PI)) + (text . "\blankline ") + (text . "\newline \menuitemstyle{} \tab{2} Do you wish for a check for ") + (text . "goodness of fit of the least squares model?") + (radioButtons goodness + (" " " No" nogood) + (" " " Yes" good)) + (text . "\blankline ")) + htMakeDoneButton('"Continue", 'annaOpt2Solve) + htShowPage() + +annaOpt2Solve htPage == + g := htpButtonValue(htPage,'goodness) + goodness := + g = 'nogood => '"nogood" + '"good" + n := + $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'n) + objValUnwrap htpLabelSpadValue(htPage, 'n) + m := + $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage, 'm) + objValUnwrap htpLabelSpadValue(htPage, 'm) + m = '15 and n = '3 and goodness = '"nogood" => annaOpt2DefaultSolve() + m = '15 and n = '3 => annaOpt2DefaultSolve2() + fList := + "append"/[f(i) for i in 1..m] where f(i) == + lineEnd := ('"\newline\tab{2}") + fnam := INTERN STRCONC ('"f",STRINGIMAGE i) + [['text,:lineEnd], ['bcStrings,[42, '"X[1]", fnam, 'EM]]] + xmiddle := ('"\blankline \menuitemstyle{}\tab{2} Enter initial guess of the") + xmiddle := STRCONC(xmiddle,'" solution vector {\it x(n)}: ") + xList := + "append"/[fg(i) for i in 1..n] where fg(i) == + xnam := INTERN STRCONC ('"x",STRINGIMAGE i) + [['text,'"\newline\tab{2}"],['bcStrings,[8, '"0.0", xnam, 'F]]] + xList := [['text,:xmiddle],:xList] + equationPart := [ + '(domainConditions + (isDomain EM $EmptyMode) + (isDomain F (Float))), + :fList,:xList] + page := htInitPage('"Minimization of a Sum of Squares using AXIOM/NAG Expert System",nil) + htSay '"\menuitemstyle{}\tab{2} " + htSay '"Enter the objective functions, {\it F(x)} in terms of X[1]...X[n]: " + htSay '"\newline \tab{2} " + htMakePage equationPart + htMakeDoneButton('"Continue",'annaOpt2Gen) + htpSetProperty(page,'n,n) + htpSetProperty(page,'m,m) + htpSetProperty(page,'goodness,goodness) + htShowPage() + +annaOpt2DefaultSolve() == + goodness := '"nogood" + n := '3 + m := '15 + page := htInitPage('"Minimization of a Sum of Squares using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain F (Float)) + (isDomain I (Integer))) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the functions \htbitmap{fi} below ") + (text . "in terms of X[1]...X[n]: ") + (text . "\newline ") + (text . "\newline {\em Function 1:} \space{1}") + (bcStrings (42 "(X[3]+15*X[2])**(-1)+X[1]-0.14" f1 EM)) + (text . "\newline {\em Function 2:} \space{1}") + (bcStrings (42 "2*(2*X[3]+14*X[2])**(-1)+X[1]-0.18" f2 EM)) + (text . "\newline {\em Function 3:} \space{1}") + (bcStrings (42 "3*(3*X[3]+13*X[2])**(-1)+X[1]-0.22" f3 EM)) + (text . "\newline {\em Function 4:} \space{1}") + (bcStrings (42 "4*(4*X[3]+12*X[2])**(-1)+X[1]-0.25" f4 EM)) + (text . "\newline {\em Function 5:} \space{1}") + (bcStrings (42 "5*(5*X[3]+11*X[2])**(-1)+X[1]-0.29" f5 EM)) + (text . "\newline {\em Function 6:} \space{1}") + (bcStrings (42 "6*(6*X[3]+10*X[2])**(-1)+X[1]-0.32" f6 EM)) + (text . "\newline {\em Function 7:} \space{1}") + (bcStrings (42 "7*(7*X[3]+9*X[2])**(-1)+X[1]-0.35" f7 EM)) + (text . "\newline {\em Function 8:} \space{1}") + (bcStrings (42 "8*(8*X[3]+8*X[2])**(-1)+X[1]-0.39" f8 EM)) + (text . "\newline {\em Function 9:} \space{1}") + (bcStrings (42 "9*(7*X[3]+7*X[2])**(-1)+X[1]-0.37" f9 EM)) + (text . "\newline {\em Function 10:} \space{1}") + (bcStrings (42 "10*(6*X[3]+6*X[2])**(-1)+X[1]-0.58" f10 EM)) + (text . "\newline {\em Function 11:} \space{1}") + (bcStrings (42 "11*(5*X[3]+5*X[2])**(-1)+X[1]-0.73" f11 EM)) + (text . "\newline {\em Function 12:} \space{1}") + (bcStrings (42 "12*(4*X[3]+4*X[2])**(-1)+X[1]-0.96" f12 EM)) + (text . "\newline {\em Function 13:} \space{1}") + (bcStrings (42 "13*(3*X[3]+3*X[2])**(-1)+X[1]-1.34" f13 EM)) + (text . "\newline {\em Function 14:} \space{1}") + (bcStrings (42 "14*(2*X[3]+2*X[2])**(-1)+X[1]-2.1" f14 EM)) + (text . "\newline {\em Function 15:} \space{1}") + (bcStrings (42 "15*(X[3]+X[2])**(-1)+X[1]-4.39" f15 EM)) + (text . "\blankline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter initial guess of the solution vector {\it x(n)}: \newline \tab{2}") + (bcStrings (8 "0.5" x1 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "1.0" x2 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "1.5" x3 F))) + htMakeDoneButton('"Continue",'annaOpt2Gen) + htpSetProperty(page,'n,n) + htpSetProperty(page,'m,m) + htpSetProperty(page,'goodness,goodness) + htShowPage() + +annaOpt2DefaultSolve2() == + goodness := '"good" + n := '3 + m := '15 + page := htInitPage('"Minimization of a Sum of Squares using AXIOM/NAG Expert System",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain F (Float)) + (isDomain I (Integer))) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the functions \htbitmap{fi} below ") + (text . "in terms of X[1]...X[n]: ") + (text . "\newline ") + (text . "\newline {\em Function 1:} \space{1}") + (bcStrings (42 "(X[3]+15*X[2])**(-1)+X[1]-0.14" f1 EM)) + (text . "\newline {\em Function 2:} \space{1}") + (bcStrings (42 "2*(2*X[3]+14*X[2])**(-1)+X[1]-0.18" f2 EM)) + (text . "\newline {\em Function 3:} \space{1}") + (bcStrings (42 "3*(3*X[3]+13*X[2])**(-1)+X[1]-0.22" f3 EM)) + (text . "\newline {\em Function 4:} \space{1}") + (bcStrings (42 "4*(4*X[3]+12*X[2])**(-1)+X[1]-0.25" f4 EM)) + (text . "\newline {\em Function 5:} \space{1}") + (bcStrings (42 "5*(5*X[3]+11*X[2])**(-1)+X[1]-0.29" f5 EM)) + (text . "\newline {\em Function 6:} \space{1}") + (bcStrings (42 "6*(6*X[3]+10*X[2])**(-1)+X[1]-0.32" f6 EM)) + (text . "\newline {\em Function 7:} \space{1}") + (bcStrings (42 "7*(7*X[3]+9*X[2])**(-1)+X[1]-0.35" f7 EM)) + (text . "\newline {\em Function 8:} \space{1}") + (bcStrings (42 "8*(8*X[3]+8*X[2])**(-1)+X[1]-0.39" f8 EM)) + (text . "\newline {\em Function 9:} \space{1}") + (bcStrings (42 "9*(7*X[3]+7*X[2])**(-1)+X[1]-0.37" f9 EM)) + (text . "\newline {\em Function 10:} \space{1}") + (bcStrings (42 "10*(6*X[3]+6*X[2])**(-1)+X[1]-0.58" f10 EM)) + (text . "\newline {\em Function 11:} \space{1}") + (bcStrings (42 "11*(5*X[3]+5*X[2])**(-1)+X[1]-0.73" f11 EM)) + (text . "\newline {\em Function 12:} \space{1}") + (bcStrings (42 "12*(4*X[3]+4*X[2])**(-1)+X[1]-0.96" f12 EM)) + (text . "\newline {\em Function 13:} \space{1}") + (bcStrings (42 "13*(3*X[3]+3*X[2])**(-1)+X[1]-1.34" f13 EM)) + (text . "\newline {\em Function 14:} \space{1}") + (bcStrings (42 "14*(2*X[3]+2*X[2])**(-1)+X[1]-2.1" f14 EM)) + (text . "\newline {\em Function 15:} \space{1}") + (bcStrings (42 "15*(X[3]+X[2])**(-1)+X[1]-4.39" f15 EM)) + (text . "\blankline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter initial guess of the solution vector {\it x(n)}: \newline \tab{2}") + (bcStrings (8 "0.5" x1 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "1.0" x2 F)) + (text . "\newline \tab{2}") + (bcStrings (8 "1.5" x3 F))) + htMakeDoneButton('"Continue",'annaOpt2Gen) + htpSetProperty(page,'n,n) + htpSetProperty(page,'m,m) + htpSetProperty(page,'goodness,goodness) + htShowPage() + +annaOpt2Gen htPage == + + goodness := htpProperty(htPage,'goodness) + n := htpProperty(htPage,'n) + m := htpProperty(htPage,'m) + alist := htpInputAreaAlist htPage + y := alist + for i in 1..n repeat + init := STRCONC((first y).1,'"") + initList := [init,:initList] + y := rest y + initString := bcwords2liststring initList + for i in 1..m repeat + f := STRCONC((first y).1," ") + fList := [f,:fList] + y := rest y + fString := bcwords2liststring fList + prefix := + goodness = '"good" => '"goodnessOfFit( " + '"optimize( " + midfix := STRCONC(fString,", ",initString) + suffix := STRCONC(prefix, midfix,")") + annaGen suffix +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/apply.boot.pamphlet b/src/interp/apply.boot.pamphlet new file mode 100644 index 00000000..a859aa3d --- /dev/null +++ b/src/interp/apply.boot.pamphlet @@ -0,0 +1,276 @@ +\documentclass{article} +\usepackage{axiom} + +\title{\File{src/interp/apply.boot} Papmhlet} +\author{The Axiom Team} + +\begin{document} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject + +\section{License} + +<>= +-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are +-- met: +-- +-- - Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- +-- - Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in +-- the documentation and/or other materials provided with the +-- distribution. +-- +-- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- names of its contributors may be used to endorse or promote products +-- derived from this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +-- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + +)package "BOOT" + +oldCompilerAutoloadOnceTrigger() == nil + +compAtomWithModemap(x,m,e,v) == + Tl := + [[transImplementation(x,map,fn),target,e] + for map in v | map is [[.,target],[.,fn]]] => + --accept only monadic operators + T:= or/[t for (t:= [.,target,.]) in Tl | modeEqual(m,target)] => T + 1=#(Tl:= [y for t in Tl | (y:= convert(t,m))]) => first Tl + 0<#Tl and m=$NoValueMode => first Tl + nil + +transImplementation(op,map,fn) == +--+ + fn := genDeltaEntry [op,:map] + fn is ["XLAM",:.] => [fn] + ["call",fn] + +compApply(sig,varl,body,argl,m,e) == + argTl:= [[.,.,e]:= comp(x,$EmptyMode,e) for x in argl] + contour:= + [Pair(x,[["mode",m'],["value",removeEnv comp(a,m',e)]]) + for x in varl for m' in sig.source for a in argl] + code:= [["LAMBDA",varl,body'],:[T.expr for T in argTl]] + m':= resolve(m,sig.target) + body':= (comp(body,m',addContour(contour,e))).expr + [code,m',e] + +compToApply(op,argl,m,e) == + T:= compNoStacking(op,$EmptyMode,e) or return nil + m1:= T.mode + T.expr is ["QUOTE", =m1] => nil + compApplication(op,argl,m,T.env,T) + +compApplication(op,argl,m,e,T) == + T.mode is ['Mapping, retm, :argml] => + #argl ^= #argml => nil + retm := resolve(m, retm) + retm = $Category or isCategoryForm(retm,e) => nil -- not handled + argTl := [[.,.,e] := comp(x,m,e) or return "failed" + for x in argl for m in argml] + argTl = "failed" => nil + form:= + not (member(op,$formalArgList) or member(T.expr,$formalArgList)) and ATOM T.expr => + nprefix := $prefix or + -- following needed for referencing local funs at capsule level + getAbbreviation($op,#rest $form) + [op',:[a.expr for a in argTl],"$"] where + op':= INTERN STRCONC(encodeItem nprefix,";",encodeItem T.expr) + ['call, ['applyFun, T.expr], :[a.expr for a in argTl]] + coerce([form, retm, e],resolve(retm,m)) + op = 'elt => nil + eltForm := ['elt, op, :argl] + comp(eltForm, m, e) + +compFormWithModemap(form is [op,:argl],m,e,modemap) == + [map:= [.,target,:.],[pred,impl]]:= modemap + -- this fails if the subsuming modemap is conditional + --impl is ['Subsumed,:.] => nil + if isCategoryForm(target,e) and isFunctor op then + [modemap,e]:= substituteIntoFunctorModemap(argl,modemap,e) or return nil + [map:= [.,target,:.],:cexpr]:= modemap + sv:=listOfSharpVars map + if sv then + -- SAY [ "compiling ", op, " in compFormWithModemap, + -- mode= ",map," sharp vars=",sv] + for x in argl for ss in $FormalMapVariableList repeat + if ss in sv then + [map:= [.,target,:.],:cexpr]:= modemap :=SUBST(x,ss,modemap) + -- SAY ["new map is",map] + not (target':= coerceable(target,m,e)) => nil + map:= [target',:rest map] + [f,Tl,sl]:= compApplyModemap(form,modemap,e,nil) or return nil + + --generate code; return + T:= + [x',m',e'] where + m':= SUBLIS(sl,map.(1)) + x':= + form':= [f,:[t.expr for t in Tl]] + m'=$Category or isCategoryForm(m',e) => form' + -- try to deal with new-style Unions where we know the conditions + op = "elt" and f is ['XLAM,:.] and IDENTP(z:=CAR argl) and + (c:=get(z,'condition,e)) and + c is [['case,=z,c1]] and + (c1 is ['_:,=(CADR argl),=m] or EQ(c1,CADR argl) ) => +-- first is a full tag, as placed by getInverseEnvironment +-- second is what getSuccessEnvironment will place there + ["CDR",z] + ["call",:form'] + e':= + Tl => (LAST Tl).env + e + convert(T,m) + +-- This version tends to give problems with #1 and categories +-- applyMapping([op,:argl],m,e,ml) == +-- #argl^=#ml-1 => nil +-- mappingHasCategoryTarget := +-- isCategoryForm(first ml,e) => --is op a functor? +-- form:= [op,:argl'] +-- pairlis:= [[v,:a] for a in argl for v in $FormalMapVariableList] +-- ml:= SUBLIS(pairlis,ml) +-- true +-- false +-- argl':= +-- [T.expr for x in argl for m' in rest ml] where +-- T() == [.,.,e]:= comp(x,m',e) or return "failed" +-- if argl'="failed" then return nil +-- mappingHasCategoryTarget => convert([form,first ml,e],m) +-- form:= +-- not member(op,$formalArgList) and ATOM op => +-- [op',:argl',"$"] where +-- op':= INTERN STRCONC(STRINGIMAGE $prefix,";",STRINGIMAGE op) +-- ["call",["applyFun",op],:argl'] +-- pairlis:= [[v,:a] for a in argl' for v in $FormalMapVariableList] +-- convert([form,SUBLIS(pairlis,first ml),e],m) + +applyMapping([op,:argl],m,e,ml) == + #argl^=#ml-1 => nil + isCategoryForm(first ml,e) => + --is op a functor? + pairlis:= [[v,:a] for a in argl for v in $FormalMapVariableList] + ml' := SUBLIS(pairlis, ml) + argl':= + [T.expr for x in argl for m' in rest ml'] where + T() == [.,.,e]:= comp(x,m',e) or return "failed" + if argl'="failed" then return nil + form:= [op,:argl'] + convert([form,first ml',e],m) + argl':= + [T.expr for x in argl for m' in rest ml] where + T() == [.,.,e]:= comp(x,m',e) or return "failed" + if argl'="failed" then return nil + form:= + not member(op,$formalArgList) and ATOM op and not get(op,'value,e) => + nprefix := $prefix or + -- following needed for referencing local funs at capsule level + getAbbreviation($op,#rest $form) + [op',:argl',"$"] where + op':= INTERN STRCONC(encodeItem nprefix,";",encodeItem op) + ['call,['applyFun,op],:argl'] + pairlis:= [[v,:a] for a in argl' for v in $FormalMapVariableList] + convert([form,SUBLIS(pairlis,first ml),e],m) + +--% APPLY MODEMAPS + +compApplyModemap(form,modemap,$e,sl) == + [op,:argl] := form --form to be compiled + [[mc,mr,:margl],:fnsel] := modemap --modemap we are testing + + -- $e is the current environment + -- sl substitution list, nil means bottom-up, otherwise top-down + + -- 0. fail immediately if #argl=#margl + + if #argl^=#margl then return nil + + -- 1. use modemap to evaluate arguments, returning failed if + -- not possible + + lt:= + [[.,m',$e]:= + comp(y,g,$e) or return "failed" where + g:= SUBLIS(sl,m) where + sl:= pmatchWithSl(m',m,sl) for y in argl for m in margl] + lt="failed" => return nil + + -- 2. coerce each argument to final domain, returning failed + -- if not possible + + lt':= [coerce(y,d) or return "failed" + for y in lt for d in SUBLIS(sl,margl)] + lt'="failed" => return nil + + -- 3. obtain domain-specific function, if possible, and return + + --$bindings is bound by compMapCond + [f,$bindings]:= compMapCond(op,mc,sl,fnsel) or return nil + +--+ can no longer trust what the modemap says for a reference into +--+ an exterior domain (it is calculating the displacement based on view +--+ information which is no longer valid; thus ignore this index and +--+ store the signature instead. + +--$NRTflag=true and f is [op1,d,.] and NE(d,'$) and member(op1,'(ELT CONST)) => + f is [op1,d,.] and member(op1,'(ELT CONST Subsumed)) => + [genDeltaEntry [op,:modemap],lt',$bindings] + [f,lt',$bindings] + +compMapCond(op,mc,$bindings,fnsel) == + or/[compMapCond'(u,op,mc,$bindings) for u in fnsel] + +compMapCond'([cexpr,fnexpr],op,dc,bindings) == + compMapCond''(cexpr,dc) => compMapCondFun(fnexpr,op,dc,bindings) + stackMessage ["not known that",'%b,dc,'%d,"has",'%b,cexpr,'%d] + +compMapCond''(cexpr,dc) == + cexpr=true => true + --cexpr = "true" => true + cexpr is ["AND",:l] => and/[compMapCond''(u,dc) for u in l] + cexpr is ["OR",:l] => or/[compMapCond''(u,dc) for u in l] + cexpr is ["not",u] => not compMapCond''(u,dc) + cexpr is ["has",name,cat] => (knownInfo cexpr => true; false) + --for the time being we'll stop here - shouldn't happen so far + --$disregardConditionIfTrue => true + --stackSemanticError(("not known that",'%b,name, + -- '%d,"has",'%b,cat,'%d),nil) + --now it must be an attribute + member(["ATTRIBUTE",dc,cexpr],get("$Information","special",$e)) => true + --for the time being we'll stop here - shouldn't happen so far + stackMessage ["not known that",'%b,dc,'%d,"has",'%b,cexpr,'%d] + false + +compMapCondFun(fnexpr,op,dc,bindings) == [fnexpr,bindings] + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/as.boot.pamphlet b/src/interp/as.boot.pamphlet new file mode 100644 index 00000000..fd848ab2 --- /dev/null +++ b/src/interp/as.boot.pamphlet @@ -0,0 +1,1223 @@ +\documentclass{article} +\usepackage{axiom} + +\title{\File{src/interp/as.boot} Pamphlet} +\author{The Axiom Team} + +\begin{document} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject + +\section{New Aldor compiler changes} + +This mod is used to make the open source version of Axiom work +with the new aldor compiler. +Aldor does not want the [[attributeAlist]]. +This used to read: +\begin{verbatim} + HPUT($opHash,con,[ancestorAlist,attributeAlist,:opalist]) +\end{verbatim} +but was changed to: +<>= + HPUT($opHash,con,[ancestorAlist,nil,:opalist]) +@ + +\section{License} + +<>= +-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are +-- met: +-- +-- - Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- +-- - Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in +-- the documentation and/or other materials provided with the +-- distribution. +-- +-- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- names of its contributors may be used to endorse or promote products +-- derived from this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +-- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + +--global hash tables for new compiler +$docHash := MAKE_-HASH_-TABLE() +$conHash := MAKE_-HASH_-TABLE() +$opHash := MAKE_-HASH_-TABLE() +$asyPrint := false + +asList() == + OBEY '"rm -f temp.text" + OBEY '"ls as/*.asy > temp.text" + instream := OPEN '"temp.text" + lines := [READLINE instream while not EOFP instream] + CLOSE instream + lines + +asAll lines == + for x in lines repeat + sayBrightly ['"-----> ",x] + asTran x + 'done + +as name == + astran STRCONC(STRINGIMAGE name,'".asy") +-- astran STRCONC(getEnv('"AXIOM"), +-- '"/../../obj/rios/as/",STRINGIMAGE name,'".asy") + 'done + +astran asyFile == +--global hash tables for new compiler + $docHash := MAKE_-HASH_-TABLE() + $conHash := MAKE_-HASH_-TABLE() + $constantHash := MAKE_-HASH_-TABLE() + $niladics : local := nil + $asyFile: local := asyFile + $asFilename: local := STRCONC(PATHNAME_-NAME asyFile,'".as") + asytran asyFile + conlist := [x for x in HKEYS $conHash | HGET($conHash,x) isnt [.,.,"function",:.]] + $mmAlist : local := + [[con,:asyConstructorModemap con] for con in conlist] + $docAlist : local := + [[con,:REMDUP asyDocumentation con] for con in conlist] + $parentsHash : local := MAKE_-HASH_-TABLE() +--$childrenHash: local := MAKE_-HASH_-TABLE() + for con in conlist repeat + parents := asyParents con + HPUT($parentsHash,con,asyParents con) +-- for [parent,:pred] in parents repeat +-- parentOp := opOf parent +-- HPUT($childrenHash,parentOp,insert([con,:pred],HGET($childrenHash,parentOp))) + $newConlist := union(conlist, $newConlist) + [[x,:asMakeAlist x] for x in HKEYS $conHash] + +asyParents(conform) == + acc := nil + con:= opOf conform +--formals := TAKE(#formalParams,$TriangleVariableList) + modemap := LASSOC(con,$mmAlist) + $constructorCategory :local := asySubstMapping CADAR modemap + for x in folks $constructorCategory repeat +-- x := SUBLISLIS(formalParams,formals,x) +-- x := SUBLISLIS(IFCDR conform,formalParams,x) +-- x := SUBST('Type,'Object,x) + acc := [:explodeIfs x,:acc] + NREVERSE acc + +asySubstMapping u == + u is [op,:r] => + op = "->" => + [s, t] := r + args := + s is [op,:u] and asyComma? op => [asySubstMapping y for y in u] + [asySubstMapping s] + ['Mapping, asySubstMapping t, :args] + [asySubstMapping x for x in u] + u + +--asyFilePackage asyFile == +-- name := INTERN PATHNAME_-NAME asyFile +-- modemap := +-- [[[name],['CATEGORY,'domain, +-- :[asyMkSignature(con,CDAR mm) for [con,:mm] in $mmAlist]]],['T,name]] +-- opAlist := [[con,[CDAR mm]] for [con,:mm] in $mmAlist] +-- documentation := +-- [[con,[CDAR mm,fn LASSOC(con,$docAlist)]] for [con,:mm] in $mmAlist] +-- where fn u == +-- LASSOC('constructor,u) is [[=nil,doc]] => doc +-- '"" +-- res := [['constructorForm,name],['constant,:'true], +-- ['constructorKind,:'file], +-- ['constructorModemap,:modemap], +-- ['sourceFile,:PNAME name], +-- ['operationAlist,:zeroOneConversion opAlist], +-- ['documentation,:documentation]] +--asyDisplay(name,res) +-- [name,:res] + +asyMkSignature(con,sig) == +-- atom sig => ['TYPE,con,sig] +-- following line converts constants into nullary functions + atom sig => ['SIGNATURE,con,[sig]] + ['SIGNATURE,con,sig] + +asMakeAlist con == + record := HGET($conHash,con) + [form,sig,predlist,kind,exposure,comments,typeCode,:filename] := first record +--TTT in case we put the wrong thing in for niladic catgrs +--if ATOM(form) and kind='category then form:=[form] + if ATOM(form) then form:=[form] + kind = 'function => asMakeAlistForFunction con + abb := asyAbbreviation(con,#(KDR sig)) + if null KDR form then PUT(opOf form,'NILADIC,'T) + modemap := asySubstMapping LASSOC(con,$mmAlist) + $constructorCategory :local := CADAR modemap + parents := mySort HGET($parentsHash,con) +--children:= mySort HGET($childrenHash,con) + alists := HGET($opHash,con) + opAlist := SUBLISLIS($FormalMapVariableList,KDR form,CDDR alists) + ancestorAlist:= SUBLISLIS($FormalMapVariableList,KDR form,CAR alists) + catAttrs := [[x,:true] for x in getAttributesFromCATEGORY $constructorCategory] + attributeAlist := REMDUP [:CADR alists,:catAttrs] + documentation := + SUBLISLIS($FormalMapVariableList,KDR form,LASSOC(con,$docAlist)) + filestring := STRCONC(PATHNAME_-NAME STRINGIMAGE filename,'".as") + constantPart := HGET($constantHash,con) and [['constant,:true]] + niladicPart := MEMQ(con,$niladics) and [['NILADIC,:true]] + falist := TAKE(#KDR form,$FormalMapVariableList) + constructorCategory := + kind = 'category => + talist := TAKE(#KDR form, $TriangleVariableList) + SUBLISLIS(talist, falist, $constructorCategory) + SUBLISLIS(falist,KDR form,$constructorCategory) + if constructorCategory='Category then kind := 'category + exportAlist := asGetExports(kind, form, constructorCategory) + constructorModemap := SUBLISLIS(falist,KDR form,modemap) +--TTT fix a niladic category constructormodemap (remove the joins) + if kind = 'category then + SETF(CADAR(constructorModemap),['Category]) + res := [['constructorForm,:form],:constantPart,:niladicPart, + ['constructorKind,:kind], + ['constructorModemap,:constructorModemap], + ['abbreviation,:abb], + ['constructorCategory,:constructorCategory], + ['parents,:parents], + ['attributes,:attributeAlist], + ['ancestors,:ancestorAlist], + -- ['children,:children], + ['sourceFile,:filestring], + ['operationAlist,:zeroOneConversion opAlist], + ['modemaps,:asGetModemaps(exportAlist,form,kind,modemap)], + ['sourcefile,:$asFilename], + ['typeCode,:typeCode], + ['documentation,:documentation]] + if $asyPrint then asyDisplay(con,res) + res + +asGetExports(kind, conform, catform) == + u := asCategoryParts(kind, conform, catform, true) or return nil + -- ensure that signatures are lists + [[op, sigpred] for [op,sig,:pred] in CDDR u] where + sigpred == + pred := + pred = "T" => nil + pred + [sig, nil, :pred] + +asMakeAlistForFunction fn == + record := HGET($conHash,fn) + [form,sig,predlist,kind,exposure,comments,typeCode,:filename] := first record + modemap := LASSOC(fn,$mmAlist) + newsig := asySignature(sig,nil) + opAlist := [[fn,[newsig,nil,:predlist]]] + res := [['modemaps,:asGetModemaps(opAlist,fn,'function,modemap)], + ['typeCode,:typeCode]] + if $asyPrint then asyDisplay(fn,res) + res + +getAttributesFromCATEGORY catform == + catform is ['CATEGORY,.,:r] => [y for x in r | x is ['ATTRIBUTE,y]] + catform is ['Join,:m,x] => getAttributesFromCATEGORY x + nil + +displayDatabase x == main where + main == + for y in + '(CONSTRUCTORFORM CONSTRUCTORKIND _ + CONSTRUCTORMODEMAP _ + ABBREVIATION _ + CONSTRUCTORCATEGORY _ + PARENTS _ + ATTRIBUTES _ + ANCESTORS _ + SOURCEFILE _ + OPERATIONALIST _ + MODEMAPS _ + SOURCEFILE _ + DOCUMENTATION) repeat fn(x,y) + fn(x,y) == + sayBrightly ['"----------------- ",y,'" --------------------"] + pp GETDATABASE(x,y) + +-- For some reason Dick has modified as.boot to convert the +-- identifier |0| or |1| to an integer in the list of operations. +-- This is WRONG, all existing code assumes that operation names +-- are always identifiers not numbers. +-- This function breaks the ability of the interpreter to find +-- |0| or |1| as exports of new compiler domains. +-- Unless someone has a strong reason for keeping the change, +-- this function should be no-opped, i.e. +-- zeroOneConversion opAlist == opAlist +-- If this change is made, then we are able to find asharp constants again. +-- bmt Mar 26, 1994 and executed by rss + +zeroOneConversion opAlist == opAlist +-- for u in opAlist repeat +-- [op,:.] := u +-- DIGITP (PNAME op).0 => RPLACA(u, string2Integer PNAME op) +-- opAlist + +asyDisplay(con,alist) == + banner := '"==============================" + sayBrightly [banner,'" ",con,'" ",banner] + for [prop,:value] in alist repeat + sayBrightlyNT [prop,'": "] + pp value + +asGetModemaps(opAlist,oform,kind,modemap) == + acc:= nil + rpvl:= + MEMQ(kind, '(category function)) => rest $PatternVariableList -- *1 is special for $ + $PatternVariableList + form := [opOf oform,:[y for x in KDR oform for y in rpvl]] + dc := + MEMQ(kind, '(category function)) => "*1" + form + pred1 := + kind = 'category => [["*1",form]] + nil + signature := CDAR modemap + domainList := + [[a,m] for a in rest form for m in rest signature | + asIsCategoryForm m] + catPredList:= + kind = 'function => [["isFreeFunction","*1",opOf form]] + [['ofCategory,:u] for u in [:pred1,:domainList]] +-- for [op,:itemlist] in SUBLISLIS(rpvl, $FormalMapVariableList,opAlist) repeat +-- the code seems to oscillate between generating $FormalMapVariableList +-- and generating $TriangleVariableList + for [op,:itemlist] in SUBLISLIS(rpvl, $FormalMapVariableList,opAlist) repeat + for [sig0, pred] in itemlist repeat + sig := SUBST(dc,"$",sig0) + pred:= SUBST(dc,"$",pred) + sig := SUBLISLIS(rpvl,KDR oform,sig) + pred:= SUBLISLIS(rpvl,KDR oform,pred) + pred := pred or 'T + ----------> Constants change <-------------- + if IDENTP sig0 then + sig := [sig] + pred := MKPF([pred,'(isAsConstant)],'AND) + pred' := MKPF([pred,:catPredList],'AND) + mm := [[dc,:sig],[pred']] + acc := [[op,:interactiveModemapForm mm],:acc] + NREVERSE acc + +asIsCategoryForm m == + m = 'BasicType or GETDATABASE(opOf m,'CONSTRUCTORKIND) = 'category + +asyDocumentation con == + docHash := HGET($docHash,con) + u := [[op,:[fn(x,op) for x in rec]] for op in HKEYS docHash + | rec := HGET(docHash,op)] where fn(x,op) == + [form,sig,pred,origin,where?,comments,:.] := x + ----------> Constants change <-------------- + if IDENTP sig then sig := [sig] + [asySignature(sig,nil),trimComments comments] + [form,sig,pred,origin,where?,comments] := first HGET($conHash,con) + --above "first" assumes only one entry + comments := trimComments asyExtractDescription comments + [:u,['constructor,[nil,comments]]] + +asyExtractDescription str == + k := STRPOS('"Description:",str,0,nil) => asyExtractDescription SUBSTRING(str,k + 12,nil) + k := STRPOS('"Author:",str,0,nil) => asyExtractDescription SUBSTRING(str,0,k) + str + +trimComments str == + null str or str = '"" => '"" + m := MAXINDEX str + str := SUBSTRING(str,0,m) + trimString str + +asyExportAlist con == +--format of 'operationAlist property of LISPLIBS (as returned from koOps): +-- +-- +--!!! asyFile NEED: need to know if function is implemented by domain!!! + docHash := HGET($docHash,con) + [[op,:[fn(x,op) for x in rec]] for op in HKEYS docHash | rec := HGET(docHash,op)] + where fn(x,op) == + [form,sig,pred,origin,where?,comments,:.] := x + tail := + pred => [pred] + nil + newSig := asySignature(sig,nil) + [newSig,nil,:tail] + +asyMakeOperationAlist(con,proplist, key) == + oplist := + u := LASSOC('domExports,proplist) => + kind := 'domain + u + u := LASSOC('catExports,proplist) => + kind := 'category + u + key = 'domain => + kind := 'domain + u := NIL + return nil + ht := MAKE_-HASH_-TABLE() + ancestorAlist := nil + for ['Declare,id,form,r] in oplist repeat + id = "%%" => + opOf form = con => nil + y := asyAncestors form + [attrs, na] := asyFindAttrs y + y := na + if opOf(y)^=con then ancestorAlist := [ [y,:true],:ancestorAlist] + idForm := + form is ['Apply,'_-_>,source,target] => [id,:asyArgs source] + ----------> Constants change <-------------- + id + pred := + LASSOC('condition,r) is p => hackToRemoveAnd p + nil + sig := asySignature(asytranForm(form,[idForm],nil),nil) + entry := + --id ^= "%%" and IDENTP idForm => [[sig],nil,nil,'ASCONST] + id ^= "%%" and IDENTP idForm => + pred => [[sig],nil,asyPredTran pred,'ASCONST] + [[sig],nil,true,'ASCONST] + pred => [sig,nil,asyPredTran pred] + [sig] + HPUT(ht,id,[entry,:HGET(ht,id)]) + opalist := [[op,:REMDUP HGET(ht,op)] for op in HKEYS ht] + --HPUT($opHash,con,[ancestorAlist,attributeAlist,:opalist]) +<> + +hackToRemoveAnd p == +---remove this as soon as .asy files do not contain forms (And pred) forms + p is ['And,q,:r] => + r => ['AND,q,:r] + q + p + +asyAncestors x == + x is ['Apply,:r] => asyAncestorList r + x is [op,y,:.] and MEMQ(op, '(PretendTo RestrictTo)) => asyAncestors y + atom x => + x = '_% => '_$ + MEMQ(x, $niladics) => [x] + GETDATABASE(x ,'NILADIC) => [x] + x + asyAncestorList x + +asyAncestorList x == [asyAncestors y for y in x] +--============================================================================ +-- Build Operation Alist from sig +--============================================================================ + +--format of operations as returned from koOps +-- +-- + +--abb,kind,file,sourcefile,coSig,dbLineNumber,constructorArgs,libfile +--((sig where(NIL or #) condition(T or pred) ELTorSubsumed) ... +--expanded lists are: sig, predicate, origin, exposeFlag, comments + +--============================================================================ +-- Building Hash Tables for Operations/Constructors +--============================================================================ +asytran fn == +--put operations into table format for browser: +-- + inStream := OPEN fn + sayBrightly ['" Reading ",fn] + u := READ inStream + $niladics := mkNiladics u + for x in $niladics repeat PUT(x,'NILADIC,true) + for d in u repeat + ['Declare,name,:.] := d + name = "%%" => 'skip --skip over top-level properties + $docHashLocal: local := MAKE_-HASH_-TABLE() + asytranDeclaration(d,'(top),nil,false) + if null name then hohohoho() + HPUT($docHash,name,$docHashLocal) + CLOSE inStream + 'done + +mkNiladics u == + [name for x in u | x is ['Declare,name,y,:.] and y isnt ['Apply,'_-_>,:.]] + +--OLD DEFINITION FOLLOWS +asytranDeclaration(dform,levels,predlist,local?) == + ['Declare,id,form,r] := dform + id = 'failed => id + KAR dform ^= 'Declare => systemError '"asytranDeclaration" + if levels = '(top) then + if form isnt ['Apply,"->",:.] then HPUT($constantHash,id,true) + comments := LASSOC('documentation,r) or '"" + idForm := + levels is ['top,:.] => + form is ['Apply,'_-_>,source,target] => [id,:asyArgs source] + id + ----------> Constants change <-------------- + id + newsig := asytranForm(form,[idForm,:levels],local?) + key := + levels is ['top,:.] => + MEMQ(id,'(%% Category Type)) => 'constant + asyLooksLikeCatForm? form => 'category + form is ['Apply, '_-_>,.,u] => + if u is ['Apply, construc,:.] then u:= construc + GETDATABASE(opOf u,'CONSTRUCTORKIND) = 'domain => 'function + asyLooksLikeCatForm? u => 'category + 'domain + 'domain + first levels + typeCode := LASSOC('symeTypeCode,r) + record := [idForm,newsig,asyMkpred predlist,key,true,comments,typeCode,:$asyFile] + if not local? then + ht := + levels = '(top) => $conHash + $docHashLocal + HPUT(ht,id,[record,:HGET(ht,id)]) + if levels = '(top) then asyMakeOperationAlist(id,r, key) + ['Declare,id,newsig,r] + +asyLooksLikeCatForm? x == +--TTT don't see a Third in my version .... + x is ['Define, ['Declare, ., ['Apply, 'Third,:.],:.],:.] or + x is ['Define, ['Declare, ., 'Category ],:.] + +--asytranDeclaration(dform,levels,predlist,local?) == +-- ['Declare,id,form,r] := dform +-- id = 'failed => id +-- levels isnt ['top,:.] => asytranForm(form,[id,:levels],local?) +-- idForm := +-- form is ['Apply,'_-_>,source,target] => [id,:asyArgs source] +-- id +-- if form isnt ['Apply,"->",:.] then HPUT($constantHash,id,true) +-- comments := LASSOC('documentation,r) or '"" +-- newsig := asytranForm(form,[idForm,:levels],local?) +-- key := +-- MEMQ(id,'(%% Category Type)) => 'constant +-- form is ['Apply,'Third,:.] => 'category +-- form is ['Apply,.,.,target] and target is ['Apply,name,:.] +-- and MEMQ(name,'(Third Join)) => 'category +-- 'domain +-- record := [newsig,asyMkpred predlist,key,true,comments,:$asyFile] +-- if not local? then +-- ht := +-- levels = '(top) => $conHash +-- $docHashLocal +-- HPUT(ht,id,[record,:HGET(ht,id)]) +-- if levels = '(top) then asyMakeOperationAlist(id,r) +-- ['Declare,id,newsig,r] + +asyIsCatForm form == + form is ['Apply,:r] => + r is ['_-_>,.,a] => asyIsCatForm a + r is ['Third,'Type,:.] => true + false + false + +asyArgs source == + args := + source is [op,:u] and asyComma? op => u + [source] + [asyArg x for x in args] + +asyArg x == + x is ['Declare,id,:.] => id + x + +asyMkpred predlist == + null predlist => nil + predlist is [p] => p + ['AND,:predlist] + +asytranForm(form,levels,local?) == + u := asytranForm1(form,levels,local?) + null u => hahah() + u + +asytranForm1(form,levels,local?) == + form is ['With,left,cat] => +-- left ^= nil => error '"WITH cannot take a left argument yet" + asytranCategory(form,levels,nil,local?) + form is ['Apply,:.] => asytranApply(form,levels,local?) + form is ['Declare,:.] => asytranDeclaration(form,levels,nil,local?) + form is ['Comma,:r] => ['Comma,:[asytranForm(x,levels,local?) for x in r]] +--form is ['_-_>,:s] => asytranMapping(s,levels,local?) + form is [op,a,b] and MEMQ(a,'(PretendTo RestrictTo)) => + asytranForm1(a,levels,local?) + form is ['LitInteger,s] => + READ_-FROM_-STRING(s) + form is ['Define,:.] => + form is ['Define,['Declare,.,x,:.],rest] => +--TTT i don't know about this one but looks ok + x = 'Category => asytranForm1(rest,levels, local?) + asytranForm1(x,levels,local?) + error '"DEFINE forms are not handled yet" + if form = '_% then $hasPerCent := true + IDENTP form => + form = "%" => "$" + GETL(form,'NILADIC) => [form] + form + [asytranForm(x,levels,local?) for x in form] + +asytranApply(['Apply,name,:arglist],levels,local?) == + MEMQ(name,'(Record Union)) => + [name,:[asytranApplySpecial(x, levels, local?) for x in arglist]] + null arglist => [name] + name is [ 'RestrictTo, :.] => + asytranApply(['Apply, CAR CDR name,:arglist], levels, local?) + name is [ 'Qualify, :.] => + asytranApply(['Apply, CAR CDR name,:arglist], levels, local?) + name is 'string => asytranLiteral CAR arglist + name is 'integer => asytranLiteral CAR arglist + name is 'float => asytranLiteral CAR arglist + name = 'Enumeration => + ["Enumeration",:[asytranEnumItem arg for arg in arglist]] + [:argl,lastArg] := arglist + [name,:[asytranFormSpecial(arg,levels,true) for arg in argl], + asytranFormSpecial(lastArg,levels,false)] + +asytranLiteral(lit) == + CAR CDR lit + +asytranEnumItem arg == + arg is ['Declare, name, :.] => name + error '"Bad Enumeration entry" + +asytranApplySpecial(x, levels, local?) == + x is ['Declare, name, typ, :.] => [":",name,asytranForm(typ, levels, local?)] + asytranForm(x, levels, local?) + +asytranFormSpecial(x, levels, local?) == --> this throws away variable name (revise later) + x is ['Declare, name, typ, :.] => asytranForm(typ, levels, local?) + asytranForm(x, levels, local?) + +asytranCategory(form,levels,predlist,local?) == + cat := + form is ['With,left,right] => + right is ['Blank,:.] => ['Sequence] + right + form + left := + form is ['With,left,right] => + left is ['Blank,:.] => nil + left + nil + $hasPerCent: local := nil + items := + cat is ['Sequence,:s] => s + [cat] + catTable := MAKE_-HASH_-TABLE() + catList := nil + for x in items | x repeat + if null x then systemError() + dform := asytranCategoryItem(x,levels,predlist,local?) + null dform => nil + dform is ['Declare,id,record,r] => + HPUT(catTable,id,[asyWrap(record,predlist),:HGET(catTable,id)]) + catList := [asyWrap(dform,predlist),:catList] + keys := listSort(function GLESSEQP,HKEYS catTable) + right1 := NREVERSE catList + right2 := [[key,:HGET(catTable,key)] for key in keys] + right := + right2 => [:right1,['Exports,:right2]] + right1 + res := + left => [left,:right] + right + res is [x] and x is ['IF,:.] => x + ['With,:res] + +asyWrap(record,predlist) == + predlist => ['IF,MKPF(predlist,'AND),record] + record + +asytranCategoryItem(x,levels,predlist,local?) == + x is ['If,predicate,item,:r] => + IFCAR r => error '"ELSE expressions not allowed yet in conditionals" + pred := + predicate is ['Test,r] => r + predicate + asytranCategory(item,levels,[pred,:predlist],local?) + MEMQ(KAR x,'(Default Foreign)) => nil + x is ['Declare,:.] => asytranDeclaration(x,levels,predlist,local?) + x + +--============================================================================ +-- Extending Constructor Datatable +--============================================================================ +--FORMAT of $constructorDataTable entry: +--abb kind libFile sourceFile coSig constructorArgs +--alist is ((kind . domain) (libFile . MATRIX) (sourceFile . "matrix") +-- (coSig NIL T) (dbLineNumber . 29187) (constructorArgs R) +-- (modemap . ( +-- (|Matrix| |#1|) +-- (Join (MatrixCategory #1 (Vector #1) (Vector #1)) +-- (CATEGORY domain +-- (SIGNATURE diagonalMatrix ($ (Vector #1))) +-- (IF (has #1 (Field)) +-- (SIGNATURE inverse ((Union $ "failed") $)) noBranch))) +-- (Ring)) +-- (T Matrix)) ) +extendConstructorDataTable() == +-- tb := $constructorDataTable + for x in listSort(function GLESSEQP,HKEYS $conHash) repeat +-- if LASSOC(x,tb) then tb := DELLASOS(x,tb) + record := HGET($conHash,x) + [form,sig,predlist,origin,exposure,comments,typeCode,:filename] := first record + abb := asyAbbreviation(x,#(rest sig)) + kind := 'domain + --Note: this "first" assumes that there is ONLY one sig per name + cosig := [nil,:asyCosig sig] + args := asyConstructorArgs sig + tb := + [[x,abb, + ['kind,:kind], + ['cosig,:cosig], + ['libfile,filename], + ['sourceFile,STRINGIMAGE filename], + ['constructorArgs,:args]],:tb] + listSort(function GLESSEQP,ASSOCLEFT tb) + +asyConstructorArgs sig == + sig is ['With,:.] => nil + sig is ['_-_>,source,target] => + source is [op,:argl] and asyComma? op => [asyConstructorArg x for x in argl] + [asyConstructorArg source] + +asyConstructorArg x == + x is ['Declare,name,t,:.] => name + x + +asyCosig sig == --can be a type or could be a signature + atom sig or sig is ['With,:.] => nil + sig is ['_-_>,source,target] => + source is [op,:argl] and asyComma? op => [asyCosigType x for x in argl] + [asyCosigType source] + error false + +asyCosigType u == + u is [name,t] => + t is [fn,:.] => + asyComma? fn => fn + fn = 'With => 'T + nil + t = 'Type => 'T + error '"Unknown atomic type" + error false + +asyAbbreviation(id,n) == chk(id,main) where --> n = number of arguments + main == + a := createAbbreviation id => a + name := PNAME id +-- #name < 8 => INTERN UPCASE name + parts := asySplit(name,MAXINDEX name) + newname := "STRCONC"/[asyShorten x for x in parts] + #newname < 8 => INTERN newname + tryname := SUBSTRING(name,0,7) + not createAbbreviation tryname => INTERN UPCASE tryname + nil + chk(conname,abb) == + (xx := asyGetAbbrevFromComments conname) => xx + con := abbreviation? abb => + conname = con => abb + conname + abb + +asyGetAbbrevFromComments con == + docHash := HGET($docHash,con) + u := [[op,:[fn(x,op) for x in rec]] for op in HKEYS docHash + | rec := HGET(docHash,op)] where fn(x,op) == + [form,sig,pred,origin,where?,comments,:.] := x + ----------> Constants change <-------------- + if IDENTP sig then sig := [sig] + [asySignature(sig,nil),trimComments comments] + [form,sig,pred,origin,where?,comments] := first HGET($conHash,con) + --above "first" assumes only one entry + x := asyExtractAbbreviation comments + x => intern x + NIL + +asyExtractAbbreviation str == + not (k:= STRPOS('"Abbrev: ",str,0,nil)) => NIL + str := SUBSTRING(str, k+8, nil) + k := STRPOS($stringNewline, str,0,nil) + k => SUBSTRING(str, 0, k) + str + +asyShorten x == + y := createAbbreviation x + or LASSOC(x, + '(("Small" . "SM") ("Single" ."S") ("Half" . "H")("Point" . "PT") + ("Floating" . "F") ("System" . "SYS") ("Number" . "N") + ("Inventor" . "IV") + ("Finite" . "F") ("Double" . "D") ("Builtin" . "BI"))) => y + UPCASE x + +asySplit(name,end) == + end < 1 => [name] + k := 0 + for i in 1..end while LOWER_-CASE_-P name.i repeat k := i + k := k + 1 + [SUBSTRING(name,0,k),:asySplit(SUBSTRING(name,k,nil),end-k)] + +createAbbreviation s == + if STRINGP s then s := INTERN s + a := constructor? s + a ^= s => a + nil + +--============================================================================ +-- extending getConstructorModemap Property +--============================================================================ +--Note: modemap property is built when getConstructorModemap is called + +asyConstructorModemap con == + HGET($conHash,con) isnt [record,:.] => nil --not there + [form,sig,predlist,kind,exposure,comments,typeCode,:filename] := record + $kind: local := kind + --NOTE: sig has the form (-> source target) or simply (target) + $constructorArgs: local := KDR form + signature := asySignature(sig,false) + formals := ['_$,:TAKE(#$constructorArgs,$FormalMapVariableList)] + mm := [[[con,:$constructorArgs],:signature],['T,con]] + SUBLISLIS(formals,['_%,:$constructorArgs],mm) + +asySignature(sig,names?) == + sig is ['Join,:.] => [asySig(sig,nil)] + sig is ['With,:.] => [asySig(sig,nil)] + sig is ['_-_>,source,target] => + target := + names? => ['dummy,target] + target + source is [op,:argl] and asyComma? op => + [asySigTarget(target,names?),:[asySig(x,names?) for x in argl]] + [asySigTarget(target,names?),asySig(source,names?)] + ----------> The following is a hack for constants which are category names<-- + sig is ['Third,:.] => [asySig(sig,nil)] + ----------> Constants change <-------------- + asySig(sig,nil) + +asySigTarget(u,name?) == asySig1(u,name?,true) + +asySig(u,name?) == asySig1(u,name?,false) + +asySig1(u,name?,target?) == + x := + name? and u is [name,t] => t + u + x is [fn,:r] => + fn = 'Join => asyTypeJoin r ---------> jump out to newer code 4/94 + MEMQ(fn, '(RestrictTo PretendTo)) => asySig(first r,name?) + asyComma? fn => + u := [asySig(x,name?) for x in r] + target? => + null u => '(Void) + -- this implies a multiple value return, not currently supported + -- in the interpreter + ['Multi,:u] + u + fn = 'With => asyCATEGORY r + fn = 'Third => + r is [b] => + b is ['With,:s] => asyCATEGORY s + b is ['Blank,:.] => asyCATEGORY nil + error x + fn = 'Apply and r is ['_-_>,:s] => asyMapping(s,name?) + fn = '_-_> => asyMapping(r,name?) + fn = 'Declare and r is [name,typ,:.] => + asySig1(typ, name?, target?) + x is '(_%) => '(_$) + [fn,:[asySig(x,name?) for x in r]] +--x = 'Type => '(Type) + x = '_% => '_$ + x + +-- old version was : +--asyMapping([a,b],name?) == +-- a := asySig(a,name?) +-- b := asySig(b,name?) +-- args := +-- a is [op,:r] and asyComma? op => r +-- [a] +-- ['Mapping,b,:args] + +asyMapping([a,b],name?) == + newa := asySig(a,name?) + b := asySig(b,name?) + args := + a is [op,:r] and asyComma? op => newa + [a] + ['Mapping,b,:args] + +--============================================================================ +-- code for asySignatures of the form (Join,:...) +--============================================================================ +asyType x == + x is [fn,:r] => + fn = 'Join => asyTypeJoin r + MEMQ(fn, '(RestrictTo PretendTo)) => asyType first r + asyComma? fn => + u := [asyType x for x in r] + u + fn = 'With => asyCATEGORY r + fn = '_-_> => asyTypeMapping r + fn = 'Apply => r +-- fn = 'Declare and r is [name,typ,:.] => typ + x is '(_%) => '(_$) + x +--x = 'Type => '(Type) + x = '_% => '_$ + x + +asyTypeJoin r == + $conStack : local := nil + $opStack : local := nil + $predlist : local := nil + for x in r repeat asyTypeJoinPart(x,$predlist) + catpart := + $opStack => ['CATEGORY,$kind,:asyTypeJoinStack REVERSE $opStack] + nil + conpart := asyTypeJoinStack REVERSE $conStack + conpart => + catpart => ['Join,:conpart,catpart] + CDR conpart => ['Join,:conpart] + conpart + catpart + +asyTypeJoinPart(x,$predlist) == + x is ['Join,:y] => for z in y repeat asyTypeJoinPart(z, $predlist) + x is ['With,:y] => for p in y repeat asyTypeJoinPartWith p + asyTypeJoinPartWith x + +asyTypeJoinPartWith x == + x is ['Exports,:y] => for p in y repeat asyTypeJoinPartExport p + x is ['Exports,:.] => systemError 'exports + x is ['Comma] => nil + x is ['Export,:y] => nil + x is ['IF,:r] => asyTypeJoinPartIf r + x is ['Sequence,:x] => for y in x repeat asyTypeJoinItem y + asyTypeJoinItem x + +asyTypeJoinPartIf [pred,value] == + predlist := [asyTypeJoinPartPred pred,:$predlist] + asyTypeJoinPart(value,predlist) + +asyTypeJoinPartPred x == + x is ['Test, y] => asyTypeUnit y + asyTypeUnit x + +asyTypeJoinItem x == + result := asyTypeUnit x + isLowerCaseLetter (PNAME opOf result).0 => + $opStack := [[['ATTRIBUTE,result],:$predlist],:$opStack] + $conStack := [[result,:$predlist],:$conStack] + +asyTypeMapping([a,b]) == + a := asyTypeUnit a + b := asyTypeUnit b + args := + a is [op,:r] and asyComma? op => r + [a] + ['Mapping,b,:args] + +asyTypeUnit x == + x is [fn,:r] => + fn = 'Join => systemError 'Join ----->asyTypeJoin r + MEMQ(fn, '(RestrictTo PretendTo)) => asyTypeUnit first r + asyComma? fn => + u := [asyTypeUnit x for x in r] + u + fn = 'With => asyCATEGORY r + fn = '_-_> => asyTypeMapping r + fn = 'Apply => asyTypeUnitList r + fn = 'Declare and r is [name,typ,:.] => asyTypeUnitDeclare(name,typ) + x is '(_%) => '(_$) + [fn,:asyTypeUnitList r] + GETL(x,'NILADIC) => [x] +--x = 'Type => '(Type) + x = '_% => '_$ + x + +asyTypeUnitList x == [asyTypeUnit y for y in x] + +asyTypeUnitDeclare(op,typ) == + typ is ['Apply, :r] => asyCatSignature(op,r) + asyTypeUnit typ +--============================================================================ +-- Translator for ['With,:.] +--============================================================================ +asyCATEGORY x == + if x is [join,:y] and join is ['Apply,:s] then + exports := y + joins := + s is ['Join,:r] => [asyJoinPart u for u in r] + [asyJoinPart s] + else if x is [id,:y] and IDENTP id then + joins := [[id]] + exports := y + else + joins := nil + exports := x + cats := exports + operations := nil + if exports is [:r,['Exports,:ops]] then + cats := r + operations := ops + exportPart := + ['CATEGORY,'domain,:"APPEND"/[asyCatItem y for y in operations]] + [attribs, na] := asyFindAttrs joins + joins := na + cats := "append"/[asyCattran c for c in cats] + [a, na] := asyFindAttrs cats + cats := na + attribs := APPEND(attribs, a) + attribs := [['ATTRIBUTE, x] for x in attribs] + exportPart := [:exportPart,:attribs] + joins or cats or attribs => + ['Join,:joins,:cats, exportPart] + exportPart + +asyFindAttrs l == + attrs := [] + notattrs := [] + for x in l repeat + x0 := x + while CONSP x repeat x := CAR x + if MEMQ(x, _*ATTRIBUTES_*) then attrs := [:attrs, x] + else notattrs := [:notattrs, x0] + [attrs, notattrs] + +simpCattran x == + u := asyCattran x + u is [y] => y + ['Join,:u] + +asyCattran x == + x is ['With,:r] => "append"/[asyCattran1 x for x in r] + x is ['IF,:.] => "append"/[asyCattranConstructors(x,nil)] + [x] + +asyCattran1 x == + x is ['Exports,:y] => "append"/[asyCattranOp u for u in y] + x is ['IF,:.] => "append"/[asyCattranConstructors(x,nil)] + systemError nil + +asyCattranOp [op,:items] == + "append"/[asyCattranOp1(op,item,nil) for item in items] + +asyCattranOp1(op, item, predlist) == + item is ['IF, p, x] => + pred := asyPredTran + p is ['Test,t] => t + p +-- x is ['IF,:.] => "append"/[asyCattranOp1('IF, x, [pred,:predlist])] +-- This line used to call asyCattranOp1 with too few arguments. Following +-- fix suggested by RDJ. + x is ['IF,:.] => "append"/[asyCattranOp1(op,y,[pred,:predlist]) for y in x] + [['IF, asySimpPred(pred,predlist), asyCattranSig(op,x), 'noBranch]] + [asyCattranSig(op,item)] + +asyPredTran p == asyPredTran1 asyJoinPart p + +asyPredTran1 p == + p is ['Has,x,y] => ['has,x, simpCattran y] + p is ['Test, q] => asyPredTran1 q + p is [op,:r] and MEMQ(op,'(AND OR NOT)) => + [op,:[asyPredTran1 q for q in r]] + p + +asyCattranConstructors(item, predlist) == + item is ['IF, p, x] => + pred := asyPredTran + p is ['Test,t] => t + p + x is ['IF,:.] => "append"/[asyCattranConstructors(x, [pred,:predlist])] + form := ['ATTRIBUTE, asyJoinPart x] + [['IF, asySimpPred(pred,predlist), form, 'noBranch]] + systemError() + +asySimpPred(p, predlist) == + while predlist is [q,:predlist] repeat p := quickAnd(q,p) + p + +asyCattranSig(op,y) == + y isnt ["->",source,t] => +-- ['SIGNATURE, op, asyTypeUnit y] +-- following makes constants into nullary functions + ['SIGNATURE, op, [asyTypeUnit y]] + s := + source is ['Comma,:s] => [asyTypeUnit z for z in s] + [asyTypeUnit source] + t := asyTypeUnit t + null t => ['SIGNATURE,op,s] + ['SIGNATURE,op,[t,:s]] + +asyJoinPart x == + IDENTP x => [x] + asytranForm(x,nil,true) + +asyCatItem item == + atom item => [item] + item is ['IF,.,.] => [item] + [op,:sigs] := item + [asyCatSignature(op,sig) for sig in sigs | sig] + +asyCatSignature(op,sig) == + sig is ['_-_>,source,target] => + ['SIGNATURE,op, [asyTypeItem target,:asyUnTuple source]] + ----------> Constants change <-------------- +-- ['TYPE,op,asyTypeItem sig] +-- following line converts constants into nullary functions + ['SIGNATURE,op,[asyTypeItem sig]] + +asyUnTuple x == + x is [op,:u] and asyComma? op => [asyTypeItem y for y in u] + [asyTypeItem x] + +asyTypeItem x == + atom x => + x = '_% => '_$ + x + x is ['_-_>,a,b] => + ['Mapping,b,:asyUnTuple a] + x is ['Apply,:r] => + r is ['_-_>,a,b] => + ['Mapping,b,:asyUnTuple a] + r is ['Record,:parts] => + ['Record,:[[":",a,b] for ['Declare,a,b,:.] in parts]] + r is ['Segment,:parts] => + ['Segment,:[asyTypeItem x for x in parts]] + asytranApply(x,nil,true) + x is ['Declare,.,t,:.] => asyTypeItem t + x is ['Comma,:args] => + -- this implies a multiple value return, not currently supported + -- in the interpreter + args => ['Multi,:[asyTypeItem y for y in args]] + ['Void] + [asyTypeItem y for y in x] + +--============================================================================ +-- Utilities +--============================================================================ +asyComma? op == MEMQ(op,'(Comma Multi)) + + +hput(table,name,value) == + if null name then systemError() + HPUT(table,name,value) + +--============================================================================ +-- category parts +--============================================================================ + +-- this constructs operation information from a category. +-- NB: This is categoryParts, but with the kind supplied by +-- an arguments +asCategoryParts(kind,conform,category,:options) == main where + main == + cons? := IFCAR options --means to include constructors as well + $attrlist: local := nil + $oplist : local := nil + $conslist: local := nil + conname := opOf conform + for x in exportsOf(category) repeat build(x,true) + $attrlist := listSort(function GLESSEQP,$attrlist) + $oplist := listSort(function GLESSEQP,$oplist) + res := [$attrlist,:$oplist] + if cons? then res := [listSort(function GLESSEQP,$conslist),:res] + if kind = 'category then + tvl := TAKE(#rest conform,$TriangleVariableList) + res := SUBLISLIS($FormalMapVariableList,tvl,res) + res + build(item,pred) == + item is ['SIGNATURE,op,sig,:.] => $oplist := [[opOf op,sig,:pred],:$oplist] + --note: opOf is needed!!! Bug in compiler puts in (One) and (Zero) + item is ['ATTRIBUTE,attr] => + constructor? opOf attr => + $conslist := [[attr,:pred],:$conslist] + nil + opOf attr = 'nothing => 'skip + $attrlist := [[opOf attr,IFCDR attr,:pred],:$attrlist] + item is ['TYPE,op,type] => + $oplist := [[op,[type],:pred],:$oplist] + item is ['IF,pred1,s1,s2] => + build(s1,quickAnd(pred,pred1)) + s2 => build(s2,quickAnd(pred,['NOT,pred1])) + item is ['PROGN,:r] => for x in r repeat build(x,pred) + item in '(noBranch) => 'ok + null item => 'ok + systemError '"build error" + exportsOf(target) == + target is ['CATEGORY,.,:r] => r + target is ['Join,:r,f] => + for x in r repeat $conslist := [[x,:true],:$conslist] + exportsOf f + $conslist := [[target,:true],:$conslist] + nil + +--============================================================================ +-- Dead Code (for a very odd value of 'dead') +--============================================================================ +asyTypeJoinPartExport x == + [op,:items] := x + for y in items repeat + y isnt ["->",source,t] => +-- sig := ['TYPE, op, asyTypeUnit y] +-- converts constants to nullary functions (this code isn't dead) + sig := ['SIGNATURE, op, [asyTypeUnit y]] + $opStack := [[sig,:$predlist],:$opStack] + s := + source is ['Comma,:s] => [asyTypeUnit z for z in s] + [asyTypeUnit source] + t := asyTypeUnit t + sig := + null t => ['SIGNATURE,op,s] + ['SIGNATURE,op,[t,:s]] + $opStack := [[sig,:$predlist],:$opStack] + +--============================================================================ +-- Code to create opDead Code +--============================================================================ +asyTypeJoinStack r == + al := [[[x while r is [[x, :q],:s] and p = q and (r := s; true)],:p] + while r is [[.,:p],:.]] + result := "append"/[fn for [y,:p] in al] where fn == + p => [['IF,asyTypeMakePred p,:y]] + y + result + +asyTypeMakePred [p,:u] == + while u is [q,:u] repeat p := quickAnd(q,p) + p + + + + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/astr.boot.pamphlet b/src/interp/astr.boot.pamphlet new file mode 100644 index 00000000..b8f9eb0b --- /dev/null +++ b/src/interp/astr.boot.pamphlet @@ -0,0 +1,99 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/interp astr.boot} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\section{License} +<>= +-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are +-- met: +-- +-- - Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- +-- - Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in +-- the documentation and/or other materials provided with the +-- distribution. +-- +-- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- names of its contributors may be used to endorse or promote products +-- derived from this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +-- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + +)package "BOOT" + +--% Attributed Structures (astr) +-- For objects which are pairs where the CAR field is either just a tag +-- (an identifier) or a pair which is the tag and an association list. + +-- Pick off the tag +ncTag x == + not PAIRP x => ncBug('S2CB0031,[]) + x := QCAR x + IDENTP x => x + not PAIRP x => ncBug('S2CB0031,[]) + QCAR x + +-- Pick off the property list +ncAlist x == + not PAIRP x => ncBug('S2CB0031,[]) + x := QCAR x + IDENTP x => NIL + not PAIRP x => ncBug('S2CB0031,[]) + QCDR x + + --- Get the entry for key k on x's association list +ncEltQ(x,k) == + r := QASSQ(k,ncAlist x) + NULL r => ncBug ('S2CB0007,[k]) + CDR r + +-- Put (k . v) on the association list of x and return v +-- case1: ncPutQ(x,k,v) where k is a key (an identifier), v a value +-- put the pair (k . v) on the association list of x and return v +-- case2: ncPutQ(x,k,v) where k is a list of keys, v a list of values +-- equivalent to [ncPutQ(x,key,val) for key in k for val in v] +ncPutQ(x,k,v) == + LISTP k => + for key in k for val in v repeat ncPutQ(x,key,val) + v + r := QASSQ(k,ncAlist x) + if NULL r then + r := CONS( CONS(k,v), ncAlist x) + RPLACA(x,CONS(ncTag x,r)) + else + RPLACD(r,v) + v + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/ax.boot.pamphlet b/src/interp/ax.boot.pamphlet new file mode 100644 index 00000000..2234b1eb --- /dev/null +++ b/src/interp/ax.boot.pamphlet @@ -0,0 +1,428 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/interp ax.boot} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\section{New Aldor compiler changes} +This was changed so the open source version of axiom can work with the new +aldor compiler. +This used to read: +\begin{verbatim} + axForm := ['Sequence, ['Import, [], 'AxiomLib], :axForms] +\end{verbatim} +but was changed to read: +<>= + axForm := ['Sequence, _ + ['Import, [], 'AxiomLib], ['Import, [], 'Boolean], :axForms] +@ +\subsection{makeAxExportForm} +<>= +makeAxExportForm(filename, constructors) == + $defaultFlag : local := false + $literals := [] + axForms := + [modemapToAx(modemap) for cname in constructors | + (modemap:=GETDATABASE(cname,'CONSTRUCTORMODEMAP)) and + (not cname in '(Tuple Exit Type)) and + not isDefaultPackageName cname] + if $baseForms then + axForms := [:$baseForms, :axForms] + if $defaultFlag then + axForms := + [['Foreign, ['Declare, 'dummyDefault, 'Exit], 'Lisp], :axForms] + axForms := APPEND(axDoLiterals(), axForms) + axForm := ['Sequence, _ + ['Import, [], 'AxiomLib], ['Import, [], 'Boolean], :axForms] + axForm + +@ +\subsection{axFormatPref} +Here we add an else clause. The original code read: +\begin{verbatim} + if name = '$ then name := '% +\end{verbatim} +It appears that Aldor allows a richer syntax for [[has]] +conditions since the call to [[axFormatOp]] appears to allow +nested IF conditions.OQ +<>= +axFormatPred pred == + atom pred => pred + [op,:args] := pred + op = 'IF => axFormatOp pred + op = 'has => + [name,type] := args + if name = '$ then name := '% + else name := axFormatOp name + ftype := axFormatOp type + if ftype is ['Declare,:.] then + ftype := ['With, [], ftype] + ['Test,['Has,name, ftype]] + axArglist := [axFormatPred arg for arg in args] + op = 'AND => ['And,:axArglist] + op = 'OR => ['Or,:axArglist] + op = 'NOT => ['Not,:axArglist] + error "unknown predicate" + +@ +\section{License} +<>= +-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are +-- met: +-- +-- - Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- +-- - Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in +-- the documentation and/or other materials provided with the +-- distribution. +-- +-- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- names of its contributors may be used to endorse or promote products +-- derived from this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +-- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + +$stripTypes := false +$pretendFlag := false +$defaultFlag := false +$baseForms := nil +$literals := nil + +spad2AxTranslatorAutoloadOnceTrigger any == true + +sourceFilesToAxFile(filename, sourceFiles) == + makeAxFile(filename, MAPCAN('fileConstructors, sourceFiles)) + + +$extendedDomains := nil + +setExtendedDomains(l) == + $extendedDomains := l + +fileConstructors name == + [INTERN(con,"BOOT") for con in SRCABBREVS SOURCEPATH STRING name] + +makeAxFile(filename, constructors) == + $defaultFlag : local := false + $literals := [] + axForms := + [modemapToAx(modemap) for cname in constructors | + (modemap:=GETDATABASE(cname,'CONSTRUCTORMODEMAP)) and + (not cname in '(Tuple Exit Type)) and + not isDefaultPackageName cname] + if $baseForms then + axForms := [:$baseForms, :axForms] + if $defaultFlag then + axForms := + [['Foreign, ['Declare, 'dummyDefault, 'Exit], 'Lisp], :axForms] + axForms := APPEND(axDoLiterals(), axForms) +<> + st := MAKE_-OUTSTREAM(filename) + PPRINT(axForm,st) + CLOSE st + +<> + +stripType type == + $stripTypes => + categoryForm? type => 'Type + type + type + +modemapToAx(modemap) == + modemap is [[consform, target,:argtypes],.] + consform is [constructor,:args] + argdecls:=['Comma, : [axFormatDecl(a,stripType t) for a in args for t in argtypes]] + resultType := axFormatType stripType target + categoryForm? constructor => + categoryInfo := GETDATABASE(constructor,'CONSTRUCTORCATEGORY) + categoryInfo := SUBLISLIS($FormalMapVariableList, $TriangleVariableList, + categoryInfo) + NULL args => + ['Define,['Declare, constructor,'Category], + addDefaults(constructor, axFormatType categoryInfo)] + ['Define, + ['Declare, constructor, ['Apply, "->", optcomma argdecls, 'Category]], + ['Lambda, argdecls, 'Category, + ['Label, constructor, + addDefaults(constructor, axFormatType categoryInfo)]]] + constructor in $extendedDomains => + NULL args => + ['Extend, ['Define, ['Declare, constructor, resultType], + ['Add, ['PretendTo, ['Add, [], []], resultType], []]]] + conscat := INTERN(STRCONC(SYMBOL_-NAME(constructor), "ExtendCategory"),"BOOT") + rtype := ['Apply, conscat, :args] +-- if resultType is ['With,a,b] then +-- if not(b is ['Sequence,:withseq]) then withseq := [b] +-- cosigs := rest GETDATABASE(constructor, 'COSIG) +-- exportargs := [['Export, [], arg, []] for arg in args for p in cosigs | p] +-- resultType := ['With,a,['Sequence,:APPEND(exportargs, withseq)]] + consdef := ['Define, + ['Declare, conscat, ['Apply, "->", optcomma argdecls, 'Category]], + ['Lambda, argdecls, 'Category, ['Label, conscat, resultType]]] + ['Sequence, consdef, + ['Extend, ['Define, + ['Declare, constructor, ['Apply, "->", optcomma argdecls, rtype]], + ['Lambda, argdecls, rtype, + ['Label, constructor, + ['Add, ['PretendTo, ['Add, [], []], rtype], []]]]]]] + NULL args => + ['Export, ['Declare, constructor, resultType],[],[]] +-- if resultType is ['With,a,b] then +-- if not(b is ['Sequence,:withseq]) then withseq := [b] +-- cosigs := rest GETDATABASE(constructor, 'COSIG) +-- exportargs := [['Export, [], arg, []] for arg in args for p in cosigs | p] +-- resultType := ['With,a,['Sequence,:APPEND(exportargs, withseq)]] + ['Export, ['Declare, constructor, ['Apply, "->", optcomma argdecls, resultType]],[],[]] + +optcomma [op,:args] == + # args = 1 => first args + [op,:args] + +axFormatDecl(sym, type) == + if sym = '$ then sym := '% + opOf type in '(StreamAggregate FiniteLinearAggregate) => + ['Declare, sym, 'Type] + ['Declare, sym, axFormatType type] + +makeTypeSequence l == + ['Sequence,: delete('Type, l)] + +axFormatAttrib(typeform) == + atom typeform => typeform + axFormatType typeform + +axFormatType(typeform) == + atom typeform => + typeform = '$ => '% + STRINGP typeform => + ['Apply,'Enumeration, INTERN typeform] + INTEGERP typeform => + -- need to test for PositiveInteger vs Integer + axAddLiteral('integer, 'PositiveInteger, 'Literal) + ['RestrictTo, ['LitInteger, STRINGIMAGE typeform ], 'PositiveInteger] + FLOATP typeform => ['LitFloat, STRINGIMAGE typeform] + MEMQ(typeform,$TriangleVariableList) => + SUBLISLIS($FormalMapVariableList, $TriangleVariableList, typeform) + MEMQ(typeform, $FormalMapVariableList) => typeform + axAddLiteral('string, 'Symbol, 'Literal) + ['RestrictTo, ['LitString, PNAME typeform], 'Symbol] + typeform is ['construct,: args] => + axAddLiteral('bracket, ['Apply, 'List, 'Symbol], [ 'Apply, 'Tuple, 'Symbol]) + axAddLiteral('string, 'Symbol, 'Literal) + ['RestrictTo, ['Apply, 'bracket, + :[axFormatType a for a in args]], + ['Apply, 'List, 'Symbol] ] + typeform is [op] => + op = '$ => '% + op = 'Void => ['Comma] + op + typeform is ['local, val] => axFormatType val + typeform is ['QUOTE, val] => axFormatType val + typeform is ['Join,:cats,lastcat] => + lastcat is ['CATEGORY,type,:ops] => + ['With, [], + makeTypeSequence( + APPEND([axFormatType c for c in cats], + [axFormatOp op for op in ops]))] + ['With, [], makeTypeSequence([axFormatType c for c in rest typeform])] + typeform is ['CATEGORY, type, :ops] => + ['With, [], axFormatOpList ops] + typeform is ['Mapping, target, :argtypes] => + ['Apply, "->", + ['Comma, :[axFormatType t for t in argtypes]], + axFormatType target] + typeform is ['_:, name, type] => axFormatDecl(name,type) + typeform is ['Union, :args] => + first args is ['_:,.,.] => + ['Apply, 'Union, :[axFormatType a for a in args]] + taglist := [] + valueCount := 0 + for x in args repeat + tag := + STRINGP x => INTERN x + x is ['QUOTE,val] and STRINGP val => INTERN val + valueCount := valueCount + 1 + INTERNL("value", STRINGIMAGE valueCount) + taglist := [tag ,: taglist] + ['Apply, 'Union, :[axFormatDecl(name,type) for name in reverse taglist + for type in args]] + typeform is ['Dictionary,['Record,:args]] => + ['Apply, 'Dictionary, + ['PretendTo, axFormatType CADR typeform, 'SetCategory]] + typeform is ['FileCategory,xx,['Record,:args]] => + ['Apply, 'FileCategory, axFormatType xx, + ['PretendTo, axFormatType CADDR typeform, 'SetCategory]] + typeform is [op,:args] => + $pretendFlag and constructor? op and + GETDATABASE(op,'CONSTRUCTORMODEMAP) is [[.,target,:argtypes],.] => + ['Apply, op, + :[['PretendTo, axFormatType a, axFormatType t] + for a in args for t in argtypes]] + MEMQ(op, '(SquareMatrix SquareMatrixCategory DirectProduct + DirectProductCategory RadixExpansion)) and + GETDATABASE(op,'CONSTRUCTORMODEMAP) is [[.,target,arg1type,:restargs],.] => + ['Apply, op, + ['PretendTo, axFormatType first args, axFormatType arg1type], + :[axFormatType a for a in rest args]] + ['Apply, op, :[axFormatType a for a in args]] + error "unknown entry type" + +axFormatOpList ops == ['Sequence,:[axFormatOp o for o in ops]] + +axOpTran(name) == + ATOM name => + name = 'elt => 'apply + name = 'setelt => 'set! + name = 'SEGMENT => ".." + name = 1 => '_1 + name = 0 => '_0 + name + opOf name = 'Zero => '_0 + opOf name = 'One => '_1 + error "bad op name" + +axFormatOpSig(name, [result,:argtypes]) == + ['Declare, axOpTran name, + ['Apply, "->", ['Comma, :[axFormatType t for t in argtypes]], + axFormatType result]] + +axFormatConstantOp(name, [result]) == + ['Declare, axOpTran name, axFormatType result] + +<> + +axFormatCondOp op == + $pretendFlag:local := true + axFormatOp op + + +axFormatOp op == + op is ['IF, pred, trueops, falseops] => + NULL(trueops) or trueops='noBranch => + ['If, ['Test,['Not, axFormatPred pred]], + axFormatCondOp falseops, + axFormatCondOp trueops] + ['If, axFormatPred pred, + axFormatCondOp trueops, + axFormatCondOp falseops] + -- ops are either single op or ['PROGN, ops] + op is ['SIGNATURE, name, type] => axFormatOpSig(name,type) + op is ['SIGNATURE, name, type, 'constant] => + axFormatConstantOp(name,type) + op is ['ATTRIBUTE, attributeOrCategory] => + categoryForm? attributeOrCategory => + axFormatType attributeOrCategory + ['RestrictTo, axFormatAttrib attributeOrCategory, 'Category] + op is ['PROGN, :ops] => axFormatOpList ops + op is 'noBranch => [] + axFormatType op + +addDefaults(catname, withform) == + withform isnt ['With, joins, ['Sequence,: oplist]] => + error "bad category body" + null(defaults := getDefaultingOps catname) => withform + defaultdefs := [makeDefaultDef(decl) for decl in defaults] + ['With, joins, + ['Sequence, :oplist, ['Default, ['Sequence,: defaultdefs]]]] + +makeDefaultDef(decl) == + decl isnt ['Declare, op, type] => + error "bad default definition" + $defaultFlag := true + type is ['Apply, "->", args, result] => + ['Define, decl, ['Lambda, makeDefaultArgs args, result, + ['Label, op, 'dummyDefault]]] + ['Define, ['Declare, op, type], 'dummyDefault] + +makeDefaultArgs args == + args isnt ['Comma,:argl] => error "bad default argument list" + ['Comma,: [['Declare,v,t] for v in $TriangleVariableList for t in argl]] + +getDefaultingOps catname == + not(name:=hasDefaultPackage catname) => nil + $infovec: local := getInfovec name + opTable := $infovec.1 + $opList:local := nil + for i in 0..MAXINDEX opTable repeat + op := opTable.i + i := i + 1 + startIndex := opTable.i + stopIndex := + i + 1 > MAXINDEX opTable => MAXINDEX getCodeVector() + opTable.(i + 2) + curIndex := startIndex + while curIndex < stopIndex repeat + curIndex := get1defaultOp(op,curIndex) + $pretendFlag : local := true + catops := GETDATABASE(catname, 'OPERATIONALIST) + [axFormatDefaultOpSig(op,sig,catops) for opsig in $opList | opsig is [op,sig]] + +axFormatDefaultOpSig(op, sig, catops) == + #sig > 1 => axFormatOpSig(op,sig) + nsig := MSUBST('$,'($), sig) -- dcSig listifies '$ ?? + (catsigs := LASSOC(op, catops)) and + (catsig := assoc(nsig, catsigs)) and last(catsig) = 'CONST => + axFormatConstantOp(op, sig) + axFormatOpSig(op,sig) + +get1defaultOp(op,index) == + numvec := getCodeVector() + segment := getOpSegment index + numOfArgs := numvec.index + index := index + 1 + predNumber := numvec.index + index := index + 1 + signumList := + -- following substitution fixes the problem that default packages + -- have $ added as a first arg, thus other arg counts are off by 1. + SUBLISLIS($FormalMapVariableList, rest $FormalMapVariableList, + dcSig(numvec,index,numOfArgs)) + index := index + numOfArgs + 1 + slotNumber := numvec.index + if not([op,signumList] in $opList) then + $opList := [[op,signumList],:$opList] + index + 1 + +axAddLiteral(name, type, dom) == + elt := [name, type, dom] + if not member( elt, $literals) then + $literals := [elt, :$literals] + +axDoLiterals() == + [ [ 'Import, + [ 'With, [], + ['Declare, name, [ 'Apply, '_-_> , dom , '_% ]]], + type ] for [name, type, dom] in $literals] + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/axext_l.lisp.pamphlet b/src/interp/axext_l.lisp.pamphlet new file mode 100644 index 00000000..3d03127c --- /dev/null +++ b/src/interp/axext_l.lisp.pamphlet @@ -0,0 +1,230 @@ +%% Oh Emacs, this is a -*- Lisp -*- file despite apperance. +\documentclass{article} +\usepackage{axiom} + +\title{\File{src/interp/axext\_l.lisp} Pamphlet} +\author{Timothy Daly} + +\begin{document} +\maketitle + +\begin{abstract} +\end{abstract} + + +\tableofcontents +\eject + +\section{License} + +<>= +;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +;; All rights reserved. +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are +;; met: +;; +;; - Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; +;; - Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in +;; the documentation and/or other materials provided with the +;; distribution. +;; +;; - Neither the name of The Numerical ALgorithms Group Ltd. nor the +;; names of its contributors may be used to endorse or promote products +;; derived from this software without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +;; IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +;; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +;; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +;; OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +;; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +;; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + +;; File containing primitives needed by exextend in order to interop with axiom +;; This file could do with some declares + +(in-package "FOAM-USER") + +;; tacky but means we can run programs + +(defun H-integer (l e) + (|AXL-LiteralToInteger| l)) + +(defun H-string (l e) + (|AXL-LiteralToString| l)) + +(defun H-error (l e) + (|AXL-error| l)) + +(eval-when (load eval) + (defconstant |G-axclique_string_305639517| (cons #'H-String nil)) + (defconstant |G-axclique_integer_685864888| (cons #'H-integer nil)) + (defconstant |G-axclique_error_011667951| (cons #'H-error nil))) + +;; Literals should be null-terminated strings + +;; SingleInteger + +(defmacro |AXL-LiteralToSingleInteger| (l) + `(parse-integer ,l :junk-allowed t)) + +(defmacro |AXL-LiteralToInteger| (l) + `(parse-integer ,l :junk-allowed t)) + +(defmacro |AXL-LiteralToDoubleFloat| (l) + `(read-from-string ,l nil (|DFlo0|) + :preserve-whitespace t)) + +(defmacro |AXL-LiteralToString| (l) + `(subseq ,l 0 (- (length ,l) 1))) + +(defmacro |AXL-SingleIntegerToInteger| (si) + `(coerce (the |SInt| ,si) |BInt|)) + +(defmacro |AXL-StringToFloat| (s) + `(boot::|string2Float| ,s)) + +(defmacro |AXL-IntegerIsNonNegative| (i) + `(not (< ,i 0))) + +(defmacro |AXL-IntegerIsPositive| (i) + `(< 0 (the |BInt| ,i))) + +(defmacro |AXL-plusInteger| (a b) + `(the |BInt| (+ (the |BInt| ,a) + (the |BInt| ,b)))) + +(defmacro |AXL-minusInteger| (a b) + `(the |BInt| (- (the |BInt| ,a) + (the |BInt| ,b)))) + +(defmacro |AXL-timesInteger| (a b) + `(the |BInt| (* (the |BInt| ,a) + (the |BInt| ,b)))) + +(defmacro |AXL-eqInteger| (a b) + `(= (the |BInt| ,a) + (the |BInt| ,b))) + +(defmacro |AXL-ltInteger| (a b) + `(< (the |BInt| ,a) + (the |BInt| ,b))) + +(defmacro |AXL-leInteger| (a b) + `(<= (the |BInt| ,a) + (the |BInt| ,b))) + +(defmacro |AXL-gtInteger| (a b) + `(> (the |BInt| ,a) + (the |BInt| ,b))) + +(defmacro |AXL-geInteger| (a b) + `(>= (the |BInt| ,a) + (the |BInt| ,b))) + +(defmacro |AXL-plusSingleInteger| (a b) + `(the |SInt| (+ (the |SInt| ,a) + (the |SInt| ,b)))) + +(defmacro |AXL-minusSingleInteger| (a b) + `(the |SInt| (- (the |SInt| ,a) + (the |SInt| ,b)))) + +(defmacro |AXL-timesSingleInteger| (a b) + `(the |SInt| (* (the |SInt| ,a) + (the |SInt| ,b)))) + +(defmacro |AXL-eqSingleInteger| (a b) + `(= (the |SInt| ,a) + (the |SInt| ,b))) + +(defmacro |AXL-ltSingleInteger| (a b) + `(< (the |SInt| ,a) + (the |SInt| ,b))) + +(defmacro |AXL-leSingleInteger| (a b) + `(<= (the |SInt| ,a) + (the |SInt| ,b))) + +(defmacro |AXL-gtSingleInteger| (a b) + `(> (the |SInt| ,a) + (the |SInt| ,b))) + +(defmacro |AXL-geSingleInteger| (a b) + `(>= (the |SInt| ,a) + (the |SInt| ,b))) + +(defmacro |AXL-incSingleInteger| (i) + `(the |SInt| (+ (the |SInt| ,i) 1))) + +(defmacro |AXL-decSingleInteger| (i) + `(- (the |SInt| ,i) + (the |SInt| 1))) + +(defmacro |AXL-onefnSingleInteger| () '(the |SInt| 1)) +(defmacro |AXL-zerofnSingleInteger| () '(the |SInt| 0)) + +(defmacro |AXL-cons| (x y) + `(cons ,x ,y)) + +(defmacro |AXL-nilfn| () nil) + +(defmacro |AXL-car| (x) `(car ,x)) + +(defmacro |AXL-cdr| (x) `(cdr ,x)) + +(defmacro |AXL-null?| (x) `(null ,x)) + +(defmacro |AXL-rplaca| (x y) `(rplaca ,x ,y)) + +(defmacro |AXL-rplacd| (x y) `(rplacd ,x ,y)) + +(defmacro |AXL-error| (msg) `(error ,msg)) + +;; arrays +;; 0 based! +(defmacro |AXL-arrayRef| (arr i) + `(|AElt| ,arr ,i)) + +(defmacro |AXL-arraySet| (arr i v) + `(setf (|AElt| ,arr ,i) ,v)) + +(defmacro |AXL-arrayToList| (x) + `(coerce ,x 'list)) + +(defmacro |AXL-arraySize| (x) + `(length ,x)) + +(defmacro |AXL-arrayNew| (n) + `(make-array ,n)) + +(defmacro |AXL-arrayCopy| (x) + `(copy-seq ,x)) + +;; Vectors + + +;; Testing + +(defun |AXL-spitSInt| (x) + (print x)) + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/bc-matrix.boot.pamphlet b/src/interp/bc-matrix.boot.pamphlet new file mode 100644 index 00000000..008722a6 --- /dev/null +++ b/src/interp/bc-matrix.boot.pamphlet @@ -0,0 +1,175 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/interp bc-matrix.boot} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\section{License} +<>= +-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are +-- met: +-- +-- - Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- +-- - Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in +-- the documentation and/or other materials provided with the +-- distribution. +-- +-- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- names of its contributors may be used to endorse or promote products +-- derived from this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +-- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + +-- Basic Command matrix entry + +bcMatrix() == bcReadMatrix nil + +bcReadMatrix exitFunctionOrNil == + page := htInitPage('"Matrix Basic Command", nil) + htpSetProperty(page,'exitFunction,exitFunctionOrNil) + htMakePage + '((domainConditions + (isDomain PI (PositiveInteger))) + (text . "Enter the size of the matrix:") + (inputStrings + ("Number of {\em rows}:\space{3}" "" 5 2 rows PI) + ("Number of {\em columns}: " "" 5 2 cols PI)) + (text . "\blankline ") + (text . "How would you like to enter the matrix?") + (text . "\beginmenu") + (text . "\item ") + (bcLinks ("\menuitemstyle{By entering individual entries}" "" bcInputExplicitMatrix explicit)) + (text . "\item ") + (bcLinks ("\menuitemstyle{By formula}" "" bcInputMatrixByFormula formula)) + (text . "\endmenu")) + htShowPage() + +bcInputMatrixByFormula(htPage,junk) == + page := htInitPage('"Basic Matrix Command", htpPropertyList htPage) + htMakePage '( + (domainConditions + (isDomain S (Symbol)) + (isDomain FE (Expression (Integer)))) + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em row variable}: ") + (text . "\tab{36}") + (bcStrings (6 i rowVar S)) + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em column variable}: ") + (text . "\tab{36}") + (bcStrings (6 j colVar S)) + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the general {\em formula} for the entries:") + (text . "\newline\tab{2} ") + (bcStrings (40 "1/(x - i - j - 1)" formula FE))) + htMakeDoneButton('"Continue", 'bcInputMatrixByFormulaGen) + nrows := + null $bcParseOnly => objValUnwrap htpLabelSpadValue(htPage,'rows) + PARSE_-INTEGER htpLabelInputString(htPage,'rows) + ncols := + null $bcParseOnly => objValUnwrap htpLabelSpadValue(htPage,'cols) + PARSE_-INTEGER htpLabelInputString(htPage,'cols) + htpSetProperty(page, 'nrows, nrows) + htpSetProperty(page, 'ncols, ncols) + htShowPage() + +bcInputMatrixByFormulaGen htPage == + fun := htpProperty(htPage,'exitFunction) => FUNCALL(fun, htPage) + formula := htpLabelInputString(htPage,'formula) + rowVar := htpLabelInputString(htPage,'rowVar) + colVar := htpLabelInputString(htPage,'colVar) + nrows := htpProperty(htPage,'nrows) + ncols := htpProperty(htPage,'ncols) + bcGen STRCONC('"matrix([[",formula,'" for ",colVar,'" in 1..", + STRINGIMAGE ncols,'"] for ",rowVar,'" in 1..",STRINGIMAGE nrows,'"])") + +bcInputExplicitMatrix(htPage,junk) == + nrows := + null $bcParseOnly => objValUnwrap htpLabelSpadValue(htPage,'rows) + PARSE_-INTEGER htpLabelInputString(htPage,'rows) + ncols := + null $bcParseOnly => objValUnwrap htpLabelSpadValue(htPage,'cols) + PARSE_-INTEGER htpLabelInputString(htPage,'cols) + cond := nil + k := 0 + wrows := # STRINGIMAGE nrows + wcols := # STRINGIMAGE ncols + labelList := + "append"/[[f for j in 1..ncols] for i in 1..nrows] where f == + rowpart := STRCONC('"{\em Row",htStringPad(i,wrows)) + colpart := STRCONC('", Column",htStringPad(j,wcols),'":}\space{2}") + prefix := STRCONC(rowpart,colpart) + -- name := INTERN STRCONC(htMkName('"row",i),htMkName('"col",j)) + name := INTERN STRINGIMAGE (k := k + 1) + [prefix,'"",30, 0,name,'P] + labelList := + [['domainConditions, '(isDomain P (Polynomial $EmptyMode)), cond], + ['inputStrings, :labelList] ] + page := htInitPage('"Solve Basic Command", htpPropertyList htPage) + bcHt '"Enter the entries of the matrix:" + htMakePage labelList + htMakeDoneButton('"Continue", 'bcGenExplicitMatrix) + htpSetProperty(page,'nrows,nrows) + htpSetProperty(page,'ncols,ncols) + htShowPage() + +bcGenExplicitMatrix htPage == + htpSetProperty(htPage,'matrix,htpInputAreaAlist htPage) + fun := htpProperty(htPage,'exitFunction) => FUNCALL(fun, htPage) + bcGen bcMatrixGen htPage + +bcMatrixGen htPage == + nrows := htpProperty(htPage,'nrows) + ncols := htpProperty(htPage,'ncols) + mat := htpProperty(htPage,'matrix) + formula := LASSOC('formula,mat) => + formula := formula.0 + rowVar := LASSOC('rowVar,mat).0 + colVar := LASSOC('colVar,mat).0 + STRCONC('"matrix([[",formula,'" for ",colVar,'" in 1..", + STRINGIMAGE ncols,'"] for ",rowVar,'" in 1..",STRINGIMAGE nrows,'"])") + mat := htpProperty(htPage,'matrix) => + mat := REVERSE mat + k := -1 + matform := [[mat.(k := k + 1).1 + for j in 0..(ncols-1)] for i in 0..(nrows-1)] + matstring := bcwords2liststring [bcwords2liststring x for x in matform] + STRCONC('"matrix(",matstring,'")") + systemError nil + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/bc-misc.boot.pamphlet b/src/interp/bc-misc.boot.pamphlet new file mode 100644 index 00000000..8e879add --- /dev/null +++ b/src/interp/bc-misc.boot.pamphlet @@ -0,0 +1,946 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/interp bc-misc.boot} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\section{License} +<>= +-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are +-- met: +-- +-- - Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- +-- - Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in +-- the documentation and/or other materials provided with the +-- distribution. +-- +-- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- names of its contributors may be used to endorse or promote products +-- derived from this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +-- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + +--Hypertex commands other than solve and matrix + +bcDrawIt2(ind,a,b) == STRCONC('"{}",ind,'"=",a,'"{}..",b,'"{}") + +bcIndefiniteIntegrate() == + htInitPage("Indefinite Integration Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain S (String)) + (isDomain SY (Symbol))) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em function} you would like to integrate:") + (text . "\newline\tab{2} ") + (bcStrings (45 "1/(x**2 + 6)" integrand EM)) + (text . "\blankline") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em variable of integration}:") + (text . "\tab{37}") + (bcStrings (10 x symbol SY)) + (doneButton "Continue" bcIndefiniteIntegrateGen)) + htShowPage() + +bcIndefiniteIntegrateGen htPage == + integrand := htpLabelInputString(htPage,'integrand) + var := htpLabelInputString(htPage,'symbol) + bcGen STRCONC('"integrate(",integrand,'",",var,")") + + +bcDefiniteIntegrate() == + htInitPage("Definite Integration Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain S (String)) + (isDomain SY (Symbol))) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em function} you would like to integrate:") + (text . "\newline\tab{2} ") + (bcStrings (45 "1/(x**2 + 6)" integrand EM)) + (text . "\blankline") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em variable of integration}:") + (text . "\tab{37}") + (bcStrings (10 x symbol SY)) + (text . "\blankline") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline Enter {\em lower limit}:") + (radioButtons fromButton + ("" "Minus infinity" minusInfinity) + ("" ( + (text . "A finite point:\tab{15}") + (bcStrings (10 0 from EM . bcOptional))) fromPoint)) + (text . "\blankline") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\indent{2}\newline Enter {\em upper limit}:") + (radioButtons toButton + ("" "Plus infinity" plusInfinity) + ("" ( + (text "A finite point:\tab{15}") + (bcStrings (10 y to EM . bcOptional))) toPoint)) + (doneButton "Continue" bcDefiniteIntegrateGen)) + htShowPage() + +bcDefiniteIntegrateGen htPage == + integrand := htpLabelInputString(htPage,'integrand) + var := htpLabelInputString(htPage,'symbol) + lowerLimit := + htpButtonValue(htPage,'fromButton) = 'fromPoint => + htpLabelInputString(htPage,'from) + '"%minusInfinity" + upperLimit := + htpButtonValue(htPage,'toButton) = 'toPoint => + htpLabelInputString(htPage,'to) + '"%plusInfinity" + varpart := STRCONC(var,'" = ",lowerLimit,'"..",upperLimit) + bcGen + STRCONC('"integrate(",integrand,'",",varpart,'")") + +bcSum() == + htInitPage("Sum Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain S (String)) + (isDomain SY (Symbol))) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em function} you would like to sum:") + (text . "\newline\tab{2} ") + (bcStrings (44 "i**3" summand EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em summation index}:") + (text . "\tab{36}") + (bcStrings (10 i index SY)) + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the limits of the sum:") + (text . "\newline\tab{10}{\em From:}") + (bcStrings (10 1 first S)) + (text . "\tab{32}{\em To:}") + (text . "\tab{36}") + (bcStrings (10 n last S)) + (doneButton "Continue" bcSumGen)) + htShowPage() + +bcSumGen htPage == + mand := htpLabelInputString(htPage,'summand) + index := htpLabelInputString(htPage,'index) + first := htpLabelInputString(htPage,'first) + last := htpLabelInputString(htPage,'last) + bcGen STRCONC('"sum(",mand,'",",index,'" = ",first,'"..",last,'")") + +bcProduct() == + htInitPage("Product Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain S (String)) + (isDomain SY (Symbol))) + (text . "Enter the {\em function} you would like to compute the product of:") + (inputStrings ("" "" 45 "i**2" mand EM)) + (text . "\vspace{1}\newline") + (inputStrings ("Enter the {\em index of the product}:" "" 5 i index SY)) + (text . "\vspace{1}\newline Enter the limits of the index:") + (inputStrings + ("\newline{\em From:}" "" 10 "1" first EM) + ("{\em To:}\space{2}" "" 10 "n" last EM)) + (doneButton "Continue" bcProductGen)) + htShowPage() + +bcProductGen htPage == + mand := htpLabelInputString(htPage,'mand) + index := htpLabelInputString(htPage,'index) + first := htpLabelInputString(htPage,'first) + last := htpLabelInputString(htPage,'last) + bcGen STRCONC('"product(",mand,'",",index,'",",first,'",",last,'")") + +bcDifferentiate() == + htInitPage("Differentiate Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain S (String)) + (isDomain SY (Symbol))) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em function} you want to differentiate:") + (text . "\newline\tab{2} ") + (bcStrings (55 "sin(x*y)" diffand EM)) + (text . "\blankline") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline List the {\em variables} you want to differentiate with respect to?") + (text . "\newline\tab{2} ") + (bcStrings (55 "x y" variables S . quoteString)) + (text . "\blankline") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "\newline List the number of {\em times} you want to differentiate with respect to each variable (leave blank if once for each)") + (text . "\newline\tab{2} ") + (bcStrings (55 "1 2" times S . quoteString))) + htMakeDoneButton('"Continue", 'bcDifferentiateGen) + htShowPage() + +bcDifferentiateGen htPage == + mand := htpLabelInputString(htPage,'diffand) + varlist := bcString2WordList htpLabelInputString(htPage,'variables) + indexList := bcString2WordList htpLabelInputString(htPage,'times) + varpart := + #varlist > 1 => bcwords2liststring varlist + first varlist + indexpart := + null indexList => nil + null rest indexList => first indexList + #indexList = #varlist => bcwords2liststring indexList + bcError '"You must say how many times you want to differentiate with respect to each variable---or leave that entry blank" + lastPart := + indexpart => STRCONC('",",indexpart,'")") + '")" + bcGen STRCONC('"differentiate(",mand,'",",varpart,lastPart) + +bcDraw() == + htInitPage('"Draw Basic Command",nil) + bcHt '"What would you like to draw?" + bcHt '"\newline\centerline{{\em Two Dimensional Plots}}\newline" + bcHt '"\lispdownlink{A function of one variable}{(|bcDraw2Dfun|)}" + bcHt '"\space{2}y = f(x)\newline" + bcHt '"\lispdownlink{A parametrically defined curve}{(|bcDraw2Dpar|)}" + bcHt '"\space{2}(x(t), y(t))\newline" + bcHt '"\lispdownlink{A solution to a polynomial equation}{(|bcDraw2DSolve|)}" + bcHt '"\space{2} p(x,y) = 0\newline" + bcHt '"\vspace{1}\newline " + bcHt '"\centerline{{\em Three Dimensional Surfaces}}\newline\newline" + bcHt '"\lispdownlink{A function of two variables}{(|bcDraw3Dfun|)}" + bcHt '"\space{2} z = f(x,y)\newline" + bcHt '"\lispdownlink{A parametrically defined tube}{(|bcDraw3Dpar|)}" + bcHt '"\space{2}(x(t), y(t), z(t))\newline" + bcHt '"\lispdownlink{A parameterically defined surface}{(|bcDraw3Dpar1|)}" + bcHt '"\space{2}(x(u,v), y(u,v), z(u,v))\newline" + htShowPage() + + +bcDraw2Dfun() == + htInitPage('"Draw Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain F (Float)) + (isDomain SY (Symbol))) + (text + "\centerline{Drawing {\em y = f(x)}}\newline " + "\centerline{where {\em y} is the dependent variable and}\newline " + "\centerline{where {\em x} is the independent variable}\vspace{1}\newline " + "\menuitemstyle{}\tab{2}What {\em function} f would you like to draw?\newline\tab{2}") + (bcStrings (55 "x*cos(x)" function EM)) + (text . "\vspace{1}\newline\menuitemstyle{}\tab{2}Enter {\em dependent} variable:") + (bcStrings (6 y dependent SY)) + (text . "\newline\vspace{1}\newline ") + (text . "\menuitemstyle{}\tab{2}Enter {\em independent} variable and {\em range}:\newline\tab{2} ") + (text . "{\em Variable:}") + (bcStrings (6 x ind SY)) + (text . "ranges {\em from:}") + (bcStrings (9 0 from1 F)) + (text . "{\em to:}") + (bcStrings (9 30 to1 F)) + (text + "\indent{0}\vspace{1}\newline\menuitemstyle{}\tab{2} " + "Optionally enter a {\em title} for your curve:" + ) + (bcStrings (15 "y = x*cos(x)" title S)) + (text . "\indent{0}") + (doneButton "Continue" bcDraw2DfunGen) + (text . "{}")) + htShowPage() + +bcDraw2DfunGen htPage == + fun := htpLabelInputString(htPage,'function) + dep := htpLabelInputString(htPage,'dependent) + ind := htpLabelInputString(htPage,'ind) + from1 := htpLabelInputString(htPage,'from1) + to1 := htpLabelInputString(htPage,'to1) + title := htpLabelInputString(htPage,'title) + if (title ^= '"") then + titlePart := STRCONC('"{}",'"title ==_"",title,'"_"") + bcFinish('"draw",fun,bcDrawIt2(ind,from1,to1),titlePart) + else + bcFinish('"draw",fun,bcDrawIt2(ind,from1,to1)) + + +bcDraw2Dpar() == + htInitPage('"Draw Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain F (Float)) + (isDomain SY (Symbol))) + (text + "\centerline{Drawing a parametrically defined curve:}\newline " + "\centerline{{\em ( f1(t), f2(t) )}}\newline " + "\centerline{in terms of two functions {\em f1} and {\em f2}}" + "\centerline{and an independent variable {\em t}}\vspace{1}\newline" + "\menuitemstyle{}\tab{2}Enter the two {\em functions:}") + (text . "\newline\tab{2}{\em Function 1:}") + (bcStrings (44 "-9*sin(4*t/5)" function1 EM)) + (text . "\newline\tab{2}{\em Function 2:}") + (bcStrings (44 "8*sin(t)" function2 EM)) + (text ."\vspace{1}\newline\menuitemstyle{}\tab{2}Enter {\em independent} variable and range:\newline\tab{2} ") + (text . "{\em Variable:}") + (bcStrings (6 t ind SY)) + (text . "ranges {\em from:}") + (bcStrings (9 "-5*\%pi" from1 F)) + (text . "{\em to:}") + (bcStrings (9 "5*\%pi" to1 F)) + (text + "\vspace{1}\newline\menuitemstyle{}\tab{2}" + "Optionally enter a {\em title} for your curve:") + (bcStrings (15 "Lissajous" title S)) + (text . "\indent{0}") + (doneButton "Continue" bcDraw2DparGen)) + htShowPage() + +bcDraw2DparGen htPage == + fun1 := htpLabelInputString(htPage,'function1) + fun2 := htpLabelInputString(htPage,'function2) + ind := htpLabelInputString(htPage,'ind) + from1 := htpLabelInputString(htPage,'from1) + to1 := htpLabelInputString(htPage,'to1) + title := htpLabelInputString(htPage,'title) + curvePart := STRCONC('"curve(",'"{}",fun1,'",{}",fun2,'")") + if (title ^= '"") then + titlePart := (title = '"" => nil; STRCONC('"{}",'"title ==_"",title,'"_"")) + bcFinish('"draw",curvePart,bcDrawIt2(ind,from1,to1),titlePart) + else + bcFinish('"draw",curvePart,bcDrawIt2(ind,from1,to1)) + +bcDraw2DSolve() == + htInitPage('"Draw Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain F (Float)) + (isDomain SY (Symbol))) + (text + "\centerline{Plotting the solution to {\em p(x,y) = 0}, where} " + "\centerline{{\em p} is a polynomial in two variables {\em x} and {\em y}}" + "\vspace{1}\newline\menuitemstyle{}\tab{2}Enter the {\em polynomial} p:" + "\newline\tab{2}") + (bcStrings (40 "y**2+7*x*y-(x**3+16*x)" function EM)) + (text . "\vspace{1}\newline\menuitemstyle{}\tab{2}Enter the {\em variables}:") + (text . "\newline\tab{2}{\em Variable 1:} ") + (bcStrings (4 x independent1 SY)) + (text . "ranges {\em from:}") + (bcStrings (9 -15 from1 F)) + (text . "{\em to:}") + (bcStrings (9 10 to1 F)) + (text . "\newline\tab{2}{\em Variable 2:} ") + (bcStrings (4 y independent2 SY)) + (text . "ranges {\em from:}") + (bcStrings (9 -10 from2 F)) + (text . "{\em to:}") + (bcStrings (9 50 to2 F)) + (text + "\indent{0}\vspace{1}\newline\menuitemstyle{}\tab{2} " + "Optionally enter a {\em title} for your curve:") + (bcStrings (15 "" title S)) + (text . "\indent{0}")) + htMakeDoneButton('"Continue",'bcDraw2DSolveGen) + htShowPage() + +bcDraw2DSolveGen htPage == + fun := htpLabelInputString(htPage,'function) + ind1 := htpLabelInputString(htPage,'independent1) + from1 := htpLabelInputString(htPage,'from1) + to1 := htpLabelInputString(htPage,'to1) + ind2 := htpLabelInputString(htPage,'independent2) + from2 := htpLabelInputString(htPage,'from2) + to2 := htpLabelInputString(htPage,'to2) + title := htpLabelInputString(htPage,'title) + clipPart := STRCONC('"{}",'"range==[{}",from1,'"..",to1,",{}",from2,'"..",to2,'"]") + if (title ^= '"") then + titlePart := (title = '"" => nil; STRCONC('"{}",'"title ==_"",title,'"_"")) + bcFinish('"draw",STRCONC(fun,'" = 0 "),ind1,ind2,clipPart,titlePart) + else + bcFinish('"draw",STRCONC(fun,'" = 0 "),ind1,ind2,clipPart) + +bcDraw3Dfun() == + htInitPage('"Three Dimensional Draw Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain F (Float)) + (isDomain SY (Symbol))) + (text + "\centerline{Drawing {\em z = f(x,y)}}\newline " + "\centerline{where {\em z} is the dependent variable and}\newline " + "\centerline{where {\em x, y} are the independent variables}\vspace{1}\newline\menuitemstyle{}\tab{2} " + "What {\em function} f which you like to draw?\newline\tab{2}") + (bcStrings (55 "exp(cos(x-y)-sin(x*y))-2" function EM)) + (text . "\newline\menuitemstyle{}\tab{2}Enter {\em dependent} variable:") + (bcStrings (6 z dependent SY)) + (text + "\vspace{1}\newline\menuitemstyle{}\tab{2}" + "Enter {\em independent} variables and ranges:\newline\tab{2} " + "{\em Variable:}") + (bcStrings (6 x independent1 SY)) + (text . "ranges {\em from:}") + (bcStrings (9 -5 from1 F)) + (text . "{\em to:}") + (bcStrings (9 5 to1 F)) + (text . "\newline\tab{2}{\em Variable:}") + (bcStrings (6 y independent2 SY)) + (text . "ranges {\em from:}") + (bcStrings (9 -5 from2 F)) + (text . "{\em to:}") + (bcStrings (9 5 to2 F)) + (text + "\indent{0}\vspace{1}\newline\menuitemstyle{}\tab{2} " + "Optionally enter a {\em title} for your surface:") + (bcStrings (15 "" title S)) + (text . "\indent{0}") + (doneButton "Continue" bcDraw3DfunGen)) + htShowPage() + +bcDraw3DfunGen htPage == + fun := htpLabelInputString(htPage,'function) + dep := htpLabelInputString(htPage,'dependent) + ind1 := htpLabelInputString(htPage,'independent1) + from1 := htpLabelInputString(htPage,'from1) + to1 := htpLabelInputString(htPage,'to1) + ind2 := htpLabelInputString(htPage,'independent2) + from2 := htpLabelInputString(htPage,'from2) + to2 := htpLabelInputString(htPage,'to2) + title := htpLabelInputString(htPage,'title) + if (title ^= '"") then + titlePart := (title = '"" => nil;STRCONC('"{}",'"title ==_"",title,'"_"")) + bcFinish('"draw",fun,bcDrawIt2(ind1,from1,to1),bcDrawIt2(ind2,from2,to2),titlePart) + else + bcFinish('"draw",fun,bcDrawIt2(ind1,from1,to1),bcDrawIt2(ind2,from2,to2)) + +bcDraw3Dpar() == + htInitPage('"Draw Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain F (Float)) + (isDomain SY (Symbol))) + (text + "\centerline{Drawing a parametrically defined curve:" + "{\em ( f1(t), f2(t), f3(t) )}}\newline " + "\centerline{in terms of three functions {\em f1}, {\em f2}, and {\em f3}}\newline " + "\centerline{and an independent variable {\em t}}\vspace{1}\newline\menuitemstyle{}\tab{2} " + "Enter the three {\em functions} of the independent variable:") + (text . "\newline\tab{2}{\em Function f1:}") + (bcStrings (42 "1.3*cos(2*t)*cos(4*t) + sin(4*t)*cos(t)" function1 EM)) + (text . "\newline\tab{2}{\em Function f2:}") + (bcStrings (42 "1.3*sin(2*t)*cos(4*t) - sin(4*t)*sin(t)" function2 EM)) + (text . "\newline\tab{2}{\em Function f3:}") + (bcStrings (42 "2.5*cos(4*t)" function3 EM)) + (text ."\vspace{1}\newline\menuitemstyle{}\tab{2}Enter {\em independent} variable and range:\newline\tab{2} ") + (text ."{\em Variable:}") + (bcStrings (6 t ind SY)) + (text . "ranges {\em from:}") + (bcStrings (9 0 from1 F)) + (text "{\em to:}") + (bcStrings (9 "4*\%pi" to1 F)) + (text + "\indent{0}\vspace{1}\newline\menuitemstyle{}\tab{2} " + "Optionally enter a {\em title} for your surface:") + (bcStrings (15 "knot" title S)) + (text . "\indent{0}") + (doneButton "Continue" bcDraw3DparGen)) + htShowPage() + +bcDraw3DparGen htPage == + fun1 := htpLabelInputString(htPage,'function1) + fun2 := htpLabelInputString(htPage,'function2) + fun3 := htpLabelInputString(htPage,'function3) + ind := htpLabelInputString(htPage,'ind) + from1 := htpLabelInputString(htPage,'from1) + to1 := htpLabelInputString(htPage,'to1) + title := htpLabelInputString(htPage,'title) + curvePart := STRCONC('"curve(",'"{}",fun1,'",{}",fun2,'",{}",fun3,'")") + tubePart := '"{}tubeRadius==.25,{}tubePoints==16" + if (title ^= '"") then + titlePart := (title = '"" => nil; STRCONC('"{}",'"title ==_"",title,'"_"")) + bcFinish('"draw",curvePart,bcDrawIt2(ind,from1,to1),tubePart,titlePart) + else + bcFinish('"draw",curvePart,bcDrawIt2(ind,from1,to1),tubePart) + +bcDraw3Dpar1() == + htInitPage('"Draw Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain F (Float)) + (isDomain SY (Symbol))) + (text + "\centerline{Drawing a parametrically defined surface:}\newline " + "\centerline{{\em ( f1(u,v), f2(u,v), f3(u,v) )}}\newline " + "\centerline{in terms of three functions {\em f1}, {\em f2}, and {\em f3}}\newline " + "\centerline{and two independent variables {\em u} and {\em v}}\vspace{1}\newline\menuitemstyle{}\tab{2}" + "Enter the three {\em functions} of the independent variables:") + (text . "\newline\tab{2}") + (text . "{\em Function f1:}") + (bcStrings (43 "u*sin(v)" function1 EM)) + (text . "\newline\tab{2}") + (text . "{\em Function f2:}") + (bcStrings (43 "v*cos(u)" function2 EM)) + (text . "\newline\tab{2}") + (text . "{\em Function f3:}") + (bcStrings (43 "u*cos(v)" function3 EM)) + (text . "\newline\menuitemstyle{}\tab{2}Enter independent {\em variables} and ranges:") + (text . "\newline\tab{2}") + (text . "{\em Variable 1:}") + (bcStrings (5 u ind1 SY)) + (text . "ranges {\em from:}") + (bcStrings (9 "-\%pi" from1 F)) + (text . "{\em to:}") + (bcStrings (9 "\%pi" to1 F)) + (text . "\newline\tab{2}") + (text . "{\em Variable 2:}") + (bcStrings (5 v ind2 SY)) + (text . "ranges {\em from:}") + (bcStrings (9 "-\%pi/2" from2 F)) + (text . "{\em to:}") + (bcStrings (9 "\%pi/2" to2 F)) + (text + "\indent{0}\newline\menuitemstyle{}\tab{2} " + "Optionally enter a {\em title} for your surface:") + (bcStrings (15 "surface" title S)) + (text . "\indent{0}")) + htMakeDoneButton ('"Continue",'bcDraw3Dpar1Gen) + htShowPage() + +bcDraw3Dpar1Gen htPage == + fun1 := htpLabelInputString(htPage,'function1) + fun2 := htpLabelInputString(htPage,'function2) + fun3 := htpLabelInputString(htPage,'function3) + ind1 := htpLabelInputString(htPage,'ind1) + from1 := htpLabelInputString(htPage,'from1) + to1 := htpLabelInputString(htPage,'to1) + ind2 := htpLabelInputString(htPage,'ind2) + from2 := htpLabelInputString(htPage,'from2) + to2 := htpLabelInputString(htPage,'to2) + title := htpLabelInputString(htPage,'title) + r1 := bcDrawIt2(ind1,from1,to1) + r2 := bcDrawIt2(ind2,from2,to2) + surfacePart := STRCONC('"surface(",'"{}",fun1,'",{}",fun2,'",{}",fun3,'")") + if (title ^= '"") then + titlePart := (title = '"" => nil; STRCONC('"{}",'"title ==_"",title,'"_"")) + bcFinish('"draw",surfacePart,r1,r2,titlePart) + else + bcFinish('"draw",surfacePart,r1,r2) + +bcSeries() == + htInitPage('"Series Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain S (String)) + (isDomain SY (Symbol))) + (text . "Create a series by: ") + (text . "\beginmenu") + (text . "\item ") + (bcLinks ("\menuitemstyle{Expansion}" "" bcSeriesExpansion NILl)) + (text . "\tab{11}Expand a function in a series around a point") + (text . "\item ") + (bcLinks ("\menuitemstyle{Formula}" "" bcSeriesByFormula NIL)) + (text . "\tab{11}Give a formula for the {\em i}'th coefficient") + (text . "\endmenu")) + htShowPage() + +bcSeriesExpansion(a,b) == + htInitPage('"Series Expansion Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain EEM (Expression $EmptyMode)) + (isDomain S (String)) + (isDomain SY (Symbol))) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em function} you want to expand in a power series") + (text . "\newline\tab{2} ") + (bcStrings (55 "log(cot(x))" function EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em power series variable}") + (text . "\tab{49}") + (bcStrings (8 x variable SY)) + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em point} about which you want to expand") + (text . "\tab{49}") + (bcStrings (8 "\%pi/2" point EM))) + htMakeDoneButton('"Continue",'bcSeriesExpansionGen) + htShowPage() + +bcSeriesExpansionGen htPage == + fun := htpLabelInputString(htPage,'function) + var := htpLabelInputString(htPage,'variable) + point := htpLabelInputString(htPage,'point) + terms := htpLabelInputString(htPage,'numberOfTerms) + bcFinish("series",fun,STRCONC(var,'" = ",point)) + +bcSeriesByFormula(a,b) == + htInitPage('"Power Series Basic Command",nil) + htMakePage '( + (text . "Select the kind of power series you want to create:") + (text . "\beginmenu") + (text . "\item ") + (bcLinks ("\menuitemstyle{Taylor Series}" "" bcTaylorSeries taylor)) + (text . "\newline Series where the exponent ranges over the integers from a {\em non-negative integer} value to plus infinity by an arbitrary {\em positive integer} step size") + (text . "\item ") + (bcLinks ("\menuitemstyle{Laurent Series}" "" bcLaurentSeries laurent)) + (text . "\newline Series where the exponent ranges from an arbitrary {\em integer} value to plus infinity by an arbitrary {\em positive integer} step size") + (text . "\item ") + (bcLinks ("\menuitemstyle{Puiseux Series}" "" bcPuiseuxSeries puiseux)) + (text . "\newline Series where the exponent ranges from an arbitrary {\em rational value} to plus infinity by an arbitrary {\em positive rational number} step size") + (text . "\endmenu")) + htShowPage() + +bcTaylorSeries(a,b) == + htInitPage('"Taylor Series Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain EEM (Expression $EmptyMode)) + (isDomain S (String)) + (isDomain SY (Symbol))) + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the formula for the general coefficient of the series") + (text . "\newline\tab{2} ") + (bcStrings (55 "1/factorial(i)" formula EM)) + (text . "\blankline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em index variable} for your formula") + (text . "\tab{49}") + (bcStrings (8 i index SY)) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em power series variable}") + (text . "\tab{49}") + (bcStrings (8 x variable SY)) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em point} about which you want to expand") + (text . "\tab{49}") + (bcStrings (8 0 point EM)) + (text . "\blankline ") + (text ."For Taylor Series, the exponent of the power series variable ranges from an {\em initial value}, an arbitrary non-negative integer, to plus infinity; the {\em step size} is any positive integer.") + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em initial value} of the index (an integer)") + (text . "\tab{49}") + (bcStrings (8 "0" min I)) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em step size} (a positive integer)") + (text . "\tab{49}") + (bcStrings (8 "1" step PI)) + (doneButton "Continue" bcTaylorSeriesGen)) + htShowPage() + +bcSeriesByFormulaGen htPage == bcNotReady() + +bcLaurentSeries(a,b) == + htInitPage('"Laurent Series Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain EEM (Expression $EmptyMode)) + (isDomain S (String)) + (isDomain I (Integer)) + (isDomain PI (PositiveInteger)) + (isDomain SY (Symbol))) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the formula for the general coefficient of the series") + (text . "\newline\tab{2} ") + (bcStrings (55 "(-1)**(n - 1)/(n + 2)" formula EM)) + (text . "\vspace{1}\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em index variable} for your formula") + (text . "\tab{49}") + (bcStrings (8 n index SY)) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em power series variable}") + (text . "\tab{49}") + (bcStrings (8 x variable SY)) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em point} about which you want to expand") + (text . "\tab{49}") + (bcStrings (8 0 point F)) + (text . "\blankline") + (text . "\newline For Laurent Series, the exponent of the power series variable ranges from an {\em initial value}, an arbitrary integer value, to plus infinity; the {\em step size} is any positive integer.") + (text . "\blankline") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em initial value} of the index (an integer)") + (text . "\tab{49}") + (bcStrings (8 "-1" min I)) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em step size} (a positive integer)") + (text . "\tab{49}") + (bcStrings (8 "1" step PI)) + (doneButton "Continue" bcLaurentSeriesGen)) + htShowPage() + +bcPuiseuxSeries(a,b) == + htInitPage('"Puiseux Series Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain EEM (Expression $EmptyMode)) + (isDomain S (String)) + (isDomain I (Integer)) + (isDomain PI (PositiveInteger)) + (isDOmain RN (Fraction (Integer))) + (isDomain SY (Symbol))) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text ."Enter the {\em formula} for the general coefficient of the series") + (text . "\newline\tab{2} ") + (bcStrings(55 "(-1)**((3*n - 4)/6)/factorial(n - 1/3)" formula EM)) + (text . "\vspace{1}\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em index variable} for your formula") + (text . "\tab{49}") + (bcStrings (8 n index SY)) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em power series variable}") + (text . "\tab{49}") + (bcStrings (8 x variable SY)) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em point} about which you want to expand") + (text . "\tab{49}") + (bcStrings (8 0 point F)) + (text . "\blankline ") + (text . "For Puiseux Series, the exponent of the power series variable ranges from an {\em initial value}, an arbitary rational number, to plus infinity; the {\em step size} is an any positive rational number.") + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em initial value} of index (a rational number)") + (text . "\tab{51}") + (bcStrings (6 "4/3" min RN)) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em step size} (a positive rational number)") + (text . "\tab{51}") + (bcStrings (6 "2" step RN)) + (doneButton "Continue" bcPuiseuxSeriesGen)) + htShowPage() + +bcTaylorSeriesGen htPage == bcSeriesGen(htPage) + +bcLaurentSeriesGen htPage == + bcSeriesGen(htPage) + +bcPuiseuxSeriesGen htPage == + bcSeriesGen(htPage) + +bcSeriesGen(htPage) == + step:= htpLabelInputString(htPage,'step) + min := htpLabelInputString(htPage,'min) + formula := htpLabelInputString(htPage,'formula) + index := htpLabelInputString(htPage,'index) + var := htpLabelInputString(htPage,'variable) + point := htpLabelInputString(htPage,'point) + varPart := STRCONC(var,'" = ",point) + minPart := STRCONC(min,'"..") + bcFinish('"series",STRCONC(index,'" +-> ",formula),varPart,minPart,step) + +bcLimit() == + htInitPage('"Limit Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain S (String)) + (isDomain SY (Symbol))) + (text . "What kind of limit do you want to compute? ") + (text . "\blankline ") + (text . "\beginmenu") + (text . "\item ") + (bcLinks ("\menuitemstyle{A real limit?}" "" bcRealLimit real)) + (text . "\indentrel{17}\tab{0}") + (text . "The limit as the variable approaches a {\em real} value along the real axis") + (text . "\indentrel{-17}") + (text . "\item ") + (text . "\blankline ") + (bcLinks ("\menuitemstyle{A complex limit?}" "" bcComplexLimit complex)) + (text . "\indentrel{17}\tab{0}") + (text . "The limit as the variable approaches a {\em complex} value along any path in the complex plane") + (text . "\indentrel{-17}") + (text . "\endmenu") + ) + htShowPage() + +bcRealLimit(a,b) == + htInitPage('"Real Limit Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain S (String)) + (isDomain F (Float)) + (isDomain SY (Symbol))) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em function} you want to compute the limit of:") + (text . "\newline\tab{2} ") + (bcStrings (45 "x*sin(1/x)" expression EM)) + (text . "\blankline") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the name of the {\em variable}: ") + (text . "\tab{41}") + (bcStrings (6 x variable SY)) + (text . "\blankline") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Compute the limit at") + (radioButtons location + ("A finite point:" ( + (text . "\tab{33}") + (bcStrings (6 0 point F))) finitePoint) + ("Plus infinity" "" plusInfinity) + ("Minus infinity" "" minusInfinity)) + (doneButton "Continue" bcRealLimitGen)) + htShowPage() + +bcRealLimitGen htPage == + (p := htpButtonValue(htPage,'location)) ^= 'finitePoint => + fun := htpLabelInputString(htPage,'expression) + var := htpLabelInputString(htPage,'variable) + loc := + p = 'plusInfinity => '"%plusInfinity" + '"%minusInfinity" + bcFinish('"limit",fun,STRCONC(var,'" = ",loc)) + page := htInitPage('"Real Limit Basic Command",nil) + htMakePage '( + (text . "Compute the limit") + (lispLinks + ("\menuitemstyle{From both directions}" "" bcRealLimitGen1 both) + ("\menuitemstyle{From the right}" "" bcRealLimitGen1 right) + ("\menuitemstyle{From the left}" "" bcRealLimitGen1 left))) + htpSetProperty(page,'fun,htpLabelInputString(htPage,'expression)) + htpSetProperty(page,'var,htpLabelInputString(htPage,'variable)) + htpSetProperty(page,'loc,htpLabelInputString(htPage,'point)) + htShowPage() + +bcRealLimitGen1(htPage,key) == + direction := + key = 'right => '"_"right_"" + key = 'left => '"_"left_"" + nil + fun := htpProperty(htPage,'fun) + var := htpProperty(htPage,'var) + loc := htpProperty(htPage,'loc) + varPart := STRCONC(var,'" = ",loc) + bcFinish('"limit",fun,varPart,direction) + +bcComplexLimit(a,b) == + htInitPage('"Complex Limit Basic Command",nil) + htMakePage '( + (domainConditions + (isDomain EM $EmptyMode) + (isDomain S (String)) + (isDomain F (Float)) + (isDomain SY (Symbol))) + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the {\em function} you want to compute the limit of:") + (text . "\newline\tab{2} ") + (bcStrings (40 "sin(a*x)/tan(b*x)" expression EM)) + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Enter the name of the {\em variable}: ") + (text . "\tab{37}") + (bcStrings (5 x variable SY)) + (text . "\blankline ") + (text . "\newline ") + (text . "\menuitemstyle{}\tab{2}") + (text . "Compute the limit at") + (radioButtons location + ("A finite point:" ( + (text . "\newline\space{0}Real part:\space{3}") + (bcStrings (20 0 real F)) + (text . "\newline Complex part:") + (bcStrings (20 0 complex F))) finitePoint) + ("Complex infinity" "" complexInfinity)) + (doneButton "Continue" bcComplexLimitGen)) + htShowPage() + +bcComplexLimitGen htPage == + fun := htpLabelInputString(htPage,'expression) + var := htpLabelInputString(htPage,'variable) + loc := + (p := htpButtonValue(htPage,'location)) = 'finitePoint => + real := htpLabelInputString(htPage,'real) + comp := htpLabelInputString(htPage,'complex) + complexPart := + comp = '"0" => '"" + comp = '"1" => '"%i" + STRCONC(comp,'"*%i") + real = '"0" => + complexPart = '"" => "0" + complexPart + complexPart = '"" => real + STRCONC(real,'" + ",complexPart) + '"%infinity" + varPart := STRCONC(var,'" = ",loc) + bcFinish('"complexLimit",fun,varPart) + + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/bc-solve.boot.pamphlet b/src/interp/bc-solve.boot.pamphlet new file mode 100644 index 00000000..56314441 --- /dev/null +++ b/src/interp/bc-solve.boot.pamphlet @@ -0,0 +1,384 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/interp bc-solve.boot} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\section{License} +<>= +-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are +-- met: +-- +-- - Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- +-- - Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in +-- the documentation and/or other materials provided with the +-- distribution. +-- +-- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- names of its contributors may be used to endorse or promote products +-- derived from this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +-- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + + -- HyperTeX basic Solve Command +$systemType := nil +$numberOfEquations := 0 +$solutionMethod := nil + +bcSolve() == + htInitPage('"Solve Basic Command", nil) + htMakePage '( + (text . "What do you want to solve? ") + (text . "\beginmenu") + (text . "\item ") + (bcLinks ("\menuitemstyle{A System Of Linear Equations}" "" bcLinearSolve linear)) + (text . "\item ") + (bcLinks ("\menuitemstyle{A System of Polynomial Equations}" "" bcSystemSolve polynomial)) + (text . "\item ") + (bcLinks ("\menuitemstyle{A Single Polynomial Equation}" "" bcSolveSingle onePolynomial)) + (text . "\endmenu")) + htShowPage() + +bcLinearSolve(p,nn) == + htInitPage('"Basic Solve Command", nil) + htMakePage '( + (text . "How do you want to enter the equations?") + (text . "\beginmenu") + (text . "\item ") + (text . "\newline ") + (bcLinks ("\menuitemstyle{Directly as equations}" "" bcLinearSolveEqns equations)) + (text . "\item ") + (text . "\newline ") + (bcLinks ("\menuitemstyle{In matrix form}" "" bcLinearSolveMatrix matrix)) + (text . "\indentrel{16}\tab{0}") + (text . " \spad{AX = B}, where \spad{A} is a matrix of coefficients and \spad{B} is a vector" ) + (text . "\indentrel{-16}\item ") + (text . "\endmenu")) + htShowPage() + +bcLinearSolveEqns(htPage, p) == + htInitPage('"Basic Solve Command", nil) + htMakePage '( + (domainConditions (isDomain PI (PositiveInteger))) + (inputStrings + ("Enter the {\em number} of equations:" "" 5 2 numberOfEquations PI))) + htMakeDoneButton('"Continue", 'bcLinearSolveEqns1) + htShowPage() + +bcSystemSolve(htPage, p) == + htInitPage('"Basic Solve Command", nil) + htMakePage '( + (domainConditions (isDomain PI (PositiveInteger))) + (inputStrings + ("Enter the {\em number} of equations:" "" 5 2 numberOfEquations PI))) + htMakeDoneButton('"Continue", 'bcSystemSolveEqns1) + htShowPage() + +bcSolveSingle(htPage,p) == + htpSetProperty(htPage,'systemType, 'onePolynomial) + htpSetProperty(htPage,'exitFunction,'bcInputSolveInfo) + bcInputEquations(htPage,'exact) + +bcSystemSolveEqns1 htPage == + htpSetProperty(htPage,'systemType,'polynomial) + htpSetProperty(htPage,'exitFunction,'bcInputSolveInfo) + bcInputEquations(htPage,'exact) + +bcLinearSolveEqns1 htPage == + htpSetProperty(htPage,'systemType,'linear) + htpSetProperty(htPage,'exitFunction,'bcLinearSolveEqnsGen) + bcInputEquations(htPage,'exact) + +bcInputSolveInfo htPage == + page := htInitPage('"Solve Basic Command", htpPropertyList htPage) + htpSetProperty(page,'numberOfEquations,htpProperty(htPage,'numberOfEquations)) + htpSetProperty(page,'inputArea,htpInputAreaAlist htPage) + htMakePage '( + (domainConditions (isDomain PI (PositiveInteger))) + (text . "What would you like?") + (text . "\beginmenu") + (text . "\item ") + (bcLinks ("\menuitemstyle{Exact Solutions}" "" bcSolveEquations exact)) + (text . "\indentrel{18}\tab{0} ") + (text . "Solutions expressed in terms of {\em roots} of irreducible polynomials") + (text . "\indentrel{-18}") + (text . "\item ") + (bcLinks ("\menuitemstyle{Numeric Solutions}" "" bcSolveEquationsNumerically numeric)) + (text . "\indentrel{18}\tab{0} ") + (text . "Solutions expressed in terms of approximate real or complex {\em numbers}") + (text . "\indentrel{-18}") + (text . "\item ") + (bcLinks ("\menuitemstyle{Radical Solutions}" "" bcSolveEquations radical)) + (text . "\indentrel{18}\tab{0} ") + (text . "Solutions expressed in terms of {\em radicals} if it is possible") + (text . "\indentrel{-18}") + (text . "\endmenu")) + htShowPage() + +bcInputEquations(htPage,solutionMethod) == + numEqs := + htpProperty(htPage, 'systemType) = 'onePolynomial => 1 + $bcParseOnly => PARSE_-INTEGER htpLabelInputString(htPage,'numberOfEquations) + objValUnwrap htpLabelSpadValue(htPage, 'numberOfEquations) + linearPred := htpProperty(htPage,'systemType) = 'linear + labelList := + numEqs = 1 => '( + (bcStrings (42 "x^2+1" l1 P)) + (text . " = ") + (bcStrings (6 0 r1 P))) + "append"/[f(i,numEqs,linearPred) for i in 1..numEqs] where f(i,n,linearp) == + spacer := (i > 99 => 0; i > 9 => 1; 2) + prefix := STRCONC('"\newline\tab{2}{\em Equation ",STRINGIMAGE i,'":}") + prefix := STRCONC(prefix,'"\space{",STRINGIMAGE spacer,'"}") + lnam := INTERN STRCONC('"l",STRINGIMAGE i) + rnam := INTERN STRCONC('"r",STRINGIMAGE i) + var:= + linearp => bcMakeLinearEquations(i,n) + bcMakeEquations(i,n) + [['text,:prefix],['bcStrings,[30,var,lnam,'P]],'(text . " = "),['bcStrings,[5,"0",rnam,'P]]] + equationPart := [ + '(domainConditions + (isDomain P (Polynomial $EmptyMode)) + (isDomain S (String)) + (isDomain PI (PositiveInteger))), + :labelList] + page := htInitPage('"Solve Basic Command", htpPropertyList htPage) + htpSetProperty(page, 'numberOfEquations, numEqs) + htpSetProperty(page, 'solutionMethod,solutionMethod) + htSay '"\newline\menuitemstyle{}\tab{2}" + htSay + numEqs = 1 => '"Enter the {\em Equation}:" + '"Enter the {\em Equations}:" + htSay '"\newline\tab{2}" + htMakePage equationPart + bcHt '"\blankline " + htSay '"\newline\menuitemstyle{}\tab{2}" + htMakePage + numEqs = 1 => '( + (text ."Enter the {\em unknown} (leave blank if implied): ") + (text . "\tab{48}") + (bcStrings (6 "x" unknowns S . quoteString))) + ['(text . "Enter the unknowns (leave blank if implied):"), + '(text . "\tab{44}"), + ['bcStrings, [10,bcMakeUnknowns(numEqs),'unknowns,'P]]] + htMakeDoneButton('"Continue", 'bcInputEquationsEnd) + htShowPage() + +bcCreateVariableString(i) == + STRCONC('"x",STRINGIMAGE i) + +bcMakeUnknowns(number)== + APPLY('CONCAT,[STRCONC(bcCreateVariableString(i)," ") for i in 1..number]) + +bcMakeEquations(i,number)== + number =1 => STRCONC(bcCreateVariableString(1),"^2+1") + bcCreateVariableString(i) + STRCONC( + STRCONC( + APPLY('CONCAT,[STRCONC(bcCreateVariableString(j),"+") for j in 1..number]),"1"), + STRCONC("-2*",STRCONC(bcCreateVariableString(i),"^2"))) + + +bcMakeLinearEquations(i,number)== + number = 1 => bcCreateVariableString(1) + number = 2 => + i=1 => STRCONC(bcCreateVariableString(1),STRCONC("+",bcCreateVariableString(2))) + STRCONC(bcCreateVariableString(1),STRCONC("-",bcCreateVariableString(2))) + STRCONC( + STRCONC( + APPLY('CONCAT,[STRCONC(bcCreateVariableString(j),"+") for j in 1..number]),"1"), + STRCONC("-2*",bcCreateVariableString(i))) + + +bcInputEquationsEnd htPage == + fun := htpProperty(htPage, 'exitFunction) => FUNCALL(fun,htPage) + systemError nil + +bcSolveEquationsNumerically(htPage,p) == + page := htInitPage('"Solve Basic Command", htpPropertyList htPage) + htMakePage '( + (text . "What would you like?") + (radioButtons choice + ("Real roots expressed as rational numbers" "" rr) + ("Real roots expressed as floats" "" rf) + ("Complex roots expressed as rational numbers" "" cr) + ("Complex roots expressed as floats" "" cf)) + (text . "\vspace{1}\newline") + (inputStrings + ("Enter the number of desired {\em digits} of accuracy" "" 5 20 acc PI))) + htMakeDoneButton('"Continue", 'bcSolveNumerically1) + htShowPage() + +bcSolveNumerically1(htPage) == + bcSolveEquations(htPage,'numeric) + +--bcSolveNumerically1(htPage,kind) == +-- htpSetProperty(htPage,'kind,kind) +-- bcSolveEquations(htPage,'numeric) + +bcSolveEquations(htPage,solutionMethod) == + if solutionMethod = 'numeric then + digits := htpLabelInputString(htPage,'acc) + kind := htpButtonValue(htPage,'choice) + accString := + kind in '(rf cf) => STRCONC('"1.e-",digits) + STRCONC('"1/10**",digits) + alist := htpProperty(htPage,'inputArea) + [[.,varpart,:.],:r] := alist + varlist := bcString2WordList varpart + varString := (rest varlist => bcwords2liststring varlist; first varlist) + eqnString := bcGenEquations r + solutionMethod = 'numeric => + name := + kind in '(rf rr) => '"solve" + '"complexSolve" + bcFinish(name,eqnString,accString) + name := + solutionMethod = 'radical => '"radicalSolve" + '"solve" + bcFinish(name,eqnString,varString,accString) + +bcLinearSolveMatrix(htPage,junk) == + bcReadMatrix 'bcLinearSolveMatrix1 + +bcLinearSolveMatrix1 htPage == + page := htInitPage('"Linear Solve Basic Command",htpPropertyList htPage) + htpSetProperty(page,'matrix,bcLinearExtractMatrix htPage) + htMakePage '( + (text . "The right side vector B is:") + (lispLinks + ("Zero:" "the system is homogeneous" bcLinearSolveMatrixHomo homo) + ("Not zero:" "the system is not homogeneous" bcLinearSolveMatrixInhomo nothomo))) + htShowPage() + +bcLinearExtractMatrix htPage == REVERSE htpInputAreaAlist htPage + +bcLinearSolveMatrixInhomo(htPage,junk) == + nrows := htpProperty(htPage,'nrows) + ncols := htpProperty(htPage,'ncols) + labelList := + [f(i) for i in 1..ncols] where f(i) == + spacer := (i > 99 => 0; i > 9 => 1; 2) + prefix := STRCONC('"{\em Coefficient ",STRINGIMAGE i,'":}") + if spacer ^= 0 then + prefix := STRCONC(prefix,'"\space{",STRINGIMAGE spacer,'"}") + name := INTERN STRCONC('"c",STRINGIMAGE i) + [prefix,"",30, 0,name, 'P] + page := htInitPage('"Linear Solve Basic Command",htpPropertyList htPage) + htpSetProperty(page,'matrix,htpProperty(htPage,'matrix)) + htpSetProperty(page,'nrows,nrows) + htpSetProperty(page,'ncols,ncols) + htMakePage [ + '(domainConditions (isDomain P (Polynomial $EmptyMode))), + '(text . "Enter the right side vector B:"), + ['inputStrings, :labelList], + '(text . "\vspace{1}\newline Do you want:" ), + '(lispLinks + ("All the solutions?" "" bcLinearSolveMatrixInhomoGen all) + ("A particular solution?" "" bcLinearSolveMatrixInhomoGen particular))] + htShowPage() + +bcLinearSolveMatrixInhomoGen(htPage,key) == bcLinearMatrixGen(htPage,key) + +bcLinearSolveMatrixHomo(htPage,key) == bcLinearMatrixGen(htPage,'homo) + +bcLinearMatrixGen(htPage,key) == + matform := bcMatrixGen htPage + key = 'homo => bcFinish('"nullSpace",matform) + vector := [x.1 for x in REVERSE htpInputAreaAlist htPage] + vecform := bcVectorGen vector + form := bcMkFunction('"solve",matform,[vecform]) + bcGen + key = 'particular => STRCONC(form,'".particular") + form + +linearFinalRequest(nhh,mat,vect) == + sayBrightly '"Do you want more information on the meaning of the output" + sayBrightly '" (1) no " + sayBrightly '" (2) yes " + tt := bcQueryInteger(1,2,true) + tt=1 => sayBrightly '"Bye Bye" + tt=2 => explainLinear(nhh) + +explainLinear(flag) == + flag="notHomogeneous" => + '("solve returns a particular solution and a basis for" + "the vector space of solutions for the homogeneous part." + "The particular solution is _"failed_" if one cannot be found.") + flag= "homogeneous" => + '("solve returns a basis for" + "the vector space of solutions for the homogeneous part") + systemError nil + +finalExactRequest(equations,unknowns) == + sayBrightly '"Do you like:" + sayBrightly '" (1) the solutions how they are displayed" + sayBrightly '" (2) to get ????" + sayBrightly '" (3) more information on the meaning of the output" + tt := bcQueryInteger(1,3,true) + tt=1 => sayBrightly '"Bye Bye" + tt=2 => moreExactSolution(equations,unknowns,flag) + tt=3 => explainExact(equations,unknowns) + +bcLinearSolveEqnsGen htPage == + alist := htpInputAreaAlist htPage + if vars := htpLabelInputString(htPage,'unknowns) then + varlist := bcString2WordList vars + varString := (rest varlist => bcwords2liststring varlist; first varlist) + alist := rest alist --know these are first on the list + eqnString := bcGenEquations alist + bcFinish('"solve",eqnString,varString) + +bcGenEquations alist == + y := alist + while y repeat + right := (first y).1 + y := rest y + left := (first y).1 + y := rest y + eqnlist := [STRCONC(left,'" = ",right),:eqnlist] + rest eqnlist => bcwords2liststring eqnlist + first eqnlist + + + + + + + + + + + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/bc-util.boot.pamphlet b/src/interp/bc-util.boot.pamphlet new file mode 100644 index 00000000..56287145 --- /dev/null +++ b/src/interp/bc-util.boot.pamphlet @@ -0,0 +1,147 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/interp bc-util.boot} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\section{License} +<>= +-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are +-- met: +-- +-- - Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- +-- - Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in +-- the documentation and/or other materials provided with the +-- distribution. +-- +-- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- names of its contributors may be used to endorse or promote products +-- derived from this software without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +-- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + +bcFinish(name,arg,:args) == bcGen bcMkFunction(name,arg,args) + +bcMkFunction(name,arg,args) == + args := [x for x in args | x] + STRCONC(name,'"(",arg,"STRCONC"/[STRCONC('",", x) for x in args],'")") + +bcString2HyString2 s == + (STRINGP s) and (s.0 = char '_") => + len := #s + STRCONC('"\_"", SUBSTRING(s, 1, len-2), '"\_"") + s + +bcString2HyString s == s + +bcFindString(s,i,n,char) == or/[j for j in i..n | s.j = char] + +bcGen command == + htInitPage('"Basic Command",nil) + string := + #command < 50 => STRCONC('"{\centerline{\tt ",command,'" }}") + STRCONC('"{\tt ",command,'" }") + htMakePage [ + '(text + "{Here is the AXIOM command you could have issued to compute this result:}" + "\vspace{2}\newline "), + ['text,:string]] + htMakeDoitButton('"Do It", command) + htShowPage() + +-- bcGen for axiom - nag link +linkGen command == + htInitPage('"AXIOM-Nag Link Command",nil) + string := + #command < 50 => STRCONC('"{\centerline{ ",command,'" }}") + command + htMakePage [ + '(text + "\centerline{{\em Here is the AXIOM command}}" + "\centerline{{\em you could have issued to compute this result:}}" + "\vspace{2}\newline "), + ['text,:string]] + htMakeDoitButton('"Do It", command) + htShowPage() + +bcOptional s == + s = '"" => '"2" + s + +bcvspace() == bcHt '"\vspace{1}\newline " + +bcString2WordList s == fn(s,0,MAXINDEX s) where + fn(s,i,n) == + i > n => nil + k := or/[j for j in i..n | s.j ^= char '_ ] + null INTEGERP k => nil + l := bcFindString(s,k + 1,n,char '_ ) + null INTEGERP l => [SUBSTRING(s,k,nil)] + [SUBSTRING(s,k,l-k),:fn(s,l + 1,n)] + + +bcwords2liststring u == + null u => nil + STRCONC('"[",first u,fn rest u) where + fn(u) == + null u => '"]" + STRCONC('", ",first u,fn rest u) + +bcVectorGen vec == bcwords2liststring vec + +bcError string == + sayBrightlyNT '"NOTE: " + sayBrightly string + +bcDrawIt(ind,a,b) == STRCONC(ind,'"=",a,'"..",b) + +bcNotReady htPage == + htInitPage('"Basic Command",nil) + htMakePage '( + (text . + "{\centerline{\em This facility will soon be available}}")) + htShowPage() + +htStringPad(n,w) == + s := STRINGIMAGE n + ws := #s + STRCONC('"\space{",STRINGIMAGE (w - ws + 1),'"}",s) + +stringList2String x == + null x => '"()" + STRCONC('"(",first x,"STRCONC"/[STRCONC('",",y) for y in rest x],'")") + +htMkName(s,n) == STRCONC(s,STRINGIMAGE n) + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/bits.lisp.pamphlet b/src/interp/bits.lisp.pamphlet new file mode 100644 index 00000000..1b38eadf --- /dev/null +++ b/src/interp/bits.lisp.pamphlet @@ -0,0 +1,99 @@ +%% Oh Emacs, this is a -*- Lisp -*- file despite apperance. +\documentclass{article} +\usepackage{axiom} + +\title{\File{src/interp/bits.lisp} Pamphlet} +\author{Timothy Daly} + +\begin{document} + +\maketitle +\begin{abstract} +\end{abstract} + +\tableofcontents +\eject + +\section{License} + +<>= +;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +;; All rights reserved. +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are +;; met: +;; +;; - Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; +;; - Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in +;; the documentation and/or other materials provided with the +;; distribution. +;; +;; - Neither the name of The Numerical ALgorithms Group Ltd. nor the +;; names of its contributors may be used to endorse or promote products +;; derived from this software without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +;; IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +;; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +;; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +;; OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +;; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +;; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + +;;; The types "bit" and "bit vector" are implemented differently +;;; in different variants of lisp. +;;; These lisp macros/functions will have different implementations +;;; on different lisp systems. + +;;; The operations which traverse entire vectors are given as functions +;;; since the function calling overhead will be relatively small. +;;; The operations which extract or set a single part of the vector are +;;; provided as macros. + +(in-package "BOOT") + +;;; SMW Nov 88: Created + +(defmacro truth-to-bit (x) `(cond (,x 1) ('else 0))) +(defmacro bit-to-truth (b) `(eq ,b 1)) + +(defun bvec-make-full (n x) + (make-array (list n) :element-type 'bit :initial-element x)) + +(defmacro bvec-elt (bv i) `(sbit ,bv ,i)) +(defmacro bvec-setelt (bv i x) `(setf (sbit ,bv ,i) ,x)) +(defmacro bvec-size (bv) `(size ,bv)) + +(defun bvec-copy (bv) (copy-seq bv)) +(defun bvec-concat (bv1 bv2) (concatenate '(vector bit) bv1 bv2)) +(defun bvec-equal (bv1 bv2) (equal bv1 bv2)) +(defun bvec-greater (bv1 bv2) + (let ((pos (mismatch bv1 bv2))) + (cond ((or (null pos) (>= pos (length bv1))) nil) + ((< pos (length bv2)) (> (bit bv1 pos) (bit bv2 pos))) + ((find 1 bv1 :start pos) t) + (t nil)))) +(defun bvec-and (bv1 bv2) (bit-and bv1 bv2)) +(defun bvec-or (bv1 bv2) (bit-ior bv1 bv2)) +(defun bvec-xor (bv1 bv2) (bit-xor bv1 bv2)) +(defun bvec-nand (bv1 bv2) (bit-nand bv1 bv2)) +(defun bvec-nor (bv1 bv2) (bit-nor bv1 bv2)) +(defun bvec-not (bv) (bit-not bv)) +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/bookvol5.pamphlet b/src/interp/bookvol5.pamphlet new file mode 100644 index 00000000..5a7bd281 --- /dev/null +++ b/src/interp/bookvol5.pamphlet @@ -0,0 +1,1659 @@ +\documentclass{book} +\usepackage{axiom} +\usepackage{graphicx} +% struggle with latex figure-floating behavior +\renewcommand\floatpagefraction{.9} +\renewcommand\topfraction{.9} +\renewcommand\bottomfraction{.9} +\renewcommand\textfraction{.1} +\setcounter{totalnumber}{50} +\setcounter{topnumber}{50} +\setcounter{bottomnumber}{50} + +\begin{document} +\begin{titlepage} +\center{\includegraphics{ps/axiomFront.ps}} +\vskip 0.1in +\includegraphics{ps/bluebayou.ps}\\ +\vskip 0.1in +{\Huge{The 30 Year Horizon}} +\vskip 0.1in +$$ +\begin{array}{lll} +Manuel\ Bronstein & William\ Burge & Timothy\ Daly \\ +James\ Davenport & Michael\ Dewar & Martin\ Dunstan \\ +Albrecht\ Fortenbacher & Patrizia\ Gianni & Johannes\ Grabmeier \\ +Jocelyn\ Guidry & Richard\ Jenks & Larry\ Lambe \\ +Michael\ Monagan & Scott\ Morrison & William\ Sit \\ +Jonathan\ Steinbach & Robert\ Sutor & Barry\ Trager \\ +Stephen\ Watt & Jim\ Wen & Clifton\ Williamson +\end{array} +$$ +\center{\large{VOLUME 5: THE AXIOM INTERPRETER}} +\end{titlepage} +\pagenumbering{roman} +\begin{verbatim} +The Blue Bayou image Copyright (c) 2004 Jocelyn Guidry + +Portions Copyright (c) 2004 Martin Dunstan + +Portions Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +All rights reserved. + +This book and the Axiom software is licensed as follows: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +\end{verbatim} +\tableofcontents +\vfill +\eject +\setlength{\parindent}{0em} +\setlength{\parskip}{1ex} +{\Large{\bf New Foreword}} +\vskip .25in + +On October 1, 2001 Axiom was withdrawn from the market and ended +life as a commercial product. +On September 3, 2002 Axiom was released under the Modified BSD +license, including this document. +On August 27, 2003 Axiom was released as free and open source +software available for download from the Free Software Foundation's +website, Savannah. + +Work on Axiom has had the generous support of the Center for +Algorithms and Interactive Scientific Computation (CAISS) at +City College of New York. Special thanks go to Dr. Gilbert +Baumslag for his support of the long term goal. + +The online version of this documentation is roughly 1000 pages. +In order to make printed versions we've broken it up into three +volumes. The first volume is tutorial in nature. The second volume +is for programmers. The third volume is reference material. We've +also added a fourth volume for developers. All of these changes +represent an experiment in print-on-demand delivery of documentation. +Time will tell whether the experiment succeeded. + +Axiom has been in existence for over thirty years. It is estimated to +contain about three hundred man-years of research and has, as of +September 3, 2003, 143 people listed in the credits. All of these +people have contributed directly or indirectly to making Axiom +available. Axiom is being passed to the next generation. I'm looking +forward to future milestones. + +With that in mind I've introduced the theme of the ``30 year horizon''. +We must invent the tools that support the Computational Mathematician +working 30 years from now. How will research be done when every bit of +mathematical knowledge is online and instantly available? What happens +when we scale Axiom by a factor of 100, giving us 1.1 million domains? +How can we integrate theory with code? How will we integrate theorems +and proofs of the mathematics with space-time complexity proofs and +running code? What visualization tools are needed? How do we support +the conceptual structures and semantics of mathematics in effective +ways? How do we support results from the sciences? How do we teach +the next generation to be effective Computational Mathematicians? + +The ``30 year horizon'' is much nearer than it appears. + +\vskip .25in +%\noindent +Tim Daly\\ +CAISS, City College of New York\\ +November 10, 2003 ((iHy)) +\vfill +\eject +\pagenumbering{arabic} +\setcounter{chapter}{0} % Chapter 1 +\chapter{The Interpreter} +\section{Star Global Variables} +\begin{tabular}{lll} +NAME & SET & USE \\ +*eof* & ncTopLevel & \\ +*features* & & restart \\ +*package* & & restart \\ +*standard-input* & & ncIntLoop \\ +*standard-output* & & ncIntLoop \\ +*top-level-hook* & set-restart-hook & \\ +\end{tabular} + +\subsection{*eof*} +The [[*eof*]] variable is set to [[NIL]] in [[ncTopLevel]]. +\subsection{*features*} +The [[*features*]] variable from common lisp is tested for the presence +of the [[:unix]] keyword. Apparently this controls the use of Saturn, +a previous Axiom frontend. The Saturn frontend was never released as +open source and so this test and the associated variables are probably +not used. + +\subsection{*package*} +The [[*package*]] variable, from common lisp, is set in [[restart]] +to the [[BOOT]] package where the intepreter lives. +\subsection{*standard-input*} +The [[*standard-input*]] common lisp variable is used to set the +[[curinstream]] variable in [[ncIntLoop]]. + +This variable is an argument to [[serverReadLine]] in +the [[intloopReadConsole]] function. + +\subsection{*standard-output*} +The [[*standard-output*]] common lisp variable is used to set the +[[curoutstream]] variable in [[ncIntLoop]]. + +\subsection{*top-level-hook*} +The [[*top-level-hook*]] common lisp variable contains the name of +a function to invoke when an image is started. In our case it is +called [[restart]]. This is the entry point to the Axiom interpreter. + +\section{Dollar Global Variables} +\begin{tabular}{lll} +NAME & SET & USE \\ +\$boot & ncTopLevel & \\ +coerceFailure & & runspad \\ +curinstream & ncIntLoop & \\ +curoutstream & ncIntLoop & \\ +vmlisp::\$current-directory & restart & \\ + & reroot & \\ +\$currentLine & restart & removeUndoLines \\ +\$dalymode & & intloopReadConsole \\ +\$defaultMsgDatabaseName & reroot & \\ +\$directory-list & reroot & \\ +\$displayStartMsgs & & restart \\ +\$e & ncTopLevel & \\ +\$erMsgToss & SpadInterpretStream & \\ +\$fn & SpadInterpretStream & \\ +\$frameRecord & initvars & \\ + & clearFrame & \\ + & undoSteps & undoSteps \\ + & recordFrame & recordFrame \\ +\$HiFiAccess & initHist & historySpad2Cmd \\ + & historySpad2Cmd & \\ + & & setHistoryCore \\ +\$HistList & initHist & \\ +\$HistListAct & initHist & \\ +\$HistListLen & initHistList & \\ +\$HistRecord & initHistList & \\ +\$historyDirectory & & makeHistFileName \\ + & & makeHistFileName \\ +\$historyFileType & initvars & histInputFileName \\ +\$inclAssertions & SpadInterpretStream & \\ +\$inLispVM & spad & \\ +\$InteractiveFrame & restart & ncTopLevel \\ + & undo & recordFrame \\ + & undoSteps & undoSteps \\ + & & reportUndo \\ +\$InteractiveMode & ncTopLevel & \\ +\$internalHistoryTable & initvars & \\ +\$interpreterFrameName & initializeInterpreterFrameRing & \\ +\$interpreterFrameRing & initializeInterpreterFrameRing & \\ +\$InitialModemapFrame & & makeInitialModemapFrame \\ +\$intRestart & & intloop \\ +\$intTopLevel & intloop & \\ +\$IOindex & restart & historySpad2Cmd \\ + & removeUndoLines & undoCount \\ +\$lastPos & SpadInterpretStream & \\ +\$libQuiet & SpadInterpretStream & \\ +\$library-directory-list & reroot & \\ +\$msgDatabaseName & reroot * \\ +\$ncMsgList & SpadInterpretStream & \\ +\$newcompErrorCount & SpadInterpretStream & \\ +\$newcompMode & SpadInterpretStream & \\ +\$newspad & ncTopLevel & \\ +\$nopos & & SpadInterpretStream \\ +\$okToExecuteMachineCode & SpadInterpretStream & \\ +\$oldHistoryFileName & initvars & oldHistFileName \\ +\$openServerIfTrue & restart & restart \\ + & spad-save & \\ + & initvars & \\ +\$options & & history \\ + & historySpad2Cmd & historySpad2Cmd \\ + & & undo \\ +\$previousBindings & initvars & \\ + & clearFrame & \\ + & recordFrame & recordFrame \\ +\$printLoadMsgs & restart & \\ +\$PrintCompilerMessageIfTrue & spad & \\ +\$promptMsg & SpadInterpretStream & \\ +\$relative-directory-list & & reroot \\ +\$relative-library-directory-list & & reroot \\ +\$reportUndo & initvars & diffAlist \\ +\$shoeReadLineFunction & SpadInterpretStream & \\ +\$spad & ncTopLevel & \\ +\$spadroot & reroot & initroot \\ + & & make-absolute-filename \\ + & & reroot \\ +\$SpadServer & restart & \\ +\$SpadServerName & initvars & restart \\ +\$systemCommandFunction & SpadInterpretStream & \\ +top\_level & & runspad \\ +\$quitTag & & runspad \\ +\$useInternalHistoryTable & initvars & initHist \\ + & setHistoryCore & setHistoryCore \\ +\$undoFlag & initvars & recordFrame \\ +\end{tabular} + +\subsection{\$boot} +The [[$boot]] variable is set to [[NIL]] in [[ncTopLevel]]. + +\subsection{coerceFailure} +The [[coerceFailure]] symbol is a catch tag used in [[runspad]] +to catch an exit from [[ncTopLevel]]. + +\subsection{curinstream} +The [[curinstream]] variable is set to the value of the +[[*standard-input*]] common lisp +variable in [[ncIntLoop]]. While not using the +``dollar'' convention this variable is still ``global''. + +\subsection{curinstream} +The [[curoutstream]] variable is set to the value of the +[[*standard-output*]] common lisp variable in [[ncIntLoop]]. +While not using the ``dollar'' convention this variable is still ``global''. + +\subsection{vmlisp::\$current-directory} +When running in Lucid Common Lisp ([[:lucid]]) on an IBM/370 mainframe +([[:ibm/370]]) this variable is used in place of the +[[*default-pathname-defaults*]] common lisp variable. +Otherwise this variable is +set to the empty string in [[restart]]. + +Notice that the variable [[*default-pathname-defaults*]] is a Common +Lisp standard variable with implementation defined meaning. +Typically, its value is an object that represents the directory from +where the Lisp image has been started. + +The [[reroot]] function sets this variable to the value of +[[$spadroot]] which itself has the value of the argument to the +[[reroot]] function. Since the argument to the [[reroot]] function is +an string which represents an absolute pathname pointing to AXIOM the +net result is that the [[$current-directory]] is set to point to the +shell [[AXIOM]] variable. + +So during execute both [[$current-directory]] and [[$spadroot]] reflect +the value of the [[AXIOM]] shell variable. + +\subsection{\$currentLine} +The [[$currentLine]] line is set to [[NIL]] in [[restart]]. +It is used in [[removeUndoLines]] in the undo mechanism. + +\subsection{\$dalymode} +The [[$dalymode]] variable is used in a case statement in +[[intloopReadConsole]]. This variable can be set to any non-nil +value. When not nil the interpreter will send any line that begins +with an ``[[(]]'' to be sent to the underlying lisp. This is useful +for debugging Axiom. The normal value of this variable is [[NIL]]. + +This variable was created as an alternative to prefixing every lisp +command with [[)lisp]]. When doing a lot of debugging this is tedious +and error prone. This variable was created to shortcut that process. +Clearly it breaks some semantics of the language accepted by the +interpreter as parens are used for grouping expressions. + +\subsection{\$defaultMsgDatabaseName} +The [[$defaultMsgDatabaseName]] is the absolute path to the +[[s2-us.msgs]] file which contains all of the english language +messages output by the system. + +\subsection{\$directory-list} +The [[$directory-list]] is a list of absolute directory names. +These names are made absolute by mapping the [[make-absolute-filename]] +over the variable [[$relative-directory-list]]. + +\subsection{\$displayStartMsgs} +The [[$displayStartMsgs]] variable is used in [[restart]] but is not +set so this is likely a bug. + +\subsection{\$e} +The [[$e]] variable is set to the value of +[[$InteractiveFrame]] which is set in [[restart]] to the value of the +call to the [[makeInitialModemapFrame]] function. This function simply +returns a copy of the variable [[$InitialModemapFrame]]. + +Thus [[$e]] is a copy of the variable [[$InitialModemapFrame]]. + +This variable is used in the undo mechanism. + +\subsection{\$erMsgToss} +The [[$erMsgToss]] variable is set to [[NIL]] in [[SpadInterpretStream]]. + +\subsection{\$fn} +The [[$fn]] variable is set in [[SpadInterpretStream]]. It is set to +the second argument which is a list. It appears that this list has the +same structure as an argument to the LispVM [[rdefiostream]] function. + +\subsection{\$frameRecord} +[[$frameRecord = [delta1, delta2,... ] ]] where +[[delta(i)]] contains changes in the ``backwards'' direction. +Each [[delta(i)]] has the form [[((var . proplist)...)]] where +proplist denotes an ordinary proplist. For example, an entry +of the form [[((x (value) (mode (Integer)))...)]] indicates that +to undo 1 step, [[x]]'s value is cleared and its mode should be set +to [[(Integer)]]. + +A [[delta(i)]] of the form [[(systemCommand . delta)]] is a special +delta indicating changes due to system commands executed between +the last command and the current command. By recording these deltas +separately, it is possible to undo to either BEFORE or AFTER +the command. These special [[delta(i)]]s are given ONLY when a +a system command is given which alters the environment. + +Note: [[recordFrame('system)]] is called before a command is executed, and +[[recordFrame('normal)]] is called after (see processInteractive1). +If no changes are found for former, no special entry is given. + +This is part of the undo mechanism. + +\subsection{\$HiFiAccess} +The [[$HiFiAccess]] is set by [[initHist]] to [[T]]. It is a flag +used by the history mechanism to record whether the history function +is currently on. It can be reset by using the axiom +command +\begin{verbatim} + )history off +\end{verbatim} +It appears that the name means ``History File Access''. + +The [[$HiFiAccess]] variable is used by [[historySpad2Cmd]] to check +whether history is turned on. [[T]] means it is, [[NIL]] means it is not. + +\subsection{\$HistList} +Thie [[$HistList]] variable is set by [[initHistList]] to an initial +value of [[NIL]] elements. The last element of the list is smashed to +point to the first element to make the list circular. +This is a circular list of length [[$HistListLen]]. + +\subsection{\$HistListAct} +The [[$HistListAct]] variable is set by [[initHistList]] to [[0]]. +This variable holds the actual number of elements in the history list. +This is the number of ``undoable'' steps. + +\subsection{\$HistListLen} +The [[$HistListLen]] variable is set by [[initHistList]] to [[20]]. +This is the length of a circular list maintained in the variable +[[$HistList]]. + +\subsection{\$HistRecord} +The [[$HistRecord]] variable is set by [[initHistList]] to [[NIL]]. +[[$HistRecord]] collects the input line, all variable bindings +and the output of a step, before it is written to the file named by +the function [[histFileName]]. + +\subsection{\$historyFileType} +The [[$historyFileType]] is set at load time by a call to +[[initvars]] to a value of ``[[axh]]''. It appears that this +is intended to be used as a filetype extension. +It is part of the history mechanism. It is used in [[makeHistFileName]] +as part of the history file name. + +\subsection{\$inclAssertions} +The [[$inclAssertions]] is set +in the function [[SpadInterpretStream]] to the list [[(aix |CommonLisp|)]] + +\subsection{\$internalHistoryTable} +The [[$internalHistoryTable]] variable is set at load time by a call to +[[initvars]] to a value of [[NIL]]. +It is part of the history mechanism. + +\subsection{\$interpreterFrameName} +The [[$interpreterFrameName]] variable, set in +[[initializeInterpreterFrameRing]] to the constant +[[initial]] to indicate that this is the initial (default) frame. + +Frames are structures that capture all of the variables defined in a +session. There can be multiple frames and the user can freely switch +between them. Frames are kept in a ring data structure so you can +move around the ring. + +\subsection{\$interpreterFrameRing} +The [[$interpreterFrameRing]] is set to a pair whose car is set to +the result of [[emptyInterpreterFrame]] + +\subsection{\$InitialModemapFrame} +This variable is copied and returned by the function +[[makeInitialModemapFrame]]. There is no initial value so this +is probably a bug. + +\subsection{\$inLispVM} +The [[$inLispVM]] is set to [[NIL]] in [[spad]]. LispVM is a +non-common lisp that runs on IBM/370 mainframes. This is probably dead +code. It appears that this list has the same structure as an argument +to the LispVM [[rdefiostream]] function. + +\subsection{\$InteractiveFrame} +The [[$InteractiveFrame]] is set in [[restart]] to the value of the +call to the [[makeInitialModemapFrame]] function. This function simply +returns a copy of the variable [[$InitialModemapFrame]] + +\subsection{\$InteractiveMode} +The [[$InteractiveMode]] is set to [[T]] in [[ncTopLevel]]. + +\subsection{\$intRestart} +The [[$intRestart]] variable is used in [[intloop]] but has no value. +This is probably a bug. While the variable's value is unchanged the +system will continually reenter the [[SpadInterpretStream]] function. + +\subsection{\$intTopLevel} +The [[$intTopLevel]] is a catch tag. Throwing to this tags which is +caught in the [[intloop]] will +restart the [[SpadInterpretStream]] function. + +\subsection{\$IOindex} +The [[$IOindex]] index variable is set to [[1]] in [[restart]]. +This variable is used in the [[historySpad2Cmd]] function in the +history mechanism. It is set in the [[removeUndoLines]] function +in the undo mechanism. + +This is used in the undo mechanism in function [[undoCount]] +to compute the number of undos. You can't undo more actions then +have already happened. + +\subsection{\$lastPos} +The [[$lastPos]] variable is set in [[SpadInterpretStream]] +to the value of the [[$nopos]] variable. +Since [[$nopos]] appears to have no value +this is likely a bug. + +\subsection{\$libQuiet} +The [[$libQuiet]] variable is set to the third argument of the +[[SpadInterpretStream]] function. This is passed from [[intloop]] +with the value of [[T]]. This variable appears to be intended to +control the printing of library loading messages which would need +to be suppressed if input was coming from a file. + +\subsection{\$library-directory-list} +The [[$library-directory-list]] variable is set by [[reroot]] by +mapping the function [[make-absolute-filename]] across the +[[$relative-library-directory-list]] variable which is not yet set so this +is probably a bug. + +\subsection{\$msgDatabaseName} +The [[$msgDatabaseName]] is set to [[NIL]] in [[reroot]]. + +\subsection{\$ncMsgList} +The [[$ncMsgList]] is set to [[NIL]] in [[SpadInterpretStream]]. + +\subsection{\$newcompErrorCount} +The [[$newcompErrorCount]] is set to [[0]] in [[SpadInterpretStream]]. + +\subsection{\$newcompMode} +The [[$newcompMode]] is set to [[NIL]] in [[SpadInterpretStream]]. + +\subsection{\$newspad} +The [[$newspad]] is set to [[T]] in [[ncTopLevel]]. + +\subsection{\$nopos} +The [[$nopos]] variable is used in [[SpadInterpretStream]] but does +not appear to have a value and is likely a bug. + +\subsection{\$oldHistoryFileName} +The [[$oldHistoryFileName]] is set at load time by a call to +[[initvars]] to a value of ``[[last]]''. +It is part of the history mechanism. It is used in the function +[[oldHistFileName]] and [[restoreHistory]]. + +\subsection{\$okToExecuteMachineCode} +The [[$okToExecuteMachineCode]] is set to [[T]] in [[SpadInterpretStream]]. + +\subsection{\$options} +The [[$options]] variable is tested by the [[history]] function. +If it is [[NIL]] then output the message +\begin{verbatim} + You have not used the correct syntax for the history command. + Issue )help history for more information. +\end{verbatim} + +The [[$options]] variable is tested in the [[historySpad2Cmd]] function. +It appears to record the options that were given to a spad command on +the input line. The function [[selectOptionLC]] appears to take a list +off options to scan. + +This variable is not yet set and is probably a bug. + +\subsection{\$previousBindings} +The [[$previousBindings]] is a copy of the +[[CAAR $InteractiveFrame]]. This is used to +compute the [[delta(i)]]s stored in [[$frameRecord]]. +This is part of the undo mechanism. + +\subsection{\$printLoadMsgs} +The [[$printLoadMsgs]] variable is set to [[T]] in [[restart]]. + +\subsection{\$PrintCompilerMessageIfTrue} +The [[$PrintCompilerMessageIfTrue]] variable is set to [[NIL]] in [[spad]]. + +\subsection{\$openServerIfTrue} +The [[$openServerIfTrue]] is tested in [[restart]] before it has been +set (and is thus a bug). It appears to control whether the interpreter +will be used as an open server, probably for OpenMath use. + +If an open server is not requested then this variable to [[NIL]] + +\subsection{\$promptMsg} +The [[$promptMsg]] variable is set to the constant [[S2CTP023]]. This +constant points to a message in [[src/doc/msgs/s2-us.msgs]]. This message +does nothing but print the argument value. + +\subsection{\$relative-directory-list} +The [[$relative-directory-list]] is used in [[reroot]] to create +[[$directory-list]] which is a list of absolute directory names. +It is not yet set and is probably a bug. + +\subsection{\$relative-library-directory-list} +The [[$relative-library-directory-list]] is used in [[reroot]] to create +a list of absolute directory names from [[$library-directory-list]] (which is +It is not yet set and is probably a bug). + +\subsection{\$reportUndo} +The [[$reportUndo]] variable is used in [[diffAlist]]. It was not normally +bound but has been set to [[T]] in [[initvars]]. If the variable is set +to [[T]] then we call [[reportUndo]]. + +It is part of the undo mechanism. + +\subsection{\$shoeReadLineFunction} +The [[$shoeReadLineFunction]] is set in [[SpadInterpretStream]] +to point to the +[[serverReadLine]] + +\subsection{\$spadroot} +The [[$spadroot]] variable is the internal name for the [[AXIOM]] +shell variable. + +The [[$spadroot]] variable is set in [[reroot]] to the value of the +argument. The argument is expected to be a directory name. + +The [[$spadroot]] variable is tested in [[initroot]]. + +The [[$spadroot]] variable is used by the function +[[make-absolute-filename]]. It concatenates this variable to the +front of a relative pathname to make it absolute. +\subsection{\$spad} +The [[$spad]] variable is set to [[T]] in [[ncTopLevel]]. + +\subsection{\$SpadServer} +If an open server is not requested then this variable to [[T]]. +It has no value before this time (and is thus a bug). + +\subsection{\$SpadServerName} +The [[$SpadServerName]] is passed to the [[openServer]] function, if the +function exists. + +\subsection{\$systemCommandFunction} +The [[$systemCommandFunction]] is set in [[SpadInterpretStream]] +to point to the function +[[InterpExecuteSpadSystemCommand]]. + +\subsection{top\_level} +The [[top\_level]] symbol is a catch tag used in [[runspad]] +to catch an exit from [[ncTopLevel]]. + +\subsection{\$quitTag} +The [[$quitTag]] is used as a variable in a [[catch]] block. +It appears that it can be thrown somewhere below [[ncTopLevel]]. + +\subsection{\$useInternalHistoryTable} +The [[$useInternalHistoryTable]] variable is set at load time by a call to +[[initvars]] to a value of [[NIL]]. It is part of the history mechanism. + +\subsection{\$undoFlag} +The [[$undoFlag]] is used in [[recordFrame]] to decide whether to do +undo recording. It is initially set to [[T]] in [[initvars]]. +This is part of the undo mechanism. + +\chapter{Starting Axiom} +Axiom starts by invoking a function value of the lisp symbol +[[*top-level-hook*]]. The function invocation path to from this +point until the prompt is approximates (skipping initializations): +\begin{verbatim} + lisp -> restart + -> |spad| + -> |runspad| + -> |ncTopLevel| + -> |ncIntLoop| + -> |intloop| + -> |SpadInterpretStream| + -> |intloopReadConsole| +\end{verbatim} +The [[|intloopReadConsole|]] function does tail-recursive calls to +itself (don't break this) and never exits. +\section{Variables Used} +\section{Data Structures} +\section{Functions} +\subsection{defun set-restart-hook} +When a lisp image containing code is reloaded there is a hook to +allow a function to be called. In our case it is the [[restart]] +function which is the entry to the Axiom interpreter. +<>= +(defun set-restart-hook () + #+KCL (setq system::*top-level-hook* 'restart) + #+Lucid (setq boot::restart-hook 'restart) + 'restart + ) + +@ +\subsection{defun restart} +The restart function is the real root of the world. It sets up memory +if we are working in a GCL/akcl version of the system. It sets the +current package to be the ``BOOT'' package which is the standard +package in which the interpreter runs. It calls initroot \cite{1} +to set the \$spadroot variable (usually the \$AXIOM variable). + +The [[compiler::*compile-verbose*]] flag has been set to nil globally. +We do not want to know about the microsteps of GCL's compile facility. + +The [[compiler::*suppress-compiler-warnings*]] flag has been set to t. +We do not care that certain generated variables are not used. + +The [[compiler::*suppress-compiler-notes*]] flag has been set to t. +We do not care that tail recursion occurs. +<>= +(defun restart () +#+:akcl + (init-memory-config :cons 500 :fixnum 200 :symbol 500 :package 8 + :array 400 :string 500 :cfun 100 :cpages 3000 :rpages 1000 :hole 2000) +#+:akcl (setq compiler::*compile-verbose* nil) +#+:akcl (setq compiler::*suppress-compiler-warnings* t) +#+:akcl (setq compiler::*suppress-compiler-notes* t) +#-:CCL + (in-package "BOOT") +#+:CCL + (setq *package* (find-package "BOOT")) +#+:CCL (setpchar "") ;; Turn off CCL read prompts +#+(OR :akcl :CCL) (initroot) +#+:akcl (system:gbc-time 0) +#+:akcl + (when (and $openServerIfTrue (fboundp '|openServer|)) + (prog (os) + (setq os (|openServer| $SpadServerName)) + (if (zerop os) + (progn + (setq $openServerIfTrue nil) + (setq |$SpadServer| t))))) +;; We do the following test at runtime to allow us to use the same images +;; with Saturn and Sman. MCD 30-11-95 +#+:CCL + (when + (and (memq :unix *features*) $openServerIfTrue (fboundp '|openServer|)) + (prog (os) + (setq os (|openServer| $SpadServerName)) + (if (zerop os) + (progn + (setq $openServerIfTrue nil) + (setq |$SpadServer| t))))) + (setq |$IOindex| 1) + (setq |$InteractiveFrame| (|makeInitialModemapFrame|)) + (setq |$printLoadMsgs| t) +#+(and :lucid :ibm/370) + (setq vmlisp::$current-directory "") +#-(and :lucid :ibm/370) + (setq vmlisp::$current-directory + (make-directory *default-pathname-defaults*)) + (|loadExposureGroupData|) + (|statisticsInitialization|) + (|initHist|) + (|initializeInterpreterFrameRing|) + + (when |$displayStartMsgs| + (|spadStartUpMsgs|)) + (setq |$currentLine| nil) + (restart0) + (|readSpadProfileIfThere|) + (|spad|)) + +@ + +\subsection{defun SpadInterpretStream} +The [[SpadInterpretStream]] function takes three arguments +\begin{list}{} +\item [[str]] This is passed as an argument to [[intloopReadConsole]] +\item [[source]] This is the name of a source file but appears not +to be used. It is set to the list [[(tim daly ?)]]. +\item [[interactive?]] If this is false then various messages are +suppressed and input does not use piles. If this is true then the +library loading routines might output messages and piles are expected +on input (as from a file). +\end{list} + + +\section{Helper Functions} +\subsection{defun reclaim} +Call the garbage collector on various platforms. +<>= +#+abcl +(defun reclaim () (ext::gc)) +#+:allegro +(defun reclaim () (excl::gc t)) +#+:CCL +(defun reclaim () (gc)) +#+clisp +(defun reclaim () (#+lisp=cl ext::gc #-lisp=cl lisp::gc)) +#+(or :cmulisp :cmu) +(defun reclaim () (ext:gc)) +#+cormanlisp +(defun reclaim () (cl::gc)) +#+(OR IBCL KCL GCL) +(defun reclaim () (si::gbc t)) +#+lispworks +(defun reclaim () (hcl::normal-gc)) +#+Lucid +(defun reclaim () (lcl::gc)) +#+sbcl +(defun reclaim () (sb-ext::gc)) +@ +\subsection{defun getenviron} +<>= +(defun getenviron (shellvar) + #+allegro (sys::getenv (string var)) + #+clisp (ext:getenv (string var)) + #+(or cmu scl) + (cdr + (assoc (string var) ext:*environment-list* :test #'equalp :key #'string)) + #+(or kcl akcl gcl) (si::getenv (string var)) + #+lispworks (lw:environment-variable (string var)) + #+lucid (lcl:environment-variable (string var)) + #+mcl (ccl::getenv var) + #+sbcl (sb-ext:posix-getenv var) + ) +@ +\subsection{defun init-memory-config} +Austin-Kyoto Common Lisp (AKCL), now known as Gnu Common Lisp (GCL) +requires some changes to the default memory setup to run Axiom efficently. +This function performs those setup commands. +<>= +(defun init-memory-config (&key + (cons 500) + (fixnum 200) + (symbol 500) + (package 8) + (array 400) + (string 500) + (cfun 100) + (cpages 3000) + (rpages 1000) + (hole 2000) ) + ;; initialize AKCL memory allocation parameters + #+:AKCL + (progn + (system:allocate 'cons cons) + (system:allocate 'fixnum fixnum) + (system:allocate 'symbol symbol) + (system:allocate 'package package) + (system:allocate 'array array) + (system:allocate 'string string) + (system:allocate 'cfun cfun) + (system:allocate-contiguous-pages cpages) + (system:allocate-relocatable-pages rpages) + (system:set-hole-size hole)) + #-:AKCL + nil) + +@ +\subsection{defun initroot} +Sets up the system to use the {\bf AXIOM} shell variable if we can +and default to the {\bf \$spadroot} variable (which was the value +of the {\bf AXIOM} shell variable at build time) if we can't. +<>= +(defun initroot (&optional (newroot (BOOT::|getEnv| "AXIOM"))) + (reroot (or newroot $spadroot (error "setenv AXIOM or (setq $spadroot)")))) + +@ +\subsection{defun loadExposureGroupData} +<>= +#+:AKCL +(defun |loadExposureGroupData| () + (cond + ((load "./exposed" :verbose nil :if-does-not-exist nil) + '|done|) + ((load (concat (system:getenv "AXIOM") "/algebra/exposed") + :verbose nil :if-does-not-exist nil) + '|done|) + (t '|failed|) )) + +#+:CCL +(defun |loadExposureGroupData| () + (cond + ((load "./exposed.lsp" :verbose NIL :if-does-not-exist NIL) '|done|) + ((load (concat (BOOT::|getEnv| "AXIOM") "/../../src/algebra/exposed.lsp") + :verbose nil :if-does-not-exist nil) '|done|) + (t nil) )) + +@ +\subsection{make-absolute-filename} +Prefix a filename with the {\bf AXIOM} shell variable. +<>= +(defun make-absolute-filename (name) + (concatenate 'string $spadroot name)) + +@ + +\subsection{defun reroot} +The reroot function is used to reset the important variables used by +the system. In particular, these variables are sensitive to the +{\bf AXIOM} shell variable. That variable is renamed internally to +be {\bf \$spadroot}. The {\bf reroot} function will change the +system to use a new root directory and will have the same effect +as changing the {\bf AXIOM} shell variable and rerunning the system +from scratch. Note that we have changed from the +NAG distribution back to the original form. If you need the NAG +version you can push {\bf :tpd} on the {\bf *features*} variable +before compiling this file. A correct call looks like: +\begin{verbatim} +(in-package "BOOT") +(reroot "/spad/mnt/${SYS}") +\end{verbatim} +where the [[${SYS}]] variable is the same one set at build time. +<>= +(defun reroot (dir) + (setq $spadroot dir) + (setq $directory-list + (mapcar #'make-absolute-filename $relative-directory-list)) + (setq $library-directory-list + (mapcar #'make-absolute-filename $relative-library-directory-list)) + (setq |$defaultMsgDatabaseName| + (pathname (make-absolute-filename "/share/msgs/s2-us.msgs"))) + (setq |$msgDatabaseName| ()) + (setq $current-directory $spadroot)) + +@ +\subsection{defun statisticsInitialization} +<>= +(defun |statisticsInitialization| () + "initialize the garbage collection timer" + #+:akcl (system:gbc-time 0) + nil) + +@ +\chapter{The History Mechanism} +\section{)history} +\index{ugSysCmdhistory} + +\index{history} + + +\par\noindent{\bf User Level Required:} interpreter + +\par\noindent{\bf Command Syntax:} +\begin{list}{} +\item{\tt )history )on} +\item{\tt )history )off} +\item{\tt )history )write} {\it historyInputFileName} +\item{\tt )history )show [{\it n}] [both]} +\item{\tt )history )save} {\it savedHistoryName} +\item{\tt )history )restore} [{\it savedHistoryName}] +\item{\tt )history )reset} +\item{\tt )history )change} {\it n} +\item{\tt )history )memory} +\item{\tt )history )file} +\item{\tt \%} +\item{\tt \%\%({\it n})} +\item{\tt )set history on | off} +\end{list} + +\par\noindent{\bf Command Description:} + +The {\it history} facility within Axiom allows you to restore your +environment to that of another session and recall previous +computational results. +Additional commands allow you to review previous +input lines and to create an {\bf .input} file of the lines typed to +\index{file!input} +Axiom. + +Axiom saves your input and output if the history facility is +turned on (which is the default). +This information is saved if either of +\begin{verbatim} +)set history on +)history )on +\end{verbatim} +has been issued. +Issuing either +\begin{verbatim} +)set history off +)history )off +\end{verbatim} +will discontinue the recording of information. +\index{history )on} +\index{set history on} +\index{set history off} +\index{history )off} + +Whether the facility is disabled or not, +the value of {\tt \%} in Axiom always +refers to the result of the last computation. +If you have not yet entered anything, +{\tt \%} evaluates to an object of type +{\tt Variable('\%)}. +The function {\tt \%\%} may be used to refer +to other previous results if the history facility is enabled. +In that case, +{\tt \%\%(n)} is the output from step {\tt n} if {\tt n > 0}. +If {\tt n < 0}, the step is computed relative to the current step. +Thus {\tt \%\%(-1)} is also the previous step, +{\tt \%\%(-2)}, is the step before that, and so on. +If an invalid step number is given, Axiom will signal an error. + +The {\it environment} information can either be saved in a file or entirely in +memory (the default). +Each frame +(\ref{ugSysCmdframe} on page~\pageref{ugSysCmdframe}) +has its own history database. +When it is kept in a file, some of it may also be kept in memory for +efficiency. +When the information is saved in a file, the name of the file is +of the form {\bf FRAME.axh} where ``{\bf FRAME}'' is the name of the +current frame. +The history file is placed in the current working directory +(see \ref{ugSysCmdcd} on page~\pageref{ugSysCmdcd}). +Note that these history database files are not text files (in fact, +they are directories themselves), and so are not in human-readable +format. + +The options to the {\tt )history} command are as follows: + +\begin{description} +\item[{\tt )change} {\it n}] +will set the number of steps that are saved in memory to {\it n}. +This option only has effect when the history data is maintained in a +file. +If you have issued {\tt )history )memory} (or not changed the default) +there is no need to use {\tt )history )change}. +\index{history )change} + +\item[{\tt )on}] +will start the recording of information. +If the workspace is not empty, you will be asked to confirm this +request. +If you do so, the workspace will be cleared and history data will begin +being saved. +You can also turn the facility on by issuing {\tt )set history on}. + +\item[{\tt )off}] +will stop the recording of information. +The {\tt )history )show} command will not work after issuing this +command. +Note that this command may be issued to save time, as there is some +performance penalty paid for saving the environment data. +You can also turn the facility off by issuing {\tt )set history off}. + +\item[{\tt )file}] +indicates that history data should be saved in an external file on disk. + +\item[{\tt )memory}] +indicates that all history data should be kept in memory rather than +saved in a file. +Note that if you are computing with very large objects it may not be +practical to kept this data in memory. + +\item[{\tt )reset}] +will flush the internal list of the most recent workspace calculations +so that the data structures may be garbage collected by the underlying +Common Lisp system. +Like {\tt )history )change}, this option only has real effect when +history data is being saved in a file. + +\item[{\tt )restore} [{\it savedHistoryName}]] +completely clears the environment and restores it to a saved session, if +possible. +The {\tt )save} option below allows you to save a session to a file +with a given name. If you had issued +{\tt )history )save jacobi} +the command +{\tt )history )restore jacobi} +would clear the current workspace and load the contents of the named +saved session. If no saved session name is specified, the system looks +for a file called {\bf last.axh}. + +\item[{\tt )save} {\it savedHistoryName}] +is used to save a snapshot of the environment in a file. +This file is placed in the current working directory +(see \ref{ugSysCmdcd} on page~\pageref{ugSysCmdcd}). +Use {\tt )history )restore} to restore the environment to the state +preserved in the file. +This option also creates an input file containing all the lines of input +since you created the workspace frame (for example, by starting your +Axiom session) or last did a {\tt )clear all} or +{\tt )clear completely}. + +\item[{\tt )show} [{\it n}] [{\tt both}]] +can show previous input lines and output results. +{\tt )show} will display up to twenty of the last input lines +(fewer if you haven't typed in twenty lines). +{\tt )show} {\it n} will display up to {\it n} of the last input lines. +{\tt )show both} will display up to five of the last input lines and +output results. +{\tt )show} {\it n} {\tt both} will display up to {\it n} of the last +input lines and output results. + +\item[{\tt )write} {\it historyInputFile}] +creates an {\bf .input} file with the input lines typed since the start +of the session/frame or the last {\tt )clear all} or {\tt )clear +completely}. +If {\it historyInputFileName} does not contain a period (``.'') in the filename, +{\bf .input} is appended to it. +For example, +{\tt )history )write chaos} +and +{\tt )history )write chaos.input} +both write the input lines to a file called {\bf chaos.input} in your +current working directory. +If you issued one or more {\tt )undo} commands, +{\tt )history )write} +eliminates all +input lines backtracked over as a result of {\tt )undo}. +You can edit this file and then use {\tt )read} to have Axiom process +the contents. +\end{description} + +\par\noindent{\bf Also See:} +{\tt )frame} \index{ugSysCmdframe}, +{\tt )read} \index{ugSysCmdread}, +{\tt )set} \index{ugSysCmdset}, and +{\tt )undo} \index{ugSysCmdundo}. + + +History recording is done in two different ways: +\begin{itemize} +\item all changes in variable bindings (i.e. previous values) are + written to [[$HistList]], which is a circular list +\item all new bindings (including the binding to [[%]]) are written to a + file called [[histFileName()]] + one older session is accessible via the file [[$oldHistFileName()]] +\end{itemize} + +\section{Variables Used} +The following global variables are used: +\begin{list}{} +\item [[$HistList]], [[$HistListLen]] and [[$HistListAct]] which is the + actual number of ``undoable'' steps) +\item [[$HistRecord]] collects the input line, all variable bindings + and the output of a step, before it is written to the file + [[histFileName()]]. +\item [[$HiFiAccess]] is a flag, which is reset by [[)history )off]] +\end{list} +The result of step n can be accessed by [[%n]], which is translated +into a call of [[fetchOutput(n)]]. The +[[updateHist]] is called after every interpreter step. The +[[putHist]] function records all changes in the environment to [[$HistList]] + and [[$HistRecord]] + +\subsection{Initialized history variables} +\begin{verbatim} +\end{verbatim} + +<>= +(defvar |$historyDirectory| 'A "vm/370 filename disk component") +(defvar |$HiFiAccess| t "t means turn on history mechanism") +@ + +\section{Data Structures} +\section{Functions} + +\subsection{defun setHistoryCore} +We [[case]] on the [[inCore]] argument value +\begin{list}{} +\item If history is already on and is kept in the same location as requested +(file or memory) then complain. +\item If history is not in use then start using the file or memory as +requested. This is done by simply setting the [[$useInternalHistoryTable]] +to the requested value, where [[T]] means use memory and [[NIL]] means +use a file. We tell the user. +\item If history should be in memory, that is [[inCore]] is not [[NIL]], +and the history file already contains information we read the information +from the file, store it in memory, and erase the history file. We modify +[[$useInternalHistoryTable]] to [[T]] to indicate that we're maintining +the history in memory and tell the user. +\item Otherwise history must be on and in memory. We erase any old history +file and then write the in-memory history to a new file +\end{list} + + +\section{History File Messages} +<>= +S2IH0001 + You have not reached step %1b yet, and so its value cannot be + supplied. +S2IH0002 + Cannot supply value for step %1b because 1 is the first step. +S2IH0003 + Step %1b has no value. +S2IH0004 + The history facility is not on, so you cannot use %b %% %d . +S2IH0006 + You have not used the correct syntax for the %b history %d command. + Issue %b )help history %d for more information. +S2IH0007 + The history facility is already on. +S2IH0008 + The history facility is now on. +S2IH0009 + Turning on the history facility will clear the contents of the + workspace. + Please enter %b y %d or %b yes %d if you really want to do this: +S2IH0010 + The history facility is still off. +S2IH0011 + The history facility is already off. +S2IH0012 + The history facility is now off. +S2IH0013 + The history facility is not on, so the .input file containing your user input + cannot be created. +S2IH0014 + Edit %b %1 %d to see the saved input lines. +S2IH0015 + The argument %b n %d for %b )history )change n must be a nonnegative + integer and your argument, %1b , is not one. +S2IH0016 + The history facility is not on, so no information can be saved. +S2IH0018 + The saved history file is %1b . +S2IH0019 + There is no history file, so value of step %1b is + undefined. +S2IH0022 + No history information had been saved yet. +S2IH0023 + %1b is not a valid filename for the history file. +S2IH0024 + History information cannot be restored from %1b because the file does + not exist. +S2IH0025 + The workspace has been successfully restored from the history file + %1b . +S2IH0026 + The history facility command %1b cannot be performed because the + history facility is not on. +S2IH0027 + A value containing a %1b is being saved in a history file or a + compiled input file INLIB. This type + is not yet usable in other history operations. You might want to issue + %b )history )off %d +S2IH0029 + History information is already being maintained in an external file + (and not in memory). +S2IH0030 + History information is already being maintained in memory (and not + in an external file). +S2IH0031 + When the history facility is active, history information will be + maintained in a file (and not in an internal table). +S2IH0032 + When the history facility is active, history information will be + maintained in memory (and not in an external file). +S2IH0034 + Missing element in internal history table. +S2IH0035 + Can't save the value of step number %1b. You can re-generate this value + by running the input file %2b. +S2IH0036 + The value specified cannot be saved to a file. +S2IH0037 + You must specify a file name to the history save command +S2IH0038 + You must specify a file name to the history write command +@ + +\chapter{The Frame Mechanism} +\section{)frame} +%\label{ugSysCmdframe} +%\index{frame} +\par\noindent{\bf Command Syntax:} +\begin{list}{} +\item{\tt )frame new {\it frameName}} +\item{\tt )frame drop {\it [frameName]}} +\item{\tt )frame next} +\item{\tt )frame last} +\item{\tt )frame names} +\item{\tt )frame import {\it frameName} {\it [objectName1 [objectName2 ...]]}} +\item{\tt )set message frame on | off} +\item{\tt )set message prompt frame} +\end{list} + +\par\noindent{\bf Command Description:} + +A {\it frame} can be thought of as a logical session within the +physical session that you get when you start the system. You can +have as many frames as you want, within the limits of your computer's +storage, paging space, and so on. +Each frame has its own {\it step number}, {\it environment} and {\it history.} +You can have a variable named {\tt a} in one frame and it will +have nothing to do with anything that might be called {\tt a} in +any other frame. + +Some frames are created by the HyperDoc program and these can +have pretty strange names, since they are generated automatically. +\index{frame names} +To find out the names +of all frames, issue +\begin{verbatim} +)frame names +\end{verbatim} +It will indicate the name of the current frame. + +You create a new frame +\index{frame new} +``{\bf quark}'' by issuing +\begin{verbatim} +)frame new quark +\end{verbatim} +The history facility can be turned on by issuing either +{\tt )set history on} or {\tt )history )on}. +If the history facility is on and you are saving history information +in a file rather than in the Axiom environment +then a history file with filename {\bf quark.axh} will +be created as you enter commands. +If you wish to go back to what +you were doing in the +\index{frame next} +``{\bf initial}'' frame, use +\index{frame last} +\begin{verbatim} +)frame next +\end{verbatim} +or +\begin{verbatim} +)frame last +\end{verbatim} +to cycle through the ring of available frames to get back to +``{\bf initial}''. + +If you want to throw +away a frame (say ``{\bf quark}''), issue +\begin{verbatim} +)frame drop quark +\end{verbatim} +If you omit the name, the current frame is dropped. +\index{frame drop} + +If you do use frames with the history facility on and writing to a file, +you may want to delete some of the older history files. +\index{file!history} +These are directories, so you may want to issue a command like +{\tt rm -r quark.axh} to the operating system. + +You can bring things from another frame by using +\index{frame import} +{\tt )frame import}. +For example, to bring the {\tt f} and {\tt g} from the frame ``{\bf quark}'' +to the current frame, issue +\begin{verbatim} +)frame import quark f g +\end{verbatim} +If you want everything from the frame ``{\bf quark}'', issue +\begin{verbatim} +)frame import quark +\end{verbatim} +You will be asked to verify that you really want everything. + +There are two {\tt )set} flags +\index{set message frame} +to make it easier to tell where you are. +\begin{verbatim} +)set message frame on | off +\end{verbatim} +will print more messages about frames when it is set on. +By default, it is off. +\begin{verbatim} +)set message prompt frame +\end{verbatim} +will give a prompt +\index{set message prompt frame} +that looks like +\begin{verbatim} +initial (1) -> +\end{verbatim} +\index{prompt!with frame name} +when you start up. In this case, the frame name and step make up the +prompt. + +\par\noindent{\bf Also See:} +{\tt )history} \index{ugSysCmdhistory} and +{\tt )set} \index{ugSysCmdset}. + + +@ +\section{Variables Used} +\section{Data Structures} +\section{Functions} + + +\section{Frame File Messages} +<>= +S2IZ0016 + The %1b system command takes arguments but no options. +S2IZ0017 + %1b is not a valid frame name +S2IZ0018 + You must provide a name for the new frame. +S2IZ0019 + You cannot use the name %1b for a new frame because an existing + frame already has that name. +S2IZ0020 + There is only one frame active and therefore that cannot be closed. + Furthermore, the frame name you gave is not the name of the current frame. + The current frame is called %1b . +S2IZ0021 + The current frame is the only active one. Issue %b )clear all %d to + clear its contents. +S2IZ0022 + There is no frame called %1b and so your command cannot be + processed. +S2IZ0024 + The names of the existing frames are: %1 %l + The current frame is the first one listed. +S2IZ0073 + %b )frame import %d must be followed by the frame name. The names + of objects in that frame can then optionally follow the frame name. + For example, + %ceon %b )frame import calculus %d %ceoff + imports all objects in the %b calculus %d frame, and + %ceon %b )frame import calculus epsilon delta %d %ceoff + imports the objects named %b epsilon %d and %b delta %d from the + frame %b calculus %d . + Please note that if the current frame contained any information + about objects with these names, then that information would be + cleared before the import took place. +S2IZ0074 + You cannot import anything from the frame %1b because that is not + the name of an existing frame. +S2IZ0075 + You cannot import from the current frame (nor is there a need!). +S2IZ0076 + User verification required: + do you really want to import everything from the frame %1b ? + If so, please enter %b y %d or %b yes %d : +S2IZ0077 + On your request, AXIOM will not import everything from frame %1b. +S2IZ0078 + Import from frame %1b is complete. Please issue %b )display all %d + if you wish to see the contents of the current frame. +S2IZ0079 + AXIOM cannot import %1b from frame %2b because it cannot be found. +@ +\chapter{The Undo Mechanism} +\section{)undo} +\index{ugSysCmdundo} + +\index{undo} + + +\par\noindent{\bf User Level Required:} interpreter + +\par\noindent{\bf Command Syntax:} +\begin{list}{} +\item{\tt )undo} +\item{\tt )undo} {\it integer} +\item{\tt )undo} {\it integer [option]} +\item{\tt )undo} {\tt )redo} +\end{list} +% +where {\it option} is one of +% +\begin{list}{} +\item{\tt )after} +\item{\tt )before} +\end{list} + +\par\noindent{\bf Command Description:} + +This command is used to +restore the state of the user environment to an earlier +point in the interactive session. +The argument of an {\tt )undo} is an integer which must designate some +step number in the interactive session. + +\begin{verbatim} +)undo n +)undo n )after +\end{verbatim} +These commands return the state of the interactive +environment to that immediately after step {\tt n}. +If {\tt n} is a positive number, then {\tt n} refers to step nummber +{\tt n}. If {\tt n} is a negative number, it refers to the \tt n-th +previous command (that is, undoes the effects of the last $-n$ +commands). + +A {\tt )clear all} resets the {\tt )undo} facility. +Otherwise, an {\tt )undo} undoes the effect of {\tt )clear} with +options {\tt properties}, {\tt value}, and {\tt mode}, and +that of a previous {\tt undo}. +If any such system commands are given between steps $n$ and +$n + 1$ ($n > 0$), their effect is undone +for {\tt )undo m} for any $0 < m \leq n$.. + +The command {\tt )undo} is equivalent to {\tt )undo -1} (it undoes +the effect of the previous user expression). +The command {\tt )undo 0} undoes any of the above system commands +issued since the last user expression. + +\begin{verbatim} +)undo n )before +\end{verbatim} +This command returns the state of the interactive +environment to that immediately before step {\tt n}. +Any {\tt )undo} or {\tt )clear} system commands +given before step {\tt n} will not be undone. + +\begin{verbatim} +)undo )redo +\end{verbatim} +This command reads the file {\tt redo.input}. +created by the last {\tt )undo} command. +This file consists of all user input lines, excluding those +backtracked over due to a previous {\tt )undo}. + +\par\noindent{\bf Also See:} +{\tt )history} \index{ugSysCmdhistory}. +The command {\tt )history )write} will eliminate the ``undone'' command +lines of your program. +\section{Variables Used} +\section{Data Structures} +[[$frameRecord = [delta1, delta2,... ] ]] where +[[delta(i)]] contains changes in the ``backwards'' direction. +Each [[delta(i)]] has the form [[((var . proplist)...)]] where +proplist denotes an ordinary proplist. For example, an entry +of the form [[((x (value) (mode (Integer)))...)]] indicates that +to undo 1 step, [[x]]'s value is cleared and its mode should be set +to [[(Integer)]]. + +A [[delta(i)]] of the form [[(systemCommand . delta)]] is a special +delta indicating changes due to system commands executed between +the last command and the current command. By recording these deltas +separately, it is possible to undo to either BEFORE or AFTER +the command. These special [[delta(i)]]s are given ONLY when a +a system command is given which alters the environment. + +Note: [[recordFrame('system)]] is called before a command is executed, and +[[recordFrame('normal)]] is called after (see processInteractive1). +If no changes are found for former, no special entry is given. + +The [[$previousBindings]] is a copy of the +[[CAAR $InteractiveFrame]]. This is used to +compute the [[delta(i)]]s stored in [[$frameRecord]]. +\section{Functions} +\subsection{Initial Undo Variables} +\begin{verbatim} +\end{verbatim} +<>= +(defvar |$reportUndo| nil "t means we report the steps undo takes") +@ + + +\subsection{defun reportUndo} +This function is enabled by setting [[|$reportUndo]] to a non-nil value. +An example of the output generated is: +\begin{verbatim} +r := binary(22/7) + + + ___ + (1) 11.001 + Type: BinaryExpansion +Properties of % :: + value was: NIL + value is: ((|BinaryExpansion|) WRAPPED . #(1 (1 1) NIL (0 0 1))) +Properties of r :: + value was: NIL + value is: ((|BinaryExpansion|) WRAPPED . #(1 (1 1) NIL (0 0 1))) + +\end{verbatim} + + +\chapter{The Spad Server Mechanism} +<>= +(defvar $openServerIfTrue t "t means try starting an open server") +(defconstant $SpadServerName "/tmp/.d" "the name of the spad server socket") +(defvar |$SpadServer| nil "t means Scratchpad acts as a remote server") + +@ + +\chapter{Axiom Build-time Functions} +\subsection{defun spad-save} +The {\bf spad-save} function is just a cover function for more +lisp system specific save functions. There is no standard name +for saving a lisp image so we make one and conditionalize it +at compile time. + +This function is passed the name of an image that will be saved. +The saved image contains all of the loaded functions. + +This is used in the [[src/interp/Makefile.pamphlet]] in three places: +\begin{list}{} +\item creating depsys, an image for compiling axiom. + +Some of the Common Lisp code we compile uses macros which +are assumed to be available at compile time. The {\bf DEPSYS} +image is created to contain the compile time environment +and saved. We pipe compile commands into this environment +to compile from Common Lisp to machine dependent code. +\begin{verbatim} +DEPSYS= ${OBJ}/${SYS}/bin/depsys +\end{verbatim} + +\item creating savesys, an image for running axiom. + +Once we've compile all of the Common Lisp files we fire up +a clean lisp image called {\bf LOADSYS}, load all of the +final executable code and save it out as {\bf SAVESYS}. +The {\bf SAVESYS} image is copied to the [[${MNT}/${SYS}/bin]] +subdirectory and becomes the axiom executable image. +\begin{verbatim} +LOADSYS= ${OBJ}/${SYS}/bin/lisp +SAVESYS= ${OBJ}/${SYS}/bin/interpsys +AXIOMSYS= ${MNT}/${SYS}/bin/AXIOMsys +\end{verbatim} + + +\item creating debugsys, an image with all interpreted functions loaded. + +Occasionally we need to really get into the system internals. +The best way to do this is to run almost all of the lisp code +interpreted rather than compiled (note that cfuns.lisp and sockio.lisp +still need to be loaded in compiled form as they depend on the +loader to link with lisp internals). This image is nothing more +than a load of the file src/interp/debugsys.lisp.pamphlet. If +you need to make test modifications you can add code to that +file and it will show up here. +\begin{verbatim} +DEBUGSYS=${OBJ}/${SYS}/bin/debugsys +\end{verbatim} +\end{list} +<>= +(defun spad-save (save-file) + (setq |$SpadServer| nil) + (setq $openServerIfTrue t) +#+:AKCL + (system::save-system save-file) +#+:allegro + (if (fboundp 'boot::restart) + (excl::dumplisp :name save-file :restart-function #'boot::restart) + (excl::dumplisp :name save-file)) +#+Lucid + (if (fboundp 'boot::restart) + (sys::disksave save-file :restart-function #'boot::restart) + (sys::disksave save-file)) +#+:CCL + (preserve) +) + +@ + +\chapter{The Interpreter} +<>= +(IMPORT-MODULE "vmlisp") +(in-package "BOOT") +<> + + +<> + +<> +<> + +<> + +<> + +<> + +<> +<> + +<> +<> +<> + +@ +\chapter{Makefile.bookvol5} +<<*>>= +LATEX=/usr/bin/latex +LISP=${AXIOM}/obj/linux/bin/lisp +TANGLE=/usr/local/bin/NOTANGLE +WEAVE=/usr/local/bin/NOWEAVE -delay + +all: bookvol5 + @echo 0 done + +bookvol5: bookvol5.pamphlet + @echo 1 extracting the bookvol5reter + ${WEAVE} bookvol5.pamphlet >bookvol5.tex + ${LATEX} bookvol5.tex + ${LATEX} bookvol5.tex + ${TANGLE} -R"Interpreter" bookvol5.pamphlet >bookvol5.lisp + +remake: + @echo 2 rebuilding the makefile + @${TANGLE} bookvol5.pamphlet >Makefile.bookvol5 + +@ +\eject +\begin{thebibliography}{99} +\bibitem nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/bootfuns.lisp.pamphlet b/src/interp/bootfuns.lisp.pamphlet new file mode 100644 index 00000000..1afbe294 --- /dev/null +++ b/src/interp/bootfuns.lisp.pamphlet @@ -0,0 +1,601 @@ +%% Oh Emacs, this is a -*- Lisp -*- file despite apperance. +\documentclass{article} +\usepackage{axiom} + +\title{\File{src/interp/bootfuns.lisp} Pamphlet} +\author{Timothy Daly} + +\begin{document} +\maketitle + +\begin{abstract} +\end{abstract} + +\tableofcontents +\eject + + +\section{License} + +<>= +;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +;; All rights reserved. +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are +;; met: +;; +;; - Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; +;; - Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in +;; the documentation and/or other materials provided with the +;; distribution. +;; +;; - Neither the name of The Numerical ALgorithms Group Ltd. nor the +;; names of its contributors may be used to endorse or promote products +;; derived from this software without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +;; IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +;; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +;; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +;; OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +;; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +;; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ + + + +\section{The [[BOOT]] package} + +Everything in axiom that the user references eventually shows +up here. The interpreter and the algebra are run after switching +to the boot package (in-package "BOOT") so any symbol that the +interpreter or algebra uses has to (cough, cough) appear here. +<<*>>= +<> + +(IMPORT-MODULE "hash") +(defpackage "BOOT" + #+:common-lisp (:use "COMMON-LISP") + #-:common-lisp (:use "LISP") + (:use "VMLISP" "AxiomCore")) + +@ + +Note that it is confusing the package \Tool{Axiom}'s compiler and +interpreter use is called [[BOOT]]. It should have been +[[Spad]], or better yet [[Axiom]]. + + +\section{Constants} + +\subsection{\$EmptyMode} + +[[$EmptyMode]] is a contant whose value is [[$EmptyMode]]. +It is used by [[isPartialMode]] (in [[i-funsel.boot]]) to +decide if a modemap is partially constructed. If the [[$EmptyMode]] +constant occurs anywhere in the modemap structure at any depth +then the modemap is still incomplete. To find this constant the +[[isPartialMode]] function calls [[CONTAINED |$EmptyMode| Y]] +which will walk the structure $Y$ looking for this constant. +<>= +(def-boot-val |$EmptyMode| '|$EmptyMode| "compiler constant") +@ + + +\section{Portability issues} + +This section discusses some portability issues known to affect +this module. + +\subsection{[[compiler-let]]} + +The construct [[compiler-let]] is not part of ANSI Lisp, although +it had been described in CLTL. Therefore some Lisp implementations +offer it as extensions. + +<>= +#+:clisp (import 'ext:compiler-let) +@ + +\subsection{Missing DFLOAT Transcendental functions} + +These functions should be defined for DoubleFloat inputs but are not. +These are cheap and easy definitions that work but should be rewritten. +<>= +(defun sec (x) (/ 1 (cos x))) +(defun csc (x) (/ 1 (sin x))) +(defun acsc (x) (asin (/ 1 x))) +(defun asec (x) (acos (/ 1 x))) +(defun csch (x) (/ 1 (sinh x))) +(defun coth (x) (* (cosh x) (csch x))) +(defun sech (x) (/ 1 (cosh x))) +(defun acsch (x) (asinh (/ 1 x))) +(defun acoth (x) (atanh (/ 1 x))) +(defun asech (x) (acosh (/ 1 x))) +@ + +\subsection{The manexp fix} + +Contributed by Juergen Weiss from a suggestion by Arthur Norman. +This is a Mantissa and Exponent function. +<>= +#+(or :cmu :akcl :gcl) +(defun manexp (u) + (multiple-value-bind (f e s) + (decode-float u) + (cons (* s f) e))) + +@ + +\subsection{The arc cotangent function} + +Contributed by Juergen Weiss from Arthur Norman's CCL. +<>= +#+(or :cmu :akcl :gcl) +(defun acot (a) + (if (> a 0.0) + (if (> a 1.0) + (atan (/ 1.0 a)) + (- (/ pi 2.0) (atan a))) + (if (< a -1.0) + (- pi (atan (/ -1.0 a))) + (+ (/ pi 2.0) (atan (- a)))))) + +@ + +\subsection{The arc cotangent function} + +Contributed by Juergen Weiss from Arthur Norman's CCL. +<>= +#+(or :cmu :akcl :gcl) +(defun cot (a) + (if (or (> a 1000.0) (< a -1000.0)) + (/ (cos a) (sin a)) + (/ 1.0 (tan a)))) + +@ + +\subsection{The get-current-directory function} + +Contributed by Juergen Weiss. +<>= +#+:cmu +(defun get-current-directory () + (namestring (extensions::default-directory))) + +#+(or :akcl :gcl) +(defun get-current-directory () + (namestring (truename ""))) + +@ + + +<<*>>= + +; NAME: Boot Package +; PURPOSE: Provide forward references to Boot Code for functions to be at +; defined at the boot level, but which must be accessible +; not defined at lower levels. + +(in-package "BOOT") + +<> + +(defmacro def-boot-fun (f args where) + `(compiler-let nil + (defun ,f ,args ,where (print (list ',f . ,args))) + (export '(,f) "BOOT"))) + +(defmacro def-boot-var (p where) + `(compiler-let nil + (defparameter ,p nil ,where) + (export '(,p) "BOOT"))) + +(defmacro def-boot-val (p val where) + `(compiler-let nil + (defparameter ,p ,val ,where) + (export '(,p) "BOOT"))) + +(def-boot-fun |initializeSetVariables| (arg) "early temp def") +(def-boot-fun |updateSourceFiles| (x) "temp def") +#-:CCL +(def-boot-val |$timerTicksPerSecond| INTERNAL-TIME-UNITS-PER-SECOND + "for TEMPUS-FUGIT and $TOTAL-ELAPSED-TIME") +#+:CCL +(def-boot-val |$timerTicksPerSecond| 1000 + "for TEMPUS-FUGIT and $TOTAL-ELAPSED-TIME") +(def-boot-val $boxString + (concatenate 'string (list (code-char #x1d) (code-char #xe2))) + "this string of 2 chars displays as a box") +(def-boot-val |$quadSymbol| $boxString "displays an APL quad") +(def-boot-val |$quadSym| '|$quadSym| "unbound symbol referenced in format.boot") +(def-boot-val $escapeString (string (code-char 27)) + "string for single escape character") +(def-boot-val $boldString (concatenate 'string $escapeString "[12m") + "switch into bold font") +(def-boot-val $normalString (concatenate 'string $escapeString "[0;10m") + "switch back into normal font") +(def-boot-val $reverseVideoString (concatenate 'string $escapeString "[7m") + "switch into reverse video") +(def-boot-val $underlineString (concatenate 'string $escapeString "[4m") + "switch into underline mode") +(def-boot-val $COMPILE t "checked in COMP-2 to skip compilation") +(def-boot-var |$abbreviationTable| "???") +(def-boot-val |$algebraList| + '(|QuotientField| |Polynomial| + |UnivariatePoly| + |MultivariatePolynomial| + |DistributedMultivariatePolynomial| + |HomogeneousDistributedMultivariatePolynomial| + |Gaussian| |SquareMatrix| + |RectangularMatrix|) "???") +(def-boot-val |$BasicDomains| + '(|Integer| |Float| |Symbol| + |Boolean| |String|) "???") +(def-boot-val |$BasicPredicates| + '(FIXP STRINGP FLOATP) "???") +(def-boot-val |$BFtag| '-BF- "big float marker") +(def-boot-val |$BigFloat| '(|Float|) "???") +(def-boot-val |$BigFloatOpt| '(|BigFloat| . OPT) "???") +(def-boot-val |$Boolean| '(|Boolean|) "???") +(def-boot-val |$BooleanOpt| '(|Boolean| . OPT) "???") +(def-boot-val |$bootStrapMode| () "if T compCapsule skips body") +(def-boot-fun |bootUnionPrint| (x s tt) "Interpreter>Coerce.boot") +(def-boot-fun |break| (msg) "Interpreter>Trace.boot") +(def-boot-fun |breaklet| (fn vars) "Interpreter>Trace.boot") +(def-boot-var |$brightenCommentsFlag| "???") +(def-boot-var |$brightenCommentsIfTrue| "???") +(def-boot-val |$BreakMode| '|query| "error.boot") +(def-boot-var |$cacheAlist| "Interpreter>System.boot") +(def-boot-val |$cacheCount| 0 "???") +(def-boot-val |$Category| '(|Category|) "???") +; modemap:== ( (p e) (p e) ... (p e) ) +; modemaplist:= ( modemap ... ) + +(def-boot-val |$CategoryFrame| + '((((|Category| . ((|modemap| (((|Category|) (|Category|)) (T *))))) + (|Join| . ((|modemap| + (((|Category|) (|Category|) (|Category|) (|Category|)) (T *)) + (((|Category|) (|Category|) (|List| |Category|)) (|Category|)) (T *)) + ))))) + "Compiler>CUtil.boot") +(def-boot-val |$CategoryNames| + '(|Category| |CATEGORY| |RecordCategory| |Join| + |StringCategory| |SubsetCategory| |UnionCategory|) + "???") +(def-boot-val |$clamList| + '((|getModemapsFromDatabase| |hash| UEQUAL |count|) + (|getOperationAlistFromLisplib| |hash| UEQUAL |count|) + (|getFileProperty| |hash| UEQUAL |count|) + (|canCoerceFrom| |hash| UEQUAL |count|) + (|selectMms1| |hash| UEQUAL |count|) + (|coerceMmSelection| |hash| UEQUAL |count|) + (|isValidType| |hash| UEQUAL |count|)) + "Interpreter>Clammed.boot") +(def-boot-val |$CommonDomains| + '(|Record| |Union| |List| |Vector| + |String| |Float| |Integer| + |NonNegativeInteger| |Expression| + |NonPositiveInteger| + |PositiveInteger| |SmallInteger| + |Boolean|) "???") + +(def-boot-var |$compCount| "???") +(def-boot-var |$compileMapFlag| "Interpreter>SetVars.boot") +(def-boot-var |$compUniquelyIfTrue| "Compiler>Compiler.boot") +(def-boot-val |$consistencyCheck| nil "Interpreter>Consis.boot") +(def-boot-val |$ConstructorCache| (MAKE-HASHTABLE 'ID) "???") +(def-boot-var |$constructorsNotInDatabase| "Interpreter>Database.boot") +(def-boot-var |$createUpdateFiles| "Interpreter>SetVarT.boot") +(def-boot-var |$croakIfTrue| "See moan in U.") +(def-boot-var |$currentFunction| "???") +(def-boot-val |$currentLine| "" "current input line for history") +(def-boot-val $delay 0 "???") +(def-boot-var $Directory "???") +(def-boot-var $DISPLAY "???") +(def-boot-val |$Domain| '(|Domain|) "???") +(def-boot-var |$DomainFrame| "???") +(def-boot-val |$DomainNames| + '(|Integer| |Float| |Symbol| |Boolean| + |String| |Expression| + |Mapping| |SubDomain| |List| |Union| + |Record| |Vector|) "???") +(def-boot-val |$DomainsInScope| '(NIL) "???") +(def-boot-val |$domainTraceNameAssoc| () "association list of trace domains") +(def-boot-val |$DomainVariableList| + '($1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 + $12 $13 $14 $15) "???") +(def-boot-val |$DoubleQuote| "\"" "???") +(def-boot-val |$DummyFunctorNames| + '(|Boolean| |Mapping|) "???") +(def-boot-var |$eltIfNil| "SpecialFunctions>PSpad.boot") +(def-boot-val |$EmptyEnvironment| '((NIL)) "???") +(def-boot-val |$EmptyList| () "???") +<> +(def-boot-val |$EM| |$EmptyMode| "???") +(def-boot-val |$EmptyString| "" "???") +(def-boot-val |$EmptyVector| '#() "???") +(def-boot-val |$Expression| '(|Expression|) "???") +(def-boot-val |$ExpressionOpt| + '(|Expression| . OPT) "???") +(def-boot-var |$evalDomain| "???") +(def-boot-val |$Exit| '(Exit) "compiler constant") +(def-boot-var |$exitMode| "???") +(def-boot-var |$exitModeStack| "???") +(def-boot-val |$failure| (GENSYM) "Symbol denoting a failed operation.") +(def-boot-val |$false| NIL "???") +(def-boot-val |$Float| '(|Float|) "???") +(def-boot-val |$FloatOpt| '(|Float| . OPT) "???") +(def-boot-val |$FontTable| '(|FontTable|) "???") +(def-boot-var |$forceDatabaseUpdate| "See load function.") +(def-boot-var |$form| "???") +(def-boot-val |$FormalMapVariableList| + '(\#1 \#2 \#3 \#4 \#5 \#6 \#7 \#8 \#9 + \#10 \#11 \#12 \#13 \#14 \#15) "???") +(def-boot-val |$FormalMapVariableList2| + '(\#\#1 \#\#2 \#\#3 \#\#4 \#\#5 \#\#6 \#\#7 \#\#8 \#\#9 + \#\#10 \#\#11 \#\#12 \#\#13 \#\#14 \#\#15) "???") +(def-boot-var |$fromSpadTrace| "Interpreter>Trace.boot") +(def-boot-var $function "Interpreter>System.boot") +(def-boot-var $FunName "???") +(def-boot-var $FunName_Tail "???") +(def-boot-val |$ConstructorNames| + '(|SubDomain| |List| |Union| |Record| |Vector|) + "Used in isFunctor test, and compDefine.") +(def-boot-val |$gauss01| '(|gauss| 0 1) "???") +(def-boot-var |$genFVar| "???") +(def-boot-val |$genSDVar| 0 "counter for genSomeVariable" ) +(def-boot-val |$hasCategoryTable| (MAKE-HASHTABLE 'UEQUAL) "???") +(def-boot-var |$hasYield| "???") +(def-boot-var |$ignoreCommentsIfTrue| "???") +(def-boot-var |$Index| "???") +(def-boot-val |$InitialDomainsInScope| + '((|Boolean|) |$EmptyMode| |$NoValueMode|) + "???") +(def-boot-val |$InitialModemapFrame| '((NIL)) "???") +(def-boot-var |$inLispVM| "Interpreter>Eval.boot") +(def-boot-var |$insideCapsuleFunctionIfTrue| "???") +(def-boot-var |$insideCategoryIfTrue| "???") +(def-boot-var |$insideCoerceInteractiveHardIfTrue| "???") +(def-boot-val |$insideCompTypeOf| NIL "checked in comp3") +(def-boot-val |$insideConstructIfTrue| NIL "checked in parse.boot") +(def-boot-var |$insideExpressionIfTrue| "???") +(def-boot-var |$insideFunctorIfTrue| "???") +(def-boot-var |$insideWhereIfTrue| "???") +(def-boot-val |$instantRecord| (MAKE-HASHTABLE 'ID) "???") +(def-boot-val |$Integer| '(|Integer|) "???") +(def-boot-val |$IntegerOpt| '(|Integer| . OPT) "???") +(def-boot-val |$InteractiveFrame| '((NIL)) "top level environment") +(def-boot-var |$InteractiveMode| "Interactive>System.boot") +(def-boot-val |$InteractiveModemapFrame| '((NIL)) "???") +(def-boot-var |$InteractiveTimingStatsIfTrue| "???") +(def-boot-var |$LastCxArg| "???") +(def-boot-val $lastprefix "S-" "???") +(def-boot-val |$lastUntraced| NIL "Used for )restore option of )trace.") +(def-boot-var |$leaveLevelStack| "???") +(def-boot-var |$leaveMode| "???") +(def-boot-val |$leftPren| "(" "For use in SAY expressions.") +(def-boot-val |$letAssoc| NIL "Used for trace of assignments in SPAD code.") +(def-boot-var |$libFile| "Compiler>LispLib.boot") +(def-boot-var $LINENUMBER "???") +(def-boot-var $linestack "???") +(def-boot-val |$Lisp| '(|Lisp|) "???") +(def-boot-val $LISPLIB nil "whether to produce a lisplib or not") +(def-boot-var |$lisplibDependentCategories| "Compiler>LispLib.boot") +(def-boot-var |$lisplibDomainDependents| "Compiler>LispLib.boot") +(def-boot-var |$lisplibForm| "Compiler>LispLib.boot") +(def-boot-var |$lisplibKind| "Compiler>LispLib.boot") +(def-boot-var |$lisplibModemapAlist| "Compiler>LispLib.boot") +(def-boot-var |$lisplibModemap| "Compiler>LispLib.boot") +(def-boot-var |$lisplibOperationAlist| "Compiler>LispLib.boot") +(def-boot-var |$lisplibSignatureAlist| "Compiler>LispLib.boot") +(def-boot-var |$lisplibVariableAlist| "Compiler>LispLib.boot") +(def-boot-var |$lisp2lispRenameAssoc| "???") +(def-boot-val |$LocalFrame| '((NIL)) "???") +(def-boot-var |$mapSubNameAlist| "Interpreter>Trace.boot") +(def-boot-var |$mathTrace| "Interpreter>Trace.boot") +(def-boot-var |$mathTraceList| "Controls mathprint output for )trace.") +(def-boot-var $maxlinenumber "???") +(def-boot-val |$Mode| '(Mode) "compiler constant") +(def-boot-var |$ModemapFrame| "???") +(def-boot-val |$ModeVariableList| + '(&1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 + &12 &13 &14 &15) "???") +(def-boot-var |$mostRecentOpAlist| "???") +(def-boot-var $NBOOT "???") +(def-boot-val |$NegativeIntegerOpt| '(|NegativeInteger| . OPT) "???") +(def-boot-val |$NegativeInteger| '(|NegativeInteger|) "???") +(def-boot-val |$NETail| (CONS |$EmptyEnvironment| NIL) "???") +(def-boot-var $NEWLINSTACK "???") +(def-boot-var |$noEnv| "???") +(def-boot-val |$NonMentionableDomainNames| '($ |Rep| |Mapping|) "???") +(def-boot-val |$NonNegativeIntegerOpt| '(|NonNegativeInteger| . OPT) "???") +(def-boot-val |$NonNegativeInteger| '(|NonNegativeInteger|) "???") +(def-boot-val |$NonPositiveIntegerOpt| '(|NonPositiveInteger| . OPT) "???") +(def-boot-val |$NonPositiveInteger| '(|NonPositiveInteger|) "???") +(def-boot-var |$noParseCommands| "???") +(def-boot-val |$NoValueMode| '|$NoValueMode| "compiler literal") +(def-boot-val |$NoValue| '|$NoValue| "compiler literal") +(def-boot-val $num_of_meta_errors 0 "Number of errors seen so far") +(def-boot-var $OLDLINE "Used to output command lines.") +(def-boot-val |$oldTime| 0 "???") +(def-boot-val |$One| '(|One|) "???") +(def-boot-val |$OneCoef| '(1 1 . 1) "???") +(def-boot-val |$operationNameList| NIL "op names for apropos") +(def-boot-var |$opFilter| "Used to /s a function") +(def-boot-var |OptionList| "???") +(def-boot-val |$optionAlist| nil "info for trace boot") +(def-boot-var |$OutsideStringIfTrue| "???") +(def-boot-val |$PatternVariableList| + '(*1 *2 *3 *4 *5 *6 *7 *8 *9 *10 *11 + *12 *13 *14 *15) "???") +(def-boot-var |$PolyMode| "???") +(def-boot-val |$Polvar| '(WRAPPED . ((1 . 1))) "???") +(def-boot-var |$polyDefaultAssoc| "???") +(def-boot-val |$PolyDomains| + '(|Polynomial| |MultivariatePolynomial| + |UnivariatePoly| + |DistributedMultivariatePolynomial| + |HomogeneousDistributedMultivariatePolynomial|) + "???") +(def-boot-val |$PositiveIntegerOpt| '(|PositiveInteger| . OPT) "???") +(def-boot-val |$PositiveInteger| '(|PositiveInteger|) "???") +(def-boot-var |$postStack| "???") +(def-boot-var |$prefix| "???") +(def-boot-val |$PrettyPrint| nil "if t generated code is prettyprinted") +(def-boot-var |$previousTime| "???") +(def-boot-val |$PrimitiveDomainNames| nil +"Used in mkCategory to avoid generating vector slot +for primitive domains. Also used by putInLocalDomainReferences and optCal.") +(def-boot-val |$optimizableDomainNames| + '(|FactoredForm| |List| |Vector| + |Integer| |NonNegativeInteger| |PositiveInteger| + |SmallInteger| |String| |Boolean| |Symbol| |BooleanFunctions|) + "used in optCall to decide which domains can be optimized") +(def-boot-val |$PrintBox| '(|PrintBox|) "???") +(def-boot-var |$PrintCompilerMessagesIfTrue| "???") +(def-boot-val |$printConStats| nil "display constructor cache totals") +(def-boot-val |$printLoadMsgs| 't "Interpreter>SetVarT.boot") +(def-boot-var |$PrintOnly| "Compiler>LispLib.boot") +(def-boot-val |$UserSynonyms| () "list of user defined synonyms") +(def-boot-val |$SystemSynonyms| () "list of system defined synonyms") +(def-boot-val |$QuickCode| NIL "Controls generation of QREFELT, etc.") +(def-boot-val |$QuickLet| NIL "Set to T for no LET tracing.") +(def-boot-var |$QuietIfNil| "???") +(def-boot-val |$RationalNumberOpt| '(|RationalNumber| . OPT) "???") +(def-boot-val |$RationalNumber| '(|RationalNumber|) "???") +(def-boot-var |$readingFile| "???") +(def-boot-val |$report3| nil "addMap report info") +(def-boot-var |$reportBottomUpFlag| "Interpreter>SetVarT.boot") +(def-boot-var |$reportCoerce| "???") +(def-boot-var |$reportCoerceIfTrue| "???") +(def-boot-var |$reportCompilation| "???") +(def-boot-var |$reportExitModeStack| "???") +(def-boot-var |$reportFlag| "Interpreter>SetVars.boot") +(def-boot-val |$reportSpadTrace| () "report list of traced functions") +(def-boot-var |$resolveFlag| "Interpreter>SetVars.boot") +(def-boot-var |$returnMode| "???") +(def-boot-val |$rightPren| ")" "???") +(def-boot-var |$scanModeFlag| "???") +(def-boot-var |$semanticErrorStack| "???") +(def-boot-val |$SetFunctions| nil "checked in SetFunctionSlots") +(def-boot-val |$SideEffectFreeFunctionList| + '(|null| |case| |Zero| |One| \: \:\: |has| |Mapping| + |elt| = \> \>= \< \<= MEMBER |is| |isnt| ATOM + $= $\> $\>= $\< $\<= $^= $MEMBER) "???") +(def-boot-var |$slamFlag| "Interpreter>SetVars.boot") +(def-boot-val |$SmallInteger| '(|SmallInteger|) "???") +(def-boot-val |$SmallIntegerOpt| '(|SmallInteger| . OPT) "???") +(def-boot-val |$sourceFileTypes| + '(SPAD BOOT LISP LISP370 META) + "Interpreter>System.boot") +(def-boot-val $SPAD nil "Is this Spad code?") +(def-boot-var $SPAD_ERRORS "???") +(def-boot-val |$spadLibFT| 'LISPLIB "???") +(def-boot-var |$spadOpList| "???") +(def-boot-var |$spadSystemDisks| "Interpreter>Database.boot") +(def-boot-val |$SpecialDomainNames| + '(|add| |CAPSULE| |SubDomain| |List| |Union| |Record| |Vector|) + "Used in isDomainForm, addEmptyCapsuleIfnecessary.") +(def-boot-var |$streamAlist| "???") +(def-boot-val |$streamCount| 0 "???") +(def-boot-var |$streamIndexing| "???") +(def-boot-val |$StreamIndex| 0 "???") +(def-boot-val |$StringCategory| '(|StringCategory|) "???") +(def-boot-val |$StringOpt| '(|String| . OPT) "???") +(def-boot-val |$String| '(|String|) "???") +(def-boot-var |$suffix| "???") +(def-boot-val |$Symbol| '(|Symbol|) "???") +(def-boot-val |$SymbolOpt| '(|Symbol| . OPT) "???") +(def-boot-var |$systemCommands| "Interpreter>System.boot") +(def-boot-val |$systemCreation| (currenttime) "???") +(def-boot-val |$systemLastChanged| + |$systemCreation| "???") +(def-boot-val |$tempCategoryTable| (MAKE-HASHTABLE 'UEQUAL) "???") +(def-boot-val |$ThrowAwayMode| '|$ThrowAwayMode| "interp constant") +(def-boot-val |$timerOn| t "???") +(def-boot-var |$topOp| "See displayPreCompilationErrors") +(def-boot-var |$tokenCommands| "???") +(def-boot-var $TOKSTACK "???") +(def-boot-val $TOP_LEVEL t "???") +(def-boot-var $top_stack "???") +(def-boot-var |$tracedModemap| "Interpreter>Trace.boot") +(def-boot-val |$traceDomains| t "enables domain tracing") +(def-boot-val |$TraceFlag| t "???") +(def-boot-var |$tracedSpadModemap| "Interpreter>Trace.boot") +(def-boot-var |$traceletFunctions| "???") +(def-boot-var |$traceNoisely| "Interpreter>Trace.boot") +(def-boot-var |$TranslateOnly| "???") +(def-boot-var |$tripleCache| "Compiler>Compiler.boot") +(def-boot-val |$true| ''T "???") +(def-boot-var $Type "???") +(def-boot-val |$underDomainAlist| + '((|DistributedMultivariatePolynomial| . 2) + (|FactoredForm| . 1) + (|FactoredRing| . 1) + (|Gaussian| . 1) + (|List| . 1) + (|Matrix| . 1) + (|MultivariatePolynomial| . 2) + (|HomogeneousDistributedMultivariatePolynomial| . 2) + (|Polynomial| . 1) + (|QuotientField| . 1) + (|RectangularMatrix| . 3) + (|SquareMatrix| . 2) + (|UnivariatePoly| . 2) + (|Vector| . 1) + (|VVectorSpace| . 2)) "???") + +(def-boot-val |$updateCatTableIfTrue| T "update category table on load") +(def-boot-var |$updateIfTrue| + "Should SPAD databases be updated&squeezed?") +(def-boot-val |$useBFasDefault| T + "Determines whether to use BF as default floating point type.") +(def-boot-val |$useDCQnotLET| () "checked in DEF-LET for use of DCQ") +(def-boot-fun BUMPCOMPERRORCOUNT () "errorSupervisor1") +(def-boot-var |$VariableCount| "???") +(def-boot-val |$Void| '(|Void|) "compiler constant") +(def-boot-var |$warningStack| "???") +(def-boot-val |$whereList| () "referenced in format boot formDecl2String") +(def-boot-var |$xCount| "???") +(def-boot-var |$xeditIsConsole| "???") +(def-boot-var |$xyCurrent| "???") +(def-boot-var |$xyInitial| "???") +(def-boot-var |$xyMax| "???") +(def-boot-var |$xyMin| "???") +(def-boot-var |$xyStack| "???") +(def-boot-val |$Zero| '(|Zero|) "???") + +(def-boot-val |$domainsWithUnderDomains| + (mapcar #'car |$underDomainAlist|) "???") +(def-boot-val |$inputPromptType| '|step| "checked in MKPROMPT") +(def-boot-val |$IOindex| 0 "step counter") + +(defun |printLoadMessages| (u) + (if (memq u '(|%display%| |%describe%|)) + (if |$printLoadMsgs| "on" "off") + (seq + (setq |$printLoadMsgs| (and (listp u) (equal (car u) '|on|))) +#+:CCL (verbos (if |$printLoadMsgs| 2 0)) +))) + +<> +<> +<> +<> +<> +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} diff --git a/src/interp/bootlex.lisp.pamphlet b/src/interp/bootlex.lisp.pamphlet new file mode 100644 index 00000000..37ddf16d --- /dev/null +++ b/src/interp/bootlex.lisp.pamphlet @@ -0,0 +1,488 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/interp bootlex.lisp} +\author{Timothy Daly} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\section{License} +<>= +;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +;; All rights reserved. +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are +;; met: +;; +;; - Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; +;; - Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in +;; the documentation and/or other materials provided with the +;; distribution. +;; +;; - Neither the name of The Numerical ALgorithms Group Ltd. nor the +;; names of its contributors may be used to endorse or promote products +;; derived from this software without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +;; IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +;; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +;; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +;; OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +;; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +;; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@ +<<*>>= +<> + +; NAME: BootLex.lisp +; PURPOSE: Parsing support routines for Boot and Spad code +; CONTENTS: +; +; 0. Global parameters +; 1. BOOT File Handling +; 2. BOOT Line Handling +; 3. BOOT Token Handling +; 4. BOOT Token Parsing Actions +; 5. BOOT Error Handling + +(in-package "BOOT") + +; *** 0. Global parameters + +(defparameter Boot-Line-Stack nil "List of lines returned from PREPARSE.") + +(defun Next-Lines-Clear () (setq Boot-Line-Stack nil)) + +(defun Next-Lines-Show () + (and Boot-Line-Stack (format t "Currently preparsed lines are:~%~%")) + (mapcar #'(lambda (line) + (format t "~&~5D> ~A~%" (car line) (cdr Line))) + Boot-Line-Stack)) + +; *** 1. BOOT file handling + +(defun init-boot/spad-reader () + (setq $SPAD_ERRORS (VECTOR 0 0 0)) + (setq SPADERRORSTREAM *standard-output*) + (setq XTokenReader 'get-BOOT-token) + (setq Line-Handler 'next-BOOT-line) + (setq Meta_Error_Handler 'spad_syntax_error) + (setq File-Closed nil) + (Next-Lines-Clear) + (setq Boot-Line-Stack nil) + (ioclear)) + +(defmacro test (x &rest y) + `(progn + (setq spaderrorstream t) + (in-boot) + (initialize-preparse *terminal-io*) + (,(intern (strconc "PARSE-" x)) . ,y))) + +(defun |oldParserAutoloadOnceTrigger| () nil) + +(defun print-defun (name body) + (let* ((sp (assoc 'vmlisp::compiler-output-stream vmlisp::optionlist)) + (st (if sp (cdr sp) *standard-output*))) + (if (and (is-console st) (symbolp name) (fboundp name) + (not (compiled-function-p (symbol-function name)))) + (compile name)) + (when (or |$PrettyPrint| (not (is-console st))) + (print-full body st) (force-output st)))) + +(defun boot-parse-1 (in-stream + &aux + (Echo-Meta nil) + (current-fragment nil) + ($INDEX 0) + ($LineList nil) + ($EchoLineStack nil) + ($preparse-last-line nil) + ($BOOT T) + (*EOF* NIL) + (OPTIONLIST NIL)) + (declare (special echo-meta *comp370-apply* *EOF* File-Closed + $index $linelist $echolinestack $preparse-last-line)) + (init-boot/spad-reader) + (let* ((Boot-Line-Stack (PREPARSE in-stream)) + (parseout (prog2 (|PARSE-Expression|) (pop-stack-1)) ) ) + ;(setq parseout (|new2OldLisp| parseout)) + ; (setq parseout (DEF-RENAME parseout)) + ; (DEF-PROCESS parseout) + parseout)) + +(defun boot (&optional + (*boot-input-file* nil) + (*boot-output-file* nil) + &aux + (Echo-Meta t) + ($BOOT T) + (|$InteractiveMode| NIL) + (XCape #\_) + (File-Closed NIL) + (*EOF* NIL) + (OPTIONLIST NIL) + (*fileactq-apply* (function print-defun)) + (*comp370-apply* (function print-defun))) + (declare (special echo-meta *comp370-apply* *EOF* File-Closed XCape)) + (init-boot/spad-reader) + (with-open-stream + (in-stream (if *boot-input-file* (open *boot-input-file* :direction :input) + *standard-input*)) + (initialize-preparse in-stream) + (with-open-stream + (out-stream (if *boot-output-file* + (open *boot-output-file* :direction :output) + #-:cmulisp (make-broadcast-stream *standard-output*) + #+:cmulisp *standard-output* + )) + (when *boot-output-file* + (format out-stream "~&;;; -*- Mode:Lisp; Package:Boot -*-~%~%") + (print-package "BOOT")) + (loop (if (and (not File-Closed) + (setq Boot-Line-Stack (PREPARSE in-stream))) + (progn + (|PARSE-Expression|) + (let ((parseout (pop-stack-1)) ) + (setq parseout (|new2OldLisp| parseout)) + (setq parseout (DEF-RENAME parseout)) + (let ((*standard-output* out-stream)) + (DEF-PROCESS parseout)) + (format out-stream "~&") + (if (null parseout) (ioclear)) )) + (return nil))) + (if *boot-input-file* + (format out-stream ";;;Boot translation finished for ~a~%" + (namestring *boot-input-file*))) + (IOClear in-stream out-stream))) + T) + +(defun spad (&optional + (*spad-input-file* nil) + (*spad-output-file* nil) + &aux + ;; (Echo-Meta *spad-input-file*) + ;; (*comp370-apply* (function print-and-eval-defun)) + (*comp370-apply* (function print-defun)) + (*fileactq-apply* (function print-defun)) + ;; (|$InteractiveMode| nil) + ($SPAD T) + ($BOOT nil) + (XCape #\_) + (OPTIONLIST nil) + (*EOF* NIL) + (File-Closed NIL) + ;; ($current-directory "/spad/libraries/") + (/editfile *spad-input-file*) + (|$noSubsumption| |$noSubsumption|) + in-stream out-stream) + (declare (special echo-meta /editfile *comp370-apply* *EOF* + File-Closed Xcape |$noSubsumption|)) + ;; only rebind |$InteractiveFrame| if compiling + (progv (if (not |$InteractiveMode|) '(|$InteractiveFrame|)) + (if (not |$InteractiveMode|) + (list (|addBinding| + '|$DomainsInScope| + `((FLUID . |true|) + (|special| . ,(COPY-TREE |$InitialDomainsInScope|))) + (|addBinding| '|$Information| NIL (|makeInitialModemapFrame|))))) + (init-boot/spad-reader) + (unwind-protect + (progn + (setq in-stream (if *spad-input-file* + (open *spad-input-file* :direction :input) + *standard-input*)) + (initialize-preparse in-stream) + (setq out-stream (if *spad-output-file* + (open *spad-output-file* :direction :output) + *standard-output*)) + (when *spad-output-file* + (format out-stream "~&;;; -*- Mode:Lisp; Package:Boot -*-~%~%") + (print-package "BOOT")) + (setq curoutstream out-stream) + (loop + (if (or *eof* file-closed) (return nil)) + (catch 'SPAD_READER + (if (setq Boot-Line-Stack (PREPARSE in-stream)) + (let ((LINE (cdar Boot-Line-Stack))) + (declare (special LINE)) + (|PARSE-NewExpr|) + (let ((parseout (pop-stack-1)) ) + (when parseout + (let ((*standard-output* out-stream)) + (S-PROCESS parseout)) + (format out-stream "~&"))) + ;(IOClear in-stream out-stream) + ))) + (IOClear in-stream out-stream))) + (if *spad-input-file* (shut in-stream)) + (if *spad-output-file* (shut out-stream))) + T)) + +(defun READ-BOOT (FN FM TO) + (let (($boot t)) (READ-SPAD1 FN 'BOOT FM TO))) + +(defun READ-SPAD1 (FN FT FM TO) + (LET ((STRM IN-STREAM)) + (SETQ $MAXLINENUMBER 0) + (SETQ $SPAD_ERRORS (VECTOR 0 0 0)) + (SETQ IN-STREAM (open (strconc fm ">" fn "." ft) :direction :input)) + ($ERASE (LIST FN 'ERROR 'A)) + (SETQ OUT-STREAM (if TO (open to :direction :output) OUT-STREAM)) + (SETQ SPADERRORSTREAM (open (strconc "a>" fn ".error") :direction :output)) + (READ-SPAD-1) + (close SPADERRORSTREAM) + (SETQ IN-STREAM STRM) + (OR (EQUAL #(0 0 0) $SPAD_ERRORS) + (|sayBrightly| (LIST '|%b| (ELT $SPAD_ERRORS 0) '|%d| '|syntax errors| + '|%l| '|%b| (ELT $SPAD_ERRORS 1) '|%d| '|precompilation errors| + '|%l| '|%b| (ELT $SPAD_ERRORS 2) '|%d| '|semantic errors| '|%l|))) + (+ (ELT $SPAD_ERRORS 0) (ELT $SPAD_ERRORS 1) (ELT $SPAD_ERRORS 2)))) + +(defun READBOOT () + (let (form expr ($BOOT 'T)) + (declare (special $BOOT)) + (ADVANCE-TOKEN) + (|PARSE-Expression|) + ;; (|pp| (setq form (|postTransform| (FIRST STACK)))) + (|pp| (setq form (|postTransform| (pop-STACK-1)))) + (setq EXPR (DEF-RENAME form)) + (DEF-PROCESS EXPR) + (TERSYSCOMMAND))) + +; *** 2. BOOT Line Handling *** + +; See the file PREPARSE.LISP for the hard parts of BOOT line processing. + +(defun next-BOOT-line (&optional (in-stream t)) + + "Get next line, trimming trailing blanks and trailing comments. +One trailing blank is added to a non-blank line to ease between-line +processing for Next Token (i.e., blank takes place of return). Returns T +if it gets a non-blank line, and NIL at end of stream." + + (if Boot-Line-Stack + (let ((Line-Number (caar Boot-Line-Stack)) + (Line-Buffer (suffix #\Space (cdar Boot-Line-Stack)))) + (pop Boot-Line-Stack) + (Line-New-Line Line-Buffer Current-Line Line-Number) + (setq |$currentLine| (setq LINE Line-Buffer)) + Line-Buffer))) + +; *** 3. BOOT Token Handling *** + +(defparameter xcape #\_ "Escape character for Boot code.") + +(defun get-BOOT-token (token) + + "If you have an _, go to the next line. +If you have a . followed by an integer, get a floating point number. +Otherwise, get a .. identifier." + + (if (not (boot-skip-blanks)) + nil + (let ((token-type (boot-token-lookahead-type (current-char)))) + (case token-type + (eof (token-install nil '*eof token nonblank)) + (escape (advance-char) + (get-boot-identifier-token token t)) + (argument-designator (get-argument-designator-token token)) + (id (get-boot-identifier-token token)) + (num (get-number-token token)) + (string (get-SPADSTRING-token token)) + (special-char (get-special-token token)) + (t (get-gliph-token token token-type)))))) + +(defun boot-skip-blanks () + (setq nonblank t) + (loop (let ((cc (current-char))) + (if (not cc) (return nil)) + (if (eq (boot-token-lookahead-type cc) 'white) + (progn (setq nonblank nil) (if (not (advance-char)) (return nil))) + (return t))))) + +(defun boot-token-lookahead-type (char) + "Predicts the kind of token to follow, based on the given initial character." + (cond ((not char) 'eof) + ((char= char #\_) 'escape) + ((and (char= char #\#) (digitp (next-char))) 'argument-designator) + ((digitp char) 'num) + ((and (char= char #\$) $boot + (alpha-char-p (next-char))) 'id) + ((or (char= char #\%) (char= char #\?) + (char= char #\!) (alpha-char-p char)) 'id) + ((char= char #\") 'string) + ((member char + '(#\Space #\Tab #\Return) + :test #'char=) 'white) + ((get (intern (string char)) 'Gliph)) + (t 'special-char))) + +(defun get-argument-designator-token (token) + (advance-char) + (get-number-token token) + (token-install (intern (strconc "#" (format nil "~D" (token-symbol token)))) + 'argument-designator token nonblank)) + +(defvar Keywords '(|or| |and| |isnt| |is| |otherwise| |when| |where| + |has| |with| |add| |case| |in| |by| |pretend| |mod| + |exquo| |div| |quo| |else| |rem| |then| |suchthat| + |if| |yield| |iterate| |from| |exit| |leave| |return| + |not| |unless| |repeat| |until| |while| |for| |import|) + + + +"Alphabetic literal strings occurring in the New Meta code constitute +keywords. These are recognized specifically by the AnyId production, +GET-BOOT-IDENTIFIER will recognize keywords but flag them +as keywords.") + +(defun get-boot-identifier-token (token &optional (escaped? nil)) + "An identifier consists of an escape followed by any character, a %, ?, +or an alphabetic, followed by any number of escaped characters, digits, +or the chracters ?, !, ' or %" + (prog ((buf (make-adjustable-string 0)) + (default-package NIL)) + (suffix (current-char) buf) + (advance-char) + id (let ((cur-char (current-char))) + (cond ((char= cur-char XCape) + (if (not (advance-char)) (go bye)) + (suffix (current-char) buf) + (setq escaped? t) + (if (not (advance-char)) (go bye)) + (go id)) + ((and (null default-package) + (char= cur-char #\')) + (setq default-package buf) + (setq buf (make-adjustable-string 0)) + (if (not (advance-char)) (go bye)) + (go id)) + ((or (alpha-char-p cur-char) + (digitp cur-char) + (member cur-char '(#\% #\' #\? #\!) :test #'char=)) + (suffix (current-char) buf) + (if (not (advance-char)) (go bye)) + (go id)))) + bye (if (and (stringp default-package) + (or (not (find-package default-package)) ;; not a package name + (every #'(lambda (x) (eql x #\')) buf))) ;;token ends with '' + (setq buf (concatenate 'string default-package "'" buf) + default-package nil)) + (setq buf (intern buf (or default-package "BOOT"))) + (return (token-install + buf + (if (and (not escaped?) + (member buf Keywords :test #'eq)) + 'keyword 'identifier) + token + nonblank)))) + +(defun get-gliph-token (token gliph-list) + (prog ((buf (make-adjustable-string 0))) + (suffix (current-char) buf) + (advance-char) + loop (setq gliph-list (assoc (intern (string (current-char))) gliph-list)) + (if gliph-list + (progn (suffix (current-char) buf) + (pop gliph-list) + (advance-char) + (go loop)) + (let ((new-token (intern buf))) + (return (token-install (or (get new-token 'renametok) new-token) + 'gliph token nonblank)))))) + +(defun get-SPADSTRING-token (token) + "With TOK=\" and ABC\" on IN-STREAM, extracts and stacks string ABC" + (PROG ((BUF (make-adjustable-string 0))) + (if (char/= (current-char) #\") (RETURN NIL) (advance-char)) + (loop + (if (char= (current-char) #\") (return nil)) + (SUFFIX (if (char= (current-char) XCape) + (advance-char) + (current-char)) + BUF) + (if (null (advance-char)) ;;end of line + (PROGN (|sayBrightly| "Close quote inserted") (RETURN nil))) + ) + (advance-char) + (return (token-install (copy-seq buf) ;should make a simple string + 'spadstring token)))) + +; **** 4. BOOT token parsing actions + +; Parsing of operator tokens depends on tables initialized by BOTTOMUP.LISP + +(defun-parse-token SPADSTRING) +(defun-parse-token KEYWORD) +(defun-parse-token ARGUMENT-DESIGNATOR) + +(defun |boot-LEXPR| () (SETQ $NBOOT T) (New-LEXPR1)) + +(defun TRANSLABEL (X AL) (TRANSLABEL1 X AL) X) + +(defun TRANSLABEL1 (X AL) + "Transforms X according to AL = ((