Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import *
- def f(x, y, z, w):
- return (x and not(z)) or (y == z) or not(w)
- for a in product([0, 1], repeat = 4):
- table = [(a[0], a[1], 0, 0), (1, 0, a[2], 0), (1, 0, 1, a[3])]
- if len(set(table)) == len(table):
- for p in permutations('xyzw'):
- if [f(**dict(zip(p, r))) for r in table] == [0, 0, 0]:
- print(p)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement