def is_literal(expr):
 if isinstance(expr, Not):
  return (not isinstance(expr.args[0], BooleanFunction))
 else:
  return (not isinstance(expr, BooleanFunction))

def is_literal ( expr ) : if isinstance ( expr , Not ) : return ( not isinstance ( expr . args [ 0 ] , BooleanFunction ) ) else : return ( not isinstance ( expr , BooleanFunction ) )
returns true if expr is a literal .