Simplifying boolean expressions