On Apr 30, 3:05 pm, basti <[email protected]> wrote:
> On Apr 28, 2:59 am, Ronan Lamy <[email protected]> wrote:
> > Le mardi 27 avril 2010 à 15:49 -0700, basti a écrit :
>
> > > Like many others before I stumbled over sympy's pattern matching. I'm
> > > mainly interested in matching non-commutative expressions - which is
> > > currently simply not implemented.
> > > While starting implementing it I detected some shortcomings with sympy
> > > which have to be solved first:
>
> > > (1) Inconvenient and surprising matching results (also for commutative
> > > expressions).
> > > (2) subs mechanism does not respect non-commutativity at all.
> > > (3) subs does not allow evaluate=False as keyword
>
> > > I will continue working on all three topics in the near future and
> > > have already started (1) and (3).
>
> > Cool! Can you share your code, even if it's not polished yet? (Just
> > create a personal github repo, if you don't have one already and push
> > your branch there)
>
> My gitrepo is [email protected]:bastikr/sympy.git
> The interesting branch is "subs". In this branch I implemented a first
> attempt of a structural pattern matching algorithm. Then I
> reimplemented subs so that it now uses this algorithm whenever the
> pattern that should be substituted is not a simple atom. For atomic
> substitution I implemented a method in Basic called "_subs_atom". (I
> saw in your gitrepo that you also implemented something like this,
> maybe we should discuss this method separately).
> Currently there are 22 failures and 27 exceptions when I run the test
> suite so it's by far not finished.
>
> Sebastian
By the way, this already brings some neat improvements. E.g:
In [2]: u = Wild("u")
In [3]: (x**3).subs(x**u, u*x**(u-1))
Out[3]:
2
3⋅x
;)
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.