Foundations for the implementation of higher-order subtyping

被引:1
作者
Crary, K
机构
关键词
D O I
10.1145/258949.258961
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We show how to implement a calculus with higher-order subtyping and subkinding by replacing uses of implicit subsumption with explicit coercions. To ensure this can be done, a polymorphic function is adjusted to take, as an additional argument, a proof that its type constructor argument has the desired kind. Such a proof is extracted from the derivation of a kinding judgement and may in turn require proof coercions, which are extracted from subkinding judgements. This technique is formalized as a type-directed translation from a calculus of higher-order subtyping to a subtyping-free calculus. This translation generalizes an existing result for second-order subtyping calculi (such as F-less than or equal to). We also discuss two interpretations of subtyping, one that views it as type inclusion and another that views it as the existence of a well-behaved coercion, and we show, by a type-theoretic construction, that our translation is the minimum consequence of shifting from the inclusion interpretation to the coercion-existence interpretation. This construction shows that the translation is the natural one, and it also provides a framework for extending the translation to richer type systems. Finally, we show how the two interpretations can be reconciled in a common semantics. It is then easy to show the coherence of the translation relative to that semantics.
引用
收藏
页码:125 / 135
页数:11
相关论文
共 31 条
  • [1] ALLEN SF, 1987, 2ND P ANN S LOG COMP, P215
  • [2] Allen Stuart Frazier, 1987, PhD thesis
  • [3] [Anonymous], ACM COMPUTING SURVEY
  • [4] PROOFS AS PROGRAMS
    BATES, JL
    CONSTABLE, RL
    [J]. ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1985, 7 (01): : 113 - 136
  • [5] INHERITANCE AS IMPLICIT COERCION
    BREAZUTANNEN, V
    COQUAND, T
    GUNTER, CA
    SCEDROV, A
    [J]. INFORMATION AND COMPUTATION, 1991, 93 (01) : 172 - 221
  • [6] BREAZUTANNEN V, 1990, 1990 ACM C LISP FUNC, P44
  • [7] A MODEST MODEL OF RECORDS, INHERITANCE, AND BOUNDED QUANTIFICATION
    BRUCE, KB
    LONGO, G
    [J]. INFORMATION AND COMPUTATION, 1990, 87 (1-2) : 196 - 240
  • [8] CARDELLI L, 1991, LECT NOTES COMPUT SC, V526, P750
  • [9] CARDELLI L, 1993, 87 SYST RES CTR DIG
  • [10] CARDELLI L, 1991, FORMAL DESCRIPTION P