Tellsimp and stack overflow.



On Tue, Jun 22, 2010 at 4:38 AM, Grigory Sarnitskiy
<sargrigory at yandex.ru> wrote:

> matchdeclare (mulexp, lambda ([e], not atom(e) and op(e) = "*"))$
>
> tellsimp (RAv (mulexp), RAv (first (mulexp)) * RAv (rest (mulexp)) + RAv (RPl(first(mulexp)) * RPl(rest(mulexp))) )$
>
> Obviously, that's never ending recursion. Can I somehow set it to break after n steps?

Well, one approach would be to replace "*" by some other
operator, let's say FOO, and then as a separate step replace FOO by "*".

tellsimpafter (but not tellsimp) handles "*" and "+" (but none others)
as commutative n-ary operators, and has a special scheme for handling
them. The reference manual for tellsimpafter tells about that.

It's not clear to me what you're trying to do. Maybe if you state the
rules informally (not as Maxima declarations) I can help you formulate
the appropriate tellsimpafter incantation.

best

Robert Dodier