paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Ready, <tt>Set</tt> , Verify! Applying <tt>hs-to-coq</tt> to real-world Haskell code

准备,Set,验证!将 hs-to-coq 应用于真实世界 Haskell 代码
JFP vol.312021匹配度 2/10 · 该论文属于定理证明与程序验证,将 hs-to-coq 用于验证 Haskell containers 库,与用户关注的 LLM/Agent 改进形式化验证、浮点程序分析或贝叶斯程序分析没有直接关系。它虽兼具形式化与工程实现,但缺少 LLM/Agent、静态分析工具或 AI 系统场景等核心要素。引用 10 inbox
JOACHIM BREITNER, ANTAL SPECTOR-ZABUSKY, YAO LI, CHRISTINE RIZKALLAH, JOHN WIEGLEY, JOSHUA COHEN, STEPHANIE WEIRICH
crossref: 2026-09-10

AI 速览

一句话:把 hs-to-coq 应用于 Haskell containers 库,验证其类型类定律与接口,并扩展 partiality 支持。

主流函数式语言程序缺乏机械化验证工具。本文使用 hs-to-coq 将 Haskell containers 库的重要部分翻译到 Coq,并依据类型类定律、库测试套件和 Coq 标准库接口等来源推导规约进行验证。结果表明,对成熟、广泛使用、高度优化且未修改的 Haskell 代码进行验证是可行的;作者还扩展 hs-to-coq 以处理 partiality,深化了对权重平衡树理论的理解,且未发现缺陷,佐证了经过良好测试的函数式代码的质量。

问题
如何为主流函数式语言中成熟、优化且未修改的真实代码提供机械化验证,并处理 Haskell 偏函数语义带来的挑战。
方法
用 hs-to-coq 将 Haskell containers 库片段翻译到 Coq,从类型类定律、测试套件和 Coq 标准库接口提取规约,并扩展工具以支持 partiality。
评估
对 containers 库的重要部分进行 Coq 机械化验证,覆盖权重平衡树等性质,未发现实现缺陷,并总结了工具扩展与理论收获。
原文摘要(Abstract)

Abstract Good tools can bring mechanical verification to programs written in mainstream functional languages. We use hs-to-coq to translate significant portions of Haskell’s containers library into Coq, and verify it against specifications that we derive from a variety of sources including type class laws, the library’s test suite, and interfaces from Coq’s standard library. Our work shows that it is feasible to verify mature, widely used, highly optimized, and unmodified Haskell code. We also learn more about the theory of weight-balanced trees, extend hs-to-coq to handle partiality, and – since we found no bugs – attest to the superb quality of well-tested functional code.

链接与引用

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

BibTeX
@article{paperbot1227,
  title = {Ready,
                    <tt>Set</tt>
                    , Verify! Applying
                    <tt>hs-to-coq</tt>
                    to real-world Haskell code},
  author = {JOACHIM BREITNER and ANTAL SPECTOR-ZABUSKY and YAO LI and CHRISTINE RIZKALLAH and JOHN WIEGLEY and JOSHUA COHEN and STEPHANIE WEIRICH},
  journal = {Journal of Functional Programming},
  volume = {31},
  year = {2021},
  doi = {10.1017/s0956796820000283}
}