Dynamically call get-value only when check-sat returns "sat"

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 (= #b1111 z))
(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 .

+4
2

CVC4

--dump-models          output models after every SAT/INVALID/UNKNOWN
                       response [*]

, get-value. , CVC4 SMT2. ( , , .)

+1

, , , SMT .

SMT- . , , , script, , , . . ( , Haskell SBV, .)

, ; , SMT2-lib .

+3

Source: https://habr.com/ru/post/1545931/


All Articles