[GiNaC-devel] Fix for pattern matching

Matthias Dellweg dellweg at tp1.uni-duesseldorf.de
Sat Dec 7 00:03:30 CET 2013


Am Fri, 06 Dec 2013 10:47:19 +0200
schrieb Alexei Sheplyakov <alexei.sheplyakov at gmail.com>:

> > while using GiNaC, I came across a strange behaviour with pattern
> > matching in products having more than one wildcard. The match
> > succeeded in a probablistic fashion.
> 
> Could you please give some examples so I can make a proper test case?

Try this:

exmap repl_lst;
cout << (t*t*exp(t*A)).match(pow(t, wild(0))*exp(wild(1))*A, repl_lst)
  << repl_lst << endl;

It turns out, my repl_lst was actually prefilled by a failed match
before. It didn't fail on its own. But it must somehow be possible to
create a Situation where a single match triggers this problem on its
own.

Kind regards,
 Matthias


More information about the GiNaC-devel mailing list