Pattern matching in GiNaC CVS

Richard B. Kreckel kreckel at thep.physik.uni-mainz.de
Tue Jun 19 12:58:43 CEST 2001


On Mon, 18 Jun 2001, Do Hoang Son wrote:
> Hmmm, I don't know.
> Just look at Maple 
> 
> > c:=ln(x*y)*z;
> > subs(ln=foo,c);
> foo(x*y)*z
> 
> or in Mathematica
> 
> In[1]:= c=Log[x*y]*z
>  
> Out[1]= z Log[x y]
>  
> In[2]:= c//. Log[a__]-> foo[a]
>   
> Out[2]= z foo[x y]
> 
> There is not any problem there.
> One offent uses this trick to get rid of troubles that caused by a
> difined/internal functions.

No, there is not any problem since you haven't really shown us anything
that's going to happen later to this new foo() function.  Remember last
time we talked about such `obvious' transformations?  They turned out to
be blatant bugs in both Maple and Mathematica.

Seriously: please send us a simple example where something like this is 
needed in order to get around divergences or such and we can discuss
alternatives.

Cheers
    -richy.
-- 
Richard Kreckel
<Richard.Kreckel at Uni-Mainz.DE>
<http://wwwthep.physik.uni-mainz.de/~kreckel/>





More information about the GiNaC-devel mailing list