Theory Value
section ‹Value›
theory Value imports Subtype begin
text ‹This theory contains our model of the values in the store. The store is untyped, therefore all
types that exist in Java are wrapped into one type ‹Value›.
In a first approach, the primitive Java types supported in this formalization are
mapped to similar Isabelle
types. Later, we will have
proper formalizations of the Java types in Isabelle, which will then be used here.
›
type_synonym JavaInt = int
type_synonym JavaShort = int
type_synonym JavaByte = int
type_synonym JavaBoolean = bool
text ‹The objects of each class are identified by a unique ID.
We use elements of type @{typ nat} here, but in general it is sufficient to use
an infinite type with a successor function and a comparison predicate.
›
type_synonym ObjectId = nat
text ‹The definition of the datatype ‹Value›. Values can be of the Java types
boolean, int, short and byte. Additionally, they can be an object reference,
an array reference or the value null.›