【发布时间】:2012-04-15 17:04:09
【问题描述】:
如果我问的话,使用 z3/python 网络界面:
x = Real ('x')
solve(x * x == 2, show=True)
我很高兴:
Problem:
[x·x = 2]
Solution:
[x = -1.4142135623?]
我认为以下 smt-lib2 脚本会有相同的解决方案:
(set-option :produce-models true)
(declare-fun s0 () Real)
(assert (= 2.0 (* s0 s0)))
(check-sat)
唉,我用 z3 (v3.2) 得到了unknown。
我怀疑问题出在非线性术语(* s0 s0) 上,python 接口在某种程度上不会受到影响。有没有办法在 smt-lib2 中编写相同的代码来获取模型?
【问题讨论】: