> In one sentence, at the moment Add and Mul and others are both > containers and canonicalizators (if this word exists :). I want to > have them separate, so different canonicalizators can be used on the > same expr (real algebra vs quantum module vs multilinear vs group > theory vs any other system that works on symbols). > > This means that at least at the beginning Add, Mul, etc will be used > as they are now - both containers and canonicalizators for the real > algebra that sympy supports, but at the same time they will be used > with evaluate=False as only containers for other symbolic systems. > > @Nathan Rice, If I understand correctly, your idea is to have the > entire core of sympy working in that manner. Am I correct? Do you have > some proof of concept code?
Did you see the github link I posted? https://github.com/nathan-rice/symbolic The Symbol class in the posted code does the following simultaneously: 1. Builds a closure chain that will execute the sequence of operations as if the original object had been used 2. Records the necessary information to generate an AST representation of the code that would perform that sequence of operations. Even ugly things like attribute setting, augmented assigns, and what not are supported. Python is obnoxious about crossing from expression to statement, but that is mostly handled as well. I even dealt with history bookkeeping when performing operations on two symbols that were the target of multiple statements. There are lots of tests, and only a few things are broken off the top of my head (__divmod__ and performing n-ary (n>1) operations where one of the arguments is also a Symbol object). Nathan -- 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.
