exercise3.smt2 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. (set-option :produce-unsat-cores true)
  2. ;(set-option :produce-proofs true)
  3. (declare-sort C)
  4. (declare-const x C)
  5. (declare-const y C)
  6. (declare-const z C)
  7. (declare-fun F (C) C)
  8. (declare-fun G (C) C)
  9. (push)
  10. ; we assert the entire EUF formula
  11. (assert (! (= x y) :named A1))
  12. (assert (! (= (F x) (G (G y))) :named A2))
  13. (assert (! (= z (G (F y))) :named A3))
  14. (assert (! (not (= z (G (F x)))) :named A4))
  15. ; check for satisfiability
  16. (check-sat)
  17. ;(get-unsat-core)
  18. (pop)
  19. ; now we define the flat symbols
  20. (declare-const fx C)
  21. (declare-const fy C)
  22. (declare-const gy C)
  23. (declare-const ggy C)
  24. (declare-const gfx C)
  25. (declare-const gfy C)
  26. (push)
  27. ; this time we assert the translated formula by asserting both flat and the functional constraints
  28. ; assert flatE(phiEUF)
  29. (assert (= x y))
  30. (assert (= fx ggy))
  31. (assert (= z gfy))
  32. (assert (not (= z gfx)))
  33. ; assert FCE(phiEUF)
  34. (assert (! (=> (= x y) (= fx fy)) :named F1))
  35. (assert (! (=> (= y gy) (= gy ggy)) :named F2))
  36. (assert (! (=> (= y fx) (= gy gfx)) :named F3))
  37. (assert (! (=> (= y fy) (= gy gfy)) :named F4))
  38. (assert (! (=> (= fx fy) (= gfx gfy)) :named F5))
  39. (assert (! (=> (= gy fx) (= ggy gfx)) :named F6))
  40. (assert (! (=> (= gy fy) (= ggy gfy)) :named F7))
  41. ; check for satisfiability again
  42. (check-sat)
  43. ; extract the unsatisfiability core
  44. (get-unsat-core)
  45. (pop)