defrule and apply1



Yes,
*
matchdeclare([s1,s2],constantp,[W1,W2],lambda ([e], not constantp (e)))$
declare(C1,constant,C2,constant)$
defrule(r11, A(   W1(a),s1*W2(a)),s1*A(W1(a),W2(a)))$
defrule(r12, A(s1*W1(a),   W2(a)),s1*A(W1(a),W2(a)))$
defrule(r13, A(s1*W1(a),s2*W2(a)),s1*s2*A(W1(a),W2(a)))$
wyr:A(C1*F1(a),C2*F2(a))$
apply1(wyr,r11,r12,r13);
*
really works. Thank you so much again.
Marek.
___________________________________
Robert Dodier wrote:
> On Thu, Sep 9, 2010 at 12:42 PM, Marek Pietrow<mrk at kft.umcs.lublin.pl>  wrote:
>
>> matchdeclare ([s1, s2], constantp, [t1, t2], lambda ([e], not constantp
>> (e)));
>> defrule (r13, A (s1*t1, s2*t2), s1*s2 * A (t1, t2));
>> wyr:A(s1*t1,s2*t2);
>> apply1(wyr,r13);
>
>> If yes, it seems to not work. Either for wyr:A(s1*t1,s2*t2); nor for
>> wyr:A(s1*t1(a),s2*t2(a));
>
> Try it with your previous expression, in which C1 and C2 were
> declared constants.
>
> best
>
> Robert Dodier
>