VeriFast is a powerful tool for verification of various correctness properties of C programs using symbolic execution. However, VeriFast itself has not been verified. We present a proof-of-concept extension which generates a correctness certificate for each successful verification run individually. This certificate takes the form of a Coq script containing two proofs which, when successfully checked by Coq, together remove the need for trusting in the correctness of VeriFast itself. The first proves a lemma expressing the correctness of the program with respect to a big step operational semantics developed by ourselves, intended to reflect VeriFast’s interpretation of C. We have formalized this semantics in Coq as cbsem. This lemma is proven by symbolic execution in Coq, which in turn is implemented by transforming the exported AST of the program into a Coq proposition representing the symbolic execution performed by VeriFast itself. The second proves the correctness of the same C program with respect to CompCert’s Clight big step semantics. This proof simply applies our proof of the soundness of cbsem with respect to CompCert Clight to the first proof.
[1]
Xavier Leroy,et al.
Formal verification of a realistic compiler
,
2009,
CACM.
[2]
Lars Birkedal,et al.
Iris from the ground up: A modular foundation for higher-order concurrent separation logic
,
2018,
Journal of Functional Programming.
[3]
Xavier Leroy,et al.
The CompCert Memory Model, Version 2
,
2012
.
[4]
Frank Piessens,et al.
Featherweight VeriFast
,
2015,
Log. Methods Comput. Sci..
[5]
Xavier Leroy,et al.
Mechanized Semantics for the Clight Subset of the C Language
,
2009,
Journal of Automated Reasoning.
[6]
Xavier Leroy,et al.
Coinductive big-step operational semantics
,
2006,
Inf. Comput..
[7]
Derek Dreyer,et al.
RefinedC: automating the foundational verification of C code with refined ownership types
,
2021,
PLDI.
[8]
Alexander J. Summers,et al.
Formally Validating a Practical Verification Condition Generator
,
2021,
CAV.
[9]
Robbert Krebbers,et al.
The C standard formalized in Coq
,
2015
.