Full Iso-Recursive Types

被引:0
|
作者
Zhou, Litao [1 ]
Wan, Qianyong [1 ]
Oliveira, Bruno C. D. S. [1 ]
机构
[1] Univ Hong Kong, Hong Kong, Peoples R China
来源
关键词
Recursive types; Subtyping; Type system;
D O I
10.1145/3689718
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
There are two well-known formulations of recursive types: iso-recursive and equi-recursive types. Abadi and Fiore [LICS 1996] have shown that iso- and equi-recursive types have the same expressive power. However, their encoding of equi-recursive types in terms of iso-recursive types requires explicit coercions. These coercions come with significant additional computational overhead, and complicate reasoning about the equivalence of the two formulations of recursive types. This paper proposes a generalization of iso-recursive types called full iso-recursive types. Full iso-recursive types allow encoding all programs with equi-recursive types without computational overhead. Instead of explicit term coercions, all type transformations are captured by computationally irrelevant casts, which can be erased at runtime without affecting the semantics of the program. Consequently, reasoning about the equivalence between the two approaches can be greatly simplified. We present a calculus called lambda(mu)(Fi), which extends the simply typed lambda calculus (STLC) with full iso-recursive types. The lambda(mu)(Fi) calculus is proved to be type sound, and shown to have the same expressive power as a calculus with equi-recursive types. We also extend our results to subtyping, and show that equi-recursive subtyping can be expressed in terms of iso-recursive subtyping with cast operators.
引用
收藏
页数:30
相关论文
共 50 条
  • [1] 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):
  • [2] Revisiting Iso-Recursive Subtyping
    Zhou, Yaoda
    Zhao, Jinxu
    Oliveira, Bruno C. D. S.
    ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2022, 44 (04):
  • [3] Mutually Iso-Recursive Subtyping
    Rossberg, Andreas
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2023, 7 (OOPSLA):
  • [4] Revisiting Iso-Recursive Subtyping
    Zhou, Yaoda
    Oliveira, Bruno C. D. S.
    Zhao, Jinxu
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (OOPSLA):
  • [5] ON THE SEMANTIC EXPRESSIVENESS OF ISO- AND EQUI-RECURSIVE TYPES
    Devriese, Dominique
    Martin, Eric m.
    Patrignani, Marco
    LOGICAL METHODS IN COMPUTER SCIENCE, 2024, 20 (04) : 1 - 45
  • [6] Full abstraction for first-order objects with recursive types and subtyping
    Viswanathan, R
    THIRTEENTH ANNUAL IEEE SYMPOSIUM ON LOGIC IN COMPUTER SCIENCE, PROCEEDINGS, 1998, : 380 - 391
  • [7] COMPUTING WITH RECURSIVE TYPES
    COSMADAKIS, SS
    FOURTH ANNUAL SYMPOSIUM ON LOGIC IN COMPUTER SCIENCE, 1989, : 24 - 38
  • [8] SUBTYPING RECURSIVE TYPES
    AMADIO, RM
    CARDELLI, L
    ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1993, 15 (04): : 575 - 631
  • [9] RECURSIVE TYPES FOR FUN
    CARDONE, F
    THEORETICAL COMPUTER SCIENCE, 1991, 83 (01) : 29 - 56
  • [10] Monotone recursive types and recursive data representations in Cedille
    Jenkins, Christopher
    Stump, Aaron
    Mathematical Structures in Computer Science, 2021, 31 (06) : 682 - 745