added syntatic sugar, xor, implies, and iff
This commit is contained in:
parent
395c87cbe6
commit
08bc671401
2 changed files with 22 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue