paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Strong functional pearl: Harper’s regular-expression matcher in Cedille

强函数式珍珠:在 Cedille 中实现 Harper 的正则表达式匹配器
ICFP 4(ICFP)2020匹配度 2/10 · 论文属于纯类型论/函数式编程领域,研究用递归宇宙接口静态保证程序终止,虽与形式化验证和静态分析有微弱关联,但不涉及 LLM/Agent、机器学习系统、浮点程序分析或贝叶斯程序分析,与用户核心研究方向交集很小。引用 3 inbox
Aaron Stump, Christopher Jenkins, Stephan Spahn, Colin McDonald
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:在 Cedille 中用递归宇宙接口将 Harper 的续延式正则表达式匹配器实现为强函数式程序,静态保证其全输入终止。

本文回应 Bove、Krauss 和 Sozeau 提出的挑战,在 Cedille 中将 Harper 基于续延的正则表达式匹配器实现为强函数式程序。其关键不是依赖类型或显式终止证明,而是使用 Cedille 提供的“递归宇宙”接口:语言保证所有针对该接口编写的程序都终止,而程序员只需用标准多态类型检查代码是否符合接口。该实现展示了无需复杂类型机制即可获得全输入终止保证的强函数式编程风格,并为以正则匹配器为代表的非结构化递归程序提供了可静态验证的终止方案。

问题
如何在无依赖类型、无显式终止证明的前提下,实现可被静态保证终止的强函数式程序,特别是 Harper 基于续延的正则表达式匹配器,并回应 Bove、Krauss 和 Sozeau 的挑战。
方法
将匹配器写成 Cedille 中的强函数式程序,借助语言提供的“递归宇宙”接口;只需标准多态类型即可检查程序符合该接口,由语言保证接口上的程序终止。
评估
Cedille 静态确认该匹配器对所有输入都终止,且代码通过标准多态类型检查,表明无需依赖类型或终止证明即可获得终止保证。
原文摘要(Abstract)

This paper describes an implementation of Harper's continuation-based regular-expression matcher as a strong functional program in Cedille; i.e., Cedille statically confirms termination of the program on all inputs. The approach uses neither dependent types nor termination proofs. Instead, a particular interface dubbed a recursion universe is provided by Cedille, and the language ensures that all programs written against this interface terminate. Standard polymorphic typing is all that is needed to check the code against the interface. This answers a challenge posed by Bove, Krauss, and Sozeau.

链接与引用

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

BibTeX
@article{StumpJSM20,
  title = {Strong functional pearl: Harper’s regular-expression matcher in Cedille},
  author = {Aaron Stump and Christopher Jenkins and Stephan Spahn and Colin McDonald},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {4},
  number = {ICFP},
  year = {2020},
  doi = {10.1145/3409004}
}