Artifact ec7b26136bb1c2ef00c0291dd96bd146c9b1a54713a4c5025edd03aabc9fa3c1:
- Executable file
r38/packages/dipoly/dipprint.red
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1174) [annotate] [blame] [check-ins using] [more...]
module dipprint; %/* printing routines for distributive polynomials*/ % Authors: R. Gebauer, A. C. Hearn, H. Kredel symbolic procedure diplprint u; % Prints a list of distributive polynomials using dipprint for each v in u do dipprint v; symbolic procedure dipprint u; % Prints a distributive polynomial in infix form <<terpri(); dipprint1(u,nil); terpri(); terpri()>>; symbolic procedure dipprint1(u,v); % Prints a distributive polynomial in infix form. % U is a distributive form. V is a flag which is true if a term % has preceded current form if dipzero!? u then if null v then dipprin2 0 else nil else begin scalar bool,w; w := diplbc u; if bcminus!? w then <<bool := t; w := bcneg w>>; if bool then dipprin2 " - " else if v then dipprin2 " + "; (if not bcone!? w or evzero!? x then <<bcprin w; dipevlpri(x,t)>> else dipevlpri(x,nil)) where x = dipevlmon u; dipprint1(dipmred u,t) end; symbolic procedure dipprin2 u; % Prints u, preceding by two EOL's if we have reached column 70 <<if posn()>69 then <<terpri(); terpri()>>; prin2 u>>; endmodule;;end;