paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Is sized typing for Coq practical?

Coq 的 sized typing 实用吗?
JFP vol.332023匹配度 2/10 · 论文研究 Coq 中 sized type 与 size inference 的理论和内核实现,属于类型论与证明助手方向;但未涉及 LLM/Agent、ML/Agentic 程序的静态分析、浮点程序分析或贝叶斯程序分析,与用户核心研究方向仅有形式验证/类型系统层面的间接关联。引用 3 inbox
JONATHAN CHAN, YUFENG LI, WILLIAM J. BOWMAN
crossref: 2026-09-10

AI 速览

一句话:提出 CIC* sized type theory 与 size inference 并实现于 Coq 内核,评估发现性能严重退化,结论不实用。

证明助手 Coq 要求递归函数终止、余递归函数生产,以维持类型论一致性,但其句法检查脆弱且限制用户;已有 sized type theories 更稳健、可组合,却未用于 Coq。为回答原因,本文提出 CIC*:基于 CIC 的 sized type theory,扩展了全局与局部定义等 Coq 特性。作者设计相应 size inference 算法并在 Coq 内核中实现;为最大向后兼容,无需用户额外标注。评估编译 Coq 标准库部分内容时,发现算法本身导致严重性能退化。结论:若要保持向后兼容,用 size inference 替代句法检查在性能上不切实际。

问题
为什么已有更稳健、可组合的 sized type theories 尚未被 Coq 采用?
方法
提出基于 CIC 的 sized type theory CIC*,扩展全局/局部定义等 Coq 特性,设计 size inference 算法并实现于 Coq 内核,且不要求用户额外标注。
评估
通过编译 Coq 标准库部分内容进行评估,观察到算法本身导致严重性能退化,因而在保持向后兼容时替代句法检查不实用。
原文摘要(Abstract)

Abstract Contemporary proof assistants such as Coq require that recursive functions be terminating and corecursive functions be productive to maintain logical consistency of their type theories, and some ensure these properties using syntactic checks. However, being syntactic, they are inherently delicate and restrictive, preventing users from easily writing obviously terminating or productive functions at their whim. Meanwhile, there exist many sized type theories that perform type-based termination and productivity checking, including theories based on the Calculus of (Co)Inductive Constructions (CIC), the core calculus underlying Coq. These theories are more robust and compositional in comparison. So why haven’t they been adapted to Coq? In this paper, we venture to answer this question with CIC $\widehat{\ast}$ , a sized type theory based on CIC. It extends past work on sized types in CIC with additional Coq features such as global and local definitions. We also present a corresponding size inference algorithm and implement it within Coq’s kernel; for maximal backward compatibility with existing Coq developments, it requires no additional annotations from the user. In our evaluation of the implementation, we find a severe performance degradation when compiling parts of the Coq standard library, inherent to the algorithm itself. We conclude that if we wish to maintain backward compatibility, using size inference as a replacement for syntactic checking is impractical in terms of performance.

链接与引用

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

BibTeX
@article{paperbot2146,
  title = {Is sized typing for Coq practical?},
  author = {JONATHAN CHAN and YUFENG LI and WILLIAM J. BOWMAN},
  journal = {Journal of Functional Programming},
  volume = {33},
  year = {2023},
  doi = {10.1017/s0956796822000120}
}