Created
April 13, 2015 21:14
-
-
Save akhileshs/66b654a3111e7eff2cc9 to your computer and use it in GitHub Desktop.
basic proofs
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 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