paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Algebraic Effects Meet Hoare Logic in Cubical Agda

代数效应在 Cubical Agda 中遇上 Hoare 逻辑
POPL 8(POPL)2024匹配度 3/10 · 论文属于 PL 与形式化验证领域(Cubical Agda 中的代数效应形式化、效应通用的 Hoare 逻辑),与用户关注的“形式化验证”有邻接关系,且同时具备理论形式化与库实现,符合部分偏好;但它完全不涉及 LLM/Agent、机器学习系统静态分析、浮点程序分析或贝叶斯程序分析,也未讨论工业落地或 benchmark 失效问题,与研究方向的核心交叉点几乎没有交集。引用 2 inbox
Donnacha Oisín Kidney, Zhixuan Yang, Nicolas Wu
crossref: 2026-09-10

AI 速览

一句话:在 Cubical Agda 中用商类型形式化带方程的代数效应,并提供效应通用的 Hoare 逻辑与等式推理。

本文关注带等式(equations)的代数效应在依赖类型论中的形式化。以往工作多借助 setoid 处理效应方程带来的商结构,而本文在 Cubical Agda 中改用商类型(quotient types)忠实编码按定律商去后的项。作者构建了一个库,既提供代数效应的等式推理工具,也给出一个效应通用的 Hoare 逻辑,使带效应程序可以按前置/后置条件进行推理。特别地,该工作通过 Hoare 逻辑的消去原理(elimination principle)将等式推理与 Hoare 风格推理联系起来。其贡献在于把高阶商类型、代数效应和 Hoare 逻辑统一在同一立方类型论框架中,从而支持对效应程序进行机器化验证与等式推导。评估主要是 Cubical Agda 中的形式化实现及其推理机制的关联性。

问题
如何在不使用 setoid 的情况下忠实形式化带方程的代数效应,并为其提供 Hoare 式前后条件推理。
方法
在 Cubical Agda 中使用商类型编码按定律商去的项,构建等式推理工具和效应通用的 Hoare 逻辑,并用 Hoare 逻辑的消去原理关联等式推理与 Hoare 风格推理。
评估
以 Cubical Agda 库的形式进行机器化形式化,并展示等式推理与 Hoare 风格推理通过消去原理相互关联。
原文摘要(Abstract)

This paper presents a novel formalisation of algebraic effects with equations in Cubical Agda. Unlike previous work in the literature that employed setoids to deal with equations, the library presented here uses quotient types to faithfully encode the type of terms quotiented by laws. Apart from tools for equational reasoning, the library also provides an effect-generic Hoare logic for algebraic effects, which enables reasoning about effectful programs in terms of their pre- and post-conditions. A particularly novel aspect is that equational reasoning and Hoare-style reasoning are related by an elimination principle of Hoare logic.

链接与引用

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

BibTeX
@article{paperbot2613,
  title = {Algebraic Effects Meet Hoare Logic in Cubical Agda},
  author = {Donnacha Oisín Kidney and Zhixuan Yang and Nicolas Wu},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {POPL},
  year = {2024},
  doi = {10.1145/3632898}
}