simplify logical operations