Specification of ratsubst WAS: Forcing substitution
Subject: Specification of ratsubst WAS: Forcing substitution
From: Richard Fateman
Date: Mon, 9 Jun 2008 10:53:35 -0700
ratsubst (A,B, C) essentially tries to divide C by the highest power of B
that goes into it.
That is, it rewrites C= q*B^n+r. It then returns q*A^n+r. [it looks for
the next-highest-power of B... etc]
As you are aware, division requires a "main variable", and I think this is
some variable occuring in B and C, and is the one that most likely to be
eliminated.
In the examples below, b is the main variable. Why it is chosen, I don't
know, offhand.
The details may be in Project MAC TR-95. (my PhD dissertation).
http://citeseer.ist.psu.edu/cache/papers/cs/26086/http:zSzzSzwww.lcs.mit.edu
zSzpublicationszSzpubszSzpdfzSzMIT-LCS-TR-095.pdf/fateman72essays.pdf
on page 98,
but that describes 4 or 5 versions of ratsubst.
RJF
_____
From: macrakis at gmail.com [mailto:macrakis at gmail.com] On Behalf Of Stavros
Macrakis
Sent: Monday, June 09, 2008 10:33 AM
To: fateman at EECS.Berkeley.EDU
Cc: rowlett at atlascomm.net; Maxima List
Subject: Specification of ratsubst WAS: Forcing substitution
ratsubst does indeed solve Owlett's problem.
But I'd be interested to know what exactly the *specification* of ratsubst
is. Consider, for example:
ratsubst( r, a+b, a*2+b ) => r+a
ratsubst( r, a+b, a+b*2 ) => 2*r-a
Why the assymmetry? Presumably something to do with variable ordering, but
I can't get it to act differently if I change ratvars or use CREs with
well-defined variable ordering, e.g. rat(a+b*2,a,b).
-s