On 1 Mai, 16:40, Haz <[email protected]> wrote: > The cache issue runs deeper -- variable x, that depends on variably y, may > simplify to something that doesn't even involve y because of the assumptions > that come with y. In this case, a result is stored for x that is only valid > under the right assumptions for y, and we would need to be very careful > about what cache entries change when we delete y. > > The example may sound contrived, but it does arise in practice, and was a > headache to debug. >
Well there must be an end to it, right? Every assumption is about symbols. Every symbol x that depends in any way on another symbol y has y in its free_symbols. In fact any exrpession has all symbols it depends on (recursively) in its free_symbols. Hence it would be enough to pull all assumptions involving any free symbols into the hash computation. Right? [If not then one point in the above chain of argument must be wrong; this is very well possible :-)] Of course then we want a quick way to find all assumptions involving a given symbol. The easiest would be to have the symbol store a list of assumptions it is involved in. … Which brings us back to ronan's comment that all this is not much different from storing assumptions with the symbols anyway. > On Sat, Apr 30, 2011 at 2:21 PM, Tom Bachmann <[email protected]>wrote: > > > > > > It should also be emphasized that it isn't just a simple notion of > > > cleaning up assumptions after yourself -- the cache interacts in quite an > > > intertwined way. Under the right assumptions, expressions will be > > > simplified, and variables will be assigned certain values. If that's > > stored > > > in the cache, changing any related assumption will invalidate the result. > > > Why not make assumptions part of the hash of an object? At least to > > the extent that the cache is concerned? > > > -- > > 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.
