\documentclass{book}
%\newcommand{\VolumeName}{Volume 2: Axiom Users Guide}
%\input{bookheader.tex}
\pagenumbering{arabic}
\mainmatter
\setcounter{chapter}{0} % Chapter 1

\usepackage{makeidx}
\makeindex
\begin{document}
\begin{verbatim}
\start
Date: Mon, 1 Dec 2008 11:29:46 -0600
From: Tim Daly
To: list
Subject: 20081201.01.tpd.patch (bookvol10.3 add domains)

More domains were added to the algebra domain volume.

The large patch is available at:
<http://axiom-developer.org/axiom-website/patches.html#latest>

\start
Date: Mon, 1 Dec 2008 11:30:45 -0600
From: Tim Daly
To: list
Subject: 20081201.02.tpd.patch (add missing files)

The 20081201.01.tpd.patch was incomplete. 
This adds the missing files.
=========================================================================
diff --git a/changelog b/changelog
index e63377a..bfd5dfb 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,56 @@
+20081201 tpd src/axiom-website/patches.html 20081201.01 and 20081201.02
+20081201 tpd books/ps/v103sequentialdifferentialvariable.ps added
+20081201 tpd books/ps/v103sequentialdifferentialpolynomial.ps added
+20081201 tpd books/ps/v103orderlydifferentialvariable.ps added
+20081201 tpd books/ps/v103orderlydifferentialpolynomial.ps added
+20081201 tpd books/ps/v103odeintensityfunctionstable.ps added
+20081201 tpd books/ps/v103integrationfunctionstable.ps added
+20081201 tpd books/ps/v103hyperellipticfinitedivisor.ps added
+20081201 tpd books/ps/v103framedmodule.ps added
+20081201 tpd books/ps/v103fractionalidealfunctions2.ps added
+20081201 tpd books/ps/v103fractionalideal.ps added
+20081201 tpd books/ps/v103finitedivisor.ps added
+20081201 tpd books/ps/v103extalgbasis.ps added
+20081201 tpd books/ps/v103drawoption.ps added
+20081201 tpd books/ps/v103differentialsparsemultivariatepolynomial.ps added
+20081201 tpd books/ps/v103derhamcomplex.ps added
+20081201 tpd books/ps/v103d03fafannatype.ps added
+20081201 tpd books/ps/v103d03eefannatype.ps added
+20081201 tpd books/ps/v103d02ejfannatype.ps added
+20081201 tpd books/ps/v103d02cjfannatype.ps added
+20081201 tpd books/ps/v103d02bhfannatype.ps added
+20081201 tpd books/ps/v103d02bbfannatype.ps added
+20081201 tpd books/ps/v103d01transformfunctiontype.ps added
+20081201 tpd books/ps/v103d01gbfannatype.ps added
+20081201 tpd books/ps/v103d01fcfannatype.ps added
+20081201 tpd books/ps/v103d01asfannatype.ps added
+20081201 tpd books/ps/v103d01aqfannatype.ps added
+20081201 tpd books/ps/v103d01apfannatype.ps added
+20081201 tpd books/ps/v103d01anfannatype.ps added
+20081201 tpd books/ps/v103d01amfannatype.ps added
+20081201 tpd books/ps/v103d01alfannatype.ps added
+20081201 tpd books/ps/v103d01akfannatype.ps added
+20081201 tpd books/ps/v103d01ajfannatype.ps added
+20081201 tpd books/ps/v103antisymm.ps added
+20081201 tpd books/Makefile add amssymb for toc.tex creation \mathbb
+20081201 tpd src/algebra/drawopt.spad move domain to bookvol10.3
+20081201 tpd src/algebra/Makefile remove dpolcat.spad
+20081201 tpd src/algebra/dpolcat.spad removed, move domains to bookvol10.3
+20081201 tpd src/algebra/divisor.spad move domains to bookvol10.3
+20081201 tpd src/algebra/Makefile remove derham.spad
+20081201 tpd src/algebra/derham.spad removed, move domain to bookvol10.3
+20081201 tpd src/algebra/Makefile remove d03routine.spad
+20081201 tpd src/algebra/d03routine.spad removed, move domain to bookvol10.3
+20081201 tpd src/algebra/Makefile remove d02routine.spad
+20081201 tpd src/algebra/d02routine.spad removed, move domain to bookvol10.3
+20081201 tpd src/algebra/d02agents.spad move domain to bookvol10.3
+20081201 tpd src/algebra/Makefile remove d01transform.spad
+20081201 tpd src/algebra/d01transform.spad removed, move domain to bookvol10.3
+20081201 tpd src/algebra/Makefile remove d01routine.spad
+20081201 tpd src/algebra/d01routine.spad removed, move domains to bookvol10.3
+20081201 tpd src/algebra/d01agents.spad move domain to bookvol10.3
+20081130 tpd src/axiom-website/patches.html 20081130.02.tpd.patch
+20081130 tpd src/axiom-website/videos.html added
 20081130 tpd src/axiom-website/patches.html 20081130.01.tpd.patch
 20081130 tpd src/axiom-website/videos.html add videos link
 20081130 tpd src/axiom-website/screenshots.html add videos link
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index cd25d6a..6c4c33a 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -763,6 +763,10 @@ index.html - fix broken link<br/>
 website -- add videos page<br/>
 <a href="patches/20081130.02.tpd.patch">20081130.02.tpd.patch</a>
 website -- add videos page<br/>
+<a href="patches/20081201.01.tpd.patch">20081201.01.tpd.patch</a>
+bookvol10.3 add domains<br/>
+<a href="patches/20081201.02.tpd.patch">20081201.02.tpd.patch</a>
+add missing files<br/>
 
  </body>
 </html>
\ No newline at end of file

\start
Date: Mon, 01 Dec 2008 14:30:42 -0700
From: Karl Hegbloom
To: list
Subject: [patch] Suggested grammatical improvement for	bookvol7.1.pamphlet


Karl Hegbloom
Phone: 435-659-6257

--------------050005040508050100030602
 name="bookvol7.1.pamphlet.diff"
 filename="bookvol7.1.pamphlet.diff"

diff --git a/books/bookvol7.1.pamphlet b/books/bookvol7.1.pamphlet
index a88a865..1bf7b1d 100644
--- a/books/bookvol7.1.pamphlet
+++ b/books/bookvol7.1.pamphlet
@@ -71202,7 +71202,7 @@ find a solution.
 Some computer algebra systems use heuristics or table-driven
 approaches to integration.  When these systems cannot determine the
 answer to an integration problem, they reply ``I don't know.'' Axiom
-uses a algorithm for integration.  that conclusively proves that an
+uses an algorithm for integration that utilizes a conclusive proof that an
 integral cannot be expressed in terms of elementary functions.
 
 \xtc{

\start
Date: Mon, 1 Dec 2008 16:54:46 -0500
From: Tim Daly
To: Karl Hegbloom
Subject: Re: [patch] Suggested grammatical improvement for bookvol7.1.pamphlet

Thanks. I'll apply it at the next update. -- Tim

\start
Date: Mon, 1 Dec 2008 19:57:20 -0600
From: Tim Daly
To: list
Subject: 20081201.03.tpd.patch (bookvol10.3 add domains)

Add Karl Hegbloom to credits.
Fix typos in omserver.spad, fparfrac.spad, bookvol7.1
Add Expression.help, Expression.regress to src/algebra/Makefile
Add more domains to bookvol10.3

The patch is too large to post. See
<http://axiom-developer.org/axiom-website/patches.html#latest>

\start
Date: Mon, 1 Dec 2008 20:10:15 -0600
From: Tim Daly
To: list
Subject: 20081201.04.tpd.patch (website add wmv, pdf to videos)

The Information Sources video has been rendered in wmv format
so it can be viewed directly from the Axiom website. (Note that
google reported 68 views in the first 24 hours).

The Information Sources video in PDF format was added to the video page

======================================================================
diff --git a/changelog b/changelog
index fa626d9..82bc4ae 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,7 @@
+20081201 tpd src/axiom-website/patches.html 20081201.04.tpd.patch
+20081201 tpd src/axiom-website/index.html fix video link
+20081201 tpd src/axiom-website/videos.html add wmv, pdf
+20081201 tpd src/axiom-website/patches.html 20081201.03.tpd.patch
 20081201 tpd books/Makefile move amssymb to preamble
 20081201 kxh books/bookvol7.1 fix syntax
 20081201 tpd src/interp/setq.lisp add Karl Hegbloom
diff --git a/src/axiom-website/index.html b/src/axiom-website/index.html
index 0e05eed..0bce186 100644
--- a/src/axiom-website/index.html
+++ b/src/axiom-website/index.html
@@ -72,7 +72,7 @@
    </div>
    <div align="center">
     [
-     <a href="videos.html" title="videos">
+     <a href="axiom-website/videos.html" title="videos">
       Videos
      </a>
     ]
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index ad638c8..6daa1c1 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -769,6 +769,8 @@ bookvol10.3 add domains<br/>
 add missing files<br/>
 <a href="patches/20081201.03.tpd.patch">20081201.03.tpd.patch</a>
 bookvol10.3 add domains<br/>
+<a href="patches/20081201.04.tpd.patch">20081201.04.tpd.patch</a>
+website add wmv, pdf to video page<br/>
 
  </body>
 </html>
\ No newline at end of file
diff --git a/src/axiom-website/videos.html b/src/axiom-website/videos.html
index adda03d..5fc142a 100644
--- a/src/axiom-website/videos.html
+++ b/src/axiom-website/videos.html
@@ -91,13 +91,43 @@
   <br>
   <hr>
 
-<div id="body">
+<div id="header">
  Axiom videos are now available. This will be an ongoing development
  effort.
  <br/>
- <a href="http://www.youtube.com/watch?v=CV8y3UrpadY">
-  Axiom Information Sources"
-  </a>
+</div>
+<hr/>
+<div id="informationsources">
+<table>
+ <tr> 
+  <td>
+   <b>Axiom Information Sources</b>
+  </td>
+  <td>
+   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+  </td>
+  <td>
+   <a href="http://www.youtube.com/watch?v=CV8y3UrpadY">
+    youtube
+   </a>
+  </td>
+  <td>
+   <a href="informationsources.html">
+    wmv
+   </a>
+  </td>
+  <td>
+   <a href="informationsources.pdf">
+    pdf
+   </a>
+  </td>
+ </tr>
+</table>
+<br/>
+The <b>Information Sources</b> video gives a quick overview of the 
+external and internal information available for Axiom. The
+external sources include books and websites. The internal
+sources include browsers and help facilities. 
 </div>
 
 </body>

\start
Date: Tue, 2 Dec 2008 12:42:09 -0600
From: Tim Daly
To: list
Subject: 20081202.01.tpd.patch (browser lighten background image)

The Axiom firefox background was too dark. 
This patch lightens it.
========================================================================
diff --git a/books/bookvol11.pamphlet b/books/bookvol11.pamphlet
index a74adfe..18e20b3 100644
--- a/books/bookvol11.pamphlet
+++ b/books/bookvol11.pamphlet
@@ -253,7 +253,7 @@ all: ${PAGES}
 	@ ${TANGLE} -R"strang.input"   ${BOOK} >strang.input
 	@ ${TANGLE} -R"signatures.txt" ${BOOK} >signatures.txt
 	@ cp ${SPD}/books/ps/doctitle.png ${OUT}/doctitle.png
-	@ cp ${SPD}/books/ps/bigbayou.png ${OUT}/bigbayou.png
+	@ cp ${SPD}/books/ps/lightbayou.png ${OUT}/lightbayou.png
 
 @
 
@@ -38665,7 +38665,7 @@ The normal arithmetic operations are available for floating point numbers.
 <<page head>>
  <center>
   <a href="axbook/book-contents.xhtml">
-   <img src="axbook/ps/bluebayou.png"/>
+   <img src="axbook/ps/lightbayou.png"/>
   </a>
  </center>
  <center>
@@ -49077,7 +49077,7 @@ Additional information sources:
 <<rootpage.xhtml>>=
 <<standard head>>
   <style>
-   body { background: url(bigbayou.png) no-repeat; }
+   body { background: url(lightbayou.png) no-repeat; }
   </style>
  </head>
  <body>
diff --git a/books/ps/lightbayou.png b/books/ps/lightbayou.png
new file mode 100644
index 0000000..958dca8
Binary files /dev/null and b/books/ps/lightbayou.png differ
diff --git a/changelog b/changelog
index 82bc4ae..a96b9cb 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,6 @@
+20081202 tpd src/axiom-website/patches.html 20081202.01.tpd.patch
+20081202 tpd books/ps/lightbayou.png lighten browser background
+20081202 tpd books/bookvol11.pamphlet lighten browser background
 20081201 tpd src/axiom-website/patches.html 20081201.04.tpd.patch
 20081201 tpd src/axiom-website/index.html fix video link
 20081201 tpd src/axiom-website/videos.html add wmv, pdf
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 6daa1c1..4f9cb94 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -771,6 +771,8 @@ add missing files<br/>
 bookvol10.3 add domains<br/>
 <a href="patches/20081201.04.tpd.patch">20081201.04.tpd.patch</a>
 website add wmv, pdf to video page<br/>
+<a href="patches/20081202.01.tpd.patch">20081202.01.tpd.patch</a>
+browser lighten background image <br/>
 
  </body>
 </html>
\ No newline at end of file

\start
Date: Tue, 2 Dec 2008 17:39:54 -0600
From: Tim Daly
To: list
Subject: 20081202.02.tpd.patch (website download.html add Doyen Thumbdrive)

Thanks to Alfredo Portes there is now a USB thumbdrive bootable version 
of Axiom available at 

<http://axiom-developer.org/axiom-website/download.html>

Download the file and follow the instructions which are available
further down on the page.

Tim
=========================================================================
diff --git a/changelog b/changelog
index a96b9cb..6a46d88 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081202 tpd src/axiom-website/patches.html 20081202.02.tpd.patch
+20081202 tpd src/axiom-website/download.html add doyen thumbdrive
 20081202 tpd src/axiom-website/patches.html 20081202.01.tpd.patch
 20081202 tpd books/ps/lightbayou.png lighten browser background
 20081202 tpd books/bookvol11.pamphlet lighten browser background
@@ -9,7 +11,7 @@
 20081201 kxh books/bookvol7.1 fix syntax
 20081201 tpd src/interp/setq.lisp add Karl Hegbloom
 20081201 tpd readme add Karl Hegbloom
-20081201 kxh Karl Hegbloom <harl.hegbloom@gmail.com>	
+20081201 kxh Karl Hegbloom	
 20081201 tpd src/algebra/omserver.spad fix unexpected HT command
 20081201 tpd src/algebra/fparfrac.spad fix unexpected HT command
 20081201 tpd src/axiom-website/patches.html 20081201.03.tpd.patch
diff --git a/src/axiom-website/download.html b/src/axiom-website/download.html
index ad30551..0f3e075 100644
--- a/src/axiom-website/download.html
+++ b/src/axiom-website/download.html
@@ -255,6 +255,43 @@
     <tr>
      <td align="left">
       <font face="Helvetica, Arial, sans-serif" size="+1">
+       Doyen Thumbdrive
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      <a href="downloads/doyenthumb-ubuntu-july2008-bin.zip">zip</a>
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      </font>
+     </td>
+    </tr>
+
+    <tr>
+     <td align="left">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
        fedora5
       </font>
      </td>
@@ -898,13 +935,26 @@ export PATH=$AXIOM/bin:$PATH
 make
 </pre>
 
+  <hr>
+  <h1>Doyen Thumbdrive</h1>
+  <p>
+   Afer you download and unzip the file, copy the boot and DOYEN
+   directories to your USB drive.
+  </p>
 
+  <p>
+   Make sure you are inside the mounted drive and run bootinst.sh
+   (bootinst.bat on windows) that is inside the boot directory.
+   Please make SURE you are installing to the USB DRIVE in the
+   message.
+  </p>
+  
   <hr>
   <h1>Compile notes</h1>
    <p>In general, various systems insist on moving critical files
       around or, worse yet, don't install needed files. These notes
       show particular details for known systems
-   </a>
+   </p>
   <h3>Ubuntu</h3>
    <pre>
 echo 0 >/proc/sys/kernel/randomize_va_space
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 4f9cb94..fa77512 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -773,6 +773,8 @@ bookvol10.3 add domains<br/>
 website add wmv, pdf to video page<br/>
 <a href="patches/20081202.01.tpd.patch">20081202.01.tpd.patch</a>
 browser lighten background image <br/>
+<a href="patches/20081202.02.tpd.patch">20081202.02.tpd.patch</a>
+website download.html add Doyen Thumbdrive <br/>
 
  </body>
 </html>
\ No newline at end of file

\start
Date: Wed, 03 Dec 2008 05:33:04 -0500
From: William Sit
To: list
Subject: Re: 20081202.02.tpd.patch (website download.html add Doyen Thumbdrive)

I downloaded the zip file, unzip and copy boot and DOYEN 
directories to the USB drive. Running bootinst.bat results 
in MBR not written (Access denied). I login-ed on a 
Windows machine running Vista Home Premium with SP1, as 
administrator. Permission was denied due to "physical 
access" to hardware. (Windows Defender is running, as well 
as some other security software.)

I used two different USB, same result.

Then I opened a DOS window and switched to the DOS 
directory and run DOYEN.bat, and this was the result:

LOADLIN v1.6c (C) 1994..2002 Hans Lermen <lermen@fgan.de>

CPU is in V86-mode (may be WINDOWS, EMM386, QEMM, 386MAX, 
...)
You need pure 386/486 real mode or a VCPI server to boot 
Linux
VCPI is supported by most EMS drivers (if EMS is enabled),
but never under WINDOWS-3.1 or WINDOWS'95.
(However, real DOS-Mode of WINDOWS'95 can have EMS driver 
with VCPI)
If loading via VCPI you also MUST have:
   1. An interceptable setup-code (see MANUAL.TXT)
   2. Identical Physical-to-Virtual mapping for the first 
640 Kbytes

Your current DOS/CPU configuration is:
   load buffer size: 0x00000000     , setup buffer size: 
 0x3E00
   total memory:     0x00100000
   CPU is in V86 mode
   SetupIntercept: NO
   stat2: cpu_V86, but no VCPI available (check aborted)
   input params (size 0x0078):
     ..\vmlinuz root=/dev/ram0 rw initrd=..\initrd.gz 
init=linuxrc load_ramdisk=1
  prompt_ramdisk=0 ramdisk_size=6666 vga=769
   LOADLIN started from DOS-prompt
WARNING: Not enough free memory (load buffer size)
E:\boot\dos>

Well, my laptop is a Acer Travelmate 7520G, AMD Turion 
64x2 Mobile Technology. 

Is there a way to run VCPI? I tried running in 
compatibility mode with Win 98 or NT4.0 (including 
loadlin.exe) and no luck. From the message above, it 
sounds like this is using some old DOS drivers (VCPI has 
been replaced by DPMI and others years ago).

Any help will be appreciated. Thanks.

William

On Tue, 2 Dec 2008 17:39:54 -0600
  Tim Daly wrote:
>Thanks to Alfredo Portes there is now a USB thumbdrive 
>bootable version 
>of Axiom available at 
>
><http://axiom-developer.org/axiom-website/download.html>
>
>Download the file and follow the instructions which are 
>available
>further down on the page.

\start
Date: Wed, 03 Dec 2008 06:48:45 -0500
From: William Sit
To: list
Subject: Re: 20081202.02.tpd.patch (website download.html add Doyen Thumbdrive)

I found out how to get around the MBR problem.
I have to first boot into safe mode with command prompt 
(on my machine, it is F8 while booting). Then in the DOS 
window, run bootinst.bat.  This succeeds in overwriting 
the MBR. 

Then I have to change the BIOS setting (F2 while booting) 
to allow booting from a USB HDD.

And that does it. Axiom runs.

I did find some problem with the hyperdoc trying to run 
examples from 3D graphics. It crashes with a system error. 
I don't have the details since I had to reboot a few times 
to set up internet access. I can connect by wired 
internet, but I have not been able to run wireless yet -- 
That's my problem though.

Great job and many thanks to Alfredo Portes for the 
thumbdrive version.

William




On Wed, 03 Dec 2008 05:33:04 -0500
  William Sit wrote:
>Tim:
>
>I downloaded the zip file, unzip and copy boot and DOYEN 
>directories to the USB drive. Running bootinst.bat 
>results in MBR not written (Access denied). I login-ed on 
>a Windows machine running Vista Home Premium with SP1, as 
>administrator. Permission was denied due to "physical 
>access" to hardware. (Windows Defender is running, as 
>well as some other security software.)
>
>I used two different USB, same result.
>
>Then I opened a DOS window and switched to the DOS 
>directory and run DOYEN.bat, and this was the result:
>
>LOADLIN v1.6c (C) 1994..2002 Hans Lermen <lermen@fgan.de>
>
>CPU is in V86-mode (may be WINDOWS, EMM386, QEMM, 386MAX, 
>...)
>You need pure 386/486 real mode or a VCPI server to boot 
>Linux
>VCPI is supported by most EMS drivers (if EMS is 
>enabled),
>but never under WINDOWS-3.1 or WINDOWS'95.
>(However, real DOS-Mode of WINDOWS'95 can have EMS driver 
>with VCPI)
>If loading via VCPI you also MUST have:
>   1. An interceptable setup-code (see MANUAL.TXT)
>   2. Identical Physical-to-Virtual mapping for the first 
>640 Kbytes
>
>Your current DOS/CPU configuration is:
>   load buffer size: 0x00000000     , setup buffer size: 
>  0x3E00
>   total memory:     0x00100000
>   CPU is in V86 mode
>   SetupIntercept: NO
>   stat2: cpu_V86, but no VCPI available (check aborted)
>   input params (size 0x0078):
>     ..\vmlinuz root=/dev/ram0 rw initrd=..\initrd.gz 
>init=linuxrc load_ramdisk=1
>  prompt_ramdisk=0 ramdisk_size=6666 vga=769
>   LOADLIN started from DOS-prompt
>WARNING: Not enough free memory (load buffer size)
>E:\boot\dos>
>
>Well, my laptop is a Acer Travelmate 7520G, AMD Turion 
>64x2 Mobile Technology. 
>Is there a way to run VCPI? I tried running in 
>compatibility mode with Win 98 or NT4.0 (including 
>loadlin.exe) and no luck. From the message above, it 
>sounds like this is using some old DOS drivers (VCPI has 
>been replaced by DPMI and others years ago).
>
>Any help will be appreciated. Thanks.
>
>William
>
>On Tue, 2 Dec 2008 17:39:54 -0600
>  Tim Daly wrote:
>>Thanks to Alfredo Portes there is now a USB thumbdrive 
>>bootable version of Axiom available at 
>><http://axiom-developer.org/axiom-website/download.html>
>>
>>Download the file and follow the instructions which are 
>>available
>>further down on the page.

\start
Date: Thu, 04 Dec 2008 00:54:10 -0500
From: William Sit
To: list
Subject: Re: 20081202.02.tpd.patch (website download.html add Doyen Thumbdrive)

This email is not Axiom related, but Doyen OS related. 
Maybe it is because I do not know how Doyen functions, but 
I believe the Doyen USB version is not meant to replace an 
alternative bootable version in the sense that the Doyen 
drive is not "writable" (the USB drive is writable, but 
Doyen seems to treat it as if it is a CDROM, since, as far 
as I can tell, the OS that boots up only resides in 
memory, and all files changed are in memory, which would 
not survive a shutdown). This is likely because a separate 
OS is "installed" rather than "booted" from a writable 
drive. The Doyen files are read-only, and even if one 
makes them "writable", the resident OS would not update it 
without some hacking, because an image of the OS at boot 
time is compressed by the volumes (like usr.lzm, var.lzm, 
home.lzm, in the DOYEN/base directory).  It would be great 
if there is a command like "saveSystem" to pack the memory 
system back onto the drive, sort of like for a virtual 
machine, and preserve the state of all the computation 
frozen at the time of quitting Doyen. The resident OS need 
not even be shutdown. I think the tools are already 
available in DOYEN/tools, so that a script can easily 
perform it at shutdown. Something like (after making 
DOYEN/base writable):

cd /mnt/sdb1/DOYEN
tools/dir2lzm /var base/var.lzm

and similarly for the other volumes. This however takes a 
fairly long time, and I notice there is also a 
/mnt/live/memory/changes directory in the running system, 
and I wonder whether it would be possible and enough to 
just save just the changes (instead of /var, use /mnt/live 
in the illustration above), and the loading routines at 
boot time can restore the changes at "install" time. The 
problem with this approach, however, is that as the OS 
carries out the
command, some files such as log files, may be changed, and 
some cron jobs may also change other files, during the 
operation. Thus such "save" should best be done at 
shutdown time.

When the system is shutdown (and I mean using "shutdown -g 
now" from a terminal), it shuts down drivers, including 
the network connections, and then offers a menu to reboot, 
or to fix packages and some other choices, but there is no 
choice to update the USB drive images. Moreover, to fix 
things, it needs internet access for the packages and it 
fails, of course, despite the connection is still live. 
One is brought back to the reboot menu and this can go on 
looping forever until one really shuts down the machine 
from a booted system by going to system-quit on the menu 
bar. And then, everything is lost.

I know this is not the original purpose of Doyen and so 
this is not a complaint, but a suggestion. Unfortunately, 
I don't know enough to implement the suggestion.

I am still not able to set up the wireless (for a network 
with hidden ESSID) because the OS needs to download the 
drivers, and even though I did download the drivers with a 
wired connection, the system must be rebooted to take 
effect, but the system reboots from the USB drive! 
Occasionally, however, I am able to connect to an open 
wireless network from the neighborhood. I don't quite 
know why.

\start
Date: Thu, 4 Dec 2008 10:19:34 -0500
From: Alfredo Portes
To: William Sit
Subject: Re: 20081202.02.tpd.patch (website download.html add Doyen Thumbdrive)

I will address your email in more detail later, but I will like to
make a quick remark.

Doyen is created using Linux Live Scripts: http://www.linux-live.org/

In the documentation we have this:

"1) persistent changes
Use 'changes=...' boot parameter to specify persistent changes
directory or file. If a directory is used, eg. changes=/some_dir/ and
the /some_dir/ is found on some partition on your disk, then all the
changes made to the root filesystem will be saved to that directory.
This works even if /some_dir/ is on NTFS or VFAT, thanks to posixovl
overlay (an userspace filesystem, already included). Important note:
if you plan to save changes on VFAT, make sure to modify your
distribution's shutdown scripts. It must not execute killall, else
posixovl is killed and everything is wrong. Instead, call the cleanup
script from /mnt/live/cleanup. If a file is specified for the changes
boot parameter, eg. changes=/path/file.dat, and the file has a valid
filesystem inside, then the file will be loop-mounted and changes
written to it. You may also use changes=/dev/sda1/path/ and
changes=/dev/sda1/path/file.dat ... to specify particular device where
to look for. Other devices will be skipped (will not be even
mounted)."

You make want to give it a try. I will try to document all this later
on (once I get to test it
myself.).

\start
Date: Thu, 4 Dec 2008 15:09:10 -0600
From: Tim Daly
To: list
Subject: 20081203.01.tpd.patch (bookvol10.3 add domains)

More domains have been moved from the algebra directory to bookvol10.3

The patch is too large to post. See
<http://axiom-developer.org/axiom-website/patches.html#latest>

\start
Date: Thu, 4 Dec 2008 16:58:58 -0600
From: Tim Daly
To: list
Subject: 20081204.01.tpd.patch (website update screenshots)

This updates the screenshots page with actual output from Axiom.
=======================================================================
diff --git a/changelog b/changelog
index 37bbd8b..2532ed6 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,8 @@
+20081204 tpd src/axiom-website/patches.html 20081204.01.tpd.patch
+20081204 tpd src/axiom-website/matrixinmatrix.jpg replace texmacs version
+20081204 tpd src/axiom-website/heatequation.jpg replace texmacs version
+20081204 tpd src/axiom-website/axiomfirefox.jpg firefox screenshot
+20081204 tpd src/axiom-website/screenshots.html replace screenshots
 20081203 tpd src/axiom-website/patches.html 20081203.01.tpd.patch
 20081203 tpd books/bookvol10.3 add domains
 20081203 tpd books/ps/v103finitefieldcyclicgroup.ps added
diff --git a/src/axiom-website/axiomfirefox.jpg b/src/axiom-website/axiomfirefox.jpg
new file mode 100644
index 0000000..6ac4daf
Binary files /dev/null and b/src/axiom-website/axiomfirefox.jpg differ
diff --git a/src/axiom-website/heatequation.jpg b/src/axiom-website/heatequation.jpg
new file mode 100644
index 0000000..634e241
Binary files /dev/null and b/src/axiom-website/heatequation.jpg differ
diff --git a/src/axiom-website/matrixinmatrix.jpg b/src/axiom-website/matrixinmatrix.jpg
new file mode 100644
index 0000000..3359e59
Binary files /dev/null and b/src/axiom-website/matrixinmatrix.jpg differ
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 8115d1e..e943b24 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -777,6 +777,8 @@ browser lighten background image <br/>
 website download.html add Doyen Thumbdrive <br/>
 <a href="patches/20081203.01.tpd.patch">20081203.01.tpd.patch</a>
 bookvol10.3 add domains<br/>
+<a href="patches/20081204.01.tpd.patch">20081204.01.tpd.patch</a>
+website update screenshots<br/>
 
  </body>
 </html>
\ No newline at end of file
diff --git a/src/axiom-website/screenshots.html b/src/axiom-website/screenshots.html
index c6e200d..d40d9de 100644
--- a/src/axiom-website/screenshots.html
+++ b/src/axiom-website/screenshots.html
@@ -120,15 +120,10 @@
 
  <li>
  <p>
- <font size=5>
-  Some matrix computations under <a
- href="http://texmacs.org/">TeXmacs</a>. Please notice the hierarchical
- editing capabilities of TeXmacs. 
- </font>
- <br>
- <br>
- <br>
- <img src="screenshot3.png"> <br/>
+ Axiom is capable of nesting a matrix within a matrix as can
+ be seen from this screenshot:
+ </p>
+ <img src="matrixinmatrix.jpg"> <br/>
  </p>
  </li>
 
@@ -294,13 +289,19 @@ Type: XPolynomialRing(SquareMatrix(2,Fraction Integer),OrderedFreeMonoid Symbol)
 
 </div>
 <hr>
- <font size=5>
-Axiom is now running under Windows. This is a screenshot of Axiom
-running on Windows in a TeXmacs window:
- </font>
+<p>
+Axiom can do rule substitution to help simplify complex results
+as this screenshot shows:
+</p>
+<img src="heatequation.jpg">
+<hr>
+<p>
+Axiom has a new Firefox front end which will replace the Hyperdoc
+help system:
+</p>
 <br>
 <br>
-<img src="screenshot2.jpg">
+<img src="axiomfirefox.jpg">
 <br>
 
 </body>

\start
Date: Thu, 4 Dec 2008 23:14:59 -0600
From: Tim Daly
To: list
Subject: 20081204.02.tpd.patch (clean up input regression files)

Regularize and check all input regression files for proper counting
syntax so the checks can be more thorough.

This patch is too large to post. See
<http://axiom-developer.org/axiom-website/patches.html#latest>

\start
Date: Fri, 05 Dec 2008 01:45:08 -0500
From: William Sit
To: Alfredo Portes
Subject: Re: 20081202.02.tpd.patch (website download.html add Doyen Thumbdrive)

Thanks for the quick suggestion. I'll try that this 
weekend when I have more time.

The following report probably is unrelated to Doyen (or 
Axiom), but more to BIOS and drivers?

One minor "complaint" or rather "bug report": Doyen is not 
supposed to alter the machine or original OS. However I 
have found that, on my laptop (Acer Travelmate 7520G 
running Windows Vista Home Premium, SP1), the time of day 
(or perhaps the time zone, I'm not sure which) is always 
altered after I shut down Doyen and reboot to Windows 
Vista. This happens even when I simply do a restart right 
after booting up. I suspect this is due to Doyen modifying 
the time or time zone setting, say to manual instead of 
from internet time, since manual is the setting I got 
after rebooting to Windows even though I reset it back to 
internet time. If this is correct, then Doyen might have 
modified some BIOS setting.  Alternative theory: internet 
is not connected early enough in the boot process and the 
time zone is not set/reset correctlly (although the choice 
presented always has, in my case, Eastern US, as the 
default). I am not certain whether the time during Doyen 
is correct or not. I think it is.

Also, while Doyen recognizes the wireless hardware 
(Broadcom BCM 43 family), the driver does not seem to 
recognize the on/off switch that controls the wireless 
(kind of like *the switch*, not the hardware itself,  is 
disabled). This is probably again a BIOS and driver 
problem.

Thanks again for all your hard work on the Doyen project.

William

On Thu, 4 Dec 2008 10:19:34 -0500
  Alfredo Portes wrote:
>Hi William,
>
>I will address your email in more detail later, but I 
>will like to
>make a quick remark.
>
>Doyen is created using Linux Live Scripts: 
>http://www.linux-live.org/
>
>In the documentation we have this:
>
>"1) persistent changes
>Use 'changes=...' boot parameter to specify persistent 
>changes
>directory or file. If a directory is used, eg. 
>changes=/some_dir/ and
>the /some_dir/ is found on some partition on your disk, 
>then all the
>changes made to the root filesystem will be saved to that 
>directory.
>This works even if /some_dir/ is on NTFS or VFAT, thanks 
>to posixovl
>overlay (an userspace filesystem, already included). 
>Important note:
>if you plan to save changes on VFAT, make sure to modify 
>your
>distribution's shutdown scripts. It must not execute 
>killall, else
>posixovl is killed and everything is wrong. Instead, call 
>the cleanup
>script from /mnt/live/cleanup. If a file is specified for 
>the changes
>boot parameter, eg. changes=/path/file.dat, and the file 
>has a valid
>filesystem inside, then the file will be loop-mounted and 
>changes
>written to it. You may also use changes=/dev/sda1/path/ 
>and
>changes=/dev/sda1/path/file.dat ... to specify particular 
>device where
>to look for. Other devices will be skipped (will not be 
>even
>mounted)."
>
>You make want to give it a try. I will try to document 
>all this later
>on (once I get to test it
>myself.).

\start
Date: Fri, 5 Dec 2008 16:22:38 -0600
From: Tim Daly
To: list
Subject: 20081205.01.tpd.patch (bug 7161: integer.spad remove signature change)

The signature change for PositiveInteger in integer.spad causes a 
value stack overflow in r21bugsbig. This is a long standing regression.
Bug 7161 closed.

Tim
===========================================================================
diff --git a/changelog b/changelog
index f8f6e9f..beaca4a 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,7 @@
+20081205 tpd src/axiom-website/patches.html 20081205.01.tpd.patch
+20081205 tpd src/algebra/integer.spad fix r21bugsbig regression
+20081205 tpd src/input/r20bugs.input.pamphlet fix regression
+20081204 tpd src/axiom-website/patches.html 20081204.01.tpd.patch
 20081204 tpd src/input/r21bugsbig.input cleanup
 20081204 tpd src/algebra/zerodim.spad cleanup
 20081204 tpd src/input/void.input cleanup
diff --git a/src/algebra/integer.spad.pamphlet b/src/algebra/integer.spad.pamphlet
index 5f5a068..16ac727 100644
--- a/src/algebra/integer.spad.pamphlet
+++ b/src/algebra/integer.spad.pamphlet
@@ -10,10 +10,6 @@
 \tableofcontents
 \eject
 \section{package INTSLPE IntegerSolveLinearPolynomialEquation}
-<<dot>>=
-"INTSLPE" -> "PACKAGE"
-"IntegerSolveLinearPolynomialEquation()" -> "Package"
-@
 <<package INTSLPE IntegerSolveLinearPolynomialEquation>>=
 )abbrev package INTSLPE IntegerSolveLinearPolynomialEquation
 ++ Author: Davenport
@@ -726,14 +722,6 @@ o )show Integer
 o $AXIOM/doc/src/algebra/integer.spad.dvi
 
 @
-<<dot>>=
-"INT" -> "INS"
-"Integer()" -> "IntegerNumberSystem()"
-"INT" -> "KONVERT"
-"Integer()" -> "ConvertibleTo(String)"
-"INT" -> "OM"
-"Integer()" -> "OpenMath()"
-@
 <<domain INT Integer>>=
 )abbrev domain INT Integer
 ++ Author:
@@ -1123,12 +1111,6 @@ Note that this code is not included in the generated catdef.spad file.
 (MAKEPROP (QUOTE |Integer|) (QUOTE NILADIC) T) 
 @
 \section{domain NNI NonNegativeInteger}
-<<dot>>=
-"NNI" -> "OAMONS"
-"NonNegativeInteger()" -> "OrderedAbelianMonoidSup()"
-"NNI" -> "MONOID"
-"NonNegativeInteger()" -> "Monoid()"
-@
 <<domain NNI NonNegativeInteger>>=
 )abbrev domain NNI NonNegativeInteger
 ++ Author:
@@ -1331,12 +1313,6 @@ Note that this code is not included in the generated catdef.spad file.
 
 @
 \section{domain PI PositiveInteger}
-<<dot>>=
-"PI" -> "OASGP"
-"PositiveInteger()" -> "OrderedAbelianSemiGroup()"
-"PI" -> "MONOID"
-"PositiveInteger()" -> "Monoid()"
-@
 <<domain PI PositiveInteger>>=
 )abbrev domain PI PositiveInteger
 ++ Author:
@@ -1347,7 +1323,7 @@ Note that this code is not included in the generated catdef.spad file.
 ++ Keywords: positive integer
 ++ Description: \spadtype{PositiveInteger} provides functions for
 ++   positive integers.
-PositiveInteger: Join(OrderedAbelianSemiGroup,Monoid) with
+PositiveInteger: Join(AbelianSemiGroup,OrderedSet,Monoid) with
             gcd: (%,%) -> %
               ++ gcd(a,b) computes the greatest common divisor of two
               ++ positive integers \spad{a} and b.
@@ -1743,10 +1719,6 @@ o )show RomanNumeral
 o $AXIOM/doc/src/algebra/integer.spad.dvi
 
 @
-<<dot>>=
-"ROMAN" -> "INS"
-"RomanNumeral()" -> "IntegerNumberSystem()"
-@
 <<domain ROMAN RomanNumeral>>=
 )abbrev domain ROMAN RomanNumeral
 ++ Author:
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index e943b24..6b6b24c 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -779,6 +779,10 @@ website download.html add Doyen Thumbdrive <br/>
 bookvol10.3 add domains<br/>
 <a href="patches/20081204.01.tpd.patch">20081204.01.tpd.patch</a>
 website update screenshots<br/>
+<a href="patches/20081204.02.tpd.patch">20081204.02.tpd.patch</a>
+clean up input regression files<br/>
+<a href="patches/20081204.02.tpd.patch">20081204.02.tpd.patch</a>
+bug 7161: integer.spad remove signature change<br/>
 
  </body>
 </html>
\ No newline at end of file
diff --git a/src/input/r20bugs.input.pamphlet b/src/input/r20bugs.input.pamphlet
index 2fa8660..d91d6ff 100644
--- a/src/input/r20bugs.input.pamphlet
+++ b/src/input/r20bugs.input.pamphlet
@@ -196,7 +196,8 @@ positiveRemainder(-1::SINT,-5::SINT)
 complexRoots([u**2-v+1,v**2-4],[u,v],0.01)
 --R 
 --R
---R   (1)  [[1.73046875 %i,- 2.0],[- 1.73046875 %i,- 2.0],[- 1.0,2.0],[1.0,2.0]]
+--R   (1)
+--R   [[1.732421875 %i,- 2.0],[- 1.732421875 %i,- 2.0],[- 1.0,2.0],[1.0,2.0]]
 --R                                                Type: List List Complex Float
 --E 17
 
\start
Date: Fri, 5 Dec 2008 18:05:47 -0600
From: Tim Daly
To: list
Subject: 20081205.02.tpd.patch (schaum17 fix 14.355, 14.356)

Tim Lahey pointed out that the 'ax' term in these two equations should
properly be 'a*x'. The equations still do not simplify.
======================================================================
diff --git a/readme b/readme
index b9c3c20..c8f1a1c 100644
--- a/readme
+++ b/readme
@@ -215,9 +215,10 @@ at the axiom command prompt will prettyprint the list.
 "Alejandro Jakubi       Richard Jenks"
 "Kai Kaminski           Grant Keady            Tony Kennedy"
 "Paul Kosinski          Klaus Kusche           Bernhard Kutzler"
-"Larry Lambe            Franz Lehner           Frederic Lehobey"
-"Michel Levaud          Howard Levy            Liu Xiaojun"
-"Rudiger Loos           Michael Lucks          Richard Luczak"
+"Tim Lahey              Larry Lambe            Franz Lehner"
+"Frederic Lehobey       Michel Levaud          Howard Levy"
+"Liu Xiaojun            Rudiger Loos           Michael Lucks"
+"Richard Luczak"
 "Camm Maguire           Francois Maltey        Alasdair McAndrew"
 "Bob McElrath           Michael McGettrick     Ian Meikle"
 "David Mentre           Victor S. Miller       Gerard Milmeister"
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 6b6b24c..1891268 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -781,8 +781,10 @@ bookvol10.3 add domains<br/>
 website update screenshots<br/>
 <a href="patches/20081204.02.tpd.patch">20081204.02.tpd.patch</a>
 clean up input regression files<br/>
-<a href="patches/20081204.02.tpd.patch">20081204.02.tpd.patch</a>
+<a href="patches/20081205.01.tpd.patch">20081205.01.tpd.patch</a>
 bug 7161: integer.spad remove signature change<br/>
+<a href="patches/20081205.02.tpd.patch">20081205.02.tpd.patch</a>
+schaum17 fix 14.355, 14.356<br/>
 
  </body>
 </html>
\ No newline at end of file
diff --git a/src/input/schaum17.input.pamphlet b/src/input/schaum17.input.pamphlet
index d9d7ac1..6c5e67c 100644
--- a/src/input/schaum17.input.pamphlet
+++ b/src/input/schaum17.input.pamphlet
@@ -688,13 +688,21 @@ $$
 )clear all
 
 --S 52 of 136
-aa:=integrate(x/(1-sin(ax)),x)
---R 
+aa:=integrate(x/(1-sin(a*x)),x)
 --R
---R                2
---R               x
---R   (1)  - ------------
---R          2sin(ax) - 2
+--R   (1)
+--R                                      sin(a x) - cos(a x) - 1
+--R       (2sin(a x) - 2cos(a x) - 2)log(-----------------------)
+--R                                            cos(a x) + 1
+--R     + 
+--R                                            2
+--R       (- sin(a x) + cos(a x) + 1)log(------------) - a x sin(a x)
+--R                                      cos(a x) + 1
+--R     + 
+--R       - a x cos(a x) - a x
+--R  /
+--R      2            2            2
+--R     a sin(a x) - a cos(a x) - a
 --R                                          Type: Union(Expression Integer,...)
 --E 
 
@@ -714,16 +722,26 @@ bb:=x/a*tan(%pi/4+(a*x)/2)+2/a^2*log(sin(%pi/4-(a*x)/2))
 cc:=aa-bb
 --R
 --R   (3)
---R                                 2a x - %pi
---R       (- 4sin(ax) + 4)log(- sin(----------))
---R                                      4
+--R                                      sin(a x) - cos(a x) - 1
+--R       (2sin(a x) - 2cos(a x) - 2)log(-----------------------)
+--R                                            cos(a x) + 1
 --R     + 
---R                                  2a x + %pi     2 2
---R       (- 2a x sin(ax) + 2a x)tan(----------) - a x
---R                                       4
+--R                                            2
+--R       (- sin(a x) + cos(a x) + 1)log(------------)
+--R                                      cos(a x) + 1
+--R     + 
+--R                                              2a x - %pi
+--R       (- 2sin(a x) + 2cos(a x) + 2)log(- sin(----------))
+--R                                                   4
+--R     + 
+--R                                                2a x + %pi
+--R       (- a x sin(a x) + a x cos(a x) + a x)tan(----------) - a x sin(a x)
+--R                                                     4
+--R     + 
+--R       - a x cos(a x) - a x
 --R  /
---R       2            2
---R     2a sin(ax) - 2a
+--R      2            2            2
+--R     a sin(a x) - a cos(a x) - a
 --R                                                     Type: Expression Integer
 --E
 @
@@ -737,12 +755,11 @@ $$
 )clear all
 
 --S 55 of 136
-aa:=integrate(1/(1+sin(ax)),x)
---R 
+aa:=integrate(1/(1+sin(a*x)),x)
 --R
---R             x
---R   (1)  -----------
---R        sin(ax) + 1
+--R              - 2cos(a x) - 2
+--R   (1)  ---------------------------
+--R        a sin(a x) + a cos(a x) + a
 --R                                          Type: Union(Expression Integer,...)
 --E 
 
@@ -760,11 +777,12 @@ bb:=-1/a*tan(%pi/4-(a*x)/2)
 --S 57 of 136
 cc:=aa-bb
 --R
---R                           2a x - %pi
---R        (- sin(ax) - 1)tan(----------) + a x
---R                                4
---R   (3)  ------------------------------------
---R                    a sin(ax) + a
+--R
+--R                                       2a x - %pi
+--R        (- sin(a x) - cos(a x) - 1)tan(----------) - 2cos(a x) - 2
+--R                                            4
+--R   (3)  ----------------------------------------------------------
+--R                        a sin(a x) + a cos(a x) + a
 --R                                                     Type: Expression Integer
 --E
 
@@ -780,9 +798,9 @@ tanrule:=rule(tan(a/b) == sin(a)/cos(b))
 --S 59 of 136     14:356 Axiom cannot simplify this expression
 dd:=tanrule cc
 --R
---R        (- sin(ax) - 1)sin(2a x - %pi) + a x cos(4)
---R   (5)  -------------------------------------------
---R                 a cos(4)sin(ax) + a cos(4)
+--R        (- sin(a x) - cos(a x) - 1)sin(2a x - %pi) - 2cos(4)cos(a x) - 2cos(4)
+--R   (5)  ----------------------------------------------------------------------
+--R                    a cos(4)sin(a x) + a cos(4)cos(a x) + a cos(4)
 --R                                                     Type: Expression Integer
 --E
 @
diff --git a/src/interp/setq.lisp.pamphlet b/src/interp/setq.lisp.pamphlet
index 4073795..f395d21 100644
--- a/src/interp/setq.lisp.pamphlet
+++ b/src/interp/setq.lisp.pamphlet
@@ -626,9 +626,10 @@
 "Alejandro Jakubi       Richard Jenks"
 "Kai Kaminski           Grant Keady            Tony Kennedy"
 "Paul Kosinski          Klaus Kusche           Bernhard Kutzler"
-"Larry Lambe            Franz Lehner           Frederic Lehobey"
-"Michel Levaud          Howard Levy            Liu Xiaojun"
-"Rudiger Loos           Michael Lucks          Richard Luczak"
+"Tim Lahey              Larry Lambe            Franz Lehner"
+"Frederic Lehobey       Michel Levaud          Howard Levy"
+"Liu Xiaojun            Rudiger Loos           Michael Lucks"
+"Richard Luczak"
 "Camm Maguire           Francois Maltey        Alasdair McAndrew"
 "Bob McElrath           Michael McGettrick     Ian Meikle"
 "David Mentre           Victor S. Miller       Gerard Milmeister"

\start
Date: Sat, 06 Dec 2008 15:04:15 -0500
From: William Sit
To: Alfredo Portes,Tim Daly
Subject: Re: 20081202.02.tpd.patch (website download.html add Doyen Thumbdrive)

Dear Tim and Alfredo:

This one is partly about Axiom. Run Axiom (DOYEN ubuntu), 
and click browse in hyperdoc, then enter Integer and click 
constructor; then click Users. The following fatal error 
message occurs:

                         AXIOM Computer Algebra System 
                          Version: Axiom (July 2008)
                Timestamp: Thursday July 24, 2008 at 
21:52:14 
-----------------------------------------------------------------------------
    Issue )copyright to view copyright notices.
    Issue )summary for a summary of useful system 
commands.
    Issue )quit to leave AXIOM and return to shell.
-----------------------------------------------------------------------------
  
    Re-reading compress.daase   Re-reading interp.daase
    Re-reading operation.daase
    Re-reading category.daase
    Re-reading browse.daase
(1) -> 
(1) ->    Loading 
/usr/local/axiom/mnt/ubuntu/autoload/bc-matrix.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/bc-misc.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/bc-solve.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/bc-util.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/ht-util.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/htsetvar.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/ht-root.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/br-con.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/br-data.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/showimp.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/br-op1.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/br-op2.
    Loading 
/usr/local/axiom/mnt/ubuntu/autoload/br-search.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/br-util.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/topics.
    Loading /usr/local/axiom/mnt/ubuntu/autoload/br-prof.
    Loading 
/usr/local/axiom/mnt/ubuntu/autoload/br-saturn.
  
    >> System error:
    Caught fatal error [memory may be damaged]

Hitting enter gives a prompt. Enter )hd and hyperdoc 
reloads. Repeat the above, and Axiom crashes (window goes 
away).

By the way, I tried the suggestion to use 
"changes=/path/file.dat" as bootparameter (I used 
"/dev/sda3/DOYEN-Axiom/files.dat" where the directory 
exist but not the file files.dat), and nothing works and I 
only encounter lots of problems (difficult to document, 
such as my computer slows to a crawl, even opening the 
text editor took many seconds, possibly half a minute, 
when it should be instantaneous almost.)  Nothing was 
saved (rather save-able?) and at shutdown time, the screen 
display was weird. One thing is consistent: the time was 
changed to GMT time after reboot to Windows (not the 
timezone, just the time was 5 hours ahead of New York). 
Windows also failed to recognize the USB I used for DOYEN 
(until I remove and test it on another computer, and it 
was fine). With the assistance of a wired connection, I 
was able to connect to a wireless router, but only after 
lots of steps and trials. Too bad this has to be repeated 
with each reboot, and without the wired internet 
connection, simply can't be done at all.

I also tried saving the changes to the USB drive (FAT 
formatted, and follow the "cleanup" instruction, except 
that it gives an error message when the command is run: 

doyen@doyen:~$ /mnt/live/cleanup
bash: /mnt/live/cleanup: /bin/ash: bad interpreter: No 
such file or directory
doyen@doyen:~$ ls -al /mnt/live
total 503
drwxr-xr-x  14 root root   1024 2008-12-06 09:19 .
drwxr-xr-x   8 root root    160 2008-12-06 09:19 ..
drwxr-xr-x   2 root root   2048 2008-12-06 09:19 bin
-rwxr-xr-x   1 root root   2182 2008-08-08 18:53 cleanup
drwxr-xr-x   2 root root  11264 2008-12-06 09:19 dev
drwxr-xr-x   2 root root   1024 2008-12-06 09:19 etc
drwxr-xr-x   3 root root   1024 2008-03-17 07:48 lib
-rw-r--r--   1 root root  25575 2008-08-08 18:53 
liblinuxlive
-rwxr-xr-x   1 root root   8562 2008-08-08 18:53 linuxrc
drwxrwxrwt   4 root root     80 2008-12-06 09:19 memory
drwxr-xr-x   3 root root   1024 2008-12-06 09:19 mnt
dr-xr-xr-x 167 root root      0 2008-12-06 09:19 proc
lrwxrwxrwx   1 root root      3 2008-08-08 18:53 sbin -> 
bin
drwxr-xr-x   2 root root   1024 2008-08-08 18:53 sys
drwxr-xr-x   2 root root   1024 2008-12-06 09:19 tmp
drwxr-xr-x   2 root root   1024 2008-12-06 09:19 union
drwxr-xr-x   2 root root   1024 2008-08-08 18:53 usr
-rw-------   1 root root 450560 2008-08-08 18:53 usr.lzm
drwxr-xr-x   3 root root   1024 2008-08-08 18:53 var
doyen@doyen:~$ 

\start
Date: Sun, 7 Dec 2008 07:04:24 -0600
From: Tim Daly
To: list
Subject: 20081206.01.tpd.patch (regression file fixed created)

This adds 267 new tests to the Axiom regression test suite.
======================================================================
diff --git a/changelog b/changelog
index beaca4a..02caa58 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,12 @@
+20081206 tpd src/axiom-website/patches.html 20081206.01.tpd.patch
+20081206 tpd src/input/Makefile add fixed.regress
+20081206 tpd src/input/fixed.input convert to a regression file
+20081206 tpd src/input/schaum17.input fix missing space typo
+20081205 tpd src/axiom-website/patches.html 20081205.02.tpd.patch
+20081205 txl src/input/schaum17.input fix 14.355, 14.356
+20081205 tpd src/interp/setq.lisp add Tim Lahey
+20081205 tpd readme add Tim Lahey
+20081205 txl Tim Lahey
 20081205 tpd src/axiom-website/patches.html 20081205.01.tpd.patch
 20081205 tpd src/algebra/integer.spad fix r21bugsbig regression
 20081205 tpd src/input/r20bugs.input.pamphlet fix regression
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 1891268..2428e91 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -785,6 +785,8 @@ clean up input regression files<br/>
 bug 7161: integer.spad remove signature change<br/>
 <a href="patches/20081205.02.tpd.patch">20081205.02.tpd.patch</a>
 schaum17 fix 14.355, 14.356<br/>
+<a href="patches/20081206.01.tpd.patch">20081206.01.tpd.patch</a>
+regression file fixed created<br/>
 
  </body>
 </html>
\ No newline at end of file
diff --git a/src/input/Makefile.pamphlet b/src/input/Makefile.pamphlet
index 032ce85..2cf453c 100644
--- a/src/input/Makefile.pamphlet
+++ b/src/input/Makefile.pamphlet
@@ -305,7 +305,8 @@ REGRES= algaggr.regress algbrbf.regress  algfacob.regress alist.regress  \
     expexpan.regress  explim.regress   expr1.regress    exprode.regress \
     expr.regress      exseries.regress exsum.regress    exprpoly.regress \
     farray.regress    ffdemo.regress   fferr.regress    ffx72.regress \
-    fib.regress       file.regress     float1.regress   float2.regress \
+    fib.regress       file.regress     fixed.regress \
+    float1.regress    float2.regress \
     float.regress     fname1.regress   fname.regress    fnla.regress \
     fns.regress       fparfrac.regress fparfrc.regress  fr1.regress \
     fr2.regress       frac.regress     fr.regress       free.regress \
@@ -315,7 +316,7 @@ REGRES= algaggr.regress algbrbf.regress  algfacob.regress alist.regress  \
     herm.regress      heugcd.regress \
     hexadec.regress   ico.regress      ideal.regress \
     ifact.regress     ifthenelse.regress \
-    infprod.regress  intaf.regress    intbypart.regress \
+    infprod.regress   intaf.regress    intbypart.regress \
     intdeq.regress \
     intef2.regress    intef.regress    intg0.regress    intheory.regress \
     intmix2.regress   intmix.regress   int.regress      intrf.regress \
diff --git a/src/input/fixed.input.pamphlet b/src/input/fixed.input.pamphlet
index c221351..4a5a5c3 100644
--- a/src/input/fixed.input.pamphlet
+++ b/src/input/fixed.input.pamphlet
@@ -10,413 +10,1181 @@
 \tableofcontents
 \eject
 \section{License}
-<<license>>=
---Copyright The Numerical Algorithms Group Limited 1996.
-@
+Copyright The Numerical Algorithms Group Limited 1996.
+
+daly/10/06/92
 <<*>>=
-<<license>>
---fixed.input
+)spool fixed.output
+)set message test on
+)set message auto off
+)set break resume
+)set expose add constructor SquareMatrix
 
--------------------------------------------------------------------
--- daly/10/06/92
--------------------------------------------------------------------
+@
+Something is wrong with the integration of serices, when the
+coeffiennts are not constants. while the series is mathematically
+correct, this is not what one expects as the taylor series, which
+does not exist. 
+<<*>>=
 )clear all
--- something is wrong with the integration of serices, when the
--- coeffiennts are not constants. while the series is mathematically
--- correct, this is not what one expects as the taylor series, which
--- does not exist. 
-series(x/(x+log(x)))
--- here integrate is treating log(x) as a constant, which is incorrect.
-integrate(%)
 
--------------------------------------------------------------------
--- bmt/10/19/92 integrate problem -- serious, wrong answer
--------------------------------------------------------------------
+--S 1
+t1:=series(x/(x+log(x)))
+--R
+--R   (1)
+--R        1          1     2      1     3      1     4      1     5      1     6
+--R     ------ x - ------- x  + ------- x  - ------- x  + ------- x  - ------- x
+--R     log(x)           2            3            4            5            6
+--R                log(x)       log(x)       log(x)       log(x)       log(x)
+--R   + 
+--R      1     7      1     8      1     9       1     10       1     11      12
+--R   ------- x  - ------- x  + ------- x  - -------- x   + -------- x   + O(x  )
+--R         7            8            9            10             11
+--R   log(x)       log(x)       log(x)       log(x)         log(x)
+--R                   Type: GeneralUnivariatePowerSeries(Expression Integer,x,0)
+--E
+
+@
+Here integrate is treating log(x) as a constant, which is incorrect.
+<<*>>=
+
+--S 2
+integrate(t1)
+--R 
+--R 
+--RDaly Bug
+--R   >> Error detected within library code:
+--R   "'integrate' unavailable on this domain;  use 'approximate' first"
+--R
+--R   Continuing to read the file...
+--R
+--E
+
+@
+bmt/10/19/92 integrate problem -- serious, wrong answer
+<<*>>=
 )clear all
-2*sin(t)*sqrt(1+cos(t))
---correct answer is 2*sin(t)/sqrt(1+cos(t))
-integrate(%,t)
 
--------------------------------------------------------------------
--- bmt/10/20/92 multiple complex in type tower
--------------------------------------------------------------------
+--S 3
+t1:=2*sin(t)*sqrt(1+cos(t))
+--R
+--R                +----------+
+--R   (1)  2sin(t)\|cos(t) + 1
+--R                                                     Type: Expression Integer
+--E
+
+@
+Correct answer is \[\frac{2\sin(t)}{\sqrt{1+\cos(t)}}\]
+<<*>>=
+
+--S 4
+integrate(t1,t)
+--R
+--R                        +----------+
+--R        (- 4cos(t) - 4)\|cos(t) + 1
+--R   (2)  ----------------------------
+--R                      3
+--R                                          Type: Union(Expression Integer,...)
+--E
+
+@
+bmt/10/20/92 multiple complex in type tower
+<<*>>=
 )clear all
+
+--S 5
 n:Complex ?
--- an invalid type. can't have 2 complex constructors in a tower
+--R                                                                   Type: Void
+--E
+
+@
+An invalid type. can't have 2 complex constructors in a tower
+<<*>>=
+
+--S 6
 n:=x/y+%i
+--R
+--R        x
+--R   (2)  - + %i
+--R        y
+--R                                    Type: Complex Fraction Polynomial Integer
+--E
+
+@
+grabm/09/28/92 coercion bug
 
--------------------------------------------------------------------------
--- grabm/09/28/92 coercion bug
--- comment: this coercion must carefully check whether there is a symbol
---          among the kernels which is equal to an indeterminate of the
---          polynomial ring, and not simply considering every expression
---          as a constant
--------------------------------------------------------------------------
+This coercion must carefully check whether there is a symbol
+among the kernels which is equal to an indeterminate of the
+polynomial ring, and not simply considering every expression
+as a constant
+<<*>>=
 )clear all
+
+--S 7
 f:=(a-b-c-d)**2::EXPR INT
-f::DMP(['a,'b],EXPR INT)
-degree %
-
--------------------------------------------------------------------
--- bmt/10/26/92 wrong answer
--- comment:I believe this problem simplifies to
--- lfintegrate(sqrt(u**3+u**2),u) which returns the
--- wrong answer due to some confusion in prootintegrate in INTPAF.
--- I think the confusion happens with the use of radPoly and rootPoly.
--- The answer is computed with respect to the result returned by rootPoly
--- but the kernel which is substituted for "y" corresponds to radPoly.
--------------------------------------------------------------------
-)clear all
--- should be 2*sin(t)/sqrt(1+cos(t))
+--R
+--R         2                      2                 2           2
+--R   (1)  d  + (2c + 2b - 2a)d + c  + (2b - 2a)c + b  - 2a b + a
+--R                                                     Type: Expression Integer
+--E
+
+--S 8
+t1:=f::DMP(['a,'b],EXPR INT)
+--R
+--R         2                          2                 2           2
+--R   (2)  a  - 2a b + (- 2d - 2c)a + b  + (2d + 2c)b + d  + 2c d + c
+--R            Type: DistributedMultivariatePolynomial([a,b],Expression Integer)
+--E
+
+--S 9
+degree t1
+--R
+--R   (3)  [2,0]
+--R                                    Type: DirectProduct(2,NonNegativeInteger)
+--E
+
+@
+bmt/10/26/92 wrong answer
+
+I believe this problem simplifies to
+{\tt lfintegrate(sqrt(u**3+u**2),u)} which returns the
+wrong answer due to some confusion in prootintegrate in {\tt INTPAF}.
+I think the confusion happens with the use of radPoly and rootPoly.
+The answer is computed with respect to the result returned by rootPoly
+but the kernel which is substituted for ``y'' corresponds to radPoly.
+
+The answer should be should be \[\frac{2*\sin(t)}{\sqrt{1+\cos(t)}}\]
+<<*>>=
+)clear all
+
+--S 10
 integrate(sqrt(1+cos(x)),x)
+--R
+--R                +----------+
+--R        2sin(x)\|cos(x) + 1
+--R   (1)  --------------------
+--R             cos(x) + 1
+--R                                          Type: Union(Expression Integer,...)
+--E
 
--------------------------------------------------------------------
--- bmt/09/28/92 bug in ITRIGMNP
--- gives:
---    Cannot convert kernel to gaussian function
--------------------------------------------------------------------
+@
+bmt/09/28/92 bug in ITRIGMNP
+
+gives: Cannot convert kernel to gaussian function
+<<*>>=
 )clear all
+
+--S 11
 integrate(exp(x**2),x)
+--R
+--R           x     2
+--I         ++    %K
+--I   (1)   |   %e   d%K
+--R        ++
+--R                                          Type: Union(Expression Integer,...)
+--E
 
--------------------------------------------------------------------
--- themos/11/06/92 integration bug
---comment:
---I suggest changing line 11 of limitedLogs in INTTR from:
---      rows := max(degree den, 1 + "max"/[degree(u.contrib) for u in l1])
---to:
---      rows := max(degree den,
---                  1 + reduce(max,[degree(u.contrib) for u in l1],0)$List(N))
---Does you agree, thus max/ empty list would return 0.
--------------------------------------------------------------------
+@
+themos/11/06/92 integration bug
+
+I suggest changing line 11 of limitedLogs in INTTR from:
+\begin{verbatim}
+  rows := max(degree den, 1 + "max"/[degree(u.contrib) for u in l1])
+\end{verbatim}
+to
+\begin{verbatim}
+  rows := max(degree den,
+           1 + reduce(max,[degree(u.contrib) for u in l1],0)$List(N))
+\end{verbatim}
+Do you agree, thus max/ empty list would return 0.
+<<*>>=
 )clear all
+
+--S 12
 f:=log(1-(b*x/(a+c*x**2)))/x
---               2
---            c x  - b x + a
---        log(--------------)
---                  2
---               c x  + a
---   (1)  -------------------
---                 x
-integrate(%,x)
---                   2
---                 %J c - %J b + a
---             log(---------------)
---           x          2
---         ++         %J c + a
---   (2)   |   -------------------- d%J
---        ++            %J
-expand f
---                 2               2
---        - log(c x  + a) + log(c x  - b x + a)
---   (3)  -------------------------------------
---                          x
-integrate(%,x)
---   >> Error detected within library code:
---   No identity element for reduce of empty list using operation
---   max
-
--------------------------------------------------------------------
--- bmt/11/17/92 interpreter resolve problem
--------------------------------------------------------------------
--- says cannot find an appropriate *
+--R
+--R               2
+--R            c x  - b x + a
+--R        log(--------------)
+--R                  2
+--R               c x  + a
+--R   (1)  -------------------
+--R                 x
+--R                                                     Type: Expression Integer
+--E
+
+--S 13
+integrate(f,x)
+--R
+--R                   2
+--I                 %K c - %K b + a
+--R             log(---------------)
+--R           x           2
+--I         ++          %K c + a
+--I   (2)   |   -------------------- d%K
+--I        ++            %K
+--R                                          Type: Union(Expression Integer,...)
+--E
+
+--S 14
+g:=expand f
+--R
+--R                 2               2
+--R        - log(c x  + a) + log(c x  - b x + a)
+--R   (3)  -------------------------------------
+--R                          x
+--R                                                     Type: Expression Integer
+--E
+
+--S 15
+integrate(g,x)
+--R
+--R           x         2               2
+--I         ++  - log(%K c + a) + log(%K c - %K b + a)
+--I   (4)   |   -------------------------------------- d%K
+--I        ++                     %K
+--R                                          Type: Union(Expression Integer,...)
+--E
+
+@
+bmt/11/17/92 interpreter resolve problem\\
+Says cannot find an appropriate *
+<<*>>=
 )clear all
+
+--S 16
 %i/m*sqrt(m) 
+--R
+--R           +-+
+--R        %i\|m
+--R   (1)  ------
+--R           m
+--R                                             Type: Expression Complex Integer
+--E
 
--------------------------------------------------------------------------
--- tpd/09/22/92 this generates extra brackets
--------------------------------------------------------------------------
+@
+tpd/09/22/92 this generates extra brackets
+<<*>>=
 )clear all
+
+--S 17
 foo n == matrix[[i for i in 1..n] for j in 1..n]
+--R                                                                   Type: Void
+--E
+
+--S 18
 foo
+--R
+--R   (2)  foo n == [[i for i in 1..n] for j in 1..n]
+--R                                                     Type: FunctionCalled foo
+--E
+
+)clear all
+
+msq := Matrix SquareMatrix(2,POLY INT)
 
--------------------------------------------------------------------------
---- tpd/09/24/92 matrix multiplication appears broken in the product.
--- fails with
---   >> System error:
---   The function |deleteAssoc| is undefined.
---   You are being returned to the top level of the interpreter.
--- comment: (barry)
--- This bug is due to the new autoloading scheme for the compiler, the
--- function deleteAssoc needs to be moved into the in core system.
--- As a work around, 
--- if you compile a non existent file, the apropriate files will be loaded,
--- e.g.:
--- )co foo
---  comment: this works in version 2
--------------------------------------------------------------------------
+@
+tpd/09/24/92 matrix multiplication appears broken in the product.\\
+fails with
+\begin{verbatim}
+   >> System error:
+   The function |deleteAssoc| is undefined.
+   You are being returned to the top level of the interpreter.
+\end{verbatim}
+comment: (barry)\\
+This bug is due to the new autoloading scheme for the compiler, the
+function deleteAssoc needs to be moved into the in core system.
+
+As a work around, 
+if you compile a non existent file, the apropriate files will be loaded,
+e.g.:
+\begin{verbatim}
+)co foo
+\end{verbatim}
+comment: this works in version 2
+<<*>>=
+)clear all
+
+--S 19
 msq := Matrix SquareMatrix(2,POLY INT)
+--R 
+--R
+--R   (1)  Matrix SquareMatrix(2,Polynomial Integer)
+--R                                                                 Type: Domain
+--E
+
+--S 20
 m : msq := zero(2,2)
+--R
+--R        ++0  0+  +0  0++
+--R        ||    |  |    ||
+--R        |+0  0+  +0  0+|
+--R   (2)  |              |
+--R        |+0  0+  +0  0+|
+--R        ||    |  |    ||
+--R        ++0  0+  +0  0++
+--R                              Type: Matrix SquareMatrix(2,Polynomial Integer)
+--E
+
+--S 21
 m(1,1) := matrix([[1,2],[a,b]])
+--R
+--R        +1  2+
+--R   (3)  |    |
+--R        +a  b+
+--R                                     Type: SquareMatrix(2,Polynomial Integer)
+--E
+
+--S 22
 m(1,2) := matrix([[a,b],[2,b]])
+--R
+--R        +a  b+
+--R   (4)  |    |
+--R        +2  b+
+--R                                     Type: SquareMatrix(2,Polynomial Integer)
+--E
+
+--S 23
 m(2,2) := matrix([[1,2],[2,b]])
+--R
+--R        +1  2+
+--R   (5)  |    |
+--R        +2  b+
+--R                                     Type: SquareMatrix(2,Polynomial Integer)
+--E
+
+--S 24
 m
+--R
+--R        ++1  2+  +a  b++
+--R        ||    |  |    ||
+--R        |+a  b+  +2  b+|
+--R   (6)  |              |
+--R        |+0  0+  +1  2+|
+--R        ||    |  |    ||
+--R        ++0  0+  +2  b++
+--R                              Type: Matrix SquareMatrix(2,Polynomial Integer)
+--E
+
+--S 25
 m*m
+--R
+--R        +                    +              2           ++
+--R        |+2a + 1   2b + 2 +  |2b + 2a + 4  b  + 3b + 2a ||
+--R        ||                |  |                          ||
+--R        ||          2     |  |      2        2          ||
+--R   (7)  |+a b + a  b  + 2a+  +4b + a  + 2  2b  + a b + 4+|
+--R        |                                                |
+--R        |      +0  0+              +  5     2b + 2+      |
+--R        |      |    |              |              |      |
+--R        |      +0  0+              |         2    |      |
+--R        +                          +2b + 2  b  + 4+      +
+--R                              Type: Matrix SquareMatrix(2,Polynomial Integer)
+--E
+
+--S 26
 m**2
+--R
+--R        +                    +              2           ++
+--R        |+2a + 1   2b + 2 +  |2b + 2a + 4  b  + 3b + 2a ||
+--R        ||                |  |                          ||
+--R        ||          2     |  |      2        2          ||
+--R   (8)  |+a b + a  b  + 2a+  +4b + a  + 2  2b  + a b + 4+|
+--R        |                                                |
+--R        |      +0  0+              +  5     2b + 2+      |
+--R        |      |    |              |              |      |
+--R        |      +0  0+              |         2    |      |
+--R        +                          +2b + 2  b  + 4+      +
+--R                              Type: Matrix SquareMatrix(2,Polynomial Integer)
+--E
+
+--S 27
 m**3
+--R
+--R        +matrix1  matrix2+
+--R   (9)  |                |
+--R        +matrix3  matrix4+
+--R
+--R
+--R
+--R                  +                        2              +
+--R                  |   2a b + 4a + 1      2b  + 2b + 4a + 2|
+--R   where matrix1= |                                       |
+--R                  |   2           2        3              |
+--R                  +a b  + a b + 2a  + a   b  + 4a b + 2a  +
+--R
+--R   and matrix2 =
+--R     +        2           2                    3     2                        +
+--R     |      2b  + 12b + 2a  + 7a + 8          b  + 5b  + (4a + 7)b + 4a + 8   |
+--R     |                                                                        |
+--R     |  2     2                2              3       2                  2    |
+--R     +6b  + (a  + 2a + 4)b + 2a  + 4a + 10  3b  + 2a b  + (3a + 12)b + 2a  + 4+
+--R
+--R                +0  0+
+--R   and matrix3= |    |
+--R                +0  0+
+--R
+--R                +                 2          +
+--R                |   4b + 9      2b  + 2b + 10|
+--R   and matrix4= |                            |
+--R                |  2              3          |
+--R                +2b  + 2b + 10   b  + 8b + 4 +
+--R                              Type: Matrix SquareMatrix(2,Polynomial Integer)
+--E
+
+--S 28
 (m*m)*m
+--R
+--R         +matrix1  matrix2+
+--R   (10)  |                |
+--R         +matrix3  matrix4+
+--R
+--R
+--R
+--R                  +                        2              +
+--R                  |   2a b + 4a + 1      2b  + 2b + 4a + 2|
+--R   where matrix1= |                                       |
+--R                  |   2           2        3              |
+--R                  +a b  + a b + 2a  + a   b  + 4a b + 2a  +
+--R
+--R   and matrix2 =
+--R     +        2           2                    3     2                        +
+--R     |      2b  + 12b + 2a  + 7a + 8          b  + 5b  + (4a + 7)b + 4a + 8   |
+--R     |                                                                        |
+--R     |  2     2                2              3       2                  2    |
+--R     +6b  + (a  + 2a + 4)b + 2a  + 4a + 10  3b  + 2a b  + (3a + 12)b + 2a  + 4+
+--R
+--R                +0  0+
+--R   and matrix3= |    |
+--R                +0  0+
+--R
+--R                +                 2          +
+--R                |   4b + 9      2b  + 2b + 10|
+--R   and matrix4= |                            |
+--R                |  2              3          |
+--R                +2b  + 2b + 10   b  + 8b + 4 +
+--R                              Type: Matrix SquareMatrix(2,Polynomial Integer)
+--E
+
+--S 29
 mm:=m*m
+--R
+--R         +                    +              2           ++
+--R         |+2a + 1   2b + 2 +  |2b + 2a + 4  b  + 3b + 2a ||
+--R         ||                |  |                          ||
+--R         ||          2     |  |      2        2          ||
+--R   (11)  |+a b + a  b  + 2a+  +4b + a  + 2  2b  + a b + 4+|
+--R         |                                                |
+--R         |      +0  0+              +  5     2b + 2+      |
+--R         |      |    |              |              |      |
+--R         |      +0  0+              |         2    |      |
+--R         +                          +2b + 2  b  + 4+      +
+--R                              Type: Matrix SquareMatrix(2,Polynomial Integer)
+--E
+
+--S 30
 mm*m
+--R
+--R         +matrix1  matrix2+
+--R   (12)  |                |
+--R         +matrix3  matrix4+
+--R
+--R
+--R
+--R                  +                        2              +
+--R                  |   2a b + 4a + 1      2b  + 2b + 4a + 2|
+--R   where matrix1= |                                       |
+--R                  |   2           2        3              |
+--R                  +a b  + a b + 2a  + a   b  + 4a b + 2a  +
+--R
+--R   and matrix2 =
+--R     +        2           2                    3     2                        +
+--R     |      2b  + 12b + 2a  + 7a + 8          b  + 5b  + (4a + 7)b + 4a + 8   |
+--R     |                                                                        |
+--R     |  2     2                2              3       2                  2    |
+--R     +6b  + (a  + 2a + 4)b + 2a  + 4a + 10  3b  + 2a b  + (3a + 12)b + 2a  + 4+
+--R
+--R                +0  0+
+--R   and matrix3= |    |
+--R                +0  0+
+--R
+--R                +                 2          +
+--R                |   4b + 9      2b  + 2b + 10|
+--R   and matrix4= |                            |
+--R                |  2              3          |
+--R                +2b  + 2b + 10   b  + 8b + 4 +
+--R                              Type: Matrix SquareMatrix(2,Polynomial Integer)
+--E
 
--------------------------------------------------------------------------
--- tpd/09/25/92 new equation.spad from johannes grabmeier
--------------------------------------------------------------------------
-
-
---Furthermore, we have function to put 0 or 1 on one side
---and factor the left hand side, after the right hand side
---is 0 and we have an IntegralDomain.
---Johannes
+@
+tpd/09/25/92 new equation.spad from johannes grabmeier
 
+Furthermore, we have function to put 0 or 1 on one side
+and factor the left hand side, after the right hand side
+is 0 and we have an IntegralDomain.\\
+Johannes
+<<*>>=
+)clear all
+--S 31
 eq1 := (-6*x**3+13*x**2+4)=(-x**4+12*x)
---
---
---            3      2         4
---   (1)  - 6x  + 13x  + 4= - x  + 12x
---                                            Type: Equation Polynomial Integer
---                                       Time: 1.61 (IN) + 1.47 (OT) = 3.08 sec
+--R
+--R            3      2         4
+--R   (1)  - 6x  + 13x  + 4= - x  + 12x
+--R                                            Type: Equation Polynomial Integer
+--E
+
+--S 32
 eq2 := x**4+13*x**2-12*x = 6*x**3-4
---
---
---         4      2          3
---   (2)  x  + 13x  - 12x= 6x  - 4
---                                            Type: Equation Polynomial Integer
---                                       Time: 0.16 (IN) + 0.11 (OT) = 0.27 sec
+--R
+--R         4      2          3
+--R   (2)  x  + 13x  - 12x= 6x  - 4
+--R                                            Type: Equation Polynomial Integer
+--E
+
+--S 33
 eq := eq1*y**2+eq2
---
---
---             3      2      2    4      2            4        2     3
---   (3)  (- 6x  + 13x  + 4)y  + x  + 13x  - 12x= (- x  + 12x)y  + 6x  - 4
---                                            Type: Equation Polynomial Integer
---               Time: 0.26 (IN) + 0.01 (EV) + 0.01 (OT) + 1.54 (GC) = 1.82 sec
-swap %
---
---
---            4        2     3           3      2      2    4      2
---   (4)  (- x  + 12x)y  + 6x  - 4= (- 6x  + 13x  + 4)y  + x  + 13x  - 12x
---                                            Type: Equation Polynomial Integer
---                                                   Time: 0.07 (OT) = 0.07 sec
-% + 4
---
---
---            4        2     3       3      2      2    4      2
---   (5)  (- x  + 12x)y  + 6x = (- 6x  + 13x  + 4)y  + x  + 13x  - 12x + 4
---                                            Type: Equation Polynomial Integer
---                                       Time: 0.69 (IN) + 0.01 (OT) = 0.70 sec
-%-6*x**3
---
---
---            4        2       3      2      2    4     3      2
---   (6)  (- x  + 12x)y = (- 6x  + 13x  + 4)y  + x  - 6x  + 13x  - 12x + 4
---                                            Type: Equation Polynomial Integer
---                                       Time: 0.19 (IN) + 0.01 (OT) = 0.20 sec
-leftZero %
---
---
---             4     3      2            2    4     3      2
---   (7)  0= (x  - 6x  + 13x  - 12x + 4)y  + x  - 6x  + 13x  - 12x + 4
---                                            Type: Equation Polynomial Integer
---                                       Time: 0.01 (IN) + 0.05 (OT) = 0.06 sec
-swap %
---
---
---          4     3      2            2    4     3      2
---   (8)  (x  - 6x  + 13x  - 12x + 4)y  + x  - 6x  + 13x  - 12x + 4= 0
---                                            Type: Equation Polynomial Integer
---                                                   Time: 0.01 (IN) = 0.01 sec
-factor lhs %
---
---
---               2       2  2
---   (9)  (x - 2) (x - 1) (y  + 1)
---                                            Type: Factored Polynomial Integer
---                           Time: 0.50 (IN) + 0.09 (EV) + 0.30 (OT) = 0.89 sec
-factorAndSplit eq
---
---
---                             2
---   (10)  [x - 2= 0,x - 1= 0,y  + 1= 0]
---                                       Type: List Equation Polynomial Integer
---                                       Time: 0.09 (EV) + 0.21 (OT) = 0.30 sec
-inv (eq :: EQ FRAC POLY INT)
---
---
---                            1                                1
---   (11)  - ------------------------------------= - ----------------------
---              3      2      2    4      2            4        2     3
---           (6x  - 13x  - 4)y  - x  - 13x  + 12x    (x  - 12x)y  - 6x  + 4
---                                   Type: Equation Fraction Polynomial Integer
---                                                   Time: 0.03 (IN) = 0.03 sec
-- %
---
---
---                          1                              1
---   (12)  ------------------------------------= ----------------------
---            3      2      2    4      2          4        2     3
---         (6x  - 13x  - 4)y  - x  - 13x  + 12x  (x  - 12x)y  - 6x  + 4
---                                   Type: Equation Fraction Polynomial Integer
---                                       Time: 0.01 (IN) + 0.01 (OT) = 0.02 sec
-
-
--------------------------------------------------------------------
--- bmt/09/29/92 coercion bug
--- fails with:
--- failed cannot be coerced to mode 
--- (Record (: coef1 (Integer)) (: coef2 (Integer)))
--- fixed on 09/29/92
--------------------------------------------------------------------
-)clear all
-(p,q):UP(x,INT)
-p:=3*x**4+11*x**2-4
-q:=9*x**4+9*x**2-4
+--R
+--R             3      2      2    4      2            4        2     3
+--R   (3)  (- 6x  + 13x  + 4)y  + x  + 13x  - 12x= (- x  + 12x)y  + 6x  - 4
+--R                                            Type: Equation Polynomial Integer
+--E
+
+--S 34
+t1:=swap eq
+--R
+--R            4        2     3           3      2      2    4      2
+--R   (4)  (- x  + 12x)y  + 6x  - 4= (- 6x  + 13x  + 4)y  + x  + 13x  - 12x
+--R                                            Type: Equation Polynomial Integer
+--E
+
+--S 35
+t2:=t1 + 4
+--R
+--R            4        2     3       3      2      2    4      2
+--R   (5)  (- x  + 12x)y  + 6x = (- 6x  + 13x  + 4)y  + x  + 13x  - 12x + 4
+--R                                            Type: Equation Polynomial Integer
+--E
+
+--S 36
+t3:=t2-6*x**3
+--R
+--R            4        2       3      2      2    4     3      2
+--R   (6)  (- x  + 12x)y = (- 6x  + 13x  + 4)y  + x  - 6x  + 13x  - 12x + 4
+--R                                            Type: Equation Polynomial Integer
+--E
+
+--S 37
+t4:=leftZero t3
+--R
+--R             4     3      2            2    4     3      2
+--R   (7)  0= (x  - 6x  + 13x  - 12x + 4)y  + x  - 6x  + 13x  - 12x + 4
+--R                                            Type: Equation Polynomial Integer
+--E
+
+--S 38
+t5:=swap t4
+--R
+--R          4     3      2            2    4     3      2
+--R   (8)  (x  - 6x  + 13x  - 12x + 4)y  + x  - 6x  + 13x  - 12x + 4= 0
+--R                                            Type: Equation Polynomial Integer
+--E
+
+--S 39
+t6:=factor lhs t5
+--R
+--R               2       2  2
+--R   (9)  (x - 2) (x - 1) (y  + 1)
+--R                                            Type: Factored Polynomial Integer
+--E
+
+--S 40
+t7:=factorAndSplit eq
+--R
+--R                             2
+--R   (10)  [x - 2= 0,x - 1= 0,y  + 1= 0]
+--R                                       Type: List Equation Polynomial Integer
+--E
+
+--S 41
+t8:=inv (eq :: EQ FRAC POLY INT)
+--R
+--R                             1                                1
+--R   (11)  - ------------------------------------= - ----------------------
+--R              3      2      2    4      2            4        2     3
+--R           (6x  - 13x  - 4)y  - x  - 13x  + 12x    (x  - 12x)y  - 6x  + 4
+--R                                   Type: Equation Fraction Polynomial Integer
+--E
+
+--S 42
+- t8
+--R
+--R                           1                              1
+--R   (12)  ------------------------------------= ----------------------
+--R            3      2      2    4      2          4        2     3
+--R         (6x  - 13x  - 4)y  - x  - 13x  + 12x  (x  - 12x)y  - 6x  + 4
+--R                                   Type: Equation Fraction Polynomial Integer
+--E
+
+@
+bmt/09/29/92 coercion bug\\
+fails with:
+\begin{verbatim}
+ failed cannot be coerced to mode 
+ (Record (: coef1 (Integer)) (: coef2 (Integer)))
+\end{verbatim}
+fixed on 09/29/92
+
+Another subtle bug exists as of Nov 2008 release.
+The expression
+\begin{verbatim}
+  (p,q):UP(x,INT)
+\end{verbatim}
+generates the error
+\begin{verbatim} 
+Daly Bug
+   Category, domain or package constructor : is not available.
+\end{verbatim}
+works fine at the top of this file but not here. Which means that
+some property is not being cleared properly. The symbol ``p'' does get
+properly declared despite the error message. --Tim
+<<*>>=
+)clear all
+
+--S 43
+(p1,p2):UP(x,INT)
+--R                                                                   Type: Void
+--E
+
+--S 44
+p1:=3*x**4+11*x**2-4
+--R
+--R          4      2
+--R   (2)  3x  + 11x  - 4
+--R                                        Type: UnivariatePolynomial(x,Integer)
+--E
+
+--S 45
+p2:=9*x**4+9*x**2-4
+--R
+--R          4     2
+--R   (3)  9x  + 9x  - 4
+--R                                        Type: UnivariatePolynomial(x,Integer)
+--E
+
+--S 46
 myNextPrime: (INT,NNI) -> INT
+--R                                                                   Type: Void
+--E
+
+--S 47
 myNextPrime(x,n)==nextPrime(x)$PRIMES(INT)
---  runs forever due to algebra bug in handling leading coefficients
-modularGcd([p,q])$InnerModularGcd(INT,UP(x,INT),67108859,myNextPrime)
+--R                                                                   Type: Void
+--E
 
--------------------------------------------------------------------
--- dewar/10/02/92
--- actually, this was never wrong
--------------------------------------------------------------------
+@
+Runs forever due to algebra bug in handling leading coefficients
+<<*>>=
+--S 48
+modularGcd([p1,p2])$InnerModularGcd(INT,UP(x,INT),67108859,myNextPrime)
+--R   Compiling function myNextPrime with type (Integer,NonNegativeInteger
+--R      ) -> Integer 
+--R
+--R          2
+--R   (6)  3x  - 1
+--R                                        Type: UnivariatePolynomial(x,Integer)
+--E
+
+@
+dewar/10/02/92 actually, this was never wrong
+<<*>>=
+)clear all
+
+--S 49
 numeric(%e ** %pi)
---gives
-   (61)
---  23.1406926327 7926900563 5493084578 4861294789 0532254433 2912200665 
--- 6744971913 2534837468 7163222983 2730035
+--R
+--R   (1)  23.1406926327 79269006
+--R                                                                  Type: Float
+--E
 
--------------------------------------------------------------------
--- themos/10/07/92
--------------------------------------------------------------------
+@
+themos/10/07/92
+<<*>>=
 )clear all
+
+--S 50
 y:=operator 'y
+--R
+--R   (1)  y
+--R                                                          Type: BasicOperator
+--E
+
+--S 51
 deqx:=differentiate(y(x),x,2)+differentiate(y(x),x)+y(x)
+--R
+--R         ,,       ,
+--R   (2)  y  (x) + y (x) + y(x)
+--R
+--R                                                     Type: Expression Integer
+--E
+
+--S 52
 solve(deqx,y,x)
+--R
+--R                                             x     x
+--R                                     +-+   - -   - -      +-+
+--R                                   x\|3      2     2    x\|3
+--R   (3)  [particular= 0,basis= [cos(-----)%e   ,%e   sin(-----)]]
+--R                                     2                    2
+--RType: Union(Record(particular: Expression Integer,basis: List Expression Integer),...)
+--E
+
+--S 53
 solve(deqx,y,x=0,[1])
+--R
+--R                      x
+--R              +-+   - -
+--R            x\|3      2
+--R   (4)  cos(-----)%e
+--R              2
+--R                                          Type: Union(Expression Integer,...)
+--E
+
+--S 54
 deqt:=differentiate(y(t),t,2)+differentiate(y(t),t)+y(t)
+--R
+--R         ,,       ,
+--R   (5)  y  (t) + y (t) + y(t)
+--R
+--R                                                     Type: Expression Integer
+--E
+
+--S 55
 solve(deqt,y,t)
+--R
+--R                                             t     t
+--R                                     +-+   - -   - -      +-+
+--R                                   t\|3      2     2    t\|3
+--R   (6)  [particular= 0,basis= [cos(-----)%e   ,%e   sin(-----)]]
+--R                                     2                    2
+--RType: Union(Record(particular: Expression Integer,basis: List Expression Integer),...)
+--E
+
+--S 56
 solve(deqt,y,t=0,[1]) -- bug
+--R
+--R                      t
+--R              +-+   - -
+--R            t\|3      2
+--R   (7)  cos(-----)%e
+--R              2
+--R                                          Type: Union(Expression Integer,...)
+--E
+
+--S 57
 deqz:=differentiate(y(z),z,2)+differentiate(y(z),z)+y(z)
+--R
+--R         ,,       ,
+--R   (8)  y  (z) + y (z) + y(z)
+--R
+--R                                                     Type: Expression Integer
+--E
+
+--S 58
 solve(deqz,y,z)
+--R
+--R                                             z     z
+--R                                     +-+   - -   - -      +-+
+--R                                   z\|3      2     2    z\|3
+--R   (9)  [particular= 0,basis= [cos(-----)%e   ,%e   sin(-----)]]
+--R                                     2                    2
+--RType: Union(Record(particular: Expression Integer,basis: List Expression Integer),...)
+--E
+
+--S 59
 solve(deqz,y,z=0,[1]) --bug
+--R
+--R                       z
+--R               +-+   - -
+--R             z\|3      2
+--R   (10)  cos(-----)%e
+--R               2
+--R                                          Type: Union(Expression Integer,...)
+--E
 
--------------------------------------------------------------------
--- themos/10/07/92 equation
--------------------------------------------------------------------
+@
+themos/10/07/92 equation
+<<*>>=
 )clear all
+
+--S 60
 y:=operator 'y
-deq:=D(y(x),x)+x**2=(y x)/x-(y x)**2
+--R
+--R   (1)  y
+--R                                                          Type: BasicOperator
+--E
 
+--S 61
+deq:=D(y(x),x)+x**2=(y x)/x-(y x)**2
+--R
+--R                            2
+--R         ,       2  - x y(x)  + y(x)
+--R   (2)  y (x) + x = ----------------
+--R                            x
+--R                                            Type: Equation Expression Integer
+--E
 
--------------------------------------------------------------------
--- bmt/10/08/92 laplace
--------------------------------------------------------------------
+@
+bmt/10/08/92 laplace
+<<*>>=
 )clear all
+
+--S 62
 laplace(exp(-x**3)*x**7,x,s) 
+--R
+--R                       3
+--R                 7  - x
+--R   (1)  laplace(x %e    ,x,s)
+--R                                                     Type: Expression Integer
+--E
+
+@
+bmt/09/30/92 nonlinear ODE 
 
--------------------------------------------------------------------
--- bmt/09/30/92 nonlinear ODE 
--------------------------------------------------------------------
--- Any hope of solving the following which appeared in Barry
--- Simon's computer algebra test suite:
--- (Apparently it has Bernoulli form)
+Any hope of solving the following which appeared in Barry
+Simon's computer algebra test suite:
+(Apparently it has Bernoulli form)
+<<*>>=
+)clear all
+
+--S 63
 y:=operator 'y
+--R
+--R   (1)  y
+--R                                                          Type: BasicOperator
+--E
+
+--S 64
 x**2 * D(y x, x) + 2*x*(y x) - (y x)**3 = 0
+--R
+--R         2 ,          3
+--R   (2)  x y (x) - y(x)  + 2x y(x)= 0
+--R
+--R                                            Type: Equation Expression Integer
+--E
+
+--S 65
 solve(%,y,x)
+--R
+--R             5         2
+--R        (- 3x  - 2)y(x)  + 5x
+--R   (3)  ---------------------
+--R                 5    2
+--R               5x y(x)
+--R                                          Type: Union(Expression Integer,...)
+--E
 
+@
+sit/10/08/92 factor bug
+<<*>>=
+)clear all
 
--------------------------------------------------------------------
--- sit/10/08/92 factor bug
--------------------------------------------------------------------
+--S 66
 p:POLY FRAC INT := 3*(x+1)
--- is wrong (missing factor of 3).
+--R
+--R   (1)  3x + 3
+--R                                            Type: Polynomial Fraction Integer
+--E
+
+@
+Is wrong (missing factor of 3).
+<<*>>=
+
+--S 67
 factor(p)**2 
+--R
+--R                2
+--R   (2)  9(x + 1)
+--R                                   Type: Factored Polynomial Fraction Integer
+--E
+
+@
+henderson/10/08/92 
+
+TextFile cliams that the operator readLineIfCan! returns ``failed'' when
+the end of the file is reached.  In fact, I get a system error, which is
+not very useful:
+\begin{verbatim}
+(16) ->readLineIfCan!(fp)
+   >> System error:
+   Unexpected end of #<input stream "/home/mcd/work/work">.
+   You are being returned to the top level of the interpreter.
+\end{verbatim}
+
+<<*>>=
+)clear all
 
--------------------------------------------------------------------
--- henderson/10/08/92 
--------------------------------------------------------------------
-)clear all
---TextFile cliams that the operator readLineIfCan! returns "failed" when
---the end of the file is reached.  In fact, I get a system error, which is
---not very useful:
---(16) ->readLineIfCan!(fp)
---   >> System error:
---   Unexpected end of #<input stream "/home/mcd/work/work">.
---   You are being returned to the top level of the interpreter.
+--S 68
 fout:TextFile:=open("/tmp/foo","output")
+--R
+--R   (1)  "/tmp/foo"
+--R                                                               Type: TextFile
+--E
+
+--S 69
 write!(fout,"foo")
+--R
+--R   (2)  "foo"
+--R                                                                 Type: String
+--E
+
+--S 70
 close!(fout)
+--R
+--R   (3)  "/tmp/foo"
+--R                                                               Type: TextFile
+--E
+
+--S 71
 fin:TextFile:=open("/tmp/foo","input")
+--R
+--R   (4)  "/tmp/foo"
+--R                                                               Type: TextFile
+--E
+
+--S 72
 readLineIfCan!(fin)
+--R
+--R   (5)  "foo"
+--R                                                      Type: Union(String,...)
+--E
+
+--S 73
 readLineIfCan!(fin)
+--R
+--R   (6)  "failed"
+--R                                                    Type: Union("failed",...)
+--E
+
+--S 74
 close!(fin)
+--R
+--R   (7)  "/tmp/foo"
+--R                                                               Type: TextFile
+--E
+
+--S 75
 )lis (system "rm /tmp/foo")
+--R 
+--RValue = 0
+--E
 
--------------------------------------------------------------------
--- bmt/10/08/92 factoring over SAEs
--------------------------------------------------------------------
+@
+bmt/10/08/92 factoring over SAEs
+<<*>>=
 )clear all
+
+--S 76
 a | a**2+1
-(x+a)*(x+a+1)
-factor %
+--R   Your statement has resulted in the following assignments and 
+--R      declaration:
+--R
+--R   SAEa := SimpleAlgebraicExtension(Fraction Integer,UnivariatePolynomial(a,Fraction Integer),a*a+1)
+--R   a : SAEa := a
+--R
+--R   (1)  a
+--RType: SimpleAlgebraicExtension(Fraction Integer,UnivariatePolynomial(a,Fraction Integer),a*a+1)
+--E
+
+--S 77
+t1:=(x+a)*(x+a+1)
+--R
+--R         2
+--R   (2)  x  + (2a + 1)x + a - 1
+--RType: Polynomial SimpleAlgebraicExtension(Fraction Integer,UnivariatePolynomial(a,Fraction Integer),a*a+1)
+--E
+
+--S 78
+factor t1
+--R
+--R   (3)  (x + a + 1)(x + a)
+--RType: Factored Polynomial SimpleAlgebraicExtension(Fraction Integer,UnivariatePolynomial(a,Fraction Integer),a*a+1)
+--E
 
--------------------------------------------------------------------
--- miller/10/09/92 local vars in types
--------------------------------------------------------------------
-)clear all
---Fixed (Victor's) bug with using local variables in type expressions
---assigned to local variables.  It now gives a message and correctly uses
---interpret-only mode.
---The function changed was getAndEvalConstructorArgument from i-spec1.boot.
+@
+miller/10/09/92 local vars in types
+
+Fixed (Victor's) bug with using local variables in type expressions
+assigned to local variables.  It now gives a message and correctly uses
+interpret-only mode.
+The function changed was getAndEvalConstructorArgument from i-spec1.boot.
+
+themos/10/19/92
 
--------------------------------------------------------------------
--- themos/10/19/92
--------------------------------------------------------------------
+Do this in a virgin system
+<<*>>=
 )clear all
--- Do this in a virgin system
+
 )set expose add constructor SquareMatrix
+
+--S 79
 S2:= SquareMatrix(2,FRAC POLY INT);
-V2: S2 := matrix([[v,-v],[-v,v]]);
-I2: S2 := 1;
-m:=5;
+--R
+--R                                                                 Type: Domain
+--E
+
+--S 80
+V2: S2 := matrix([[v,-v],[-v,v]])
+--R
+--R        + v   - v+
+--R   (2)  |        |
+--R        +- v   v +
+--R                            Type: SquareMatrix(2,Fraction Polynomial Integer)
+--E
+
+--S 81
+I2: S2 := 1
+--R
+--R        +1  0+
+--R   (3)  |    |
+--R        +0  1+
+--R                            Type: SquareMatrix(2,Fraction Polynomial Integer)
+--E
+
+--S 82
+m:=5
+--R
+--R   (4)  5
+--R                                                        Type: PositiveInteger
+--E
+
+--S 83
 l: List(S2) := append(cons(V2+h*I2,_
             [(V2+2*h*I2) for i in 2 .. (m-1)]),_
              [V2+h*I2])
+--R 
+--R
+--R   (5)
+--R    +v + h   - v +  +v + 2h   - v  +  +v + 2h   - v  +  +v + 2h   - v  +
+--R   [|            |, |              |, |              |, |              |,
+--R    + - v   v + h+  + - v    v + 2h+  + - v    v + 2h+  + - v    v + 2h+
+--R    +v + h   - v +
+--R    |            |]
+--R    + - v   v + h+
+--R                       Type: List SquareMatrix(2,Fraction Polynomial Integer)
+--E
+
+@
+Does this give an error of deleteAssoc not defined ??
+<<*>>=
+--S 84
 A: SquareMatrix(m, S2) := diagonalMatrix(l)
--- did you get an error of deleteAssoc not defined ??
+--R
+--R        +matrix1  matrix2  matrix2  matrix2  matrix2+
+--R        |                                           |
+--R        |matrix2  matrix3  matrix2  matrix2  matrix2|
+--R        |                                           |
+--R   (6)  |matrix2  matrix2  matrix3  matrix2  matrix2|
+--R        |                                           |
+--R        |matrix2  matrix2  matrix2  matrix3  matrix2|
+--R        |                                           |
+--R        +matrix2  matrix2  matrix2  matrix2  matrix1+
+--R
+--R
+--R
+--R                  +v + h   - v +
+--R   where matrix1= |            |
+--R                  + - v   v + h+
+--R
+--R                +0  0+
+--R   and matrix2= |    |
+--R                +0  0+
+--R
+--R                +v + 2h   - v  +
+--R   and matrix3= |              |
+--R                + - v    v + 2h+
+--R            Type: SquareMatrix(5,SquareMatrix(2,Fraction Polynomial Integer))
+--E
 
--- load definition of deleteAssoc
+@
+load definition of deleteAssoc
+\begin{verbatim}
 )li (load "/spad/obj/rios/interp/c-util")
 
 A: SquareMatrix(m, S2) := diagonalMatrix(l)
---now , can print.
+\end{verbatim}
+now , can print.
+
+bmt/10/19/92 squareFree bug
+
+Has an extra factor of 2.
+<<*>>=
+)clear all
 
--------------------------------------------------------------------
--- bmt/10/19/92 squareFree bug
--------------------------------------------------------------------
--- has an extra factor of 2.
+--S 85
 squareFree((2*x*y+1)*(x*y+1)**2)
+--R
+--R                 2
+--R   (1)  (x y + 1) (2x y + 1)
+--R                                            Type: Factored Polynomial Integer
+--E
+
+@
+bmt/10/19/92 division by zero error
+<<*>>=
+)clear all
 
--------------------------------------------------------------------
--- bmt/10/19/92 division by zero error
--------------------------------------------------------------------
+--S 86
 limit(atan(1/sin(x)),x=0)
+--R
+--R                          %pi                 %pi
+--R   (1)  [leftHandLimit= - ---,rightHandLimit= ---]
+--R                           2                   2
+--RType: Union(Record(leftHandLimit: Union(OrderedCompletion Expression Integer,"failed"),rightHandLimit: Union(OrderedCompletion Expression Integer,"failed")),...)
+--E
+
+@
+bmt/10/19/92 limit problem
 
--------------------------------------------------------------------
--- bmt/10/19/92 limit problem
--------------------------------------------------------------------
+The left and right hand limits don't agree
+<<*>>=
 )clear all
--- the left and right hand limits don't agree
+
+--S 87
 limit(atan(-sin(x)/(cos(x)+e)),x=acos(-e))
--- the left and right hand limits don't agree
+--R
+--R                          %pi                 %pi
+--R   (1)  [leftHandLimit= - ---,rightHandLimit= ---]
+--R                           2                   2
+--RType: Union(Record(leftHandLimit: Union(OrderedCompletion Expression Integer,"failed"),rightHandLimit: Union(OrderedCompletion Expression Integer,"failed")),...)
+--E
+
+--S 88
 limit(atan(1/(cos(x)+e)),x=acos(-e))
+--R
+--R                        %pi                   %pi
+--R   (2)  [leftHandLimit= ---,rightHandLimit= - ---]
+--R                         2                     2
+--RType: Union(Record(leftHandLimit: Union(OrderedCompletion Expression Integer,"failed"),rightHandLimit: Union(OrderedCompletion Expression Integer,"failed")),...)
+--E
 
--------------------------------------------------------------------
--- grabmeier/10/19/92 unable to compute the determinant of an 8x8
--------------------------------------------------------------------
+@
+grabmeier/10/19/92 unable to compute the determinant of an 8x8
+<<*>>=
 )clear all
-D := MATRIX FRAC(POLY INT)
 
+--S 89
+D := MATRIX FRAC(POLY INT)
+--R
+--R   (1)  Matrix Fraction Polynomial Integer
+--R                                                                 Type: Domain
+--E
 
+--S 90
 d : (INT, Boolean) -> POLY INT
+--R                                                                   Type: Void
+--E
+
+--S 91
 d(i,ss)  ==
   ex := i rem 4
   if ex < 0 then ex := ex+4
@@ -429,13 +1197,34 @@ d(i,ss)  ==
   ex = 1 => 'd
   ex = 2 => 'dd
   'ddd
-
-
+--R 
+--R                                                                   Type: Void
+--E
 
 -- 1,d,dd,ddd,s,sd,sdd,sddd
 
+--S 92
 mTV4 : D := new(8,8,0)
-
+--R
+--R        +0  0  0  0  0  0  0  0+
+--R        |                      |
+--R        |0  0  0  0  0  0  0  0|
+--R        |                      |
+--R        |0  0  0  0  0  0  0  0|
+--R        |                      |
+--R        |0  0  0  0  0  0  0  0|
+--R   (4)  |                      |
+--R        |0  0  0  0  0  0  0  0|
+--R        |                      |
+--R        |0  0  0  0  0  0  0  0|
+--R        |                      |
+--R        |0  0  0  0  0  0  0  0|
+--R        |                      |
+--R        +0  0  0  0  0  0  0  0+
+--R                                     Type: Matrix Fraction Polynomial Integer
+--E
+
+--S 93
 for i in 1..8 repeat
   for j in 1..8 repeat
     mTV4(i,j) :=
@@ -444,52 +1233,1022 @@ for i in 1..8 repeat
         d(-i+j,true)
       j <= 4 => d(i+j-2,true)
       d(-i+j,false)
+--R 
+--R   Compiling function d with type (Integer,Boolean) -> Polynomial 
+--R      Integer 
+--R                                                                   Type: Void
+--E
+
+--S 94
 mTV4
+--R
+--R        + 1     d     dd   ddd    s     sd   sdd   sddd+
+--R        |                                              |
+--R        | d     dd   ddd    1    sddd   s     sd   sdd |
+--R        |                                              |
+--R        | dd   ddd    1     d    sdd   sddd   s     sd |
+--R        |                                              |
+--R        |ddd    1     d     dd    sd   sdd   sddd   s  |
+--R   (6)  |                                              |
+--R        | s     sd   sdd   sddd   1     d     dd   ddd |
+--R        |                                              |
+--R        | sd   sdd   sddd   s    ddd    1     d     dd |
+--R        |                                              |
+--R        |sdd   sddd   s     sd    dd   ddd    1     d  |
+--R        |                                              |
+--R        +sddd   s     sd   sdd    d     dd   ddd    1  +
+--R                                     Type: Matrix Fraction Polynomial Integer
+--E
+
+--S 95
 gdd4 := determinant mTV4
+--R
+--R   (7)
+--R           8                2       2      2     2         6
+--R     - sddd  + (8s sdd + 4sd  + 4ddd  + 4dd  + 4d  + 4)sddd
+--R   + 
+--R                  2
+--R         - 8sd sdd  + ((- 8dd - 8)ddd - 8d dd - 8d)sdd
+--R       + 
+--R              2
+--R         (- 8s  - 16d ddd - 16dd)sd + ((- 8dd - 8)ddd - 8d dd - 8d)s
+--R    *
+--R           5
+--R       sddd
+--R   + 
+--R             4         2       2                2            2        2
+--R         2sdd  + (- 20s  + 4ddd  + 16d ddd + 4dd  + 16dd + 4d  + 4)sdd
+--R       + 
+--R                    2
+--R             - 8s sd  + ((24dd + 24)ddd + 24d dd + 24d)sd
+--R           + 
+--R                     2                 2             2
+--R             (- 16ddd  + 16d ddd - 16dd  + 16dd - 16d  - 16)s
+--R        *
+--R           sdd
+--R       + 
+--R              4          2      2     2       2
+--R         - 6sd  + (- 4ddd  - 4dd  - 4d  - 4)sd
+--R       + 
+--R                                                 4
+--R         ((24dd + 24)ddd + 24d dd + 24d)s sd + 2s
+--R       + 
+--R              2                2            2      2       4
+--R         (4ddd  + 16d ddd + 4dd  + 16dd + 4d  + 4)s  - 6ddd
+--R       + 
+--R               2           2        2         2                        4
+--R         (- 8dd  + 8dd - 4d  - 8)ddd  + (8d dd  + 32d dd + 8d)ddd - 6dd
+--R       + 
+--R              2       2     2       4     2
+--R         (- 8d  - 4)dd  + 8d dd - 6d  - 8d  - 6
+--R    *
+--R           4
+--R       sddd
+--R   + 
+--R                                                      3
+--R         (32s sd + (- 16dd - 16)ddd - 16d dd - 16d)sdd
+--R       + 
+--R              3                                                              2
+--R         (16sd  + (- 32d ddd - 32dd)sd + ((16dd + 16)ddd + 16d dd + 16d)s)sdd
+--R       + 
+--R                                                2
+--R             ((- 16dd - 16)ddd - 16d dd - 16d)sd
+--R           + 
+--R                 3           2       2      2
+--R             (32s  + (- 32ddd  - 32dd  - 32d  - 32)s)sd
+--R           + 
+--R                                             2                 3
+--R             ((16dd + 16)ddd + 16d dd + 16d)s  + (16dd + 16)ddd
+--R           + 
+--R                                2
+--R             (- 16d dd - 16d)ddd
+--R           + 
+--R                  3       2         2              2                  3
+--R             (16dd  - 16dd  + (- 16d  - 16)dd - 16d  + 16)ddd + 16d dd
+--R           + 
+--R                     2       3               3
+--R             - 16d dd  + (16d  - 16d)dd + 16d  + 16d
+--R        *
+--R           sdd
+--R       + 
+--R             2                    3                                        2
+--R         (16s  + 32d ddd + 32dd)sd  + ((- 16dd - 16)ddd - 16d dd - 16d)s sd
+--R       + 
+--R                                2          3          2         2
+--R             (- 32d ddd - 32dd)s  + 32d ddd  + (- 16dd  - 16)ddd
+--R           + 
+--R                            3           3      2  2             2
+--R             (- 64d dd + 32d )ddd + 32dd  - 16d dd  + 32dd - 16d
+--R        *
+--R           sd
+--R       + 
+--R                                           3
+--R         ((- 16dd - 16)ddd - 16d dd - 16d)s
+--R       + 
+--R                           3                      2
+--R             (16dd + 16)ddd  + (- 16d dd - 16d)ddd
+--R           + 
+--R                  3       2         2              2                  3
+--R             (16dd  - 16dd  + (- 16d  - 16)dd - 16d  + 16)ddd + 16d dd
+--R           + 
+--R                     2       3               3
+--R             - 16d dd  + (16d  - 16d)dd + 16d  + 16d
+--R        *
+--R           s
+--R    *
+--R           3
+--R       sddd
+--R   + 
+--R                 5          2       2                2            2        4
+--R         - 8s sdd  + (- 20sd  + 4ddd  + 16d ddd + 4dd  + 16dd + 4d  + 4)sdd
+--R       + 
+--R                                                 3                          3
+--R         (((16dd + 16)ddd + 16d dd + 16d)sd + 16s  + (- 32d ddd - 32dd)s)sdd
+--R       + 
+--R                   2        2                 2             2        2
+--R             (- 56s  + 24ddd  - 32d ddd + 24dd  - 32dd + 24d  + 24)sd
+--R           + 
+--R             ((- 16dd - 16)ddd - 16d dd - 16d)s sd
+--R           + 
+--R                   2                 2             2       2       4          3
+--R             (24ddd  - 32d ddd + 24dd  - 32dd + 24d  + 24)s  - 8ddd  - 16d ddd
+--R           + 
+--R                   2      2        2                3          4       3
+--R             (- 8dd  + 16d  - 8)ddd  + (96d dd - 16d )ddd - 8dd  - 16dd
+--R           + 
+--R                  2        2            4     2
+--R             (- 8d  + 16)dd  - 16dd - 8d  - 8d  - 8
+--R        *
+--R              2
+--R           sdd
+--R       + 
+--R                    4                                      3
+--R             - 8s sd  + ((- 16dd - 16)ddd - 16d dd - 16d)sd
+--R           + 
+--R                   2                 2             2          2
+--R             (32ddd  + 96d ddd + 32dd  + 96dd + 32d  + 32)s sd
+--R           + 
+--R                                                   2                   3
+--R                 ((- 16dd - 16)ddd - 16d dd - 16d)s  + (- 16dd - 16)ddd
+--R               + 
+--R                                  2
+--R                 (16d dd + 16d)ddd
+--R               + 
+--R                        3       2       2              2                  3
+--R                 (- 16dd  + 16dd  + (16d  + 16)dd + 16d  - 16)ddd - 16d dd
+--R               + 
+--R                       2         3               3
+--R                 16d dd  + (- 16d  + 16d)dd - 16d  - 16d
+--R            *
+--R               sd
+--R           + 
+--R                 5                      3
+--R             - 8s  + (- 32d ddd - 32dd)s
+--R           + 
+--R                     4                2    2            2                4
+--R                 8ddd  + (- 32dd + 48d )ddd  + (- 32d dd  - 32d)ddd + 8dd
+--R               + 
+--R                     2      2       4
+--R                 48dd  - 32d dd + 8d  + 8
+--R            *
+--R               s
+--R        *
+--R           sdd
+--R       + 
+--R            6          2      2     2       4
+--R         4sd  + (- 4ddd  - 4dd  - 4d  - 4)sd
+--R       + 
+--R                                              3
+--R         ((- 16dd - 16)ddd - 16d dd - 16d)s sd
+--R       + 
+--R                  4         2                 2             2       2       4
+--R             - 20s  + (24ddd  - 32d ddd + 24dd  - 32dd + 24d  + 24)s  - 4ddd
+--R           + 
+--R                  2             2         2          2                         4
+--R             (16dd  + 48dd - 88d  + 16)ddd  + (48d dd  - 64d dd + 48d)ddd - 4dd
+--R           + 
+--R                 2        2      2       4      2
+--R             (16d  - 88)dd  + 48d dd - 4d  + 16d  - 4
+--R        *
+--R             2
+--R           sd
+--R       + 
+--R                                             3
+--R             ((16dd + 16)ddd + 16d dd + 16d)s
+--R           + 
+--R                                 3                    2
+--R                 (- 16dd - 16)ddd  + (16d dd + 16d)ddd
+--R               + 
+--R                        3       2       2              2                  3
+--R                 (- 16dd  + 16dd  + (16d  + 16)dd + 16d  - 16)ddd - 16d dd
+--R               + 
+--R                       2         3               3
+--R                 16d dd  + (- 16d  + 16d)dd - 16d  - 16d
+--R            *
+--R               s
+--R        *
+--R           sd
+--R       + 
+--R              2                2            2      4
+--R         (4ddd  + 16d ddd + 4dd  + 16dd + 4d  + 4)s
+--R       + 
+--R                   4          3         2      2        2                3
+--R             - 8ddd  - 16d ddd  + (- 8dd  + 16d  - 8)ddd  + (96d dd - 16d )ddd
+--R           + 
+--R                  4       3        2        2            4     2
+--R             - 8dd  - 16dd  + (- 8d  + 16)dd  - 16dd - 8d  - 8d  - 8
+--R        *
+--R            2
+--R           s
+--R       + 
+--R             6       2            2        4             3
+--R         4ddd  + (4dd  - 16dd - 4d  + 4)ddd  - 32d dd ddd
+--R       + 
+--R             4       2        2      2       4      2        2
+--R         (4dd  + (24d  + 24)dd  + 32d dd - 4d  + 24d  + 4)ddd
+--R       + 
+--R                  4         3         2         3                         6
+--R         (- 16d dd  - 32d dd  + 32d dd  + (- 32d  - 32d)dd - 16d)ddd + 4dd
+--R       + 
+--R            2       4      4      2       2      4       6     4     2
+--R         (4d  - 4)dd  + (4d  + 24d  - 4)dd  - 16d dd + 4d  + 4d  + 4d  + 4
+--R    *
+--R           2
+--R       sddd
+--R   + 
+--R                6                                   5
+--R         8sd sdd  + ((- 8dd - 8)ddd - 8d dd - 8d)sdd
+--R       + 
+--R                  2        2                 2             2
+--R             (- 8s  - 16ddd  + 16d ddd - 16dd  + 16dd - 16d  - 16)sd
+--R           + 
+--R             ((24dd + 24)ddd + 24d dd + 24d)s
+--R        *
+--R              4
+--R           sdd
+--R       + 
+--R                   3                                    2
+--R             32s sd  + ((16dd + 16)ddd + 16d dd + 16d)sd
+--R           + 
+--R                     2       2      2
+--R             (- 32ddd  - 32dd  - 32d  - 32)s sd
+--R           + 
+--R                                               2                 3
+--R             ((- 16dd - 16)ddd - 16d dd - 16d)s  + (16dd + 16)ddd
+--R           + 
+--R                                2
+--R             (- 16d dd - 16d)ddd
+--R           + 
+--R                  3       2         2              2                  3
+--R             (16dd  - 16dd  + (- 16d  - 16)dd - 16d  + 16)ddd + 16d dd
+--R           + 
+--R                     2       3               3
+--R             - 16d dd  + (16d  - 16d)dd + 16d  + 16d
+--R        *
+--R              3
+--R           sdd
+--R       + 
+--R                  5                       3
+--R             - 8sd  + (- 32d ddd - 32dd)sd
+--R           + 
+--R                                                  2
+--R             ((- 16dd - 16)ddd - 16d dd - 16d)s sd
+--R           + 
+--R                     4         2                 2             2       2       4
+--R                 - 8s  + (32ddd  + 96d ddd + 32dd  + 96dd + 32d  + 32)s  + 8ddd
+--R               + 
+--R                              2    2            2                4       2
+--R                 (- 32dd + 48d )ddd  + (- 32d dd  - 32d)ddd + 8dd  + 48dd
+--R               + 
+--R                      2       4
+--R                 - 32d dd + 8d  + 8
+--R            *
+--R               sd
+--R           + 
+--R                                               3
+--R             ((- 16dd - 16)ddd - 16d dd - 16d)s
+--R           + 
+--R                                 3                    2
+--R                 (- 16dd - 16)ddd  + (16d dd + 16d)ddd
+--R               + 
+--R                        3       2       2              2                  3
+--R                 (- 16dd  + 16dd  + (16d  + 16)dd + 16d  - 16)ddd - 16d dd
+--R               + 
+--R                       2         3               3
+--R                 16d dd  + (- 16d  + 16d)dd - 16d  - 16d
+--R            *
+--R               s
+--R        *
+--R              2
+--R           sdd
+--R       + 
+--R                                              4
+--R             ((24dd + 24)ddd + 24d dd + 24d)sd
+--R           + 
+--R                 3           2       2      2          3
+--R             (32s  + (- 32ddd  - 32dd  - 32d  - 32)s)sd
+--R           + 
+--R                                                   2                   3
+--R                 ((- 16dd - 16)ddd - 16d dd - 16d)s  + (- 16dd - 16)ddd
+--R               + 
+--R                                  2
+--R                 (16d dd + 16d)ddd
+--R               + 
+--R                        3       2       2              2                  3
+--R                 (- 16dd  + 16dd  + (16d  + 16)dd + 16d  - 16)ddd - 16d dd
+--R               + 
+--R                       2         3               3
+--R                 16d dd  + (- 16d  + 16d)dd - 16d  - 16d
+--R            *
+--R                 2
+--R               sd
+--R           + 
+--R                         2       2      2       3
+--R                 (- 32ddd  - 32dd  - 32d  - 32)s
+--R               + 
+--R                          4          3        2      2         2
+--R                     32ddd  - 64d ddd  + (96dd  - 64d  + 96)ddd
+--R                   + 
+--R                                     3           4       3       2        2
+--R                     (- 128d dd - 64d )ddd + 32dd  - 64dd  + (96d  - 64)dd
+--R                   + 
+--R                                 4      2
+--R                     - 64dd + 32d  + 96d  + 32
+--R                *
+--R                   s
+--R            *
+--R               sd
+--R           + 
+--R                                             4
+--R             ((24dd + 24)ddd + 24d dd + 24d)s
+--R           + 
+--R                                 3                    2
+--R                 (- 16dd - 16)ddd  + (16d dd + 16d)ddd
+--R               + 
+--R                        3       2       2              2                  3
+--R                 (- 16dd  + 16dd  + (16d  + 16)dd + 16d  - 16)ddd - 16d dd
+--R               + 
+--R                       2         3               3
+--R                 16d dd  + (- 16d  + 16d)dd - 16d  - 16d
+--R            *
+--R                2
+--R               s
+--R           + 
+--R                           5                    4
+--R             (- 8dd - 8)ddd  + (24d dd + 24d)ddd
+--R           + 
+--R                    3       2         2              2         3
+--R             (- 16dd  + 16dd  + (- 16d  + 16)dd - 16d  - 16)ddd
+--R           + 
+--R                    3         2         3               3          2
+--R             (16d dd  - 16d dd  + (- 16d  - 16d)dd - 16d  + 16d)ddd
+--R           + 
+--R                      5       4       2        3         2        2
+--R                 - 8dd  + 24dd  + (16d  - 16)dd  + (- 16d  - 16)dd
+--R               + 
+--R                     4      2              4      2
+--R                 (24d  - 16d  + 24)dd + 24d  + 16d  - 8
+--R            *
+--R               ddd
+--R           + 
+--R                    5         4         3         3       3         2
+--R             - 8d dd  + 24d dd  + (- 16d  - 16d)dd  + (16d  - 16d)dd
+--R           + 
+--R                  5      3              5      3
+--R             (- 8d  + 16d  + 24d)dd - 8d  - 16d  - 8d
+--R        *
+--R           sdd
+--R       + 
+--R              2                    5                                      4
+--R         (- 8s  - 16d ddd - 16dd)sd  + ((24dd + 24)ddd + 24d dd + 24d)s sd
+--R       + 
+--R                                2          3          2         2
+--R             (- 32d ddd - 32dd)s  + 32d ddd  + (- 16dd  - 16)ddd
+--R           + 
+--R                            3           3      2  2             2
+--R             (- 64d dd + 32d )ddd + 32dd  - 16d dd  + 32dd - 16d
+--R        *
+--R             3
+--R           sd
+--R       + 
+--R                                             3
+--R             ((16dd + 16)ddd + 16d dd + 16d)s
+--R           + 
+--R                                 3                    2
+--R                 (- 16dd - 16)ddd  + (16d dd + 16d)ddd
+--R               + 
+--R                        3       2       2              2                  3
+--R                 (- 16dd  + 16dd  + (16d  + 16)dd + 16d  - 16)ddd - 16d dd
+--R               + 
+--R                       2         3               3
+--R                 16d dd  + (- 16d  + 16d)dd - 16d  - 16d
+--R            *
+--R               s
+--R        *
+--R             2
+--R           sd
+--R       + 
+--R               6           2                 2             2       4
+--R             8s  + (- 16ddd  + 16d ddd - 16dd  + 16dd - 16d  - 16)s
+--R           + 
+--R                     4                2    2            2                4
+--R                 8ddd  + (- 32dd + 48d )ddd  + (- 32d dd  - 32d)ddd + 8dd
+--R               + 
+--R                     2      2       4
+--R                 48dd  - 32d dd + 8d  + 8
+--R            *
+--R                2
+--R               s
+--R           + 
+--R                      5        2                4            2      3          3
+--R             - 16d ddd  + (16dd  + 16dd + 16)ddd  + (- 32d dd  + 32d  - 32d)ddd
+--R           + 
+--R                  4       3         2        2       2              2         2
+--R             (16dd  - 32dd  + (- 32d  - 32)dd  + (96d  - 32)dd - 32d  + 16)ddd
+--R           + 
+--R                    4         3         2      5      3                 5
+--R             (16d dd  + (- 32d  + 96d)dd  - 16d  - 32d  + 16d)ddd - 16dd
+--R           + 
+--R                2  4         2        3       4      2   2
+--R             16d dd  + (- 32d  + 32)dd  + (16d  - 32d )dd
+--R           + 
+--R                 4      2              4      2
+--R             (16d  - 32d  - 16)dd + 16d  + 16d
+--R        *
+--R           sd
+--R       + 
+--R                                       5
+--R         ((- 8dd - 8)ddd - 8d dd - 8d)s
+--R       + 
+--R                           3                      2
+--R             (16dd + 16)ddd  + (- 16d dd - 16d)ddd
+--R           + 
+--R                  3       2         2              2                  3
+--R             (16dd  - 16dd  + (- 16d  - 16)dd - 16d  + 16)ddd + 16d dd
+--R           + 
+--R                     2       3               3
+--R             - 16d dd  + (16d  - 16d)dd + 16d  + 16d
+--R        *
+--R            3
+--R           s
+--R       + 
+--R                           5                    4
+--R             (- 8dd - 8)ddd  + (24d dd + 24d)ddd
+--R           + 
+--R                    3       2         2              2         3
+--R             (- 16dd  + 16dd  + (- 16d  + 16)dd - 16d  - 16)ddd
+--R           + 
+--R                    3         2         3               3          2
+--R             (16d dd  - 16d dd  + (- 16d  - 16d)dd - 16d  + 16d)ddd
+--R           + 
+--R                      5       4       2        3         2        2
+--R                 - 8dd  + 24dd  + (16d  - 16)dd  + (- 16d  - 16)dd
+--R               + 
+--R                     4      2              4      2
+--R                 (24d  - 16d  + 24)dd + 24d  + 16d  - 8
+--R            *
+--R               ddd
+--R           + 
+--R                    5         4         3         3       3         2
+--R             - 8d dd  + 24d dd  + (- 16d  - 16d)dd  + (16d  - 16d)dd
+--R           + 
+--R                  5      3              5      3
+--R             (- 8d  + 16d  + 24d)dd - 8d  - 16d  - 8d
+--R        *
+--R           s
+--R    *
+--R       sddd
+--R   + 
+--R          8      2       2      2     2        6
+--R     - sdd  + (4s  + 4ddd  + 4dd  + 4d  + 4)sdd
+--R   + 
+--R             2                                                            5
+--R     (- 8s sd  + ((- 8dd - 8)ddd - 8d dd - 8d)sd + (- 16d ddd - 16dd)s)sdd
+--R   + 
+--R            4        2                2            2       2
+--R         2sd  + (4ddd  + 16d ddd + 4dd  + 16dd + 4d  + 4)sd
+--R       + 
+--R                                                 4
+--R         ((24dd + 24)ddd + 24d dd + 24d)s sd - 6s
+--R       + 
+--R                2      2     2      2       4         2           2        2
+--R         (- 4ddd  - 4dd  - 4d  - 4)s  - 6ddd  + (- 8dd  + 8dd - 4d  - 8)ddd
+--R       + 
+--R             2                        4        2       2     2       4     2
+--R       (8d dd  + 32d dd + 8d)ddd - 6dd  + (- 8d  - 4)dd  + 8d dd - 6d  - 8d  - 6
+--R    *
+--R          4
+--R       sdd
+--R   + 
+--R                                            3       3                         2
+--R         ((- 16dd - 16)ddd - 16d dd - 16d)sd  + (16s  + (- 32d ddd - 32dd)s)sd
+--R       + 
+--R                                               2                 3
+--R             ((- 16dd - 16)ddd - 16d dd - 16d)s  + (16dd + 16)ddd
+--R           + 
+--R                                2
+--R             (- 16d dd - 16d)ddd
+--R           + 
+--R                  3       2         2              2                  3
+--R             (16dd  - 16dd  + (- 16d  - 16)dd - 16d  + 16)ddd + 16d dd
+--R           + 
+--R                     2       3               3
+--R             - 16d dd  + (16d  - 16d)dd + 16d  + 16d
+--R        *
+--R           sd
+--R       + 
+--R                          3
+--R         (32d ddd + 32dd)s
+--R       + 
+--R                    3          2         2                  3           3
+--R             32d ddd  + (- 16dd  - 16)ddd  + (- 64d dd + 32d )ddd + 32dd
+--R           + 
+--R                  2  2             2
+--R             - 16d dd  + 32dd - 16d
+--R        *
+--R           s
+--R    *
+--R          3
+--R       sdd
+--R   + 
+--R               2       2                2            2       4
+--R         (- 20s  + 4ddd  + 16d ddd + 4dd  + 16dd + 4d  + 4)sd
+--R       + 
+--R                                            3
+--R         ((16dd + 16)ddd + 16d dd + 16d)s sd
+--R       + 
+--R                   2                 2             2       2       4          3
+--R             (24ddd  - 32d ddd + 24dd  - 32dd + 24d  + 24)s  - 8ddd  - 16d ddd
+--R           + 
+--R                   2      2        2                3          4       3
+--R             (- 8dd  + 16d  - 8)ddd  + (96d dd - 16d )ddd - 8dd  - 16dd
+--R           + 
+--R                  2        2            4     2
+--R             (- 8d  + 16)dd  - 16dd - 8d  - 8d  - 8
+--R        *
+--R             2
+--R           sd
+--R       + 
+--R                                               3
+--R             ((- 16dd - 16)ddd - 16d dd - 16d)s
+--R           + 
+--R                                 3                    2
+--R                 (- 16dd - 16)ddd  + (16d dd + 16d)ddd
+--R               + 
+--R                        3       2       2              2                  3
+--R                 (- 16dd  + 16dd  + (16d  + 16)dd + 16d  - 16)ddd - 16d dd
+--R               + 
+--R                       2         3               3
+--R                 16d dd  + (- 16d  + 16d)dd - 16d  - 16d
+--R            *
+--R               s
+--R        *
+--R           sd
+--R       + 
+--R           6          2      2     2      4
+--R         4s  + (- 4ddd  - 4dd  - 4d  - 4)s
+--R       + 
+--R                   4        2             2         2
+--R             - 4ddd  + (16dd  + 48dd - 88d  + 16)ddd
+--R           + 
+--R                    2                         4       2        2      2       4
+--R             (48d dd  - 64d dd + 48d)ddd - 4dd  + (16d  - 88)dd  + 48d dd - 4d
+--R           + 
+--R                2
+--R             16d  - 4
+--R        *
+--R            2
+--R           s
+--R       + 
+--R             6       2            2        4             3
+--R         4ddd  + (4dd  - 16dd - 4d  + 4)ddd  - 32d dd ddd
+--R       + 
+--R             4       2        2      2       4      2        2
+--R         (4dd  + (24d  + 24)dd  + 32d dd - 4d  + 24d  + 4)ddd
+--R       + 
+--R                  4         3         2         3                         6
+--R         (- 16d dd  - 32d dd  + 32d dd  + (- 32d  - 32d)dd - 16d)ddd + 4dd
+--R       + 
+--R            2       4      4      2       2      4       6     4     2
+--R         (4d  - 4)dd  + (4d  + 24d  - 4)dd  - 16d dd + 4d  + 4d  + 4d  + 4
+--R    *
+--R          2
+--R       sdd
+--R   + 
+--R              6                                  5
+--R         8s sd  + ((- 8dd - 8)ddd - 8d dd - 8d)sd
+--R       + 
+--R                 2                 2             2          4
+--R         (- 16ddd  + 16d ddd - 16dd  + 16dd - 16d  - 16)s sd
+--R       + 
+--R                                             2                 3
+--R             ((16dd + 16)ddd + 16d dd + 16d)s  + (16dd + 16)ddd
+--R           + 
+--R                                2
+--R             (- 16d dd - 16d)ddd
+--R           + 
+--R                  3       2         2              2                  3
+--R             (16dd  - 16dd  + (- 16d  - 16)dd - 16d  + 16)ddd + 16d dd
+--R           + 
+--R                     2       3               3
+--R             - 16d dd  + (16d  - 16d)dd + 16d  + 16d
+--R        *
+--R             3
+--R           sd
+--R       + 
+--R                 5                      3
+--R             - 8s  + (- 32d ddd - 32dd)s
+--R           + 
+--R                     4                2    2            2                4
+--R                 8ddd  + (- 32dd + 48d )ddd  + (- 32d dd  - 32d)ddd + 8dd
+--R               + 
+--R                     2      2       4
+--R                 48dd  - 32d dd + 8d  + 8
+--R            *
+--R               s
+--R        *
+--R             2
+--R           sd
+--R       + 
+--R                                             4
+--R             ((24dd + 24)ddd + 24d dd + 24d)s
+--R           + 
+--R                                 3                    2
+--R                 (- 16dd - 16)ddd  + (16d dd + 16d)ddd
+--R               + 
+--R                        3       2       2              2                  3
+--R                 (- 16dd  + 16dd  + (16d  + 16)dd + 16d  - 16)ddd - 16d dd
+--R               + 
+--R                       2         3               3
+--R                 16d dd  + (- 16d  + 16d)dd - 16d  - 16d
+--R            *
+--R                2
+--R               s
+--R           + 
+--R                           5                    4
+--R             (- 8dd - 8)ddd  + (24d dd + 24d)ddd
+--R           + 
+--R                    3       2         2              2         3
+--R             (- 16dd  + 16dd  + (- 16d  + 16)dd - 16d  - 16)ddd
+--R           + 
+--R                    3         2         3               3          2
+--R             (16d dd  - 16d dd  + (- 16d  - 16d)dd - 16d  + 16d)ddd
+--R           + 
+--R                      5       4       2        3         2        2
+--R                 - 8dd  + 24dd  + (16d  - 16)dd  + (- 16d  - 16)dd
+--R               + 
+--R                     4      2              4      2
+--R                 (24d  - 16d  + 24)dd + 24d  + 16d  - 8
+--R            *
+--R               ddd
+--R           + 
+--R                    5         4         3         3       3         2
+--R             - 8d dd  + 24d dd  + (- 16d  - 16d)dd  + (16d  - 16d)dd
+--R           + 
+--R                  5      3              5      3
+--R             (- 8d  + 16d  + 24d)dd - 8d  - 16d  - 8d
+--R        *
+--R           sd
+--R       + 
+--R                            5
+--R         (- 16d ddd - 16dd)s
+--R       + 
+--R                    3          2         2                  3           3
+--R             32d ddd  + (- 16dd  - 16)ddd  + (- 64d dd + 32d )ddd + 32dd
+--R           + 
+--R                  2  2             2
+--R             - 16d dd  + 32dd - 16d
+--R        *
+--R            3
+--R           s
+--R       + 
+--R                      5        2                4            2      3          3
+--R             - 16d ddd  + (16dd  + 16dd + 16)ddd  + (- 32d dd  + 32d  - 32d)ddd
+--R           + 
+--R                  4       3         2        2       2              2         2
+--R             (16dd  - 32dd  + (- 32d  - 32)dd  + (96d  - 32)dd - 32d  + 16)ddd
+--R           + 
+--R                    4         3         2      5      3                 5
+--R             (16d dd  + (- 32d  + 96d)dd  - 16d  - 32d  + 16d)ddd - 16dd
+--R           + 
+--R                2  4         2        3       4      2   2
+--R             16d dd  + (- 32d  + 32)dd  + (16d  - 32d )dd
+--R           + 
+--R                 4      2              4      2
+--R             (16d  - 32d  - 16)dd + 16d  + 16d
+--R        *
+--R           s
+--R    *
+--R       sdd
+--R   + 
+--R         8        2      2     2       6                                    5
+--R     - sd  + (4ddd  + 4dd  + 4d  + 4)sd  + ((- 8dd - 8)ddd - 8d dd - 8d)s sd
+--R   + 
+--R           4        2                2            2      2       4
+--R         2s  + (4ddd  + 16d ddd + 4dd  + 16dd + 4d  + 4)s  - 6ddd
+--R       + 
+--R               2           2        2         2                        4
+--R         (- 8dd  + 8dd - 4d  - 8)ddd  + (8d dd  + 32d dd + 8d)ddd - 6dd
+--R       + 
+--R              2       2     2       4     2
+--R         (- 8d  - 4)dd  + 8d dd - 6d  - 8d  - 6
+--R    *
+--R         4
+--R       sd
+--R   + 
+--R                                           3
+--R         ((- 16dd - 16)ddd - 16d dd - 16d)s
+--R       + 
+--R                           3                      2
+--R             (16dd + 16)ddd  + (- 16d dd - 16d)ddd
+--R           + 
+--R                  3       2         2              2                  3
+--R             (16dd  - 16dd  + (- 16d  - 16)dd - 16d  + 16)ddd + 16d dd
+--R           + 
+--R                     2       3               3
+--R             - 16d dd  + (16d  - 16d)dd + 16d  + 16d
+--R        *
+--R           s
+--R    *
+--R         3
+--R       sd
+--R   + 
+--R              2                2            2      4
+--R         (4ddd  + 16d ddd + 4dd  + 16dd + 4d  + 4)s
+--R       + 
+--R                   4          3         2      2        2                3
+--R             - 8ddd  - 16d ddd  + (- 8dd  + 16d  - 8)ddd  + (96d dd - 16d )ddd
+--R           + 
+--R                  4       3        2        2            4     2
+--R             - 8dd  - 16dd  + (- 8d  + 16)dd  - 16dd - 8d  - 8d  - 8
+--R        *
+--R            2
+--R           s
+--R       + 
+--R             6       2            2        4             3
+--R         4ddd  + (4dd  - 16dd - 4d  + 4)ddd  - 32d dd ddd
+--R       + 
+--R             4       2        2      2       4      2        2
+--R         (4dd  + (24d  + 24)dd  + 32d dd - 4d  + 24d  + 4)ddd
+--R       + 
+--R                  4         3         2         3                         6
+--R         (- 16d dd  - 32d dd  + 32d dd  + (- 32d  - 32d)dd - 16d)ddd + 4dd
+--R       + 
+--R            2       4      4      2       2      4       6     4     2
+--R         (4d  - 4)dd  + (4d  + 24d  - 4)dd  - 16d dd + 4d  + 4d  + 4d  + 4
+--R    *
+--R         2
+--R       sd
+--R   + 
+--R                                       5
+--R         ((- 8dd - 8)ddd - 8d dd - 8d)s
+--R       + 
+--R                           3                      2
+--R             (16dd + 16)ddd  + (- 16d dd - 16d)ddd
+--R           + 
+--R                  3       2         2              2                  3
+--R             (16dd  - 16dd  + (- 16d  - 16)dd - 16d  + 16)ddd + 16d dd
+--R           + 
+--R                     2       3               3
+--R             - 16d dd  + (16d  - 16d)dd + 16d  + 16d
+--R        *
+--R            3
+--R           s
+--R       + 
+--R                           5                    4
+--R             (- 8dd - 8)ddd  + (24d dd + 24d)ddd
+--R           + 
+--R                    3       2         2              2         3
+--R             (- 16dd  + 16dd  + (- 16d  + 16)dd - 16d  - 16)ddd
+--R           + 
+--R                    3         2         3               3          2
+--R             (16d dd  - 16d dd  + (- 16d  - 16d)dd - 16d  + 16d)ddd
+--R           + 
+--R                      5       4       2        3         2        2
+--R                 - 8dd  + 24dd  + (16d  - 16)dd  + (- 16d  - 16)dd
+--R               + 
+--R                     4      2              4      2
+--R                 (24d  - 16d  + 24)dd + 24d  + 16d  - 8
+--R            *
+--R               ddd
+--R           + 
+--R                    5         4         3         3       3         2
+--R             - 8d dd  + 24d dd  + (- 16d  - 16d)dd  + (16d  - 16d)dd
+--R           + 
+--R                  5      3              5      3
+--R             (- 8d  + 16d  + 24d)dd - 8d  - 16d  - 8d
+--R        *
+--R           s
+--R    *
+--R       sd
+--R   + 
+--R        8        2      2     2      6
+--R     - s  + (4ddd  + 4dd  + 4d  + 4)s
+--R   + 
+--R               4         2           2        2         2
+--R         - 6ddd  + (- 8dd  + 8dd - 4d  - 8)ddd  + (8d dd  + 32d dd + 8d)ddd
+--R       + 
+--R              4        2       2     2       4     2
+--R         - 6dd  + (- 8d  - 4)dd  + 8d dd - 6d  - 8d  - 6
+--R    *
+--R        4
+--R       s
+--R   + 
+--R             6       2            2        4             3
+--R         4ddd  + (4dd  - 16dd - 4d  + 4)ddd  - 32d dd ddd
+--R       + 
+--R             4       2        2      2       4      2        2
+--R         (4dd  + (24d  + 24)dd  + 32d dd - 4d  + 24d  + 4)ddd
+--R       + 
+--R                  4         3         2         3                         6
+--R         (- 16d dd  - 32d dd  + 32d dd  + (- 32d  - 32d)dd - 16d)ddd + 4dd
+--R       + 
+--R            2       4      4      2       2      4       6     4     2
+--R         (4d  - 4)dd  + (4d  + 24d  - 4)dd  - 16d dd + 4d  + 4d  + 4d  + 4
+--R    *
+--R        2
+--R       s
+--R   + 
+--R          8            2    6           2         5
+--R     - ddd  + (8dd + 4d )ddd  + (- 8d dd  - 8d)ddd
+--R   + 
+--R         4       2     2       4        4
+--R     (2dd  - 20dd  - 8d dd - 6d  + 2)ddd
+--R   + 
+--R            3      3  2               3    3
+--R     (32d dd  + 16d dd  + 32d dd + 16d )ddd
+--R   + 
+--R           5      2  4       3      2  2        4            6      2    2
+--R     (- 8dd  - 20d dd  + 16dd  - 56d dd  + (- 8d  - 8)dd + 4d  - 20d )ddd
+--R   + 
+--R           6        4      3  3        5        2      3       5              8
+--R     (8d dd  - 8d dd  + 32d dd  + (- 8d  - 8d)dd  + 32d dd - 8d  + 8d)ddd - dd
+--R   + 
+--R        6     2  5      4       4      2  3         4       2      6     2
+--R     4dd  - 8d dd  + (2d  - 6)dd  + 16d dd  + (- 20d  + 4)dd  + (8d  - 8d )dd
+--R   + 
+--R        8     4
+--R     - d  + 2d  - 1
+--R                                            Type: Fraction Polynomial Integer
+--E
 
--------------------------------------------------------------------
--- sutor/09/28/92 operator bug?
--------------------------------------------------------------------
+@
+sutor/09/28/92 operator bug?
+<<*>>=
 )clear all
+
+--S 96
 L n ==
   n = 0 => 1
   n = 1 => x
   (2*n-1)/n * x * L(n-1) - (n-1)/n * L(n-2)
+--R 
+--R                                                                   Type: Void
+--E
+
+--S 97
 dx:=operator("D")::OP(POLY FRAC INT)
+--R
+--R   (2)  D
+--R                                   Type: Operator Polynomial Fraction Integer
+--E
+
+--S 98
 evaluate(dx,p+-> differentiate(p,'x))
+--R 
+--R   There are 4 exposed and 1 unexposed library operations named 
+--R      evaluate having 2 argument(s) but none was determined to be 
+--R      applicable. Use HyperDoc Browse, or issue
+--R                            )display op evaluate
+--R      to learn more about the available operations. Perhaps 
+--R      package-calling the operation or using coercions on the arguments
+--R      will allow you to apply the operation.
+--R 
+--RDaly Bug
+--R   Cannot find a definition or applicable library operation named 
+--R      evaluate with argument type(s) 
+--R                    Operator Polynomial Fraction Integer
+--R                              AnonymousFunction
+--R      
+--R      Perhaps you should use "@" to indicate the required return type, 
+--R      or "$" to specify which version of the function you need.
+--E
+
+--S 99
 E n == (1-x**2)*dx**2-2*x*dx+n*(n+1)
+--R                                                                   Type: Void
+--E
+
+--S 100
 L 15
--- used to fail on this line
+--R   Compiling function L with type Integer -> Polynomial Fraction 
+--R      Integer 
+--R   Compiling function L as a recurrence relation.
+--R
+--R   (4)
+--R     9694845  15   35102025  13   50702925  11   37182145  9   14549535  7
+--R     ------- x   - -------- x   + -------- x   - -------- x  + -------- x
+--R       2048          2048           2048           2048          2048
+--R   + 
+--R       2909907  5   255255  3   6435
+--R     - ------- x  + ------ x  - ---- x
+--R         2048        2048       2048
+--R                                            Type: Polynomial Fraction Integer
+--E
+
+@
+Used to fail on this line
+<<*>>=
+
+--S 101
 E 15
+--R   Compiling function E with type PositiveInteger -> Operator 
+--R      Polynomial Fraction Integer 
+--R
+--R                       2      2
+--R   (5)  240 - 2x D - (x  - 1)D
+--R                                   Type: Operator Polynomial Fraction Integer
+--E
 
--------------------------------------------------------------------
--- bmt/10/12/92 EFSTRUC recursion problem
--------------------------------------------------------------------
+@
+bmt/10/12/92 EFSTRUC recursion problem
+<<*>>=
 )clear all
+
+--S 102
 bug:=(1+x**(1/4))**(1/3)/(x**(1/2))
--- gives a value stack overflow
-integrate(bug,x) -- seems to go into infinite recursion in rischNormalize
+--R
+--R         +--------+
+--R        3|4+-+
+--R        \|\|x  + 1
+--R   (1)  -----------
+--R             +-+
+--R            \|x
+--R                                                     Type: Expression Integer
+--E
 
--------------------------------------------------------------------
--- james/10/28/92 coerce bug
--------------------------------------------------------------------
+@
+Gives a value stack overflow
+
+Seems to go into infinite recursion in rischNormalize
+<<*>>=
+--S 103
+integrate(bug,x)
+--R
+--R                              +--------+
+--R           4+-+2    4+-+     3|4+-+
+--R        (12\|x   + 3\|x  - 9)\|\|x  + 1
+--R   (2)  --------------------------------
+--R                        7
+--R                                          Type: Union(Expression Integer,...)
+--E
+
+@
+james/10/28/92 coerce bug
+
+Improper character in Roman numeral: G
+<<*>>=
 )clear all
--- improper character in Roman numeral: G
+
+--S 104
 g::ROMAN
+--R 
+--R 
+--RDaly Bug
+--R   >> Error detected within library code:
+--R   Improper character in Roman numeral: 
+--R   #\G
+--R
+--R   Continuing to read the file...
+--R
+--E
+
+@
+grabm/10/28/92 runs forever
 
--------------------------------------------------------------------
--- grabm/10/28/92 runs forever
--------------------------------------------------------------------
+factor is quick but sqrt runs forever
+<<*>>=
 )clear all
--- this is quick
+
+--S 105
 factor 1068303355883998767544567663620885466990173600
--- but this runs forever
-sqrt 1068303355883998767544567663620885466990173600
+--R
+--R         5 7 2 4  2  2  2
+--R   (1)  2 3 5 7 17 19 23 3343 4219 326705949951846198203
+--R                                                       Type: Factored Integer
+--E
 
+--S 106
+sqrt 1068303355883998767544567663620885466990173600
+--R
+--R                  +-----------------------------+
+--R   (2)  196571340\|27647393656301898872761810506
+--R                                                        Type: AlgebraicNumber
+--E
 
--------------------------------------------------------------------
--- themos/11/05/92 fortran output bug
--------------------------------------------------------------------
+@
+themos/11/05/92 fortran output bug
+<<*>>=
 )clear all
 --      REAL T7,T6,T5,T4,T3,T2,T1
 --      T1=x*x
@@ -503,670 +2262,3465 @@ sqrt 1068303355883998767544567663620885466990173600
 --     &16.*x)*T4+(-T5+16.*T6)*y)*COS(x))/(y**8+4.*T1*y**6+6.*T7*y**4+4.*x
 --     &**6*y*y+x**8)
 -- T7 is referenced before it is defined
-a1:=sin(x)/(x**2+y**2);a2:=D(a1,[x,y]);a2+D(a2,x)
-
--------------------------------------------------------------------
--- grabm/11/05/92 
--- comment:
---I believe the "bug" is that the interpreter is converting gb which is
---a list of dmp style polynomials to a list of POLY type polynomials.
---Unfortunately the result of such a conversion is no longer a groebner basis.
---I don't see any reasonable way to prevent this, and would therefore have to
---classify this as "user error", when working with grobner bases, the user
---needs to force all his polynomials to be the appropriate type (thus having
---the correct ordering).
--------------------------------------------------------------------
--- expressing a symmetric functions in terms of elementary symm. functions
--- working in POLY INT is o.k.
+
+--S 107
+a1:=sin(x)/(x**2+y**2)
+--R
+--R         sin(x)
+--R   (1)  -------
+--R         2    2
+--R        y  + x
+--R                                                     Type: Expression Integer
+--E
+
+--S 108
+a2:=D(a1,[x,y])
+--R
+--R                           3     2
+--R        8x y sin(x) + (- 2y  - 2x y)cos(x)
+--R   (2)  ----------------------------------
+--R               6     2 4     4 2    6
+--R              y  + 3x y  + 3x y  + x
+--R                                                     Type: Expression Integer
+--E
+
+--S 109
+a2+D(a2,x)
+--R
+--R   (3)
+--R          5      2           3      4     3      2
+--R       (2y  + (4x  + 8x + 8)y  + (2x  + 8x  - 40x )y)sin(x)
+--R     + 
+--R            5        2        3        4      3
+--R       (- 2y  + (- 4x  + 16x)y  + (- 2x  + 16x )y)cos(x)
+--R  /
+--R      8     2 6     4 4     6 2    8
+--R     y  + 4x y  + 6x y  + 4x y  + x
+--R                                                     Type: Expression Integer
+--E
+
+@
+grabm/11/05/92 
+
+I believe the ``bug'' is that the interpreter is converting gb which is
+a list of dmp style polynomials to a list of POLY type polynomials.
+Unfortunately the result of such a conversion is no longer a groebner basis.
+I don't see any reasonable way to prevent this, and would therefore have to
+classify this as ``user error'', when working with grobner bases, the user
+needs to force all his polynomials to be the appropriate type (thus having
+the correct ordering).
+
+Expressing a symmetric functions in terms of elementary symm. functions
+working in POLY INT is o.k.
+<<*>>=
+)clear all
+
+--S 110
 R := FRAC INT
---   (1)  Fraction Integer
+--R
+--R   (1)  Fraction Integer
+--R                                                                 Type: Domain
+--E
+
+--S 111
 lpx : List POLY R := [x1+x2+x3, x1*x2+x1*x3+x2*x3,x1*x2*x3]
---   (2)  [x3 + x2 + x1,(x2 + x1)x3 + x1 x2,x1 x2 x3]
-lip := [lpx.1-e3, lpx.2-e2, lpx.3-e1]
---   (3)  [x3 + x2 + x1 - e3,(x2 + x1)x3 + x1 x2 - e2,x1 x2 x3 - e1]
+--R
+--R   (2)  [x3 + x2 + x1,(x2 + x1)x3 + x1 x2,x1 x2 x3]
+--R                                       Type: List Polynomial Fraction Integer
+--E
+
+--S 112
+lip := [lpx.1-e3, lpx.2-e2, lpx.3-e1]--R
+--R
+--R   (3)  [x3 + x2 + x1 - e3,(x2 + x1)x3 + x1 x2 - e2,x1 x2 x3 - e1]
+--R                                       Type: List Polynomial Fraction Integer
+--E
+
+--S 113
 gbp := groebner lip
---   (4)
---                         2                   2
---   [x3 + x2 + x1 - e3, x2  + (x1 - e3)x2 + x1  - e3 x1 + e2,
---      3        2
---    x1  - e3 x1  + e2 x1 - e1]
+--R
+--R   (4)
+--R                         2                   2
+--R   [x3 + x2 + x1 - e3, x2  + (x1 - e3)x2 + x1  - e3 x1 + e2,
+--R      3        2
+--R    x1  - e3 x1  + e2 x1 - e1]
+--R                                       Type: List Polynomial Fraction Integer
+--E
+
+--S 114
 normalForm(x1**2+x2**2+x3**2,gbp)
---          2
---   (5)  e3  - 2e2
--- working in DMP is o.k.
+--R
+--R          2
+--R   (5)  e3  - 2e2
+--R                                            Type: Polynomial Fraction Integer
+--E
+
+--S 115
 dmp := DMP([x1,x2,x3,e1,e2,e3],INT)
---   (6)  DistributedMultivariatePolynomial([x1,x2,x3,e1,e2,e3],Integer)
+--R
+--R   (6)  DistributedMultivariatePolynomial([x1,x2,x3,e1,e2,e3],Integer)
+--R                                                                 Type: Domain
+--E
+
+--S 116
 li : List dmp := [lpx.1-e1, lpx.2-e2, lpx.3-e3]
---   (7)  [x1 + x2 + x3 - e1,x1 x2 + x1 x3 + x2 x3 - e2,x1 x2 x3 - e3]
+--R
+--R   (7)  [x1 + x2 + x3 - e1,x1 x2 + x1 x3 + x2 x3 - e2,x1 x2 x3 - e3]
+--R    Type: List DistributedMultivariatePolynomial([x1,x2,x3,e1,e2,e3],Integer)
+--E
+
+--S 117
 gb := groebner li
---   (8)
---                         2                     2
---   [x1 + x2 + x3 - e1, x2  + x2 x3 - x2 e1 + x3  - x3 e1 + e2,
---      3     2
---    x3  - x3 e1 + x3 e2 - e3]
+--R
+--R   (8)
+--R                         2                     2
+--R   [x1 + x2 + x3 - e1, x2  + x2 x3 - x2 e1 + x3  - x3 e1 + e2,
+--R      3     2
+--R    x3  - x3 e1 + x3 e2 - e3]
+--R    Type: List DistributedMultivariatePolynomial([x1,x2,x3,e1,e2,e3],Integer)
+--E
+
+--S 118
 p:dmp:=(x1**2+x2**2+x3**2)
---          2     2     2
---   (9)  x1  + x2  + x3
+--R
+--R          2     2     2
+--R   (9)  x1  + x2  + x3
+--R         Type: DistributedMultivariatePolynomial([x1,x2,x3,e1,e2,e3],Integer)
+--E
+
+--S 119
 normalForm(p,gb)
---           2
---   (10)  e1  - 2e2
--- but we have some problems (coercion? ordering?) here:
+--R
+--R           2
+--R   (10)  e1  - 2e2
+--RType: DistributedMultivariatePolynomial([x1,x2,x3,e1,e2,e3],Fraction Integer)
+--E
+
+--S 120
 normalForm(x1**2+x2**2+x3**2,gb)
---            2                      2              2
---   (11)  2x2  + (2x1 - 2e1)x2 + 2x1  - 2e1 x1 + e1
+--R
+--R            2                      2              2
+--R   (11)  2x2  + (2x1 - 2e1)x2 + 2x1  - 2e1 x1 + e1
+--R                                            Type: Polynomial Fraction Integer
+--E
 
+@
+bmt/11/17/92 Ifintegrate
+
+It seems that one cannot simply parametrize reducible curves.
+Any attempt at parametrization can only follow one branch.
+For curves of the form $y^2=a^2x^2+bx+c$, these are only reducible
+if $a^2x^2+bx+c$ is a perfect square. Basically I think we need to
+choose 1 branch in this case. Under some circumstances we could
+try to proceed down both branches and then unify the result, but for
+the time being, perhaps we should just perform the substitution
+$y=sqrt(a^2x^2+bx+c)$ whenever that is a perfect square.
+(then we don't even need to do any back subsitution or change to dx).
+
+For another example, perhaps due to the same essential difficulty try
+<<*>>=
+)clear all
 
+--S 121
+integrate(normalize(sqrt(1+cos(x)),x),x)
+--R
+--R                +--------+
+--R             x  |     x 2
+--R        2sin(-) |2cos(-)
+--R             2 \|     2
+--R   (1)  ------------------
+--R                  x
+--R              cos(-)
+--R                  2
+--R                                          Type: Union(Expression Integer,...)
+--E
 
+@
+This gets a non-invertible error
 
--------------------------------------------------------------------
--- bmt/11/17/92 Ifintegrate
--------------------------------------------------------------------
---It seems that one cannot simply parametrize reducible curves.
---Any attempt at parametrization can only follow one branch.
---For curves of the form y**2=a**2*x**2+b*x+c, these are only reducible
---if a**2*x**2+b*x+c is a perfect square. Basically I think we need to
---choose 1 branch in this case. Under some circumstances we could
---try to proceed down both branches and then unify the result, but for
---the time being, perhaps we should just perform the substitution
---y=sqrt(a**2*x**2+b*x+c) whenever that is a perfect square.
---(then we don't even need to do any back subsitution or change to dx).
---
---For another example, perhaps due to the same essential difficulty try
+I have fixed integrate(sqrt(1+cos(x)),x) and
 integrate(normalize(sqrt(1+cos(x)),x),x)
--- this gets a non-invertible error
+fix was to function prootintegrate in INTPAF in intaf.spad
 
---I have fixed integrate(sqrt(1+cos(x)),x) and
---integrate(normalize(sqrt(1+cos(x)),x),x)
---fix was to function prootintegrate in INTPAF in intaf.spad
+james/02/11/93 integrate
 
+used to give error:
+\begin{verbatim}
+  No identity element for reduce of empty list using operation max
+\end{verbatim}
+<<*>>=
+)clear all
 
--------------------------------------------------------------------
--- james/02/11/93 integrate
--- used to give error:
---   No identity element for reduce of empty list using operation
---   max
--------------------------------------------------------------------
+--S 122
 integrate(((-x-1)*log((x**2+x))**2+2*log(x))/(x+1),x)
+--R
+--R           x                 2      2
+--I         ++  (- %K - 1)log(%K  + %K)  + 2log(%K)
+--I   (1)   |   ----------------------------------- d%K
+--I        ++                  %K + 1
+--R                                          Type: Union(Expression Integer,...)
+--E
 
--------------------------------------------------------------------
--- dewar/02/15/93
--------------------------------------------------------------------
+@
+dewar/02/15/93
+
+\begin{verbatim}
+  i::Polynomial(Integer)
+  %::Union(Symbol,Polynomial Integer)
+  list %
+\end{verbatim}
+This is a bug in old style union handling, this style of unions
+will become obsolete, so the suggested fix is to use tagged unions instead:
+
+<<*>>=
 )clear all
---i::Polynomial(Integer)
---%::Union(Symbol,Polynomial Integer)
---list %
---
---this is a bug in old style union handling, this style of unions
---will become obsolete, so the suggested fix is to use tagged unions instead:
-i::POLY INT
-%::Union(s:Symbol, p:POLY INT)
-list % -- works
 
--------------------------------------------------------------------
--- grabm/03/04/93
--- parser bug? not for system commands
--------------------------------------------------------------------
+--S 123
+t1:=i::POLY INT
+--R
+--R   (1)  i
+--R                                                     Type: Polynomial Integer
+--E
+
+--S 124
+t2:=t1::Union(s:Symbol, p:POLY INT)
+--R
+--R   (2)  i
+--R                                       Type: Union(p: Polynomial Integer,...)
+--E
+
+--S 125
+list t2
+--R
+--R   (3)  [i]
+--R                            Type: List Union(s: Symbol,p: Polynomial Integer)
+--E
+
+@
+grabm/03/04/93 parser bug? not for system commands
+\begin{verbatim}
 )clear all
 -- gives error: Sorry, but no option begins with upd;
 )load /spad/mnt/rios/algebra/EQ )upd; a:=1
 -- works
 )load /spad/mnt/rios/algebra/EQ )upd ; a:=1
+\end{verbatim}
 
--------------------------------------------------------------------
--- bronstein/03/08/93
--------------------------------------------------------------------
+bronstein/03/08/93 wrong particular solution
+<<*>>=
 )clear all
+
+--S 126
 I:=operator 'I
+--R
+--R   (1)  I
+--R                                                          Type: BasicOperator
+--E
+
+--S 127
 J:=operator 'J
+--R
+--R   (2)  J
+--R                                                          Type: BasicOperator
+--E
+
+--S 128
 eq := mu * D(I x,x) = - (K + S) * I(x) + S*J(x)
+--R
+--R           ,
+--R   (3)  muI (x)= S J(x) + (- S - K)I(x)
+--R
+--R                                            Type: Equation Expression Integer
+--E
+
+--S 129
 solve(eq,I,x)
---> wrong particular solution
-
--------------------------------------------------------------------
--- dewar/03/16/93
--- bug writing backslash to files
---comment:
---This is not a bug, what is written to the file is the lisp representation
---of the string "\\test" (since '\' is lisp escape character).
---The file is read and written using lisp primitives and thus the escape
---characters need to be doubled. This is consistent, since if you read the
---item back in from the file, the correct string is reconstituted.
---
---If you want to create a text file which simply contains lines of text
---instead of lines of lisp strings, use:
---ofile : TextFile := open("test","output")  ...
---then you will get a file of literal strings with no string delimiters and
---no escape characters.
--------------------------------------------------------------------
+--R
+--R   (4)
+--R                  (- S - K)x                                       (- S - K)x
+--R                  ----------   x                                   ----------
+--I                      mu     ++        S J(%K)                         mu
+--I   [particular= %e           |   ------------------ d%K ,basis= [%e          ]]
+--I                            ++        - %K S - %K K
+--R                                      -------------
+--R                                            mu
+--R                                 mu %e
+--RType: Union(Record(particular: Expression Integer,basis: List Expression Integer),...)
+--E
+
+@
+
+dewar/03/16/93 bug writing backslash to files
+
+This is not a bug, what is written to the file is the lisp representation
+of the string "\\test" (since '\' is lisp escape character).
+The file is read and written using lisp primitives and thus the escape
+characters need to be doubled. This is consistent, since if you read the
+item back in from the file, the correct string is reconstituted.
+
+If you want to create a text file which simply contains lines of text
+instead of lines of lisp strings, use:
+\begin{verbatim}
+  ofile : TextFile := open("test","output")  ...
+\end{verbatim}
+then you will get a file of literal strings with no string delimiters and
+no escape characters.
+<<*>>=
 )clear all
+
+--S 130
 ofile: File String := open("/tmp/test","output")
--- this writes "\\\\test" but should write "\\test"
+--R
+--R   (1)  "/tmp/test"
+--R                                                            Type: File String
+--E
+
+@
+This writes ``\verb|\\\\test|'' but should write ``\verb|\\test|''
+<<*>>=
+
+--S 131
 write!(ofile,"\\test"::String)
+--R
+--R   (2)  "\\test"
+--R                                                                 Type: String
+--E
+
+--S 132
 close! ofile
+--R
+--R   (3)  "/tmp/test"
+--R                                                            Type: File String
+--E
+
+@
+
+themos/04/07/93 this sometimes fails
 
--------------------------------------------------------------------
--- themos/04/07/93
--- this sometimes fails
--- comment:
---thanks for tracing down the problem. Basically the lines for monicizing
---the result need to be done before we try to 
---retract back from the algebraic extension.
--------------------------------------------------------------------
+Thanks for tracing down the problem. Basically the lines for monicizing
+the result need to be done before we try to 
+retract back from the algebraic extension.
+<<*>>=
 )clear all
+
+--S 133
 pol:DMP([x,y,z],PF(2)):=x**2*y**2+x**2*y*z+x**2*z**2+x*y*z**2+y**3*z+y*z**3
+--R
+--R         2 2    2       2 2        2    3       3
+--R   (1)  x y  + x y z + x z  + x y z  + y z + y z
+--R                Type: DistributedMultivariatePolynomial([x,y,z],PrimeField 2)
+--E
+
+--S 134
 factor pol
+--R
+--R         2 2    2       2 2        2    3       3
+--R   (2)  x y  + x y z + x z  + x y z  + y z + y z
+--R       Type: Factored DistributedMultivariatePolynomial([x,y,z],PrimeField 2)
+--E
+
+@
+williamson/04/21/93
 
--------------------------------------------------------------------
--- williamson/04/21/93
--- comment:
---I ran into some problems when factoring polynomials over number fields.
---Evidently the interpretor doesn't choose the correct function 'factor'.
---It uses a function from MULTFACT, when it should be using a function from
---SAEFACT. 
--------------------------------------------------------------------
+I ran into some problems when factoring polynomials over number fields.
+Evidently the interpretor doesn't choose the correct function 'factor'.
+It uses a function from MULTFACT, when it should be using a function from
+SAEFACT. 
+<<*>>=
 )clear all
+
+--S 135
 up := UP('w,FRAC INT)
+--R
+--R   (1)  UnivariatePolynomial(w,Fraction Integer)
+--R                                                                 Type: Domain
+--E
+
+--S 136
 p : up := w**4 + w**3 + w**2 + w + 1
+--R
+--R         4    3    2
+--R   (2)  w  + w  + w  + w + 1
+--R                               Type: UnivariatePolynomial(w,Fraction Integer)
+--E
+
+--S 137
 sae := SAE(FRAC INT,up,p)
+--R
+--R   (3)
+--R  SimpleAlgebraicExtension(Fraction Integer,UnivariatePolynomial(w,Fraction Int
+--R  eger),w**4+w**3+w*w+w+1)
+--R                                                                 Type: Domain
+--E
+
+--S 138
 q : UP('x,sae) := x**5 - 1
-factor q -- used to report: x**5-1 
+--R
+--R         5
+--R   (4)  x  - 1
+--RType: UnivariatePolynomial(x,SimpleAlgebraicExtension(Fraction Integer,UnivariatePolynomial(w,Fraction Integer),w**4+w**3+w*w+w+1))
+--E
+
+@
+Used to report: x**5-1 
+<<*>>=
+--S 139
+factor q 
+--R
+--R                            2       3       3    2
+--R   (5)  (x - 1)(x - w)(x - w )(x - w )(x + w  + w  + w + 1)
+--RType: Factored UnivariatePolynomial(x,SimpleAlgebraicExtension(Fraction Integer,UnivariatePolynomial(w,Fraction Integer),w**4+w**3+w*w+w+1))
+--E
+
+--S 140
 saefact := SAEFACT(up,sae,UP('x,sae))
+--R
+--R   (6)
+--R  SimpleAlgebraicExtensionAlgFactor(UnivariatePolynomial(w,Fraction Integer),Si
+--R  mpleAlgebraicExtension(Fraction Integer,UnivariatePolynomial(w,Fraction Integ
+--R  er),w**4+w**3+w*w+w+1),UnivariatePolynomial(x,SimpleAlgebraicExtension(Fracti
+--R  on Integer,UnivariatePolynomial(w,Fraction Integer),w**4+w**3+w*w+w+1)))
+--R                                                                 Type: Domain
+--E
+
+--S 141
 factor(q)$saefact
+--R
+--R                            2       3       3    2
+--R   (7)  (x - 1)(x - w)(x - w )(x - w )(x + w  + w  + w + 1)
+--RType: Factored UnivariatePolynomial(x,SimpleAlgebraicExtension(Fraction Integer,UnivariatePolynomial(w,Fraction Integer),w**4+w**3+w*w+w+1))
+--E
+
+@
+
+grabm/04/30/93
 
--------------------------------------------------------------------
--- grabm/04/30/93
--- comment:
---This bug has been fixed at yorktown, in radix.spad, change line 163, the
---third line of intgroup to be:
---      empty? rest li => intToExpr first(li)
---and then recompile RADIX
--------------------------------------------------------------------
+This bug has been fixed at yorktown, in radix.spad, change line 163, the
+third line of intgroup to be:
+\begin{verbatim}
+  empty? rest li => intToExpr first(li)
+\end{verbatim}
+and then recompile RADIX
+
+Results in 10 and not A
+<<*>>=
 )clear all
--- results in 10 and not A
+
+--S 142
 10::RadixExpansion(16)
+--R
+--R   (1)  A
+--R                                                      Type: RadixExpansion 16
+--E
+
+@
+bronstei@inf.ethz.ch (manuel bronstein)
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch (manuel bronstein)
--------------------------------------------------------------------
+Used to return x, now returns 1
+<<*>>=
 )clear all
+
+--S 143
 r:=rule 'x == 1
--- used to return x, now returns 1
+--R
+--R   (1)  x == 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E
+
+--S 144
 r x
+--R
+--R   (2)  1
+--R                                                     Type: Expression Integer
+--E
+
+@
+ADK@scri.fsu.edu (tony kennedy)
 
--------------------------------------------------------------------
--- ADK@scri.fsu.edu (tony kennedy)
--------------------------------------------------------------------
+<<*>>=
 )clear all
-factor(-12)
-%**2
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch (manuel bronstein)
--- >> Error: cannot retract nonconstant polynomial
--------------------------------------------------------------------
+--S 145
+t1:=factor(-12)
+--R
+--R           2
+--R   (1)  - 2 3
+--R                                                       Type: Factored Integer
+--E
+
+--S 146
+t1**2
+--R
+--R         4 2
+--R   (2)  2 3
+--R                                                       Type: Factored Integer
+--E
+
+@
+bronstei@inf.ethz.ch (manuel bronstein)
+
+Error: cannot retract nonconstant polynomial
+<<*>>=
 )clear all
+
+--S 147
 complexNumeric(log(sqrt(-3)))
+--R
+--R   (1)  0.5493061443 340548457 + 1.5707963267 948966192 %i
+--R                                                          Type: Complex Float
+--E
+
+@
+quitte@knuth.univ-poitiers.fr/8/15/93 (Claude Quitte)
+
+Why is it impossible to specify the target/cible types for the
+functions leftProductBy and rightProductBy in the body of the package ???
 
--------------------------------------------------------------------
--- quitte@knuth.univ-poitiers.fr/8/15/93 (Claude Quitte)
--------------------------------------------------------------------
+The code for leftProductBy is correct but the code for rightProductBy
+troubles the compiler !!!! It seems to compile a LOCAL function with
+ANOTHER signature.
+
+\begin{verbatim}
+   initializing nrlib TEST for Test
+   compiling into nrlib TEST
+   compiling exported leftProductBy : Integer -> Integer -> Integer
+Time: 0.35 SEC.
+
+   compiling local rightProductBy : Integer -> Integer
+****** comp fails at level 2 with expression: ******
+error in function rightProductBy
+
+****** level 2  ******
+$x:= #1
+$m:= $EmptyMode
+$f:=
+((((|n| # #) (|rightProductBy| # # #) (|n| #) (|rightProductBy| # # #) ...)))
+
+   >> Apparent user error:
+   no mode found for
+   #1
+   You are being returned to the top level of the interpreter.
+\end{verbatim}
+answer (barry):
+
+Your problem in TEST about specifying target types which are Mapping's
+was a bug in the compiler and has been fixed for Axiom release 2.0.
+
+<<*>>=
+\begin{verbatim}
 )clear all
---)abbreviation package TEST Test
---
---Test() : with
---
---   leftProductBy : Integer -> (Integer -> Integer)
---   rightProductBy : Integer -> Mapping(Integer, Integer)
---
--- == add
---
---   leftProductBy(n) == n * #1
---
---   rightProductBy(n : Integer) : Mapping(Integer, Integer) == #1 * n
---------------------------------------------------------------------------
---
---Why is it impossible to specify the target/cible types for the
---functions leftProductBy and rightProductBy in the body of the package ???
---
---The code for leftProductBy is correct but the code for rightProductBy
---troubles the compiler !!!! It seems to compile a LOCAL function with
---ANOTHER signature.
---
---------------------------------------------------------------------------
---   initializing nrlib TEST for Test
---   compiling into nrlib TEST
---   compiling exported leftProductBy : Integer -> Integer -> Integer
---Time: 0.35 SEC.
---
---   compiling local rightProductBy : Integer -> Integer
---****** comp fails at level 2 with expression: ******
---error in function rightProductBy
---
---****** level 2  ******
---$x:= #1
---$m:= $EmptyMode
---$f:=
---((((|n| # #) (|rightProductBy| # # #) (|n| #) (|rightProductBy| # # #) ...)))
---
---   >> Apparent user error:
---   no mode found for
---   #1
---   You are being returned to the top level of the interpreter.
-------------------------------------------------------------------------
--- answer (barry):
---
---Your problem in TEST about specifying target types which are Mapping's
---was a bug in the compiler and has been fixed for Axiom release 2.0.
---
+)sys rm -f /tmp/tpd.spad
+)lisp (setq ofile (open "/tmp/tpd.spad" :direction :output))
+)lisp (format ofile ")abbreviation package TPD Tpd~%")
+)lisp (format ofile "Tpd() : with~%")
+)lisp (format ofile "   leftProductBy : Integer -> (Integer -> Integer)~%")
+)lisp (format ofile "   rightProductBy : Integer -> Mapping(Integer, Integer)~%")
+)lisp (format ofile "  == add~%")
+)lisp (format ofile "   leftProductBy(n) == n * #1~%")
+)lisp (format ofile "   rightProductBy(n : Integer) : Mapping(Integer, Integer) == #1 * n~%")
+)lisp (close ofile)
+)compile /tmp/tpd.spad
+)sys rm -f /tmp/tpd.spad
+)sys rm -rf /tmp/TPD.nrlib
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/10/6/93 (Manuel Bronstein)
--------------------------------------------------------------------
+@
+bronstei@inf.ethz.ch/10/6/93 (Manuel Bronstein)
+
+Here is algfunc.spad with an old bug fixed: eventh-roots of negative floats
+coerced to EXPR FLOAT (e.g. sqrt(-1::EXPR FLOAT)) used to produced an error
+message since the sqrt from FLOAT was called. 
+
+I have now fixed iroot from AF(R,)
+to call the sqrt from R only if either R is algebraically closed, or the
+root is odd, or the argument is positive. Here's the new behaviour:
+
+As a side-effect, this fixes the problem with numeric
+(which was instantiating \verb|sqrt(-1)\$EXPR(FLOAT))|.
+<<*>>=
 )clear all
---Here is algfunc.spad with an old bug fixed: eventh-roots of negative floats
---coerced to EXPR FLOAT (e.g. sqrt(-1::EXPR FLOAT)) used to produced an error
---message since the sqrt from FLOAT was called. 
---I have now fixed iroot from AF(R,)
---to call the sqrt from R only if either R is algebraically closed, or the
---root is odd, or the argument is positive. Here's the new behaviour:
+
+--S 148
 sqrt(-1::EXPR FLOAT)
+--R
+--R         +-----+
+--R   (1)  \|- 1.0
+--R                                                       Type: Expression Float
+--E
+
+--S 149
 sqrt(2::EXPR FLOAT)
+--R 
+--R
+--R   (2)  1.4142135623 730950488
+--R                                                       Type: Expression Float
+--E
+
+--S 150
 nthRoot(-2::EXPR FLOAT, 3)
+--R
+--R   (3)  - 1.2599210498 948731648
+--R                                                       Type: Expression Float
+--E
+
+--S 151
 nthRoot(-2::EXPR FLOAT, 4)
---As a side-effect, this fixes the problem with numeric
--- (which was instantiating sqrt(-1)$EXPR(FLOAT)).
+--R
+--R        4+-----+
+--R   (4)  \|- 2.0
+--R                                                       Type: Expression Float
+--E
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/10/6/93 (Manuel Bronstein)
--------------------------------------------------------------------
+@
+bronstei@inf.ethz.ch/10/6/93 (Manuel Bronstein)
+
+Here is an updated efstruc.spad where ker2trigs now knows about abs.
+<<*>>=
 )clear all
---Here is an updated efstruc.spad where ker2trigs now knows about abs.
-real abs(4 + %i * 5) -- does the right thing.
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/10/5/93 (Manuel Bronstein)
--------------------------------------------------------------------
+--S 152
+real abs(4 + %i * 5)
+--R
+--R         +--+
+--R   (1)  \|41
+--R                                                     Type: Expression Integer
+--E
+
+@
+bronstei@inf.ethz.ch/10/5/93 (Manuel Bronstein)
+
+Here is again an enhanced elemntry.spad. What happens now is that
+\begin{verbatim}
+  exp(q * %i * %pi)
+\end{verbatim}
+gets automatically simplifed whenever q is a rational number whose
+denominator is one of  \{1,2,3,4,6\}.
+<<*>>=
 )clear all
---Here is again an enhanced elemntry.spad. What happens now is that
-exp(q * %i * %pi)
---gets automatically simplifed whenever q is a rational number whose
---denominator is one of  {1,2,3,4,6}.
+
+--S 153
 exp(5/3*%i*%pi)
+--R
+--R             +-+
+--R        - %i\|3  + 1
+--R   (1)  ------------
+--R              2
+--R                                             Type: Expression Complex Integer
+--E
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/10/4/93 (Manuel Bronstein)
--- luczak@nag.com (Richard Luczak)
--------------------------------------------------------------------
+@
+bronstei@inf.ethz.ch/10/4/93 (Manuel Bronstein),\\
+luczak@nag.com (Richard Luczak)
+<<*>>=
 )clear all
+
+--S 154
 exp(log(-1))
+--R
+--R   (1)  - 1
+--R                                                     Type: Expression Integer
+--E
+
+--S 155
 sum((-1)**k * (k+m),k=0..n)
+--R
+--R                          n
+--R        (2n + 2m + 1)(- 1)  + 2m - 1
+--R   (2)  ----------------------------
+--R                      4
+--R                                                     Type: Expression Integer
+--E
+
+@
+bronstei@inf.ethz.ch/10/4/93 (Manuel Bronstein)
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/10/4/93 (Manuel Bronstein)
--------------------------------------------------------------------
+Simplifies (abs now checks quotients instead of just retraction to R).
+<<*>>=
 )clear all
---simplifies (abs now checks quotients instead of just retraction to R).
+
+--S 156
 abs((1/2)::EXPR(INT))
+--R
+--R        1
+--R   (1)  -
+--R        2
+--R                                                     Type: Expression Integer
+--E
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/10/4/93 (Manuel Bronstein)
--------------------------------------------------------------------
+@
+bronstei@inf.ethz.ch/10/4/93 (Manuel Bronstein)
+<<*>>=
 )clear all
+
+--S 157
 integrate(1/(x**2 + %i*a),x)
+--R
+--R         +--+         +--+         +--+           +--+
+--R         |%i          |%i          |%i            |%i
+--R         |-- log(%i a |--  + x) -  |-- log(- %i a |--  + x)
+--R        \| a         \| a         \| a           \| a
+--R   (1)  ---------------------------------------------------
+--R                                 2
+--R                                  Type: Union(Expression Complex Integer,...)
+--E
 
--------------------------------------------------------------------
--- bmt@spadserv.watson.ibm.com/9/28/93 (Barry Trager)
--------------------------------------------------------------------
+@
+bmt@spadserv.watson.ibm.com/9/28/93 (Barry Trager)
+<<*>>=
 )clear all
+
+--S 158
 limit(1/2**n,n=%plusInfinity)
+--R
+--R   (1)  0
+--R                        Type: Union(OrderedCompletion Expression Integer,...)
+--E
+
+@
+bronstei@inf.ethz.ch/9/22/93 (Manuel Bronstein)
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/9/22/93 (Manuel Bronstein)
--------------------------------------------------------------------
+Here is an update to efstruc.spad that handles complex constants much better.
+Negative square roots and negative logs are now recognized as complex and
+treated properly by real?, real, imag, and complexForm:
+
+As a result, integrals involving sqrt(-2) etc... are now treated correctly
+(this was the case only for sqrt(-1) with the older version).
+<<*>>=
 )clear all
---Here is an update to efstruc.spad that handles complex constants much better.
---Negative square roots and negative logs are now recognized as complex and
---treated properly by real?, real, imag, and complexForm:
+
+--S 159
 x := sqrt(-3) + sqrt 2 + sqrt(- exp a) + log(-a**2-1)
+--R
+--R         +-----+
+--R         |    a           2         +-+    +---+
+--R   (1)  \|- %e   + log(- a  - 1) + \|2  + \|- 3
+--R                                                     Type: Expression Integer
+--E
+
+--S 160
 real? x
+--R
+--R   (2)  false
+--R                                                                Type: Boolean
+--E
+
+--S 161
 real x
+--R
+--R             2         +-+
+--R   (3)  log(a  + 1) + \|2
+--R                                                     Type: Expression Integer
+--E
+
+--S 162
 imag x
---As a result, integrals involving sqrt(-2) etc... are now treated correctly
---(this was the case only for sqrt(-1) with the older version).
-
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/9/22/93 (Manuel Bronstein)
--------------------------------------------------------------------
-)clear all
--->> haha := rule x*x == z
--->> haha(a*a + b*b + c**2)        -->  3z
--->> haha(a*a + b*b + c**2 + d*d)  -->  z
--->>
--->> the bug is that the last line returns z instead of 4z.
---
---Sorry guys, this is not a bug: haha is so general a rule that it matches
---the integer 4 (as 2 squared), so the rewrite chain for the last example is:
---
---a*a + b*b + c**2 + d*d  --->  z + z + z + z  = 4 * z ---> z * z ---> z
---
---Here is a console showing what exactly happens:
+--R
+--R         +---+
+--R         |  a     +-+
+--R   (4)  \|%e   + \|3  + %pi
+--R                                                     Type: Expression Integer
+--E
+
+@
+bronstei@inf.ethz.ch/9/22/93 (Manuel Bronstein)
+\begin{verbatim}
+  haha := rule x*x == z
+  haha(a*a + b*b + c**2)        -->  3z
+  haha(a*a + b*b + c**2 + d*d)  -->  z
+\end{verbatim}
+
+The bug is that the last line returns z instead of 4z.
+
+Sorry guys, this is not a bug: haha is so general a rule that it matches
+the integer 4 (as 2 squared), so the rewrite chain for the last example is:
+\begin{verbatim}
+ a*a + b*b + c**2 + d*d  --->  z + z + z + z  = 4 * z ---> z * z ---> z
+\end{verbatim}
+Here is a console showing what exactly happens:
+<<*>>=
+)clear all
+
+--S 163
 haha := rule x*x == z
+--R
+--R         2
+--R   (1)  x  == z
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E
+
+--S 164
 haha 4
+--R
+--R   (2)  z
+--R                                                     Type: Expression Integer
+--E
+
+--S 165
 haha 3
+--R
+--R   (3)  3
+--R                                                     Type: Expression Integer
+--E
+
+--S 166
 haha(4*z)
+--R
+--R   (4)  z
+--R                                                     Type: Expression Integer
+--E
+
+--S 167
 haha(3*z)
---To see the whole rewrite chain:
-a*a + b*b + c**2 + d*d
-applyRules([haha], %, 1)$APPRULE(INT,INT,EXPR INT)
-applyRules([haha], %, 1)$APPRULE(INT,INT,EXPR INT)
-applyRules([haha], %, 1)$APPRULE(INT,INT,EXPR INT)
---I think it's actually the proper behavior for the pattern matcher. This
---example shows that rules can bite, something Mma users are quite aware about!
-
--------------------------------------------------------------------
--- dewar/9/16/93 (mike dewar)
--------------------------------------------------------------------
---There's an odd discontinuity about the behaviour of the following
---function:
+--R
+--R   (5)  3z
+--R                                                     Type: Expression Integer
+--E
+
+@
+To see the whole rewrite chain:
+<<*>>=
+
+--S 168
+t1:=a*a + b*b + c**2 + d*d
+--R
+--R         2    2    2    2
+--R   (6)  d  + c  + b  + a
+--R                                                     Type: Polynomial Integer
+--E
+
+--S 169
+t2:=applyRules([haha], t1, 1)$APPRULE(INT,INT,EXPR INT)
+--R
+--R   (7)  4z
+--R                                                     Type: Expression Integer
+--E
+
+--S 170
+t3:=applyRules([haha], t2, 1)$APPRULE(INT,INT,EXPR INT)
+--R
+--R         2
+--R   (8)  z
+--R                                                     Type: Expression Integer
+--E
+
+--S 171
+t4:=applyRules([haha], t3, 1)$APPRULE(INT,INT,EXPR INT)
+--R
+--R   (9)  z
+--R                                                     Type: Expression Integer
+--E
+
+@
+I think it's actually the proper behavior for the pattern matcher. This
+example shows that rules can bite, something Mma users are quite aware about!
+
+dewar/9/16/93 (mike dewar)
+
+There's an odd discontinuity about the behaviour of the following function:
+
+<<*>>=
+)clear all
 
+--S 172
 harm(1) == 1
+--R                                                                   Type: Void
+--E
+
+--S 173
 harm(n) == harm(n-1) + 1/n
+--R                                                                   Type: Void
+--E
+
+--S 174
 harm : Integer -> Fraction Integer
-harm(1023) -- takes a little while, as expected
-harm(1024) -- takes forever?
-
--------------------------------------------------------------------
--- williams@inf.ethz.ch/9/1/93 (Clifton Williamson)
--------------------------------------------------------------------
---> we should probably support integrate(%,x) on series types.
---> x could be either the variable of expansion or a parameter variable.
---
---We've discussed this before with regard to the function 'differentiate'.
---The technical problem is that "generalized" power series may have
---"coefficients" involving the series variable:
-series(x**x,x=0)
---In this case, as currently implemented, 'differentiate' returns incorrect
---answers:
-)set mess test off
-differentiate %
-)set mess test on
---The solution we discussed (perhaps "resolution" is a better word) was to
---create a separate series type for generalized series.  This would be a
---carbon copy of UPXS, except that differentiate(series,variable(series)) and
---integrate(series,variable(series)) would return an error message.  The
---error message could also suggest that the user first apply 'approximate',
---then compute a derivative or integral.  We would also have a coercion from
---UPXS to this type.  The function 'series' would return a UPXS, when the
---coefficients do not involve the series variable, and a "generalized series",
---when the coefficients involve the series variable.
---
---If this sounds cool to you, I'll go ahead with it when I have time.  (I'm
---trying to meet a 16 September deadline for a MEGA '94 submission.  I'm still
---getting my results together, so time is tight.  Let me know if there is a
---time deadline for the AXIOM code!)
---
---> Also we need better tools for taking finite truncations of series objects.
---> In particular since we now mostly use series(expr,var) to create a series,
---> UPXS if over a coefficient domain which supports the symbol of expansion,
---> should be able to truncate a series to an EXPR.
---
---I thought I had you on this one!  The signature is there (in pscat.spad):
---
---    if Coef has coerce: Symbol -> Coef then
---      if Coef has "**":(Coef,Expon) -> Coef then
---        approximate: ($,Expon) -> Coef
---          ++ \spad{approximate(f)} returns a truncated power series with the
---          ++ series variable viewed as an element of the coefficient domain.
---
---It certainly works for Laurent series:
-laurent(cos(a+x)/x,x=0)
-approximate(%,3)
---But, unfortunately, I never implemented it for Puiseux series:
-puiseux(cos(a+x)/x,x=0)
-approximate(%,3)
-series(cos(x**(2/3) + a),x=0)
-approximate(%,2)
-approximate(%% 1,7/5)
-
-
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/10/6/93 (manuel bronstein)
--------------------------------------------------------------------
-)clear all
-)set message type off
-
--- Here is algfunc.spad with an old bug fixed: eventh-roots of negative floats
--- coerced to EXPR FLOAT (e.g. sqrt(-1::EXPR FLOAT)) used to produced an error
--- message since the sqrt from FLOAT was called. 
--- I have now fixed iroot from AF(R,)
--- to call the sqrt from R only if either R is algebraically closed, or the
--- root is odd, or the argument is positive. Here's the new behaviour:
+--R                                                                   Type: Void
+--E
+
+--S 175
+harm(1023)
+--R   Compiling function harm with type Integer -> Fraction Integer 
+--R   Compiling function harm as a recurrence relation.
+--R
+--R   (4)
+--R    56918929836783747778186562994910417364284519936484803738256503363047591584_
+--R     2733402533503384016070102378254838554019021072460441324115730731899754524_
+--R     3051637047716166927952839924926898113855910441901034429495456850574721819_
+--R     0959291999714039498339199810512595613399980225816207570338522992407348206_
+--R     8458996501642275777927445608416707051265982507444007863105751583310646982_
+--R     3197880912123301992627534179914738912810939235218743092316208657821544413_
+--R     7507111
+--R  /
+--R    75809030906834453523777687598142141106414192506285711254121803198491495253_
+--R     8828569124484088941284219071465702944545255084351101237230340026626588247_
+--R     6367291194600696876416243191521584529737974727209031624214028323361847170_
+--R     9764957043186933388156027004157275042770718773974970630837005685761111898_
+--R     3824612373575784564285126841732340269099782510311467722310664215128464192_
+--R     0090417465131869897386008931792841181410706392968052396422445537614139284_
+--R     160000
+--R                                                       Type: Fraction Integer
+--E
+
+--S 176
+harm(1024)
+--R
+--R   (5)
+--R    11385266612491648666057698881942984686550388639494349140449232739078238853_
+--R     8713454502191389383076154933054707275314439864005454497269185801458595955_
+--R     4127443958199377930451435489735214028719028533199097687298001800355635024_
+--R     8967439746760057644460577384504944069458175160764295712712838133748769663_
+--R     0859452124788876557627760315566968995024077356615956093475101696822581124_
+--R     2802077948390776255359440156469896861491512274902986275736609357453715408_
+--R     90803597
+--R  /
+--R    15161806181366890704755537519628428221282838501257142250824360639698299050_
+--R     7765713824896817788256843814293140588909051016870220247446068005325317649_
+--R     5273458238920139375283248638304316905947594945441806324842805664672369434_
+--R     1952991408637386677631205400831455008554143754794994126167401137152222379_
+--R     6764922474715156912857025368346468053819956502062293544462132843025692838_
+--R     4018083493026373979477201786358568236282141278593610479284489107522827856_
+--R     8320000
+--R                                                       Type: Fraction Integer
+--E
+
+@
+williams@inf.ethz.ch/9/1/93 (Clifton Williamson)
+
+We should probably support integrate(%,x) on series types.
+x could be either the variable of expansion or a parameter variable.
+
+We've discussed this before with regard to the function 'differentiate'.
+The technical problem is that ``generalized'' power series may have
+``coefficients'' involving the series variable:
+<<*>>=
+)clear all
+
+--S 177
+t1:=series(x**x,x=0)
+--R
+--R   (1)
+--R                         2            3            4            5
+--R                   log(x)   2   log(x)   3   log(x)   4   log(x)   5
+--R     1 + log(x)x + ------- x  + ------- x  + ------- x  + ------- x
+--R                      2            6            24          120
+--R   + 
+--R           6            7            8            9            10
+--R     log(x)   6   log(x)   7   log(x)   8   log(x)   9   log(x)    10      11
+--R     ------- x  + ------- x  + ------- x  + ------- x  + -------- x   + O(x  )
+--R       720          5040        40320        362880       3628800
+--R                   Type: GeneralUnivariatePowerSeries(Expression Integer,x,0)
+--E
+
+@
+In this case, as currently implemented, 'differentiate' returns incorrect
+answers:
+<<*>>=
+
+--S 178
+differentiate t1
+ 
+   >> Error detected within library code:
+   "'differentiate' unavailable on this domain;  use 'approximate' first"
+
+--E
+
+@
+The solution we discussed (perhaps ``resolution'' is a better word) was to
+create a separate series type for generalized series.  This would be a
+carbon copy of UPXS, except that differentiate(series,variable(series)) and
+integrate(series,variable(series)) would return an error message.  The
+error message could also suggest that the user first apply 'approximate',
+then compute a derivative or integral.  We would also have a coercion from
+UPXS to this type.  The function 'series' would return a UPXS, when the
+coefficients do not involve the series variable, and a ``generalized series'',
+when the coefficients involve the series variable.
+
+If this sounds cool to you, I'll go ahead with it when I have time.  (I'm
+trying to meet a 16 September deadline for a MEGA '94 submission.  I'm still
+getting my results together, so time is tight.  Let me know if there is a
+time deadline for the AXIOM code!)
+
+Also we need better tools for taking finite truncations of series objects.
+In particular since we now mostly use series(expr,var) to create a series,
+UPXS if over a coefficient domain which supports the symbol of expansion,
+should be able to truncate a series to an EXPR.
+
+I thought I had you on this one!  The signature is there (in pscat.spad):
+\begin{verbatim}
+    if Coef has coerce: Symbol -> Coef then
+      if Coef has "**":(Coef,Expon) -> Coef then
+        approximate: ($,Expon) -> Coef
+          ++ \spad{approximate(f)} returns a truncated power series with the
+          ++ series variable viewed as an element of the coefficient domain.
+\end{verbatim}
+It certainly works for Laurent series:
+<<*>>=
+)clear all
+
+--S 179
+t1:=laurent(cos(a+x)/x,x=0)
+--R
+--R   (1)
+--R            - 1            cos(a)     sin(a)  2   cos(a)  3   sin(a)  4
+--R     cos(a)x    - sin(a) - ------ x + ------ x  + ------ x  - ------ x
+--R                              2          6          24          120
+--R   + 
+--R       cos(a)  5   sin(a)  6   cos(a)  7   sin(a)  8    cos(a)  9      10
+--R     - ------ x  + ------ x  + ------ x  - ------ x  - ------- x  + O(x  )
+--R         720        5040        40320      362880      3628800
+--R                        Type: UnivariateLaurentSeries(Expression Integer,x,0)
+--E
+
+--S 180
+approximate(t1,3)
+--R
+--R           3                  4      2
+--R        (4x  - 24x)sin(a) + (x  - 12x  + 24)cos(a)
+--R   (2)  ------------------------------------------
+--R                            24x
+--R                                                     Type: Expression Integer
+--E
+
+@
+But, unfortunately, I never implemented it for Puiseux series:
+<<*>>=
+
+--S 181
+t2:=puiseux(cos(a+x)/x,x=0)
+--R
+--R   (3)
+--R            - 1            cos(a)     sin(a)  2   cos(a)  3   sin(a)  4
+--R     cos(a)x    - sin(a) - ------ x + ------ x  + ------ x  - ------ x
+--R                              2          6          24          120
+--R   + 
+--R       cos(a)  5   sin(a)  6   cos(a)  7   sin(a)  8    cos(a)  9      10
+--R     - ------ x  + ------ x  + ------ x  - ------ x  - ------- x  + O(x  )
+--R         720        5040        40320      362880      3628800
+--R                        Type: UnivariatePuiseuxSeries(Expression Integer,x,0)
+--E
+
+--S 182
+approximate(t2,3)
+--R
+--R           3                  4      2
+--R        (4x  - 24x)sin(a) + (x  - 12x  + 24)cos(a)
+--R   (4)  ------------------------------------------
+--R                            24x
+--R                                                     Type: Expression Integer
+--E
+
+--S 183
+t3:=series(cos(x**(2/3) + a),x=0)
+--R
+--R   (5)
+--R                   2           4                       8           10      11
+--R                   -           -                       -           --      --
+--R                   3   cos(a)  3   sin(a)  2   cos(a)  3   sin(a)   3       3
+--R   cos(a) - sin(a)x  - ------ x  + ------ x  + ------ x  - ------ x   + O(x  )
+--R                          2           6          24          120
+--R                        Type: UnivariatePuiseuxSeries(Expression Integer,x,0)
+--E
+
+--S 184
+approximate(t3,2)
+--R
+--R                 3+-+2            3+-+    2
+--R        - 6sin(a)\|x   - 3x cos(a)\|x  + x sin(a) + 6cos(a)
+--R   (6)  ---------------------------------------------------
+--R                                 6
+--R                                                     Type: Expression Integer
+--E
+
+--S 185
+approximate(t1,7)
+--R
+--R   (7)
+--R          7       5        3
+--R       (8x  - 336x  + 6720x  - 40320x)sin(a)
+--R     + 
+--R         8      6        4         2
+--R       (x  - 56x  + 1680x  - 20160x  + 40320)cos(a)
+--R  /
+--R     40320x
+--R                                                     Type: Expression Integer
+--E
+
+@
+bronstei@inf.ethz.ch/10/6/93 (manuel bronstein)
+
+Here is algfunc.spad with an old bug fixed: eventh-roots of negative floats
+coerced to EXPR FLOAT (e.g. sqrt(-1::EXPR FLOAT)) used to produced an error
+message since the sqrt from FLOAT was called. 
+
+I have now fixed iroot from AF(R,)
+to call the sqrt from R only if either R is algebraically closed, or the
+root is odd, or the argument is positive. Here's the new behaviour:
+<<*>>=
+)clear all
+
+--S 186
 sqrt(-1::EXPR FLOAT)
+--R
+--R         +-----+
+--R   (1)  \|- 1.0
+--R                                                       Type: Expression Float
+--E
+
+--S 187
 sqrt(2::EXPR FLOAT)
+--R
+--R   (2)  1.4142135623 730950488
+--R                                                       Type: Expression Float
+--E
+
+--S 188
 nthRoot(-2::EXPR FLOAT, 3)
+--R
+--R   (3)  - 1.2599210498 948731648
+--R                                                       Type: Expression Float
+--E
+
+--S 189
 nthRoot(-2::EXPR FLOAT, 4)
---As a side-effect, this fixes the problem with numeric
--- (which was instantiating sqrt(-1)$EXPR(FLOAT)).
+--R
+--R        4+-----+
+--R   (4)  \|- 2.0
+--R                                                       Type: Expression Float
+--E
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/9/22/93 (manuel bronstein)
--------------------------------------------------------------------
-)clear all
---Here is a (rather major) bug fix to ffactor in FSUPFACT.nrlib. It causes
---a large family of integrals to return 0, because ffactor(?**2+expr) returned
---?**2 when expr involved a parameter. This is fixed now.
+@
+As a side-effect, this fixes the problem with numeric
+(which was instantiating sqrt(-1)\$EXPR(FLOAT)).
+
+bronstei@inf.ethz.ch/9/22/93 (manuel bronstein)
+
+Here is a (rather major) bug fix to ffactor in FSUPFACT.nrlib. It causes
+a large family of integrals to return 0, because ffactor(?**2+expr) returned
+?**2 when expr involved a parameter. This is fixed now.
+
+jhd@maths.bath.ac.uk/8/15/93 James Davenport
+
+\begin{verbatim}
+   (1)
+   VCONCAT
+                             log(x)
+                       atan(---------)
+                             +------+
+                             | 2
+           2                \|a  - 1
+      ((- a  + 1<0) -> ---------------)
+                           +------+
+                           | 2
+                          \|a  - 1
+  ,
+      PAREN
+               2
+           (- a  + 1>0)
+         ->
+                                      +--------+
+                          2    2      |   2           2
+               log((log(x)  - a  + 1)\|- a  + 1  + (2a  - 2)log(x))
+             +
+                           2    2
+               - log(log(x)  + a  - 1)
+          /
+               +--------+
+               |   2
+             2\|- a  + 1
+  ,
+                            1
+      ( Or (a - 1=0) -> - ------)
+           (a + 1=0)      log(x)
+                                          Type: ConditionalExpression Integer
+
+\end{verbatim}
+is still fairly ugly.
 
--------------------------------------------------------------------
--- jhd@maths.bath.ac.uk/8/15/93 James Davenport
--------------------------------------------------------------------
+<<*>>=
 )clear all
+
+--S 190
 integrate(1/(x*(log(x)**2+a**2-1)),x)
---   (1)
---   VCONCAT
---                             log(x)
---                       atan(---------)
---                             +------+
---                             | 2
---           2                \|a  - 1
---      ((- a  + 1<0) -> ---------------)
---                           +------+
---                           | 2
---                          \|a  - 1
---  ,
---      PAREN
---               2
---           (- a  + 1>0)
---         ->
---                                      +--------+
---                          2    2      |   2           2
---               log((log(x)  - a  + 1)\|- a  + 1  + (2a  - 2)log(x))
---             +
---                           2    2
---               - log(log(x)  + a  - 1)
---          /
---               +--------+
---               |   2
---             2\|- a  + 1
---  ,
---                            1
---      ( Or (a - 1=0) -> - ------)
---           (a + 1=0)      log(x)
---                                          Type: ConditionalExpression Integer
---
---is still fairly ugly.
+--R
+--R   (1)
+--R                           +--------+                                +------+
+--R               2    2      |   2           2                         | 2
+--R        (log(x)  - a  + 1)\|- a  + 1  + (2a  - 2)log(x)       log(x)\|a  - 1
+--R    log(-----------------------------------------------) atan(---------------)
+--R                              2    2                                2
+--R                        log(x)  + a  - 1                           a  - 1
+--R   [----------------------------------------------------,---------------------]
+--R                          +--------+                            +------+
+--R                          |   2                                 | 2
+--R                        2\|- a  + 1                            \|a  - 1
+--R                                     Type: Union(List Expression Integer,...)
+--E
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/8/9/93 (manuel bronstein)
--------------------------------------------------------------------
+@
+bronstei@inf.ethz.ch/8/9/93 (manuel bronstein)
+
+Here is efstruc.spad with a change to normalize so that
+this now returns  2**(1/4) ** 2 + 2**(1/4)
+<<*>>=
 )clear all
---Here is efstruc.spad with a change to normalize so that
-normalize(2**(1/2) + 2**(1/4)) now returns  2**(1/4) ** 2 + 2**(1/4).
 
+--S 191
+normalize(2**(1/2) + 2**(1/4)) 
+--R
+--R        4+-+2   4+-+
+--R   (1)  \|2   + \|2
+--R                                                     Type: Expression Integer
+--E
 
--------------------------------------------------------------------
--- satoshi@yktvmv.vnet.ibm.com/8/7/93 satoshi hamaguchi
--------------------------------------------------------------------
+@
+
+satoshi@yktvmv.vnet.ibm.com/8/7/93 satoshi hamaguchi
+
+In axiom, both of these yield a warning ``potentialPole''.
+If I use ``noPole'' they give the right answer.
+Isn't this a bug?
+<<*>>=
 )clear all
--- In axiom, both
-  integrate(%e**x,x=0..1)
---and
-  integrate(log(x),x=1..2)
---yield a warning  potentialPole    .
---If I use "noPole", they give right answers. Isn't this a bug?
---... Satoshi
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/8/5/93 (manuel bronstein)
--------------------------------------------------------------------
+--S 912
+integrate(%e**x,x=0..1)
+--R
+--R   (1)  %e - 1
+--R                    Type: Union(f1: OrderedCompletion Expression Integer,...)
+--E
+
+--S 913
+integrate(log(x),x=1..2)
+--R
+--R   (2)  log(4) - 1
+--R                    Type: Union(f1: OrderedCompletion Expression Integer,...)
+--E
+
+@
+
+bronstei@inf.ethz.ch/8/5/93 (manuel bronstein)
+
+This will return 2**(5/6).
+<<*>>=
 )clear all
-simplify(2**(1/3)*2**(1/2)) -- will return 2**(5/6).
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/8/4/93 (manuel bronstein)
--------------------------------------------------------------------
+--S 194
+simplify(2**(1/3)*2**(1/2)) -- 
+--R
+--R        6+-+5
+--R   (1)  \|2
+--R                                                     Type: Expression Integer
+--E
+
+@
+bronstei@inf.ethz.ch/8/4/93 (manuel bronstein)
+<<*>>=
 )clear all
+
+--S 195
 integrate(1/sqrt(1+cos(x)), x)
+--R
+--R                  +-+       +----------+         2
+--R         +-+    2\|2 sin(x)\|cos(x) + 1  - cos(x)  + 2cos(x) + 3
+--R        \|2 log(------------------------------------------------)
+--R                                    2
+--R                              cos(x)  + 2cos(x) + 1
+--R   (1)  ---------------------------------------------------------
+--R                                    2
+--R                                          Type: Union(Expression Integer,...)
+--E
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/8/4/93 (manuel bronstein)
--------------------------------------------------------------------
+@
+bronstei@inf.ethz.ch/8/4/93 (manuel bronstein)
+
+This used to be division by 0 error
+<<*>>=
 )clear all
-normalize atan(cos(x)/sin(x))  -- used to be division by 0 error
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/8/4/93 (manuel bronstein)
--------------------------------------------------------------------
+--S 196
+normalize atan(cos(x)/sin(x))
+--R
+--R        - 2x + %pi
+--R   (1)  ----------
+--R             2
+--R                                                     Type: Expression Integer
+--E
+
+@
+
+bronstei@inf.ethz.ch/8/4/93 (manuel bronstein)
+<<*>>=
 )clear all
+
+--S 197
 a := 2**(1/6)
+--R
+--R        6+-+
+--R   (1)  \|2
+--R                                                        Type: AlgebraicNumber
+--E
+
+--S 198
 [a**n for n in 2..13]
+--R
+--R         6+-+2 6+-+3 6+-+4 6+-+5    6+-+  6+-+2  6+-+3  6+-+4  6+-+5    6+-+
+--R   (2)  [\|2  ,\|2  ,\|2  ,\|2  ,2,2\|2 ,2\|2  ,2\|2  ,2\|2  ,2\|2  ,4,4\|2 ]
+--R                                                   Type: List AlgebraicNumber
+--E
+
+@
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/8/4/93 (manuel bronstein)
--------------------------------------------------------------------
+bronstei@inf.ethz.ch/8/4/93 (manuel bronstein)
+<<*>>=
 )clear all
+
+--S 199
 int:=sqrt(a*(1-u**2)/(1+u**2))/u
-integrate(eval(int,a=1),u) -- works
-integrate(eval(int,a=sqrt(-1)),u) -- seems to run forever
-integrate(eval(int,a=1)*(-1)**(1/4),u) -- dies after a long time
- -- with an elt index error.
+--R
+--R         +----------+
+--R         |     2
+--R         |- a u  + a
+--R         |----------
+--R         |   2
+--R        \|  u  + 1
+--R   (1)  -------------
+--R              u
+--R                                                     Type: Expression Integer
+--E
+
+--S 200
+integrate(eval(int,a=1),u) 
+--R
+--R                     +--------+                       +--------+
+--R                     |   2                            |   2
+--R              2      |- u  + 1                 2      |- u  + 1
+--R            (u  + 1) |--------  - 1          (u  + 1) |--------  - 1
+--R                     |  2                             |  2
+--R                    \| u  + 1                        \| u  + 1
+--R        log(-----------------------) + 2atan(-----------------------)
+--R                        2                                2
+--R                       u                                u
+--R   (2)  -------------------------------------------------------------
+--R                                      2
+--R                                          Type: Union(Expression Integer,...)
+--E
+
+@
+Runs forever?
+<<*>>=
+--S 201
+integrate(eval(int,a=sqrt(-1)),u)
+--R
+--R   (3)
+--R             +---+      +-+
+--R         (- \|- 1  + 1)\|2
+--R      *
+--R                                +----------------+
+--R                                |    2      +---+
+--R               2      +---+ +-+ |(- u  + 1)\|- 1       2      +---+    2
+--R             (u  + 1)\|- 1 \|2  |----------------  + (u  - 1)\|- 1  + u  + 1
+--R                                |      2
+--R                               \|     u  + 1
+--R         log(---------------------------------------------------------------)
+--R                                        2 +---+ +-+
+--R                                       u \|- 1 \|2
+--R     + 
+--R                                              +----------------+
+--R                                              |    2      +---+
+--R                             2      +---+ +-+ |(- u  + 1)\|- 1      +---+
+--R                           (u  + 1)\|- 1 \|2  |----------------  - \|- 1  + 1
+--R                                              |      2
+--R         +---+      +-+                      \|     u  + 1
+--R       (\|- 1  + 1)\|2 log(--------------------------------------------------)
+--R                                               2 +---+ +-+
+--R                                              u \|- 1 \|2
+--R     + 
+--R           +---+      +-+
+--R         (\|- 1  - 1)\|2
+--R      *
+--R                                +----------------+
+--R                                |    2      +---+
+--R               2      +---+ +-+ |(- u  + 1)\|- 1         2      +---+    2
+--R             (u  + 1)\|- 1 \|2  |----------------  + (- u  - 1)\|- 1  - u  + 1
+--R                                |      2
+--R                               \|     u  + 1
+--R         log(-----------------------------------------------------------------)
+--R                                         2 +---+ +-+
+--R                                        u \|- 1 \|2
+--R  /
+--R     4
+--R                                          Type: Union(Expression Integer,...)
+--E
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/8/4/93 (manuel bronstein)
--------------------------------------------------------------------
+@
+Dies after a long time with an elt index error
+<<*>>=
+--S 202
+integrate(eval(int,a=1)*(-1)**(1/4),u)
+--R
+--R   (4)
+--R                                            +--------+
+--R                                            |   2
+--R                               2      +---+ |- u  + 1     +---+    2
+--R                             (u  + 1)\|- 1  |--------  - \|- 1  + u
+--R                                            |  2
+--R           +---+      +-+                  \| u  + 1
+--R       (- \|- 1  + 1)\|2 log(---------------------------------------)
+--R                                              2 +---+
+--R                                             u \|- 1
+--R     + 
+--R                                    +--------+
+--R                                    |   2
+--R                             2      |- u  + 1
+--R                           (u  + 1) |--------  - 1
+--R                                    |  2
+--R         +---+      +-+            \| u  + 1
+--R       (\|- 1  + 1)\|2 log(-----------------------)
+--R                                       2
+--R                                      u
+--R     + 
+--R                                          +--------+
+--R                                          |   2
+--R                             2      +---+ |- u  + 1     +---+    2
+--R                           (u  + 1)\|- 1  |--------  - \|- 1  - u
+--R                                          |  2
+--R         +---+      +-+                  \| u  + 1
+--R       (\|- 1  - 1)\|2 log(---------------------------------------)
+--R                                            2 +---+
+--R                                           u \|- 1
+--R  /
+--R     4
+--R                                          Type: Union(Expression Integer,...)
+--E
+
+@
+bronstei@inf.ethz.ch/8/4/93 (manuel bronstein)
+<<*>>=
 )clear all
-sqrt((1-x**2)*(1-k**2*x**2))
-integrate(x/%,x)
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/7/26/93 (manuel bronstein)
--------------------------------------------------------------------
+--S 203
+t1:=sqrt((1-x**2)*(1-k**2*x**2))
+--R
+--R         +-----------------------+
+--R         | 2 4       2      2
+--R   (1)  \|k x  + (- k  - 1)x  + 1
+--R                                                     Type: Expression Integer
+--E
+
+--S 204
+integrate(x/t1,x)
+--R
+--R                 +-----------------------+
+--R                 | 2 4       2      2          2 2    2
+--R          log(2k\|k x  + (- k  - 1)x  + 1  - 2k x  + k  + 1)
+--R   (2)  - --------------------------------------------------
+--R                                  2k
+--R                                          Type: Union(Expression Integer,...)
+--E
+
+@
+bronstei@inf.ethz.ch/7/26/93 (manuel bronstein)
+<<*>>=
 )clear all
-rad:=last zerosOf((2+y)**8-3,y)
-k:=first kernels %
-eval(rad,k,rad)
 
--------------------------------------------------------------------
--- nagttt@vax.ox.ac.uk/7/15/93 themos tsikas
--------------------------------------------------------------------
+--S 205
+t1:=last zerosOf((2+y)**8-3,y)
+--R
+--R           +-------------+
+--R           |    +-------+
+--R           |    |    +-+
+--R        - \|- 2\|- 4\|3    - 4
+--R   (1)  ----------------------
+--R                   2
+--R                                                     Type: Expression Integer
+--E
+
+--S 206
+k:=first kernels t1
+--R
+--R         +-------------+
+--R         |    +-------+
+--R         |    |    +-+
+--R   (2)  \|- 2\|- 4\|3
+--R                                              Type: Kernel Expression Integer
+--E
+
+--S 207
+eval(t1,k,t1)
+--R
+--R         +-------------+
+--R         |    +-------+
+--R         |    |    +-+
+--R        \|- 2\|- 4\|3    - 4
+--R   (3)  --------------------
+--R                  4
+--R                                                     Type: Expression Integer
+--E
+
+@
+nagttt@vax.ox.ac.uk/7/15/93 themos tsikas
+<<*>>=
 )clear all
+
+--S 208
 f := (x - y) / (x + y)
+--R
+--R        - y + x
+--R   (1)  -------
+--R         y + x
+--R                                            Type: Fraction Polynomial Integer
+--E
+
+--S 209
 eval(f,x=1/x)
+--R
+--R        - x y + 1
+--R   (2)  ---------
+--R         x y + 1
+--R                                            Type: Fraction Polynomial Integer
+--E
+
+@
+nagttt@vax.ox.ac.uk/7/15/93 themos tsikas
 
--------------------------------------------------------------------
--- nagttt@vax.ox.ac.uk/7/15/93 themos tsikas
--------------------------------------------------------------------
+I claim that these two should give the same result (they do in Reduce):
+(precision was 200)
+
+<<*>>=
 )clear all
+
+--S 210
 digits 200
---I claim that these two should give the same result (they do in Reduce):
---(precision was 200)
+--R
+--R   (1)  20
+--R                                                        Type: PositiveInteger
+--E
+
+--S 211
 a:=4*sin(2*%pi/9)*sin(5*%pi/9)/sqrt(3)
+--R
+--R             2%pi     5%pi
+--R        4sin(----)sin(----)
+--R               9        9
+--R   (2)  -------------------
+--R                 +-+
+--R                \|3
+--R                                                     Type: Expression Integer
+--E
+
+--S 212
 b:=1/(2*sin(%pi/9))
+--R
+--R            1
+--R   (3)  ---------
+--R             %pi
+--R        2sin(---)
+--R              9
+--R                                                     Type: Expression Integer
+--E
+
+--S 213
 a::EXPR FLOAT
-b::EXPR FLOAT                                 
-
--------------------------------------------------------------------
--- bmt@spadserv.watson.ibm.com/9/15/93 (Barry Trager)
--------------------------------------------------------------------
+--R
+--R   (4)
+--R  1.4619022000 8154362611 6377206683 1458519367 5283075946 2240855318 493177672
+--R  5 8139967590 4919627790 5155131563 5927196029 5136978338 4351923544 366777748
+--R  4 3145835284 9347399264 0517928099 4530246377 7454860377 762537213
+--R                                                       Type: Expression Float
+--E
+
+--S 214
+b::EXPR FLOAT
+--R
+--R   (5)
+--R  1.4619022000 8154362611 6377206683 1458519367 5283075946 2240855318 493177672
+--R  5 8139967590 4919627790 5155131563 5927196029 5136978338 4351923544 366777748
+--R  4 3145835284 9347399264 0517928099 4530246377 7454860377 762537213
+--R                                                       Type: Expression Float
+--E
+
+--S 215
+digits 20
+--R
+--R   (6)  200
+--R                                                        Type: PositiveInteger
+--E
+@
+bmt@spadserv.watson.ibm.com/9/15/93 (Barry Trager)
+<<*>>=
 )clear all
+
+--S 216
 limit(tanh(x),x=%plusInfinity)
+--R
+--R   (1)  1
+--R                        Type: Union(OrderedCompletion Expression Integer,...)
+--E
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/6/14/93 (manuel bronstein)
--------------------------------------------------------------------
+@
+bronstei@inf.ethz.ch/6/14/93 (manuel bronstein)
+<<*>>=
 )clear all
+
+--S 217
 a := x::EXPR INT
+--R
+--R   (1)  x
+--R                                                     Type: Expression Integer
+--E
+
+--S 218
 b := x::EXPR COMPLEX INT
+--R
+--R   (2)  x
+--R                                             Type: Expression Complex Integer
+--E
+
+--S 219
 zeroOf(a**4+1,x)
+--R
+--R         +---+
+--R        \|- 1  + 1
+--R   (3)  ----------
+--R            +-+
+--R           \|2
+--R                                                     Type: Expression Integer
+--E
+
+--S 220
 zeroOf(b**4+1,x)
+--R
+--R        1 + %i
+--R   (4)  ------
+--R          +-+
+--R         \|2
+--R                                             Type: Expression Complex Integer
+--E
+
+@
+bronstei@inf.ethz.ch/6/11/93 (manuel bronstein)
+
+Now returns 0  (was crashing before)
+<<*>>=
+)clear all
+
+--S 221
+normalize(0**a)
+--R
+--R   (1)  0
+--R                                                     Type: Expression Integer
+--E
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/6/11/93 (manuel bronstein)
--------------------------------------------------------------------
+@
+bronstei@inf.ethz.ch/6/11/93 (manuel bronstein)
+
+New export ``complexForm(f)'' which returns the rectangular complex form of f:
+<<*>>=
 )clear all
-normalize(0**a) -- now returns 0  (was crashing before)
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/6/11/93 (manuel bronstein)
--------------------------------------------------------------------
+--S 222
+t1:=log(a+%i * b)
+--R
+--R   (1)  log(%i b + a)
+--R                                             Type: Expression Complex Integer
+--E
+
+--S 223
+complexForm t1
+--R
+--R             2    2
+--R        log(b  + a )        b
+--R   (2)  ------------ + atan(-)%i
+--R              2             a
+--R                                             Type: Complex Expression Integer
+--E
+
+--S 224
+t2:=complexIntegrate(1/(x-%i),x)
+--R
+--R   (3)  log(x - %i)
+--R                                             Type: Expression Complex Integer
+--E
+
+--S 225
+complexForm t2
+--R
+--R             2
+--R        log(x  + 1)        1
+--R   (4)  ----------- - atan(-)%i
+--R             2             x
+--R                                             Type: Complex Expression Integer
+--E
+
+@
+jcf@posso.ibp.fr
+
+normalForm est faux pour les polynomes a coef dans un anneau:
+<<*>>=
 )clear all
--  new export  complexForm(f)  which returns the rectangular complex form of f:
-log(a+%i * b)
-complexForm %
-complexIntegrate(1/(x-%i),x)
-complexForm %
 
--------------------------------------------------------------------
--- jcf@posso.ibp.fr
--------------------------------------------------------------------
---  normalForm est faux pour les polynomes a coef dans un anneau:
+--S 226
 D:=DMP([a,b],INT)
+--R
+--R   (1)  DistributedMultivariatePolynomial([a,b],Integer)
+--R                                                                 Type: Domain
+--E
+
+--S 227
 l:List D:=[2*a-1,b-a]
+--R
+--R   (2)  [2a - 1,- a + b]
+--R                  Type: List DistributedMultivariatePolynomial([a,b],Integer)
+--E
+
+--S 228
 g:=groebner l
+--R
+--R   (3)  [2a - 1,2b - 1]
+--R                  Type: List DistributedMultivariatePolynomial([a,b],Integer)
+--E
+
+--S 229
 p:D:=a
+--R
+--R   (4)  a
+--R                       Type: DistributedMultivariatePolynomial([a,b],Integer)
+--E
+
+@
+Was 1, au lieu de 1/2 !!
+<<*>>=
+--S 230
 normalForm(p,g)
--- was  1
---   au lieu de 1/2 !!
+--R
+--R        1
+--R   (5)  -
+--R        2
+--R              Type: DistributedMultivariatePolynomial([a,b],Fraction Integer)
+--E
 
--------------------------------------------------------------------
--- nagttt@vax.ox.ac.uk/6/9/93 themos tsikas
--------------------------------------------------------------------
+@
+nagttt@vax.ox.ac.uk/6/9/93 themos tsikas
+<<*>>=
 )clear all
+
+--S 231
 squareFreePart(50)
+--R
+--R   (1)  10
+--R                                                        Type: PositiveInteger
+--E
+
+@
 
--------------------------------------------------------------------
--- mcd@maths.bath.ac.uk/6/4/92 mike dewar
--------------------------------------------------------------------
+mcd@maths.bath.ac.uk/6/4/92 mike dewar
+<<*>>=
 )clear all
+
+--S 232
 f:=complexIntegrate(1/((x-%i)*(x-2*%i)),x)
+--R
+--R   (1)  %i log(x - %i) - %i log(x - 2%i)
+--R                                             Type: Expression Complex Integer
+--E
+
+--S 233
 g:=subst(f,x=1)
+--R
+--R   (2)  %i log(1 - %i) - %i log(1 - 2%i)
+--R                                             Type: Expression Complex Integer
+--E
+
+--S 234
 imag g
+--R
+--R        - log(5) + log(2)
+--R   (3)  -----------------
+--R                2
+--R                                                     Type: Expression Integer
+--E
 
--------------------------------------------------------------------
--- daly
--------------------------------------------------------------------
+@
+daly - not wrong but the order is obscure...
+<<*>>=
 )clear all
--- not wrong but the order is obscure...
+
+--S 235
 primes(1,10)
+--R
+--R   (1)  [2,7,5,3]
+--R                                                           Type: List Integer
+--E
 
--------------------------------------------------------------------
--- nagttt@vax.ox.ac.uk/1/11/93 themos tsikas
--------------------------------------------------------------------
+@
+nagttt@vax.ox.ac.uk/1/11/93 themos tsikas
+<<*>>=
 )clear all
+
+--S 236
 m:=matrix[[1,a,0],[b,0,a],[0,b,c]]
+--R
+--R        +1  a  0+
+--R        |       |
+--R   (1)  |b  0  a|
+--R        |       |
+--R        +0  b  c+
+--R                                              Type: Matrix Polynomial Integer
+--E
+
+@
+This ends in error:
+Internal system problem in function appInfix : fewer than 2 arguments to
+an infix function
+<<*>>=
+--S 237
 ll:=radicalEigenvectors m
--- ends in error:
--- Internal system problem in function appInfix : fewer than 2 arguments to
--- an infix function
---
--- but this works
+--R
+--R   (2)
+--R   [
+--R     [
+--R       radval =
+--R               9
+--R            *
+--R                 ROOT
+--R                          9
+--R                       *
+--R                          ROOT
+--R                                            4              3
+--R                               (- 4a b - 1)c  + (6a b + 2)c
+--R                             + 
+--R                                     2 2             2       2 2
+--R                               (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c
+--R                             + 
+--R                                    3 3      2 2
+--R                               - 32a b  - 13a b  - 4a b
+--R                      + 
+--R                           3     2                             +-+
+--R                        (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                   /
+--R                         +-+
+--R                      54\|3
+--R                ,
+--R                    3
+--R              **
+--R                 2
+--R           + 
+--R               (3c + 3)
+--R            *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R           + 
+--R              2
+--R             c  - c + 6a b + 1
+--R        /
+--R             9
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R       ,
+--R      radmult= 1,
+--R
+--R       radvect =
+--R         [
+--R   [
+--R     [
+--R                                  +-+
+--R             (- 18c + 18a b + 18)\|3
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R                 9
+--R              *
+--R                 ROOT
+--R                                   4              3         2 2             2
+--R                      (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                    + 
+--R                          2 2               3 3      2 2
+--R                      (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R             + 
+--R                  2                               +-+
+--R               (3c  + (- 21a b - 9)c + 15a b + 6)\|3
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R             (- 3c + 6)
+--R          *
+--R             ROOT
+--R                               4              3         2 2             2
+--R                  (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                + 
+--R                      2 2               3 3      2 2
+--R                  (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R         + 
+--R             3               2                       2 2             +-+
+--R           (c  + (11a b + 1)c  + (- 11a b - 4)c + 24a b  + 2a b + 2)\|3
+--R      /
+--R              2 +-+
+--R           54b \|3
+--R        *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R          **
+--R             2
+--R       ]
+--R     ,
+--R
+--R     [
+--R             9
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R             (- 6c + 3)
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R            2
+--R           c  - c + 6a b + 1
+--R      /
+--R           9b
+--R        *
+--R           ROOT
+--R                    9
+--R                 *
+--R                    ROOT
+--R                                      4              3         2 2             2
+--R                         (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                       + 
+--R                             2 2               3 3      2 2
+--R                         (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R                + 
+--R                     3     2                             +-+
+--R                  (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R             /
+--R                   +-+
+--R                54\|3
+--R          ,
+--R              3
+--R       ]
+--R     ,
+--R    [1]]
+--R           ]
+--R       ]
+--R     ,
+--R
+--R     [
+--R       radval =
+--R                    +---+
+--R               (- 9\|- 3  - 9)
+--R            *
+--R                 ROOT
+--R                          9
+--R                       *
+--R                          ROOT
+--R                                            4              3
+--R                               (- 4a b - 1)c  + (6a b + 2)c
+--R                             + 
+--R                                     2 2             2       2 2
+--R                               (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c
+--R                             + 
+--R                                    3 3      2 2
+--R                               - 32a b  - 13a b  - 4a b
+--R                      + 
+--R                           3     2                             +-+
+--R                        (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                   /
+--R                         +-+
+--R                      54\|3
+--R                ,
+--R                    3
+--R              **
+--R                 2
+--R           + 
+--R                         +---+
+--R               ((3c + 3)\|- 3  - 3c - 3)
+--R            *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R           + 
+--R               2
+--R             2c  - 2c + 12a b + 2
+--R        /
+--R                +---+
+--R             (9\|- 3  - 9)
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R       ,
+--R      radmult= 1,
+--R
+--R       radvect =
+--R         [
+--R   [
+--R     [
+--R                                  +-+
+--R             (- 36c + 36a b + 36)\|3
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R                      +---+
+--R                 (- 9\|- 3  - 9)
+--R              *
+--R                 ROOT
+--R                                   4              3         2 2             2
+--R                      (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                    + 
+--R                          2 2               3 3      2 2
+--R                      (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R             + 
+--R                        2                             +---+     2
+--R                   (- 3c  + (21a b + 9)c - 15a b - 6)\|- 3  - 3c  + (21a b + 9)c
+--R                 + 
+--R                   - 15a b - 6
+--R              *
+--R                  +-+
+--R                 \|3
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R                         +---+
+--R             ((- 3c + 6)\|- 3  + 3c - 6)
+--R          *
+--R             ROOT
+--R                               4              3         2 2             2
+--R                  (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                + 
+--R                      2 2               3 3      2 2
+--R                  (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R         + 
+--R                 3               2                       2 2             +---+
+--R               (c  + (11a b + 1)c  + (- 11a b - 4)c + 24a b  + 2a b + 2)\|- 3
+--R             + 
+--R                  3                 2                     2 2
+--R               - c  + (- 11a b - 1)c  + (11a b + 4)c - 24a b  - 2a b - 2
+--R          *
+--R              +-+
+--R             \|3
+--R      /
+--R               2 +-+
+--R           108b \|3
+--R        *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R          **
+--R             2
+--R       ]
+--R     ,
+--R
+--R     [
+--R                  +---+
+--R             (- 9\|- 3  - 9)
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R                         +---+
+--R             ((- 6c + 3)\|- 3  + 6c - 3)
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R             2
+--R           2c  - 2c + 12a b + 2
+--R      /
+--R               +---+
+--R           (9b\|- 3  - 9b)
+--R        *
+--R           ROOT
+--R                    9
+--R                 *
+--R                    ROOT
+--R                                      4              3         2 2             2
+--R                         (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                       + 
+--R                             2 2               3 3      2 2
+--R                         (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R                + 
+--R                     3     2                             +-+
+--R                  (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R             /
+--R                   +-+
+--R                54\|3
+--R          ,
+--R              3
+--R       ]
+--R     ,
+--R    [1]]
+--R           ]
+--R       ]
+--R     ,
+--R
+--R     [
+--R       radval =
+--R                    +---+
+--R               (- 9\|- 3  + 9)
+--R            *
+--R                 ROOT
+--R                          9
+--R                       *
+--R                          ROOT
+--R                                            4              3
+--R                               (- 4a b - 1)c  + (6a b + 2)c
+--R                             + 
+--R                                     2 2             2       2 2
+--R                               (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c
+--R                             + 
+--R                                    3 3      2 2
+--R                               - 32a b  - 13a b  - 4a b
+--R                      + 
+--R                           3     2                             +-+
+--R                        (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                   /
+--R                         +-+
+--R                      54\|3
+--R                ,
+--R                    3
+--R              **
+--R                 2
+--R           + 
+--R                         +---+
+--R               ((3c + 3)\|- 3  + 3c + 3)
+--R            *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R           + 
+--R                 2
+--R             - 2c  + 2c - 12a b - 2
+--R        /
+--R                +---+
+--R             (9\|- 3  + 9)
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R       ,
+--R      radmult= 1,
+--R
+--R       radvect =
+--R         [
+--R   [
+--R     [
+--R                                  +-+
+--R             (- 36c + 36a b + 36)\|3
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R                    +---+
+--R                 (9\|- 3  - 9)
+--R              *
+--R                 ROOT
+--R                                   4              3         2 2             2
+--R                      (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                    + 
+--R                          2 2               3 3      2 2
+--R                      (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R             + 
+--R                      2                               +---+     2
+--R                   (3c  + (- 21a b - 9)c + 15a b + 6)\|- 3  - 3c  + (21a b + 9)c
+--R                 + 
+--R                   - 15a b - 6
+--R              *
+--R                  +-+
+--R                 \|3
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R                       +---+
+--R             ((3c - 6)\|- 3  + 3c - 6)
+--R          *
+--R             ROOT
+--R                               4              3         2 2             2
+--R                  (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                + 
+--R                      2 2               3 3      2 2
+--R                  (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R         + 
+--R                   3                 2                     2 2             +---+
+--R               (- c  + (- 11a b - 1)c  + (11a b + 4)c - 24a b  - 2a b - 2)\|- 3
+--R             + 
+--R                  3                 2                     2 2
+--R               - c  + (- 11a b - 1)c  + (11a b + 4)c - 24a b  - 2a b - 2
+--R          *
+--R              +-+
+--R             \|3
+--R      /
+--R               2 +-+
+--R           108b \|3
+--R        *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R          **
+--R             2
+--R       ]
+--R     ,
+--R
+--R     [
+--R                  +---+
+--R             (- 9\|- 3  + 9)
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R                         +---+
+--R             ((- 6c + 3)\|- 3  - 6c + 3)
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R               2
+--R           - 2c  + 2c - 12a b - 2
+--R      /
+--R               +---+
+--R           (9b\|- 3  + 9b)
+--R        *
+--R           ROOT
+--R                    9
+--R                 *
+--R                    ROOT
+--R                                      4              3         2 2             2
+--R                         (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                       + 
+--R                             2 2               3 3      2 2
+--R                         (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R                + 
+--R                     3     2                             +-+
+--R                  (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R             /
+--R                   +-+
+--R                54\|3
+--R          ,
+--R              3
+--R       ]
+--R     ,
+--R    [1]]
+--R           ]
+--R       ]
+--R     ]
+--RType: List Record(radval: Expression Integer,radmult: Integer,radvect: List Matrix Expression Integer)
+--E
+
+@
+but this works
+<<*>>=
+
+--S 238
 ll 1
+--R
+--R   (3)
+--R   [
+--R     radval =
+--R             9
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R             (3c + 3)
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R            2
+--R           c  - c + 6a b + 1
+--R      /
+--R           9
+--R        *
+--R           ROOT
+--R                    9
+--R                 *
+--R                    ROOT
+--R                                      4              3         2 2             2
+--R                         (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                       + 
+--R                             2 2               3 3      2 2
+--R                         (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R                + 
+--R                     3     2                             +-+
+--R                  (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R             /
+--R                   +-+
+--R                54\|3
+--R          ,
+--R              3
+--R     ,
+--R    radmult= 1,
+--R
+--R     radvect =
+--R       [
+--R   [
+--R     [
+--R                                  +-+
+--R             (- 18c + 18a b + 18)\|3
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R                 9
+--R              *
+--R                 ROOT
+--R                                   4              3         2 2             2
+--R                      (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                    + 
+--R                          2 2               3 3      2 2
+--R                      (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R             + 
+--R                  2                               +-+
+--R               (3c  + (- 21a b - 9)c + 15a b + 6)\|3
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R             (- 3c + 6)
+--R          *
+--R             ROOT
+--R                               4              3         2 2             2
+--R                  (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                + 
+--R                      2 2               3 3      2 2
+--R                  (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R         + 
+--R             3               2                       2 2             +-+
+--R           (c  + (11a b + 1)c  + (- 11a b - 4)c + 24a b  + 2a b + 2)\|3
+--R      /
+--R              2 +-+
+--R           54b \|3
+--R        *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R          **
+--R             2
+--R       ]
+--R     ,
+--R
+--R     [
+--R             9
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R             (- 6c + 3)
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R            2
+--R           c  - c + 6a b + 1
+--R      /
+--R           9b
+--R        *
+--R           ROOT
+--R                    9
+--R                 *
+--R                    ROOT
+--R                                      4              3         2 2             2
+--R                         (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                       + 
+--R                             2 2               3 3      2 2
+--R                         (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R                + 
+--R                     3     2                             +-+
+--R                  (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R             /
+--R                   +-+
+--R                54\|3
+--R          ,
+--R              3
+--R       ]
+--R     ,
+--R    [1]]
+--R         ]
+--R     ]
+--RType: Record(radval: Expression Integer,radmult: Integer,radvect: List Matrix Expression Integer)
+--E
+
+--S 239
 ll 2
+--R
+--R   (4)
+--R   [
+--R     radval =
+--R                  +---+
+--R             (- 9\|- 3  - 9)
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R                       +---+
+--R             ((3c + 3)\|- 3  - 3c - 3)
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R             2
+--R           2c  - 2c + 12a b + 2
+--R      /
+--R              +---+
+--R           (9\|- 3  - 9)
+--R        *
+--R           ROOT
+--R                    9
+--R                 *
+--R                    ROOT
+--R                                      4              3         2 2             2
+--R                         (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                       + 
+--R                             2 2               3 3      2 2
+--R                         (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R                + 
+--R                     3     2                             +-+
+--R                  (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R             /
+--R                   +-+
+--R                54\|3
+--R          ,
+--R              3
+--R     ,
+--R    radmult= 1,
+--R
+--R     radvect =
+--R       [
+--R   [
+--R     [
+--R                                  +-+
+--R             (- 36c + 36a b + 36)\|3
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R                      +---+
+--R                 (- 9\|- 3  - 9)
+--R              *
+--R                 ROOT
+--R                                   4              3         2 2             2
+--R                      (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                    + 
+--R                          2 2               3 3      2 2
+--R                      (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R             + 
+--R                        2                             +---+     2
+--R                   (- 3c  + (21a b + 9)c - 15a b - 6)\|- 3  - 3c  + (21a b + 9)c
+--R                 + 
+--R                   - 15a b - 6
+--R              *
+--R                  +-+
+--R                 \|3
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R                         +---+
+--R             ((- 3c + 6)\|- 3  + 3c - 6)
+--R          *
+--R             ROOT
+--R                               4              3         2 2             2
+--R                  (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                + 
+--R                      2 2               3 3      2 2
+--R                  (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R         + 
+--R                 3               2                       2 2             +---+
+--R               (c  + (11a b + 1)c  + (- 11a b - 4)c + 24a b  + 2a b + 2)\|- 3
+--R             + 
+--R                  3                 2                     2 2
+--R               - c  + (- 11a b - 1)c  + (11a b + 4)c - 24a b  - 2a b - 2
+--R          *
+--R              +-+
+--R             \|3
+--R      /
+--R               2 +-+
+--R           108b \|3
+--R        *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R          **
+--R             2
+--R       ]
+--R     ,
+--R
+--R     [
+--R                  +---+
+--R             (- 9\|- 3  - 9)
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R                         +---+
+--R             ((- 6c + 3)\|- 3  + 6c - 3)
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R             2
+--R           2c  - 2c + 12a b + 2
+--R      /
+--R               +---+
+--R           (9b\|- 3  - 9b)
+--R        *
+--R           ROOT
+--R                    9
+--R                 *
+--R                    ROOT
+--R                                      4              3         2 2             2
+--R                         (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                       + 
+--R                             2 2               3 3      2 2
+--R                         (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R                + 
+--R                     3     2                             +-+
+--R                  (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R             /
+--R                   +-+
+--R                54\|3
+--R          ,
+--R              3
+--R       ]
+--R     ,
+--R    [1]]
+--R         ]
+--R     ]
+--RType: Record(radval: Expression Integer,radmult: Integer,radvect: List Matrix Expression Integer)
+--E
+
+--S 240
 ll 3
+--R
+--R   (5)
+--R   [
+--R     radval =
+--R                  +---+
+--R             (- 9\|- 3  + 9)
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R                       +---+
+--R             ((3c + 3)\|- 3  + 3c + 3)
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R               2
+--R           - 2c  + 2c - 12a b - 2
+--R      /
+--R              +---+
+--R           (9\|- 3  + 9)
+--R        *
+--R           ROOT
+--R                    9
+--R                 *
+--R                    ROOT
+--R                                      4              3         2 2             2
+--R                         (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                       + 
+--R                             2 2               3 3      2 2
+--R                         (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R                + 
+--R                     3     2                             +-+
+--R                  (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R             /
+--R                   +-+
+--R                54\|3
+--R          ,
+--R              3
+--R     ,
+--R    radmult= 1,
+--R
+--R     radvect =
+--R       [
+--R   [
+--R     [
+--R                                  +-+
+--R             (- 36c + 36a b + 36)\|3
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R                    +---+
+--R                 (9\|- 3  - 9)
+--R              *
+--R                 ROOT
+--R                                   4              3         2 2             2
+--R                      (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                    + 
+--R                          2 2               3 3      2 2
+--R                      (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R             + 
+--R                      2                               +---+     2
+--R                   (3c  + (- 21a b - 9)c + 15a b + 6)\|- 3  - 3c  + (21a b + 9)c
+--R                 + 
+--R                   - 15a b - 6
+--R              *
+--R                  +-+
+--R                 \|3
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R                       +---+
+--R             ((3c - 6)\|- 3  + 3c - 6)
+--R          *
+--R             ROOT
+--R                               4              3         2 2             2
+--R                  (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                + 
+--R                      2 2               3 3      2 2
+--R                  (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R         + 
+--R                   3                 2                     2 2             +---+
+--R               (- c  + (- 11a b - 1)c  + (11a b + 4)c - 24a b  - 2a b - 2)\|- 3
+--R             + 
+--R                  3                 2                     2 2
+--R               - c  + (- 11a b - 1)c  + (11a b + 4)c - 24a b  - 2a b - 2
+--R          *
+--R              +-+
+--R             \|3
+--R      /
+--R               2 +-+
+--R           108b \|3
+--R        *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R          **
+--R             2
+--R       ]
+--R     ,
+--R
+--R     [
+--R                  +---+
+--R             (- 9\|- 3  + 9)
+--R          *
+--R               ROOT
+--R                        9
+--R                     *
+--R                        ROOT
+--R                                          4              3
+--R                             (- 4a b - 1)c  + (6a b + 2)c
+--R                           + 
+--R                                   2 2             2       2 2               3 3
+--R                             (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                           + 
+--R                                  2 2
+--R                             - 13a b  - 4a b
+--R                    + 
+--R                         3     2                             +-+
+--R                      (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R                 /
+--R                       +-+
+--R                    54\|3
+--R              ,
+--R                  3
+--R            **
+--R               2
+--R         + 
+--R                         +---+
+--R             ((- 6c + 3)\|- 3  - 6c + 3)
+--R          *
+--R             ROOT
+--R                      9
+--R                   *
+--R                      ROOT
+--R                                        4              3
+--R                           (- 4a b - 1)c  + (6a b + 2)c
+--R                         + 
+--R                                 2 2             2       2 2               3 3
+--R                           (- 13a b  - 4a b - 1)c  + (22a b  + 6a b)c - 32a b
+--R                         + 
+--R                                2 2
+--R                           - 13a b  - 4a b
+--R                  + 
+--R                       3     2                             +-+
+--R                    (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R               /
+--R                     +-+
+--R                  54\|3
+--R            ,
+--R                3
+--R         + 
+--R               2
+--R           - 2c  + 2c - 12a b - 2
+--R      /
+--R               +---+
+--R           (9b\|- 3  + 9b)
+--R        *
+--R           ROOT
+--R                    9
+--R                 *
+--R                    ROOT
+--R                                      4              3         2 2             2
+--R                         (- 4a b - 1)c  + (6a b + 2)c  + (- 13a b  - 4a b - 1)c
+--R                       + 
+--R                             2 2               3 3      2 2
+--R                         (22a b  + 6a b)c - 32a b  - 13a b  - 4a b
+--R                + 
+--R                     3     2                             +-+
+--R                  (2c  - 3c  + (- 9a b - 3)c - 9a b + 2)\|3
+--R             /
+--R                   +-+
+--R                54\|3
+--R          ,
+--R              3
+--R       ]
+--R     ,
+--R    [1]]
+--R         ]
+--R     ]
+--RType: Record(radval: Expression Integer,radmult: Integer,radvect: List Matrix Expression Integer)
+--E
 
-
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/11/24/93 Manuel Bronstein
--------------------------------------------------------------------
+@
+bronstei@inf.ethz.ch/11/24/93 Manuel Bronstein
+\begin{verbatim}
 --)clear all
 --Here's a bug that appears with the )math option only.
 --
@@ -1180,314 +5734,554 @@ ll 3
 --
 -- Internal system problem in function appInfix :
 -- fewer than 2 arguments to an infix function
+\end{verbatim}
+
+copper@yktvmv/12/1/93 Don Coppersmith
 
--------------------------------------------------------------------
--- copper@yktvmv/12/1/93 Don Coppersmith
--------------------------------------------------------------------
+Attached is the list of integers n such that 2**512-n is prime
+and n is between 0 and 5000:
+\begin{verbatim}
+   4893,4653,4475,4005,3893,3669,3459,3143,2967,
+   2807,2529,1827,1695,975,875,629,569
+\end{verbatim}
+
+It was gotten from Axiom by issuing the commands
+<<*>>=
 )clear all
---Attached is the list of integers n such that 2**512-n is prime
---and n is between 0 and 5000:
---
---   4893,4653,4475,4005,3893,3669,3459,3143,2967,
---   2807,2529,1827,1695,975,875,629,569
 
---It was gotten from Axiom by issuing the commands
+--S 241
 qrimes : Stream Integer := generate(nextPrime,2**512-5000)
+--R
+--R   (1)
+--R   [
+--R    13407807929942597099574024998205846127479365820592393377723561443721764030_
+--R     0735469768018742981669034276900318581864860508537538828119465699464336490_
+--R     06079096
+--R     ,
+--R
+--R    13407807929942597099574024998205846127479365820592393377723561443721764030_
+--R     0735469768018742981669034276900318581864860508537538828119465699464336490_
+--R     06079203
+--R     ,
+--R
+--R    13407807929942597099574024998205846127479365820592393377723561443721764030_
+--R     0735469768018742981669034276900318581864860508537538828119465699464336490_
+--R     06079443
+--R     ,
+--R
+--R    13407807929942597099574024998205846127479365820592393377723561443721764030_
+--R     0735469768018742981669034276900318581864860508537538828119465699464336490_
+--R     06079621
+--R     ,
+--R
+--R    13407807929942597099574024998205846127479365820592393377723561443721764030_
+--R     0735469768018742981669034276900318581864860508537538828119465699464336490_
+--R     06080091
+--R     ,
+--R
+--R    13407807929942597099574024998205846127479365820592393377723561443721764030_
+--R     0735469768018742981669034276900318581864860508537538828119465699464336490_
+--R     06080203
+--R     ,
+--R
+--R    13407807929942597099574024998205846127479365820592393377723561443721764030_
+--R     0735469768018742981669034276900318581864860508537538828119465699464336490_
+--R     06080427
+--R     ,
+--R
+--R    13407807929942597099574024998205846127479365820592393377723561443721764030_
+--R     0735469768018742981669034276900318581864860508537538828119465699464336490_
+--R     06080637
+--R     ,
+--R
+--R    13407807929942597099574024998205846127479365820592393377723561443721764030_
+--R     0735469768018742981669034276900318581864860508537538828119465699464336490_
+--R     06080953
+--R     ,
+--R
+--R    13407807929942597099574024998205846127479365820592393377723561443721764030_
+--R     0735469768018742981669034276900318581864860508537538828119465699464336490_
+--R     06081129
+--R     ,
+--R    ...]
+--R                                                         Type: Stream Integer
+--E
+
+--S 242
 rrimes := [ 2**512-p for p in qrimes while p < 2**512 ]
+--R
+--R   (2)  [5000,4893,4653,4475,4005,3893,3669,3459,3143,2967,...]
+--R                                                         Type: Stream Integer
+--E
+
+--S 243
 srimes := complete rrimes
+--R
+--R   (3)  [5000,4893,4653,4475,4005,3893,3669,3459,3143,2967,...]
+--R                                                         Type: Stream Integer
+--E
+
+--S 244
 [srimes.i for i in [1..18]]
+--R
+--R   (4)  [[5000,4893,4653,4475,4005,3893,3669,3459,3143,2967,...]]
+--R                                                    Type: List Stream Integer
+--E
+
+--S 245
 [srimes.i for i in [10..18]]
+--R
+--R   (5)  [[2967,2807,2529,1827,1695,975,875,629,569]]
+--R                                                    Type: List Stream Integer
+--E
+
+@
+miker@num-alg-grp.co.uk/12/13/93 (Mike Richardson)
 
--------------------------------------------------------------------
--- miker@num-alg-grp.co.uk/12/13/93 (Mike Richardson)
--------------------------------------------------------------------
+This is fixed now. You get an Expression Float.
+
+I suspect that this is an example of the same thing - but it looks worse:
+\begin{verbatim} 
+  (145) ->X := log(0.7*%i*x)
+ 
+    >> Error detected within library code:
+    negative root
+\end{verbatim}
+<<*>>=
 )clear all
---
---This is fixed now. You get an Expression Float.
---
---> 
---> I suspect that this is an example of the same thing - but it looks
---> worse:
---> 
---> (145) ->X := log(0.7*%i*x)
---> 
--->    >> Error detected within library code:
--->    negative root
---> 
---> Mike
---> 
-
-
--------------------------------------------------------------------
---  sutor@yktpub.watson.ibm.com/12/15/93 (Robert S. Sutor)
--------------------------------------------------------------------
-)clear all
---enter Integer in input box
---choose domains
---choose Description
---click on Convertible(String)
---
---page cannot be formatted
 
--------------------------------------------------------------------
--- bmt@posso.dm.unipi.it12/15/93 (barry trager)
--------------------------------------------------------------------
+--S 246
+X := log(0.7*%i*x)
+--R
+--R   (1)  log(0.7 %i x)
+--R                                               Type: Expression Complex Float
+--E
+
+@
+
+sutor@yktpub.watson.ibm.com/12/15/93 (Robert S. Sutor)
+\begin{itemize}
+\item enter Integer in input box
+\item choose domains
+\item choose Description
+\item click on Convertible(String)
+\end{itemize}
+page cannot be formatted
+
+bmt@posso.dm.unipi.it12/15/93 (barry trager)
+<<*>>=
 )clear all
+
+--S 247
 log2() --> Float
-exp1() --> DoubleFLoat ???
+--R 
+--R
+--R   (1)  0.6931471805 5994530942
+--R                                                                  Type: Float
+--E
 
+--S 248
+exp1() --> DoubleFLoat ???
+--R 
+--R
+--R   (2)  2.7182818284 590452354
+--R                                                                  Type: Float
+--E
 
--------------------------------------------------------------------
---  quitte@knuth.univ-poitiers.fr/12/14/93 Claude Quitte
--------------------------------------------------------------------
+@
+quitte@knuth.univ-poitiers.fr/12/14/93 Claude Quitte
+
+There is a bug in the function \verb|delete_!|
+for the type List ; this function,
+has two arguments, a list L and an integer n : \verb|delete_!(L, n)| 
+returns a list L with the n nth-item deleted, MODIFYING its argument L.
+
+But for n = 1, the argument L is not MODIFIED !!! (exactly for n =
+minIndex(L)). An extract of the package ListAggregate (abbreviation LSAGG,
+file aggcat.spad).
+
+\begin{verbatim}
+ListAggregate(S:Object): Category == Join(StreamAggregate S,
+   FiniteLinearAggregate S, ExtensibleLinearAggregate S) with
+      list: S -> $
+	++ list(x) returns the list of one element x.
+ add
+   ..........
+
+   delete_!(x:$, i:I) ==
+     i < (m := minIndex x) => error "index out of range"
+     i = m => rest x   			****** <- here is the error
+     y := rest(x, (i - 1 - m)::N)
+     setrest_!(y, rest(y, 2))
+     x
+
+A little session :
+\end{verbatim}
+<<*>>=
 )clear all
---There is a bug in the function delete_! for the type List ; this function,
---has two arguments, a list L and an integer n : delete_!(L, n) returns
---a list L with the n nth-item deleted, MODIFYING its argument L.
---
---But for n = 1, the argument L is not MODIFIED !!! (exactly for n =
---minIndex(L)). An extract of the package ListAggregate (abbreviation LSAGG,
---file aggcat.spad).
---
---
-----------------------------------------------------------------------
---ListAggregate(S:Object): Category == Join(StreamAggregate S,
---   FiniteLinearAggregate S, ExtensibleLinearAggregate S) with
---      list: S -> $
---	++ list(x) returns the list of one element x.
--- add
---   ..........
---
---   delete_!(x:$, i:I) ==
---     i < (m := minIndex x) => error "index out of range"
---     i = m => rest x   			****** <- here is the error
---     y := rest(x, (i - 1 - m)::N)
---     setrest_!(y, rest(y, 2))
---     x
---
---A little session :
---
+
+--S 249
 L : List(String) := ["There is", "it seems", "a real bug", "here"]
---   (1)  ["There is","it seems","a real bug","here"]
---                                                            Type: List String
---
+--R
+--R   (1)  ["There is","it seems","a real bug","here"]
+--R                                                            Type: List String
+--E
+
+--S 250
 L1 := delete!(L, 1)
---   (2)  ["it seems","a real bug","here"]
---                                                            Type: List String
+--R
+--R   (2)  ["it seems","a real bug","here"]
+--R                                                            Type: List String
+--E
+
+--S 251
 L
---   (3)  ["There is","it seems","a real bug","here"]
---                                                            Type: List String
---
+--R
+--R   (3)  ["There is","it seems","a real bug","here"]
+--R                                                            Type: List String
+--E
+
+--S 252
 L2 := delete!(L, 2)
---   (4)  ["There is","a real bug","here"]
---                                                            Type: List String
+--R
+--R   (4)  ["There is","a real bug","here"]
+--R                                                            Type: List String
+--E
+
+--S 253
 L
---   (5)  ["There is","a real bug","here"]
---
---Is there a way to fix this bug quickly ?? (I am ready to modify the source
---Axiom aggcat.spad).
---The problem with ! functions lies in the documentation not in the code. We
---need to explain more clearly that ! functions are ALLOWED to update their
---arguments, not REQUIRED to do so. 
---Whenever using ! functions you should always
---use the returned result, not try to use the updated argument. This is how
---the code is designed. 
---For example if you try to do insert! into an empty list,
---the argument is not updatable and thus a new list is created. The reason for
---having ! operations is for efficiency to do less copying, not to guarantee
---that given arguments will always be updated. So the correct use is to only
---depend on the results returned by updating functions.
-
-
--------------------------------------------------------------------
---  quitte@knuth.univ-poitiers.fr/1/13/94 Claude Quitte
--------------------------------------------------------------------
+--R
+--R   (5)  ["There is","a real bug","here"]
+--R                                                            Type: List String
+--E
+
+@
+\begin{verbatim}
+   (5)  ["There is","a real bug","here"]
+\end{verbatim}
+Is there a way to fix this bug quickly ?? (I am ready to modify the source
+Axiom aggcat.spad).
+
+The problem with ! functions lies in the documentation not in the code. We
+need to explain more clearly that ! functions are ALLOWED to update their
+arguments, not REQUIRED to do so. 
+
+Whenever using ! functions you should always
+use the returned result, not try to use the updated argument. This is how
+the code is designed. 
+
+For example if you try to do insert! into an empty list,
+the argument is not updatable and thus a new list is created. The reason for
+having ! operations is for efficiency to do less copying, not to guarantee
+that given arguments will always be updated. So the correct use is to only
+depend on the results returned by updating functions.
+
+quitte@knuth.univ-poitiers.fr/1/13/94 Claude Quitte
+<<*>>=
 )clear all
+
+--S 254
 K := Fraction(Integer)   
+--R
+--R   (1)  Fraction Integer
+--R                                                                 Type: Domain
+--E
+
+--S 255
 PolK := UP('X, K) 
+--R
+--R   (2)  UnivariatePolynomial(X,Fraction Integer)
+--R                                                                 Type: Domain
+--E
+
+--S 256
 X : PolK := monomial(1, 1) 
+--R
+--R   (3)  X
+--R                               Type: UnivariatePolynomial(X,Fraction Integer)
+--E
+
+--S 257
 n : PositiveInteger := 15 
+--R
+--R   (4)  15
+--R                                                        Type: PositiveInteger
+--E
+
+--S 258
 E := SimpleAlgebraicExtension(K, PolK, X**n + X**(n-3) -1) 
+--R
+--R   (5)
+--R  SimpleAlgebraicExtension(Fraction Integer,UnivariatePolynomial(X,Fraction Int
+--R  eger),X**15+X**12-1)
+--R                                                                 Type: Domain
+--E
+
+--S 259
 y : E := X::E
+--R
+--R   (6)  X
+--RType: SimpleAlgebraicExtension(Fraction Integer,UnivariatePolynomial(X,Fraction Integer),X**15+X**12-1)
+--E
+
+--S 260
 minimalPolynomial(y)$E
---
---Internal Error
---The function minimalPolynomial with signature SimpleAlgebraicExtension(
---Fraction Integer,UnivariatePolynomial(X,Fraction Integer),X**15+X**12-1)
----> UnivariatePolynomial(X,Fraction Integer) is missing from domain
---SimpleAlgebraicExtension(Fraction (Integer))
---(UnivariatePolynomial X (Fraction (Integer)))((15 1 . 1) (12 1 . 1) (0 -1 . 1))
+--R
+--R         15    12
+--R   (7)  X   + X   - 1
+--R                               Type: UnivariatePolynomial(X,Fraction Integer)
+--E
+
+@
+\begin{verbatim}
+Internal Error
+The function minimalPolynomial with signature SimpleAlgebraicExtension(
+Fraction Integer,UnivariatePolynomial(X,Fraction Integer),X**15+X**12-1)
+ UnivariatePolynomial(X,Fraction Integer) is missing from domain
+SimpleAlgebraicExtension(Fraction (Integer))
+(UnivariatePolynomial X (Fraction (Integer)))((15 1 . 1) (12 1 . 1) (0 -1 . 1))
+\end{verbatim}
 
--------------------------------------------------------------------
--- luczak@nag.com/02/20/94 (Richard Luczak)
--------------------------------------------------------------------
+luczak@nag.com/02/20/94 (Richard Luczak)
+
+I'm trying to define the following rule
+
+<<*>>=
 )clear all
---
---I'm trying to define the following rule
---
+
+--S 261
 tr := rule cos(x)**(n | integer? n and even? n)==(1-sin(x)**2)**(n/2)
---
---Axiom returns
---
---   Cannot find a definition or library operation named even? with argument
---   types
---                             Expression Integer
---
---   We will attempt to step through and interpret the code.
---
---                                  n
---                                  -
---              n             2     2
---   (2)  cos(x)  == (- sin(x)  + 1)
---                        Type: RewriteRule(Integer,Integer,Expression Integer)
---
---
---and henceforth the rule does not work as desired. Variations on the same bug
---occur involving positive?. Of course, I get what I want using integer?(n/2)
---but ... Is this a bug?
---
--- from barry:
---
---Should use integer? n and even? integer n  instead.
---
---I toyed with the idea of implementing:
---    even? x == integer? x and even? integer x
---    odd? x == integer? x and odd? integer x
---in EXPR, but this would mean that   (x +-> even? x or odd? x)  is not always
---true anymore and I'm not sure it's a good idea. If you guys don't think it's
---a problem, it takes 2 minutes to add it to EXPR R when R has RETRACT INT
---(don't use integer? but retractIfCan@Union(Integer, "failed")).
-
--------------------------------------------------------------------
--- copper@yktvmv.vnet.ibm.com/02/22/94 don coppersmith
--------------------------------------------------------------------
-)clear all
---Questions that came up using Axiom on Aixproj:
---
---How does one find a Pade approximation?  I tried  pade(2,2,y)
---pade(y,2,2)  Pade(2,2,y)  PadeApproximation(2,2,y)
---(where y is a series in x) to no avail.
---
---Complaint: The error message
---
---    Could not find library function "pade" with arguments
---         (integer, integer, series).
---
---is misleading.  If it can't find any "pade", then say
---
---    Could not find library function "pade".
---
---If there is such a function, but I've got the arguments wrong,
---why not say
---
---    The library function "pade" takes arguments
---          (series, integer, integer)
---
---or at least make that information available somehow.
---
--- from bob sutor:
---
---Don,
---  Try using )what op pade  to see what is available. This will give
---you all operations with "pade" in their names. You can also search for
---*pade* via the HyperDoc Browse utility. If you don't use Browse, following
---up with, say, )display op pade, will give you a more information, though
---it is badly formatted (I will look at that).
---
---Aixproj is back-level, so I'm not sure exactly what is up their
---relative to the current system.
---
---I agree we could use better messages regarding unknown functions
---and I will look at that.
---  Bob
---
--- from bob sutor:
---
---The pade operation requires a taylor series as its third object while
---"series" returns a UnivariatePuiseuxSeries. If you set
---  y := taylor(1+x)**(1/5)
---then things work. You can also do
---  pade(1,1,y :: UTS(EXPR INT, x, 0) )
---but this is more work if you really have a Taylor series.
---
---This is unintuitive and there should be a "pade" for Puiseux series that
---fails if the series is not appropriate. Barry? I will now look at adding
---a bit more coercion support to the interpreter to allow Puiseux series
---to possibly retract to Laurent series and then possibly to Taylor series.
---
---Don,
---  I added the retractions I mentioned before to the development system.
---When the system is unsuccessful in matching a UnivariatePuiseuxSeries
---to an operation, it will first try to retract it to a
---UnivariateLaurentSeries. If that fails still, it will try to retract to
---a UnivariateTaylorSeries.
---
---  Be aware that this sort of thing happens when you are evaluating
---an expression. If you are defining a function, you should add
---explicit coercions or create objects of the correct type for
---efficiency. You function may still work, but it may not run in
---a compiled form.
+--R
+--R                                  n
+--R                                  -
+--R              n             2     2
+--R   (1)  cos(x)  == (- sin(x)  + 1)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E
 
--------------------------------------------------------------------
--- barry@num-alg-grp.co.uk/02/24/94 Barry Trager
--------------------------------------------------------------------
+@
+Axiom returns
+\begin{verbatim}
+  Cannot find a definition or library operation named even? with argument
+  types
+                            Expression Integer
+   We will attempt to step through and interpret the code.
+                                  n
+                                  -
+              n             2     2
+   (2)  cos(x)  == (- sin(x)  + 1)
+                        Type: RewriteRule(Integer,Integer,Expression Integer)
+
+\end{verbatim}
+and henceforth the rule does not work as desired. Variations on the same bug
+occur involving positive?. Of course, I get what I want using integer?(n/2)
+but ... Is this a bug?
+
+from barry:
+
+Should use integer? n and even? integer n  instead.
+
+I toyed with the idea of implementing:
+\begin{verbatim}
+    even? x == integer? x and even? integer x
+    odd? x == integer? x and odd? integer x
+\end{verbatim}
+in EXPR, but this would mean that   (x +-> even? x or odd? x)  is not always
+true anymore and I'm not sure it's a good idea. If you guys don't think it's
+a problem, it takes 2 minutes to add it to EXPR R when R has RETRACT INT
+(don't use integer? but retractIfCan@Union(Integer, "failed")).
+
+copper@yktvmv.vnet.ibm.com/02/22/94 don coppersmith
+
+Questions that came up using Axiom on Aixproj:
+
+How does one find a Pade approximation?  I tried  pade(2,2,y)
+pade(y,2,2)  Pade(2,2,y)  PadeApproximation(2,2,y)
+(where y is a series in x) to no avail.
+
+Complaint: The error message
+\begin{verbatim}
+    Could not find library function "pade" with arguments
+         (integer, integer, series).
+\end{verbatim}
+is misleading.  If it can't find any "pade", then say
+\begin{verbatim}
+    Could not find library function "pade".
+\end{verbatim}
+If there is such a function, but I've got the arguments wrong,
+why not say
+\begin{verbatim}
+    The library function "pade" takes arguments
+          (series, integer, integer)
+\end{verbatim}
+or at least make that information available somehow.
+
+from bob sutor:
+
+Don,
+
+Try using )what op pade  to see what is available. This will give
+you all operations with "pade" in their names. You can also search for
+*pade* via the HyperDoc Browse utility. If you don't use Browse, following
+up with, say, )display op pade, will give you a more information, though
+it is badly formatted (I will look at that).
+
+Aixproj is back-level, so I'm not sure exactly what is up their
+relative to the current system.
+
+I agree we could use better messages regarding unknown functions
+and I will look at that.
+
+Bob
+
+from bob sutor:
+
+The pade operation requires a taylor series as its third object while
+``series'' returns a UnivariatePuiseuxSeries. If you set
+\begin{verbatim}
+  y := taylor(1+x)**(1/5)
+\end{verbatim}
+then things work. You can also do
+\begin{verbatim}
+  pade(1,1,y :: UTS(EXPR INT, x, 0) )
+\end{verbatim}
+but this is more work if you really have a Taylor series.
+
+This is unintuitive and there should be a ``pade'' for Puiseux series that
+fails if the series is not appropriate. Barry? I will now look at adding
+a bit more coercion support to the interpreter to allow Puiseux series
+to possibly retract to Laurent series and then possibly to Taylor series.
+
+Don,
+
+I added the retractions I mentioned before to the development system.
+When the system is unsuccessful in matching a UnivariatePuiseuxSeries
+to an operation, it will first try to retract it to a
+UnivariateLaurentSeries. If that fails still, it will try to retract to
+a UnivariateTaylorSeries.
+
+Be aware that this sort of thing happens when you are evaluating
+an expression. If you are defining a function, you should add
+explicit coercions or create objects of the correct type for
+efficiency. You function may still work, but it may not run in
+a compiled form.
+
+barry@num-alg-grp.co.uk/02/24/94 Barry Trager
+<<*>>=
 )clear all
+
+--S 262
 sqrt(2)*2.0 -- fails
+--R 
+--R
+--R   (1)  2.8284271247 461900976
+--R                                                       Type: Expression Float
+--E
+
+--S 263
 sqrt(2)::EXPR INT * 2.0 -- works
+--R 
+--R
+--R   (2)  2.8284271247 461900976
+--R                                                       Type: Expression Float
+--E
 
--- tpd: this now fails with sample : () -> Reference Integer is missing
--- from domain: Integer
--- Internal Error
+@
+tpd: this now fails with sample : () -> Reference Integer is missing
+from domain: Integer
+Internal Error
 
+bronstei@inf.ethz.ch/02/28/94 Manuel Bronstein
 
--------------------------------------------------------------------
--- bronstei@inf.ethz.ch/02/28/94 Manuel Bronstein
--------------------------------------------------------------------
+<<*>>=
 )clear all
+
+--S 264
 f := exp(exp(x)*exp(1/exp(x))) / exp exp x
---)tr LIMITPS )math
---)tr DFINTTLS )math
---)tr DFINTTLS_;findLimit
--- the following exits back to the shell after limit returns "failed":
-computeInt(first tower f, f, 0, %plusInfinity, false)$DFINTTLS(INT, EXPR INT)
-
--------------------------------------------------------------------
--- jhd@maths.bath.ac.uk/03/02/94 James Davenport
--------------------------------------------------------------------
-)clear all
---I've fixed coercions of List and Vector to DirectProduct.
---You can now do things like
+--R
+--R                1
+--R               ---
+--R                 x
+--R            x  %e
+--R          %e %e
+--R        %e
+--R   (1)  ----------
+--R               x
+--R             %e
+--R           %e
+--R                                                     Type: Expression Integer
+--E
+
+@
+\begin{verbatim}
+ )tr LIMITPS )math
+ )tr DFINTTLS )math
+ )tr DFINTTLS_;findLimit
+\end{verbatim}
+the following exits back to the shell after limit returns ``failed'':
+computeInt(first tower f, f, 0, \%plusInfinity, false)\$DFINTTLS(INT, EXPR INT)
+
+jhd@maths.bath.ac.uk/03/02/94 James Davenport
+
+I've fixed coercions of List and Vector to DirectProduct.
+You can now do things like
+
+<<*>>=
+)clear all
+
+--S 265
 [1,2,3] :: DirectProduct(3, Fraction Integer)
---
---I also fixed coercions from Vector to List, which seems to have
---been removed via a library change.
+--R
+--R   (1)  [1,2,3]
+--R                                      Type: DirectProduct(3,Fraction Integer)
+--E
+
+@
+I also fixed coercions from Vector to List, which seems to have
+been removed via a library change.
+
+jhd@maths.bath.ac.uk/03/09/94 James Davenport
 
--------------------------------------------------------------------
--- jhd@maths.bath.ac.uk/03/09/94 James Davenport
--------------------------------------------------------------------
+Used to give a lisp error
+<<*>>=
 )clear all
--- used to give a lisp error
+
+--S 266
 x**10+1::Polynomial PrimeField 2
+--R
+--R         10
+--R   (1)  x   + 1
+--R                                                Type: Polynomial PrimeField 2
+--E
 
--------------------------------------------------------------------
--- themos@num-alg-grp.co.uk/03/11/94 Themos Tsikas
--------------------------------------------------------------------
+@
+themos@num-alg-grp.co.uk/03/11/94 Themos Tsikas
+<<*>>=
 )clear all
+
+--S 267
 f(x)==x**2
+--R                                                                   Type: Void
+--E
+
+@
 draw(f,-1..1)
 
--------------------------------------------------------------------
--- themos@num-alg-grp.co.uk/03/16/94 Themos Tsikas
--------------------------------------------------------------------
-)clear all
---The problem was that nobody was around to catch the coerceOrCroaker.
---Just comment out the first line of intCodeGenCoerce1 in i-code.boot
---(the one with the explicit THROW). Bothe the riemannSphereDraw and JHD's
---original example will then work. -- bob sutor
+themos@num-alg-grp.co.uk/03/16/94 Themos Tsikas
+
+The problem was that nobody was around to catch the coerceOrCroaker.
+Just comment out the first line of intCodeGenCoerce1 in i-code.boot
+(the one with the explicit THROW). Bothe the riemannSphereDraw and JHD's
+original example will then work. -- bob sutor
+
+\begin{verbatim}
 )read conformal
 riemannSphereDraw(1..2,0..%pi,4,4,"polar")
+\end{verbatim}
 
-
+<<*>>=
+)spool
+)lisp (bye)
 
 @
 \eject
diff --git a/src/input/schaum17.input.pamphlet b/src/input/schaum17.input.pamphlet
index 6c5e67c..fdc11a2 100644
--- a/src/input/schaum17.input.pamphlet
+++ b/src/input/schaum17.input.pamphlet
@@ -776,7 +776,7 @@ bb:=-1/a*tan(%pi/4-(a*x)/2)
 
 --S 57 of 136
 cc:=aa-bb
---R
+--R 
 --R
 --R                                       2a x - %pi
 --R        (- sin(a x) - cos(a x) - 1)tan(----------) - 2cos(a x) - 2

\start
Date: Sun, 07 Dec 2008 16:28:28 -0500
From: William Sit
To: Alfredo Portes, Tim Daly
Subject: Re: 20081202.02.tpd.patch (website download.html add Doyen Thumbdrive)

Dear Tim and Alfredo:

Okay, after some experimentation, I finally was able to 
save changes to Doyen on the USB drive. Probably, it can 
easily be saved on the hard disk as well.

The trick is to run from the USB drive (after it has 
booted into Doyen) /boot/isolinux/liloinst.sh after the 
initial change of the MBR (master boot sector) to make the 
USB drive bootable. liloinst.sh can be applied to a 
partition (not the whole drive according to documentation) 
and so the USB drive should be partitioned first. What 
liloinst.sh does is to include the directory slaxchanges 
where normally it is resident in RAM.

Warning: one should be careful about the device name of 
the USB drive, as it depends on how many hard drives you 
have on the system. All drives are named as sda, sdb, 
etc., with the USB being the last. In my case, it is sdb1 
since I have only one hard drive on the laptop.

I was able to install Fricas and reboot with this saved in 
slaxchanges.

I have also experimented with DSL (damn small linux), but 
the version I used (dsl-4.4.10.iso) somehow do not 
recognize the networks nor the hard-drives. But that is 
probably by design. I think it is trying to get the 
drivers from the Windows system, but that becomes a 
catch-22 situation. However, it is quite robust, unlike 
Doyen, which crashes sometimes on shutdown.

\start
Date: Mon, 8 Dec 2008 11:07:06 -0600
From: Tim Daly
To: list
Subject: Axiom thumbdrive

You can build a writeable thumbdrive following the instructions at
<http://fedoraproject.org/wiki/How_to_create_and_use_Live_USB

\start
Date: Mon, 08 Dec 2008 11:28:41 -0700
From: Karl Hegbloom
To: list
Subject: Re: Axiom thumbdrive

Tim Daly wrote:
> You can build a writeable thumbdrive following the instructions at
> <http://fedoraproject.org/wiki/How_to_create_and_use_Live_USB
>
> Tim
Ubuntu 8.10 (Intrepid Ibex) provides a "create USB startup disk" applet
on the System->Administration menu. It would probably not be very
difficult to have TeXmacs and Axiom installed on a USB stick.

\start
Date: Tue, 9 Dec 2008 15:20:04 -0600
From: Tim Daly
To: list
Subject: 20081208.01.tpd.patch (CATS hyperbolicrules.input added)

hyperbolicrules.input is a computer algebra test suite (CATS) regression
file that tests Axiom's handling of rule-based pattern rewrites for 
hyperbolic functions. Bugs were found and added to the list.
=======================================================================
diff --git a/changelog b/changelog
index 02caa58..352a0cf 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,6 @@
+20081208 tpd src/axiom-website/patches.html 20081208.01.tpd.patch
+20081208 tpd src/input/Makefile hyperbolicrules.input added
+20081208 tpd src/input/hyperbolicrules.input added
 20081206 tpd src/axiom-website/patches.html 20081206.01.tpd.patch
 20081206 tpd src/input/Makefile add fixed.regress
 20081206 tpd src/input/fixed.input convert to a regression file
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 2428e91..2e7c231 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -787,6 +787,8 @@ bug 7161: integer.spad remove signature change<br/>
 schaum17 fix 14.355, 14.356<br/>
 <a href="patches/20081206.01.tpd.patch">20081206.01.tpd.patch</a>
 regression file fixed created<br/>
+<a href="patches/20081208.01.tpd.patch">20081208.01.tpd.patch</a>
+CATS hyperbolicrules.input added<br/>
 
  </body>
 </html>
\ No newline at end of file
diff --git a/src/input/Makefile.pamphlet b/src/input/Makefile.pamphlet
index 2cf453c..45343ce 100644
--- a/src/input/Makefile.pamphlet
+++ b/src/input/Makefile.pamphlet
@@ -314,7 +314,8 @@ REGRES= algaggr.regress algbrbf.regress  algfacob.regress alist.regress  \
     gbf.regress       genups.regress   gonshor.regress  grpthry.regress \
     gstbl.regress     heap.regress     heat.regress     help.regress \
     herm.regress      heugcd.regress \
-    hexadec.regress   ico.regress      ideal.regress \
+    hexadec.regress   hyperbolicrules.regress \
+    ico.regress      ideal.regress \
     ifact.regress     ifthenelse.regress \
     infprod.regress   intaf.regress    intbypart.regress \
     intdeq.regress \
@@ -582,7 +583,8 @@ FILES= ${OUT}/algaggr.input  ${OUT}/algbrbf.input    ${OUT}/algfacob.input \
        ${OUT}/gstbl.input \
        ${OUT}/heap.input     ${OUT}/heat.input       ${OUT}/helix.input \
        ${OUT}/herm.input     ${OUT}/heugcd.input \
-       ${OUT}/hexadec.input    ${OUT}/huang.input \
+       ${OUT}/hexadec.input  ${OUT}/huang.input \
+       ${OUT}/hyperbolicrules.input \
        ${OUT}/ico.input      ${OUT}/ideal.input      ${OUT}/ifact.input \
        ${OUT}/ifthenelse.input \
        ${OUT}/images1.input  ${OUT}/images1a.input   ${OUT}/images3a.input \
@@ -875,7 +877,8 @@ DOCFILES= \
   ${DOC}/help.input.dvi        ${DOC}/herm.input.dvi       \
   ${DOC}/heugcd.input.dvi \
   ${DOC}/hexadec.input.dvi     ${DOC}/hilbert.as.dvi       \
-  ${DOC}/huang.input.dvi       ${DOC}/ico.input.dvi        \
+  ${DOC}/huang.input.dvi ${DOC}/hyperbolicrules.input.dvi \
+  ${DOC}/ico.input.dvi        \
   ${DOC}/ideal.input.dvi       ${DOC}/ifact.input.dvi      \
   ${DOC}/ifthenelse.input.dvi \
   ${DOC}/images1a.input.dvi    ${DOC}/images1.input.dvi    \
diff --git a/src/input/hyperbolicrules.input.pamphlet b/src/input/hyperbolicrules.input.pamphlet
new file mode 100644
index 0000000..fd3af28
--- /dev/null
+++ b/src/input/hyperbolicrules.input.pamphlet
@@ -0,0 +1,3130 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/input hyperbolicrules.input}
+\author{Timothy Daly}
+\maketitle
+\begin{abstract}
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+\section{Definition of Hyperbolic Functions}
+\subsection{8.1 Hyperbolic sine of x}
+\[{\rm sinh}(x) == \frac{e^x-e^{-x}}{2}\]
+<<*>>=
+)spool hyperbolicrules.output
+)set message test on
+)set message auto off
+)clear all
+
+--S 1 of 298
+sinhdef:=rule(sinh(x) == (e^x-e^(-x))/2)
+--R
+--R                    x    - x
+--R                   e  - e
+--R   (1)  sinh(x) == ---------
+--R                       2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 1
+
+--S 2 of 298
+t1:=sinh(x) - (e^x-e^(-x))/2
+--R
+--R           x    - x
+--R        - e  + e    + 2sinh(x)
+--R   (2)  ----------------------
+--R                   2
+--R                                                     Type: Expression Integer
+--E 2
+
+--S 3 of 298
+t2:=sinhdef t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 3
+
+@
+\subsection{8.2 Hyperbolic cosine of x}
+\[{\rm cosh}(x) == \frac{e^x+e^{-x}}{2}\]
+<<*>>=
+)clear all
+
+--S 4 of 298
+coshdef:=rule(cosh(x) == (e^x+e^(-x))/2)
+--R
+--R                    x    - x
+--R                   e  + e
+--R   (1)  cosh(x) == ---------
+--R                       2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 4
+
+--S 5 of 298
+t1:=cosh(x) - (e^x+e^(-x))/2
+--R
+--R           x    - x
+--R        - e  - e    + 2cosh(x)
+--R   (2)  ----------------------
+--R                   2
+--R                                                     Type: Expression Integer
+--E 5
+
+--S 6 of 298
+t2:=coshdef t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 6
+
+@
+\subsection{8.3 Hyperbolic tangent of x}
+\[{\rm tanh}(x) == \frac{e^x-e^{-x}}{e^x+e^{-x}}\]
+<<*>>=
+)clear all
+
+--S 7 of 298
+tanhdef:=rule(tanh(x) == (e^x-e*(-x))/(e^x+e*(-x)))
+--R
+--R                    x
+--R                   e  + e x
+--R   (1)  tanh(x) == --------
+--R                    x
+--R                   e  - e x
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 7
+
+--S 8 of 298
+t1:=tanh(x) - (e^x-e*(-x))/(e^x+e*(-x))
+--R
+--R                      x
+--R        (tanh(x) - 1)e  - e x tanh(x) - e x
+--R   (2)  -----------------------------------
+--R                       x
+--R                      e  - e x
+--R                                                     Type: Expression Integer
+--E 8
+
+--S 9 of 298
+t2:=tanhdef t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 9
+
+@
+\subsection{8.4 Hyperbolic cotangent of x}
+\[{\rm coth}(x) == \frac{e^x+e^{-x}}{e^x-e^{-x}}\]
+<<*>>=
+)clear all
+
+--S 10 of 298
+cothdef:=rule(coth(x) == (e^x+e*(-x))/(e^x-e*(-x)))
+--R
+--R                    x
+--R                   e  - e x
+--R   (1)  coth(x) == --------
+--R                    x
+--R                   e  + e x
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 10
+
+--S 11 of 298
+t1:=coth(x) - (e^x+e*(-x))/(e^x-e*(-x))
+--R
+--R                      x
+--R        (coth(x) - 1)e  + e x coth(x) + e x
+--R   (2)  -----------------------------------
+--R                       x
+--R                      e  + e x
+--R                                                     Type: Expression Integer
+--E 11
+
+--S 12 of 298
+t2:=cothdef t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 12
+
+@
+\subsection{8.5 Hyperbolic secant of x}
+\[{\rm sech}(x) == \frac{2}{e^x+e^{-x}}\]
+<<*>>=
+)clear all
+
+--S 13 of 298
+sechdef:=rule(sech(x) == 2/(e^x+e*(-x)))
+--R
+--R                       2
+--R   (1)  sech(x) == --------
+--R                    x
+--R                   e  - e x
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 13
+
+--S 14 of 298
+t1:=sech(x) - 2/(e^x+e*(-x))
+--R
+--R                x
+--R        sech(x)e  - e x sech(x) - 2
+--R   (2)  ---------------------------
+--R                   x
+--R                  e  - e x
+--R                                                     Type: Expression Integer
+--E 14
+
+--S 15 of 298
+t2:=sechdef t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 15
+
+@
+\subsection{8.6 Hyperbolic cosecant of x}
+\[{\rm csch}(x) == \frac{2}{e^x-e^{-x}}\]
+<<*>>=
+)clear all
+
+--S 16 of 298
+cschdef:=rule(csch(x) == 2/(e^x-e*(-x)))
+--R
+--R                       2
+--R   (1)  csch(x) == --------
+--R                    x
+--R                   e  + e x
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 16
+
+--S 17 of 298
+t1:=csch(x) - 2/(e^x-e*(-x))
+--R
+--R                x
+--R        csch(x)e  + e x csch(x) - 2
+--R   (2)  ---------------------------
+--R                   x
+--R                  e  + e x
+--R                                                     Type: Expression Integer
+--E 17
+
+--S 18 of 298
+t2:=cschdef t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 18
+
+@
+\section{Relationship among Hyperbolic Functions}
+\subsection{8.7 ${\rm tanh}(x)$}
+\[{\rm tanh}(x) == \frac{{\rm sinh}(x)}{{\rm cosh}(x)}\]
+<<*>>=
+)clear all
+
+--S 19 of 298
+tanhrule:=rule(tanh(x) == sinh(x)/cosh(x))
+--R
+--R                   sinh(x)
+--R   (1)  tanh(x) == -------
+--R                   cosh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 19
+
+--S 20 of 298
+t1:=tanh(x) - sinh(x)/cosh(x)
+--R
+--R        cosh(x)tanh(x) - sinh(x)
+--R   (2)  ------------------------
+--R                 cosh(x)
+--R                                                     Type: Expression Integer
+--E 20
+
+--S 21 of 298
+t2:=tanhrule t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 21
+
+@
+\subsection{8.8 ${\rm coth}(x)$}
+\[{\rm coth}(x) == \frac{1}{{\rm tanh}(x)}\]
+\[== \frac{{\rm cosh}(x)}{{\rm sinh}(x)}\]
+<<*>>=
+)clear all
+
+--S 22 of 298
+cothrule:=rule(coth(x) == 1/tanh(x))
+--R
+--R                      1
+--R   (1)  coth(x) == -------
+--R                   tanh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 22
+
+--S 23 of 298
+t1:=coth(x) - 1/tanh(x)
+--R
+--R        coth(x)tanh(x) - 1
+--R   (2)  ------------------
+--R              tanh(x)
+--R                                                     Type: Expression Integer
+--E 23
+
+--S 24 of 298
+t2:=cothrule t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 24
+
+--S 25 of 298
+cothrule2:=rule(coth(x) == cosh(x)/sinh(x))
+--R
+--R                   cosh(x)
+--R   (4)  coth(x) == -------
+--R                   sinh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 25
+
+--S 26 of 298
+t3:=coth(x) - cosh(x)/sinh(x)
+--R
+--R        coth(x)sinh(x) - cosh(x)
+--R   (5)  ------------------------
+--R                 sinh(x)
+--R                                                     Type: Expression Integer
+--E 26
+
+--S 27 of 298
+t4:=cothrule2 t3
+--R
+--R   (6)  0
+--R                                                     Type: Expression Integer
+--E 27
+
+@
+\subsection{8.9 ${\rm sech}(x)$}
+\[{\rm sech}(x) == \frac{1}{{\rm cosh}(x)}\]
+<<*>>=
+)clear all
+
+--S 28 of 298
+sechrule:=rule(sech(x) == 1/cosh(x))
+--R
+--R                      1
+--R   (1)  sech(x) == -------
+--R                   cosh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 28
+
+--S 29 of 298
+t1:=sech(x) - 1/cosh(x)
+--R
+--R        cosh(x)sech(x) - 1
+--R   (2)  ------------------
+--R              cosh(x)
+--R                                                     Type: Expression Integer
+--E 29
+
+--S 30 of 298
+t2:=sechrule t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 30
+
+@
+\subsection{8.10 ${\rm csch}(x)$}
+\[{\rm csch}(x) == \frac{1}{{\rm sinh}(x)}\]
+<<*>>=
+)clear all
+
+--S 31 of 298
+cschrule:=rule(csch(x) == 1/sinh(x))
+--R
+--R                      1
+--R   (1)  csch(x) == -------
+--R                   sinh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 31
+
+--S 32 of 298
+t1:=csch(x) - 1/sinh(x)
+--R
+--R        csch(x)sinh(x) - 1
+--R   (2)  ------------------
+--R              sinh(x)
+--R                                                     Type: Expression Integer
+--E 32
+
+--S 33 of 298
+t2:=cschrule t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 33
+
+@
+\subsection{8.11 ${\rm cosh}^2(x)-~{\rm sinh}^2(x)$}
+\[{\rm cosh}^2(x)-~{\rm sinh}^2(x) == 1\]
+<<*>>=
+)clear all
+
+--S 34 of 298
+coshsinh:=rule(cosh(x)^2-sinh(x)^2 == 1)
+--R
+--R                 2          2
+--I   (1)  - sinh(x)  + cosh(x)  + %Y == %Y + 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 34
+
+--S 35 of 298
+t1:=cosh(x)^2-sinh(x)^2 - 1
+--R
+--R                 2          2
+--R   (2)  - sinh(x)  + cosh(x)  - 1
+--R                                                     Type: Expression Integer
+--E 35
+
+--S 36 of 298
+t2:=coshsinh t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 36
+
+@
+\subsection{8.12 ${\rm sech}^2(x)+~{\rm tanh}^2(x)$}
+\[{\rm sech}^2(x)+~{\rm tanh}^2(x) == 1\]
+<<*>>=
+)clear all
+
+--S 37 of 298
+sechtanh:=rule(sech(x)^2+tanh(x)^2 == 1)
+--R
+--R               2          2
+--I   (1)  tanh(x)  + sech(x)  + %Z == %Z + 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 37
+
+--S 38 of 298
+t1:=sech(x)^2+tanh(x)^2 - 1
+--R
+--R               2          2
+--R   (2)  tanh(x)  + sech(x)  - 1
+--R                                                     Type: Expression Integer
+--E 38
+
+--S 39 of 298
+t2:=sechtanh t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 39
+
+@
+\subsection{8.13 ${\rm coth}^2(x)-~{\rm csch}^2(x)$}
+\[{\rm coth}^2(x)-~{\rm csch}^2(x) == 1\]
+<<*>>=
+)clear all
+
+--S 40 of 298
+cothcsch:=rule(coth(x)^2-csch(x)^2 == 1)
+--R
+--R                 2          2
+--I   (1)  - csch(x)  + coth(x)  + %BA == %BA + 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 40
+
+--S 41 of 298
+t1:=coth(x)^2-csch(x)^2 - 1
+--R
+--R                 2          2
+--R   (2)  - csch(x)  + coth(x)  - 1
+--R                                                     Type: Expression Integer
+--E 41
+
+--S 42 of 298
+t2:=cothcsch t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 42
+
+@
+\section{Functions of Negative Arguments}
+Axiom already knows these simplifications
+\subsection{8.14 ${\rm sinh}(-x)$}
+\[{\rm sinh}(-x) == -~{\rm sinh}(x)\]
+<<*>>=
+)clear all
+
+--S 43 of 298
+sinh(-x)
+--R
+--R   (1)  - sinh(x)
+--R                                                     Type: Expression Integer
+--E 43
+
+
+@
+\subsection{8.15 ${\rm cosh}(-x)$}
+\[{\rm cosh}(-x) == {\rm cosh}(x)\]
+<<*>>=
+)clear all
+
+--S 44 of 298
+cosh(-x)
+--R
+--R   (1)  cosh(x)
+--R                                                     Type: Expression Integer
+--E 44
+
+@
+\subsection{8.16 ${\rm tanh}(-x)$}
+\[{\rm tanh}(-x) == -~{\rm tanh}(x)\]
+<<*>>=
+)clear all
+
+--S 45 of 298
+tanh(-x)
+--R
+--R   (1)  - tanh(x)
+--R                                                     Type: Expression Integer
+--E 45
+
+@
+\subsection{8.17 ${\rm csch}(-x)$}
+\[{\rm csch}(-x) == -~{\rm csch(x)}\]
+<<*>>=
+)clear all
+
+--S 46 of 298
+csch(-x)
+--R
+--R   (1)  - csch(x)
+--R                                                     Type: Expression Integer
+--E 46
+
+@
+\subsection{8.18 ${\rm sech}(-x)$}
+\[{\rm sech}(-x) == {\rm sech}(x)\]
+<<*>>=
+)clear all
+
+--S 47 of 298
+sech(-x)
+--R
+--R   (1)  sech(x)
+--R                                                     Type: Expression Integer
+--E 47
+
+@
+\subsection{8.19 ${\rm coth}(-x)$}
+\[{\rm coth}(-x) == -~{\rm coth}(x)\]
+<<*>>=
+)clear all
+
+--S 48 of 298
+coth(-x)
+--R
+--R   (1)  - coth(x)
+--R                                                     Type: Expression Integer
+--E 48
+
+@
+\section{Addition Formulas}
+\subsection{8.20 ${\rm sinh}(x \pm y)$}
+\[{\rm sinh}(x \pm y) == {\rm sinh}(x)~{\rm cosh}(y)\pm~{\rm cosh}(x)~{\rm sinh}(y)\]
+<<*>>=
+)clear all
+
+--S 49 of 298
+sinhadd:=rule(sinh(x+y) == sinh(x)*cosh(y)+cosh(x)*sinh(y))
+--R
+--R   (1)  sinh(y + x) == cosh(x)sinh(y) + cosh(y)sinh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 49
+
+--S 50 of 298
+t1:=sinh(x+y) - (sinh(x)*cosh(y)+cosh(x)*sinh(y))
+--R
+--R   (2)  sinh(y + x) - cosh(x)sinh(y) - cosh(y)sinh(x)
+--R                                                     Type: Expression Integer
+--E 50
+
+--S 51 of 298
+t2:=sinhadd t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 51
+
+--S 52 of 298
+sinhsub:=rule(sinh(x-y) == sinh(x)*cosh(y)-cosh(x)*sinh(y))
+--R
+--I   (4)  - %T sinh(y - x) == - %T cosh(x)sinh(y) + %T cosh(y)sinh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 52
+
+--S 53 of 298
+t3:=sinh(x-y) - (sinh(x)*cosh(y)-cosh(x)*sinh(y))
+--R
+--R   (5)  cosh(x)sinh(y) - sinh(y - x) - cosh(y)sinh(x)
+--R                                                     Type: Expression Integer
+--E 53
+
+--S 54 of 298
+t4:=sinhsub t3
+--R
+--R   (6)  0
+--R                                                     Type: Expression Integer
+--E 54 
+
+@
+\subsection{8.21 ${\rm cosh}(x \pm y)$}
+\[{\rm cosh}(x \pm y) == {\rm cosh}(x)~{\rm cosh}(y)\pm~{\rm sinh}(x)~{\rm sinh}(y)\]
+<<*>>=
+)clear all
+
+--S 55 of 298
+coshadd:=rule(cosh(x+y) == cosh(x)*cosh(y)+sinh(x)*sinh(y))
+--R
+--R   (1)  cosh(y + x) == sinh(x)sinh(y) + cosh(x)cosh(y)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 55
+
+--S 56 of 298
+t1:=cosh(x+y) - (cosh(x)*cosh(y)+sinh(x)*sinh(y))
+--R
+--R   (2)  - sinh(x)sinh(y) + cosh(y + x) - cosh(x)cosh(y)
+--R                                                     Type: Expression Integer
+--E 56
+
+--S 57 of 298
+t2:=coshadd t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 57
+
+--S 58 of 298
+coshsub:=rule(cosh(x-y) == cosh(x)*cosh(y)-sinh(x)*sinh(y))
+--R
+--R   (4)  cosh(y - x) == - sinh(x)sinh(y) + cosh(x)cosh(y)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 58
+
+--S 59 of 298
+t3:=cosh(x-y) - (cosh(x)*cosh(y)-sinh(x)*sinh(y))
+--R
+--R   (5)  sinh(x)sinh(y) - cosh(x)cosh(y) + cosh(y - x)
+--R                                                     Type: Expression Integer
+--E 59
+
+--S 60 of 298
+t4:=coshsub t3
+--R
+--R   (6)  0
+--R                                                     Type: Expression Integer
+--E 60
+
+@
+\subsection{8.22 ${\rm tanh}(x \pm y)$}
+\[{\rm tanh}(x \pm y) == \frac{{\rm tanh}(x)\pm~{\rm tanh}(y)}{1\pm~{\rm tanh}(x)~{\rm tanh}(y)}\]
+<<*>>=
+)clear all
+
+--S 61 of 298
+tanhadd:=rule(tanh(x+y) == (tanh(x)+tanh(y))/(1+tanh(x)*tanh(y)))
+--R
+--R                        tanh(y) + tanh(x)
+--R   (1)  tanh(y + x) == ------------------
+--R                       tanh(x)tanh(y) + 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 61
+
+--S 62 of 298
+t1:=tanh(x+y) - (tanh(x)+tanh(y))/(1+tanh(x)*tanh(y))
+--R
+--R        (tanh(x)tanh(y) + 1)tanh(y + x) - tanh(y) - tanh(x)
+--R   (2)  ---------------------------------------------------
+--R                         tanh(x)tanh(y) + 1
+--R                                                     Type: Expression Integer
+--E 62
+
+--S 63 of 298
+t2:=tanhadd t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 63
+
+--S 64 of 298
+tanhneg:=rule(tanh(x-y) == (tanh(x)-tanh(y))/(1-tanh(x)*tanh(y)))
+--R
+--I                            %V tanh(y) - %V tanh(x)
+--I   (4)  - %V tanh(y - x) == -----------------------
+--R                               tanh(x)tanh(y) - 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 64
+
+--S 65 of 298
+t3:=tanh(x-y) - (tanh(x)-tanh(y))/(1-tanh(x)*tanh(y))
+--R
+--R        (- tanh(x)tanh(y - x) - 1)tanh(y) + tanh(y - x) + tanh(x)
+--R   (5)  ---------------------------------------------------------
+--R                            tanh(x)tanh(y) - 1
+--R                                                     Type: Expression Integer
+--E 65
+
+@
+This loops forever.
+<<*>>=
+--S 66 of 298
+-- t4:=tanhneg t3
+--E 66
+
+@
+\subsection{8.23 ${\rm coth}(x \pm y)$}
+\[{\rm coth}(x \pm y) == \frac{{\rm coth}(x)~{\rm coth}(y)\pm 1}{{\rm coth}(y)\pm~{\rm coth}(x)}\]
+<<*>>=
+)clear all
+
+--S 67 of 298
+cothadd:=rule(coth(x+y) == (coth(x)*coth(y)+1)/(coth(y)+coth(x)))
+--R
+--R                       coth(x)coth(y) + 1
+--R   (1)  coth(y + x) == ------------------
+--R                        coth(y) + coth(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 67
+
+--S 68 of 298
+t1:=coth(x+y) - (coth(x)*coth(y)+1)/(coth(y)+coth(x))
+--R
+--R        (coth(y) + coth(x))coth(y + x) - coth(x)coth(y) - 1
+--R   (2)  ---------------------------------------------------
+--R                         coth(y) + coth(x)
+--R                                                     Type: Expression Integer
+--E 68
+
+--S 69 of 298
+t2:=cothadd t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 69
+
+--S 70 of 298
+cothneg:=rule(coth(x-y) == (coth(x)*coth(y)-1)/(coth(y)-coth(x)))
+--R
+--I                            %W coth(x)coth(y) - %W
+--I   (4)  - %W coth(y - x) == ----------------------
+--R                               coth(y) - coth(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 70
+
+--S 71 of 298
+t3:=coth(x-y) - (coth(x)*coth(y)-1)/(coth(y)-coth(x))
+--R
+--R        (- coth(y - x) - coth(x))coth(y) + coth(x)coth(y - x) + 1
+--R   (5)  ---------------------------------------------------------
+--R                            coth(y) - coth(x)
+--R                                                     Type: Expression Integer
+--E 71
+
+@
+This loops forever
+<<*>>=
+--S 72 of 298
+--t4:=cothneg t3
+--E 72
+
+@
+\section{Double Angle Formulas}
+\subsection{8.24 ${\rm sinh}(2x)$}
+\[{\rm sinh}(2x) == 2~{\rm sinh}(x)~{\rm cosh}(x)\]
+<<*>>=
+)clear all
+
+--S 73 of 298
+sinh2x:=rule(sinh(2*x) == 2*sinh(x)*cosh(x))
+--R
+--R   (1)  sinh(2x) == 2cosh(x)sinh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 73
+
+--S 74 of 298
+t1:=sinh(2*x) - 2*sinh(x)*cosh(x)
+--R
+--R   (2)  sinh(2x) - 2cosh(x)sinh(x)
+--R                                                     Type: Expression Integer
+--E 74
+
+--S 75 of 298
+t2:=sinh2x t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 75
+
+@
+\subsection{8.25 ${\rm cosh}(2x)$}
+\[{\rm cosh}(2x) == {\rm cosh}^2(x)+~{\rm sinh}^2(x)\]
+\[==2~{\rm cosh}^2(x)-1\]
+\[==1+2~{\rm sinh}^2(x)\]
+<<*>>=
+)clear all
+
+--S 76 of 298
+cosh2x:=rule(cosh(2*x) == cosh(x)^2+sinh(x)^2)
+--R
+--R                           2          2
+--R   (1)  cosh(2x) == sinh(x)  + cosh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 76
+
+--S 77 of 298
+t1:=cosh(2*x) - (cosh(x)^2+sinh(x)^2)
+--R
+--R                 2                     2
+--R   (2)  - sinh(x)  + cosh(2x) - cosh(x)
+--R                                                     Type: Expression Integer
+--E 77
+
+--S 78 of 298
+t2:=cosh2x t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 78
+
+--S 79 of 298
+cosh2x2:=rule(cosh(2*x) == 2*cosh(x)^2-1)
+--R
+--R                            2
+--R   (4)  cosh(2x) == 2cosh(x)  - 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 79
+
+--S 80 of 298
+t3:=cosh(2*x) - (2*cosh(x)^2-1)
+--R
+--R                           2
+--R   (5)  cosh(2x) - 2cosh(x)  + 1
+--R                                                     Type: Expression Integer
+--E 80
+
+--S 81 of 298
+t4:=cosh2x2 t3
+--R
+--R   (6)  0
+--R                                                     Type: Expression Integer
+--E 81
+
+--S 82 of 298
+cosh2x3:=rule(cosh(2*x) == 1+2*sinh(x)^2)
+--R
+--R                            2
+--R   (7)  cosh(2x) == 2sinh(x)  + 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 82
+
+--S 83 of 298
+t5:=cosh(2*x) - (1+2*sinh(x)^2)
+--R
+--R                  2
+--R   (8)  - 2sinh(x)  + cosh(2x) - 1
+--R                                                     Type: Expression Integer
+--E 83
+
+--S 84 of 298
+t6:=cosh2x3 t5
+--R
+--R   (9)  0
+--R                                                     Type: Expression Integer
+--E 84
+
+@
+\subsection{8.26 ${\rm tanh}(2x)$}
+\[{\rm tanh}(2x) == \frac{2~{\rm tanh}(x)}{1+~{\rm tanh}^2(x)}\]
+<<*>>=
+)clear all
+
+--S 85 of 298
+tanh2x:=rule(tanh(2*x) == (2*tanh(x))/(1+tanh(x)^2))
+--R
+--R                      2tanh(x)
+--R   (1)  tanh(2x) == ------------
+--R                           2
+--R                    tanh(x)  + 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 85
+
+--S 86 of 298
+t1:=tanh(2*x) - (2*tanh(x))/(1+tanh(x)^2)
+--R
+--R                2
+--R        (tanh(x)  + 1)tanh(2x) - 2tanh(x)
+--R   (2)  ---------------------------------
+--R                          2
+--R                   tanh(x)  + 1
+--R                                                     Type: Expression Integer
+--E 86
+
+--S 87 of 298
+t2:=tanh2x t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 87
+
+@
+\section{Half Angle Formulas}
+\subsection{8.27 ${\rm sinh}\left(\frac{x}{2}\right)$}
+\[{\rm sinh}\left(\frac{x}{2}\right) == \pm\sqrt{\frac{{\rm cosh}(x) - 1}{2}}\quad [+~{\rm if\ \ }x > 0, -{\rm if\ \ }x < 0]\]
+
+if $x > 0$ then
+<<*>>=
+)clear all
+
+--S 88 of 298
+sinhhalf:=rule(sinh(x/2) == sqrt((cosh(x)-1)/2))
+--R
+--R                    +-----------+
+--R             x     \|cosh(x) - 1
+--R   (1)  sinh(-) == --------------
+--R             2           +-+
+--R                        \|2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 88
+
+--S 89 of 298
+t1:=sinh(x/2) - sqrt((cosh(x)-1)/2)
+--R
+--R           +-----------+    +-+     x
+--R        - \|cosh(x) - 1  + \|2 sinh(-)
+--R                                    2
+--R   (2)  ------------------------------
+--R                      +-+
+--R                     \|2
+--R                                                     Type: Expression Integer
+--E 89
+
+--S 90 of 298
+t2:=sinhhalf t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 90
+
+@
+if $x < 0$ then
+<<*>>=
+)clear all
+
+--S 91 of 298
+sinhhalfneg:=rule(sinh(x/2) == -sqrt((cosh(x)-1)/2))
+--R
+--R                      +-----------+
+--R             x       \|cosh(x) - 1
+--R   (1)  sinh(-) == - --------------
+--R             2             +-+
+--R                          \|2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 91
+
+--S 92 of 298
+t1:=sinh(x/2) - -sqrt((cosh(x)-1)/2)
+--R
+--R         +-----------+    +-+     x
+--R        \|cosh(x) - 1  + \|2 sinh(-)
+--R                                  2
+--R   (2)  ----------------------------
+--R                     +-+
+--R                    \|2
+--R                                                     Type: Expression Integer
+--E 92
+
+--S 93 of 298
+t2:=sinhhalfneg t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 93
+
+@
+\subsection{8.28 ${\rm cosh}\left(\frac{x}{2}\right)$}
+\[{\rm cosh}\left(\frac{x}{2}\right) == \sqrt{\frac{{\rm cosh}(x) + 1}{2}}\]
+<<*>>=
+)clear all
+
+--S 94 of 298
+coshhalf:=rule(cosh(x/2) == sqrt((cosh(x)+1)/2))
+--R
+--R                    +-----------+
+--R             x     \|cosh(x) + 1
+--R   (1)  cosh(-) == --------------
+--R             2           +-+
+--R                        \|2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 94
+
+--S 95 of 298
+t1:=cosh(x/2) - sqrt((cosh(x)+1)/2)
+--R
+--R           +-----------+    +-+     x
+--R        - \|cosh(x) + 1  + \|2 cosh(-)
+--R                                    2
+--R   (2)  ------------------------------
+--R                      +-+
+--R                     \|2
+--R                                                     Type: Expression Integer
+--E 95
+
+--S 96 of 298
+t2:=coshhalf t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 96
+
+@
+\subsection{8.29 ${\rm tanh}\left(\frac{x}{2}\right)$}
+\[{\rm tanh}\left(\frac{x}{2}\right) == \pm\sqrt{\frac{{\rm cosh}(x) - 1}{{\rm cosh}(x) + 1}}\quad [+~{\rm if\ \ }x > 0, -{\rm if\ \ }x < 0]\]
+\[== \frac{{\rm sinh}(x)}{{\rm cosh}(x)+1}\]
+\[== \frac{{\rm cosh}(x)-1}{{\rm sinh}(x)}\]
+
+if $x > 0$
+<<*>>=
+)clear all
+
+--S 97 of 298
+tanhhalf:=rule(tanh(x/2) == sqrt((cosh(x)-1)/(cosh(x)+1)))
+--R
+--R                    +-----------+
+--R             x      |cosh(x) - 1
+--R   (1)  tanh(-) ==  |-----------
+--R             2     \|cosh(x) + 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 97
+
+--S 98 of 298
+t1:=tanh(x/2) -sqrt((cosh(x)-1)/(cosh(x)+1))
+--R
+--R           +-----------+
+--R           |cosh(x) - 1         x
+--R   (2)  -  |-----------  + tanh(-)
+--R          \|cosh(x) + 1         2
+--R                                                     Type: Expression Integer
+--E 98
+
+--S 99 of 298
+t2:=tanhhalf t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 99
+
+@
+if $x < 0$
+<<*>>=
+)clear all
+
+--S 100 of 298
+tanhhalfneg:=rule(tanh(x/2) == -sqrt((cosh(x)-1)/(cosh(x)+1)))
+--R
+--R                      +-----------+
+--R             x        |cosh(x) - 1
+--R   (1)  tanh(-) == -  |-----------
+--R             2       \|cosh(x) + 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 100
+
+--S 101 of 298
+t1:=tanh(x/2) - -sqrt((cosh(x)-1)/(cosh(x)+1))
+--R
+--R         +-----------+
+--R         |cosh(x) - 1         x
+--R   (2)   |-----------  + tanh(-)
+--R        \|cosh(x) + 1         2
+--R                                                     Type: Expression Integer
+--E 101
+
+--S 102 of 298
+t2:=tanhhalfneg t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 102
+
+)clear all
+
+--S 103 of 298
+tanhhalf2:=rule(tanh(x/2) == sinh(x)/(cosh(x)+1))
+--R
+--R             x       sinh(x)
+--R   (1)  tanh(-) == -----------
+--R             2     cosh(x) + 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 103
+
+--S 104 of 298
+t1:=tanh(x/2) - sinh(x)/(cosh(x)+1)
+--R
+--R                          x
+--R        (cosh(x) + 1)tanh(-) - sinh(x)
+--R                          2
+--R   (2)  ------------------------------
+--R                  cosh(x) + 1
+--R                                                     Type: Expression Integer
+--E 104
+
+--S 105 of 298
+t2:=tanhhalf2 t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 105
+
+)clear all
+
+--S 106 of 298
+tanhhalf3:=rule(tanh(x/2) == (cosh(x)-1)/sinh(x))
+--R
+--R             x     cosh(x) - 1
+--R   (1)  tanh(-) == -----------
+--R             2       sinh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 106
+
+--S 107 of 298
+t1:=tanh(x/2) - (cosh(x)-1)/sinh(x)
+--R
+--R                    x
+--R        sinh(x)tanh(-) - cosh(x) + 1
+--R                    2
+--R   (2)  ----------------------------
+--R                   sinh(x)
+--R                                                     Type: Expression Integer
+--E 107
+
+--S 108 of 298
+t2:=tanhhalf3 t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 108
+
+@
+
+\section{Multiple Angle Formulas}
+\subsection{8.30 ${\rm sinh}(3x)$}
+\[{\rm sinh}(3x) == 3~{\rm sinh}(x)+4~{\rm sinh}^3(x)\]
+<<*>>=
+)clear all
+
+--S 109 of 298
+sinh3x:=rule(sinh(3*x) == 3*sinh(x)+4*sinh(x)^3)
+--R
+--R                            3
+--R   (1)  sinh(3x) == 4sinh(x)  + 3sinh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 109
+
+--S 110 of 298
+t1:=sinh(3*x) - (3*sinh(x)+4*sinh(x)^3)
+--R
+--R                           3
+--R   (2)  sinh(3x) - 4sinh(x)  - 3sinh(x)
+--R                                                     Type: Expression Integer
+--E 110
+
+--S 111 of 298
+t2:=sinh3x t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 111
+
+@
+\subsection{8.31 ${\rm cosh}(3x)$}
+\[{\rm cosh}(3x) == 4~{\rm cosh}^3(x)-3~{\rm cosh}(x)\]
+<<*>>=
+)clear all
+
+--S 112 of 298
+cosh3x:=rule(cosh(3*x) == 4*cosh(x)^3-3*cosh(x))
+--R
+--R                            3
+--R   (1)  cosh(3x) == 4cosh(x)  - 3cosh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 112
+
+--S 113 of 298
+t1:=cosh(3*x) - (4*cosh(x)^3-3*cosh(x))
+--R
+--R                           3
+--R   (2)  cosh(3x) - 4cosh(x)  + 3cosh(x)
+--R                                                     Type: Expression Integer
+--E 113
+
+--S 114 of 298
+t2:=cosh3x t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 114
+
+@
+\subsection{8.32 ${\rm tanh}(3x)$}
+\[{\rm tanh}(3x) == \frac{3~{\rm tanh}(x)+{\rm tanh}^3(x)}{1+3~{\rm tanh}^2(x)}\]
+<<*>>=
+)clear all
+
+--S 115 of 298
+tanh3x:=rule(tanh(3*x) == (3*tanh(x)+tanh(x)^3)/(1+3*tanh(x)^2))
+--R
+--R                           3
+--R                    tanh(x)  + 3tanh(x)
+--R   (1)  tanh(3x) == -------------------
+--R                               2
+--R                       3tanh(x)  + 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 115
+
+--S 116 of 298
+t1:=tanh(3*x) - (3*tanh(x)+tanh(x)^3)/(1+3*tanh(x)^2)
+--R
+--R                 2                       3
+--R        (3tanh(x)  + 1)tanh(3x) - tanh(x)  - 3tanh(x)
+--R   (2)  ---------------------------------------------
+--R                                2
+--R                        3tanh(x)  + 1
+--R                                                     Type: Expression Integer
+--E 116
+
+--S 117 of 298
+t2:=tanh3x t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 117
+
+@
+\subsection{8.33 ${\rm sinh}(4x)$}
+\[{\rm sinh}(4x) == 8~{\rm sinh}^3(x)~{\rm cosh}(x)+4~{\rm sinh}(x)~{\rm cosh}(x)\]
+<<*>>=
+)clear all
+
+--S 118 of 298
+sinh4x:=rule(sinh(4*x) == 8*sinh(x)^3*cosh(x)+4*sinh(x)*cosh(x))
+--R
+--R                                   3
+--R   (1)  sinh(4x) == 8cosh(x)sinh(x)  + 4cosh(x)sinh(x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 118
+
+--S 119 of 298
+t1:=sinh(4*x) - (8*sinh(x)^3*cosh(x)+4*sinh(x)*cosh(x))
+--R
+--R                                  3
+--R   (2)  sinh(4x) - 8cosh(x)sinh(x)  - 4cosh(x)sinh(x)
+--R                                                     Type: Expression Integer
+--E 119
+
+--S 120 of 298
+t2:=sinh4x t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 120
+
+@
+\subsection{8.34 ${\rm cosh}(4x)$}
+\[{\rm cosh}(4x) == 8~{\rm cosh}^4(x)-8~{\rm cosh}^2(x)+1\]
+<<*>>=
+)clear all
+
+--S 121 of 298
+cosh4x:=rule(cosh(4*x) == 8*cosh(x)^4-8*cosh(x)^2+1)
+--R
+--R                            4           2
+--R   (1)  cosh(4x) == 8cosh(x)  - 8cosh(x)  + 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 121
+
+--S 122 of 298
+t1:=cosh(4*x) - (8*cosh(x)^4-8*cosh(x)^2+1)
+--R
+--R                           4           2
+--R   (2)  cosh(4x) - 8cosh(x)  + 8cosh(x)  - 1
+--R                                                     Type: Expression Integer
+--E 122
+
+--S 123 of 298
+t2:=cosh4x t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 123
+
+@
+\subsection{8.35 ${\rm tanh}(4x)$}
+\[{\rm tanh}(4x) == \frac{4~{\rm tanh}(x)+4~{\rm tanh}^3(x)}{1+6~{\rm tanh}^2(x)+{\rm tanh}^4(x)}\]
+<<*>>=
+)clear all
+
+--S 124 of 298
+tanh4x:=rule(tanh(4*x) == (4*tanh(x)+4*tanh(x)^3)/(1+6*tanh(x)^2+tanh(x)^4))
+--R
+--R                              3
+--R                      4tanh(x)  + 4tanh(x)
+--R   (1)  tanh(4x) == ------------------------
+--R                           4           2
+--R                    tanh(x)  + 6tanh(x)  + 1
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 124
+
+--S 125 of 298
+t1:=tanh(4*x) - (4*tanh(x)+4*tanh(x)^3)/(1+6*tanh(x)^2+tanh(x)^4)
+--R
+--R                4           2                        3
+--R        (tanh(x)  + 6tanh(x)  + 1)tanh(4x) - 4tanh(x)  - 4tanh(x)
+--R   (2)  ---------------------------------------------------------
+--R                                4           2
+--R                         tanh(x)  + 6tanh(x)  + 1
+--R                                                     Type: Expression Integer
+--E 125
+
+--S 126 of 298
+t2:=tanh4x t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 126
+
+@
+
+\section{Powers of Hyperbolic Functions}
+\subsection{8.36 ${\rm sinh}^2(x)$}
+\[{\rm sinh}^2(x) == \frac{1}{2}~{\rm cosh}(2x)-\frac{1}{2}\]
+<<*>>=
+)clear all
+
+--S 127 of 298
+sinhsquared:=rule(sinh(x)^2 == 1/2*cosh(2*x)-1/2)
+--R
+--R               2    cosh(2x) - 1
+--R   (1)  sinh(x)  == ------------
+--R                          2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 127
+
+--S 128 of 298
+t1:=sinh(x)^2 - (1/2*cosh(2*x)-1/2)
+--R
+--R                2
+--R        2sinh(x)  - cosh(2x) + 1
+--R   (2)  ------------------------
+--R                    2
+--R                                                     Type: Expression Integer
+--E 128
+
+--S 129 of 298
+t2:=sinhsquared t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 129
+
+@
+\subsection{8.37 ${\rm cosh}^2(x)$}
+\[{\rm cosh}^2(x) == \frac{1}{2}~{\rm cosh}(2x)+\frac{1}{2}\]
+<<*>>=
+)clear all
+
+--S 130 of 298
+coshsquared:=rule(cosh(x)^2 == 1/2*cosh(2*x)+1/2)
+--E 130
+
+--S 131 of 298
+t1:=cosh(x)^2 - (1/2*cosh(2*x)+1/2)
+--E 131
+
+--S 132 of 298
+t2:=coshsquared t1
+--E 132
+
+@
+\subsection{8.38 ${\rm sinh}^3(x)$}
+\[{\rm sinh}^3(x) == \frac{1}{4}~{\rm sinh}(3x)-\frac{3}{4}~{\rm sinh}(x)\]
+<<*>>=
+)clear all
+
+--S 133 of 298
+sinhcubed:=rule(sinh(x)^3 == 1/4*sinh(3*x)-3/4*sinh(x))
+--R
+--R               3    sinh(3x) - 3sinh(x)
+--R   (1)  sinh(x)  == -------------------
+--R                             4
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 133
+
+--S 134 of 298
+t1:=sinh(x)^3 - (1/4*sinh(3*x)-3/4*sinh(x))
+--R
+--R                             3
+--R        - sinh(3x) + 4sinh(x)  + 3sinh(x)
+--R   (2)  ---------------------------------
+--R                        4
+--R                                                     Type: Expression Integer
+--E 134
+
+--S 135 of 298
+t2:=sinhcubed t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 135
+
+@
+\subsection{8.39 ${\rm cosh}^3(x)$}
+\[{\rm cosh}^3(x) == \frac{1}{4}~{\rm cosh}(3x)+\frac{3}{4}~{\rm cosh}(x)\]
+<<*>>=
+)clear all
+
+--S 136 of 298
+coshcubed:=rule(cosh(x)^3 == 1/4*cosh(3*x)+3/4*cosh(x))
+--R
+--R               3    cosh(3x) + 3cosh(x)
+--R   (1)  cosh(x)  == -------------------
+--R                             4
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 136
+
+--S 137 of 298
+t1:=cosh(x)^3 - (1/4*cosh(3*x)+3/4*cosh(x))
+--R
+--R                             3
+--R        - cosh(3x) + 4cosh(x)  - 3cosh(x)
+--R   (2)  ---------------------------------
+--R                        4
+--R                                                     Type: Expression Integer
+--E 137
+
+--S 138 of 298
+t2:=coshcubed t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 138
+
+@
+\subsection{8.40 ${\rm sinh}^4(x)$}
+\[{\rm sinh}^4(x) == \frac{3}{8}-\frac{1}{2}~{\rm cosh}(2x)+\frac{1}{8}~{\rm cosh}(4x)\]
+<<*>>=
+)clear all
+
+--S 139 of 298
+sinhfourth:=rule(sinh(x)^4 == 3/8-1/2*cosh(2*x)+1/8*cosh(4*x))
+--R
+--R               4    cosh(4x) - 4cosh(2x) + 3
+--R   (1)  sinh(x)  == ------------------------
+--R                                8
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 139
+
+--S 140 of 298
+t1:=sinh(x)^4 - (3/8-1/2*cosh(2*x)+1/8*cosh(4*x))
+--R
+--R                4
+--R        8sinh(x)  - cosh(4x) + 4cosh(2x) - 3
+--R   (2)  ------------------------------------
+--R                          8
+--R                                                     Type: Expression Integer
+--E 140
+
+--S 141 of 298
+t2:=sinhfourth t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 141
+
+@
+\subsection{8.41 ${\rm cosh}^4(x)$}
+\[{\rm cosh}^4(x) == \frac{3}{8}+\frac{1}{2}~{\rm cosh}(2x)+\frac{1}{8}~{\rm cosh}(4x)\]
+<<*>>=
+)clear all
+
+--S 142 of 298
+coshfourth:=rule(cosh(x)^4 == 3/8+1/2*cosh(2*x)+1/8*cosh(4*x))
+--R
+--R               4    cosh(4x) + 4cosh(2x) + 3
+--R   (1)  cosh(x)  == ------------------------
+--R                                8
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 142
+
+--S 143 of 298
+t1:=cosh(x)^4 - (3/8+1/2*cosh(2*x)+1/8*cosh(4*x))
+--R
+--R                                         4
+--R        - cosh(4x) - 4cosh(2x) + 8cosh(x)  - 3
+--R   (2)  --------------------------------------
+--R                           8
+--R                                                     Type: Expression Integer
+--E 143
+
+--S 144 of 298
+t2:=coshfourth t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 144
+
+@
+\section{Sum, Difference, and Product of Hyperbolic Products}
+\subsection{8.42 ${\rm sinh}(x)+{\rm sinh}(y)$}
+\[{\rm sinh}(x)+{\rm sinh}(y) == 2~{\rm sinh}(\frac{1}{2}(x+y))~{\rm cosh}(\frac{1}{2}(x-y))\]
+<<*>>=
+)clear all
+
+--S 145 of 298
+sinhplussinh:=rule(sinh(x)+sinh(y) == 2*sinh(1/2*(x+y))*cosh(1/2*(x-y)))
+--R
+--R                                        y - x      y + x
+--I   (1)  sinh(y) + sinh(x) + %M == 2cosh(-----)sinh(-----) + %M
+--R                                          2          2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 145
+
+--S 146 of 298
+t1:=sinh(x)+sinh(y) - 2*sinh(1/2*(x+y))*cosh(1/2*(x-y))
+--R
+--R                        y - x      y + x
+--R   (2)  sinh(y) - 2cosh(-----)sinh(-----) + sinh(x)
+--R                          2          2
+--R                                                     Type: Expression Integer
+--E 146
+
+--S 147 of 298
+t2:=sinhplussinh t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 147
+
+@
+\subsection{8.43 ${\rm sinh}(x)-{\rm sinh}(y)$}
+\[{\rm sinh}(x)-{\rm sinh}(y) == 2~{\rm cosh}(\frac{1}{2}(x+y))~{\rm sinh}(\frac{1}{2}(x-y))\]
+<<*>>=
+)clear all
+
+--S 148 of 298
+sinhminussinh:=rule(sinh(x)-sinh(y) == 2*cosh(1/2*(x+y))*sinh(1/2*(x-y)))
+--R
+--R                                            y + x      y - x
+--I   (1)  - sinh(y) + sinh(x) + %N == - 2cosh(-----)sinh(-----) + %N
+--R                                              2          2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 148
+
+--S 149 of 298
+t1:=sinh(x)-sinh(y) - 2*cosh(1/2*(x+y))*sinh(1/2*(x-y))
+--R
+--R                          y + x      y - x
+--R   (2)  - sinh(y) + 2cosh(-----)sinh(-----) + sinh(x)
+--R                            2          2
+--R                                                     Type: Expression Integer
+--E 149
+
+--S 150 of 298
+t2:=sinhminussinh t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 150
+
+@
+\subsection{8.44 ${\rm cosh}(x)+{\rm cosh}(y)$}
+\[{\rm cosh}(x)+{\rm cosh}(y) == 2~{\rm cosh}(\frac{1}{2}(x+y))~{\rm cosh}(\frac{1}{2}(x-y))\]
+<<*>>=
+)clear all
+
+--S 151 of 298
+coshpluscosh:=rule(cosh(x)+cosh(y) == 2*cosh(1/2*(x+y))*cosh(1/2*(x-y)))
+--R
+--R                                        y - x      y + x
+--I   (1)  cosh(y) + cosh(x) + %O == 2cosh(-----)cosh(-----) + %O
+--R                                          2          2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 151
+
+--S 152 of 298
+t1:=cosh(x)+cosh(y) - 2*cosh(1/2*(x+y))*cosh(1/2*(x-y))
+--R
+--R                        y - x      y + x
+--R   (2)  cosh(y) - 2cosh(-----)cosh(-----) + cosh(x)
+--R                          2          2
+--R                                                     Type: Expression Integer
+--E 152
+
+--S 153 of 298
+t2:=coshpluscosh t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 153
+
+@
+\subsection{8.45 ${\rm cosh}(x)-{\rm cosh}(y)$}
+\[{\rm cosh}(x)-{\rm cosh}(y) == 2~{\rm sinh}(\frac{1}{2}(x+y))~{\rm sinh}(\frac{1}{2}(x-y))\]
+<<*>>=
+)clear all
+
+--S 154 of 298
+coshminuscosh:=rule(cosh(x)-cosh(y) == 2*sinh(1/2*(x+y))*sinh(1/2*(x-y)))
+--R
+--R                                            y - x      y + x
+--I   (1)  - cosh(y) + cosh(x) + %P == - 2sinh(-----)sinh(-----) + %P
+--R                                              2          2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 154
+
+--S 155 of 298
+t1:=cosh(x)-cosh(y) - 2*sinh(1/2*(x+y))*sinh(1/2*(x-y))
+--R
+--R              y - x      y + x
+--R   (2)  2sinh(-----)sinh(-----) - cosh(y) + cosh(x)
+--R                2          2
+--R                                                     Type: Expression Integer
+--E 155
+
+--S 156 of 298
+t2:=coshminuscosh t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 156
+
+@
+\subsection{8.46 ${\rm sinh}(x){\rm sinh}(y)$}
+\[{\rm sinh}(x){\rm sinh}(y) == \frac{1}{2}(~{\rm cosh}(x+y)-{\rm cosh}(x-y))\]
+<<*>>=
+)clear all
+
+--S 157 of 298
+sinhtimessinh:=rule(sinh(x)*sinh(y) == 1/2*(cosh(x+y)-cosh(x-y)))
+--R
+--I                             %Q cosh(y + x) - %Q cosh(y - x)
+--I   (1)  %Q sinh(x)sinh(y) == -------------------------------
+--R                                            2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 157
+
+--S 158 of 298
+t1:=sinh(x)*sinh(y) - (1/2*(cosh(x+y)-cosh(x-y)))
+--R
+--R        2sinh(x)sinh(y) - cosh(y + x) + cosh(y - x)
+--R   (2)  -------------------------------------------
+--R                             2
+--R                                                     Type: Expression Integer
+--E 158
+
+--S 159 of 298
+t2:=sinhtimessinh t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 159
+
+@
+\subsection{8.47 ${\rm cosh}(x){\rm cosh}(y)$}
+\[{\rm cosh}(x){\rm cosh}(y) == \frac{1}{2}(~{\rm cosh}(x+y)+{\rm cosh}(x-y))\]
+<<*>>=
+)clear all
+
+--S 160 of 298
+coshtimescosh:=rule(cosh(x)*cosh(y)==1/2*(cosh(x+y)+cosh(x-y)))
+--R
+--I                             %R cosh(y + x) + %R cosh(y - x)
+--I   (1)  %R cosh(x)cosh(y) == -------------------------------
+--R                                            2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 160
+
+--S 161 of 298
+t1:=cosh(x)*cosh(y) - 1/2*(cosh(x+y)+cosh(x-y))
+--R
+--R        - cosh(y + x) + 2cosh(x)cosh(y) - cosh(y - x)
+--R   (2)  ---------------------------------------------
+--R                              2
+--R                                                     Type: Expression Integer
+--E 161
+
+--S 162 of 298
+t2:=coshtimescosh t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 162
+
+@
+\subsection{8.48 ${\rm sinh}(x){\rm cosh}(y)$}
+\[{\rm sinh}(x){\rm cosh}(y) == \frac{1}{2}(~{\rm sinh}(x+y)+{\rm sinh}(x-y))\]
+<<*>>=
+)clear all
+
+--S 163 of 298
+sinhtimescosh:=rule(sinh(x)*cosh(y) == 1/2*(sinh(x+y)+sinh(x-y)))
+--R
+--I                             %S sinh(y + x) - %S sinh(y - x)
+--I   (1)  %S cosh(y)sinh(x) == -------------------------------
+--R                                            2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 163
+
+--S 164 of 298
+t1:=sinh(x)*cosh(y) - 1/2*(sinh(x+y)+sinh(x-y))
+--R
+--R        - sinh(y + x) + sinh(y - x) + 2cosh(y)sinh(x)
+--R   (2)  ---------------------------------------------
+--R                              2
+--R                                                     Type: Expression Integer
+--E 164
+
+--S 165 of 298
+t2:=sinhtimescosh t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 165
+
+@
+\section{Inverse Hyperbolic Functions}
+\subsection{8.55 ${\rm sinh}^{-1}(x)$}
+\[{\rm asinh}(x) == \log(x+\sqrt{x^2+1}) \quad {\rm if\ \ } -\infty < x < \infty\]
+<<*>>=
+)clear all
+
+--S 166 of 298
+asinhrule:=rule(asinh(x) == log(x+sqrt(x^2+1)))
+--R
+--R                         +------+
+--R                         | 2
+--R   (1)  asinh(x) == log(\|x  + 1  + x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 166
+
+--S 167 of 298
+t1:=asinh(x) - log(x+sqrt(x^2+1))
+--R
+--R               +------+
+--R               | 2
+--R   (2)  - log(\|x  + 1  + x) + asinh(x)
+--R                                                     Type: Expression Integer
+--E 167
+
+--S 168 of 298
+t2:=asinhrule t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 168
+
+@
+\subsection{8.56 ${\rm cosh}^{-1}(x)$}
+\[{\rm acosh}(x) == \log(x+\sqrt{x^2-1}) \quad {\rm if\ \ } x \ge 1\]
+<<*>>=
+)clear all
+
+--S 169 of 298
+acoshrule:=rule(acosh(x) == log(x+sqrt(x^2-1)))
+--R
+--R                         +------+
+--R                         | 2
+--R   (1)  acosh(x) == log(\|x  - 1  + x)
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 169
+
+--S 170 of 298
+t1:=acosh(x) - log(x+sqrt(x^2-1))
+--R
+--R               +------+
+--R               | 2
+--R   (2)  - log(\|x  - 1  + x) + acosh(x)
+--R                                                     Type: Expression Integer
+--E 170
+
+--S 171 of 298
+t2:=acoshrule t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 171
+
+@
+
+\subsection{8.57 ${\rm tanh}^{-1}(x)$}
+\[{\rm atanh}(x) == \frac{1}{2}\log(\frac{1+x}{1-x}) \quad {\rm if\ \ } -1 < x < 1\]
+<<*>>=
+)clear all
+
+--S 172 of 298
+atanhrule:=rule(atanh(x) == 1/2*log((1+x)/(1-x)))
+--R
+--R                        - x - 1
+--R                    log(-------)
+--R                         x - 1
+--R   (1)  atanh(x) == ------------
+--R                          2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 172
+
+--S 173 of 298
+t1:=atanh(x) - 1/2*log((1+x)/(1-x))
+--R
+--R              - x - 1
+--R        - log(-------) + 2atanh(x)
+--R               x - 1
+--R   (2)  --------------------------
+--R                     2
+--R                                                     Type: Expression Integer
+--E 173
+
+--S 174 of 298
+t2:=atanhrule t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 174
+
+@
+
+\subsection{8.58 ${\rm coth}^{-1}(x)$}
+\[{\rm acoth}(x) == \frac{1}{2}\log(\frac{x+1}{x-1}) \quad {\rm if\ \ } x>1 or x<-1\]
+<<*>>=
+)clear all
+
+--S 175 of 298
+acothrule:=rule(acoth(x) == 1/2*log((x+1)/(x-1)))
+--R
+--R                        x + 1
+--R                    log(-----)
+--R                        x - 1
+--R   (1)  acoth(x) == ----------
+--R                         2
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 175
+
+--S 176 of 298
+t1:=acoth(x) - 1/2*log((x+1)/(x-1))
+--R
+--R              x + 1
+--R        - log(-----) + 2acoth(x)
+--R              x - 1
+--R   (2)  ------------------------
+--R                    2
+--R                                                     Type: Expression Integer
+--E 176
+
+--S 177 of 298
+t2:=acothrule t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 177
+
+@
+
+\subsection{8.59 ${\rm sech}^{-1}(x)$}
+\[{\rm asech}(x) == \log(\frac{1}{x}+\sqrt{\frac{1}{x^2}-1}) \quad {\rm if\ \ } 0 < x \le 1\]
+<<*>>=
+)clear all
+
+--S 178 of 298
+asechrule:=rule(asech(x) == log(1/x+sqrt(1/x^2-1)))
+--R
+--R                          +--------+
+--R                          |   2
+--R                          |- x  + 1
+--R                        x |--------  + 1
+--R                          |    2
+--R                         \|   x
+--R   (1)  asech(x) == log(----------------)
+--R                                x
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 178
+
+--S 179 of 298
+t1:=asech(x) - log(1/x+sqrt(1/x^2-1))
+--R
+--R                +--------+
+--R                |   2
+--R                |- x  + 1
+--R              x |--------  + 1
+--R                |    2
+--R               \|   x
+--R   (2)  - log(----------------) + asech(x)
+--R                      x
+--R                                                     Type: Expression Integer
+--E 179
+
+--S 180 of 298
+t2:=asechrule t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 180
+
+@
+\subsection{8.60 ${\rm csch}^{-1}(x)$}
+\[{\rm acsch}(x) == \log(\frac{1}{x}+\sqrt{\frac{1}{x^2}+1}) \quad {\rm if\ \ } x \ne 0\]
+<<*>>=
+)clear all
+
+--S 181 of 298
+acschrule:=rule(acsch(x) == log(1/x+sqrt(1/x^2+1)))
+--R
+--R                          +------+
+--R                          | 2
+--R                          |x  + 1
+--R                        x |------  + 1
+--R                          |   2
+--R                         \|  x
+--R   (1)  acsch(x) == log(--------------)
+--R                               x
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 181
+
+--S 182 of 298
+t1:=acsch(x) - log(1/x+sqrt(1/x^2+1))
+--R
+--R                +------+
+--R                | 2
+--R                |x  + 1
+--R              x |------  + 1
+--R                |   2
+--R               \|  x
+--R   (2)  - log(--------------) + acsch(x)
+--R                     x
+--R                                                     Type: Expression Integer
+--E 182
+
+--S 183 of 298
+t2:=acschrule t1
+--R
+--R   (3)  0
+--R                                                     Type: Expression Integer
+--E 183
+
+@
+\section{Relations between Inverse Hyperbolic Functions}
+\subsection{8.61 ${\rm csch}^{-1}(x)$}
+\[{\rm csch}^{-1}(x) == {\rm sinh}^{-1}\left(\frac{1}{x}\right)\]
+<<*>>=
+)clear all
+
+--S 184 of 298
+cschinv:=rule(csch(x)^(-1) == sinh(1/x)^(-1))
+--R
+--R           1          1
+--R   (1)  ------- == -------
+--R        csch(x)         1
+--R                   sinh(-)
+--R                        x
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 184
+
+--S 185 of 298
+t1:=csch(x)^(-1) - sinh(1/x)^(-1)
+--R
+--R             1
+--R        sinh(-) - csch(x)
+--R             x
+--R   (2)  -----------------
+--R                      1
+--R          csch(x)sinh(-)
+--R                      x
+--R                                                     Type: Expression Integer
+--E 185
+
+--S 186 of 298
+t2:=cschinv t1
+--R
+--R             1
+--R        sinh(-) - csch(x)
+--R             x
+--R   (3)  -----------------
+--R                      1
+--R          csch(x)sinh(-)
+--R                      x
+--R                                                     Type: Expression Integer
+--E 186
+
+@
+\subsection{8.62 ${\rm sech}^{-1}(x)$}
+\[{\rm sech}^{-1}(x) == {\rm cosh}^{-1}\left(\frac{1}{x}\right)\]
+<<*>>=
+)clear all
+
+--S 187 of 298
+sechinv:=rule(sech(x)^(-1) == cosh(1/x)^(-1))
+--R
+--R           1          1
+--R   (1)  ------- == -------
+--R        sech(x)         1
+--R                   cosh(-)
+--R                        x
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 187
+
+--S 188 of 298
+t1:=sech(x)^(-1) - cosh(1/x)^(-1)
+--R
+--R                         1
+--R        - sech(x) + cosh(-)
+--R                         x
+--R   (2)  -------------------
+--R                1
+--R           cosh(-)sech(x)
+--R                x
+--R                                                     Type: Expression Integer
+--E 188
+
+--S 189 of 298
+t2:=sechinv t1
+--R
+--R                         1
+--R        - sech(x) + cosh(-)
+--R                         x
+--R   (3)  -------------------
+--R                1
+--R           cosh(-)sech(x)
+--R                x
+--R                                                     Type: Expression Integer
+--E 189
+
+@
+\subsection{8.63 ${\rm coth}^{-1}(x)$}
+\[{\rm coth}^{-1}(x) == {\rm tanh}^{-1}\left(\frac{1}{x}\right)\]
+<<*>>=
+)clear all
+
+--S 190 of 298
+cothinv:=rule(coth(x)^(-1) == tanh(1/x)^(-1))
+--R
+--R           1          1
+--R   (1)  ------- == -------
+--R        coth(x)         1
+--R                   tanh(-)
+--R                        x
+--R                        Type: RewriteRule(Integer,Integer,Expression Integer)
+--E 190
+
+--S 191 of 298
+t1:=coth(x)^(-1) - tanh(1/x)^(-1)
+--R
+--R             1
+--R        tanh(-) - coth(x)
+--R             x
+--R   (2)  -----------------
+--R                      1
+--R          coth(x)tanh(-)
+--R                      x
+--R                                                     Type: Expression Integer
+--E 191
+
+--S 192 of 298
+t2:=cothinv t1
+--R
+--R             1
+--R        tanh(-) - coth(x)
+--R             x
+--R   (3)  -----------------
+--R                      1
+--R          coth(x)tanh(-)
+--R                      x
+--R                                                     Type: Expression Integer
+--E 192
+
+@
+\subsection{8.64 ${\rm sinh}^{-1}(x)$}
+\[{\rm sinh}^{-1}(x) == -~{\rm sinh}^{-1}(x)\]
+These identities are already known to Axiom
+<<*>>=
+)clear all
+
+--S 193 of 298
+t1:=sinh(-x)^(-1) - -sinh(x)^(-1)
+--R
+--R   (1)  0
+--R                                                     Type: Expression Integer
+--E 193
+
+@
+\subsection{8.65 ${\rm tanh}^{-1}(x)$}
+\[{\rm tanh}^{-1}(x) == -~{\rm tanh}^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 194 of 298
+t1:=tanh(-x)^(-1) - -tanh(x)^(-1)
+--R
+--R   (1)  0
+--R                                                     Type: Expression Integer
+--E 194
+
+@
+\subsection{8.66 ${\rm coth}^{-1}(x)$}
+\[{\rm coth}^{-1}(x) == -~{\rm coth}^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 195 of 298
+t1:=coth(-x)^(-1) - -coth(x)^(-1)
+--R
+--R   (1)  0
+--R                                                     Type: Expression Integer
+--E 195
+
+@
+\subsection{8.67 ${\rm csch}^{-1}(x)$}
+\[{\rm csch}^{-1}(x) == -~{\rm csch}^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 196 of 298
+t1:=csch(-x)^(-1) - -csch(x)^(-1)
+--R
+--R   (1)  0
+--R                                                     Type: Expression Integer
+--E 196
+
+@
+\section{Relationship between Hyperbolic and Trigonometric Functions}
+\subsection{8.74 $\sin(ix)$}
+\[\sin(ix) == i~{\rm sinh}(x)\]
+This match does not work.
+<<*>>=
+)clear all
+
+--S 197 of 298
+sininv:=rule(sin(%i*x) == %i*sinh(x))
+--R
+--R   (1)  sin(%i x) == %i sinh(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 197
+
+--S 198 of 298
+t1:=sin(x*%i) - %i*sinh(x)
+--R
+--R   (2)  - %i sinh(x) + sin(%i x)
+--R                                             Type: Expression Complex Integer
+--E 198
+
+--S 199 of 298
+t2:=sininv t1
+--R
+--R   (3)  - %i sinh(x) + sin(%i x)
+--R                                             Type: Expression Complex Integer
+--E 199
+
+@
+\subsection{8.75 $\cos(ix)$}
+\[\cos(ix) == {\rm cosh}(x)\]
+<<*>>=
+)clear all
+
+--S 200 of 298
+cosinv:=rule(cos(x*%i) == cosh(x))
+--R
+--R   (1)  cos(%i x) == cosh(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 200
+
+--S 201 of 298
+t1:=cos(x*%i) - cosh(x)
+--R
+--R   (2)  - cosh(x) + cos(%i x)
+--R                                             Type: Expression Complex Integer
+--E 201
+
+--S 202 of 298
+t2:=cosinv t1
+--R
+--R   (3)  - cosh(x) + cos(%i x)
+--R                                             Type: Expression Complex Integer
+--E 202
+
+@
+\subsection{8.76 $\tan(ix)$}
+\[\tan(ix) == i~{\rm tanh}(x)\]
+<<*>>=
+)clear all
+
+--S 203 of 298
+taninv:=rule(tan(x*%i) == %i*tanh(x))
+--R
+--R   (1)  tan(%i x) == %i tanh(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 203
+
+--S 204 of 298
+t1:=tan(x*%i) - %i*tanh(x)
+--R
+--R   (2)  - %i tanh(x) + tan(%i x)
+--R                                             Type: Expression Complex Integer
+--E 204
+
+--S 205 of 298
+t2:=taninv t1
+--R
+--R   (3)  - %i tanh(x) + tan(%i x)
+--R                                             Type: Expression Complex Integer
+--E 205
+
+@
+\subsection{8.77 $\csc(ix)$}
+\[\csc(ix) == -i~{\rm csch}(x)\]
+<<*>>=
+)clear all
+
+--S 206 of 298
+cscinv:=rule(csc(x*%i) == -%i*csch(x))
+--R
+--R   (1)  csc(%i x) == - %i csch(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 206
+
+--S 207 of 298
+t1:=csc(x*%i) - -%i*csch(x)
+--R
+--R   (2)  %i csch(x) + csc(%i x)
+--R                                             Type: Expression Complex Integer
+--E 207
+
+--S 208 of 298
+t2:=cscinv t1
+--R
+--R   (3)  %i csch(x) + csc(%i x)
+--R                                             Type: Expression Complex Integer
+--E 208
+
+@
+\subsection{8.78 $\sec(ix)$}
+\[\sec(ix) == {\rm sech}(x)\]
+<<*>>=
+)clear all
+
+--S 209 of 298
+secinv:=rule(sec(x*%i) == sech(x))
+--R
+--R   (1)  sec(%i x) == sech(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 209
+
+--S 210 of 298
+t1:=sec(x*%i) - sech(x)
+--R
+--R   (2)  - sech(x) + sec(%i x)
+--R                                             Type: Expression Complex Integer
+--E 210
+
+--S 211 of 298
+t2:=secinv t1
+--R
+--R   (3)  - sech(x) + sec(%i x)
+--R                                             Type: Expression Complex Integer
+--E 211
+
+@
+\subsection{8.79 $\cot(ix)$}
+\[\cot(ix) == -i~{\rm coth}(x)\]
+<<*>>=
+)clear all
+
+--S 212 of 298
+cotinv:=rule(cot(x*%i) == -%i*coth(x))
+--R
+--R   (1)  cot(%i x) == - %i coth(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 212
+
+--S 213 of 298
+t1:=cot(x*%i) - -%i*coth(x)
+--R
+--R   (2)  %i coth(x) + cot(%i x)
+--R                                             Type: Expression Complex Integer
+--E 213
+
+--S 214 of 298
+t2:=cotinv t1
+--R
+--R   (3)  %i coth(x) + cot(%i x)
+--R                                             Type: Expression Complex Integer
+--E 214 
+
+@
+\subsection{8.80 ${\rm sinh}(ix)$}
+\[\sinh(ix) == i~\sin(x)\]
+<<*>>=
+)clear all
+
+--S 215 of 298
+sinhinv:=rule(sinh(x*%i) == %i*sin(x))
+--R
+--R   (1)  sinh(%i x) == %i sin(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 215
+
+--S 216 of 298
+t1:=sinh(x*%i) - %i*sin(x)
+--R
+--R   (2)  sinh(%i x) - %i sin(x)
+--R                                             Type: Expression Complex Integer
+--E 216
+
+--S 217 of 298
+t2:=sinhinv t1
+--R
+--R   (3)  sinh(%i x) - %i sin(x)
+--R                                             Type: Expression Complex Integer
+--E 217
+
+@
+\subsection{8.81 ${\rm cosh}(ix)$}
+\[\cosh(ix) == \cos(x)\]
+<<*>>=
+)clear all
+
+--S 218 of 298
+coshinv:=rule(cosh(x*%i) == cos(x))
+--R
+--R   (1)  cosh(%i x) == cos(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 218
+
+--S 219 of 298
+t1:=cosh(x*%i) - cos(x)
+--R
+--R   (2)  cosh(%i x) - cos(x)
+--R                                             Type: Expression Complex Integer
+--E 219
+
+--S 220 of 298
+t2:=coshinv t1
+--R
+--R   (3)  cosh(%i x) - cos(x)
+--R                                             Type: Expression Complex Integer
+--E 220
+
+@
+p\subsection{8.82 ${\rm tanh}(ix)$}
+\[\tanh(ix) == i\tan(x)\]
+<<*>>=
+)clear all
+
+--S 221 of 298
+tanhinv:=rule(tanh(x*%i) == %i*tan(x))
+--R
+--R   (1)  tanh(%i x) == %i tan(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 221
+
+--S 222 of 298
+t1:=tanh(x*%i) - %i*tan(x)
+--R
+--R   (2)  tanh(%i x) - %i tan(x)
+--R                                             Type: Expression Complex Integer
+--E 222
+
+--S 223 of 298
+t2:=tanhinv t1
+--R
+--R   (3)  tanh(%i x) - %i tan(x)
+--R                                             Type: Expression Complex Integer
+--E 223
+
+@
+\subsection{8.83 ${\rm csch}(ix)$}
+\[{\rm csch}(ix) == -i \csc(x)\]
+<<*>>=
+)clear all
+
+--S 224 of 298
+cschinv:=rule(x*%i == -%i*csc(x))
+--R
+--R   (1)  %i x == - %i csc(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 224
+
+--S 225 of 298
+t1:=x*%i - -%i*csc(x)
+--R
+--R   (2)  %i csc(x) + %i x
+--R                                             Type: Expression Complex Integer
+--E 225
+
+--S 226 of 298
+t2:=cschinv t1
+--R
+--R   (3)  %i csc(x) + %i x
+--R                                             Type: Expression Complex Integer
+--E 226
+
+@
+\subsection{8.84 ${\rm sech}(ix)$}
+\[{\rm sech}(ix) == \sec(x)\]
+<<*>>=
+)clear all
+
+--S 227 of 298
+sechinv:=rule(sech(x*%i) == sec(x))
+--R
+--R   (1)  sech(%i x) == sec(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 227
+
+--S 228 of 298
+t1:=sech(x*%i) - sec(x)
+--R
+--R   (2)  sech(%i x) - sec(x)
+--R                                             Type: Expression Complex Integer
+--E 228
+
+--S 229 of 298
+t2:=sechinv t1
+--R
+--R   (3)  sech(%i x) - sec(x)
+--R                                             Type: Expression Complex Integer
+--E 229
+
+@
+\subsection{8.85 ${\rm coth}(ix)$}
+\[{\rm coth}(ix) == -i \cot(x)\]
+<<*>>=
+)clear all
+
+--S 230 of 298
+cothinv:=rule(coth(x*%i) == -%i*cot(x))
+--R
+--R   (1)  coth(%i x) == - %i cot(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 230
+
+--S 231 of 298
+t1:=coth(x*%i) - -%i*cot(x)
+--R
+--R   (2)  coth(%i x) + %i cot(x)
+--R                                             Type: Expression Complex Integer
+--E 231
+
+--S 232 of 298
+t2:=cothinv t1
+--R
+--R   (3)  coth(%i x) + %i cot(x)
+--R                                             Type: Expression Complex Integer
+--E 232
+
+@
+
+\section{Periodicity of Hyperbolic Functions}
+\subsection{8.86 ${\rm sinh}(x+2k\pi i)$}
+\[{\rm sinh}(x+2k\pi i) == {\rm sinh}(x)\]
+<<*>>=
+)clear all
+
+--S 233 of 298
+sinhperiod:=rule(sinh(x+2*k*%pi*%i) == sinh(x))
+--R
+--R   (1)  sinh(x + 2%i k %pi) == sinh(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 233
+
+--S 234 of 298
+t1:=sinh(x+2*k*%pi*%i) - sinh(x)
+--R
+--R   (2)  sinh(x + 2%i k %pi) - sinh(x)
+--R                                             Type: Expression Complex Integer
+--E 234
+
+--S 235 of 298
+t2:=sinhperiod t1
+--R
+--R   (3)  sinh(x + 2%i k %pi) - sinh(x)
+--R                                             Type: Expression Complex Integer
+--E 235
+
+@
+\subsection{8.87 ${\rm cosh}(x+2k\pi i)$} 
+\[{\rm cosh}(x+2k\pi i) == {\rm cosh}(x)\]
+<<*>>=
+)clear all
+
+--S 236 of 298
+coshperiod:=rule(cosh(x+2*k*%pi*%i) == cosh(x))
+--R
+--R   (1)  cosh(x + 2%i k %pi) == cosh(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 236
+
+--S 237 of 298
+t1:=cosh(x+2*k*%pi*%i) - cosh(x)
+--R
+--R   (2)  cosh(x + 2%i k %pi) - cosh(x)
+--R                                             Type: Expression Complex Integer
+--E 237
+
+--S 238 of 298
+t2:=coshperiod t1
+--R
+--R   (3)  cosh(x + 2%i k %pi) - cosh(x)
+--R                                             Type: Expression Complex Integer
+--E 238
+
+@
+\subsection{8.88 ${\rm tanh}(x+2k\pi i)$} 
+\[{\rm tanh}(x+k\pi i) == {\rm tanh}(x)\]
+<<*>>=
+)clear all
+
+--S 239 of 298
+tanhperiod:=rule(tanh(x+k*%pi*%i) == tanh(x))
+--R
+--R   (1)  tanh(x + %i k %pi) == tanh(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 239
+
+--S 240 of 298
+t1:=tanh(x+k*%pi*%i) - tanh(x)
+--R
+--R   (2)  tanh(x + %i k %pi) - tanh(x)
+--R                                             Type: Expression Complex Integer
+--E 240
+
+--S 241 of 298
+t2:=tanhperiod t1
+--R
+--R   (3)  tanh(x + %i k %pi) - tanh(x)
+--R                                             Type: Expression Complex Integer
+--E 241
+
+@
+\subsection{8.89 ${\rm csch}(x+2k\pi i)$} 
+\[{\rm csch}(x+2k\pi i) == {\rm csch}(x)\]
+<<*>>=
+)clear all
+
+--S 242 of 298
+cschperiod:=rule(csch(x+2*k*%pi*%i) == csch(x))
+--R
+--R   (1)  csch(x + 2%i k %pi) == csch(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 242
+
+--S 243 of 298
+t1:=csch(x+2*k*%pi*%i) - csch(x)
+--R
+--R   (2)  csch(x + 2%i k %pi) - csch(x)
+--R                                             Type: Expression Complex Integer
+--E 243
+
+--S 244 of 298
+t2:=cschperiod t1
+--R
+--R   (3)  csch(x + 2%i k %pi) - csch(x)
+--R                                             Type: Expression Complex Integer
+--E 244
+
+@
+\subsection{8.90 ${\rm sech}(x+2k\pi i)$} 
+\[{\rm sech}(x+2k\pi i) == {\rm sech}(x)\]
+<<*>>=
+)clear all
+
+--S 245 of 298
+sechperiod:=rule(sech(x+2*k*%pi*%i) == sech(x))
+--R
+--R   (1)  sech(x + 2%i k %pi) == sech(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 245
+
+--S 246 of 298
+t1:=sech(x+2*k*%pi*%i) - sech(x)
+--R
+--R   (2)  sech(x + 2%i k %pi) - sech(x)
+--R                                             Type: Expression Complex Integer
+--E 246
+
+--S 247 of 298
+t2:=sechperiod t1
+--R
+--R   (3)  sech(x + 2%i k %pi) - sech(x)
+--R                                             Type: Expression Complex Integer
+--E 247
+
+@
+\subsection{8.91 ${\rm coth}(x+2k\pi i)$} 
+\[{\rm coth}(x+k\pi i) == {\rm coth}(x)\]
+<<*>>=
+)clear all
+
+--S 248 of 298
+cothperiod:=rule(coth(x+k*%pi*%i) == coth(x))
+--R
+--R   (1)  coth(x + %i k %pi) == coth(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 248
+
+--S 249 of 298
+t1:=coth(x+k*%pi*%i) - coth(x)
+--R
+--R   (2)  coth(x + %i k %pi) - coth(x)
+--R                                             Type: Expression Complex Integer
+--E 249
+
+--S 250 of 298
+t2:=cothperiod t1
+--R
+--R   (3)  coth(x + %i k %pi) - coth(x)
+--R                                             Type: Expression Complex Integer
+--E 250
+
+@
+
+\section{Relationship between Inverse Hyperbolic and Inverse Trigonometric Functions}
+These patterns do not match in Axiom.
+\subsection{8.92 $\sin^{-1}(ix)$}
+\[\sin^{-1}(ix) == i~{\rm sinh}^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 251 of 298
+sinsinh:=rule(sin(%i*x)^(-1) == %i*sinh(x)^(-1))
+--R
+--R            1           %i
+--R   (1)  --------- == -------
+--R        sin(%i x)    sinh(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 251
+
+--S 252 of 298
+t1:=sin(%i*x)^(-1) - %i*sinh(x)^(-1)
+--R
+--R        sinh(x) - %i sin(%i x)
+--R   (2)  ----------------------
+--R           sin(%i x)sinh(x)
+--R                                             Type: Expression Complex Integer
+--E 252
+
+--S 253 of 298
+t2:=sinsinh t1
+--R
+--R        sinh(x) - %i sin(%i x)
+--R   (3)  ----------------------
+--R           sin(%i x)sinh(x)
+--R                                             Type: Expression Complex Integer
+--E 253
+
+@
+\subsection{8.93 ${\rm \sinh}^{-1}(ix)$}
+\[{\rm \sinh}^{-1}(ix) == i~\sin^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 254 of 298
+sinhsin:=rule(sinh(%i*x)^(-1) == %i*sin(x)^(-1))
+--R
+--R             1          %i
+--R   (1)  ---------- == ------
+--R        sinh(%i x)    sin(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 254
+
+--S 255 of 298
+t1:=sinh(%i*x)^(-1) - %i*sin(x)^(-1)
+--R
+--R        - %i sinh(%i x) + sin(x)
+--R   (2)  ------------------------
+--R            sin(x)sinh(%i x)
+--R                                             Type: Expression Complex Integer
+--E 255
+
+--S 256 of 298
+t2:=sinhsin t1
+--R
+--R        - %i sinh(%i x) + sin(x)
+--R   (3)  ------------------------
+--R            sin(x)sinh(%i x)
+--R                                             Type: Expression Complex Integer
+--E 256
+
+@
+\subsection{8.94 $\cos^{-1}(x)$}
+\[\cos^{-1}(x) == \pm ~{\rm cosh}^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 257 of 298
+coscosh:=rule(cos(x)^(-1) == %i*cosh(x)^(-1))
+--R
+--R           1         %i
+--R   (1)  ------ == -------
+--R        cos(x)    cosh(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 257
+
+--S 258 of 298
+t1:=cos(x)^(-1) - %i*cosh(x)^(-1)
+--R
+--R        cosh(x) - %i cos(x)
+--R   (2)  -------------------
+--R           cos(x)cosh(x)
+--R                                             Type: Expression Complex Integer
+--E 258
+
+--S 259 of 298
+t2:=coscosh t1
+--R
+--R        cosh(x) - %i cos(x)
+--R   (3)  -------------------
+--R           cos(x)cosh(x)
+--R                                             Type: Expression Complex Integer
+--E 259
+
+)clear all
+
+--S 260 of 298
+coscosh2:=rule(cos(x)^(-1) == -%i*cosh(x)^(-1))
+--R
+--R           1           %i
+--R   (1)  ------ == - -------
+--R        cos(x)      cosh(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 260
+
+--S 261 of 298
+t1:=cos(x)^(-1) - -%i*cosh(x)^(-1)
+--R
+--R        cosh(x) + %i cos(x)
+--R   (2)  -------------------
+--R           cos(x)cosh(x)
+--R                                             Type: Expression Complex Integer
+--E 261
+
+--S 262 of 298
+t2:=coscosh2 t1
+--R
+--R        cosh(x) + %i cos(x)
+--R   (3)  -------------------
+--R           cos(x)cosh(x)
+--R                                             Type: Expression Complex Integer
+--E 262
+
+@
+\subsection{8.95 ${\rm \cosh}^{-1}(x)$}
+\[{\rm \cosh}^{-1}(x) == \pm i~\cos^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 263 of 298
+coshcos:=rule(cosh(x)^(-1) == %i*cos(x)^(-1))
+--R
+--R           1         %i
+--R   (1)  ------- == ------
+--R        cosh(x)    cos(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 263
+
+--S 264 of 298
+t1:=cosh(x)^(-1) - %i*cos(x)^(-1)
+--R
+--R        - %i cosh(x) + cos(x)
+--R   (2)  ---------------------
+--R            cos(x)cosh(x)
+--R                                             Type: Expression Complex Integer
+--E 264
+
+--S 265 of 298
+t2:=coshcos t1
+--R
+--R        - %i cosh(x) + cos(x)
+--R   (3)  ---------------------
+--R            cos(x)cosh(x)
+--R                                             Type: Expression Complex Integer
+--E 265
+
+)clear all
+
+--S 266 of 298
+coshcos2:=rule(cosh(x)^(-1) == -%i*cos(x)^(-1))
+--R
+--R           1           %i
+--R   (1)  ------- == - ------
+--R        cosh(x)      cos(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 266
+
+--S 267 of 298
+t1:=cosh(x)^(-1) - -%i*cos(x)^(-1)
+--R
+--R        %i cosh(x) + cos(x)
+--R   (2)  -------------------
+--R           cos(x)cosh(x)
+--R                                             Type: Expression Complex Integer
+--E 267
+
+--S 268 of 298
+t2:=coshcos2 t1
+--R
+--R        %i cosh(x) + cos(x)
+--R   (3)  -------------------
+--R           cos(x)cosh(x)
+--R                                             Type: Expression Complex Integer
+--E 268
+
+@
+\subsection{8.96 $\tan^{-1}(ix)$}
+\[\tan^{-1}(ix) == i~{\rm tanh}^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 269 of 298
+tantanh:=rule(tan(%i*x)^(-1) == %i*tanh(x)^(-1))
+--R
+--R            1           %i
+--R   (1)  --------- == -------
+--R        tan(%i x)    tanh(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 269
+
+--S 270 of 298
+t1:=tan(%i*x)^(-1) - %i*tanh(x)^(-1)
+--R
+--R        tanh(x) - %i tan(%i x)
+--R   (2)  ----------------------
+--R           tan(%i x)tanh(x)
+--R                                             Type: Expression Complex Integer
+--E 270
+
+--S 271 of 298
+t2:=tantanh t1
+--R
+--R        tanh(x) - %i tan(%i x)
+--R   (3)  ----------------------
+--R           tan(%i x)tanh(x)
+--R                                             Type: Expression Complex Integer
+--E 271
+
+@
+\subsection{8.97 ${\rm tanh}^{-1}(ix)$}
+\[{\rm tanh}^{-1}(ix) == i~\tan^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 272 of 298
+tanhtan:=rule(tanh(%i*x)^(-1) == %i*tan(x)^(-1))
+--R
+--R             1          %i
+--R   (1)  ---------- == ------
+--R        tanh(%i x)    tan(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 272
+
+--S 273 of 298
+t1:=tanh(%i*x)^(-1) - %i*tan(x)^(-1)
+--R
+--R        - %i tanh(%i x) + tan(x)
+--R   (2)  ------------------------
+--R            tan(x)tanh(%i x)
+--R                                             Type: Expression Complex Integer
+--E 273
+
+--S 274 of 298
+t2:=tanhtan t1
+--R
+--R        - %i tanh(%i x) + tan(x)
+--R   (3)  ------------------------
+--R            tan(x)tanh(%i x)
+--R                                             Type: Expression Complex Integer
+--E 274
+
+@
+\subsection{8.98 $\cot^{-1}(ix)$}
+\[\cot^{-1}(ix) == -i~{\rm cosh}^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 275 of 298
+cotcoth:=rule(cot(%i*x)^(-1) == -%i*coth(x)^(-1))
+--R
+--R            1             %i
+--R   (1)  --------- == - -------
+--R        cot(%i x)      coth(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 275
+
+--S 276 of 298
+t1:=cot(%i*x)^(-1) - -%i*coth(x)^(-1)
+--R
+--R        coth(x) + %i cot(%i x)
+--R   (2)  ----------------------
+--R           cot(%i x)coth(x)
+--R                                             Type: Expression Complex Integer
+--E 276
+
+--S 277 of 298
+t2:=cotcoth t1
+--R
+--R        coth(x) + %i cot(%i x)
+--R   (3)  ----------------------
+--R           cot(%i x)coth(x)
+--R                                             Type: Expression Complex Integer
+--E 277
+
+@
+\subsection{8.99 ${\rm coth}^{-1}(ix)$}
+\[{\rm coth}^{-1}(ix) == -i~\cot^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 278 of 298
+cothcot:=rule(coth(%i*x)^(-1) == -%i*cot(x)^(-1))
+--R
+--R             1            %i
+--R   (1)  ---------- == - ------
+--R        coth(%i x)      cot(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 278
+
+--S 279 of 298
+t1:=coth(%i*x)^(-1) - -%i*cot(x)^(-1)
+--R
+--R        %i coth(%i x) + cot(x)
+--R   (2)  ----------------------
+--R           cot(x)coth(%i x)
+--R                                             Type: Expression Complex Integer
+--E 279
+
+--S 280 of 298
+t2:=cothcot t1
+--R
+--R        %i coth(%i x) + cot(x)
+--R   (3)  ----------------------
+--R           cot(x)coth(%i x)
+--R                                             Type: Expression Complex Integer
+--E 280
+
+@
+\subsection{8.100 $\sec^{-1}(x)$}
+\[\sec^{-1}(x) == \pm i~{\rm sech}(x)\]
+<<*>>=
+)clear all
+
+--S 281 of 298
+secsech:=rule(sec(x)^(-1) == %i*sech(x)^(-1))
+--R
+--R           1         %i
+--R   (1)  ------ == -------
+--R        sec(x)    sech(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 281
+
+--S 282 of 298
+t1:=sec(x)^(-1) - %i*sech(x)^(-1)
+--R
+--R        sech(x) - %i sec(x)
+--R   (2)  -------------------
+--R           sec(x)sech(x)
+--R                                             Type: Expression Complex Integer
+--E 282
+
+--S 283 of 298
+t2:=secsech t1
+--R
+--R        sech(x) - %i sec(x)
+--R   (3)  -------------------
+--R           sec(x)sech(x)
+--R                                             Type: Expression Complex Integer
+--E 283
+
+)clear all
+
+--S 284 of 298
+secsech2:=rule(sec(x)^(-1) == -%i*sech(x)^(-1))
+--R
+--R           1           %i
+--R   (1)  ------ == - -------
+--R        sec(x)      sech(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 284
+
+--S 285 of 298
+t1:=sec(x)^(-1) - -%i*sech(x)^(-1)
+--R
+--R        sech(x) + %i sec(x)
+--R   (2)  -------------------
+--R           sec(x)sech(x)
+--R                                             Type: Expression Complex Integer
+--E 285
+
+--S 286 of 298
+t2:=secsech2 t1
+--R
+--R        sech(x) + %i sec(x)
+--R   (3)  -------------------
+--R           sec(x)sech(x)
+--R                                             Type: Expression Complex Integer
+--E 286
+
+@
+\subsection{8.101 ${\rm sech}^{-1}(x)$}
+\[{\rm sech}^{-1}(x) == \pm i~\sec^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 287 of 298
+sechsec:=rule(sech(x)^(-1) == %i*sec(x)^(-1))
+--R
+--R           1         %i
+--R   (1)  ------- == ------
+--R        sech(x)    sec(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 287
+
+--S 288 of 298
+t1:=sech(x)^(-1) - %i*sec(x)^(-1)
+--R
+--R        - %i sech(x) + sec(x)
+--R   (2)  ---------------------
+--R            sec(x)sech(x)
+--R                                             Type: Expression Complex Integer
+--E 288
+
+--S 289 of 298
+t2:=sechsec t1
+--R
+--R        - %i sech(x) + sec(x)
+--R   (3)  ---------------------
+--R            sec(x)sech(x)
+--R                                             Type: Expression Complex Integer
+--E 289
+
+)clear all
+
+--S 290 of 298
+sechsec:=rule(sech(x)^(-1) == -%i*sec(x)^(-1))
+--R
+--R           1           %i
+--R   (1)  ------- == - ------
+--R        sech(x)      sec(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 290
+
+--S 291 of 298
+t1:=sech(x)^(-1) - -%i*sec(x)^(-1)
+--R
+--R        %i sech(x) + sec(x)
+--R   (2)  -------------------
+--R           sec(x)sech(x)
+--R                                             Type: Expression Complex Integer
+--E 291
+
+--S 292 of 298
+t2:=sechsec t1
+--R
+--R        %i sech(x) + sec(x)
+--R   (3)  -------------------
+--R           sec(x)sech(x)
+--R                                             Type: Expression Complex Integer
+--E 292
+
+@
+\subsection{8.102 $\csc^{-1}(ix)$}
+\[\csc^{-1}(ix) == -i~{\rm csch}^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 293 of 298
+csccsch:=rule(csc(%i*x)^(-1) == -%i*csch(x)^(-1))
+--R
+--R            1             %i
+--R   (1)  --------- == - -------
+--R        csc(%i x)      csch(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 293
+
+--S 294 of 298
+t1:=csc(%i*x)^(-1) - -%i*csch(x)^(-1)
+--R
+--R        csch(x) + %i csc(%i x)
+--R   (2)  ----------------------
+--R           csc(%i x)csch(x)
+--R                                             Type: Expression Complex Integer
+--E 294
+
+--S 295 of 298
+t2:=csccsch t1
+--R
+--R        csch(x) + %i csc(%i x)
+--R   (3)  ----------------------
+--R           csc(%i x)csch(x)
+--R                                             Type: Expression Complex Integer
+--E 295
+
+@
+\subsection{8.103 ${\rm csch}^{-1}(ix)$}
+\[{\rm csch}^{-1}(ix) ==-i~\csc^{-1}(x)\]
+<<*>>=
+)clear all
+
+--S 296 of 298
+cschcsc:=rule(csch(%i*x)^(-1) == -%i*csc(x)^(-1))
+--R
+--R             1            %i
+--R   (1)  ---------- == - ------
+--R        csch(%i x)      csc(x)
+--R        Type: RewriteRule(Integer,Complex Integer,Expression Complex Integer)
+--E 296
+
+--S 297 of 298
+t1:=csch(%i*x)^(-1) - -%i*csc(x)^(-1)
+--R
+--R        %i csch(%i x) + csc(x)
+--R   (2)  ----------------------
+--R           csc(x)csch(%i x)
+--R                                             Type: Expression Complex Integer
+--E 297
+
+--S 298 of 298
+t2:=cschcsc t1
+--R
+--R        %i csch(%i x) + csc(x)
+--R   (3)  ----------------------
+--R           csc(x)csch(%i x)
+--R                                             Type: Expression Complex Integer
+--E 298
+
+@
+
+\begin{verbatim}
+rootrule4a:RewriteRule(INT,COMPLEX(INT),EXPR(COMPLEX(INT))):=rule(sqrt(p^2-q^2)==sqrt(p-q)*sqrt(q+p))  schaum17.input.pamphlet:
+tanrule2:RewriteRule(INT,COMPLEX(INT),EXPR(COMPLEX(INT))):=rule(tan(a) == sin(a)/cos(a))  schaum17.input.pamphlet:
+\end{verbatim}
+
+<<*>>=
+)spool 
+)lisp (bye)
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}

\start
Date: Tue, 9 Dec 2008 20:45:14 -0600
From: Tim Daly
To: list
Subject: ISSAC 2009 Call for Papers

			   CALL FOR PAPERS ISSAC 2009
          International Symposium on Symbolic and Algebraic Computation
		      Korea Institute for Advanced Study
			 Seoul, Korea, July 28-31, 2009

			  http://issac2009.kias.re.kr/

The 2009 International Symposium on Symbolic and  Algebraic  Computation
(ISSAC) is the 34th meeting in a series of conferences, begun in 1966 and held
annually since 1981 in North America, Europe and Asia, for original research on
all aspects of symbolic computation.  Following tradition, ISSAC 2009 will have
presentations of accepted research papers, invited talks, poster sessions,
tutorial courses, software demonstrations, and company exhibits.

IMPORTANT DATES

Paper submission deadline is Saturday, Jan. 17, 2009, 23:59 EST [+7 days extension]
Notification of Acceptance/rejection: no later than Monday, March 30, 2009.

CONFERENCE TOPICS

All topics covered traditionally by ISSAC including
   all of computer algebra
   algebraic methods in computational geometry and in theorem proving
   the computer science of creating software for doing mathematics
Applications of symbolic computation to
   the natural sciences, life science, engineering, education, and others
For more details, see, e.g., the TOC in the Computer Algebra Handbook
URL: http://issac2009.kias.re.kr/cah_toc.pdf
In addition and not exclusively, applications of symbolic computation to
   new models of computation (e.g., quantum computation, origami mathematics)
   algebraic statistics
Certification of numerical results by symbolic computation
Implementation of symbolic computation systems on compact and mobile devices.

CONFERENCE OFFICERS

Jeremy Johnson, Drexel U., USA and Hyungju Park, KIAS, Korea, General Co-Chairs
Erich Kaltofen, NCSU, USA, Program Committee Chair

			       Program Committee
Massimo Caboara, U. Pisa, Italy          Siegfried Rump, TUHH, Germany
Gene Cooperman, Northeastern U., USA     Bruno Salvy, INRIA, France
Mark Giesbrecht, U. Waterloo, Canada     Carsten Schneider, RISC, Austria
Jaime Gutierrez, U. Cantabria, Spain     Kiyoshi Shirayanagi, Tokai U., Japan
Weidong Liao, Shepherd U., USA           Elena Smirnova, Texas Instruments, USA
Scott McCallum, Macquarie U., Australia  Volker Sorge, U. Birmingham, UK
Kosaku Nagasaka, Kobe U., Japan          Adam Strzebonski, Wolfram Research, USA
Clement Pernet, U. Washington, USA       Stephen Watt, U. Western Ontario, Canada
                / U. Grenoble I, France  Franz Winkler, RISC, Austria
Markus Rosenkranz, RICAM, Austria        Min Wu, East China Normal U., China

SUBMISSION INSTRUCTIONS

Papers must contain original research and not duplicate work published or
submitted for publication elsewhere. Papers will be reviewed by the Program
Committee and external referees.  Proceedings will be distributed at ISSAC
2009.  Papers must be written in English and should not exceed 8 pages in ACM's
Proceedings style http://www.acm.org/sigs/publications/proceedings-templates,
which is about 20 to 22 pages in LaTeX 12pt article style.  If necessary,
submissions can have an appendix that may be read by the reviewers and PC
Members, but that is not considered part of the Proceedings paper.

Papers are exclusively submitted via
              http://www.easychair.org/conferences?conf=issac2009

We expect that at least one author of each accepted paper attends ISSAC 2009
and presents her or his paper.

REPEATING DATES

Submit by Jan. 24, 23:59 EST;  accept/reject by Mar. 30;  Conf. Jul. 28-31, 2009

\start
Date: Wed, 10 Dec 2008 13:20:22 -0600
From: Tim Daly
To: list
Subject: 20081209.01.tpd.patch (bookvol10.3 add domains)

More domains were moved into the Axiom algebra domain volume.

The patch is too large to post. See
<http://axiom-developer.org/axiom-website/patches.html#latest>

\start
Date: Thu, 11 Dec 2008 20:29:24 -0600
From: Tim Daly
To: list
Subject: 20081210.01.tpd.patch (bookvol10.3 add domains)

Add additional domains to volume 10.3
along with fixes for regression tests and the table of contents.

The patch is to large to include. See
<http://axiom-developer.org/axiom-website/patches.html#latest>

\start
Date: Fri, 12 Dec 2008 13:32:31 -0600
From: Tim Daly
To: list
Subject: 20081211.01.tpd.patch (regression test suite cleanup)

The patch cleans up some minor breakage in the regression test suite.

It also fixes cwmmt in preparation for removing noweb from the tool chain.

Tim

=====================================================================
diff --git a/books/bookvol10.3.pamphlet b/books/bookvol10.3.pamphlet
index 3510eef..33e4bb1 100644
--- a/books/bookvol10.3.pamphlet
+++ b/books/bookvol10.3.pamphlet
@@ -15348,6 +15348,117 @@ Equation(S: Type): public == private where
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain EMR EuclideanModularRing}
+\pagehead{EuclideanModularRing}{EMR}
+\pagepic{ps/v103euclideanmodularring.ps}{EMR}{1.00}
+See also:\\
+\refto{ModularRing}{MODRING}
+\refto{ModularField}{MODFIELD}
+<<domain EMR EuclideanModularRing>>=
+)abbrev domain EMR EuclideanModularRing
+++ Description:
+++ These domains are used for the factorization and gcds
+++ of univariate polynomials over the integers in order to work modulo
+++ different  primes.
+++ See \spadtype{ModularRing}, \spadtype{ModularField}
+EuclideanModularRing(S,R,Mod,reduction:(R,Mod) -> R,
+                     merge:(Mod,Mod) -> Union(Mod,"failed"),
+                      exactQuo : (R,R,Mod) -> Union(R,"failed")) : C == T
+ where
+  S    :  CommutativeRing
+  R    :  UnivariatePolynomialCategory S
+  Mod  :  AbelianMonoid
+
+  C == EuclideanDomain with
+                modulus :   %     -> Mod
+			++ modulus(x) \undocumented
+                coerce  :   %     -> R
+			++ coerce(x) \undocumented
+                reduce  : (R,Mod) -> %
+			++ reduce(r,m) \undocumented
+                exQuo   :  (%,%)  -> Union(%,"failed")
+			++ exQuo(x,y) \undocumented
+                recip   :    %    -> Union(%,"failed")
+			++ recip(x) \undocumented
+                inv     :    %    -> %
+			++ inv(x) \undocumented
+                elt     : (%, R)  -> R
+			++ elt(x,r) or x.r \undocumented
+
+  T == ModularRing(R,Mod,reduction,merge,exactQuo) add
+
+    --representation
+      Rep:= Record(val:R,modulo:Mod)
+    --declarations
+      x,y,z: %
+
+      divide(x,y) ==
+        t:=merge(x.modulo,y.modulo)
+        t case "failed" => error "incompatible moduli"
+        xm:=t::Mod
+        yv:=y.val
+        invlcy:R
+--        if one? leadingCoefficient yv then invlcy:=1
+        if (leadingCoefficient yv = 1) then invlcy:=1
+        else
+          invlcy:=(inv reduce((leadingCoefficient yv)::R,xm)).val
+          yv:=reduction(invlcy*yv,xm)
+        r:=monicDivide(x.val,yv)
+        [reduce(invlcy*r.quotient,xm),reduce(r.remainder,xm)]
+
+      if R has fmecg:(R,NonNegativeInteger,S,R)->R
+         then x rem y  ==
+           t:=merge(x.modulo,y.modulo)
+           t case "failed" => error "incompatible moduli"
+           xm:=t::Mod
+           yv:=y.val
+           invlcy:R
+--           if not one? leadingCoefficient yv then
+           if not (leadingCoefficient yv = 1) then
+             invlcy:=(inv reduce((leadingCoefficient yv)::R,xm)).val
+             yv:=reduction(invlcy*yv,xm)
+           dy:=degree yv
+           xv:=x.val
+           while (d:=degree xv - dy)>=0 repeat
+                 xv:=reduction(fmecg(xv,d::NonNegativeInteger,
+                                     leadingCoefficient xv,yv),xm)
+                 xv = 0 => return [xv,xm]$Rep
+           [xv,xm]$Rep
+         else x rem y  == 
+           t:=merge(x.modulo,y.modulo)
+           t case "failed" => error "incompatible moduli"
+           xm:=t::Mod
+           yv:=y.val
+           invlcy:R
+--           if not one? leadingCoefficient yv then
+           if not (leadingCoefficient yv = 1) then
+             invlcy:=(inv reduce((leadingCoefficient yv)::R,xm)).val
+             yv:=reduction(invlcy*yv,xm)
+           r:=monicDivide(x.val,yv)
+           reduce(r.remainder,xm)
+
+      euclideanSize x == degree x.val
+
+      unitCanonical x ==
+        zero? x => x
+        degree(x.val) = 0 => 1
+--        one? leadingCoefficient(x.val) => x
+        (leadingCoefficient(x.val) = 1) => x
+        invlcx:%:=inv reduce((leadingCoefficient(x.val))::R,x.modulo)
+        invlcx * x
+
+      unitNormal x ==
+--        zero?(x) or one?(leadingCoefficient(x.val)) => [1, x, 1]
+        zero?(x) or ((leadingCoefficient(x.val)) = 1) => [1, x, 1]
+        lcx := reduce((leadingCoefficient(x.val))::R,x.modulo)
+        invlcx:=inv lcx
+        degree(x.val) = 0 => [lcx, 1, invlcx]
+        [lcx, invlcx * x, invlcx]
+
+      elt(x : %,s : R) : R == reduction(elt(x.val,s),x.modulo)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain EXPEXPAN ExponentialExpansion}
 \pagehead{ExponentialExpansion}{EXPEXPAN}
 \pagepic{ps/v103exponentialexpansion.ps}{EXPEXPAN}{1.00}
@@ -26690,6 +26801,82 @@ GeneralDistributedMultivariatePolynomial(vl,R,E): public == private where
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain GMODPOL GeneralModulePolynomial}
+\pagehead{GeneralModulePolynomial}{GMODPOL}
+\pagepic{ps/v103generalmodulepolynomial.ps}{GMODPOL}{1.00}
+See also:\\
+\refto{ModuleMonomial}{MODMONOM}
+<<domain GMODPOL GeneralModulePolynomial>>=
+)abbrev domain GMODPOL GeneralModulePolynomial
+++ Description:
+++ This package \undocumented
+GeneralModulePolynomial(vl, R, IS, E, ff, P): public  ==  private where
+  vl: List(Symbol)
+  R: CommutativeRing
+  IS: OrderedSet
+  NNI ==> NonNegativeInteger
+  E: DirectProductCategory(#vl, NNI)
+  MM ==> Record(index:IS, exponent:E)
+  ff: (MM, MM) -> Boolean
+  OV  ==> OrderedVariableList(vl)
+  P: PolynomialCategory(R, E, OV)
+  ModMonom ==> ModuleMonomial(IS, E, ff)
+
+
+  public  ==  Join(Module(P), Module(R))  with
+        leadingCoefficient: $ -> R
+		++ leadingCoefficient(x) \undocumented
+        leadingMonomial: $ -> ModMonom
+		++ leadingMonomial(x) \undocumented
+        leadingExponent: $ -> E
+		++ leadingExponent(x) \undocumented
+        leadingIndex: $ -> IS
+		++ leadingIndex(x) \undocumented
+        reductum: $ -> $
+		++ reductum(x) \undocumented
+        monomial: (R, ModMonom) -> $
+		++ monomial(r,x) \undocumented
+        unitVector: IS -> $
+		++ unitVector(x) \undocumented
+        build: (R, IS, E) -> $
+		++ build(r,i,e) \undocumented
+        multMonom: (R, E, $) -> $
+		++ multMonom(r,e,x) \undocumented
+        "*": (P,$) -> $
+		++ p*x \undocumented
+
+
+  private  ==  FreeModule(R, ModMonom)  add
+        Rep:= FreeModule(R, ModMonom)
+        leadingMonomial(p:$):ModMonom == leadingSupport(p)$Rep
+        leadingExponent(p:$):E == exponent(leadingMonomial p)
+        leadingIndex(p:$):IS == index(leadingMonomial p)
+        unitVector(i:IS):$ == monomial(1,[i, 0$E]$ModMonom)
+
+
+ -----------------------------------------------------------------------------
+
+        build(c:R, i:IS, e:E):$  ==  monomial(c, construct(i, e))
+
+ -----------------------------------------------------------------------------
+
+     ----   WARNING: assumes c ^= 0
+
+        multMonom(c:R, e:E, mp:$):$  ==
+            zero? mp => mp
+            monomial(c * leadingCoefficient mp, [leadingIndex mp,
+                     e + leadingExponent mp]) + multMonom(c, e, reductum mp)
+
+ -----------------------------------------------------------------------------
+
+
+        ((p:P) * (mp:$)):$  ==
+            zero? p => 0
+            multMonom(leadingCoefficient p, degree p, mp) +
+               reductum(p) * mp
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain GCNAALG GenericNonAssociativeAlgebra}
 \pagehead{GenericNonAssociativeAlgebra}{GCNAALG}
 \pagepic{ps/v103genericnonassociativealgebra.ps}{GCNAALG}{1.00}
@@ -28243,6 +28430,47 @@ IndexedDirectProductOrderedAbelianMonoidSup(A:OrderedAbelianMonoidSup,S:OrderedS
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain INDE IndexedExponents}
+\pagehead{IndexedExponents}{INDE}
+\pagepic{ps/v103indexedexponents.ps}{INDE}{1.00}
+See also:\\
+\refto{Polynomial}{POLY}
+\refto{MultivariatePolynomial}{MPOLY}
+\refto{SparseMultivariatePolynomial}{SMP}
+<<domain INDE IndexedExponents>>=
+)abbrev domain INDE IndexedExponents
+++ Author: James Davenport
+++ Date Created:
+++ Date Last Updated:
+++ Basic Functions:
+++ Related Constructors:
+++ Also See:
+++ AMS Classifications:
+++ Keywords:
+++ References:
+++ Description:
+++   IndexedExponents of an ordered set of variables gives a representation
+++ for the degree of polynomials in commuting variables. It gives an ordered
+++ pairing of non negative integer exponents with variables
+
+IndexedExponents(Varset:OrderedSet): C == T where
+  C == Join(OrderedAbelianMonoidSup,
+            IndexedDirectProductCategory(NonNegativeInteger,Varset))
+  T == IndexedDirectProductOrderedAbelianMonoidSup(NonNegativeInteger,Varset) add
+      Term:=  Record(k:Varset,c:NonNegativeInteger)
+      Rep:=  List Term
+      x:%
+      t:Term
+      coerceOF(t):OutputForm ==     --++ converts term to OutputForm
+         t.c = 1 => (t.k)::OutputForm
+         (t.k)::OutputForm ** (t.c)::OutputForm
+      coerce(x):OutputForm == ++ converts entire exponents to OutputForm
+         null x => 1::Integer::OutputForm
+         null rest x => coerceOF(first x)
+         reduce("*",[coerceOF t for t in x])
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain IFARRAY IndexedFlexibleArray}
 <<dot>>=
 "IFARRAY" -> "A1AGG"
@@ -28694,6 +28922,81 @@ IndexedList(S:Type, mn:Integer): Exports == Implementation where
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain IMATRIX IndexedMatrix}
+\pagehead{IndexedMatrix}{IMATRIX}
+\pagepic{ps/v103indexedmatrix.ps}{IMATRIX}{1.00}
+See also:\\
+\refto{Matrix}{MATRIX}
+\refto{RectangularMatrix}{RMATRIX}
+\refto{SquareMatrix}{SQMATRIX}
+<<domain IMATRIX IndexedMatrix>>=
+)abbrev domain IMATRIX IndexedMatrix
+++ Author: Grabmeier, Gschnitzer, Williamson
+++ Date Created: 1987
+++ Date Last Updated: July 1990
+++ Basic Operations:
+++ Related Domains: Matrix, RectangularMatrix, SquareMatrix,
+++   StorageEfficientMatrixOperations
+++ Also See:
+++ AMS Classifications:
+++ Keywords: matrix, linear algebra
+++ Examples:
+++ References:
+++ Description:
+++   An \spad{IndexedMatrix} is a matrix where the minimal row and column
+++   indices are parameters of the type.  The domains Row and Col
+++   are both IndexedVectors.
+++   The index of the 'first' row may be obtained by calling the
+++   function \spadfun{minRowIndex}.  The index of the 'first' column may
+++   be obtained by calling the function \spadfun{minColIndex}.  The index of
+++   the first element of a 'Row' is the same as the index of the
+++   first column in a matrix and vice versa.
+IndexedMatrix(R,mnRow,mnCol): Exports == Implementation where
+  R : Ring
+  mnRow, mnCol : Integer
+  Row ==> IndexedVector(R,mnCol)
+  Col ==> IndexedVector(R,mnRow)
+  MATLIN ==> MatrixLinearAlgebraFunctions(R,Row,Col,$)
+ 
+  Exports ==> MatrixCategory(R,Row,Col)
+ 
+  Implementation ==>
+    InnerIndexedTwoDimensionalArray(R,mnRow,mnCol,Row,Col) add
+ 
+      swapRows_!(x,i1,i2) ==
+        (i1 < minRowIndex(x)) or (i1 > maxRowIndex(x)) or _
+           (i2 < minRowIndex(x)) or (i2 > maxRowIndex(x)) =>
+             error "swapRows!: index out of range"
+        i1 = i2 => x
+        minRow := minRowIndex x
+        xx := x pretend PrimitiveArray(PrimitiveArray(R))
+        n1 := i1 - minRow; n2 := i2 - minRow
+        row1 := qelt(xx,n1)
+        qsetelt_!(xx,n1,qelt(xx,n2))
+        qsetelt_!(xx,n2,row1)
+        xx pretend $
+ 
+      if R has commutative("*") then
+ 
+        determinant x == determinant(x)$MATLIN
+        minordet    x == minordet(x)$MATLIN
+ 
+      if R has EuclideanDomain then
+ 
+        rowEchelon  x == rowEchelon(x)$MATLIN
+ 
+      if R has IntegralDomain then
+ 
+        rank        x == rank(x)$MATLIN
+        nullity     x == nullity(x)$MATLIN
+        nullSpace   x == nullSpace(x)$MATLIN
+ 
+      if R has Field then
+ 
+        inverse     x == inverse(x)$MATLIN
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain IARRAY1 IndexedOneDimensionalArray}
 <<dot>>=
 "IARRAY1" -> "A1AGG"
@@ -29225,6 +29528,198 @@ InnerIndexedTwoDimensionalArray(R,mnRow,mnCol,Row,Col):_
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain INFORM InputForm}
+\pagehead{InputForm}{INFORM}
+\pagepic{ps/v103inputform.ps}{INFORM}{1.00}
+<<domain INFORM InputForm>>=
+)abbrev domain INFORM InputForm
+++ Parser forms
+++ Author: Manuel Bronstein
+++ Date Created: ???
+++ Date Last Updated: 19 April 1991
+++ Description:
+++   Domain of parsed forms which can be passed to the interpreter.
+++   This is also the interface between algebra code and facilities
+++   in the interpreter.
+
+--)boot $noSubsumption := true
+
+InputForm():
+  Join(SExpressionCategory(String,Symbol,Integer,DoubleFloat,OutputForm),
+       ConvertibleTo SExpression) with
+    interpret: % -> Any
+      ++ interpret(f) passes f to the interpreter.
+    convert  : SExpression -> %
+      ++ convert(s) makes s into an input form.
+    binary   : (%, List %) -> %
+      ++ \spad{binary(op, [a1,...,an])} returns the input form
+      ++ corresponding to  \spad{a1 op a2 op ... op an}.
+      ++
+      ++X a:=[1,2,3]::List(InputForm)
+      ++X binary(_+::InputForm,a)
+
+    function : (%, List Symbol, Symbol) -> %
+      ++ \spad{function(code, [x1,...,xn], f)} returns the input form
+      ++ corresponding to \spad{f(x1,...,xn) == code}.
+    lambda   : (%, List Symbol) -> %
+      ++ \spad{lambda(code, [x1,...,xn])} returns the input form
+      ++ corresponding to \spad{(x1,...,xn) +-> code} if \spad{n > 1},
+      ++ or to \spad{x1 +-> code} if \spad{n = 1}.
+    "+"      : (%, %) -> %
+      ++ \spad{a + b} returns the input form corresponding to \spad{a + b}.
+    "*"      : (%, %) -> %
+      ++ \spad{a * b} returns the input form corresponding to \spad{a * b}.
+    "/"      : (%, %) -> %
+      ++ \spad{a / b} returns the input form corresponding to \spad{a / b}.
+    "**"     : (%, NonNegativeInteger) -> %
+      ++ \spad{a ** b} returns the input form corresponding to \spad{a ** b}.
+    "**"     : (%, Integer) -> %
+      ++ \spad{a ** b} returns the input form corresponding to \spad{a ** b}.
+    0        : constant -> %
+      ++ \spad{0} returns the input form corresponding to 0.
+    1        : constant -> %
+      ++ \spad{1} returns the input form corresponding to 1.
+    flatten  : % -> %
+      ++ flatten(s) returns an input form corresponding to s with
+      ++ all the nested operations flattened to triples using new
+      ++ local variables.
+      ++ If s is a piece of code, this speeds up
+      ++ the compilation tremendously later on.
+    unparse  : % -> String
+      ++ unparse(f) returns a string s such that the parser
+      ++ would transform s to f.
+      ++ Error: if f is not the parsed form of a string.
+    parse : String -> %
+      ++ parse is the inverse of unparse. It parses a string to InputForm.
+    declare  : List %   -> Symbol
+      ++ declare(t) returns a name f such that f has been
+      ++ declared to the interpreter to be of type t, but has
+      ++ not been assigned a value yet.
+      ++ Note: t should be created as \spad{devaluate(T)$Lisp} where T is the
+      ++ actual type of f (this hack is required for the case where
+      ++ T is a mapping type).
+    compile  : (Symbol, List %) -> Symbol
+      ++ \spad{compile(f, [t1,...,tn])} forces the interpreter to compile
+      ++ the function f with signature \spad{(t1,...,tn) -> ?}.
+      ++ returns the symbol f if successful.
+      ++ Error: if f was not defined beforehand in the interpreter,
+      ++ or if the ti's are not valid types, or if the compiler fails.
+ == SExpression add
+    Rep := SExpression
+
+    mkProperOp: Symbol -> %
+    strsym    : % -> String
+    tuplify   : List Symbol -> %
+    flatten0  : (%, Symbol, NonNegativeInteger) ->
+                                             Record(lst: List %, symb:%)
+
+    0                        == convert(0::Integer)
+    1                        == convert(1::Integer)
+    convert(x:%):SExpression == x pretend SExpression
+    convert(x:SExpression):% == x
+
+    conv(ll : List %): % ==
+      convert(ll pretend List SExpression)$SExpression pretend %
+
+    lambda(f,l) == conv([convert("+->"::Symbol),tuplify l,f]$List(%))
+
+    interpret x ==
+      v := interpret(x)$Lisp
+      mkObj(unwrap(objVal(v)$Lisp)$Lisp, objMode(v)$Lisp)$Lisp
+
+    convert(x:DoubleFloat):% ==
+      zero? x => 0
+--      one? x => 1
+      (x = 1) => 1
+      convert(x)$Rep
+
+    flatten s ==
+      -- will not compile if I use 'or'
+      atom? s => s
+      every?(atom?,destruct s)$List(%) => s
+      sy := new()$Symbol
+      n:NonNegativeInteger := 0
+      l2 := [flatten0(x, sy, n := n + 1) for x in rest(l := destruct s)]
+      conv(concat(convert("SEQ"::Symbol)@%,
+        concat(concat [u.lst for u in l2], conv(
+           [convert("exit"::Symbol)@%, 1$%, conv(concat(first l,
+               [u.symb for u in l2]))@%]$List(%))@%)))@%
+
+    flatten0(s, sy, n) ==
+      atom? s => [nil(), s]
+      a := convert(concat(string sy, convert(n)@String)::Symbol)@%
+      l2 := [flatten0(x, sy, n := n+1) for x in rest(l := destruct s)]
+      [concat(concat [u.lst for u in l2], conv([convert(
+        "LET"::Symbol)@%, a, conv(concat(first l,
+             [u.symb for u in l2]))@%]$List(%))@%), a]
+
+    strsym s ==
+      string? s => string s
+      symbol? s => string symbol s
+      error "strsym: form is neither a string or symbol"
+
+    unparse x ==
+      atom?(s:% := form2String(x)$Lisp) => strsym s
+      concat [strsym a for a in destruct s]
+
+    parse(s:String):% ==
+      ncParseFromString(s)$Lisp
+
+    declare signature ==
+      declare(name := new()$Symbol, signature)$Lisp
+      name
+
+    compile(name, types) ==
+      symbol car cdr car
+        selectLocalMms(mkProperOp name, convert(name)@%,
+          types, nil$List(%))$Lisp
+
+    mkProperOp name ==
+      op := mkAtree(nme := convert(name)@%)$Lisp
+      transferPropsToNode(nme, op)$Lisp
+      convert op
+
+    binary(op, args) ==
+      (n := #args) < 2 => error "Need at least 2 arguments"
+      n = 2 => convert([op, first args, last args]$List(%))
+      convert([op, first args, binary(op, rest args)]$List(%))
+
+    tuplify l ==
+      empty? rest l => convert first l
+      conv
+        concat(convert("Tuple"::Symbol), [convert x for x in l]$List(%))
+
+    function(f, l, name) ==
+      nn := convert(new(1 + #l, convert(nil()$List(%)))$List(%))@%
+      conv([convert("DEF"::Symbol), conv(cons(convert(name)@%,
+                        [convert(x)@% for x in l])), nn, nn, f]$List(%))
+
+    s1 + s2 ==
+      s1 = 0 => s2
+      s2 = 0 => s1
+      conv [convert("+"::Symbol), s1, s2]$List(%)
+
+    s1 * s2 ==
+      s1 = 0 or s2 = 0 => 0
+      s1 = 1 => s2
+      s2 = 1 => s1
+      conv [convert("*"::Symbol), s1, s2]$List(%)
+
+    s1:% ** n:Integer ==
+      s1 = 0 and n > 0 => 0
+      s1 = 1 or zero? n => 1
+--      one? n => s1
+      (n = 1) => s1
+      conv [convert("**"::Symbol), s1, convert n]$List(%)
+
+    s1:% ** n:NonNegativeInteger == s1 ** (n::Integer)
+
+    s1 / s2 ==
+      s2 = 1 => s1
+      conv [convert("/"::Symbol), s1, s2]$List(%)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain INT Integer}
 The function {\bf one?} has been rewritten back to its original form.
 The NAG version called a lisp primitive that exists only in Codemist
@@ -32279,24 +32774,6 @@ leq
 --E 16
 )spool
  
-Dx: LODO(EXPR INT, f +-> D(f, x))
-Dx := D()
-Dop:= Dx^3 + G/x^2*Dx + H/x^3 - 1
-n == 3
-phi == reduce(+,[subscript(s,[i])*exp(x)/x^i for i in 0..n])
-phi1 ==  Dop(phi) / exp x
-phi2 == phi1 *x**(n+3)
-phi3 == retract(phi2)@(POLY INT)
-pans == phi3 ::UP(x,POLY INT)
-pans1 == [coefficient(pans, (n+3-i) :: NNI) for i in 2..n+1]
-leq == solve(pans1,[subscript(s,[i]) for i in 1..n])
-leq
-n==4
-leq
-n==7
-leq
-)spool
-)lisp (bye)
 @
 <<LinearOrdinaryDifferentialOperator.help>>=
 ====================================================================
@@ -32499,6 +32976,9 @@ o $AXIOM/doc/src/algebra/lodo.spad.dvi
 @
 \pagehead{LinearOrdinaryDifferentialOperator}{LODO}
 \pagepic{ps/v103linearordinarydifferentialoperator.ps}{LODO}{1.00}
+See also:\\
+\refto{LinearOrdinaryDifferentialOperator1}{LODO1}
+\refto{LinearOrdinaryDifferentialOperator2}{LODO2}
 <<domain LODO LinearOrdinaryDifferentialOperator>>=
 )abbrev domain LODO LinearOrdinaryDifferentialOperator
 ++ Author: Manuel Bronstein
@@ -32925,6 +33405,9 @@ o $AXIOM/doc/src/algebra/lodo.spad.dvi
 @
 \pagehead{LinearOrdinaryDifferentialOperator1}{LODO1}
 \pagepic{ps/v103linearordinarydifferentialoperator1.ps}{LODO1}{1.00}
+See also:\\
+\refto{LinearOrdinaryDifferentialOperator}{LODO}
+\refto{LinearOrdinaryDifferentialOperator2}{LODO2}
 <<domain LODO1 LinearOrdinaryDifferentialOperator1>>=
 )abbrev domain LODO1 LinearOrdinaryDifferentialOperator1
 ++ Author: Manuel Bronstein
@@ -33465,6 +33948,9 @@ o $AXIOM/doc/src/algebra/lodo.spad.dvi
 @
 \pagehead{LinearOrdinaryDifferentialOperator2}{LODO2}
 \pagepic{ps/v103linearordinarydifferentialoperator2.ps}{LODO2}{1.00}
+See also:\\
+\refto{LinearOrdinaryDifferentialOperator}{LODO}
+\refto{LinearOrdinaryDifferentialOperator1}{LODO1}
 <<domain LODO2 LinearOrdinaryDifferentialOperator2>>=
 )abbrev domain LODO2 LinearOrdinaryDifferentialOperator2
 ++ Author: Stephen M. Watt, Manuel Bronstein
@@ -35085,6 +35571,2600 @@ MakeCachableSet(S:SetCategory): Exports == Implementation where
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain MATRIX Matrix}
+<<Matrix.input>>=
+-- matrix.spad.pamphlet Matrix.input
+)spool Matrix.output
+)set message test on
+)set message auto off
+)clear all
+--S 1 of 38
+m : Matrix(Integer) := new(3,3,0)
+--R 
+--R
+--R        +0  0  0+
+--R        |       |
+--R   (1)  |0  0  0|
+--R        |       |
+--R        +0  0  0+
+--R                                                         Type: Matrix Integer
+--E 1
+
+--S 2 of 38
+setelt(m,2,3,5)
+--R 
+--R
+--R   (2)  5
+--R                                                        Type: PositiveInteger
+--E 2
+
+--S 3 of 38
+m(1,2) := 10
+--R 
+--R
+--R   (3)  10
+--R                                                        Type: PositiveInteger
+--E 3
+
+--S 4 of 38
+m
+--R 
+--R
+--R        +0  10  0+
+--R        |        |
+--R   (4)  |0  0   5|
+--R        |        |
+--R        +0  0   0+
+--R                                                         Type: Matrix Integer
+--E 4
+
+--S 5 of 38
+matrix [ [1,2,3,4],[0,9,8,7] ]
+--R 
+--R
+--R        +1  2  3  4+
+--R   (5)  |          |
+--R        +0  9  8  7+
+--R                                                         Type: Matrix Integer
+--E 5
+
+--S 6 of 38
+dm := diagonalMatrix [1,x**2,x**3,x**4,x**5]
+--R 
+--R
+--R        +1  0   0   0   0 +
+--R        |                 |
+--R        |    2            |
+--R        |0  x   0   0   0 |
+--R        |                 |
+--R        |        3        |
+--R   (6)  |0  0   x   0   0 |
+--R        |                 |
+--R        |            4    |
+--R        |0  0   0   x   0 |
+--R        |                 |
+--R        |                5|
+--R        +0  0   0   0   x +
+--R                                              Type: Matrix Polynomial Integer
+--E 6
+
+--S 7 of 38
+setRow!(dm,5,vector [1,1,1,1,1])
+--R 
+--R
+--R        +1  0   0   0   0+
+--R        |                |
+--R        |    2           |
+--R        |0  x   0   0   0|
+--R        |                |
+--R   (7)  |        3       |
+--R        |0  0   x   0   0|
+--R        |                |
+--R        |            4   |
+--R        |0  0   0   x   0|
+--R        |                |
+--R        +1  1   1   1   1+
+--R                                              Type: Matrix Polynomial Integer
+--E 7
+
+--S 8 of 38
+setColumn!(dm,2,vector [y,y,y,y,y])
+--R 
+--R
+--R        +1  y  0   0   0+
+--R        |               |
+--R        |0  y  0   0   0|
+--R        |               |
+--R        |       3       |
+--R   (8)  |0  y  x   0   0|
+--R        |               |
+--R        |           4   |
+--R        |0  y  0   x   0|
+--R        |               |
+--R        +1  y  1   1   1+
+--R                                              Type: Matrix Polynomial Integer
+--E 8
+
+--S 9 of 38
+cdm := copy(dm)
+--R 
+--R
+--R        +1  y  0   0   0+
+--R        |               |
+--R        |0  y  0   0   0|
+--R        |               |
+--R        |       3       |
+--R   (9)  |0  y  x   0   0|
+--R        |               |
+--R        |           4   |
+--R        |0  y  0   x   0|
+--R        |               |
+--R        +1  y  1   1   1+
+--R                                              Type: Matrix Polynomial Integer
+--E 9
+
+--S 10 of 38
+setelt(dm,4,1,1-x**7)
+--R 
+--R
+--R            7
+--R   (10)  - x  + 1
+--R                                                     Type: Polynomial Integer
+--E 10
+
+--S 11 of 38
+[dm,cdm]
+--R 
+--R
+--R          +   1      y  0   0   0+ +1  y  0   0   0+
+--R          |                      | |               |
+--R          |   0      y  0   0   0| |0  y  0   0   0|
+--R          |                      | |               |
+--R          |              3       | |       3       |
+--R   (11)  [|   0      y  x   0   0|,|0  y  x   0   0|]
+--R          |                      | |               |
+--R          |   7              4   | |           4   |
+--R          |- x  + 1  y  0   x   0| |0  y  0   x   0|
+--R          |                      | |               |
+--R          +   1      y  1   1   1+ +1  y  1   1   1+
+--R                                         Type: List Matrix Polynomial Integer
+--E 11
+
+--S 12 of 38
+subMatrix(dm,2,3,2,4)
+--R 
+--R
+--R         +y  0   0+
+--R   (12)  |        |
+--R         |    3   |
+--R         +y  x   0+
+--R                                              Type: Matrix Polynomial Integer
+--E 12
+
+--S 13 of 38
+d := diagonalMatrix [1.2,-1.3,1.4,-1.5]
+--R 
+--R
+--R         +1.2   0.0   0.0   0.0 +
+--R         |                      |
+--R         |0.0  - 1.3  0.0   0.0 |
+--R   (13)  |                      |
+--R         |0.0   0.0   1.4   0.0 |
+--R         |                      |
+--R         +0.0   0.0   0.0  - 1.5+
+--R                                                           Type: Matrix Float
+--E 13
+
+--S 14 of 38
+e := matrix [ [6.7,9.11],[-31.33,67.19] ]
+--R 
+--R
+--R         +  6.7    9.11 +
+--R   (14)  |              |
+--R         +- 31.33  67.19+
+--R                                                           Type: Matrix Float
+--E 14
+
+--S 15 of 38
+setsubMatrix!(d,1,2,e)
+--R 
+--R
+--R         +1.2    6.7    9.11    0.0 +
+--R         |                          |
+--R         |0.0  - 31.33  67.19   0.0 |
+--R   (15)  |                          |
+--R         |0.0    0.0     1.4    0.0 |
+--R         |                          |
+--R         +0.0    0.0     0.0   - 1.5+
+--R                                                           Type: Matrix Float
+--E 15
+
+--S 16 of 38
+d
+--R 
+--R
+--R         +1.2    6.7    9.11    0.0 +
+--R         |                          |
+--R         |0.0  - 31.33  67.19   0.0 |
+--R   (16)  |                          |
+--R         |0.0    0.0     1.4    0.0 |
+--R         |                          |
+--R         +0.0    0.0     0.0   - 1.5+
+--R                                                           Type: Matrix Float
+--E 16
+
+--S 17 of 38
+a := matrix [ [1/2,1/3,1/4],[1/5,1/6,1/7] ]
+--R 
+--R
+--R         +1  1  1+
+--R         |-  -  -|
+--R         |2  3  4|
+--R   (17)  |       |
+--R         |1  1  1|
+--R         |-  -  -|
+--R         +5  6  7+
+--R                                                Type: Matrix Fraction Integer
+--E 17
+
+--S 18 of 38
+b := matrix [ [3/5,3/7,3/11],[3/13,3/17,3/19] ] 
+--R 
+--R
+--R         +3   3    3+
+--R         |-   -   --|
+--R         |5   7   11|
+--R   (18)  |          |
+--R         | 3   3   3|
+--R         |--  --  --|
+--R         +13  17  19+
+--R                                                Type: Matrix Fraction Integer
+--E 18
+
+--S 19 of 38
+horizConcat(a,b)
+--R 
+--R
+--R         +1  1  1  3   3    3+
+--R         |-  -  -  -   -   --|
+--R         |2  3  4  5   7   11|
+--R   (19)  |                   |
+--R         |1  1  1   3   3   3|
+--R         |-  -  -  --  --  --|
+--R         +5  6  7  13  17  19+
+--R                                                Type: Matrix Fraction Integer
+--E 19
+
+--S 20 of 38
+vab := vertConcat(a,b)
+--R 
+--R
+--R         +1   1   1 +
+--R         |-   -   - |
+--R         |2   3   4 |
+--R         |          |
+--R         |1   1   1 |
+--R         |-   -   - |
+--R         |5   6   7 |
+--R   (20)  |          |
+--R         |3   3    3|
+--R         |-   -   --|
+--R         |5   7   11|
+--R         |          |
+--R         | 3   3   3|
+--R         |--  --  --|
+--R         +13  17  19+
+--R                                                Type: Matrix Fraction Integer
+--E 20
+
+--S 21 of 38
+transpose vab
+--R 
+--R
+--R         +1  1  3    3+
+--R         |-  -  -   --|
+--R         |2  5  5   13|
+--R         |            |
+--R         |1  1  3    3|
+--R   (21)  |-  -  -   --|
+--R         |3  6  7   17|
+--R         |            |
+--R         |1  1   3   3|
+--R         |-  -  --  --|
+--R         +4  7  11  19+
+--R                                                Type: Matrix Fraction Integer
+--E 21
+
+--S 22 of 38
+m := matrix [ [1,2],[3,4] ]
+--R 
+--R
+--R         +1  2+
+--R   (22)  |    |
+--R         +3  4+
+--R                                                         Type: Matrix Integer
+--E 22
+
+--S 23 of 38
+4 * m * (-5)
+--R 
+--R
+--R         +- 20  - 40+
+--R   (23)  |          |
+--R         +- 60  - 80+
+--R                                                         Type: Matrix Integer
+--E 23
+
+--S 24 of 38
+n := matrix([ [1,0,-2],[-3,5,1] ])
+--R 
+--R
+--R         + 1   0  - 2+
+--R   (24)  |           |
+--R         +- 3  5   1 +
+--R                                                         Type: Matrix Integer
+--E 24
+
+--S 25 of 38
+m * n
+--R 
+--R
+--R         +- 5  10   0 +
+--R   (25)  |            |
+--R         +- 9  20  - 2+
+--R                                                         Type: Matrix Integer
+--E 25
+
+--S 26 of 38
+vec := column(n,3)
+--R 
+--R
+--R   (26)  [- 2,1]
+--R                                                         Type: Vector Integer
+--E 26
+
+--S 27 of 38
+vec * m
+--R 
+--R
+--R   (27)  [1,0]
+--R                                                         Type: Vector Integer
+--E 27
+
+--S 28 of 38
+m * vec
+--R 
+--R
+--R   (28)  [0,- 2]
+--R                                                         Type: Vector Integer
+--E 28
+
+--S 29 of 38
+hilb := matrix([ [1/(i + j) for i in 1..3] for j in 1..3])
+--R 
+--R
+--R         +1  1  1+
+--R         |-  -  -|
+--R         |2  3  4|
+--R         |       |
+--R         |1  1  1|
+--R   (29)  |-  -  -|
+--R         |3  4  5|
+--R         |       |
+--R         |1  1  1|
+--R         |-  -  -|
+--R         +4  5  6+
+--R                                                Type: Matrix Fraction Integer
+--E 29
+
+--S 30 of 38
+inverse(hilb)
+--R 
+--R
+--R         + 72    - 240   180 +
+--R         |                   |
+--R   (30)  |- 240   900   - 720|
+--R         |                   |
+--R         + 180   - 720   600 +
+--R                                     Type: Union(Matrix Fraction Integer,...)
+--E 30
+
+--S 31 of 38
+mm := matrix([ [1,2,3,4], [5,6,7,8], [9,10,11,12], [13,14,15,16] ])
+--R 
+--R
+--R         +1   2   3   4 +
+--R         |              |
+--R         |5   6   7   8 |
+--R   (31)  |              |
+--R         |9   10  11  12|
+--R         |              |
+--R         +13  14  15  16+
+--R                                                         Type: Matrix Integer
+--E 31
+
+--S 32 of 38
+inverse(mm)
+--R 
+--R
+--R   (32)  "failed"
+--R                                                    Type: Union("failed",...)
+--E 32
+
+--S 33 of 38
+determinant(mm)
+--R 
+--R
+--R   (33)  0
+--R                                                     Type: NonNegativeInteger
+--E 33
+
+--S 34 of 38
+trace(mm)
+--R 
+--R
+--R   (34)  34
+--R                                                        Type: PositiveInteger
+--E 34
+
+--S 35 of 38
+rank(mm)
+--R 
+--R
+--R   (35)  2
+--R                                                        Type: PositiveInteger
+--E 35
+
+--S 36 of 38
+nullity(mm)
+--R 
+--R
+--R   (36)  2
+--R                                                        Type: PositiveInteger
+--E 36
+
+--S 37 of 38
+nullSpace(mm)
+--R 
+--R
+--R   (37)  [[1,- 2,1,0],[2,- 3,0,1]]
+--R                                                    Type: List Vector Integer
+--E 37
+
+--S 38 of 38
+rowEchelon(mm)
+--R 
+--R
+--R         +1  2  3  4 +
+--R         |           |
+--R         |0  4  8  12|
+--R   (38)  |           |
+--R         |0  0  0  0 |
+--R         |           |
+--R         +0  0  0  0 +
+--R                                                         Type: Matrix Integer
+--E 38
+)spool
+)lisp (bye)
+@
+<<Matrix.help>>=
+====================================================================
+Matrix examples
+====================================================================
+
+The Matrix domain provides arithmetic operations on matrices
+and standard functions from linear algebra.
+This domain is similar to the TwoDimensionalArray domain, except
+that the entries for Matrix must belong to a  Ring.
+
+====================================================================
+Creating Matrices
+====================================================================
+
+There are many ways to create a matrix from a collection of values or
+from existing matrices.
+
+If the matrix has almost all items equal to the same value, use new to
+create a matrix filled with that value and then reset the entries that
+are different.
+
+  m : Matrix(Integer) := new(3,3,0)
+    +0  0  0+
+    |       |
+    |0  0  0|
+    |       |
+    +0  0  0+
+                      Type: Matrix Integer
+
+To change the entry in the second row, third column to 5, use setelt.
+
+  setelt(m,2,3,5)
+    5
+                      Type: PositiveInteger
+
+An alternative syntax is to use assignment.
+
+  m(1,2) := 10
+    10
+                      Type: PositiveInteger
+
+The matrix was destructively modified.
+
+  m
+    +0  10  0+
+    |        |
+    |0  0   5|
+    |        |
+    +0  0   0+
+                      Type: Matrix Integer
+
+If you already have the matrix entries as a list of lists, use matrix.
+
+  matrix [ [1,2,3,4],[0,9,8,7] ]
+    +1  2  3  4+
+    |          |
+    +0  9  8  7+
+                      Type: Matrix Integer
+
+If the matrix is diagonal, use diagonalMatrix.
+
+  dm := diagonalMatrix [1,x**2,x**3,x**4,x**5]
+        +1  0   0   0   0 +
+        |                 |
+        |    2            |
+        |0  x   0   0   0 |
+        |                 |
+        |        3        |
+        |0  0   x   0   0 |
+        |                 |
+        |            4    |
+        |0  0   0   x   0 |
+        |                 |
+        |                5|
+        +0  0   0   0   x +
+                     Type: Matrix Polynomial Integer
+
+Use setRow and setColumn to change a row or column of a matrix.
+
+  setRow!(dm,5,vector [1,1,1,1,1])
+        +1  0   0   0   0+
+        |                |
+        |    2           |
+        |0  x   0   0   0|
+        |                |
+        |        3       |
+        |0  0   x   0   0|
+        |                |
+        |            4   |
+        |0  0   0   x   0|
+        |                |
+        +1  1   1   1   1+
+                    Type: Matrix Polynomial Integer
+
+  setColumn!(dm,2,vector [y,y,y,y,y])
+        +1  y  0   0   0+
+        |               |
+        |0  y  0   0   0|
+        |               |
+        |       3       |
+        |0  y  x   0   0|
+        |               |
+        |           4   |
+        |0  y  0   x   0|
+        |               |
+        +1  y  1   1   1+
+                    Type: Matrix Polynomial Integer
+
+Use copy to make a copy of a matrix.
+
+  cdm := copy(dm)
+        +1  y  0   0   0+
+        |               |
+        |0  y  0   0   0|
+        |               |
+        |       3       |
+        |0  y  x   0   0|
+        |               |
+        |           4   |
+        |0  y  0   x   0|
+        |               |
+        +1  y  1   1   1+
+                    Type: Matrix Polynomial Integer
+
+This is useful if you intend to modify a matrix destructively but
+want a copy of the original.
+
+  setelt(dm,4,1,1-x**7)
+        7
+     - x  + 1
+                    Type: Polynomial Integer
+
+  [dm,cdm]
+          +   1      y  0   0   0+ +1  y  0   0   0+
+          |                      | |               |
+          |   0      y  0   0   0| |0  y  0   0   0|
+          |                      | |               |
+          |              3       | |       3       |
+         [|   0      y  x   0   0|,|0  y  x   0   0|]
+          |                      | |               |
+          |   7              4   | |           4   |
+          |- x  + 1  y  0   x   0| |0  y  0   x   0|
+          |                      | |               |
+          +   1      y  1   1   1+ +1  y  1   1   1+
+                     Type: List Matrix Polynomial Integer
+
+Use subMatrix to extract part of an existing matrix.  The syntax is 
+subMatrix(m, firstrow, lastrow, firstcol, lastcol).
+
+  subMatrix(dm,2,3,2,4)
+         +y  0   0+
+         |        |
+         |    3   |
+         +y  x   0+
+                     Type: Matrix Polynomial Integer
+
+To change a submatrix, use setsubMatrix.
+
+  d := diagonalMatrix [1.2,-1.3,1.4,-1.5]
+         +1.2   0.0   0.0   0.0 +
+         |                      |
+         |0.0  - 1.3  0.0   0.0 |
+         |                      |
+         |0.0   0.0   1.4   0.0 |
+         |                      |
+         +0.0   0.0   0.0  - 1.5+
+                     Type: Matrix Float
+
+If e is too big to fit where you specify, an error message is
+displayed.  Use subMatrix to extract part of e, if necessary.
+
+  e := matrix [ [6.7,9.11],[-31.33,67.19] ]
+         +  6.7    9.11 +
+         |              |
+         +- 31.33  67.19+
+                      Type: Matrix Float
+
+This changes the submatrix of d whose upper left corner is at the
+first row and second column and whose size is that of e.
+
+  setsubMatrix!(d,1,2,e)
+         +1.2    6.7    9.11    0.0 +
+         |                          |
+         |0.0  - 31.33  67.19   0.0 |
+         |                          |
+         |0.0    0.0     1.4    0.0 |
+         |                          |
+         +0.0    0.0     0.0   - 1.5+
+                       Type: Matrix Float
+
+  d
+         +1.2    6.7    9.11    0.0 +
+         |                          |
+         |0.0  - 31.33  67.19   0.0 |
+         |                          |
+         |0.0    0.0     1.4    0.0 |
+         |                          |
+         +0.0    0.0     0.0   - 1.5+
+                        Type: Matrix Float
+
+Matrices can be joined either horizontally or vertically to make
+new matrices.
+
+  a := matrix [ [1/2,1/3,1/4],[1/5,1/6,1/7] ]
+         +1  1  1+
+         |-  -  -|
+         |2  3  4|
+         |       |
+         |1  1  1|
+         |-  -  -|
+         +5  6  7+
+                         Type: Matrix Fraction Integer
+
+  b := matrix [ [3/5,3/7,3/11],[3/13,3/17,3/19] ] 
+         +3   3    3+
+         |-   -   --|
+         |5   7   11|
+         |          |
+         | 3   3   3|
+         |--  --  --|
+         +13  17  19+
+                         Type: Matrix Fraction Integer
+
+Use horizConcat to append them side to side.  The two matrices must
+have the same number of rows.
+
+  horizConcat(a,b)
+         +1  1  1  3   3    3+
+         |-  -  -  -   -   --|
+         |2  3  4  5   7   11|
+         |                   |
+         |1  1  1   3   3   3|
+         |-  -  -  --  --  --|
+         +5  6  7  13  17  19+
+                         Type: Matrix Fraction Integer
+
+Use vertConcat to stack one upon the other.  The two matrices must
+have the same number of columns.
+
+  vab := vertConcat(a,b)
+         +1   1   1 +
+         |-   -   - |
+         |2   3   4 |
+         |          |
+         |1   1   1 |
+         |-   -   - |
+         |5   6   7 |
+         |          |
+         |3   3    3|
+         |-   -   --|
+         |5   7   11|
+         |          |
+         | 3   3   3|
+         |--  --  --|
+         +13  17  19+
+                         Type: Matrix Fraction Integer
+
+The operation transpose is used to create a new matrix by reflection
+across the main diagonal.
+
+  transpose vab
+         +1  1  3    3+
+         |-  -  -   --|
+         |2  5  5   13|
+         |            |
+         |1  1  3    3|
+         |-  -  -   --|
+         |3  6  7   17|
+         |            |
+         |1  1   3   3|
+         |-  -  --  --|
+         +4  7  11  19+
+                         Type: Matrix Fraction Integer
+
+====================================================================
+Operations on Matrices
+====================================================================
+
+Axiom provides both left and right scalar multiplication.
+
+  m := matrix [ [1,2],[3,4] ]
+         +1  2+
+         |    |
+         +3  4+
+                          Type: Matrix Integer
+
+  4 * m * (-5)
+         +- 20  - 40+
+         |          |
+         +- 60  - 80+
+                          Type: Matrix Integer
+
+You can add, subtract, and multiply matrices provided, of course, that
+the matrices have compatible dimensions.  If not, an error message is
+displayed.
+
+  n := matrix([ [1,0,-2],[-3,5,1] ])
+         + 1   0  - 2+
+         |           |
+         +- 3  5   1 +
+                          Type: Matrix Integer
+
+This following product is defined but n * m is not.
+
+  m * n
+         +- 5  10   0 +
+         |            |
+         +- 9  20  - 2+
+                          Type: Matrix Integer
+
+The operations nrows and ncols return the number of rows and columns
+of a matrix.  You can extract a row or a column of a matrix using the
+operations row and column.  The object returned is a Vector.
+
+Here is the third column of the matrix n.
+
+  vec := column(n,3)
+     [- 2,1]
+                          Type: Vector Integer
+
+You can multiply a matrix on the left by a "row vector" and on the right
+by a "column vector".
+
+  vec * m
+     [1,0]
+                          Type: Vector Integer
+
+Of course, the dimensions of the vector and the matrix must be compatible
+or an error message is returned.
+
+  m * vec
+    [0,- 2]
+                          Type: Vector Integer
+
+The operation inverse computes the inverse of a matrix if the matrix
+is invertible, and returns "failed" if not.
+
+This Hilbert matrix is invertible.
+
+  hilb := matrix([ [1/(i + j) for i in 1..3] for j in 1..3])
+         +1  1  1+
+         |-  -  -|
+         |2  3  4|
+         |       |
+         |1  1  1|
+         |-  -  -|
+         |3  4  5|
+         |       |
+         |1  1  1|
+         |-  -  -|
+         +4  5  6+
+                          Type: Matrix Fraction Integer
+
+  inverse(hilb)
+         + 72    - 240   180 +
+         |                   |
+         |- 240   900   - 720|
+         |                   |
+         + 180   - 720   600 +
+                          Type: Union(Matrix Fraction Integer,...)
+
+This matrix is not invertible.
+
+  mm := matrix([ [1,2,3,4], [5,6,7,8], [9,10,11,12], [13,14,15,16] ])
+         +1   2   3   4 +
+         |              |
+         |5   6   7   8 |
+         |              |
+         |9   10  11  12|
+         |              |
+         +13  14  15  16+
+                           Type: Matrix Integer
+
+  inverse(mm)
+     "failed"
+                           Type: Union("failed",...)
+
+The operation determinant computes the determinant of a matrix
+provided that the entries of the matrix belong to a CommutativeRing.
+
+The above matrix mm is not invertible and, hence, must have determinant 0.
+
+  determinant(mm)
+    0
+                           Type: NonNegativeInteger
+
+The operation trace computes the trace of a square matrix.
+
+  trace(mm)
+    34
+                           Type: PositiveInteger
+
+The operation rank computes the rank of a matrix: the maximal number
+of linearly independent rows or columns.
+
+  rank(mm)
+    2
+                           Type: PositiveInteger
+
+The operation nullity computes the nullity of a matrix: the dimension
+of its null space.
+
+  nullity(mm)
+    2
+                           Type: PositiveInteger
+
+The operation nullSpace returns a list containing a basis for the null
+space of a matrix.  Note that the nullity is the number of elements in
+a basis for the null space.
+
+  nullSpace(mm)
+    [[1,- 2,1,0],[2,- 3,0,1]]
+                           Type: List Vector Integer
+
+The operation rowEchelon returns the row echelon form of a matrix.  It
+is easy to see that the rank of this matrix is two and that its
+nullity is also two.
+
+  rowEchelon(mm)
+         +1  2  3  4 +
+         |           |
+         |0  4  8  12|
+         |           |
+         |0  0  0  0 |
+         |           |
+         +0  0  0  0 +
+                           Type: Matrix Integer
+
+See Also
+o )help OneDimensionalArray
+o )help TwoDimensionalArray
+o )help Vector
+o )help Permanent
+o )show Matrix
+o $AXIOM/doc/src/algebra/matrix.spad.dvi
+
+@
+\pagehead{Matrix}{MATRIX}
+\pagepic{ps/v103matrix.ps}{MATRIX}{1.00}
+See also:\\
+\refto{IndexedMatrix}{IMATRIX}
+\refto{RectangularMatrix}{RMATRIX}
+\refto{SquareMatrix}{SQMATRIX}
+<<domain MATRIX Matrix>>=
+)abbrev domain MATRIX Matrix
+++ Author: Grabmeier, Gschnitzer, Williamson
+++ Date Created: 1987
+++ Date Last Updated: July 1990
+++ Basic Operations:
+++ Related Domains: IndexedMatrix, RectangularMatrix, SquareMatrix
+++ Also See:
+++ AMS Classifications:
+++ Keywords: matrix, linear algebra
+++ Examples:
+++ References:
+++ Description:
+++   \spadtype{Matrix} is a matrix domain where 1-based indexing is used
+++   for both rows and columns.
+Matrix(R): Exports == Implementation where
+  R : Ring
+  Row ==> Vector R
+  Col ==> Vector R
+  mnRow ==> 1
+  mnCol ==> 1
+  MATLIN ==> MatrixLinearAlgebraFunctions(R,Row,Col,$)
+  MATSTOR ==> StorageEfficientMatrixOperations(R)
+ 
+  Exports ==> MatrixCategory(R,Row,Col) with
+    diagonalMatrix: Vector R -> $
+      ++ \spad{diagonalMatrix(v)} returns a diagonal matrix where the elements
+      ++ of v appear on the diagonal.
+
+    if R has ConvertibleTo InputForm then ConvertibleTo InputForm
+
+    if R has Field then
+      inverse: $ -> Union($,"failed")
+        ++ \spad{inverse(m)} returns the inverse of the matrix m. 
+        ++ If the matrix is not invertible, "failed" is returned.
+        ++ Error: if the matrix is not square.
+--     matrix: Vector Vector R -> $
+--       ++ \spad{matrix(v)} converts the vector of vectors v to a matrix, where
+--       ++ the vector of vectors is viewed as a vector of the rows of the
+--       ++ matrix
+--     diagonalMatrix: Vector $ -> $
+--       ++ \spad{diagonalMatrix([m1,...,mk])} creates a block diagonal matrix
+--       ++ M with block matrices {\em m1},...,{\em mk} down the diagonal,
+--       ++ with 0 block matrices elsewhere.
+--     vectorOfVectors: $ -> Vector Vector R
+--       ++ \spad{vectorOfVectors(m)} returns the rows of the matrix m as a
+--       ++ vector of vectors
+ 
+  Implementation ==>
+   InnerIndexedTwoDimensionalArray(R,mnRow,mnCol,Row,Col) add
+    minr ==> minRowIndex
+    maxr ==> maxRowIndex
+    minc ==> minColIndex
+    maxc ==> maxColIndex
+    mini ==> minIndex
+    maxi ==> maxIndex
+ 
+    minRowIndex x == mnRow
+    minColIndex x == mnCol
+ 
+    swapRows_!(x,i1,i2) ==
+        (i1 < minRowIndex(x)) or (i1 > maxRowIndex(x)) or _
+           (i2 < minRowIndex(x)) or (i2 > maxRowIndex(x)) =>
+             error "swapRows!: index out of range"
+        i1 = i2 => x
+        minRow := minRowIndex x
+        xx := x pretend PrimitiveArray(PrimitiveArray(R))
+        n1 := i1 - minRow; n2 := i2 - minRow
+        row1 := qelt(xx,n1)
+        qsetelt_!(xx,n1,qelt(xx,n2))
+        qsetelt_!(xx,n2,row1)
+        xx pretend $
+ 
+    positivePower:($,Integer,NonNegativeInteger) -> $
+    positivePower(x,n,nn) ==
+--      one? n => x
+      (n = 1) => x
+      -- no need to allocate space for 3 additional matrices
+      n = 2 => x * x
+      n = 3 => x * x * x
+      n = 4 => (y := x * x; y * y)
+      a := new(nn,nn,0) pretend Matrix(R)
+      b := new(nn,nn,0) pretend Matrix(R)
+      c := new(nn,nn,0) pretend Matrix(R)
+      xx := x pretend Matrix(R)
+      power_!(a,b,c,xx,n :: NonNegativeInteger)$MATSTOR pretend $
+ 
+    x:$ ** n:NonNegativeInteger ==
+      not((nn := nrows x) = ncols x) =>
+        error "**: matrix must be square"
+      zero? n => scalarMatrix(nn,1)
+      positivePower(x,n,nn)
+ 
+    if R has commutative("*") then
+ 
+        determinant x == determinant(x)$MATLIN
+        minordet    x == minordet(x)$MATLIN
+ 
+    if R has EuclideanDomain then
+ 
+        rowEchelon  x == rowEchelon(x)$MATLIN
+ 
+    if R has IntegralDomain then
+ 
+        rank        x == rank(x)$MATLIN
+        nullity     x == nullity(x)$MATLIN
+        nullSpace   x == nullSpace(x)$MATLIN
+ 
+    if R has Field then
+ 
+        inverse     x == inverse(x)$MATLIN
+ 
+        x:$ ** n:Integer ==
+          nn := nrows x
+          not(nn = ncols x) =>
+            error "**: matrix must be square"
+          zero? n => scalarMatrix(nn,1)
+          positive? n => positivePower(x,n,nn)
+          (xInv := inverse x) case "failed" =>
+            error "**: matrix must be invertible"
+          positivePower(xInv :: $,-n,nn)
+ 
+--     matrix(v: Vector Vector R) ==
+--       (rows := # v) = 0 => new(0,0,0)
+--       -- error check: this is a top level function
+--       cols := # v.mini(v)
+--       for k in (mini(v) + 1)..maxi(v) repeat
+--         cols ^= # v.k => error "matrix: rows of different lengths"
+--       ans := new(rows,cols,0)
+--       for i in minr(ans)..maxr(ans) for k in mini(v)..maxi(v) repeat
+--         vv := v.k
+--         for j in minc(ans)..maxc(ans) for l in mini(vv)..maxi(vv) repeat
+--           ans(i,j) := vv.l
+--       ans
+ 
+    diagonalMatrix(v: Vector R) ==
+      n := #v; ans := zero(n,n)
+      for i in minr(ans)..maxr(ans) for j in minc(ans)..maxc(ans) _
+          for k in mini(v)..maxi(v) repeat qsetelt_!(ans,i,j,qelt(v,k))
+      ans
+ 
+--     diagonalMatrix(vec: Vector $) ==
+--       rows : NonNegativeInteger := 0
+--       cols : NonNegativeInteger := 0
+--       for r in mini(vec)..maxi(vec) repeat
+--         mat := vec.r
+--         rows := rows + nrows mat; cols := cols + ncols mat
+--       ans := zero(rows,cols)
+--       loR := minr ans; loC := minc ans
+--       for r in mini(vec)..maxi(vec) repeat
+--         mat := vec.r
+--         hiR := loR + nrows(mat) - 1; hiC := loC + nrows(mat) - 1
+--         for i in loR..hiR for k in minr(mat)..maxr(mat) repeat
+--           for j in loC..hiC for l in minc(mat)..maxc(mat) repeat
+--             ans(i,j) := mat(k,l)
+--         loR := hiR + 1; loC := hiC + 1
+--       ans
+ 
+--     vectorOfVectors x ==
+--       vv : Vector Vector R := new(nrows x,0)
+--       cols := ncols x
+--       for k in mini(vv)..maxi(vv) repeat
+--         vv.k := new(cols,0)
+--       for i in minr(x)..maxr(x) for k in mini(vv)..maxi(vv) repeat
+--         v := vv.k
+--         for j in minc(x)..maxc(x) for l in mini(v)..maxi(v) repeat
+--           v.l := x(i,j)
+--       vv
+ 
+    if R has ConvertibleTo InputForm then
+      convert(x:$):InputForm ==
+         convert [convert("matrix"::Symbol)@InputForm,
+                  convert listOfLists x]$List(InputForm)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain MODMON ModMonic}
+\pagehead{ModMonic}{MODMON}
+\pagepic{ps/v103modmonic.ps}{MODMON}{1.00}
+<<domain MODMON ModMonic>>=
+)abbrev domain MODMON ModMonic
+++ Description:
+++ This package \undocumented
+-- following line prevents caching ModMonic
+)bo PUSH('ModMonic, $mutableDomains)
+ 
+ModMonic(R,Rep): C == T
+ where
+  R: Ring
+  Rep: UnivariatePolynomialCategory(R)
+  C == UnivariatePolynomialCategory(R) with
+  --operations
+    setPoly : Rep -> Rep
+	++ setPoly(x) \undocumented
+    modulus : -> Rep
+	++ modulus() \undocumented
+    reduce: Rep -> %
+	++ reduce(x) \undocumented
+    lift: % -> Rep --reduce lift = identity
+	++ lift(x) \undocumented
+    coerce: Rep -> %
+	++ coerce(x) \undocumented
+    Vectorise: % -> Vector(R)
+	++ Vectorise(x) \undocumented
+    UnVectorise: Vector(R) -> %
+	++ UnVectorise(v) \undocumented
+    An: % -> Vector(R)
+	++ An(x) \undocumented
+    pow : -> PrimitiveArray(%)
+	++ pow() \undocumented
+    computePowers : -> PrimitiveArray(%)
+	++ computePowers() \undocumented
+    if R has FiniteFieldCategory then
+       frobenius: % -> %
+	++ frobenius(x) \undocumented
+    --LinearTransf: (%,Vector(R)) -> SquareMatrix<deg> R
+  --assertions
+    if R has Finite then Finite
+  T == add
+    --constants
+      m:Rep := monomial(1,1)$Rep --| degree(m) > 0 and LeadingCoef(m) = R$1
+      d := degree(m)$Rep
+      d1 := (d-1):NonNegativeInteger
+      twod := 2*d1+1
+      frobenius?:Boolean := R has FiniteFieldCategory
+      --VectorRep:= DirectProduct(d:NonNegativeInteger,R)
+    --declarations
+      x,y: %
+      p: Rep
+      d,n: Integer
+      e,k1,k2: NonNegativeInteger
+      c: R
+      --vect: Vector(R)
+      power:PrimitiveArray(%)
+      frobeniusPower:PrimitiveArray(%)
+      computeFrobeniusPowers : () -> PrimitiveArray(%)
+    --representations
+    --mutable m    --take this out??
+    --define
+      power := new(0,0)
+      frobeniusPower := new(0,0)
+      setPoly (mon : Rep) ==
+        mon =$Rep m => mon
+        oldm := m
+        leadingCoefficient mon ^= 1 => error "polynomial must be monic"
+        -- following copy code needed since FFPOLY can modify mon
+        copymon:Rep:= 0
+        while not zero? mon repeat
+           copymon := monomial(leadingCoefficient mon, degree mon)$Rep + copymon
+           mon := reductum mon
+        m := copymon
+        d := degree(m)$Rep
+        d1 := (d-1)::NonNegativeInteger
+        twod := 2*d1+1
+        power := computePowers()
+        if frobenius? then
+          degree(oldm)>1 and not((oldm exquo$Rep m) case "failed") =>
+              for i in 1..d1 repeat
+                frobeniusPower(i) := reduce lift frobeniusPower(i)
+          frobeniusPower := computeFrobeniusPowers()
+        m
+      modulus == m
+      if R has Finite then
+         size == d * size$R
+         random == UnVectorise([random()$R for i in 0..d1])
+      0 == 0$Rep
+      1 == 1$Rep
+      c * x == c *$Rep x
+      n * x == (n::R) *$Rep x
+      coerce(c:R):% == monomial(c,0)$Rep
+      coerce(x:%):OutputForm == coerce(x)$Rep
+      coefficient(x,e):R == coefficient(x,e)$Rep
+      reductum(x) == reductum(x)$Rep
+      leadingCoefficient x == (leadingCoefficient x)$Rep
+      degree x == (degree x)$Rep
+      lift(x) == x pretend Rep
+      reduce(p) == (monicDivide(p,m)$Rep).remainder
+      coerce(p) == reduce(p)
+      x = y == x =$Rep y
+      x + y == x +$Rep y
+      - x == -$Rep x
+      x * y ==
+        p := x *$Rep y
+        ans:=0$Rep
+        while (n:=degree p)>d1 repeat
+           ans:=ans + leadingCoefficient(p)*power.(n-d)
+           p := reductum p
+        ans+p
+      Vectorise(x) == [coefficient(lift(x),i) for i in 0..d1]
+      UnVectorise(vect) ==
+        reduce(+/[monomial(vect.(i+1),i) for i in 0..d1])
+      computePowers ==
+           mat : PrimitiveArray(%):= new(d,0)
+           mat.0:= reductum(-m)$Rep
+           w: % := monomial$Rep (1,1)
+           for i in 1..d1 repeat
+              mat.i := w *$Rep mat.(i-1)
+              if degree mat.i=d then
+                mat.i:= reductum mat.i + leadingCoefficient mat.i * mat.0
+           mat
+      if frobenius? then
+          computeFrobeniusPowers() ==
+            mat : PrimitiveArray(%):= new(d,1)
+            mat.1:= mult := monomial(1, size$R)$%
+            for i in 2..d1 repeat
+               mat.i := mult * mat.(i-1)
+            mat
+
+          frobenius(a:%):% ==
+            aq:% := 0
+            while a^=0 repeat
+              aq:= aq + leadingCoefficient(a)*frobeniusPower(degree a)
+              a := reductum a
+            aq
+         
+      pow == power
+      monomial(c,e)==
+         if e<d then monomial(c,e)$Rep
+         else
+            if e<=twod then
+               c * power.(e-d)
+            else
+               k1:=e quo twod
+               k2 := (e-k1*twod)::NonNegativeInteger
+               reduce((power.d1 **k1)*monomial(c,k2))
+      if R has Field then
+
+         (x:% exquo y:%):Union(%, "failed") ==
+            uv := extendedEuclidean(y, modulus(), x)$Rep
+            uv case "failed" => "failed"
+            return reduce(uv.coef1)
+
+         recip(y:%):Union(%, "failed") ==  1 exquo y
+         divide(x:%, y:%) ==
+            (q := (x exquo y)) case "failed" => error "not divisible"
+            [q, 0]
+
+--     An(MM) == Vectorise(-(reduce(reductum(m))::MM))
+--     LinearTransf(vect,MM) ==
+--       ans:= 0::SquareMatrix<d>(R)
+--       for i in 1..d do setelt(ans,i,1,vect.i)
+--       for j in 2..d do
+--          setelt(ans,1,j, elt(ans,d,j-1) * An(MM).1)
+--          for i in 2..d do
+--            setelt(ans,i,j, elt(ans,i-1,j-1) + elt(ans,d,j-1) * An(MM).i)
+--       ans
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain MODFIELD ModularField}
+\pagehead{ModularField}{MODFIELD}
+\pagepic{ps/v103modularfield.ps}{MODFIELD}{1.00}
+See also:\\
+\refto{ModularRing}{MODRING}
+\refto{EuclideanModularRing}{EMR}
+<<domain MODFIELD ModularField>>=
+)abbrev domain MODFIELD ModularField
+++ These domains are used for the factorization and gcds
+++ of univariate polynomials over the integers in order to work modulo
+++ different  primes.
+++ See \spadtype{ModularRing}, \spadtype{EuclideanModularRing} 
+ModularField(R,Mod,reduction:(R,Mod) -> R,
+               merge:(Mod,Mod) -> Union(Mod,"failed"),
+                      exactQuo : (R,R,Mod) -> Union(R,"failed")) : C == T
+ where
+  R    :  CommutativeRing
+  Mod  :  AbelianMonoid
+
+  C == Field with
+                modulus :   %     -> Mod
+			++ modulus(x) \undocumented
+                coerce  :   %     -> R
+			++ coerce(x) \undocumented
+                reduce  : (R,Mod) -> %
+			++ reduce(r,m) \undocumented
+                exQuo   :  (%,%)  -> Union(%,"failed")
+			++ exQuo(x,y) \undocumented
+
+  T == ModularRing(R,Mod,reduction,merge,exactQuo)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain MODRING ModularRing}
+\pagehead{ModularRing}{MODRING}
+\pagepic{ps/v103modularring.ps}{MODRING}{1.00}
+See also:\\
+\refto{EuclideanModularRing}{EMR}
+\refto{ModularField}{MODFIELD}
+<<domain MODRING ModularRing>>=
+)abbrev domain MODRING ModularRing
+++ Author: P.Gianni, B.Trager
+++ Date Created:
+++ Date Last Updated:
+++ Basic Functions:
+++ Related Constructors:
+++ Also See:
+++ AMS Classifications:
+++ Keywords:
+++ References:
+++ Description:
+++ These domains are used for the factorization and gcds
+++ of univariate polynomials over the integers in order to work modulo
+++ different  primes.
+++ See \spadtype{EuclideanModularRing} ,\spadtype{ModularField}
+
+ModularRing(R,Mod,reduction:(R,Mod) -> R,
+               merge:(Mod,Mod) -> Union(Mod,"failed"),
+                      exactQuo : (R,R,Mod) -> Union(R,"failed")) : C == T
+ where
+  R    :  CommutativeRing
+  Mod  :  AbelianMonoid
+
+  C == Ring with
+                modulus :   %     -> Mod
+			++ modulus(x) \undocumented
+                coerce  :   %     -> R
+			++ coerce(x) \undocumented
+                reduce  : (R,Mod) -> %
+			++ reduce(r,m) \undocumented
+                exQuo   :  (%,%)  -> Union(%,"failed")
+			++ exQuo(x,y) \undocumented
+                recip   :    %    -> Union(%,"failed")
+			++ recip(x) \undocumented
+                inv     :    %    -> %
+			++ inv(x) \undocumented
+
+  T == add
+    --representation
+      Rep:= Record(val:R,modulo:Mod)
+    --declarations
+      x,y: %
+
+    --define
+      modulus(x)   == x.modulo
+      coerce(x)    == x.val
+      coerce(i:Integer):% == [i::R,0]$Rep
+      i:Integer * x:% == (i::%)*x
+      coerce(x):OutputForm == (x.val)::OutputForm
+      reduce (a:R,m:Mod) == [reduction(a,m),m]$Rep
+
+      characteristic():NonNegativeInteger == characteristic()$R
+      0 == [0$R,0$Mod]$Rep
+      1 == [1$R,0$Mod]$Rep
+      zero? x == zero? x.val
+--      one? x == one? x.val
+      one? x == (x.val = 1)
+
+      newmodulo(m1:Mod,m2:Mod) : Mod ==
+        r:=merge(m1,m2)
+        r case "failed" => error "incompatible moduli"
+        r::Mod
+
+      x=y ==
+        x.val = y.val => true
+        x.modulo = y.modulo => false
+        (x-y).val = 0
+      x+y == reduce((x.val +$R y.val),newmodulo(x.modulo,y.modulo))
+      x-y == reduce((x.val -$R y.val),newmodulo(x.modulo,y.modulo))
+      -x  == reduce ((-$R x.val),x.modulo)
+      x*y == reduce((x.val *$R y.val),newmodulo(x.modulo,y.modulo))
+
+      exQuo(x,y) ==
+        xm:=x.modulo
+        if xm ^=$Mod y.modulo then xm:=newmodulo(xm,y.modulo)
+        r:=exactQuo(x.val,y.val,xm)
+        r case "failed"=> "failed"
+        [r::R,xm]$Rep
+
+      --if R has EuclideanDomain then
+      recip x ==
+        r:=exactQuo(1$R,x.val,x.modulo)
+        r case "failed" => "failed"
+        [r,x.modulo]$Rep
+
+      inv x ==
+        if (u:=recip x) case "failed" then error("not invertible")
+        else u::%
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain MODMONOM ModuleMonomial}
+\pagehead{ModuleMonomial}{MODMONOM}
+\pagepic{ps/v103modulemonomial.ps}{MODMONOM}{1.00}
+See also:\\
+\refto{GeneralModulePolynomial}{GMODPOL}
+<<domain MODMONOM ModuleMonomial>>=
+)abbrev domain MODMONOM ModuleMonomial
+++ Description:
+++ This package \undocumented
+ModuleMonomial(IS: OrderedSet,
+               E: SetCategory,
+               ff:(MM, MM) -> Boolean): T == C where
+
+   MM ==> Record(index:IS, exponent:E)
+
+   T == OrderedSet  with
+        exponent: $ -> E
+		++ exponent(x) \undocumented
+        index: $ -> IS
+		++ index(x) \undocumented
+        coerce: MM -> $
+		++ coerce(x) \undocumented
+        coerce: $ -> MM
+		++ coerce(x) \undocumented
+        construct: (IS, E) -> $
+		++ construct(i,e) \undocumented
+   C == MM  add
+        Rep:= MM
+        x:$ < y:$ == ff(x::Rep, y::Rep)
+        exponent(x:$):E == x.exponent
+        index(x:$): IS == x.index
+        coerce(x:$):MM == x::Rep::MM
+        coerce(x:MM):$ == x::Rep::$
+        construct(i:IS, e:E):$ == [i, e]$MM::Rep::$
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain MOEBIUS MoebiusTransform}
+\pagehead{MoebiusTransform}{MOEBIUS}
+\pagepic{ps/v103moebiustransform.ps}{MOEBIUS}{1.00}
+<<domain MOEBIUS MoebiusTransform>>=
+)abbrev domain MOEBIUS MoebiusTransform
+++ 2-by-2 matrices acting on P1(F).
+++ Author: Stephen "Say" Watt
+++ Date Created: January 1987
+++ Date Last Updated: 11 April 1990
+++ Keywords:
+++ Examples:
+++ References:
+MoebiusTransform(F): Exports == Implementation where
+  ++ MoebiusTransform(F) is the domain of fractional linear (Moebius)
+  ++ transformations over F.
+  F : Field
+  OUT ==> OutputForm
+  P1F ==> OnePointCompletion F         -- projective 1-space over F
+ 
+  Exports ==> Group with
+ 
+    moebius: (F,F,F,F) -> %
+      ++ moebius(a,b,c,d) returns \spad{matrix [[a,b],[c,d]]}.
+    shift: F -> %
+      ++ shift(k) returns \spad{matrix [[1,k],[0,1]]} representing the map 
+      ++ \spad{x -> x + k}.
+    scale: F -> %
+      ++ scale(k) returns \spad{matrix [[k,0],[0,1]]} representing the map 
+      ++ \spad{x -> k * x}.
+    recip: () -> %
+      ++ recip() returns \spad{matrix [[0,1],[1,0]]} representing the map 
+      ++ \spad{x -> 1 / x}.
+    shift: (%,F) -> %
+      ++ shift(m,h) returns \spad{shift(h) * m} 
+      ++ (see \spadfunFrom{shift}{MoebiusTransform}).
+    scale: (%,F) -> %
+      ++ scale(m,h) returns \spad{scale(h) * m}
+      ++ (see \spadfunFrom{shift}{MoebiusTransform}).
+    recip: % -> %
+      ++ recip(m) = recip() * m
+    eval: (%,F) -> F
+      ++ eval(m,x) returns \spad{(a*x + b)/(c*x + d)} 
+      ++ where \spad{m = moebius(a,b,c,d)}
+      ++ (see \spadfunFrom{moebius}{MoebiusTransform}).
+    eval: (%,P1F) -> P1F
+      ++ eval(m,x) returns \spad{(a*x + b)/(c*x + d)} 
+      ++ where \spad{m = moebius(a,b,c,d)}
+      ++ (see \spadfunFrom{moebius}{MoebiusTransform}).
+
+  Implementation ==> add
+ 
+    Rep := Record(a: F,b: F,c: F,d: F)
+ 
+    moebius(aa,bb,cc,dd) == [aa,bb,cc,dd]
+ 
+    a(t:%):F == t.a
+    b(t:%):F == t.b
+    c(t:%):F == t.c
+    d(t:%):F == t.d
+ 
+    1 == moebius(1,0,0,1)
+    t * s ==
+      moebius(b(t)*c(s) + a(t)*a(s), b(t)*d(s) + a(t)*b(s), _
+              d(t)*c(s) + c(t)*a(s), d(t)*d(s) + c(t)*b(s))
+    inv t == moebius(d(t),-b(t),-c(t),a(t))
+ 
+    shift f == moebius(1,f,0,1)
+    scale f == moebius(f,0,0,1)
+    recip() == moebius(0,1,1,0)
+ 
+    shift(t,f) == moebius(a(t) + f*c(t), b(t) + f*d(t), c(t), d(t))
+    scale(t,f) == moebius(f*a(t),f*b(t),c(t),d(t))
+    recip t    == moebius(c(t),d(t),a(t),b(t))
+ 
+    eval(t:%,f:F) == (a(t)*f + b(t))/(c(t)*f + d(t))
+    eval(t:%,f:P1F) ==
+      (ff := retractIfCan(f)@Union(F,"failed")) case "failed" =>
+        (a(t)/c(t)) :: P1F
+      zero?(den := c(t) * (fff := ff :: F) + d(t)) => infinity()
+      ((a(t) * fff + b(t))/den) :: P1F
+ 
+    coerce t ==
+      var := "%x" :: OUT
+      num := (a(t) :: OUT) * var + (b(t) :: OUT)
+      den := (c(t) :: OUT) * var + (d(t) :: OUT)
+      rarrow(var,num/den)
+ 
+    proportional?: (List F,List F) -> Boolean
+    proportional?(list1,list2) ==
+      empty? list1 => empty? list2
+      empty? list2 => false
+      zero? (x1 := first list1) =>
+        (zero? first list2) and proportional?(rest list1,rest list2)
+      zero? (x2 := first list2) => false
+      map(#1 / x1,list1) = map(#1 / x2,list2)
+ 
+    t = s ==
+      list1 : List F := [a(t),b(t),c(t),d(t)]
+      list2 : List F := [a(s),b(s),c(s),d(s)]
+      proportional?(list1,list2)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain MRING MonoidRing}
+\pagehead{MonoidRing}{MRING}
+\pagepic{ps/v103monoidring.ps}{MRING}{1.00}
+<<domain MRING MonoidRing>>=
+)abbrev domain MRING MonoidRing
+++ Authors: Stephan M. Watt; revised by Johannes Grabmeier
+++ Date Created: January 1986
+++ Date Last Updated: 14 December 1995, Mike Dewar
+++ Basic Operations: *, +, monomials, coefficients
+++ Related Constructors: Polynomial
+++ Also See:
+++ AMS Classifications:
+++ Keywords: monoid ring, group ring, polynomials in non-commuting
+++  indeterminates
+++ References:
+++ Description:
+++  \spadtype{MonoidRing}(R,M), implements the algebra
+++  of all maps from the monoid M to the commutative ring R with
+++  finite support.
+++  Multiplication of two maps f and g is defined
+++  to map an element c of M to the (convolution) sum over {\em f(a)g(b)}
+++  such that {\em ab = c}. Thus M can be identified with a canonical
+++  basis and the maps can also be considered as formal linear combinations
+++  of the elements in M. Scalar multiples of a basis element are called
+++  monomials. A prominent example is the class of polynomials
+++  where the monoid is a direct product of the natural numbers
+++  with pointwise addition. When M is
+++  \spadtype{FreeMonoid Symbol}, one gets polynomials
+++  in infinitely many non-commuting variables. Another application
+++  area is representation theory of finite groups G, where modules
+++  over \spadtype{MonoidRing}(R,G) are studied.
+
+MonoidRing(R: Ring, M: Monoid): MRcategory == MRdefinition where
+    Term ==> Record(coef: R, monom: M)
+
+    MRcategory ==> Join(Ring, RetractableTo M, RetractableTo R) with
+        monomial         : (R, M) -> %
+          ++ monomial(r,m) creates a scalar multiple of the basis element m.
+        coefficient : (%, M) -> R
+          ++ coefficient(f,m) extracts the coefficient of m in f with respect
+          ++ to the canonical basis M.
+        coerce:   List Term -> %
+          ++ coerce(lt) converts a list of terms and coefficients to a member of the domain.
+        terms       : % -> List Term
+          ++ terms(f) gives the list of non-zero coefficients combined
+          ++ with their corresponding basis element as records.
+          ++ This is the internal representation.
+        map         : (R -> R, %) -> %
+          ++ map(fn,u) maps function fn onto the coefficients
+          ++ of the non-zero monomials of u.
+        monomial?   : % -> Boolean
+          ++ monomial?(f) tests if f is a single monomial.
+        coefficients: % -> List R
+          ++ coefficients(f) lists all non-zero coefficients.
+        monomials: % -> List %
+           ++ monomials(f) gives the list of all monomials whose
+           ++ sum is f.
+        numberOfMonomials: % -> NonNegativeInteger
+           ++ numberOfMonomials(f) is the number of non-zero coefficients
+           ++ with respect to the canonical basis.
+        if R has CharacteristicZero then CharacteristicZero
+        if R has CharacteristicNonZero then CharacteristicNonZero
+        if R has CommutativeRing then Algebra(R)
+        if (R has Finite and M has Finite) then Finite
+        if M has OrderedSet then
+          leadingMonomial   : % -> M
+            ++ leadingMonomial(f) gives the monomial of f whose
+            ++ corresponding monoid element is the greatest
+            ++ among all those with non-zero coefficients.
+          leadingCoefficient: % -> R
+            ++ leadingCoefficient(f) gives the coefficient of f, whose
+            ++ corresponding monoid element is the greatest
+            ++ among all those with non-zero coefficients.
+          reductum          : % -> %
+            ++ reductum(f) is f minus its leading monomial.
+
+    MRdefinition ==> add
+        Ex ==> OutputForm
+        Cf ==> coef
+        Mn ==> monom
+
+        Rep  := List Term
+
+        coerce(x: List Term): % == x :: %
+
+        monomial(r:R, m:M)  ==
+          r = 0 => empty()
+          [[r, m]]
+
+        if (R has Finite and M has Finite) then
+          size() == size()$R ** size()$M
+
+          index k ==
+            -- use p-adic decomposition of k
+            -- coefficient of p**j determines coefficient of index(i+p)$M
+            i:Integer := k rem size()
+            p:Integer := size()$R
+            n:Integer := size()$M
+            ans:% := 0
+            for j in 0.. while i > 0 repeat
+              h := i rem p
+              -- we use index(p) = 0$R
+              if h ^= 0 then
+                c : R := index(h :: PositiveInteger)$R
+                m : M := index((j+n) :: PositiveInteger)$M
+                --ans := ans + c *$% m
+                ans := ans + monomial(c, m)$%
+              i := i quo p
+            ans
+
+          lookup(z : %) : PositiveInteger ==
+            -- could be improved, if M has OrderedSet
+            -- z = index lookup z, n = lookup index n
+            -- use p-adic decomposition of k
+            -- coefficient of p**j determines coefficient of index(i+p)$M
+            zero?(z) => size()$% pretend PositiveInteger
+            liTe : List Term := terms z  -- all non-zero coefficients
+            p  : Integer := size()$R
+            n  : Integer := size()$M
+            res : Integer := 0
+            for te in liTe repeat
+              -- assume that lookup(p)$R = 0
+              l:NonNegativeInteger:=lookup(te.Mn)$M
+              ex : NonNegativeInteger := (n=l => 0;l)
+              co : Integer := lookup(te.Cf)$R
+              res := res + co * p ** ex
+            res pretend PositiveInteger
+
+          random() == index( (1+(random()$Integer rem size()$%) )_
+            pretend PositiveInteger)$%
+
+        0                   == empty()
+        1                   == [[1, 1]]
+        terms a             == (copy a) pretend List(Term)
+        monomials a         == [[t] for t in a]
+        coefficients a      == [t.Cf for t in a]
+        coerce(m:M):%       == [[1, m]]
+        coerce(r:R): % ==
+        -- coerce of ring
+          r = 0 => 0
+          [[r,    1]]
+        coerce(n:Integer): % ==
+        -- coerce of integers
+          n = 0 => 0
+          [[n::R, 1]]
+        - a                 == [[ -t.Cf, t.Mn] for t in a]
+        if R has noZeroDivisors
+           then
+            (r:R) * (a:%) ==
+              r = 0 => 0
+              [[r*t.Cf, t.Mn] for t in a]
+           else
+            (r:R) * (a:%) ==
+              r = 0 => 0
+              [[rt, t.Mn] for t in a | (rt:=r*t.Cf) ^= 0]
+        if R has noZeroDivisors
+           then
+            (n:Integer) * (a:%) ==
+              n = 0 => 0
+              [[n*t.Cf, t.Mn] for t in a]
+           else
+            (n:Integer) * (a:%) ==
+              n = 0 => 0
+              [[nt, t.Mn] for t in a | (nt:=n*t.Cf) ^= 0]
+        map(f, a)           == [[ft, t.Mn] for t in a | (ft:=f(t.Cf)) ^= 0]
+        numberOfMonomials a == #a
+
+        retractIfCan(a:%):Union(M, "failed") ==
+--          one?(#a) and one?(a.first.Cf) => a.first.Mn
+          ((#a) = 1) and ((a.first.Cf) = 1) => a.first.Mn
+          "failed"
+
+        retractIfCan(a:%):Union(R, "failed") ==
+--          one?(#a) and one?(a.first.Mn) => a.first.Cf
+          ((#a) = 1) and ((a.first.Mn) = 1) => a.first.Cf
+          "failed"
+
+        if R has noZeroDivisors then
+          if M has Group then
+            recip a ==
+              lt := terms a
+              #lt ^= 1 => "failed"
+              (u := recip lt.first.Cf) case "failed" => "failed"
+              --(u::R) * inv lt.first.Mn
+              monomial((u::R), inv lt.first.Mn)$%
+          else
+            recip a ==
+              #a ^= 1 or a.first.Mn ^= 1 => "failed"
+              (u := recip a.first.Cf) case "failed" => "failed"
+              u::R::%
+
+        mkTerm(r:R, m:M):Ex ==
+            r=1 => m::Ex
+            r=0 or m=1 => r::Ex
+            r::Ex * m::Ex
+
+        coerce(a:%):Ex ==
+            empty? a => (0$Integer)::Ex
+            empty? rest a => mkTerm(a.first.Cf, a.first.Mn)
+            reduce(_+, [mkTerm(t.Cf, t.Mn) for t in a])$List(Ex)
+
+        if M has OrderedSet then -- we mean totally ordered
+            -- Terms are stored in decending order.
+            leadingCoefficient a == (empty? a => 0; a.first.Cf)
+            leadingMonomial a    == (empty? a => 1; a.first.Mn)
+            reductum a           == (empty? a => a; rest a)
+
+            a = b ==
+                #a ^= #b => false
+                for ta in a for tb in b repeat
+                    ta.Cf ^= tb.Cf or ta.Mn ^= tb.Mn => return false
+                true
+
+            a + b ==
+                c:% := empty()
+                while not empty? a and not empty? b repeat
+                  ta := first a; tb := first b
+                  ra := rest a;  rb := rest b
+                  c :=
+                    ta.Mn > tb.Mn => (a := ra; concat_!(c, ta))
+                    ta.Mn < tb.Mn => (b := rb; concat_!(c, tb))
+                    a := ra; b := rb
+                    not zero?(r := ta.Cf+tb.Cf) =>
+                                        concat_!(c, [r, ta.Mn])
+                    c
+                concat_!(c, concat(a, b))
+
+            coefficient(a, m) ==
+                for t in a repeat
+                    if t.Mn = m then return t.Cf
+                    if t.Mn < m then return 0
+                0
+
+
+            if M has OrderedMonoid then
+
+            -- we use that multiplying an ordered list of monoid elements
+            -- by a single element respects the ordering
+
+              if R has noZeroDivisors then
+                a:% * b:% ==
+                  +/[[[ta.Cf*tb.Cf, ta.Mn*tb.Mn]$Term
+                    for tb in b ] for ta in reverse a]
+              else
+                a:% * b:% ==
+                  +/[[[r, ta.Mn*tb.Mn]$Term
+                    for tb in b | not zero?(r := ta.Cf*tb.Cf)]
+                      for ta in reverse a]
+            else -- M hasn't OrderedMonoid
+
+            -- we cannot assume that mutiplying an ordered list of
+            -- monoid elements by a single element respects the ordering:
+            -- we have to order and to collect equal terms
+              ge : (Term,Term) -> Boolean
+              ge(s,t) == t.Mn <= s.Mn
+
+              sortAndAdd : List Term -> List Term
+              sortAndAdd(liTe) ==  -- assume liTe not empty
+                liTe := sort(ge,liTe)
+                m : M :=  (first liTe).Mn
+                cf : R := (first liTe).Cf
+                res : List Term := []
+                for te in rest liTe repeat
+                  if m = te.Mn then
+                    cf := cf + te.Cf
+                  else
+                    if not zero? cf then res := cons([cf,m]$Term, res)
+                    m := te.Mn
+                    cf := te.Cf
+                if not zero? cf then res := cons([cf,m]$Term, res)
+                reverse res
+
+
+              if R has noZeroDivisors then
+                a:% * b:% ==
+                  zero? a => a
+                  zero? b => b  -- avoid calling sortAndAdd with []
+                  +/[sortAndAdd [[ta.Cf*tb.Cf, ta.Mn*tb.Mn]$Term
+                    for tb in b ] for ta in reverse a]
+              else
+                a:% * b:% ==
+                  zero? a => a
+                  zero? b => b  -- avoid calling sortAndAdd with []
+                  +/[sortAndAdd [[r, ta.Mn*tb.Mn]$Term
+                    for tb in b | not zero?(r := ta.Cf*tb.Cf)]
+                      for ta in reverse a]
+
+
+        else -- M hasn't OrderedSet
+            -- Terms are stored in random order.
+          a = b ==
+            #a ^= #b => false
+            brace(a pretend List(Term)) =$Set(Term) brace(b pretend List(Term))
+
+          coefficient(a, m) ==
+            for t in a repeat
+              t.Mn = m => return t.Cf
+            0
+
+          addterm(Tabl: AssociationList(M,R), r:R, m:M):R ==
+              (u := search(m, Tabl)) case "failed" => Tabl.m := r
+              zero?(r := r + u::R) => (remove_!(m, Tabl); 0)
+              Tabl.m := r
+
+          a + b ==
+              Tabl := table()$AssociationList(M,R)
+              for t in a repeat
+                  Tabl t.Mn := t.Cf
+              for t in b repeat
+                  addterm(Tabl, t.Cf, t.Mn)
+              [[Tabl m, m]$Term for m in keys Tabl]
+
+          a:% * b:% ==
+              Tabl := table()$AssociationList(M,R)
+              for ta in a repeat
+                  for tb in (b pretend List(Term)) repeat
+                      addterm(Tabl, ta.Cf*tb.Cf, ta.Mn*tb.Mn)
+              [[Tabl.m, m]$Term for m in keys Tabl]
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain MSET Multiset}
+<<Multiset.input>>=
+-- mset.spad.pamphlet Multiset.input
+)spool Multiset.output
+)set message test on
+)set message auto off
+)clear all
+--S 1 of 14
+s := multiset [1,2,3,4,5,4,3,2,3,4,5,6,7,4,10]
+--R 
+--R
+--R   (1)  {1,2: 2,3: 3,4: 4,2: 5,6,7,10}
+--R                                               Type: Multiset PositiveInteger
+--E 1
+
+--S 2 of 14
+insert!(3,s)
+--R 
+--R
+--R   (2)  {1,2: 2,4: 3,4: 4,2: 5,6,7,10}
+--R                                               Type: Multiset PositiveInteger
+--E 2
+
+--S 3 of 14
+remove!(3,s,1)
+--R 
+--R
+--R   (3)  {1,2: 2,3: 3,4: 4,2: 5,6,7,10}
+--R                                               Type: Multiset PositiveInteger
+--E 3
+
+--S 4 of 14
+s
+--R 
+--R
+--R   (4)  {1,2: 2,3: 3,4: 4,2: 5,6,7,10}
+--R                                               Type: Multiset PositiveInteger
+--E 4
+
+--S 5 of 14
+remove!(5,s)
+--R 
+--R
+--R   (5)  {1,2: 2,3: 3,4: 4,6,7,10}
+--R                                               Type: Multiset PositiveInteger
+--E 5
+
+--S 6 of 14
+s
+--R 
+--R
+--R   (6)  {1,2: 2,3: 3,4: 4,6,7,10}
+--R                                               Type: Multiset PositiveInteger
+--E 6
+
+--S 7 of 14
+count(5,s)
+--R 
+--R
+--R   (7)  0
+--R                                                     Type: NonNegativeInteger
+--E 7
+
+--S 8 of 14
+t := multiset [2,2,2,-9]
+--R 
+--R
+--R   (8)  {3: 2,- 9}
+--R                                                       Type: Multiset Integer
+--E 8
+
+--S 9 of 14
+U := union(s,t)
+--R 
+--R
+--R   (9)  {1,5: 2,3: 3,4: 4,6,7,10,- 9}
+--R                                                       Type: Multiset Integer
+--E 9
+
+--S 10 of 14
+I := intersect(s,t)
+--R 
+--R
+--R   (10)  {5: 2}
+--R                                                       Type: Multiset Integer
+--E 10
+
+--S 11 of 14
+difference(s,t)
+--R 
+--R
+--R   (11)  {1,3: 3,4: 4,6,7,10}
+--R                                                       Type: Multiset Integer
+--E 11
+
+--S 12 of 14
+S := symmetricDifference(s,t)
+--R 
+--R
+--R   (12)  {1,3: 3,4: 4,6,7,10,- 9}
+--R                                                       Type: Multiset Integer
+--E 12
+
+--S 13 of 14
+(U = union(S,I))@Boolean
+--R 
+--R
+--R   (13)  true
+--R                                                                Type: Boolean
+--E 13
+
+--S 14 of 14
+t1 := multiset [1,2,2,3]; [t1 < t, t1 < s, t < s, t1 <= s]
+--R 
+--R
+--R   (14)  [false,true,false,true]
+--R                                                           Type: List Boolean
+--E 14
+)spool
+)lisp (bye)
+@
+<<Multiset.help>>=
+====================================================================
+Multiset examples
+====================================================================
+
+The domain Multiset(R) is similar to Set(R) except that multiplicities
+(counts of duplications) are maintained and displayed.  Use the
+operation multiset to create multisets from lists.  All the standard
+operations from sets are available for multisets.  An element with
+multiplicity greater than one has the multiplicity displayed first,
+then a colon, and then the element.
+
+Create a multiset of integers.
+
+  s := multiset [1,2,3,4,5,4,3,2,3,4,5,6,7,4,10]
+    {1,2: 2,3: 3,4: 4,2: 5,6,7,10}
+                          Type: Multiset PositiveInteger
+
+The operation insert! adds an element to a multiset.
+
+  insert!(3,s)
+    {1,2: 2,4: 3,4: 4,2: 5,6,7,10}
+                          Type: Multiset PositiveInteger
+
+Use remove! to remove an element.  If a third argument is present, it
+specifies how many instances to remove. Otherwise all instances of the
+element are removed.  Display the resulting multiset.
+
+  remove!(3,s,1); s
+
+    {1,2: 2,3: 3,4: 4,2: 5,6,7,10}
+                          Type: Multiset PositiveInteger
+
+  remove!(5,s); s
+    {1,2: 2,3: 3,4: 4,6,7,10}
+                          Type: Multiset PositiveInteger
+
+The operation count returns the number of copies of a given value.
+
+  count(5,s)
+    0
+                          Type: NonNegativeInteger
+
+A second multiset.
+
+  t := multiset [2,2,2,-9]
+    {3: 2,- 9}
+                          Type: Multiset Integer
+
+The union of two multisets is additive.
+
+  U := union(s,t)
+    {1,5: 2,3: 3,4: 4,6,7,10,- 9}
+                          Type: Multiset Integer
+
+The intersect operation gives the elements that are in common, with
+additive multiplicity.
+
+  I := intersect(s,t)
+    {5: 2}
+                          Type: Multiset Integer
+
+The difference of s and t consists of the elements that s has but t
+does not.  Elements are regarded as indistinguishable, so that if s
+and t have any element in common, the difference does not contain that
+element.
+
+  difference(s,t)
+    {1,3: 3,4: 4,6,7,10}
+                          Type: Multiset Integer
+
+The symmetricDifference is the union of difference(s, t) and difference(t, s).
+
+  S := symmetricDifference(s,t)
+    {1,3: 3,4: 4,6,7,10,- 9}
+                          Type: Multiset Integer
+
+Check that the union of the symmetricDifference and the intersect
+equals the union of the elements.
+
+  (U = union(S,I))@Boolean
+    true
+                          Type: Boolean
+
+Check some inclusion relations.
+
+  t1 := multiset [1,2,2,3]; [t1 < t, t1 < s, t < s, t1 <= s]
+    [false,true,false,true]
+                          Type: List Boolean
+
+See Also:
+o )show Multiset
+o $AXIOM/doc/src/algebra/mset.spad.dvi
+
+@
+\pagehead{Multiset}{MSET}
+\pagepic{ps/v103multiset.ps}{MSET}{1.00}
+<<domain MSET Multiset>>=
+)abbrev domain MSET Multiset
+++ Author:Stephen M. Watt, William H. Burge, Richard D. Jenks, Frederic Lehobey
+++ Date Created:NK
+++ Date Last Updated: 14 June 1994
+++ Basic Operations:
+++ Related Domains:
+++ Also See:
+++ AMS Classifications:
+++ Keywords:
+++ Examples:
+++ References:
+++ Description: A multiset is a set with multiplicities.
+Multiset(S: SetCategory): MultisetAggregate S with
+        finiteAggregate
+        shallowlyMutable
+        multiset: () -> %
+          ++ multiset()$D creates an empty multiset of domain D.
+        multiset: S -> %
+          ++ multiset(s) creates a multiset with singleton s.
+        multiset: List S -> %
+          ++ multiset(ls) creates a multiset with elements from \spad{ls}.
+        members: % -> List S
+          ++ members(ms) returns a list of the elements of \spad{ms}
+          ++ {\em without} their multiplicity. See also \spadfun{parts}.
+        remove: (S,%,Integer) -> %
+          ++ remove(x,ms,number) removes at most \spad{number} copies of
+          ++ element x if \spad{number} is positive, all of them if
+          ++ \spad{number} equals zero, and all but at most \spad{-number} if
+          ++ \spad{number} is negative.
+        remove: ( S -> Boolean ,%,Integer) -> %
+          ++ remove(p,ms,number) removes at most \spad{number} copies of
+          ++ elements x such that \spad{p(x)} is \spadfun{true}
+          ++ if \spad{number} is positive, all of them if
+          ++ \spad{number} equals zero, and all but at most \spad{-number} if
+          ++ \spad{number} is negative.
+        remove_!: (S,%,Integer) -> %
+          ++ remove!(x,ms,number) removes destructively at most \spad{number}
+          ++ copies of element x if \spad{number} is positive, all
+          ++ of them if \spad{number} equals zero, and all but at most
+          ++ \spad{-number} if \spad{number} is negative.
+        remove_!: ( S -> Boolean ,%,Integer) -> %
+          ++ remove!(p,ms,number) removes destructively at most \spad{number}
+          ++ copies of elements x such that \spad{p(x)} is
+          ++ \spadfun{true} if \spad{number} is positive, all of them if
+          ++ \spad{number} equals zero, and all but at most \spad{-number} if
+          ++ \spad{number} is negative.
+
+    == add
+
+        Tbl ==> Table(S, Integer)
+        tbl ==> table$Tbl
+        Rep := Record(count: Integer, table: Tbl)
+
+        n: Integer
+        ms, m1, m2: %
+        t,  t1, t2: Tbl
+        D ==> Record(entry: S, count: NonNegativeInteger)
+        K ==> Record(key: S, entry: Integer)
+
+        elt(t:Tbl, s:S):Integer ==
+          a := search(s,t)$Tbl
+          a case "failed" => 0
+          a::Integer
+
+        empty():% == [0,tbl()]
+        multiset():% == empty()
+        dictionary():% == empty()			-- DictionaryOperations
+        set():% == empty()
+        brace():% == empty()
+
+        construct(l:List S):% ==
+            t := tbl()
+            n := 0
+            for e in l repeat
+              t.e := inc t.e
+              n := inc n
+            [n, t]
+        multiset(l:List S):% == construct l
+        bag(l:List S):% == construct l			-- BagAggregate
+        dictionary(l:List S):% == construct l		-- DictionaryOperations
+        set(l:List S):% == construct l
+        brace(l:List S):% == construct l
+
+        multiset(s:S):% == construct [s]
+
+        if S has ConvertibleTo InputForm then
+          convert(ms:%):InputForm ==
+            convert [convert("multiset"::Symbol)@InputForm,
+             convert(parts ms)@InputForm]
+
+        members(ms:%):List S == keys ms.table
+
+        coerce(ms:%):OutputForm ==
+            l: List OutputForm := empty()
+            t := ms.table
+            colon := ": " :: OutputForm
+            for e in keys t repeat
+                ex := e::OutputForm
+                n := t.e
+                item :=
+                  n > 1 => hconcat [n :: OutputForm,colon, ex]
+                  ex
+                l := cons(item,l)
+            brace l
+
+        duplicates(ms:%):List D ==			-- MultiDictionary
+          ld : List D := empty()
+          t := ms.table
+          for e in keys t | (n := t.e) > 1 repeat
+            ld := cons([e,n::NonNegativeInteger],ld)
+          ld
+
+        extract_!(ms:%):S ==				-- BagAggregate
+          empty? ms => error "extract: Empty multiset"
+          ms.count := dec ms.count
+          t := ms.table
+          e := inspect(t).key
+          if (n := t.e) > 1 then t.e := dec n
+           else remove_!(e,t)
+          e
+
+        inspect(ms:%):S == inspect(ms.table).key	-- BagAggregate
+
+        insert_!(e:S,ms:%):% ==				-- BagAggregate
+            ms.count   := inc ms.count
+            ms.table.e := inc ms.table.e
+            ms
+
+        member?(e:S,ms:%):Boolean == member?(e,keys ms.table)
+
+        empty?(ms:%):Boolean == ms.count = 0
+
+        #(ms:%):NonNegativeInteger == ms.count::NonNegativeInteger
+
+        count(e:S, ms:%):NonNegativeInteger == ms.table.e::NonNegativeInteger
+
+        remove_!(e:S, ms:%, max:Integer):% ==
+          zero? max => remove_!(e,ms)
+          t := ms.table
+          if member?(e, keys t) then
+            ((n := t.e) <= max) =>
+              remove_!(e,t)
+              ms.count := ms.count-n
+            max > 0 =>
+              t.e := n-max
+              ms.count := ms.count-max
+            (n := n+max) > 0 =>
+              t.e := -max
+              ms.count := ms.count-n
+          ms
+
+        remove_!(p: S -> Boolean, ms:%, max:Integer):% ==
+          zero? max => remove_!(p,ms)
+          t := ms.table
+          for e in keys t | p(e) repeat
+            ((n := t.e) <= max) =>
+              remove_!(e,t)
+              ms.count := ms.count-n
+            max > 0 =>
+              t.e := n-max
+              ms.count := ms.count-max
+            (n := n+max) > 0 =>
+              t.e := -max
+              ms.count := ms.count-n
+          ms
+
+        remove(e:S, ms:%, max:Integer):% == remove_!(e, copy ms, max)
+
+        remove(p: S -> Boolean,ms:%,max:Integer):% == remove_!(p, copy ms, max)
+
+        remove_!(e:S, ms:%):% ==			-- DictionaryOperations
+          t := ms.table
+          if member?(e, keys t) then
+            ms.count := ms.count-t.e
+            remove_!(e, t)
+          ms
+
+        remove_!(p:S ->Boolean, ms:%):% ==		-- DictionaryOperations
+          t := ms.table
+          for e in keys t | p(e) repeat
+            ms.count := ms.count-t.e
+            remove_!(e, t)
+          ms
+
+	select_!(p: S -> Boolean, ms:%):% ==		-- DictionaryOperations
+          remove_!(not p(#1), ms)
+
+        removeDuplicates_!(ms:%):% ==			-- MultiDictionary
+          t := ms.table
+          l := keys t
+          for e in l repeat t.e := 1
+          ms.count := #l
+          ms
+
+        insert_!(e:S,ms:%,more:NonNegativeInteger):% ==	-- MultiDictionary
+            ms.count   := ms.count+more
+            ms.table.e := ms.table.e+more
+            ms
+
+        map_!(f: S->S, ms:%):% ==			-- HomogeneousAggregate
+          t := ms.table
+          t1 := tbl()
+          for e in keys t repeat
+            t1.f(e) := t.e
+            remove_!(e, t)
+          ms.table := t1
+          ms
+
+	map(f: S -> S, ms:%):% == map_!(f, copy ms)	-- HomogeneousAggregate
+
+        parts(m:%):List S ==
+          l := empty()$List(S)
+          t := m.table
+          for e in keys t repeat
+            for i in 1..t.e repeat
+              l := cons(e,l)
+          l
+
+        union(m1:%, m2:%):% ==
+            t := tbl()
+            t1:= m1.table
+            t2:= m2.table
+            for e in keys t1 repeat t.e := t1.e
+            for e in keys t2 repeat t.e := t2.e + t.e
+            [m1.count + m2.count, t]
+
+        intersect(m1:%, m2:%):% ==
+--          if #m1 > #m2 then intersect(m2, m1)
+            t := tbl()
+            t1:= m1.table
+            t2:= m2.table
+            n := 0
+            for e in keys t1 repeat
+              m := min(t1.e,t2.e)
+              m > 0 =>
+                m := t1.e + t2.e
+                t.e := m
+                n := n + m
+            [n, t]
+
+        difference(m1:%, m2:%):% ==
+            t := tbl()
+            t1:= m1.table
+            t2:= m2.table
+            n := 0
+            for e in keys t1 repeat
+              k1 := t1.e
+              k2 := t2.e
+              k1 > 0 and k2 = 0 =>
+                t.e := k1
+                n := n + k1
+            n = 0 => empty()
+            [n, t]
+
+        symmetricDifference(m1:%, m2:%):% ==
+            union(difference(m1,m2), difference(m2,m1))
+
+        m1 = m2 ==
+            m1.count ^= m2.count => false
+            t1 := m1.table
+            t2 := m2.table
+            for e in keys t1 repeat
+                t1.e ^= t2.e => return false
+            for e in keys t2 repeat
+                t1.e ^= t2.e => return false
+            true
+
+        m1 < m2 ==
+            m1.count >= m2.count => false
+            t1 := m1.table
+            t2 := m2.table
+            for e in keys t1 repeat
+                t1.e > t2.e => return false
+            m1.count < m2.count
+
+        subset?(m1:%, m2:%):Boolean ==
+            m1.count > m2.count => false
+            t1 := m1.table
+            t2 := m2.table
+            for e in keys t1 repeat t1.e > t2.e => return false
+            true
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain MPOLY MultivariatePolynomial}
+<<MultivariatePolynomial.input>>=
+-- multpoly.spad.pamphlet MultivariatePolynomial.input
+)spool MultivariatePolynomial.output
+)set message test on
+)set message auto off
+)clear all
+--S 1 of 9
+m : MPOLY([x,y],INT) := (x^2 - x*y^3 +3*y)^2
+--R 
+--R
+--R         4     3 3     6       2     4      2
+--R   (1)  x  - 2y x  + (y  + 6y)x  - 6y x + 9y
+--R                                  Type: MultivariatePolynomial([x,y],Integer)
+--E 1
+
+--S 2 of 9
+m :: MPOLY([y,x],INT)
+--R 
+--R
+--R         2 6       4     3 3     2     2     4
+--R   (2)  x y  - 6x y  - 2x y  + 9y  + 6x y + x
+--R                                  Type: MultivariatePolynomial([y,x],Integer)
+--E 2
+
+--S 3 of 9
+p : MPOLY([x,y],POLY INT)
+--R 
+--R                                                                   Type: Void
+--E 3
+
+--S 4 of 9
+p :: POLY INT
+--R 
+--R
+--R   (4)  p
+--R                                                     Type: Polynomial Integer
+--E 4
+
+--S 5 of 9
+% :: MPOLY([a,b],POLY INT)
+--R 
+--R
+--R   (5)  p
+--R                       Type: MultivariatePolynomial([a,b],Polynomial Integer)
+--E 5
+
+--S 6 of 9
+q : UP(x, FRAC MPOLY([y,z],INT))
+--R 
+--R                                                                   Type: Void
+--E 6
+
+--S 7 of 9
+q := (x^2 - x*(z+1)/y +2)^2 
+--R 
+--R
+--R                             2    2
+--R         4   - 2z - 2  3   4y  + z  + 2z + 1  2   - 4z - 4
+--R   (7)  x  + -------- x  + ----------------- x  + -------- x + 4
+--R                 y                  2                 y
+--R                                   y
+--R Type: UnivariatePolynomial(x,Fraction MultivariatePolynomial([y,z],Integer))
+--E 7
+
+--S 8 of 9
+q :: UP(z, FRAC MPOLY([x,y],INT))
+--R 
+--R
+--R   (8)
+--R    2            3     2             2 4       3      2      2            2
+--R   x   2   - 2y x  + 2x  - 4y x     y x  - 2y x  + (4y  + 1)x  - 4y x + 4y
+--R   -- z  + -------------------- z + ---------------------------------------
+--R    2                2                                  2
+--R   y                y                                  y
+--R Type: UnivariatePolynomial(z,Fraction MultivariatePolynomial([x,y],Integer))
+--E 8
+
+--S 9 of 9
+q :: MPOLY([x,z], FRAC UP(y,INT))
+--R 
+--R
+--R                                               2
+--R         4      2     2  3     1  2    2     4y  + 1  2      4     4
+--R   (9)  x  + (- - z - -)x  + (-- z  + -- z + -------)x  + (- - z - -)x + 4
+--R                y     y        2       2         2           y     y
+--R                              y       y         y
+--R Type: MultivariatePolynomial([x,z],Fraction UnivariatePolynomial(y,Integer))
+--E 9
+)spool
+)lisp (bye)
+@
+<<MultivariatePolynomial.help>>=
+====================================================================
+MultivariatePolynomial examples
+====================================================================
+
+The domain constructor MultivariatePolynomial is similar to Polynomial
+except that it specifies the variables to be used.  Polynomial are
+available for MultivariatePolynomial.  The abbreviation for
+MultivariatePolynomial is MPOLY.  The type expressions
+
+  MultivariatePolynomial([x,y],Integer)
+  MPOLY([x,y],INT) 
+
+refer to the domain of multivariate polynomials in the variables x and
+y where the coefficients are restricted to be integers.  The first
+variable specified is the main variable and the display of the polynomial
+reflects this.
+
+This polynomial appears with terms in descending powers of the variable x.
+
+  m : MPOLY([x,y],INT) := (x^2 - x*y^3 +3*y)^2
+     4     3 3     6       2     4      2
+    x  - 2y x  + (y  + 6y)x  - 6y x + 9y
+                     Type: MultivariatePolynomial([x,y],Integer)
+
+It is easy to see a different variable ordering by doing a conversion.
+
+  m :: MPOLY([y,x],INT)
+     2 6       4     3 3     2     2     4
+    x y  - 6x y  - 2x y  + 9y  + 6x y + x
+                     Type: MultivariatePolynomial([y,x],Integer)
+
+You can use other, unspecified variables, by using Polynomial in the
+coefficient type of MPOLY.
+
+  p : MPOLY([x,y],POLY INT)
+                     Type: Void
+
+Conversions can be used to re-express such polynomials in terms of
+the other variables.  For example, you can first push all the
+variables into a polynomial with integer coefficients.
+
+  p :: POLY INT
+    p
+                     Type: Polynomial Integer
+
+Now pull out the variables of interest.
+
+  % :: MPOLY([a,b],POLY INT)
+    p
+                     Type: MultivariatePolynomial([a,b],Polynomial Integer)
+
+Restriction:
+  Axiom does not allow you to create types where MultivariatePolynomial
+  is contained in the coefficient type of Polynomial. Therefore,
+  MPOLY([x,y],POLY INT) is legal but POLY MPOLY([x,y],INT) is not.
+
+Multivariate polynomials may be combined with univariate polynomials
+to create types with special structures.
+
+  q : UP(x, FRAC MPOLY([y,z],INT))
+                          Type: Void
+
+This is a polynomial in x whose coefficients are quotients of polynomials 
+in y and z.
+
+  q := (x^2 - x*(z+1)/y +2)^2 
+                             2    2
+         4   - 2z - 2  3   4y  + z  + 2z + 1  2   - 4z - 4
+   (7)  x  + -------- x  + ----------------- x  + -------- x + 4
+                 y                  2                 y
+                                   y
+ Type: UnivariatePolynomial(x,Fraction MultivariatePolynomial([y,z],Integer))
+
+Use conversions for structural rearrangements. z does not appear in a
+denominator and so it can be made the main variable.
+
+  q :: UP(z, FRAC MPOLY([x,y],INT))
+    2            3     2             2 4       3      2      2            2
+   x   2   - 2y x  + 2x  - 4y x     y x  - 2y x  + (4y  + 1)x  - 4y x + 4y
+   -- z  + -------------------- z + ---------------------------------------
+    2                2                                  2
+   y                y                                  y
+ Type: UnivariatePolynomial(z,Fraction MultivariatePolynomial([x,y],Integer))
+
+Or you can make a multivariate polynomial in x and z whose
+coefficients are fractions in polynomials in y.
+
+  q :: MPOLY([x,z], FRAC UP(y,INT))
+     4      2     2  3     1  2    2     4y  + 1  2      4     4
+    x  + (- - z - -)x  + (-- z  + -- z + -------)x  + (- - z - -)x + 4
+            y     y        2       2         2           y     y
+                          y       y         y
+ Type: MultivariatePolynomial([x,z],Fraction UnivariatePolynomial(y,Integer))
+
+A conversion like q :: MPOLY([x,y], FRAC UP(z,INT)) is not possible in
+this example because y appears in the denominator of a fraction.  As
+you can see, Axiom provides extraordinary flexibility in the
+manipulation and display of expressions via its conversion facility.
+
+See Also:
+o )help DistributedMultivariatePolynomial
+o )help UnivariatePolynomial
+o )help Polynomial
+o )show MultivariatePolynomial
+o $AXIOM/doc/src/algebra/multpoly.spad.dvi
+
+@
+\pagehead{MultivariatePolynomial}{MPOLY}
+\pagepic{ps/v103multivariatepolynomial.ps}{MPOLY}{1.00}
+See also:\\
+\refto{Polynomial}{POLY}
+\refto{SparseMultivariatePolynomial}{SMP}
+\refto{IndexedExponents}{INDE}
+<<domain MPOLY MultivariatePolynomial>>=
+)abbrev domain MPOLY MultivariatePolynomial
+++ Author: Dave Barton, Barry Trager
+++ Date Created:
+++ Date Last Updated:
+++ Basic Functions: Ring, degree, eval, coefficient, monomial, differentiate,
+++ resultant, gcd
+++ Related Constructors: SparseMultivariatePolynomial, Polynomial
+++ Also See:
+++ AMS Classifications:
+++ Keywords: polynomial, multivariate
+++ References:
+++ Description:
+++   This type is the basic representation of sparse recursive multivariate
+++ polynomials whose variables are from a user specified list of symbols.
+++ The ordering is specified by the position of the variable in the list.
+++ The coefficient ring may be non commutative,
+++ but the variables are assumed to commute.
+
+MultivariatePolynomial(vl:List Symbol, R:Ring)
+   ==  SparseMultivariatePolynomial(--SparseUnivariatePolynomial,
+           R, OrderedVariableList vl)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Chapter N}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain NONE None}
@@ -38318,6 +41398,846 @@ PlaneAlgebraicCurvePlot(): PlottablePlaneCurveCategory _
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain POLY Polynomial}
+<<Polynomial.input>>=
+-- multpoly.spad.pamphlet Polynomial.input
+)spool Polynomial.output
+)set message test on
+)set message auto off
+--S 1 of 46
+x + 1
+--R 
+--R
+--R   (1)  x + 1
+--R                                                     Type: Polynomial Integer
+--E 1
+
+--S 2 of 46
+z - 2.3
+--R 
+--R
+--R   (2)  z - 2.3
+--R                                                       Type: Polynomial Float
+--E 2
+
+--S 3 of 46
+y**2 - z + 3/4
+--R 
+--R
+--R               2   3
+--R   (3)  - z + y  + -
+--R                   4
+--R                                            Type: Polynomial Fraction Integer
+--E 3
+
+--S 4 of 46
+y **2 + x*y + y
+--R 
+--R
+--R         2
+--R   (4)  y  + (x + 1)y
+--R                                                     Type: Polynomial Integer
+--E 4
+
+--S 5 of 46
+% :: DMP([y,x],INT)
+--R 
+--R
+--R         2
+--R   (5)  y  + y x + y
+--R                       Type: DistributedMultivariatePolynomial([y,x],Integer)
+--E 5
+
+--S 6 of 46
+p := (y-1)**2 * x * z
+--R 
+--R
+--R            2
+--R   (6)  (x y  - 2x y + x)z
+--R                                                     Type: Polynomial Integer
+--E 6
+
+--S 7 of 46
+q := (y-1) * x * (z+5)
+--R 
+--R
+--R   (7)  (x y - x)z + 5x y - 5x
+--R                                                     Type: Polynomial Integer
+--E 7
+
+--S 8 of 46
+factor(q)
+--R 
+--R
+--R   (8)  x(y - 1)(z + 5)
+--R                                            Type: Factored Polynomial Integer
+--E 8
+
+--S 9 of 46
+p - q**2
+--R 
+--R
+--R   (9)
+--R         2 2     2     2  2          2      2       2             2
+--R     (- x y  + 2x y - x )z  + ((- 10x  + x)y  + (20x  - 2x)y - 10x  + x)z
+--R   + 
+--R          2 2      2       2
+--R     - 25x y  + 50x y - 25x
+--R                                                     Type: Polynomial Integer
+--E 9
+
+--S 10 of 46
+gcd(p,q)
+--R 
+--R
+--R   (10)  x y - x
+--R                                                     Type: Polynomial Integer
+--E 10
+
+--S 11 of 46
+factor %
+--R 
+--R
+--R   (11)  x(y - 1)
+--R                                            Type: Factored Polynomial Integer
+--E 11
+
+--S 12 of 46
+lcm(p,q)
+--R 
+--R
+--R             2             2        2
+--R   (12)  (x y  - 2x y + x)z  + (5x y  - 10x y + 5x)z
+--R                                                     Type: Polynomial Integer
+--E 12
+
+--S 13 of 46
+content p
+--R 
+--R
+--R   (13)  1
+--R                                                        Type: PositiveInteger
+--E 13
+
+--S 14 of 46
+resultant(p,q,z)
+--R 
+--R
+--R           2 3      2 2      2      2
+--R   (14)  5x y  - 15x y  + 15x y - 5x
+--R                                                     Type: Polynomial Integer
+--E 14
+
+--S 15 of 46
+resultant(p,q,x)
+--R 
+--R
+--R   (15)  0
+--R                                                     Type: Polynomial Integer
+--E 15
+
+--S 16 of 46
+mainVariable p
+--R 
+--R
+--R   (16)  z
+--R                                                      Type: Union(Symbol,...)
+--E 16
+
+--S 17 of 46
+mainVariable(1 :: POLY INT)
+--R 
+--R
+--R   (17)  "failed"
+--R                                                    Type: Union("failed",...)
+--E 17
+
+--S 18 of 46
+ground? p
+--R 
+--R
+--R   (18)  false
+--R                                                                Type: Boolean
+--E 18
+
+--S 19 of 46
+ground?(1 :: POLY INT)
+--R 
+--R
+--R   (19)  true
+--R                                                                Type: Boolean
+--E 19
+
+--S 20 of 46
+variables p
+--R 
+--R
+--R   (20)  [z,y,x]
+--R                                                            Type: List Symbol
+--E 20
+
+--S 21 of 46
+degree(p,x)
+--R 
+--R
+--R   (21)  1
+--R                                                        Type: PositiveInteger
+--E 21
+
+--S 22 of 46
+degree(p,y)
+--R 
+--R
+--R   (22)  2
+--R                                                        Type: PositiveInteger
+--E 22
+
+--S 23 of 46
+degree(p,z)
+--R 
+--R
+--R   (23)  1
+--R                                                        Type: PositiveInteger
+--E 23
+
+--S 24 of 46
+degree(p,[x,y,z])
+--R 
+--R
+--R   (24)  [1,2,1]
+--R                                                Type: List NonNegativeInteger
+--E 24
+
+--S 25 of 46
+minimumDegree(p,z)
+--R 
+--R
+--R   (25)  1
+--R                                                        Type: PositiveInteger
+--E 25
+
+--S 26 of 46
+totalDegree p
+--R 
+--R
+--R   (26)  4
+--R                                                        Type: PositiveInteger
+--E 26
+
+--S 27 of 46
+leadingMonomial p
+--R 
+--R
+--R            2
+--R   (27)  x y z
+--R                                                     Type: Polynomial Integer
+--E 27
+
+--S 28 of 46
+reductum p
+--R 
+--R
+--R   (28)  (- 2x y + x)z
+--R                                                     Type: Polynomial Integer
+--E 28
+
+--S 29 of 46
+p - leadingMonomial p - reductum p
+--R 
+--R
+--R   (29)  0
+--R                                                     Type: Polynomial Integer
+--E 29
+
+--S 30 of 46
+leadingCoefficient p
+--R 
+--R
+--R   (30)  1
+--R                                                        Type: PositiveInteger
+--E 30
+
+--S 31 of 46
+p
+--R 
+--R
+--R             2
+--R   (31)  (x y  - 2x y + x)z
+--R                                                     Type: Polynomial Integer
+--E 31
+
+--S 32 of 46
+eval(p,x,w)
+--R 
+--R
+--R             2
+--R   (32)  (w y  - 2w y + w)z
+--R                                                     Type: Polynomial Integer
+--E 32
+
+--S 33 of 46
+eval(p,x,1)
+--R 
+--R
+--R           2
+--R   (33)  (y  - 2y + 1)z
+--R                                                     Type: Polynomial Integer
+--E 33
+
+--S 34 of 46
+eval(p,x,y^2 - 1)
+--R 
+--R
+--R           4     3
+--R   (34)  (y  - 2y  + 2y - 1)z
+--R                                                     Type: Polynomial Integer
+--E 34
+
+--S 35 of 46
+D(p,x)
+--R 
+--R
+--R           2
+--R   (35)  (y  - 2y + 1)z
+--R                                                     Type: Polynomial Integer
+--E 35
+
+--S 36 of 46
+D(p,y)
+--R 
+--R
+--R   (36)  (2x y - 2x)z
+--R                                                     Type: Polynomial Integer
+--E 36
+
+--S 37 of 46
+D(p,z)
+--R 
+--R
+--R            2
+--R   (37)  x y  - 2x y + x
+--R                                                     Type: Polynomial Integer
+--E 37
+
+--S 38 of 46
+integrate(p,y)
+--R 
+--R
+--R          1    3      2
+--R   (38)  (- x y  - x y  + x y)z
+--R          3
+--R                                            Type: Polynomial Fraction Integer
+--E 38
+
+--S 39 of 46
+qr := monicDivide(p,x+1,x)
+--R 
+--R
+--R                      2                           2
+--R   (39)  [quotient= (y  - 2y + 1)z,remainder= (- y  + 2y - 1)z]
+--R     Type: Record(quotient: Polynomial Integer,remainder: Polynomial Integer)
+--E 39
+
+--S 40 of 46
+qr.remainder
+--R 
+--R
+--R             2
+--R   (40)  (- y  + 2y - 1)z
+--R                                                     Type: Polynomial Integer
+--E 40
+
+--S 41 of 46
+p - ((x+1) * qr.quotient + qr.remainder)
+--R 
+--R
+--R   (41)  0
+--R                                                     Type: Polynomial Integer
+--E 41
+
+--S 42 of 46
+p/q
+--R 
+--R
+--R         (y - 1)z
+--R   (42)  --------
+--R           z + 5
+--R                                            Type: Fraction Polynomial Integer
+--E 42
+
+--S 43 of 46
+(2/3) * x**2 - y + 4/5 
+--R 
+--R
+--R               2  2   4
+--R   (43)  - y + - x  + -
+--R               3      5
+--R                                            Type: Polynomial Fraction Integer
+--E 43
+
+--S 44 of 46
+% :: FRAC POLY INT
+--R 
+--R
+--R                    2
+--R         - 15y + 10x  + 12
+--R   (44)  -----------------
+--R                 15
+--R                                            Type: Fraction Polynomial Integer
+--E 44
+
+--S 45 of 46
+% :: POLY FRAC INT
+--R 
+--R
+--R               2  2   4
+--R   (45)  - y + - x  + -
+--R               3      5
+--R                                            Type: Polynomial Fraction Integer
+--E 45
+
+--S 46 of 46
+map(numeric,%)
+--R 
+--R
+--R                                            2
+--R   (46)  - 1.0 y + 0.6666666666 6666666667 x  + 0.8
+--R                                                       Type: Polynomial Float
+--E 46
+)spool
+)lisp (bye)
+@
+<<Polynomial.help>>=
+====================================================================
+Polynomial examples
+====================================================================
+
+The domain constructor Polynomial (abbreviation: POLY) provides
+polynomials with an arbitrary number of unspecified variables.
+
+It is used to create the default polynomial domains in Axiom.  Here
+the coefficients are integers.
+
+  x + 1
+    x + 1
+                          Type: Polynomial Integer
+
+Here the coefficients have type Float.
+
+  z - 2.3
+    z - 2.3
+                           Type: Polynomial Float
+
+And here we have a polynomial in two variables with coefficients which
+have type Fraction Integer.
+
+  y**2 - z + 3/4
+           2   3
+    - z + y  + -
+               4
+                           Type: Polynomial Fraction Integer
+
+The representation of objects of domains created by Polynomial is that
+of recursive univariate polynomials. The term univariate means "one
+variable". The term multivariate means "possibly more than one variable".
+
+This recursive structure is sometimes obvious from the display of a polynomial.
+
+  y **2 + x*y + y
+     2
+    y  + (x + 1)y
+                           Type: Polynomial Integer
+
+In this example, you see that the polynomial is stored as a polynomial
+in y with coefficients that are polynomials in x with integer coefficients.  
+In fact, you really don't need to worry about the representation unless you 
+are working on an advanced application where it is critical. The polynomial 
+types created from DistributedMultivariatePolynomial and
+NewDistributedMultivariatePolynomial are stored and displayed in a
+non-recursive manner.
+
+You see a "flat" display of the above polynomial by converting to
+one of those types.
+
+  % :: DMP([y,x],INT)
+     2
+    y  + y x + y
+                   Type: DistributedMultivariatePolynomial([y,x],Integer)
+
+We will demonstrate many of the polynomial facilities by using two
+polynomials with integer coefficients.
+
+By default, the interpreter expands polynomial expressions, even if they
+are written in a factored format.
+
+  p := (y-1)**2 * x * z
+        2
+    (x y  - 2x y + x)z
+                   Type: Polynomial Integer
+
+See Factored to see how to create objects in factored form directly.
+
+  q := (y-1) * x * (z+5)
+    (x y - x)z + 5x y - 5x
+                   Type: Polynomial Integer
+
+The fully factored form can be recovered by using factor.
+
+  factor(q)
+    x(y - 1)(z + 5)
+                   Type: Factored Polynomial Integer
+
+This is the same name used for the operation to factor integers.  Such
+reuse of names is called overloading and makes it much easier to think
+of solving problems in general ways.  Axiom facilities for factoring
+polynomials created with Polynomial are currently restricted to the
+integer and rational number coefficient cases.
+
+The standard arithmetic operations are available for polynomials.
+
+  p - q**2
+         2 2     2     2  2          2      2       2             2
+     (- x y  + 2x y - x )z  + ((- 10x  + x)y  + (20x  - 2x)y - 10x  + x)z
+   + 
+          2 2      2       2
+     - 25x y  + 50x y - 25x
+                   Type: Polynomial Integer
+
+The operation gcd is used to compute the greatest common divisor of
+two polynomials.
+
+  gcd(p,q)
+    x y - x
+                   Type: Polynomial Integer
+
+In the case of p and q, the gcd is obvious from their definitions.  We
+factor the gcd to show this relationship better.
+
+  factor %
+    x(y - 1)
+                   Type: Factored Polynomial Integer
+
+The least common multiple is computed by using lcm.
+
+  lcm(p,q)
+        2             2        2
+    (x y  - 2x y + x)z  + (5x y  - 10x y + 5x)z
+                   Type: Polynomial Integer
+
+Use content to compute the greatest common divisor of the coefficients
+of the polynomial.
+
+  content p
+    1
+                   Type: PositiveInteger
+
+Many of the operations on polynomials require you to specify a variable.  
+For example, resultant requires you to give the variable in which the 
+polynomials should be expressed.
+
+This computes the resultant of the values of p and q, considering them 
+as polynomials in the variable z.  They do not share a root when thought 
+of as polynomials in z.
+
+  resultant(p,q,z)
+       2 3      2 2      2      2
+     5x y  - 15x y  + 15x y - 5x
+                   Type: Polynomial Integer
+
+This value is 0 because as polynomials in x the polynomials have a
+common root.
+
+  resultant(p,q,x)
+    0
+                   Type: Polynomial Integer
+
+The data type used for the variables created by Polynomial is Symbol.
+As mentioned above, the representation used by Polynomial is recursive
+and so there is a main variable for nonconstant polynomials.
+
+The operation mainVariable returns this variable.  The return type is 
+actually a union of Symbol and "failed".
+
+  mainVariable p
+    z
+                   Type: Union(Symbol,...)
+
+The latter branch of the union is be used if the polynomial has no
+variables, that is, is a constant.
+
+  mainVariable(1 :: POLY INT)
+    "failed"
+                   Type: Union("failed",...)
+
+You can also use the predicate ground? to test whether a polynomial is
+in fact a member of its ground ring.
+
+  ground? p
+    false
+                   Type: Boolean
+
+  ground?(1 :: POLY INT)
+    true
+                   Type: Boolean
+
+The complete list of variables actually used in a particular polynomial 
+is returned by variables.  For constant polynomials, this list is empty.
+
+  variables p
+    [z,y,x]
+                   Type: List Symbol
+
+The degree operation returns the degree of a polynomial in a specific variable.
+
+  degree(p,x)
+    1
+                   Type: PositiveInteger
+
+  degree(p,y)
+    2
+                   Type: PositiveInteger
+
+  degree(p,z)
+    1
+                   Type: PositiveInteger
+
+If you give a list of variables for the second argument, a list of the
+degrees in those variables is returned.
+
+  degree(p,[x,y,z])
+    [1,2,1]
+                   Type: List NonNegativeInteger
+
+The minimum degree of a variable in a polynomial is computed using 
+minimumDegree.
+
+  minimumDegree(p,z)
+    1
+                   Type: PositiveInteger
+
+The total degree of a polynomial is returned by totalDegree.
+
+  totalDegree p
+    4
+                   Type: PositiveInteger
+
+It is often convenient to think of a polynomial as a leading monomial plus
+the remaining terms.
+
+  leadingMonomial p
+        2
+     x y z
+                   Type: Polynomial Integer
+
+The reductum operation returns a polynomial consisting of the sum of
+the monomials after the first.
+
+  reductum p
+    (- 2x y + x)z
+                   Type: Polynomial Integer
+
+These have the obvious relationship that the original polynomial is
+equal to the leading monomial plus the reductum.
+
+  p - leadingMonomial p - reductum p
+    0
+                   Type: Polynomial Integer
+
+The value returned by leadingMonomial includes the coefficient of that term.  
+This is extracted by using leadingCoefficient on the original polynomial.
+
+  leadingCoefficient p
+    1
+                   Type: PositiveInteger
+
+The operation eval is used to substitute a value for a variable in a 
+polynomial.
+
+  p
+        2
+    (x y  - 2x y + x)z
+                   Type: Polynomial Integer
+
+This value may be another variable, a constant or a polynomial.
+
+  eval(p,x,w)
+        2
+    (w y  - 2w y + w)z
+                   Type: Polynomial Integer
+
+  eval(p,x,1)
+      2
+    (y  - 2y + 1)z
+                   Type: Polynomial Integer
+
+Actually, all the things being substituted are just polynomials,
+some more trivial than others.
+
+  eval(p,x,y^2 - 1)
+      4     3
+    (y  - 2y  + 2y - 1)z
+                   Type: Polynomial Integer
+
+Derivatives are computed using the D operation.
+
+  D(p,x)
+      2
+    (y  - 2y + 1)z
+                   Type: Polynomial Integer
+
+The first argument is the polynomial and the second is the variable.
+
+  D(p,y)
+    (2x y - 2x)z
+                   Type: Polynomial Integer
+
+Even if the polynomial has only one variable, you must specify it.
+
+  D(p,z)
+       2
+    x y  - 2x y + x
+                   Type: Polynomial Integer
+
+Integration of polynomials is similar and the integrate operation is used.
+
+Integration requires that the coefficients support division. Axiom
+converts polynomials over the integers to polynomials over the rational 
+numbers before integrating them.
+
+  integrate(p,y)
+     1    3      2
+    (- x y  - x y  + x y)z
+     3
+                  Type: Polynomial Fraction Integer
+
+It is not possible, in general, to divide two polynomials.  In our
+example using polynomials over the integers, the operation monicDivide
+divides a polynomial by a monic polynomial (that is, a polynomial with
+leading coefficient equal to 1).  The result is a record of the
+quotient and remainder of the division.
+
+You must specify the variable in which to express the polynomial.
+
+  qr := monicDivide(p,x+1,x)
+                 2                           2
+    [quotient= (y  - 2y + 1)z,remainder= (- y  + 2y - 1)z]
+     Type: Record(quotient: Polynomial Integer,remainder: Polynomial Integer)
+
+The selectors of the components of the record are quotient and remainder.  
+Issue this to extract the remainder.
+
+  qr.remainder
+        2
+    (- y  + 2y - 1)z
+                       Type: Polynomial Integer
+
+Now that we can extract the components, we can demonstrate the
+relationship among them and the arguments to our original expression
+qr := monicDivide(p,x+1,x).
+
+  p - ((x+1) * qr.quotient + qr.remainder)
+    0
+                       Type: Polynomial Integer
+
+If the / operator is used with polynomials, a fraction object is
+created.  In this example, the result is an object of type 
+Fraction Polynomial Integer.
+
+  p/q
+    (y - 1)z
+    --------
+      z + 5
+                       Type: Fraction Polynomial Integer
+
+If you use rational numbers as polynomial coefficients, the
+resulting object is of type Polynomial Fraction Integer.
+
+  (2/3) * x**2 - y + 4/5 
+          2  2   4
+    - y + - x  + -
+          3      5
+                       Type: Polynomial Fraction Integer
+
+This can be converted to a fraction of polynomials and back again, if
+required.
+
+  % :: FRAC POLY INT
+               2
+    - 15y + 10x  + 12
+    -----------------
+            15
+                       Type: Fraction Polynomial Integer
+
+  % :: POLY FRAC INT
+          2  2   4
+    - y + - x  + -
+          3      5
+                       Type: Polynomial Fraction Integer
+
+To convert the coefficients to floating point, map the numeric
+operation on the coefficients of the polynomial.
+
+  map(numeric,%)
+    - 1.0 y + 0.6666666666 6666666667 x  + 0.8
+                       Type: Polynomial Float
+
+See Also:
+o )help Factored
+o )help UnivariatePolynomial
+o )help MultivariatePolynomial
+o )help DistributedMultivariatePolynomial
+o )help NewDistributedMultivariatePolynomial
+o )show Polynomial
+o $AXIOM/doc/src/algebra/multpoly.spad.dvi
+
+@
+\pagehead{Polynomial}{POLY}
+\pagepic{ps/v103polynomial.ps}{POLY}{1.00}
+See also:\\
+\refto{MultivariatePolynomial}{MPOLY}
+\refto{SparseMultivariatePolynomial}{SMP}
+\refto{IndexedExponents}{INDE}
+<<domain POLY Polynomial>>=
+)abbrev domain POLY Polynomial
+++ Author: Dave Barton, Barry Trager
+++ Date Created:
+++ Date Last Updated:
+++ Basic Functions: Ring, degree, eval, coefficient, monomial, differentiate,
+++ resultant, gcd
+++ Related Constructors: SparseMultivariatePolynomial, MultivariatePolynomial
+++ Also See:
+++ AMS Classifications:
+++ Keywords: polynomial, multivariate
+++ References:
+++ Description:
+++   This type is the basic representation of sparse recursive multivariate
+++ polynomials whose variables are arbitrary symbols. The ordering
+++ is alphabetic determined by the Symbol type.
+++ The coefficient ring may be non commutative,
+++ but the variables are assumed to commute.
+
+Polynomial(R:Ring):
+  PolynomialCategory(R, IndexedExponents Symbol, Symbol) with
+   if R has Algebra Fraction Integer then
+     integrate: (%, Symbol) -> %
+       ++ integrate(p,x) computes the integral of \spad{p*dx}, i.e.
+       ++ integrates the polynomial p with respect to the variable x.
+ == SparseMultivariatePolynomial(R, Symbol) add
+
+    import UserDefinedPartialOrdering(Symbol)
+
+    coerce(p:%):OutputForm ==
+      (r:= retractIfCan(p)@Union(R,"failed")) case R => r::R::OutputForm
+      a :=
+        userOrdered?() => largest variables p
+        mainVariable(p)::Symbol
+      outputForm(univariate(p, a), a::OutputForm)
+
+    if R has Algebra Fraction Integer then
+      integrate(p, x) == (integrate univariate(p, x)) (x::%)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain IDEAL PolynomialIdeals}
 \pagehead{PolynomialIdeals}{IDEAL}
 \pagepic{ps/v103polynomialideals.ps}{IDEAL}{1.00}
@@ -39169,6 +43089,103 @@ RadicalFunctionField(F, UP, UPUP, radicnd, n): Exports == Impl where
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain RMATRIX RectangularMatrix}
+\pagehead{RectangularMatrix}{RMATRIX}
+\pagepic{ps/v103rectangularmatrix.ps}{RMATRIX}{1.00}
+See also:\\
+\refto{IndexedMatrix}{IMATRIX}
+\refto{Matrix}{MATRIX}
+\refto{SquareMatrix}{SQMATRIX}
+<<domain RMATRIX RectangularMatrix>>=
+)abbrev domain RMATRIX RectangularMatrix
+++ Author: Grabmeier, Gschnitzer, Williamson
+++ Date Created: 1987
+++ Date Last Updated: July 1990
+++ Basic Operations:
+++ Related Domains: IndexedMatrix, Matrix, SquareMatrix
+++ Also See:
+++ AMS Classifications:
+++ Keywords: matrix, linear algebra
+++ Examples:
+++ References:
+++ Description:
+++   \spadtype{RectangularMatrix} is a matrix domain where the number of rows
+++   and the number of columns are parameters of the domain.
+RectangularMatrix(m,n,R): Exports == Implementation where
+  m,n : NonNegativeInteger
+  R   : Ring
+  Row ==> DirectProduct(n,R)
+  Col ==> DirectProduct(m,R)
+  Exports ==> Join(RectangularMatrixCategory(m,n,R,Row,Col),_
+                   CoercibleTo Matrix R) with
+ 
+    if R has Field then VectorSpace R
+ 
+    if R has ConvertibleTo InputForm then ConvertibleTo InputForm
+
+    rectangularMatrix: Matrix R -> $
+      ++ \spad{rectangularMatrix(m)} converts a matrix of type \spadtype{Matrix}
+      ++ to a matrix of type \spad{RectangularMatrix}.
+    coerce: $ -> Matrix R
+      ++ \spad{coerce(m)} converts a matrix of type \spadtype{RectangularMatrix}
+      ++ to a matrix of type \spad{Matrix}.
+ 
+  Implementation ==> Matrix R add
+    minr ==> minRowIndex
+    maxr ==> maxRowIndex
+    minc ==> minColIndex
+    maxc ==> maxColIndex
+    mini ==> minIndex
+    maxi ==> maxIndex
+ 
+    ZERO := new(m,n,0)$Matrix(R) pretend $
+    0    == ZERO
+ 
+    coerce(x:$):OutputForm == coerce(x pretend Matrix R)$Matrix(R)
+
+    matrix(l: List List R) ==
+      -- error check: this is a top level function
+      #l ^= m => error "matrix: wrong number of rows"
+      for ll in l repeat
+        #ll ^= n => error "matrix: wrong number of columns"
+      ans : Matrix R := new(m,n,0)
+      for i in minr(ans)..maxr(ans) for ll in l repeat
+        for j in minc(ans)..maxc(ans) for r in ll repeat
+          qsetelt_!(ans,i,j,r)
+      ans pretend $
+ 
+    row(x,i)    == directProduct row(x pretend Matrix(R),i)
+    column(x,j) == directProduct column(x pretend Matrix(R),j)
+ 
+    coerce(x:$):Matrix(R) == copy(x pretend Matrix(R))
+ 
+    rectangularMatrix x ==
+      (nrows(x) ^= m) or (ncols(x) ^= n) =>
+        error "rectangularMatrix: matrix of bad dimensions"
+      copy(x) pretend $
+ 
+    if R has EuclideanDomain then
+ 
+      rowEchelon x == rowEchelon(x pretend Matrix(R)) pretend $
+ 
+    if R has IntegralDomain then
+ 
+      rank x    == rank(x pretend Matrix(R))
+      nullity x == nullity(x pretend Matrix(R))
+      nullSpace x ==
+        [directProduct c for c in nullSpace(x pretend Matrix(R))]
+ 
+    if R has Field then
+ 
+      dimension() == (m * n) :: CardinalNumber
+ 
+    if R has ConvertibleTo InputForm then
+      convert(x:$):InputForm ==
+         convert [convert("rectangularMatrix"::Symbol)@InputForm,
+                  convert(x::Matrix(R))]$List(InputForm)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain REF Reference}
 <<dot>>=
 "REF" -> "TYPE"
@@ -40584,6 +44601,878 @@ SimpleFortranProgram(R,FS): Exports == Implementation where
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain SAOS SingletonAsOrderedSet}
+<<dot>>=
+"SAOS" -> "ORDSET"
+"SingletonAsOrderedSet()" -> "OrderedSet()"
+@
+\pagehead{SingletonAsOrderedSet}{SAOS}
+\pagepic{ps/v103singletonasorderedset.ps}{SAOS}{1.00}
+<<domain SAOS SingletonAsOrderedSet>>=
+)abbrev domain SAOS SingletonAsOrderedSet
+++ This trivial domain lets us build Univariate Polynomials
+++  in an anonymous variable
+SingletonAsOrderedSet(): OrderedSet with
+              create:() -> %
+              convert:% -> Symbol
+  ==  add
+   create() == "?" pretend %
+   a<b == false -- only one element
+   coerce(a) == outputForm "?"  -- CJW doesn't like this: change ?
+   a=b == true  -- only one element
+   min(a,b) == a  -- only one element
+   max(a,b) == a  -- only one element
+   convert a == coerce("?")
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain SMP SparseMultivariatePolynomial}
+\pagehead{SparseMultivariatePolynomial}{SMP}
+\pagepic{ps/v103sparsemultivariatepolynomial.ps}{SMP}{1.00}
+See also:\\
+\refto{Polynomial}{POLY}
+\refto{MultivariatePolynomial}{MPOLY}
+\refto{IndexedExponents}{INDE}
+<<domain SMP SparseMultivariatePolynomial>>=
+)abbrev domain SMP SparseMultivariatePolynomial
+++ Author: Dave Barton, Barry Trager
+++ Date Created:
+++ Date Last Updated: 30 November 1994
+++ Fix History:
+++ 30 Nov 94: added gcdPolynomial for float-type coefficients
+++ Basic Functions: Ring, degree, eval, coefficient, monomial, differentiate,
+++ resultant, gcd
+++ Related Constructors: Polynomial, MultivariatePolynomial
+++ Also See:
+++ AMS Classifications:
+++ Keywords: polynomial, multivariate
+++ References:
+++ Description:
+++   This type is the basic representation of sparse recursive multivariate
+++ polynomials. It is parameterized by the coefficient ring and the
+++ variable set which may be infinite. The variable ordering is determined
+++ by the variable set parameter. The coefficient ring may be non-commutative,
+++ but the variables are assumed to commute.
+
+SparseMultivariatePolynomial(R: Ring,VarSet: OrderedSet): C == T where
+  pgcd ==> PolynomialGcdPackage(IndexedExponents VarSet,VarSet,R,%)
+  C == PolynomialCategory(R,IndexedExponents(VarSet),VarSet)
+  SUP ==> SparseUnivariatePolynomial
+  T == add
+    --constants
+    --D := F(%) replaced by next line until compiler support completed
+
+    --representations
+      D := SparseUnivariatePolynomial(%)
+      VPoly:=  Record(v:VarSet,ts:D)
+      Rep:=  Union(R,VPoly)
+
+    --local function
+
+
+    --declarations
+      fn: R -> R
+      n: Integer
+      k: NonNegativeInteger
+      kp:PositiveInteger
+      k1:NonNegativeInteger
+      c: R
+      mvar: VarSet
+      val : R
+      var:VarSet
+      up: D
+      p,p1,p2,pval: %
+      Lval : List(R)
+      Lpval : List(%)
+      Lvar : List(VarSet)
+
+    --define
+      0  == 0$R::%
+      1  == 1$R::%
+
+
+      zero? p == p case R and zero?(p)$R
+--      one? p == p case R and one?(p)$R
+      one? p == p case R and ((p) = 1)$R
+    -- a local function
+      red(p:%):% ==
+         p case R => 0
+         if ground?(reductum p.ts) then leadingCoefficient(reductum p.ts) else [p.v,reductum p.ts]$VPoly
+
+      numberOfMonomials(p): NonNegativeInteger ==
+        p case R => 
+          zero?(p)$R => 0
+          1
+        +/[numberOfMonomials q for q in coefficients(p.ts)]
+
+      coerce(mvar):% == [mvar,monomial(1,1)$D]$VPoly
+
+      monomial? p ==
+        p case R => true
+        sup : D := p.ts
+        1 ^= numberOfMonomials(sup) => false
+        monomial? leadingCoefficient(sup)$D
+
+--    local
+      moreThanOneVariable?: % -> Boolean
+
+      moreThanOneVariable? p == 
+         p case R => false
+         q:=p.ts
+         any?(not ground? #1 ,coefficients q) => true
+         false
+
+      -- if we already know we use this (slighlty) faster function
+      univariateKnown: % -> SparseUnivariatePolynomial R 
+
+      univariateKnown p == 
+        p case R => (leadingCoefficient p) :: SparseUnivariatePolynomial(R)
+	monomial( leadingCoefficient p,degree p.ts)+ univariateKnown(red p)
+
+      univariate p ==
+        p case R =>(leadingCoefficient p) :: SparseUnivariatePolynomial(R)
+        moreThanOneVariable?  p => error "not univariate"
+        monomial( leadingCoefficient p,degree p.ts)+ univariate(red p)
+
+      multivariate (u:SparseUnivariatePolynomial(R),var:VarSet) ==
+        ground? u => (leadingCoefficient u) ::%
+        [var,monomial(leadingCoefficient u,degree u)$D]$VPoly +
+           multivariate(reductum u,var)
+
+      univariate(p:%,mvar:VarSet):SparseUnivariatePolynomial(%) ==
+        p case R or mvar>p.v  => monomial(p,0)$D
+        pt:=p.ts
+        mvar=p.v => pt
+        monomial(1,p.v,degree pt)*univariate(leadingCoefficient pt,mvar)+
+          univariate(red p,mvar)
+
+--  a local functions, used in next definition
+      unlikeUnivReconstruct(u:SparseUnivariatePolynomial(%),mvar:VarSet):% ==
+        zero? (d:=degree u) => coefficient(u,0)
+        monomial(leadingCoefficient u,mvar,d)+
+            unlikeUnivReconstruct(reductum u,mvar)
+
+      multivariate(u:SparseUnivariatePolynomial(%),mvar:VarSet):% ==
+        ground? u => coefficient(u,0)
+        uu:=u
+        while not zero? uu repeat
+          cc:=leadingCoefficient uu
+          cc case R or mvar > cc.v => uu:=reductum uu
+          return unlikeUnivReconstruct(u,mvar)
+        [mvar,u]$VPoly
+
+      ground?(p:%):Boolean ==
+        p case R => true
+        false
+
+--      const p ==
+--        p case R => p
+--        error "the polynomial is not a constant"
+
+      monomial(p,mvar,k1) ==
+        zero? k1 or zero? p => p
+        p case R or mvar>p.v => [mvar,monomial(p,k1)$D]$VPoly
+        p*[mvar,monomial(1,k1)$D]$VPoly
+
+      monomial(c:R,e:IndexedExponents(VarSet)):% ==
+        zero? e => (c::%)
+        monomial(1,leadingSupport e, leadingCoefficient e) *
+            monomial(c,reductum e)
+
+      coefficient(p:%, e:IndexedExponents(VarSet)) : R ==
+        zero? e =>
+          p case R  => p::R
+          coefficient(coefficient(p.ts,0),e)
+        p case R => 0
+        ve := leadingSupport e
+        vp := p.v
+        ve < vp =>
+          coefficient(coefficient(p.ts,0),e)
+        ve > vp => 0
+        coefficient(coefficient(p.ts,leadingCoefficient e),reductum e)
+
+--    coerce(e:IndexedExponents(VarSet)) : % ==
+--      e = 0 => 1
+--      monomial(1,leadingSupport e, leadingCoefficient e) *
+--          (reductum e)::%
+
+--    retract(p:%):IndexedExponents(VarSet) ==
+--      q:Union(IndexedExponents(VarSet),"failed"):=retractIfCan p
+--      q :: IndexedExponents(VarSet)
+
+--    retractIfCan(p:%):Union(IndexedExponents(VarSet),"failed") ==
+--      p = 0 => degree p
+--      reductum(p)=0 and leadingCoefficient(p)=1 => degree p
+--      "failed"
+
+      coerce(n) == n::R::%
+      coerce(c) == c::%
+      characteristic == characteristic$R
+
+      recip(p) ==
+        p case R => (uu:=recip(p::R);uu case "failed" => "failed"; uu::%)
+        "failed"
+
+      - p ==
+          p case R => -$R p
+          [p.v, - p.ts]$VPoly
+      n * p  ==
+          p case R => n * p::R
+          mvar:=p.v
+          up:=n*p.ts
+          if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly
+      c * p  ==
+          c = 1 => p
+          p case R => c * p::R
+          mvar:=p.v
+          up:=c*p.ts
+          if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly
+      p1 + p2  ==
+         p1 case R and p2 case R => p1 +$R p2
+         p1 case R => [p2.v, p1::D + p2.ts]$VPoly
+	 p2 case R => [p1.v,  p1.ts + p2::D]$VPoly
+	 p1.v = p2.v => 
+              mvar:=p1.v
+              up:=p1.ts+p2.ts
+              if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly
+	 p1.v < p2.v =>
+              [p2.v, p1::D + p2.ts]$VPoly
+         [p1.v, p1.ts + p2::D]$VPoly
+
+      p1 - p2  ==
+         p1 case R and p2 case R => p1 -$R p2
+         p1 case R => [p2.v, p1::D - p2.ts]$VPoly
+         p2 case R => [p1.v,  p1.ts - p2::D]$VPoly
+         p1.v = p2.v =>
+              mvar:=p1.v
+              up:=p1.ts-p2.ts
+              if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly
+         p1.v < p2.v =>
+              [p2.v, p1::D - p2.ts]$VPoly
+         [p1.v, p1.ts - p2::D]$VPoly
+
+      p1 = p2  ==
+         p1 case R =>
+             p2 case R => p1 =$R p2
+             false
+         p2 case R => false
+         p1.v = p2.v => p1.ts = p2.ts
+         false
+
+      p1 * p2  ==
+         p1 case R => p1::R * p2
+         p2 case R => 
+            mvar:=p1.v
+            up:=p1.ts*p2
+            if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly
+	 p1.v = p2.v => 
+            mvar:=p1.v
+            up:=p1.ts*p2.ts
+            if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly
+         p1.v > p2.v => 
+            mvar:=p1.v
+            up:=p1.ts*p2
+            if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly
+            --- p1.v < p2.v 
+         mvar:=p2.v
+         up:=p1*p2.ts
+         if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly
+
+      p ^ kp == p ** (kp pretend NonNegativeInteger)
+      p ** kp == p ** (kp pretend NonNegativeInteger )
+      p ^ k == p ** k
+      p ** k  ==
+         p case R => p::R ** k
+         -- univariate special case 
+         not moreThanOneVariable? p => 
+             multivariate( (univariateKnown p) ** k , p.v)
+         mvar:=p.v
+         up:=p.ts ** k
+         if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly
+
+      if R has IntegralDomain then
+         UnitCorrAssoc ==> Record(unit:%,canonical:%,associate:%)
+         unitNormal(p) ==
+            u,c,a:R
+            p case R =>
+              (u,c,a):= unitNormal(p::R)$R
+              [u::%,c::%,a::%]$UnitCorrAssoc
+            (u,c,a):= unitNormal(leadingCoefficient(p))$R
+            [u::%,(a*p)::%,a::%]$UnitCorrAssoc
+         unitCanonical(p) ==
+            p case R => unitCanonical(p::R)$R
+            (u,c,a):= unitNormal(leadingCoefficient(p))$R
+            a*p
+         unit? p ==
+            p case R => unit?(p::R)$R
+            false
+         associates?(p1,p2) ==
+            p1 case R => p2 case R and associates?(p1,p2)$R
+            p2 case VPoly and p1.v = p2.v and associates?(p1.ts,p2.ts)
+
+         if R has approximate then
+           p1  exquo  p2  ==
+              p1 case R and p2 case R =>
+                a:= (p1::R  exquo  p2::R)
+                if a case "failed" then "failed" else a::%
+              zero? p1 => p1
+--              one? p2 => p1
+              (p2 = 1) => p1
+              p1 case R or p2 case VPoly and p1.v < p2.v => "failed"
+              p2 case R or p1.v > p2.v =>
+                 a:= (p1.ts  exquo  p2::D)
+                 a case "failed" => "failed"
+                 [p1.v,a]$VPoly::%
+              -- The next test is useful in the case that R has inexact
+              -- arithmetic (in particular when it is Interval(...)).
+              -- In the case where the test succeeds, empirical evidence
+              -- suggests that it can speed up the computation several times,
+              -- but in other cases where there are a lot of variables
+              -- and p1 and p2 differ only in the low order terms (e.g. p1=p2+1)
+              -- it slows exquo down by about 15-20%.
+              p1 = p2 => 1
+              a:= p1.ts  exquo  p2.ts
+              a case "failed" => "failed"
+              mvar:=p1.v
+              up:SUP %:=a
+              if ground? (up) then leadingCoefficient(up) else [mvar,up]$VPoly::%
+         else
+           p1  exquo  p2  ==
+              p1 case R and p2 case R =>
+                a:= (p1::R  exquo  p2::R)
+                if a case "failed" then "failed" else a::%
+              zero? p1 => p1
+--              one? p2 => p1
+              (p2 = 1) => p1
+              p1 case R or p2 case VPoly and p1.v < p2.v => "failed"
+              p2 case R or p1.v > p2.v =>
+                 a:= (p1.ts  exquo  p2::D)
+                 a case "failed" => "failed"
+                 [p1.v,a]$VPoly::%
+              a:= p1.ts  exquo  p2.ts
+              a case "failed" => "failed"
+              mvar:=p1.v
+              up:SUP %:=a
+              if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly::%
+
+      map(fn,p) ==
+         p case R => fn(p)
+         mvar:=p.v
+         up:=map(map(fn,#1),p.ts)
+         if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly
+
+      if R has Field then
+        (p : %) / (r : R) == inv(r) * p
+
+      if R has GcdDomain then
+        content(p) ==
+           p case R => p
+           c :R :=0
+           up:=p.ts
+--           while not(zero? up) and not(one? c) repeat
+           while not(zero? up) and not(c = 1) repeat
+               c:=gcd(c,content leadingCoefficient(up))
+               up := reductum up
+           c
+
+      if R has EuclideanDomain and R has CharacteristicZero and not(R has FloatingPointSystem)  then
+        content(p,mvar) ==
+          p case R => p
+          gcd(coefficients univariate(p,mvar))$pgcd
+
+        gcd(p1,p2) ==  gcd(p1,p2)$pgcd
+
+        gcd(lp:List %) ==  gcd(lp)$pgcd
+
+        gcdPolynomial(a:SUP $,b:SUP $):SUP $ == gcd(a,b)$pgcd
+
+      else if R has GcdDomain then
+        content(p,mvar) ==
+          p case R => p
+          content univariate(p,mvar)
+
+        gcd(p1,p2) ==
+           p1 case R =>
+              p2 case R => gcd(p1,p2)$R::%
+              zero? p1 => p2
+              gcd(p1, content(p2.ts))
+           p2 case R =>
+              zero? p2 => p1
+              gcd(p2, content(p1.ts))
+           p1.v < p2.v => gcd(p1, content(p2.ts))
+           p1.v > p2.v => gcd(content(p1.ts), p2)
+           mvar:=p1.v
+           up:=gcd(p1.ts, p2.ts)
+           if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly
+
+        if R has FloatingPointSystem then
+           -- eventually need a better notion of gcd's over floats
+           -- this essentially computes the gcds of the monomial contents
+           gcdPolynomial(a:SUP $,b:SUP $):SUP $ ==
+	      ground? (a) =>
+                  zero? a => b
+		  gcd(leadingCoefficient a, content b)::SUP $
+	      ground?(b) =>
+                  zero? b => b
+		  gcd(leadingCoefficient b, content a)::SUP $
+	      conta := content a
+	      mona:SUP $ := monomial(conta, minimumDegree a)
+              if mona ^= 1 then
+		   a := (a exquo mona)::SUP $
+	      contb := content b
+	      monb:SUP $ := monomial(contb, minimumDegree b)
+              if monb ^= 1 then
+		   b := (b exquo monb)::SUP $
+	      mong:SUP $  := monomial(gcd(conta, contb),
+                                      min(degree mona, degree monb))
+              degree(a) >= degree b =>
+		   not((a exquo b) case "failed") =>
+			mong * b
+		   mong
+	      not((b exquo a) case "failed") => mong * a
+	      mong
+
+      coerce(p):OutputForm ==
+        p case R => (p::R)::OutputForm
+        outputForm(p.ts,p.v::OutputForm)
+
+      coefficients p ==
+        p case R => list(p :: R)$List(R)
+        "append"/[coefficients(p1)$% for p1 in coefficients(p.ts)]
+
+      retract(p:%):R ==
+        p case R => p :: R
+        error "cannot retract nonconstant polynomial"
+
+      retractIfCan(p:%):Union(R, "failed") ==
+        p case R => p::R
+        "failed"
+
+--      leadingCoefficientRecursive(p:%):% ==
+--         p case R => p
+--         leadingCoefficient p.ts
+
+      mymerge:(List VarSet,List VarSet) ->List VarSet
+      mymerge(l:List VarSet,m:List VarSet):List VarSet  ==
+         empty? l => m
+         empty? m => l
+         first l = first m => 
+            empty? rest l => 
+                 setrest!(l,rest m)
+                 l
+            empty? rest m => l 
+	    setrest!(l, mymerge(rest l, rest m))
+            l
+         first l > first m =>
+            empty? rest l => 
+                setrest!(l,m) 
+                l
+            setrest!(l, mymerge(rest l, m))
+            l
+         empty? rest m => 
+             setrest!(m,l)
+             m
+         setrest!(m,mymerge(l,rest m))
+         m
+         
+      variables p ==
+         p case R => empty()
+         lv:List VarSet:=empty()
+         q := p.ts
+         while not zero? q repeat
+           lv:=mymerge(lv,variables leadingCoefficient q)
+           q := reductum q
+         cons(p.v,lv)
+
+      mainVariable p ==
+         p case R => "failed"
+         p.v
+
+      eval(p,mvar,pval) == univariate(p,mvar)(pval)
+      eval(p,mvar,val) ==  univariate(p,mvar)(val)
+
+      evalSortedVarlist(p,Lvar,Lpval):% ==
+        p case R => p
+        empty? Lvar or empty? Lpval => p
+        mvar := Lvar.first
+        mvar > p.v => evalSortedVarlist(p,Lvar.rest,Lpval.rest)
+        pval := Lpval.first
+        pts := map(evalSortedVarlist(#1,Lvar,Lpval),p.ts)
+        mvar=p.v =>
+             pval case R => pts (pval::R)
+             pts pval
+        multivariate(pts,p.v)
+
+      eval(p,Lvar,Lpval) ==
+	empty? rest Lvar => evalSortedVarlist(p,Lvar,Lpval)
+	sorted?(#1 > #2, Lvar) => evalSortedVarlist(p,Lvar,Lpval)
+        nlvar := sort(#1 > #2,Lvar)
+        nlpval :=
+           Lvar = nlvar => Lpval
+           nlpval := [Lpval.position(mvar,Lvar) for mvar in nlvar]
+        evalSortedVarlist(p,nlvar,nlpval)
+
+      eval(p,Lvar,Lval) ==
+        eval(p,Lvar,[val::% for val in Lval]$(List %)) -- kill?
+
+      degree(p,mvar) ==
+        p case R => 0
+        mvar= p.v => degree p.ts
+        mvar > p.v => 0    -- might as well take advantage of the order
+        max(degree(leadingCoefficient p.ts,mvar),degree(red p,mvar))
+
+      degree(p,Lvar)  == [degree(p,mvar)  for mvar in Lvar]
+
+      degree p ==
+        p case R => 0
+        degree(leadingCoefficient(p.ts)) + monomial(degree(p.ts), p.v)
+
+      minimumDegree p ==
+        p case R => 0
+        md := minimumDegree p.ts
+        minimumDegree(coefficient(p.ts,md)) + monomial(md, p.v)
+
+      minimumDegree(p,mvar) ==
+        p case R => 0
+        mvar = p.v => minimumDegree p.ts
+        md:=minimumDegree(leadingCoefficient p.ts,mvar)
+        zero? (p1:=red p) => md
+        min(md,minimumDegree(p1,mvar))
+
+      minimumDegree(p,Lvar) ==
+        [minimumDegree(p,mvar) for mvar in Lvar]
+
+      totalDegree(p, Lvar) ==
+        ground? p => 0
+        null setIntersection(Lvar, variables p) => 0
+        u := univariate(p, mv := mainVariable(p)::VarSet)
+        weight:NonNegativeInteger := (member?(mv,Lvar) => 1; 0)
+        tdeg:NonNegativeInteger := 0
+        while u ^= 0 repeat
+            termdeg:NonNegativeInteger := weight*degree u +
+                           totalDegree(leadingCoefficient u, Lvar)
+            tdeg := max(tdeg, termdeg)
+            u := reductum u
+        tdeg
+
+      if R has CommutativeRing then
+        differentiate(p,mvar) ==
+          p case R => 0
+          mvar=p.v =>  
+             up:=differentiate p.ts
+             if ground? up then leadingCoefficient(up) else [mvar,up]$VPoly
+          up:=map(differentiate(#1,mvar),p.ts)
+          if ground? up then leadingCoefficient(up) else [p.v,up]$VPoly
+
+      leadingCoefficient(p) ==
+         p case R => p
+         leadingCoefficient(leadingCoefficient(p.ts))
+
+--      trailingCoef(p) ==
+--        p case R => p
+--        coef(p.ts,0) case R => coef(p.ts,0)
+--        trailingCoef(red p)
+--      TrailingCoef(p) == trailingCoef(p)
+
+      leadingMonomial p ==
+          p case R => p
+          monomial(leadingMonomial leadingCoefficient(p.ts),
+                   p.v, degree(p.ts))
+
+      reductum(p) == 
+          p case R => 0
+          p - leadingMonomial p
+
+
+--        if R is Integer then
+--           pgcd := PolynomialGcdPackage(%,VarSet)
+--           gcd(p1,p2) ==
+--               gcd(p1,p2)$pgcd
+--
+--        else if R is RationalNumber then
+--           gcd(p1,p2) ==
+--               mrat:= MRationalFactorize(VarSet,%)
+--               gcd(p1,p2)$mrat
+--
+--        else gcd(p1,p2) ==
+--           p1 case R =>
+--              p2 case R => gcd(p1,p2)$R::%
+--              p1 = 0 => p2
+--              gcd(p1, content(p2.ts))
+--           p2 case R =>
+--              p2 = 0 => p1
+--              gcd(p2, content(p1.ts))
+--           p1.v < p2.v => gcd(p1, content(p2.ts))
+--           p1.v > p2.v => gcd(content(p1.ts), p2)
+--           PSimp(p1.v, gcd(p1.ts, p2.ts))
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain SMTS SparseMultivariateTaylorSeries}
+\pagehead{SparseMultivariateTaylorSeries}{SMTS}
+\pagepic{ps/v103sparsemultivariatetaylorseries.ps}{SMTS}{1.00}
+See also:\\
+\refto{TaylorSeries}{TS}
+<<domain SMTS SparseMultivariateTaylorSeries>>=
+)abbrev domain SMTS SparseMultivariateTaylorSeries
+++ This domain provides multivariate Taylor series
+++ Authors: William Burge, Stephen Watt, Clifton Williamson
+++ Date Created: 15 August 1988
+++ Date Last Updated: 18 May 1991
+++ Basic Operations:
+++ Related Domains:
+++ Also See: UnivariateTaylorSeries
+++ AMS Classifications:
+++ Keywords: multivariate, Taylor, series
+++ Examples:
+++ References:
+++ Description:
+++   This domain provides multivariate Taylor series with variables
+++   from an arbitrary ordered set.  A Taylor series is represented
+++   by a stream of polynomials from the polynomial domain SMP.
+++   The nth element of the stream is a form of degree n.  SMTS is an
+++   internal domain.
+SparseMultivariateTaylorSeries(Coef,Var,SMP):_
+ Exports == Implementation where
+  Coef : Ring
+  Var  : OrderedSet
+  SMP  : PolynomialCategory(Coef,IndexedExponents Var,Var)
+  I   ==> Integer
+  L   ==> List
+  NNI ==> NonNegativeInteger
+  OUT ==> OutputForm
+  PS  ==> InnerTaylorSeries SMP
+  RN  ==> Fraction Integer
+  ST  ==> Stream
+  StS ==> Stream SMP
+  STT ==> StreamTaylorSeriesOperations SMP
+  STF ==> StreamTranscendentalFunctions SMP
+  ST2 ==> StreamFunctions2
+  ST3 ==> StreamFunctions3
+ 
+  Exports ==> MultivariateTaylorSeriesCategory(Coef,Var) with
+    coefficient: (%,NNI) -> SMP
+      ++ \spad{coefficient(s, n)} gives the terms of total degree n.
+    coerce: Var -> %
+      ++ \spad{coerce(var)} converts a variable to a Taylor series
+    coerce: SMP -> %
+      ++ \spad{coerce(poly)} regroups the terms by total degree and forms
+      ++ a series.
+    "*":(SMP,%)->%
+      ++\spad{smp*ts} multiplies a TaylorSeries by a monomial SMP.
+    csubst:(L Var,L StS) -> (SMP -> StS)
+      ++\spad{csubst(a,b)} is for internal use only
+ 
+    if Coef has Algebra Fraction Integer then
+      integrate: (%,Var,Coef) -> %
+        ++\spad{integrate(s,v,c)} is the integral of s with respect
+        ++ to v and having c as the constant of integration.
+      fintegrate: (() -> %,Var,Coef) -> %
+        ++\spad{fintegrate(f,v,c)} is the integral of \spad{f()} with respect
+        ++ to v and having c as the constant of integration.
+        ++ The evaluation of \spad{f()} is delayed.
+ 
+  Implementation ==> PS add
+ 
+    Rep := StS -- Below we use the fact that Rep of PS is Stream SMP.
+    extend(x,n) == extend(x,n + 1)$Rep
+    complete x == complete(x)$Rep
+
+    evalstream:(%,L Var,L SMP) -> StS
+    evalstream(s:%,lv:(L Var),lsmp:(L SMP)):(ST SMP) ==
+      scan(0,_+$SMP,map(eval(#1,lv,lsmp),s pretend StS))$ST2(SMP,SMP)
+ 
+    addvariable:(Var,InnerTaylorSeries Coef) -> %
+    addvariable(v,s) ==
+      ints := integers(0)$STT pretend ST NNI
+      map(monomial(#2 :: SMP,v,#1)$SMP,ints,s pretend ST Coef)$ST3(NNI,Coef,SMP)
+ 
+    coefficient(s,n) == elt(s,n + 1)$Rep  -- 1-based indexing for streams
+ 
+--% creation of series
+ 
+    coerce(r:Coef) == monom(r::SMP,0)$STT
+    smp:SMP * p:% == (((smp) *  (p pretend Rep))$STT)pretend %
+    r:Coef * p:% == (((r::SMP) *  (p pretend Rep))$STT)pretend %
+    p:% * r:Coef == (((r::SMP) * ( p pretend Rep))$STT)pretend %
+    mts(p:SMP):% ==
+      (uv := mainVariable p) case "failed" => monom(p,0)$STT
+      v := uv :: Var
+      s : % := 0
+      up := univariate(p,v)
+      while not zero? up repeat
+        s := s + monomial(1,v,degree up) * mts(leadingCoefficient up)
+        up := reductum up
+      s
+ 
+    coerce(p:SMP) == mts p
+    coerce(v:Var) == v :: SMP :: %
+ 
+    monomial(r:%,v:Var,n:NNI) ==
+      r * monom(monomial(1,v,n)$SMP,n)$STT
+ 
+--% evaluation
+ 
+    substvar: (SMP,L Var,L %) -> %
+    substvar(p,vl,q) ==
+      null vl => monom(p,0)$STT
+      (uv := mainVariable p) case "failed" => monom(p,0)$STT
+      v := uv :: Var
+      v = first vl =>
+        s : % := 0
+        up := univariate(p,v)
+        while not zero? up repeat
+          c := leadingCoefficient up
+          s := s + first q ** degree up * substvar(c,rest vl,rest q)
+          up := reductum up
+        s
+      substvar(p,rest vl,rest q)
+ 
+    sortmfirst:(SMP,L Var,L %) -> %
+    sortmfirst(p,vl,q) ==
+      nlv : L Var := sort(#1 > #2,vl)
+      nq : L % := [q position$(L Var) (i,vl) for i in nlv]
+      substvar(p,nlv,nq)
+ 
+    csubst(vl,q) == sortmfirst(#1,vl,q pretend L(%)) pretend StS
+ 
+    restCheck(s:StS):StS ==
+      -- checks that stream is null or first element is 0
+      -- returns empty() or rest of stream
+      empty? s => s
+      not zero? frst s =>
+        error "eval: constant coefficient should be 0"
+      rst s
+ 
+    eval(s:%,v:L Var,q:L %) ==
+      #v ^= #q =>
+        error "eval: number of variables should equal number of values"
+      nq : L StS := [restCheck(i pretend StS) for i in q]
+      addiag(map(csubst(v,nq),s pretend StS)$ST2(SMP,StS))$STT pretend %
+ 
+    substmts(v:Var,p:SMP,q:%):% ==
+      up := univariate(p,v)
+      ss : % := 0
+      while not zero? up repeat
+        d:=degree up
+        c:SMP:=leadingCoefficient up
+        ss := ss + c* q ** d
+        up := reductum up
+      ss
+ 
+    subststream(v:Var,p:SMP,q:StS):StS==
+      substmts(v,p,q pretend %) pretend StS
+ 
+    comp1:(Var,StS,StS) -> StS
+    comp1(v,r,t)== addiag(map(subststream(v,#1,t),r)$ST2(SMP,StS))$STT
+ 
+    comp(v:Var,s:StS,t:StS):StS == delay
+      empty? s => s
+      f := frst s; r : StS := rst s;
+      empty? r => s
+      empty? t => concat(f,comp1(v,r,empty()$StS))
+      not zero? frst t =>
+        error "eval: constant coefficient should be zero"
+      concat(f,comp1(v,r,rst t))
+ 
+    eval(s:%,v:Var,t:%) == comp(v,s pretend StS,t pretend StS)
+ 
+--% differentiation and integration
+ 
+    differentiate(s:%,v:Var):% ==
+      empty? s => 0
+      map(differentiate(#1,v),rst s)
+ 
+    if Coef has Algebra Fraction Integer then
+ 
+      stream(x:%):Rep == x pretend Rep
+ 
+      (x:%) ** (r:RN) == powern(r,stream x)$STT
+      (r:RN) * (x:%)  == map(r * #1, stream x)$ST2(SMP,SMP) pretend %
+      (x:%) * (r:RN)  == map(#1 * r,stream x )$ST2(SMP,SMP) pretend %
+ 
+      exp x == exp(stream x)$STF
+      log x == log(stream x)$STF
+ 
+      sin x == sin(stream x)$STF
+      cos x == cos(stream x)$STF
+      tan x == tan(stream x)$STF
+      cot x == cot(stream x)$STF
+      sec x == sec(stream x)$STF
+      csc x == csc(stream x)$STF
+ 
+      asin x == asin(stream x)$STF
+      acos x == acos(stream x)$STF
+      atan x == atan(stream x)$STF
+      acot x == acot(stream x)$STF
+      asec x == asec(stream x)$STF
+      acsc x == acsc(stream x)$STF
+ 
+      sinh x == sinh(stream x)$STF
+      cosh x == cosh(stream x)$STF
+      tanh x == tanh(stream x)$STF
+      coth x == coth(stream x)$STF
+      sech x == sech(stream x)$STF
+      csch x == csch(stream x)$STF
+ 
+      asinh x == asinh(stream x)$STF
+      acosh x == acosh(stream x)$STF
+      atanh x == atanh(stream x)$STF
+      acoth x == acoth(stream x)$STF
+      asech x == asech(stream x)$STF
+      acsch x == acsch(stream x)$STF
+ 
+      intsmp(v:Var,p: SMP): SMP ==
+        up := univariate(p,v)
+        ss : SMP := 0
+        while not zero? up repeat
+          d := degree up
+          c := leadingCoefficient up
+          ss := ss + inv((d+1) :: RN) * monomial(c,v,d+1)$SMP
+          up := reductum up
+        ss
+ 
+      fintegrate(f,v,r) ==
+        concat(r::SMP,delay map(intsmp(v,#1),f() pretend StS))
+      integrate(s,v,r) ==
+        concat(r::SMP,map(intsmp(v,#1),s pretend StS))
+ 
+    -- If there is more than one term of the same order, group them.
+    tout(p:SMP):OUT ==
+      pe := p :: OUT
+      monomial? p => pe
+      paren pe
+ 
+    showAll?: () -> Boolean
+    -- check a global Lisp variable
+    showAll?() == true
+ 
+    coerce(s:%):OUT ==
+      uu := s pretend Stream(SMP)
+      empty? uu => (0$SMP) :: OUT
+      n : NNI; count : NNI := _$streamCount$Lisp
+      l : List OUT := empty()
+      for n in 0..count while not empty? uu repeat
+        if frst(uu) ^= 0 then l := concat(tout frst uu,l)
+        uu := rst uu
+      if showAll?() then
+        for n in n.. while explicitEntries? uu and _
+               not eq?(uu,rst uu) repeat
+          if frst(uu) ^= 0 then l := concat(tout frst uu,l)
+          uu := rst uu
+      l :=
+        explicitlyEmpty? uu => l
+        eq?(uu,rst uu) and frst uu = 0 => l
+        concat(prefix("O" :: OUT,[n :: OUT]),l)
+      empty? l => (0$SMP) :: OUT
+      reduce("+",reverse_! l)
+    if Coef has Field then
+         stream(x:%):Rep == x pretend Rep
+         SF2==> StreamFunctions2
+         p:% / r:Coef ==(map(#1/$SMP r,stream p)$SF2(SMP,SMP))pretend %
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain SHDP SplitHomogeneousDirectProduct}
 \pagehead{SplitHomogeneousDirectProduct}{SHDP}
 \pagepic{ps/v103splithomogeneousdirectproduct.ps}{SHDP}{1.00}
@@ -40640,6 +45529,296 @@ SplitHomogeneousDirectProduct(dimtot,dim1,S) : T == C where
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain SQMATRIX SquareMatrix}
+<<SquareMatrix.input>>=
+-- matrix.spad.pamphlet SquareMatrix.input
+)spool SquareMatrix.output
+)set message test on
+)set message auto off
+)clear all
+--S 1 of 6
+)set expose add constructor SquareMatrix
+--R 
+--I   SquareMatrix is now explicitly exposed in frame frame0 
+--E 1 
+
+--S 2 of 6
+m := squareMatrix [ [1,-%i],[%i,4] ]
+--R 
+--R
+--R        +1   - %i+
+--R   (1)  |        |
+--R        +%i   4  +
+--R                                        Type: SquareMatrix(2,Complex Integer)
+--E 2
+
+--S 3 of 6
+m*m - m
+--R 
+--R
+--R        + 1   - 4%i+
+--R   (2)  |          |
+--R        +4%i   13  +
+--R                                        Type: SquareMatrix(2,Complex Integer)
+--E 3
+
+--S 4 of 6
+mm := squareMatrix [ [m, 1], [1-m, m**2] ]
+--R 
+--R
+--R        ++1   - %i+      +1  0+   +
+--R        ||        |      |    |   |
+--R        |+%i   4  +      +0  1+   |
+--R   (3)  |                         |
+--R        |+ 0    %i +  + 2   - 5%i+|
+--R        ||         |  |          ||
+--R        ++- %i  - 3+  +5%i   17  ++
+--R                        Type: SquareMatrix(2,SquareMatrix(2,Complex Integer))
+--E 4
+
+--S 5 of 6
+p := (x + m)**2
+--R 
+--R
+--R         2   + 2   - 2%i+    + 2   - 5%i+
+--R   (4)  x  + |          |x + |          |
+--R             +2%i    8  +    +5%i   17  +
+--R                             Type: Polynomial SquareMatrix(2,Complex Integer)
+--E 5
+
+--S 6 of 6
+p::SquareMatrix(2, ?)
+--R 
+--R
+--R        + 2                        +
+--R        |x  + 2x + 2  - 2%i x - 5%i|
+--R   (5)  |                          |
+--R        |              2           |
+--R        +2%i x + 5%i  x  + 8x + 17 +
+--R                             Type: SquareMatrix(2,Polynomial Complex Integer)
+--E 6
+)spool
+)lisp (bye)
+@
+<<SquareMatrix.help>>=
+====================================================================
+SquareMatrix examples
+====================================================================
+ 
+The top level matrix type in Axiom is Matrix, which provides basic
+arithmetic and linear algebra functions.  However, since the matrices
+can be of any size it is not true that any pair can be added or
+multiplied.  Thus Matrix has little algebraic structure.
+ 
+Sometimes you want to use matrices as coefficients for polynomials or
+in other algebraic contexts.  In this case, SquareMatrix should be
+used.  The domain SquareMatrix(n,R) gives the ring of n by n square
+matrices over R.
+ 
+Since SquareMatrix is not normally exposed at the top level, you must
+expose it before it can be used.
+
+  )set expose add constructor SquareMatrix
+
+Once SQMATRIX has been exposed, values can be created using the
+squareMatrix function.
+
+  m := squareMatrix [ [1,-%i],[%i,4] ]
+    +1   - %i+
+    |        |
+    +%i   4  +
+                        Type: SquareMatrix(2,Complex Integer)
+
+The usual arithmetic operations are available.
+
+  m*m - m
+    + 1   - 4%i+
+    |          |
+    +4%i   13  +
+                        Type: SquareMatrix(2,Complex Integer)
+
+Square matrices can be used where ring elements are required.
+For example, here is a matrix with matrix entries.
+
+  mm := squareMatrix [ [m, 1], [1-m, m**2] ]
+    ++1   - %i+      +1  0+   +
+    ||        |      |    |   |
+    |+%i   4  +      +0  1+   |
+    |                         |
+    |+ 0    %i +  + 2   - 5%i+|
+    ||         |  |          ||
+    ++- %i  - 3+  +5%i   17  ++
+                        Type: SquareMatrix(2,SquareMatrix(2,Complex Integer))
+
+Or you can construct a polynomial with  square matrix coefficients.
+
+  p := (x + m)**2
+     2   + 2   - 2%i+    + 2   - 5%i+
+    x  + |          |x + |          |
+         +2%i    8  +    +5%i   17  +
+                        Type: Polynomial SquareMatrix(2,Complex Integer)
+
+This value can be converted to a square matrix with polynomial coefficients.
+
+  p::SquareMatrix(2, ?)
+    + 2                        +
+    |x  + 2x + 2  - 2%i x - 5%i|
+    |                          |
+    |              2           |
+    +2%i x + 5%i  x  + 8x + 17 +
+                        Type: SquareMatrix(2,Polynomial Complex Integer)
+ 
+See Also:
+o )help Matrix
+o )show SquareMatrix
+o $AXIOM/doc/src/algebra/matrix.spad.dvi
+
+@
+\pagehead{SquareMatrix}{SQMATRIX}
+\pagepic{ps/v103squarematrix.ps}{SQMATRIX}{1.00}
+See also:\\
+\refto{IndexedMatrix}{IMATRIX}
+\refto{Matrix}{MATRIX}
+\refto{RectangularMatrix}{RMATRIX}
+<<domain SQMATRIX SquareMatrix>>=
+)abbrev domain SQMATRIX SquareMatrix
+++ Author: Grabmeier, Gschnitzer, Williamson
+++ Date Created: 1987
+++ Date Last Updated: July 1990
+++ Basic Operations:
+++ Related Domains: IndexedMatrix, Matrix, RectangularMatrix
+++ Also See:
+++ AMS Classifications:
+++ Keywords: matrix, linear algebra
+++ Examples:
+++ References:
+++ Description:
+++   \spadtype{SquareMatrix} is a matrix domain of square matrices, where the
+++   number of rows (= number of columns) is a parameter of the type.
+SquareMatrix(ndim,R): Exports == Implementation where
+  ndim : NonNegativeInteger
+  R    : Ring
+  Row ==> DirectProduct(ndim,R)
+  Col ==> DirectProduct(ndim,R)
+  MATLIN ==> MatrixLinearAlgebraFunctions(R,Row,Col,$)
+ 
+  Exports ==> Join(SquareMatrixCategory(ndim,R,Row,Col),_
+                   CoercibleTo Matrix R) with
+ 
+    transpose: $ -> $
+      ++ \spad{transpose(m)} returns the transpose of the matrix m.
+    squareMatrix: Matrix R -> $
+      ++ \spad{squareMatrix(m)} converts a matrix of type \spadtype{Matrix}
+      ++ to a matrix of type \spadtype{SquareMatrix}.
+    coerce: $ -> Matrix R
+      ++ \spad{coerce(m)} converts a matrix of type \spadtype{SquareMatrix}
+      ++ to a matrix of type \spadtype{Matrix}.
+--  symdecomp : $ -> Record(sym:$,antisym:$)
+--    ++ \spad{symdecomp(m)} decomposes the matrix m as a sum of a symmetric
+--    ++ matrix \spad{m1} and an antisymmetric matrix \spad{m2}. The object
+--    ++ returned is the Record \spad{[m1,m2]}
+--  if R has commutative("*") then
+--    minorsVect: -> Vector(Union(R,"uncomputed")) --range: 1..2**n-1
+--      ++ \spad{minorsVect(m)} returns a vector of the minors of the matrix m
+    if R has commutative("*") then central
+      ++ the elements of the Ring R, viewed as diagonal matrices, commute
+      ++ with all matrices and, indeed, are the only matrices which commute
+      ++ with all matrices.
+    if R has commutative("*") and R has unitsKnown then unitsKnown
+      ++ the invertible matrices are simply the matrices whose determinants
+      ++ are units in the Ring R.
+    if R has ConvertibleTo InputForm then ConvertibleTo InputForm
+ 
+  Implementation ==> Matrix R add
+    minr ==> minRowIndex
+    maxr ==> maxRowIndex
+    minc ==> minColIndex
+    maxc ==> maxColIndex
+    mini ==> minIndex
+    maxi ==> maxIndex
+ 
+    ZERO := scalarMatrix 0
+    0    == ZERO
+    ONE  := scalarMatrix 1
+    1    == ONE
+
+    characteristic() == characteristic()$R
+ 
+    matrix(l: List List R) ==
+      -- error check: this is a top level function
+      #l ^= ndim => error "matrix: wrong number of rows"
+      for ll in l repeat
+        #ll ^= ndim => error "matrix: wrong number of columns"
+      ans : Matrix R := new(ndim,ndim,0)
+      for i in minr(ans)..maxr(ans) for ll in l repeat
+        for j in minc(ans)..maxc(ans) for r in ll repeat
+          qsetelt_!(ans,i,j,r)
+      ans pretend $
+ 
+    row(x,i)    == directProduct row(x pretend Matrix(R),i)
+    column(x,j) == directProduct column(x pretend Matrix(R),j)
+    coerce(x:$):OutputForm == coerce(x pretend Matrix R)$Matrix(R)
+ 
+    scalarMatrix r == scalarMatrix(ndim,r)$Matrix(R) pretend $
+ 
+    diagonalMatrix l ==
+      #l ^= ndim =>
+        error "diagonalMatrix: wrong number of entries in list"
+      diagonalMatrix(l)$Matrix(R) pretend $
+ 
+    coerce(x:$):Matrix(R) == copy(x pretend Matrix(R))
+ 
+    squareMatrix x ==
+      (nrows(x) ^= ndim) or (ncols(x) ^= ndim) =>
+        error "squareMatrix: matrix of bad dimensions"
+      copy(x) pretend $
+ 
+    x:$ * v:Col ==
+      directProduct((x pretend Matrix(R)) * (v :: Vector(R)))
+ 
+    v:Row * x:$ ==
+      directProduct((v :: Vector(R)) * (x pretend Matrix(R)))
+ 
+    x:$ ** n:NonNegativeInteger ==
+      ((x pretend Matrix(R)) ** n) pretend $
+ 
+    if R has commutative("*") then
+ 
+      determinant x == determinant(x pretend Matrix(R))
+      minordet x    == minordet(x pretend Matrix(R))
+ 
+    if R has EuclideanDomain then
+ 
+      rowEchelon x == rowEchelon(x pretend Matrix(R)) pretend $
+ 
+    if R has IntegralDomain then
+ 
+      rank x    == rank(x pretend Matrix(R))
+      nullity x == nullity(x pretend Matrix(R))
+      nullSpace x ==
+        [directProduct c for c in nullSpace(x pretend Matrix(R))]
+ 
+    if R has Field then
+ 
+      dimension() == (m * n) :: CardinalNumber
+ 
+      inverse x ==
+        (u := inverse(x pretend Matrix(R))) case "failed" => "failed"
+        (u :: Matrix(R)) pretend $
+ 
+      x:$ ** n:Integer ==
+        ((x pretend Matrix(R)) ** n) pretend $
+ 
+      recip x == inverse x
+ 
+    if R has ConvertibleTo InputForm then
+      convert(x:$):InputForm ==
+         convert [convert("squareMatrix"::Symbol)@InputForm,
+                  convert(x::Matrix(R))]$List(InputForm)
+
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain STACK Stack}
 <<dot>>=
 "STACK" -> "SKAGG"
@@ -40993,6 +46172,63 @@ SymbolTable() : exports == implementation where
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Chapter T}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain TS TaylorSeries}
+\pagehead{TaylorSeries}{TS}
+\pagepic{ps/v103taylorseries.ps}{TS}{1.00}
+See also:\\
+\refto{SparseMultivariateTaylorSeries}{SMTS}
+<<domain TS TaylorSeries>>=
+)abbrev domain TS TaylorSeries
+++ Authors: Burge, Watt, Williamson
+++ Date Created: 15 August 1988
+++ Date Last Updated: 18 May 1991
+++ Basic Operations:
+++ Related Domains: SparseMultivariateTaylorSeries
+++ Also See: UnivariateTaylorSeries
+++ AMS Classifications:
+++ Keywords: multivariate, Taylor, series
+++ Examples:
+++ References:
+++ Description:
+++   \spadtype{TaylorSeries} is a general multivariate Taylor series domain
+++   over the ring Coef and with variables of type Symbol.
+TaylorSeries(Coef): Exports == Implementation where
+  Coef  : Ring
+  L   ==> List
+  NNI ==> NonNegativeInteger
+  SMP ==> Polynomial Coef
+  StS ==> Stream SMP
+ 
+  Exports ==> MultivariateTaylorSeriesCategory(Coef,Symbol) with
+    coefficient: (%,NNI) -> SMP
+      ++\spad{coefficient(s, n)} gives the terms of total degree n.
+    coerce: Symbol -> %
+      ++\spad{coerce(s)} converts a variable to a Taylor series
+    coerce: SMP -> %
+      ++\spad{coerce(s)} regroups terms of s by total degree
+      ++ and forms a series.
+ 
+    if Coef has Algebra Fraction Integer then
+      integrate: (%,Symbol,Coef) -> %
+        ++\spad{integrate(s,v,c)} is the integral of s with respect
+        ++ to v and having c as the constant of integration.
+      fintegrate: (() -> %,Symbol,Coef) -> %
+        ++\spad{fintegrate(f,v,c)} is the integral of \spad{f()} with respect
+        ++ to v and having c as the constant of integration.
+        ++ The evaluation of \spad{f()} is delayed.
+ 
+  Implementation ==> SparseMultivariateTaylorSeries(Coef,Symbol,SMP) add
+    Rep := StS -- Below we use the fact that Rep of PS is Stream SMP.
+ 
+    polynomial(s,n) ==
+      sum : SMP := 0
+      for i in 0..n while not empty? s repeat
+        sum := sum + frst s
+        s:= rst s
+      sum
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain TEXTFILE TextFile}
 <<TextFile.input>>=
 -- files.spad.pamphlet TextFile.input
@@ -45407,6 +50643,7 @@ Note that this code is not included in the generated catdef.spad file.
 <<domain EQ Equation>>
 <<domain EXPEXPAN ExponentialExpansion>>
 <<domain EXPUPXS ExponentialOfUnivariatePuiseuxSeries>>
+<<domain EMR EuclideanModularRing>>
 <<domain EXPR Expression>>
 <<domain E04DGFA e04dgfAnnaType>>
 <<domain E04FDFA e04fdfAnnaType>>
@@ -45450,6 +50687,7 @@ Note that this code is not included in the generated catdef.spad file.
 <<domain FPARFRAC FullPartialFractionExpansion>>
 
 <<domain GDMP GeneralDistributedMultivariatePolynomial>>
+<<domain GMODPOL GeneralModulePolynomial>>
 <<domain GCNAALG GenericNonAssociativeAlgebra>>
 <<domain GSERIES GeneralUnivariatePowerSeries>>
 
@@ -45465,8 +50703,10 @@ Note that this code is not included in the generated catdef.spad file.
 <<domain IDPO IndexedDirectProductObject>>
 <<domain IDPOAM IndexedDirectProductOrderedAbelianMonoid>>
 <<domain IDPOAMS IndexedDirectProductOrderedAbelianMonoidSup>>
+<<domain INDE IndexedExponents>>
 <<domain IFARRAY IndexedFlexibleArray>>
 <<domain ILIST IndexedList>>
+<<domain IMATRIX IndexedMatrix>>
 <<domain IARRAY1 IndexedOneDimensionalArray>>
 <<domain IARRAY2 IndexedTwoDimensionalArray>>
 <<domain ITUPLE InfiniteTuple>>
@@ -45474,6 +50714,7 @@ Note that this code is not included in the generated catdef.spad file.
 <<domain IFF InnerFiniteField>>
 <<domain IFAMON InnerFreeAbelianMonoid>>
 <<domain IIARRAY2 InnerIndexedTwoDimensionalArray>>
+<<domain INFORM InputForm>>
 <<domain INT Integer>>
 <<domain ZMOD IntegerMod>>
 <<domain INTFTBL IntegrationFunctionsTable>>
@@ -45499,6 +50740,15 @@ Note that this code is not included in the generated catdef.spad file.
 <<domain MFLOAT MachineFloat>>
 <<domain MINT MachineInteger>>
 <<domain MKCHSET MakeCachableSet>>
+<<domain MATRIX Matrix>>
+<<domain MODMON ModMonic>>
+<<domain MODMONOM ModuleMonomial>>
+<<domain MODFIELD ModularField>>
+<<domain MODRING ModularRing>>
+<<domain MOEBIUS MoebiusTransform>>
+<<domain MRING MonoidRing>>
+<<domain MSET Multiset>>
+<<domain MPOLY MultivariatePolynomial>>
 
 <<domain NONE None>>
 <<domain NNI NonNegativeInteger>>
@@ -45521,6 +50771,7 @@ Note that this code is not included in the generated catdef.spad file.
 <<domain ACPLOT PlaneAlgebraicCurvePlot>>
 <<domain PALETTE Palette>>
 <<domain HACKPI Pi>>
+<<domain POLY Polynomial>>
 <<domain IDEAL PolynomialIdeals>>
 <<domain PI PositiveInteger>>
 <<domain PRIMARR PrimitiveArray>>
@@ -45530,6 +50781,7 @@ Note that this code is not included in the generated catdef.spad file.
 <<domain QUEUE Queue>>
 
 <<domain RADFF RadicalFunctionField>>
+<<domain RMATRIX RectangularMatrix>>
 <<domain REF Reference>>
 <<domain RESULT Result>>
 <<domain ROMAN RomanNumeral>>
@@ -45537,14 +50789,19 @@ Note that this code is not included in the generated catdef.spad file.
 <<domain FORMULA ScriptFormulaFormat>>
 <<domain SAE SimpleAlgebraicExtension>>
 <<domain SFORT SimpleFortranProgram>>
+<<domain SAOS SingletonAsOrderedSet>>
 <<domain SDPOL SequentialDifferentialPolynomial>>
 <<domain SDVAR SequentialDifferentialVariable>>
 <<domain SETMN SetOfMIntegersInOneToN>>
+<<domain SMP SparseMultivariatePolynomial>>
+<<domain SMTS SparseMultivariateTaylorSeries>>
 <<domain SHDP SplitHomogeneousDirectProduct>>
+<<domain SQMATRIX SquareMatrix>>
 <<domain STACK Stack>>
 <<domain SWITCH Switch>>
 <<domain SYMTAB SymbolTable>>
 
+<<domain TS TaylorSeries>>
 <<domain TEXTFILE TextFile>>
 <<domain SYMS TheSymbolTable>>
 <<domain M3D ThreeDimensionalMatrix>>
diff --git a/src/algebra/acplot.spad.pamphlet b/src/algebra/acplot.spad.pamphlet
index 4dbec57..f18549a 100644
--- a/src/algebra/acplot.spad.pamphlet
+++ b/src/algebra/acplot.spad.pamphlet
@@ -125,9 +125,7 @@ ans3 := realSolve(lp,lsv,0.01)$REALSOLV
 --R                                                        Type: List List Float
 --E 13
 )spool
- 
-)spool
-)lisp (bye)
+
 @
 <<RealSolvePackage.help>>=
 ====================================================================
diff --git a/src/algebra/mappkg.spad.pamphlet b/src/algebra/mappkg.spad.pamphlet
index 030d679..ce3616e 100644
--- a/src/algebra/mappkg.spad.pamphlet
+++ b/src/algebra/mappkg.spad.pamphlet
@@ -318,14 +318,6 @@ fibs := curry(shiftfib, fibinit)
 )lisp (bye)
  
 @
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}
-)spool
-)lisp (bye)
-@
 <<MappingPackage1.help>>=
 ====================================================================
 MappingPackage examples
@@ -1690,14 +1682,6 @@ h:=(x:EXPR(INT)):EXPR(INT)+->1
 )lisp (bye)
  
 @
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}
-)spool
-)lisp (bye)
-@
 <<MappingPackage4.help>>=
 ====================================================================
 MappingPackage examples
diff --git a/src/algebra/xlpoly.spad.pamphlet b/src/algebra/xlpoly.spad.pamphlet
index 43702dd..bc703ed 100644
--- a/src/algebra/xlpoly.spad.pamphlet
+++ b/src/algebra/xlpoly.spad.pamphlet
@@ -1269,7 +1269,6 @@ r + r1 + r2
 --E 28
 )spool
  
-)spool
 )lisp (bye)
 @
 <<LiePolynomial.help>>=
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index ca14fd6..34d60cf 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -791,6 +791,10 @@ regression file fixed created<br/>
 CATS hyperbolicrules.input added<br/>
 <a href="patches/20081209.01.tpd.patch">20081209.01.tpd.patch</a>
 bookvol10.3 add domains<br/>
+<a href="patches/20081210.01.tpd.patch">20081210.01.tpd.patch</a>
+bookvol10.3 add domains<br/>
+<a href="patches/20081211.01.tpd.patch">20081211.01.tpd.patch</a>
+<br/>
 
  </body>
 </html>
\ No newline at end of file
diff --git a/src/input/Makefile.pamphlet b/src/input/Makefile.pamphlet
index 45343ce..b341753 100644
--- a/src/input/Makefile.pamphlet
+++ b/src/input/Makefile.pamphlet
@@ -266,7 +266,7 @@ OUTS= ffrac.output     \
       tutchap2.output  tutchap3.output  tutchap4.output  \
       up.output        \
       vector.output    viewdef.output   \
-      wutset.output    xpbwpoly.output  \
+      wutset.output    \
       xpoly.output     xpr.output       \
       zdsolve.output   zimmer.output    zlindep.output 
 
@@ -687,7 +687,7 @@ FILES= ${OUT}/algaggr.input  ${OUT}/algbrbf.input    ${OUT}/algfacob.input \
        ${OUT}/vector.input   ${OUT}/vectors.input    ${OUT}/viewdef.input \
        ${OUT}/void.input     ${OUT}/wiggle.input   \
        ${OUT}/wutset.input \
-       ${OUT}/xpbwpoly.input ${OUT}/xpoly.input      ${OUT}/xpr.input \
+       ${OUT}/xpoly.input      ${OUT}/xpr.input \
        ${OUT}/zdsolve.input  ${OUT}/zimmer.input     ${OUT}/zlindep.input
 
 FILES2=${OUT}/arith.input    ${OUT}/bugs.input \
@@ -1043,7 +1043,7 @@ DOCFILES= \
   ${DOC}/vector.input.dvi      ${DOC}/vectors.input.dvi    \
   ${DOC}/viewdef.input.dvi     ${DOC}/void.input.dvi       \
   ${DOC}/wester.input.dvi      ${DOC}/wiggle.input.dvi     \
-  ${DOC}/wutset.input.dvi      ${DOC}/xpbwpoly.input.dvi   \
+  ${DOC}/wutset.input.dvi      \
   ${DOC}/xpoly.input.dvi       ${DOC}/xpr.input.dvi        \
   ${DOC}/zdsolve.input.dvi     ${DOC}/zimmer.input.dvi     \
   ${DOC}/zlindep.input.dvi  
diff --git a/src/input/cwmmt.input.pamphlet b/src/input/cwmmt.input.pamphlet
index c037652..2179513 100644
--- a/src/input/cwmmt.input.pamphlet
+++ b/src/input/cwmmt.input.pamphlet
@@ -98,6 +98,7 @@ CompWithMappingModeTest() : Exports == Implementation where
 \end{chunk}
 <<*>>=
 )spool cwmmt.output
+)sys cp $AXIOM/../../src/input/cwmmt.input.pamphlet .
 )lisp (tangle "cwmmt.input.pamphlet" "cwmmt.spad" "cwmmt.spad" )
 )co cwmmt.spad
 )set message test on
diff --git a/src/input/function.input.pamphlet b/src/input/function.input.pamphlet
index 8e2c181..52c3385 100644
--- a/src/input/function.input.pamphlet
+++ b/src/input/function.input.pamphlet
@@ -359,6 +359,8 @@ sinCosExpand(sin(x+y-2*z) * cos y)
 --R                                                     Type: Expression Integer
 --E 33
 
+)spool
+)lisp (bye)
 @
 \eject
 \begin{thebibliography}{99}
diff --git a/src/input/series.input.pamphlet b/src/input/series.input.pamphlet
index bd53d23..eb840eb 100644
--- a/src/input/series.input.pamphlet
+++ b/src/input/series.input.pamphlet
@@ -18,7 +18,8 @@
 )set message test on
 )set message auto off
 )clear all
---S 1 of 17
+
+@
 \section{Expression To Power Series}
 We compute series expansions of various functions using EXPR2UPS.
 
diff --git a/src/input/xpbwpoly.input.pamphlet b/src/input/xpbwpoly.input.pamphlet
deleted file mode 100644
index f838d24..0000000
--- a/src/input/xpbwpoly.input.pamphlet
+++ /dev/null
@@ -1,59 +0,0 @@
-\documentclass{article}
-\usepackage{axiom}
-\begin{document}
-\title{\$SPAD/src/input XPBWPOLY.input}
-\author{The Axiom Team}
-\maketitle
-\begin{abstract}
-\end{abstract}
-\eject
-\tableofcontents
-\eject
-<<*>>=
-)cl all
-
-a:Symbol := 'a
-b:Symbol := 'b
-RN    := Fraction(Integer)
-word   := OrderedFreeMonoid Symbol
-lword := LyndonWord(Symbol)
-base  := PoincareBirkhoffWittLyndonBasis Symbol
-dpoly := XDistributedPolynomial(Symbol, RN)
-rpoly := XRecursivePolynomial(Symbol, RN)
-lpoly := LiePolynomial(Symbol, RN)
-poly  := XPBWPolynomial(Symbol, RN)
-liste : List lword := LyndonWordsList([a,b], 6)
-0$poly
-1$poly
-p : poly := a
-q : poly := b
-pq: poly := p*q
-pq :: dpoly
-mirror pq
-ListOfTerms pq
-reductum pq
-leadingMonomial pq
-coefficients pq
-leadingTerm pq
-degree pq
-pq4:=exp(pq,4)
-log(pq4,4) - pq
-lp1 :lpoly := LiePoly liste.10
-lp2 :lpoly := LiePoly liste.11
-lp  :lpoly := [lp1, lp2]
-lpd1: dpoly := lp1
-lpd2: dpoly := lp2
-lpd : dpoly := lpd1 * lpd2 - lpd2 * lpd1
-lp :: dpoly - lpd
-p := 3 * lp
-q := lp1
-pq:= p * q
-pr:rpoly := p :: rpoly
-qr:rpoly := q :: rpoly
-pq :: rpoly - pr*qr
-@
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}

\start
Date: Sat, 13 Dec 2008 13:34:51 -0600
From: Tim Daly
To: list
Subject: 20081212.01.tpd.patch (bookvol10.3 add domains)

More domains were moved to book volume 10.3

Patch available at:
<http://axiom-developer.org/axiom-website/patches.html#latest>

\start
Date: Sun, 14 Dec 2008 00:22:10 -0600
From: Tim Daly
To: list
Subject: 20081213.01.tpd.patch (lisp move to gcl-pre3)

Move Axiom to the lastest GCL sources.

========================================================================
diff --git a/Makefile b/Makefile
index 0003b8c..0314d2f 100644
--- a/Makefile
+++ b/Makefile
@@ -14,8 +14,9 @@ LSP=${SPD}/lsp
 #GCLVERSION=gcl-2.6.6
 #GCLVERSION=gcl-2.6.7pre
 #GCLVERSION=gcl-2.6.7
-GCLVERSION=gcl-2.6.8pre
+#GCLVERSION=gcl-2.6.8pre
 #GCLVERSION=gcl-2.6.8pre2
+GCLVERSION=gcl-2.6.8pre3
 AWK=gawk
 GCLDIR=${LSP}/${GCLVERSION}
 SRC=${SPD}/src
diff --git a/Makefile.pamphlet b/Makefile.pamphlet
index 18105ad..246d9ac 100644
--- a/Makefile.pamphlet
+++ b/Makefile.pamphlet
@@ -749,9 +749,9 @@ forget to erase the lsp/Makefile the wrong patches will be applied.
 #GCLVERSION=gcl-2.6.6
 #GCLVERSION=gcl-2.6.7pre
 #GCLVERSION=gcl-2.6.7
-GCLVERSION=gcl-2.6.8pre
+#GCLVERSION=gcl-2.6.8pre
 #GCLVERSION=gcl-2.6.8pre2
-#GCLVERSION=gcl-2.6.8pre3 
+GCLVERSION=gcl-2.6.8pre3 
 @
 
 \subsubsection{The [[GCLOPTS]] configure variable}
diff --git a/changelog b/changelog
index 4fe3151..ffc5154 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,9 @@
+20081213 tpd src/axiom-website/patches.html 20081213.01.tpd.patch
+20081213 tpd zips/gcl-2.6.8pre3.unixport.makefile.patch move to gcl-pre3
+20081213 tpd zips/gcl-2.6.8pre3.unixport.init_gcl.lsp.in.patch move to gcl-pre3
+20081213 tpd zips/gcl-2.6.8pre3.tgz move to gcl-pre3
+20081213 tpd Makefile.pamphlet move to gcl-pre3
+20081213 tpd Makefile move to gcl-pre3
 20081212 tpd src/axiom-website/patches.html 20081212.01.tpd.patch
 20081212 tpd books/bookvol4.pamphlet added
 20081212 tpd books/ps/v103univariateskewpolynomial.ps added
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 6dbfd08..fb4cca2 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -795,6 +795,10 @@ bookvol10.3 add domains<br/>
 bookvol10.3 add domains<br/>
 <a href="patches/20081211.01.tpd.patch">20081211.01.tpd.patch</a>
 regression test suite cleanup<br/>
+<a href="patches/20081212.01.tpd.patch">20081212.01.tpd.patch</a>
+bookvol10.3 add domains<br/>
+<a href="patches/20081213.01.tpd.patch">20081213.01.tpd.patch</a>
+lisp move to GCL-pre3<br/>
 
  </body>
 </html>
\ No newline at end of file
diff --git a/zips/gcl-2.6.8pre3.tgz b/zips/gcl-2.6.8pre3.tgz
index 93c17d8..b1437ad 100644
Binary files a/zips/gcl-2.6.8pre3.tgz and b/zips/gcl-2.6.8pre3.tgz differ
diff --git a/zips/gcl-2.6.8pre3.unixport.init_gcl.lsp.in.patch b/zips/gcl-2.6.8pre3.unixport.init_gcl.lsp.in.patch
index 0828565..553d963 100644
--- a/zips/gcl-2.6.8pre3.unixport.init_gcl.lsp.in.patch
+++ b/zips/gcl-2.6.8pre3.unixport.init_gcl.lsp.in.patch
@@ -1,11 +1,13 @@
---- init_gcl.lsp.in	2008-11-22 05:33:51.000000000 -0500
-+++ init_gcl.lsp.in.new	2008-11-22 05:34:00.000000000 -0500
-@@ -85,7 +85,7 @@
+--- init_gcl.lsp.in	2006-10-25 17:17:05.000000000 -0400
++++ init_gcl.lsp.in.tpd	2008-11-21 13:35:59.000000000 -0500
+@@ -85,8 +85,8 @@
     (cond ((si::get-command-arg "-batch")
  	  (setq si::*top-level-hook* 'bye))
  	 ((si::get-command-arg "-f"))
 -	 (t (format t si::*system-banner*)
-+	 (t ;(format t si::*system-banner*)
- 	    (format t "Temporary directory for compiler files set to ~a~%" *tmp-dir*)))
+-	    (format t "Temporary directory for compiler files set to ~a~%" *tmp-dir*)))
++	 (t (format nil si::*system-banner*)
++	    (format nil "Temporary directory for compiler files set to ~a~%" *tmp-dir*)))
     (setq si::*ihs-top* 1)
     (in-package 'system::user) (incf system::*ihs-top* 2)
+    (funcall system::*old-top-level*))
diff --git a/zips/gcl-2.6.8pre3.unixport.makefile.patch b/zips/gcl-2.6.8pre3.unixport.makefile.patch
index 56ed9a4..4af04b1 100644
--- a/zips/gcl-2.6.8pre3.unixport.makefile.patch
+++ b/zips/gcl-2.6.8pre3.unixport.makefile.patch
@@ -1,12 +1,12 @@
---- makefile	Sun Jul 24 12:55:39 2005
-+++ makefile.tpd	Sun Jul 24 15:40:01 2005
-@@ -14,7 +14,8 @@
+--- makefile	2006-08-23 14:14:22.000000000 -0400
++++ makefile.tpd	2008-11-21 13:31:06.000000000 -0500
+@@ -15,7 +15,8 @@
  PORTDIR = $(shell pwd)
  
  LD_LIBS_PRE=$(FIRST_FILE) $(addprefix -u ,$(PATCHED_SYMBOLS))
 -LD_LIBS_POST=$(LIBS) $(LIBC) -lgclp $(LAST_FILE)
 +# 20031022000 tpd link axiom's C library code
-+LD_LIBS_POST=$(LIBS) $(LIBC) -lgclp ${OBJ}/${SYS}/lib/libspad.a $(LAST_FILE) 
++LD_LIBS_POST=$(LIBS) $(LIBC) -lgclp ${OBJ}/${SYS}/lib/libspad.a $(LAST_FILE)
  
  ifeq ($(ARRS),)
  ARRS:=ar rs

\start
Date: Sun, 14 Dec 2008 04:18:36 -0500
From: Tim Daly
To: Roberto Cari
Subject: Re: [Axiom-mail] Axiom installation on Vector linux

I can reproduce your problem but do not yet have a solution.

make LDF="-L/usr/lib" should work but the vector linux version
of libXpm does not contain XpmReadFileToImage.

I'm not sure why libXpm.a is missing this function.
I'm still searching for clues.

\start
Date: Sun, 14 Dec 2008 04:49:10 -0500
From: Tim Daly
To: Roberto Cari
Subject: Re: [Axiom-mail] Axiom installation on Vector linux

> I can reproduce your problem but do not yet have a solution.
> 
> make LDF="-L/usr/lib" should work but the vector
> linux version
> of libXpm does not contain XpmReadFileToImage.
> 
> I'm not sure why libXpm.a is missing this function.
> I'm still searching for clues.

Ok, I've finally beaten this problem into submission.  Its going to
take some time for me to create and test a general purpose patch to
flatten this issue.  Its nearly 5am here so I'll look at it after I
get some sleep.

\start
Date: Sun, 14 Dec 2008 12:42:33 -0600
From: Tim Daly
To: list
Subject: 20081213.02.tpd.patch (bookvol10.3 add domains)

More domains were moved to book volume 10.3

Patch is available at:
http://axiom-developer.org/axiom-website/patches.html#latest

\start
Date: Mon, 15 Dec 2008 02:45:19 -0500
From: Tim Daly
To: Roberto Cari
Subject: Re: [Axiom-mail] Axiom installation on Vector linux

I should note that you have a running axiom called AXIOMsys on your system.
If the $AXIOM and $PATH variables are set per instructions then you can
just type AXIOMsys and it will start.

So you don't have to wait for my patch. My patch involves the graphics
subsystem.

\start
Date: Mon, 15 Dec 2008 10:23:36 -0500
From: Tim Daly
To: Roberto Cari
Subject: Re: [Axiom-mail] Axiom installation on Vector linux

Rob,

I've fixed the problem. 
I put the vector platform and the binary on the binary download page:

http://axiom-developer.org/axiom-website/download.html

Now that I've built a vector linux machine for it I'll post a new
version with each Axiom release (every 2 months).

The fix has to go thru a large number of steps, including testing on
the other platforms I support, so the source won't show up for a while
yet. It will certainly be part of the next release.

Assuming you've unpacked it and put it into /usr/local/axiom you would
then do:

export AXIOM=/usr/local/axiom/mnt/vector
export PATH=$AXIOM/bin:$PATH
axiom

Let me know if there are any other problems.

\start
Date: Mon, 15 Dec 2008 10:33:55 -0600
From: Tim Daly
To: list
Subject: 20081214.01.tpd.patch (bookvol3 add domains)

More domains were moved to book volume 3.

Patch is at 
http://axiom-developer.org/axiom-developer/patches.html#latest

\start
Date: Mon, 15 Dec 2008 10:40:15 -0600
From: Tim Daly
To: list
Subject: 20081215.01.tpd.patch (download.html add vector linux)

Vector Linux is now a supported Axiom platform.
It was added to the list on the download page.

=========================================================================
diff --git a/src/axiom-website/download.html b/src/axiom-website/download.html
index 0f3e075..6576df9 100644
--- a/src/axiom-website/download.html
+++ b/src/axiom-website/download.html
@@ -841,6 +841,43 @@
      </td>
     </tr>
 
+    <tr>
+     <td align="left">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+       vector
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      </font>
+     </td>
+     <td align="center">
+      <font face="Helvetica, Arial, sans-serif" size="+1">
+      <a href="downloads/axiom-vector-nov2008-bin.tgz">bin</a>
+      </font>
+     </td>
+    </tr>
+
    </tbody>
   </table>
 
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 2615787..269373e 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -803,6 +803,8 @@ lisp move to GCL-pre3<br/>
 bookvol10.3 add domains<br/>
 <a href="patches/20081214.01.tpd.patch">20081214.01.tpd.patch</a>
 bookvol10.3 add domains<br/>
+<a href="patches/20081215.01.tpd.patch">20081215.01.tpd.patch</a>
+download.html add vector linux<br/>
 
  </body>
 </html>
\ No newline at end of file

\start
Date: Tue, 16 Dec 2008 02:06:11 -0600
From: Tim Daly
To: list
Subject: 20081215.02.tpd.patch (bookvol10.3 add domains)

More domains were added to book volume 10.3

See http://axiom-developer.org/axiom-website/patches.html#latest

\start
Date: Tue, 16 Dec 2008 08:56:38 -0600
From: Tim Daly
To: list
Subject: 20081216.01.tpd.patch (bookvol7.1 give complete path to htadd)

The build process should not depend on the PATH variable to find htadd

======================================================================
diff --git a/books/bookvol7.1.pamphlet b/books/bookvol7.1.pamphlet
index efb5a02..b44d50a 100644
--- a/books/bookvol7.1.pamphlet
+++ b/books/bookvol7.1.pamphlet
@@ -188484,6 +188484,7 @@ PAGELIST= ${PHT} algebra aspex basic  bmcat cphelp expose gloss  \
 HYPER=${MNT}/${SYS}/doc
 PAGEFILE=${HYPER}/bookvol7.1.pamphlet
 SMAN=${MNT}/${SYS}/bin/sman
+HTADD=${MNT}/${SYS}/bin/htadd
 
 all: dir ${PAGEFILE} ${HYPER}/ht.db
 	@echo 3 finished ${BOOK}
@@ -188515,7 +188516,7 @@ ${HYPER}/ht.db: ${BOOK}
 	@echo 2 making ${HYPER} from ${BOOK}
 	@ (cd ${HYPER} ; \
            rm -f ht.db ; \
-	   htadd ${PAGEFILE} )
+	   ${HTADD} ${PAGEFILE} )
 	@ cp -pr ${IN}/bitmaps ${HYPER}
 	@ cp -pr ${IN}/viewports ${HYPER}
 	@ (cd ${HYPER}/viewports ; \
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 3452f13..52ae287 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -807,6 +807,8 @@ bookvol10.3 add domains<br/>
 download.html add vector linux<br/>
 <a href="patches/20081215.02.tpd.patch">20081215.02.tpd.patch</a>
 bookvol10.3 add domains<br/>
+<a href="patches/20081216.01.tpd.patch">20081216.01.tpd.patch</a>
+bookvol7.1 give complete path to htadd<br/>
 
  </body>
 </html>
\ No newline at end of file

\start
Date: Tue, 16 Dec 2008 10:02:45 -0600
From: Tim Daly
To: list
Subject: 20081216.02.tpd.patch (biquat.input fix regression)

biquat.input has the name of the source file in the )show output.
The source file has changed. The regression is fixed.
=======================================================================
diff --git a/changelog b/changelog
index 51fe338..a97ed0f 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,7 @@
+20081216 tpd src/axiom-website/patches.html 20081216.02.tpd.patch
+20081216 tpd src/input/biquat.input source file name change
+20081216 tpd src/axiom-website/patches.html 20081216.01.tpd.patch
+20081216 tpd books/bookvol7.1 give complete path to htadd
 20081215 tpd src/axiom-website/patches.html 20081215.02.tpd.patch
 20081215 tpd books/ps/v103universalsegment.ps added
 20081215 tpd books/ps/v103threespace.ps added
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 52ae287..7377e11 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -809,6 +809,8 @@ download.html add vector linux<br/>
 bookvol10.3 add domains<br/>
 <a href="patches/20081216.01.tpd.patch">20081216.01.tpd.patch</a>
 bookvol7.1 give complete path to htadd<br/>
+<a href="patches/20081216.02.tpd.patch">20081216.02.tpd.patch</a>
+biquat.input fix regression failure<br/>
 
  </body>
 </html>
\ No newline at end of file
diff --git a/src/input/biquat.input.pamphlet b/src/input/biquat.input.pamphlet
index bfb3165..2290150 100644
--- a/src/input/biquat.input.pamphlet
+++ b/src/input/biquat.input.pamphlet
@@ -660,7 +660,7 @@ So let's find out more about this domain:
 --R RewriteRule(Base: SetCategory,R: Join(Ring,PatternMatchable Base,OrderedSet,ConvertibleTo Pattern Base),F: Join(FunctionSpace R,PatternMatchable Base,ConvertibleTo Pattern Base))  is a domain constructor
 --R Abbreviation for RewriteRule is RULE 
 --R This constructor is exposed in this frame.
---R Issue )edit rule.spad.pamphlet to see algebra source code for RULE 
+--R Issue )edit bookvol10.3.spad.pamphlet to see algebra source code for RULE 
 --R
 --R------------------------------- Operations --------------------------------
 --R ?=? : (%,%) -> Boolean                coerce : Equation F -> %


\start
Date: Tue, 16 Dec 2008 21:46:00 -0600
From: Tim Daly
To: list
Subject: 20081216.03.tpd.patch (bookvol10.3 add domains)

Add more domains to book volume 10.3

Patch is at
http://axiom-developer.org/axiom-website/patches.html#latest

\start
Date: Wed, 17 Dec 2008 17:22:30 -0600
From: Tim Daly
To: list
Subject: 20081216.04.tpd.patch (bookvol10.3 add domains)

Move more domains to bookvol10.3

Patch is at
http://axiom-developer.org/axiom-website/patches.html#latest

\start
Date: Wed, 17 Dec 2008 17:31:03 -0600
From: Tim Daly
To: list
Subject: 20081217.01.tpd.patch (padic.spad removed)

Remove padic.spad.pamphlet.
The domains have been moved to bookvol10.3

==========================================================================
diff --git a/changelog b/changelog
index 347c07b..7bc32ab 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081217 tpd src/axiom-website/patches.html 20081217.01.tpd.patch
+20081217 tpd src/algebra/padic.spad removed, move domains to bookvol10.3
 20081216 tpd src/axiom-website/patches.html 20081216.04.tpd.patch
 20081216 tpd books/ps/v103anonymousfunction.ps added
 20081216 tpd books/ps/v103directproduct.ps added
diff --git a/src/algebra/padic.spad.pamphlet b/src/algebra/padic.spad.pamphlet
deleted file mode 100644
index 666ae07..0000000
--- a/src/algebra/padic.spad.pamphlet
+++ /dev/null
@@ -1,573 +0,0 @@
-\documentclass{article}
-\usepackage{axiom}
-\begin{document}
-\title{\$SPAD/src/algebra padic.spad}
-\author{Clifton J. Williamson}
-\maketitle
-\begin{abstract}
-\end{abstract}
-\eject
-\tableofcontents
-\eject
-\section{domain IPADIC InnerPAdicInteger}
-<<domain IPADIC InnerPAdicInteger>>=
-)abbrev domain IPADIC InnerPAdicInteger
-++ Author: Clifton J. Williamson
-++ Date Created: 20 August 1989
-++ Date Last Updated: 15 May 1990
-++ Basic Operations:
-++ Related Domains:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ Keywords: p-adic, completion
-++ Examples:
-++ References:
-++ Description:
-++   This domain implements Zp, the p-adic completion of the integers.
-++   This is an internal domain.
-InnerPAdicInteger(p,unBalanced?): Exports == Implementation where
-  p           : Integer
-  unBalanced? : Boolean
-  I   ==> Integer
-  NNI ==> NonNegativeInteger
-  OUT ==> OutputForm
-  L   ==> List
-  ST  ==> Stream
-  SUP ==> SparseUnivariatePolynomial
-
-  Exports ==> PAdicIntegerCategory p
-
-  Implementation ==> add
-
-    PEXPR := p :: OUT
-
-    Rep := ST I
-
-    characteristic() == 0
-    euclideanSize(x) == order(x)
-
-    stream(x:%):ST I == x pretend ST(I)
-    padic(x:ST I):% == x pretend %
-    digits x == stream x
-
-    extend(x,n) == extend(x,n + 1)$Rep
-    complete x == complete(x)$Rep
-
---     notBalanced?:() -> Boolean
---     notBalanced?() == unBalanced?
-
-    modP:I -> I
-    modP n ==
-      unBalanced? or (p = 2) => positiveRemainder(n,p)
-      symmetricRemainder(n,p)
-
-    modPInfo:I -> Record(digit:I,carry:I)
-    modPInfo n ==
-      dv := divide(n,p)
-      r0 := dv.remainder; q := dv.quotient
-      if (r := modP r0) ^= r0 then q := q + ((r0 - r) quo p)
-      [r,q]
-
-    invModP: I -> I
-    invModP n == invmod(n,p)
-
-    modulus()     == p
-    moduloP x     == (empty? x => 0; frst x)
-    quotientByP x == (empty? x => x; rst x)
-
-    approximate(x,n) ==
-      n <= 0 or empty? x => 0
-      frst x + p * approximate(rst x,n - 1)
-
-    x = y ==
-      st : ST I := stream(x - y)
-      n : I := _$streamCount$Lisp
-      for i in 0..n repeat
-        empty? st => return true
-        frst st ^= 0 => return false
-        st := rst st
-      empty? st
-
-    order x ==
-      st := stream x
-      for i in 0..1000 repeat
-        empty? st => return 0
-        frst st ^= 0 => return i
-        st := rst st
-      error "order: series has more than 1000 leading zero coefs"
-
-    0 == padic concat(0$I,empty())
-    1 == padic concat(1$I,empty())
-
-    intToPAdic: I -> ST I
-    intToPAdic n == delay
-      n = 0 => empty()
-      modp := modPInfo n
-      concat(modp.digit,intToPAdic modp.carry)
-
-    intPlusPAdic: (I,ST I) -> ST I
-    intPlusPAdic(n,x) == delay
-      empty? x => intToPAdic n
-      modp := modPInfo(n + frst x)
-      concat(modp.digit,intPlusPAdic(modp.carry,rst x))
-
-    intMinusPAdic: (I,ST I) -> ST I
-    intMinusPAdic(n,x) == delay
-      empty? x => intToPAdic n
-      modp := modPInfo(n - frst x)
-      concat(modp.digit,intMinusPAdic(modp.carry,rst x))
-
-    plusAux: (I,ST I,ST I) -> ST I
-    plusAux(n,x,y) == delay
-      empty? x and empty? y => intToPAdic n
-      empty? x => intPlusPAdic(n,y)
-      empty? y => intPlusPAdic(n,x)
-      modp := modPInfo(n + frst x + frst y)
-      concat(modp.digit,plusAux(modp.carry,rst x,rst y))
-
-    minusAux: (I,ST I,ST I) -> ST I
-    minusAux(n,x,y) == delay
-      empty? x and empty? y => intToPAdic n
-      empty? x => intMinusPAdic(n,y)
-      empty? y => intPlusPAdic(n,x)
-      modp := modPInfo(n + frst x - frst y)
-      concat(modp.digit,minusAux(modp.carry,rst x,rst y))
-
-    x + y == padic plusAux(0,stream x,stream y)
-    x - y == padic minusAux(0,stream x,stream y)
-    - y   == padic intMinusPAdic(0,stream y)
-    coerce(n:I) == padic intToPAdic n
-
-    intMult:(I,ST I) -> ST I
-    intMult(n,x) == delay
-      empty? x => empty()
-      modp := modPInfo(n * frst x)
-      concat(modp.digit,intPlusPAdic(modp.carry,intMult(n,rst x)))
-
-    (n:I) * (x:%) ==
-      padic intMult(n,stream x)
-
-    timesAux:(ST I,ST I) -> ST I
-    timesAux(x,y) == delay
-      empty? x or empty? y => empty()
-      modp := modPInfo(frst x * frst y)
-      car := modp.digit
-      cdr : ST I --!!
-      cdr := plusAux(modp.carry,intMult(frst x,rst y),timesAux(rst x,y))
-      concat(car,cdr)
-
-    (x:%) * (y:%) == padic timesAux(stream x,stream y)
-
-    quotientAux:(ST I,ST I) -> ST I
-    quotientAux(x,y) == delay
-      empty? x => error "quotientAux: first argument"
-      empty? y => empty()
-      modP frst x = 0 =>
-        modP frst y = 0 => quotientAux(rst x,rst y)
-        error "quotient: quotient not integral"
-      z0 := modP(invModP frst x * frst y)
-      yy : ST I --!!
-      yy := rest minusAux(0,y,intMult(z0,x))
-      concat(z0,quotientAux(x,yy))
-
-    recip x ==
-      empty? x or modP frst x = 0 => "failed"
-      padic quotientAux(stream x,concat(1,empty()))
-
-    iExquo: (%,%,I) -> Union(%,"failed")
-    iExquo(xx,yy,n) ==
-      n > 1000 =>
-        error "exquo: quotient by series with many leading zero coefs"
-      empty? yy => "failed"
-      empty? xx => 0
-      zero? frst yy =>
-        zero? frst xx => iExquo(rst xx,rst yy,n + 1)
-        "failed"
-      (rec := recip yy) case "failed" => "failed"
-      xx * (rec :: %)
-
-    x exquo y == iExquo(stream x,stream y,0)
-
-    divide(x,y) ==
-      (z:=x exquo y) case "failed" => [0,x]
-      [z, 0]
-
-    iSqrt: (I,I,I,%) -> %
-    iSqrt(pn,an,bn,bSt) == delay
-      bn1 := (empty? bSt => bn; bn + pn * frst(bSt))
-      c := (bn1 - an*an) quo pn
-      aa := modP(c * invmod(2*an,p))
-      nSt := (empty? bSt => bSt; rst bSt)
-      concat(aa,iSqrt(pn*p,an + pn*aa,bn1,nSt))
-
-    sqrt(b,a) ==
-      p = 2 =>
-        error "sqrt: no square roots in Z2 yet"
-      not zero? modP(a*a - (bb := moduloP b)) =>
-        error "sqrt: not a square root (mod p)"
-      b := (empty? b => b; rst b)
-      a := modP a
-      concat(a,iSqrt(p,a,bb,b))
-
-    iRoot: (SUP I,I,I,I) -> ST I
-    iRoot(f,alpha,invFpx0,pPow) == delay
-      num := -((f(alpha) exquo pPow) :: I)
-      digit := modP(num * invFpx0)
-      concat(digit,iRoot(f,alpha + digit * pPow,invFpx0,p * pPow))
-
-    root(f,x0) ==
-      x0 := modP x0
-      not zero? modP f(x0) =>
-        error "root: not a root (mod p)"
-      fpx0 := modP (differentiate f)(x0)
-      zero? fpx0 =>
-        error "root: approximate root must be a simple root (mod p)"
-      invFpx0 := modP invModP fpx0
-      padic concat(x0,iRoot(f,x0,invFpx0,p))
-
-    termOutput:(I,I) -> OUT
-    termOutput(k,c) ==
-      k = 0 => c :: OUT
-      mon := (k = 1 => PEXPR; PEXPR ** (k :: OUT))
-      c = 1 => mon
-      c = -1 => -mon
-      (c :: OUT) * mon
-
-    showAll?:() -> Boolean
-    -- check a global Lisp variable
-    showAll?() == true
-
-    coerce(x:%):OUT ==
-      empty?(st := stream x) => 0 :: OUT
-      n : NNI ; count : NNI := _$streamCount$Lisp
-      l : L OUT := empty()
-      for n in 0..count while not empty? st repeat
-        if frst(st) ^= 0 then
-          l := concat(termOutput(n :: I,frst st),l)
-        st := rst st
-      if showAll?() then
-        for n in (count + 1).. while explicitEntries? st and _
-               not eq?(st,rst st) repeat
-          if frst(st) ^= 0 then
-            l := concat(termOutput(n pretend I,frst st),l)
-          st := rst st
-      l :=
-        explicitlyEmpty? st => l
-        eq?(st,rst st) and frst st = 0 => l
-        concat(prefix("O" :: OUT,[PEXPR ** (n :: OUT)]),l)
-      empty? l => 0 :: OUT
-      reduce("+",reverse_! l)
-
-@
-\section{domain PADIC PAdicInteger}
-<<domain PADIC PAdicInteger>>=
-)abbrev domain PADIC PAdicInteger
-++ Author: Clifton J. Williamson
-++ Date Created: 20 August 1989
-++ Date Last Updated: 15 May 1990
-++ Basic Operations:
-++ Related Domains:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ Keywords: p-adic, completion
-++ Examples:
-++ References:
-++ Description:
-++   Stream-based implementation of Zp: p-adic numbers are represented as
-++   sum(i = 0.., a[i] * p^i), where the a[i] lie in 0,1,...,(p - 1).
-PAdicInteger(p:Integer) == InnerPAdicInteger(p,true$Boolean)
-
-@
-\section{domain BPADIC BalancedPAdicInteger}
-<<domain BPADIC BalancedPAdicInteger>>=
-)abbrev domain BPADIC BalancedPAdicInteger
-++ Author: Clifton J. Williamson
-++ Date Created: 15 May 1990
-++ Date Last Updated: 15 May 1990
-++ Basic Operations:
-++ Related Domains:
-++ Also See:
-++ AMS Classifications:
-++ Keywords: p-adic, complementation
-++ Examples:
-++ References:
-++ Description:
-++   Stream-based implementation of Zp: p-adic numbers are represented as
-++   sum(i = 0.., a[i] * p^i), where the a[i] lie in -(p - 1)/2,...,(p - 1)/2.
-BalancedPAdicInteger(p:Integer) == InnerPAdicInteger(p,false$Boolean)
-
-@
-\section{domain PADICRC PAdicRationalConstructor}
-<<domain PADICRC PAdicRationalConstructor>>=
-)abbrev domain PADICRC PAdicRationalConstructor
-++ Author: Clifton J. Williamson
-++ Date Created: 10 May 1990
-++ Date Last Updated: 10 May 1990
-++ Basic Operations:
-++ Related Domains:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ Keywords: p-adic, completion
-++ Examples:
-++ References:
-++ Description: This is the category of stream-based representations of Qp.
-PAdicRationalConstructor(p,PADIC): Exports == Implementation where
-  p     :   Integer
-  PADIC :   PAdicIntegerCategory p
-  CF    ==> ContinuedFraction
-  I     ==> Integer
-  NNI   ==> NonNegativeInteger
-  OUT   ==> OutputForm
-  L     ==> List
-  RN    ==> Fraction Integer
-  ST    ==> Stream
-
-  Exports ==> QuotientFieldCategory(PADIC) with
-    approximate: (%,I) -> RN
-      ++ \spad{approximate(x,n)} returns a rational number y such that
-      ++ \spad{y = x (mod p^n)}.
-    continuedFraction: % -> CF RN
-      ++ \spad{continuedFraction(x)} converts the p-adic rational number x
-      ++ to a continued fraction.
-    removeZeroes: % -> %
-      ++ \spad{removeZeroes(x)} removes leading zeroes from the
-      ++ representation of the p-adic rational \spad{x}.
-      ++ A p-adic rational is represented by (1) an exponent and
-      ++ (2) a p-adic integer which may have leading zero digits.
-      ++ When the p-adic integer has a leading zero digit, a 'leading zero'
-      ++ is removed from the p-adic rational as follows:
-      ++ the number is rewritten by increasing the exponent by 1 and
-      ++ dividing the p-adic integer by p.
-      ++ Note: \spad{removeZeroes(f)} removes all leading zeroes from f.
-    removeZeroes: (I,%) -> %
-      ++ \spad{removeZeroes(n,x)} removes up to n leading zeroes from
-      ++ the p-adic rational \spad{x}.
-
-  Implementation ==> add
-
-    PEXPR := p :: OUT
-
---% representation
-
-    Rep := Record(expon:I,pint:PADIC)
-
-    getExpon: % -> I
-    getZp   : % -> PADIC
-    makeQp  : (I,PADIC) -> %
-
-    getExpon x    == x.expon
-    getZp x       == x.pint
-    makeQp(r,int) == [r,int]
-
---% creation
-
-    0 == makeQp(0,0)
-    1 == makeQp(0,1)
-
-    coerce(x:I)     == x :: PADIC :: %
-    coerce(r:RN)    == (numer(r) :: %)/(denom(r) :: %)
-    coerce(x:PADIC) == makeQp(0,x)
-
---% normalizations
-
-    removeZeroes x ==
-      empty? digits(xx := getZp x) => 0
-      zero? moduloP xx =>
-        removeZeroes makeQp(getExpon x + 1,quotientByP xx)
-      x
-
-    removeZeroes(n,x) ==
-      n <= 0 => x
-      empty? digits(xx := getZp x) => 0
-      zero? moduloP xx =>
-        removeZeroes(n - 1,makeQp(getExpon x + 1,quotientByP xx))
-      x
-
---% arithmetic
-
-    x = y ==
-      EQ(x,y)$Lisp => true
-      n := getExpon(x) - getExpon(y)
-      n >= 0 =>
-        (p**(n :: NNI) * getZp(x)) = getZp(y)
-      (p**((- n) :: NNI) * getZp(y)) = getZp(x)
-
-    x + y ==
-      n := getExpon(x) - getExpon(y)
-      n >= 0 =>
-        makeQp(getExpon y,getZp(y) + p**(n :: NNI) * getZp(x))
-      makeQp(getExpon x,getZp(x) + p**((-n) :: NNI) * getZp(y))
-
-    -x == makeQp(getExpon x,-getZp(x))
-
-    x - y ==
-      n := getExpon(x) - getExpon(y)
-      n >= 0 =>
-        makeQp(getExpon y,p**(n :: NNI) * getZp(x) - getZp(y))
-      makeQp(getExpon x,getZp(x) - p**((-n) :: NNI) * getZp(y))
-
-    n:I * x:% == makeQp(getExpon x,n * getZp x)
-    x:% * y:% == makeQp(getExpon x + getExpon y,getZp x * getZp y)
-
-    x:% ** n:I ==
-      zero? n => 1
-      positive? n => expt(x,n :: PositiveInteger)$RepeatedSquaring(%)
-      inv expt(x,(-n) :: PositiveInteger)$RepeatedSquaring(%)
-
-    recip x ==
-      x := removeZeroes(1000,x)
-      zero? moduloP(xx := getZp x) => "failed"
-      (inv := recip xx) case "failed" => "failed"
-      makeQp(- getExpon x,inv :: PADIC)
-
-    inv x ==
-      (inv := recip x) case "failed" => error "inv: no inverse"
-      inv :: %
-
-    x:% / y:% == x * inv y
-    x:PADIC / y:PADIC == (x :: %) / (y :: %)
-    x:PADIC * y:% == makeQp(getExpon y,x * getZp y)
-
-    approximate(x,n) ==
-      k := getExpon x
-      (p :: RN) ** k * approximate(getZp x,n - k)
-
-    cfStream: % -> Stream RN
-    cfStream x == delay
---    zero? x => empty()
-      invx := inv x; x0 := approximate(invx,1)
-      concat(x0,cfStream(invx - (x0 :: %)))
-
-    continuedFraction x ==
-      x0 := approximate(x,1)
-      reducedContinuedFraction(x0,cfStream(x - (x0 :: %)))
-
-    termOutput:(I,I) -> OUT
-    termOutput(k,c) ==
-      k = 0 => c :: OUT
-      mon := (k = 1 => PEXPR; PEXPR ** (k :: OUT))
-      c = 1 => mon
-      c = -1 => -mon
-      (c :: OUT) * mon
-
-    showAll?:() -> Boolean
-    -- check a global Lisp variable
-    showAll?() == true
-
-    coerce(x:%):OUT ==
-      x := removeZeroes(_$streamCount$Lisp,x)
-      m := getExpon x; zp := getZp x
-      uu := digits zp
-      l : L OUT := empty()
-      empty? uu => 0 :: OUT
-      n : NNI ; count : NNI := _$streamCount$Lisp
-      for n in 0..count while not empty? uu repeat
-        if frst(uu) ^= 0 then
-          l := concat(termOutput((n :: I) + m,frst(uu)),l)
-        uu := rst uu
-      if showAll?() then
-        for n in (count + 1).. while explicitEntries? uu and _
-               not eq?(uu,rst uu) repeat
-          if frst(uu) ^= 0 then
-            l := concat(termOutput((n::I) + m,frst(uu)),l)
-          uu := rst uu
-      l :=
-        explicitlyEmpty? uu => l
-        eq?(uu,rst uu) and frst uu = 0 => l
-        concat(prefix("O" :: OUT,[PEXPR ** ((n :: I) + m) :: OUT]),l)
-      empty? l => 0 :: OUT
-      reduce("+",reverse_! l)
-
-@
-\section{domain PADICRAT PAdicRational}
-<<domain PADICRAT PAdicRational>>=
-)abbrev domain PADICRAT PAdicRational
-++ Author: Clifton J. Williamson
-++ Date Created: 15 May 1990
-++ Date Last Updated: 15 May 1990
-++ Keywords: p-adic, complementation
-++ Basic Operations:
-++ Related Domains:
-++ Also See:
-++ AMS Classifications:
-++ Keywords: p-adic, completion
-++ Examples:
-++ References:
-++ Description:
-++   Stream-based implementation of Qp: numbers are represented as
-++   sum(i = k.., a[i] * p^i) where the a[i] lie in 0,1,...,(p - 1).
-PAdicRational(p:Integer) == PAdicRationalConstructor(p,PAdicInteger p)
-
-@
-\section{domain BPADICRT BalancedPAdicRational}
-<<domain BPADICRT BalancedPAdicRational>>=
-)abbrev domain BPADICRT BalancedPAdicRational
-++ Author: Clifton J. Williamson
-++ Date Created: 15 May 1990
-++ Date Last Updated: 15 May 1990
-++ Keywords: p-adic, complementation
-++ Basic Operations:
-++ Related Domains:
-++ Also See:
-++ AMS Classifications:
-++ Keywords: p-adic, completion
-++ Examples:
-++ References:
-++ Description:
-++   Stream-based implementation of Qp: numbers are represented as
-++   sum(i = k.., a[i] * p^i), where the a[i] lie in -(p - 1)/2,...,(p - 1)/2.
-BalancedPAdicRational(p:Integer) ==
-  PAdicRationalConstructor(p,BalancedPAdicInteger p)
-
-@
-\section{License}
-<<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.
-@
-<<*>>=
-<<license>>
-
-<<domain IPADIC InnerPAdicInteger>>
-<<domain PADIC PAdicInteger>>
-<<domain BPADIC BalancedPAdicInteger>>
-<<domain PADICRC PAdicRationalConstructor>>
-<<domain PADICRAT PAdicRational>>
-<<domain BPADICRT BalancedPAdicRational>>
-@
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index a7c066a..3189281 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -815,6 +815,8 @@ biquat.input fix regression failure<br/>
 bookvol10.3 add domains<br/>
 <a href="patches/20081216.04.tpd.patch">20081216.04.tpd.patch</a>
 bookvol10.3 add domains<br/>
+<a href="patches/20081217.01.tpd.patch">20081217.01.tpd.patch</a>
+padic.spad removed<br/>
 
  </body>
 </html>
\ No newline at end of file

\start
Date: Thu, 18 Dec 2008 00:31:38 -0600
From: Tim Daly
To: list
Subject: 20081217.02.tpd.patch (add guess package)

Add Martin Rubey's Guess package to build process
==========================
==========================
=====================
diff --git a/books/bookvol10.3.pamphlet b/books/bookvol10.3.pamphlet
index 4a12546..7d78657 100644
--- a/books/bookvol10.3.pamphlet
+++ b/books/bookvol10.3.pamphlet
@@ -32337,6 +32337,151 @@ GraphImage (): Exports == Implementation wh=
ere

 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%=
%
+\section{domain GOPT GuessOption}
+\pagehead{GuessOption}{GOPT}
+\pagepic{ps/v103guessoption.ps}{GOPT}{1.00}
+<<domain GOPT GuessOption>>=
+)abbrev domain GOPT GuessOption
+++ Author: Martin Rubey
+++ Description: GuessOption is a domain whose elements are various optio=
ns used
+++ by \spadtype{Guess}.
+GuessOption(): Exports == Implementation where
+
+  Exports == SetCategory with
+
+    maxDerivative: Integer -> %
+      ++ maxDerivative(d) specifies the maximum derivative in an algebra=
ic
+      ++ differential equation. maxDerivative(-1) specifies that the max=
imum
+      ++ derivative can be arbitrary. This option is expressed in the fo=
rm
+      ++ \spad{maxDerivative == d}.
+
+    maxShift: Integer -> %
+      ++ maxShift(d) specifies the maximum shift in a recurrence
+      ++ equation. maxShift(-1) specifies that the maximum shift can be
+      ++ arbitrary. This option is expressed in the form \spad{maxShift =
== d}.
+
+    maxPower: Integer -> %
+      ++ maxPower(d) specifies the maximum degree in an algebraic differ=
ential
+      ++ equation. For example, the degree of (f'')^3 f' is 4. maxPower(=
-1)
+      ++ specifies that the maximum exponent can be arbitrary. This opti=
on is
+      ++ expressed in the form \spad{maxPower == d}.
+
+    homogeneous: Boolean -> %
+      ++ homogeneous(d) specifies whether we allow only homogeneous alge=
braic
+      ++ differential equations. This option is expressed in the form
+      ++ \spad{homogeneous == d}.
+
+    maxLevel: Integer -> %
+      ++ maxLevel(d) specifies the maximum number of recursion levels op=
erators
+      ++ guessProduct and guessSum will be applied.  maxLevel(-1) specif=
ies
+      ++ that all levels are tried. This option is expressed in the form
+      ++ \spad{maxLevel == d}.
+
+    maxDegree: Integer -> %
+      ++ maxDegree(d) specifies the maximum degree of the coefficient
+      ++ polynomials in an algebraic differential equation or a recursio=
n with
+      ++ polynomial coefficients. For rational functions with an exponen=
tial
+      ++ term, \spad{maxDegree} bounds the degree of the denominator
+      ++ polynomial.
+      ++ maxDegree(-1) specifies that the maximum
+      ++ degree can be arbitrary. This option is expressed in the form
+      ++ \spad{maxDegree == d}.
+
+    allDegrees: Boolean -> %
+      ++ allDegrees(d) specifies whether all possibilities of the degree=
 vector
+      ++ - taking into account maxDegree - should be tried. This is main=
ly
+      ++ interesting for rational interpolation. This option is expresse=
d in
+      ++ the form \spad{allDegrees == d}.
+
+    safety: NonNegativeInteger -> %
+      ++ safety(d) specifies the number of values reserved for testing a=
ny
+      ++ solutions found. This option is expressed in the form \spad{saf=
ety ==
+      ++ d}.
+
+    one: Boolean -> %
+      ++ one(d) specifies whether we are happy with one solution. This o=
ption
+      ++ is expressed in the form \spad{one == d}.
+
+    debug: Boolean -> %
+      ++ debug(d) specifies whether we want additional output on the
+      ++ progress. This option is expressed in the form \spad{debug ===
 d}.
+
+    functionName: Symbol -> %
+      ++ functionName(d) specifies the name of the function given by the
+      ++ algebraic differential equation or recurrence. This option is
+      ++ expressed in the form \spad{functionName == d}.
+
+    variableName: Symbol -> %
+      ++ variableName(d) specifies the variable used in by the algebraic
+      ++ differential equation. This option is expressed in the form
+      ++ \spad{variableName == d}.
+
+    indexName: Symbol -> %
+      ++ indexName(d) specifies the index variable used for the formulas=
. This
+      ++ option is expressed in the form \spad{indexName == d}.
+
+    displayAsGF: Boolean -> %
+      ++ displayAsGF(d) specifies whether the result is a generating fun=
ction
+      ++ or a recurrence. This option should not be set by the user, but=
 rather
+      ++ by the HP-specification.
+
+    option : (List %, Symbol) -> Union(Any, "failed")
+      ++ option() is not to be used at the top level;
+      ++ option determines internally which drawing options are indicate=
d in
+      ++ a draw command.
+
+    option?: (List %, Symbol) -> Boolean
+      ++ option?() is not to be used at the top level;
+      ++ option? internally returns true for drawing options which are
+      ++ indicated in a draw command, or false for those which are not.
+
+    checkOptions: List % -> Void
+      ++ checkOptions checks whether an option is given twice
+
+  Implementation ==> add
+    import AnyFunctions1(Boolean)
+    import AnyFunctions1(Symbol)
+    import AnyFunctions1(Integer)
+    import AnyFunctions1(NonNegativeInteger)
+
+    Rep := Record(keyword: Symbol, value: Any)
+
+    maxLevel d      == ["maxLevel"::Symbol,      d::Any]
+    maxDerivative d == ["maxDerivative"::Symbol, d::Any]
+    maxShift d      == maxDerivative d
+    maxDegree d     == ["maxDegree"::Symbol,     d::Any]
+    allDegrees d    == ["allDegrees"::Symbol,    d::Any]
+    maxPower d      == ["maxPower"::Symbol,      d::Any]
+    safety d        == ["safety"::Symbol,        d::Any]
+    homogeneous d   == ["homogeneous"::Symbol,   d::Any]
+    debug d         == ["debug"::Symbol,         d::Any]
+    one d           == ["one"::Symbol,           d::Any]
+    functionName d  == ["functionName"::Symbol,  d::Any]
+    variableName d  == ["variableName"::Symbol,  d::Any]
+    indexName d     == ["indexName"::Symbol,     d::Any]
+    displayAsGF d   == ["displayAsGF"::Symbol,   d::Any]
+
+    coerce(x:%):OutputForm == x.keyword::OutputForm = x.value::Out=
putForm
+    x:% = y:%              == x.keyword = y.keyword and x.value =
= y.value
+
+    option?(l, s) ==
+      for x in l repeat
+        x.keyword = s => return true
+      false
+
+    option(l, s) ==
+      for x in l repeat
+        x.keyword = s => return(x.value)
+      "failed"
+
+    checkOptions l ==
+      if not empty? l then
+        if find((first l).keyword = #1.keyword, rest l) case "failed"
+        then checkOptions rest l
+        else error "GuessOption: Option specified twice"
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%=
%
 \chapter{Chapter H}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%=
%
 \section{domain HASHTBL HashTable}
@@ -69807,11 +69952,13 @@ SparseUnivariatePolynomial(R:Ring): UnivariateP=
olynomialCategory(R) with
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%=
%
 \section{domain SUPEXPR SparseUnivariatePolynomialExpressions}
+
 This domain is a hack, in some sense. What I'd really like to do -
 automatically - is to provide all operations supported by the coefficien=
t
 domain, as long as the polynomials can be retracted to that domain, i.e.=
, as
 long as they are just constants. I don't see another way to do this,
 unfortunately.
+
 \pagehead{SparseUnivariatePolynomialExpressions}{SUPEXPR}
 \pagepic{ps/v103sparseunivariatepolynomialexpressions.ps}{SUPEXPR}{1.00}
 <<domain SUPEXPR SparseUnivariatePolynomialExpressions>>=
@@ -69826,6 +69973,11 @@ SparseUnivariatePolynomialExpressions(R: Ring): =
Exports == Implementation where
     Implementation == SparseUnivariatePolynomial R add

         if R has TranscendentalFunctionCategory then
+            log(p: %): % ==
+                ground? p => coerce log ground p
+                output(hconcat("log p for p= ", p::OutputForm))$Output=
Package
+                error "SUPTRAFUN: log only defined for elements of the c=
oefficient ring"
+
             exp(p: %): % ==
                 ground? p => coerce exp ground p
                 output(hconcat("exp p for p= ", p::OutputForm))$Output=
Package
@@ -80133,6 +80285,16 @@ TwoDimensionalViewport ():Exports == Impleme=
ntation where
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%=
%
 \chapter{Chapter U}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%=
%
+\section{domain UFPS UnivariateFormalPowerSeries}
+\pagehead{UnivariateFormalPowerSeries}{UFPS}
+\pagepic{ps/v103univariateformalpowerseries.ps}{UFPS}{1.00}
+<<domain UFPS UnivariateFormalPowerSeries>>=
+)abbrev domain UFPS UnivariateFormalPowerSeries
+UnivariateFormalPowerSeries(Coef: Ring) ==
+    UnivariateTaylorSeries(Coef, 'x, 0$Coef)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%=
%
 \section{domain ULS UnivariateLaurentSeries}
 \pagehead{UnivariateLaurentSeries}{ULS}
 \pagepic{ps/v103univariatelaurentseries.ps}{ULS}{1.00}
@@ -91111,6 +91273,7 @@ Note that this code is not included in the genera=
ted catdef.spad file.
 <<domain GTSET GeneralTriangularSet>>
 <<domain GSERIES GeneralUnivariatePowerSeries>>
 <<domain GRIMAGE GraphImage>>
+<<domain GOPT GuessOption>>

 <<domain HASHTBL HashTable>>
 <<domain HEAP Heap>>
@@ -91321,6 +91484,7 @@ Note that this code is not included in the genera=
ted catdef.spad file.
 <<domain ARRAY2 TwoDimensionalArray>>
 <<domain VIEW2D TwoDimensionalViewport>>

+<<domain UFPS UnivariateFormalPowerSeries>>
 <<domain ULS UnivariateLaurentSeries>>
 <<domain ULSCONS UnivariateLaurentSeriesConstructor>>
 <<domain UP UnivariatePolynomial>>
diff --git a/changelog b/changelog
index 7bc32ab..1e0a9cf 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,14 @@
+20081217 tpd src/axiom-website/patches.html 20081217.02.tpd.patch
+20081217 tpd src/input/ndftip.input fix regression on map operation coun=
t
+20081217 tpd src/algebra/Makefile remove wtpol.spad
+20081217 tpd src/algebra/mantepse.spad move domains to bookvol10.3
+20081217 tpd src/algebra/ssolve.spad move domain to bookvol10.3
+20081217 tpd src/algebra/ssolve.spad add guess package code
+20081217 tpd src/algebra/rec.spad add guess package code
+20081217 tpd src/algebra/mantepse.spad add guess package code
+20081217 tpd src/algebra/Makefile add guess package code
+20081217 tpd src/algebra/fffg.spad add guess package code
+20081217 tpd src/algebra/exposed.lsp add guess package code
 20081217 tpd src/axiom-website/patches.html 20081217.01.tpd.patch
 20081217 tpd src/algebra/padic.spad removed, move domains to bookvol10.3
 20081216 tpd src/axiom-website/patches.html 20081216.04.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphle=
t
index 22de514..ce9ddba 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -422,7 +422,9 @@ xlpoly.spad.pamphlet (MAGMA LWORD LIECAT FLALG XEXPPK=
G LPOLY PBWLB XPBWPOLY
 LAYER11=\
   ${OUT}/APPLYORE.o ${OUT}/ARRAY1.o   ${OUT}/ARRAY12.o  ${OUT}/ARRAY2.o =
  \
   ${OUT}/ASTACK.o   ${OUT}/BTAGG.o    ${OUT}/BTAGG-.o   ${OUT}/COMBINAT.=
o \
-  ${OUT}/CSTTOOLS.o ${OUT}/D01FCFA.o  ${OUT}/E04MBFA.o  ${OUT}/FARRAY.o =
  \
+  ${OUT}/CSTTOOLS.o ${OUT}/D01FCFA.o  ${OUT}/E04MBFA.o  \
+  ${OUT}/FAMR2.o \
+  ${OUT}/FARRAY.o   \
   ${OUT}/FLALG.o    ${OUT}/GALUTIL.o  ${OUT}/HEAP.o     ${OUT}/IARRAY1.o=
  \
   ${OUT}/IARRAY2.o  ${OUT}/IFARRAY.o  ${OUT}/INTCAT.o   ${OUT}/INTHEORY.=
o \
   ${OUT}/IRREDFFX.o ${OUT}/LFCAT.o    ${OUT}/LODOCAT.o  ${OUT}/LODOCAT-.=
o \
@@ -579,7 +581,8 @@ LAYER14=\
   ${OUT}/D01AQFA.o  ${OUT}/EMR.o      ${OUT}/EQ.o       ${OUT}/ERROR.o  =
  \
   ${OUT}/EVALCYC.o  ${OUT}/E04DGFA.o  ${OUT}/E04FDFA.o  ${OUT}/E04GCFA.o=
  \
   ${OUT}/E04JAFA.o  ${OUT}/FACUTIL.o  ${OUT}/FF.o       ${OUT}/FFCG.o   =
  \
-  ${OUT}/FFCGX.o    ${OUT}/FFHOM.o    ${OUT}/FFNB.o     ${OUT}/FFNBX.o  =
  \
+  ${OUT}/FFCGX.o    ${OUT}/FFFG.o \
+  ${OUT}/FFHOM.o    ${OUT}/FFNB.o     ${OUT}/FFNBX.o    \
   ${OUT}/FFPOLY.o   ${OUT}/FFX.o      ${OUT}/FFSLPE.o   ${OUT}/FGLMICPK.=
o \
   ${OUT}/FILE.o     ${OUT}/FINAALG.o  ${OUT}/FINAALG-.o ${OUT}/FINRALG.o=
  \
   ${OUT}/FINRALG-.o ${OUT}/FFF.o      ${OUT}/FLOATRP.o  ${OUT}/FNAME.o  =
  \
@@ -616,7 +619,8 @@ LAYER14=\
   ${OUT}/SCPKG.o    ${OUT}/SHDP.o     ${OUT}/SHP.o      ${OUT}/SIGNRF.o =
  \
   ${OUT}/SMITH.o    ${OUT}/SMP.o      ${OUT}/SMTS.o     ${OUT}/SOLVEFOR.=
o \
   ${OUT}/SPLTREE.o  ${OUT}/STINPROD.o ${OUT}/STTFNC.o   ${OUT}/SUBRESP.o=
  \
-  ${OUT}/SUMRF.o    ${OUT}/SUP.o      ${OUT}/SUPFRACF.o ${OUT}/TANEXP.o =
  \
+  ${OUT}/SUMRF.o    ${OUT}/SUP.o      ${OUT}/SUPEXPR.o \
+  ${OUT}/SUPFRACF.o ${OUT}/TANEXP.o   \
   ${OUT}/TEMUTL.o   ${OUT}/TEX.o      ${OUT}/TEXTFILE.o ${OUT}/TREE.o   =
  \
   ${OUT}/TWOFACT.o  ${OUT}/UNIFACT.o  ${OUT}/UP.o       ${OUT}/UPCDEN.o =
  \
   ${OUT}/UPDECOMP.o ${OUT}/UPDIVP.o   ${OUT}/UPMP.o     ${OUT}/UPOLYC2.o=
  \
@@ -635,6 +639,7 @@ plot.spad.pamphlet (PLOT PLOT1)

 LAYER15=\
   ${OUT}/DIAGG.o   ${OUT}/DIAGG-.o   ${OUT}/DSMP.o     ${OUT}/EXPUPXS.o =
\
+  ${OUT}/FFFGF.o \
   ${OUT}/FRAMALG.o ${OUT}/FRAMALG-.o ${OUT}/MDAGG.o    ${OUT}/ODPOL.o   =
\
   ${OUT}/PLOT.o    ${OUT}/RMCAT2.o   ${OUT}/ROIRC.o    ${OUT}/SDPOL.o   =
\
   ${OUT}/SMATCAT.o ${OUT}/SMATCAT-.o ${OUT}/TUBETOOL.o ${OUT}/UPXSCCA.o =
\
@@ -762,7 +767,8 @@ LAYER19=\
   ${OUT}/FFCAT.o    ${OUT}/FFCAT-.o   ${OUT}/FFCGP.o    ${OUT}/FFNBP.o  =
 \
   ${OUT}/FFP.o      ${OUT}/FLOAT.o    ${OUT}/FPARFRAC.o ${OUT}/FR.o     =
 \
   ${OUT}/FRNAALG.o  ${OUT}/FRNAALG-.o ${OUT}/FS.o       ${OUT}/FS-.o    =
 \
-  ${OUT}/FST.o      ${OUT}/FUNCTION.o ${OUT}/GDMP.o     ${OUT}/HACKPI.o =
 \
+  ${OUT}/FST.o      ${OUT}/FUNCTION.o ${OUT}/GDMP.o     ${OUT}/GOPT.o   =
 \
+  ${OUT}/HACKPI.o  \
   ${OUT}/IDEAL.o    ${OUT}/INFORM.o   ${OUT}/INFORM1.o  ${OUT}/IPRNTPK.o=
 \
   ${OUT}/IR.o       ${OUT}/ISUPS.o    ${OUT}/KERNEL.o   ${OUT}/LIB.o    =
 \
   ${OUT}/LMDICT.o   ${OUT}/LODOOPS.o  ${OUT}/MATRIX.o   ${OUT}/MKFLCFN.o=
 \
@@ -865,6 +871,7 @@ LAYER20=\
   ${OUT}/FORDER.o   ${OUT}/FORTRAN.o  ${OUT}/FSRED.o    ${OUT}/FSUPFACT.=
o \
   ${OUT}/FRNAAF2.o  ${OUT}/FSPECF.o   ${OUT}/FS2.o      ${OUT}/FS2UPS.o =
  \
   ${OUT}/GAUSSFAC.o ${OUT}/GCNAALG.o  ${OUT}/GENUFACT.o ${OUT}/GENUPS.o =
  \
+  ${OUT}/GOPT0.o \
   ${OUT}/GTSET.o    ${OUT}/GPOLSET.o  ${OUT}/IAN.o      ${OUT}/INEP.o   =
  \
   ${OUT}/INFPROD0.o ${OUT}/INFSP.o    ${OUT}/INPRODFF.o ${OUT}/INPRODPF.=
o \
   ${OUT}/INTAF.o    ${OUT}/INTALG.o   ${OUT}/INTEF.o    ${OUT}/INTG0.o  =
  \
@@ -881,9 +888,10 @@ LAYER20=\
   ${OUT}/RDEEF.o    ${OUT}/RDEEFS.o   ${OUT}/RDIV.o     ${OUT}/RSETCAT.o=
  \
   ${OUT}/RSETCAT-.o ${OUT}/RULE.o     ${OUT}/RULESET.o  ${OUT}/SIMPAN.o =
  \
   ${OUT}/SFORT.o    ${OUT}/SOLVESER.o ${OUT}/SUMFS.o    ${OUT}/SUTS.o   =
  \
-  ${OUT}/TOOLSIGN.o ${OUT}/TRIGMNIP.o ${OUT}/TRMANIP.o  ${OUT}/ULSCCAT.o=
  \
+  ${OUT}/TOOLSIGN.o ${OUT}/TRIGMNIP.o ${OUT}/TRMANIP.o  ${OUT}/UFPS.o   =
  \
+  ${OUT}/ULSCCAT.o  \
   ${OUT}/ULSCCAT-.o ${OUT}/UPXSSING.o ${OUT}/UTSODE.o   ${OUT}/UTSODETL.=
o \
-  ${OUT}/UTS2.o     ${OUT}/WUTSET.o  \
+  ${OUT}/UTSSOL.o   ${OUT}/UTS2.o     ${OUT}/WUTSET.o  \
   layer20done
    
 @
@@ -918,12 +926,15 @@ taylor.spad.pamphlet (ITAYLOR UTS UTS2)

 LAYER21=\
   ${OUT}/DEFINTEF.o ${OUT}/DFINTTLS.o ${OUT}/DEFINTRF.o ${OUT}/D01TRNS.o=
  \
-  ${OUT}/EFULS.o    ${OUT}/ESCONT.o   ${OUT}/EXPR.o     ${OUT}/EXPR2UPS.=
o \
+  ${OUT}/EFULS.o    ${OUT}/ESCONT.o   ${OUT}/EXPR.o     ${OUT}/EXPRSOL.o=
 \
+  ${OUT}/EXPR2UPS.o \
   ${OUT}/FDIV.o     ${OUT}/FSCINT.o   ${OUT}/FSINT.o    ${OUT}/FS2EXPXP.=
o \
   ${OUT}/GSERIES.o  ${OUT}/HELLFDIV.o ${OUT}/INVLAPLA.o ${OUT}/IR2F.o   =
  \
   ${OUT}/IRRF2F.o   ${OUT}/LAPLACE.o  ${OUT}/LIMITPS.o  ${OUT}/LODEEF.o =
  \
-  ${OUT}/NODE1.o    ${OUT}/ODECONST.o ${OUT}/ODEINT.o   ${OUT}/REP.o    =
  \
-  ${OUT}/SOLVERAD.o ${OUT}/SULS.o     ${OUT}/SUPXS.o    ${OUT}/ULS.o    =
  \
+  ${OUT}/NODE1.o    ${OUT}/ODECONST.o ${OUT}/ODEINT.o   ${OUT}/RECOP.o  =
  \
+  ${OUT}/REP.o      \
+  ${OUT}/SOLVERAD.o ${OUT}/SULS.o     ${OUT}/SUPXS.o    ${OUT}/UFPS1.o \
+  ${OUT}/ULS.o      \
   ${OUT}/ULSCONS.o  ${OUT}/UPXS.o     ${OUT}/UPXSCONS.o ${OUT}/UTS.o \
   layer21done

@@ -949,6 +960,7 @@ zerodim.spad.pamphlet (RGCHAIN ZDSOLVE)

 LAYER22=\
   ${OUT}/ASP29.o    ${OUT}/COMBF.o    ${OUT}/D01AGNT.o  ${OUT}/FSPRMELT.=
o \
+  ${OUT}/GUESS.o \
   ${OUT}/INBFF.o    ${OUT}/LODO.o     ${OUT}/LODO1.o    ${OUT}/LODO2.o  =
  \
   ${OUT}/NTSCAT.o   ${OUT}/REGSET.o   ${OUT}/RGCHAIN.o  ${OUT}/RSETGCD.o=
  \
   ${OUT}/RSDCMPK.o  ${OUT}/SFRTCAT.o  ${OUT}/SIGNEF.o   ${OUT}/SNTSCAT.o=
  \
@@ -975,12 +987,21 @@ zerodim.spad.pamphlet (LEXTRIPK IRURPK RURPK)
 <<layer23>>=

 LAYER23=\
-  ${OUT}/CPIMA.o    ${OUT}/IRURPK.o   ${OUT}/LAZM3PK.o  ${OUT}/LEXTRIPK.=
o \
+  ${OUT}/CPIMA.o    ${OUT}/GUESSAN.o  ${OUT}/GUESSINT.o  \
+  ${OUT}/GUESSF1.o  ${OUT}/GUESSP.o   ${OUT}/GUESSUP.o \
+  ${OUT}/IRURPK.o   ${OUT}/LAZM3PK.o  ${OUT}/LEXTRIPK.o \
   ${OUT}/NORMPK.o   ${OUT}/QCMPACK.o  ${OUT}/RURPK.o    ${OUT}/SFRGCD.o =
  \
   ${OUT}/SFQCMPK.o  ${OUT}/INTRVL.o   ${OUT}/ODEEF.o \
   layer23done

 @
+<<layer24>>=
+
+LAYER24=\
+  ${OUT}/GUESSF.o \
+  layer24done
+
+@
 \subsection{User Layer for newly added algebra}
 Rather than classify newly created algebra into the existing type lattic=
e
 we add it here.
@@ -998,9 +1019,184 @@ ORDER=\
   ${LAYER4}   ${LAYER5}  ${LAYER6}  ${LAYER7}  ${LAYER8}  ${LAYER9}  \
   ${LAYER10}  ${LAYER11} ${LAYER12} ${LAYER13} ${LAYER14} ${LAYER15} \
   ${LAYER16}  ${LAYER17} ${LAYER18} ${LAYER19} ${LAYER20} ${LAYER21} \
-  ${LAYER22}  ${LAYER23} ${USERLAYER} ${LAYER0COPY}
+  ${LAYER22}  ${LAYER23} ${LAYER24} ${USERLAYER} ${LAYER0COPY}

 @
+\section{New Algebra dependencies}
+
+New algebra files can depend on new algebra files. Since these files
+are not part of the default database we need to be explicit about the
+new files being loaded with the library command.
+
+<<newcode>>=
+
+FFFGFDEPS = FAMR2 FFFG
+
+${MID}/FFFGF.nrlib/code.o: ${MID}/FFFGF.spad
+	@echo S1 making ${MID}/FFFGF.nrlib/code.o from ${MID}/FFFGF.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${FFFGFDEPS} \n )co FFFGF.spad" | ${INTERPSYS}  ; \
+           else \
+	    echo -e ")lib ${FFFGFDEPS} \n )co FFFGF.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+UTSSOLDEPS = SUPEXPR
+
+${MID}/UTSSOL.nrlib/code.o: ${MID}/UTSSOL.spad
+	@echo S1 making ${MID}/UTSSOL.nrlib/code.o from ${MID}/UTSSOL.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${UTSSOLDEPS} \n )co UTSSOL.spad" | ${INTERPSYS}  ; \
+           else \
+	    echo -e ")lib ${UTSSOLDEPS} \n )co UTSSOL.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+EXPRSOLDEPS = SUPEXPR UTSSOL
+
+${MID}/EXPRSOL.nrlib/code.o: ${MID}/EXPRSOL.spad
+	@echo S1 making ${MID}/EXPRSOL.nrlib/code.o from ${MID}/EXPRSOL.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${EXPRSOLDEPS} \n )co EXPRSOL.spad" | ${INTERPSYS}  ;=
 \
+           else \
+	    echo -e ")lib ${EXPRSOLDEPS} \n )co EXPRSOL.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+GOPT0DEPS = GOPT
+
+${MID}/GOPT0.nrlib/code.o: ${MID}/GOPT0.spad
+	@echo S1 making ${MID}/GOPT0.nrlib/code.o from ${MID}/GOPT0.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${GOPT0DEPS} \n )co GOPT0.spad" | ${INTERPSYS}  ; \
+           else \
+	    echo -e ")lib ${GOPT0DEPS} \n )co GOPT0.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+RECOPDEPS = SUPEXPR UTSSOL EXPRSOL UFPS
+
+${MID}/RECOP.nrlib/code.o: ${MID}/RECOP.spad
+	@echo S1 making ${MID}/RECOP.nrlib/code.o from ${MID}/RECOP.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${RECOPDEPS} \n )co RECOP.spad" | ${INTERPSYS}  ; \
+           else \
+	    echo -e ")lib ${RECOPDEPS} \n )co RECOP.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+UFPS1DEPS = UFPS
+
+${MID}/UFPS1.nrlib/code.o: ${MID}/UFPS1.spad
+	@echo S1 making ${MID}/UFPS1.nrlib/code.o from ${MID}/UFPS1.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${UFPS1DEPS} \n )co UFPS1.spad" | ${INTERPSYS}  ; \
+           else \
+	    echo -e ")lib ${UFPS1DEPS} \n )co UFPS1.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+GUESSDEPS = NEWTON FAMR2 FFFG FFFGF SUPEXPR UTSSOL EXPRSOL GOPT GOPT0 =
\
+            UFPS RECOP UFPS1
+
+${MID}/GUESS.nrlib/code.o: ${MID}/GUESS.spad
+	@echo S1 making ${MID}/GUESS.nrlib/code.o from ${MID}/GUESS.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${GUESSDEPS} \n )co GUESS.spad" | ${INTERPSYS}  ; \
+           else \
+	    echo -e ")lib ${GUESSDEPS} \n )co GUESS.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+GUESSINTDEPS = NEWTON FAMR2 FFFG FFFGF SUPEXPR UTSSOL EXPRSOL GOPT GOP=
T0 \
+            UFPS RECOP UFPS1 GUESS
+
+${MID}/GUESSINT.nrlib/code.o: ${MID}/GUESSINT.spad
+	@echo S1 making ${MID}/GUESSINT.nrlib/code.o from ${MID}/GUESSINT.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${GUESSINTDEPS} \n )co GUESSINT.spad" | ${INTERPSYS} =
 ; \
+           else \
+	    echo -e ")lib ${GUESSINTDEPS} \n )co GUESSINT.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+GUESSF1DEPS = NEWTON FAMR2 FFFG FFFGF SUPEXPR UTSSOL EXPRSOL GOPT GOPT=
0 \
+            UFPS RECOP UFPS1 GUESS
+
+${MID}/GUESSF1.nrlib/code.o: ${MID}/GUESSF1.spad
+	@echo S1 making ${MID}/GUESSF1.nrlib/code.o from ${MID}/GUESSF1.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${GUESSF1DEPS} \n )co GUESSF1.spad" | ${INTERPSYS}  ;=
 \
+           else \
+	    echo -e ")lib ${GUESSF1DEPS} \n )co GUESSF1.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+GUESSFDEPS = NEWTON FAMR2 FFFG FFFGF SUPEXPR UTSSOL EXPRSOL GOPT GOPT0=
 \
+            UFPS RECOP UFPS1 GUESS GUESSF1
+
+${MID}/GUESSF.nrlib/code.o: ${MID}/GUESSF.spad
+	@echo S1 making ${MID}/GUESSF.nrlib/code.o from ${MID}/GUESSF.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${GUESSFDEPS} \n )co GUESSF.spad" | ${INTERPSYS}  ; \
+           else \
+	    echo -e ")lib ${GUESSFDEPS} \n )co GUESSF.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+GUESSPDEPS = NEWTON FAMR2 FFFG FFFGF SUPEXPR UTSSOL EXPRSOL GOPT GOPT0=
 \
+            UFPS RECOP UFPS1 GUESS
+
+${MID}/GUESSP.nrlib/code.o: ${MID}/GUESSP.spad
+	@echo S1 making ${MID}/GUESSP.nrlib/code.o from ${MID}/GUESSP.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${GUESSPDEPS} \n )co GUESSP.spad" | ${INTERPSYS}  ; \
+           else \
+	    echo -e ")lib ${GUESSPDEPS} \n )co GUESSP.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+GUESSANDEPS = NEWTON FAMR2 FFFG FFFGF SUPEXPR UTSSOL EXPRSOL GOPT GOPT=
0 \
+            UFPS RECOP UFPS1 GUESS
+
+${MID}/GUESSAN.nrlib/code.o: ${MID}/GUESSAN.spad
+	@echo S1 making ${MID}/GUESSAN.nrlib/code.o from ${MID}/GUESSAN.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${GUESSANDEPS} \n )co GUESSAN.spad" | ${INTERPSYS}  ;=
 \
+           else \
+	    echo -e ")lib ${GUESSANDEPS} \n )co GUESSAN.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+GUESSUPDEPS = NEWTON FAMR2 FFFG FFFGF SUPEXPR UTSSOL EXPRSOL GOPT GOPT=
0 \
+            UFPS RECOP UFPS1 GUESS
+
+${MID}/GUESSUP.nrlib/code.o: ${MID}/GUESSUP.spad
+	@echo S1 making ${MID}/GUESSUP.nrlib/code.o from ${MID}/GUESSUP.spad
+	@ (cd ${MID} ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo -e ")lib ${GUESSUPDEPS} \n )co GUESSUP.spad" | ${INTERPSYS}  ;=
 \
+           else \
+	    echo -e ")lib ${GUESSUPDEPS} \n )co GUESSUP.spad" \
+	      | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+
+
+
+@
+
 \section{Broken Files}
 These files are Aldor files
 \begin{verbatim}
@@ -1073,6 +1269,16 @@ files.
 INTERPSYS=${OBJ}/${SYS}/bin/interpsys

 @
+\subsection{The shell variable}
+We use the ``-e'' flag to echo which is not supported by the ``sh''
+shell but is supported by ``bash''. The ``-e'' flag to echo causes
+it to interpret special characters, in our case newlines.
+
+<<environment>>=
+
+SHELL=bash
+
+@
 \subsection{The SPADFILES list}
 Note that we have excluded {\bf mlift.spad.jhd} from this list.
 We need to figure out which mlift.spad to keep.
@@ -1204,7 +1410,7 @@ SPADFILES= \
  ${OUTSRC}/viewdef.spad ${OUTSRC}/viewpack.spad \
  ${OUTSRC}/void.spad \
  ${OUTSRC}/weier.spad \
- ${OUTSRC}/xlpoly.spad  \
+ ${OUTSRC}/xlpoly.spad \
  ${OUTSRC}/ystream.spad \
  ${OUTSRC}/zerodim.spad

@@ -1356,7 +1562,7 @@ DOCFILES= \
  ${DOC}/viewdef.spad.dvi ${DOC}/viewpack.spad.dvi \
  ${DOC}/void.spad.dvi \
  ${DOC}/weier.spad.dvi \
- ${DOC}/xlpoly.spad.dvi  \
+ ${DOC}/xlpoly.spad.dvi \
  ${DOC}/ystream.spad.dvi \
  ${DOC}/zerodim.spad.dvi

@@ -1729,122 +1935,127 @@ layer0copy:

 layer0done:
 	@ echo =======================
============
-	@ echo === layer  0 of 23 complete ======
+	@ echo === layer  0 of 24 complete ======
 	@ echo =======================
============

 layer1done:
 	@ echo =======================
============
-	@ echo === layer  1 of 23 complete ======
+	@ echo === layer  1 of 24 complete ======
 	@ echo =======================
============

 layer2done:
 	@ echo =======================
============
-	@ echo === layer  2 of 23 complete ======
+	@ echo === layer  2 of 24 complete ======
 	@ echo =======================
============

 layer3done:
 	@ echo =======================
============
-	@ echo === layer  3 of 23 complete ======
+	@ echo === layer  3 of 24 complete ======
 	@ echo =======================
============

 layer4done:
 	@ echo =======================
============
-	@ echo === layer  4 of 23 complete ======
+	@ echo === layer  4 of 24 complete ======
 	@ echo =======================
============

 layer5done:
 	@ echo =======================
============
-	@ echo === layer  5 of 23 complete ======
+	@ echo === layer  5 of 24 complete ======
 	@ echo =======================
============

 layer6done:
 	@ echo =======================
============
-	@ echo === layer  6 of 23 complete ======
+	@ echo === layer  6 of 24 complete ======
 	@ echo =======================
============

 layer7done:
 	@ echo =======================
============
-	@ echo === layer  7 of 23 complete ======
+	@ echo === layer  7 of 24 complete ======
 	@ echo =======================
============

 layer8done:
 	@ echo =======================
============
-	@ echo === layer  8 of 23 complete ======
+	@ echo === layer  8 of 24 complete ======
 	@ echo =======================
============

 layer9done:
 	@ echo =======================
============
-	@ echo === layer 9 of 23 complete ======
+	@ echo === layer 9 of 24 complete ======
 	@ echo =======================
============

 layer10done:
 	@ echo =======================
============
-	@ echo === layer 10 of 23 complete ======
+	@ echo === layer 10 of 24 complete ======
 	@ echo =======================
============

 layer11done:
 	@ echo =======================
============
-	@ echo === layer 11 of 23 complete ======
+	@ echo === layer 11 of 24 complete ======
 	@ echo =======================
============

 layer12done:
 	@ echo =======================
============
-	@ echo === layer 12 of 23 complete ======
+	@ echo === layer 12 of 24 complete ======
 	@ echo =======================
============

 layer13done:
 	@ echo =======================
============
-	@ echo === layer 13 of 23 complete ======
+	@ echo === layer 13 of 24 complete ======
 	@ echo =======================
============

 layer14done:
 	@ echo =======================
============
-	@ echo === layer 14 of 23 complete ======
+	@ echo === layer 14 of 24 complete ======
 	@ echo =======================
============

 layer15done:
 	@ echo =======================
============
-	@ echo === layer 15 of 23 complete ======
+	@ echo === layer 15 of 24 complete ======
 	@ echo =======================
============

 layer16done:
 	@ echo =======================
============
-	@ echo === layer 16 of 23 complete ======
+	@ echo === layer 16 of 24 complete ======
 	@ echo =======================
============

 layer17done:
 	@ echo =======================
============
-	@ echo === layer 17 of 23 complete ======
+	@ echo === layer 17 of 24 complete ======
 	@ echo =======================
============

 layer18done:
 	@ echo =======================
============
-	@ echo === layer 18 of 23 complete ======
+	@ echo === layer 18 of 24 complete ======
 	@ echo =======================
============

 layer19done:
 	@ echo =======================
============
-	@ echo === layer 19 of 23 complete ======
+	@ echo === layer 19 of 24 complete ======
 	@ echo =======================
============

 layer20done:
 	@ echo =======================
============
-	@ echo === layer 20 of 23 complete ======
+	@ echo === layer 20 of 24 complete ======
 	@ echo =======================
============

 layer21done:
 	@ echo =======================
============
-	@ echo === layer 21 of 23 complete ======
+	@ echo === layer 21 of 24 complete ======
 	@ echo =======================
============

 layer22done:
 	@ echo =======================
============
-	@ echo === layer 22 of 23 complete ======
+	@ echo === layer 22 of 24 complete ======
 	@ echo =======================
============

 layer23done:
 	@ echo =======================
============
-	@ echo === layer 23 of 23 complete ======
+	@ echo === layer 23 of 24 complete ======
+	@ echo =======================
============
+
+layer24done:
+	@ echo =======================
============
+	@ echo === layer 24 of 24 complete ======
 	@ echo =======================
============

 @
@@ -2476,18 +2687,23 @@ ${HELP}/Library.help: ${BOOKS}/bookvol10.3.pamphl=
et
 ${HELP}/LieExponentials.help: ${BOOKS}/bookvol10.3.pamphlet
 	@echo 7040 create LieExponentials.help from \
            ${BOOKS}/bookvol10.3.pamphlet
-	@${TANGLE} -R"LieExponentials.help" ${BOOKS}/bookvol10.3.pamphlet \
+	@${TANGLE} -R"LieExponentials.help" \
+           ${BOOKS}/bookvol10.3.pamphlet \
            >${HELP}/LieExponentials.help
 	@cp ${HELP}/LieExponentials.help ${HELP}/LEXP.help
-	@${TANGLE} -R"LieExponentials.input" ${BOOKS}/bookvol10.3.pamphlet \
+	@${TANGLE} -R"LieExponentials.input" \
+            ${BOOKS}/bookvol10.3.pamphlet \
             >${INPUT}/LieExponentials.input

 ${HELP}/LiePolynomial.help: ${BOOKS}/bookvol10.3.pamphlet
-	@echo 7041 create LiePolynomial.help from ${BOOKS}/bookvol10.3.pamphlet
-	@${TANGLE} -R"LiePolynomial.help" ${BOOKS}/bookvol10.3.pamphlet \
+	@echo 7041 create LiePolynomial.help from \
+           ${BOOKS}/bookvol10.3.pamphlet
+	@${TANGLE} -R"LiePolynomial.help" \
+           ${BOOKS}/bookvol10.3.pamphlet \
            >${HELP}/LiePolynomial.help
 	@cp ${HELP}/LiePolynomial.help ${HELP}/LPOLY.help
-	@${TANGLE} -R"LiePolynomial.input" ${BOOKS}/bookvol10.3.pamphlet \
+	@${TANGLE} -R"LiePolynomial.input" \
+            ${BOOKS}/bookvol10.3.pamphlet \
             >${INPUT}/LiePolynomial.input

 ${HELP}/LinearOrdinaryDifferentialOperator.help: ${BOOKS}/bookvol10.3.pa=
mphlet
@@ -2534,19 +2750,25 @@ ${HELP}/List.help: ${BOOKS}/bookvol10.3.pamphlet
             >${INPUT}/List.input

 ${HELP}/LyndonWord.help: ${BOOKS}/bookvol10.3.pamphlet
-	@echo 7046 create LyndonWord.help from ${BOOKS}/bookvol10.3.pamphlet
-	@${TANGLE} -R"LyndonWord.help" ${BOOKS}/bookvol10.3.pamphlet \
+	@echo 7046 create LyndonWord.help from \
+            ${BOOKS}/bookvol10.3.pamphlet
+	@${TANGLE} -R"LyndonWord.help" \
+            ${BOOKS}/bookvol10.3.pamphlet \
             >${HELP}/LyndonWord.help
 	@cp ${HELP}/LyndonWord.help ${HELP}/LWORD.help
-	@${TANGLE} -R"LyndonWord.input" ${BOOKS}/bookvol10.3.pamphlet \
+	@${TANGLE} -R"LyndonWord.input" \
+            ${BOOKS}/bookvol10.3.pamphlet \
             >${INPUT}/LyndonWord.input

-${HELP}/Magma.help: ${BOOKS}/bookvol10.3.pamphlet
-	@echo 7047 create Magma.help from ${BOOKS}/bookvol10.3.pamphlet
-	@${TANGLE} -R"Magma.help" ${BOOKS}/bookvol10.3.pamphlet  \
+${HELP}/Magma.help: ${BOOKS}/bookvol10.3.pamphlet
+	@echo 7047 create Magma.help from \
+            ${BOOKS}/bookvol10.3.pamphlet
+	@${TANGLE} -R"Magma.help" \
+            ${BOOKS}/bookvol10.3.pamphlet \
             >${HELP}/Magma.help
 	@-cp ${HELP}/Magma.help ${HELP}/MAGMA.help
-	@${TANGLE} -R"Magma.input" ${BOOKS}/bookvol10.3.pamphlet  \
+	@${TANGLE} -R"Magma.input" \
+            ${BOOKS}/bookvol10.3.pamphlet \
             >${INPUT}/Magma.input

 ${HELP}/MakeFunction.help: ${IN}/mkfunc.spad.pamphlet
@@ -2954,20 +3176,25 @@ ${HELP}/XPBWPolynomial.help: ${BOOKS}/bookvol10.3=
.pamphlet
             >${INPUT}/XPBWPolynomial.input

 ${HELP}/XPolynomial.help: ${BOOKS}/bookvol10.3.pamphlet
-	@echo 7092 create XPolynomial.help from ${BOOKS}/bookvol10.3.pamphlet
-	@${TANGLE} -R"XPolynomial.help" ${BOOKS}/bookvol10.3.pamphlet \
+	@echo 7092 create XPolynomial.help from \
+           ${BOOKS}/bookvol10.3.pamphlet
+	@${TANGLE} -R"XPolynomial.help"  \
+           ${BOOKS}/bookvol10.3.pamphlet \
            >${HELP}/XPolynomial.help
 	@cp ${HELP}/XPolynomial.help ${HELP}/XPOLY.help
-	@${TANGLE} -R"XPolynomial.input" ${BOOKS}/bookvol10.3.pamphlet \
+	@${TANGLE} -R"XPolynomial.input" \
+            ${BOOKS}/bookvol10.3.pamphlet \
             >${INPUT}/XPolynomial.input

 ${HELP}/XPolynomialRing.help: ${BOOKS}/bookvol10.3.pamphlet
 	@echo 7093 create XPolynomialRing.help from \
            ${BOOKS}/bookvol10.3.pamphlet
-	@${TANGLE} -R"XPolynomialRing.help" ${BOOKS}/bookvol10.3.pamphlet \
+	@${TANGLE} -R"XPolynomialRing.help" \
+           ${BOOKS}/bookvol10.3.pamphlet \
            >${HELP}/XPolynomialRing.help
 	@cp ${HELP}/XPolynomialRing.help ${HELP}/XPR.help
-	@${TANGLE} -R"XPolynomialRing.input" ${BOOKS}/bookvol10.3.pamphlet \
+	@${TANGLE} -R"XPolynomialRing.input" \
+            ${BOOKS}/bookvol10.3.pamphlet \
             >${INPUT}/XPolynomialRing.input

 ${HELP}/ZeroDimensionalSolvePackage.help: ${IN}/zerodim.spad.pamphlet
@@ -3022,6 +3249,8 @@ all: src ${OUT}/libdb.text ${DOCFILES} ${SPADBIN}/i=
ndex.html \
         ${SPADHELP}
 	@ echo 4302 finished ${IN}

+<<newcode>>
+
 ${SPADBIN}/index.html:
 	@ echo 5000 making ${SPADBIN}/index.html
 	@ echo "<html><head>Axiom Algebra</head><body>" >${SPADBIN}/index.html
diff --git a/src/algebra/exposed.lsp.pamphlet b/src/algebra/exposed.lsp.p=
amphlet
index 9701e7f..a577f11 100644
--- a/src/algebra/exposed.lsp.pamphlet
+++ b/src/algebra/exposed.lsp.pamphlet
@@ -160,6 +160,12 @@
   (|GraphicsDefaults| . GRDEF)
   (|GroebnerPackage| . GB)
   (|GroebnerFactorizationPackage| . GBF)
+  (|Guess| . GUESS)
+  (|GuessOption| . GOPT)
+  (|GuessAlgebraicNumber| . GUESSAN)
+  (|GuessInteger| . GUESSINT)
+  (|GuessPolynomial| . GUESSP)
+  (|GuessFinite| . GUESSF)
   (|HallBasis| . HB)
   (|Heap| . HEAP)
   (|HexadecimalExpansion| . HEXADEC)
diff --git a/src/algebra/fffg.spad.pamphlet b/src/algebra/fffg.spad.pamph=
let
index c49b7f4..8402fb0 100644
--- a/src/algebra/fffg.spad.pamphlet
+++ b/src/algebra/fffg.spad.pamphlet
@@ -1,5 +1,5 @@
 \documentclass{article}
-\usepackage{axiom,amsthm}
+\usepackage{axiom,amsthm,amsmath,amssymb}
 \newtheorem{ToDo}{ToDo}[section]
 \begin{document}
 \title{fffg.spad}
@@ -48,7 +48,7 @@ FiniteAbelianMonoidRingFunctions2(E: OrderedAbelianMono=
id,
 ++ Applications 22.
 FractionFreeFastGaussian(D, V): Exports == Implementation where
   D: Join(IntegralDomain, GcdDomain)
-  V: AbelianMonoidRing(D, NonNegativeInteger)
+  V: AbelianMonoidRing(D, NonNegativeInteger) -- for example, SUP D

   SUP  ==> SparseUnivariatePolynomial

@@ -62,8 +62,18 @@ FractionFreeFastGaussian(D, V): Exports == Impleme=
ntation where
       ++ \spad{fffg} is the general algorithm as proposed by Beckermann =
and
       ++ Labahn.
       ++
-      ++ The second argument, c(k, M) computes c_k(M) as in Equation (2)=
. Note
-      ++ that the information about f is therefore encoded in c.
+
+      ++ The first argument is the list of c_{i,i}.  These are the only =
values
+      ++ of C explicitely needed in \spad{fffg}.
+      ++
+      ++ The second argument c, computes c_k(M), i.e., c_k(.) is the dua=
l basis
+      ++ of the vector space V, but also knows about the special multipl=
ication
+      ++ rule as descibed in Equation (2).  Note that the information ab=
out f
+      ++ is therefore encoded in c.
+      ++
+      ++ The third argument is the vector of degree bounds n, as introdu=
ced in
+      ++ Definition 2.1.  In particular, the sum of the entries is the o=
rder of
+      ++ the Mahler system computed.

     interpolate: (List D, List D, NonNegativeInteger) -> Fraction SUP D
       ++ \spad{interpolate(xlist, ylist, deg} returns the rational funct=
ion with
@@ -77,11 +87,11 @@ FractionFreeFastGaussian(D, V): Exports == Implem=
entation where

 \begin{ToDo}
   The following function could be moved to [[FFFGF]], parallel to
-  [[generalInterpolation]]. However, the reason for moving
+  [[generalInterpolation]].  However, the reason for moving
   [[generalInterpolation]] for fractions to a separate package was the n=
eed of
-  a generic signature, hence the extra argument [[VF]] to [[FFFGF]]. In =
the
+  a generic signature, hence the extra argument [[VF]] to [[FFFGF]].  In=
 the
   special case of rational interpolation, this extra argument is not nec=
essary,
-  since we are always returning a fraction of [[SUP]]s, and ignore [[V]]=
. In
+  since we are always returning a fraction of [[SUP]]s, and ignore [[V]]=
.  In
   fact, [[V]] is not needed for [[fffg]] itself, only if we want to spec=
ify a
   [[CoeffAction]].

@@ -229,7 +239,7 @@ FractionFreeFastGaussian(D, V): Exports == Implem=
entation where
     generalInterpolation(C: List D, coeffAction: CoeffAction,
                          f: Vector V,
                          eta: List NonNegativeInteger): Matrix SUP D ==
=
-   
+
       c: cFunction := generalCoefficient(coeffAction, f,
                                          (#1-1)::NonNegativeInteger, #2)
       fffg(C, c, eta)
@@ -270,7 +280,7 @@ non-negative components smaller than [[p]] with the s=
ame sum as [[v]].
       else
         v.pos     := v.pos + 1   
         v.(pos-1) := (v.(pos-1) - 1)::NonNegativeInteger
-   
+
       v
 @

@@ -401,83 +411,107 @@ interpolation problem, if [[M.1.(2,1)]] vanishes.
 ------------------------------------------------------------------------=
-------
 -- fffg
 ------------------------------------------------------------------------=
-------
+@
+
+[[recurrence]] computes the new matrix $M$, according to the following f=
ormulas
+(cf. Table~2 in Beckermann and Labahn):
+\begin{align*}
+  &\text{Increase order}\\
+  &\quad\quad\text{for $\ell=1\dots m$, $\ell\neq\pi$}\\
+  &\quad\quad\quad\quad\mathbf M_{\sigma+1}^{(.,\ell)} :=
+        \left(\mathbf M_{\sigma}^{(.,\ell)}r^{(\pi)}
+            - \mathbf M_{\sigma}^{(.,\pi)}r^{(\ell)}\right)/d_\sigma\\
+  &\text{Increase order in column $\pi$}\\
+  &\quad\quad\mathbf M_{\sigma+1}^{(.,\pi)} :=
+        \left(z-c_{\sigma,\sigma}\right)\mathbf M_{\sigma}^{(.,\pi)}\\
+  &\text{Adjust degree constraints:}\\
+  &\quad\quad\mathbf M_{\sigma+1}^{(.,\pi)} :=
+        \left(\mathbf M_{\sigma+1}^{(.,\pi)}r^{(\pi)}
+            - \sum_{\ell\neq\pi}\mathbf M_{\sigma+1}^{(.,\ell)}p^{(\ell)=
}
+        \right)/d_\sigma
+\end{align*}
+
+Since we do not need the matrix $\mathbf M_{\sigma}$ anymore, we drop th=
e index
+and update the matrix destructively.  In the following, we write [[Ck]] =
for
+$c_{\sigma,\sigma}$.

+<<package FFFG FractionFreeFastGaussian>>=
 -- a major part of the time is spent here
-    recurrence(M: Matrix SUP D, lambda: NonNegativeInteger, m: NonNegati=
veInteger,
+    recurrence(M: Matrix SUP D, pi: NonNegativeInteger, m: NonNegativeIn=
teger,
                r: Vector D, d: D, z: SUP D, Ck: D, p: Vector D): Matrix =
SUP D ==

-          rLambda := qelt(r, lambda)
-          polyf := rLambda * (z - Ck::SUP D)
-
-          for i in 1..m repeat
-            Milambda    := qelt(M, i, lambda)
-            newMilambda := polyf * Milambda
-
+        rPi: D := qelt(r, pi)
+        polyf: SUP D := rPi * (z - Ck::SUP D)

--- update columns ~= lambda and calculate their sum
-            for l in 1..m | l ~= lambda repeat
-              rl  := qelt(r, l)
-              Mil := ((qelt(M, i, l) * rLambda - Milambda * rl) exquo =
d)::SUP D
-              qsetelt!(M, i, l, Mil)
+        for i in 1..m repeat
+            MiPi: SUP D    := qelt(M, i, pi)
+            newMiPi: SUP D := polyf * MiPi

-              pl  := qelt(p, l)
-              newMilambda := newMilambda - pl * Mil
+-- update columns ~= pi and calculate their sum
+            for l in 1..m | l ~= pi repeat
+                rl: D  := qelt(r, l)
+-- I need the coercion to SUP D, since exquo returns an element of
+-- Union("failed", SUP D)...
+                Mil: SUP D := ((qelt(M, i, l) * rPi - MiPi * rl) exquo=
 d)::SUP D
+                qsetelt!(M, i, l, Mil)

--- update column lambda
+                pl: D  := qelt(p, l)
+                newMiPi := newMiPi - pl * Mil

-            qsetelt!(M, i, lambda, (newMilambda exquo d)::SUP D)
+-- update column pi
+            qsetelt!(M, i, pi, (newMiPi exquo d)::SUP D)

-          M
+        M


     fffg(C: List D, c: cFunction, eta: List NonNegativeInteger): Matrix =
SUP D ==
-
 -- eta is the vector of degrees. We compute M with degrees eta+e_i-1, i==
1..m
-      z: SUP D := monomial(1, 1)
-      m: NonNegativeInteger := #eta
-      M: Matrix SUP D := scalarMatrix(m, 1)
-      d: D := 1
-      K: NonNegativeInteger := reduce(_+, eta)
-      etak: Vector NonNegativeInteger := zero(m)
-      r: Vector D := zero(m)
-      p: Vector D := zero(m)
-      Lambda: List Integer
-      lambdaMax: Integer
-      lambda: NonNegativeInteger
-
-      for k in 1..K repeat
+        z: SUP D := monomial(1, 1)
+        m: NonNegativeInteger := #eta
+        M: Matrix SUP D := scalarMatrix(m, 1)
+        d: D := 1
+        K: NonNegativeInteger := reduce(_+, eta)
+        etak: Vector NonNegativeInteger := zero(m)
+        r: Vector D := zero(m)
+        p: Vector D := zero(m)
+        Lambda: List Integer
+        lambdaMax: Integer
+        lambda: NonNegativeInteger
+
+        for k in 1..K repeat
 -- k = sigma+1

-        for l in 1..m repeat r.l := c(k, column(M, l))
+            for l in 1..m repeat r.l := c(k, column(M, l))

-        Lambda := [eta.l-etak.l for l in 1..m | r.l ~= 0]
+            Lambda := [eta.l-etak.l for l in 1..m | r.l ~= 0]

 -- if Lambda is empty, then M, d and etak remain unchanged. Otherwise, w=
e look
 -- for the next closest para-normal point.

-        (empty? Lambda) => "iterate"
+            (empty? Lambda) => "iterate"

-        lambdaMax := reduce(max, Lambda)
-        lambda := 1
-        while eta.lambda-etak.lambda < lambdaMax or r.lambda = 0 repea=
t
-          lambda := lambda + 1
+            lambdaMax := reduce(max, Lambda)
+            lambda := 1
+            while eta.lambda-etak.lambda < lambdaMax or r.lambda = 0 r=
epeat
+                lambda := lambda + 1

 -- Calculate leading coefficients

-        for l in 1..m | l ~= lambda repeat
-          if etak.l > 0 then
-            p.l := coefficient(M.(l, lambda), (etak.l-1)::NonNegativeI=
nteger)
-          else
-            p.l := 0
+            for l in 1..m | l ~= lambda repeat
+                if etak.l > 0 then
+                    p.l := coefficient(M.(l, lambda),
+                                       (etak.l-1)::NonNegativeInteger)
+                else
+                    p.l := 0

 -- increase order and adjust degree constraints

-        M := recurrence(M, lambda, m, r, d, z, C.k, p)
+            M := recurrence(M, lambda, m, r, d, z, C.k, p)

-        d := r.lambda
-        etak.lambda := etak.lambda + 1
+            d := r.lambda
+            etak.lambda := etak.lambda + 1

-      M
+        M

 @
 %$
@@ -540,7 +574,7 @@ FractionFreeFastGaussianFractions(D, V, VF): Exports =
== Implementation where
       n := #f
       g: Vector V   := new(n, 0)
       den: Vector D := new(n, 0)
-
+
       for i in 1..n repeat
         c := coefficients(f.i)
         den.i := commonDenominator(c)$CommonDenominator(D, F, List F)
@@ -548,7 +582,7 @@ FractionFreeFastGaussianFractions(D, V, VF): Exports =
== Implementation where
                   $FAMR2(NonNegativeInteger, Fraction D, VF, D, V)

       M := generalInterpolation(C, coeffAction, g, eta)$FFFG(D, V)
-
+
 -- The following is necessary since I'm multiplying each row with a fact=
or, not
 -- each column. Possibly I could factor out gcd den, but I'm not sure wh=
ether
 -- this is efficient.
@@ -560,24 +594,24 @@ FractionFreeFastGaussianFractions(D, V, VF): Export=
s == Implementation where
                          sumEta: NonNegativeInteger,
                          maxEta: NonNegativeInteger)
                         : Stream Matrix SUP D ==
-
+
       n := #f
       g: Vector V   := new(n, 0)
       den: Vector D := new(n, 0)
-
+
       for i in 1..n repeat
         c := coefficients(f.i)
         den.i := commonDenominator(c)$CommonDenominator(D, F, List F)
         g.i := map(retract(#1*den.i)@D, f.i)
                   $FAMR2(NonNegativeInteger, Fraction D, VF, D, V)
-
+
       c: cFunction := generalCoefficient(coeffAction, g,
                                          (#1-1)::NonNegativeInteger, #2)=
$FFFG(D, V)


       MS: Stream Matrix SUP D
          := generalInterpolation(C, coeffAction, g, sumEta, maxEta)$FF=
FG(D, V)
-
+
 -- The following is necessary since I'm multiplying each row with a fact=
or, not
 -- each column. Possibly I could factor out gcd den, but I'm not sure wh=
ether
 -- this is efficient.
diff --git a/src/algebra/mantepse.spad.pamphlet b/src/algebra/mantepse.sp=
ad.pamphlet
index f21b766..5addd74 100644
--- a/src/algebra/mantepse.spad.pamphlet
+++ b/src/algebra/mantepse.spad.pamphlet
@@ -17,15 +17,6 @@
   \GFUN.
 \end{abstract}
 \tableofcontents
-\section{domain UFPS UnivariateFormalPowerSeries}
-<<domain UFPS UnivariateFormalPowerSeries>>=
-)abbrev domain UFPS UnivariateFormalPowerSeries
-UnivariateFormalPowerSeries(Coef: Ring) ==
-    UnivariateTaylorSeries(Coef, 'x, 0$Coef)
-
-@
-%$
-
 \section{package UFPS1 UnivariateFormalPowerSeriesFunctions}
 <<package UFPS1 UnivariateFormalPowerSeriesFunctions>>=
 )abbrev package UFPS1 UnivariateFormalPowerSeriesFunctions
@@ -47,148 +38,6 @@ UnivariateFormalPowerSeriesFunctions(Coef: Ring): Exp=
orts == Implementation
 @
 %$

-\section{domain GOPT GuessOption}
-<<domain GOPT GuessOption>>=
-)abbrev domain GOPT GuessOption
-++ Author: Martin Rubey
-++ Description: GuessOption is a domain whose elements are various optio=
ns used
-++ by \spadtype{Guess}.
-GuessOption(): Exports == Implementation where
-
-  Exports == SetCategory with
-
-    maxDerivative: Integer -> %
-      ++ maxDerivative(d) specifies the maximum derivative in an algebra=
ic
-      ++ differential equation. maxDerivative(-1) specifies that the max=
imum
-      ++ derivative can be arbitrary. This option is expressed in the fo=
rm
-      ++ \spad{maxDerivative == d}.
-
-    maxShift: Integer -> %
-      ++ maxShift(d) specifies the maximum shift in a recurrence
-      ++ equation. maxShift(-1) specifies that the maximum shift can be
-      ++ arbitrary. This option is expressed in the form \spad{maxShift =
== d}.
- 
-    maxPower: Integer -> %
-      ++ maxPower(d) specifies the maximum degree in an algebraic differ=
ential
-      ++ equation. For example, the degree of (f'')^3 f' is 4. maxPower(=
-1)
-      ++ specifies that the maximum exponent can be arbitrary. This opti=
on is
-      ++ expressed in the form \spad{maxPower == d}.
-
-    homogeneous: Boolean -> %
-      ++ homogeneous(d) specifies whether we allow only homogeneous alge=
braic
-      ++ differential equations. This option is expressed in the form
-      ++ \spad{homogeneous == d}.
-
-    maxLevel: Integer -> %
-      ++ maxLevel(d) specifies the maximum number of recursion levels op=
erators
-      ++ guessProduct and guessSum will be applied.  maxLevel(-1) specif=
ies
-      ++ that all levels are tried. This option is expressed in the form
-      ++ \spad{maxLevel == d}.
-
-    maxDegree: Integer -> %
-      ++ maxDegree(d) specifies the maximum degree of the coefficient
-      ++ polynomials in an algebraic differential equation or a recursio=
n with
-      ++ polynomial coefficients. For rational functions with an exponen=
tial
-      ++ term, \spad{maxDegree} bounds the degree of the denominator
-      ++ polynomial.
-      ++ maxDegree(-1) specifies that the maximum
-      ++ degree can be arbitrary. This option is expressed in the form
-      ++ \spad{maxDegree == d}.
-
-    allDegrees: Boolean -> %
-      ++ allDegrees(d) specifies whether all possibilities of the degree=
 vector
-      ++ - taking into account maxDegree - should be tried. This is main=
ly
-      ++ interesting for rational interpolation. This option is expresse=
d in
-      ++ the form \spad{allDegrees == d}.
-
-    safety: NonNegativeInteger -> %
-      ++ safety(d) specifies the number of values reserved for testing a=
ny
-      ++ solutions found. This option is expressed in the form \spad{saf=
ety ==
-      ++ d}.
-
-    one: Boolean -> %
-      ++ one(d) specifies whether we are happy with one solution. This o=
ption
-      ++ is expressed in the form \spad{one == d}.
-
-    debug: Boolean -> %
-      ++ debug(d) specifies whether we want additional output on the
-      ++ progress. This option is expressed in the form \spad{debug ===
 d}.
-
-    functionName: Symbol -> %
-      ++ functionName(d) specifies the name of the function given by the
-      ++ algebraic differential equation or recurrence. This option is
-      ++ expressed in the form \spad{functionName == d}.
-
-    variableName: Symbol -> %
-      ++ variableName(d) specifies the variable used in by the algebraic
-      ++ differential equation. This option is expressed in the form
-      ++ \spad{variableName == d}.
-
-    indexName: Symbol -> %
-      ++ indexName(d) specifies the index variable used for the formulas=
. This
-      ++ option is expressed in the form \spad{indexName == d}.
-
-    displayAsGF: Boolean -> %
-      ++ displayAsGF(d) specifies whether the result is a generating fun=
ction
-      ++ or a recurrence. This option should not be set by the user, but=
 rather
-      ++ by the HP-specification.
-
-    option : (List %, Symbol) -> Union(Any, "failed")
-      ++ option() is not to be used at the top level;
-      ++ option determines internally which drawing options are indicate=
d in
-      ++ a draw command.
-
-    option?: (List %, Symbol) -> Boolean
-      ++ option?() is not to be used at the top level;
-      ++ option? internally returns true for drawing options which are
-      ++ indicated in a draw command, or false for those which are not.
-
-    checkOptions: List % -> Void
-      ++ checkOptions checks whether an option is given twice
- 
-  Implementation ==> add
-    import AnyFunctions1(Boolean)
-    import AnyFunctions1(Symbol)
-    import AnyFunctions1(Integer)
-    import AnyFunctions1(NonNegativeInteger)
-
-    Rep := Record(keyword: Symbol, value: Any)
- 
-    maxLevel d      == ["maxLevel"::Symbol,      d::Any]
-    maxDerivative d == ["maxDerivative"::Symbol, d::Any]
-    maxShift d      == maxDerivative d
-    maxDegree d     == ["maxDegree"::Symbol,     d::Any]
-    allDegrees d    == ["allDegrees"::Symbol,    d::Any]
-    maxPower d      == ["maxPower"::Symbol,      d::Any]
-    safety d        == ["safety"::Symbol,        d::Any]
-    homogeneous d   == ["homogeneous"::Symbol,   d::Any]
-    debug d         == ["debug"::Symbol,         d::Any]
-    one d           == ["one"::Symbol,           d::Any]
-    functionName d  == ["functionName"::Symbol,  d::Any]
-    variableName d  == ["variableName"::Symbol,  d::Any]
-    indexName d     == ["indexName"::Symbol,     d::Any]
-    displayAsGF d   == ["displayAsGF"::Symbol,   d::Any]
-
-    coerce(x:%):OutputForm == x.keyword::OutputForm = x.value::Out=
putForm
-    x:% = y:%              == x.keyword = y.keyword and x.value =
= y.value
-
-    option?(l, s) ==
-      for x in l repeat
-        x.keyword = s => return true
-      false
-
-    option(l, s) ==
-      for x in l repeat
-        x.keyword = s => return(x.value)
-      "failed"
-
-    checkOptions l ==
-      if not empty? l then
-        if find((first l).keyword = #1.keyword, rest l) case "failed"
-        then checkOptions rest l
-        else error "GuessOption: Option specified twice"
-
-@

 \section{package GOPT0 GuessOptionFunctions0}
 <<package GOPT0 GuessOptionFunctions0>>=
@@ -213,7 +62,7 @@ GuessOptionFunctions0(): Exports == Implementation=
 where

     maxShift: LGOPT -> Integer
       ++ maxShift returns the specified maxShift or -1 as default.
- 
+
     maxDegree: LGOPT -> Integer
       ++ maxDegree returns the specified maxDegree or -1 as default.

@@ -267,7 +116,7 @@ GuessOptionFunctions0(): Exports == Implementatio=
n where
         retract(opt :: Any)$AnyFunctions1(Integer)

     maxShift l == maxDerivative l
- 
+
     maxDegree l ==
       if (opt := option(l, "maxDegree" :: Symbol)) case "failed" then
         -1
@@ -279,13 +128,13 @@ GuessOptionFunctions0(): Exports == Implementat=
ion where
         false
       else
         retract(opt :: Any)$AnyFunctions1(Boolean)
- 
+
     maxPower l ==
       if (opt := option(l, "maxPower" :: Symbol)) case "failed" then
         -1
       else
         retract(opt :: Any)$AnyFunctions1(Integer)
- 
+
     safety l ==
       if (opt := option(l, "safety" :: Symbol)) case "failed" then
         1$NonNegativeInteger
@@ -345,17 +194,17 @@ GuessOptionFunctions0(): Exports == Implementat=
ion where
 ++ \spadtype{GuessPolynomial}, etc.
 Guess(F, S, EXPRR, R, retract, coerce): Exports == Implementation wh=
ere
     F: Field                                 -- zB.: FRAC POLY PF 5
--- in F wird interpoliert und gerechnet
+-- in F we interpolate und check

     S: GcdDomain

--- in guessExpRat m=C3=B6chte ich die Wurzeln von Polynomen =C3=BCber F =
bestimmen. Wenn F
--- ein Quotientenk=C3=B6rper ist, dann kann ich den Nenner loswerden.
--- F w=C3=A4re dann also QFCAT S
+-- in guessExpRat I would like to determine the roots of polynomials in =
F. When
+-- F is a quotientfield, I can get rid of the denominator.  In this case=
 F is
+-- roughly QFCAT S

     R: Join(OrderedSet, IntegralDomain)      -- zB.: FRAC POLY INT

--- die Ergebnisse werden aber in EXPRR dargestellt
+-- results are given as elements of EXPRR
 --    EXPRR: Join(ExpressionSpace, IntegralDomain,
     EXPRR: Join(FunctionSpace Integer, IntegralDomain,
                 RetractableTo R, RetractableTo Symbol,
@@ -369,16 +218,16 @@ Guess(F, S, EXPRR, R, retract, coerce): Exports ==
= Implementation where
               ground? : % -> Boolean

                                              -- zB.: EXPR INT
--- EXPR FRAC POLY INT ist ja verboten. Deshalb kann ich nicht einfach EX=
PR R
--- verwenden
--- EXPRR existiert, falls irgendwann einmal EXPR PF 5 unterst=C3=BCtzt w=
ird.
+-- EXPR FRAC POLY INT is forbidden. Thus i cannot just use EXPR R
+
+-- EXPRR exists, in case at some point there is support for EXPR PF 5.


--- das folgende m=C3=B6chte ich eigentlich loswerden.
- 
+-- the following I really would like to get rid of
+
     retract: R -> F                          -- zB.: i+->i
     coerce: F -> EXPRR                       -- zB.: i+->i
--- Achtung EXPRR ~= EXPR R
+-- attention: EXPRR ~= EXPR R

     LGOPT ==> List GuessOption
     GOPT0 ==> GuessOptionFunctions0
@@ -445,6 +294,8 @@ Section~\ref{sec:Hermite-Pade}.

 <<package GUESS Guess>>=
     --@<<implementation: Guess - Hermite-Pade - Types for Operators>>
+    -- EXT ==> (Integer, V, V) -> FPOLYS
+    -- EXTEXPR ==> (Symbol, F, F) -> EXPRR
 @

 <<package GUESS Guess>>=
@@ -455,168 +306,184 @@ Section~\ref{sec:Hermite-Pade}.
           ++ \spadfun{guessADE} to the successive differences and quotie=
nts of
           ++ the list. Default options as described in
           ++ \spadtype{GuessOptionFunctions0} are used.
- 
+
         guess: (List F, LGOPT) -> GUESSRESULT
           ++ \spad{guess(l, options)} applies recursively \spadfun{guess=
Rec}
           ++ and \spadfun{guessADE} to the successive differences and qu=
otients
           ++ of the list. The given options are used.
- 
+
         guess: (List F, List GUESSER, List Symbol) -> GUESSRESULT
           ++ \spad{guess(l, guessers, ops)} applies recursively the give=
n
           ++ guessers to the successive differences if ops contains the =
symbol
           ++ guessSum and quotients if ops contains the symbol guessProd=
uct to
           ++ the list. Default options as described in
           ++ \spadtype{GuessOptionFunctions0} are used.
- 
+
         guess: (List F, List GUESSER, List Symbol, LGOPT) -> GUESSRESULT
           ++ \spad{guess(l, guessers, ops)} applies recursively the give=
n
           ++ guessers to the successive differences if ops contains the =
symbol
           ++ \spad{guessSum} and quotients if ops contains the symbol
           ++ \spad{guessProduct} to the list. The given options are used.
- 
+
         guessExpRat: List F -> GUESSRESULT
           ++ \spad{guessExpRat l} tries to find a function of the form
           ++ n+->(a+b n)^n r(n), where r(n) is a rational function, that=
 fits
           ++ l.
- 
+
         guessExpRat: (List F, LGOPT) -> GUESSRESULT
           ++ \spad{guessExpRat(l, options)} tries to find a function of =
the
           ++ form n+->(a+b n)^n r(n), where r(n) is a rational function,=
 that
           ++ fits l.
- 
+
+        guessBinRat: List F -> GUESSRESULT
+          ++ \spad{guessBinRat(l, options)} tries to find a function of =
the
+          ++ form n+->binomial(a+b n, n) r(n), where r(n) is a rational
+          ++ function, that fits l.
+
+        guessBinRat: (List F, LGOPT) -> GUESSRESULT
+          ++ \spad{guessBinRat(l, options)} tries to find a function of =
the
+          ++ form n+->binomial(a+b n, n) r(n), where r(n) is a rational
+          ++ function, that fits l.
+
         if F has RetractableTo Symbol and S has RetractableTo Symbol the=
n

             guessExpRat: Symbol -> GUESSER
               ++ \spad{guessExpRat q} returns a guesser that tries to fi=
nd a
-              ++ function of the form n+->(a+b q^n)^n r(q^n), where r(n)=
 is a
-              ++ rational function, that fits l.
+              ++ function of the form n+->(a+b q^n)^n r(q^n), where r(q^=
n) is a
+              ++ q-rational function, that fits l.
+
+            guessBinRat: Symbol -> GUESSER
+              ++ \spad{guessBinRat q} returns a guesser that tries to fi=
nd a
+              ++ function of the form n+->qbinomial(a+b n, n) r(n), wher=
e r(q^n) is a
+              ++ q-rational function, that fits l.

         guessHP: (LGOPT -> HPSPEC) -> GUESSER
           ++ \spad{guessHP f} constructs an operation that applies Hermi=
te-Pade
           ++ approximation to the series generated by the given function=
 f.
- 
+
         guessADE: List F -> GUESSRESULT
           ++ \spad{guessADE l} tries to find an algebraic differential e=
quation
           ++ for a generating function whose first Taylor coefficients a=
re
           ++ given by l, using the default options described in
           ++ \spadtype{GuessOptionFunctions0}.
- 
+
         guessADE: (List F, LGOPT) -> GUESSRESULT
           ++ \spad{guessADE(l, options)} tries to find an algebraic
           ++ differential equation for a generating function whose first=
 Taylor
           ++ coefficients are given by l, using the given options.
- 
+
         guessAlg: List F -> GUESSRESULT
           ++ \spad{guessAlg l} tries to find an algebraic equation for a
           ++ generating function whose first Taylor coefficients are giv=
en by
           ++ l, using the default options described in
           ++ \spadtype{GuessOptionFunctions0}. It is equivalent to
           ++ \spadfun{guessADE}(l, maxDerivative == 0).
- 
+
         guessAlg: (List F, LGOPT) -> GUESSRESULT
           ++ \spad{guessAlg(l, options)} tries to find an algebraic equa=
tion
           ++ for a generating function whose first Taylor coefficients a=
re
           ++ given by l, using the given options. It is equivalent to
           ++ \spadfun{guessADE}(l, options) with \spad{maxDerivative ==
= 0}.
- 
+
         guessHolo: List F -> GUESSRESULT
           ++ \spad{guessHolo l} tries to find an ordinary linear differe=
ntial
           ++ equation for a generating function whose first Taylor coeff=
icients
           ++ are given by l, using the default options described in
           ++ \spadtype{GuessOptionFunctions0}. It is equivalent to
           ++ \spadfun{guessADE}\spad{(l, maxPower == 1)}.
- 
+
         guessHolo: (List F, LGOPT) -> GUESSRESULT
           ++ \spad{guessHolo(l, options)} tries to find an ordinary line=
ar
           ++ differential equation for a generating function whose first=
 Taylor
           ++ coefficients are given by l, using the given options. It is
           ++ equivalent to \spadfun{guessADE}\spad{(l, options)} with
           ++ \spad{maxPower == 1}.
- 
+
         guessPade: (List F, LGOPT) -> GUESSRESULT
           ++ \spad{guessPade(l, options)} tries to find a rational funct=
ion
           ++ whose first Taylor coefficients are given by l, using the g=
iven
           ++ options. It is equivalent to \spadfun{guessADE}\spad{(l,
           ++ maxDerivative == 0, maxPower == 1, allDegrees ===
 true)}.
- 
+
         guessPade: List F -> GUESSRESULT
           ++ \spad{guessPade(l, options)} tries to find a rational funct=
ion
           ++ whose first Taylor coefficients are given by l, using the d=
efault
           ++ options described in \spadtype{GuessOptionFunctions0}. It i=
s
           ++ equivalent to \spadfun{guessADE}\spad{(l, options)} with
           ++ \spad{maxDerivative == 0, maxPower == 1, allDegrees=
 == true}.
- 
+
         guessRec: List F -> GUESSRESULT
           ++ \spad{guessRec l} tries to find an ordinary difference equa=
tion
           ++ whose first values are given by l, using the default option=
s
           ++ described in \spadtype{GuessOptionFunctions0}.
- 
+
         guessRec: (List F, LGOPT) -> GUESSRESULT
           ++ \spad{guessRec(l, options)} tries to find an ordinary diffe=
rence
           ++ equation whose first values are given by l, using the given
           ++ options.
- 
+
         guessPRec: (List F, LGOPT) -> GUESSRESULT
           ++ \spad{guessPRec(l, options)} tries to find a linear recurre=
nce
           ++ with polynomial coefficients whose first values are given b=
y l,
           ++ using the given options. It is equivalent to
           ++ \spadfun{guessRec}\spad{(l, options)} with \spad{maxPower ==
= 1}.
- 
+
         guessPRec: List F -> GUESSRESULT
           ++ \spad{guessPRec l} tries to find a linear recurrence with
           ++ polynomial coefficients whose first values are given by l, =
using
           ++ the default options described in
           ++ \spadtype{GuessOptionFunctions0}. It is equivalent to
           ++ \spadfun{guessRec}\spad{(l, maxPower == 1)}.
- 
+
         guessRat: (List F, LGOPT) -> GUESSRESULT
           ++ \spad{guessRat(l, options)} tries to find a rational functi=
on
           ++ whose first values are given by l, using the given options.=
 It is
           ++ equivalent to \spadfun{guessRec}\spad{(l, maxShift == 0=
, maxPower
           ++ == 1, allDegrees == true)}.
- 
+
         guessRat: List F -> GUESSRESULT
           ++ \spad{guessRat l} tries to find a rational function whose f=
irst
           ++ values are given by l, using the default options described =
in
           ++ \spadtype{GuessOptionFunctions0}. It is equivalent to
           ++ \spadfun{guessRec}\spad{(l, maxShift == 0, maxPower ==
= 1,
           ++ allDegrees == true)}.
- 
+
         diffHP: LGOPT -> HPSPEC
           ++ \spad{diffHP options} returns a specification for Hermite-P=
ade
           ++ approximation with the differential operator
- 
+
         shiftHP: LGOPT -> HPSPEC
           ++ \spad{shiftHP options} returns a specification for Hermite-=
Pade
           ++ approximation with the shift operator
- 
+
         if F has RetractableTo Symbol and S has RetractableTo Symbol the=
n
+
             shiftHP: Symbol -> (LGOPT -> HPSPEC)
               ++ \spad{shiftHP options} returns a specification for
               ++ Hermite-Pade approximation with the $q$-shift operator
-   
+
             diffHP: Symbol -> (LGOPT -> HPSPEC)
               ++ \spad{diffHP options} returns a specification for Hermi=
te-Pade
               ++ approximation with the  $q$-dilation operator
-   
+
             guessRec: Symbol -> GUESSER
               ++ \spad{guessRec q} returns a guesser that finds an ordin=
ary
               ++ q-difference equation whose first values are given by l=
, using
               ++ the given options.
-     
+
             guessPRec: Symbol -> GUESSER
               ++ \spad{guessPRec q} returns a guesser that tries to find
               ++ a linear q-recurrence with polynomial coefficients whos=
e first
               ++ values are given by l, using the given options. It is
               ++ equivalent to \spadfun{guessRec}\spad{(q)} with
               ++ \spad{maxPower == 1}.
-     
+
             guessRat: Symbol -> GUESSER
               ++ \spad{guessRat q} returns a guesser that tries to find =
a
               ++ q-rational function whose first values are given by l, =
using
               ++ the given options. It is equivalent to \spadfun{guessRe=
c} with
               ++ \spad{(l, maxShift == 0, maxPower == 1, allDegr=
ees == true)}.
-   
+
             guessADE: Symbol -> GUESSER
               ++ \spad{guessADE q} returns a guesser that tries to find =
an
               ++ algebraic differential equation for a generating functi=
on whose
@@ -627,22 +494,32 @@ Section~\ref{sec:Hermite-Pade}.
 @

 <<debug exports: Guess>>=
-termAsUFPSF: (UFPSF, List Integer, DIFFSPECS, DIFFSPEC1) -> UFPSF
-termAsUFPSF2: (UFPSF, List Integer, DIFFSPECS, DIFFSPEC1) -> UFPSF
-termAsEXPRR: (EXPRR, Symbol, List Integer, DIFFSPECX, DIFFSPEC1X) -> EXP=
RR
-termAsUFPSSUPF: (UFPSSUPF, List Integer, DIFFSPECSF, DIFFSPEC1F) -> UFPS=
SUPF
-termAsUFPSSUPF2: (UFPSSUPF, List Integer, DIFFSPECSF, DIFFSPEC1F) -> UFP=
SSUPF
-
-ShiftSXGF: (EXPRR, Symbol, NNI) -> EXPRR
-ShiftAXGF: (NNI, Symbol, EXPRR) -> EXPRR
-
-FilteredPartitionStream: LGOPT -> Stream List Integer
-
-guessInterpolate: (List SUP F, List NNI, HPSPEC) -> Matrix SUP S
+--termAsUFPSF: (UFPSF, List Integer, DIFFSPECS, DIFFSPEC1) -> UFPSF
+--termAsUFPSF2: (UFPSF, List Integer, DIFFSPECS, DIFFSPEC1) -> UFPSF
+--termAsEXPRR: (EXPRR, Symbol, List Integer, DIFFSPECX, DIFFSPEC1X) -> E=
XPRR
+--termAsUFPSSUPF: (UFPSSUPF, List Integer, DIFFSPECSF, DIFFSPEC1F) -> UF=
PSSUPF
+--termAsUFPSSUPF2: (UFPSSUPF, List Integer, DIFFSPECSF, DIFFSPEC1F) -> U=
FPSSUPF
+--
+--ShiftSXGF: (EXPRR, Symbol, NNI) -> EXPRR
+--ShiftAXGF: (NNI, Symbol, EXPRR) -> EXPRR
+--
+--FilteredPartitionStream: LGOPT -> Stream List Integer
+--
+--guessInterpolate: (List SUP F, List NNI, HPSPEC) -> Matrix SUP S
 testInterpolant: (List SUP S, List F, List UFPSSUPF, List EXPRR, List EX=
PRR, _
                   NNI, HPSPEC, Symbol, BasicOperator, LGOPT) _
                   -> Union("failed", Record(function: EXPRR, order: NNI)=
)

+--checkResult: (EXPRR, Symbol, Integer, List F, LGOPT) -> NNI
+--
+--guessBinRatAux: (Symbol, List F, DIFFSPECN, EXT, EXTEXPR,
+--                 List Integer, LGOPT) -> List EXPRR
+--guessBinRatAux0: (List F, DIFFSPECN, EXT, EXTEXPR,
+--                  LGOPT) -> GUESSRESULT
+--binExt: EXT
+--binExtEXPR: EXTEXPR
+--defaultD: DIFFSPECN
+
 @

 <<package GUESS Guess>>=
@@ -659,6 +536,7 @@ testInterpolant: (List SUP S, List F, List UFPSSUPF, =
List EXPRR, List EXPRR, _

 <<implementation: Guess - Utilities>>
 <<implementation: Guess - guessExpRat>>
+<<implementation: Guess - guessBinRat>>
 <<implementation: Guess - Hermite-Pade>>
 <<implementation: Guess - guess>>
 @
@@ -686,6 +564,7 @@ SUPS2SUPF(p: SUP S): SUP F ==
               to Fraction S"

 @
+%$

 \subsection{guessing rational functions with an exponential term}

@@ -740,7 +619,7 @@ SUPPOLYS2SUPF(p: SUP POLYS, a1v: F, Av: F): SUP F ==
=
 SUPFPOLYS2FSUPPOLYS(p: SUP FPOLYS): Fraction SUP POLYS  ==
   cden := splitDenominator(p)
          $UnivariatePolynomialCommonDenominator(POLYS, FPOLYS,SUP FPOLYS=
)
- 
+
   pnum: SUP POLYS
        := map(retract(#1 * cden.den)$FPOLYS, p)
              $SparseUnivariatePolynomialFunctions2(FPOLYS, POLYS)
@@ -754,9 +633,19 @@ POLYF2EXPRR(p: POLYF): EXPRR ==
      $PolynomialCategoryLifting(IndexedExponents V, V,
                                 F, POLYF, EXPRR)

+-- this needs documentation. In particular, why is V appearing here?
+GF ==> GeneralizedMultivariateFactorize(SingletonAsOrderedSet,
+                                        IndexedExponents V, F, F,
+                                        SUP F)
+
+-- does not work:
+--                                                     6
+--   WARNING (genufact): No known algorithm to factor ? , trying square-=
free.
+
+-- GF ==> GenUFactorize F
 @

-\paragraph{mimicking $q$-anaologa}
+\paragraph{mimicking $q$-analoga}

 <<implementation: Guess - guessExpRat - Utilities>>=
 defaultD: DIFFSPECN
@@ -772,8 +661,8 @@ DN2DL(DN, i) == retract(retract(DN(i::EXPRR))@R)

 \subsubsection{reducing the degree of the polynomials}

-The degree of [[poly3]] is governed by $(a0+x_m a_1)^{x_m}$. Therefore, =
we
-substitute $A-x_m a1$ for $a$, which reduces the degree in $a_1$ by
+The degree of [[poly3]] is governed by $(a_0+x_m a_1)^{x_m}$. Therefore,=
 we
+substitute $A-x_m a1$ for $a_0$, which reduces the degree in $a_1$ by
 $x_m-x_{i+1}$.

 <<implementation: Guess - guessExpRat - substitute>>=
@@ -896,10 +785,6 @@ still obtain a polynomial.
 \subsubsection{The main routine}

 <<implementation: Guess - guessExpRat - Main>>=
-GF ==> GeneralizedMultivariateFactorize(SingletonAsOrderedSet,
-                                        IndexedExponents V, F, F,
-                                        SUP F)
-
 guessExpRatAux(xx: Symbol, list: List F, basis: DIFFSPECN,
                xValues: List Integer, options: LGOPT): List EXPRR ==

@@ -909,7 +794,7 @@ guessExpRatAux(xx: Symbol, list: List F, basis: DIFFS=
PECN,
     len: NNI := #list
     if len < 4 then return []
                else len := (len-3)::NNI
- 
+
     xlist := [F2FPOLYS DN2DL(basis, xValues.i) for i in 1..len]
     x1 := F2FPOLYS DN2DL(basis, xValues.(len+1))
     x2 := F2FPOLYS DN2DL(basis, xValues.(len+2))
@@ -1034,7 +919,8 @@ a rational function. To obtain $y$, we compute $y(n)=
=s_n*(a+b n)^{-n}$.
             systemCommand("sys date +%s")$MoreSystemCommands
             output("computing gcd..."::OutputForm)$OutputPackage

--- we want to solve over F           
+-- we want to solve over F
+-- for polynomial domains S this seems to be very costly!    
         res3: SUP F := SUPS2SUPF(primitivePart(gcd(res1, res2)))

         if debug(options)$GOPT0 then
@@ -1153,7 +1039,7 @@ guessExpRatAux0(list: List F, basis: DIFFSPECN, opt=
ions: LGOPT): GUESSRESULT ==
     res: List EXPRR
         := [eval(zeros * f, xx::EXPRR, xx::EXPRR) _
             for f in guessExpRatAux(xx, newlist, basis, xValues, options=
)]
-       
+
     reslist := map([#1, checkResult(#1, xx, len, list, options)], res)
                   $ListFunctions2(EXPRR, Record(function: EXPRR, order: =
NNI))

@@ -1172,6 +1058,334 @@ if F has RetractableTo Symbol and S has Retractab=
leTo Symbol then

 @

+\subsection{guessing rational functions with a binomial term}
+
+\begin{ToDo}
+  It is not clear whether one should take the model
+  \begin{equation*}
+    \binom{a+bn}{n}q(n),
+  \end{equation*}
+  which includes rational functions, or
+  \begin{equation*}
+    (a+bn)(a+bn+1)\dots (a+bn+n)q(n).
+  \end{equation*}
+  which includes rational functions times $n!$. We choose the former, si=
nce
+  dividing by $n!$ is a common normalisation. The question remains wheth=
er we
+  should do the same for [[guessExpRat]].
+\end{ToDo}
+
+
+<<implementation: Guess - guessBinRat>>=
+
+EXT ==> (Integer, V, V) -> FPOLYS
+EXTEXPR ==> (Symbol, F, F) -> EXPRR
+
+binExt: EXT
+binExt(i: Integer, va1: V, vA: V): FPOLYS ==
+    numl: List POLYS := [(vA::POLYS) + i * (va1::POLYS) - (l::POLYS) _
+                         for l in 0..i-1]
+    num: POLYS := reduce(_*, numl, 1)
+
+    num/(factorial(i)::POLYS)
+
+binExtEXPR: EXTEXPR
+binExtEXPR(i: Symbol, a1v: F, Av: F): EXPRR ==
+    binomial(coerce Av + coerce a1v * (i::EXPRR), i::EXPRR)
+
+
+guessBinRatAux(xx: Symbol, list: List F,
+               basis: DIFFSPECN, ext: EXT, extEXPR: EXTEXPR,
+               xValues: List Integer, options: LGOPT): List EXPRR ==
+
+    a1: V := index(1)$V
+    A: V := index(2)$V
+
+    len: NNI := #list
+    if len < 4 then return []
+               else len := (len-3)::NNI
+
+    xlist := [F2FPOLYS DN2DL(basis, xValues.i) for i in 1..len]
+    x1 := F2FPOLYS DN2DL(basis, xValues.(len+1))
+    x2 := F2FPOLYS DN2DL(basis, xValues.(len+2))
+    x3 := F2FPOLYS DN2DL(basis, xValues.(len+3))
+
+@
+
+We try to fit the data $(s1,s2,\dots)$ to the model $\binom{a+b n}{n} y(=
n)$,
+$r$ being a rational function. To obtain $y$, we compute
+$y(n)=s_n*\binom{a+bn}{n}^-1$.
+
+<<implementation: Guess - guessBinRat>>=
+    y: NNI -> FPOLYS :=
+        F2FPOLYS(list.#1) / _
+        ext((xValues.#1)::Integer, a1, A)
+
+    ylist: List FPOLYS := [y i for i in 1..len]
+
+    y1 := y(len+1)
+    y2 := y(len+2)
+    y3 := y(len+3)
+
+    res := []::List EXPRR
+    if maxDegree(options)$GOPT0 = -1
+    then maxDeg := len-1
+    else maxDeg := min(maxDegree(options)$GOPT0, len-1)
+
+    for i in 0..maxDeg repeat
+--        if debug(options)$GOPT0 then
+--            output(hconcat("degree BinRat "::OutputForm, i::OutputForm=
))
+--                $OutputPackage
+
+@
+
+\begin{ToDo}
+  Shouldn't we use the algorithm over [[POLYS]] here? Strange enough, fo=
r
+  polynomial interpolation, it is faster, but for rational interpolation
+  \emph{much} slower. This should be investigated.
+\end{ToDo}
+
+\begin{ToDo}
+  It seems that [[maxDeg]] bounds the degree of the denominator, rather =
than
+  the numerator? This is now added to the documentation of [[maxDegree]]=
, it
+  should make sense.
+\end{ToDo}
+
+<<implementation: Guess - guessBinRat>>=
+--        if debug(options)$GOPT0 then
+--            output("interpolating..."::OutputForm)$OutputPackage
+
+        ri: FSUPFPOLYS
+           := interpolate(xlist, ylist, (len-1-i)::NNI) _
+                         $FFFG(FPOLYS, SUP FPOLYS)
+
+--        if debug(options)$GOPT0 then
+--            output(hconcat("ri ", ri::OutputForm))$OutputPackage
+
+        poly1: POLYS := numer(elt(ri, x1)$SUP(FPOLYS) - y1)
+        poly2: POLYS := numer(elt(ri, x2)$SUP(FPOLYS) - y2)
+        poly3: POLYS := numer(elt(ri, x3)$SUP(FPOLYS) - y3)
+
+--        if debug(options)$GOPT0 then
+--            output(hconcat("poly1 ", poly1::OutputForm))$OutputPackage
+--            output(hconcat("poly2 ", poly2::OutputForm))$OutputPackage
+--            output(hconcat("poly3 ", poly3::OutputForm))$OutputPackage
+
+
+        n:Integer := len - i
+        res1: SUP S := univariate(resultant(poly1, poly3, a1))
+        res2: SUP S := univariate(resultant(poly2, poly3, a1))
+        if debug(options)$GOPT0 then
+--            output(hconcat("res1 ", res1::OutputForm))$OutputPackage
+--            output(hconcat("res2 ", res2::OutputForm))$OutputPackage
+
+--            if res1 ~= res1res or res2 ~= res2res then
+--            output(hconcat("poly1 ", poly1::OutputForm))$OutputPackage
+--                output(hconcat("poly2 ", poly2::OutputForm))$OutputPac=
kage
+--            output(hconcat("poly3 ", poly3::OutputForm))$OutputPackage
+--                output(hconcat("res1 ", res1::OutputForm))$OutputPacka=
ge
+--                output(hconcat("res2 ", res2::OutputForm))$OutputPacka=
ge
+--            output("n/i: " string(n) " " string(i))$OutputPackage
+            output("res1 ord: " string(minimumDegree res1))
+                  $OutputPackage
+            output("res1 deg: " string(degree res1))
+                  $OutputPackage
+            output("res2 ord: " string(minimumDegree res2))
+                  $OutputPackage
+            output("res2 deg: " string(degree res2))
+                  $OutputPackage
+
+        if debug(options)$GOPT0 then
+            output("computing gcd..."::OutputForm)$OutputPackage
+
+-- we want to solve over F           
+        res3: SUP F := SUPS2SUPF(primitivePart(gcd(res1, res2)))
+
+--        if debug(options)$GOPT0 then
+--            output(hconcat("res3 ", res3::OutputForm))$OutputPackage
+
+-- res3 is a polynomial in A=a0+(len+3)*a1
+-- now we have to find the roots of res3
+
+        for f in factors factor(res3)$GF | degree f.factor = 1 repeat
+-- we are only interested in the linear factors
+--             if debug(options)$GOPT0 then
+--                 output(hconcat("f: ", f::OutputForm))$OutputPackage
+
+             Av: F := -coefficient(f.factor, 0)
+                     / leadingCoefficient f.factor
+
+--             if debug(options)$GOPT0 then
+--                 output(hconcat("Av: ", Av::OutputForm))$OutputPackage
+
+-- FIXME: in an earlier version, we disregarded vanishing Av
+--        maybe we intended to disregard vanishing a1v? Either doesn't r=
eally
+--        make sense to me right now.
+
+             evalPoly := eval(POLYS2POLYF poly3, A, Av)
+             if zero? evalPoly
+             then evalPoly := eval(POLYS2POLYF poly1, A, Av)
+-- Note that it really may happen that poly3 vanishes when specializing
+-- A. Consider for example guessExpRat([1,1,1,1]).
+
+-- FIXME: We check poly1 below, too. I should work out in what cases pol=
y3
+-- vanishes.
+
+             for g in factors factor(univariate evalPoly)$GF
+                      | degree g.factor = 1 repeat
+--                 if debug(options)$GOPT0 then
+--                     output(hconcat("g: ", g::OutputForm))$OutputPacka=
ge
+
+                 a1v: F := -coefficient(g.factor, 0)
+                          / leadingCoefficient g.factor
+
+--                 if debug(options)$GOPT0 then
+--                     output(hconcat("a1v: ", a1v::OutputForm))$OutputP=
ackage
+
+-- check whether poly1 and poly2 really vanish. Note that we could have =
found
+-- an extraneous solution, since we only computed the gcd of the two
+-- resultants.
+
+                 t1 := eval(POLYS2POLYF poly1, [a1, A]::List V,
+                                               [a1v, Av]::List F)
+
+--                 if debug(options)$GOPT0 then
+--                     output(hconcat("t1: ", t1::OutputForm))$OutputPac=
kage
+
+                 if zero? t1 then 
+                     t2 := eval(POLYS2POLYF poly2, [a1, A]::List V,
+                                                   [a1v, Av]::List F)
+
+--                     if debug(options)$GOPT0 then
+--                         output(hconcat("t2: ", t2::OutputForm))$Outpu=
tPackage
+
+                     if zero? t2 then
+
+                         ri1: Fraction SUP POLYS
+                             := SUPFPOLYS2FSUPPOLYS(numer ri)
+                              / SUPFPOLYS2FSUPPOLYS(denom ri)
+
+--                         if debug(options)$GOPT0 then
+--                             output(hconcat("ri1: ", ri1::OutputForm))=
$OutputPackage
+
+                         numr: SUP F := SUPPOLYS2SUPF(numer ri1, a1v, =
Av)
+                         denr: SUP F := SUPPOLYS2SUPF(denom ri1, a1v, =
Av)
+
+--                         if debug(options)$GOPT0 then
+--                             output(hconcat("numr: ", numr::OutputForm=
))$OutputPackage
+--                             output(hconcat("denr: ", denr::OutputForm=
))$OutputPackage
+
+                         if not zero? denr then
+                             res4: EXPRR := eval(FSUPF2EXPRR(xx, numr/=
denr),
+                                                 kernel(xx),
+                                                 basis(xx::EXPRR))
+                                           * extEXPR(xx, a1v, Av)
+
+--                             if debug(options)$GOPT0 then
+--                                 output(hconcat("res4: ", res4::Output=
Form))$OutputPackage
+
+                             res := cons(res4, res)
+                         else if zero? numr and debug(options)$GOPT0 the=
n
+                             output("numerator and denominator vanish!")
+                                   $OutputPackage
+
+-- If we are only interested in one solution, we do not try other degree=
s if we
+-- have found already some solutions. I.e., the indentation here is corr=
ect.
+
+        if not null(res) and one(options)$GOPT0 then return res
+
+    res
+
+guessBinRatAux0(list: List F,
+                basis: DIFFSPECN, ext: EXT, extEXPR: EXTEXPR,
+                options: LGOPT): GUESSRESULT ==
+
+    if zero? safety(options)$GOPT0 then
+        error "Guess: guessBinRat does not support zero safety"
+-- guesses Functions of the form binomial(a+b*n, n)*rat(n)
+    xx := indexName(options)$GOPT0
+
+-- restrict to safety
+
+    len: Integer := #list
+    if len-safety(options)$GOPT0+1 < 0 then return []
+
+    shortlist: List F := first(list, (len-safety(options)$GOPT0+1)::NN=
I)
+
+-- remove zeros from list
+
+    zeros: EXPRR := 1
+    newlist: List F
+    xValues: List Integer
+
+    i: Integer := -1
+    for x in shortlist repeat
+        i := i+1
+        if x = 0 then
+            zeros := zeros * (basis(xx::EXPRR) - basis(i::EXPRR))
+
+    i := -1
+    for x in shortlist repeat
+        i := i+1
+        if x ~= 0 then
+            newlist := cons(x/retract(retract(eval(zeros, xx::EXPRR,
+                                                          i::EXPRR))@R),
+                            newlist)
+            xValues := cons(i, xValues)
+
+    newlist := reverse newlist
+    xValues := reverse xValues
+
+    res: List EXPRR
+        := [eval(zeros * f, xx::EXPRR, xx::EXPRR) _
+            for f in guessBinRatAux(xx, newlist, basis, ext, extEXPR, xV=
alues, _
+                                    options)]
+
+    reslist := map([#1, checkResult(#1, xx, len, list, options)], res)
+                  $ListFunctions2(EXPRR, Record(function: EXPRR, order: =
NNI))
+
+    select(#1.order < len-safety(options)$GOPT0, reslist)
+
+guessBinRat(list : List F): GUESSRESULT ==
+    guessBinRatAux0(list, defaultD, binExt, binExtEXPR, [])
+
+guessBinRat(list: List F, options: LGOPT): GUESSRESULT ==
+    guessBinRatAux0(list, defaultD, binExt, binExtEXPR, options)
+
+
+if F has RetractableTo Symbol and S has RetractableTo Symbol then
+
+    qD: Symbol -> DIFFSPECN
+    qD q == (q::EXPRR)**#1
+
+
+    qBinExtAux(q: Symbol, i: Integer, va1: V, vA: V): FPOLYS ==
+        fl: List FPOLYS
+             := [(1$FPOLYS - _
+                  va1::POLYS::FPOLYS * (vA::POLYS::FPOLYS)**(i-1) * _
+                  F2FPOLYS(q::F)**l) / (1-F2FPOLYS(q::F)**l) _
+                 for l in 1..i]
+        reduce(_*, fl, 1)
+
+    qBinExt: Symbol -> EXT
+    qBinExt q == qBinExtAux(q, #1, #2, #3)
+
+    qBinExtEXPRaux(q: Symbol, i: Symbol, a1v: F, Av: F): EXPRR ==
+        l: Symbol := 'l
+        product((1$EXPRR - _
+                 coerce a1v * (coerce Av) ** (coerce i - 1$EXPRR) * _
+                 (q::EXPRR) ** coerce(l)) / _
+                (1$EXPRR - (q::EXPRR) ** coerce(l)), _
+                equation(l, 1$EXPRR..i::EXPRR))
+
+    qBinExtEXPR: Symbol -> EXTEXPR
+    qBinExtEXPR q == qBinExtEXPRaux(q, #1, #2, #3)
+
+    guessBinRat(q: Symbol): GUESSER ==
+        guessBinRatAux0(#1, qD q, qBinExt q, qBinExtEXPR q, #2)_
+
+@
+
+
 \subsection{Hermite Pad\'e interpolation}\label{sec:Hermite-Pade}

 <<implementation: Guess - Hermite-Pade>>=
@@ -1193,12 +1407,12 @@ DIFFSPECX ==> (EXPRR, Symbol, NonNegativeInte=
ger) -> EXPRR
                                                --      f(x)+->D(f, x)
 DIFFSPECS ==> (UFPSF, NonNegativeInteger) -> UFPSF
                                                -- eg.: f(x)+->f(q*x)
- 
+
 DIFFSPECSF ==> (UFPSSUPF, NonNegativeInteger) -> UFPSSUPF
                                                -- eg.: f(x)+->f(q*x)
- 
+
 -- the constant term for the inhomogeneous case
- 
+
 DIFFSPEC1 ==> UFPSF

 DIFFSPEC1F ==> UFPSSUPF
@@ -1209,8 +1423,8 @@ DIFFSPEC1X ==> Symbol -> EXPRR

 \subsubsection{Streams}\label{sec:streams}

-In this section we define some functions that provide streams for [[Herm=
itePade]].
-
+In this section we define some functions that provide streams for
+[[HermitePade]].

 The following three functions transform a partition [[l]] into a product=
 of
 derivatives of [[f]], using the given operators. We need to provide the =
same
@@ -1317,7 +1531,7 @@ does not.

 Note that we conjugate all partitions at the very end of the following
 procedure\dots
-
+
 <<implementation: Guess - Hermite-Pade - Streams>>=
 FilteredPartitionStream(options: LGOPT): Stream List Integer ==
     maxD := 1+maxDerivative(options)$GOPT0
@@ -1340,7 +1554,7 @@ FilteredPartitionStream(options: LGOPT): Stream Lis=
t Integer ==
         s := cons([],
                   select(((maxD = 0) or (# #1 <= maxD)) _
                      and ((maxP = -1) or (first #1 <= maxP)), s3))
-       
+
     s := conjugates(s)$PartitionsAndPermutations
     if homogeneous(options)$GOPT0 then rest s else s

@@ -1364,7 +1578,7 @@ applying one of the power and shift or differentiat=
ion operators. More
 precisely, the $n$\textsuperscript{th} entry of the stream takes into ac=
count
 all partitions up to index $n$. Thus, the entries of the stream are weak=
ly
 increasing.
-      
+
 <<implementation: Guess - Hermite-Pade - Streams>>=      
 ADEdegreeStream(partitions: Stream List Integer): Stream NNI ==
     scan(0, max((if empty? #1 then 0 else (first #1 - 1)::NNI), #2),
@@ -1389,7 +1603,7 @@ ADEEXPRRStream(f: EXPRR, xx: Symbol, partitions: St=
ream List Integer,
 \subsubsection{Operators}

 We need to define operators that transform series for differentiation an=
d
-shifting. We also provide operators for $q$-analoga. The functionality
+shifting. We also provide operators for $q$-analogs. The functionality
 corresponding to powering and taking the Hadamard product if provided by=
 the
 streams, see Section~\ref{sec:streams}.

@@ -1571,7 +1785,7 @@ shiftHP options ==
 @

 \paragraph{$q$-Shifting} The $q$-shift also transforms $u(n)$ into $u(n+=
1)$,
-and we can reuse the corrseponding functions of the previous paragraph.
+and we can reuse the corresponding functions of the previous paragraph.
 However, this time multiplication with $z$ is defined differently: the
 coefficient of $x^k$ in $z u(n)$ is $q^n u(n)$. We do not define the
 corresponding functionality for power series.
@@ -1716,7 +1930,7 @@ guessInterpolate2(guessList: List SUP F,
         generalInterpolation((D.C)(sumEta), D.A,
                              vguessListF, sumEta, maxEta)
                             $FFFGF(S, SUP S, SUP F)
-   
+
     else error "Type parameter F should be either equal to S or equal _
                 to Fraction S"
 @
@@ -1809,8 +2023,14 @@ Finally, it seems that we have found a solution. N=
ow we cancel the greatest
 common divisor of the equation. Note that this may take quite some time,=
 it
 seems to be quicker to check [[generalCoefficient]] with the original [[=
resi]].

+If [[S]] is a [[Field]], the [[gcd]] will always be $1$.  Thus, in this =
case we
+make the result monic.
+
 <<implementation: Guess - testInterpolant>>=
-    g: SUP S := gcd resi
+    g: SUP S
+    if S has Field
+    then g := leadingCoefficient(find(not zero? #1, reverse resi)::SUP=
(S))::SUP(S)
+    else g := gcd resi
     resiF := map(SUPS2SUPF((#1 exquo g)::SUP(S)), resi)
                 $ListFunctions2(SUP S, SUP F)

@@ -1877,12 +2097,10 @@ important if we apply, for example, [[guessRat]] =
recursively. In this case,
     x := variableName(options)$GOPT0
     dummy := new$Symbol

-    initials: List EXPRR
-    if displayAsGF(options)$GOPT0
-    then initials := [coerce(e)@EXPRR*factorial(k::EXPRR) _
-                      for e in list for k in 0..]
-    else initials := [coerce(e)@EXPRR for e in list]
+    initials: List EXPRR := [coerce(e)@EXPRR for e in list]
+
 @
+%$

 We need to create several streams. Let $P$ be the univariate power serie=
s whose
 first few elements are given by [[list]]. As an example, consider the
@@ -1942,7 +2160,7 @@ which all the generated series are correct, taking =
into account [[safety]].
             output(hconcat("guessDegree is ", guessDegree::OutputForm))
                   $OutputPackage
 @
-%$
+%$"

 We now have to distinguish between the case where we try all combination=
 of
 degrees and the case where we try only an (nearly) evenly distributed ve=
ctor of
@@ -2004,10 +2222,19 @@ increase the order anymore.
                           .quotient = 0) and
                        (newMaxParams.remainder < o)))
             then iterate? := true
-            else eta: List NNI
-                     := [(if i <= maxParams.remainder   _
-                          then maxParams.quotient + 1   _
-                          else maxParams.quotient)::NNI for i in 1..o]
+            else if ((maxDegree(options)$GOPT0 ~= -1) and
+                     (maxParams.quotient > maxDegree(options)$GOPT0))
+                 then
+                     guessDegree := o*(1+maxDegree(options)$GOPT0)-2
+                     eta: List NNI
+                         := [(if i < o    _
+                               then maxDegree(options)$GOPT0 + 1   _
+                               else maxDegree(options)$GOPT0)::NNI _
+                             for i in 1..o]
+                 else eta: List NNI
+                          := [(if i <= maxParams.remainder   _
+                               then maxParams.quotient + 1   _
+                               else maxParams.quotient)::NNI for i in 1.=
.o]
 @

 We distribute the parameters as evenly as possible.  Is it better to hav=
e
@@ -2019,7 +2246,10 @@ HermitePade.

 \begin{ToDo}
   [[maxDegree]] should be handled differently, maybe: we should only pas=
s as
-  many coefficients to [[FFFG]] as [[maxDegree]] implies!
+  many coefficients to [[FFFG]] as [[maxDegree]] implies! That is, if we=
 cannot
+  increase the order anymore, we should decrease [[guessDegree]] to %
+  $o\cdot [[maxDegree]] - 2$ and set [[eta]] accordingly.  I might have =
to take
+  care of [[allDegrees]], too.
 \end{ToDo}

 <<implementation: Guess - guessHPaux>>=
@@ -2035,7 +2265,7 @@ HermitePade.
             if debug(options)$GOPT0 then
                 output("The list of expressions is")$OutputPackage
                 output(exprList::OutputForm)$OutputPackage
-   
+
             if allDegrees(options)$GOPT0 then
                 MS: Stream Matrix SUP S := guessInterpolate2(guessList=
,
                                                              guessDegree=
::NNI+1,
@@ -2043,7 +2273,7 @@ HermitePade.
                 repeat
                     (empty? MS) => break
                     M := first MS
-           
+
                     for i in 1..o repeat
                         res := testInterpolant(entries column(M, i),
                                                list,
@@ -2057,13 +2287,13 @@ HermitePade.

                         if not member?(res, reslist)
                         then reslist := cons(res, reslist)
-           
+
                         if one(options)$GOPT0 then return reslist
-           
+
                     MS := rest MS
             else
                 M: Matrix SUP S := guessInterpolate(guessList, eta, D)
-   
+
                 for i in 1..o repeat
                     res := testInterpolant(entries column(M, i),
                                            list,
@@ -2073,10 +2303,10 @@ HermitePade.
                                            guessDegree::NNI,
                                            D, dummy, op, options)
                     (res case "failed") => "iterate"
-   
+
                     if not member?(res, reslist)
                     then reslist := cons(res, reslist)
-   
+
                     if one(options)$GOPT0 then return reslist

     reslist
@@ -2168,7 +2398,7 @@ if F has RetractableTo Symbol and S has Retractable=
To Symbol then
     guessRec(q: Symbol): GUESSER ==
         opts: LGOPT := cons(displayAsGF(false)$GuessOption, #2)
         guessHPaux(#1, (shiftHP q)(opts), opts)
- 
+
     guessPRec(q: Symbol): GUESSER ==
         opts: LGOPT := append([displayAsGF(false)$GuessOption,
                                maxPower(1)$GuessOption], #2)
@@ -2219,7 +2449,7 @@ guess(list: List F, guessers: List GUESSER, ops: Li=
st Symbol,
             output(hconcat("res ", res::OutputForm))$OutputPackage

         if one(options)$GOPT0 and not empty? res then return res
-
+
     if (maxLevel = 0) then return res

     if member?('guessProduct, ops) and not member?(0$F, list) then
@@ -2270,7 +2500,7 @@ guess(list: List F, guessers: List GUESSER, ops: Li=
st Symbol,
             for guess in sumGuess
                     | not any?(guess.function = #1.function, res) repe=
at
                 res := cons(guess, res)
- 
+
     res

 guess(list: List F): GUESSRESULT ==
@@ -2308,15 +2538,15 @@ GuessInteger() == Guess(Fraction Integer, Int=
eger, Expression Integer,
 ++ This package exports guessing of sequences of numbers in a finite fie=
ld
 GuessFiniteFunctions(F:Join(FiniteFieldCategory, ConvertibleTo Integer))=
:
   Exports == Implementation where
-
+
     EXPRR ==> Expression Integer
-
+
     Exports == with

       F2EXPRR: F -> EXPRR
-
+
     Implementation == add
-
+
       F2EXPRR(p: F): EXPRR == convert(p)@Integer::EXPRR

 @
@@ -2345,6 +2575,320 @@ GuessPolynomial() == Guess(Fraction Polynomia=
l Integer, Polynomial Integer,

 @

+\section{package GUESSAN GuessAlgebraicNumber}
+<<package GUESSAN GuessAlgebraicNumber>>=
+)abbrev package GUESSAN GuessAlgebraicNumber
+++ Description:
+++ This package exports guessing of sequences of rational functions
+GuessAlgebraicNumber() == Guess(AlgebraicNumber, AlgebraicNumber,
+                           Expression Integer,
+                           AlgebraicNumber,
+                           id$MappingPackage1(AlgebraicNumber),
+                           coerce$Expression(Integer))
+
+@
+
+
+\section{package GUESSUP GuessUnivariatePolynomial}
+<<package GUESSUP GuessUnivariatePolynomial>>=
+)abbrev domain MYUP MyUnivariatePolynomial
+MyUnivariatePolynomial(x:Symbol, R:Ring):
+  UnivariatePolynomialCategory(R) with
+    RetractableTo Symbol;
+    coerce: Variable(x) -> %
+      ++ coerce(x) converts the variable x to a univariate polynomial.
+    fmecg: (%,NonNegativeInteger,R,%) -> %
+        ++ fmecg(p1,e,r,p2) finds X : p1 - r * X**e * p2
+    if R has univariate: (R, Symbol) -> SparseUnivariatePolynomial R
+    then coerce: R -> %
+    coerce: Polynomial R -> %
+   == SparseUnivariatePolynomial(R) add
+    Rep := SparseUnivariatePolynomial(R)
+    coerce(p: %):OutputForm  == outputForm(p, outputForm x)
+    coerce(x: Symbol): % == monomial(1, 1)
+    coerce(v: Variable(x)):% == monomial(1, 1)
+    retract(p: %): Symbol ==
+        retract(p)@SingletonAsOrderedSet
+        x
+    if R has univariate: (R, Symbol) -> SparseUnivariatePolynomial R
+    then coerce(p: R): % == univariate(p, x)$R
+
+    coerce(p: Polynomial R): % ==
+        poly: SparseUnivariatePolynomial(Polynomial R)
+             := univariate(p, x)$(Polynomial R)
+        map(retract(#1), poly)$UnivariatePolynomialCategoryFunctions2(Po=
lynomial R,
+                    SparseUnivariatePolynomial Polynomial R,
+                    R, %)
+
+
+)abbrev domain MYEXPR MyExpression
+MyExpression(q: Symbol, R): Exports == Implementation where
+
+  R: Join(Ring, OrderedSet, IntegralDomain)
+  UP ==> MyUnivariatePolynomial(q, R)
+
+  Exports == Join(FunctionSpace R, IntegralDomain,
+                RetractableTo UP, RetractableTo Symbol,
+                RetractableTo Integer, CombinatorialOpsCategory,
+                PartialDifferentialRing Symbol) with
+              _* : (%,%) -> %
+              _/ : (%,%) -> %
+              _*_* : (%,%) -> %
+              numerator : % -> %
+              denominator : % -> %
+              ground? : % -> Boolean
+
+              coerce: Fraction UP -> %
+              retract: % -> Fraction UP
+
+  Implementation == Expression R add
+    Rep := Expression R
+
+    iunivariate(p: Polynomial R): UP ==
+        poly: SparseUnivariatePolynomial(Polynomial R)
+             := univariate(p, q)$(Polynomial R)
+        map(retract(#1), poly)$UnivariatePolynomialCategoryFunctions2(Po=
lynomial R,
+                    SparseUnivariatePolynomial Polynomial R,
+                    R, UP)
+
+    retract(p: %): Fraction UP ==
+        poly: Fraction Polynomial R := retract p
+        upoly: UP := iunivariate numer poly
+        vpoly: UP := iunivariate denom poly
+
+        upoly / vpoly
+
+    retract(p: %): UP == iunivariate retract p
+
+    coerce(r: Fraction UP): % ==
+       num: SparseUnivariatePolynomial R := makeSUP numer r
+       den: SparseUnivariatePolynomial R := makeSUP denom r
+       u: Polynomial R := multivariate(num, q)
+       v: Polynomial R := multivariate(den, q)
+
+       quot: Fraction Polynomial R := u/v
+
+       quot::(Expression R)
+
+
+
+)abbrev package GUESSUP GuessUnivariatePolynomial
+++ Description:
+++ This package exports guessing of sequences of univariate rational fun=
ctions
+GuessUnivariatePolynomial(q: Symbol): Exports == Implementation wher=
e
+
+    UP ==> MyUnivariatePolynomial(q, Integer)
+    EXPRR ==> MyExpression(q, Integer)
+    F ==> Fraction UP
+    S ==> UP
+    NNI ==> NonNegativeInteger
+    LGOPT ==> List GuessOption
+    GUESSRESULT ==> List Record(function: EXPRR, order: NNI)
+    GUESSER ==> (List F, LGOPT) -> GUESSRESULT
+
+    Exports == with
+
+        guess: List F -> GUESSRESULT
+          ++ \spad{guess l} applies recursively \spadfun{guessRec} and
+          ++ \spadfun{guessADE} to the successive differences and quotie=
nts of
+          ++ the list. Default options as described in
+          ++ \spadtype{GuessOptionFunctions0} are used.
+
+        guess: (List F, LGOPT) -> GUESSRESULT
+          ++ \spad{guess(l, options)} applies recursively \spadfun{guess=
Rec}
+          ++ and \spadfun{guessADE} to the successive differences and qu=
otients
+          ++ of the list. The given options are used.
+
+        guess: (List F, List GUESSER, List Symbol) -> GUESSRESULT
+          ++ \spad{guess(l, guessers, ops)} applies recursively the give=
n
+          ++ guessers to the successive differences if ops contains the =
symbol
+          ++ guessSum and quotients if ops contains the symbol guessProd=
uct to
+          ++ the list. Default options as described in
+          ++ \spadtype{GuessOptionFunctions0} are used.
+
+        guess: (List F, List GUESSER, List Symbol, LGOPT) -> GUESSRESULT
+          ++ \spad{guess(l, guessers, ops)} applies recursively the give=
n
+          ++ guessers to the successive differences if ops contains the =
symbol
+          ++ \spad{guessSum} and quotients if ops contains the symbol
+          ++ \spad{guessProduct} to the list. The given options are used.
+
+        guessExpRat: List F -> GUESSRESULT
+          ++ \spad{guessExpRat l} tries to find a function of the form
+          ++ n+->(a+b n)^n r(n), where r(n) is a rational function, that=
 fits
+          ++ l.
+
+        guessExpRat: (List F, LGOPT) -> GUESSRESULT
+          ++ \spad{guessExpRat(l, options)} tries to find a function of =
the
+          ++ form n+->(a+b n)^n r(n), where r(n) is a rational function,=
 that
+          ++ fits l.
+
+        guessBinRat: List F -> GUESSRESULT
+          ++ \spad{guessBinRat(l, options)} tries to find a function of =
the
+          ++ form n+->binomial(a+b n, n) r(n), where r(n) is a rational
+          ++ function, that fits l.
+
+        guessBinRat: (List F, LGOPT) -> GUESSRESULT
+          ++ \spad{guessBinRat(l, options)} tries to find a function of =
the
+          ++ form n+->binomial(a+b n, n) r(n), where r(n) is a rational
+          ++ function, that fits l.
+
+--        if F has RetractableTo Symbol and S has RetractableTo Symbol t=
hen
+
+        guessExpRat: Symbol -> GUESSER
+          ++ \spad{guessExpRat q} returns a guesser that tries to find a
+          ++ function of the form n+->(a+b q^n)^n r(q^n), where r(q^n) i=
s a
+          ++ q-rational function, that fits l.
+
+        guessBinRat: Symbol -> GUESSER
+          ++ \spad{guessBinRat q} returns a guesser that tries to find a
+          ++ function of the form n+->qbinomial(a+b n, n) r(n), where r(=
q^n) is a
+          ++ q-rational function, that fits l.
+
+------------------------------------------------------------------------=
-------
+
+        guessHP: (LGOPT -> HPSPEC) -> GUESSER
+          ++ \spad{guessHP f} constructs an operation that applies Hermi=
te-Pade
+          ++ approximation to the series generated by the given function=
 f.
+
+        guessADE: List F -> GUESSRESULT
+          ++ \spad{guessADE l} tries to find an algebraic differential e=
quation
+          ++ for a generating function whose first Taylor coefficients a=
re
+          ++ given by l, using the default options described in
+          ++ \spadtype{GuessOptionFunctions0}.
+
+        guessADE: (List F, LGOPT) -> GUESSRESULT
+          ++ \spad{guessADE(l, options)} tries to find an algebraic
+          ++ differential equation for a generating function whose first=
 Taylor
+          ++ coefficients are given by l, using the given options.
+
+        guessAlg: List F -> GUESSRESULT
+          ++ \spad{guessAlg l} tries to find an algebraic equation for a
+          ++ generating function whose first Taylor coefficients are giv=
en by
+          ++ l, using the default options described in
+          ++ \spadtype{GuessOptionFunctions0}. It is equivalent to
+          ++ \spadfun{guessADE}(l, maxDerivative == 0).
+
+        guessAlg: (List F, LGOPT) -> GUESSRESULT
+          ++ \spad{guessAlg(l, options)} tries to find an algebraic equa=
tion
+          ++ for a generating function whose first Taylor coefficients a=
re
+          ++ given by l, using the given options. It is equivalent to
+          ++ \spadfun{guessADE}(l, options) with \spad{maxDerivative ==
= 0}.
+
+        guessHolo: List F -> GUESSRESULT
+          ++ \spad{guessHolo l} tries to find an ordinary linear differe=
ntial
+          ++ equation for a generating function whose first Taylor coeff=
icients
+          ++ are given by l, using the default options described in
+          ++ \spadtype{GuessOptionFunctions0}. It is equivalent to
+          ++ \spadfun{guessADE}\spad{(l, maxPower == 1)}.
+
+        guessHolo: (List F, LGOPT) -> GUESSRESULT
+          ++ \spad{guessHolo(l, options)} tries to find an ordinary line=
ar
+          ++ differential equation for a generating function whose first=
 Taylor
+          ++ coefficients are given by l, using the given options. It is
+          ++ equivalent to \spadfun{guessADE}\spad{(l, options)} with
+          ++ \spad{maxPower == 1}.
+
+        guessPade: (List F, LGOPT) -> GUESSRESULT
+          ++ \spad{guessPade(l, options)} tries to find a rational funct=
ion
+          ++ whose first Taylor coefficients are given by l, using the g=
iven
+          ++ options. It is equivalent to \spadfun{guessADE}\spad{(l,
+          ++ maxDerivative == 0, maxPower == 1, allDegrees ===
 true)}.
+
+        guessPade: List F -> GUESSRESULT
+          ++ \spad{guessPade(l, options)} tries to find a rational funct=
ion
+          ++ whose first Taylor coefficients are given by l, using the d=
efault
+          ++ options described in \spadtype{GuessOptionFunctions0}. It i=
s
+          ++ equivalent to \spadfun{guessADE}\spad{(l, options)} with
+          ++ \spad{maxDerivative == 0, maxPower == 1, allDegrees=
 == true}.
+
+        guessRec: List F -> GUESSRESULT
+          ++ \spad{guessRec l} tries to find an ordinary difference equa=
tion
+          ++ whose first values are given by l, using the default option=
s
+          ++ described in \spadtype{GuessOptionFunctions0}.
+
+        guessRec: (List F, LGOPT) -> GUESSRESULT
+          ++ \spad{guessRec(l, options)} tries to find an ordinary diffe=
rence
+          ++ equation whose first values are given by l, using the given
+          ++ options.
+
+        guessPRec: (List F, LGOPT) -> GUESSRESULT
+          ++ \spad{guessPRec(l, options)} tries to find a linear recurre=
nce
+          ++ with polynomial coefficients whose first values are given b=
y l,
+          ++ using the given options. It is equivalent to
+          ++ \spadfun{guessRec}\spad{(l, options)} with \spad{maxPower ==
= 1}.
+
+        guessPRec: List F -> GUESSRESULT
+          ++ \spad{guessPRec l} tries to find a linear recurrence with
+          ++ polynomial coefficients whose first values are given by l, =
using
+          ++ the default options described in
+          ++ \spadtype{GuessOptionFunctions0}. It is equivalent to
+          ++ \spadfun{guessRec}\spad{(l, maxPower == 1)}.
+
+        guessRat: (List F, LGOPT) -> GUESSRESULT
+          ++ \spad{guessRat(l, options)} tries to find a rational functi=
on
+          ++ whose first values are given by l, using the given options.=
 It is
+          ++ equivalent to \spadfun{guessRec}\spad{(l, maxShift == 0=
, maxPower
+          ++ == 1, allDegrees == true)}.
+
+        guessRat: List F -> GUESSRESULT
+          ++ \spad{guessRat l} tries to find a rational function whose f=
irst
+          ++ values are given by l, using the default options described =
in
+          ++ \spadtype{GuessOptionFunctions0}. It is equivalent to
+          ++ \spadfun{guessRec}\spad{(l, maxShift == 0, maxPower ==
= 1,
+          ++ allDegrees == true)}.
+
+        diffHP: LGOPT -> HPSPEC
+          ++ \spad{diffHP options} returns a specification for Hermite-P=
ade
+          ++ approximation with the differential operator
+
+        shiftHP: LGOPT -> HPSPEC
+          ++ \spad{shiftHP options} returns a specification for Hermite-=
Pade
+          ++ approximation with the shift operator
+
+--        if F has RetractableTo Symbol and S has RetractableTo Symbol t=
hen
+
+        shiftHP: Symbol -> (LGOPT -> HPSPEC)
+          ++ \spad{shiftHP options} returns a specification for
+          ++ Hermite-Pade approximation with the $q$-shift operator
+
+        diffHP: Symbol -> (LGOPT -> HPSPEC)
+          ++ \spad{diffHP options} returns a specification for Hermite-P=
ade
+          ++ approximation with the  $q$-dilation operator
+
+        guessRec: Symbol -> GUESSER
+          ++ \spad{guessRec q} returns a guesser that finds an ordinary
+          ++ q-difference equation whose first values are given by l, us=
ing
+          ++ the given options.
+
+        guessPRec: Symbol -> GUESSER
+          ++ \spad{guessPRec q} returns a guesser that tries to find
+          ++ a linear q-recurrence with polynomial coefficients whose fi=
rst
+          ++ values are given by l, using the given options. It is
+          ++ equivalent to \spadfun{guessRec}\spad{(q)} with
+          ++ \spad{maxPower == 1}.
+
+        guessRat: Symbol -> GUESSER
+          ++ \spad{guessRat q} returns a guesser that tries to find a
+          ++ q-rational function whose first values are given by l, usin=
g
+          ++ the given options. It is equivalent to \spadfun{guessRec} w=
ith
+          ++ \spad{(l, maxShift == 0, maxPower == 1, allDegrees =
== true)}.
+
+        guessADE: Symbol -> GUESSER
+          ++ \spad{guessADE q} returns a guesser that tries to find an
+          ++ algebraic differential equation for a generating function w=
hose
+          ++ first Taylor coefficients are given by l, using the given
+          ++ options.
+
+------------------------------------------------------------------------=
-------
+
+    Implementation == Guess(Fraction UP, UP,
+                            MyExpression(q, Integer),
+                            Fraction UP,
+                            id$MappingPackage1(Fraction UP),
+                            coerce$MyExpression(q, Integer))
+@
+
+
 \section{License}
 <<license>>=
 --Copyright (c) 2006-2007, Martin Rubey <Martin.Rubey@univie.ac.at>
@@ -2377,14 +2921,14 @@ GuessPolynomial() == Guess(Fraction Polynomia=
l Integer, Polynomial Integer,
 <<*>>=
 <<license>>

-<<dom: UFPS UnivariateFormalPowerSeries>>
 <<package UFPS1 UnivariateFormalPowerSeriesFunctions>>
-<<domain GOPT GuessOption>>
 <<package GOPT0 GuessOptionFunctions0>>
 <<package GUESS Guess>>
 <<package GUESSINT GuessInteger>>
+<<package GUESSAN GuessAlgebraicNumber>>
 <<package GUESSF1 GuessFiniteFunctions>>
 <<package GUESSF GuessFinite>>
 <<package GUESSP GuessPolynomial>>
+<<package GUESSUP GuessUnivariatePolynomial>>
 @
 \end{document}
diff --git a/src/algebra/rec.spad.pamphlet b/src/algebra/rec.spad.pamphle=
t
index 5be79c2..8cedd33 100644
--- a/src/algebra/rec.spad.pamphlet
+++ b/src/algebra/rec.spad.pamphlet
@@ -21,7 +21,8 @@
 RecurrenceOperator(R, F): Exports == Implementation where
   R: Join(OrderedSet, IntegralDomain, ConvertibleTo InputForm)
   F: Join(FunctionSpace R, AbelianMonoid, RetractableTo Integer, _
-          RetractableTo Symbol, PartialDifferentialRing Symbol)
+          RetractableTo Symbol, PartialDifferentialRing Symbol, _
+          CombinatorialOpsCategory)
 --RecurrenceOperator(F): Exports == Implementation where
 --  F: Join(ExpressionSpace, AbelianMonoid, RetractableTo Integer,
 --          RetractableTo Symbol, PartialDifferentialRing Symbol)
@@ -39,14 +40,20 @@ RecurrenceOperator(R, F): Exports == Implementati=
on where

     evalADE: (BasicOperator, Symbol, F, F, F, List F) -> F
       ++ \spad{evalADE(f, dummy, x, n, eq, values)} creates an expressio=
n that
-      ++ stands for the coefficient of x^n in f(x), where f(x) is given =
by the
-      ++ functional equation eq. However, for technical reasons the vari=
able x
-      ++ has to be replaced by a dummy variable dummy in eq. The argumen=
t
-      ++ values specifies f(0), f'(0), f''(0),...
+      ++ stands for the coefficient of x^n in the Taylor expansion of f(=
x),
+      ++ where f(x) is given by the functional equation eq. However, for
+      ++ technical reasons the variable x has to be replaced by a dummy
+      ++ variable dummy in eq. The argument values specifies the first f=
ew
+      ++ Taylor coefficients.
+
+    getEq: F -> F
+      ++ \spad{getEq f} returns the defining equation, if f represents t=
he
+      ++ coefficient of an ADE or a recurrence.
+
+    getOp: F -> BasicOperator
+      ++ \spad{getOp f}, if f represents the coefficient of a recurrence=
 or
+      ++ ADE, returns the operator representing the solution

-    getADE: F -> F
-      ++ \spad{getADE f} returns the defining equation, if f stands for =
the
-      ++ coefficient of an ADE.

 -- should be local
     numberOfValuesNeeded: (Integer, BasicOperator, Symbol, F) -> Integer
@@ -165,7 +172,7 @@ how many initial values are necessary.

           p := univariate(a.1, retract(n::F)@Kernel(F))
           if denominator p ~= 1 then return "failed"
-         
+
           num := numer p

           if degree num = 1 and coefficient(num, 1) = 1
@@ -249,14 +256,14 @@ how many initial values are necessary.
           then values.(len-n)
           else
             shiftInfo := shiftInfoRec(op, argsym, eq)
- 
+
             if shiftInfo.max case Integer then
               p := univariate(eq, shiftInfo.ker)

               num := numer p
- 
+
               if degree num = 1 then
- 
+
                 next := -coefficient(num, 0)/coefficient(num, 1)
                 nextval := eval(next, argsym::F,
                                 (len-(shiftInfo.max)::Integer)::F)
@@ -266,7 +273,7 @@ how many initial values are necessary.
               else
                 kernel(oprecur,
                        append([eq, argsym::F, argdisp, op(arg)], values)=
)
- 
+
             else
               kernel(oprecur,
                      append([eq, argsym::F, argdisp, op(arg)], values))
@@ -334,6 +341,24 @@ an operator.

 \subsection{Functional Equations}

+\subsubsection{Determining the number of initial values for ADE's}
+
+We use Joris van der Hoeven's instructions for ADE's. Given
+$Q=p(f,f',\dots,f^{(r)})$ we first need to differentiate $Q$ with resp=
ect to
+$f^{(i)}$ for $i\in\{0,1,\dots,r\}$, plug in the given truncated power s=
eries
+solution and determine the valuation.
+
+<<NOTYET implementation: RecurrenceOperator>>=
+    getValuation(op, argsym, eq, maxorder, values): Integer ==
+        max: Integer := -1;
+        ker: Kernel F
+        for i in 0..maxorder repeat
+            ker := D(op(argsym), argsym, i)::Kernel F
+            pol := univariate(eq, ker)
+            dif := D pol
+            ground numer(dif.D(op(argsym), argsym, i))
+@
+
 \subsubsection{Extracting some information from the functional equation}

 [[getOrder]] returns the maximum derivative of [[op]] occurring in [[f]].
@@ -360,51 +385,55 @@ an operator.

       if ((n := retractIfCan(arg)@Union(Integer, "failed")) case "fail=
ed")
       then
---
--- The following would need yet another operator, namely "coefficient of=
".
---
---         keq := kernels eq
---         order := getOrder(op, keq.1)
---         for k in rest keq repeat order := max(order, getOrder(op, k=
))
---
---         if zero? order then
--- -- in this case, we have an algebraic equation
---
---           p: Fraction SparseUnivariatePolynomial F
---             := univariate(eq, kernels(D(op(argsym::F), argsym, orde=
r)).1)$F
---
---           num := numer p
---
---           if one? degree num then
--- -- the equation is in fact linear
---             return eval(-coefficient(num, 0)/coefficient(num, 1), arg=
sym::F, arg::F)
---
-        kernel(opADE,
-               append([eq, argsym::F, argdisp, op(arg)], values))
+-- try to determine the necessary number of initial values
+         keq := kernels eq
+         order := getOrder(op, keq.1)
+         for k in rest keq repeat order := max(order, getOrder(op, k))
+
+         p: Fraction SparseUnivariatePolynomial F
+           := univariate(eq, kernels(D(op(argsym::F), argsym, order)).=
1)$F
+
+         if one? degree numer p
+-- the equation is holonomic
+         then kernel(opADE,
+                     append([eq, argsym::F, argdisp, op(arg)],
+                            reverse first(reverse values, order)))
+         else kernel(opADE,
+                     append([eq, argsym::F, argdisp, op(arg)], values))
       else
         if n < 0
         then 0
         else
           keq := kernels eq
           order := getOrder(op, keq.1)
-          output(hconcat("The order is ", order::OutputForm))$OutputPack=
age
+--          output(hconcat("The order is ", order::OutputForm))$OutputPa=
ckage
           for k in rest keq repeat order := max(order, getOrder(op, k)=
)

           p: Fraction SparseUnivariatePolynomial F
             := univariate(eq, kernels(D(op(argsym::F), argsym, order))=
.1)$F

-          output(hconcat("p: ", p::OutputForm))$OutputPackage
+--          output(hconcat("p: ", p::OutputForm))$OutputPackage
+
           if degree numer p > 1
           then
-            kernel(opADE,
-                   append([eq, argsym::F, argdisp, op(arg)], values))
+--            kernel(opADE,
+--                   append([eq, argsym::F, argdisp, op(arg)], values))
+
+            s := seriesSolve(eq, op, argsym, reverse values)
+                            $ExpressionSolve(R, F,
+                                             UnivariateFormalPowerSeries=
 F,
+                                             UnivariateFormalPowerSeries
+                                               SparseUnivariatePolynomia=
lExpressions F)
+
+            elt(s, n::Integer::NonNegativeInteger)
+
           else
             s := seriesSolve(eq, op, argsym, first(reverse values, ord=
er))
                             $ExpressionSolve(R, F,
                                              UnivariateFormalPowerSeries=
 F,
                                              UnivariateFormalPowerSeries
                                                SparseUnivariatePolynomia=
lExpressions F)
-         
+
             elt(s, n::Integer::NonNegativeInteger)


@@ -418,13 +447,25 @@ an operator.

     evaluate(opADE, iADE)$BasicOperatorFunctions1(F)

-    getADE(f: F): F ==
+    getEq(f: F): F ==
       ker := kernels f
-      if one?(#ker) and is?(operator(ker.1), "rootOfADE"::Symbol) then
+      if one?(#ker) and _
+         (is?(operator(ker.1), "rootOfADE"::Symbol) or _
+          is?(operator(ker.1), "rootOfRec"::Symbol)) then
         l := argument(ker.1)
         eval(eqAsF l, dummyAsF l, displayVariable l)
       else
-        error "getADE: argument should be a single rootOfADE object"
+        error "getEq: argument should be a single rootOfADE or rootOfRec=
 object"
+
+    getOp(f: F): BasicOperator ==
+      ker := kernels f
+      if one?(#ker) and _
+         (is?(operator(ker.1), "rootOfADE"::Symbol) or _
+          is?(operator(ker.1), "rootOfRec"::Symbol)) then
+        operatorName argument(ker.1)
+      else
+        error "getOp: argument should be a single rootOfADE or rootOfRec=
 object"
+

 @
 %$
@@ -440,7 +481,9 @@ an operator.
            := cons(eval(eqAsF l, dummyAsF l, displayVariable l)::Outpu=
tForm = _
                    0::OutputForm,
                    [eval(D(op(dummyAsF l), dummy l, i), _
-                         dummyAsF l=0)::OutputForm = (values.(i+1)):=
:OutputForm
+                         dummyAsF l=0)::OutputForm = _
+                    (values.(i+1))::OutputForm * _
+                    factorial(box(i::R::F)$F)::OutputForm _
                     for i in 0..min(4,#values-5)])

       bracket(hconcat([bracket((displayVariable l)::OutputForm ** _
diff --git a/src/algebra/ssolve.spad.pamphlet b/src/algebra/ssolve.spad.p=
amphlet
index cce6ca7..f761c4b 100644
--- a/src/algebra/ssolve.spad.pamphlet
+++ b/src/algebra/ssolve.spad.pamphlet
@@ -9,6 +9,156 @@
 \begin{abstract}
 \end{abstract}
 \tableofcontents
+\section{package UTSSOL TaylorSolve}
+
+[[UTSSOL]] is a facility to compute the first few coefficients of a Tayl=
or
+series given only implicitely by a function [[f]] that vanishes when app=
lied to
+the Taylor series.
+
+It uses the method of undetermined coefficients.
+
+\begin{ToDo}
+  Could I either
+  \begin{itemize}
+  \item take a function [[UTSCAT F -> UTSCAT F]] and still be able to co=
mpute
+    with undetermined coefficients, or
+  \item take a function [[F -> F]], and do likewise?
+  \end{itemize}
+
+  Let's see.
+
+  Try to compute the equation without resorting to power series. I.e., %
+  [[c: SUP SUP F]], and [[f: SUP SUP F -> SUP SUP F]]. Won't this make t=
he
+  computation of coefficients terribly slow?
+
+  I could also try to replace transcendental kernels with variables\dots
+
+  Unfortunately, [[SUP F]] does not have [[TRANFUN]] -- well, it can't, =
of
+  course. However, I'd like to be able to compute %
+  [[sin(1+monomial(1,1)$UFPS SUP EXPR INT)]].
+\end{ToDo}
+
+<<package UTSSOL TaylorSolve>>=
+)abb package UTSSOL TaylorSolve
+TaylorSolve(F, UTSF, UTSSUPF): Exports == Implementation where
+    F: Field
+    SUP  ==> SparseUnivariatePolynomialExpressions
+    UTSF: UnivariateTaylorSeriesCategory F
+    UTSSUPF: UnivariateTaylorSeriesCategory SUP F
+    NNI  ==> NonNegativeInteger
+
+    Exports == with
+        seriesSolve: (UTSSUPF -> UTSSUPF, List F) -> UTSF
+
+    Implementation == add
+<<implementation: UTSSOL TaylorSolve>>
+@
+
+<<implementation: UTSSOL TaylorSolve>>=
+        seriesSolve(f, l) ==
+            c1 := map(#1::(SUP F), l)$ListFunctions2(F, SUP F)::(Strea=
m SUP F)
+            coeffs: Stream SUP F := concat(c1, generate(monomial(1$F,1=
$NNI)))
+--            coeffs: Stream SUP F := concat(c1, monomial(1$F,1$NNI))
+@
+
+[[coeffs]] is the stream of the already computed coefficients of the sol=
ution,
+plus one which is so far undetermined. We store in [[st.2]] the complete=
 stream
+and in [[st.1]] the stream starting with the first coefficient that has
+possibly not yet been computed.
+
+\begin{ToDo}
+  The mathematics is not quite worked out. If [[coeffs]] is initialized =
as
+  stream with all coefficients set to the \emph{same} transcendental val=
ue,
+  and not enough initial values are given, then the missing ones are
+  implicitely assumed to be all identical. It may well happen that a sol=
ution
+  is produced, although it is not uniquely determined\dots
+\end{ToDo}
+
+<<implementation: UTSSOL TaylorSolve>>=
+            st: List Stream SUP F := [coeffs, coeffs]
+@
+
+Consider an arbitrary equation $f\big(x, y(x)\big)=0$. When setting $x=
=0$, we
+obtain $f\big(0, y(0)\big)=0$. It is not necessarily the case that thi=
s
+determines $y(0)$ uniquely, so we need one initial value that satisfies =
this
+equation.
+\begin{ToDo}
+  [[seriesSolve]] should check that the given initial values satisfy $f\=
big(0, y(0),
+  y'(0),...\big) = 0$.
+\end{ToDo}
+Now consider the derivatives of $f$, where we write $y$ instead of $y(x)=
$ for
+better readability:
+\begin{equation*}
+  \frac{d}{dx}f(x, y)=f_1(x, y) + f_2(x, y)y^\prime
+\end{equation*}
+and
+\begin{align*}
+  \frac{d^2}{dx^2}f(x, y)&=f_{1,1}(x, y)\\
+                         &+f_{1,2}(x, y)y^\prime\\
+                         &+f_{2,1}(x, y)y^\prime\\
+                         &+f_{2,2}(x, y)(y^\prime)^2\\
+                         &+f_2(x, y)y^{\prime\prime}.
+\end{align*}
+In general, $\frac{d^2}{dx^2}f(x, y)$ depends only linearly on
+$y^{\prime\prime}$.
+
+\begin{ToDo}
+  This points to another possibility: Since we know that we only need to=
 solve
+  linear equations, we could compute two values and then use interpolati=
on.
+  This might be a bit slower, but more importantly: can we still check t=
hat we
+  have enough initial values? Furthermore, we then really need that $f$ =
is
+  analytic, i.e., operators are not necessarily allowed anymore. However=
, it
+  seems that composition is allowed.
+\end{ToDo}
+
+<<implementation: UTSSOL TaylorSolve>>=
+            next: () -> F :=
+                nr := st.1
+                res: F
+
+                if ground?(coeff: SUP F := nr.1)$(SUP F)
+@
+%$
+
+If the next element was already calculated, we can simply return it:
+
+<<implementation: UTSSOL TaylorSolve>>=
+                then
+                    res := ground coeff
+                    st.1 := rest nr
+                else
+@
+
+Otherwise, we have to find the first non-satisfied relation and solve it=
. It
+should be linear, or a single non-constant monomial. That is, the soluti=
on
+should be unique.
+
+<<implementation: UTSSOL TaylorSolve>>=
+                    ns := st.2
+                    eqs: Stream SUP F := coefficients f series ns
+                    while zero? first eqs repeat eqs := rest eqs
+                    eq: SUP F := first eqs
+                    if degree eq > 1 then
+                        if monomial? eq then res := 0
+                        else
+                            output(hconcat("The equation is: ", eq::Outp=
utForm))
+                                  $OutputPackage
+                            error "seriesSolve: equation for coefficient=
 not linear"
+                    else res := (-coefficient(eq, 0$NNI)$(SUP F)
+                                 /coefficient(eq, 1$NNI)$(SUP F))
+
+                    nr.1 := res::SUP F
+--                    concat!(st.2, monomial(1$F,1$NNI))
+                    st.1 := rest nr
+
+                res
+
+            series generate next
+
+@
+%$
+
+
 \section{package EXPRSOL ExpressionSolve}

 \begin{ToDo}
@@ -34,6 +184,7 @@ ExpressionSolve(R, F, UTSF, UTSSUPF): Exports == I=
mplementation where
     Exports == with

         seriesSolve: (F, OP, SY, List F) -> UTSF
+        replaceDiffs: (F, OP, Symbol) -> F

     Implementation == add
 <<implementation: EXPRSOL ExpressionSolve>>
@@ -51,18 +202,25 @@ It turns out that the compiler doesn't find the righ=
t definition of
 that's even cleaner. Also, we need to tell the compiler that kernels tha=
t are
 independent of the main variable should be coerced to elements of the
 coefficient ring, since it will complain otherwise.
+\begin{ToDo}
+  I cannot find an example for this behaviour right now. However, if I d=
o use
+  the coerce, the following fails:
+  \begin{verbatim}
+     seriesSolve(h x -1-x*h x *h(q*x), h, x, [1])
+  \end{verbatim}
+\end{ToDo}

 <<implementation: EXPRSOL ExpressionSolve>>=
         opelt := operator("elt"::Symbol)$OP
         opdiff := operator("D"::Symbol)$OP
         opcoerce := operator("coerce"::Symbol)$OP

-        replaceDiffs: (F, OP, Symbol) -> F
+--        replaceDiffs: (F, OP, Symbol) -> F
         replaceDiffs (expr, op, sy) ==
             lk := kernels expr
             for k in lk repeat
-                if freeOf?(coerce k, sy) then
-                    expr := subst(expr, [k], [opcoerce [coerce k]])
+--                if freeOf?(coerce k, sy) then
+--                    expr := subst(expr, [k], [opcoerce [coerce k]])

                 if is?(k, op) then
                     arg := first argument k
@@ -139,10 +297,8 @@ works. This is probably due to missing [[/]] in [[UF=
PS]].
 <<*>>=
 <<license>>

-
-<<pkg: UTSSOL TaylorSolve>>
-
-<<pkg: EXPRSOL ExpressionSolve>>
+<<package UTSSOL TaylorSolve>>
+<<package EXPRSOL ExpressionSolve>>

 @
 \end{document}
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.h=
tml
index 3189281..b6d0a87 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -817,6 +817,8 @@ bookvol10.3 add domains<br/>
 bookvol10.3 add domains<br/>
 <a href="patches/20081217.01.tpd.patch">20081217.01.tpd.patch</a>
 padic.spad removed<br/>
+<a href="patches/20081217.02.tpd.patch">20081217.02.tpd.patch</a>
+add guess package<br/>

  </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/src/input/ndftip.input.pamphlet b/src/input/ndftip.input.pam=
phlet
index 84578e4..3e4c0ab 100644
--- a/src/input/ndftip.input.pamphlet
+++ b/src/input/ndftip.input.pamphlet
@@ -586,7 +586,7 @@ hdftsD := nagHermitianDFT seqsD;
 --S 34 of 45 used to work?
 map(expand,hdftsD) :: List Vector Complex Float
 --R
---R   There are 68 exposed and 8 unexposed library operations named map
+--R   There are 68 exposed and 9 unexposed library operations named map
 --R      having 2 argument(s) but none was determined to be applicable.
 --R      Use HyperDoc Browse, or issue
 --R                               )display op map

\start
Date: Mon, 22 Dec 2008 00:47:09 -0600
From: Tim Daly
To: list
Subject: 20081219.01.wxh.patch (Float has exp: Float ->	Float)

Patch by Waldek to expand has questions for explicit signatures
=======================================================================
diff --git a/changelog b/changelog
index 1e0a9cf..f491f42 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081219 tpd src/axiom-website/patches.html 20081219.01.wxh.patch
+20081219 wxh src/interp/nrunfast.boot Float has exp : Float -> Float
 20081217 tpd src/axiom-website/patches.html 20081217.02.tpd.patch
 20081217 tpd src/input/ndftip.input fix regression on map operation count
 20081217 tpd src/algebra/Makefile remove wtpol.spad
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index b6d0a87..c8f6886 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -819,6 +819,8 @@ bookvol10.3 add domains<br/>
 padic.spad removed<br/>
 <a href="patches/20081217.02.tpd.patch">20081217.02.tpd.patch</a>
 add guess package<br/>
+<a href="patches/20081219.01.wxh.patch">20081219.01.wxh.patch</a>
+Float has exp: Float -> Float<br/>
 
  </body>
 </html>
diff --git a/src/interp/nrunfast.boot.pamphlet b/src/interp/nrunfast.boot.pamphlet
index 7613842..5c1c210 100644
--- a/src/interp/nrunfast.boot.pamphlet
+++ b/src/interp/nrunfast.boot.pamphlet
@@ -779,6 +779,10 @@ newHasTest(domform,catOrAtt) ==
 -- we will refuse to say yes for 'Cat has Cat'
 --GETDATABASE(opOf domform,'CONSTRUCTORKIND) = 'category => throwKeyedMsg("S2IS0025",NIL)
 -- on second thoughts we won't!
+  catOrAtt is [":", fun, ["Mapping", :sig1]] =>
+    evaluateType ["Mapping", :sig1] is ["Mapping", :sig2] =>
+      not(null(HasSignature(domform, [fun, sig2])))
+    systemError '"strange Mapping type in newHasTest"
   GETDATABASE(opOf domform,'CONSTRUCTORKIND) = 'category =>
       domform = catOrAtt => 'T
       for [aCat,:cond] in [:ancestorsOf(domform,NIL),:SUBLISLIS (rest domform,$FormalMapVariableList,GETDATABASE(opOf domform,'ATTRIBUTES))] |  aCat = catOrAtt  repeat

\start
Date: Mon, 22 Dec 2008 20:12:27 -0600
From: Tim Daly
To: list
Subject: 20081221.01.tpd.patch (bookvol10.3 add domains)

Break out MYEXPR, MYUP from GUESSF
Add a Gorka quote to readme
Add Ubuntu XTerm Xresources to download.html
========================================================================
diff --git a/books/bookvol10.3.pamphlet b/books/bookvol10.3.pamphlet
index 7d78657..453e0e2 100644
--- a/books/bookvol10.3.pamphlet
+++ b/books/bookvol10.3.pamphlet
@@ -47664,6 +47664,100 @@ MultivariatePolynomial(vl:List Symbol, R:Ring)
 
 @
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain MYEXPR MyExpression}
+\pagehead{MyExpression}{MYEXPR}
+\pagepic{ps/v103myexpression.ps}{MYEXPR}{1.00}
+See also:\\
+\refto{MyUnivariatePolynomial}{MYUP}
+<<domain MYEXPR MyExpression>>=
+)abbrev domain MYEXPR MyExpression
+MyExpression(q: Symbol, R): Exports == Implementation where
+
+  R: Join(Ring, OrderedSet, IntegralDomain)
+  UP ==> MyUnivariatePolynomial(q, R)
+
+  Exports == Join(FunctionSpace R, IntegralDomain,
+                RetractableTo UP, RetractableTo Symbol, 
+                RetractableTo Integer, CombinatorialOpsCategory,
+                PartialDifferentialRing Symbol) with
+              _* : (%,%) -> %
+              _/ : (%,%) -> %
+              _*_* : (%,%) -> %
+              numerator : % -> %
+              denominator : % -> %
+              ground? : % -> Boolean 
+
+              coerce: Fraction UP -> %
+              retract: % -> Fraction UP
+
+  Implementation == Expression R add
+    Rep := Expression R
+
+    iunivariate(p: Polynomial R): UP ==
+        poly: SparseUnivariatePolynomial(Polynomial R) 
+             := univariate(p, q)$(Polynomial R)
+        map(retract(#1), poly)$UnivariatePolynomialCategoryFunctions2(Polynomial R,
+                    SparseUnivariatePolynomial Polynomial R, 
+                    R, UP)
+
+    retract(p: %): Fraction UP == 
+        poly: Fraction Polynomial R := retract p
+        upoly: UP := iunivariate numer poly
+        vpoly: UP := iunivariate denom poly
+
+        upoly / vpoly
+
+    retract(p: %): UP == iunivariate retract p
+
+    coerce(r: Fraction UP): % == 
+       num: SparseUnivariatePolynomial R := makeSUP numer r
+       den: SparseUnivariatePolynomial R := makeSUP denom r
+       u: Polynomial R := multivariate(num, q)
+       v: Polynomial R := multivariate(den, q)
+
+       quot: Fraction Polynomial R := u/v
+
+       quot::(Expression R)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{domain MYUP MyUnivariatePolynomial}
+\pagehead{MyUnivariatePolynomial}{MYUP}
+\pagepic{ps/v103myunivariatepolynomial.ps}{MYUP}{1.00}
+See also:\\
+\refto{MyExpression}{MYEXPR}
+<<domain MYUP MyUnivariatePolynomial>>=
+)abbrev domain MYUP MyUnivariatePolynomial
+MyUnivariatePolynomial(x:Symbol, R:Ring):
+  UnivariatePolynomialCategory(R) with
+    RetractableTo Symbol;
+    coerce: Variable(x) -> %
+      ++ coerce(x) converts the variable x to a univariate polynomial.
+    fmecg: (%,NonNegativeInteger,R,%) -> %
+        ++ fmecg(p1,e,r,p2) finds X : p1 - r * X**e * p2
+    if R has univariate: (R, Symbol) -> SparseUnivariatePolynomial R
+    then coerce: R -> %
+    coerce: Polynomial R -> %
+   == SparseUnivariatePolynomial(R) add
+    Rep := SparseUnivariatePolynomial(R)
+    coerce(p: %):OutputForm  == outputForm(p, outputForm x)
+    coerce(x: Symbol): % == monomial(1, 1)
+    coerce(v: Variable(x)):% == monomial(1, 1)
+    retract(p: %): Symbol == 
+        retract(p)@SingletonAsOrderedSet
+        x
+    if R has univariate: (R, Symbol) -> SparseUnivariatePolynomial R
+    then coerce(p: R): % == univariate(p, x)$R
+
+    coerce(p: Polynomial R): % == 
+        poly: SparseUnivariatePolynomial(Polynomial R) 
+             := univariate(p, x)$(Polynomial R)
+        map(retract(#1), poly)$UnivariatePolynomialCategoryFunctions2(Polynomial R,
+                    SparseUnivariatePolynomial Polynomial R, 
+                    R, %)
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Chapter N}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{domain NSMP NewSparseMultivariatePolynomial}
@@ -91347,6 +91441,8 @@ Note that this code is not included in the generated catdef.spad file.
 <<domain MRING MonoidRing>>
 <<domain MSET Multiset>>
 <<domain MPOLY MultivariatePolynomial>>
+<<domain MYEXPR MyExpression>>
+<<domain MYUP MyUnivariatePolynomial>>
 
 <<domain NSMP NewSparseMultivariatePolynomial>>
 <<domain NSUP NewSparseUnivariatePolynomial>>
diff --git a/changelog b/changelog
index f491f42..fcdd260 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,11 @@
+20081221 tpd src/axiom-website/patches.html 20081221.01.tpd.patch
+20081221 tpd readme add Gorka quote
+20081221 tpd src/axiom-website/download.html XTerm*metaSendsEscape: true
+20081221 tpd src/algebra/Makefile.pamphlet
+20081221 tpd books/bookvol10.3 add domains
+20081221 tpd books/ps/v103myunivariatepolynomial.ps added
+20081221 tpd books/ps/v103myexpression.ps added
+20081221 tpd src/algebra/mantepse.spad move domains to bookvol10.3
 20081219 tpd src/axiom-website/patches.html 20081219.01.wxh.patch
 20081219 wxh src/interp/nrunfast.boot Float has exp : Float -> Float
 20081217 tpd src/axiom-website/patches.html 20081217.02.tpd.patch
diff --git a/readme b/readme
index c8f1a1c..ae718f3 100644
--- a/readme
+++ b/readme
@@ -1,3 +1,5 @@
+"What matters the most is what you do for free" -- John Gorka
+
 You've unpacked the Axiom source code to some directory. In this
 document we'll call that directory /home/me/axiom. Note that the path
 cannot contain uppercase characters or spaces. This is a porting
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index ce9ddba..e15ac4b 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -878,7 +878,8 @@ LAYER20=\
   ${OUT}/INTHERAL.o ${OUT}/INTPAF.o   ${OUT}/INTPM.o    ${OUT}/INTTOOLS.o \
   ${OUT}/ITRIGMNP.o ${OUT}/JORDAN.o   ${OUT}/KOVACIC.o  ${OUT}/LF.o       \
   ${OUT}/LIE.o      ${OUT}/LODOF.o    ${OUT}/LSQM.o     ${OUT}/OMEXPR.o   \
-  ${OUT}/MCMPLX.o   ${OUT}/MULTFACT.o ${OUT}/NAGD01.o   ${OUT}/NAGD02.o   \
+  ${OUT}/MCMPLX.o   ${OUT}/MULTFACT.o ${OUT}/MYEXPR.o  \
+  ${OUT}/NAGD01.o   ${OUT}/NAGD02.o   \
   ${OUT}/NAGF01.o   ${OUT}/NAGF02.o   ${OUT}/NAGF04.o   ${OUT}/NCEP.o     \
   ${OUT}/NLINSOL.o  ${OUT}/NSMP.o     ${OUT}/NUMERIC.o  ${OUT}/OCT.o      \
   ${OUT}/OCTCT2.o   ${OUT}/ODEPAL.o   ${OUT}/ODERTRIC.o ${OUT}/PADE.o     \
@@ -931,6 +932,7 @@ LAYER21=\
   ${OUT}/FDIV.o     ${OUT}/FSCINT.o   ${OUT}/FSINT.o    ${OUT}/FS2EXPXP.o \
   ${OUT}/GSERIES.o  ${OUT}/HELLFDIV.o ${OUT}/INVLAPLA.o ${OUT}/IR2F.o     \
   ${OUT}/IRRF2F.o   ${OUT}/LAPLACE.o  ${OUT}/LIMITPS.o  ${OUT}/LODEEF.o   \
+  ${OUT}/MYUP.o \
   ${OUT}/NODE1.o    ${OUT}/ODECONST.o ${OUT}/ODEINT.o   ${OUT}/RECOP.o    \
   ${OUT}/REP.o      \
   ${OUT}/SOLVERAD.o ${OUT}/SULS.o     ${OUT}/SUPXS.o    ${OUT}/UFPS1.o \
@@ -1181,7 +1183,7 @@ ${MID}/GUESSAN.nrlib/code.o: ${MID}/GUESSAN.spad
 	   fi )
 
 GUESSUPDEPS = NEWTON FAMR2 FFFG FFFGF SUPEXPR UTSSOL EXPRSOL GOPT GOPT0 \
-            UFPS RECOP UFPS1 GUESS
+            UFPS RECOP UFPS1 GUESS MYEXPR MYUP
 
 ${MID}/GUESSUP.nrlib/code.o: ${MID}/GUESSUP.spad
 	@echo S1 making ${MID}/GUESSUP.nrlib/code.o from ${MID}/GUESSUP.spad
@@ -3242,6 +3244,7 @@ ${HELP}/ZeroDimensionalSolvePackage.help: ${IN}/zerodim.spad.pamphlet
 <<layer21>>
 <<layer22>>
 <<layer23>>
+<<layer24>>
 <<USERLAYER>>
 <<order>>
 
diff --git a/src/algebra/mantepse.spad.pamphlet b/src/algebra/mantepse.spad.pamphlet
index 5addd74..b6c9ba3 100644
--- a/src/algebra/mantepse.spad.pamphlet
+++ b/src/algebra/mantepse.spad.pamphlet
@@ -2587,91 +2587,8 @@ GuessAlgebraicNumber() == Guess(AlgebraicNumber, AlgebraicNumber,
                            coerce$Expression(Integer))
 
 @
-
-
 \section{package GUESSUP GuessUnivariatePolynomial}
 <<package GUESSUP GuessUnivariatePolynomial>>=
-)abbrev domain MYUP MyUnivariatePolynomial
-MyUnivariatePolynomial(x:Symbol, R:Ring):
-  UnivariatePolynomialCategory(R) with
-    RetractableTo Symbol;
-    coerce: Variable(x) -> %
-      ++ coerce(x) converts the variable x to a univariate polynomial.
-    fmecg: (%,NonNegativeInteger,R,%) -> %
-        ++ fmecg(p1,e,r,p2) finds X : p1 - r * X**e * p2
-    if R has univariate: (R, Symbol) -> SparseUnivariatePolynomial R
-    then coerce: R -> %
-    coerce: Polynomial R -> %
-   == SparseUnivariatePolynomial(R) add
-    Rep := SparseUnivariatePolynomial(R)
-    coerce(p: %):OutputForm  == outputForm(p, outputForm x)
-    coerce(x: Symbol): % == monomial(1, 1)
-    coerce(v: Variable(x)):% == monomial(1, 1)
-    retract(p: %): Symbol == 
-        retract(p)@SingletonAsOrderedSet
-        x
-    if R has univariate: (R, Symbol) -> SparseUnivariatePolynomial R
-    then coerce(p: R): % == univariate(p, x)$R
-
-    coerce(p: Polynomial R): % == 
-        poly: SparseUnivariatePolynomial(Polynomial R) 
-             := univariate(p, x)$(Polynomial R)
-        map(retract(#1), poly)$UnivariatePolynomialCategoryFunctions2(Polynomial R,
-                    SparseUnivariatePolynomial Polynomial R, 
-                    R, %)
-
-
-)abbrev domain MYEXPR MyExpression
-MyExpression(q: Symbol, R): Exports == Implementation where
-
-  R: Join(Ring, OrderedSet, IntegralDomain)
-  UP ==> MyUnivariatePolynomial(q, R)
-
-  Exports == Join(FunctionSpace R, IntegralDomain,
-                RetractableTo UP, RetractableTo Symbol, 
-                RetractableTo Integer, CombinatorialOpsCategory,
-                PartialDifferentialRing Symbol) with
-              _* : (%,%) -> %
-              _/ : (%,%) -> %
-              _*_* : (%,%) -> %
-              numerator : % -> %
-              denominator : % -> %
-              ground? : % -> Boolean 
-
-              coerce: Fraction UP -> %
-              retract: % -> Fraction UP
-
-  Implementation == Expression R add
-    Rep := Expression R
-
-    iunivariate(p: Polynomial R): UP ==
-        poly: SparseUnivariatePolynomial(Polynomial R) 
-             := univariate(p, q)$(Polynomial R)
-        map(retract(#1), poly)$UnivariatePolynomialCategoryFunctions2(Polynomial R,
-                    SparseUnivariatePolynomial Polynomial R, 
-                    R, UP)
-
-    retract(p: %): Fraction UP == 
-        poly: Fraction Polynomial R := retract p
-        upoly: UP := iunivariate numer poly
-        vpoly: UP := iunivariate denom poly
-
-        upoly / vpoly
-
-    retract(p: %): UP == iunivariate retract p
-
-    coerce(r: Fraction UP): % == 
-       num: SparseUnivariatePolynomial R := makeSUP numer r
-       den: SparseUnivariatePolynomial R := makeSUP denom r
-       u: Polynomial R := multivariate(num, q)
-       v: Polynomial R := multivariate(den, q)
-
-       quot: Fraction Polynomial R := u/v
-
-       quot::(Expression R)
-
-
-
 )abbrev package GUESSUP GuessUnivariatePolynomial
 ++ Description:
 ++ This package exports guessing of sequences of univariate rational functions
diff --git a/src/axiom-website/download.html b/src/axiom-website/download.html
index 6576df9..875d2d3 100644
--- a/src/axiom-website/download.html
+++ b/src/axiom-website/download.html
@@ -1001,6 +1001,11 @@ cd axiom
 export AXIOM=`pwd`/mnt/ubuntu
 export PATH=$AXIOM/bin:$PATH
 make
+
+Also note that Ubuntu ships a broken xterm setting for the emacs alt key
+where alt is supposed to be meta. Add the following line 
+  XTerm*metaSendsEscape: true
+in your .Xresources file
    </pre>
 
   <h3>OpenSuSE</h3>
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index c8f6886..16f1537 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -821,6 +821,8 @@ padic.spad removed<br/>
 add guess package<br/>
 <a href="patches/20081219.01.wxh.patch">20081219.01.wxh.patch</a>
 Float has exp: Float -> Float<br/>
+<a href="patches/20081221.01.wxh.patch">20081221.01.wxh.patch</a>
+bookvol10.3 add domains<br/>
 
  </body>
 </html>

\start
Date: Tue, 23 Dec 2008 04:49:23 -0600
From: Tim Daly
To: list
Subject: 20081222.01.tpd.patch (algebra/Makefile add clique mechanism)

The clique mechanism solves mutual dependencies in source files
======================================================================
diff --git a/changelog b/changelog
index fcdd260..3911cc9 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081222 tpd src/axiom-website/patches.html 20081222.01.tpd.patch
+20081222 tpd src/algebra/Makefile add clique mechanism
 20081221 tpd src/axiom-website/patches.html 20081221.01.tpd.patch
 20081221 tpd readme add Gorka quote
 20081221 tpd src/axiom-website/download.html XTerm*metaSendsEscape: true
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index e15ac4b..ae238bd 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -878,7 +878,7 @@ LAYER20=\
   ${OUT}/INTHERAL.o ${OUT}/INTPAF.o   ${OUT}/INTPM.o    ${OUT}/INTTOOLS.o \
   ${OUT}/ITRIGMNP.o ${OUT}/JORDAN.o   ${OUT}/KOVACIC.o  ${OUT}/LF.o       \
   ${OUT}/LIE.o      ${OUT}/LODOF.o    ${OUT}/LSQM.o     ${OUT}/OMEXPR.o   \
-  ${OUT}/MCMPLX.o   ${OUT}/MULTFACT.o ${OUT}/MYEXPR.o  \
+  ${OUT}/MCMPLX.o   ${OUT}/MULTFACT.o ${MID}/clique1.spad \
   ${OUT}/NAGD01.o   ${OUT}/NAGD02.o   \
   ${OUT}/NAGF01.o   ${OUT}/NAGF02.o   ${OUT}/NAGF04.o   ${OUT}/NCEP.o     \
   ${OUT}/NLINSOL.o  ${OUT}/NSMP.o     ${OUT}/NUMERIC.o  ${OUT}/OCT.o      \
@@ -932,7 +932,6 @@ LAYER21=\
   ${OUT}/FDIV.o     ${OUT}/FSCINT.o   ${OUT}/FSINT.o    ${OUT}/FS2EXPXP.o \
   ${OUT}/GSERIES.o  ${OUT}/HELLFDIV.o ${OUT}/INVLAPLA.o ${OUT}/IR2F.o     \
   ${OUT}/IRRF2F.o   ${OUT}/LAPLACE.o  ${OUT}/LIMITPS.o  ${OUT}/LODEEF.o   \
-  ${OUT}/MYUP.o \
   ${OUT}/NODE1.o    ${OUT}/ODECONST.o ${OUT}/ODEINT.o   ${OUT}/RECOP.o    \
   ${OUT}/REP.o      \
   ${OUT}/SOLVERAD.o ${OUT}/SULS.o     ${OUT}/SUPXS.o    ${OUT}/UFPS1.o \
@@ -1024,6 +1023,29 @@ ORDER=\
   ${LAYER22}  ${LAYER23} ${LAYER24} ${USERLAYER} ${LAYER0COPY}
 
 @
+\section{Cliques}
+The algebra code sometimes have circular references. The compiler can
+resolve these references directly if all of the required sources
+are in the same source file.
+
+So the idea to remove the BOOTSTRAP code is to cluster the spad
+sources into "cliqueN.spad" files and feed them all to the compiler
+at once.
+<<newcode>>=
+CLIQUE1DEPS = ${MID}/MYUP.spad ${MID}/MYEXPR.spad
+
+${MID}/clique1.spad: ${CLIQUE1DEPS}
+	@echo cl1 making ${OUT}/MYUP.o from ${MID}/clique1.spad
+	@echo cl1 making ${OUT}/MYEXPR.o from ${MID}/clique1.spad
+	@ (cd ${MID} ; \
+	   cat ${CLIQUE1DEPS} >clique1.spad ; \
+	   if [ -z "${NOISE}" ] ; then \
+	    echo ")co clique1.spad" | ${INTERPSYS}  ; \
+           else \
+	    echo ")co clique1.spad" | ${INTERPSYS} >${TMP}/trace ; \
+	   fi )
+	
+@
 \section{New Algebra dependencies}
 
 New algebra files can depend on new algebra files. Since these files
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 16f1537..c42abc6 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -823,6 +823,8 @@ add guess package<br/>
 Float has exp: Float -> Float<br/>
 <a href="patches/20081221.01.wxh.patch">20081221.01.wxh.patch</a>
 bookvol10.3 add domains<br/>
+<a href="patches/20081222.01.tpd.patch">20081222.01.tpd.patch</a>
+algebra/Makefile add clique mechanism<br/>
 
  </body>
 </html>

\start
Date: Tue, 23 Dec 2008 13:45:43 -0600
From: Tim Daly
To: list
Subject: 20081223.02.tpd.patch (algebra/Makefile move BASTYPE to layer 0)

BASTYPE needs no support files.
=======================================================================
diff --git a/changelog b/changelog
index c7e254d..c659d48 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081223 tpd src/axiom-website/patches.html 20081223.02.tpd.patch
+20081223 tpd src/algebra/Makefile move BASTYPE to layer 0
 20081223 tpd src/axiom-website/patches.html 20081223.01.tpd.patch
 20081223 tpd src/algebra/Makefile move AGG to layer 1
 20081222 tpd src/axiom-website/patches.html 20081222.01.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 61cc610..ead9000 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -176,7 +176,8 @@ system.spad.pamphlet  (MSYSCMD)
 <<layer0>>=
 
 LAYER0=\
-  ${OUT}/AHYP.o    ${OUT}/ATTREG.o  ${OUT}/CFCAT.o   ${OUT}/ELTAB.o    \
+  ${OUT}/AHYP.o    ${OUT}/ATTREG.o  ${OUT}/BASTYPE.o ${OUT}/BASTYPE-.o \
+  ${OUT}/CFCAT.o   ${OUT}/ELTAB.o    \
   ${OUT}/KOERCE.o  ${OUT}/KONVERT.o ${OUT}/MSYSCMD.o ${OUT}/ODEIFTBL.o \
   ${OUT}/OM.o      ${OUT}/OMCONN.o  ${OUT}/OMDEV.o   ${OUT}/OUT.o      \
   ${OUT}/PRIMCAT.o ${OUT}/PRINT.o   ${OUT}/PTRANFN.o ${OUT}/SPFCAT.o   \
@@ -225,7 +226,6 @@ grdef.spad.pamphlet (GRDEF)
 <<layer3>>=
 
 LAYER3=\
-  ${OUT}/BASTYPE.o ${OUT}/BASTYPE-.o \
   ${OUT}/GRDEF.o ${OUT}/LIST3.o ${OUT}/MKFUNC.o \
   layer3done
 
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index fc9f5fc..c16accc 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -827,6 +827,8 @@ bookvol10.3 add domains<br/>
 algebra/Makefile add clique mechanism<br/>
 <a href="patches/20081223.01.tpd.patch">20081223.01.tpd.patch</a>
 algebra/Makefile move AGG to layer1<br/>
+<a href="patches/20081223.02.tpd.patch">20081223.02.tpd.patch</a>
+algebra/Makefile move BASTYPE to layer0<br/>
 
  </body>
 </html>

\start
Date: Wed, 24 Dec 2008 00:17:48 -0600
From: Tim Daly
To: list
Subject: 20081223.04.tpd.patch (algebra/Makefile move LIST3 to layer 1)

Move LIST3 to layer 1
===================================================================
diff --git a/changelog b/changelog
index 63a237d..96bdf8e 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081223 tpd src/axiom-website/patches.html 20081223.04.tpd.patch
+20081223 tpd src/algebra/Makefile move LIST3 to layer 1
 20081223 tpd src/axiom-website/patches.html 20081223.03.tpd.patch
 20081223 tpd src/algebra/Makefile move GRDEF to layer 0
 20081223 tpd src/axiom-website/patches.html 20081223.02.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 504a0ab..39d107f 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -198,6 +198,7 @@ LAYER1=\
   ${OUT}/AGG.o     ${OUT}/AGG-.o \
   ${OUT}/ANY1.o     ${OUT}/COMBOPC.o  ${OUT}/DROPT1.o   ${OUT}/EQ2.o      \
   ${OUT}/FORTCAT.o  ${OUT}/ITFUN2.o   ${OUT}/ITFUN3.o   ${OUT}/ITUPLE.o   \
+  ${OUT}/LIST3.o \
   ${OUT}/MKBCFUNC.o ${OUT}/MKRECORD.o ${OUT}/MKUCFUNC.o ${OUT}/NONE1.o    \
   ${OUT}/PATAB.o    ${OUT}/PLOT1.o    ${OUT}/PPCURVE.o  ${OUT}/PSCURVE.o  \
   ${OUT}/REAL.o     ${OUT}/RESLATC.o  ${OUT}/RETRACT.o  ${OUT}/RETRACT-.o \
@@ -218,11 +219,15 @@ LAYER2=\
 
 @
 \subsection{Layer 3}
+\subsubsection{Completed spad files}
+\begin{verbatim}
+grdef.spad.pamphlet (GRDEF)
+\end{verbatim}
 
 <<layer3>>=
 
 LAYER3=\
-  ${OUT}/LIST3.o ${OUT}/MKFUNC.o \
+ ${OUT}/MKFUNC.o \
   layer3done
 
 @
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 287754e..ae73df3 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -831,6 +831,8 @@ algebra/Makefile move AGG to layer1<br/>
 algebra/Makefile move BASTYPE to layer0<br/>
 <a href="patches/20081223.03.tpd.patch">20081223.03.tpd.patch</a>
 algebra/Makefile move GRDEF to layer0<br/>
+<a href="patches/20081223.04.tpd.patch">20081223.04.tpd.patch</a>
+algebra/Makefile move LIST3 to layer1<br/>
 
  </body>
 </html>

\start
Date: Wed, 24 Dec 2008 01:25:06 -0600
From: Tim Daly
To: list
Subject: 20081223.05.tpd.patch (algebra/Makefile move MKFUNC to layer 1)

Move MKFUNC.o to layer 1 of the build
=====================================================================
diff --git a/changelog b/changelog
index 96bdf8e..9ebadaf 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081223 tpd src/axiom-website/patches.html 20081223.05.tpd.patch
+20081223 tpd src/algebra/Makefile move MKFUNC to layer 1
 20081223 tpd src/axiom-website/patches.html 20081223.04.tpd.patch
 20081223 tpd src/algebra/Makefile move LIST3 to layer 1
 20081223 tpd src/axiom-website/patches.html 20081223.03.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 39d107f..2609c50 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -199,7 +199,8 @@ LAYER1=\
   ${OUT}/ANY1.o     ${OUT}/COMBOPC.o  ${OUT}/DROPT1.o   ${OUT}/EQ2.o      \
   ${OUT}/FORTCAT.o  ${OUT}/ITFUN2.o   ${OUT}/ITFUN3.o   ${OUT}/ITUPLE.o   \
   ${OUT}/LIST3.o \
-  ${OUT}/MKBCFUNC.o ${OUT}/MKRECORD.o ${OUT}/MKUCFUNC.o ${OUT}/NONE1.o    \
+  ${OUT}/MKBCFUNC.o ${OUT}/MKFUNC.o \
+  ${OUT}/MKRECORD.o ${OUT}/MKUCFUNC.o ${OUT}/NONE1.o    \
   ${OUT}/PATAB.o    ${OUT}/PLOT1.o    ${OUT}/PPCURVE.o  ${OUT}/PSCURVE.o  \
   ${OUT}/REAL.o     ${OUT}/RESLATC.o  ${OUT}/RETRACT.o  ${OUT}/RETRACT-.o \
   ${OUT}/SEGBIND2.o ${OUT}/SEGCAT.o   ${OUT}/STREAM1.o  ${OUT}/STREAM2.o  \
@@ -227,7 +228,6 @@ grdef.spad.pamphlet (GRDEF)
 <<layer3>>=
 
 LAYER3=\
- ${OUT}/MKFUNC.o \
   layer3done
 
 @
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index ae73df3..09fe518 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -833,6 +833,8 @@ algebra/Makefile move BASTYPE to layer0<br/>
 algebra/Makefile move GRDEF to layer0<br/>
 <a href="patches/20081223.04.tpd.patch">20081223.04.tpd.patch</a>
 algebra/Makefile move LIST3 to layer1<br/>
+<a href="patches/20081223.05.tpd.patch">20081223.05.tpd.patch</a>
+algebra/Makefile move MKFUNC to layer1<br/>
 
  </body>
 </html>

\start
Date: Wed, 24 Dec 2008 02:55:08 -0600
From: Tim Daly
To: list
Subject: 20081223.06.tpd.patch (algebra/Makefile move ESCONT1 to layer 0)

Move ESCONT1.o to layer 0
=====================================================================
diff --git a/changelog b/changelog
index 9ebadaf..887af71 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081223 tpd src/axiom-website/patches.html 20081223.06.tpd.patch
+20081223 tpd src/algebra/Makefile move ESCONT1 to layer 0
 20081223 tpd src/axiom-website/patches.html 20081223.05.tpd.patch
 20081223 tpd src/algebra/Makefile move MKFUNC to layer 1
 20081223 tpd src/axiom-website/patches.html 20081223.04.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 2609c50..5784f2f 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -177,7 +177,7 @@ system.spad.pamphlet  (MSYSCMD)
 
 LAYER0=\
   ${OUT}/AHYP.o    ${OUT}/ATTREG.o  ${OUT}/BASTYPE.o ${OUT}/BASTYPE-.o \
-  ${OUT}/CFCAT.o   ${OUT}/ELTAB.o   ${OUT}/GRDEF.o \
+  ${OUT}/CFCAT.o   ${OUT}/ELTAB.o   ${OUT}/ESCONT1.o ${OUT}/GRDEF.o \
   ${OUT}/KOERCE.o  ${OUT}/KONVERT.o ${OUT}/MSYSCMD.o ${OUT}/ODEIFTBL.o \
   ${OUT}/OM.o      ${OUT}/OMCONN.o  ${OUT}/OMDEV.o   ${OUT}/OUT.o      \
   ${OUT}/PRIMCAT.o ${OUT}/PRINT.o   ${OUT}/PTRANFN.o ${OUT}/SPFCAT.o   \
@@ -242,7 +242,7 @@ ystream.spad.pamphlet (YSTREAM)
 
 LAYER4=\
   ${OUT}/ANON.o     ${OUT}/COLOR.o    ${OUT}/COMM.o     ${OUT}/COMPPROP.o \
-  ${OUT}/ELTAGG.o   ${OUT}/ELTAGG-.o  ${OUT}/ESCONT1.o  ${OUT}/EXIT.o     \
+  ${OUT}/ELTAGG.o   ${OUT}/ELTAGG-.o  ${OUT}/EXIT.o     \
   ${OUT}/FAMONC.o   ${OUT}/FILECAT.o  ${OUT}/FINITE.o   ${OUT}/FNCAT.o    \
   ${OUT}/FORMULA1.o ${OUT}/IDPC.o     ${OUT}/IEVALAB.o  ${OUT}/IEVALAB-.o \
   ${OUT}/INTBIT.o   ${OUT}/LMODULE.o  ${OUT}/LOGIC.o    ${OUT}/LOGIC-.o   \
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 09fe518..77f3f1e 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -835,6 +835,8 @@ algebra/Makefile move GRDEF to layer0<br/>
 algebra/Makefile move LIST3 to layer1<br/>
 <a href="patches/20081223.05.tpd.patch">20081223.05.tpd.patch</a>
 algebra/Makefile move MKFUNC to layer1<br/>
+<a href="patches/20081223.06.tpd.patch">20081223.06.tpd.patch</a>
+algebra/Makefile move ESCONT1 to layer0<br/>
 
  </body>
 </html>

\start
Date: Wed, 24 Dec 2008 03:52:45 -0600
From: Tim Daly
To: list
Subject: 20081224.01.tpd.patch (algebra/Makefile move PARPCURV to layer 1)

Move PARPCURV to layer 1
=======================================================================
diff --git a/changelog b/changelog
index 887af71..a311aff 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081224 tpd src/axiom-website/patches.html 20081224.01.tpd.patch
+20081224 tpd src/algebra/Makefile move PARPCURV to layer 1
 20081223 tpd src/axiom-website/patches.html 20081223.06.tpd.patch
 20081223 tpd src/algebra/Makefile move ESCONT1 to layer 0
 20081223 tpd src/axiom-website/patches.html 20081223.05.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 5784f2f..f28f5ce 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -201,6 +201,7 @@ LAYER1=\
   ${OUT}/LIST3.o \
   ${OUT}/MKBCFUNC.o ${OUT}/MKFUNC.o \
   ${OUT}/MKRECORD.o ${OUT}/MKUCFUNC.o ${OUT}/NONE1.o    \
+  ${OUT}/PARPCURV.o \
   ${OUT}/PATAB.o    ${OUT}/PLOT1.o    ${OUT}/PPCURVE.o  ${OUT}/PSCURVE.o  \
   ${OUT}/REAL.o     ${OUT}/RESLATC.o  ${OUT}/RETRACT.o  ${OUT}/RETRACT-.o \
   ${OUT}/SEGBIND2.o ${OUT}/SEGCAT.o   ${OUT}/STREAM1.o  ${OUT}/STREAM2.o  \
@@ -251,7 +252,7 @@ LAYER4=\
   ${OUT}/NIPROB.o   ${OUT}/NONE.o     ${OUT}/NUMINT.o   ${OUT}/ODECAT.o   \
   ${OUT}/ODEPROB.o  ${OUT}/OMENC.o    ${OUT}/ONECOMP2.o ${OUT}/OPTCAT.o   \
   ${OUT}/OPTPROB.o  ${OUT}/ORDSET.o   ${OUT}/ORDSET-.o  ${OUT}/PALETTE.o  \
-  ${OUT}/PARPCURV.o ${OUT}/PARPC2.o   ${OUT}/PARSCURV.o ${OUT}/PARSC2.o   \
+  ${OUT}/PARPC2.o   ${OUT}/PARSCURV.o ${OUT}/PARSC2.o   \
   ${OUT}/PARSURF.o  ${OUT}/PARSU2.o   ${OUT}/PATMAB.o   ${OUT}/PATRES2.o  \
   ${OUT}/PATTERN1.o ${OUT}/PDECAT.o   ${OUT}/PDEPROB.o  ${OUT}/REPSQ.o    \
   ${OUT}/REPDB.o    ${OUT}/RFDIST.o   ${OUT}/RIDIST.o   ${OUT}/RMODULE.o  \
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 77f3f1e..364bafe 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -837,6 +837,8 @@ algebra/Makefile move LIST3 to layer1<br/>
 algebra/Makefile move MKFUNC to layer1<br/>
 <a href="patches/20081223.06.tpd.patch">20081223.06.tpd.patch</a>
 algebra/Makefile move ESCONT1 to layer0<br/>
+<a href="patches/20081224.01.tpd.patch">20081224.01.tpd.patch</a>
+algebra/Makefile move PARPCURV to layer1<br/>
 
  </body>
 </html>

\start
Date: Wed, 24 Dec 2008 05:15:22 -0600
From: Tim Daly
To: list
Subject: 20081224.02.tpd.patch (algebra/Makefile move PARPC2 to layer 1)

Move PARPC2 to layer 1
=====================================================================
diff --git a/changelog b/changelog
index a311aff..6a7efd9 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081224 tpd src/axiom-website/patches.html 20081224.02.tpd.patch
+20081224 tpd src/algebra/Makefile move PARPC2 to layer 1
 20081224 tpd src/axiom-website/patches.html 20081224.01.tpd.patch
 20081224 tpd src/algebra/Makefile move PARPCURV to layer 1
 20081223 tpd src/axiom-website/patches.html 20081223.06.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index f28f5ce..623e1d6 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -201,7 +201,7 @@ LAYER1=\
   ${OUT}/LIST3.o \
   ${OUT}/MKBCFUNC.o ${OUT}/MKFUNC.o \
   ${OUT}/MKRECORD.o ${OUT}/MKUCFUNC.o ${OUT}/NONE1.o    \
-  ${OUT}/PARPCURV.o \
+  ${OUT}/PARPCURV.o ${OUT}/PARPC2.o \
   ${OUT}/PATAB.o    ${OUT}/PLOT1.o    ${OUT}/PPCURVE.o  ${OUT}/PSCURVE.o  \
   ${OUT}/REAL.o     ${OUT}/RESLATC.o  ${OUT}/RETRACT.o  ${OUT}/RETRACT-.o \
   ${OUT}/SEGBIND2.o ${OUT}/SEGCAT.o   ${OUT}/STREAM1.o  ${OUT}/STREAM2.o  \
@@ -252,7 +252,7 @@ LAYER4=\
   ${OUT}/NIPROB.o   ${OUT}/NONE.o     ${OUT}/NUMINT.o   ${OUT}/ODECAT.o   \
   ${OUT}/ODEPROB.o  ${OUT}/OMENC.o    ${OUT}/ONECOMP2.o ${OUT}/OPTCAT.o   \
   ${OUT}/OPTPROB.o  ${OUT}/ORDSET.o   ${OUT}/ORDSET-.o  ${OUT}/PALETTE.o  \
-  ${OUT}/PARPC2.o   ${OUT}/PARSCURV.o ${OUT}/PARSC2.o   \
+  ${OUT}/PARSCURV.o ${OUT}/PARSC2.o   \
   ${OUT}/PARSURF.o  ${OUT}/PARSU2.o   ${OUT}/PATMAB.o   ${OUT}/PATRES2.o  \
   ${OUT}/PATTERN1.o ${OUT}/PDECAT.o   ${OUT}/PDEPROB.o  ${OUT}/REPSQ.o    \
   ${OUT}/REPDB.o    ${OUT}/RFDIST.o   ${OUT}/RIDIST.o   ${OUT}/RMODULE.o  \
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 364bafe..dce3b5b 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -839,6 +839,8 @@ algebra/Makefile move MKFUNC to layer1<br/>
 algebra/Makefile move ESCONT1 to layer0<br/>
 <a href="patches/20081224.01.tpd.patch">20081224.01.tpd.patch</a>
 algebra/Makefile move PARPCURV to layer1<br/>
+<a href="patches/20081224.02.tpd.patch">20081224.02.tpd.patch</a>
+algebra/Makefile move PARPC2 to layer1<br/>
 
  </body>
 </html>

\start
Date: Wed, 24 Dec 2008 07:11:28 -0600
From: Tim Daly
To: list
Subject: 20081224.03.tpd.patch (algebra/Makefile move PARSCURV to layer 1)

Move PARSCURV to layer 1
===================================================================
diff --git a/changelog b/changelog
index 6a7efd9..f4e7344 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081224 tpd src/axiom-website/patches.html 20081224.03.tpd.patch
+20081224 tpd src/algebra/Makefile move PARSCURV to layer 1
 20081224 tpd src/axiom-website/patches.html 20081224.02.tpd.patch
 20081224 tpd src/algebra/Makefile move PARPC2 to layer 1
 20081224 tpd src/axiom-website/patches.html 20081224.01.tpd.patch
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index dce3b5b..9e12433 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -841,6 +841,8 @@ algebra/Makefile move ESCONT1 to layer0<br/>
 algebra/Makefile move PARPCURV to layer1<br/>
 <a href="patches/20081224.02.tpd.patch">20081224.02.tpd.patch</a>
 algebra/Makefile move PARPC2 to layer1<br/>
+<a href="patches/20081224.03.tpd.patch">20081224.03.tpd.patch</a>
+algebra/Makefile move PARSCURV to layer1<br/>
 
  </body>
 </html>

\start
Date: Wed, 24 Dec 2008 08:57:30 -0600
From: Tim Daly
To: list
Subject: 20081224.04.tpd.patch (algebra/Makefile move PARCS2 to layer 1)

Move PARCS2 to layer 1 
=====================================================================
diff --git a/changelog b/changelog
index f4e7344..84caf07 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081224 tpd src/axiom-website/patches.html 20081224.04.tpd.patch
+20081224 tpd src/algebra/Makefile move PARSC2 to layer 1
 20081224 tpd src/axiom-website/patches.html 20081224.03.tpd.patch
 20081224 tpd src/algebra/Makefile move PARSCURV to layer 1
 20081224 tpd src/axiom-website/patches.html 20081224.02.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 623e1d6..d7734be 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -201,7 +201,7 @@ LAYER1=\
   ${OUT}/LIST3.o \
   ${OUT}/MKBCFUNC.o ${OUT}/MKFUNC.o \
   ${OUT}/MKRECORD.o ${OUT}/MKUCFUNC.o ${OUT}/NONE1.o    \
-  ${OUT}/PARPCURV.o ${OUT}/PARPC2.o \
+  ${OUT}/PARPCURV.o ${OUT}/PARPC2.o   ${OUT}/PARSCURV.o ${OUT}/PARSC2.o \
   ${OUT}/PATAB.o    ${OUT}/PLOT1.o    ${OUT}/PPCURVE.o  ${OUT}/PSCURVE.o  \
   ${OUT}/REAL.o     ${OUT}/RESLATC.o  ${OUT}/RETRACT.o  ${OUT}/RETRACT-.o \
   ${OUT}/SEGBIND2.o ${OUT}/SEGCAT.o   ${OUT}/STREAM1.o  ${OUT}/STREAM2.o  \
@@ -252,7 +252,6 @@ LAYER4=\
   ${OUT}/NIPROB.o   ${OUT}/NONE.o     ${OUT}/NUMINT.o   ${OUT}/ODECAT.o   \
   ${OUT}/ODEPROB.o  ${OUT}/OMENC.o    ${OUT}/ONECOMP2.o ${OUT}/OPTCAT.o   \
   ${OUT}/OPTPROB.o  ${OUT}/ORDSET.o   ${OUT}/ORDSET-.o  ${OUT}/PALETTE.o  \
-  ${OUT}/PARSCURV.o ${OUT}/PARSC2.o   \
   ${OUT}/PARSURF.o  ${OUT}/PARSU2.o   ${OUT}/PATMAB.o   ${OUT}/PATRES2.o  \
   ${OUT}/PATTERN1.o ${OUT}/PDECAT.o   ${OUT}/PDEPROB.o  ${OUT}/REPSQ.o    \
   ${OUT}/REPDB.o    ${OUT}/RFDIST.o   ${OUT}/RIDIST.o   ${OUT}/RMODULE.o  \
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 9e12433..1f4ea90 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -843,6 +843,8 @@ algebra/Makefile move PARPCURV to layer1<br/>
 algebra/Makefile move PARPC2 to layer1<br/>
 <a href="patches/20081224.03.tpd.patch">20081224.03.tpd.patch</a>
 algebra/Makefile move PARSCURV to layer1<br/>
+<a href="patches/20081224.04.tpd.patch">20081224.04.tpd.patch</a>
+algebra/Makefile move PARS2 to layer1<br/>
 
  </body>
 </html>

\start
Date: Wed, 24 Dec 2008 11:33:23 -0600
From: Tim Daly
To: list
Subject: 20081224.05.tpd.patch (algebra/Makefile collapse layer 4 into 1 and 2)

Layer 4 collapses into layers 1 and 2.
The graph now eliminates layers 3 and 4 completely.
=========================================================================
diff --git a/changelog b/changelog
index 84caf07..e2be770 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081224 tpd src/axiom-website/patches.html 20081224.05.tpd.patch
+20081224 tpd src/algebra/Makefile collapse layer 4 into 1 and 2
 20081224 tpd src/axiom-website/patches.html 20081224.04.tpd.patch
 20081224 tpd src/algebra/Makefile move PARSC2 to layer 1
 20081224 tpd src/axiom-website/patches.html 20081224.03.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index d7734be..7966832 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -167,65 +167,66 @@ LAYER0COPY=\
 
 @
 \subsection{Layer 0}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-print.spad.pamphlet   (PRINT)
-system.spad.pamphlet  (MSYSCMD)
-\end{verbatim}
-
+Depends on: Category Domain Package Bootstrap\\
+Used by next layer: BASTYPE CFCAT KOERCE KONVERT TYPE
 <<layer0>>=
 
 LAYER0=\
-  ${OUT}/AHYP.o    ${OUT}/ATTREG.o  ${OUT}/BASTYPE.o ${OUT}/BASTYPE-.o \
-  ${OUT}/CFCAT.o   ${OUT}/ELTAB.o   ${OUT}/ESCONT1.o ${OUT}/GRDEF.o \
-  ${OUT}/KOERCE.o  ${OUT}/KONVERT.o ${OUT}/MSYSCMD.o ${OUT}/ODEIFTBL.o \
-  ${OUT}/OM.o      ${OUT}/OMCONN.o  ${OUT}/OMDEV.o   ${OUT}/OUT.o      \
-  ${OUT}/PRIMCAT.o ${OUT}/PRINT.o   ${OUT}/PTRANFN.o ${OUT}/SPFCAT.o   \
-  ${OUT}/TYPE.o \
+  ${OUT}/AHYP.o     ${OUT}/ATTREG.o  ${OUT}/BASTYPE.o ${OUT}/BASTYPE-.o \
+  ${OUT}/CFCAT.o    ${OUT}/ELTAB.o   ${OUT}/ESCONT1.o ${OUT}/GRDEF.o \
+  ${OUT}/INTBIT.o   ${OUT}/KOERCE.o  ${OUT}/KONVERT.o ${OUT}/MSYSCMD.o \
+  ${OUT}/ODEIFTBL.o ${OUT}/OM.o      ${OUT}/OMCONN.o  ${OUT}/OMDEV.o  \
+  ${OUT}/OUT.o      ${OUT}/PRIMCAT.o ${OUT}/PRINT.o   ${OUT}/PTRANFN.o \
+  ${OUT}/RFDIST.o   ${OUT}/RIDIST.o  ${OUT}/SPFCAT.o  ${OUT}/TYPE.o \
   layer0done
 
 @
 \subsection{Layer 1}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-ituple.spad.pamphlet   (ITFUN2 ITFUN3 ITUPLE)
-mkrecord.spad.pamphlet (MKRECORD)
-\end{verbatim}
+Depends on: BASTYPE CFCAT KOERCE KONVERT TYPE\\
+Used by next layer: FORTCAT RETRACT SETCAT
+
 
 <<layer1>>=
 
 LAYER1=\
-  ${OUT}/AGG.o     ${OUT}/AGG-.o \
-  ${OUT}/ANY1.o     ${OUT}/COMBOPC.o  ${OUT}/DROPT1.o   ${OUT}/EQ2.o      \
-  ${OUT}/FORTCAT.o  ${OUT}/ITFUN2.o   ${OUT}/ITFUN3.o   ${OUT}/ITUPLE.o   \
-  ${OUT}/LIST3.o \
-  ${OUT}/MKBCFUNC.o ${OUT}/MKFUNC.o \
-  ${OUT}/MKRECORD.o ${OUT}/MKUCFUNC.o ${OUT}/NONE1.o    \
-  ${OUT}/PARPCURV.o ${OUT}/PARPC2.o   ${OUT}/PARSCURV.o ${OUT}/PARSC2.o \
-  ${OUT}/PATAB.o    ${OUT}/PLOT1.o    ${OUT}/PPCURVE.o  ${OUT}/PSCURVE.o  \
-  ${OUT}/REAL.o     ${OUT}/RESLATC.o  ${OUT}/RETRACT.o  ${OUT}/RETRACT-.o \
-  ${OUT}/SEGBIND2.o ${OUT}/SEGCAT.o   ${OUT}/STREAM1.o  ${OUT}/STREAM2.o  \
-  ${OUT}/STREAM3.o \
+  ${OUT}/AGG.o      ${OUT}/AGG-.o     ${OUT}/ANON.o     ${OUT}/ANY1.o     \
+  ${OUT}/COLOR.o    ${OUT}/COMBOPC.o  ${OUT}/COMM.o     ${OUT}/COMPPROP.o \
+  ${OUT}/DROPT1.o   ${OUT}/ELTAGG.o   ${OUT}/ELTAGG-.o  ${OUT}/EQ2.o      \
+  ${OUT}/EXIT.o     ${OUT}/FILECAT.o  ${OUT}/FINITE.o   ${OUT}/FNCAT.o    \
+  ${OUT}/FORMULA1.o ${OUT}/FORTCAT.o  ${OUT}/IDPC.o     ${OUT}/IEVALAB.o  \
+  ${OUT}/IEVALAB-.o ${OUT}/ITFUN2.o   ${OUT}/ITFUN3.o   ${OUT}/ITUPLE.o   \
+  ${OUT}/LIST3.o    ${OUT}/LMODULE.o  ${OUT}/LOGIC.o    ${OUT}/LOGIC-.o   \
+  ${OUT}/MAPHACK1.o ${OUT}/MAPHACK2.o ${OUT}/MAPHACK3.o ${OUT}/MAPPKG1.o  \
+  ${OUT}/MAPPKG2.o  ${OUT}/MAPPKG3.o  ${OUT}/MKBCFUNC.o ${OUT}/MKFUNC.o   \
+  ${OUT}/MKRECORD.o ${OUT}/MKUCFUNC.o ${OUT}/MONAD.o    ${OUT}/MONAD-.o   \
+  ${OUT}/NIPROB.o   ${OUT}/NONE.o     ${OUT}/NONE1.o    ${OUT}/NUMINT.o   \
+  ${OUT}/ODECAT.o   ${OUT}/ODEPROB.o  ${OUT}/OMENC.o    ${OUT}/ONECOMP2.o \
+  ${OUT}/OPTCAT.o   ${OUT}/OPTPROB.o  ${OUT}/ORDSET.o   ${OUT}/ORDSET-.o  \
+  ${OUT}/PALETTE.o  ${OUT}/PARPCURV.o ${OUT}/PARPC2.o   ${OUT}/PARSCURV.o \
+  ${OUT}/PARSC2.o   ${OUT}/PARSURF.o  ${OUT}/PARSU2.o   ${OUT}/PATAB.o    \
+  ${OUT}/PATMAB.o   ${OUT}/PATRES2.o  ${OUT}/PATTERN1.o ${OUT}/PDECAT.o   \
+  ${OUT}/PDEPROB.o  ${OUT}/PLOT1.o    ${OUT}/PPCURVE.o  ${OUT}/PSCURVE.o  \
+  ${OUT}/REAL.o     ${OUT}/REPDB.o    ${OUT}/REPSQ.o    ${OUT}/RESLATC.o  \
+  ${OUT}/RETRACT.o  ${OUT}/RETRACT-.o ${OUT}/RMODULE.o  ${OUT}/SEGBIND2.o \
+  ${OUT}/SEGCAT.o   ${OUT}/SEXCAT.o   ${OUT}/SGROUP.o   ${OUT}/SGROUP-.o  \
+  ${OUT}/SPACEC.o   ${OUT}/SPLNODE.o  ${OUT}/STEP.o     ${OUT}/STREAM1.o  \
+  ${OUT}/STREAM2.o  ${OUT}/STREAM3.o  ${OUT}/SUCH.o     ${OUT}/TEX1.o     \
+  ${OUT}/UDVO.o     ${OUT}/YSTREAM.o \
   layer1done
 
+  
 @
 \subsection{Layer 2}
-\subsubsection{Completed spad files}
-
+Depends on: FORTCAT RETRACT SETCAT
 <<layer2>>=
 
 LAYER2=\
-  ${OUT}/FMC.o   ${OUT}/FMFUN.o   ${OUT}/FORTFN.o  ${OUT}/FVC.o  \
-  ${OUT}/FVFUN.o ${OUT}/INTRET.o  ${OUT}/SEGXCAT.o  \
+  ${OUT}/FAMONC.o ${OUT}/FMC.o   ${OUT}/FMFUN.o  ${OUT}/FORTFN.o  \
+  ${OUT}/FVC.o    ${OUT}/FVFUN.o ${OUT}/INTRET.o ${OUT}/SEGXCAT.o  \
   layer2done
 
 @
 \subsection{Layer 3}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-grdef.spad.pamphlet (GRDEF)
-\end{verbatim}
-
 <<layer3>>=
 
 LAYER3=\
@@ -234,30 +235,9 @@ LAYER3=\
 @
 
 \subsubsection{Completed spad files}
-\begin{verbatim}
-paramete.spad.pamphlet (PARPCURV PARPC2 PARSCURV PARSC2 PARSURF PARSU2
-ystream.spad.pamphlet (YSTREAM)
-\end{verbatim}
-
 <<layer4>>=
 
 LAYER4=\
-  ${OUT}/ANON.o     ${OUT}/COLOR.o    ${OUT}/COMM.o     ${OUT}/COMPPROP.o \
-  ${OUT}/ELTAGG.o   ${OUT}/ELTAGG-.o  ${OUT}/EXIT.o     \
-  ${OUT}/FAMONC.o   ${OUT}/FILECAT.o  ${OUT}/FINITE.o   ${OUT}/FNCAT.o    \
-  ${OUT}/FORMULA1.o ${OUT}/IDPC.o     ${OUT}/IEVALAB.o  ${OUT}/IEVALAB-.o \
-  ${OUT}/INTBIT.o   ${OUT}/LMODULE.o  ${OUT}/LOGIC.o    ${OUT}/LOGIC-.o   \
-  ${OUT}/MAPHACK1.o ${OUT}/MAPHACK2.o ${OUT}/MAPHACK3.o ${OUT}/MAPPKG1.o  \
-  ${OUT}/MAPPKG2.o  ${OUT}/MAPPKG3.o  ${OUT}/MONAD.o    ${OUT}/MONAD-.o   \
-  ${OUT}/NIPROB.o   ${OUT}/NONE.o     ${OUT}/NUMINT.o   ${OUT}/ODECAT.o   \
-  ${OUT}/ODEPROB.o  ${OUT}/OMENC.o    ${OUT}/ONECOMP2.o ${OUT}/OPTCAT.o   \
-  ${OUT}/OPTPROB.o  ${OUT}/ORDSET.o   ${OUT}/ORDSET-.o  ${OUT}/PALETTE.o  \
-  ${OUT}/PARSURF.o  ${OUT}/PARSU2.o   ${OUT}/PATMAB.o   ${OUT}/PATRES2.o  \
-  ${OUT}/PATTERN1.o ${OUT}/PDECAT.o   ${OUT}/PDEPROB.o  ${OUT}/REPSQ.o    \
-  ${OUT}/REPDB.o    ${OUT}/RFDIST.o   ${OUT}/RIDIST.o   ${OUT}/RMODULE.o  \
-  ${OUT}/SEXCAT.o   ${OUT}/SGROUP.o   ${OUT}/SGROUP-.o  ${OUT}/SPACEC.o   \
-  ${OUT}/SPLNODE.o  ${OUT}/STEP.o     ${OUT}/SUCH.o     ${OUT}/TEX1.o     \
-  ${OUT}/UDVO.o     ${OUT}/YSTREAM.o \
   layer4done
 
 @
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 1f4ea90..dbc6520 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -844,7 +844,9 @@ algebra/Makefile move PARPC2 to layer1<br/>
 <a href="patches/20081224.03.tpd.patch">20081224.03.tpd.patch</a>
 algebra/Makefile move PARSCURV to layer1<br/>
 <a href="patches/20081224.04.tpd.patch">20081224.04.tpd.patch</a>
-algebra/Makefile move PARS2 to layer1<br/>
+algebra/Makefile move PARCS2 to layer1<br/>
+<a href="patches/20081224.05.tpd.patch">20081224.05.tpd.patch</a>
+algebra/Makefile collapse layer 4 into 1 and 2<br/>
 
  </body>
 </html>

\start
Date: Wed, 24 Dec 2008 22:25:37 -0600
From: Tim Daly
To: list
Subject: 20081224.06.tpd.patch (algebra/Makefile collapse layer 5 into layer 2)

Layer 5 of the build graph now collapses into layer 2
=======================================================================
diff --git a/changelog b/changelog
index e2be770..27fe299 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081224 tpd src/axiom-website/patches.html 20081224.06.tpd.patch
+20081224 tpd src/algebra/Makefile collapse layer 5 into layer 2
 20081224 tpd src/axiom-website/patches.html 20081224.05.tpd.patch
 20081224 tpd src/algebra/Makefile collapse layer 4 into 1 and 2
 20081224 tpd src/axiom-website/patches.html 20081224.04.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 7966832..2f2bcd4 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -183,8 +183,8 @@ LAYER0=\
 @
 \subsection{Layer 1}
 Depends on: BASTYPE CFCAT KOERCE KONVERT TYPE\\
-Used by next layer: FORTCAT RETRACT SETCAT
-
+Used by next layer: AGG ELTAGG FINITE FORTCAT IDPC IEVALAB LMODULE 
+MONAD ORDSET PATMAB RETRACT RMODULE SETCAT SGROUP 
 
 <<layer1>>=
 
@@ -217,12 +217,26 @@ LAYER1=\
   
 @
 \subsection{Layer 2}
-Depends on: FORTCAT RETRACT SETCAT
+Depends on: AGG ELTAGG FINITE FORTCAT IDPC IEVALAB LMODULE MONAD ORDSET 
+PATMAB RETRACT RMODULE SETCAT SGROUP 
 <<layer2>>=
 
 LAYER2=\
-  ${OUT}/FAMONC.o ${OUT}/FMC.o   ${OUT}/FMFUN.o  ${OUT}/FORTFN.o  \
-  ${OUT}/FVC.o    ${OUT}/FVFUN.o ${OUT}/INTRET.o ${OUT}/SEGXCAT.o  \
+  ${OUT}/ATRIG.o    ${OUT}/ATRIG-.o   ${OUT}/BMODULE.o  ${OUT}/CACHSET.o  \
+  ${OUT}/CHARNZ.o   ${OUT}/CHARZ.o    ${OUT}/DVARCAT.o  ${OUT}/DVARCAT-.o \
+  ${OUT}/ELEMFUN.o  ${OUT}/ELEMFUN-.o ${OUT}/ESTOOLS2.o ${OUT}/EVALAB.o   \
+  ${OUT}/EVALAB-.o  ${OUT}/FAMONC.o   ${OUT}/FCOMP.o    ${OUT}/FEVALAB.o  \
+  ${OUT}/FEVALAB-.o ${OUT}/FMC.o      ${OUT}/FMFUN.o    ${OUT}/FORTFN.o   \
+  ${OUT}/FPATMAB.o  ${OUT}/FVC.o      ${OUT}/FVFUN.o    ${OUT}/GROUP.o    \
+  ${OUT}/GROUP-.o   ${OUT}/IDPAM.o    ${OUT}/IDPO.o     ${OUT}/INCRMAPS.o \
+  ${OUT}/INTRET.o   ${OUT}/IXAGG.o    ${OUT}/IXAGG-.o   ${OUT}/KERNEL2.o  \
+  ${OUT}/LALG.o     ${OUT}/LALG-.o    ${OUT}/LINEXP.o   ${OUT}/MODMONOM.o \
+  ${OUT}/MONADWU.o  ${OUT}/MONADWU-.o ${OUT}/MRF2.o     ${OUT}/NARNG.o    \
+  ${OUT}/NARNG-.o   ${OUT}/NSUP2.o    ${OUT}/OASGP.o    ${OUT}/ODVAR.o    \
+  ${OUT}/OPQUERY.o  ${OUT}/ORDFIN.o   ${OUT}/ORDMON.o   ${OUT}/PATMATCH.o \
+  ${OUT}/PERMCAT.o  ${OUT}/PDRING.o   ${OUT}/PDRING-.o  ${OUT}/SDVAR.o    \
+  ${OUT}/SEGXCAT.o  ${OUT}/SUP2.o     ${OUT}/TRIGCAT.o  ${OUT}/TRIGCAT-.o \
+  ${OUT}/ULS2.o     ${OUT}/UP2.o \
   layer2done
 
 @
@@ -247,19 +261,6 @@ LAYER4=\
 <<layer5>>=
 
 LAYER5=\
-  ${OUT}/ATRIG.o    ${OUT}/ATRIG-.o   ${OUT}/BMODULE.o  ${OUT}/CACHSET.o  \
-  ${OUT}/CHARNZ.o   ${OUT}/CHARZ.o    ${OUT}/DVARCAT.o  ${OUT}/DVARCAT-.o \
-  ${OUT}/ELEMFUN.o  ${OUT}/ELEMFUN-.o ${OUT}/ESTOOLS2.o ${OUT}/EVALAB.o   \
-  ${OUT}/EVALAB-.o  ${OUT}/FCOMP.o    ${OUT}/FEVALAB.o  ${OUT}/FEVALAB-.o \
-  ${OUT}/FPATMAB.o  ${OUT}/GROUP.o    ${OUT}/GROUP-.o   ${OUT}/IDPAM.o    \
-  ${OUT}/IDPO.o     ${OUT}/INCRMAPS.o ${OUT}/IXAGG.o    ${OUT}/IXAGG-.o   \
-  ${OUT}/KERNEL2.o  ${OUT}/LALG.o     ${OUT}/LALG-.o    ${OUT}/LINEXP.o   \
-  ${OUT}/MODMONOM.o ${OUT}/MONADWU.o  ${OUT}/MONADWU-.o ${OUT}/MRF2.o     \
-  ${OUT}/NARNG.o    ${OUT}/NARNG-.o   ${OUT}/NSUP2.o    ${OUT}/OASGP.o    \
-  ${OUT}/ODVAR.o    ${OUT}/OPQUERY.o  ${OUT}/ORDFIN.o   ${OUT}/ORDMON.o   \
-  ${OUT}/PATMATCH.o ${OUT}/PERMCAT.o  ${OUT}/PDRING.o   ${OUT}/PDRING-.o  \
-  ${OUT}/SDVAR.o    ${OUT}/SUP2.o     ${OUT}/TRIGCAT.o  ${OUT}/TRIGCAT-.o \
-  ${OUT}/ULS2.o     ${OUT}/UP2.o \
   layer5done
 
 @
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index dbc6520..7769f15 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -847,6 +847,8 @@ algebra/Makefile move PARSCURV to layer1<br/>
 algebra/Makefile move PARCS2 to layer1<br/>
 <a href="patches/20081224.05.tpd.patch">20081224.05.tpd.patch</a>
 algebra/Makefile collapse layer 4 into 1 and 2<br/>
+<a href="patches/20081224.06.tpd.patch">20081224.06.tpd.patch</a>
+algebra/Makefile collapse layer 5 into layer 2<br/>
 
  </body>
 </html>

\start
Date: Thu, 25 Dec 2008 01:32:28 -0600
From: Tim Daly
To: list
Subject: 20081225.01.tpd.patch (algebra/Makefile move layers 7, 8, 9)

Layers 7,8,and 9 have been numbered downward to 5,6 and 7 respectively.
Some domains were moved to reflect constraints.
=======================================================================
diff --git a/changelog b/changelog
index 27fe299..ed0c328 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081224 tpd src/axiom-website/patches.html 20081225.01.tpd.patch
+20081224 tpd src/algebra/Makefile move layers 7,8,9
 20081224 tpd src/axiom-website/patches.html 20081224.06.tpd.patch
 20081224 tpd src/algebra/Makefile collapse layer 5 into layer 2
 20081224 tpd src/axiom-website/patches.html 20081224.05.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 2f2bcd4..f69c169 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -184,7 +184,7 @@ LAYER0=\
 \subsection{Layer 1}
 Depends on: BASTYPE CFCAT KOERCE KONVERT TYPE\\
 Used by next layer: AGG ELTAGG FINITE FORTCAT IDPC IEVALAB LMODULE 
-MONAD ORDSET PATMAB RETRACT RMODULE SETCAT SGROUP 
+MONAD ORDSET PATMAB RETRACT RMODULE SGROUP 
 
 <<layer1>>=
 
@@ -218,7 +218,9 @@ LAYER1=\
 @
 \subsection{Layer 2}
 Depends on: AGG ELTAGG FINITE FORTCAT IDPC IEVALAB LMODULE MONAD ORDSET 
-PATMAB RETRACT RMODULE SETCAT SGROUP 
+PATMAB RETRACT RMODULE SGROUP \\
+Used by next layer: BMODULE CACHSET ELEMFUN EVALAB GROUP IXAGG MONADWU NARNG 
+OASGP PDRING 
 <<layer2>>=
 
 LAYER2=\
@@ -228,73 +230,87 @@ LAYER2=\
   ${OUT}/EVALAB-.o  ${OUT}/FAMONC.o   ${OUT}/FCOMP.o    ${OUT}/FEVALAB.o  \
   ${OUT}/FEVALAB-.o ${OUT}/FMC.o      ${OUT}/FMFUN.o    ${OUT}/FORTFN.o   \
   ${OUT}/FPATMAB.o  ${OUT}/FVC.o      ${OUT}/FVFUN.o    ${OUT}/GROUP.o    \
-  ${OUT}/GROUP-.o   ${OUT}/IDPAM.o    ${OUT}/IDPO.o     ${OUT}/INCRMAPS.o \
-  ${OUT}/INTRET.o   ${OUT}/IXAGG.o    ${OUT}/IXAGG-.o   ${OUT}/KERNEL2.o  \
-  ${OUT}/LALG.o     ${OUT}/LALG-.o    ${OUT}/LINEXP.o   ${OUT}/MODMONOM.o \
-  ${OUT}/MONADWU.o  ${OUT}/MONADWU-.o ${OUT}/MRF2.o     ${OUT}/NARNG.o    \
-  ${OUT}/NARNG-.o   ${OUT}/NSUP2.o    ${OUT}/OASGP.o    ${OUT}/ODVAR.o    \
-  ${OUT}/OPQUERY.o  ${OUT}/ORDFIN.o   ${OUT}/ORDMON.o   ${OUT}/PATMATCH.o \
-  ${OUT}/PERMCAT.o  ${OUT}/PDRING.o   ${OUT}/PDRING-.o  ${OUT}/SDVAR.o    \
-  ${OUT}/SEGXCAT.o  ${OUT}/SUP2.o     ${OUT}/TRIGCAT.o  ${OUT}/TRIGCAT-.o \
-  ${OUT}/ULS2.o     ${OUT}/UP2.o \
+  ${OUT}/GROUP-.o   ${OUT}/IDPAG.o    ${OUT}/IDPAM.o    ${OUT}/IDPO.o     \
+  ${OUT}/INCRMAPS.o ${OUT}/INTRET.o   ${OUT}/IXAGG.o    ${OUT}/IXAGG-.o   \
+  ${OUT}/KERNEL2.o  ${OUT}/LALG.o     ${OUT}/LALG-.o    ${OUT}/LINEXP.o   \
+  ${OUT}/MODMONOM.o ${OUT}/MONADWU.o  ${OUT}/MONADWU-.o ${OUT}/MRF2.o     \
+  ${OUT}/NARNG.o    ${OUT}/NARNG-.o   ${OUT}/NSUP2.o    ${OUT}/OASGP.o    \
+  ${OUT}/ODVAR.o    ${OUT}/OPQUERY.o  ${OUT}/ORDFIN.o   ${OUT}/ORDMON.o   \
+  ${OUT}/PATMATCH.o ${OUT}/PERMCAT.o  ${OUT}/PDRING.o   ${OUT}/PDRING-.o  \
+  ${OUT}/SDVAR.o    ${OUT}/SEGXCAT.o  ${OUT}/SUP2.o     ${OUT}/TRIGCAT.o  \
+  ${OUT}/TRIGCAT-.o ${OUT}/ULS2.o     ${OUT}/UP2.o \
   layer2done
 
 @
 \subsection{Layer 3}
+Depends on: BMODULE CACHSET ELEMFUN EVALAB GROUP IXAGG MONADWU NARNG 
+OASGP PDRING\\
+Used by next layer: BGAGG BRAGG ELAGG- GRMOD MODULE OAMON 
 <<layer3>>=
 
 LAYER3=\
+  ${OUT}/AUTOMOR.o  ${OUT}/BGAGG.o   ${OUT}/BGAGG-.o   ${OUT}/BRAGG.o    \
+  ${OUT}/BRAGG-.o   ${OUT}/CARTEN2.o ${OUT}/CHARPOL.o  ${OUT}/COMPLEX2.o \
+  ${OUT}/DIFEXT.o   ${OUT}/DIFEXT-.o ${OUT}/DLAGG.o    ${OUT}/ELAGG.o    \
+  ${OUT}/ELAGG-.o   ${OUT}/ES1.o     ${OUT}/ES2.o      ${OUT}/GRMOD.o    \
+  ${OUT}/GRMOD-.o   ${OUT}/HYPCAT.o  ${OUT}/HYPCAT-.o  ${OUT}/MKCHSET.o  \
+  ${OUT}/MODRING.o  ${OUT}/MODULE.o  ${OUT}/MODULE-.o  ${OUT}/NASRING.o  \
+  ${OUT}/NASRING-.o ${OUT}/OAMON.o   ${OUT}/SORTPAK.o  ${OUT}/ZMOD.o \
   layer3done
 
 @
 
-\subsubsection{Completed spad files}
+\subsection{Layer 4}
+Depends on: BGAGG BRAGG ELAGG- GRMOD MODULE OAMON \\
+Used by next layer: ALGEBRA ALGEBRA- BTCAT OCAMON QUAGG SKAGG
 <<layer4>>=
 
 LAYER4=\
+  ${OUT}/ALGEBRA.o ${OUT}/ALGEBRA-.o ${OUT}/BTCAT.o  ${OUT}/BTCAT-.o \
+  ${OUT}/FMCAT.o   ${OUT}/IDPOAM.o   ${OUT}/IFAMON.o ${OUT}/GRALG.o  \
+  ${OUT}/GRALG-.o  ${OUT}/OCAMON.o   ${OUT}/PRQAGG.o ${OUT}/QUAGG.o  \
+  ${OUT}/SKAGG.o  \
   layer4done
 
 @
 \subsection{Layer 5}
-\subsubsection{Completed spad files}
+Depends on: ALGEBRA ALGEBRA- BTCAT OCAMON QUAGG SKAGG\\
+Used by next layer: MLO OAGROUP OAMONS PID XALG
 
 <<layer5>>=
 
 LAYER5=\
+  ${OUT}/BSTREE.o  ${OUT}/BTOURN.o   ${OUT}/CARD.o     ${OUT}/DRAWHACK.o \
+  ${OUT}/DQAGG.o   ${OUT}/FACTFUNC.o ${OUT}/FMTC.o     ${OUT}/FR2.o      \
+  ${OUT}/FRAC2.o   ${OUT}/FRUTIL.o   ${OUT}/ITAYLOR.o  ${OUT}/MLO.o      \
+  ${OUT}/NAALG.o   ${OUT}/NAALG-.o   ${OUT}/NEWTON.o   ${OUT}/OAGROUP.o  \
+  ${OUT}/OAMONS.o  ${OUT}/OP.o       ${OUT}/ORDCOMP2.o ${OUT}/PID.o      \
+  ${OUT}/RANDSRC.o ${OUT}/UNISEG2.o  ${OUT}/XALG.o  \
   layer5done
 
 @
 \subsection{Layer6}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-sortpak.spad.pamphlet (SORTPAK)
-\end{verbatim}
-
+Depends on: MLO OAGROUP OAMONS PID XALG
 <<layer6>>=
 
 LAYER6=\
-  ${OUT}/AUTOMOR.o  ${OUT}/BGAGG.o   ${OUT}/BGAGG-.o   ${OUT}/BRAGG.o    \
-  ${OUT}/BRAGG-.o   ${OUT}/CARTEN2.o ${OUT}/CHARPOL.o  ${OUT}/COMPLEX2.o \
-  ${OUT}/DIFEXT.o   ${OUT}/DIFEXT-.o ${OUT}/DLAGG.o    ${OUT}/ELAGG.o    \
-  ${OUT}/ELAGG-.o   ${OUT}/ES1.o     ${OUT}/ES2.o      ${OUT}/GRMOD.o    \
-  ${OUT}/GRMOD-.o   ${OUT}/HYPCAT.o  ${OUT}/HYPCAT-.o  ${OUT}/MKCHSET.o  \
-  ${OUT}/MODRING.o  ${OUT}/MODULE.o  ${OUT}/MODULE-.o  ${OUT}/NASRING.o  \
-  ${OUT}/NASRING-.o ${OUT}/OAMON.o   ${OUT}/SORTPAK.o  ${OUT}/ZMOD.o \
+  ${OUT}/AMR.o      ${OUT}/AMR-.o     ${OUT}/DEGRED.o  ${OUT}/DLP.o      \
+  ${OUT}/EAB.o      ${OUT}/ESTOOLS1.o ${OUT}/FAGROUP.o ${OUT}/FAMONOID.o \
+  ${OUT}/FIELD.o    ${OUT}/FIELD-.o   ${OUT}/FLAGG.o   ${OUT}/FLAGG-.o   \
+  ${OUT}/FLINEXP.o  ${OUT}/FLINEXP-.o ${OUT}/FRETRCT.o ${OUT}/FRETRCT-.o \
+  ${OUT}/FSERIES.o  ${OUT}/FT.o       ${OUT}/IDPOAMS.o ${OUT}/INFINITY.o \
+  ${OUT}/LA.o       ${OUT}/OMLO.o     ${OUT}/ORTHPOL.o ${OUT}/PRODUCT.o  \
+  ${OUT}/PADICCT.o  ${OUT}/PMPRED.o   ${OUT}/PMASS.o   ${OUT}/PTFUNC2.o  \
+  ${OUT}/RADCAT.o   ${OUT}/RADCAT-.o  ${OUT}/RATRET.o  ${OUT}/RADUTIL.o  \
+  ${OUT}/UPXS2.o    ${OUT}/XFALG.o    ${OUT}/ZLINDEP.o \
   layer6done
 
 @
 \subsection{Layer7}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-\end{verbatim}
 
 <<layer7>>=
 
 LAYER7=\
-  ${OUT}/ALGEBRA.o ${OUT}/ALGEBRA-.o ${OUT}/BTCAT.o  ${OUT}/BTCAT-.o \
-  ${OUT}/FMCAT.o   ${OUT}/IDPOAM.o   ${OUT}/IFAMON.o ${OUT}/GRALG.o  \
-  ${OUT}/GRALG-.o  ${OUT}/OCAMON.o   ${OUT}/PRQAGG.o ${OUT}/QUAGG.o  \
-  ${OUT}/SKAGG.o  \
   layer7done
 
 @
@@ -303,13 +319,6 @@ LAYER7=\
 <<layer8>>=
 
 LAYER8=\
-  ${OUT}/BSTREE.o  ${OUT}/BTOURN.o   ${OUT}/CARD.o    ${OUT}/DRAWHACK.o \
-  ${OUT}/DQAGG.o   ${OUT}/FACTFUNC.o ${OUT}/FMTC.o    ${OUT}/FR2.o      \
-  ${OUT}/FRAC2.o   ${OUT}/FRUTIL.o   ${OUT}/ITAYLOR.o ${OUT}/MLO.o      \
-  ${OUT}/NAALG.o   ${OUT}/NAALG-.o   ${OUT}/NEWTON.o  \
-  ${OUT}/OAGROUP.o ${OUT}/OAMONS.o   \
-  ${OUT}/OP.o      ${OUT}/ORDCOMP2.o ${OUT}/PID.o     ${OUT}/RANDSRC.o  \
-  ${OUT}/UNISEG2.o ${OUT}/XALG.o  \
   layer8done
 
 @
@@ -323,15 +332,6 @@ retract.spad.pamphlet (RETRACT FRETRCT RATRET)
 <<layer9>>=
 
 LAYER9=\
-  ${OUT}/AMR.o      ${OUT}/AMR-.o     ${OUT}/DEGRED.o  ${OUT}/DLP.o      \
-  ${OUT}/EAB.o      ${OUT}/ESTOOLS1.o ${OUT}/FAGROUP.o ${OUT}/FAMONOID.o \
-  ${OUT}/FIELD.o    ${OUT}/FIELD-.o   ${OUT}/FLAGG.o   ${OUT}/FLAGG-.o   \
-  ${OUT}/FLINEXP.o  ${OUT}/FLINEXP-.o ${OUT}/FRETRCT.o ${OUT}/FRETRCT-.o \
-  ${OUT}/FSERIES.o  ${OUT}/FT.o       ${OUT}/IDPAG.o   ${OUT}/IDPOAMS.o  \
-  ${OUT}/INFINITY.o ${OUT}/LA.o       ${OUT}/OMLO.o    ${OUT}/ORTHPOL.o  \
-  ${OUT}/PRODUCT.o  ${OUT}/PADICCT.o  ${OUT}/PMPRED.o  ${OUT}/PMASS.o    \
-  ${OUT}/PTFUNC2.o  ${OUT}/RADCAT.o   ${OUT}/RADCAT-.o ${OUT}/RATRET.o   \
-  ${OUT}/RADUTIL.o  ${OUT}/UPXS2.o    ${OUT}/XFALG.o   ${OUT}/ZLINDEP.o \
   layer9done
 
 @
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 7769f15..b524223 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -849,6 +849,8 @@ algebra/Makefile move PARCS2 to layer1<br/>
 algebra/Makefile collapse layer 4 into 1 and 2<br/>
 <a href="patches/20081224.06.tpd.patch">20081224.06.tpd.patch</a>
 algebra/Makefile collapse layer 5 into layer 2<br/>
+<a href="patches/20081225.01.tpd.patch">20081225.01.tpd.patch</a>
+algebra/Makefile move layers 7,8,9 <br/>
 
  </body>
 </html>

\start
Date: Thu, 25 Dec 2008 02:54:24 -0600
From: Tim Daly
To: list
Subject: 20081225.02.tpd.patch (algebra/Makefile move layer 10, MAPPKG4)

MAPPKG4 was misplaced and moved.
Layer 10 was renamed.
=======================================================================
diff --git a/changelog b/changelog
index ed0c328..7d0ef17 100644
--- a/changelog
+++ b/changelog
@@ -1,5 +1,7 @@
-20081224 tpd src/axiom-website/patches.html 20081225.01.tpd.patch
-20081224 tpd src/algebra/Makefile move layers 7,8,9
+20081225 tpd src/axiom-website/patches.html 20081225.02.tpd.patch
+20081225 tpd src/algebra/Makefile move layer 10, MAPPKG4
+20081225 tpd src/axiom-website/patches.html 20081225.01.tpd.patch
+20081225 tpd src/algebra/Makefile move layers 7,8,9
 20081224 tpd src/axiom-website/patches.html 20081224.06.tpd.patch
 20081224 tpd src/algebra/Makefile collapse layer 5 into layer 2
 20081224 tpd src/axiom-website/patches.html 20081224.05.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index f69c169..20cfb51 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -290,7 +290,9 @@ LAYER5=\
 
 @
 \subsection{Layer6}
-Depends on: MLO OAGROUP OAMONS PID XALG
+Depends on: MLO OAGROUP OAMONS PID XALG\\
+Used by next layer: AMR FIELD FIELD- FLAGG FLAGG- FRETRCT PADICCT RADCAT 
+XFALG
 <<layer6>>=
 
 LAYER6=\
@@ -299,64 +301,18 @@ LAYER6=\
   ${OUT}/FIELD.o    ${OUT}/FIELD-.o   ${OUT}/FLAGG.o   ${OUT}/FLAGG-.o   \
   ${OUT}/FLINEXP.o  ${OUT}/FLINEXP-.o ${OUT}/FRETRCT.o ${OUT}/FRETRCT-.o \
   ${OUT}/FSERIES.o  ${OUT}/FT.o       ${OUT}/IDPOAMS.o ${OUT}/INFINITY.o \
-  ${OUT}/LA.o       ${OUT}/OMLO.o     ${OUT}/ORTHPOL.o ${OUT}/PRODUCT.o  \
-  ${OUT}/PADICCT.o  ${OUT}/PMPRED.o   ${OUT}/PMASS.o   ${OUT}/PTFUNC2.o  \
-  ${OUT}/RADCAT.o   ${OUT}/RADCAT-.o  ${OUT}/RATRET.o  ${OUT}/RADUTIL.o  \
-  ${OUT}/UPXS2.o    ${OUT}/XFALG.o    ${OUT}/ZLINDEP.o \
+  ${OUT}/LA.o       ${OUT}/MAPPKG4.o  ${OUT}/OMLO.o    ${OUT}/ORTHPOL.o  \
+  ${OUT}/PRODUCT.o  ${OUT}/PADICCT.o  ${OUT}/PMPRED.o  ${OUT}/PMASS.o   \
+  ${OUT}/PTFUNC2.o  ${OUT}/RADCAT.o   ${OUT}/RADCAT-.o ${OUT}/RATRET.o  \
+  ${OUT}/RADUTIL.o  ${OUT}/UPXS2.o    ${OUT}/XFALG.o   ${OUT}/ZLINDEP.o \
   layer6done
 
 @
 \subsection{Layer7}
-
+Depends on: AMR FIELD FIELD- FLAGG FLAGG- FRETRCT PADICCT RADCAT XFALG 
 <<layer7>>=
 
 LAYER7=\
-  layer7done
-
-@
-\subsection{Layer8}
-
-<<layer8>>=
-
-LAYER8=\
-  layer8done
-
-@
-\subsection{Layer9}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-degred.spad.pamphlet (DEGRED)
-retract.spad.pamphlet (RETRACT FRETRCT RATRET)
-\end{verbatim}
-
-<<layer9>>=
-
-LAYER9=\
-  layer9done
-
-@
-\subsection{Layer10}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-complet.spad.pamphlet (ORDCOMP ORDCOMP2 ONECOMP ONECOMP2 INFINITY)
-cra.spad.pamphlet (CRAPACK)
-defaults.spad.pamphlet (REPSQ REPDB FLASORT)
-drawpak.spad.pamphlet (DRAWCX)
-mappkg.spad.pamphlet (MAPHACK1 MAPHACK2 MAPHACK3 MAPHACK4
-                      MAPPKG1 MAPPKG2 MAPPKG3 MAPPKG4)
-mesh.spad.pamphlet (MESH)
-partperm.spad.pamphlet (PARTPERM)
-pgrobner.spad.pamphlet (PGROEB)
-plottool.spad.pamphlet (PLOTTOOL)
-setorder.spad.pamphlet (UDPO UDVO)
-sttaylor.spad.pamphlet (STTAYLOR)
-tableau.spad.pamphlet (TABLBUMP TABLEAU)
-viewpack.spad.pamphlet (VIEW)
-\end{verbatim}
-
-<<layer10>>=
-
-LAYER10=\
   ${OUT}/A1AGG.o    ${OUT}/A1AGG-.o   ${OUT}/ARR2CAT.o  ${OUT}/ARR2CAT-.o \
   ${OUT}/ASP34.o    ${OUT}/BBTREE.o   ${OUT}/BFUNCT.o   ${OUT}/BPADIC.o   \
   ${OUT}/BTREE.o    ${OUT}/CRAPACK.o  ${OUT}/DEQUEUE.o  ${OUT}/DLIST.o    \
@@ -367,7 +323,6 @@ LAYER10=\
   ${OUT}/IPADIC.o   ${OUT}/IROOT.o    ${OUT}/IR2.o      ${OUT}/LEXP.o     \
   ${OUT}/LIECAT.o   ${OUT}/LIECAT-.o  ${OUT}/LIST2.o    ${OUT}/LIST2MAP.o \
   ${OUT}/LMOPS.o    ${OUT}/LZSTAGG.o  ${OUT}/LZSTAGG-.o ${OUT}/MAGMA.o    \
-  ${OUT}/MAPPKG4.o  \
   ${OUT}/MESH.o     ${OUT}/MOEBIUS.o  ${OUT}/MODFIELD.o ${OUT}/MODOP.o    \
   ${OUT}/MRING.o    ${OUT}/MTHING.o   ${OUT}/NCNTFRAC.o ${OUT}/NCODIV.o   \
   ${OUT}/NUMTUBE.o  ${OUT}/ODR.o      ${OUT}/OFMONOID.o ${OUT}/ONECOMP.o  \
@@ -382,6 +337,30 @@ LAYER10=\
   ${OUT}/TOPSP.o    ${OUT}/TRANFUN.o  ${OUT}/TRANFUN-.o ${OUT}/TUBE.o     \
   ${OUT}/UDPO.o     ${OUT}/UNISEG.o   ${OUT}/VIEW.o     ${OUT}/VSPACE.o   \
   ${OUT}/VSPACE-.o  ${OUT}/XPOLYC.o   ${OUT}/XPR.o \
+  layer7done
+
+@
+\subsection{Layer8}
+
+<<layer8>>=
+
+LAYER8=\
+  layer8done
+
+@
+\subsection{Layer9}
+
+<<layer9>>=
+
+LAYER9=\
+  layer9done
+
+@
+\subsection{Layer10}
+
+<<layer10>>=
+
+LAYER10=\
   layer10done
 
 @
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index b524223..bd746ae 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -851,6 +851,8 @@ algebra/Makefile collapse layer 4 into 1 and 2<br/>
 algebra/Makefile collapse layer 5 into layer 2<br/>
 <a href="patches/20081225.01.tpd.patch">20081225.01.tpd.patch</a>
 algebra/Makefile move layers 7,8,9 <br/>
+<a href="patches/20081225.01.tpd.patch">20081225.01.tpd.patch</a>
+algebra/Makefile move layer 10, MAPPKG4 <br/>
 
  </body>
 </html>

\start
Date: Thu, 25 Dec 2008 06:19:47 -0600
From: Tim Daly
To: list
Subject: 20081225.03.tpd.patch (algebra/Makefile move layers 11, 12, 13)

Renumber layers 11, 12, and 13 downward as graph collapses.
=====================================================================
diff --git a/changelog b/changelog
index 7d0ef17..2a9f666 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081225 tpd src/axiom-website/patches.html 20081225.03.tpd.patch
+20081225 tpd src/algebra/Makefile move layers 11, 12, 13
 20081225 tpd src/axiom-website/patches.html 20081225.02.tpd.patch
 20081225 tpd src/algebra/Makefile move layer 10, MAPPKG4
 20081225 tpd src/axiom-website/patches.html 20081225.01.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 20cfb51..a60cf0f 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -309,15 +309,17 @@ LAYER6=\
 
 @
 \subsection{Layer7}
-Depends on: AMR FIELD FIELD- FLAGG FLAGG- FRETRCT PADICCT RADCAT XFALG 
+Depends on: AMR FIELD FIELD- FLAGG FLAGG- FRETRCT PADICCT RADCAT XFALG \\
+Used by next layer: A1AGG A1AGG- ARR2CAT FAMR FPC LIECAT LZSTAGG OREPCAT PSCAT 
+TRANFUN VSPACE XPOLYC
 <<layer7>>=
 
 LAYER7=\
   ${OUT}/A1AGG.o    ${OUT}/A1AGG-.o   ${OUT}/ARR2CAT.o  ${OUT}/ARR2CAT-.o \
   ${OUT}/ASP34.o    ${OUT}/BBTREE.o   ${OUT}/BFUNCT.o   ${OUT}/BPADIC.o   \
   ${OUT}/BTREE.o    ${OUT}/CRAPACK.o  ${OUT}/DEQUEUE.o  ${OUT}/DLIST.o    \
-  ${OUT}/DRAWCX.o   ${OUT}/D01GBFA.o  ${OUT}/D02EJFA.o  ${OUT}/D03FAFA.o  \
-  ${OUT}/DRAWPT.o   ${OUT}/FAMR.o     ${OUT}/FAMR-.o    ${OUT}/FLASORT.o  \
+  ${OUT}/DRAWCX.o   ${OUT}/DRAWPT.o   ${OUT}/D01GBFA.o  ${OUT}/D02EJFA.o  \
+  ${OUT}/D03FAFA.o  ${OUT}/FAMR.o     ${OUT}/FAMR-.o    ${OUT}/FLASORT.o  \
   ${OUT}/FLAGG2.o   ${OUT}/FGROUP.o   ${OUT}/FM.o       ${OUT}/FM1.o      \
   ${OUT}/FPC.o      ${OUT}/FPC-.o     ${OUT}/FMONOID.o  ${OUT}/INDE.o     \
   ${OUT}/IPADIC.o   ${OUT}/IROOT.o    ${OUT}/IR2.o      ${OUT}/LEXP.o     \
@@ -341,191 +343,84 @@ LAYER7=\
 
 @
 \subsection{Layer8}
-
+Depends on: A1AGG A1AGG- ARR2CAT FAMR FPC LIECAT LZSTAGG OREPCAT PSCAT 
+TRANFUN VSPACE XPOLYC
+Used by next layer: BTAGG FLALG MATCAT SRAGG VECTCAT 
 <<layer8>>=
 
 LAYER8=\
+  ${OUT}/APPLYORE.o ${OUT}/ARRAY1.o   ${OUT}/ARRAY12.o  ${OUT}/ARRAY2.o   \
+  ${OUT}/ASTACK.o   ${OUT}/BTAGG.o    ${OUT}/BTAGG-.o   ${OUT}/COMBINAT.o \
+  ${OUT}/CSTTOOLS.o ${OUT}/D01FCFA.o  ${OUT}/E04MBFA.o  ${OUT}/FAMR2.o    \
+  ${OUT}/FARRAY.o   ${OUT}/FLALG.o    ${OUT}/GALUTIL.o  ${OUT}/HEAP.o     \
+  ${OUT}/IARRAY1.o  ${OUT}/IARRAY2.o  ${OUT}/IFARRAY.o  ${OUT}/INTCAT.o   \
+  ${OUT}/INTHEORY.o ${OUT}/IRREDFFX.o ${OUT}/LFCAT.o    ${OUT}/LODOCAT.o  \
+  ${OUT}/LODOCAT-.o ${OUT}/LWORD.o    ${OUT}/MATCAT.o   ${OUT}/MATCAT-.o  \
+  ${OUT}/MATSTOR.o  ${OUT}/ORESUP.o   ${OUT}/OREPCTO.o  ${OUT}/OREUP.o    \
+  ${OUT}/PLOT3D.o   ${OUT}/PR.o       ${OUT}/PREASSOC.o ${OUT}/PRIMARR2.o \
+  ${OUT}/REDORDER.o ${OUT}/SRAGG.o    ${OUT}/SRAGG-.o   ${OUT}/STREAM.o   \
+  ${OUT}/SYMPOLY.o  ${OUT}/TS.o       ${OUT}/TUPLE.o    ${OUT}/UPSCAT.o   \
+  ${OUT}/UPSCAT-.o  ${OUT}/VECTCAT.o  ${OUT}/VECTCAT-.o ${OUT}/XDPOLY.o   \
+  ${OUT}/XEXPPKG.o  ${OUT}/XF.o       ${OUT}/XF-.o      ${OUT}/XPBWPOLY.o \
+  ${OUT}/XPOLY.o    ${OUT}/XRPOLY.o \
   layer8done
 
 @
 \subsection{Layer9}
-
+Depends on: BTAGG FLALG MATCAT SRAGG VECTCAT
+Used by next layer: IVECTOR PTCAT STRICAT 
 <<layer9>>=
 
 LAYER9=\
+  ${OUT}/BITS.o    ${OUT}/DIRPROD2.o ${OUT}/IMATRIX.o  ${OUT}/IVECTOR.o \
+  ${OUT}/LPOLY.o   ${OUT}/LSMP.o     ${OUT}/LSMP1.o    ${OUT}/MATCAT2.o \
+  ${OUT}/PTCAT.o   ${OUT}/STRICAT.o  ${OUT}/TRIMAT.o  \
   layer9done
 
 @
 \subsection{Layer10}
-
+Depends on: IVECTOR PTCAT STRICAT
 <<layer10>>=
 
 LAYER10=\
+  ${OUT}/ASSOCEQ.o  ${OUT}/CARTEN.o   ${OUT}/CLIF.o     ${OUT}/CLIP.o     \
+  ${OUT}/COORDSYS.o ${OUT}/DBASE.o    ${OUT}/DHMATRIX.o ${OUT}/DIOSP.o    \
+  ${OUT}/DIRPCAT.o  ${OUT}/DIRPCAT-.o ${OUT}/D02BBFA.o  ${OUT}/D02BHFA.o  \
+  ${OUT}/D02CJFA.o  ${OUT}/FAXF.o     ${OUT}/FAXF-.o    ${OUT}/FFPOLY2.o  \
+  ${OUT}/FNLA.o     ${OUT}/GRAY.o     ${OUT}/HB.o       ${OUT}/IRSN.o     \
+  ${OUT}/MCALCFN.o  ${OUT}/MHROWRED.o ${OUT}/NUMODE.o   ${OUT}/NUMQUAD.o  \
+  ${OUT}/ODESYS.o   ${OUT}/ODETOOLS.o ${OUT}/ORDFUNS.o  ${OUT}/PERMAN.o   \
+  ${OUT}/PFECAT.o   ${OUT}/PFECAT-.o  ${OUT}/POINT.o    ${OUT}/PSEUDLIN.o \
+  ${OUT}/PTPACK.o   ${OUT}/REP2.o     ${OUT}/SETMN.o    ${OUT}/SEX.o      \
+  ${OUT}/STRING.o   ${OUT}/SYMFUNC.o  ${OUT}/VECTOR2.o \
   layer10done
 
 @
 \subsection{Layer11}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-array1.spad.pamphlet (PRIMARR PRIMARR2 TUPLE IFARRAY FARRAY IARRAY1 ARRAY1
-                      ARRAY12)
-combinat.spad.pamphlet (COMBINAT)
-ffx.spad.pamphlet (IRREDFFX)
-galutil.spad.pamphlet (GALUTIL)
-matstor.spad.pamphlet (MATSTOR)
-ore.spad.pamphlet (OREPCAT APPLYORE AUTOMOR OREPCTO ORESUP OREUP)
-stream.spad.pamphlet (LZSTAGG CSTTOOLS STREAM STREAM1 STREAM2 STREAM3)
-xlpoly.spad.pamphlet (MAGMA LWORD LIECAT FLALG XEXPPKG LPOLY PBWLB XPBWPOLY
-                      LEXP)
-\end{verbatim}
 
 <<layer11>>=
 
 LAYER11=\
-  ${OUT}/APPLYORE.o ${OUT}/ARRAY1.o   ${OUT}/ARRAY12.o  ${OUT}/ARRAY2.o   \
-  ${OUT}/ASTACK.o   ${OUT}/BTAGG.o    ${OUT}/BTAGG-.o   ${OUT}/COMBINAT.o \
-  ${OUT}/CSTTOOLS.o ${OUT}/D01FCFA.o  ${OUT}/E04MBFA.o  \
-  ${OUT}/FAMR2.o \
-  ${OUT}/FARRAY.o   \
-  ${OUT}/FLALG.o    ${OUT}/GALUTIL.o  ${OUT}/HEAP.o     ${OUT}/IARRAY1.o  \
-  ${OUT}/IARRAY2.o  ${OUT}/IFARRAY.o  ${OUT}/INTCAT.o   ${OUT}/INTHEORY.o \
-  ${OUT}/IRREDFFX.o ${OUT}/LFCAT.o    ${OUT}/LODOCAT.o  ${OUT}/LODOCAT-.o \
-  ${OUT}/LWORD.o    ${OUT}/MATCAT.o   ${OUT}/MATCAT-.o  ${OUT}/MATSTOR.o  \
-  ${OUT}/ORESUP.o   ${OUT}/OREPCTO.o  ${OUT}/OREUP.o    ${OUT}/PLOT3D.o   \
-  ${OUT}/PR.o       ${OUT}/PREASSOC.o ${OUT}/PRIMARR2.o ${OUT}/REDORDER.o \
-  ${OUT}/SRAGG.o    ${OUT}/SRAGG-.o   ${OUT}/STREAM.o   ${OUT}/SYMPOLY.o  \
-  ${OUT}/TS.o       ${OUT}/TUPLE.o    ${OUT}/UPSCAT.o   ${OUT}/UPSCAT-.o  \
-  ${OUT}/VECTCAT.o  ${OUT}/VECTCAT-.o ${OUT}/XDPOLY.o   ${OUT}/XEXPPKG.o  \
-  ${OUT}/XF.o       ${OUT}/XF-.o      ${OUT}/XPBWPOLY.o ${OUT}/XPOLY.o    \
-  ${OUT}/XRPOLY.o \
   layer11done
 
 @
 \subsection{Layer12}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-\end{verbatim}
 
 <<layer12>>=
 
 LAYER12=\
- ${OUT}/BITS.o    ${OUT}/DIRPROD2.o ${OUT}/IMATRIX.o  ${OUT}/IVECTOR.o \
- ${OUT}/LPOLY.o   ${OUT}/LSMP.o     ${OUT}/LSMP1.o    ${OUT}/MATCAT2.o \
- ${OUT}/PTCAT.o   ${OUT}/STRICAT.o  ${OUT}/TRIMAT.o  \
   layer12done
 
 @
 \subsection{Layer13}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-carten.spad.pamphlet (GRMOD GRALG CARTEN CARTEN2)
-clip.spad.pamphlet (CLIP)
-coordsys.spad.pamphlet (COORDSYS)
-ffpoly2.spad.pamphlet (FFPOLY2)
-irsn.spad.pamphlet (IRSN)
-numode.spad.pamphlet (NUMODE)
-numquad.spad.pamphlet (NUMQUAD)
-perman.spad.pamphlet (GRAY PERMAN)
-pseudolin.spad.pamphlet (PSEUDLIN)
-rep2.spad.pamphlet (REP2)
-solvedio.spad.pamphlet (DIOSP)
-\end{verbatim}
 
 <<layer13>>=
 
 LAYER13=\
-  ${OUT}/ASSOCEQ.o  ${OUT}/CARTEN.o   ${OUT}/CLIF.o     ${OUT}/CLIP.o     \
-  ${OUT}/COORDSYS.o ${OUT}/DBASE.o    ${OUT}/DHMATRIX.o ${OUT}/DIOSP.o    \
-  ${OUT}/DIRPCAT.o  ${OUT}/DIRPCAT-.o ${OUT}/D02BBFA.o  ${OUT}/D02BHFA.o  \
-  ${OUT}/D02CJFA.o  ${OUT}/FAXF.o     ${OUT}/FAXF-.o    ${OUT}/FFPOLY2.o  \
-  ${OUT}/FNLA.o     ${OUT}/GRAY.o     ${OUT}/HB.o       ${OUT}/IRSN.o     \
-  ${OUT}/MCALCFN.o  ${OUT}/MHROWRED.o ${OUT}/NUMODE.o   ${OUT}/NUMQUAD.o  \
-  ${OUT}/ODESYS.o   ${OUT}/ODETOOLS.o ${OUT}/ORDFUNS.o  ${OUT}/PERMAN.o   \
-  ${OUT}/PFECAT.o   ${OUT}/PFECAT-.o  ${OUT}/POINT.o    ${OUT}/PSEUDLIN.o \
-  ${OUT}/PTPACK.o   ${OUT}/REP2.o     ${OUT}/SETMN.o    ${OUT}/SEX.o      \
-  ${OUT}/STRING.o   ${OUT}/SYMFUNC.o  ${OUT}/VECTOR2.o \
   layer13done
 
 @
 \subsection{Layer14}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-allfact.spad.pamphlet (MRATFAC MPRFF MPCPF GENMFACT RFFACTOR SUPFRACF)
-bezout.spad.pamphlet (BEZOUT)
-brill.spad.pamphlet (BRILL)
-cden.spad.pamphlet (ICDEN CDEN UPCDEN MCDEN)
-contfrac.spad.pamphlet (CONTFRAC NCNTFRAC)
-cycles.spad.pamphlet (CYCLES EVALCYC)
-cyclotom.spad.pamphlet (CYCLOTOM)
-ddfact.spad.pamphlet (DDFACT)
-equation2.spad.pamphlet (EQ EQ2 FEVALAB)
-error.spad.pamphlet (ERROR)
-facutil.spad.pamphlet (FACUTIL PUSHVAR)
-ffcat.spad.pamphlet (FPC XF FAXF DLP FFIELDC FFSLPE)
-fff.spad.pamphlet (FFF)
-ffhom.spad.pamphlet (FFHOM)
-ffpoly.spad.pamphlet (FFPOLY)
-formula.spad.pamphlet (FORMULA FORMULA1)
-fraction.spad.pamphlet (LO LA QFCAT QFCAT2 FRAC LPEFRAC FRAC2)
-galfactu.spad.pamphlet (GALFACTU)
-galpolyu.spad.pamphlet (GALPOLYU)
-gb.spad.pamphlet (GB)
-gbeuclid.spad.pamphlet (GBEUCLID)
-gbintern.spad.pamphlet (GBINTERN)
-gdirprod.spad.pamphlet (ORDFUNS ODP HDP SHDP)
-geneez.spad.pamphlet (GENEEZ)
-ghensel.spad.pamphlet (GHENSEL)
-gpgcd.spad.pamphlet (GENPGCD)
-groebf.spad.pamphlet (GBF)
-groebsol.spad.pamphlet (GROEBSOL)
-intrf.spad.pamphlet (SUBRESP MONOTOOL INTHERTR INTTR INTRAT INTRF)
-idecomp.spad.pamphlet (IDECOMP)
-leadcdet.spad.pamphlet (LEADCDET)
-lindep.spad.pamphlet (LINDEP ZLINDEP)
-lingrob.spad.pamphlet (LGROBP)
-listgcd.spad.pamphlet (HEUGCD)
-matfuns.spad.pamphlet (IMATLIN MATCAT2 RMCAT2 IMATQF MATLIN)
-mfinfact.spad.pamphlet (MFINFACT)
-mlift.spad.pamphlet (MLIST)
-moddfact.spad.pamphlet (MDDFACT)
-multsqfr.spad.pamphlet (MULTSQFR)
-newpoint.spad.pamphlet (PTCAT POINT COMPPROP SUBSPACE PTPACK PTFUNC2)
-numtheor.spad.pamphlet (INTHEORY PNTHEORY)
-npcoef.spad.pamphlet (NPCOEF)
-omdev.spad.pamphlet (OMENC OMDEV OMCONN OMPKG)
-omserver.spad.pamphlet (OMSERVER)
-pdecomp.spad.pamphlet (PCOMP PDECOMP)
-pfbr.spad.pamphlet (PFBRU PFBR)
-pfr.spad.pamphlet (PFR PFRPAC)
-pgcd.spad.pamphlet (PGCD)
-pinterp.spad.pamphlet (PINTERPA PINTERP)
-pleqn.spad.pamphlet (PLEQN)
-poltopol.spad.pamphlet (MPC2 MPC3 POLTOPOL)
-poly.spad.pamphlet (FM PR SUP SUP2 UP UP2 POLY2UP UPSQFREE PSQFR UPMP)
-polycat.spad.pamphlet (AMR FAMR POLYCAT POLYLIFT UPOLYC UPOLYC2 COMMUPC)
-prs.spad.pamphlet (PRS)
-radix.spad.pamphlet (RADIX BINARY DECIMAL HEXADEC RADUTIL)
-ratfact.spad.pamphlet (RATFACT)
-rderf.spad.pamphlet (RDETR)
-realzero.spad.pamphlet (REAL0)
-real0q.spad.pamphlet (REAL0Q)
-rf.spad.pamphlet (POLYCATQ RF)
-solvefor.spad.pamphlet (SOLVEFOR)
-solvelin.spad.pamphlet (LSMP LSMP1 LSPP)
-smith.spad.pamphlet (SMITH)
-sttf.spad.pamphlet (STTF STTFNC)
-sturm.spad.pamphlet (SHP)
-sum.spad.pamphlet (ISUMP GOSPER SUMRF)
-tex.spad.pamphlet (TEX)
-twofact.spad.pamphlet (NORMRETR TWOFACT)
-unifact.spad.pamphlet (UNIFACT)
-updecomp.spad.pamphlet (UPDECOMP)
-updivp.spad.pamphlet (UPDIVP)
-viewdef.spad.pamphlet (VIEWDEF)
-vector.spad.pamphlet (VECTCAT IVECTOR VECTOR VECTOR2 DIRPCAT DIRPROD DIRPROD2)
-void.spad.pamphlet (VOID EXIT)
-weier.spad.pamphlet (WEIER)
-\end{verbatim}
 
 <<layer14>>=
 
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index bd746ae..4ca6300 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -851,8 +851,10 @@ algebra/Makefile collapse layer 4 into 1 and 2<br/>
 algebra/Makefile collapse layer 5 into layer 2<br/>
 <a href="patches/20081225.01.tpd.patch">20081225.01.tpd.patch</a>
 algebra/Makefile move layers 7,8,9 <br/>
-<a href="patches/20081225.01.tpd.patch">20081225.01.tpd.patch</a>
+<a href="patches/20081225.02.tpd.patch">20081225.02.tpd.patch</a>
 algebra/Makefile move layer 10, MAPPKG4 <br/>
+<a href="patches/20081225.03.tpd.patch">20081225.03.tpd.patch</a>
+algebra/Makefile move layers 11, 12, 13 <br/>
 
  </body>
 </html>

\start
Date: Thu, 25 Dec 2008 11:04:04 -0600
From: Tim Daly
To: list
Subject: 20081225.04.tpd.patch (algebra/Makefile move layers 15-19)

Layers up to 19 have been collapsed downward.
=======================================================================
diff --git a/changelog b/changelog
index 2a9f666..1e53de8 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081225 tpd src/axiom-website/patches.html 20081225.04.tpd.patch
+20081225 tpd src/algebra/Makefile move layers 15-19
 20081225 tpd src/axiom-website/patches.html 20081225.03.tpd.patch
 20081225 tpd src/algebra/Makefile move layers 11, 12, 13
 20081225 tpd src/axiom-website/patches.html 20081225.02.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index a60cf0f..4335faf 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -380,6 +380,7 @@ LAYER9=\
 @
 \subsection{Layer10}
 Depends on: IVECTOR PTCAT STRICAT
+Used by next layer: DIRPCAT FAXF PFECAT STRING
 <<layer10>>=
 
 LAYER10=\
@@ -397,252 +398,184 @@ LAYER10=\
 
 @
 \subsection{Layer11}
-
+Depends on: DIRPCAT FAXF PFECAT STRING
+Used by next layer: DIOPS DPOLCAT FINRALG FRAC RMATCAT RRCC UPXSCAT
 <<layer11>>=
 
 LAYER11=\
+  ${OUT}/ASP1.o     ${OUT}/ASP10.o    ${OUT}/ASP24.o    ${OUT}/ASP4.o     \
+  ${OUT}/ASP50.o    ${OUT}/ASP6.o     ${OUT}/ASP73.o    ${OUT}/AXSERV.o   \
+  ${OUT}/BALFACT.o  ${OUT}/BEZOUT.o   ${OUT}/BINARY.o   ${OUT}/BINFILE.o  \
+  ${OUT}/BOUNDZRO.o ${OUT}/BPADICRT.o ${OUT}/BRILL.o    ${OUT}/CDEN.o     \
+  ${OUT}/CHVAR.o    ${OUT}/COMMUPC.o  ${OUT}/CONTFRAC.o ${OUT}/CVMP.o     \
+  ${OUT}/CYCLOTOM.o ${OUT}/CYCLES.o   ${OUT}/DDFACT.o   ${OUT}/DECIMAL.o  \
+  ${OUT}/DIOPS.o    ${OUT}/DIOPS-.o   ${OUT}/DIRPROD.o  ${OUT}/DISPLAY.o  \
+  ${OUT}/DMP.o      ${OUT}/DPMO.o     ${OUT}/DPOLCAT.o  ${OUT}/DPOLCAT-.o \
+  ${OUT}/D01AJFA.o  ${OUT}/D01AKFA.o  ${OUT}/D01ALFA.o  ${OUT}/D01AMFA.o  \
+  ${OUT}/D01APFA.o  ${OUT}/D01AQFA.o  ${OUT}/EMR.o      ${OUT}/EQ.o       \
+  ${OUT}/ERROR.o    ${OUT}/EVALCYC.o  ${OUT}/E04DGFA.o  ${OUT}/E04FDFA.o  \
+  ${OUT}/E04GCFA.o  ${OUT}/E04JAFA.o  ${OUT}/FACUTIL.o  ${OUT}/FF.o       \
+  ${OUT}/FFCG.o     ${OUT}/FFCGX.o    ${OUT}/FFFG.o     ${OUT}/FFFGF.o    \
+  ${OUT}/FFHOM.o    ${OUT}/FFNB.o     ${OUT}/FFNBX.o    ${OUT}/FFPOLY.o   \
+  ${OUT}/FFX.o      ${OUT}/FFSLPE.o   ${OUT}/FGLMICPK.o ${OUT}/FILE.o     \
+  ${OUT}/FINAALG.o  ${OUT}/FINAALG-.o ${OUT}/FINRALG.o  ${OUT}/FINRALG-.o \
+  ${OUT}/FFF.o      ${OUT}/FLOATRP.o  ${OUT}/FNAME.o    ${OUT}/FOP.o      \
+  ${OUT}/FORMULA.o  ${OUT}/FORT.o     ${OUT}/FRAC.o     ${OUT}/FTEM.o     \
+  ${OUT}/GENEEZ.o   ${OUT}/GENMFACT.o ${OUT}/GENPGCD.o  ${OUT}/GALFACTU.o \
+  ${OUT}/GALPOLYU.o ${OUT}/GB.o       ${OUT}/GBEUCLID.o ${OUT}/GBF.o      \
+  ${OUT}/GBINTERN.o ${OUT}/GHENSEL.o  ${OUT}/GMODPOL.o  ${OUT}/GOSPER.o   \
+  ${OUT}/GRIMAGE.o  ${OUT}/GROEBSOL.o ${OUT}/HDMP.o     ${OUT}/HDP.o      \
+  ${OUT}/HEXADEC.o  ${OUT}/HEUGCD.o   ${OUT}/IBPTOOLS.o ${OUT}/IFF.o      \
+  ${OUT}/IBITS.o    ${OUT}/ICARD.o    ${OUT}/ICDEN.o    ${OUT}/IDECOMP.o  \
+  ${OUT}/IIARRAY2.o ${OUT}/IMATLIN.o  ${OUT}/IMATQF.o   ${OUT}/INMODGCD.o \
+  ${OUT}/INNMFACT.o ${OUT}/INPSIGN.o  ${OUT}/INTHERTR.o ${OUT}/INTRAT.o   \
+  ${OUT}/INTRF.o    ${OUT}/INTSLPE.o  ${OUT}/INTTR.o    ${OUT}/ISUMP.o    \
+  ${OUT}/LAUPOL.o   ${OUT}/LEADCDET.o ${OUT}/LGROBP.o   ${OUT}/LIMITRF.o  \
+  ${OUT}/LINDEP.o   ${OUT}/LO.o       ${OUT}/LPEFRAC.o  ${OUT}/LSPP.o     \
+  ${OUT}/MATLIN.o   ${OUT}/MCDEN.o    ${OUT}/MDDFACT.o  ${OUT}/MFINFACT.o \
+  ${OUT}/MFLOAT.o   ${OUT}/MINT.o     ${OUT}/MLIFT.o    ${OUT}/MMAP.o     \
+  ${OUT}/MODMON.o   ${OUT}/MONOTOOL.o ${OUT}/MPCPF.o    ${OUT}/MPC2.o     \
+  ${OUT}/MPC3.o     ${OUT}/MPOLY.o    ${OUT}/MPRFF.o    ${OUT}/MRATFAC.o  \
+  ${OUT}/MULTSQFR.o ${OUT}/NORMRETR.o ${OUT}/NPCOEF.o   ${OUT}/NSUP.o     \
+  ${OUT}/NTPOLFN.o  ${OUT}/ODP.o      ${OUT}/ODEPRIM.o  ${OUT}/ODEPRRIC.o \
+  ${OUT}/OMPKG.o    ${OUT}/OMSERVER.o ${OUT}/PADEPAC.o  ${OUT}/PADICRAT.o \
+  ${OUT}/PADICRC.o  ${OUT}/PCOMP.o    ${OUT}/PDECOMP.o  ${OUT}/PF.o       \
+  ${OUT}/PFBR.o     ${OUT}/PFBRU.o    ${OUT}/PFOTOOLS.o ${OUT}/PFRPAC.o   \
+  ${OUT}/PGCD.o     ${OUT}/PINTERPA.o ${OUT}/PLEQN.o    ${OUT}/PMPLCAT.o  \
+  ${OUT}/PMQFCAT.o  ${OUT}/PNTHEORY.o ${OUT}/POLUTIL.o  ${OUT}/POLTOPOL.o \
+  ${OUT}/POLYCATQ.o ${OUT}/POLYLIFT.o ${OUT}/POLYROOT.o ${OUT}/POLY2.o    \
+  ${OUT}/POLY2UP.o  ${OUT}/PRS.o      ${OUT}/PSQFR.o    ${OUT}/PUSHVAR.o  \
+  ${OUT}/QALGSET.o  ${OUT}/QFCAT2.o   ${OUT}/RADIX.o    ${OUT}/RATFACT.o  \
+  ${OUT}/RCFIELD.o  ${OUT}/RCFIELD-.o ${OUT}/RDETR.o    ${OUT}/RDETRS.o   \
+  ${OUT}/REAL0.o    ${OUT}/REAL0Q.o   ${OUT}/REALSOLV.o ${OUT}/RESRING.o  \
+  ${OUT}/RETSOL.o   ${OUT}/RF.o       ${OUT}/RFFACTOR.o ${OUT}/RMATCAT.o  \
+  ${OUT}/RMATCAT-.o ${OUT}/RRCC.o     ${OUT}/RRCC-.o    ${OUT}/SCPKG.o    \
+  ${OUT}/SHDP.o     ${OUT}/SHP.o      ${OUT}/SIGNRF.o   ${OUT}/SMITH.o    \
+  ${OUT}/SMP.o      ${OUT}/SMTS.o     ${OUT}/SOLVEFOR.o ${OUT}/SPLTREE.o  \
+  ${OUT}/STINPROD.o ${OUT}/STTFNC.o   ${OUT}/SUBRESP.o  ${OUT}/SUMRF.o    \
+  ${OUT}/SUP.o      ${OUT}/SUPEXPR.o  ${OUT}/SUPFRACF.o ${OUT}/TANEXP.o   \
+  ${OUT}/TEMUTL.o   ${OUT}/TEX.o      ${OUT}/TEXTFILE.o ${OUT}/TREE.o     \
+  ${OUT}/TWOFACT.o  ${OUT}/UNIFACT.o  ${OUT}/UP.o       ${OUT}/UPCDEN.o   \
+  ${OUT}/UPDECOMP.o ${OUT}/UPDIVP.o   ${OUT}/UPMP.o     ${OUT}/UPOLYC2.o  \
+  ${OUT}/UPXSCAT.o  ${OUT}/UPSQFREE.o ${OUT}/VIEWDEF.o  ${OUT}/VIEW2D.o   \
+  ${OUT}/VOID.o     ${OUT}/WEIER.o    ${OUT}/WP.o \
   layer11done
 
 @
 \subsection{Layer12}
-
+Depends on: DIOPS DPOLCAT FINRALG FRAC RMATCAT RRCC UPXSCAT
+Used by next layer: DIAGG FRAMALG MDAGG SMATCAT UPXSCCA
 <<layer12>>=
 
 LAYER12=\
+  ${OUT}/DIAGG.o   ${OUT}/DIAGG-.o   ${OUT}/DSMP.o     ${OUT}/EXPUPXS.o \
+  ${OUT}/FRAMALG.o ${OUT}/FRAMALG-.o ${OUT}/MDAGG.o    ${OUT}/ODPOL.o   \
+  ${OUT}/PLOT.o    ${OUT}/RMCAT2.o   ${OUT}/ROIRC.o    ${OUT}/SDPOL.o   \
+  ${OUT}/SMATCAT.o ${OUT}/SMATCAT-.o ${OUT}/TUBETOOL.o ${OUT}/UPXSCCA.o \
+  ${OUT}/UPXSCCA-.o \
   layer12done
 
 @
 \subsection{Layer13}
-
+Depends on: DIAGG FRAMALG MDAGG SMATCAT UPXSCCA
+Used by next layer: FSAGG KDAGG MSETAGG MONOGEN
 <<layer13>>=
 
 LAYER13=\
+  ${OUT}/DPMM.o     ${OUT}/EFUPXS.o  ${OUT}/FFINTBAS.o ${OUT}/FRIDEAL.o  \
+  ${OUT}/FRIDEAL2.o ${OUT}/FRMOD.o   ${OUT}/FSAGG.o    ${OUT}/FSAGG-.o   \
+  ${OUT}/IBATOOL.o  ${OUT}/INTFACT.o ${OUT}/KDAGG.o    ${OUT}/KDAGG-.o   \
+  ${OUT}/MSETAGG.o  ${OUT}/MONOGEN.o ${OUT}/MONOGEN-.o ${OUT}/NFINTBAS.o \
+  ${OUT}/SPACE3.o  \
   layer13done
 
 @
 \subsection{Layer14}
-
+Depends on: FSAGG KDAGG MSETAGG MONOGEN
+Used by next layer: TBAGG
 <<layer14>>=
 
 LAYER14=\
-  ${OUT}/ASP1.o     ${OUT}/ASP10.o    ${OUT}/ASP24.o    ${OUT}/ASP4.o     \
-  ${OUT}/ASP50.o    ${OUT}/ASP6.o     ${OUT}/ASP73.o    ${OUT}/AXSERV.o   \
-  ${OUT}/BALFACT.o  \
-  ${OUT}/BEZOUT.o   ${OUT}/BINARY.o   ${OUT}/BINFILE.o  ${OUT}/BOUNDZRO.o \
-  ${OUT}/BPADICRT.o ${OUT}/BRILL.o    ${OUT}/CDEN.o     ${OUT}/CHVAR.o    \
-  ${OUT}/COMMUPC.o  ${OUT}/CONTFRAC.o ${OUT}/CVMP.o     ${OUT}/CYCLOTOM.o \
-  ${OUT}/CYCLES.o   ${OUT}/DDFACT.o   ${OUT}/DECIMAL.o  ${OUT}/DIOPS.o    \
-  ${OUT}/DIOPS-.o   ${OUT}/DIRPROD.o  ${OUT}/DISPLAY.o  ${OUT}/DMP.o      \
-  ${OUT}/DPMO.o     ${OUT}/DPOLCAT.o  ${OUT}/DPOLCAT-.o ${OUT}/D01AJFA.o  \
-  ${OUT}/D01AKFA.o  ${OUT}/D01ALFA.o  ${OUT}/D01AMFA.o  ${OUT}/D01APFA.o  \
-  ${OUT}/D01AQFA.o  ${OUT}/EMR.o      ${OUT}/EQ.o       ${OUT}/ERROR.o    \
-  ${OUT}/EVALCYC.o  ${OUT}/E04DGFA.o  ${OUT}/E04FDFA.o  ${OUT}/E04GCFA.o  \
-  ${OUT}/E04JAFA.o  ${OUT}/FACUTIL.o  ${OUT}/FF.o       ${OUT}/FFCG.o     \
-  ${OUT}/FFCGX.o    ${OUT}/FFFG.o \
-  ${OUT}/FFHOM.o    ${OUT}/FFNB.o     ${OUT}/FFNBX.o    \
-  ${OUT}/FFPOLY.o   ${OUT}/FFX.o      ${OUT}/FFSLPE.o   ${OUT}/FGLMICPK.o \
-  ${OUT}/FILE.o     ${OUT}/FINAALG.o  ${OUT}/FINAALG-.o ${OUT}/FINRALG.o  \
-  ${OUT}/FINRALG-.o ${OUT}/FFF.o      ${OUT}/FLOATRP.o  ${OUT}/FNAME.o    \
-  ${OUT}/FOP.o      ${OUT}/FORMULA.o  ${OUT}/FORT.o     ${OUT}/FRAC.o     \
-  ${OUT}/FTEM.o     ${OUT}/GENEEZ.o   ${OUT}/GENMFACT.o ${OUT}/GENPGCD.o  \
-  ${OUT}/GALFACTU.o ${OUT}/GALPOLYU.o ${OUT}/GB.o       ${OUT}/GBEUCLID.o \
-  ${OUT}/GBF.o      ${OUT}/GBINTERN.o ${OUT}/GHENSEL.o  ${OUT}/GMODPOL.o  \
-  ${OUT}/GOSPER.o   ${OUT}/GRIMAGE.o  ${OUT}/GROEBSOL.o ${OUT}/HDMP.o     \
-  ${OUT}/HDP.o      ${OUT}/HEXADEC.o  ${OUT}/HEUGCD.o   ${OUT}/IBPTOOLS.o \
-  ${OUT}/IFF.o      ${OUT}/IBITS.o    ${OUT}/ICARD.o    ${OUT}/ICDEN.o    \
-  ${OUT}/IDECOMP.o  ${OUT}/IIARRAY2.o ${OUT}/IMATLIN.o  ${OUT}/IMATQF.o   \
-  ${OUT}/INMODGCD.o ${OUT}/INNMFACT.o ${OUT}/INPSIGN.o  ${OUT}/INTHERTR.o \
-  ${OUT}/INTRAT.o   ${OUT}/INTRF.o    ${OUT}/INTSLPE.o  ${OUT}/INTTR.o    \
-  ${OUT}/ISUMP.o    ${OUT}/LAUPOL.o   ${OUT}/LEADCDET.o ${OUT}/LGROBP.o   \
-  ${OUT}/LIMITRF.o  ${OUT}/LINDEP.o   ${OUT}/LO.o       ${OUT}/LPEFRAC.o  \
-  ${OUT}/LSPP.o     ${OUT}/MATLIN.o   ${OUT}/MCDEN.o    ${OUT}/MDDFACT.o  \
-  ${OUT}/MFINFACT.o ${OUT}/MFLOAT.o   ${OUT}/MINT.o     ${OUT}/MLIFT.o    \
-  ${OUT}/MMAP.o     ${OUT}/MODMON.o   ${OUT}/MONOTOOL.o ${OUT}/MPCPF.o    \
-  ${OUT}/MPC2.o     ${OUT}/MPC3.o     ${OUT}/MPOLY.o    ${OUT}/MPRFF.o    \
-  ${OUT}/MRATFAC.o  ${OUT}/MULTSQFR.o ${OUT}/NORMRETR.o ${OUT}/NPCOEF.o   \
-  ${OUT}/NSUP.o     ${OUT}/NTPOLFN.o  ${OUT}/ODP.o      ${OUT}/ODEPRIM.o  \
-  ${OUT}/ODEPRRIC.o ${OUT}/OMPKG.o    ${OUT}/OMSERVER.o ${OUT}/PADEPAC.o  \
-  ${OUT}/PADICRAT.o ${OUT}/PADICRC.o  ${OUT}/PCOMP.o    ${OUT}/PDECOMP.o  \
-  ${OUT}/PF.o       ${OUT}/PFBR.o     ${OUT}/PFBRU.o    ${OUT}/PFOTOOLS.o \
-  ${OUT}/PFRPAC.o   ${OUT}/PGCD.o     ${OUT}/PINTERPA.o ${OUT}/PLEQN.o    \
-  ${OUT}/PMPLCAT.o  ${OUT}/PMQFCAT.o  ${OUT}/PNTHEORY.o ${OUT}/POLUTIL.o  \
-  ${OUT}/POLTOPOL.o ${OUT}/POLYCATQ.o ${OUT}/POLYLIFT.o ${OUT}/POLYROOT.o \
-  ${OUT}/POLY2.o    ${OUT}/POLY2UP.o  ${OUT}/PRS.o      ${OUT}/PSQFR.o    \
-  ${OUT}/PUSHVAR.o  ${OUT}/QALGSET.o  ${OUT}/QFCAT2.o   ${OUT}/RADIX.o    \
-  ${OUT}/RATFACT.o  ${OUT}/RCFIELD.o  ${OUT}/RCFIELD-.o ${OUT}/RDETR.o    \
-  ${OUT}/RDETRS.o   ${OUT}/REAL0.o    ${OUT}/REAL0Q.o   ${OUT}/REALSOLV.o \
-  ${OUT}/RESRING.o  ${OUT}/RETSOL.o   ${OUT}/RF.o       ${OUT}/RFFACTOR.o \
-  ${OUT}/RMATCAT.o  ${OUT}/RMATCAT-.o ${OUT}/RRCC.o     ${OUT}/RRCC-.o    \
-  ${OUT}/SCPKG.o    ${OUT}/SHDP.o     ${OUT}/SHP.o      ${OUT}/SIGNRF.o   \
-  ${OUT}/SMITH.o    ${OUT}/SMP.o      ${OUT}/SMTS.o     ${OUT}/SOLVEFOR.o \
-  ${OUT}/SPLTREE.o  ${OUT}/STINPROD.o ${OUT}/STTFNC.o   ${OUT}/SUBRESP.o  \
-  ${OUT}/SUMRF.o    ${OUT}/SUP.o      ${OUT}/SUPEXPR.o \
-  ${OUT}/SUPFRACF.o ${OUT}/TANEXP.o   \
-  ${OUT}/TEMUTL.o   ${OUT}/TEX.o      ${OUT}/TEXTFILE.o ${OUT}/TREE.o     \
-  ${OUT}/TWOFACT.o  ${OUT}/UNIFACT.o  ${OUT}/UP.o       ${OUT}/UPCDEN.o   \
-  ${OUT}/UPDECOMP.o ${OUT}/UPDIVP.o   ${OUT}/UPMP.o     ${OUT}/UPOLYC2.o  \
-  ${OUT}/UPXSCAT.o  ${OUT}/UPSQFREE.o ${OUT}/VIEWDEF.o  ${OUT}/VIEW2D.o   \
-  ${OUT}/VOID.o     ${OUT}/WEIER.o    ${OUT}/WP.o \
+  ${OUT}/CCLASS.o   ${OUT}/FSAGG2.o  ${OUT}/GALFACT.o ${OUT}/IALGFACT.o \
+  ${OUT}/IBACHIN.o  ${OUT}/MMLFORM.o ${OUT}/NORMMA.o  ${OUT}/ODERED.o   \
+  ${OUT}/OMSAGG.o   ${OUT}/PERM.o    ${OUT}/PERMGRP.o ${OUT}/PRIMES.o   \
+  ${OUT}/PWFFINTB.o ${OUT}/RDIST.o   ${OUT}/SAE.o     ${OUT}/SAEFACT.o  \
+  ${OUT}/SAERFFC.o  ${OUT}/SGCF.o    ${OUT}/TBAGG.o   ${OUT}/TBAGG-.o   \
+  ${OUT}/VIEW3D.o   ${OUT}/WFFINTBS.o  \
   layer14done
 
 @
 \subsection{Layer15}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-plot.spad.pamphlet (PLOT PLOT1)
-\end{verbatim}
-
+Depends on: TBAGG
+Used by next layer: ALIST
 <<layer15>>=
 
 LAYER15=\
-  ${OUT}/DIAGG.o   ${OUT}/DIAGG-.o   ${OUT}/DSMP.o     ${OUT}/EXPUPXS.o \
-  ${OUT}/FFFGF.o \
-  ${OUT}/FRAMALG.o ${OUT}/FRAMALG-.o ${OUT}/MDAGG.o    ${OUT}/ODPOL.o   \
-  ${OUT}/PLOT.o    ${OUT}/RMCAT2.o   ${OUT}/ROIRC.o    ${OUT}/SDPOL.o   \
-  ${OUT}/SMATCAT.o ${OUT}/SMATCAT-.o ${OUT}/TUBETOOL.o ${OUT}/UPXSCCA.o \
-  ${OUT}/UPXSCCA-.o \
+  ${OUT}/ALIST.o   ${OUT}/EQTBL.o   ${OUT}/GSTBL.o   ${OUT}/HASHTBL.o \
+  ${OUT}/INTABL.o  ${OUT}/INTFTBL.o ${OUT}/INTPACK.o ${OUT}/IPF.o     \
+  ${OUT}/KAFILE.o  ${OUT}/PATRES.o  ${OUT}/STBL.o    ${OUT}/STRTBL.o  \
+  ${OUT}/TABLE.o   ${OUT}/TBCMPPK.o  \
   layer15done
 
 @
 \subsection{Layer16}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-efupxs.spad.pamphlet (EFUPXS)
-lodop.spad.pamphlet (MLO OMLO NCODIV ODR DPMO DPMM)
-space.spad.pamphlet (SPACEC SPACE3 TOPSP)
-\end{verbatim}
-
+Depends on: ALIST
 <<layer16>>=
 
 LAYER16=\
-  ${OUT}/DPMM.o     ${OUT}/EFUPXS.o  ${OUT}/FFINTBAS.o ${OUT}/FRIDEAL.o  \
-  ${OUT}/FRIDEAL2.o ${OUT}/FRMOD.o   ${OUT}/FSAGG.o    ${OUT}/FSAGG-.o   \
-  ${OUT}/IBATOOL.o  ${OUT}/INTFACT.o ${OUT}/KDAGG.o    ${OUT}/KDAGG-.o   \
-  ${OUT}/MSETAGG.o  ${OUT}/MONOGEN.o ${OUT}/MONOGEN-.o ${OUT}/NFINTBAS.o \
-  ${OUT}/SPACE3.o  \
+  ${OUT}/ACF.o      ${OUT}/ACF-.o     ${OUT}/ACPLOT.o   ${OUT}/ANTISYM.o  \
+  ${OUT}/ANY.o      ${OUT}/ASP12.o    ${OUT}/ASP27.o    ${OUT}/ASP28.o    \
+  ${OUT}/ASP33.o    ${OUT}/ASP49.o    ${OUT}/ASP55.o    ${OUT}/ASP7.o     \
+  ${OUT}/ASP78.o    ${OUT}/ASP8.o     ${OUT}/ASP9.o     ${OUT}/ATTRBUT.o  \
+  ${OUT}/BOP.o      ${OUT}/BOP1.o     ${OUT}/COMMONOP.o ${OUT}/COMPCAT.o  \
+  ${OUT}/COMPCAT-.o ${OUT}/DRAW.o     ${OUT}/DRAWCFUN.o ${OUT}/DROPT.o    \
+  ${OUT}/DROPT0.o   ${OUT}/D01ANFA.o  ${OUT}/D01ASFA.o  ${OUT}/D03AGNT.o  \
+  ${OUT}/EP.o       ${OUT}/E04AGNT.o  ${OUT}/FCPAK1.o   ${OUT}/FEXPR.o    \
+  ${OUT}/FFCAT.o    ${OUT}/FFCAT-.o   ${OUT}/FFCGP.o    ${OUT}/FFNBP.o    \
+  ${OUT}/FFP.o      ${OUT}/FLOAT.o    ${OUT}/FPARFRAC.o ${OUT}/FR.o       \
+  ${OUT}/FRNAALG.o  ${OUT}/FRNAALG-.o ${OUT}/FS.o       ${OUT}/FS-.o      \
+  ${OUT}/FST.o      ${OUT}/FUNCTION.o ${OUT}/GDMP.o     ${OUT}/GOPT.o     \
+  ${OUT}/HACKPI.o   ${OUT}/IDEAL.o    ${OUT}/INFORM.o   ${OUT}/INFORM1.o  \
+  ${OUT}/IPRNTPK.o  ${OUT}/IR.o       ${OUT}/ISUPS.o    ${OUT}/KERNEL.o   \
+  ${OUT}/LIB.o      ${OUT}/LMDICT.o   ${OUT}/LODOOPS.o  ${OUT}/MATRIX.o   \
+  ${OUT}/MKFLCFN.o  ${OUT}/MSET.o     ${OUT}/M3D.o      ${OUT}/NAGC02.o   \
+  ${OUT}/NAGC05.o   ${OUT}/NAGC06.o   ${OUT}/NAGD03.o   ${OUT}/NAGE01.o   \
+  ${OUT}/NAGE02.o   ${OUT}/NAGE04.o   ${OUT}/NAGF07.o   ${OUT}/NAGS.o     \
+  ${OUT}/NAGSP.o    ${OUT}/NREP.o     ${OUT}/NUMFMT.o   ${OUT}/OC.o       \
+  ${OUT}/OC-.o      ${OUT}/ODEPACK.o  ${OUT}/ODERAT.o   ${OUT}/OMERR.o    \
+  ${OUT}/OMERRK.o   ${OUT}/OPTPACK.o  ${OUT}/OSI.o      ${OUT}/PATTERN.o  \
+  ${OUT}/OVAR.o     ${OUT}/PMKERNEL.o ${OUT}/PMSYM.o    ${OUT}/POLY.o     \
+  ${OUT}/PRIMELT.o  ${OUT}/QALGSET2.o ${OUT}/QEQUAT.o   ${OUT}/RECLOS.o   \
+  ${OUT}/REP1.o     ${OUT}/RESULT.o   ${OUT}/QUATCAT.o  ${OUT}/QUATCAT-.o \
+  ${OUT}/RFFACT.o   ${OUT}/RMATRIX.o  ${OUT}/ROMAN.o    ${OUT}/ROUTINE.o  \
+  ${OUT}/RPOLCAT.o  ${OUT}/RPOLCAT-.o ${OUT}/RULECOLD.o ${OUT}/SAOS.o     \
+  ${OUT}/SEGBIND.o  ${OUT}/SET.o      ${OUT}/SPECOUT.o  ${OUT}/SQMATRIX.o \
+  ${OUT}/SWITCH.o   ${OUT}/SYMS.o     ${OUT}/SYMTAB.o   ${OUT}/SYSSOLP.o  \
+  ${OUT}/UTSCAT.o   ${OUT}/UTSCAT-.o  ${OUT}/VARIABLE.o \
   layer16done
 
 @
 \subsection{Layer17}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-aggcat2.spad.pamphlet (FLAGG2 FSAGG2)
-galfact.spad.pamphlet (GALFACT)
-intfact.spad.pamphlet (PRIMES IROOT INTFACT)
-padiclib.spad.pamphlet (IBPTOOLS IBACHIN PWFFINTB)
-permgrps.spad.pamphlet (PERMGRP PGE)
-random.spad.pamphlet (RANDSRC RDIST INTBIT RIDIST RFDIST)
-sgcf.spad.pamphlet (SGCF)
-\end{verbatim}
 
 <<layer17>>=
 
 LAYER17=\
-  ${OUT}/CCLASS.o  ${OUT}/FSAGG2.o  ${OUT}/GALFACT.o ${OUT}/IALGFACT.o \
-  ${OUT}/IBACHIN.o ${OUT}/MMLFORM.o \
-  ${OUT}/NORMMA.o  ${OUT}/ODERED.o  ${OUT}/OMSAGG.o   \
-  ${OUT}/PERM.o    ${OUT}/PERMGRP.o ${OUT}/PRIMES.o  ${OUT}/PWFFINTB.o \
-  ${OUT}/RDIST.o   ${OUT}/SAE.o     ${OUT}/SAEFACT.o ${OUT}/SAERFFC.o  \
-  ${OUT}/SGCF.o    ${OUT}/TBAGG.o   ${OUT}/TBAGG-.o  ${OUT}/VIEW3D.o  \
   layer17done
 
 @
 \subsection{Layer18}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-d01package.spad.pamphlet (INTPACK)
-list.spad.pamphlet (ILIST LIST LIST2 LIST3 LIST2MAP ALIST)
-\end{verbatim}
 
 <<layer18>>=
 
 LAYER18=\
-  ${OUT}/ALIST.o   ${OUT}/EQTBL.o   ${OUT}/GSTBL.o   ${OUT}/HASHTBL.o \
-  ${OUT}/INTABL.o  ${OUT}/INTFTBL.o ${OUT}/INTPACK.o ${OUT}/IPF.o     \
-  ${OUT}/KAFILE.o  ${OUT}/PATRES.o  ${OUT}/STBL.o    ${OUT}/STRTBL.o  \
-  ${OUT}/TABLE.o   ${OUT}/TBCMPPK.o  \
   layer18done
 
 @
 \subsection{Layer19}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-acplot.spad.pamphlet (REALSOLV ACPLOT)
-alql.spad.pamphlet (DLIST ICARD DBASE QEQUAT MTHING OPQUERY)
-any.spad.pamphlet (NONE NONE1 ANY ANY1)
-c02.spad.pamphlet (NAGC02)
-c05.spad.pamphlet (NAGC05)
-c06.spad.pamphlet (NAGC06)
-d02package.spad.pamphlet (ODEPACK)
-d03agents.spad.pamphlet (D03AGNT)
-d03package.spad.pamphlet (PDEPACK)
-drawopt.spad.pamphlet (DROPT DROPT1 DROPT0)
-eigen.spad.pamphlet (EP CHARPOL)
-e01.spad.pamphlet (NAGE01)
-e02.spad.pamphlet (NAGE02)
-e04.spad.pamphlet (NAGE04)
-e04agents.spad.pamphlet (E04AGNT)
-e04package.spad.pamphlet (OPTPACK)
-fnla.spad.pamphlet (OSI COMM HB FNLA)
-fortpak.spad.pamphlet (FCPAK1 NAGSP FORT FOP TEMUTL MCALCFN)
-fr.spad.pamphlet (FR FRUTIL FR2)
-f07.spad.pamphlet (NAGF07)
-intaux.spad.pamphlet (IR IR2)
-intclos.spad.pamphlet (TRIMAT IBATOOL FFINTBAS WFFINTBS NFINTBAS)
-integer.spad.pamphlet (INTSLPE INT NNI PI ROMAN)
-kl.spad.pamphlet (CACHSET SCACHE MKCHSET KERNEL KERNEL2)
-mkfunc.spad.pamphlet (INFORM INFORM1 MKFUNC MKUCFUNC MKBCFUNC MKFLCFN)
-modgcd.spad.pamphlet (INMODGCD)
-multpoly.spad.pamphlet (POLY POLY2 MPOLY SMP INDE)
-newdata.spad.pamphlet (IPRNTPK TBCMPPK SPLNODE SPLTREE)
-op.spad.pamphlet (BOP BOP1 COMMONOP)
-out.spad.pamphlet (OUT SPECOUT DISPLAY)
-outform.spad.pamphlet (NUMFMT OUTFORM)
-patmatch1.spad.pamphlet (PATRES PATRES2 PATLRES PATMAB FPATMAB PMSYM PMKERNEL
-                         PMDOWN PMTOOLS PMLSAGG)
-pattern.spad.pamphlet (PATTERN PATTERN1 PATTERN2 PATAB)
-qalgset.spad.pamphlet (QALGSET QALGSET2)
-reclos.spad.pamphlet (POLUTIL RRCC RCFIELD ROIRC RECLOS)
-rep1.spad.pamphlet (REP1)
-s.spad.pamphlet (NAGS)
-seg.spad.pamphlet (SEGCAT SEGXCAT SEG SEG2 SEGBIND SETBIND2 UNISEG UNISEG2
-                   INCRMAPS)
-syssolp.spad.pamphlet (SYSSOLP)
-\end{verbatim}
 
 <<layer19>>=
 
 LAYER19=\
-  ${OUT}/ACF.o      ${OUT}/ACF-.o     ${OUT}/ACPLOT.o   ${OUT}/ANTISYM.o \
-  ${OUT}/ANY.o      ${OUT}/ASP12.o    ${OUT}/ASP27.o    ${OUT}/ASP28.o   \
-  ${OUT}/ASP33.o    ${OUT}/ASP49.o    ${OUT}/ASP55.o    ${OUT}/ASP7.o    \
-  ${OUT}/ASP78.o    ${OUT}/ASP8.o     ${OUT}/ASP9.o     ${OUT}/ATTRBUT.o \
-  ${OUT}/BOP.o      ${OUT}/BOP1.o     ${OUT}/COMMONOP.o ${OUT}/COMPCAT.o \
-  ${OUT}/COMPCAT-.o ${OUT}/DRAW.o     ${OUT}/DRAWCFUN.o ${OUT}/DROPT.o   \
-  ${OUT}/DROPT0.o   ${OUT}/D01ANFA.o  ${OUT}/D01ASFA.o  ${OUT}/D03AGNT.o \
-  ${OUT}/EP.o       ${OUT}/E04AGNT.o  ${OUT}/FCPAK1.o   ${OUT}/FEXPR.o   \
-  ${OUT}/FFCAT.o    ${OUT}/FFCAT-.o   ${OUT}/FFCGP.o    ${OUT}/FFNBP.o   \
-  ${OUT}/FFP.o      ${OUT}/FLOAT.o    ${OUT}/FPARFRAC.o ${OUT}/FR.o      \
-  ${OUT}/FRNAALG.o  ${OUT}/FRNAALG-.o ${OUT}/FS.o       ${OUT}/FS-.o     \
-  ${OUT}/FST.o      ${OUT}/FUNCTION.o ${OUT}/GDMP.o     ${OUT}/GOPT.o    \
-  ${OUT}/HACKPI.o  \
-  ${OUT}/IDEAL.o    ${OUT}/INFORM.o   ${OUT}/INFORM1.o  ${OUT}/IPRNTPK.o \
-  ${OUT}/IR.o       ${OUT}/ISUPS.o    ${OUT}/KERNEL.o   ${OUT}/LIB.o     \
-  ${OUT}/LMDICT.o   ${OUT}/LODOOPS.o  ${OUT}/MATRIX.o   ${OUT}/MKFLCFN.o \
-  ${OUT}/MSET.o     ${OUT}/M3D.o      ${OUT}/NAGC02.o   ${OUT}/NAGC05.o  \
-  ${OUT}/NAGC06.o   ${OUT}/NAGD03.o   ${OUT}/NAGE01.o   ${OUT}/NAGE02.o  \
-  ${OUT}/NAGE04.o   ${OUT}/NAGF07.o   ${OUT}/NAGS.o     ${OUT}/NAGSP.o   \
-  ${OUT}/NREP.o     ${OUT}/NUMFMT.o   ${OUT}/OC.o       ${OUT}/OC-.o     \
-  ${OUT}/ODEPACK.o  ${OUT}/ODERAT.o   ${OUT}/OMERR.o    ${OUT}/OMERRK.o  \
-  ${OUT}/OPTPACK.o  ${OUT}/OSI.o      ${OUT}/PATTERN.o  ${OUT}/OVAR.o    \
-  ${OUT}/PMKERNEL.o ${OUT}/PMSYM.o    ${OUT}/POLY.o     ${OUT}/PRIMELT.o \
-  ${OUT}/QALGSET2.o ${OUT}/QEQUAT.o   ${OUT}/RECLOS.o   ${OUT}/REP1.o    \
-  ${OUT}/RESULT.o   ${OUT}/QUATCAT.o  ${OUT}/QUATCAT-.o ${OUT}/RFFACT.o  \
-  ${OUT}/RMATRIX.o  ${OUT}/ROMAN.o    ${OUT}/ROUTINE.o  ${OUT}/RPOLCAT.o \
-  ${OUT}/RPOLCAT-.o ${OUT}/RULECOLD.o ${OUT}/SAOS.o     ${OUT}/SEGBIND.o \
-  ${OUT}/SET.o      ${OUT}/SPECOUT.o  ${OUT}/SQMATRIX.o ${OUT}/SWITCH.o  \
-  ${OUT}/SYMS.o     ${OUT}/SYMTAB.o   ${OUT}/SYSSOLP.o  ${OUT}/UTSCAT.o  \
-  ${OUT}/UTSCAT-.o  ${OUT}/VARIABLE.o ${OUT}/WFFINTBS.o  \
   layer19done
 
 
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 4ca6300..1a34cd9 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -855,6 +855,8 @@ algebra/Makefile move layers 7,8,9 <br/>
 algebra/Makefile move layer 10, MAPPKG4 <br/>
 <a href="patches/20081225.03.tpd.patch">20081225.03.tpd.patch</a>
 algebra/Makefile move layers 11, 12, 13 <br/>
+<a href="patches/20081225.04.tpd.patch">20081225.04.tpd.patch</a>
+algebra/Makefile move layers 15, 16, 17, 18, 19 <br/>
 
  </body>
 </html>

\start
Date: Fri, 26 Dec 2008 09:12:24 -0600
From: Tim Daly
To: list
Subject: 20081226.01.tpd.patch (algebra/Makefile rearrange build order)

Move several domains downward in the build order
=======================================================================
diff --git a/changelog b/changelog
index 1e53de8..8a8dc2b 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081226 tpd src/axiom-website/patches.html 20081225.04.tpd.patch
+20081226 tpd src/algebra/Makefile rearrange build order
 20081225 tpd src/axiom-website/patches.html 20081225.04.tpd.patch
 20081225 tpd src/algebra/Makefile move layers 15-19
 20081225 tpd src/axiom-website/patches.html 20081225.03.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 4335faf..6b99258 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -83,6 +83,15 @@ stanzas before continuing upward.
 
 \section{The Algebra Lattice Layers}
 \subsection{Layer 0 Bootstrap}
+The easiest way to find out where a spad file lives in the hierarchy
+is to create the following script (called 'show'):
+\begin{verbatim}
+  echo ")co $1" | AXIOMsys >out
+  fgrep abbreviates out
+  fgrep "Loading" out | grep -v autoload
+\end{verbatim}
+and then run it with ``./show FOO'' where the algebra source file
+is FOO.spad.
 \subsubsection{Completed spad files}
 Note well that none of the algebra stanzas should include these
 files in the preconditions otherwise we have an infinite compile
@@ -344,7 +353,7 @@ LAYER7=\
 @
 \subsection{Layer8}
 Depends on: A1AGG A1AGG- ARR2CAT FAMR FPC LIECAT LZSTAGG OREPCAT PSCAT 
-TRANFUN VSPACE XPOLYC
+TRANFUN VSPACE XPOLYC\\
 Used by next layer: BTAGG FLALG MATCAT SRAGG VECTCAT 
 <<layer8>>=
 
@@ -367,7 +376,7 @@ LAYER8=\
 
 @
 \subsection{Layer9}
-Depends on: BTAGG FLALG MATCAT SRAGG VECTCAT
+Depends on: BTAGG FLALG MATCAT SRAGG VECTCAT\\
 Used by next layer: IVECTOR PTCAT STRICAT 
 <<layer9>>=
 
@@ -379,7 +388,7 @@ LAYER9=\
 
 @
 \subsection{Layer10}
-Depends on: IVECTOR PTCAT STRICAT
+Depends on: IVECTOR PTCAT STRICAT\\
 Used by next layer: DIRPCAT FAXF PFECAT STRING
 <<layer10>>=
 
@@ -398,7 +407,7 @@ LAYER10=\
 
 @
 \subsection{Layer11}
-Depends on: DIRPCAT FAXF PFECAT STRING
+Depends on: DIRPCAT FAXF PFECAT STRING\\
 Used by next layer: DIOPS DPOLCAT FINRALG FRAC RMATCAT RRCC UPXSCAT
 <<layer11>>=
 
@@ -414,7 +423,8 @@ LAYER11=\
   ${OUT}/D01AJFA.o  ${OUT}/D01AKFA.o  ${OUT}/D01ALFA.o  ${OUT}/D01AMFA.o  \
   ${OUT}/D01APFA.o  ${OUT}/D01AQFA.o  ${OUT}/EMR.o      ${OUT}/EQ.o       \
   ${OUT}/ERROR.o    ${OUT}/EVALCYC.o  ${OUT}/E04DGFA.o  ${OUT}/E04FDFA.o  \
-  ${OUT}/E04GCFA.o  ${OUT}/E04JAFA.o  ${OUT}/FACUTIL.o  ${OUT}/FF.o       \
+  ${OUT}/E04GCFA.o  ${OUT}/E04JAFA.o  ${OUT}/E04UCFA.o  \
+  ${OUT}/FACUTIL.o  ${OUT}/FF.o       \
   ${OUT}/FFCG.o     ${OUT}/FFCGX.o    ${OUT}/FFFG.o     ${OUT}/FFFGF.o    \
   ${OUT}/FFHOM.o    ${OUT}/FFNB.o     ${OUT}/FFNBX.o    ${OUT}/FFPOLY.o   \
   ${OUT}/FFX.o      ${OUT}/FFSLPE.o   ${OUT}/FGLMICPK.o ${OUT}/FILE.o     \
@@ -463,7 +473,7 @@ LAYER11=\
 
 @
 \subsection{Layer12}
-Depends on: DIOPS DPOLCAT FINRALG FRAC RMATCAT RRCC UPXSCAT
+Depends on: DIOPS DPOLCAT FINRALG FRAC RMATCAT RRCC UPXSCAT\\
 Used by next layer: DIAGG FRAMALG MDAGG SMATCAT UPXSCCA
 <<layer12>>=
 
@@ -477,7 +487,7 @@ LAYER12=\
 
 @
 \subsection{Layer13}
-Depends on: DIAGG FRAMALG MDAGG SMATCAT UPXSCCA
+Depends on: DIAGG FRAMALG MDAGG SMATCAT UPXSCCA\\
 Used by next layer: FSAGG KDAGG MSETAGG MONOGEN
 <<layer13>>=
 
@@ -491,7 +501,7 @@ LAYER13=\
 
 @
 \subsection{Layer14}
-Depends on: FSAGG KDAGG MSETAGG MONOGEN
+Depends on: FSAGG KDAGG MSETAGG MONOGEN\\
 Used by next layer: TBAGG
 <<layer14>>=
 
@@ -506,25 +516,27 @@ LAYER14=\
 
 @
 \subsection{Layer15}
-Depends on: TBAGG
+Depends on: TBAGG\\
 Used by next layer: ALIST
 <<layer15>>=
 
 LAYER15=\
   ${OUT}/ALIST.o   ${OUT}/EQTBL.o   ${OUT}/GSTBL.o   ${OUT}/HASHTBL.o \
   ${OUT}/INTABL.o  ${OUT}/INTFTBL.o ${OUT}/INTPACK.o ${OUT}/IPF.o     \
-  ${OUT}/KAFILE.o  ${OUT}/PATRES.o  ${OUT}/STBL.o    ${OUT}/STRTBL.o  \
-  ${OUT}/TABLE.o   ${OUT}/TBCMPPK.o  \
+  ${OUT}/KAFILE.o  ${OUT}/PATRES.o  ${OUT}/PDEPACK.o ${OUT}/STBL.o    \
+  ${OUT}/STRTBL.o  ${OUT}/TABLE.o   ${OUT}/TBCMPPK.o  \
   layer15done
 
 @
 \subsection{Layer16}
-Depends on: ALIST
+Depends on: ALIST\\
+Used by next layer: ACF COMPCAT FFCAT FRNAALG FS OC QUATCAT RPOLCAT UTSCAT 
 <<layer16>>=
 
 LAYER16=\
   ${OUT}/ACF.o      ${OUT}/ACF-.o     ${OUT}/ACPLOT.o   ${OUT}/ANTISYM.o  \
   ${OUT}/ANY.o      ${OUT}/ASP12.o    ${OUT}/ASP27.o    ${OUT}/ASP28.o    \
+  ${OUT}/ASP30.o    \
   ${OUT}/ASP33.o    ${OUT}/ASP49.o    ${OUT}/ASP55.o    ${OUT}/ASP7.o     \
   ${OUT}/ASP78.o    ${OUT}/ASP8.o     ${OUT}/ASP9.o     ${OUT}/ATTRBUT.o  \
   ${OUT}/BOP.o      ${OUT}/BOP1.o     ${OUT}/COMMONOP.o ${OUT}/COMPCAT.o  \
@@ -535,11 +547,13 @@ LAYER16=\
   ${OUT}/FFP.o      ${OUT}/FLOAT.o    ${OUT}/FPARFRAC.o ${OUT}/FR.o       \
   ${OUT}/FRNAALG.o  ${OUT}/FRNAALG-.o ${OUT}/FS.o       ${OUT}/FS-.o      \
   ${OUT}/FST.o      ${OUT}/FUNCTION.o ${OUT}/GDMP.o     ${OUT}/GOPT.o     \
+  ${OUT}/GOPT0.o \
   ${OUT}/HACKPI.o   ${OUT}/IDEAL.o    ${OUT}/INFORM.o   ${OUT}/INFORM1.o  \
   ${OUT}/IPRNTPK.o  ${OUT}/IR.o       ${OUT}/ISUPS.o    ${OUT}/KERNEL.o   \
   ${OUT}/LIB.o      ${OUT}/LMDICT.o   ${OUT}/LODOOPS.o  ${OUT}/MATRIX.o   \
   ${OUT}/MKFLCFN.o  ${OUT}/MSET.o     ${OUT}/M3D.o      ${OUT}/NAGC02.o   \
-  ${OUT}/NAGC05.o   ${OUT}/NAGC06.o   ${OUT}/NAGD03.o   ${OUT}/NAGE01.o   \
+  ${OUT}/NAGC05.o   ${OUT}/NAGC06.o   ${OUT}/NAGD01.o   ${OUT}/NAGD02.o   \
+  ${OUT}/NAGD03.o   ${OUT}/NAGE01.o   \
   ${OUT}/NAGE02.o   ${OUT}/NAGE04.o   ${OUT}/NAGF07.o   ${OUT}/NAGS.o     \
   ${OUT}/NAGSP.o    ${OUT}/NREP.o     ${OUT}/NUMFMT.o   ${OUT}/OC.o       \
   ${OUT}/OC-.o      ${OUT}/ODEPACK.o  ${OUT}/ODERAT.o   ${OUT}/OMERR.o    \
@@ -556,112 +570,26 @@ LAYER16=\
 
 @
 \subsection{Layer17}
-
+Depends on: ACF COMPCAT FFCAT FRNAALG FS OC QUATCAT RPOLCAT UTSCAT
 <<layer17>>=
 
 LAYER17=\
-  layer17done
-
-@
-\subsection{Layer18}
-
-<<layer18>>=
-
-LAYER18=\
-  layer18done
-
-@
-\subsection{Layer19}
-
-<<layer19>>=
-
-LAYER19=\
-  layer19done
-
-
-@
-\subsection{Layer20}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-algfact.spad.pamphlet (IALGFACT SAEFACT RFFACT SAERFFC ALGFACT)
-algfunc.spad.pamphlet (ACF ACFS AF)
-cmplxrt.spad.pamphlet (CMPLXRT)
-crfp.spad.pamphlet (CRFP)
-curve.spad.pamphlet (FFCAT MMAP FFCAT2 CHAVAR RDFF ALGFF)
-draw.spad.pamphlet (DRAWCFUN DRAW DRAWCURV DRAWPT)
-d01.spad.pamphlet (NAGD01)
-efstruc.spad.pamphlet (SYMFUNC TANEXP EFSTRUC ITRIGMNP TRIGMNIP CTRIGMNP)
-elemntry.spad.pamphlet (EF)
-elfuts.spad.pamphlet (ELFUTS)
-exprode.spad.pamphlet (EXPRODE)
-f01.spad.pamphlet (NAGF01)
-f02.spad.pamphlet (NAGF02)
-f04.spad.pamphlet (NAGF04)
-fspace.spad.pamphlet (ES ES1 ES2 FS FS2)
-fs2ups.spad.pamphlet (FS2UPS)
-funcpkgs.spad.pamphlet (FSUPFACT)
-gaussfac.spad.pamphlet (GAUSSFAC)
-gaussian.spad.pamphlet (COMPCAT COMPLPAT CPMATCH COMPLEX COMPLEX2 COMPFACT
-                        CINTSLPE)
-generic.spad.pamphlet (GCNAALG CVMP)
-genufact.spad.pamphlet (GENUFACT)
-genups.spad.pamphlet (GENUPS)
-infprod.spad.pamphlet (STINPROD INFPROD0 INPRODPF INPRODFF)
-intaf.spad.pamphlet (INTG0 INTPAF INTAF)
-intalg.spad.pamphlet (DBLRESP INTHERAL INTALG)
-intef.spad.pamphlet (INTEF)
-intpm.spad.pamphlet (INTPM)
-kovacic.spad.pamphlet (KOVACIC)
-liouv.spad.pamphlet (LF)
-lodof.spad.pamphlet (SETMN PREASSOC ASSOCEQ LODOF)
-manip.spad.pamphlet (FACTFUNC POLYROOT ALGMANIP SIMPAN TRMANIP)
-multfact.spad.pamphlet (INNMFACT MULTFACT ALGMFACT)
-naalg.spad.pamphlet (ALGSC SCPKG ALGPKG FRNAAF2)
-newpoly.spad.pamphlet (NSUP NSUP2 RPOLCAT NSMP)
-nlinsol.spad.pamphlet (RETSOL NLINSOL)
-numeigen.spad.pamphlet (IFSPRMELT.oNEP NREP NCEP)
-numeric.spad.pamphlet (NUMERIC DRAWHACK)
-numsolve.spad.pamphlet (INFSP FLOATRP FLOATCP)
-oct.spad.pamphlet (OC OCT OCTCT2)
-odealg.spad.pamphlet (ODESYS ODERED ODEPAL)
-openmath.spad.pamphlet (OMEXPR)
-pade.spad.pamphlet (PADEPAC PADE)
-patmatch2.spad.pamphlet (PMINS PMQFCAT PMPLCT PMFS PATMATCH)
-pfo.spad.pamphlet (FORDER RDIV PFOTOOLS PFOQ FSRED PFO)
-primelt.spad.pamphlet (PRIMELT FSPRMELT)
-quat.spad.pamphlet (QUATCAT QUAT QUATCT2)
-rdeef.spad.pamphlet (INTTOOLS RDEEF)
-rdesys.spad.pamphlet (RDETRS RDEEFS)
-riccati.spad.pamphlet (ODEPRRIC ODERTRIC)
-rule.spad.pamphlet (RULE APPRULE RULESET)
-sign.spad.pamphlet (TOOLSIGN INPSIGN SIGNRF LIMITRF)
-special.spad.pamphlet (DFSFUN ORTHPOL NTPOLFN)
-tools.spad.pamphlet (ESTOOLS ESTOOLS1 ESTOOLS2)
-triset.spad.pamphlet (TSETCAT GTSET PSETPK)
-tube.spad.pamphlet (TUBE TUBETOOL EXPRTUBE NUMTUBE)
-utsode.spad.pamphlet (UTSODE)
-\end{verbatim}
-
-<<layer20>>=
-
-LAYER20=\
   ${OUT}/ACFS.o     ${OUT}/ACFS-.o    ${OUT}/AF.o       ${OUT}/ALGFACT.o  \
   ${OUT}/ALGFF.o    ${OUT}/ALGMANIP.o ${OUT}/ALGMFACT.o ${OUT}/ALGPKG.o   \
   ${OUT}/ALGSC.o    ${OUT}/AN.o       ${OUT}/APPRULE.o  ${OUT}/ASP19.o    \
-  ${OUT}/ASP20.o    ${OUT}/ASP30.o    ${OUT}/ASP31.o    ${OUT}/ASP35.o    \
+  ${OUT}/ASP20.o    ${OUT}/ASP31.o    ${OUT}/ASP35.o    \
   ${OUT}/ASP41.o    ${OUT}/ASP42.o    ${OUT}/ASP74.o    ${OUT}/ASP77.o    \
   ${OUT}/ASP80.o    ${OUT}/CINTSLPE.o ${OUT}/COMPFACT.o ${OUT}/COMPLEX.o  \
   ${OUT}/COMPLPAT.o ${OUT}/CMPLXRT.o  ${OUT}/CPMATCH.o  ${OUT}/CRFP.o     \
   ${OUT}/CTRIGMNP.o ${OUT}/D01WGTS.o  ${OUT}/D02AGNT.o  ${OUT}/D03EEFA.o  \
   ${OUT}/DBLRESP.o  ${OUT}/DERHAM.o   ${OUT}/DFSFUN.o   ${OUT}/DRAWCURV.o \
-  ${OUT}/E04NAFA.o  ${OUT}/E04UCFA.o  ${OUT}/EF.o       ${OUT}/EFSTRUC.o  \
+  ${OUT}/E04NAFA.o  ${OUT}/EF.o       ${OUT}/EFSTRUC.o  \
   ${OUT}/ELFUTS.o   ${OUT}/ESTOOLS.o  ${OUT}/EXPEXPAN.o ${OUT}/EXPRODE.o  \
   ${OUT}/EXPRTUBE.o ${OUT}/EXPR2.o    ${OUT}/FC.o       ${OUT}/FDIVCAT.o  \
   ${OUT}/FDIVCAT-.o ${OUT}/FDIV2.o    ${OUT}/FFCAT2.o   ${OUT}/FLOATCP.o  \
-  ${OUT}/FORDER.o   ${OUT}/FORTRAN.o  ${OUT}/FSRED.o    ${OUT}/FSUPFACT.o \
-  ${OUT}/FRNAAF2.o  ${OUT}/FSPECF.o   ${OUT}/FS2.o      ${OUT}/FS2UPS.o   \
+  ${OUT}/FORDER.o   ${OUT}/FORTRAN.o  ${OUT}/FRNAAF2.o  ${OUT}/FSRED.o    \
+  ${OUT}/FSUPFACT.o ${OUT}/FSPECF.o   ${OUT}/FS2.o      ${OUT}/FS2UPS.o   \
   ${OUT}/GAUSSFAC.o ${OUT}/GCNAALG.o  ${OUT}/GENUFACT.o ${OUT}/GENUPS.o   \
-  ${OUT}/GOPT0.o \
   ${OUT}/GTSET.o    ${OUT}/GPOLSET.o  ${OUT}/IAN.o      ${OUT}/INEP.o     \
   ${OUT}/INFPROD0.o ${OUT}/INFSP.o    ${OUT}/INPRODFF.o ${OUT}/INPRODPF.o \
   ${OUT}/INTAF.o    ${OUT}/INTALG.o   ${OUT}/INTEF.o    ${OUT}/INTG0.o    \
@@ -669,11 +597,10 @@ LAYER20=\
   ${OUT}/ITRIGMNP.o ${OUT}/JORDAN.o   ${OUT}/KOVACIC.o  ${OUT}/LF.o       \
   ${OUT}/LIE.o      ${OUT}/LODOF.o    ${OUT}/LSQM.o     ${OUT}/OMEXPR.o   \
   ${OUT}/MCMPLX.o   ${OUT}/MULTFACT.o ${MID}/clique1.spad \
-  ${OUT}/NAGD01.o   ${OUT}/NAGD02.o   \
   ${OUT}/NAGF01.o   ${OUT}/NAGF02.o   ${OUT}/NAGF04.o   ${OUT}/NCEP.o     \
   ${OUT}/NLINSOL.o  ${OUT}/NSMP.o     ${OUT}/NUMERIC.o  ${OUT}/OCT.o      \
   ${OUT}/OCTCT2.o   ${OUT}/ODEPAL.o   ${OUT}/ODERTRIC.o ${OUT}/PADE.o     \
-  ${OUT}/PAN2EXPR.o ${OUT}/PDEPACK.o  ${OUT}/PFO.o      ${OUT}/PFOQ.o     \
+  ${OUT}/PAN2EXPR.o ${OUT}/PFO.o      ${OUT}/PFOQ.o     \
   ${OUT}/PICOERCE.o ${OUT}/PMASSFS.o  ${OUT}/PMFS.o     ${OUT}/PMPREDFS.o \
   ${OUT}/PSETPK.o   ${OUT}/QUAT.o     ${OUT}/QUATCT2.o  ${OUT}/RADFF.o    \
   ${OUT}/RDEEF.o    ${OUT}/RDEEFS.o   ${OUT}/RDIV.o     ${OUT}/RSETCAT.o  \
@@ -683,6 +610,31 @@ LAYER20=\
   ${OUT}/ULSCCAT.o  \
   ${OUT}/ULSCCAT-.o ${OUT}/UPXSSING.o ${OUT}/UTSODE.o   ${OUT}/UTSODETL.o \
   ${OUT}/UTSSOL.o   ${OUT}/UTS2.o     ${OUT}/WUTSET.o  \
+  layer17done
+
+@
+\subsection{Layer18}
+
+<<layer18>>=
+
+LAYER18=\
+  layer18done
+
+@
+\subsection{Layer19}
+
+<<layer19>>=
+
+LAYER19=\
+  layer19done
+
+
+@
+\subsection{Layer20}
+
+<<layer20>>=
+
+LAYER20=\
   layer20done
     
 @
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 1a34cd9..e0cedab 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -857,6 +857,8 @@ algebra/Makefile move layer 10, MAPPKG4 <br/>
 algebra/Makefile move layers 11, 12, 13 <br/>
 <a href="patches/20081225.04.tpd.patch">20081225.04.tpd.patch</a>
 algebra/Makefile move layers 15, 16, 17, 18, 19 <br/>
+<a href="patches/20081226.01.tpd.patch">20081226.01.tpd.patch</a>
+algebra/Makefile rearrange build order <br/>
 
  </body>
 </html>

\start
Date: Fri, 26 Dec 2008 17:39:10 -0600
From: Tim Daly
To: list
Subject: 20081226.02.tpd.patch (algebra/Makefile rearrange build order)

More rearrangements in the build order to satisfy build graph
======================================================================
diff --git a/changelog b/changelog
index 8a8dc2b..f76cb32 100644
--- a/changelog
+++ b/changelog
@@ -1,4 +1,6 @@
-20081226 tpd src/axiom-website/patches.html 20081225.04.tpd.patch
+20081226 tpd src/axiom-website/patches.html 20081226.02.tpd.patch
+20081226 tpd src/algebra/Makefile rearrange build order
+20081226 tpd src/axiom-website/patches.html 20081226.01.tpd.patch
 20081226 tpd src/algebra/Makefile rearrange build order
 20081225 tpd src/axiom-website/patches.html 20081225.04.tpd.patch
 20081225 tpd src/algebra/Makefile move layers 15-19
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 6b99258..6e070ed 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -423,52 +423,51 @@ LAYER11=\
   ${OUT}/D01AJFA.o  ${OUT}/D01AKFA.o  ${OUT}/D01ALFA.o  ${OUT}/D01AMFA.o  \
   ${OUT}/D01APFA.o  ${OUT}/D01AQFA.o  ${OUT}/EMR.o      ${OUT}/EQ.o       \
   ${OUT}/ERROR.o    ${OUT}/EVALCYC.o  ${OUT}/E04DGFA.o  ${OUT}/E04FDFA.o  \
-  ${OUT}/E04GCFA.o  ${OUT}/E04JAFA.o  ${OUT}/E04UCFA.o  \
-  ${OUT}/FACUTIL.o  ${OUT}/FF.o       \
-  ${OUT}/FFCG.o     ${OUT}/FFCGX.o    ${OUT}/FFFG.o     ${OUT}/FFFGF.o    \
-  ${OUT}/FFHOM.o    ${OUT}/FFNB.o     ${OUT}/FFNBX.o    ${OUT}/FFPOLY.o   \
-  ${OUT}/FFX.o      ${OUT}/FFSLPE.o   ${OUT}/FGLMICPK.o ${OUT}/FILE.o     \
-  ${OUT}/FINAALG.o  ${OUT}/FINAALG-.o ${OUT}/FINRALG.o  ${OUT}/FINRALG-.o \
-  ${OUT}/FFF.o      ${OUT}/FLOATRP.o  ${OUT}/FNAME.o    ${OUT}/FOP.o      \
-  ${OUT}/FORMULA.o  ${OUT}/FORT.o     ${OUT}/FRAC.o     ${OUT}/FTEM.o     \
-  ${OUT}/GENEEZ.o   ${OUT}/GENMFACT.o ${OUT}/GENPGCD.o  ${OUT}/GALFACTU.o \
-  ${OUT}/GALPOLYU.o ${OUT}/GB.o       ${OUT}/GBEUCLID.o ${OUT}/GBF.o      \
-  ${OUT}/GBINTERN.o ${OUT}/GHENSEL.o  ${OUT}/GMODPOL.o  ${OUT}/GOSPER.o   \
-  ${OUT}/GRIMAGE.o  ${OUT}/GROEBSOL.o ${OUT}/HDMP.o     ${OUT}/HDP.o      \
-  ${OUT}/HEXADEC.o  ${OUT}/HEUGCD.o   ${OUT}/IBPTOOLS.o ${OUT}/IFF.o      \
-  ${OUT}/IBITS.o    ${OUT}/ICARD.o    ${OUT}/ICDEN.o    ${OUT}/IDECOMP.o  \
-  ${OUT}/IIARRAY2.o ${OUT}/IMATLIN.o  ${OUT}/IMATQF.o   ${OUT}/INMODGCD.o \
-  ${OUT}/INNMFACT.o ${OUT}/INPSIGN.o  ${OUT}/INTHERTR.o ${OUT}/INTRAT.o   \
-  ${OUT}/INTRF.o    ${OUT}/INTSLPE.o  ${OUT}/INTTR.o    ${OUT}/ISUMP.o    \
-  ${OUT}/LAUPOL.o   ${OUT}/LEADCDET.o ${OUT}/LGROBP.o   ${OUT}/LIMITRF.o  \
-  ${OUT}/LINDEP.o   ${OUT}/LO.o       ${OUT}/LPEFRAC.o  ${OUT}/LSPP.o     \
-  ${OUT}/MATLIN.o   ${OUT}/MCDEN.o    ${OUT}/MDDFACT.o  ${OUT}/MFINFACT.o \
-  ${OUT}/MFLOAT.o   ${OUT}/MINT.o     ${OUT}/MLIFT.o    ${OUT}/MMAP.o     \
-  ${OUT}/MODMON.o   ${OUT}/MONOTOOL.o ${OUT}/MPCPF.o    ${OUT}/MPC2.o     \
-  ${OUT}/MPC3.o     ${OUT}/MPOLY.o    ${OUT}/MPRFF.o    ${OUT}/MRATFAC.o  \
-  ${OUT}/MULTSQFR.o ${OUT}/NORMRETR.o ${OUT}/NPCOEF.o   ${OUT}/NSUP.o     \
-  ${OUT}/NTPOLFN.o  ${OUT}/ODP.o      ${OUT}/ODEPRIM.o  ${OUT}/ODEPRRIC.o \
-  ${OUT}/OMPKG.o    ${OUT}/OMSERVER.o ${OUT}/PADEPAC.o  ${OUT}/PADICRAT.o \
-  ${OUT}/PADICRC.o  ${OUT}/PCOMP.o    ${OUT}/PDECOMP.o  ${OUT}/PF.o       \
-  ${OUT}/PFBR.o     ${OUT}/PFBRU.o    ${OUT}/PFOTOOLS.o ${OUT}/PFRPAC.o   \
-  ${OUT}/PGCD.o     ${OUT}/PINTERPA.o ${OUT}/PLEQN.o    ${OUT}/PMPLCAT.o  \
-  ${OUT}/PMQFCAT.o  ${OUT}/PNTHEORY.o ${OUT}/POLUTIL.o  ${OUT}/POLTOPOL.o \
-  ${OUT}/POLYCATQ.o ${OUT}/POLYLIFT.o ${OUT}/POLYROOT.o ${OUT}/POLY2.o    \
-  ${OUT}/POLY2UP.o  ${OUT}/PRS.o      ${OUT}/PSQFR.o    ${OUT}/PUSHVAR.o  \
-  ${OUT}/QALGSET.o  ${OUT}/QFCAT2.o   ${OUT}/RADIX.o    ${OUT}/RATFACT.o  \
-  ${OUT}/RCFIELD.o  ${OUT}/RCFIELD-.o ${OUT}/RDETR.o    ${OUT}/RDETRS.o   \
-  ${OUT}/REAL0.o    ${OUT}/REAL0Q.o   ${OUT}/REALSOLV.o ${OUT}/RESRING.o  \
-  ${OUT}/RETSOL.o   ${OUT}/RF.o       ${OUT}/RFFACTOR.o ${OUT}/RMATCAT.o  \
-  ${OUT}/RMATCAT-.o ${OUT}/RRCC.o     ${OUT}/RRCC-.o    ${OUT}/SCPKG.o    \
-  ${OUT}/SHDP.o     ${OUT}/SHP.o      ${OUT}/SIGNRF.o   ${OUT}/SMITH.o    \
-  ${OUT}/SMP.o      ${OUT}/SMTS.o     ${OUT}/SOLVEFOR.o ${OUT}/SPLTREE.o  \
-  ${OUT}/STINPROD.o ${OUT}/STTFNC.o   ${OUT}/SUBRESP.o  ${OUT}/SUMRF.o    \
-  ${OUT}/SUP.o      ${OUT}/SUPEXPR.o  ${OUT}/SUPFRACF.o ${OUT}/TANEXP.o   \
-  ${OUT}/TEMUTL.o   ${OUT}/TEX.o      ${OUT}/TEXTFILE.o ${OUT}/TREE.o     \
-  ${OUT}/TWOFACT.o  ${OUT}/UNIFACT.o  ${OUT}/UP.o       ${OUT}/UPCDEN.o   \
-  ${OUT}/UPDECOMP.o ${OUT}/UPDIVP.o   ${OUT}/UPMP.o     ${OUT}/UPOLYC2.o  \
-  ${OUT}/UPXSCAT.o  ${OUT}/UPSQFREE.o ${OUT}/VIEWDEF.o  ${OUT}/VIEW2D.o   \
-  ${OUT}/VOID.o     ${OUT}/WEIER.o    ${OUT}/WP.o \
+  ${OUT}/E04GCFA.o  ${OUT}/E04JAFA.o  ${OUT}/E04UCFA.o  ${OUT}/FACUTIL.o  \
+  ${OUT}/FF.o       ${OUT}/FFCG.o     ${OUT}/FFCGX.o    ${OUT}/FFFG.o     \
+  ${OUT}/FFFGF.o    ${OUT}/FFHOM.o    ${OUT}/FFNB.o     ${OUT}/FFNBX.o    \
+  ${OUT}/FFPOLY.o   ${OUT}/FFX.o      ${OUT}/FFSLPE.o   ${OUT}/FGLMICPK.o \
+  ${OUT}/FILE.o     ${OUT}/FINAALG.o  ${OUT}/FINAALG-.o ${OUT}/FINRALG.o  \
+  ${OUT}/FINRALG-.o ${OUT}/FFF.o      ${OUT}/FLOATRP.o  ${OUT}/FNAME.o    \
+  ${OUT}/FOP.o      ${OUT}/FORMULA.o  ${OUT}/FORT.o     ${OUT}/FRAC.o     \
+  ${OUT}/FTEM.o     ${OUT}/GENEEZ.o   ${OUT}/GENMFACT.o ${OUT}/GENPGCD.o  \
+  ${OUT}/GALFACTU.o ${OUT}/GALPOLYU.o ${OUT}/GB.o       ${OUT}/GBEUCLID.o \
+  ${OUT}/GBF.o      ${OUT}/GBINTERN.o ${OUT}/GHENSEL.o  ${OUT}/GMODPOL.o  \
+  ${OUT}/GOSPER.o   ${OUT}/GRIMAGE.o  ${OUT}/GROEBSOL.o ${OUT}/HDMP.o     \
+  ${OUT}/HDP.o      ${OUT}/HEXADEC.o  ${OUT}/HEUGCD.o   ${OUT}/IBPTOOLS.o \
+  ${OUT}/IFF.o      ${OUT}/IBITS.o    ${OUT}/ICARD.o    ${OUT}/ICDEN.o    \
+  ${OUT}/IDECOMP.o  ${OUT}/IIARRAY2.o ${OUT}/IMATLIN.o  ${OUT}/IMATQF.o   \
+  ${OUT}/INMODGCD.o ${OUT}/INNMFACT.o ${OUT}/INPSIGN.o  ${OUT}/INTHERTR.o \
+  ${OUT}/INTRAT.o   ${OUT}/INTRF.o    ${OUT}/INTSLPE.o  ${OUT}/INTTR.o    \
+  ${OUT}/ISUMP.o    ${OUT}/LAUPOL.o   ${OUT}/LEADCDET.o ${OUT}/LGROBP.o   \
+  ${OUT}/LIMITRF.o  ${OUT}/LINDEP.o   ${OUT}/LO.o       ${OUT}/LPEFRAC.o  \
+  ${OUT}/LSPP.o     ${OUT}/MATLIN.o   ${OUT}/MCDEN.o    ${OUT}/MDDFACT.o  \
+  ${OUT}/MFINFACT.o ${OUT}/MFLOAT.o   ${OUT}/MINT.o     ${OUT}/MLIFT.o    \
+  ${OUT}/MMAP.o     ${OUT}/MODMON.o   ${OUT}/MONOTOOL.o ${OUT}/MPCPF.o    \
+  ${OUT}/MPC2.o     ${OUT}/MPC3.o     ${OUT}/MPOLY.o    ${OUT}/MPRFF.o    \
+  ${OUT}/MRATFAC.o  ${OUT}/MULTSQFR.o ${OUT}/NORMRETR.o ${OUT}/NPCOEF.o   \
+  ${OUT}/NSUP.o     ${OUT}/NTPOLFN.o  ${OUT}/ODP.o      ${OUT}/ODEPRIM.o  \
+  ${OUT}/ODEPRRIC.o ${OUT}/OMPKG.o    ${OUT}/OMSERVER.o ${OUT}/PADEPAC.o  \
+  ${OUT}/PADICRAT.o ${OUT}/PADICRC.o  ${OUT}/PCOMP.o    ${OUT}/PDECOMP.o  \
+  ${OUT}/PF.o       ${OUT}/PFBR.o     ${OUT}/PFBRU.o    ${OUT}/PFOTOOLS.o \
+  ${OUT}/PFRPAC.o   ${OUT}/PGCD.o     ${OUT}/PINTERPA.o ${OUT}/PLEQN.o    \
+  ${OUT}/PMPLCAT.o  ${OUT}/PMQFCAT.o  ${OUT}/PNTHEORY.o ${OUT}/POLUTIL.o  \
+  ${OUT}/POLTOPOL.o ${OUT}/POLYCATQ.o ${OUT}/POLYLIFT.o ${OUT}/POLYROOT.o \
+  ${OUT}/POLY2.o    ${OUT}/POLY2UP.o  ${OUT}/PRS.o      ${OUT}/PSQFR.o    \
+  ${OUT}/PUSHVAR.o  ${OUT}/QALGSET.o  ${OUT}/QFCAT2.o   ${OUT}/RADIX.o    \
+  ${OUT}/RATFACT.o  ${OUT}/RCFIELD.o  ${OUT}/RCFIELD-.o ${OUT}/RDETR.o    \
+  ${OUT}/RDETRS.o   ${OUT}/REAL0.o    ${OUT}/REAL0Q.o   ${OUT}/REALSOLV.o \
+  ${OUT}/RESRING.o  ${OUT}/RETSOL.o   ${OUT}/RF.o       ${OUT}/RFFACTOR.o \
+  ${OUT}/RMATCAT.o  ${OUT}/RMATCAT-.o ${OUT}/RRCC.o     ${OUT}/RRCC-.o    \
+  ${OUT}/SCPKG.o    ${OUT}/SHDP.o     ${OUT}/SHP.o      ${OUT}/SIGNRF.o   \
+  ${OUT}/SMITH.o    ${OUT}/SMP.o      ${OUT}/SMTS.o     ${OUT}/SOLVEFOR.o \
+  ${OUT}/SPLTREE.o  ${OUT}/STINPROD.o ${OUT}/STTFNC.o   ${OUT}/SUBRESP.o  \
+  ${OUT}/SUMRF.o    ${OUT}/SUP.o      ${OUT}/SUPEXPR.o  ${OUT}/SUPFRACF.o \
+  ${OUT}/TANEXP.o   ${OUT}/TEMUTL.o   ${OUT}/TEX.o      ${OUT}/TEXTFILE.o \
+  ${OUT}/TREE.o     ${OUT}/TWOFACT.o  ${OUT}/UNIFACT.o  ${OUT}/UP.o       \
+  ${OUT}/UPCDEN.o   ${OUT}/UPDECOMP.o ${OUT}/UPDIVP.o   ${OUT}/UPMP.o     \
+  ${OUT}/UPOLYC2.o  ${OUT}/UPXSCAT.o  ${OUT}/UPSQFREE.o ${OUT}/VIEWDEF.o  \
+  ${OUT}/VIEW2D.o   ${OUT}/VOID.o     ${OUT}/WEIER.o    ${OUT}/WP.o \
   layer11done
 
 @
@@ -536,24 +535,22 @@ Used by next layer: ACF COMPCAT FFCAT FRNAALG FS OC QUATCAT RPOLCAT UTSCAT
 LAYER16=\
   ${OUT}/ACF.o      ${OUT}/ACF-.o     ${OUT}/ACPLOT.o   ${OUT}/ANTISYM.o  \
   ${OUT}/ANY.o      ${OUT}/ASP12.o    ${OUT}/ASP27.o    ${OUT}/ASP28.o    \
-  ${OUT}/ASP30.o    \
-  ${OUT}/ASP33.o    ${OUT}/ASP49.o    ${OUT}/ASP55.o    ${OUT}/ASP7.o     \
-  ${OUT}/ASP78.o    ${OUT}/ASP8.o     ${OUT}/ASP9.o     ${OUT}/ATTRBUT.o  \
-  ${OUT}/BOP.o      ${OUT}/BOP1.o     ${OUT}/COMMONOP.o ${OUT}/COMPCAT.o  \
-  ${OUT}/COMPCAT-.o ${OUT}/DRAW.o     ${OUT}/DRAWCFUN.o ${OUT}/DROPT.o    \
-  ${OUT}/DROPT0.o   ${OUT}/D01ANFA.o  ${OUT}/D01ASFA.o  ${OUT}/D03AGNT.o  \
-  ${OUT}/EP.o       ${OUT}/E04AGNT.o  ${OUT}/FCPAK1.o   ${OUT}/FEXPR.o    \
-  ${OUT}/FFCAT.o    ${OUT}/FFCAT-.o   ${OUT}/FFCGP.o    ${OUT}/FFNBP.o    \
-  ${OUT}/FFP.o      ${OUT}/FLOAT.o    ${OUT}/FPARFRAC.o ${OUT}/FR.o       \
-  ${OUT}/FRNAALG.o  ${OUT}/FRNAALG-.o ${OUT}/FS.o       ${OUT}/FS-.o      \
-  ${OUT}/FST.o      ${OUT}/FUNCTION.o ${OUT}/GDMP.o     ${OUT}/GOPT.o     \
-  ${OUT}/GOPT0.o \
-  ${OUT}/HACKPI.o   ${OUT}/IDEAL.o    ${OUT}/INFORM.o   ${OUT}/INFORM1.o  \
-  ${OUT}/IPRNTPK.o  ${OUT}/IR.o       ${OUT}/ISUPS.o    ${OUT}/KERNEL.o   \
-  ${OUT}/LIB.o      ${OUT}/LMDICT.o   ${OUT}/LODOOPS.o  ${OUT}/MATRIX.o   \
-  ${OUT}/MKFLCFN.o  ${OUT}/MSET.o     ${OUT}/M3D.o      ${OUT}/NAGC02.o   \
-  ${OUT}/NAGC05.o   ${OUT}/NAGC06.o   ${OUT}/NAGD01.o   ${OUT}/NAGD02.o   \
-  ${OUT}/NAGD03.o   ${OUT}/NAGE01.o   \
+  ${OUT}/ASP30.o    ${OUT}/ASP33.o    ${OUT}/ASP49.o    ${OUT}/ASP55.o    \
+  ${OUT}/ASP7.o     ${OUT}/ASP78.o    ${OUT}/ASP8.o     ${OUT}/ASP9.o     \
+  ${OUT}/ATTRBUT.o  ${OUT}/BOP.o      ${OUT}/BOP1.o     ${OUT}/COMMONOP.o \
+  ${OUT}/COMPCAT.o  ${OUT}/COMPCAT-.o ${OUT}/DRAW.o     ${OUT}/DRAWCFUN.o \
+  ${OUT}/DROPT.o    ${OUT}/DROPT0.o   ${OUT}/D01ANFA.o  ${OUT}/D01ASFA.o  \
+  ${OUT}/D03AGNT.o  ${OUT}/EP.o       ${OUT}/E04AGNT.o  ${OUT}/FCPAK1.o   \
+  ${OUT}/FEXPR.o    ${OUT}/FFCAT.o    ${OUT}/FFCAT-.o   ${OUT}/FFCGP.o    \
+  ${OUT}/FFNBP.o    ${OUT}/FFP.o      ${OUT}/FLOAT.o    ${OUT}/FPARFRAC.o \
+  ${OUT}/FR.o       ${OUT}/FRNAALG.o  ${OUT}/FRNAALG-.o ${OUT}/FS.o       \
+  ${OUT}/FS-.o      ${OUT}/FST.o      ${OUT}/FUNCTION.o ${OUT}/GDMP.o     \
+  ${OUT}/GOPT.o     ${OUT}/GOPT0.o    ${OUT}/HACKPI.o   ${OUT}/IDEAL.o    \
+  ${OUT}/INFORM.o   ${OUT}/INFORM1.o  ${OUT}/IPRNTPK.o  ${OUT}/IR.o       \
+  ${OUT}/ISUPS.o    ${OUT}/KERNEL.o   ${OUT}/LIB.o      ${OUT}/LMDICT.o   \
+  ${OUT}/LODOOPS.o  ${OUT}/MATRIX.o   ${OUT}/MKFLCFN.o  ${OUT}/MSET.o     \
+  ${OUT}/M3D.o      ${OUT}/NAGC02.o   ${OUT}/NAGC05.o   ${OUT}/NAGC06.o   \
+  ${OUT}/NAGD01.o   ${OUT}/NAGD02.o   ${OUT}/NAGD03.o   ${OUT}/NAGE01.o   \
   ${OUT}/NAGE02.o   ${OUT}/NAGE04.o   ${OUT}/NAGF07.o   ${OUT}/NAGS.o     \
   ${OUT}/NAGSP.o    ${OUT}/NREP.o     ${OUT}/NUMFMT.o   ${OUT}/OC.o       \
   ${OUT}/OC-.o      ${OUT}/ODEPACK.o  ${OUT}/ODERAT.o   ${OUT}/OMERR.o    \
@@ -570,21 +567,22 @@ LAYER16=\
 
 @
 \subsection{Layer17}
-Depends on: ACF COMPCAT FFCAT FRNAALG FS OC QUATCAT RPOLCAT UTSCAT
+Depends on: ACF COMPCAT FFCAT FRNAALG FS OC QUATCAT RPOLCAT UTSCAT\\
+Used by next layer: ACFS EXPRSOL FDIVCAT UFPS ULSCCAT UTSSOL 
 <<layer17>>=
 
 LAYER17=\
   ${OUT}/ACFS.o     ${OUT}/ACFS-.o    ${OUT}/AF.o       ${OUT}/ALGFACT.o  \
   ${OUT}/ALGFF.o    ${OUT}/ALGMANIP.o ${OUT}/ALGMFACT.o ${OUT}/ALGPKG.o   \
   ${OUT}/ALGSC.o    ${OUT}/AN.o       ${OUT}/APPRULE.o  ${OUT}/ASP19.o    \
-  ${OUT}/ASP20.o    ${OUT}/ASP31.o    ${OUT}/ASP35.o    \
-  ${OUT}/ASP41.o    ${OUT}/ASP42.o    ${OUT}/ASP74.o    ${OUT}/ASP77.o    \
-  ${OUT}/ASP80.o    ${OUT}/CINTSLPE.o ${OUT}/COMPFACT.o ${OUT}/COMPLEX.o  \
-  ${OUT}/COMPLPAT.o ${OUT}/CMPLXRT.o  ${OUT}/CPMATCH.o  ${OUT}/CRFP.o     \
-  ${OUT}/CTRIGMNP.o ${OUT}/D01WGTS.o  ${OUT}/D02AGNT.o  ${OUT}/D03EEFA.o  \
-  ${OUT}/DBLRESP.o  ${OUT}/DERHAM.o   ${OUT}/DFSFUN.o   ${OUT}/DRAWCURV.o \
-  ${OUT}/E04NAFA.o  ${OUT}/EF.o       ${OUT}/EFSTRUC.o  \
-  ${OUT}/ELFUTS.o   ${OUT}/ESTOOLS.o  ${OUT}/EXPEXPAN.o ${OUT}/EXPRODE.o  \
+  ${OUT}/ASP20.o    ${OUT}/ASP31.o    ${OUT}/ASP35.o    ${OUT}/ASP41.o    \
+  ${OUT}/ASP42.o    ${OUT}/ASP74.o    ${OUT}/ASP77.o    ${OUT}/ASP80.o    \
+  ${OUT}/CINTSLPE.o ${OUT}/COMPFACT.o ${OUT}/COMPLEX.o  ${OUT}/COMPLPAT.o \
+  ${OUT}/CMPLXRT.o  ${OUT}/CPMATCH.o  ${OUT}/CRFP.o     ${OUT}/CTRIGMNP.o \
+  ${OUT}/D01WGTS.o  ${OUT}/D02AGNT.o  ${OUT}/D03EEFA.o  ${OUT}/DBLRESP.o  \
+  ${OUT}/DERHAM.o   ${OUT}/DFSFUN.o   ${OUT}/DRAWCURV.o ${OUT}/D01TRNS.o  \
+  ${OUT}/E04NAFA.o  ${OUT}/EF.o       ${OUT}/EFSTRUC.o  ${OUT}/ELFUTS.o   \
+  ${OUT}/ESTOOLS.o  ${OUT}/EXPEXPAN.o ${OUT}/EXPRODE.o  \
   ${OUT}/EXPRTUBE.o ${OUT}/EXPR2.o    ${OUT}/FC.o       ${OUT}/FDIVCAT.o  \
   ${OUT}/FDIVCAT-.o ${OUT}/FDIV2.o    ${OUT}/FFCAT2.o   ${OUT}/FLOATCP.o  \
   ${OUT}/FORDER.o   ${OUT}/FORTRAN.o  ${OUT}/FRNAAF2.o  ${OUT}/FSRED.o    \
@@ -600,24 +598,33 @@ LAYER17=\
   ${OUT}/NAGF01.o   ${OUT}/NAGF02.o   ${OUT}/NAGF04.o   ${OUT}/NCEP.o     \
   ${OUT}/NLINSOL.o  ${OUT}/NSMP.o     ${OUT}/NUMERIC.o  ${OUT}/OCT.o      \
   ${OUT}/OCTCT2.o   ${OUT}/ODEPAL.o   ${OUT}/ODERTRIC.o ${OUT}/PADE.o     \
-  ${OUT}/PAN2EXPR.o ${OUT}/PFO.o      ${OUT}/PFOQ.o     \
-  ${OUT}/PICOERCE.o ${OUT}/PMASSFS.o  ${OUT}/PMFS.o     ${OUT}/PMPREDFS.o \
-  ${OUT}/PSETPK.o   ${OUT}/QUAT.o     ${OUT}/QUATCT2.o  ${OUT}/RADFF.o    \
-  ${OUT}/RDEEF.o    ${OUT}/RDEEFS.o   ${OUT}/RDIV.o     ${OUT}/RSETCAT.o  \
-  ${OUT}/RSETCAT-.o ${OUT}/RULE.o     ${OUT}/RULESET.o  ${OUT}/SIMPAN.o   \
-  ${OUT}/SFORT.o    ${OUT}/SOLVESER.o ${OUT}/SUMFS.o    ${OUT}/SUTS.o     \
-  ${OUT}/TOOLSIGN.o ${OUT}/TRIGMNIP.o ${OUT}/TRMANIP.o  ${OUT}/UFPS.o     \
-  ${OUT}/ULSCCAT.o  \
+  ${OUT}/PAN2EXPR.o ${OUT}/PFO.o      ${OUT}/PFOQ.o     ${OUT}/PICOERCE.o \
+  ${OUT}/PMASSFS.o  ${OUT}/PMFS.o     ${OUT}/PMPREDFS.o ${OUT}/PSETPK.o   \
+  ${OUT}/QUAT.o     ${OUT}/QUATCT2.o  ${OUT}/RADFF.o    ${OUT}/RDEEF.o    \
+  ${OUT}/RDEEFS.o   ${OUT}/RDIV.o     ${OUT}/RSETCAT.o  ${OUT}/RSETCAT-.o \
+  ${OUT}/RULE.o     ${OUT}/RULESET.o  ${OUT}/SIMPAN.o   ${OUT}/SFORT.o    \
+  ${OUT}/SOLVESER.o ${OUT}/SUMFS.o    ${OUT}/SUTS.o     ${OUT}/TOOLSIGN.o \
+  ${OUT}/TRIGMNIP.o ${OUT}/TRMANIP.o  ${OUT}/UFPS.o     ${OUT}/ULSCCAT.o  \
   ${OUT}/ULSCCAT-.o ${OUT}/UPXSSING.o ${OUT}/UTSODE.o   ${OUT}/UTSODETL.o \
   ${OUT}/UTSSOL.o   ${OUT}/UTS2.o     ${OUT}/WUTSET.o  \
   layer17done
 
 @
 \subsection{Layer18}
-
+Depends on: ACFS EXPRSOL FDIVCAT UFPS ULSCCAT UTSSOL 
 <<layer18>>=
 
 LAYER18=\
+  ${OUT}/DEFINTEF.o ${OUT}/DFINTTLS.o ${OUT}/DEFINTRF.o ${OUT}/EFULS.o    \
+  ${OUT}/ESCONT.o   ${OUT}/EXPR.o     ${OUT}/EXPRSOL.o  \
+  ${OUT}/EXPR2UPS.o ${OUT}/FDIV.o     \
+  ${OUT}/FSCINT.o   ${OUT}/FSINT.o    ${OUT}/FS2EXPXP.o ${OUT}/GSERIES.o  \
+  ${OUT}/HELLFDIV.o ${OUT}/INVLAPLA.o ${OUT}/IR2F.o     ${OUT}/IRRF2F.o   \
+  ${OUT}/LAPLACE.o  ${OUT}/LIMITPS.o  ${OUT}/LODEEF.o   ${OUT}/NODE1.o    \
+  ${OUT}/ODECONST.o ${OUT}/ODEINT.o   ${OUT}/REP.o      \
+  ${OUT}/SOLVERAD.o ${OUT}/SULS.o     ${OUT}/SUPXS.o    ${OUT}/UFPS1.o    \
+  ${OUT}/ULS.o      ${OUT}/ULSCONS.o  ${OUT}/UPXS.o     ${OUT}/UPXSCONS.o \
+  ${OUT}/UTS.o \
   layer18done
 
 @
@@ -639,73 +646,22 @@ LAYER20=\
     
 @
 \subsection{Layer21}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-cont.spad.pamphlet (ESCONT ESCONT1)
-ddfact.spad.pamphlet (DDFACT)
-defintef.spad.pamphlet (DEFINTEF)
-defintrf.spad.pamphlet (DFINTTLS DEFINTRF)
-divisor.spad.pamphlet (FRIDEAL FRIDEAL2 MHROWRED FRMOD FDIVCAT HELLFDIV FDIV
-                       FDIV2)
-efuls.spad.pamphlet (EFULS)
-expr.spad.pamphlet (EXPR PAN2EXPR EXPR2 PMPREDFS PMASSFS PMPRED PMASS HACKPI
-                    PICOERCE)
-expr2ups.spad.pamphlet (EXPR2UPS)
-fs2expxp.spad.pamphlet (FS2EXPXP)
-integrat.spad.pamphlet (FSCINT FSINT)
-irexpand.spad.pamphlet (IR2F IRRF2F)
-laplace.spad.pamphlet (LAPLACE INVLAPLA)
-laurent.spad.pamphlet (ULSCCAT ULSCONS ULS USL2)
-nlode.spad.pamphlet (NODE1)
-oderf.spad.pamphlet (BALFACT BOUNDZRO ODEPRIM UTSODETL ODERAT ODETOOLS ODEINT
-                     ODECONST)
-puiseux.spad.pamphlet (UPXSCCA UPXSCONS UPXS UPXS2)
-radeigen.spad.pamphlet (REP)
-solverad.spad.pamphlet (SOLVERAD)
-taylor.spad.pamphlet (ITAYLOR UTS UTS2)
-\end{verbatim}
 
 <<layer21>>=
 
 LAYER21=\
-  ${OUT}/DEFINTEF.o ${OUT}/DFINTTLS.o ${OUT}/DEFINTRF.o ${OUT}/D01TRNS.o  \
-  ${OUT}/EFULS.o    ${OUT}/ESCONT.o   ${OUT}/EXPR.o     ${OUT}/EXPRSOL.o \
-  ${OUT}/EXPR2UPS.o \
-  ${OUT}/FDIV.o     ${OUT}/FSCINT.o   ${OUT}/FSINT.o    ${OUT}/FS2EXPXP.o \
-  ${OUT}/GSERIES.o  ${OUT}/HELLFDIV.o ${OUT}/INVLAPLA.o ${OUT}/IR2F.o     \
-  ${OUT}/IRRF2F.o   ${OUT}/LAPLACE.o  ${OUT}/LIMITPS.o  ${OUT}/LODEEF.o   \
-  ${OUT}/NODE1.o    ${OUT}/ODECONST.o ${OUT}/ODEINT.o   ${OUT}/RECOP.o    \
-  ${OUT}/REP.o      \
-  ${OUT}/SOLVERAD.o ${OUT}/SULS.o     ${OUT}/SUPXS.o    ${OUT}/UFPS1.o \
-  ${OUT}/ULS.o      \
-  ${OUT}/ULSCONS.o  ${OUT}/UPXS.o     ${OUT}/UPXSCONS.o ${OUT}/UTS.o \
   layer21done
 
 @
 \subsection{Layer22}
-\subsubsection{Completed spad files}
-\begin{verbatim}
-combfunc.spad.pamphlet (COMBF)
-d01agents.spad.pamphlet (D01AGNT SNTSCAT)
-ffnb.spad.pamphlet (INBFF)
-limitps.spad.pamphlet (SIGNEF)
-lodo.spad.pamphlet (LODO LODO1 LODO2)
-newpoint.spad.pamphlet (SUBSPACE)
-nregset.spad.pamphlet (NTSCAT)
-primelt.spad.pamphlet (FSPRMELT)
-regset.spad.pamphlet (REGSET RSETGCD RSDCMPK)
-sregset.spad.pamphlet (SFRTCAT SRDCMPK SREGSET)
-sttf.spad.pamphlet (STTF)
-transsolve.spad.pamphlet (SOLVETRA)
-zerodim.spad.pamphlet (RGCHAIN ZDSOLVE)
-\end{verbatim}
+Depends on: EXPRSOL
 <<layer22>>=
 
 LAYER22=\
   ${OUT}/ASP29.o    ${OUT}/COMBF.o    ${OUT}/D01AGNT.o  ${OUT}/FSPRMELT.o \
-  ${OUT}/GUESS.o \
   ${OUT}/INBFF.o    ${OUT}/LODO.o     ${OUT}/LODO1.o    ${OUT}/LODO2.o    \
-  ${OUT}/NTSCAT.o   ${OUT}/REGSET.o   ${OUT}/RGCHAIN.o  ${OUT}/RSETGCD.o  \
+  ${OUT}/NTSCAT.o   ${OUT}/RECOP.o    \
+  ${OUT}/REGSET.o   ${OUT}/RGCHAIN.o  ${OUT}/RSETGCD.o  \
   ${OUT}/RSDCMPK.o  ${OUT}/SFRTCAT.o  ${OUT}/SIGNEF.o   ${OUT}/SNTSCAT.o  \
   ${OUT}/SOLVETRA.o ${OUT}/SRDCMPK.o  ${OUT}/SREGSET.o  ${OUT}/STTF.o     \
   ${OUT}/SUBSPACE.o ${OUT}/ZDSOLVE.o \
@@ -730,8 +686,7 @@ zerodim.spad.pamphlet (LEXTRIPK IRURPK RURPK)
 <<layer23>>=
 
 LAYER23=\
-  ${OUT}/CPIMA.o    ${OUT}/GUESSAN.o  ${OUT}/GUESSINT.o  \
-  ${OUT}/GUESSF1.o  ${OUT}/GUESSP.o   ${OUT}/GUESSUP.o \
+  ${OUT}/CPIMA.o    ${OUT}/GUESS.o \
   ${OUT}/IRURPK.o   ${OUT}/LAZM3PK.o  ${OUT}/LEXTRIPK.o \
   ${OUT}/NORMPK.o   ${OUT}/QCMPACK.o  ${OUT}/RURPK.o    ${OUT}/SFRGCD.o   \
   ${OUT}/SFQCMPK.o  ${OUT}/INTRVL.o   ${OUT}/ODEEF.o \
@@ -741,7 +696,8 @@ LAYER23=\
 <<layer24>>=
 
 LAYER24=\
-  ${OUT}/GUESSF.o \
+  ${OUT}/GUESSAN.o  ${OUT}/GUESSINT.o  \
+  ${OUT}/GUESSF1.o  ${OUT}/GUESSP.o   ${OUT}/GUESSUP.o \
   layer24done
 
 @
@@ -751,6 +707,7 @@ we add it here.
 <<USERLAYER>>=
 
 USERLAYER=\
+  ${OUT}/GUESSF.o \
   ${OUT}/RINTERP.o
 @
 \subsection{Order}
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index e0cedab..1c48c17 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -859,6 +859,8 @@ algebra/Makefile move layers 11, 12, 13 <br/>
 algebra/Makefile move layers 15, 16, 17, 18, 19 <br/>
 <a href="patches/20081226.01.tpd.patch">20081226.01.tpd.patch</a>
 algebra/Makefile rearrange build order <br/>
+<a href="patches/20081226.02.tpd.patch">20081226.02.tpd.patch</a>
+algebra/Makefile rearrange build order <br/>
 
  </body>
 </html>

\start
Date: Sun, 28 Dec 2008 02:00:11 -0600
From: Tim Daly
To: list
Subject: 20081227.01.tpd.patch (algebra/Makfile complete build order change)

This patch completes the build order change of the algebra.
We are now ready to build the graph of the algebra build process.
=========================================================================
diff --git a/changelog b/changelog
index f76cb32..7267459 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20081227 tpd src/axiom-website/patches.html 20081227.01.tpd.patch
+20081227 tpd src/algebra/Makefile complete build order change
 20081226 tpd src/axiom-website/patches.html 20081226.02.tpd.patch
 20081226 tpd src/algebra/Makefile rearrange build order
 20081226 tpd src/axiom-website/patches.html 20081226.01.tpd.patch
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 6e070ed..c3c7d03 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -233,6 +233,7 @@ OASGP PDRING
 <<layer2>>=
 
 LAYER2=\
+  ${OUT}/ASP29.o    \
   ${OUT}/ATRIG.o    ${OUT}/ATRIG-.o   ${OUT}/BMODULE.o  ${OUT}/CACHSET.o  \
   ${OUT}/CHARNZ.o   ${OUT}/CHARZ.o    ${OUT}/DVARCAT.o  ${OUT}/DVARCAT-.o \
   ${OUT}/ELEMFUN.o  ${OUT}/ELEMFUN-.o ${OUT}/ESTOOLS2.o ${OUT}/EVALAB.o   \
@@ -376,14 +377,15 @@ LAYER8=\
 
 @
 \subsection{Layer9}
-Depends on: BTAGG FLALG MATCAT SRAGG VECTCAT\\
+Depends on: BTAGG FLALG LODOCAT MATCAT SRAGG VECTCAT\\
 Used by next layer: IVECTOR PTCAT STRICAT 
 <<layer9>>=
 
 LAYER9=\
-  ${OUT}/BITS.o    ${OUT}/DIRPROD2.o ${OUT}/IMATRIX.o  ${OUT}/IVECTOR.o \
-  ${OUT}/LPOLY.o   ${OUT}/LSMP.o     ${OUT}/LSMP1.o    ${OUT}/MATCAT2.o \
-  ${OUT}/PTCAT.o   ${OUT}/STRICAT.o  ${OUT}/TRIMAT.o  \
+  ${OUT}/BITS.o    ${OUT}/DIRPROD2.o ${OUT}/IMATRIX.o  ${OUT}/INTRVL.o  \
+  ${OUT}/IVECTOR.o ${OUT}/LODO1.o    ${OUT}/LODO2.o    ${OUT}/LPOLY.o   \
+  ${OUT}/LSMP.o    ${OUT}/LSMP1.o    ${OUT}/MATCAT2.o ${OUT}/PTCAT.o   \
+  ${OUT}/STRICAT.o ${OUT}/TRIMAT.o  \
   layer9done
 
 @
@@ -393,16 +395,16 @@ Used by next layer: DIRPCAT FAXF PFECAT STRING
 <<layer10>>=
 
 LAYER10=\
-  ${OUT}/ASSOCEQ.o  ${OUT}/CARTEN.o   ${OUT}/CLIF.o     ${OUT}/CLIP.o     \
-  ${OUT}/COORDSYS.o ${OUT}/DBASE.o    ${OUT}/DHMATRIX.o ${OUT}/DIOSP.o    \
-  ${OUT}/DIRPCAT.o  ${OUT}/DIRPCAT-.o ${OUT}/D02BBFA.o  ${OUT}/D02BHFA.o  \
-  ${OUT}/D02CJFA.o  ${OUT}/FAXF.o     ${OUT}/FAXF-.o    ${OUT}/FFPOLY2.o  \
-  ${OUT}/FNLA.o     ${OUT}/GRAY.o     ${OUT}/HB.o       ${OUT}/IRSN.o     \
-  ${OUT}/MCALCFN.o  ${OUT}/MHROWRED.o ${OUT}/NUMODE.o   ${OUT}/NUMQUAD.o  \
-  ${OUT}/ODESYS.o   ${OUT}/ODETOOLS.o ${OUT}/ORDFUNS.o  ${OUT}/PERMAN.o   \
-  ${OUT}/PFECAT.o   ${OUT}/PFECAT-.o  ${OUT}/POINT.o    ${OUT}/PSEUDLIN.o \
-  ${OUT}/PTPACK.o   ${OUT}/REP2.o     ${OUT}/SETMN.o    ${OUT}/SEX.o      \
-  ${OUT}/STRING.o   ${OUT}/SYMFUNC.o  ${OUT}/VECTOR2.o \
+  ${OUT}/ASSOCEQ.o  ${OUT}/CARTEN.o   ${OUT}/CLIF.o     ${OUT}/CLIP.o    \
+  ${OUT}/COORDSYS.o ${OUT}/DBASE.o    ${OUT}/DHMATRIX.o ${OUT}/DIOSP.o   \
+  ${OUT}/DIRPCAT.o  ${OUT}/DIRPCAT-.o ${OUT}/D02BBFA.o  ${OUT}/D02BHFA.o \
+  ${OUT}/D02CJFA.o  ${OUT}/FAXF.o     ${OUT}/FAXF-.o    ${OUT}/FFPOLY2.o \
+  ${OUT}/FNLA.o     ${OUT}/GRAY.o     ${OUT}/HB.o       ${OUT}/INBFF.o   \
+  ${OUT}/IRSN.o     ${OUT}/MCALCFN.o  ${OUT}/MHROWRED.o ${OUT}/NUMODE.o  \
+  ${OUT}/NUMQUAD.o  ${OUT}/ODESYS.o   ${OUT}/ODETOOLS.o ${OUT}/ORDFUNS.o \
+  ${OUT}/PERMAN.o   ${OUT}/PFECAT.o   ${OUT}/PFECAT-.o  ${OUT}/POINT.o   \
+  ${OUT}/PSEUDLIN.o ${OUT}/PTPACK.o   ${OUT}/REP2.o     ${OUT}/SETMN.o   \
+  ${OUT}/SEX.o      ${OUT}/STRING.o   ${OUT}/SYMFUNC.o  ${OUT}/VECTOR2.o \
   layer10done
 
 @
@@ -458,16 +460,17 @@ LAYER11=\
   ${OUT}/RATFACT.o  ${OUT}/RCFIELD.o  ${OUT}/RCFIELD-.o ${OUT}/RDETR.o    \
   ${OUT}/RDETRS.o   ${OUT}/REAL0.o    ${OUT}/REAL0Q.o   ${OUT}/REALSOLV.o \
   ${OUT}/RESRING.o  ${OUT}/RETSOL.o   ${OUT}/RF.o       ${OUT}/RFFACTOR.o \
-  ${OUT}/RMATCAT.o  ${OUT}/RMATCAT-.o ${OUT}/RRCC.o     ${OUT}/RRCC-.o    \
-  ${OUT}/SCPKG.o    ${OUT}/SHDP.o     ${OUT}/SHP.o      ${OUT}/SIGNRF.o   \
-  ${OUT}/SMITH.o    ${OUT}/SMP.o      ${OUT}/SMTS.o     ${OUT}/SOLVEFOR.o \
-  ${OUT}/SPLTREE.o  ${OUT}/STINPROD.o ${OUT}/STTFNC.o   ${OUT}/SUBRESP.o  \
-  ${OUT}/SUMRF.o    ${OUT}/SUP.o      ${OUT}/SUPEXPR.o  ${OUT}/SUPFRACF.o \
-  ${OUT}/TANEXP.o   ${OUT}/TEMUTL.o   ${OUT}/TEX.o      ${OUT}/TEXTFILE.o \
-  ${OUT}/TREE.o     ${OUT}/TWOFACT.o  ${OUT}/UNIFACT.o  ${OUT}/UP.o       \
-  ${OUT}/UPCDEN.o   ${OUT}/UPDECOMP.o ${OUT}/UPDIVP.o   ${OUT}/UPMP.o     \
-  ${OUT}/UPOLYC2.o  ${OUT}/UPXSCAT.o  ${OUT}/UPSQFREE.o ${OUT}/VIEWDEF.o  \
-  ${OUT}/VIEW2D.o   ${OUT}/VOID.o     ${OUT}/WEIER.o    ${OUT}/WP.o \
+  ${OUT}/RINTERP.o  ${OUT}/RMATCAT.o  ${OUT}/RMATCAT-.o ${OUT}/RRCC.o     \
+  ${OUT}/RRCC-.o    ${OUT}/SCPKG.o    ${OUT}/SHDP.o     ${OUT}/SHP.o      \
+  ${OUT}/SIGNRF.o   ${OUT}/SMITH.o    ${OUT}/SMP.o      ${OUT}/SMTS.o     \
+  ${OUT}/SOLVEFOR.o ${OUT}/SPLTREE.o  ${OUT}/STINPROD.o ${OUT}/STTF.o     \
+  ${OUT}/STTFNC.o   ${OUT}/SUBRESP.o  ${OUT}/SUBSPACE.o ${OUT}/SUMRF.o    \
+  ${OUT}/SUP.o      ${OUT}/SUPEXPR.o  ${OUT}/SUPFRACF.o ${OUT}/TANEXP.o   \
+  ${OUT}/TEMUTL.o   ${OUT}/TEX.o      ${OUT}/TEXTFILE.o ${OUT}/TREE.o     \
+  ${OUT}/TWOFACT.o  ${OUT}/UNIFACT.o  ${OUT}/UP.o       ${OUT}/UPCDEN.o   \
+  ${OUT}/UPDECOMP.o ${OUT}/UPDIVP.o   ${OUT}/UPMP.o     ${OUT}/UPOLYC2.o  \
+  ${OUT}/UPXSCAT.o  ${OUT}/UPSQFREE.o ${OUT}/VIEWDEF.o  ${OUT}/VIEW2D.o   \
+  ${OUT}/VOID.o     ${OUT}/WEIER.o    ${OUT}/WP.o \
   layer11done
 
 @
@@ -505,12 +508,12 @@ Used by next layer: TBAGG
 <<layer14>>=
 
 LAYER14=\
-  ${OUT}/CCLASS.o   ${OUT}/FSAGG2.o  ${OUT}/GALFACT.o ${OUT}/IALGFACT.o \
-  ${OUT}/IBACHIN.o  ${OUT}/MMLFORM.o ${OUT}/NORMMA.o  ${OUT}/ODERED.o   \
-  ${OUT}/OMSAGG.o   ${OUT}/PERM.o    ${OUT}/PERMGRP.o ${OUT}/PRIMES.o   \
-  ${OUT}/PWFFINTB.o ${OUT}/RDIST.o   ${OUT}/SAE.o     ${OUT}/SAEFACT.o  \
-  ${OUT}/SAERFFC.o  ${OUT}/SGCF.o    ${OUT}/TBAGG.o   ${OUT}/TBAGG-.o   \
-  ${OUT}/VIEW3D.o   ${OUT}/WFFINTBS.o  \
+  ${OUT}/CCLASS.o   ${OUT}/CPIMA.o   ${OUT}/FSAGG2.o   ${OUT}/GALFACT.o \
+  ${OUT}/IALGFACT.o ${OUT}/IBACHIN.o  ${OUT}/MMLFORM.o ${OUT}/NORMMA.o  \
+  ${OUT}/ODERED.o   ${OUT}/OMSAGG.o   ${OUT}/PERM.o    ${OUT}/PERMGRP.o \
+  ${OUT}/PRIMES.o   ${OUT}/PWFFINTB.o ${OUT}/RDIST.o   ${OUT}/SAE.o     \
+  ${OUT}/SAEFACT.o  ${OUT}/SAERFFC.o  ${OUT}/SGCF.o    ${OUT}/TBAGG.o   \
+  ${OUT}/TBAGG-.o   ${OUT}/VIEW3D.o   ${OUT}/WFFINTBS.o  \
   layer14done
 
 @
@@ -548,27 +551,33 @@ LAYER16=\
   ${OUT}/GOPT.o     ${OUT}/GOPT0.o    ${OUT}/HACKPI.o   ${OUT}/IDEAL.o    \
   ${OUT}/INFORM.o   ${OUT}/INFORM1.o  ${OUT}/IPRNTPK.o  ${OUT}/IR.o       \
   ${OUT}/ISUPS.o    ${OUT}/KERNEL.o   ${OUT}/LIB.o      ${OUT}/LMDICT.o   \
-  ${OUT}/LODOOPS.o  ${OUT}/MATRIX.o   ${OUT}/MKFLCFN.o  ${OUT}/MSET.o     \
-  ${OUT}/M3D.o      ${OUT}/NAGC02.o   ${OUT}/NAGC05.o   ${OUT}/NAGC06.o   \
-  ${OUT}/NAGD01.o   ${OUT}/NAGD02.o   ${OUT}/NAGD03.o   ${OUT}/NAGE01.o   \
-  ${OUT}/NAGE02.o   ${OUT}/NAGE04.o   ${OUT}/NAGF07.o   ${OUT}/NAGS.o     \
-  ${OUT}/NAGSP.o    ${OUT}/NREP.o     ${OUT}/NUMFMT.o   ${OUT}/OC.o       \
-  ${OUT}/OC-.o      ${OUT}/ODEPACK.o  ${OUT}/ODERAT.o   ${OUT}/OMERR.o    \
-  ${OUT}/OMERRK.o   ${OUT}/OPTPACK.o  ${OUT}/OSI.o      ${OUT}/PATTERN.o  \
-  ${OUT}/OVAR.o     ${OUT}/PMKERNEL.o ${OUT}/PMSYM.o    ${OUT}/POLY.o     \
-  ${OUT}/PRIMELT.o  ${OUT}/QALGSET2.o ${OUT}/QEQUAT.o   ${OUT}/RECLOS.o   \
-  ${OUT}/REP1.o     ${OUT}/RESULT.o   ${OUT}/QUATCAT.o  ${OUT}/QUATCAT-.o \
-  ${OUT}/RFFACT.o   ${OUT}/RMATRIX.o  ${OUT}/ROMAN.o    ${OUT}/ROUTINE.o  \
-  ${OUT}/RPOLCAT.o  ${OUT}/RPOLCAT-.o ${OUT}/RULECOLD.o ${OUT}/SAOS.o     \
-  ${OUT}/SEGBIND.o  ${OUT}/SET.o      ${OUT}/SPECOUT.o  ${OUT}/SQMATRIX.o \
-  ${OUT}/SWITCH.o   ${OUT}/SYMS.o     ${OUT}/SYMTAB.o   ${OUT}/SYSSOLP.o  \
-  ${OUT}/UTSCAT.o   ${OUT}/UTSCAT-.o  ${OUT}/VARIABLE.o \
+  ${OUT}/LODO.o     ${OUT}/LODOOPS.o  ${OUT}/MATRIX.o   ${OUT}/MKFLCFN.o  \
+  ${OUT}/MSET.o     ${OUT}/M3D.o      ${OUT}/NAGC02.o   ${OUT}/NAGC05.o   \
+  ${OUT}/NAGC06.o   ${OUT}/NAGD01.o   ${OUT}/NAGD02.o   ${OUT}/NAGD03.o   \
+  ${OUT}/NAGE01.o   ${OUT}/NAGE02.o   ${OUT}/NAGE04.o   ${OUT}/NAGF07.o   \
+  ${OUT}/NAGS.o     ${OUT}/NAGSP.o    ${OUT}/NREP.o     ${OUT}/NUMFMT.o   \
+  ${OUT}/OC.o       ${OUT}/OC-.o      ${OUT}/ODEPACK.o  ${OUT}/ODERAT.o   \
+  ${OUT}/OMERR.o    ${OUT}/OMERRK.o   ${OUT}/OPTPACK.o  ${OUT}/OSI.o      \
+  ${OUT}/PATTERN.o  ${OUT}/OVAR.o     ${OUT}/PMKERNEL.o ${OUT}/PMSYM.o    \
+  ${OUT}/POLY.o     ${OUT}/PRIMELT.o  ${OUT}/QALGSET2.o ${OUT}/QEQUAT.o   \
+  ${OUT}/RECLOS.o   ${OUT}/REP1.o     ${OUT}/RESULT.o   ${OUT}/QUATCAT.o  \
+  ${OUT}/QUATCAT-.o ${OUT}/RFFACT.o   ${OUT}/RMATRIX.o  ${OUT}/ROMAN.o    \
+  ${OUT}/ROUTINE.o  ${OUT}/RPOLCAT.o  ${OUT}/RPOLCAT-.o ${OUT}/RULECOLD.o \
+  ${OUT}/SAOS.o     ${OUT}/SEGBIND.o  ${OUT}/SET.o      ${OUT}/SPECOUT.o  \
+  ${OUT}/SQMATRIX.o ${OUT}/SWITCH.o   ${OUT}/SYMS.o     ${OUT}/SYMTAB.o   \
+  ${OUT}/SYSSOLP.o  ${OUT}/UTSCAT.o   ${OUT}/UTSCAT-.o  \
+  ${OUT}/VARIABLE.o \
   layer16done
 
 @
 \subsection{Layer17}
 Depends on: ACF COMPCAT FFCAT FRNAALG FS OC QUATCAT RPOLCAT UTSCAT\\
 Used by next layer: ACFS EXPRSOL FDIVCAT UFPS ULSCCAT UTSSOL 
+
+The clique1.spad file is used because "MYEXPR" and "MYUP" are 
+mutually dependent. Rather than add one to the bootstrap we let the
+compiler resolve them in one step. This same technique might be useful
+for other cliques in bootstrap. This needs to be investigated.
 <<layer17>>=
 
 LAYER17=\
@@ -577,24 +586,25 @@ LAYER17=\
   ${OUT}/ALGSC.o    ${OUT}/AN.o       ${OUT}/APPRULE.o  ${OUT}/ASP19.o    \
   ${OUT}/ASP20.o    ${OUT}/ASP31.o    ${OUT}/ASP35.o    ${OUT}/ASP41.o    \
   ${OUT}/ASP42.o    ${OUT}/ASP74.o    ${OUT}/ASP77.o    ${OUT}/ASP80.o    \
-  ${OUT}/CINTSLPE.o ${OUT}/COMPFACT.o ${OUT}/COMPLEX.o  ${OUT}/COMPLPAT.o \
-  ${OUT}/CMPLXRT.o  ${OUT}/CPMATCH.o  ${OUT}/CRFP.o     ${OUT}/CTRIGMNP.o \
-  ${OUT}/D01WGTS.o  ${OUT}/D02AGNT.o  ${OUT}/D03EEFA.o  ${OUT}/DBLRESP.o  \
-  ${OUT}/DERHAM.o   ${OUT}/DFSFUN.o   ${OUT}/DRAWCURV.o ${OUT}/D01TRNS.o  \
-  ${OUT}/E04NAFA.o  ${OUT}/EF.o       ${OUT}/EFSTRUC.o  ${OUT}/ELFUTS.o   \
-  ${OUT}/ESTOOLS.o  ${OUT}/EXPEXPAN.o ${OUT}/EXPRODE.o  \
-  ${OUT}/EXPRTUBE.o ${OUT}/EXPR2.o    ${OUT}/FC.o       ${OUT}/FDIVCAT.o  \
-  ${OUT}/FDIVCAT-.o ${OUT}/FDIV2.o    ${OUT}/FFCAT2.o   ${OUT}/FLOATCP.o  \
-  ${OUT}/FORDER.o   ${OUT}/FORTRAN.o  ${OUT}/FRNAAF2.o  ${OUT}/FSRED.o    \
-  ${OUT}/FSUPFACT.o ${OUT}/FSPECF.o   ${OUT}/FS2.o      ${OUT}/FS2UPS.o   \
-  ${OUT}/GAUSSFAC.o ${OUT}/GCNAALG.o  ${OUT}/GENUFACT.o ${OUT}/GENUPS.o   \
-  ${OUT}/GTSET.o    ${OUT}/GPOLSET.o  ${OUT}/IAN.o      ${OUT}/INEP.o     \
-  ${OUT}/INFPROD0.o ${OUT}/INFSP.o    ${OUT}/INPRODFF.o ${OUT}/INPRODPF.o \
-  ${OUT}/INTAF.o    ${OUT}/INTALG.o   ${OUT}/INTEF.o    ${OUT}/INTG0.o    \
-  ${OUT}/INTHERAL.o ${OUT}/INTPAF.o   ${OUT}/INTPM.o    ${OUT}/INTTOOLS.o \
-  ${OUT}/ITRIGMNP.o ${OUT}/JORDAN.o   ${OUT}/KOVACIC.o  ${OUT}/LF.o       \
-  ${OUT}/LIE.o      ${OUT}/LODOF.o    ${OUT}/LSQM.o     ${OUT}/OMEXPR.o   \
-  ${OUT}/MCMPLX.o   ${OUT}/MULTFACT.o ${MID}/clique1.spad \
+  ${OUT}/CINTSLPE.o ${OUT}/COMBF.o    ${OUT}/COMPFACT.o ${OUT}/COMPLEX.o  \
+  ${OUT}/COMPLPAT.o ${OUT}/CMPLXRT.o  ${OUT}/CPMATCH.o  ${OUT}/CRFP.o     \
+  ${OUT}/CTRIGMNP.o ${OUT}/D01WGTS.o  ${OUT}/D02AGNT.o  ${OUT}/D03EEFA.o  \
+  ${OUT}/DBLRESP.o  ${OUT}/D01AGNT.o  ${OUT}/DERHAM.o   ${OUT}/DFSFUN.o   \
+  ${OUT}/DRAWCURV.o ${OUT}/D01TRNS.o  ${OUT}/E04NAFA.o  ${OUT}/EF.o       \
+  ${OUT}/EFSTRUC.o  ${OUT}/ELFUTS.o   ${OUT}/ESTOOLS.o  ${OUT}/EXPEXPAN.o \
+  ${OUT}/EXPRODE.o  ${OUT}/EXPRTUBE.o ${OUT}/EXPR2.o    ${OUT}/FC.o       \
+  ${OUT}/FDIVCAT.o  ${OUT}/FDIVCAT-.o ${OUT}/FDIV2.o    ${OUT}/FFCAT2.o   \
+  ${OUT}/FLOATCP.o  ${OUT}/FORDER.o   ${OUT}/FORTRAN.o  ${OUT}/FRNAAF2.o  \
+  ${OUT}/FSPRMELT.o ${OUT}/FSRED.o    ${OUT}/FSUPFACT.o ${OUT}/FSPECF.o   \
+  ${OUT}/FS2.o      ${OUT}/FS2UPS.o   ${OUT}/GAUSSFAC.o ${OUT}/GCNAALG.o  \
+  ${OUT}/GENUFACT.o ${OUT}/GENUPS.o   ${OUT}/GTSET.o    ${OUT}/GPOLSET.o  \
+  ${OUT}/IAN.o      ${OUT}/INEP.o     ${OUT}/INFPROD0.o ${OUT}/INFSP.o    \
+  ${OUT}/INPRODFF.o ${OUT}/INPRODPF.o ${OUT}/INTAF.o    ${OUT}/INTALG.o   \
+  ${OUT}/INTEF.o    ${OUT}/INTG0.o    ${OUT}/INTHERAL.o ${OUT}/INTPAF.o   \
+  ${OUT}/INTPM.o    ${OUT}/INTTOOLS.o ${OUT}/ITRIGMNP.o ${OUT}/JORDAN.o   \
+  ${OUT}/KOVACIC.o  ${OUT}/LF.o       ${OUT}/LIE.o      ${OUT}/LODOF.o    \
+  ${OUT}/LSQM.o     ${OUT}/OMEXPR.o   ${OUT}/MCMPLX.o   ${OUT}/MULTFACT.o \
+  ${MID}/clique1.spad \
   ${OUT}/NAGF01.o   ${OUT}/NAGF02.o   ${OUT}/NAGF04.o   ${OUT}/NCEP.o     \
   ${OUT}/NLINSOL.o  ${OUT}/NSMP.o     ${OUT}/NUMERIC.o  ${OUT}/OCT.o      \
   ${OUT}/OCTCT2.o   ${OUT}/ODEPAL.o   ${OUT}/ODERTRIC.o ${OUT}/PADE.o     \
@@ -602,8 +612,9 @@ LAYER17=\
   ${OUT}/PMASSFS.o  ${OUT}/PMFS.o     ${OUT}/PMPREDFS.o ${OUT}/PSETPK.o   \
   ${OUT}/QUAT.o     ${OUT}/QUATCT2.o  ${OUT}/RADFF.o    ${OUT}/RDEEF.o    \
   ${OUT}/RDEEFS.o   ${OUT}/RDIV.o     ${OUT}/RSETCAT.o  ${OUT}/RSETCAT-.o \
-  ${OUT}/RULE.o     ${OUT}/RULESET.o  ${OUT}/SIMPAN.o   ${OUT}/SFORT.o    \
-  ${OUT}/SOLVESER.o ${OUT}/SUMFS.o    ${OUT}/SUTS.o     ${OUT}/TOOLSIGN.o \
+  ${OUT}/RSDCMPK.o  ${OUT}/RSETGCD.o  ${OUT}/RULE.o     ${OUT}/RULESET.o  \
+  ${OUT}/SIGNEF.o   ${OUT}/SIMPAN.o   ${OUT}/SFORT.o    ${OUT}/SOLVESER.o \
+  ${OUT}/SOLVETRA.o ${OUT}/SUMFS.o    ${OUT}/SUTS.o     ${OUT}/TOOLSIGN.o \
   ${OUT}/TRIGMNIP.o ${OUT}/TRMANIP.o  ${OUT}/UFPS.o     ${OUT}/ULSCCAT.o  \
   ${OUT}/ULSCCAT-.o ${OUT}/UPXSSING.o ${OUT}/UTSODE.o   ${OUT}/UTSODETL.o \
   ${OUT}/UTSSOL.o   ${OUT}/UTS2.o     ${OUT}/WUTSET.o  \
@@ -611,105 +622,66 @@ LAYER17=\
 
 @
 \subsection{Layer18}
-Depends on: ACFS EXPRSOL FDIVCAT UFPS ULSCCAT UTSSOL 
+Depends on: ACFS EXPRSOL FDIVCAT RSETCAT UFPS ULSCCAT UTSSOL 
+Used in next layer: EXPRSOL SFRTCAT
 <<layer18>>=
 
 LAYER18=\
-  ${OUT}/DEFINTEF.o ${OUT}/DFINTTLS.o ${OUT}/DEFINTRF.o ${OUT}/EFULS.o    \
-  ${OUT}/ESCONT.o   ${OUT}/EXPR.o     ${OUT}/EXPRSOL.o  \
-  ${OUT}/EXPR2UPS.o ${OUT}/FDIV.o     \
-  ${OUT}/FSCINT.o   ${OUT}/FSINT.o    ${OUT}/FS2EXPXP.o ${OUT}/GSERIES.o  \
-  ${OUT}/HELLFDIV.o ${OUT}/INVLAPLA.o ${OUT}/IR2F.o     ${OUT}/IRRF2F.o   \
-  ${OUT}/LAPLACE.o  ${OUT}/LIMITPS.o  ${OUT}/LODEEF.o   ${OUT}/NODE1.o    \
-  ${OUT}/ODECONST.o ${OUT}/ODEINT.o   ${OUT}/REP.o      \
-  ${OUT}/SOLVERAD.o ${OUT}/SULS.o     ${OUT}/SUPXS.o    ${OUT}/UFPS1.o    \
-  ${OUT}/ULS.o      ${OUT}/ULSCONS.o  ${OUT}/UPXS.o     ${OUT}/UPXSCONS.o \
-  ${OUT}/UTS.o \
+  ${OUT}/DEFINTEF.o ${OUT}/DEFINTRF.o ${OUT}/DFINTTLS.o ${OUT}/EFULS.o    \
+  ${OUT}/ESCONT.o   ${OUT}/EXPR.o     ${OUT}/EXPRSOL.o  ${OUT}/EXPR2UPS.o \
+  ${OUT}/FDIV.o     ${OUT}/FSCINT.o   ${OUT}/FSINT.o    ${OUT}/FS2EXPXP.o \
+  ${OUT}/GSERIES.o  ${OUT}/HELLFDIV.o ${OUT}/INVLAPLA.o ${OUT}/IR2F.o     \
+  ${OUT}/IRRF2F.o   ${OUT}/LAPLACE.o  ${OUT}/LIMITPS.o  ${OUT}/LODEEF.o   \
+  ${OUT}/NODE1.o    ${OUT}/NTSCAT.o   ${OUT}/ODECONST.o ${OUT}/ODEEF.o    \
+  ${OUT}/ODEINT.o   ${OUT}/QCMPACK.o  ${OUT}/REGSET.o   ${OUT}/REP.o      \
+  ${OUT}/RGCHAIN.o  ${OUT}/SFRTCAT.o  ${OUT}/SOLVERAD.o ${OUT}/SULS.o     \
+  ${OUT}/SUPXS.o    ${OUT}/UFPS1.o    ${OUT}/ULS.o      ${OUT}/ULSCONS.o  \
+  ${OUT}/UPXS.o     ${OUT}/UPXSCONS.o ${OUT}/UTS.o      ${OUT}/ZDSOLVE.o \
   layer18done
 
 @
 \subsection{Layer19}
-
+Depends on: EXPRSOL SFRTCAT\\
+Next layer depends on: RECOP
 <<layer19>>=
 
 LAYER19=\
+  ${OUT}/RECOP.o    ${OUT}/IRURPK.o   ${OUT}/LAZM3PK.o  ${OUT}/LEXTRIPK.o \
+  ${OUT}/NORMPK.o   ${OUT}/RURPK.o    ${OUT}/SFRGCD.o   ${OUT}/SFQCMPK.o  \
+  ${OUT}/SNTSCAT.o  ${OUT}/SRDCMPK.o  ${OUT}/SREGSET.o  \
   layer19done
 
-
 @
 \subsection{Layer20}
-
+Depends on: RECOP
+Next layer depends on: GUESS
 <<layer20>>=
 
 LAYER20=\
+  ${OUT}/GUESS.o \
   layer20done
     
 @
 \subsection{Layer21}
-
+Depends on: GUESS
+Next layer depends on: GUESSF1
 <<layer21>>=
 
 LAYER21=\
+  ${OUT}/GUESSAN.o  ${OUT}/GUESSINT.o ${OUT}/GUESSF1.o  ${OUT}/GUESSP.o \
+  ${OUT}/GUESSUP.o \
   layer21done
 
 @
 \subsection{Layer22}
-Depends on: EXPRSOL
+Depends on: GUESSF1
 <<layer22>>=
 
 LAYER22=\
-  ${OUT}/ASP29.o    ${OUT}/COMBF.o    ${OUT}/D01AGNT.o  ${OUT}/FSPRMELT.o \
-  ${OUT}/INBFF.o    ${OUT}/LODO.o     ${OUT}/LODO1.o    ${OUT}/LODO2.o    \
-  ${OUT}/NTSCAT.o   ${OUT}/RECOP.o    \
-  ${OUT}/REGSET.o   ${OUT}/RGCHAIN.o  ${OUT}/RSETGCD.o  \
-  ${OUT}/RSDCMPK.o  ${OUT}/SFRTCAT.o  ${OUT}/SIGNEF.o   ${OUT}/SNTSCAT.o  \
-  ${OUT}/SOLVETRA.o ${OUT}/SRDCMPK.o  ${OUT}/SREGSET.o  ${OUT}/STTF.o     \
-  ${OUT}/SUBSPACE.o ${OUT}/ZDSOLVE.o \
+  ${OUT}/GUESSF.o \
   layer22done
 
 @
-\subsection{Final layer spad files}
-These files have not yet been fully analyzed for dependencies but
-have added in alphabetical order in this final layer. This
-ordering is apparently adequate.
-
-These files all depend on layer22.
-\begin{verbatim}
-algcat.spad.pamphlet (CPIMA)
-nregset.spad.pamphlet (NORMPK)
-nsregset.spad.pamphlet (LAZM3PK)
-regset.spad.pamphlet (QCMPACK)
-sregset.spad.pamphlet (SFRGCD SFQCMPK)
-zerodim.spad.pamphlet (LEXTRIPK IRURPK RURPK)
-\end{verbatim}
-
-<<layer23>>=
-
-LAYER23=\
-  ${OUT}/CPIMA.o    ${OUT}/GUESS.o \
-  ${OUT}/IRURPK.o   ${OUT}/LAZM3PK.o  ${OUT}/LEXTRIPK.o \
-  ${OUT}/NORMPK.o   ${OUT}/QCMPACK.o  ${OUT}/RURPK.o    ${OUT}/SFRGCD.o   \
-  ${OUT}/SFQCMPK.o  ${OUT}/INTRVL.o   ${OUT}/ODEEF.o \
-  layer23done
-
-@
-<<layer24>>=
-
-LAYER24=\
-  ${OUT}/GUESSAN.o  ${OUT}/GUESSINT.o  \
-  ${OUT}/GUESSF1.o  ${OUT}/GUESSP.o   ${OUT}/GUESSUP.o \
-  layer24done
-
-@
-\subsection{User Layer for newly added algebra}
-Rather than classify newly created algebra into the existing type lattice
-we add it here.
-<<USERLAYER>>=
-
-USERLAYER=\
-  ${OUT}/GUESSF.o \
-  ${OUT}/RINTERP.o
-@
 \subsection{Order}
 The final order of the layers is determined here.
 <<order>>=
@@ -719,7 +691,7 @@ ORDER=\
   ${LAYER4}   ${LAYER5}  ${LAYER6}  ${LAYER7}  ${LAYER8}  ${LAYER9}  \
   ${LAYER10}  ${LAYER11} ${LAYER12} ${LAYER13} ${LAYER14} ${LAYER15} \
   ${LAYER16}  ${LAYER17} ${LAYER18} ${LAYER19} ${LAYER20} ${LAYER21} \
-  ${LAYER22}  ${LAYER23} ${LAYER24} ${USERLAYER} ${LAYER0COPY}
+  ${LAYER22}  ${LAYER0COPY}
 
 @
 \section{Cliques}
@@ -2964,9 +2936,6 @@ ${HELP}/ZeroDimensionalSolvePackage.help: ${IN}/zerodim.spad.pamphlet
 <<layer20>>
 <<layer21>>
 <<layer22>>
-<<layer23>>
-<<layer24>>
-<<USERLAYER>>
 <<order>>
 
 all: src ${OUT}/libdb.text ${DOCFILES} ${SPADBIN}/index.html \
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 1c48c17..b31dabe 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -861,6 +861,8 @@ algebra/Makefile move layers 15, 16, 17, 18, 19 <br/>
 algebra/Makefile rearrange build order <br/>
 <a href="patches/20081226.02.tpd.patch">20081226.02.tpd.patch</a>
 algebra/Makefile rearrange build order <br/>
+<a href="patches/20081227.01.tpd.patch">20081227.01.tpd.patch</a>
+algebra/Makefile complete build order change <br/>
 
  </body>
 </html>

\start
Date: Mon, 29 Dec 2008 21:27:42 -0600
From: Tim Daly
To: list
Subject: 20081229.01.tpd.patch (hp.svg Axiom build order graph)

The Axiom build order graph now exists at:

http://axiom-developer.org/axiom-website/documentation.html#buildorder

The categories, domains, and packages have distinct colors (see the
bottom layer for the colors of each). Some nodes are elliptical. These
nodes are part of the bootstrap process.

Only edges that represent a dependence on the prior layer are present.

The graph is in scalable vector graphics format so you can scale it
in your browser using Ctrl- and Ctrl+ although it is rather large.

The patch is too large to post. It is available at
http://axiom-developer.org/axiom-website/patches.html#latest

\start
Date: Tue, 30 Dec 2008 20:46:40 -0600
From: Tim Daly
To: list
Subject: 20081230.01.tpd.patch (CATS Kamke test suite uploaded)

The CATS Kamke test suite for Ordinary Differential Equations was added
to the website at:
http://axiom-developer.org/axiom-website/CATS

The patch is too large to post. Visit
http://axiom-developer.org/axiom-website/patches.html#latest

\start
Date: Wed, 31 Dec 2008 07:32:58 -0600
From: Tim Daly
To: list
Subject: 20081231.01.tpd.patch (hp build order graph fixes)

Remove a couple of bogus nodes.

The patch is too large to post:
http://axiom-developer.org/axiom-website/patches.html#latest




\end{verbatim}
\eject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\cleardoublepage
%\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{axiom}
\bibliography{axiom}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\cleardoublepage
%\phantomsection
\addcontentsline{toc}{chapter}{Index}
\printindex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
