目的地演算:一种用于纯函数式内存写入的线性 λ 演算
Destination Calculus: A Linear λ-Calculus for Purely Functional Memory Writes
AI总结:
本文提出一种以目的地为核心的纯函数式线性 λ 演算,通过模态类型系统同时管理线性性与作用域,统一了现有目的地传递系统并扩展了纯函数式语言的表达能力,其类型安全性已在 Coq 中形式化验证。
摘要:
目的地传递——又称输出参数——是指传入一个参数来填充结果,而不是从函数返回结果。由于其明显具有命令式特征,目的地传递一直难以融入纯函数式编程。本文提出了一种以目的地为核心的纯函数式演算。我们的演算涵盖了所有类似的系统,并可用于推理它们的正确性或扩展性。此外,我们的演算能够表达此前未知可否在纯语言中表达的程序。这一点由一个模态类型系统来保证,其中模态用于同时管理线性性和作用域。我们核心演算的类型安全性已通过 Coq 证明助手进行了形式化证明。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。