On Tue, Jun 22, 2010 at 12:31 AM, Ondrej Certik <ond...@certik.cz> wrote:
>
>
> I would be more than happy if we can remove all caching altogether,
> but since it currently would slow sympy down, Well, maybe not anymore.
> We should do some tests. But let's say we need to keep the cache (at
> least optional).
>

  I've disabled it for the time being to focus on bugs that aren't caused by
lingering assumptions (even though the assumptions are deleted from the
global_assumptions :p). This does, however, have an adverse effect. Namely,
if x and y are symbols, then x(y) != x(y)...but if you have xy = x(y), then
xy == xy (obviously). This manifested itself in the test case modified here:
-
http://github.com/haz/sympy/commit/daf138a90d3112cdcca4abe70ce134040c54c968


> Do I understand correctly, that now the expressions don't remember
> their assumptions themselves, but you need to use either local or
> global assumptions? If so, I would just store the pure expression in
> the cache and only store the result in some form, that is independent
> of the assumptions. Or maybe with the assumptions themselves -- e.g.
> both an expression and the assumptions.
>

  So it's a little to intertwined at the moment. When you create an object,
it evaluates to different things (ie. simplifies itself at creation time)
depending on the current assumptions in the global_assumptions. This
simplified representation is then what's cached.

  Because of the above point, I think we really do still need a cache (and
it's mighty slow testing now). But if symbols and expressions are tied to
the assumptions they are related to, then we should partially cleanse the
cache of anything related to an assumption being added or deleted from the
global_assumptions. This means wrapping some more functionality in the
AssumptionContext and modifying the cache so it can clean out anything
related to a set of variables. Both things that I most likely won't be able
to get to this week :p.

  Cheers

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@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.

Reply via email to