Published December 24, 2022 | Version v1
Software Open

Certifying C program correctness with respect to the CH2O formalization of the C standard with VeriFast: source code

  • 1. KU Leuven

Description

Brief summary: 

We adapted the approach from our earlier 2021 report ("Certifying C program correctness with respect to CompCert with VeriFast", see: arXiv:2110.11034), so that now we verify against CH2O instead of against CompCert.

The uploaded code contains a slightly modified version of CH2O and a fork of VeriFast. Building instructions can be found in README.md (and in the regular documentation for VeriFast). Notable features include:

  • a big step semantics for a subset of CH2O, using coinduction to support diverging programs;
  • a soundness proof of this big step semantics with respect to CH2O axiomatic semantics;
  • a similar big step semantics for a subset of our own VeriFast C, together with a soundness proof with respect to CH2O big step semantics;
  • a formalisation of VeriFast's symbolic execution for the relevant subset of C, together with a soundness proof with respect to VeriFast big step semantics.

As in the 2021 report, we extend the VeriFast command line tool to export a Coq script whenever a program has been verified successfully. This generated Coq script proves correctness of the verified program in the CH2O formal semantics. It does so by generating a verification condition (VC) reflecting VeriFast's symbolic execution and a proof for this VC. It then applies to this result the "chain" of soundness proofs mentioned earlier, to arrive at a conclusion of correctness with respect to CH2O.

References: 

Files

README.md

Files (11.6 MB)

Name Size Download all
md5:20b2d6ab30610250bfaedd4928b64bfe
3.8 MB Download
md5:2cad1d2abba6eaf8d14900da93147dac
1.6 kB Preview Download
md5:b90c421addc2f6884f5ae5ecb8a0734c
7.8 MB Download