Closed zenna closed 9 years ago
Let me check this in an hour.
Good news is that our SMT solver is correct in a sense that the following example gives us UNSAT
:
(set-logic QF_NRA)
(declare-fun x () Bool)
(declare-fun y () Bool)
(assert (= x true))
(assert (= y true))
(assert (or
(not x)
(not y)))
(check-sat)
(exit)
I think the problem is in the way dReal assigns Boolean model. I guess nothing really happens for Boolean cases for now and it gets True(1)
which is a default value. Let me take a closer look at this one.
@zenna, I think the problem is at https://github.com/dreal/dReal.jl/blob/master/src/construct.jl#L179. Note that the return type of opensmt_get_bool
is not Bool but opensmt_result
which is a three-valued entity (-1 : false, 0 : undef, +1 : true).
I think what happens is that OpenSMT returns x : False (-1) and y : True (+1), but dReal.jl interprets both of them as True (non-zero values).
Can you check whether this is the case?
Yes. You were right.
Fixed in d9d39077eadc8f24a37f9aec7a8c7f549247ba43
Nice. Thanks!!
I agree that @scungao is great! No doubt he foresaw all these details :-)
@scungao was correctly surprised the Boolean types work because actually they don't seem to be. The C-API gives back
a=1,b=1
for a formulanot a or not b
. Any thoughts @soonhokong?