Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#991 Bug in Rules/Patterns (defrule/apply1) with Summations

open
nobody
5
2006-12-26
2006-09-26
Anonymous
No

> I am trying to apply rule s2 as follows:
>
> (%i1) matchdeclare([_x,_n,_f,_p,_g,_q],all);
> (%o1) done
>
(%i2)apply(defrule,[s2,sum(_f(_x)*_g(_x),_x,1,_n),S(_f*_g)]);
> (%o2) s2:sum(_f(_x)*_g(_x),_x,1,_n)->S(_f*_g)
> (%i3) apply1(sum(f(i1064)*g(i1064),i1064,1,N),s2);
> (%o3) sum(f(i1064)*g(i1064),i1064,1,N)
> But it does not do replacement.
>
> While following rule s4 runs:
>
> (%i4)
apply(defrule,[s4,sum(_f(_x)^_p*_g(_x)^_q,_x,1,_n),S(_f^_p*_g^_q)]);
> (%o4) s4:sum(_f(_x)^_p*_g(_x)^_q,_x,1,_n)->S(_f^_p*_g^_q)
> (%i6) apply1(sum(f(i1064)^2*g(i1064)^3,i1064,1,N),s4);
> (%o6) S(f^2*g^3)

Discussion

  • Robert Dodier
    Robert Dodier
    2006-12-26

    • labels: --> Lisp Core - Simplification