Two defrules can display the same, yet be different:
(%i1) matchdeclare(x,mapatom)$
(%i2) defrule(r1, f(x),x * f(x-1))$
(%i3) matchdeclare(x,true)$
(%i4) defrule(r2, f(x),x * f(x-1))$
Rules r1 and r2 display the same:
(%i5) disprule(r1);
(%t5) r1:f(x)->x*f(x-1)
(%o5) [%t5]
(%i6) disprule(r2);
(%t6) r2:f(x)->x*f(x-1)
(%o6) [%t6]
But the rules are different:
(%i7) apply1(f(x),r1);
(%o7) x*f(x-1)
(%i8) apply1(f(x),r2);
Maxima encountered a Lisp error:
Maybe somebody would like to take this on as a project---the
defrule code is too recondite for me to hack. As it is, defrule
isn't geared toward applying function identities that have
dummy variables --- defrule is more suited for applying
substitutions to expressions.
Barton