Search engine for discovering works of Art, research articles, and books related to Art and Culture
ShareThis
Javascript must be enabled to continue!

Coq Coq correct! verification of type checking and erasure for Coq, in Coq

View through CrossRef
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 Gödel'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.
Title: Coq Coq correct! verification of type checking and erasure for Coq, in Coq
Description:
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 Gödel'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.

Related Results

Improved Biopharmaceutical Performance of Coenzyme Q10 Through Solid Lipid Nanoparticles for Enhanced Brain Delivery
Improved Biopharmaceutical Performance of Coenzyme Q10 Through Solid Lipid Nanoparticles for Enhanced Brain Delivery
Coenzyme Q10 (CoQ) is a powerful antioxidant with neuroprotective characteristics; nevertheless, its clinical use is constrained by inadequate solubility, diminished bioavailabilit...
Verification of High Speed on Chip with VIP using System Verilog
Verification of High Speed on Chip with VIP using System Verilog
Abstract - The exploration work is addressing verification of High speed on chips protocol; we've used the system Verilog grounded test bench structure. I developed a system Verilo...
Program in Coq
Program in Coq
Programmation en Coq Dans cette thèse, nous cherchons à développer de nouvelles techniques pour écrire plus simplement des programmes formellement vérifiés. Nous pr...
Drawing Erasure
Drawing Erasure
Architectural practice is often a project in asserting control over the natural environment in pursuit of permanence and stability, but what if erasure could disrupt this? What new...
Automated verification of termination certificates
Automated verification of termination certificates
Vérification automatisée de certificats de terminaison S'assurer qu'un programme informatique se comporte bien, surtout dans des applications critiques (santé, tran...
Model-checking ecological state-transition graphs
Model-checking ecological state-transition graphs
Abstract Model-checking is a methodology developed in computer science to automatically assess the dynamics of discrete systems, by checking if a system modelled as...
COVID-19 Vaccine Fact-Checking Posts on Facebook: Observational Study (Preprint)
COVID-19 Vaccine Fact-Checking Posts on Facebook: Observational Study (Preprint)
BACKGROUND Effective interventions aimed at correcting COVID-19 vaccine misinformation, known as fact-checking messages, are needed to combat the mounting a...

Back to Top