Advertisement
Farz0l1x

Untitled

Apr 17th, 2024
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. from itertools import *
  2. def f(x, y, z, w):
  3.     return ((x <= y) or not(z <= w)) and ((not(x) >= w) or (not(y) <= z))
  4. for a in product([0, 1], repeat = 4):
  5.     table = [(0, 0, 0, a[0]), (0, a[1], 1, a[2]), (0, 0, a[3], 1)]
  6.     if len(table) == len(set(table)):
  7.         for p in permutations('xyzw'):
  8.             if [f(**dict(zip(p, r))) for r in table] == [0, 0, 0]:
  9.                 print(p)
  10.  
  11. print('x y z w F')
  12. for x in 0, 1:
  13.     for y in 0, 1:
  14.         for z in 0, 1:
  15.             for w in 0, 1:
  16.                 F = ((x <= y) or not(z <= w)) and ((not(x) >= w) or (not(y) <= z))
  17.                 if F == 0:
  18.                     print(x, y, z, w, F)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement