Created
November 7, 2011 15:34
-
-
Save Eugeny/1345286 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def a(x,y): return x and y | |
def o(x,y): return x or y | |
def s(x,y): return not(x and y) // sheffer | |
def n(x): return not x | |
def c(fx): | |
r = 2 | |
for x1 in [True, False]: | |
for x2 in [True, False]: | |
for x3 in [True, False]: | |
for x4 in [True, False]: | |
r *= 10 | |
if fx(x1,x2,x3,x4): | |
r += 1 | |
print r | |
c(lambda x1,x2,x3,x4: s(s(x1,x2),x3)) | |
c(lambda x1,x2,x3,x4: n(x1 and x2 and x3)) | |
c(lambda x1,x2,x3,x4: n(a(a(n(x1),x2),x3))) | |
c(lambda x1,x2,x3,x4: s(a(n(x1),x2),x3)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment