Ownership types characterize the topology of objects in the heap, through a characterization of the context to which an object belongs. They have been used to support reasoning, memory management, concurrency, etc. Subtyping is traditionally invariant w.r.t. contexts, which has often proven inflexible in some situations. Recent work has introduced restricted forms of subtype variance and unknown context, but in a rather ad-hoc and restricted way. We develop Jo, a calculus which supports parameterisation of types, as well as contexts, and allows variant subtyping of contexts based on existential quantification. Jo is more expressive, general, and uniform than previous works which add variance to ownership languages. Our explicit use of existential types makes the connection to type-theoretic foundations from existential types more transparent. We prove type soundness for Jo and extend it to Jodeep which enforces the owners-as-dominators property.
Nicholas R. Cameron, Sophia Drossopoulou