[Python] python sympy satisfiable vs solveable?

Discussão em 'Python' iniciado por Stack, Janeiro 19, 2025.

  1. Stack

    Stack Membro Participativo

    I'm learning to use sympy and am doing

    >>> from sympy import *
    >>> x, y, z, t = symbols('x y z t')
    >>> k, m, n = symbols('k m n', integer=True)
    >>> f, g, h = symbols('f g h', cls=Function)
    >>> init_printing()
    >>> satisfiable((x > 3) & (x == 1))
    False


    which is correct. But if I change the last part of that instruction

    >>> print(satisfiable((x > 3) & (x <= 1)))
    {Q.le(x, 1): True, Q.gt(x, 3): True}


    I would have expect that to resolve to 'False'. Clearly there's something I'm not understanding about sympy and satisfiable. Can anyone give me a clue?

    Continue reading...

Compartilhe esta Página