Artifact a3f5df4110caf39df6b52e3ae04eb7674c473a670777c337573957f830007334:
- Executable file
r37/packages/dipoly/dip2a.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: 942) [annotate] [blame] [check-ins using] [more...]
module dip2a; %/* Functions for converting distributive forms into prefix forms*/ %/*Authors: R. Gebauer, A. C. Hearn, H. Kredel*/ expr procedure dip2a u; % /* Returns prefix equivalent of distributive polynomial u*/ if dipzero!? u then 0 else dipreplus dip2a1 u; expr procedure dip2a1 u; if dipzero!? u then nil else ((if bcminus!? x then list('minus,dipretimes(bc2a bcneg x . y)) else dipretimes(bc2a x . y)) where x = diplbc u, y = expvec2a dipevlmon u) . dip2a1 dipmred u; expr procedure dipreplus u; if atom u then u else if null cdr u then car u else 'plus . u; expr procedure dipretimes u; % /* U is a list of prefix expressions the first of which is a number. % Result is prefix representation for their product*/ if car u = 1 then if cdr u then dipretimes cdr u else 1 else if null cdr u then car u else 'times . u; endmodule; end;