declare(A,outative)



Thank you,
I think it is nice idea this forcing with the rule definition pulling 
out the constant from the second argument. But I cannot understand what 
is the lines:
notone(x):=if x=1 then true else false;
matchdeclare(n1, notone);
Launching:
*
notone(x):=if x=1 then true else false;
matchdeclare(n1, notone);
defrule (rule, A(x(a), n1*y(a)), n1* A(x(a),y(a)))
apply1(A(x(a),%i*y(a)),rule);
*
makes maxima working for unreasonable time, I have to break this 
calculation.
If I typed:
*
defrule(a1, A(x(a),s*y(a)),s*A(x(a),y(a)));
*
gives good result for:
*
apply1(A(x(a),s*y(a)),a1);
*
but if I set the constant like
*
apply1(A(x(a),%i*y(a)),a1);
*
it does not work.
If I added in the beginning the declaration that 's' means constant:
*
declare(s,constant);
defrule(a1, A(x(a),s*y(a)),s*A(x(a),y(a)));
apply1(A(x(a),%i*y(a)),a1);
*
nothing have been changed.
How to tell maxima that the rule should be applied to any constant?

Best regards, Marek Pietrow.

______________________________
Richard Fateman wrote:
> I think you can do  apply1(expres,r1,r2), to save some typing..
>
> You may need more rules like
>
> notone(x):=if x=1 then true else false
>
> matchdeclare(n1, notone);
>
> defrule (r3, A(x(a), n1*y(a)), n1* A(x(a),y(a)))
>
>
> RJF
>