matchdeclare matching functions or an alternative?



Your request isn't very clear, but I suspect that what you're looking for
is something like

matchdeclare(ff_xx, lambda([ex],not freeof('xx,ex)));

which will match any subexpression containing the variable xx.

You will have to be very careful in writing rules using a match like this.
 In particular, you want to make sure that the xx's somehow disappear from
your expression, otherwise you will have an infinite loop.

Here's a little (meaningless) test:


defrule(ff_xx_rule,ff_xx,subst('yy,'xx,ff_xx)^2+diff(ff_xx,'xx));
apply1(xx^3/3,ff_xx_rule) => ((yy^6/9+yy^2)^2+2*yy)^2+2


Is that what you had in mind?

         -s


On Fri, Feb 22, 2013 at 7:25 PM, Mike Valenzuela <mickle.mouse at gmail.com>wrote:

> Hello,
>
> I am wondering if there is a way to use matchdeclare to do the following:
>
> matchdeclare(ff(xx), isfunction(ff,xx))
> Where ff is supposed to be a function of xx.
>
> If it is possible, how?
> If not what do you suggest as an alternative?
> I am looking for write a simplification rule which allows an operator to
> "propagate" through implicit/explicit operators. By implicit I mean that
> ff(xx) could be something as simple as xx+1. By explicit I mean something
> like sin(xx). This is for implementing a custom "chain-rule."
>
> Thanks in advance
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>