- Regarding Symbol('x', positive=True), I think this requires some
thought. I am beginning to think that actually the best way to do this
is to keep doing it like we do it now (modulo some refactoring of the
Symbol class).

I think perhaps there needs to be a separate set of global
assumptions, which are assumptions that never change. For example,
Q.positive(pi) (from my understanding this currently works by calling
.evalf(); we should see if it's faster to do that or to store a bunch
of Q.positive(pi) and so on explicitly, but anyway, not all custom
object assumptions can be generalized like this) never changes, and so
it should never be cleared, and additionally any facts resulting from
it should never be cleared.

In general, we want to allow objects to define their own assumptions
about themselves, so that things can remain modular, and so that
objects in user-land can work as first-class citizens with the
assumptions. So, given that, I think that Symbol('x', positive=True)
should be no different. This "keeps the assumptions in the core", but
really, the issue is the inference code in the core. So I would just
leave Symbol('x', positive=True) alone for now, and refactor how it
works internally once we have a good API for how custom objects define
their own assumptions on themselves.


Maybe I wasn't being clear about this, but my current suggestion is to have an (immutable) .assumptions property/field on every Basic (or perhaps just on Symbol and Dummy). This will hold predicates, like Q.positive, implicitly referring to itself. Then the assumptions code pulls in this extra knowledge automatically.

[Note: having this immutable field on objects is essentially equivalent to having an append-only global assumptions set indexed by objects, except that the former solution is more garbage-collection friendly.]

Matthew suggested this solution should only be temporary. In principle, the way to define "static" assumptions on objects is to put them into handlers, at least currently. But the whole point of disentangling the assumptions and the core is that we can change such things reasonably easily.

I'll think about your other points.

--
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to