From bdfc2f7cfbf088c2adf7033355fdc6d81605670e Mon Sep 17 00:00:00 2001
From: Tim Daly <daly@axiom-developer.org>
Date: Thu, 15 Jan 2015 15:59:04 -0500
Subject: src/input/intlinear4.input added to the unit test suite

This is part of cooperative work with Albert Rich on a
decision tree form of the Rich pattern matching integrator.
---
 changelog                           |    3 +
 patch                               |    4 +-
 src/axiom-website/patches.html      |    2 +
 src/input/Makefile.pamphlet         |    5 +-
 src/input/intlinear4.input.pamphlet |  174 +++++++++++++++++++++++++++++++++++
 5 files changed, 185 insertions(+), 3 deletions(-)
 create mode 100644 src/input/intlinear4.input.pamphlet

diff --git a/changelog b/changelog
index 11bb609..ea813eb 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,6 @@
+20150115 tpd src/axiom-website/patches.html 20150115.01.tpd.patch
+20150115 tpd src/input/Makefile add intlinear4.input
+20150115 tpd src/input/intlinear4.input added to the unit test suite
 20150113 tpd src/axiom-website/patches.html 20150113.01.tpd.patch
 20150113 tpd books/bookvol3 remove |function| and regularize Spad code
 20150109 tpd src/axiom-website/patches.html 20150109.03.tpd.patch
diff --git a/patch b/patch
index 1c3a3d0..b6fbd2f 100644
--- a/patch
+++ b/patch
@@ -1,2 +1,4 @@
-books/bookvol3 remove |function| and regularize Spad code
+src/input/intlinear4.input added to the unit test suite
 
+This is part of cooperative work with Albert Rich on a 
+decision tree form of the Rich pattern matching integrator.
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 412912a..d7f3de1 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -4952,6 +4952,8 @@ books/bookvolbib add Fate13 reference<br/>
 books/bookvolbib add Stou07 reference<br/>
 <a href="patches/20150113.01.tpd.patch">20150113.01.tpd.patch</a>
 books/bookvol3 remove |function| and regularize Spad code
+<a href="patches/20150115.01.tpd.patch">20150115.01.tpd.patch</a>
+src/input/intlinear4.input added to the unit test suite<br/>
  </body>
 </html>
 
diff --git a/src/input/Makefile.pamphlet b/src/input/Makefile.pamphlet
index c285632..d898407 100644
--- a/src/input/Makefile.pamphlet
+++ b/src/input/Makefile.pamphlet
@@ -299,7 +299,7 @@ REGRESSTESTS= ackermann.regress \
     hyperell.regress  ico.regress       ideal.regress \
     ifact.regress     ifthenelse.regress i2e.regress \
     infprod.regress   intaf.regress    intbypart.regress \
-    inputform.regress intdeq.regress \
+    intlinear4.regress inputform.regress intdeq.regress \
     intef2.regress    intef.regress    intg0.regress    intheory.regress \
     intmix2.regress   intmix.regress   int.regress      intrf.regress \
     iprntpk.regress \
@@ -671,7 +671,7 @@ FILES= ${OUT}/ackermann.input \
        ${OUT}/images3.input  ${OUT}/images6.input    ${OUT}/images6a.input \
        ${OUT}/images7.input  ${OUT}/images7a.input   ${OUT}/infprod.input \
        ${OUT}/inputform.input  ${OUT}/intaf.input    ${OUT}/intbypart.input \
-       ${OUT}/intdeq.input   ${OUT}/intef.input \
+       ${OUT}/intlinear4.input ${OUT}/intdeq.input   ${OUT}/intef.input \
        ${OUT}/intg0.input    ${OUT}/intheory.input   ${OUT}/int.input \
        ${OUT}/intlf.input    ${OUT}/intmix.input     ${OUT}/intrf.input \
        ${OUT}/ipftest.input  ${OUT}/is.input         ${OUT}/isprime.input \
@@ -1035,6 +1035,7 @@ DOCFILES= \
   ${DOC}/images8a.input.dvi    ${DOC}/images8.input.dvi    \
   ${DOC}/infprod.input.dvi     ${DOC}/inputform.input.dvi  \
   ${DOC}/intaf.input.dvi       ${DOC}/intbypart.input.dvi  \
+  ${DOC}/intlinear4.input.dvi \
   ${DOC}/intdeq.input.dvi      ${DOC}/intef2.input.dvi     \
   ${DOC}/intef.input.dvi       ${DOC}/intg0.input.dvi      \
   ${DOC}/intheory.input.dvi    ${DOC}/int.input.dvi        \
diff --git a/src/input/intlinear4.input.pamphlet b/src/input/intlinear4.input.pamphlet
new file mode 100644
index 0000000..4545ad7
--- /dev/null
+++ b/src/input/intlinear4.input.pamphlet
@@ -0,0 +1,174 @@
+\documentclass{article}
+\usepackage{axiom}
+\setlength{\textwidth}{400pt}
+\begin{document}
+\title{\$SPAD/src/input intlinear4.input}
+\author{Albert Rich and Timothy Daly}
+\maketitle
+\begin{abstract}
+This is a decision tree form of the Rich pattern matching integrator.
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+\begin{chunk}{*}
+)set break resume
+)sys rm -f intlinear4.output
+)spool intlinear4.output
+)set message test on
+)set message auto off
+)clear all
+ 
+--S 1 of 10
+Rn ==> Fraction(Integer)
+--R 
+--R                                                                   Type: Void
+--E 1
+
+--S 2 of 10
+ET := Expression(Complex(Integer))
+--R 
+--R
+--R   (2)  Expression(Complex(Integer))
+--R                                                                 Type: Domain
+--E 2
+
+--S 3 of 10
+eql?(m:ET, n:ET):Boolean == zero?(m-n)
+--R 
+--R   Function declaration eql? : (Expression(Complex(Integer)),Expression
+--R      (Complex(Integer))) -> Boolean has been added to workspace.
+--R                                                                   Type: Void
+--E 3
+
+\end{chunk}
+
+\section{Outline of rules for integrands of the form}
+\[\int{(a+bx)^m}\]
+See \verb|2.1.1 (a+b x)^m.pdf|
+
+\[\begin{array}{rcl}
+m=0, b=0 &=& x\\
+m=0, b\ne 0 &=& x\\
+m\ne 0, b=0 &=& a^m x\\
+m=1 &=& \displaystyle ax+\frac{1}{2}bx^2\\
+\\
+m=-1  &=& \displaystyle\frac{log(a+bx)}{b}\\
+\\
+{\textrm general} &=& \displaystyle\frac{(a+bx)^{m+1}}{b(m+1)}
+\end{array}\]
+
+\section{Axiom code for the rules}
+\begin{chunk}{*}
+--S 4 of 10
+intlinear4(a:ET, b:ET, m:ET, x:Symbol):ET ==
+  if eql?(m,0) or eql?(b,0) then
+    x*(a+b*x)^m
+  else if eql?(m,1) then
+    (a*x+1/2*b*x^2)
+  else if eql?(m,-1) then
+    log(a+b*x)/b
+  else 
+    (a+b*x)^(1+m)/(b*(1+m)) 
+--R 
+--R   Function declaration intlinear4 : (Expression(Complex(Integer)),
+--R      Expression(Complex(Integer)),Expression(Complex(Integer)),Symbol)
+--R       -> Expression(Complex(Integer)) has been added to workspace.
+--R                                                                   Type: Void
+--E 4
+
+\end{chunk}
+
+\section{Test cases with Axiom results}
+{\bf Case 1a}: $m=0, b=0 => x$
+\begin{chunk}{*}
+--S 5 of 10
+intlinear4(A::ET, 0::ET, 0::ET,    x::SYMBOL)
+--R 
+--R   Compiling function eql? with type (Expression(Complex(Integer)),
+--R      Expression(Complex(Integer))) -> Boolean 
+--R   Compiling function intlinear4 with type (Expression(Complex(Integer)
+--R      ),Expression(Complex(Integer)),Expression(Complex(Integer)),
+--R      Symbol) -> Expression(Complex(Integer)) 
+--R
+--R   (5)  x
+--R                                           Type: Expression(Complex(Integer))
+--E 5
+
+\end{chunk}
+
+\noindent{\bf Case 1b}: $m=0, b\ne 0 => x$
+\begin{chunk}{*}
+--S 6 of 10
+intlinear4(A::ET, B::ET, 0::ET,    x::SYMBOL)
+--R 
+--R
+--R   (6)  x
+--R                                           Type: Expression(Complex(Integer))
+--E 6
+
+\end{chunk}
+
+\noindent{\bf Case 1c}: $m\ne 0, b=0 => a^m x$
+\begin{chunk}{*}
+--S 7 of 10
+intlinear4(A::ET, 0::ET, M::ET,    x::SYMBOL)
+--R 
+--R
+--R           M
+--R   (7)  x A
+--R                                           Type: Expression(Complex(Integer))
+--E 7
+
+\end{chunk}
+
+\noindent{\bf Case 2}: $m=1 => \displaystyle ax+\frac{1}{2}bx^2$
+\begin{chunk}{*}
+--S 8 of 10
+intlinear4(A::ET, B::ET, 1::ET,    x::SYMBOL)
+--R 
+--R
+--R           2
+--R        B x  + 2A x
+--R   (8)  -----------
+--R             2
+--R                                           Type: Expression(Complex(Integer))
+--E 8
+
+\end{chunk}
+
+\noindent{\bf Case 3}: $m=-1  => \displaystyle\frac{log(a+bx)}{b}$
+\begin{chunk}{*}
+--S 9 of 10
+intlinear4(A::ET, B::ET, (-1)::ET, x::SYMBOL)
+--R 
+--R
+--R        log(B x + A)
+--R   (9)  ------------
+--R              B
+--R                                           Type: Expression(Complex(Integer))
+--E 9
+
+\end{chunk}
+
+\noindent{\bf Case4}: 
+${\textrm general} => \displaystyle\frac{(a+bx)^{m+1}}{b(m+1)}$
+\begin{chunk}{*}
+--S 10 of 10
+intlinear4(A::ET, B::ET, M::ET,    x::SYMBOL)
+--R 
+--R
+--R                  M + 1
+--R         (B x + A)
+--R   (10)  --------------
+--R             B M + B
+--R                                           Type: Expression(Complex(Integer))
+--E 10
+
+)spool
+)lisp (bye)
+\end{chunk}
+
+\end{document}
+
+
-- 
1.7.5.4

