[Maxima] Rules and Patterns - bug?

Robert Dodier robert.dodier at gmail.com
Wed Apr 1 15:16:34 CDT 2009

2009/4/1 Martin Schönecker <ms_usenet at gmx.de>:

> Doesn't the rule, or the predicate, or the pattern make a mistake here?
>  The pattern yy of type barp was constructed to match an atom, which is
> not fulfilled here?  Shouldn't the last bit return something like
> x*y*HEY_LOOK(foo, z), or with any permutation of the {x,y,z}?

For + and *, the matching code captures all of the matching
arguments. e.g. given matchdeclare(aa, blurfp), then the code
assigns to aa a single term such that blurfp(aa) => true,
--or-- a product of terms such that map(blurfp, args(aa)) =>
[true, true, true, ...].

Only + and * are treated that way. I have considered extending
to code to treat all commutative n-ary operators like that but
never got around to it.


Robert Dodier

More information about the Maxima mailing list