Le 03/11/2012 18:28, Matthew Rocklin a écrit :
I've run into an issue with the new assumptions system. Can anyone see what is going on? Here is an exampleI've written this logic about triangular matrices into an assumptions handler In [1]: X = MatrixSymbol('X', 3, 3) In [2]: Y = MatrixSymbol('Y', 3, 3) In [3]: ask(Q.lower_triangular(X+Y), Q.lower_triangular(X) & Q.lower_triangular(Y)) Out[3]: True I've added the following two lines to known_facts Implies(Q.lower_triangular, Q.triangular), Implies(Q.upper_triangular, Q.triangular), Which makes the following possible In [4]: ask(Q.triangular(X), Q.lower_triangular(X)) Out[4]: True However I don't seem to be able to combine the two In [5]: ask(Q.triangular(X+Y), Q.lower_triangular(X) & Q.lower_triangular(Y)) <returns None> What could be happening here? Does SymPy support this kind of inference?
No, the new-style assumptions don't support this, only the old ones do that kind of thing. The new-style assumptions work by either evaluating the predicate or making logical deductions from assumptions operating on the same argument, but they can't infer the need for intermediate steps (in this case Q.lower_triangular(X+Y)).
-- 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.
