It would be a strain to say that sympy has a nicely abstracted rule set. In most of the code all such rules are just a part of the logic of the methods of the class in question.
For example (a+a) ---> 2*a is just part of the Add __new__ method. When you call Add(a,a) it would apply appropriate rules and give you Mul(2,a). There is occasionally discussion about abstracting better such rules, but this is not yet done. So if you want an object that simplifies automatically in a certain way, just implement the rules in the __new__ method or a helper function and you will be good to go. It is not the cleanest solution, but is how most of the stuff is done at the moment. I hope that this answers you question. BTW, there is a statistics module that implements many useful idioms from probability theory and there is a set class that will definitely can be extended if you are interested in helping. -- 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.
