1 2 # Logical operators and helpers. 3 4 -def implies(p,q): 5 return not p or q 6 7 -def equivalent(p,q): 8 return (p and q) or (not p and not q) 9 10 -def xor(p,q): 11 return (p and not q) or (q and not p) 12