What4 over-eagerly produces counterexamples with ArrayMapping
instead of ArrayConcrete
#271
Labels
bug
Something isn't working
ArrayMapping
instead of ArrayConcrete
#271
what4
has two different representation of concrete SMT arrays (i.e.,GroundArray
s):ArrayMapping
: an array that is defined by a total, higher-order function.ArrayConcrete
: an array where most indices map to a constant value, with certain indices mapping to separate values instead.It is far preferable to have
ArrayConcrete
instead ofArrayMapping
in counterexamples, as it is much simpler to display and inspectArrayConcrete
values than it is to displayArrayMapping
.To my surprise,
what4
often producesArrayMapping
values in places where anArrayConcrete
would suffice. Consider this example, for instance:Here, the SMT array
arr
could be concretized as anArrayConcrete
where most indices map toTrue
, but where the value at index 42 maps toFalse
instead. To my surprise, however, that is not whatwhat4
picks when concretizingarr
:Note that I am interleaving the SMT solver interactions (using
defaultLogData{logHandle = Just stdout}
), but the important bit is thatArrayMapping
appears in the output rather thanArrayConcrete
. What's more, thisArrayMapping
does not come from the SMT solver, since there is no corresponding(get-value ...)
call in the Z3 process for retrieving a model forarr
. As such, thisArrayMapping
must be coming fromwhat4
's own simplification rules.We should investigate why this happens and see if we can make
what4
produce anArrayConcrete
here instead of anArrayMapping
.The text was updated successfully, but these errors were encountered: