Hi Everyone, I'd like to know more about pattern matching within SymPy and how it can be applied beyond the Expr class.
I see that Basic has a matches method that does exact matching (so for example requires the same number of args and same arg sequence between pattern and expression). I see that AssocOp(Expr) has a _matches_commutative method that (I assume) allows freer matching. Some questions: How well does pattern matching work in SymPy on non-commutative symbols? How well does pattern matching work in SymPy on non-Exprs. Could _matches_commutative be moved up out of Expr to work on Basics? This code appears pretty general. Union(Set) is commutative too. The Wild class is a Symbol. How should we construct Wild objects for other non-expr types? How could we match sets for example? The code in _matches_commutative and mul.matches are difficult for me to understand. Are these implementing a known algorithm that I can look up somewhere. Are there supplemental docs or references? If anyone is knowledgeable or interested in extending pattern matching within SymPy I'd enjoy company on this project. -Matt -- 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.
