CertiRocq is a compiler for Gallina, the specification language of the Rocq Prover. CertiRocq targets WebAssembly and Clight, a subset of the C language that can be compiled with any C compiler, including the CompCert verified compiler.
Large parts of the CertiRocq compiler have been verified whereas others are in the process of being verified.
The CertiRocq Wiki has instructions for using the CertiRocq plugin to compile Gallina to C and interfacing with the generated C code.
You can also find end-to-end examples in tests/programs/tests.v and tests/axioms/tests.v.
See INSTALL.md for installation instructions.
Yannick Forster, Joomy Korkut, Zoe Paraskevopoulou, and Matthieu Sozeau.
Andrew Appel, Abhishek Anand, Anvay Grover, John Li, Greg Morrisett, Randy Pollack, Olivier Savary Belanger, Matthew Weaver
CertiRocq is open source and distributed under the MIT license.
libraries/contains shared Rocq utilities used throughout the developmenttheories/contains the core compiler development and proofsplugins/contains the Rocq plugins, withplugins/plugin/as the main plugin andplugins/cplugin/as the vanilla-extraction variant used as the more conservative plugin variant and as the basis for the bootstrapped toolsruntime/contains the C runtime support and FFI helpers used by generated programstests/contains demos, regression tests, and end-to-end test harnessesbootstrap/contains the bootstrapped CertiRocq plugin for Rocq and a CertiRocq-compiled variant of MetaRocq's safe type checker
Structure of the theories directory:
theories/common: contains common utilities shared across the developmenttheories/LambdaBox_to_LambdaANF: contains the translation from MetaRocq's erased LambdaBox language to CertiRocq's ANF IRtheories/LambdaANF: contains the λANF IR, optimization pipeline, and proofstheories/Compiler: contains the top-level CertiRocq pipelinetheories/Codegen: contains the Clight code generatortheories/CodegenWasm: contains the Wasm code generatortheories/Glue: contains glue-code generation supporttheories/Extractionandtheories/ExtractionVanilla: contain the extraction entry points used to build the two plugin variants
We use github's issue tracker to keep track of bugs and feature requests.
