COQ Cock Correct! Verification of Type Checking and Erasure for COQ, in COQ

Proceedings of the ACM on Programming Languages(2020)

引用 83|浏览12
暂无评分
摘要
COQ is built around a well-delimited kernel that perfoms typechecking for definitions in a variant of the Calculus of Inductive Constructions (CIC). Although the metatheory of CIC is very stable and reliable, the correctness of its implementation in COQ is less clear. Indeed, implementing an efficient type checker for CIC is a rather complex task, and many parts of the code rely on implicit invariants which can easily be broken by further evolution of the code. Therefore, on average, one critical bug has been found every year in COQ. This paper presents the first implementation of a type checker for the kernel of COQ (without the module system and template polymorphism), which is proven correct in COQ with respect to its formal specification and axiomatisation of part of its metatheory. Note that because of Godel's incompleteness theorem, there is no hope to prove completely the correctness of the specification of COQ inside COQ (in particular strong normalisation or canonicity), but it is possible to prove the correctness of the implementation assuming the correctness of the specification, thus moving from a trusted code base (TCB) to a trusted theory base (TTB) paradigm. Our work is based on the METACoQ project which provides metaprogramming facilities to work with terms and declarations at the level of this kernel. Our type checker is based on the specification of the typing relation of the Polymorphic, Cumulative Calculus of Inductive Constructions (PCUIC) at the basis of COQ and the verification of a relatively efficient and sound type-checker for it. In addition to the kernel implementation, an essential feature of COQ is the so-called extraction: the production of executable code in functional languages from COQ definitions. We present a verified version of this subtle type-and-proof erasure step, therefore enabling the verified extraction of a safe type-checker for COQ.
更多
查看译文
关键词
certification, proof assistants, type checker
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要