(expr)
return dict((symbols[abs(lit) - 1], lit > 0) for lit in solver.var_settings)
Check satisfiability of a propositional sentence.
    It returns a model rather than True when it succeeds

    Examples
    ========

    >>> from sympy.abc import A, B
    >>> from sympy.logic.algorithms.dpll2 import dpll_satisfiable
    >>> dpll_satisfiable(A & ~B)
    {A: True, B: False}
    >>> dpll_satisfiable(A & ~A)
    False
Check satisfiability of a propositional sentence.
    It returns a model rather than True when it succeeds
Check satisfiability of a propositional sentence . It returns a model rather than True when it succeeds
def dpll_satisfiable(expr):
    """
    Check satisfiability of a propositional sentence.
    It returns a model rather than True when it succeeds

    Examples
    ========

    >>> from sympy.abc import A, B
    >>> from sympy.logic.algorithms.dpll2 import dpll_satisfiable
    >>> dpll_satisfiable(A & ~B)
    {A: True, B: False}
    >>> dpll_satisfiable(A & ~A)
    False

    """
    symbols = sorted(_find_predicates(expr), key=default_sort_key)
    symbols_int_repr = range(1, len(symbols) + 1)
    clauses = conjuncts(to_cnf(expr))
    clauses_int_repr = to_int_repr(clauses, symbols)

    solver = SATSolver(clauses_int_repr, symbols_int_repr, set())
    result = solver._find_model()

    if not result:
        return result
    # Uncomment to confirm the solution is valid (hitting set for the clauses)
    #else:
        #for cls in clauses_int_repr:
            #assert solver.var_settings.intersection(cls)

    return dict((symbols[abs(lit) - 1], lit > 0) for lit in solver.var_settings)
def dpll_satisfiable ( expr ) : symbols = sorted ( _find_predicates ( expr ) , key = default_sort_key ) symbols_int_repr = range ( 1 , len ( symbols ) + 1 ) clauses = conjuncts ( to_cnf ( expr ) ) clauses_int_repr = to_int_repr ( clauses , symbols ) solver = SATSolver ( clauses_int_repr , symbols_int_repr , set ( ) ) result = solver . _find_model ( ) if not result : return result # Uncomment to confirm the solution is valid (hitting set for the clauses) #else: #for cls in clauses_int_repr: #assert solver.var_settings.intersection(cls) return dict ( ( symbols [ abs ( lit ) - 1 ] , lit > 0 ) for lit in solver . var_settings )