applying function identities (proposal)



I don't think apply1 isn't a convenient way to selectively
apply function identities. It's best for selectively making
substitutions. Yes, I can use apply1, but I think it's
too much work.

Say f(n, x) = x f(n-1, x) is an identity. And
suppose you want to apply it to the expression

   f(a,x) * f(b,x-y),

but you only want to apply it to the f(b,x-y) term. Okay,
define a rule. After a bit, you want to repeatedly
apply the identity f(n, x) = x f(n-1, x) to the expression

   f(7,x) + f(2,x) - f(5,x)

but you only want to apply it to terms of the form
f(k,x) where k > 2.  Now what do you do?  Define
another rule? After that you want to apply the
identity to every term of the form f(a,b) -- another
rule, and on and on. I'd prefer a solution that doesn't
force you into defining a new rule for every situation.

Barton