paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Destination Calculus: A Linear 𝜆-Calculus for Purely Functional Memory Writes

目的地演算:一种用于纯函数式内存写入的线性 λ-演算
OOPSLA 9(OOPSLA1)2025匹配度 2/10 · 该论文属于纯 PL/类型系统理论,研究线性 λ-演算与 destination passing 的形式化,并用 Coq 证明类型安全;虽与形式化验证有表面交集,但未涉及用户核心关注的 LLM/Agent、静态分析、浮点程序分析或贝叶斯程序分析。引用 1 inbox
Thomas Bagrel, Arnaud Spiwack
crossref: 2026-09-10

AI 速览

一句话:提出以 destination 为核心的纯函数式线性 λ-演算,用模态类型管理线性与作用域,并在 Coq 中证明类型安全。

目标传递(destination passing)又称 out 参数,即传入一个待填充的参数而非由函数返回结果;由于其表面上的命令式特征,它一直难以融入纯函数式编程。本文提出一种以目标(destination)为核心的纯函数式演算,统一并涵盖已有类似系统,可用于推理其正确性或扩展。该演算采用模态类型系统,借助 mode 同时管理线性与作用域,从而保证安全并表达此前未知可在纯语言中表达的程序。作者在 Coq 证明助手中形式化证明了核心演算的类型安全性。

问题
destination passing/out 参数因看似命令式,难以融入纯函数式语言;如何在不破坏纯性的前提下支持内存写入式目标传递。
方法
以 destination 为核心设计线性 λ-演算,采用模态类型系统统一管理线性与作用域,并形式化证明类型安全。
评估
在 Coq 证明助手中机器化验证核心演算的类型安全性,并说明其能涵盖已有类似系统及表达此前无法表达的程序。
原文摘要(Abstract)

Destination passing —aka. out parameters— is taking a parameter to fill rather than returning a result from a function. Due to its apparently imperative nature, destination passing has struggled to find its way to pure functional programming. In this paper, we present a pure functional calculus with destinations at its core. Our calculus subsumes all the similar systems, and can be used to reason about their correctness or extension. In addition, our calculus can express programs that were previously not known to be expressible in a pure language. This is guaranteed by a modal type system where modes are used to manage both linearity and scopes. Type safety of our core calculus was proved formally with the Coq proof assistant.

链接与引用

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

BibTeX
@article{paperbot3170,
  title = {Destination Calculus: A Linear 𝜆-Calculus for Purely Functional Memory Writes},
  author = {Thomas Bagrel and Arnaud Spiwack},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA1},
  year = {2025},
  doi = {10.1145/3720423}
}