ALGEBRAIC SIMPLIFICATION
F O R THE P E R P L E X E D
A GUIDE
by
Joel M o s e s
P r o j e c t MAC,
Abstract
A l g e b r a i c s i m p l i f i c a t i o n is e x a m i n e d first
from the p o i n t of v i e w of a user n e e d i n g to
c o m p r e h e n d a large expression, and second from
the p o i n t of v i e w of a d e s i g n e r w h o w a n t s to
c o n s t r u c t a u s e f u l and e f f i c i e n t system.
F i r s t we d e s c r i b e v a r i o u s techniques akin to
substitution.
T h e s e techniques can be used to
d e c r e a s e the size of an e x p r e s s i o n and m a k e it
m o r e i n t e l l i g i b l e to a user.
Then we d e l i n e ate the s p e c t r u m of approaches to the d e s i g n
of a u t o m a t i c s i m p l i f i c a t i o n c a p a b i l i t i e s in an
a l g e b r a i c m a n i p u l a t i o n system.
Systems are
d i v i d e d into five types.
Each type p r o v i d e s
d i f f e r e n t f a c i l i t i e s for the m a n i p u l a t i o n and
s i m p l i f i c a t i o n of expressions.
F i n a l l y we
d i s c u s s some of the t h e o r e t i c a l results relat~
ed to a l g e b r a i c s i m p l i f i c a t i o n .
We describe
several p o s i t i v e results about the e x i s t e n c e
of p o w e r f u l s i m p l i f i c a t i o n a l g o r i t h m s and the
n u m b e r - t h e o r e t i c c o n j e c t u r e s on w h i c h they
rely.
Results a b o u t the n o n - e x i s t e n c e of
a l g o r i t h m s for c e r t a i n classes of e x p r e s s i o n s
are included.
Ta b l e
of C o n t e n t s
1.0
2.0
Introduction
S i m p l i f i c a t i o n for the Sake of
C o m p r e h e n s i o n - The Needs of Users
2.1
Conventional Lexicographic Ordering
of E x p r e s s i o n s
2.2
S u b s t i t u t i o n as an Aid to C o m p r e h e n sion
3.0
S i m p l i f i c a t i o n for the Sake of Efficient M a n i p u l a t i o n - W h a t D e s i g n e r s P r o v i d e
3.1
The P o l i t i c s of S i m p l i f i c a t i o n
3.1.1
The R a d i c a l s
3.1.2
The New Left
3.1.3
The L i b e r a l s
3.1.4
The C o n s e r v a t i v e s
3.1.5
The C a t h o l i c s
3.2
I n t e r m e d i a t e E x p r e s s i o n Swell
3.3
C a n o n i c a l S i m p l i f i e r s and T h e o r e t i c a l
Results - The R a d i c a l s R e v i s i t e d
3.3.1
S i m p l i f i c a t i o n A l g o r i t h m s for
Expressions with Nested Exponentials
3.3.2
Expressions involving Exponentials and L o g a r i t h m s
3.3.3
Roots of P o l y n o m i a l s
3.3.4
U n s o l v a b i l i t y Results
4.0
P r o s p e c t s for the F u t u r e
References
Figures
1.0
MIT
and e f f i c i e n c y , a r e q u i r e m e n t w h i c h t r a n s l a t e s
to a d e s i r e for a u n i f o r m r e p r e s e n t a t i o n of
e x p r e s s i o n s u t i l i z i n g a m i n i m u m n u m b e r of
functions.
Users tolerate, and in fact prefer,
a c e r t a i n amount of r e d u n d a n c y in an answer.
For example, they u s u a l l y d e s i r e to see e x p r e s sions c o n t a i n i n g the twelve t r i g o n o m e t r i c and
h y p e r b o l i c functions.
Designers would prefer
g i v i n g a user only the e x p o n e n t i a l s , sines and
cosines, or just e x p o n e n t i a l s w i t h both real
and c o m p l e x arguments, or n o t h i n g b u t r a t i o n a l
fuDctions.
T h e r e is one p r o p e r t y of s i m p l i f i c a t i o n
about w h i c h both users and d e s i g n e r s can a g r e ~
That is, that s i m p l i f i c a t i o n changes only the
form or r e p r e s e n t a t i o n of an e x p r e s si o n , but
not its value.
Changes of r e p r e s e n t a t i o n
occur in m a n y p r o b l e m solving domains.
In
fact, in the field of A r t i f i c i a l I n t e l l i g e n c e
one speaks of the P r o b l e m of R e p r e s e n t a t i o n
w h i c h can be stated r o u g h l y as "how does one
t r a n s f o r m the s t a t e m e n t of the p r o b l e m into a
form w h i c h is m o r e r e a d i l y solved."
Thus an
ideal, but not very helpful, w a y to d e s c r i b e
s i m p l i f i c a t i o n is that it is the p r o c e s s w h i c h
t r a n s f o r m s e x p r e s s i o n s into a form w i t h w h i c h
the r e m a i n i n g steps of the p r o b l e m can be
taken m o s t e f f i c i e n t l y .
The P r o b l e m of R e p r e s e n t a t i o n for algeb r a i c e x p r e s s i o n s is e s p e c i a l l y acute b e c a u s e
there are so many e q u i v a l e n t ways to r e p r e s e n t
an e x p r e s s i o n .
F r e q u e n t l y one of these
e q u i v a l e n t forms is m u c h m o r e u s e f u l than another, and just as frequently, it is a nontrivial p r o b l e m to r e c o g n i z e the e q u i v a l e n c e .
For example, it is rare that we do not w a n t to
r e c o g n i z e that an e x p r e s s i o n is e q u i v a l e n t to
0.
However, m a n y of us have d i f f i c u l t y in
r e c o g n i z i n g the f o l l o w i n g identities.
log(e 2x + 2e x + i) - 2 log(e x + i) = 0
or
(21/3 + 41/3) 3 - 6(21/3
+ 41/3 ) - 6 = 0
or
log t a n ( ~ + 7)
- sinh -I tan x = 0
C o n s i d e r how m u c h m o r e d i f f i c u l t the p r o b l e m s
b e c o m e w h e n we deal w i t h e x p r e s s i o n s w h i c h are
several pages long.
Yet e x p r e s s i o n s of such
size are q u i t e c o m m o n in a l g e b r a i c m a n i p u l a tion!
A n a d d i t i o n a l d i f f i c u l t y is that the
usual m a n i p u l a t o r y a l g o r i t h m s can e a s i l y
m a g n i f y a bad choice of r e p r e s e n t a t i o n .
For
example, the d e r i v a t i v e of a p r o d u c t of n
factors can be a sum of n terms each of n or
m o r e factors.
Thus a bad r e p r e s e n t a t i o n of
the p r o d u c t or one of its factors is propagated and m a g n i f i e d n-fold.
A n o t h e r issue w h i c h arises in d i s c u s s i o n s
of s i m p l i f i c a t i o n is r e l a t e d to the local or
g l o b a l n a t u r e of the problem.
If e x p r e s s i o n
A is d e e m e d s i m p l e r than its e q u i v a l e n t
e x p r e s s i o n B in one context, then is A to be
c o n s i d e r e d simpler than B in every c o n t e x t ?
Introduction
S i m p l i f i c a t i o n is the m o s t p e r v a s i v e process in a l g e b r a i c m a n i p u l a t i o n .
It is also
the m o s t c o n t r o v e r s i a l .
Much of the controve r s y is due to the d i f f e r e n c e b e t w e e n the
desires of a user and those of a s y s t e m designer.
The user w a n t s e x p r e s s i o n s w h i c h he can
comprehend, a r e q u i r e m e n t w h i c h u s u a l l y m e a n s
that the e x p r e s s i o n s p r e s e n t e d to the user
should be small.
The d e s i g n e r w a n t s e x p r e s sions w h i c h can be m a n i p u l a t e d w i t h g r e a t ease
Z82
A perfectly
strict
answer
is no.
For
example,
x7
12
x
+ 1
is a m o r e c o m p a c t r e p r e s e n t a t i o n
al f u n c t i o n it r e p r e s e n t s than
of the ration-
i/4(4x3)x 4
(x4) 3 + 1
The former is u s u a l l y easier to m a n i p u l a t e and
comprehend.
However, w h e n integrating, the
latter e x p r e s s i o n indicates a p @ t t e r n w h i c h
suggests the s u b s t i t u t i o n y = x ~ w h i c h yields
f
y3+l
dy ,
a m u c h simpler i n t e g r a t i o n p r o b l e m than that
which is posed by the first expression.
Designers w o u l d p r e f e r a s y s t e m in w h i c h the
s i m p l i f i c a t i o n steps are the same in every
context.
Users clearly w o u l d p r e f e r a s y s t e m
w h i c h could take c o n t e x t u a l i n f o r m a t i o n into
account in d e r i v i n g a s i m p l i f i e d expression.
D e s i g n e r s can take c o m f o r t in the fact that
while the s i m p l i f i e d form of an e x p r e s s i o n is
not the same in every context, it is so in
m a n y contexts.
Nonetheless, the task of deriving a c o m p r o m i s e b e t w e e n the w i s h e s of users
and the r e q u i r e m e n t s of an e f f i c i e n t s y s t e m is
likely to keep d e s i g n e r s talking to themselves
and to each other for quite some time.
A related aspect of s i m p l i f i c a t i o n is the
extent to w h i c h the concept can be formalized.
The po i n t that we made above is that the simplest form of an e x p r e s s i o n
depends on one's
goals or, in other words, on the context.
One
w o u l d be hard put to f o r m a l i z e the goals of
all p o t e n t i a l users.
However, one can o b t a i n
t h e o r e t i c a l results for s i m p l i f i c a t i o n algorithms w h i c h have usef,11 p r o p e r t i e s .
One such
p r o p e r t y is that the a l g o r i t h m simplifies to
zero any e x p r e s s i o n e q u i v a l e n t to 0.
A stronger p r o p e r t y is that the s i m p l i f i e r reduces
all e q u i v a l e n t e x p r e s s i o n s to a single (canonical) expression.
H i s t o r i c a l l y , s i m p l i f i c a t i o n was r e q u i r e d
in a l g e b r a i c m a n i p u l a t i o n systems b e c a u s e the
m a n i p u l a t o r y a l g o r i t h m s p r o d u c e d sloppy results,
For example, the u n s i m p l i f i e d result of
differentiating
c o n c e n t r a t e in s e c t i o n 2 on the users' need
for c o m p r e h e n s i o n of expressions, and then in
section 3 on the designers' f a c i l i t i e s for
m a n i p u l a t i n g expressions.
In d i s c u s s i n g s i m p l i f i c a t i o n for the
sake of c o m p r e h e n s i o n , we shall d e s c r i b e the
t e c h n i q u e of s u b s t i t u t i n g labels for subexpressions in s i m p l i f y i n g large e x p r e s s i o n s .
We
shall also d e s c r i b e p r i n c i p l e s of c o n v e n t i o n a l
l e x i c o g r a p h i c o r d e r i n g of e x p r e s s i o n s .
A
system can h i n d e r the c o m p r e h e n s i o n of a user
by d i s p l a y i n g e x p r e s s i o n s in u n c o n v e n t i o n a l
order.
U n f o r t u n a t e l y , no current system pays
s u f f i c i e n t heed to this point.
In s e c t i o n 3 we d e s c r i b e five d i f f e r e n t
a p p r o a c h e s to the d e s i g n of s i m p l i f i c a t i o n
facilities in a l g e b r a i c m a n i p u l a t i o n systems.
We d e s c r i b e the f a c i l i t i e s w h i c h are u s u a l l y
offered, and indicate the a d v a n t a g e s and
d i s a d v a n t a g e s in them.
The section ends w i t h
a d i s c u s s i o n of very p o w e r f u l a l g o r i t h m s b a s e d
on f o r m a l i z a t i o n s of the concepts of s i m p l i f i cation.
2.0
S i m p l i f i c a t i o n for the Sake of C o m p r e q
h e n s i o n - The Needs of Users
One of the m o s t c o m m o n c o m p l a i n t s of
users of a l g e b r a i c m a n i p u l a t i o n systems is that
the e x p r e s s i o n s o b t a i n e d as results of a calculation are i n c o m p r e h e n s i b l e and t h e r e f o r e
e s s e n t i a l l y useless.
In order to u n d e r s t a n d
the i m p o r t a n c e of such a c o m p l a i n t we have to
d i f f e r e n t i a t e b e t w e e n two m a j o r classes of
users.
Some users are only i n t e r e s t e d in the
v a l u e of a calculation.
For example, those
who use symbolic d i f f e r e n t i a t i o n as a step in
a n u m e r i c a l c a l c u l a t i o n do not care very m u c h
about the form of the s y m b o l i c d e r i v a t i v e . !
For such users the p r o b l e m of s i m p l i f i c a t i o n
reduces to keeping the i n t e r m e d i a t e e x p r e s s i o n s
in a c a l c u l a t i o n in such a form as to o p t i m i z e
the use of space and time in the calculation.
We do not wish to u n d e r e s t i m a t e the d i f f i c u l t i e s
in the s i m p l i f i c a t i o n p r o b l e m for such users.
However, in this section we will be m a i n l y
c o n c e r n e d w i t h the needs of users who do care
about the form of e x p r e s s i o n s w h i c h r e s u l t from
a symbolic calculation.
The latter class of users include those
w h o need to make "physical sense" of an expresPerhaps such a user is s t u d y i n g a prosion.
cess and w a n t s to learn about some p r o p e r t y of
the process by s y m b o l i c a l l y m a n i p u l a t i n g a
m o d e l of it.
For example, he m i g h t be inter2
ested
in
the
m
a n n e r in w h i c h the v a l u e of an
X
ax + xe
e x p r e s s i o n varies as one of its v a r i a b l e s
increases in value.
He could, of course, plot
with r e s p e c t to x is an e x p r e s s i o n such as
the value of the e x p r e s s i o n for s e v e r a l values
2
2
of the variables, but this m e t h o d may not be
0.x + a.l + l.e x
+ x-e x -2-x
very u s e f u l i f - t h e r e are many v a r i a b l e s in the
expression.
Other users m i g h t need to examine
S i m p l i f y i n g the d e r i v a t i v e above w o u l d y i el d
an e x p r e s s i o n in order to know w h a t the next
an e x p r e s s i o n like
m a n i p u l a t o r y step should be.
A simple in s t a n c e
of such a s i t u a t i o n occurs w h e n the next step
a + e x2 + 2x 2 e x2
in the c a l c u l a t i o n depends on w h e t h e r the
e x p r e s s i o n is linear or q u a d r a t i c in a gi v e n
variable.
With the ever g r o w i n g use of a l g e b r a i c m a n i p u ~
It should be clear that a user is likely
lation, it has b e c o m e i n c r e a s i n g l y a p p a r e n t
to c o m p r e h e n d and to answer q u e s t i o n s a b o u t a
that s i m p l i f i c a t i o n plays a much more complex
role in the way one solves p r o b l e m s w i t h an
small e x p r e s s i o n a lot b e t t e r than about an
a l g e b r a i c m a n i p u l a t i n g system.
In the r e m a i n d equivalent, but larger one.
Thus, a goal of
er of this paper our d i s c u s s i o n of s i m p l i f i c a I. Such users should care a little about the
tion w i l l range from m u n d a n e topics (such as
form of the d e r i v a t i v e b e c a u s e some forms of
w h e t h e r one w r i t e s x+a or a+x) to s u b l i m e ones
e x p r e s s i o n s y i e l d a smaller r o u n d - o f f error in
(whether e+~ is a r a t i o n a l number).
We shall
a n u m e r i c a l c a l c u l a t i o n than o t h e r forms.
283
s i m p l i f i c a t i o n should be to p r o d u c e small
expressions.
In fact, m o s t of the usual
s i m p l i f i c a t i o n t r a n s f o r m a t i o n s such as c o l l e c t ing terms in sums (x + 2x ~ 3x), c o l l e c t i n g
e x p o n e n t s in p r o d u c t s
(xy 2 ~1 4 y2)
,
r e m o v i n g 0 terms in sums (x + 0 4 x), and
factors of 1 in p r o d u c t s (l-X ~ x), p r o d u c e
smaller expressions.
In fact, t r a n s f o r m a t i o n s
w h i c h p r o d u c e larger e x p r e s s i o n s (e.g., expanding integral powers of sums
(x + 1) 3 4 x 3 + 3x 2 + 3x + i)
are c o n t r o v e r s i a l .
Many systems will e m p l o y
such t r a n s f o r m a t i o n s only if the user specifically d e m a n d s them.
Of course the p r e v a l e n c e in a l g e b r a i c
m a n i p u l a t i o n systems of s i m p l i f i c a t i o n transf o r m a t i o n s w h i c h p r o d u c e smaller e x p r e s s i o n s
is due m o s t l y to the fact that small expressions are u s u a l l y e a s i e r to m a n i p u l a t e than
larger ones.
This is an i n s t a n c e w h e r e the
needs of s i m p l i f i c a t i o n for the sake of improved c o m p r e h e n s i o n and s i m p l i f i c a t i o n for the
sake of e f f i c i e n t m a n i p u l a t i o n coincide.
However, the r e q u i r e m e n t s of s i m p l i f i c a t i o n
for the sake of c o m p r e h e n s i o n are m o r e subtle
than we just indicated.
It is not so m u c h the
small size of the e x p r e s s i o n w h i c h aids in
c o m p r e h e n s i o n , as the small size of a d e s c r i p eion of the expression.
For example:
1 + 2x + 3x 2 + 4x 3 +
is a lot less c o m p l e x
... + llx I0
for many
purposes
than
1 + 3x + 4x 2 + x 3 - 9x 4 + 5x 5 + x 6 + 2x 7
b e c a u s e one can supply
the former (i.e.,
i0
E
i=0
a small d e s c r i p t i o n
of
(i+l)x I ) ,
but not of the latter.
The way one u s u a l l y
obtains a small d e s c r i p t i o n is by r e c o g n i z i n g
a r e p e a t e d p a t t e r n in an expression.
Unfortunately, c o m p u t e r p r o g r a m s n o w a d a y s are not as 2
good as humans at r e c o g n i z i n g u s e f u l p a t t e r n s .
F u r t h e r m o r e , m a n y d e s c r i p t i o n s w h i c h are of
v a l u e to humans are i n c o m p l e t e d e s c r i p t i o n s
of an e x p r e s s i o n (e.g., the e x p r e s s i o n has f's
w h e n e v e r a y occurs e x c e p t for the f i rs t term).
M o s t p r o g r a m s are unable to deal w i t h incomple t e d e s c r i p t i o n s .
Both of these d r a w b a c k s
m e a n that we have to depend on the user to
o b t a i n a d e s c r i p t i o n for his own use.
The
process of "massaging an e x p r e s s i o n " w h i c h
p e o p l e use in p e n c i l - a n d - p a p e r c a l c u l a t i o n s ,
can be c h a r a c t e r i z e d as a t r i a l - a n d - e r r o r
a t t e m p t to d e c r e a s e the size of an e x p r e s s i o n
and to t r a n s f o r m it into a form for w h i c h a
short d e s c r i p t i o n is apparent.
As we h a v e
remarked, it is not p o s s i b l e now to fully
a u t o m a t e this m a s s a g i n g process.
Rather, it
should be the goal of a good s y s t e m to p r o v i d e
m a c h i n e r y w h i c h w i l l aid the user in his
m a s s a g i n g efforts.
The r e m a i n d e r of this
2. An e x c e p t i o n to this rule are p r o g ra m s to
r e c o g n i z e the next number in a s e q u e n c e [ 1 ].
Such programs would, in fact, r e c o g n i z e the
p a t t e r n in the former expression.
s e c t i o n will be d e v o t e d to d e s c r i b i n g such
machinery.
A m a j o r r e a s o n why c o m p u t e r s are not as
good as h u m a n users in s i m p l i f y i n g an expression is that they lack k n o w l e d g e of the context in w h i c h the e x p r e s s i o n was d~rived.
To
a p h y s i c i s t s u b e x p r e s s i o n s like mc ~ c o n t a i n a
good deal of i n f o r m a t i o n not a p p a r e n t to an
a l g e b r a i c m a n i p u l a t i o n system.
For example,
a p h y s i c i s t m i g h t be tempted to s u b s t i t u t e E
for mc ~ in o r d e r to r e d u c e the size of the
e x p r e s s i o n w i t h o u t d e s t r o y i n g its i n f o r m a t i o n
c o n t e n t to him.
In fact, the m a j o r t e c h n i q u e
for s i m p l i f y i n g large e x p r e s s i o n s is the
s u b s t i t u t i o n of small e x p r e s s i o n s (preferably
single literals) for large s u b e x p r e s s i o n s
w h i c h either occur f r e q u e n t l y or possess some
meaning.
We shall examine this t e c h n i q u e in
section 2.2.
W o r k i n g w i t h an a l g e b r a i c m a n i p u l a t i o n
s y s t e m can f r e q u e n t l y be a n n o y i n g b e c a u s e such
systems do not d i s p l a y e x p r e s s i o n s in the way
to w h i c h the user has b e c o m e a c c u s t o me d .
A
user w h o is p r e s e n t e d w i t h a q u a d r a t i c in x
w r i t t e n as c + x-a + bx is not only annoyed,
but is i n c a p a b l e of u n d e r s t a n d i n g such
e x p r e s s i o n s as w e l l as those w r i t t e n in a m o r e
c o n v e n t i o n a l form.
In s e c t i o n 2.1 w e p r e s e n t
an a t t e m p t to m o d e l the rules w h i c h g o v e r n the
c o n v e n t i o n a l o r d e r i n g of e x p r e s s i o n s .
2.1
Conventional
Expressions
Lexicographic
Ordering
of
As noted above, m o s t systems do not m a k e
a very s a t i s f y i n g a t t e m p t to p r o d u c e expressions in a c o n v e n t i o n a l l y o r d e r e d form.
F e n i c h e l ' s F A M O U S [ 14], and PL/i F O R M A C [ 44]
m a k e some a t t e m p t to supply c o n v e n t i o n a l lexic o g r a p h i c ordering.
However, each s y s t e m
p r o v i d e s an i n c o m p l e t e s o l u t i o n to the p r o b l e m
We have also not e n c o u n t e r e d in the m a t h e m a t i cal l i t e r a t u r e an a n a l y s i s of w h a t c o n s t i t u t e s
c o n v e n t i o n a l o r d e r i n g of e x p r e s s i o n s .
The
rules that p e o p l e i m p l i c i t l y use are a p p a r e n t ly not hard and fast ones.
For example,
x + e x seems not m u c h p r e f e r a b l e to e x + x.
In addition, c o n t e x t plays a role in m o d i f y i n g
very s t r o n g l y held views about o r d e r i n g of
expressions.
One w r i t e s am r a t h e r than m a
e x c e p t in cases like F = ma in w h i c h m is
r e l a t i v e l y c o n s t a n t and a varies.
We b e l i e v e that systems s h o u l d m a k e g r e a t er e f f o r t to a v o i d h i g h l y u n c o n v e n t i o n a l and
therefore confusing
o r d e r i n g of e x p r e s s i o n s
such as in sin(-x + 1)/2.
The f o l l o w i n g
d i s c u s s i o n is p r e s e n t e d w i t h that goal in mind.
We do not c l a i m that our d i s c u s s i o n of lexico ~
g r a p h i c o r d e r i n g is complete, or that a r a t h e r
d i f f e r e n t set of rules and p r i n c i p l e s w o u l d
not serve equally well to d e s c r i b e c o n v e n t i o n al m a t h e m a t i c a l notation.
If we have done our
job well, the r e a d e r w i l l not find m a n y surprises in our analysis.
D i f f i c u l t i e s in o r d e r i n g e x p r e s s i o n s
arise w h e n one deals w i t h c o m m u t a t i v e o p e r a tions.
The sole c o m m u t a t i v e o p e r a t o r s in m o s t
a l g e b r a i c m a n i p u l a t i o n systems are PLUS and
TIMES.
As a first a p p r o x i m a t i o n , the following p r i n c i p l e s apply to o r d e r i n g terms in a
sum and factors in a product.
P r i n c i p l e for o r d e r i n g products: F a c t o r s
i n c r e a s e in c o m p l e x i t y in a l e f t - t o - r i g h t
scan.
Examples:
2xe x,
2x2y3sin(y)
28.4
P r i n c i p l e for o r d e r i n g sums: Terms
d e c r e a s e in c o m p i e x i t y in a l e f t - t o - r i g h t scan.
Examples: 3x 2 + 5x - 6, 2x 2 - 3ax + a + 1
The p r i n c i p l e s stated above beg a definition of complexity.
A h a n d l e on such a
d e f i n i t i o n is o b t a i n e d by c l a s s i f y i n g expressions into three groups: constants, variables,
and functions.
C o n s t a n % s are less c o m p l e x
than v a r i a b l e s w h i c h are in turn less c o m p l e x
than functions of variables.
Simple constants
are either numbers or literals, w i t h numbers
less complex than literals (e.g., 2a, (3/2)~,
a + 1.4).
F u n c t i o n s of simple constants are
more complex than c o n s t a n t s (e.g., 3/2, 3~ea),
but less c o m p l e x than v a r i a b l e s (e.g., a3/2x).
The usual c o n v e n t i o n r e g a r d i n g literal
constants and v a r i a b l e s is that constants
occur early in the a l p h a b e t (e.g., a, b, c)
and v a r i a b l e s late in the a l p h a b e t (e.g., x,
y, z).
Letters in the m i d d l e of the a l p h a b e t
play m a n y roles, (e.g., f f r e q u e n t l y r e p r e s e n t s
a function, and n an integer) but they can be
considered, for our purposes, to be i n t e r m e d i ate b e t w e e n constants and variables.
Within
each class (i.e., constants, i n t e r m e d i a t e s,
and variables) a l p h a b e t i c o r d e r i n g appears to
d e t e r m i n e the complexity.
In products, literals early in the a l p h a b e t in each class have
the lowest c o m p l e x i t y rank.
This m e a n s that
literals in a p r o d u c t are o r d e r e d p u r e l y
a l p h a b e t i c a l l y (e.g., abxz, 2amn).
The comp l e x i t y rank w i t h i n each class is r e v e r s e d in
sums.
Thus we get x + y r a t h e r than y + x,
and x + a + b rather than x + b + a.
In sums,
moreover, the class rank is not a d h e r e d to
very strictly.
Thus, we f r e q u e n t l y see
a + b + x rather than x + a + b or 1 + x - y
rather than x - y + i.
Since a t t i t u d e s about
o r d e r i n g of p r o d u c t s are m o r e s t r i c t l y held
than those about sums, we shall confine m o s t
of our examples to products.
F u n c t i o n s of v a r i a b l e s are more c o m p l e x
than the v a r i a b l e s themselves.
However, in
products, p o s i t i v e integral powers of an
e x p r e s s i o n A possess the same rank as A (e.g.,
2
2
x y, x sln x).
In sums, a term h a v i n g a h i g h e r e x p o n e n t of
the m o s t c o m p l e x factor of an e x p r e s s i o n is
ranked higher than that expression, but
p o s s e s s e s the same rank r e l a t i v e to d i f f e r e n t
e x p r e s s i o n s (e.g.,
3x 2 + 2x,
x sin2x + x sin x).
One could rank the c o m p l e x i t y of the u s u a l
functions 3, but surely any such r a n k i n g m u s t
be s o m e w h a t arbitrary.
It seems that sin x
cos x is p r e f e r a b l e to cos x sin x, but is
sin x log x p r e f e r a b l e to log x sin x?
B e c a u s e of our g r o u p i n g convention, positive integer powers of v a r i a b l e s are ranked
lower than any other functions of v a r i a b l e s
(e.g.,
read: any f u n c t i o n of a g i v e n variable, say x,
is less c o m p l e x than any e x p r e s s i o n c o n t a i n i n g
a v a r i a b l e m o r e c o m p l e x than x.
U s i n g the
latter convention, the above e x a m p l e w o u l d be
written
2 x
x e y sin y.
E x p r e s s i o n s w h i c h are more i n v o l v e d than
the ones we have b e e n e x a m i n i n g up to now can
be ranked by a r e c u r s i v e test on their m o s t
complex subexpressions.
We do not wish to
give a d e t a i l e d d i s c u s s i o n of such a ranking
p r o c e d u r e b e c a u s e there does not seem to be
strong feeling about the o r d e r i n g of very
large or i n v o l v e d e x p r e s s i o n s e x c e p t w h e n
p a t t e r n s c l e a r l y appear among the s u b e x p r e s sions (e.g., polynomials, power series, F o u r i e r
series).
M o s t of the c o m m o n s i t u a t i o n s should
be h a n d l e d c o r r e c t l y by a r e c u r s i v e ranking
procedure, but the o r d e r i n g of some e x p r e s s i o n s
w o u l d involve g l o b a l p a t t e r n r e c o g n i t i o n w h i c h
is b e y o n d the c a p a b i l i t i e s of e x i s t i n g algebraic m a n i p u l a t i o n systems (e.g.,
(a + b)(a + ½ b ) ( a
+ ~b)(a
1
+ ~b)
).
There are a d d i t i o n a l c o n v e n t i o n s for
ordering expressions which algebraic manipulation systems should follow.
One rule involves
e l i m i n a t i n g the leading m i n u s sign in a sum.
Thus g i v e n an e x p r e s s i o n of the f o r m - A
+ B
one r e v e r s e s the terms to e l i m i n a t e the leading m i n u s sign (e.g., 1 - 2x rather than
-2x + i, y - x rather than -x + y).
One
could c o n c e i v a b l y extend the rule to include
sums with two or more terms, but the force of
the rule seems to d i m i n i s h c o n s i d e r a b l y with
an i n c r e a s e in the number of terms (e.g.,
-3x + 4y + 5z rather than 4y - 3x + 5z or
5z + 4y - 3x or 4y + 5z - 3x).
C o n v e n t i o n a l n o t a t i o n tends to avoid
the use of p a r e n t h e s e s in functions of a s i n g l e
a r g u m e n t (e.g., sin x, log 2).
As a r e s u l t of
this c o n v e n t i o n and also in order to avoid
c o n f u s i o n w i t h the scope of special signs such
as the square-root, i n t e g r a l and s u m m a t i o n
sign, one sometimes r e v e r s e s the normal order
(e.g., 2i/2 rather than 2/2 i, 3y sin a rather
than 3 sin(a)y).
This c o n v e n t i o n is not
crucial for a l g e b r a i c m a n i p u l a t i o n systems
since such systems rarely d i s p l a y e x p r e s s i o n s
w i t h ambiguous scopes of functions or signs.
The c o n s t a n t ~ has lower rank in products than literals w h i c h r e p r e s e n t angles
(e.g., 2~8 rather than 28~).
However, expressions w h i c h e v a l u a t e to integers or r a t i o n a l
numbers rank lower than ~ (e.g.,
3n+l.
--~---~ rather
,3n+l,
than ~t-~---)
).
Few c o n s t a n t s lead the c h a r m e d life of ~ as
e x e m p l i f i e d by the e x p r e s s i o n 2n~i8.
F r e q u e n t l y , c e r t a i n literals are used
as i m p l i c i t functions of other variables.
Such literals should be r a n k e d as functions.
This c o n v e n t i o n accounts for the s u b e x p r e s s i o n
y + x + 1 in y' + y + x + 1 = 0.
Some systems allow users to d e c l a r e
d e p e n d e n c i e s such as that of y on x in the
e x p r e s s i o n above.
One should extend this
m a c h i n e r y to allow users to o v e r r i d e the
c o n v e n t i o n a l c l a s s i f i c a t i o n of literals.
By
d e c l a r i n g m c o n s t a n t and a v a r i a b l e , one w o u l d
be able to--obtain the u s u a l f o r m u l a F=ma.
Our final remark a b o u t c o n v e n t i o n a l
o r d e r i n g regards instances of g e n e r a l patterns.
2 x
x ye sln y).
We b e l i e v e that this is a b e t t e r m o d e l of conv e n t i o n a l n o t a t i o n than an e x t e n s i o n of the
a l p h a b e t i c r a n k i n g of v a r i a b l e s w h i c h w o u l d
3. In PL/i F O R M A C [44], the f o l l o w i n g r a n k i n g
is e m p l o y e d in products; e X < e r f ( x ) < log(x) <
s i n ( x ) < c o s ( x ) < a t a n ( x ) < s i n h ( x ) < cosh(x) <
atanh(x) < x!
285
If one is g i v e n a g e n e r a l p a t t e r n of c e r t a i n
expressions, such as a + bi for c o m p l e x
numbers, then instances of that p a t t e r n will
follow the order g i v e n in the pattern, r a t h e r
than the u s u a l rules (e.g., -i + i r a t h e r than
i - i).
Systems should a c c o m m o d a t e d e f i n i t i o n s
of such patterns.
2.2
Substitution
Many
following
such as
as an Aid
which
have b e e n delayed).
A n o n - a r t i f i c i a l e x a m p l e of the use of
s u b s t i t u t i o n s w h i c h is b o r r o w e d from H e a r n
[19 ] is g i v e n in figure 2.
A t e c h n i c a l p r o b l e m arises w h e n one
m a k e s s u b s t i t u t i o n s for e x p r e s s i o n s other than
atomic or literal ones.
C o n s i d e r the p r o b l e m
of s u b s t i t u t i n g a for xy 2 in the e x p r e s s i o n
to C o m p r e h e n s i o n
symbolic calculations
form: One starts w i t h
23
x y .
take the
some e q u a t i o n s
Some p o s s i b l e
results
of this
substitution
are
23
i) x y
2 ) axy
3) a2/y.
y = g (x)
z = h(x)
f = x 2 + y2 + z 2
and e x p r e s s i o n s such as
5
i
E:
~
c.x
i=0
Later one s u b s t i t u t e s such e q u a t i o n s and
e x p r e s s i o n s into another e x p r e s s i o n such as
51~
2 + 2E 2
f3
Then one a t t e m p t s to s i m p l i f y the expression w h i c h results.
In this s e c t i o n we are
i n t e r e s t e d in the process of m a k i n g i n t e l l i g ible large e x p r e s s i o n s such as the one w h i c h
w o u l d r e s u l t if we p e r f o r m e d the s u b s t i t u t i o n s
and c a r r i e d out the d e r i v a t i v e s and e x p a n s i o n s
in the e x p r e s s i o n above.
F r e q u e n t l y , the process of s i m p l i f y i n g
large e x p r e s s i o n s involves a r e v e r s a l of the
process w h i c h led to the e x p r e s s i o n above.
That is, one s u b s t i t u t e s small e x p r e s s i o n s
(usually literals) for large s u b e x p r e s s i o n s
w h i c h occur m o r e than once in the expression.
The literals b e i n g s u b s t i t u t e d into the
e x p r e s s i o n act as names or labels for the
e x p r e s s i o n s that they replace.
This is the
same f u n c t i o n that f, y, and z had in forming
the e x p r e s s i o n above.
An a r t i f i c i a l e x a m p l e w h i c h points out
the v a l u e of s u b s t i t u t i o n to the c o m p r e h e n s i o n
of an e x p r e s s i o n occurs in [ 41].
The example
shows h o w to o b t a i n a c o m p a c t d e s c r i p t i o n of
the m a t r i x in figure i. We o b t a i n a h i e r a r c h i cal d e s c r i p t i o n by r e c o g n i z i n g p a t t e r n s in the
m a t r i x and p a t t e r n s in the m a t r i x of literals
that we substituted, etc.
We finally r e d u c e
the 64 c h a r a c t e r s in the o r i g i n a l m a t r i x to
35 c h a r a c t e r s in the final m a t r i x and all the
a s s o c i a t e d equations.
However, the h i e r a r c h i cal d e s c r i p t i o n seems to m a k e the s i m p l i f i e d
r e s u l t m u c h c l e a r e r than is i m p l i e d by the
ratio 35/64.
The process of finding those s u b e x p r e s sions w h i c h are good to replace u s u a l l y
involves some trial and error.
It is u s e f u l
to r e p l a c e s u b e x p r e s s i o n s w h i c h have some
m e a n i n g in the c o n t e x t of the problem.
In
such cases we need not r e q u i r e that the sube x p r e s s i o n s b e i n g r e p l a c e d o c c u r m o r e than
once in the expression.
B e y o n d such g e n e r a l ities, there does not seem to be m u c h one can
say at p r e s e n t w h i c h is f r e q u e n t l y u s e f u l in
the m a s s a g i n g process for large e x p r e s s i o n s .
We should note that one o f t e n c o m b i n e s subs t i t u t i o n w i t h other m a n i p u l a t i o n s
(e.g.,
c a r r y i n g out e x p a n s i o n s or d i f f e r e n t i a t i o n s
z86
One c a n n o t say that there is a "correct"
answer, b e c a u s e w h a t is a p p r o p r i a t e in one
c o n t e x t need not be a p p r o p r i a t e in another.
However, no system, u n t i l recently, gave the
user m u c h c h o i c e in the r e s u l t of s u b s t i t u t i o n .
The R E D U C E s y s t e m of H e a r n [18 ], has a good
deal of m a c h i n e r y for m a k i n g s u b s t i t u t i o n s ,
but it does not give the user m u c h c o n t r o l
over the effects of its s u b s t i t u t i o n s .
F a t e m a n [26 ] has r e c e n t l y a r r i v e d at the
f o l l o w i n g a n a l y s i s of the problem.
For simplicity, w e shall m a k e the a n a l y s i s for polynomials, but it can be e a s i l y e x t e n d e d to m o r e
complex expressions.
Let us suppose we are trying to substitute A for B in C.
We shall c o n s i d e r C to be
r e p r e s e n t e d as
n
Bi
i=0
Thus
the s u b s t i t u t i o n
n
will yield
i
c~iA
i=0
This r e p r e s e n t a t i o n of C is nonunique.
We
can m a k e the r e p r e s e n t a t i o n p r e c i s e by imposing c o n s t r a i n t s on the c o e f f i c i e n t s ~i.
Let
us assume that the v a r i a b l e s in B are r a n k e d
in some way.
Fateman's substitution programs
u s u a l l y p r o v i d e that the d e g r e e of the m a i n
v a r i a b l e of B is lower in each ~i than in B
itself.
In addition, one can r e s t r i c t the
c o e f f i c i e n t s to i) not c o n t a i n a sum, 2) be
p o l y n o m i a l s (and not rational), and 3) have
lower d e g r e e in all of the v a r i a b l e s of B than
the d e g r e e of those v a r i a b l e s in B.
By v a r y i n g these and other co n d i t i o n s ,
and by m o d i f y i n g the r a n k i n g of the v a r i a b l e s ,
one can get a v a r i e t y of results.
One can
then choose that r e s u l t w h i c h seems m o s t useful in the computation.
Some e x a m p l e s of s u b s t i t u t i o n m a d e w i t h
F a t e m a n ' s r o u t i n e s are g i v e n in figure 3.
In
each case we s u b s t i t u t e A for B in C.
The a b i l i t y of F a t e m a n ' s r o u t i n e s to
o b t a i n the results in the last four e x a m p l e s
is due to the t e c h n i q u e of c o n t i n u a l l y d i v i d ing C by B.
The last two e x a m p l e s i n d i c a t e
how this s u b s t i t u t i o n m e c h a n i s m p r o v i d e s for
the a p p l i c a t i o n of the o f t - d i s c u s s e d transformation
sin2(x)
+ cos2(x)
-- I.
One of the m o s t p o p u l a r uses of s u b s t i t u tion occurs in the d i f f e r e n t i a t i o n of products.
This kind of s u b s t i t u t i o n really a d d r e s s e s
itself to the p r o b l e m of d e c r e a s i n g the size
of an e x p r e s s i o n during a computation.
However, the t e c h n i q u e s used can effect an increase in the i n t e l l i g i b i l i t y of the final expression.
Moreover, these techniques are of
a fairly g e n e r a l nature, and can be used to
improve i n t e l l i g i b i l i t y in o t h e r cases.
C o n s i d e r the g e n e r a l form of the first
d e r i v a t i v e of a p r o d u c t of four factors f, g,
h, k:
does not d e c r e a s e the size of an expression.
However, it affords a simple way of b r e a k i n g
up the large p r o b l e m of a n a l y z i n g the w h o l e
e x p r e s s i o n into a number of smaller problems.
Success w i t h this t e c h n i q u e d e p e n d s on clever
d e c o m p o s i t i o n s of an expression.
Automatic
r o u t i n e s for i n t r o d u c i n g labels into expressions by Baker [43 ] and M a r t i n [ 24 ] cannot
be c o n s i d e r e d g r e a t successes.
At the p r e s e n t
time, we require an i n t e r a c t i n g user to b r e a k
the e x p r e s s i o n up into chunks w h i c h he can
c o n v e n i e n t l y m a n a g e and u s e f u l l y comprehend.
3.0
(fghk)'
= f'ghk + fg'hk + fgh'k + fghk'
In the g e n e r a l form f, g, h, and k each appear
three times.
In c e r t a i n cases the g e n e r a l
form will s i m p l i f y b e c a u s e f', g', h' or k'
may be 0.
F r e q u e n t l y this s i t u a t i o n w i l l not
occur.
In cases w h e r e f, g, h, and k are
complex expressions, c o n s i d e r a b l e savings in
space w i l l result if we use labels for the
factors w h i c h w o u l d appear in the d e r i v a t i v e .
A d i s a d v a n t a g e of labelling the factors is
that some s i m p l i f i c a t i o n s w h i c h w o u l d occur
due to the p r e s e n c e of the factor in the exp r e s s i o n w o u l d not occur w h e n its label is
used.
For example, the d i f f e r e n c e of a label
and the e x p r e s s i o n it is labelling is not
zero.
P r o b l e m s arise w h e n we have to take derivatives of labelled expressions.
We can use
the s tr a t e g y of not e v a l u a t i n g all d e r i v a t i v e s
of labels until some later time.
We m i g h t
wish to e v a l u a t e c e r t a i n d e r i v a t i v e s of labels
w h e n e v e r they occur by r e p l a c i n g the labels
by the e x p r e s s i o n s they represent.
Clearly,
several strategies are possible.
A technical
p r o b l e m here involves the ability of a
system to p r o d u c e the labelled e x p r e s s i o n s on
demand.
This can be done by s u b s t i t u t i o n s .
However, the f o l l o w i n g s t a t e m e n t in M A C S Y M A
[ 26] avoids m a k i n g e y p l i c i t s u b s t i t u t i o n s and
is very s e l e c t i v e in its effect.
The statement has the g e n e r a l form
WHEN conditional
A n inst a n c e
of such
W H E N SHOWF
DO label
a WHEN
= expression
statement
DO F = SIN(X/CCOS(X)
is
+ i).
As a r e s u l t of e x e c u t i n g such a statement, the
v a r i a b l e F w i l l appear as F inside e x p r e s s i o n s
as long as the v a r i a b l e SHOWF is FALSE.
When
SHOWF is c h a n g e d to TRUE then F will be replaced by the e x p r e s s i o n SIN(X)/(COS(X) + i)
when it is e n c o u n t e r e d in a computation.
When
SHOWF is c h a n g e d back to F A L S E all r e m a i n i n g
F's will appear as F once again.
In summary, the t e c h n i q u e of l a b e l l i n g
can be used w h e n e v e r an a l g o r i t h m tends to
d u p l i c a t e expressions.
The labelled expression yields to s t r u c t u r a l a n a l y s i s m o r e e a s i l y
than the e x p r e s s i o n it replaces.
However, the
t e c h n i q u e has its d r a w b a c k s since it p r e v e nt s
certain s i m p l i f i c a t i o n s from taking place.
A n o t h e r s i t u a t i o n w h e r e l a b e l l i n g can be
used occurs w h e n one is u n a b l e to d i s p l a y an
e x p r e s s i o n on one page.
S u p p o s e the expression is a sum.
Then one could r e p l a c e as m a n y
of the terms in the sum by labels as are needed to a l l o w the l a b e l l e d e x p r e s s i o n to be disp l a y e d in one page.
The labelled terms can
be d i s p l a y e d i n d e p e n d e n t l y .
This t e c h n i q u e
3.1.0
S i m p l i f i c a t i o n for the Sake of M a n i p u l a tion - W h a t Designers P r o v i d e
The P o l i t i c s
of S i m p l i f i c a t i o n
S i m p l i f i c a t i o n is such a central issue in
a l g e b r a i c m a n i p u l a t i o n that w h e n a d e s i g n e r
has d e c i d e d how he will r e p r e s e n t expressions,
what changes of r e p r e s e n t a t i o n his s y s t e m will
p e r f o r m a u t o m a t i c a l l y , w h i c h of these autom a t i c t r a n s f o r m a t i o n s he will let the user
o v e r r i d e and modify, and w h a t a d d i t i o n a l
facilities for s i m p l i f y i n g e x p r e s s i o n s his
system will have, there are few m a j o r decisions remaining.
As a result~ one can c l a s s i f y
a l g e b r a i c m a n i p u l a t i o n systems by their
a p p r o a c h to s i m p l i f i c a t i o n .
Four years ago, w h e n we last s u r v e y e d the
scene [29 ], we c l a s s i f i e d a l g e b r a i c m a n i p u l a tion systems into three categories: c o n s e r v a tives, liberals, and radicals.
In the m e a n time, there has been a slight change in the
c h a r a c t e r i s t i c s of some systems, and the
c h a r a c t e r i s t i c s of other systems have stabilized s u f f i c i e n t l y so that w e now claim the
entry of two new parties, namely, the new left
and the catholics.
The c l a s s i f i c a t i o n that we m a k e of systems is b a s e d on a single c r i t e r i o n - the
degree to w h i c h a s y s t e m insists on m a k i n g
a change of r e p r e s e n t a t i o n of an e x p r e s s i o n
g i v e n by a user.
A s y s t e m w h i c h insists on
r a d i c a l l y a l t e r i n g the form of an e x p r e s s i o n
in o r d e r to get it into its i n t e r n a l form is
called a radical one in our scheme.
A system
w h i c h is so u ~ l l i n g
to make an i n a p p r o p r i a t e
t r a n s f o r m a t i o n that it e s s e n t i a l l y forces a
user to p r o g r a m his own s i m p l i f i c a t i o n rules
is called a c o n s e r v a t i v e system.
A system
w h i c h will make certain t r a n s f o r m a t i o n s
a u t o m a t i c a l l y , but will leave others to the
d i s c r e t i o n of a user is called a liberal
system.
The new le~t is m a i n l y c o m p o s e d of
v a r i a t i o n s of old radical systems w h i c h give
c e r t a i n a d d i t i o n a l choices to a user.
Designers of c a t h o l i c systems see the m e r i t of each
of the other a p p r o a c h e s for some contexts.
They d e s i g n systems w h i c h offer s e v e r a l subsystems u s i n g d i f f e r e n t s i m p l i f i c a t i o n techniques, and let the user switch among them as
he pleases.
In the r e m a i n d e r of this section we shall
d e s c r i b e the facilities o f f e r e d by the different systems.
We shall then c o n s i d e r a m a j o r
p r o b l e m in the m a n i p u l a t i o n of e x p r e s s i o n s ,
that is, the tremendous g r o w t h in the size of
i n t e r m e d i a t e e x p r e s s i o n s in a c o m p u t a t i o n .
Finally, we shall c o n s i d e r the d e s i g n of simpl i f i c a t i o n a l g o r i t h m s based on c a n o n i c a l forms
w h i c h is the m o s t t h e o r e t i c a l topic in algebraic s i m p l i f i c a t i o n .
In r e a d i n g an essay such as this, the
reader should bear in m i n d that the author,
287
as an i n t e r e s t e d party, w i l l tend to bias the
d i s c u s s i o n toward his p o i n t of view.
Our
a t t i t u d e is best d e s c r i b e d as a c a t h o l i c one.
Such a p o s i t i o n means that we see the m e r i t
in the other a p p r o a c h e s for some situations.
However, it is p r o b a b l e that our d i s c u s s i o n
of any view other than our own w i l l be less
p o s i t i v e than that of a strong a d h e r e n t to
that view.
3.1.1
should almost never be expanded.
the i n t e g r a l of
(x + i) I000
w i t h r e s p e c t to x is t r i v i a l l y found if the
i n t e g r a n d is not expanded.
However, the
integral of the e x p a n d e d e x p r e s s i o n r e q u i r e s
more time and space, and the final r e s u l t
appears atrocious to the h u m a n eye unless the
p a t t e r n is recognized.
A s i m i l a r s i t u a t i o n occurs in r a d i c a l
r a t i o n a l f u n c t i o n systems.
The c a n o n i c a l repr e s e n t a t i o n in such systems is a q u o t i e n t of
a n u m e r a t o r w r i t t e n as a p o l y n o m i a l in canonical form and a d e n o m i n a t o r w h i c h is l i k e w i s e
w r i t t e n in c a n o n i c a l form.
One must, for the
sake of c a n o n i c a l n e s s , combine sums of q u o t i ents into a single q u o t i e n t and d i v i d e the
r e s u l t i n g n u m e r a t o r and d e n o m i n a t o r by their
g r e a t e s t c o m m o n divisor.
S u p p o s e we w a n t e d
the p a r t i a l f r a c t i o n d e c o m p o s i t i o n of
The Radicals
R a d i c a l systems can h a n d l e a single,
w e l l - d e f i n e d class of e x p r e s s i o n s (e.g., polynomials, r a t i o n a l functions, t r u n c a t e d p o w e r
series, t r u n c a t e d P o i s s o n series).
The exp r e s s i o n s in this class are r e p r e s e n t e d in a
c a n o n i c a l form.
That is, any two e q u i v a l e n t
e x p r e s s i o n s in the class are r e p r e s e n t e d in
a u n i q u e way internally.
This m e a n s that the
s y s t e m stands ready to m a k e a m a j o r c h a n g e
in the r e p r e s e n t a t i o n of an e x p r e s s i o n w r i t t e n
by a user in order to get that e x p r e s s i o n into
the i n t e r n a l c a n o n i c a l form.
The a d v a n t a g e
of this a p p r o a c h is that the task of the mani p u l a t o r y a l g o r i t h m s is w e l l - d e f i n e d and lends
itself to e f f i c i e n t i m p l e m e n t a t i o n .
Such
systems do not appear to have s p e c i a l i z e d
s i m p l i f i c a t i o n m a c h i n e r y since the p r o c e s s of
g e n e r a t i n g e x p r e s s i o n s in c a n o n i c a l form
w h i c h is a u t o m a t i c a l l y e m p l o y e d by the mani p u l a t o r y a l g o r i t h m s (e.g., addition, m u l t i plication, d i f f e r e n t i a t i o n ) is akin to simplification.
An e x p r e s s i o n w r i t t e n in its
c a n o n i c a l form is c o n s i d e r e d simplified, once
and for all time.
Any a t t e m p t to allow the
user to m o d i f y the r e p r e s e n t a t i o n of an exp r e s s i o n for his p r o b l e m w i l l likely cause a
d e c r e a s e in the e f f i c i e n c y of the m a n i p u l a t o r y
a l g o r i t h m s and is t h e r e f o r e e s c h e w e d or h i g h l y
d i s c o u r a g e d by radical designers.
E x c e l l e n t examples of radical systems are
p o l y n o m i a l m a n i p u l a t i o n systems.
One canonical r e p r e s e n t a t i o n of p o l y n o m i a l s is the
r e c u r s i v e r e p r e s e n t a t i o n used in Collins' PM
and SAC-I systems [ 9, i0 ].
One assumes a
ranking of the v a r i a b l e s such as x > y
> z.
The p o l y n o m i a l is c o n s i d e r e d as a p o l y n o m i a l
in the m a j o r v a r i a b l e w i t h c o e f f i c i e n t s w h i c h
are p o l y n o m i a l s in the other v a r i a b l e s and
w h i c h are t h e m s e l v e s r e p r e s e n t e d in this recursive form.
Thus
2x + 3
ix
sin X - e
+
-ix
- e
2i
).
Then s u b s t i t u t e y = e ix in the e x p r e s s i o n to
o b t a i n a r a t i o n a l e x p r e s s i o n in y.
Now consider i n t e g r a t i n g sin x cosl0x w i t h r e s p e c t
to x.
This becomes, after a p p r o p r i a t e translation,
as
(2z3)y + 5z2)x 2 +
3x
+
x
2
3x + 2
+ 2x + 6
The p r o b l e m is s t r a i g h t - f o r w a r d (in fact,
solved) if one leaves the e x p r e s s i o n as it
stands.
However, a r a d i c a l s y s t e m w o u l d first
combine the q u o t i e n t s and p r o c e e d to r e d e r i v e
the e x p r e s s i o n above.
One can c l a i m that r a d i c a l systems can
h a n d l e only a small s u b s e t of the e x p r e s s i o n s
that are c o m m o n l y found in a p p l i e d m a t h e m a t i c ~
However, t h e o r e t i c i a n s have b e e n c h i p p i n g
away at this p r o b l e m so that r a d i c a l systems
can now h a n d l e a w i d e v a r i e t y of e x p r e s s i o n s
which include exponentials, trigonometric
functions, roots of p o l y n o m i a l s , etc.
The
idea is to i n t r o d u c e labels for a m i n i m a l
n u m b e r of n o n r a t i o n a l e x p r e s s i o n s in such a
way that the l a b e l l e d e x p r e s s i o n is in canonical form.
(See s e c t i o n 3.3).
For example,
in order to deal w i t h r a t i o n a l f u n c t i o n s of
t r i g o n o m e t r i c functions in x one can represent sin x and cos x in the c o m p l e x e x p o n e n t i a l
form (e.g.,
+ 3y 2 + z 4 + 1
(3y 2 -
1
x2 + 2x + 5
3x2y 2 - 2x2yz 3 + 5x2z 2 + 4x - 6y3z + y3
w o u l d be r e p r e s e n t e d
For example,
/ i
(4)x
1
71
1 i0 1
TdY
((-6z + l)y 3 + 3y 2 + z 4 + I)
The o r i g i n a l p r o b l e m is trivial to integrate,
and p r o d u c e s a concise integral.
The translated p r o b l e m is m o r e e x p e n s i v e to solve and
the s o l u t i o n is not very c o m p r e h e n s i b l e .
This
t e c h n i q u e (or the s i m i l a r t e c h n i q u e of substituting
The other m a j o r r e p r e s e n t a t i o n of polynomials, p o p u l a r i z e d in the A L P A K s y s t e m of
B r o w n [ 3 ], is the e x p a n d e d r e p r e s e n t a t i o n .
The first p o l y n o m i a l is w r i t t e n in e x p a n d e d
form.
S i t u a t i o n s in w h i c h there is w i d e - s p r e a d
d i s a g r e e m e n t w i t h the r a d i c a l a p p r o a c h u s u a l l y
c o n c e r n e x p r e s s i o n s w h i c h o o n t a i n powers of
sums.
The radical systems w o u l d a u t o m a t i c a l l y
e x p a n d such e x p r e s s i o n s in order to put them
into the c a n o n i c a l form.
Other d e s i g n e r s
w o u l d c o m p l a i n that
1
y = tan ~x)
fits e m i n e n t l y into the r a d i c a l way of s o l v i n g
problems.
It has the a d v a n t a g e that it w i l l
w o r k and give some result w h e n less general,
m o r e h e u r i s t i c t e c h n i q u e s w i l l fail.
(x + i) I000
288
B e c a u s e the e x p r e s s i o n s and the m a n i p u l a tory a l g o r i t h m s of radical systems are so w e l l
defined, there is a g r e a t l i k e l i h o o d that
t h e o r e t i c a l r e s e a r c h will find ways to improve
the algorithms.
This has, in fact, been the
case.
M o s t of the m a j o r advances in a l g o r i t h m
d e s i g n in the field of a l g e b r a i c m a n i p u l a t i o n
such as in the g r e a t e s t common d i v i s o r algorithm, p o l y n o m i a l f a c t o r i z a t i o n , and integration, have a s s u m e d e x p r e s s i o n s r e p r e s e n t e d in
c a n o n i c a l form.
As a result, systems w h i c h
do not t r a n s f o r m e x p r e s s i o n s into a c a n o n i c a l
form do not b o a s t a l g o r i t h m s as p o w e r f u l or
e f f i c i e n t as those of r a d i c a l systems.
A radical system, in effect, forces a
user to tailor the p r o b l e m to fit the system.
W h e n such t a i l o r i n g is clearly out of the
question, the r a d i c a l s o l u t i o n is to b u i l d a
new s y s t e m e x p r e s s l y for the p r o b l e m or class
of p r o b l e m s that the user has.
This accounts
for the number of d i s t i n c t l y d i f f e r e n t r a d i c a l
systems w h i c h have b e e n w r i t t e n for d i f f e r e n t
p r o b l e m areas.
3.1.2
xe
x
+ x
e21Og y+x
as
where
y = e x, and
z = sin x.
The e x p r e s s i o n
e 2x + e x
x
e
~ + z
z
,
since
write
might
simplify
be e x p r e s s e d
y = e
2x
,
as
z = e
x
no a t t e m p t p r o b a b l y w o u l d be m a d e to
the e x p r e s s i o n in c a n o n i c a l form.
Some systems p e r m i t one to r e p r e s e n t nonr a t i o n a l e x p r e s s i o n s in a w a y s i m i l a r
2 x
to y e , and c o s ( a r c s i n
x)
to
/i-7.
L i b e r a l systems d i f f e r from r a d i c a l and
new left systems in several i m p o r t a n t ways. '
i)
E x p a n s i o n s are c a r r i e d out only if
the user so demands (new left systems,
of course, offer this feature also).
2)
Sums of q u o t i e n t s are never put over
a common d e n o m i n a t o r unless the user
forces such a t r a n s f o r m a t i o n , but even
if they were, the gcd c a n c e l l a t i o n s are
likely to be missed.
3)
E x p r e s s i o n s can u s u a l l y be r e p r e s e n t ed in "unsimplified" form.
That is,
l-sin(x) + 0.cos(x) can be r e p r e s e n t e d in
such systems.
This allows p a t t e r n s to be
represented.
Most m a n i p u l a t o r y algorithms
will, however, require that all their
arguments be simplified, thus d e s t r o y i n g
the patterns.
4)
N o n r a t i o n a l terms can be e x p r e s s e d
w i t h g r e a t ease.
Terms such as e x, x!,
and
n
i
c.x
i=0
be r e w r i t t e n
probably
The L i b e r a l s
Liberal systems rely on a very g e n e r a l
r e p r e s e n h a t i o n of e x p r e s s i o n s and use simplif i c a t i o n t r a n s f o r m a t i o n s w h i c h are close in
s p i r i t to the ones used in p a p e r - a n d - p e n c i l
calculations.
Liberal s i m p l i f i e r s p e r f o r m
the u s u a l s i m p l i f i c a t i o n s of c o l l e c t i n g terms
in sums and e x p o n e n t s in products, a p pl y i n g
the rules r e g a r d i n g 0 and i, and r e m o v i n g
r e d u n d a n t o p e r a t o r s (e.g., a + ( b + c ) - ~ a + b + c).
F r e q u e n t l y such systems will also know simpl i f i c a t i o n rules for c e r t a i n arguments of nonr a t i o n a l functions.
Thus sin 2~ m i g h t simplify to 0,
2
xy + x2z,
would
3.1.3
The New Left
The new left arose in r e s p o n s e to some of
the d i f f i c u l t i e s e x p e r i e n c e d with r a d i c a l
systems such as those caused by the a u t o m a t i c
e x p a n s i o n of expressions.
A new left s y s t e m
is u s u a l l y a r a t i o n a l f u n c t i o n s y s t e m w h i c h
does not n e c e s s a r i l y e x p a n d p r o d u c t s or integer powers of sums.
A new left s y s t e m w i l l
have all the usual m a c h i n e r y of a r a d i c a l
system, but the a l g o r i t h m s w i l l be g e n e r a l i z e d
to h a n d l e u n e x p a n d e d expressions.
The new
left thus s a c r i f i c e s c a n o n i c a l n e s s and some
of the w e l l - d e f i n e d n e s s of the m a n i p u l a t o r y
algorithms for the ability to solve some
problems more e f f i c i e n t l y than a r a d i c a l system would.
The user of a new left s y s t e m is
g ive n the ability to d e c i d e w h e n e x p a n s i o n is
m o s t appropriate, a facility w h i c h is, of
course, not p r e s e n t i~ a radical system.
Systems w h i c h allow u n e x p a n d e d terms in
an e x p r e s s i o n are Hearn's latest v e r s i o n of
Reduce [20 ], and the latest v e r s i o n of
A L T R A N [16 ].
A new left s y s t e m can u s u a l l y h a n d l e a
w i d e v a r i e t y of e x p r e s s i o n s w i t h g r e a t e r ease,
though w i t h less power, than a radical s y s t e m
using a c a n o n i c a l form.
The idea, once again,
is to use labels for n o n - r a t i o n a l expressions.
Thus
might
to that i n d i c a t e d above, but force e x p a n s i o n s
to be m a d e once the t r a n s l a t i o n pass is over.
Such systems should p r o b a b l y be c o n s i d e r e d to
be m o r e c a n o n i c a l than new leftish.
Examples
of these systems are Hearn's early v e r s i o n s
of Reduce [ 18 ], M A T H L A B ' s r a t i o n a l f u n c t i o n
s u b s y s t e m [ 23 ], and M A C S Y M A ' s r a t i o n a l function s u b s y s t e m [ 26 ].
i
w o u l d be e x p l i c i t l y p r e s e n t in the expression, and w o u l d not be r e p l a c e d by a label
w h e n e v e r they occurred.
5)
The r e p r e s e n t a t i o n is local in the
sense that a term sin(x) a p p e a r i n g in one
part of the e x p r e s s i o n can be m o d i f i e d
w i t h o u t a f f e c t i n g a sin(x) a p p e a r i n g in
another part of the expression.
The m a j o r d i s a d v a n t a g e a liberal s y s t e m
has r e l a t i v e to a radical or new left s y s t e m
is its inefficiency.
The r e p r e s e n t a t i o n of
i n f o r m a t i o n in a liberal s y s t e m m i g h t require
two or three times as m u c h space as in a
radical system, and m a n i p u l a t i o n s can be a
factor of ten slower (of course such figures
m i g h t i n c r e a s e or d e c r e a s e d e p e n d i n g
on the
situation).
The a d v a n t a g e claimed for liberal systems
is that one can express p r o b l e m s m o r e n a t u r a ~ y
for them than for radical or new left systems.
289
As was i n d i c a t e d in our d i s c u s s i o n of r a d i c a l
systems, c e r t a i n problems can be solved m o r e
e f f i c i e n t l y in the flexible e n v i r o n m e n t provid r
ed in liberal systems.
A liberal d e s i g n e r
wants to m i n i m i z e the t r a n s i t i o n from the
user's usual techniques.
He w o u l d pay relatively g r e a t a t t e n t i o n to m a k i n g his d i s p l a y e d
e x p r e s s i o n s i n t e l l i g i b l e to a user.
Radical
d e s i g n e r s are u s u a l l y i n t e r e s t e d in solving
large c o m p u t a t i o n a l p r o b l e m s of a s p e c i a l i z e d
nature.
New left d e s i g n e r s can be said to aim
for a large p r o p o r t i o n of the users of both
liberal and radical systems.
Such c o m p e t i t i o n
s h o u l d b e n e f i t all users.
M o s t liberal systems w i l l reorder terms
in sums and factors in p r o d u c t s b a s e d on
some l e x i c o g r a p h i c o r d e r i n g scheme.
As was
m e n t i o n e d in 2.2, such schemes f r e q u e n t l y produce r a t h e r u n n a t u r a l orderings.
Thus a user
w r i t i n g x + y + z + w can e x p e c t to g e t any
p e r m u t a t i o n of the terms as a response, depending on the n a t u r e of the o r d e r i n g b e i n g used.
Some systems, such as MATHLAB, m i n i m i z e the
use of s i m p l i f i c a t i o n of e x p r e s s i o n s p a r t l y
in order to avoid an u n n a t u r a l o r d e r i n g as
m u c h as possible.
O t h e r liberal systems do
not use a l e x i c o g r a p h i c o r d e r i n g at all, and
p r e f e r to use the o r d e r i n g o r i g i n a l l y p r e s e n t ed by the user.
Such an o r d e r i n g will, of
course, be m o d i f i e d w h e n the e x p r e s s i o n is
manipulated.
M a r t i n [ 25] used a u n i q u e hashcoding scheme w i t h w h i c h to tag e x p r e s s i o n s in
order to be able to r e c o g n i z e w h e n to c o l l e c t
terms or factors.
M a r t i n ' s h a s h - c o d e was
p o w e r f u l enough to r e c o g n i z e many identities.
However, the cost of h a s h - c o d i n g , and the fact
that o r d e r e d e x p r e s s i o n s can be m a n i p u l a t e d
m o r e e f f i c i e n t l y than u n o r d e r e d ones, p r o b a b l y
led to some i n e f f i c i e n c y in his system.
M a r t i n ' s hash code a s s i g n e d to an algebraic e x p r e s s i o n an e l e m e n t in the finite
field formed by the integers m o d u l o some large
prime.
The p r i m e was c h o s e n so that c e r t a i n
e l e m e n t s in the field had u s e f u l p r o p e r t i e s .
For example, one e l e m e n t acted like i since
its square was -i.
G i v e n r a n d o m values for
the v a r i a b l e s , the hash code a s s i g n e d numbers
to e x p r e s s i o n s so that e q u i v a l e n t e x p r e s s i o n s
u s u a l l y had the same code.
Due to the finiteness of the f i e l d # n o n - e q u i v a l e n t e x p r e s s i o n s
could be a s s i g n e d the same code, but the
p r o b a b i l i t y of this event is e x t r e m e l y low.
M a r t i n ' s hash code was u t i l i z e d in an
e x p e r i m e n t a l p r o g r a m d e s i g n e d to teach
f r e s h m e n how to i n t e g r a t e s y m b o l i c a l l y [ 31 ].
A n o t h e r t e c h n i q u e due to O l d e h o e f t [ 33 ], was
also i n t e n d e d for a CAI e n v i r o n m e n t .
Oldehoeft
e x a m i n e d the p r o b l e m s a s s o c i a t e d w i t h determ i n i n g the e q u i v a l e n c e of e x p r e s s i o n s by evaluating them at r a n d o m points.
He d i s c u s s e s
p r o b l e m s due to r o u n d - o f t overflow, a c c i d e n t a l
c o i n c i d e n c e and the effects of d e a l i n g w i t h
n o n - a n a l y t i c functions (e.g., a b s o l u t e value).
S i m p l i f i c a t i o n in liberal systems is performed by a p r o g r a m u s u a l l y called the simplifier.
Some of the e a r l i e s t p r o j e c t s in
a l g e b r a i c m a n i p u l a t i o n i n v o l v e d the d e s i g n of
liberal simplifiers.
The e a r l i e s t s i m p l i f i e r
was w r i t t e n in the LISP A s s e m b l y P r o g r a m by
G o l d b e r g in 1959 [ 15 ], and was used in Slagle%
S y m b o l i c A u t o m a t i c I n t e g r a t o r (SAINT) [ 42 ].
Other L i S P - b a s e d s i m p l i f i e r s w e r e w r i t t e n by
Hart (1961) [ 17 ], R u s s e l l and W o o l d r i d g e
(1963) [ 47 ], and K o r s v o l d (1965) [ 22 ].
The
K o r s v o l d s i m p l i f i e r is used in M A T H L A B and in
SCRATCHPAD [ 2 ] • A highly modified version
of it is also used in MACSYMA.
The F O R M A C
system's s i m p l i f i e r is c a l l e d AUTSIM.
The
p h i l o s o p h y b e h i n d A U T S I M is g i v e n in [ 45].
L i b e r a l systems offer a user the ability
to a f f e c t the r e p r e s e n t a t i o n of e x p r e s s i o n s
through two kinds of m e c h a n i s m s .
One w a y of
c h a n g i n g the e x p r e s s i o n is by using commands
(such as E X P A N D in F O R M A C or MACSYMA) to perform the t r a n s f o r m a t i o n .
A n o t h e r w a y is to
m o d i f y c e r t a i n switches w h o s e v a l u e the simplifier checks to g u i d e its operation.
A
s w i t c h m i g h t d e t e r m i n e if a f u n c t i o n such as
log s h o u l d e v a l u a t e to a f l o a t i n g p o i n t n u m b e r
if its a r g u m e n t is a number.
Another switch
m i g h t d e t e r m i n e if c e r t a i n i n d i c a t e d o p e r a tions such as d i f f e r e n t i a t i o n should, in fact,
be c a r r i e d out.
This last e x a m p l e is not
s t r i c t l y an e x a m p l e of s i m p l i f i c a t i o n ; however,
it does p o i n t out the fact that a s i m p l i f i e r
is close to b e i n g the h e a r t of a system.
3.1.4
The C o n s e r v a t i v e s
D e s i g n e r s of c o n s e r v a t i v e systems c l a i m
that one cannot d e s i g n s i m p l i f i c a t i o n rules
w h i c h w i l l be b e s t for all o c c a s s i o n s .
Therefore, c o n s e r v a t i v e systems p r o v i d e little
automatic simplification capabilities.
RatheD
they p r o v i d e m a c h i n e r y w h e r e b y a user can
b u i l d his own s i m p l i f i e r and c h a n g e it w h e n
necessary.
A s i m p l i f i e r w r i t t e n in such a
w a y is far slower than a liberal si m p l i f i e r ,
and this fact p r e s e n t s a d i s t i n c t d i s a d v a n t a g e
for c o n s e r v a t i v e systems.
In fact, one can
p o i n t to only two m a j o r c o n s e r v a t i v e systems,
F e n i c h e l ' s F A M O U S [ 14 ], and F O R M U L A A L G O L [34].
The i m p o r t a n c e of c o n s e r v a t i v e systems
lies in the p h i l o s o p h y they represent, w h i c h
is m o s t clearly g i v e n by F e n i c h e l [14 ], and
in the t e c h n i q u e w h i c h they c h a m p i o n of using
rules and advice to d e s c r i b e s i m p l i f i c a t i o n
transformations.
Their p h i l o s o p h y p r e s e n t s
an i n d i c t m e n t of all the other systems w h i c h
p e r f o r m many s i m p l i f i c a t i o n t r a n s f o r m a t i o n s
automatically, without seriously considering
the context.
D e s i g n e r s of c o n s e r v a t i v e
systems e m p h a s i z e that the s i m p l i f i e d form of
an e x p r e s s i o n is d e t e r m i n e d by context.
They
w i l l p o i n t to s i t u a t i o n s w h e r e even the m o s t
o b v i o u s t r a n s f o r m a t i o n s 0"x ~ 0 and l'x 4 x
w i l l d e s t r o y u s e f u l i n f o r m a % i o n as in the
pattern
0-sin x + l'cos x + 2-tan x + 3-cot x
+ 4.sec x + 5 . c s c x
Therefore, they c l a i m that one m u s t be able to
tune the s y s t e m to the p a r t i c u l a r n a t u r e of
the problem.
The p r e f e r r e d t e c h n i q u e of
"tuning" is b a s e d on the t h e o r e t i c a l c o n c e p t
of M a r k o v algorithms.
In a M a r k o v a l g o r i t h m
one is g i v e n an o r d e r e d set of rules to apply
to an e x p r e s s i o n .
Each rule has the form:
Pattern
4 Replacement.
For example, one such
expressions mightbe
A ' X + B'X ~
rule
applied
to algebraic
(A + B)-X
To m a k e such a rule c o r r e s p o n d to the u s u a l
n o t i o n of " c o l l e c t i n g like terms," one w o u l d
w a n t to r e s t r i c t A and B to be numbers, w h i l e
X c o u l d r e p r e s e n t any p r o d u c t of factors
other than numbers.
The rule just g i v e n does
z9o
not n e c e s s a r i l y y i e l d a s i m p l i f i e d r e s u l t in
cases such as 2-X + (-i)-X ~ 1-X.
One should
apply a w h o l e set of rules to the r e p l a c e d
expression.
Only w h e n no rule is a p p l i c a b l e
to a g i v e n e x p r e s s i o n is the a l g o r i t h m compete.
C o n s e r v a t i v e systems offer v a r i a t i o n s of
the M a r k o v a l g o r i t h m t e c h n i q u e w i t h w h i c h a
user can g e n e r a t e his own s i m p l i f i c a t i o n and
m a n i p u l a t o r y algorithms.
Such rules are m o s t
easily w r i t t e n w h e n m a k i n g local t r a n s f o r m a tions of an e x p r e s s i o n 4.
One w o u l d not w i s h
to w r i t e a f a c t o r i n g p r o g r a m as a M a r k o v
algorithm.
C o n s e r v a t i v e systems have tended
to mod e l liberal systems rather than radical
ones, since the latter s p e c i a l i z e in g l o b a l
t r a n s f o r m a t i o n of an expression.
Several d e s i g n e r s have added a c a p a b i l i t y
for w r i t i n g M a r k o v a l g o r i t h m s to their systems,
thus a l l o w i n g their systems to take on various
degrees of conservatism.
The m a i n use of
rules in such systems has been to add new
simplification transformations
(e.g.,
cos n~ ~ (-l)n), rather than to o v e r r i d e old
transformations.
Thus a user of R E D U C E can
define the s i m p l i f i c a t i o n rules r e l a t i n g to
g e n e r a l e x p o n e n t i a t i o n (e.g.,
xY.x z ~ x y+z
d i s a d v a n t a g e of a c a t h o l i c o r g a n i z a t i o n is i S
size.
A c a t h o l i c system is n e c e s s a r i l y larger
than any other type of svstem.
The v a r i e t y of
the services p r o v i d e d by the s y s t e m may force
users to learn a larger n u m b e r of c o n v e n t i o n s
than in other systems.
A catholic designer
may also impose a number of s y s t e m - w i d e conv e n t i o n s (e.g., on the data representation)
w h i c h w o u l d not be p r e s e n t in a smaller system.
Such c o n v e n t i o n s m i g h t slow down all of the
c o m p o n e n t systems.
A c a t h o l i c o r g a n i z a t i o n is only one way
to o b t a i n the a d v a n t a g e s of the conservative,
liberal, and r a d i c a l approaches to s i m p l i f i c a tion.
A s y s t e m such as REDUCE, can be v i e w e d
as a c o m p r o m i s e s y s t e m o f f e r i n g many of these
advantages.
REDUCE, however, uses only a
single r e p r e s e n t a t i o n .
R a d i c a l systems, as
we noted earlier, use d i f f e r e n t r e p r e s e n t a t i o n s
for e x p r e s s i o n s w h i c h occur in d i f f e r e n t problem areas (e.g., p o l y n o m i a l s and t r u n c a t e d
P o i s s o n series).
W h i l e it is a d v i s a b l e to
limit the number of d i s t i n c t r e p r e s e n t a t i o n s
as much as possible, it appears likely that a
system w h i c h tries to handle a large number of
a p p l i c a t i o n s e f f i c i e n t l y will r e q u i r e several
representations.
~ d e s i g n e r of a c a t h o l i c
s y s t e m is w i l l i n g to accept such a situation.
Other d e s i g n e r s m i g h t not be so willing.
),
althou g h he cannot o v e r r i d e x 0 4 i.
Korsvold's
s i m p l i f i e r and M A C S Y M A ' s p a t t e r n m a t c h i n g subsystem [ 13] also allow one to d e f i n e s i m p l i f ication rules.
The latter allows one to override many of the b u i l t - i n rules.
It also
p rovid e s for the c o m p i l a t i o n of new rules
w hich should y i e l d a r e l a t i v e l y e f f i c i e n t
simplifier.
3.1.5
3.2
The Catholics
C a t h o l i c systems use m o r e than one represe n t a t i o n for expressions, and have m o r e than
one ap p r o a c h to s i m p l i f i c a t i o n .
The b a s i c
idea u n d e r l y i n g c a t h o l i c i s m is that if one
technique does not work, another might, and
the user should be able to switch from one
r e p r e s e n t a t i o n and its r e l a t e d s i m p l i f i c a t i o n
facilities to another w i t h ease.
A catholic
s y s t e m m i g h t use a liberal s i m p l i f i e r for
most calculations, and have a radical subsystem in reserve for p e r f o r m i n g special calculations such as c o m b i n i n g quotients, solving
linear equations w i t h r a t i o n a l c o e f f i c i e n t s ,
and f a c t o r i z a t i o n .
The M A T H L A B s y s t e m is best
d e s c r i b e d in this fashion.
The M A C S Y M A
system goes further in that it allows the user
to m a n i p u l a t e e n t i r e l y with a radical r a t i o n a l
f uncti o n subsystem, as well as with a liberalradical c o m b i n a t i o n as just described.
In
addition, MACSYMA, as p o i n t e d out in 3.1.4,
has a r u l e - d e f i n i n g facility w h i c h allows it
to closely a p p r o x i m a t e a c o n s e r v a t i v e system.
The S C R A T C H P A D s y s t e m is a c o n g l o m e r a t e m a d e
up of several L I S P - b a s e d systems.
It has a
total of four simplifiers.
C a t h o l i c systems e m p h a s i z e the range of
problems that can be solved by them.
They
w o u l d like to give a user the ease of w o r k i n g
with a liberal system, the e f f i c i e n c y and
power of a radical system, and the a t t e n t i o n
to context of a c o n s e r v a t i v e system.
The
4. The author begs for f o r g i v e n e s s of the
r e a d e r for not d e f i n i n g "local".
That c o n c e p t
tends to be as c o n t e x t d e p e n d e n t as the concept of s i m p l i f i c a t i o n .
However, see [ 27 ].
Intermediate
Expression
Swell
Users of n u m e r i c a l analysis p r o g r a m s have
learned to a n t i c i p a t e p r o b l e m s due to roundoff errors.
Users of s y m b o l i c m a n i p u l a t i o n
p r o g r a m s have e n c o u n t e r e d a c o r r e s p o n d i n g
p r o b l e m in the tremendous g r o w t h of i n t e r m e d iate e x p r e s s i o n s in some calculations.
Such
g r o w t h has caused many c a l c u l a t i o n s to be
aborted b e c a u s e the e x p r e s s i o n s filled the
a v a i l a b l e c o m p u t e r memory.
Tobey has d e s c r i b ed this p h e n o m e n o n w i t h the c o l o r f u l phrase
" i n t e r m e d i a t e e x p r e s s i o n swell" [43 ].
In
many cases the final r e s u l t of a s y m b o l i c calc u l a t i o n is quite small, but in order to get
that r e s u l t one finds oneself g e n e r a t i n g very
large i n t e r m e d i a t e expressions.
For example,
the e i g e n v a l u e of a m a t r i x w i t h p o l y n o m i a l
entries can be as simple as a single number.
However, in order to obtain that number, one
is forced to factor a p o l y n o m i a l w i t h p o ly n o m ials as coefficients.
These c o e f f i c i e n t s m i g h t
be o b t a i n e d from the d e t e r m i n a n t of the matrix,
w h i c h can be several pages long.
I n t e r m e d i a t e e x p r e s s i o n s swell can be
caused by several d i f f e r e n t phenomena.
In
some cases, the p r o b l e m the user is trying to
solve is i n h e r e n t l y explosive, and it is
likely that no g e n e r a l m e t h o d will d e c r e a s e
the size of the i n t e r m e d i a t e expressions.
We
claim that such a s i t u a t i o n exists w h e n one
tries to solve systems of s i m u l t a n e o u s p o l y n o m ial e q u a t i o n s by e l i m i n a t i n g v a r i a b l e s [28 ].
The number of solutions to such systems can
be as high as the p r o d u c t of the degrees of
each polynomial.
If the i n t e r m e d i a t e e q u a t i o n s
do not factor, as is likely to be the case,
one is forced to g e n e r a t e a p o l y n o m i a l of very
high d e g r e e w h i c h w o u l d be very hard to solve
n u m e r i c a l l y for all its roots.
In c e r t a i n other cases, the p a r t i c u l a r
a l g o r i t h m that the user, in c o m b i n a t i o n w i t h
the system, has chosen for solving a problem,
is bad and a r a d i c a l l y d i f f e r e n t a p p r o a c h is
necessary.
For example, the r e c e n t l y d e v e l o p ed m o d u l a r a l g o r i t h m for c o m p u t i n g the g r e a t e s t
291
c o m m o n divisor of two p o l y n o m i a l s [ 3 ] is a
r a d i c a l l y d i f f e r e n t and m u c h more e f f i c i e n t
a l g o r i t h m than any of the p r e v i o u s algorithms.
M a j o r changes in a l g o r i t h m d e s i g n u s u a l l y requi r e e x t e n s i v e analysis so that one c a n n o t
make such m o d i f i c a t i o n s on a regular basis.
C e r t a i n l y it is not very fruitful to c o n s i d e r
such m o d i f i c a t i o n s as a task of a l g e b r a i c
simplification.
The final set of cases w h i c h we shall
c o n s i d e r is w h e n small changes in the s e q u e n c e
of steps cause a n o n t r i v i a l i m p r o v e m e n t in the
u t i l i z a t i o n of space and time.
We have already m e n t i o n e d the idea of labelling subexp r e s s i o n s w h i c h w o u l d tend to be r e p e a t e d in
a calculation.
S o m e t i m e s one can apply one's
k n o w l e d g e of s u b s e q u e n t steps in a c a l c u l a t i o n
in order to keep e x p r e s s i o n s in a form w h i c h
w i l l m a x i m i z e u t i l i z a t i o n of space and time.
At the h e a r t of Collins' first i m p r o v e m e n t
to the E u c l i d e a n GCD a l g o r i t h m [ ll] was the
idea that one could p r e d i c t how c e r t a i n terms
w e r e a u t o m a t i c a l l y i n t r o d u c e d into the interm e d i a t e expressions, and t h e r e f o r e these terms
could be c a n c e l l e d w i t h o u t a f f e c t i n g the final
result.
B e f o r e the a p p e a r a n c e of this algorithm, several people, i n c l u d i n g this author,
t h o u g h t that the size of the c o e f f i c i e n t s in
the i n t e r m e d i a t e steps of the a l g o r i t h m had
to grow e x p o n e n t i a l l y .
Collins s h o w e d that
they need g r o w only linearly!
Of course, results such as Collins' w o u l d
not be e x p e c t e d from the a v e r a g e user;
however, i m p r o v e m e n t s of a s i m i l a r n a t u r e can be
m a d e in m a n y a p p l i c a t i o n s of a l g e b r a i c m a n i p u lation.
For example, c o n s i d e r
n
y = ~ x
i=l
i
,
w h i c h is an a p p r o x i m a t i o n
you w a n t e d
x
for i - ~
"
Suppose
n
E yJ
j=0
The s t r a i g h t - f o r w a r d a p p l i c a t i o n o f e x p a n s i o n
in the l~tter sum w o u l d y i e l d a p o l y n o m i a l of
d e g r e e n ~.
However, since y is only a c c u r a t e
to d e g r e e n, all powers of x g r e a t e r than n
are w o r t h l e s s .
W h a t is called for is a
t r u n c a t i o n in the e x p a n s i o n of powers g r e a t e r
than n.
Systems w h i c h allow the user to
specify t r u n c a t i o n (e.g., by d e c l a r i n g x m = 0
for m > n), can p r o b a b l y save factors of i00
or I000 in speed for n = 20 [ 12].
3.3
C a n o n i c a l S i m p l i f i c a t i o n and T h e o r e t i c a l
Results - The Radicals R e v i s i t e d
In this s e c t i o n we shall discuss m o s t of
the t h e o r e t i c a l results r e l a t e d to a l g e b r a i c
simplification.
The a l g o r i t h m s we shall describe are either c a n o n i c a l or else possess a
strong property, n a m e l y that they can d e t e r m i n e if an e x p r e s s i o n is e q u i v a l e n t to zero.
A l m o s t all of the a l g o r i t h m s are i n c o m p l e t e in
the sense that they d e p e n d on, as yet, unproved c o n j e c t u r e s a b o u t e x p r e s s i o n s i n v o l v i n g
constants.
For example, the c o n j e c t u r e by
B r o w n [ 4 ] has, as a special case, the statem e n t that e + n is not a r a t i o n a l number.
That s t a t e m e n t is almost c e r t a i n l y true, but
no proof of it exists, and c e r t a i n l y none
exists of the full conjecture.
Even if the
c o n j e c t u r e w e r e false, the average user will
p r o b a b l y never o b t a i n i n c o r r e c t results from
these algorithms.
All of the results deal with w e l l - d e f i n e d
classes of e x p r e s s i o n s w h i c h are e x t e n s i o n s of
p o l y n o m i a l s or r a t i o n a l functions.
Some deal
w i t h e x p o n e n t i a l s , others with both e x p o n e n tials and logarithms, and still others w i t h
roots of p o l y n o m i a l s .
We shall also discuss
a n e g a t i v e result, due to R i c h a r d s o n , w h i c h
says that w h e n one d e a l s w i t h e x p r e s s i o n s inv o l v i n g the e x p o n e n t i a l and a b s o l u t e v a l u e
functions, then one cannot, in general, tell
w h e t h e r such e x p r e s s i o n s are e q u i v a l e n t to
zero.
3.3.1
S i m p l i f i c a t i o n A l ~ o r i t h m s for E x p r e s sions w i t h N e s t e d E x p o n e n t i a l s
In [ 4 ] B r o w n d e s c r i b e s a s i m p l i f i c a t i o n
a l g o r i t h m for a class of e x p r e s s i o n s he calls
R a t i o n a l E X p o n e n t i a l (REX) e x p r e s s i o n s .
REX
e x p r e s s i o n s are o b t a i n e d r e c u r s i v e l y from the
r a t i o n a l numbers, i, and n, and the v a r i a b l e s
Xl,X2, ... ,x n by the r a t i o n a l o p e r a t i o n s of
addition, s u b t r a c t i o n , m u l t i p l i c a t i o n and
d i v i s i o n and by forming e x p o n e n t i a l s of existing REX.
Thus the e x p r e s s i o n
e
e
5x
~
+
3e2X
+ xe
4el+l
is a REX e x p r e s s i o n if we agree to w r i t e x for
x I w h e n only one v a r i a b l e occurs.
Brown's
a l g o r i t h m m a k e s use of the t e c h n i q u e f r e q u e n t ly m e n t i o n e d in this paper of s u b s t i t u t i n g
labels for e x p o n e n t i a l s in o r d e r to r e d u c e an
REX e x p r e s s i o n to a r a t i o n a l e x p r e s s i o n in
the v a r i a b l e s and the labels.
The m a j o r simpl i f i c a t i o n w o r k in the a l g o r i t h m o c c u r s w h e n
the r e s u l t i n g r a t i o n a l e x p r e s s i o n is transformed into a c a n o n i c a l form.
We shall see,
however, that Brown's a l g o r i t h m is not canonical (i.e., it does not always r e d u c e equivalent e x p r e s s i o n s into the same form).
It is
powerful, though, since if we a s s u m e a c e r t a i n
conjecture, then we can p r o v e that the algorithm s i m p l i f i e s any REX e x p r e s s i o n e q u i v a l e n t
to 0 into 0.
Thus the a l g o r i t h m can d e t e r m i n e
if any two REX e x p r e s s i o n s are e q u i v a l e n t .
It
should be n o t e d that since the c o n s t a n t s i and
are included, the REX e x p r e s s i o n s c o n t a i n
the t r i g o n o m e t r i c and h y p e r b o l i c f u n c t i o n s in
e x p o n e n t i a l form.
In g e n e r a t i n g labels for the a l g o r i t h m s
one m u s t pay g r e a t a t t e n t i o n not to a l l o w
a l g e b r a i c a l l y d e p e n d e n t e x p o n e n t i a l s to be
a s s i g n e d to d i f f e r e n t labels.
Two e x p r e s s i o n s
are a l g e b r a i c a l l y d e p e n d e n t (over the rational~
if there exists a n o n z e r o p o l y n o m i a l w i t h
r a t i o n a l c o e f f i c i e n t s in these e x p r e s s i o n s
w h i c h is e q u i v a l e n t to 0. Thus,
e
x
and e
2x
are a l g e b r a i c a l l y
dependent
since
(eX) 2 - e 2x = 0.
Likewise,
e x , ex
taken
292
2
x+x 2
, and e
together
are a l g e b r a i c a l l y
dependent.
Our labelling
assign
y = e
x
scheme must
be
such
that
if w e
we had originally.
Brown's conjecture
,
{ql'q2 .....
.
2
then e
is a s s i g n e d y .
T h e a l g o r i t h m p r o c e e d s b y r e p l a c i n g innerm o s t e x p o n e n t i a l s in t h e e x p r e s s i o n s b y l a b e l s ,
if s u c h e x p o n e n t i a l s a r e n o t a l g e b r a i c a l l y
dependent on previously replaced exponentials.
T h e a l g e b r a i c d e p e n d e n c y is d e t e r m i n e d w i t h
the h e l p of t h e c o n j e c t u r e b y t e s t i n g w h e t h e r
the a r g u m e n t (of t h e e x p o n e n t i a l f u n c t i o n )
b e i n g e x a m i n e d is l i n e a r l y d e p e n d e n t o n p r e vious arguments.
T h e f o l l o w i n g is a s i m p l e
e x a m p l e of the p r o c e d u r e , a n d i n c i d e n t a l l y
s h o w s its s i m p l i f y i n g p o w e r .
Suppose we are given the REX expression
qk'
is t h a t
if
i~}
2x
is l i n e a r l y
numbers,
[eql,eq2
ql = x and r I = e
ql
= e
left
x
,
,e
...
to r i g h t ,
e
2x
+ e
e
,Xn,~ }
X
N o w q2 = x,
rI + x
+ 2xr I + x
...
x
L e t q l = 2x,
2x
the r a t i o n a l
,Xl,X2,
.
T h u s o u r f i r s t l a b e l is r i.
By substituting
it i n t o the e x p r e s s i o n w e o b t a i n
e
qk
over
is a l g e b r a i c a l l y i n d e p e n d e n t o v e r the r a t i o n al n u m b e r s .
U s i n g the c o n j e c t u r e , B r o w n c a n
easily prove that the only simplified REX
e x p r e s s i o n e q u i v a l e n t to 0 is 0 i t s e l f .
Note
that since 1 and i~ are linearly independent,
the c o n j e c t u r e s t a t e s t h a t e I a n d 17 a r e
algebraically independent, a statement which
is s t r o n g e r t h a n the s t a t e m e n t "e + ~ is n o t
a rational number."
A n i m p o r t a n t a s p e c t of t h e a l g o r i t h m is
the r e t r a c i n g of s t e p s o n e m u s t g o t h r o u g h
in s o m e c a s e s .
Consider
x
e
+ x
2x
e
+ 2xe x + x 2
Traversing the numerator from
w e f i r s t e n c o u n t e r e x.
Let
independent
rI = e
ql
r 2 = e x,
= e
2x
a n d q2 = 1/2 ql"
W e c a n n o t l e t r^ = r. I/2 s i n c e w e w a n t to
obtaln ratlonal results.
So w e r e d e f i n e r I as
2
2
r2
B y t r e a t i n g e 2x as an i n d e p e n d e n t v a r i a b l e
in t h e e x p r e s s i o n a b o v e , w e c a n try f o r a
s i m p l i f i c a t i o n b y d e t e r m i n i n g the g r e a t e s t
c o m m o n d i v i s o r of b o t h n u m e r a t o r a n d d e n o m i n ator.
H o w e v e r , t h a t a t t e m p t is u n s u c c e s s f u l
in r e d u c i n g t h e e x p r e s s i o n a n d w e c o n t i n u e
generating labels.
W e n e x t e n c o u n t e r the
e x p o n e n t i a l e 2x.
Let
q2 = 2x,
r2 = e
q2
= e
and obtain
2
r2
- r
+ 1 = eX + 1
2
B r o w n ' s a l g o r i t h m is n o t c a n o n i c a l b e c a u s e
the a l g o r i t h m d o e s n o t m a k e an o p t i m a l c h o i c e
for labels.
Consider
2x
N o w c h e c k to s e e if a l i n e a r d e p e n d e n c e e x i s t s
b e t w e e n ql a n d q 2 (and a l s o w i t h i~, it t u r n s
out).
Such a relation does exist, since
e
q l - 2q2 = 0.
Therefore,
+ r2
r2
x+x 2
e
X
redefine
Let ql = x + x
2
, rI = e
x+x
2
' q2 = x,
r2 = e
x
.
2
r2 = r1
and by
substitution
N o t e t h a t {ql' qo, i~} is l i n e a r l y i n d e p e n d e n t
over the rational numbers.
T h u s {rl, r2, x , ~ ]
is a l g e b r a i c a l l y
i n d e p e n d e n t by t h e c o n 3 e c t u r ~ .
Furthermore,
obtain
rI + x
rI
2
+ 2xr I + x
Simplifying
function reduces
2
r1
the a b o v e
it to
r2
as a r a t i o n a l
is s i m p l i f i e d as a r a t i o n a l
the s i m p l i f i e d r e s u l t is
1
rI + x
S i n c e no m o r e e x p o n e n t i a l s a r e to be
f o u n d , r e p l a c e the l a b e l s b y the e x p o n e n t i a l s .
T h e r e s u l t is
e
x+x
e
which
expression.
Hence,
2
x
differs
2
from
the e q u i v a l e n t
expression
ex
X
e
which
+
x
is i n d e e d
simpler
than
the e x p r e s s i o n
w h i c h is a l s o s i m p l i f i e d .
not canonical.
Z93
S o the
algorithm
is
Brown's a l g o r i t h m produces d i f f e r e n t
sults w h e n the e x p r e s s i o n s are reordered.
The f o l l o w i n g
in Caviness' form
reIn
5e 0 +
1
e
x+x 2
+ e
1
1
x
e
1
x+l
X
we can get
1
x+x 2
e
using
1
x
2e
of a s s i g n i n g
labels,
...
,C k
are d i f f e r e n t c o n s t a n t e x p o n e n t i a l
w r i t t e n in his form (e.g.,
3e0+e 5
e
),
and
1
-x+l
polynomials
then
a d i f f e r e n t order.
The last two examples are i n t e n d e d to
show the d i f f i c u l t i e s that a c a n o n i c a l simplifier for REX e x p r e s s i o n s has to surmount.
There is a simple proof that such a s i m p l i f i e r
exists, using B r o w n ' s conjecture.
A little
r e f l e c t i o n will show that we can p r o d u c e a
f u n c t i o n of a single integer w h i c h for inc r e a s i n g values of its input w i l l y i e l d synt a c t i c a l l y v a l i d REX expressions, and w h i c h
will y i e l d each REX e x p r e s s i o n for some input.
The c a n o n i c a l s i m p l i f i e r will, g i v e n a REX
expression, get the f u n c t i o n to g e n e r a t e REX
e x p r e s s i o n s until one is found w h i c h Brown's
a l g o r i t h m d e t e r m i n e s is e q u i v a l e n t to the
e x p r e s s i o n to be simplified.
The first expression found in this m a n n e r is c o n s i d e r e d the
s i m p l i f i e d result.
The a l g o r i t h m is canonical,
a s s u m i n g Brown's conjecture, since all equivalent REX e x p r e s s i o n s w o u l d r e s u l t in the same
simplified expression.
However, the scheme is
u t t e r l y inefficient.
It also suffers from
the fact that the s i m p l i f i e d e x p r e s s i o n s are
not d e s c r i b a b l e by some simple pattern.
For
example, the s i m p l i f i e d form of 1 m i g h t be
quit e d i f f e r e n t from 1 in this scheme.
The
next a l g o r i t h m p r o d u c e s e x p r e s s i o n s w h i c h do
satisfy g e n e r a l patterns.
Such s i m p l i f i e r s
are e x c e e d i n g l y useful since they can help us
d e t e r m i n e answers to g l o b a l q u e s t i o n s about
an e x p r e s s i o n (e.g., Is it a c o n s t a n t ? Is it
linear in x?).
In [ 7 ], C a v i n e s s d e s c r i b e s a c a n o n i c a l
s i m p l i f i c a t i o n a l g o r i t h m for a class of expressions r e l a t e d to REX expressions.
His expressiQns admit only one real variable, say x, but
no n, and no d i v i s i o n at all.
Because division is not allowed, Caviness' e x p r e s s i o n s are
exponential polynomials.
By a s s u m i n g a conjecture s i m i l a r to Brown's, C a v i n e s s shows how
e x p o n e n t i a l p o l y n o m i a l s (other than pure polynomials) can be t r a n s f o r m e d into the form
{eCl ,e C2,
usin g
S1
Pl(X)e
is
( - 3 + x 2 ) e x + ( 5 + x ) e l + x + 3e 3e O +xe x
Ci,C 2,
one order
polynomial
In o r d e r to g u a r a n t e e that p u t t i n g an
e x p r e s s i o n into his form yields a c a n o n i c a l
simplifier, C a v i n e s s m u s t d e c i d e how terms are
to be o r d e r e d in sums.
This can be done by
some lexical o r d e r i n g scheme.
G i v e n some
o r d e r i n g scheme, C a v i n e s s requires that the Si
in his form be in i n c r e a s i n g order.
To prove
c a n o n i c a l n e s s , C a v i n e s s assumes that if
e
2 e
exponential
S2
+ P2(x)e
Sk
+
"'" + P k ( X ) e
,
w h e r e the S i are d i s t i n c t e x p o n e n t i a l p o l y n o m ials w h i c h are also in this form, and the Pi
are non-zero, c a n o n i c a l l y o r d e r e d p o l y n o m i a l s .
To get e x p o n e n t i a l p o l y n o m i a l s into this form
one has to apply the usual a l g e b r a i c transf o r m a t i o n s (including expansion), and c o l l e c t
the e x p o n e n t i a l s via
a b
a+b
e e 4 e
...
,e Ck }
is l i n e a r l y i n d e p e n d e n t over the r a t i o n a l
numbers.
The proof m a k e s use of the idea that
e q u i v a l e n t e x p r e s s i o n s are equal for each
v a l u e of the v a r i a b l e x.
The c o n j e c t u r e implies, among other things, that the set
e
[e,
e e,
ee
....
}
contains only t r a n s c e n d e n t a l n u m b e r s which,
like the e + ~ c o n j e c t u r e , is u n k n o w n at
present.
W h i l e Caviness' a l g o r i t h m is q u i t e p o w e r rul, it suffers from the w e a k n e s s that it does
not p e r m i t division.
Brown's algorithm,
w h i l e it does p e r m i t division, does not y i e l d
c a n o n i c a l results.
In [30 ] we d e s c r i b e a
c a n o n i c a l s i m p l i f i e r for first o r d e r e x p o n e n tial e x p r e s s i o n s (i.e., no n e s t i n g of exponentials) w h i c h are REX e x p r e s s i o n s , but do not
involve i or ~.
The proof of c a n o n i c a l n e s s of
our s i m p l i f i c a t i o n a l g o r i t h m also d e p e n d s on
a c o n j e c t u r e w h i c h is very s i m i l a r to Brown's
and Caviness' conjectures.
The novel idea in our a l g o r i t h m is to
use a p a r t i a l f r a c t i o n d e c o m p o s i t i o n of the
exponents.
The l e f t - h a n d - s i d e of the e q u a t i o n
b e l o w is in the u s u a l c a n o n i c a l form for
r a t i o n a l functions and the r i g h t - h a n d - s i d e
r e p r e s e n t s a p a r t i a l f r a c t i o n e x p a n s i o n of it.
x5+x3+l
4
2
x -x
-i
- x +--~+
x
1
-7
1
+ -x+l
x-i
We r e q u i r e that the terms of the p a r t i a l fraction d e c o m p o s i t i o n be linearly i n d e p e n d e n t
(over the r a t i o n a l numbers) of each other.
Such p a r t i a l f r a c t i o n d e c o m p o s i t i o n s lead to
yet a n o t h e r c a n o n i c a l r e p r e s e n t a t i o n of rational functions.
The s i m p l i f i c a t i o n a l g o r i t h m
b r e a k s up an e x p o n e n t i a l of a sum into a product of e x p o n e n t i a l s w h i c h are r e p l a c e d by
labels in a m a n n e r s i m i l a r to that of Brown's
algorithm.
Thus,
x2+x
e
x
e
294
is d e c o m p o s e d
e
2
X
e
are confident, however, that a fairly e f f i c i e n t
e x p t e n s i o n of our a l g o r i t h m to h i g h e r o r d e r
e x p o n e n t i a l s will, in fact, be found.
into
X
3.3.2
X
Expressions
Logarithms
e
With proper r e l a b e l l i n g and s i m p l i f i c a t i o n of
the r e s u l t i n g r a t i o n a l e x p r e s s i o n we o b t a i n e d
the s i m p l i f i e d r e s u l t
2
X
e
Note
x
-i
+ x
1
x
x + 1
Therefore
1
e
x2+x
1
e~
+
1
e
-i
x+l
X
e
is t r a n s f o r m e d
-I
x+l
e
into
1
1
ex
+
1
e
e x
-i
e
x+l
X
Then if
1
1
ex
-i
ql = ~' rl=
' q2 = x ~ '
-i
x+l
r2= e
we can d e t e r m i n e that q2 is linearly i n d e p e n d ent of ql"
In fact, we need not check for a
full linear d e p e n d e n c e in our algorithm, but
only for the p o s s i b i l i t y that a new e x p o n e n t
is a r a t i o n a l n u m b e r m u l t i p l e of some p r e v i o u s
exponent.
This is a c o n s e q u e n c e of the linear
i n d e p e n d e n c e of our p a r t i a l f r a c t i o n d e c o m p osition.
Our example, therefore, reduces to
e
-i
r2rl + rlr2
x+l
rl
= 2r 2 = 2e
1
~
eX+l
e
= e
e 2/3x-
el/3x+
is more comples than e x b e c a u s e it is of higher degree.
The c o m p l e x i t y m e a s u r e does not
p r e s u m e that
e 2x
1
and
(eX) 2
are a l g e b r a i c a l l y related.
In fact, it does
not m a t t e r very m u c h w h i c h e x p r e s s i o n is cons i d e r e d more complex as long as the r a n k i n g is
used consistently.
The r e d u c t i o n p r o c e d u r e of the a l g o r i t h m
assumes that the e q u i v a l e n c e p r o b l e m for
r a t i o n a l functions is trivial.
A m o r e complex
e x p r e s s i o n will force the a l g o r i t h m to generate s u b p r o b l e m s w h i c h will either end up as
r a t i o n a l functions or c o n s t a n t problems.
Let us suppose that we w i s h to d e t e r m i n e
w h e t h e r an e x p r e s s i o n E is e q u i v a l e n t to 0.
Let y be the m o s t complex e x p o n e n t i a l or
l o g a r i t h m i c term in E.
Let us further suppose
that y is a l o g a r i t h m i c term.
By m u l t i p l y i n g
out d e n o m i n a t o r s , e x p a n d i n g p r o d u c t s of sums,
and c o l l e c t i n g like terms, we can get a polynomial e x p r e s s i o n E* in y of the form
frac-
1
rl+l
is simply
,
thus m i s s i n g the p o s s i b i l i t y
tion in terms of
for a d e c o m p o s i -
1/3
r1
w h i c h m i g h t be c r u c i a l
X
e
Therefore, if we let r I = e x , a p a r t i a l
tion d e c o m p o s i t i o n of
1
rl+l
e
(ex) 2
1 ~x
2
-~e
+ ~-
el~+l
and
is c o n s i d e r e d more complex than e x b e c a u s e of
the g r e a t e r d e p t h of n e s t i n g of the e x p o n e n tial function, and
U n f o r t u n a t e l y , p a r t i a l f r a c t i o n decompo s i t i o n m u s t be used with g r e a t care in h i g h e r
order exponentials; for example,
1
Exponentials
The functions of the calculus i n c l u d e logarithms as w e l l as r a t i o n a l functions and
exponentials.
Therefore, there is m u c h interest in results i n v o l v i n g the l o g a r i t h m function.
A r e s u l t close in spirit to those of 3.3.1 was
o b t a i n e d by R i c h a r d s o n [37 ] for a class of
e x p r e s s i o n s w h i c h differs from the REX expressions in that it involves no i, only a single
v a r i a b l e x, but allows the functions sine,
cosine and loglxl.
The three f u n c t i o n s in
a d d i t i o n to the e x p o n e n t i a l f u n c t i o n of REX
e x p r e s s i o n s can be nested to any depth.
R i c h a r d s o n was i n t e r e s t e d in the p r o b l e m of
d e t e r m i n i n g w h e t h e r an e x p r e s s i o n was equivalent to 0 on some i n t e r v a l of the real line.
His a l g o r i t h m for d e t e r m i n i n g the equivalence involves a r e d u c t i o n process in w h i c h
one asks w h e t h e r p r o g r e s s i v e l y less complex
e x p r e s s i o n s are e q u i v a l e n t to 0.
The a l g o r i t h m
is i n c o m p l e t e in that it relies, in some cases,
on k n o w i n g w h e t h e r a r e d u c e d e x p r e s s i o n w h i c h
involves only constants is equal to 0.
This
r e q u i r e m e n t is, of course, similar to the need
for c o n j e c t u r e s in the algorithms of 3.3.1.
R i c h a r d s o n ' s a l g o r i t h m is, furthermore, only
a p p l i c a b l e w h e n the e x p r e s s i o n b e i n g e x a m i n e d
is totally d e f i n e d e v e r y w h e r e in the interval.
In essence, this r e q u i r e m e n t is that no sube x p r e s s i o n could become u n b o u n d e d in value at
some finite p o i n t on the i n t e r v a l b e i n g
examined.
R i c h a r d s o n ' s m e a s u r e of the c o m p l e x i t y of
an e x p r e s s i o n is very l e x i c o g r a p h i c in nature
and relies on very little k n o w l e d g e of the
a l g e b r a i c p r o p e r t i e s of the functions involved.
For example,
that
1
2
Involving
in some
expresion.
We
•
B95
and
an(x)yn
+ a n _ l ( x ) y n-I +
the
is
to
E*
If
by
... + a0(x)
of l o w e r d e g r e e in y than E*, w e can t e s t
c h e c k if it is e q u i v a l e n t to 0.
If it is,
a n d t h e r e f o r e E are a l s o e q u i v a l e n t to 0.
it is not, E* a n d E are n o t e q u i v a l e n t to 0.
If a n is n o t e q u i v a l e n t to 0, d i v i d e E*
it r e s u l t i n g in the e x p r e s s i o n E2
y
n
+
a n - i (x)
a
n
y
(x)
n-i
+
a0(x)
... + - a (x)
n
Now differentiate,
resulting
say E3, of the f o r m
ny
n-ly,
integral
X
E
w h i c h is e q u i v a l e n t to 0 if the o r i g i n a l exp r e s s i o n E is e q u i v a l e n t to 0.
S i n c e an(X)
does n o t c o n t a i n y, it is less c o m p l e x
than
E or E* and w e can a p p l y the a l g o r i t h m r e c u r s i v e l y in o r d e r to d e t e r m i n e if it is e q u i v a lent to 0.
If a n is e q u i v a l e n t to 0 t h e n
s i n c e the e x p r e s s i o n E1
an_l(x)y n-I +
exponential
... + a0(x)
' (X) _ e
x
l
can be i n c l u d e d in the e x p r e s s i o n s to be t e s t e d
for e q u i v a l e n c e to 0.
The key p r o p e r t y of the
e x p o n e n t i a l f u n c t i o n u s e d in the a l g o r i t h m is
t h a t the d e r i v a t i v e of an e x p o n e n t i a l of deg r e e k is a l s o of d e g r e e k in t h a t e x p o n e n t i a l .
C o n s i d e r r a t i o n a l roots of p o l y n o m i a l s w h i c h
h a v e the f o r m
P (x)
where
gers.
n/m,
P is a p o l y n o m i a l
(E.g.,
/x,
and
n and m are
inte-
(x2+2) 2/3) .
In g e n e r a l ,
[P(x)n/m] , = ~ p ( x ) n / m
m
in an e x p r e s s i o n ,
=
n P'(x)
~
- 1 p, (x)
[p(x)n/m]
Since
+
"'" +
a n a 0 ' - a0a n'
2
a
n
E3 is of l o w e r d e g r e e in y t h a n E* s i n c e the
d e r i v a t i v e of a l o g a r i t h m i c t e r m is of l o w e r
c o m p l e x i t y t h a n the t e r m itself.
(Note t h a t
this is e s s e n t i a l l y the o n l y f a c t we n e e d to
k n o w a b o u t l o g a r i t h m s e x c e p t for cases w h e r e
the c o n s t a n t p r o b l e m arises.)
If E3 is n o t
e q u i v a l e n t to 0, t h e n E2 and t h e r e f o r e E* and
E are n o t e q u i v a l e n t to 0.
If E3 is e q u i v a l e n t
to 0, t h e n E2 is e q u i v a l e n t to a c o n s t a n t .
To
c o m p l e t e the a l g o r i t h m w e m u s t d e t e r m i n e if
the c o n s t a n t is 0.
This is the w a y in w h i c h
the c o n s t a n t p r o b l e m a r i s e s in R i c h a r d s o n ' s
algorithm.
One c o u l d a t t e m p t to e v a l u a t e the
e x p r e s s i o n at a p o i n t as O l d e h o e f t does [ 33 ].
The s i t u a t i o n h e r e is s i m p l e r t h a n in O l d e h o e f t ' s cases s i n c e if the f u n c t i o n is e q u i v a lent to a c o n s t a n t w e n e e d n o t w o r r y a b o u t
a c c i d e n t a l v a l u e s of 0 a r i s i n g in the e v a l u ation.
If the m o s t c o m p l e x t e r m y is an e x p o n ential, then Richardson's algorithm involves
d i v i s i o n by a 0.
Differentiation
will then
y i e l d a low o r d e r t e r m e q u a l to 0.
S i n c e the
d e r i v a t i v e of y ~ is of d e g r e e k in y, the
r e s t of the d e r i v a t i v e can be d i v i d e d by y to
y i e l d an e x p r e s s i o n s i m i l a r to E3 w h i c h is of
l o w e r d e g r e e t h a n E*.
A t the h e a r t of R i c h a r d s o n ' s r e d u c t i o n
p r o c e d u r e is the i d e a t h a t t h r o u g h d i f f e r e n t i a t i o n w e can o b t a i n e x p r e s s i o n s w h i c h can
be t r a n s f o r m e d in s u c h a w a y as to y i e l d
simpler problems whose solution will determine
the a n s w e r to the o r i g i n a l e q u i v a l e n c e p r o b l e m .
It t u r n s o u t t h a t this i d e a can be u s e d to
test expressions which involve functions other
t h a n e x p o n e n t i a l s and l o g a r i t h m s .
As w e p o i n t ed o u t e a r l i e r , the l o g a r i t h m i c c a s e of the
a l g o r i t h m h i n g e s on the f a c t t h a t the d e r i v a tive of a l o g a r i t h m i c t e r m is o f ' l o w e r r a n k in
c o m p l e x i t y t h a n the t e r m itself.
Thus functions w h i c h are d e f i n e d by i n t e g r a l s s u c h as
the e r r o r f u n c t i o n
2
2
-x
erf' (x) = 7 ~ e
n P'
m P
is a r a t i o n a l f u n c t i o n and of l o w e s t c o m p l e x i t y
in R i c h a r d s o n ' s r a n k i n g , w e can say t h a t
r a t i o n a l r o o t s of p o l y n o m i a l s w i l l b e h a v e like
exponentials
in R i c h a r d s o n ' s
algorithms.
Johnson
[21 ], u s i n g a s o m e w h a t d i f f e r e n t
a p p r o a c h at d e c i d i n g e q u i v a l e n c e ,
is a l s o a b l e
to h a n d l e a l a r g e class of e x p r e s s i o n s
like
the one w e h a v e just i n d i c a t e d .
It can f u r t h e r be s h o w n [32 ] t h a t
R i c h a r d s o n ' s a l g o r i t h m can be e x t e n d e d to
a c c e p t any f u n c t i o n d e f i n e d by a d i f f e r e n t i a l
e q u a t i o n of the f o r m y' = P ( x , y ) , w h e r e P is
a p o l y n o m i a l in y.
W h e n P is l i n e a r in y
the e x t e n s i o n is s t r a i g h t f o r w a r d .
P's w h i c h
are q u a d r a t i c in y are of g r e a t i m p o r t a n c e
in a p p l i e d m a t h e m a t i c s .
Unfortunately,
when
a f u n c t i o n is d e f i n e d by a q u a d r a t i c P, t h e n
its d e r i v a t i v e is m o r e c o m p l e x t h a n i t s e l f .
Thus if w e are t e s t i n g E ( x , y ( x ) ) for e q u i v a l e n c e to 0, w e s h a l l u s u a l l y f i n d t h a t
E ' ( x , y ( x ) ) has a h i g h e r d e g r e e in y t h a n E
does.
If E E 0, t h e n E' ~ 0, and t h e r e f o r e ,
the g r e a t e s t c o m m o n d i v i s o r of E and E' is a l s o
e q u i v a l e n t to 0.
C o n v e r s e l y , if the g c d of
E and E' is e q u i v a l e n t to 0, so is E.
Hence,
w e m a y use the r e s u l t of the e q u i v a l e n c e t e s t
for the gcd.
The g c d may, h o w e v e r , n o t be of
l o w e r d e g r e e in y t h a n E i t s e l f is.
In s u c h
cases it m u s t p o s s e s s the s a m e d e g r e e in y as
E does.
T h e r e f o r e , w e m a y p r o p e r l y s p e a k of
E d i v i d i n g E'
L e t us say t h a t
m !
E
- Q(x,y) .
Therefore,
integrating
log E = ~ Q ( x , y )
E = C2efQ(x'Y)
both
sides
dx + C 1
dx w h e r e
Ci,
C 2 are
constants.
E x p o n e n t i a l s u s u a l l y c a n n o t h a v e a zero
value.
In s u c h c a s e s E can o n l y h a v e a zero
v a l u e if C 2 is i d e n t i c a l l y zero.
This d e t e r m i n a t i o n is a n o t h e r c o n s t a n t p r o b l e m of a
296
special nature in that we are d e a l i n g w i t h a
f u n c t i o n that is either always 0 or never 0.
An e x p o n e n t i a l can have a zero value w h e n the
a r g u m e n t goes to -~.
Such cases w o u l d be
d i s a l l o w e d by R i c h a r d s o n ' s r e q u i r e m e n t that
expressions be totally defined.
The c a n o n i c a l s i m p l i f i c a t i o n algorithms
r e p r e s e n t an extreme in the use of e x p l i c i t
k n o w l e d g e of the s i m p l i f i c a t i o n rules of a
class of expressions.
Equivalence matching
algorithms need not e x p l i c i t l y know these
rules.
For example, R i c h a r d s o n ' s a l q o r i t h m
does not e x p l i c i t l y know that loglab] = log lal
+ log Ibl. As a result, e q u i v a l e n c e m a t c h i n g
algorithms are usually poor s i m p l i f i c a t i o n
algorithms.
It is clear that in many situations e x p l i c i t k n o w l e d g e of general simplification rules is v a l u a b l e in r e d u c i n g the size
of an expression.
In fact, we w o u l d also like
to know that a given set of s i m p l i f i c a t i o n
rules for a class of expressions is c o m p l e t e
in the sense that no other general rules can
be found w h i c h cannot be derived from the set
by r a t i o n a l operations.
Risch tackled these
q u e s t i o n s for a class of expressions similar
to R i c h a r d s o n ' s [40 ]. His results, in effect,
state that no general rules exist cther than
the familiar ones (e.g.,
e a+b = eae b, em/n log a = am/n , log ca= a,
log ab = log a + log b + 2k~i,
w h e r e k, m, and n are integers).
The m e t h o d
of attack he uses is to ask w h a t r e l a t i o n s h i p
must exist b e t w e e n an e x p o n e n t i a l or a logarithmic term and a set of other e x p o n e n t i a l s
and logarithmics for the former to be
a l g e b r a i c a l l y d e p e n d e n t on the latter.
The
proof relies on much of the m a c h i n e r y used in
Risch's previous w o r k on integration.
As
before, Risch's results require the s o l u t i o n
of c o n s t a n t problems.
Thus we may speak of three v a r i e t i e s of
theoretical algorithms.
Zero-equivalence
algorithms will g u a r a n t e e that e x p r e s s i o n s
e q u i v a l e n t to 0 w i l l be identified.
Re@ular
algorithms g u a r a n t e e that the e x p o n e n t i a l and
l o g a r i t h m i c terms in an e x p r e s s i o n are algeb r a i c a l l y i n d e p e n d e n t of each other.
Regular
algorithms are z e r o - e q u i v a l e n c e algorithms.
C a n o n i c a l algorithms w h i c h reduce e q u i v a l e n t
expressions to a single form are always zeroe q u i v a l e n c e and are usually regular.
Caviness'
a l g o r i t h m is an e x c e p t i o n to this rule in that
it is not regular.
3.3.3
Roots of P o l y n o m i a l s
In [ 6 ], Caviness discusses a class of
expressions w h i c h is o b t a i n e d from the rational numbers, the v a r i a b l e x, the r a t i o n a l operations and the o p e r a t i o n of e x p o n e n t i a t i n g to
a rational number.
The e x p o n e n t i a t i o n in this
class may not be nested.
The f o l l o w i n g
expressions are in this class;
1
The e x p r e s s i o n
(x + 31/2 ) 1/3
is not in this class b e c a u s e it involves
nested e x p o n e n t i a t i o n by non-integers.
Caviness
shows that there exists a z e r o - e q u i v a l e n c e
s i m p l i f i c a t i o n a l g o r i t h m for this class of
expressions.
The a l g o r i t h m is not canonical.
U n f o r t u n a t e l y , it is also very t i m e - c o n s u m i n g
since it can easily force one to factor polynomials (over the integers)
h a v i n g a high
degree, and f a c t o r i z a t i o n is still a very
e x p e n s i v e operation.
Recently, Fateman [26 ] showed that factorization is u s u a l l y not n e c e s s a r y if we m o d i f y
the m e a n i n g of a radical expression.
What
Caviness means by a radical e x p r e s s i o n such
as /x is a symbol w h i c h represents the general
root of a p o l y n o m i a l h a v i n g p o l y n o m i a l coefficients (i.e., y~ - x).
That is, /x can be
either one of the roots n o r m a l l y w r i t t e n as
+/x and -/x.
Fateman's a l g o r i t h m assumes that
the symbol /x represents exactly one of the
roots, and that -/x r e p r e s e n t s the other.
Fateman's algorithm, except for even roots
of unity, has the same strong p r o p e r t y as
Caviness', namely the z e r o - e q u i v a l e n c e property.
However, all he needs to test is w h e t h e r the
integers and p o l y n o m i a l s w h i c h occur inside
the radicals are r e l a t i v e l y prime to each
other.
He w o u l d d e c o m p o s e
x -l
into 47=r , ~ r
if ~
or 4 ~
o c c u r r e d e l s e w h e r e in the
expression.
However,
w o u l d be left u n c h a n g e d since no other simplified radical e x p r e s s i o n could combine w i t h
it under the rational operations.
In both
Caviness' and Fateman's a l g o r i t h m s the proof
that the s i m p l i f i c a t i o n a l g o r i t h m has zeroe q u i v a l e n c e p r o p e r t y is o b t a i n e d w i t h o u t resorting to a d d i t i o n a l conjectures.
Fateman's
a l g o r i t h m will simplify
to
to 7/2.
and incidentally, it will convert j ~
The a l g o r i t h m can be made c a n o n i c a l by removing radicals from d e n o m i n a t o r s in q u o t i e n t s
through a g e n e r a l i z a t i o n of the process of
" r a t i o n a l i z i n g the d e n o m i n a t o r . "
Thus
x + /2
could be c o n v e r t e d to
x-/2
x I/2 + x I/3
x
(4 - x) 5/3
2
- 2
in order to achieve a c a n o n i c a l form.
(x 2 + 2)2/3
297
3.3.4
U n s o l v a b i l i t y Results
By adding the a b s o l u t e v a l u e f u n c t i o n to this
class R i c h a r d s o n was able to m o d i f y G to a
f u n c t i o n F(y,x) such that F(y,x) m 0 could not
be d e t e r m i n e d by an a l g o r i t h m as y v a r i e d over
the integers.
This is R i c h a r d s o n ' s m a j o r
u n s o l v a b i l i t y result.
Several c o r o l l a r i e s of R i c h a r d s o n ' s
t h e o r e m w e r e d e r i v e d by F e n i c h e l [14 ] to show
that, among other things, one could not determ i n e the limit of every e x p r e s s i o n w h i c h
p o s s e s s e d a limit.
Risch [ 38 ] used the fact that
The e a r l i e s t of the t h e o r e t i c a l results
w h i c h we discuss in this section, and p r o b a b l y
the b e s t known one in the field of a l g e b r a i c
m a n i p u l a t i o n , is a n e g a t i v e result due to
R i c h a r d s o n [35 ].
In 1965 Richardson, Risch
and Moses w e r e all w o r k i n g on integration.
R i c h a r d s o n and Moses w e r e p u r s u i n g theorems
stating that i n t e g r a t i o n was u n s o l v a b l e (i.e.,
that no a l g o r i t h m e x i s t e d for d e t e r m i n i n g
w h e t h e r the i n t e g r a l did or did not exist in
closed form), and Risch was e x a m i n i n g algorithms
log(e x) = x + 2kni ,
for solving the p r o b l e m [38,39]. R i c h a r d s o n
s u c c e e d e d in o b t a i n i n g an u n s o l v a b i l i t y result
for some integer k, to g e n e r a t e an u n s o l v a b l e
for i n t e g r a t i o n by showing that there exists
i n t e g r a t i o n p r o b l e m by using H i l b e r t ' s Tenth
a class E of e x p r e s s i o n s for w h i c h no a l g o r i t h m
P r o b l e m and R i c h a r d s o n ' s device of i n t e g r a t i n g
exists for d e c i d i n g w h e t h e r each e x p r e s s i o n in
a m u l t i p l e of
E was e q u i v a l e n t to 0.
If we c o n s i d e r the
2
x
class of integrals
e
2
Re x
dx,
w h e r e R is some s p e c i a l l y chosen m e m b e r of E,
then if R is e q u i v a l e n t to 0, the i n t e g r a l
exists in closed form (in fact, it is a constant).
If R is not e q u i v a l e n t to 0, then the
i n t e g r a l cannot be e x p r e s s e d in closed form
due to the w e l l - k n o w n p r o p e r t i e s of
e
x
2
In [29 ], we used the fact that the differential e q u a t i o n
y, + y2 = 1 + ( ~ 2I)
x
,
p a constant,
has a s o l u t i o n w h i c h is a r a t i o n a l f u n c t i o n in
x if and only if p is an integer.
Thus we
w e r e able to g e n e r a t e systems of o r d i n a r y
d i f f e r e n t i a l e q u a t i o n s for w h i c h one cannot
d e c i d e w h e t h e r they possess r a t i o n a l functions
as solutions.
and those of the chosen members of E.
As it
4.0
P r o s p e c t s for the F u t u r e
turns out, R i c h a r d s o n ' s m a j o r result was the
d e m o n s t r a t i o n of the e x i s t e n c e of the class E,
A l t h o u g h the field of a l g e b r a i c m a n i p u l a rather than the a p p l i c a t i o n of this result
tion can already claim a number of i m p o r t a n t
to integration.
advances in the d e s i g n of algorithms, and a
The s t a r t i n g point for m o s t u n s o l v a b i l i t y
s i g n i f i c a n t number of i m p o r t a n t a p p l i c a t i o n s ,
results in a l g e b r a i c m a n i p u l a t i o n is H i l b e r t ' s
one cannot yet say that the field has stabilTenth Problem.
This problem, w h i c h is also
ized.
D e s i g n e r s have m a d e s u b s t a n t i a l i m p r o v e known as the D i o p h a n t i n e Problem, asks w h e t h e r
ments to their systems just in the last year.
there exists an a l g o r i t h m for telling w h e t h e r
M u c h of w h a t we d i s c u s s e d in this paper, the
p o l y n o m i a l s in several v a r i a b l e s w i t h integer
c o n v e n t i o n a l l e x i c o g r a p h i c o r d e r i n g of expresc o e f f i c i e n t s have solutions w h i c h are integers.
sions, the v a r i e t y of s u b s t i t u t i o n techniques,
This p r o b l e m has b e e n recently shown to be
and c a n o n i c a l simplifiers, is only a v a i l a b l e
r e c u r s i v e l y unsolvable.
In 1965, it was known
in systems in an e x p e r i m e n t a l nature.
Therethat a v e r s i o n of the problem, called the
fore, any p r e d i c t i o n s about the future state
E x p o n e n t i a l D i o p h a n t i n e Problem, was unsolvable.
of a l g e b r a i c s i m p l i f i c a t i o n are m a d e on
Today, one can use the u n s o l v a b i l i t y of
shaky grounds.
N o n e t h e l e s s , we shall a t t e m p t
H i l b e r t ' s Tenth P r o b l e m to claim that there
some p r e d i c t i o n s , albeit fairly c o n s e g v a t i v e
exists a p o l y n o m i a l P(Y,Xl,X2, ... ,x n)
ones.
such that the q u e s t i o n of w h e t h e r P = 0 had
P r a c t i t i o n e r s in the field of a l g e b r a i c
i n t e g e r solutions for Xl,X 2, ... ,x n for
m a n i p u l a t i o n , just as in m u c h of c o m p u t e r
v a r y i n g i n t e g r a l values of y could not be
science, can be d i v i d e d into three m a j o r catesolved by an algorithm.
One can g e n e r a l i z e
gories: t h e o r e t i c i a n s , systems designers, and
this p r o b l e m to d e t e r m i n e w h e t h e r P had real
users.
T h e o r e t i c i a n s tend to d e s i g n r a d i c a l
roots by asking w h e t h e r
and new left systems since the a l g o r i t h m s in
such systems are m o s t easily defined.
Users
n
2
w i t h s u b s t a n t i a l p r o b l e m s to solve also tend
sin nx i + p2(y,xl,x2, ... ,x n) = 0
to d e s i g n radical and new left systems since
i=l
the needs of such users are very special and
f r e q u e n t l y do not require the f l e x i b i l i t y
since sinTrxi= 0 forces each x i to be an integer.
o f f e r e d by liberal, c o n s e r v a t i v e , or c a t h o l i c
systems.
Systems d e s i g n e r s e x p e c t a g r e a t
By m a n i p u l a t i n g the e q u a t i o n above, R i c h a r d s o n
v a r i e t y of users and t h e r e f o r e tend to b u i l d
was able to show that there exists a f u n c t i o n
systems w i t h liberal or c o n s e r v a t i v e components.
G(y,x) such that as y varies over the integers
We have already w i t n e s s e d the d e m i s e of purely
one can not tell w h e t h e r there exist real
c o n s e r v a t i v e systems.
In the next few years
values of x such that G(y,x) < 0.
we may w i t n e s s the d e m i s e of purely liberal
At this point we have an u n d e c i d a b i l i t y
systems.
The r e a s o n for the d i m i n i s h e d importresult for the class of e x p r e s s i o n s formed by
ance of such systems is the e f f i c i e n c y of the
the r a t i o n a l numbers and n, the v a r i a b l e x,
a l g o r i t h m s p r o v i d e d in radical systems or
the operations of a d d i t i o n and m u l t i p l i c a t i o n ,
subsystems.
It w o u l d not be s u r p r i s i n g if
and the sine f u n c t i o n (which can be nested).
Z98
many radical systems mature into new left systems when the disadvantages of canonical forms
become unbearable.
This would leave the new
left systems with a single representation
which is a compromise between the radical and
liberal representations, and the catholic
systems with their multiple representations.
We believe that the theoreticians and the major
users will tend to gravitate to the new left
systems and the systems designers to the
catholic ones.
We expect to see theoretical results
about simplification algorithms encompass increasingly larger classes of expressions.
Risch's results about relationships of exponentials and logs of different arguments will
probably be extended to a number of other
functions.
The generality of the extensions which
can be made to Richardson's zero-equivalence
algorithm lead one to expect that in the next
few years it will be possible for a user to
define a function as a solution to a differential equation and then employ that function
immediately in a calculation.
One thing that we do not expect is that
the difficulties of using algebraic manipulation systems will disappear completely.
Users
will continue to complain, and designers will,
hopefully, continue to improve their creations.
Acknowledgements
Work reported herein was supported in
part by Project MAC, an M.I.T. research
project sponsored by the Advanced Research
Projects Agency, Department of Defense, under
Office of Naval Research Contract Nonr-4102(01).
References
i)
2)
3)
4)
5)
Abrahams, P.W., "Applications of LISP to
Sequence Prediction," CACM, vol.9, no.8,
p.551, Aug. 1966.
9)
Collins, G., "PM, A System for Polynomial
Manipulation," Comm. ACM, vol.9, no.8,
Aug. 1966, pp.578-589.
10) Collins, G., "The SAC-I System: An Introduction and Survey," these proceedings.
ii) Collins, G., "Subresultants and Reduced
Polynomial Remainder Sequences, "
Journal of the ACM, vol.14, Jan. 1967,
pp.128-142.
12) Engeli, M., "User's Manual for the Formula
Manipulation Language SYMBAL," University of Texas at Austin, Computer
Center, 1968.
13) Fateman, R., "The User-Level Semantic
Matching Capability in MACSYMA," these
proceedings.
14) Fenichel, R., "An On-Line System for
Algebraic Manipulation," PhD. dissert.,
Harvard U., Cambridge, Mass., 1966.
15) Goldberg, S.H., "Solution of an Electrical
Network Using a Digital Computer,"
M.S. Thesis, MIT, Cambridge, Mass.,1959.
16) Hall, A., "The ALTRAN System for Rational
Function Manipulation - A Survey,"
these proceedings.
17) Hart, T., "Simplify," Memo.27, Artificial
Intelligence Group, Project MAC, MIT,
Cambridge, Mass., 1961.
18) Hearn, A., "REDUCE: A User-Oriented Interactive System for Algebraic Simplification," In Interactive Systems for
Experimental Applied Mathematics,
Academic Press, New York, pp.79-90.
19) Hearn, A., "The Problem of Substitution,"
in Proceedings of the 1968 Summer
Blair, F. et al., "SCRATCHPAD/i: An InterInstitute on Symbolic Mathematical
active Facility for Symbolic Mathematics,"
Computation, IBM, Cambridge, Mass.,
these proceedings.
pp.3-19.
Brown, W.S., et
Non-Numerical
Computer-II,"
Journal, vol.
March, 1964.
al., "The ALPAK System for
Algebra on a Digital
Bell System Technical
XLIII, no.2, pp.785-804,
Brown, W.S., "Rational Exponential Expressions and a Conjecture Concerning
and e," Amer. Math. Monthly, voi.76,
pp.28-34, Jan. 1969.
Brown, W.S., "On Euclid's Algorithm and
the Computation of Polynomial Greatest
Common Divisors," these proceedings.
6)
Caviness, B.F., "On Canonical Forms and
Simplification," PhD disser., CarnegieMellon U., Pitts. Pa., Aug. 1967.
7)
Caviness, B.F., "On Canonical Forms and
Simplification," Journal of the ACM,
vol.17, no.2, April 1970, pp.385-396.
8)
Christensen, C., and Karr, M., "IAM, A
System for Interactive Algebraic
Manipulation," these proceedings.
20) Hearn, A., "REDUCE 2: A System and Language
for Algebraic Manipulation," these
proceedings.
21) Johnson, S., "On the Problem of Recognizing
Zero," these proceedings.
22) Korsvold, K., "An On-Line Algebraic Simplification Program,"
Artificial Intelligence Project Memo. no.37, Stanford
University, Stanford, California,
Nov. 1965.
23) Manove, M. et al., "Ratfonal Functions in
MATHLAB," in Symbol Manipulation Languages and Techniques, North-Holland,
Amsterdam, pp.86-102.
24) Martin, W., "Symbolic Mathematical Laboratory, "Report MAC-TR-36. Project MAC,
MIT, Cambridge, Mass., Jan. 1967.
25) Martin, W., "Determining the Equivalence
of Algebraic Expressions by Hash Coding,"
these proceedings.
299
26) Martin, W., and Fateman, R., "The MACSYMA
System," these proceedings.
43) Tobey, R., "Experience with FORMAC Algorithm Design," Comm. of the ACM, vol.9,
no.8, Aug. 1966, pp.589-597.
27) Minsky, M., and Papert, S., Perceptrons,
MIT Press, Cambridge, Mass., 1969.
44) Tobey, R., et al. "PL/I-FORMAC Symbolic
Mathematics Interpreter," IBM,
Cambridge, Mass., 1969.
28) Moses, J., "Solutions of Systems of Polynomial Equations by Elimination," Comm.
of the ACM, vol.9, no.8, Aug. 1966,
pp.634-637.
45) Tobey, R., et al., "Automatic Simplification in FORMAC," in Proc of Fall Joint
Computer Conference, voi.27, 1965,
pp.37-52.
29) Moses, J., "Symbolic Integration," Report
MAC-TR-47, Project MAC, MIT, Cambridge,
Mass., Dec. 1967.
46) van der Waerden, B., Modern Algebra,
F. Ungar, New York, pp.77-78.
30) Moses, J., "A Canonical Form for First
Order Exponential Expressions," in
preparation.
47) Wooldridge, D., "An Algebraic Simplify
Program in LISP," Art. Intell. Project
Memo. no.ll, Stanford Univ., Stanford,
Calif., Dec. 1963.
31) Moses, J., "Sarge - A Program for Drilling
Students in Freshman Calculus Integration Problems," Project MAC memo.,
March 1968.
32) Moses, J., Rothschild, L.P., and Schroeppel,
R., "A Zero Equivalence Algorithm for
Expressions Formed by Functions Definable by First Order Differential Equations," in preparation.
33) Oldehoeft, A., "Analysis of Constructed
Mathematical Responses by Numeric Tests
for Equivalence," ACM National Conference Proceedings, pp.i17-124, Aug. 1969.
34) Perlis, A., et al., "A Definition of
Formula Algol," Computation Center,
Carnegie-Mellon Univ., Pitts., Pa.,
March 1966.
35) Richardson, D., "Some Unsolvable Problems
Involving Functions of a Real Variable,"
PhD dissert., Univ. of Bristol, Bristol,
England, 1966.
36) Richardson, R., "Some Unsolvable Problems
Involving Elementary Functions of a
Real Variable," Journal of Symbolic
Logic, voi.33, 1968, pp.511-520.
37) Richardson, R., "A Solution of the Identity
Problem for Integral Exponential Functions," Z. Math Logik u. Grundlagen
Math, to appear.
38) Risch, R., "The Problem of Integration
Finite Terms," Trans. of the AMS,
voi.139, May 1969, pp.167-189.
vol. I,
in
39) Risch, R., "On the Integration of Elementary Functions Which are Built up Using
A l g e b r a i c Operations," Report SP-2801002, Systems Develop. Corp., Santa
Monica, Calif., June 1968.
40) Risch, R., "Further Results on Elementary
Functions,"Report RC 2402, IBM Corp.,
Yorktown Heights, NY, March 1969.
41) Simon, H., The Sciences of the Artificial,
MIT Press, Cambridge, Mass., 1969.
42) Slagle, J., "A Heuristic Program that
Solves Symbolic Integration Problems
in Freshman Calculus," PhD dissert.,
MIT, May 1961.
300
A B M N R S H I
C D O P T U J K
M N A B H I R S
O P C D J K T U
R S H I A B M N
T U J K C D O P
H I R S M NAB
J K T U O P C D
Let us call
array
IRSI
TU
ff
the a r r a y
r, and the a r r a y
I
symbols,
lwx
xw I
a, the a r r a y
IJK
HII h.
W
lma
am I w, and the a r r a y
simply
IABI
CD
While
it r e q u i r e s
Ihr
rhl
x.
Let us call
Then
the e n t i r e
structure
35 to w r i t e
the a r r a y
down
array
=
AB
a = CD
rh
x
MN
m = OP
=
RS
r = TU
FIGURE
301
i.
of 64
its d e s c r i p t i o n :
XW
am
w = ma
is
consisted
WX
S
the
~
the o r i g i n a l
only
IMN I m,
|OP|
hr
HI
h = JK
PQ
= M**2
PR
= QI~ + R T
- RS,
PS
= QS
+ RT
- PROPI/2,
l°T = Q S
- PR
+ RT,
QS
= M**2
QT
= PS
PROP2
- PROPI/2,
- PROP3/2,
- QR
- RT,
= PROPi
- 2*RT
(b.)
((4,~,4
+
+ 2*RS
Relations Between
(PROPI+PROPS)**2)*(-
2*RT**2
-
Variables
2*IY~**g*QR
-
4*QR*RT
RT*(PROPI+PROP3)+(PR*PROPI+RS*PROP3)
+ 2*~*2*PR,RS/RT)
+ 4*IYI~*2*QR*(PR + R S ) * ( 2 . ~ . 2
+ 2*~*2*PR*RS*(2*QR
+ 2*(QR
-
-
6*RT
+ RT +
-
(PROPI+PROPS))
5*(PROPI+PROP3))
RT)*((PR*PROPI+RS,PROP$)*(M**2 -
(PROPI+PROP3))
+ 2 * Q R * R T * (PROP I +PROP3 ) )
+ 2*(QR**2+
RT**2)*(2*QR*RT
+ RT*(PROPI+PROP~)) +
/
-
(PR*PROPI+RS*PROP3)
6*I~*2*RT**2*(PROPI+PROPS))
(4*PROPI*PROP3*RT*PR*RS)
(e.)
Final Result Produced by Man and Machine
Figure 2
302
IY), • 4 *
(
(2
-
g • P R O P I • PR • RT
4 * PR**2
• RS
P R O P I * P R * RS
4 • PR • R S * * 2
+
1 4 • PR • RS • R T
+
4 * PR**2
* RT
4 • PR • RS * P S
4 * PR * RS * P T
2 * PR * RS * P R O P g
4 * PR * RS • QT
4 * PR * RS * GIS
4 * PR * R $ * Q.R.
i 0 * PR * R T * * 2
2 * PR * RT * P R O P 2
+
4 * PR * RT * PS
+
4 * PR * RT * PT
+
4 • PR • R T • Q T
+
4 • PR • R T * Q S
4 * PR * RT * QR
6 * RS**2
* RT
4 * RS * R T * * 2
6 ,
RS * RT * Q R
6 * RT**5
+
6 * RT**2
* QR)
*
+
Y~*2
*
(
P R O P I * PR * RS • RT
+
P R O P I * PR * R T * * 2
+
PROPI * P
R * RT * PROP2
+
PROPI * RS**2
* RT
+
2 * P R O P I * RS * R T * * 2
2 * PROP1 * RS * RT * PT
+
PROPI * RT**$
+
2 * PROPI * Rl
• * 2 ~: PS
+
6 * PR~c.~ * RT * QT
2 * PR**2
* RT * QS
+
4 *
PR**2
* RT * QR
4 • PR * RS • RT * P R O P 2
+
4 * PR * RS • h~
PS
+
8
*
PR
*
RS
,
PR * RS * RT * QS
• QT
+
B * PR * RS
RT**g
* PROP2
+
4 *
4 * PR * R T * * 2
* QS
P2
* PS
R *
2
QR
.-
-
2
*
PR
~
RT
•
PT
+
* RT
*
PROP2
*
PR * RT * PROP2 * QS
RT * PS • QR
g * PR * RT
+
4 * RS**2
* RT * QR
4
PROPg
+
4 • RS * R T * * 2
* PS
S * RT**2
* QT
2 * RS * R T * * g
T
+
RS * RT * P R O P 2 * QR
+
• RT * PS * QR
+
4 * RS * RT *
+
4 * RS * RT * PT * QS
+
4
+
4 * RT**3
• QR
+
2 * RT**2
•
*
4 * RT**2
PS • QT
RT**2
•
•
PT
•
4 •
QR)
*
4
*
PR
*
RS
*
RT
•
QT
+
2
4 • PR * RS * RT * QR
+
8 * PR * RS • PS
* PS • QR
4 * PR * R T * * 5
+
2 * PR *
PR * R T * * 2
* PT
+
6 * PR * R T * * 2
* QT
+
PR * RT * P R O P g * * 2
2 * PR * RT * PEO
PS**2
RT**2
•
PS
PT
-
2 * PR
4 * RT**2
•
* RT *
8 * PR • RT • PS
* PT • QR
+
2 *
* RS * R T * * 5
4 * RS * R T * * 2
*
* QS
g * RS *
4 * RS * RT * PS *
PT**2
+
4 * RS
* RT**3
* PS
* PROPg * PS
-
QS
+
4
•
PS
•
PT
•
RT**2
•
PROP2
* QT
*
QT
2 * P
R S * ~ * 2 * RT • QI
2 * RS * R T * * 2
*
PT
+
6 * R
RT * P R O P g * P
PT
+
2 * RS
* RT * PT * QT
2 * RT**3
* QS
RT**2
* PROP2 *
PS
4 * RT**2
•
QR
-
+
2
2 * P R O P I * RS * R T * * 2 * PS
2 * P R * * 2 * RT * P R O P 2 * QT
8 * PR * RS • R T * * 2 • QT
+
2 * PR • RS • RT * PROP2 • QT
B * PR * RS • RT • PS • QT
8 * PR * RS • RT • PS • QR
4
• PR • RS • RT • PT • QT
,4 • PR * R T * * 2 • PS * QT
+
4 * PR
• R T * * 2 • PS • QS
+
,4 • PR * RT * PROP2 • PS • QT
+
2 * PR * R
T * PROP2 * PS • QR
+
4 • RS**2 • RT • PT • QT
,4 • RS • RT**
2 * PS • QT
8 * RS * RT • PS • PT • QT
4 • RS • RT • PS *
P T * QR
+
8 * RT**2 * PS**2 • QT) /
+
4 *
PROPI
•
(a.)
F i g u r e 2,
PR
* RS
* RT**2
*
PROP3)
Expression Initially Produced by Computer
E x a m p l e of R e d u c i n g t h e S i z e of O u t p u t E x p r e s s i o n s b y S u b s t i t u t i o n
303
A
B
a
xy
Alternative
Results
C
2 3
x y
2
axy,
a2/y,
x
a
2x + 3y
3x + 4y + 1
2 3
y
3x + 4y + i,
x
4
_y + 3
~a
a
x + y
.2
-i
1
bx
.4
1
1
2
S
s
2
+ by
2
+
C
+
c
+
+ 1
S
3
-
1
S
2
c
Figure
304
3.
+ 1
ab + 1
s 4 + 2s2c 2 + c 4
2
i,
-S
© Copyright 2026 Paperzz