Fix issue 3155

The code checks if expr in simplify function is Boolean. If yes, then simplify_logic from sympy.logic gets called and the simplest logic equivalent is returned.