tellsimpafter issue



On 5/7/07, Robert Dodier <robert.dodier at gmail.com> wrote:
>
> > tellsimpafter(laplace(signum(aa-bb),aa,cc),exp(-bb*cc)/cc);...
> x - a is represented internally as x + (-1 * a).
> Try writing signum(aa + bb) instead.


Unfortunately, this doesn't work either: (slightly simplified example)

matchdeclare([a1,a2],atom)$
tellsimpafter(qqq(a1+a2,a1),rrr(a1,a2))$
a2 + a1 partitions `sum'                       <<<<<<<<<<<<< note warning
qqq(x+y,x) => qqq(y + x, x)              no simplification
qqq(x+y,y) => qqq(y + x, y)              no simplification

An even simpler problem:

tellsimpafter(ppp(a1+a2),ppx(a1,a2));
a2 + a1 partitions `sum'
ppp(x+y) => ppx(0, y + x)            <<<<<<<<< ignores matchdeclare of a1
and a2 as atoms!!!
      (perhaps this is just a simple bug)

tellsimpafter handles + and * differently from other operators.
> But maybe not when the main (top level) operator is not + or *.
>
Sorry to be vague; the code is confusing.


Exactly, the user shouldn't have to care about any of that. If you, looking
at the code, can't tell what is going on, how is the poor mathematical user
supposed to understand it?

It would be nice to have a pattern-matching package that was both powerful
and easy to use. Unfortunately, that is not currently the case.  In the
meantime, it often turns out to be easier to write one's own matching
code... regrettably.

           -s