0
對於下面的問題,解決方案存在,但Z3說UNSAT。z3錯誤地說UNSAT
(set-logic QF_UFNRA)
(declare-fun a() Real)
(declare-fun b() Real)
(declare-fun c() Real)
(declare-fun d() Real)
(declare-fun e() Real)
(declare-fun f() Real)
(declare-fun g() Real)
(declare-fun h() Real)
(assert (and (<= a 1.0) (> a 0.0)))
(assert (and (<= b 1.0) (> b 0.0)))
(assert (and (<= c 1.0) (> c 0.0)))
(assert (and (<= d 1.0) (> d 0.0)))
(assert (and (<= e 1.0) (>= e 0.0)))
(assert (and (<= f 1.0) (>= f 0.0)))
(assert (and (<= g 1.0) (>= g 0.0)))
(assert (and (<= h 1.0) (>= h 0.0)))
(assert (= (* (+ a b) (+ a c)) a))
(assert (= (* (+ a b) (+ b d)) b))
(assert (= (* (+ a c) (+ c d)) c))
(assert (= (* (+ b d) (+ c d)) d))
(assert (= (+ a b c d e f g h) 1.0))
(check-sat)
有效的解決方案:
a = 1/12, b = 1/4, c = 1/6, d = 1/2, e = f = g = h = 0
我無法弄清楚爲什麼Z3表示不飽和度
z3版本是z3-4.3.0-x64。
github的最新版本也給出了正確的答案。我猜這個bug從4.3.0版本開始就修復了。 – Logan