>
> >   There was push-back from the community since removing the
> > Symbol('x', positive=True) syntax was largely frowned upon.
>
> As I recall, the problems were that it was slow and broke a lot of
> things. Symbol(x, positive=True) is easy to hack back in.
>

  The speed degradation was primarily due to the cache being disabled (which
the second branch avoided by flushing the cache after every assumption use).

>   I don't think this is the case. Trivial queries (those that already
> > have obvious implications) are compiled into quick reference
> > dictionaries. In particular:
> > -
> https://github.com/sympy/sympy/blob/master/sympy/assumptions/ask.py#L114
> >
> I think that the problem is with non-trivial queries, for which that
> code does nothing.
>

  The non-trivial queries are broken up, and non-trivial facts are compiled
and stored (the lookup isn't just on the facts we input, but on the facts
that can be derived). Having a good example of a query that the old
assumption system can perform (and the new one can't) would be good to have.


> The cache is the source of a lot of problems. We should try to use it as
> little as possible, even if it's not really possible to remove it at
> this time.
>

  So what are your thoughts on flushing it at the end of every computation?

The idea is to write '~Q.real(x)' instead of 'Assume(x, Q.real, False)'.
> It's shorter, easier to understand and doesn't suggest wrongly that
> creating the object does anything beyond that.
>

  Only issue with this is that we'll need to start handling (in the
assumption context), arbitrary boolean formulae: Q.positive(x) |
Q.negative(x)

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