Rewrite using expr.has(*symbols).