jjmaestro

Hacky truth table to check DNF equivalency

May 23rd, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. print ' a   b    expr  dnf '
  2. print '--------------------'
  3. for a in (True, False):
  4.     for b in (True, False):
  5.         expr = a and b or not a and b and b or a
  6.         dnf = a or b
  7.         print " %s   %s     %s     %s" % (int(a), int(b), int(expr), int(dnf))
  8.  
  9. ## Or simply go to Wolfram Alpha :D
  10. ## http://wolframalpha.com/input/?i=a+AND+b+OR+NOT+a+AND+b+AND+b+OR+a
Add Comment
Please, Sign In to add comment