paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Taming the Merge Operator

驯服 Merge 运算符
JFP vol.312021匹配度 2/10 · 该论文属于纯类型系统与形式语义领域,研究 merge 运算符、不相交交集类型和类型导向操作语义,并不涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析。虽然属于 PL 理论,但与用户当前关注的 PL↔AI 交叉方向距离较远,仅可视为广义 PL 基础。引用 11 inbox
XUEJING HUANG, JINXU ZHAO, BRUNO C. D. S. OLIVEIRA
crossref: 2026-09-10

AI 速览

一句话:提出类型导向操作语义,使带 merge 运算符的不相交交集类型演算具备确定性、主语归约并支持递归。

带不相交交集类型与对称 merge 运算符的演算可将记录拼接推广到任意类型,支持对象组合与模块化,但已有系统缺少同时满足确定性与主语归约的直接操作语义,且通常只处理终止程序。本文为 λ_i 与 λ_i+ 提出类型导向操作语义(TDOS)。λ_i 采用不相交限制以获得确定性;λ_i+ 基于 BCD 子类型并支持记录类型与嵌套组合(可递归组合被合并分量)。该语义还以直接方式处理递归。作者将静态/动态语义与原始演算及 Dunfield 演算相联系,并为 λ_i+ 给出算法化 BCD 子类型,传递性证明简单且可模块化加入分配律。所有结果已在 Coq 中形式化。

问题
带 disjoint intersection types 和 merge 运算符的演算缺乏具有确定性与主语归约的直接操作语义,且以往工作多限于终止程序,递归处理也较困难。
方法
提出类型导向操作语义(TDOS),为 λ_i 和 λ_i+ 两个变体给出直接小步语义,利用 disjointness 限制保证确定性;λ_i+ 采用 BCD 子类型并支持记录与嵌套组合,同时给出算法化 BCD 子类型系统。
评估
证明两个演算的确定性、主语归约与递归处理,将静态/动态语义与原始 λ_i 及 Dunfield 演算建立联系,并在 Coq 中形式化全部结果。
原文摘要(Abstract)

Abstract Calculi with disjoint intersection types support a symmetric merge operator with subtyping. The merge operator generalizes record concatenation to any type, enabling expressive forms of object composition, and simple solutions to hard modularity problems. Unfortunately, recent calculi with disjoint intersection types and the merge operator lack a (direct) operational semantics with expected properties such as determinism and subject reduction , and only account for terminating programs . This paper proposes a type-directed operational semantics (TDOS) for calculi with intersection types and a merge operator. We study two variants of calculi in the literature. The first calculus, called λ i , is a variant of a calculus presented by Oliveira et al. (2016) and closely related to another calculus by Dunfield (2014). Although Dunfield proposes a direct small-step semantics for her calculus, her semantics lacks both determinism and subject reduction. Using our TDOS, we obtain a direct semantics for λ i that has both properties. The second calculus, called λ i + , employs the well-known subtyping relation of Barendregt, Coppo and Dezani-Ciancaglini (BCD). Therefore, λ i + extends the more basic subtyping relation of λ i , and also adds support for record types and nested composition (which enables recursive composition of merged components). To fully obtain determinism, both λ i and λ i + employ a disjointness restriction proposed in the original λ i calculus. As an added benefit the TDOS approach deals with recursion in a straightforward way, unlike previous calculi with disjoint intersection types where recursion is problematic. We relate the static and dynamic semantics of λ i to the original version of the calculus and the calculus by Dunfield. Furthermore, for λ i + , we show a novel formulation of BCD subtyping, which is algorithmic, has a very simple proof of transitivity and allows for the modular addition of distributivity rules (i.e. without affecting other rules of subtyping). All results have been fully formalized in the Coq theorem prover.

链接与引用

DOI 原文 ·

BibTeX
@article{paperbot1228,
  title = {Taming the Merge Operator},
  author = {XUEJING HUANG and JINXU ZHAO and BRUNO C. D. S. OLIVEIRA},
  journal = {Journal of Functional Programming},
  volume = {31},
  year = {2021},
  doi = {10.1017/s0956796821000186}
}