Making a Type Difference: Subtraction on Intersection Types as Generalized Record Operations
Han Xu, Xuejing Huang, Bruno C. d. S. Oliveira
摘要
In programming languages with records, objects, or traits, it is common to have operators that allow dropping, updating or renaming some components. These operators are useful for programmers to explicitly deal with conflicts and override or update some components. While such operators have been studied for record types, little work has been done to generalize and study their theory for other types. This paper shows that, given subtyping and disjointness relations, we can specify and derive algorithmic implementations for a general type difference operator that works for other types, including function types, record types and intersection types. When defined in this way, the type difference algebra has many desired properties that are expected from a subtraction operator. Together with a generic merge operator, using type difference we can generalize many operations on records formalized in the literature. To illustrate the usefulness of type difference we create an intermediate calculus with a rich set of operators on expressions of arbitrary type, and demonstrate applications of these operators in CP , a prototype language for Compositional Programming . The semantics of the calculus is given by elaborating into a calculus with disjoint intersection types and a merge operator. We have implemented type difference and all the operators in the CP language. Moreover, all the calculi and related proofs are mechanically formalized in the Coq theorem prover.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper2
- Structural Subtyping as Parametric PolymorphismWenhao Tang, Daniel Hillerström, James McKinna, Michel Steuwer 等OOPSLA 2023 · 被引用 3 次
- Liberating Merges via Apartness and Guarded SubtypingHan Xu, Xuejing Huang, Bruno C. d. S. OliveiraOOPSLA 2025
它引用的顶会 Paper1
相关 Paper
- A Bowtie for a Beast: Overloading, Eta Expansion, and Extensible Data Types in F⋈Nick Rioux, Xuejing Huang, Bruno C. d. S. Oliveira, Steve ZdancewicPOPL 2023 · 被引用 10 次
- Polymorphic Records for Dynamic LanguagesGiuseppe Castagna, Loïc PeyrotOOPSLA 2025 · 被引用 2 次
- Imperative Compositional Programming: Type Sound Distributive Intersection Subtyping with References via Bidirectional TypingWenjia Ye, Yaozhu Sun, Bruno C. d. S. OliveiraOOPSLA 2024 · 被引用 1 次
- Type-Checking CRDT ConvergenceGeorge Zakhour, Pascal Weisenburger, Guido SalvaneschiPLDI 2023 · 被引用 16 次
- Revisiting Row Polymorphism for Set-Theoretic TypesMickaël Laurent, Pierre Donat-Bouillud, Filip Křikava, Jan VitekOOPSLA 2026
