diff --git a/sympy/logic/boolalg.py b/sympy/logic/boolalg.py index f6a2c7accb5b..e86211f22da2 100644 --- a/sympy/logic/boolalg.py +++ b/sympy/logic/boolalg.py @@ -1046,6 +1046,7 @@ def _eval_simplify(self, **kwargs): # And and Or, we only simplify the partial expressions before using # patterns rv = self.func(*[a.simplify(**kwargs) for a in self.args]) + rv = rv.to_anf() if not isinstance(rv, Xor): # This shouldn't really happen here return rv patterns = _simplify_patterns_xor() diff --git a/sympy/logic/tests/test_boolalg.py b/sympy/logic/tests/test_boolalg.py index ed37f7afe2d3..53de73f190ca 100644 --- a/sympy/logic/tests/test_boolalg.py +++ b/sympy/logic/tests/test_boolalg.py @@ -355,6 +355,7 @@ def test_simplification_boolalg(): assert And(Eq(x - 1, 0), Eq(x + 2, 2)).simplify() == False assert And(Ne(x - 1, 0), Ne(x + 2, 2)).simplify( ) == And(Ne(x, 1), Ne(x, 0)) + assert simplify(Xor(x, ~x)) == True def test_bool_map():