ask(proposition, assumptions) evaluates a proposition built from the
predicates of Q to TRUE, FALSE or NA (unknown), using the
assumptions given, the extra assumptions in ... (joined with &) and
those of context, which is global_assumptions unless another
AssumptionsContext() is given. This is SymPy's ask(): the predicates'
handlers answer first, then a SAT based search over the facts known
about the expressions involved, then the linear real arithmetic solver for
inequalities. Relations such as x > 0 may appear in the proposition and
the assumptions. A proposition or assumptions that are not boolean raise
a TypeError, and inconsistent assumptions a ValueError.
Arguments
- proposition
A boolean expression such as
Q$positive(x),Q$even(x) | Q$odd(x)orx > 1.- assumptions
Assumptions, such as
Q$positive(x) & Q$integer(y), orTRUEfor none.- ...
Further assumptions, joined to
assumptionswith&.- context
An
AssumptionsContext()whose assumptions are also used.