Exemplo n.º 1
0
Arquivo: ask.py Projeto: zalois/sympy
from sympy.logic.boolalg import (to_cnf, And, Not, Or, Implies, Equivalent,
    BooleanFunction, BooleanAtom)
from sympy.logic.inference import satisfiable
from sympy.utilities.decorator import memoize_property


# Deprecated predicates should be added to this list
deprecated_predicates = [
    'bounded',
    'infinity',
    'infinitesimal'
]

# Memoization storage for predicates
predicate_storage = {}
predicate_memo = memoize_property(predicate_storage)
# Memoization is necessary for the properties of AssumptionKeys to
# ensure that only one object of Predicate objects are created.
# This is because assumption handlers are registered on those objects.


class AssumptionKeys(object):
    """
    This class contains all the supported keys by ``ask``.
    """

    @predicate_memo
    def hermitian(self):
        """
        Hermitian predicate.
Exemplo n.º 2
0
Arquivo: ask.py Projeto: atreyv/sympy
from sympy.assumptions.assume import (global_assumptions, Predicate,
        AppliedPredicate)
from sympy.core.decorators import deprecated
from sympy.utilities.decorator import memoize_property


# Deprecated predicates should be added to this list
deprecated_predicates = [
    'bounded',
    'infinity',
    'infinitesimal'
]

# Memoization storage for predicates
predicate_storage = {}
predicate_memo = memoize_property(predicate_storage)
# Memoization is necessary for the properties of AssumptionKeys to
# ensure that only one object of Predicate objects are created.
# This is because assumption handlers are registered on those objects.


class AssumptionKeys(object):
    """
    This class contains all the supported keys by ``ask``.
    """

    @predicate_memo
    def hermitian(self):
        """
        Hermitian predicate.