diff --git a/sympy/logic/boolalg.py b/sympy/logic/boolalg.py index 802cd0e3c5d0..c0c999647ee8 100644 --- a/sympy/logic/boolalg.py +++ b/sympy/logic/boolalg.py @@ -124,8 +124,8 @@ def equals(self, other): from sympy.logic.inference import satisfiable from sympy.core.relational import Relational - if self.has(Relational) or other.has(Relational): - raise NotImplementedError('handling of relationals') + if not all(is_literal(i) for i in (self, other)): + raise NotImplementedError('non-literal BooleanFunction') more = self.atoms() less = other.atoms() if len(more) < len(less):