Abstract

The statement S ⩽ T in a λ -calculus with subtyping is traditionally interpreted by a semantic coercion function of type [[ S ]]→[lsqb; T ]] 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 ]∈[[ S ]]→[[ T ]]→[[ S ]] 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 1?sufficient power to model objects, encapsulation, and message passing, and inheritance. 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.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call