Behavior of the function 'has'

Christian Bauer cbauer at thep.physik.uni-mainz.de
Wed Mar 13 15:49:59 CET 2002


Hi!

On Tue, Mar 12, 2002 at 12:59:07PM +0100, Tatiana Zolo wrote:
> > has(2^x*3^x*4^x, 2^x);
> 1
> > has(2^x*3^x*4^x, 2^x*3^x);
> 0

has(e, x) returns true if and only if a subexpression of e (as defined by
op()) matches (as defined by match()) x (or e matches x entirely). "2^x*3^x"
is not a subexpression of "2^x*3^x*4^x" by this definition.

A workaround is to use

  > has(2^x*3^x*4^x, 2^x*3^x*$0);
  1

Bye,
Christian

-- 
  / Coding on PowerPC and proud of it
\/ http://www.uni-mainz.de/~bauec002/



More information about the GiNaC-list mailing list