I think that to understand why this is unlikely, you could read
about inherited and synthesized attributes (usually in relation
to intermediate expression trees in the theory of compiling.)
RJF
On Monday, September 1, 2014 9:54:36 AM UTC-7, Joachim Durchholz wrote:
>
> Am 01.09.2014 um 13:28 schrieb F. B.:
> > SymPy's default pattern matcher is not a structural one, i.e. it tries
> to
> > match according to some mathematical rules. A structural pattern matcher
> > would instead just match the structure of the expression-tree.
> >
> > While it is necessary to have some mathematical awareness such as, give
> the
> > wild *w*:
> >
> > - associativity awareness (i.e. f(a, b, c) = f(a, f(b, c)) and
> similar):
> > (a+b+c).match(a+w) ==> {w: b+c}
> > - commutativity awareness:
> > (a+b).match(w+a) ==> {w: b}
> > - one-identity awareness (f is one-identical if f(x) = x for any x):
> > x.match(Add(w, evaluate=False)) ==> {w: x}
>
> You can inject math awareness into a structural pattern matcher by
> letting the structure declare its mathematical properties.
>
> E.g. a function could have a one_identity_aware attribute, and the
> structural pattern matcher could have a primitive that inspects such
> attributes.
>
> (I hope that was understandable.)
>
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/97b78229-dec1-4d36-9ec9-40ee284ca014%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.