On Apr 13, 2013, at 2:57 AM, Tom Bachmann <[email protected]> wrote: 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. There was some discussion of this at https://github.com/sympy/sympy/pull/1907. I think we should go with a multiple approach. Some facts work well in the current handler system (better if we had backwards chaining). We also want to let the user extend the system with facts on his own objects. And some facts work in neither way, like the kind discussed in that pull request. Aaron Meurer 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. -- 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.
