You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
555 B

7 months ago
  1. \item \lect Let $a$ and $b$ be Boolean variables.
  2. Complete the python code with the appropriate variable declarations and constraint statements to check whether the following equivalence holds:
  3. $$\lnot (a \land b) = (\lnot a \lor \lnot b).$$
  4. \vskip1em
  5. \begin{pythonSourceCode}
  6. from z3 import *
  7. solver = Solver()
  8. a, b = Bools("a b")
  9. l, r = Bools("l r")
  10. solver.add(l == Not(And(a, b)))
  11. solver.add(r == Or(Not(a), Not(b)))
  12. solver.add(Distinct(l, r))
  13. result = solver.check()
  14. print(result)
  15. \end{pythonSourceCode}