On Tue, Apr 3, 2012 at 4:14 AM, [email protected]
<[email protected]> wrote:
> On a number of occasions the possibility of AST trees and
> canonicalizers was discussed (it started with what Nathan Rice said
> here https://groups.google.com/d/topic/sympy/fCQEdSQybTM/discussion
> and I asked some questions here
> https://groups.google.com/d/topic/sympy/rKnqkU_iK44/discussion).
>
> Why this change is useful was discussed in those threads.
>
> It seems that to have such structures evaluate=False must be used in
> many places. But as Ronan pointed out much of the code expects
> evaluate=True and fails if this is not the case. A solution will be to
> shift all of the core from the current ".flatten does all for every
> single class" paradigm to a nicer and well separated architecture of
> canonicalizers. Obviously this will take too much effort at the
> moment.
>
> I would like to know if this would be possible if not for the old code
> at least for the new code that will be written during the summer.
> Instead of every student adding something new to ".flatten" I propose
> that a single base class is implemented that just goes to the tail of
> Mul's and Add's .args and stays there. Then each student writes
> whatever he needs in terms of expression manipulation in his own
> canonicalizer.

What do you mean by "goes to the tail of .args and stays there"?  Do
you mean that the .flatten method for these classes would be a no-op,
or are you suggesting to put some kind of special marker object in
.args to signify the unevaluatedness to other classes?

Aaron Meurer

>
> Obviously, if the new canonicalizers do not know how to work with each
> other, one will not be able to mix their respective expressions. But
> this is also the case with the current .flatten and it was already
> discussed in the other threads.
>
> --
> 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.
>

-- 
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.

Reply via email to