thanks! see below. On Wed, Apr 18, 2012 at 15:47, krastanov.ste...@gmail.com < krastanov.ste...@gmail.com> wrote:
> 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. > Looking into this. For now, most interested in FiniteSet, usefull for discrete probability. But to be usefull, a part of the definition of a FiniteSet should be its Universe, I cannot see it is that now. How should that be done? Extending the definition, as it is now, or assum that the user defines a superclass of FiniteSet (not sure about the Python terminology here...) in a certain way? Kjetil > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sympy@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > > -- "If you want a picture of the future - imagine a boot stamping on the human face - forever." George Orwell (1984) -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.