The statement S ≤ T in a λ-calculus with subtyping is traditionally interpreted by a semantic coercion function of type qqSqq → qqTqq that extracts the 'T part' of an element of S. If the subtyping relation is restricted to covariant positions, this interpretation may be enriched to include both the implicit coercion and an overwriting function put[S,T] ε qqSqq → qqTqq → qqSqq that updates the T part of an element of S. We give a realizability model and a sound equational theory for a second-order calculus of positive subtyping. Though weaker than familiar calculi of bounded quantification, positive subtyping retains sufficient power to model objects, encapsulation, and message passing. Moreover, inheritance may be implemented very straightforwardly in this setting, using the put functions arising from ordinary subtyping of records in place of the sophisticated systems of record extension and update often used for this purpose. The equational laws relating the behavior of coercions and put functions can be used to prove simple properties of the resulting classes in such a way that proofs for superclasses are 'inherited' by subclasses.
CITATION STYLE
Hofmann, M., & Pierce, B. (1995). Positive subtyping. In Conference Record of the Annual ACM Symposium on Principles of Programming Languages (pp. 186–197). ACM. https://doi.org/10.1145/199448.199482
Mendeley helps you to discover research relevant for your work.