The SMT2 standard states that a get-value call is legal only after a check-sat call, and only when check-sat returns "sat" or "unknown".
Here is a simple example of a problem with unsat:
(set-option :produce-models true)
(set-logic QF_BV)
(set-info :smt-lib-version 2.0)
(declare-fun a ()(_ BitVec 4))
(declare-fun b ()(_ BitVec 4))
(declare-fun c ()(_ BitVec 4))
(declare-fun z ()(_ BitVec 4))
(assert (=
(assert (= a b))
(assert (= (bvxor a z) c))
(assert (= b c))
(check-sat)
(get-value ( a ))
(get-value ( b ))
(get-value ( c ))
Since the problem is unsat, the get-value commands are illegal. Take out any statement and it will become strong, and get-value commands will become legal. So my question is: how do you write an SMT2 script that checks the return value of check-sat and only calls get-value if it returns sat?
get-value , smt , . CVC4 , get-value .