首页    期刊浏览 2025年06月15日 星期日
登录注册

文章基本信息

  • 标题:Julia's Efficient Algorithm for Subtyping Unions and Covariant Tuples (Pearl)
  • 本地全文:下载
  • 作者:Benjamin Chung ; Francesco Zappa Nardelli ; Jan Vitek
  • 期刊名称:LIPIcs : Leibniz International Proceedings in Informatics
  • 电子版ISSN:1868-8969
  • 出版年度:2019
  • 卷号:134
  • 页码:1-15
  • DOI:10.4230/LIPIcs.ECOOP.2019.24
  • 出版社:Schloss Dagstuhl -- Leibniz-Zentrum fuer Informatik
  • 摘要:The Julia programming language supports multiple dispatch and provides a rich type annotation language to specify method applicability. When multiple methods are applicable for a given call, Julia relies on subtyping between method signatures to pick the correct method to invoke. Julia's subtyping algorithm is surprisingly complex, and determining whether it is correct remains an open question. In this paper, we focus on one piece of this problem: the interaction between union types and covariant tuples. Previous work normalized unions inside tuples to disjunctive normal form. However, this strategy has two drawbacks: complex type signatures induce space explosion, and interference between normalization and other features of Julia's type system. In this paper, we describe the algorithm that Julia uses to compute subtyping between tuples and unions - an algorithm that is immune to space explosion and plays well with other features of the language. We prove this algorithm correct and complete against a semantic-subtyping denotational model in Coq.
  • 关键词:Type systems; Subtyping; Union types
国家哲学社会科学文献中心版权所有