def METHOD_NAME(expr):
    if isinstance(expr, Symbol) or expr in boolean:
        return True
    if not isinstance(expr, BooleanFunction):
        return False
    return all(METHOD_NAME(arg) for arg in expr.args)