> It would be useful to be able to display them in exactly the form shown.
> Now let's enter them into MathPiper, and see what comes out:
>
> In> 4*x^3-5*x^2*z^2+2*x*y^2*z-3*z^2
> Result: 4*x^3-5*x^2*z^2+2*x*y^2*z-3*z^2
>
> In> -5*x^2*z^2+2*x*y^2*z+4*x^3-3*z^2.
> Result: 2*x*y^2*z-5*x^2*z^2+4*x^3-3*z^2.
>
> In> 2*x*y^2*z-5*x^2*z^2+4*x^3-3*z^2
> Result: 2*x*y^2*z-5*x^2*z^2+4*x^3-3*z^2
>
> This is not really "bad", but we have no control over it, and it does not
> show what we want to exhibit.
>
> Comments?
Tracing one of these expressions shows how it is being transformed by the rules:
%mathpiper
TraceOn();
-5*x^2*z^2+2*x*y^2*z+4*x^3-3*z^2.;
TraceOff();
%/mathpiper
A trace with less output can be obtained by using TraceSome:
%mathpiper
TraceSome("+,-")-5*x^2*z^2+2*x*y^2*z+4*x^3-3*z^2.;
%/mathpiper
The trace output seems to indicate that there is no formatting-related
transformations being done on the result expression.
Reduce has an internal format for polynomials and an output format for
polynomials which can be controlled with switches. The following
paragraph from page 149 of "Reduce: Software for Algebraic
Computation" by Rayna describes what happens when output formatting of
polynomials is turned off:
"The formatting, factoring, re-ordering, and so on which have been
described in several of the preceding sections take considerable time.
If the Reduce user doesn't care about any of these features, and
wants to speed up printing, he can use the command OFF PRI$ to
instruct the output package to display expressions in a form closely
reflecting the form in which they are stored internally. The output is
still in familiar algebraic form, but the ORDERING AND GROUPING OF
TERMS MAY SEEM ERATIC." (the emphasis is mine).
Since MathPiper does not make heavy use of switches, my thought is for
you to create some xxxForm functions (perhaps called LexForm,
GrlexForm, and GrevlexForm?) which will return expressions which are
formatted the way you would like them to be.
Ted
> I have done this, and it works. The output is a String, so no external
> formatting can get in the way.
That's great!
I am looking forward to when you commit these new functions to the
repository so that I can play with them.
Ted