[GiNaC-devel] Fix for pattern matching

Matthias Dellweg dellweg at tp1.uni-duesseldorf.de
Fri Dec 20 15:02:38 CET 2013


Am Wed, 18 Dec 2013 21:29:51 +0200
schrieb Alexei Sheplyakov <alexei.sheplyakov at gmail.com>:

> Hi, Matthias,
> 
> 
> On Mon, Dec 9, 2013 at 3:08 PM, Matthias Dellweg
> <dellweg at tp1.uni-duesseldorf.de> wrote:
> 
> > Finally found it:
> >
> > for i in $(seq 1 30); do echo
> > 'match((exp(A)*sin(x))+(exp(B)*sin(y)),
> > (exp(A)*sin($0))+(exp(B)*sin($1)));' | ginsh ; done
> >
> > without the patch it fails approximately in one out of four cases.
> > With the patch it seems to succeed every time.
> 
> Thanks a lot. I've committed the fix and a test case (almost a week
> ago, sorry for a late notification).
> 
> Best regards,
>       Alexei
> _______________________________________________
> GiNaC-devel mailing list
> GiNaC-devel at ginac.de
> https://www.cebix.net/mailman/listinfo/ginac-devel

Hi Alexei,
did you check, whether your test fails probablistically within one
single process? I thougt the sorting order depends on the memorylayout
of the program. Therefor it was stable inside the debugger or one
process, but unstable accross several runs of the program.
And again: What do you think about inverting the matching from the
expression trying to match a pattern to the pattern trying to fit to an
expression?
Best wishes,
  Matthias


More information about the GiNaC-devel mailing list