; in this file, classify is broken into named assertions ; unsat core correctly identifies the buggy expressions (set-option :produce-unsat-cores true) (declare-datatypes () ((Triangle EQUILATERAL ISOSCELES ACUTE OBTUSE RIGHT ILLEGAL))) (declare-const a Int) (assert (= a 26)) (declare-const b Int) (assert (= b 26)) (declare-const c Int) (assert (= c 7)) (declare-const t3 Bool) (assert (! (= t3 (= a c)) :named a3)) (declare-const t4 Bool) (assert (! (= t4 (= b c)) :named a4)) (declare-const t1 Bool) (assert (! (= t1 (or t3 t4)) :named a1)) (declare-const t2 Bool) (assert (! (= t2 (and (= a b) (= a c))) :named a2)) (assert (= ISOSCELES (if (and (>= a b) (>= b c)) (if t1 (if t2 EQUILATERAL ISOSCELES) (if (not (= (* a a) (+ (* b b) (* c c)))) (if (< (* a a) (+ (* b b) (* c c))) ACUTE OBTUSE) RIGHT)) ILLEGAL))) (check-sat) (get-unsat-core) ; a1 is in the unsat core ; Notes: uncomment assertion a1 to convince yourself that the ; formula becomes SAT.