Simplify boolean expression with literal intention
(cherry picked from commit e513c2e)