paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Explicit effect subtyping

显式效应子类型
JFP vol.302020匹配度 2/10 · 论文属于纯 PL 类型系统理论(代数效应与子类型),与用户关注的 PL 与 AI/LLM/浮点/贝叶斯程序分析等交叉方向无直接关联;虽涉及静态分析技术(类型与效应推断),但应用场景和论文目标均不匹配。引用 15 inbox
GEORGIOS KARACHALIAS, MATIJA PRETNAR, AMR HANY SALEH, STIEN VANDERHALLEN, TOM SCHRIJVERS
dblp: 2026-09-10crossref: 2026-09-10arxiv: 2026-09-10

AI 速览

一句话:提出显式类型化、带子类型与强制转换的代数效应处理器核心演算及约束推断算法。

随着代数效应与处理器日益流行,如何高效执行它们成为重要问题。Eff 是原生支持处理器的 ML 风格语言,其基于子类型的效应系统可用于构建效应感知优化编译器,但其核心语言是隐式类型的,导致程序变换脆弱且易错。本文提出一个显式类型化的多态核心演算,支持代数效应处理器与基于子类型的类型-效应系统;该演算将子类型调用具体化为带 coercion 的显式 cast,从而快速暴露程序变换中的类型错误。作者给出类型导向的 elaboration 与基于约束的推断算法,可将隐式类型的 Eff 风格语言转换为该演算。此外,所有 coercion 与效应信息均可直接擦除,表明 coercion 没有计算内容;并给出到无代数效应/处理器的纯语言的 monadic translation,仅在必要时引入 monadic 构造。

问题
代数效应与处理器的优化实现需要可靠的类型信息,但 Eff 等语言核心为隐式类型,使程序变换脆弱且容易隐藏类型错误。
方法
提出显式类型化的多态核心演算,用带 coercion 的显式 cast 具体化子类型证明,并设计类型导向的约束推断算法将隐式 Eff 风格语言 elaborated 到该演算。
评估
通过可擦除性说明 coercion 和效应信息没有计算内容,并给出到纯语言的 monadic translation,展示效应信息可用于仅在必要时引入 monadic 构造。
原文摘要(Abstract)

Abstract As popularity of algebraic effects and handlers increases, so does a demand for their efficient execution. Eff, an ML-like language with native support for handlers, has a subtyping-based effect system on which an effect-aware optimising compiler could be built. Unfortunately, in our experience, implementing optimisations for Eff is overly error-prone because its core language is implicitly typed, making code transformations very fragile. To remedy this, we present an explicitly typed polymorphic core calculus for algebraic effect handlers with a subtyping-based type-and-effect system. It reifies appeals to subtyping in explicit casts with coercions that witness the subtyping proof, quickly exposing typing bugs in program transformations. Our typing-directed elaboration comes with a constraint-based inference algorithm that turns an implicitly typed Eff-like language into our calculus. Moreover, all coercions and effect information can be erased in a straightforward way, demonstrating that coercions have no computational content. Additionally, we present a monadic translation from our calculus into a pure language without algebraic effects or handlers, using the effect information to introduce monadic constructs only where necessary.

链接与引用

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

BibTeX
@article{SalehKPS18,
  title = {Explicit effect subtyping},
  author = {GEORGIOS KARACHALIAS and MATIJA PRETNAR and AMR HANY SALEH and STIEN VANDERHALLEN and TOM SCHRIJVERS},
  journal = {Journal of Functional Programming},
  volume = {30},
  year = {2020},
  doi = {10.1017/s0956796820000131}
}