Closed yav closed 5 years ago
The intended treatment of indexing an array outside of its bounds is to get a "default" element of the correct type. For subrange types we use the lowest value as the default. Thus both properties should be true.
As your example shows, there is a bug in the handling of subrange types and arrays.
I was trying to understand the semantics of arrays as implemented in
jkind
, and I came across an example, where just adding an additional property to prove causesjkind
to change its mind about the validity of another property:If you run the example as is, then
jkind
states the both properties arevalid
. If you comment out the last line (where we ask it to proveok2
), then it reports thatok1
isinvalid
.This is with version 4.0.1
As an aside: what is the intended treatment of "undefined" values---is is an arbitrary value of the given type, or is it some special additional element that is different from all elements in the type?