paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Verifying efficient function calls in CakeML

验证 CakeML 中的高效函数调用
ICFP 1(ICFP)2017匹配度 2/10 · 该论文属于编译器验证与定理证明工程,虽与形式化验证相关,但没有涉及静态分析、机器学习系统、Agentic程序或LLM与形式化验证的交叉,也未覆盖浮点程序分析或贝叶斯程序分析。引用 19 inbox
Scott Owens, Michael Norrish, Ramana Kumar, Magnus O. Myreen, Yong Kiam Tan
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:为 CakeML 编译器设计支持函数调用优化的中间语言语义,并在 HOL4 中验证其编译步骤。

在 CakeML 编译器中,函数调用的高效编译与验证是一大挑战。本文设计了一种中间语言(IL),并为其定义形式语义,以支持经过验证的高效函数调用编译。所实现的验证编译步骤包括:批量处理多个柯里化参数、检测对静态已知函数的调用,以及特化无自由变量的已知函数调用。最后,论文验证了向更低层 IL 的翻译,该层仅支持封闭的一阶函数。这些步骤与 OCaml 等编译器中的优化类似。整个开发在 HOL4 定理证明器中完成,表明所提出的验证技术在此规模下切实可行,为编译器验证提供了可扩展的语义设计与证明方法。

问题
如何对编译器中的函数调用进行高效编译,并保证编译步骤的正确性?在 CakeML 编译器中,这需要为中间语言设计合适的语义,并在证明助手内验证优化步骤。
方法
设计一种支持函数调用优化的中间语言(IL)及其形式语义;实现并验证批量柯里化参数、静态调用检测、已知函数特化等编译步骤,以及向仅支持封闭一阶函数的更低层 IL 的翻译。
评估
整个开发在 HOL4 定理证明器中完成,证明技术可扩展至实际编译器规模,实现了经过验证的高效函数调用编译。
原文摘要(Abstract)

We have designed an intermediate language (IL) for the CakeML compiler that supports the verified, efficient compilation of functions and calls. Verified compilation steps include batching of multiple curried arguments, detecting calls to statically known functions, and specialising calls to known functions with no free variables. Finally, we verify the translation to a lower-level IL that only supports closed, first-order functions. These compilation steps resemble those found in other compilers (especially OCaml). Our contribution here is the design of the semantics of the IL, and the demonstration that our verification techniques over this semantics work well in practice at this scale. The entire development was carried out in the HOL4 theorem prover.

链接与引用

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

BibTeX
@article{OwensNKMT17,
  title = {Verifying efficient function calls in CakeML},
  author = {Scott Owens and Michael Norrish and Ramana Kumar and Magnus O. Myreen and Yong Kiam Tan},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {1},
  number = {ICFP},
  year = {2017},
  doi = {10.1145/3110262}
}