optimize !!! to ! in logical expressions