paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Polymorphic symmetric multiple dispatch with variance

带方差的参数多态对称多重分派
POPL 3(POPL)2019匹配度 2/10 · 该论文属于编程语言类型系统与形式化语义,研究多重分派、方差参数多态及类型可靠性,与用户核心方向(静态分析结合LLM/Agent、浮点程序分析、贝叶斯程序分析)没有直接关联。仅在广义PL/形式化验证兴趣上稍有交集。引用 5 inbox
Gyunghee Park, Jaemin Hong, Guy L. Steele Jr., Sukyoung Ryu
crossref: 2026-09-10

AI 速览

一句话:首次形式化支持对称多重分派、多重继承和带方差参数多态的对象语言,并证明其类型可靠性。

许多面向对象语言支持方法重载,多重分派根据实参运行时类型选择方法。它可自然支持二元方法,但在多重继承与参数多态等特性下,难以保证调用既无歧义又不未定义;已有形式化常以非对称方式消解歧义。本文首次形式化一种强类型面向对象语言,同时支持对称多重分派、多重继承和带方差的参数多态。作者定义静态类型检查语义与动态分派语义,提出新的动态分派算法,并证明其与静态语义一致,从而建立类型可靠性;算法还处理了类只显式声明祖先而非后代等结构不对称性带来的挑战。

问题
如何在支持多重继承和带方差参数多态的语言中,为对称多重分派同时保证静态类型安全与动态调用无歧义、无未定义。
方法
给出该语言的形式化静态类型检查语义和动态分派语义,设计新的动态分派算法并证明类型可靠性,处理面向对象结构不对称性。
评估
通过形式化定义与类型可靠性证明进行评估;摘要未报告实现、基准或用户研究。
原文摘要(Abstract)

Many object-oriented languages provide method overloading, which allows multiple method declarations with the same name. For a given method invocation, in order to choose what method declaration to invoke, multiple dispatch considers the run-time types of the arguments. While multiple dispatch can support binary methods (such as mathematical operators) intuitively and consistently, it is difficult to guarantee that calls will be neither ambiguous nor undefined at run time, especially in the presence of expressive language features such as multiple inheritance and parametric polymorphism. Previous efforts have formalized languages that include such features by using overloading rules that guarantee a unique and type-sound resolution of each overloaded method call; in many cases, such rules resolve ambiguity by treating the arguments asymmetrically. Here we present the first formal specification of a strongly typed object-oriented language with symmetric multiple dispatch, multiple inheritance, and parametric polymorphism with variance. We define both a static (type- checking) semantics and a dynamic (dispatching) semantics and prove the type soundness of the language, thus demonstrating that our novel dynamic dispatch algorithm is consistent with the static semantics. Details of our dynamic dispatch algorithm address certain technical challenges that arise from structural asymmetries inherent in object-oriented languages (e.g., classes typically declare ancestors explicitly but not descendants).

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot684,
  title = {Polymorphic symmetric multiple dispatch with variance},
  author = {Gyunghee Park and Jaemin Hong and Guy L. Steele Jr. and Sukyoung Ryu},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {3},
  number = {POPL},
  year = {2019},
  doi = {10.1145/3290324}
}