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 <= y) or not(z <= w)) and ((not(x) >= w) or (not(y) <= z))
- for a in product([0, 1], repeat = 4):
- table = [(0, 0, 0, a[0]), (0, a[1], 1, a[2]), (0, 0, a[3], 1)]
- if len(table) == len(set(table)):
- for p in permutations('xyzw'):
- if [f(**dict(zip(p, r))) for r in table] == [0, 0, 0]:
- print(p)
- print('x y z w F')
- for x in 0, 1:
- for y in 0, 1:
- for z in 0, 1:
- for w in 0, 1:
- F = ((x <= y) or not(z <= w)) and ((not(x) >= w) or (not(y) <= z))
- if F == 0:
- print(x, y, z, w, F)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement