Closed doyougnu closed 3 years ago
This can't be fixed until sbv
resets bindings created in the assertion levels. That is, if I resetAssertion
then all bindings in the stack are still maintained, including those defined inside a push->foo->pop call.
This is fixed as of 78a13fee796fdef5691cb39c87a0a75e570a3511 in the move from sbv
to z3
only. However there is a subtle difference in z3 semantics. Z3 get-model
returns a minimal model, thus if you have
a ||| b ||| c |||
only one variable will be returned in the model as the other's won't even be checked. This is default behavior from z3 (I checked rise4fun
) and so I won't change it. Note that this makes variational models much much smaller and can lead to some un-intuitive resutls:
consider:
bChc "AA" (bRef "a") (bRef "b" ||| bRef "c") ||| bRef "d"
with this formula the returned model is:
=: Model :=
a --> (ite AA (True) Undefined)
b --> (ite ~AA (True) Undefined)
=: Sat_Model :=
(~AA or AA)
which is missing bindings for c
and d
but is a perfectly reasonable model to be returned by the definition of satisfiability.
Consider this propositions:
In this proposition the value of
one
is effectively variational because it depends on the result of confguring theAA
choice, whereastwo
is plain because it is independent of the choice completely. Thus we would expect that would result model would show a variational context forone
but a constant fortwo
. Yet we are returned this:where both
one
andtwo
have results in a context even thoughtwo
's value never changes, which is correct, it is constant. Thus, during construction of the result we should check to ensure we are not adding duplicate values.