exercise4.smt2 788 B

1234567891011121314151617181920212223
  1. (set-option :produce-unsat-cores true)
  2. (declare-sort C)
  3. (declare-const x C)
  4. (declare-const y C)
  5. (declare-const z C)
  6. (declare-fun P (C C) Bool)
  7. (declare-fun Q (C C) Bool)
  8. ; we assert the premise (and name it premise)
  9. (assert (! (= y z) :named premise))
  10. ; we assert the negation of the conclusion
  11. (assert (! (not (=> (and (Q z x) (P x z)) (and (P x y) (Q x y)))) :named conclusion))
  12. (check-sat)
  13. ;(get-model)
  14. ; now we assert this quantified formula (for commutativity) to add an additional axiom to the theory
  15. (assert (! (forall ((x C)) (forall ((y C)) (=> (Q x y) (Q y x)))) :named commutativity))
  16. ; this time it turns out to be valid (there exists no counterexample)
  17. (check-sat)
  18. ; the unsat core tells us that all assertions are needed for the unsat (validity) result
  19. ;(get-unsat-core)