paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A computational interpretation of compact closed categories: reversible programming with negative and fractional types

紧致闭范畴的计算解释:带负类型与分数类型的可逆编程
POPL 5(POPL)2021匹配度 2/10 · 该论文属于可逆编程与范畴论形式语义,虽涉及操作语义和 Agda 形式化,但未涉及用户关注的静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析。引用 8 inbox
Chao-Hong Chen, Amr Sabry
crossref: 2026-09-10

AI 速览

一句话:为可逆语言引入负类型和分数类型,定义操作语义并证明其构成紧致闭范畴,并实现可逆 SAT 求解。

紧致闭范畴可建模高阶函数,并已用于线性逻辑、并发与量子计算。本文为和类型与积类型引入其对偶:负类型和分数类型,从而在常规类型结构上构造紧致闭范畴。受范畴语义启发,作者定义可靠的操作语义:负类型表示“反转执行流”的计算效应,分数类型表示“垃圾回收”特定值或抛出异常的计算效应。作者在一阶可逆类型同构语言中扩展这两类类型,分别给出操作语义,并证明每种扩展都形成紧致闭范畴;两种语义可通过回溯与异常组合实现平滑互操作。作者还编写可逆 SAT 求解器展示表达能力,并在 Agda 中形式化操作语义、大部分元理论与例子。

问题
如何为和类型与积类型的对偶——负类型和分数类型——给出计算解释,使其操作语义可靠并形成紧致闭范畴。
方法
受范畴语义启发,在一阶可逆类型同构语言中扩展负类型和分数类型,分别定义操作语义并证明其形成紧致闭范畴;再用回溯与异常组合二者,并用 Agda 形式化。
评估
通过元理论证明每种扩展构成紧致闭范畴,并以 Agda 机器化验证操作语义、大部分元理论性质与例子;用可逆 SAT 求解器展示组合表达力。
原文摘要(Abstract)

Compact closed categories include objects representing higher-order functions and are well-established as models of linear logic, concurrency, and quantum computing. We show that it is possible to construct such compact closed categories for conventional sum and product types by defining a dual to sum types, a negative type, and a dual to product types, a fractional type. Inspired by the categorical semantics, we define a sound operational semantics for negative and fractional types in which a negative type represents a computational effect that ``reverses execution flow'' and a fractional type represents a computational effect that ``garbage collects'' particular values or throws exceptions. Specifically, we extend a first-order reversible language of type isomorphisms with negative and fractional types, specify an operational semantics for each extension, and prove that each extension forms a compact closed category. We furthermore show that both operational semantics can be merged using the standard combination of backtracking and exceptions resulting in a smooth interoperability of negative and fractional types. We illustrate the expressiveness of this combination by writing a reversible SAT solver that uses backtracking search along freshly allocated and de-allocated locations. The operational semantics, most of its meta-theoretic properties, and all examples are formalized in a supplementary Agda package.

链接与引用

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

BibTeX
@article{paperbot1191,
  title = {A computational interpretation of compact closed categories: reversible programming with negative and fractional types},
  author = {Chao-Hong Chen and Amr Sabry},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {5},
  number = {POPL},
  year = {2021},
  doi = {10.1145/3434290}
}