(expr, simplify=False)
return distribute_or_over_and(expr)
Convert a propositional logical sentence s to disjunctive normal form.
    That is, of the form ((A & ~B & ...) | (B & C & ...) | ...)
    If simplify is True, the expr is evaluated to its simplest DNF form.

    Examples
    ========

    >>> from sympy.logic.boolalg import to_dnf
    >>> from sympy.abc import A, B, C
    >>> to_dnf(B & (A | C))
    Or(And(A, B), And(B, C))
    >>> to_dnf((A & B) | (A & ~B) | (B & C) | (~B & C), True)
    Or(A, C)
Convert a propositional logical sentence s to disjunctive normal form.
    That is, of the form ((A & ~B & ...) | (B & C & ...) | ...)
    If simplify is True, the expr is evaluated to its simplest DNF form.
Convert a propositional logical sentence s to disjunctive normal form . That is of the form (( A & ~B & ... ) | ( B & C & ... ) | ... ) If simplify is True the expr is evaluated to its simplest DNF form .
def to_dnf(expr, simplify=False):
    """
    Convert a propositional logical sentence s to disjunctive normal form.
    That is, of the form ((A & ~B & ...) | (B & C & ...) | ...)
    If simplify is True, the expr is evaluated to its simplest DNF form.

    Examples
    ========

    >>> from sympy.logic.boolalg import to_dnf
    >>> from sympy.abc import A, B, C
    >>> to_dnf(B & (A | C))
    Or(And(A, B), And(B, C))
    >>> to_dnf((A & B) | (A & ~B) | (B & C) | (~B & C), True)
    Or(A, C)

    """
    expr = sympify(expr)
    if not isinstance(expr, BooleanFunction):
        return expr

    if simplify:
        return simplify_logic(expr, 'dnf', True)

    # Don't convert unless we have to
    if is_dnf(expr):
        return expr

    expr = eliminate_implications(expr)
    return distribute_or_over_and(expr)
def to_dnf ( expr , simplify = False ) : expr = sympify ( expr ) if not isinstance ( expr , BooleanFunction ) : return expr if simplify : return simplify_logic ( expr , 'dnf' , True ) # Don't convert unless we have to if is_dnf ( expr ) : return expr expr = eliminate_implications ( expr ) return distribute_or_over_and ( expr )