Skip to content

Instantly share code, notes, and snippets.

@akhileshs
Created April 13, 2015 21:14
Show Gist options
  • Select an option

  • Save akhileshs/66b654a3111e7eff2cc9 to your computer and use it in GitHub Desktop.

Select an option

Save akhileshs/66b654a3111e7eff2cc9 to your computer and use it in GitHub Desktop.
basic proofs
>>> def prove(f):
... s = Solver()
... s.add(Not(f))
... if s.check() == unsat:
... print "proved"
... else:
... print "failed to prove"
>>> p, q = Bools('p q')
>>> demorgan = And(p, q) == Not(Or(Not(p), Not(q)))
>>> prove(demorgan)
proved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment