paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Containerless Plurals: Separating Number from Type in Object-Oriented Programming

无容器的多值:面向对象编程中数量与类型的分离
TOPLAS 44(4)2022匹配度 1/10 · 论文属于编程语言设计与类型系统,讨论 OO 语言中对象数量与类型分离、plural method 及类型安全证明,与用户关注的静态分析、ML/Agentic 程序分析、LLM 与形式化验证/浮点/贝叶斯程序分析均无直接交集;仅同属 PL 领域,因此匹配度低。引用 2 inbox
Friedrich Steimann
crossref: 2026-09-10

AI 速览

一句话:提出 OO 语言 Num,分离对象数量与类型,统一处理零/一/多对象,并用 plural method 取代静态方法。

多数面向对象语言要求用特殊构造把零个或多个对象编码成单值,以处理无对象或多对象情形。本文主张让表达式直接求值为任意数量对象,并提出核心面向对象语言 Num。Num 将数量与类型分离,表达式类型不取决于对象数量,从而统一处理零、一、多对象;它取消 null 引用,用可数性替代引用类型的可空性,并允许在任意数量接收者(含零个)上调用方法。为适应实际接收者数量,Num 在实例方法外引入 plural method,对多个对象联合操作并取代静态方法。作者给出 Num 的 Prolog 实现及类型安全与数量安全证明,作为概念验证。

问题
面向对象语言中,表达式求值为零个或多个对象时通常需用容器、null 等特殊构造将其编码为单值,缺乏统一处理。
方法
设计核心 OO 语言 Num,将对象数量与类型分离,取消 null 并以 countability 表示可空性,引入 plural method 支持在任意数量接收者上调用。
评估
在 Prolog 中实现 Num,并给出类型安全与数量安全证明作为概念验证。
原文摘要(Abstract)

To let expressions evaluate to no or many objects, most object-oriented programming languages require the use of special constructs that encode these cases as single objects or values. While the requirement to treat these standard situations idiomatically seems to be broadly accepted, I argue that its alternative, letting expressions evaluate to any number of objects directly, has several advantages that make it worthy of consideration. As a proof of concept, I present a core object-oriented programming language, dubbed Num , which separates number from type so that the type of an expression is independent of the number of objects it may evaluate to, thus removing one major obstacle to using no, one, and many objects uniformly. Furthermore, Num abandons null references, replaces the nullability of reference types with the more general notion of countability, and allows methods to be invoked on any number of objects, including no object. To be able to adapt behavior to the actual number of receivers, Num complements instance methods with plural methods, that is, with methods that operate on a number of objects jointly and that replace static methods known from other languages. An implementation of Num in Prolog and accompanying type and number safety proofs are presented.

链接与引用

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

BibTeX
@article{paperbot1602,
  title = {Containerless Plurals: Separating Number from Type in Object-Oriented Programming},
  author = {Friedrich Steimann},
  journal = {ACM Transactions on Programming Languages and Systems},
  volume = {44},
  number = {4},
  year = {2022},
  doi = {10.1145/3527635}
}