paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Hefty algebras: Modular elaboration of higher-order effects

Hefty 代数:高阶效应的模块化精化
JFP vol.352025匹配度 2/10 · 该论文属于函数式编程与形式语义领域,研究高阶代数效应的模块化精化语义,与用户关注的 PL 与 AI 交叉、静态分析、浮点程序分析及贝叶斯程序分析均无直接关联;虽有 Agda 形式化,但并非 LLM/Agent 辅助形式化验证,也无工业落地或问题驱动的实证评估。引用 0 inbox
CAS VAN DER REST, CASPER BACH
crossref: 2026-09-10

AI 速览

一句话:提出 Hefty 代数,用语法重载为高阶代数效应建立模块化精化语义,并在 Agda 中形式化。

代数效应与处理器支持模块化编程,但高阶操作(以计算为参数)会破坏模块性:它们虽可编码为代数效应,却通常无法封装在接口中,实现精化时需改动程序与证明。本文提出 Hefty 代数,一个通过语法重载刻画高阶效应语义的形式框架,定义从高阶效应树到原始代数效应的模块化精化,并发展模块化高阶效应理论与推理原则。作者展示该框架可覆盖文献中多种已知高阶效应,并在 Agda 中形式化全部贡献。

问题
高阶代数效应操作以计算为参数,若编码为普通代数效应,往往无法封装于接口,导致实现精化时程序和证明不再模块化。
方法
提出 Hefty 代数,以语法重载定义高阶效应的基于重载语义,并给出从高阶效应树到原始代数效应的模块化精化,以及模块化高阶效应理论与推理原则。
评估
通过定义文献中多种已知高阶效应展示可扩展性,并在 Agda 中机器化验证全部贡献。
原文摘要(Abstract)

Abstract Algebraic effects and handlers is an increasingly popular paradigm for programming with effects. A key benefit is modularity: programs with effects are defined against an interface of operations, allowing the implementation of effects to be defined and refined without changing or recompiling programs. The behavior of effects is specified using equational theories, with equational proofs inheriting the same modularity. However, higher-order operations (that take computations as arguments) break this modularity: while they can often be encoded in terms of algebraic effects, this typically breaks modularity as operations defined this way are not encapsulated in an interface, inducing changes to programs and proofs upon refinement of the implementation. In this paper, we show that syntactic overloading is a viable solution to this modularity problem by defining hefty algebras : a formal framework that captures an overloading-based semantics of higher-order effects by defining modular elaborations from higher-order effect trees into primitive algebraic effects. We demonstrate how this approach scales to define a wide range of known higher-order effects from the literature and develop modular higher-order effect theories and modular reasoning principles that build on and extend the state of the art in modular algebraic effect theories. We formalize our contributions in Agda.

链接与引用

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

BibTeX
@article{RestB25,
  title = {Hefty algebras: Modular elaboration of higher-order effects},
  author = {CAS VAN DER REST and CASPER BACH},
  journal = {Journal of Functional Programming},
  volume = {35},
  year = {2025},
  doi = {10.1017/s0956796825100142}
}