rules question



matchdeclare([r,s],true);
defrule(f, a(b(r),s),  something(a,b,r,s));
You can apply the rule f in various ways.  Like
apply1,  apply2, etc.

If  something.. includes the pattern you started
with, you might be specifying a non-terminating
computation.  In particular, replacing x by x^2
means x^2 gets replaced by (x^2)^2  etc.
RJF



Andrei Zorine wrote:
> x_ is a pattern which matches to any expression. I wanted to be able to
> have something like
> f : a(b(c),d) -> d(c) for all c,d and fixed a,b
> As you see, it's not just about substituting, but about extracting also.
> -- 
> Andrei Zorine
> 
> Stavros Macrakis wrote:
>  >>in fact I want to have something like mathematica's x_
>  >>pattern to use it inside some bigger expression.
>  >
>  >
>  > I am not familiar with Mathematica semantics.  What exactly is a
>  > Mathematica x_ pattern, and how does it work?
>  >
>  > Maybe we would understand better how to help you solve your problem if
>  > you would give us more background.  What exactly are you trying to do?
>  >
>  >        -s
>  >
>  >
>  >
> 
> 
> 
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima