sympy/sympy — pull request #2451 by Tempel (2013-09-12 00:19:15+00:00)
Title: Issue 4009: Fix predicate detection in simplify_logic.

Previously, simplify_logic would assume all free symbols were predicates, and
would construct a truth table based on results of substituting True/False for
each. This would sometimes result in incorrect simplifications when Boolean
structures were made containing other expressions. Now, it takes anything
that is not a BooleanFunction as a predicate, then simplifies the predicates
before reassembling.