def isNegation(a, b): """Is a the negation of b?""" return compareASTs(deMorganize(ast.UnaryOp(ast.Not(), deepcopy(a))), b, checkEquality=True) == 0