An Imperative Type Hierarchy with Partial Products
A <em>type hierarchy</em> for an imperative language defines an ordering on the types such that any application for small types may be reused for all larger types. The imperative facet makes this non-trivial; the straight-forward definitions will yield an inconsistent system. We introduce a new type constructor, the <em>partial product</em>, and show how to define a <em>consistent</em> hierarchy in the context of <em>fully recursive</em> types. A simple <em>polymorphism</em> is derived. By extending the types to include <em>stuctural invariants</em> we obtain a particularly appropriate notation for defining recursive types, that is superior to traditional type sums and products. We show how the ordering on types <em>extends</em> to an ordering on types with invariants. We allow the use of <em>least upper bounds</em> in type definitions and show how to resolve type equations involving these, and how to compute upper bounds of invariants.