Recursive Subtyping for All

被引:3
|
作者
Zhou, Litao [1 ]
Zhou, Yaoda [1 ]
Oliveira, Bruno C. D. S. [1 ]
机构
[1] Univ Hong Kong, Dept Comp Sci, Hong Kong, Peoples R China
关键词
Iso-Recursive Subtyping; Bounded Polymorphism; Object EncodingsIso-Recursive Subtyping; Object Encodings; INTERSECTION; SOUNDNESS; SYSTEM; UNION;
D O I
10.1145/3571241
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Recursive types and bounded quantification are prominent features in many modern programming languages, such as Java, C#, Scala or TypeScript. Unfortunately, the interaction between recursive types, bounded quantification and subtyping has shown to be problematic in the past. Consequently, defining a simple foundational calculus that combines those features and has desirable properties, such as decidability, transitivity of subtyping, conservativity and a sound and complete algorithmic formulation has been a long time challenge. This paper presents an extension of kernel F-<= =, called F-<=(mu) , with iso-recursive types. F-<= is a well-known polymorphic calculus with bounded quantification. In F-<=(mu) we add iso-recursive types, and correspondingly extend the subtyping relation with iso-recursive subtyping using the recently proposed nominal unfolding rules. We also add two smaller extensions to F-<=. The first one is a generalization of the kernel F-<= rule for bounded quantification that accepts equivalent rather than equal bounds. The second extension is the use of so-called structural folding/unfolding rules, inspired by the structural unfolding rule proposed by Abadi, Cardelli, and Viswanathan [1996]. The structural rules add expressive power to the more conventional folding/unfolding rules in the literature, and they enable additional applications. We present several results, including: type soundness; transitivity and decidability of subtyping; the conservativity of F-<=(mu) over F-<= and a sound and complete algorithmic formulation of F-<=(mu). Moreover, we study an extension of F-<=(mu), called F-<=>=(mu) which includes lower bounded quantification in addition to the conventional (upper) bounded quantification of F-<=. All the results in this paper have been formalized in the Coq theorem prover.
引用
收藏
页码:1396 / 1425
页数:30
相关论文
共 50 条
  • [1] Recursive subtyping for all
    Zhou, Litao
    Zhou, Yaoda
    Wan, Qianyong
    Oliveira, Bruno c. d. s.
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2025, 35
  • [2] SUBTYPING RECURSIVE TYPES
    AMADIO, RM
    CARDELLI, L
    ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1993, 15 (04): : 575 - 631
  • [3] Subtyping recursive games
    Chroboczek, J
    TYPED LAMBDA CALCULI AND APPLICATIONS, PROCEEDINGS, 2001, 2044 : 61 - 75
  • [4] Recursive subtyping revealed
    Gapeyev, V
    Levin, MY
    Pierce, BC
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2002, 12 (06) : 511 - 548
  • [5] Revisiting Iso-Recursive Subtyping
    Zhou, Yaoda
    Zhao, Jinxu
    Oliveira, Bruno C. D. S.
    ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2022, 44 (04):
  • [6] Revisiting Iso-Recursive Subtyping
    Zhou, Yaoda
    Oliveira, Bruno C. D. S.
    Zhao, Jinxu
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (OOPSLA):
  • [7] Recursive subtyping revealed - Functional pearl
    Gapeyev, V
    Levin, MY
    Pierce, BC
    ACM SIGPLAN NOTICES, 2000, 35 (09) : 221 - 231
  • [8] Mutually Iso-Recursive Subtyping
    Rossberg, Andreas
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2023, 7 (OOPSLA):
  • [9] Consistent Subtyping for All
    Xie, Ningning
    Bi, Xuan
    Oliveira, Bruno C. D. S.
    Schrijvers, Tom
    ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2020, 42 (01):
  • [10] Logical Equivalence for Subtyping Object and Recursive Types
    Steffen van Bakel
    Ugo de’Liguoro
    Theory of Computing Systems, 2008, 42 : 306 - 348