Hi,
I spent the last two days studying in a bit more detail the new
assumptions system. Are we *sure* that it can replace the old one?
I'm asking in particular because the new system does not do any
automated backwards chaining. The new system basically works like this.
To compute ask(is_foo(x), facts), we first call
FooHandler.<type(x)>(facts). This can do specialised reasoning, like
x+y>0 provided x>0 and y>0. This specialised code is also allowed to
call ask recursively (e.g. on subexpressions).
If this fails, we forget about the specialised handlers completely, and
try to deduce foo (or not foo) from the facts alone, via a set of
logical inference rules.
That is, in order to have backwards chaining, the handlers have to
implement it by hand! For example, we have the implication
(positive=>nonzero). Cosider the query ask(Q.nonzero(expr)). Suppose
there is a specialised positive handler for expr, but not a nonzero
handler. Then the result will be None.
Note that the problem goes away if we require a full set of handlers to
be implemented for each type. Is this desired? Or should I implement
backwards chaining?
Also, a question about code organisation. In the new assumptions system,
knowledge is expressed in "handlers", distinct from the actual objects.
Instead, the knowledge is grouped by property. E.g. there is an
AskPositive handler, which contains all the knowledge about when objects
are positive (although there can be several such handlers). Does that
make sense in general. For example, in the special functions library, it
seems much more sensible to group knowledge by function instead of property.
Thanks,
Tom
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.