added syntatic sugar, xor, implies, and iff

This commit is contained in:
Marcell Vazquez-Chanlatte 2017-01-21 19:22:22 -08:00
parent 395c87cbe6
commit 08bc671401
2 changed files with 22 additions and 3 deletions

View file

@ -147,3 +147,12 @@ def andf(*args):
def orf(*args):
return reduce(op.or_, args, stl.Or(tuple()))
def implies(x, y):
return ~x | y
def xor(x, y):
return (x | y) & ~(x & y)
def iff(x, y):
return (x & y) | (~x & ~y)