简体   繁体   中英

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.

Can someone please tell me what's the problem. I am using windows 7, jSMTLIB using cygwin

Thanks Saif

I don't know which backend in jSMTLIB you used for solving this. However, (check-sat (= xw)) is not even legal in 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.

Note that (get-info :statistics) is also incorrect; the correct option is (get-info :all-statistics) . You can read more about SMT-LIB v2 standard in their documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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