Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- def conjuncion(V1, V2):
- return (V1 and V2)
- def disyuncion(V1, V2):
- return (V1 or V2)
- def negacion(V):
- return not(V)
- def condicional(V1, V2):
- if (V1 == 1 and V2 == 0):
- return 0
- else:
- return 1
- def bicondicional(V1, V2):
- return (condicional(V1, V2) and condicional(V2, V1))
- def main():
- print 'conjuncion(condicional(negacion(C),B) , condicional(C,negacion(A)))'
- print 'a b c\tS'
- for A in range(2):
- for B in range(2):
- for C in range(2):
- formula = int(conjuncion(condicional(negacion(C),B) , condicional(C,negacion(A))))
- print A,B,C,'\t',formula
- main()
Add Comment
Please, Sign In to add comment