Types as sets of values
-
Ideals -- over $V$
- subtypes -- ordered by set inclusion
- lattice -- ,
Type system
subtypes correspond to subsets
- a collection of ideals of V
slide: The interpretation of types as sets
Formally, we may define the value set of a type with
subtypes as an isomorphism of the form
which expresses that the collection of values V
consists of (the union of) basic types
(such as Int)
and compound types (of which V itself may be a component)
such as record types (denoted by the product )
and function types (being part of the function space ).
Within this value space V, subtypes correspond to subsets
that are ordered by set inclusion.
Technically, the subsets corresponding to the subtypes
must be ideals, which comes down to the requirement
that any two types have a maximal type containing
both (in the set inclusion sense).
Intuitively, the subtype relation may be characterized
as a refinement relation, constraining the
set of individuals belonging to a type.
The subtype refinement relation may best be understood
in terms of improving our knowledge with
respect to (the elements of) the type.
For a similar view, see [