paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Contextual modal types for algebraic effects and handlers

面向代数效应与处理器的上下文模态类型
ICFP 5(ICFP)2021匹配度 1/10 · 该论文是纯类型论/逻辑基础工作(上下文模态类型刻画代数效应与 handler),与用户关注的 PL↔AI 交叉(面向 ML/Agentic 程序的静态分析、LLM 辅助形式化验证)、浮点程序分析、贝叶斯程序分析均无直接关联,也不涉及 LLM、benchmark 或工业落地。引用 9 inbox
Nikita Zyuzin, Aleksandar Nanevski
crossref: 2026-09-10

AI 速览

一句话:提出 ECMTT,用上下文模态类型内在地追踪代数效应,并把效应处理器视为上下文间可达性见证。

带代数效应的语言常用类型-效应系统追踪效应,但需在已有语言上附加效应标注。本文把计算的代数效应理论视为变量上下文,并用上下文模态类型追踪代数效应。作者定义新演算 ECMTT,以继承自上下文模态类型论(CMTT)的上下文化 □(必然)算子管理效应;效应标注内在于语言,由对应 □ 模态的引入/消去构造管理,故其类型-效应系统实际只是类型系统。ECMTT 具有局部可靠性与完备性,操作语义由 β-规约确定;效应处理器成为上下文(代数理论)间可达性的见证,推广了显式替换。这是首个将代数效应与模态类型联系的工作,并为借用模态逻辑/类型论结果的 Curry-Howard 对应迈出一步。

问题
如何在不把效应标注作为附加层的情况下,用类型系统内在地追踪代数效应?
方法
提出 ECMTT,将代数效应理论视为变量上下文,用上下文化 □ 模态类型管理效应,并把效应处理器解释为上下文间可达性见证。
评估
通过形式化定义与元理论性质(局部可靠性与完备性、β-规约操作语义)评估;摘要未报告实现或实证评估。
原文摘要(Abstract)

Programming languages with algebraic effects often track the computations’ effects using type-and-effect systems. In this paper, we propose to view an algebraic effect theory of a computation as a variable context; consequently, we propose to track algebraic effects of a computation with contextual modal types . We develop ECMTT, a novel calculus which tracks algebraic effects by a contextualized variant of the modal □ (necessity) operator, that it inherits from Contextual Modal Type Theory (CMTT). Whereas type-and-effect systems add effect annotations on top of a prior programming language, the effect annotations in ECMTT are inherent to the language, as they are managed by programming constructs corresponding to the logical introduction and elimination forms for the □ modality. Thus, the type-and-effect system of ECMTT is actually just a type system. Our design obtains the properties of local soundness and completeness, and determines the operational semantics solely by β-reduction, as customary in other logic-based calculi. In this view, effect handlers arise naturally as a witness that one context (i.e., algebraic theory) can be reached from another, generalizing explicit substitutions from CMTT. To the best of our knowledge, ECMTT is the first system to relate algebraic effects to modal types. We also see it as a step towards providing a correspondence in the style of Curry and Howard that may transfer a number of results from the fields of modal logic and modal type theory to that of algebraic effects.

链接与引用

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

BibTeX
@article{paperbot1134,
  title = {Contextual modal types for algebraic effects and handlers},
  author = {Nikita Zyuzin and Aleksandar Nanevski},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {5},
  number = {ICFP},
  year = {2021},
  doi = {10.1145/3473580}
}