Farz0l1x

Untitled

Mar 5th, 2024
670
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. from itertools import *
  2. def f(x, y, z, w):
  3.     return (w or x or y) <= ((y or z) and x or y and (w or z))
  4. for a in product([0, 1], repeat = 5):
  5.     table = [(0, 0, 0, a[0]), (a[1], 1, 1, a[2]), (a[3], 1, a[4], 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)
Advertisement
Add Comment
Please, Sign In to add comment