简体   繁体   English

Smtlib的代码问题

[英]Smtlib trouble with the code

I have this following code 我有以下代码

(set-logic QF_LIA)
(declare-fun w () Int)
(declare-fun x () Int)
(declare-fun y () Int)
(declare-fun z () Int)
(assert (> x y))
(assert (> y z))
(push 1)
(assert (> z x))
(check-sat) ; unsat
(get-info :statistics)
(pop 1)
(push 1)
(check-sat (= x w)) ; sat

The code should return unsat on first (check-sat) and sat on second (check-sat), but I get unknown. 代码应首先返回unsat(检查-sat),然后再返回第二(检查-sat),但是我不知道。

Can someone please tell me what's the problem. 有人可以告诉我这是什么问题。 I am using windows 7, jSMTLIB using cygwin 我正在使用Windows 7,使用cygwin的jSMTLIB

Thanks Saif 谢谢赛义夫

I don't know which backend in jSMTLIB you used for solving this. 我不知道您使用jSMTLIB中的哪个后端来解决此问题。 However, (check-sat (= xw)) is not even legal in SMT-LIB v2. 但是, (check-sat (= xw))在SMT-LIB v2中甚至都不合法。

When I change that line to: 当我将该行更改为:

(assert (= x w))
(check-sat)

I get unsat and sat from Z3 web interface, which is of our expectation. 我感到unsat ,从Z3 Web界面sat来,这是我们的期望。

Note that (get-info :statistics) is also incorrect; 注意(get-info :statistics)也是不正确的; the correct option is (get-info :all-statistics) . 正确的选项是(get-info :all-statistics) You can read more about SMT-LIB v2 standard in their documentation . 您可以在其文档中阅读有关SMT-LIB v2标准的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM