Revisiting Iso-Recursive Subtyping

被引:3
|
作者
Zhou, Yaoda [1 ]
Oliveira, Bruno C. D. S. [1 ]
Zhao, Jinxu [1 ]
机构
[1] Univ Hong Kong, Dept Comp Sci, Hong Kong, Peoples R China
来源
关键词
Iso-recursive types; Formalization; Subtyping;
D O I
10.1145/3428291
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The Amber rules are well-known and widely used for subtyping iso-recursive types. They were first briefly and informally introduced in 1985 by Cardelli in a manuscript describing the Amber language. Despite their use over many years, important aspects of the metatheory of the iso-recursive style Amber rules have not been studied in depth or turn out to be quite challenging to formalize. This paper aims to revisit the problem of subtyping iso-recursive types. We start by introducing a novel declarative specification that we believe captures the "spirit" of Amber-style iso-recursive subtyping. Informally, the specification states that two recursive types are subtypes if all their finite unfoldings are subtypes. The Amber rules are shown to be sound with respect to this declarative specification. We then derive a sound, complete and decidable algorithmic formulation of subtyping that employs a novel double unfolding rule. Compared to the Amber rules, the double unfolding rule has the advantage of: 1) being modular; 2) not requiring reflexivity to be built in; and 3) leading to an easy proof of transitivity of subtyping. This work sheds new insights on the theory of subtyping iso-recursive types, and the new double unfolding rule has important advantages over the original Amber rules for both implementations and metatheoretical studies involving recursive types. All results are mechanically formalized in the Coq theorem prover. As far as we know, this is the first comprehensive treatment of iso-recursive subtyping dealing with unrestricted recursive types in a theorem prover.
引用
收藏
页数:28
相关论文
共 43 条
  • [1] Revisiting Iso-Recursive Subtyping
    Zhou, Yaoda
    Zhao, Jinxu
    Oliveira, Bruno C. D. S.
    ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2022, 44 (04):
  • [2] Mutually Iso-Recursive Subtyping
    Rossberg, Andreas
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2023, 7 (OOPSLA):
  • [3] On Subtyping-Relation Completeness, with an Application to Iso-Recursive Types
    Ligatti, Jay
    Blackburn, Jeremy
    Nachtigal, Michael
    ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2017, 39 (01):
  • [4] Full Iso-Recursive Types
    Zhou, Litao
    Wan, Qianyong
    Oliveira, Bruno C. D. S.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (OOPSLA):
  • [5] Recursive subtyping for all
    Zhou, Litao
    Zhou, Yaoda
    Wan, Qianyong
    Oliveira, Bruno c. d. s.
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2025, 35
  • [6] SUBTYPING RECURSIVE TYPES
    AMADIO, RM
    CARDELLI, L
    ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1993, 15 (04): : 575 - 631
  • [7] Subtyping recursive games
    Chroboczek, J
    TYPED LAMBDA CALCULI AND APPLICATIONS, PROCEEDINGS, 2001, 2044 : 61 - 75
  • [8] Recursive Subtyping for All
    Zhou, Litao
    Zhou, Yaoda
    Oliveira, Bruno C. D. S.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2023, 7 (POPL): : 1396 - 1425
  • [9] Recursive subtyping revealed
    Gapeyev, V
    Levin, MY
    Pierce, BC
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2002, 12 (06) : 511 - 548
  • [10] Recursive subtyping revealed - Functional pearl
    Gapeyev, V
    Levin, MY
    Pierce, BC
    ACM SIGPLAN NOTICES, 2000, 35 (09) : 221 - 231