The formally-verified C compiler.
The CompCert C verified compiler is a compiler for a large subset of the C programming language that generates code for the PowerPC, ARM, x86 and RISC-V processors.
The distinguishing feature of CompCert is that it has been formally verified using the Coq proof assistant: the generated assembly code is formally guaranteed to behave as prescribed by the semantics of the source C code.
For more information on CompCert (supported platforms, supported C features, installation instructions, using the compiler, etc), please refer to the Web site and especially the user's manual.
CompCert is not free software. This non-commercial release can only
be used for evaluation, research, educational and personal purposes.
A commercial version of CompCert, without this restriction and with
professional support and extra features, can be purchased from
AbsInt. See the file LICENSE
for more
information.
The CompCert verified compiler is Copyright Institut National de Recherche en Informatique et en Automatique (INRIA) and AbsInt Angewandte Informatik GmbH.
General discussions on CompCert take place on the [email protected] mailing list.
For inquiries on the commercial version of CompCert, please contact [email protected]
To run a BeePL program run CompCert with a file that ends in .b
.
./ccomp ~/test.b
The contents of the file do not matter. The .b
suffix tells the driver to call
process_b_file
which in turn calls compile_b_file
. The program compiled is
hard coded in compile_b_file
and passed to transf_beepl_program_csyntax
. The
hard coded program in compile_b_file
is defined in BeePL_progs.v
.
To pretty print csyntax: ./ccomp ~/test.b -dc
- Add a Coq file to
compiler_test/beepl_test
- In
Makefile
add the file to the list ofBEEPL_TESTS
- In
BeePL_progs.v
Require Import
the file - Define the BeePL AST in the newly created Coq file
- Modify the required lines in
BeePL_progs.v
so the correct program gets extracted
Add -typecheck
to your command line to run the typechecker.
Full example: ./ccomp ../test.b -o test -typecheck