Initial implementation of the query system
I sent some patches to sympy-patches with an initial implementation of the query system.
You can check it out by pulling from my branch:
into your sympy repo.
Some examples of what you can do (sample isympy session):
Returns None, as we do not know whether x is positive or not.
Out[2]: True
because abs() is always positive. Because exp() is always positive, the following should also be True:
but why then does it return None ?. Well, it simply is not True that exp() is always positive, it is always positive for real values, but SymPy does not assume that x is real, so you would have to specify that. This is now done with the keyword assumptions:
Out[5]: True
As you can see, now assumptions are independent objects and are not tied to symbols any more. For more examples, see the file sympy/query/tests/test_query.py
still in the TODO list:
- support for global assumptions
- solve more complex implications, like
where it should build the chain of implications even => integer => rational => real. This chain of implications currently stops at rational for efficiency reasons, because the number of facts grows in each step which makes the number of possible paths grow exponentially.
September 5th, 2009 at 2:45 pm
Отличное наполнение блога, есть что почитать интересного, спс
September 12th, 2009 at 8:30 am
А мне нравится этот блог, только авторам надо помнить , что посетители разные бывают. Короче учитывайте возростной ценс посетителей.
November 23rd, 2009 at 8:04 pm
There’s no secret about success. Did you ever know a successful man who didn’t tell you about it?