paperbot · PL 论文追踪

全部论文 待读 收藏

P2 On the expressive power of user-defined effects: effect handlers, monadic reflection, delimited control

论用户自定义效应的表达能力:效应处理器、单子反射与定界控制
ICFP 1(ICFP)2017匹配度 2/10 · 这篇论文属于纯编程语言理论,研究效应处理器、单子反射和定界控制的宏表达能力与类型保持,与用户关注的静态分析、ML/Agentic 程序、LLM 交叉、浮点或贝叶斯程序分析均无直接关联。虽然涉及形式语义和类型系统,但未触及用户研究画像中的核心问题。引用 81 inbox
Yannick Forster, Ohad Kammar, Sam Lindley, Matija Pretnar
dblp: 2026-09-10crossref: 2026-09-10arxiv: 2026-09-10

AI 速览

一句话:比较效应处理器、单子反射与定界控制的表达能力,证明类型保持下效应处理器无法被后两者宏表达。

论文比较用户自定义计算效应的三种抽象:效应处理器、单子反射与无答案类型修改的定界控制。作者分别构造扩展 call-by-push-value 的演算,给出语法、操作语义、类型与效应系统,并为其中二者建立集合论指称语义,证明安全性、终止性、可靠性与充分性。利用 Felleisen 宏翻译,论文展示三者可相互宏表达并判定哪些翻译保持可类型性。关键结论:借助单子演算的充分有限集合论指称语义,在类型保持下,效应处理器不能被单子反射或定界控制宏表达;加入多态或归纳类型后结论失效。工作包含 Abella 机化形式化。

问题
论文要精确比较用户自定义计算效应的三种抽象——效应处理器、单子反射、无答案类型修改的定界控制——的相对表达能力,并考察语言特性对该结论的影响。
方法
为每种抽象给出扩展 call-by-push-value 的演算,定义语法、操作语义、类型与效应系统及部分指称语义,证明安全性、终止性、可靠性与充分性;用 Felleisen 宏翻译刻画相互表达并检验类型保持。
评估
借助单子演算的充分有限集合论指称语义,证明类型保持下效应处理器不能被单子反射或定界控制宏表达;该论证在加入多态或归纳类型等改动后失效,并用 Abella 机化形式化佐证。
原文摘要(Abstract)

We compare the expressive power of three programming abstractions for user-defined computational effects: Plotkin and Pretnar's effect handlers, Filinski's monadic reflection, and delimited control without answer-type-modification. This comparison allows a precise discussion about the relative expressiveness of each programming abstraction. It also demonstrates the sensitivity of the relative expressiveness of user-defined effects to seemingly orthogonal language features. We present three calculi, one per abstraction, extending Levy's call-by-push-value. For each calculus, we present syntax, operational semantics, a natural type-and-effect system, and, for effect handlers and monadic reflection, a set-theoretic denotational semantics. We establish their basic metatheoretic properties: safety, termination, and, where applicable, soundness and adequacy. Using Felleisen's notion of a macro translation, we show that these abstractions can macro-express each other, and show which translations preserve typeability. We use the adequate finitary set-theoretic denotational semantics for the monadic calculus to show that effect handlers cannot be macro-expressed while preserving typeability either by monadic reflection or by delimited control. Our argument fails with simple changes to the type system such as polymorphism and inductive types. We supplement our development with a mechanised Abella formalisation.

链接与引用

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

BibTeX
@article{ForsterKLP16,
  title = {On the expressive power of user-defined effects: effect handlers, monadic reflection, delimited control},
  author = {Yannick Forster and Ohad Kammar and Sam Lindley and Matija Pretnar},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {1},
  number = {ICFP},
  year = {2017},
  doi = {10.1145/3110257}
}