Foundational VeriFast: Pragmatic Certification of Verification Tool Results through Hinted Mirroring

Bart Jacobs · 2026

Read Foundational VeriFast: Pragmatic Certification of Verification Tool Results through Hinted Mirroring by Bart Jacobs (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-13727.txt.

Introduction

Bart Jacobs works on certifying the results of a program checker called VeriFast in 2026. VeriFast checks that C and Rust code meets strict correctness claims. It runs each function on its own, guided by notes the user adds. Those notes state what must hold before and after each step, in separation logic.

Jacobs adds a path to certify VeriFast output in a foundational way. The method uses hinted mirroring to rebuild the proof in a trusted base. Users then need not trust the whole tool, just the small checker. Stronger proof chains matter for safety-critical code.

Catalog record

CREATORBart Jacobs
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE25 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2601-13727

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Foundational VeriFast: Pragmatic Certification of Verification Tool Results through Hinted Mirroring Bart Jacobs Abstract VeriFast is a leading tool for the modular formal verification of correctness properties of single-threaded and multi-threaded C and Rust programs. It verifies a program by symbolically executing each function in isolation, exploiting user-annotated preconditions, postconditions, and loop invariants written in a form of separation logic, and using a separation logic-based symbolic representation of memory. However, the tool itself, written in roughly 30K lines of OCaml code, has not been formally verified. Therefore, bugs in the tool could cause it to falsely report the correctness of the input program. We here report on an early result extending VeriFast to emit, upon successful verification of a Rust program, a Rocq proof script that proves correctness of the program with respect to a Rocq-encoded axiomatic semantics of Rust. This significantly enhances VeriFast’s applicability in safety-critical domains. We apply hinted mirroring: we record key information from VeriFast’s symbolic execution run, and use it to direct a replay of the run in Rocq. 1 Introduction This paper is structured as follows: we recall VeriFast [ 7 ] in §1, describe the proof script generation in §2, and discuss soundness in §3. We finish by discussing limitations and related work, and offering a conclusion in §4. 2 Background: VeriFast ⬇ /*@ pred llist(head: *mut u8) = if head == 0 { true } else { *(head as *mut *mut u8) |-> ?next &*& llist(next) }; @*/ unsafe fn reverse_iter ( original : * mut u8 , reversed : * mut u8 ) -> * mut u8 //@ req llist(original) &*& llist(reversed); //@ ens llist(result); { //@ open llist(original); if original . is_null () { return reversed ; } let next = *( original as * mut * mut u8 ); *( original as * mut * mut u8 ) = reversed ; //@ close llist(original); reverse_iter ( next , original ) } unsafe fn reverse ( mut list : * mut u8 ) -> * mut u8 //@ req llist(list); //@ ens llist(result); { //@ close llist(0); reverse_iter ( list , std :: ptr :: null_mut ()) } fn main () //@ req true; //@ ens true; { unsafe { //@ close llist(0); let mut node1 : * mut u8 = std :: ptr :: null_mut (); //@ close llist(&node1 as *mut u8); let mut node2 = & raw mut node1 as * mut u8 ; //@ close llist(&node2 as *mut u8); let mut node3 = & raw mut node2 as * mut u8 ; //@ close llist(&node3 as *mut u8); let reversed = reverse (& raw mut node3 as * mut u8 ); reverse ( reversed ); std :: process :: abort (); } } Figure 1: An example VeriFast-annotated Rust program that reverses a linked list of pointer variables Consider the Rust program in Fig. 1 . Function reverse takes a pointer to the head of a linked list of pointer variables, reverses the linked list in-place, and returns a pointer to the head of the resulting linked list (which is the last node of the original linked list). The function is implemented using recursive helper function reverse_iter , which repeatedly pops a node from the front of the first given linked list and pushes it onto the front of the second one, until the first linked list is empty, and then returns the second one. The main function allocates three pointer variables on the stack, initializes them so that they constitute a linked list with node3 at the head, calls reverse on it, and then calls reverse again on the resulting linked list. This program uses unsafe blocks; therefore, the Rust compiler cannot guarantee the absence of undefined behavior. In particular, it cannot guarantee that the pointer dereferences are safe. Instead, we apply VeriFast 1 1 1 https://github.com/verifast/verifast [ 7 ] to verify the absence of undefined behavior. VeriFast requires that we annotate each function with a precondition and a postcondition, expressed in a variant of separation logic [ 12 , 14 ] , using a recursive separation logic predicate llist to assert ownership of a linked list of pointer variables. A points-to assertion * P |-> V asserts ownership of the variable pointed to by pointer P , and that it currently stores value V . The separating conjunction A1 &*& A2 asserts that A1 and A2 both hold, separately ; the conjuncts must assert ownership of disjoint sets of variables. The occurrence of &*& in the predicate definition asserts that the linked list is acyclic; the occurrence in the precondition of reverse_iter asserts that the two linked lists do not overlap. The right-hand side of a points-to assertion can be a pattern ; the pattern ? X binds the pointed-to value to logical variable X , whose scope extends to the end of the enclosing assertion. To verify a program, VeriFast symbolically executes each function separately, representing memory as a list of so-called heap chunks 2 2 2 This is a bit of a misnomer. A better name would have been “chunk of resource”, since heap chunks are also used to represent stack-allocated memory and other resources. . A heap chunk is either a points-to chunk or a predicate chunk . A points-to chunk is either of the form \mathsf{points\_to\_}(p,s) , asserting ownership of a possibly-uninitialized variable pointed to by pointer p , with initialization state s , or of the form \mathsf{points\_to}(p,v) , asserting ownership of an initialized variable at p , with value v . Here, p , s , and v are terms of first-order logic, which may contain symbols (hence symbolic execution ). Declaring a local variable whose address is taken produces (i.e., adds to the symbolic heap) a \mathsf{points\_to\_} chunk; assigning to a local variable whose address is taken consumes (i.e., removes from the symbolic heap, failing if not found) an appropriate \mathsf{points\_to\_} chunk and produces a \mathsf{points\_to} chunk. Calling a function consumes the callee’s precondition and then produces its postcondition. Consuming assertion llist ( list ) fails unless a \texttt{llist}(\ell) chunk is present in the symbolic heap, where \ell is a term that is provably equal to the value of variable list . To introduce such predicate chunks, the user must generally insert close p ( args ); ghost commands into the program, which consume the body of predicate p and produce a predicate chunk \texttt{p}(\emph{args}) . This process can be reversed using open p ( args ); ghost commands. Symbolic execution traces for main and reverse_iter are shown in Fig. 2 . {{{{{{{{{{{{{{{{{\begin{array}[]{l}{\color[rgb]{0,0,1}[],[],\emptyset}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{}{//@{\@listingGroup{ltx_lst_space}{ }}close{\@listingGroup{ltx_lst_space}{ }}llist(0);}}}}}}\\ {\color[rgb]{0,0,1}[{\color[rgb]{0,0.5,0}\texttt{llist}(\mathsf{nullptr})}],[],\emptyset}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{ltx_lst_keyword}{{let}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{node1}}}:{\@listingGroup{ltx_lst_space}{ }}\textasteriskcentered{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{}{u8}}{\@listingGroup{ltx_lst_space}{ }}={\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{std}}}::{\@listingGroup{}{ptr}}::{\@listingGroup{ltx_lst_identifier}{{null\textunderscore mut}}}();}}}}\\ {\color[rgb]{0,0,1}[{\color[rgb]{1,0,0}{\underline{{\color[rgb]{0,0,1}{\color[rgb]{0,0.5,0}\mathsf{points\_to}(\mathsfsl{node1},\mathsf{nullptr})}}}}},{\color[rgb]{1,0,0}{\underline{{\color[rgb]{0,0,1}\texttt{llist}(\mathsf{nullptr})}}}}],[\texttt{\&node1}\mapsto\mathsfsl{node1}],\{\mathsfsl{node1}\neq\mathsf{nullptr}\}}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{}{//@{\@listingGroup{ltx_lst_space}{ }}close{\@listingGroup{ltx_lst_space}{ }}llist(\&node1{\@listingGroup{ltx_lst_space}{ }}as{\@listingGroup{ltx_lst_space}{ }}\textasteriskcentered mut{\@listingGroup{ltx_lst_space}{ }}u8);}}}}}}\quad\color[rgb]{1,0.65,0}{\textsf{ConsumeChunk}(0)};\color[rgb]{1,0.65,0}{\textsf{ConsumeChunk}(0)}\\ {\color[rgb]{0,0,1}[{\color[rgb]{0,0.5,0}\texttt{llist}(\mathsfsl{node1})}],[\dots],\{\dots\}}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{ltx_lst_keyword}{{let}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{node2}}}{\@listingGroup{ltx_lst_space}{ }}={\@listingGroup{ltx_lst_space}{ }}\&{\@listingGroup{ltx_lst_identifier}{{raw}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{node1}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_keyword}{{as}}}{\@listingGroup{ltx_lst_space}{ }}\textasteriskcentered{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{}{u8}};}}}}\\ {\color[rgb]{0,0,1}[{\color[rgb]{1,0,0}{\underline{{\color[rgb]{0,0,1}{\color[rgb]{0,0.5,0}\mathsf{points\_to}(\mathsfsl{node2},\mathsfsl{node1})}}}}},{\color[rgb]{1,0,0}{\underline{{\color[rgb]{0,0,1}\texttt{llist}(\mathsfsl{node1})}}}}],[\texttt{\&node2}\mapsto\mathsfsl{node2},\dots],\{\mathsfsl{node2}\neq\mathsf{nullptr},\dots\}}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{}{//@{\@listingGroup{ltx_lst_space}{ }}close{\@listingGroup{ltx_lst_space}{ }}llist(\&node2{\@listingGroup{ltx_lst_space}{ }}as{\@listingGroup{ltx_lst_space}{ }}\textasteriskcentered mut{\@listingGroup{ltx_lst_space}{ }}u8);}}}}}}\quad\color[rgb]{1,0.65,0}{\textsf{ConsumeChunk}(0)};\color[rgb]{1,0.65,0}{\textsf{ConsumeChunk}(0)}\\ {\color[rgb]{0,0,1}[{\color[rgb]{0,0.5,0}\texttt{llist}(\mathsfsl{node2})}],[\dots],\{\dots\}}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{ltx_lst_keyword}{{let}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{node3}}}{\@listingGroup{ltx_lst_space}{ }}={\@listingGroup{ltx_lst_space}{ }}\&{\@listingGroup{ltx_lst_identifier}{{raw}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{node2}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_keyword}{{as}}}{\@listingGroup{ltx_lst_space}{ }}\textasteriskcentered{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{}{u8}};}}}}\\ {\color[rgb]{0,0,1}[{\color[rgb]{1,0,0}{\underline{{\color[rgb]{0,0,1}{\color[rgb]{0,0.5,0}\mathsf{points\_to}(\mathsfsl{node3},\mathsfsl{node2})}}}}},{\color[rgb]{1,0,0}{\underline{{\color[rgb]{0,0,1}\texttt{llist}(\mathsfsl{node2})}}}}],[\texttt{\&node3}\mapsto\mathsfsl{node3},\dots],\{\mathsfsl{node3}\neq\mathsf{nullptr},\dots\}}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{}{//@{\@listingGroup{ltx_lst_space}{ }}close{\@listingGroup{ltx_lst_space}{ }}llist(\&node3{\@listingGroup{ltx_lst_space}{ }}as{\@listingGroup{ltx_lst_space}{ }}\textasteriskcentered mut{\@listingGroup{ltx_lst_space}{ }}u8);}}}}}}\quad\color[rgb]{1,0.65,0}{\textsf{ConsumeChunk}(0)};\color[rgb]{1,0.65,0}{\textsf{ConsumeChunk}(0)}\\ {\color[rgb]{0,0,1}[{\color[rgb]{1,0,0}{\underline{{\color[rgb]{0,0,1}{\color[rgb]{0,0.5,0}\texttt{llist}(\mathsfsl{node3})}}}}}],[\dots],\{\dots\}}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{ltx_lst_keyword}{{let}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{reversed}}}{\@listingGroup{ltx_lst_space}{ }}={\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{reverse}}}(\&{\@listingGroup{ltx_lst_identifier}{{raw}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{node3}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_keyword}{{as}}}{\@listingGroup{ltx_lst_space}{ }}\textasteriskcentered{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{}{u8}});}}}}\quad\color[rgb]{1,0.65,0}{\textsf{ConsumeChunk}(0)}\\ {\color[rgb]{0,0,1}[{\color[rgb]{1,0,0}{\underline{{\color[rgb]{0,0,1}{\color[rgb]{0,0.5,0}\texttt{llist}(\mathsfsl{reversed})}}}}}],[\texttt{reversed}\mapsto\mathsfsl{reversed},\dots],\{\dots\}}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{ltx_lst_identifier}{{reverse}}}({\@listingGroup{ltx_lst_identifier}{{reversed}}});}}}}\quad\color[rgb]{1,0.65,0}{\textsf{ConsumeChunk}(0)}\\ \\ {\color[rgb]{0.5,0.5,0.5}\textrm{Produce precondition \lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{ltx_lst_identifier}{{llist}}}({\@listingGroup{ltx_lst_identifier}{{original}}}){\@listingGroup{ltx_lst_space}{ }}\&\textasteriskcentered\&{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{llist}}}({\@listingGroup{ltx_lst_identifier}{{reversed}}})}}}}}\\ {\color[rgb]{0,0,1}[{\color[rgb]{0,0.5,0}\texttt{llist}(\mathsfsl{reversed})},{\color[rgb]{1,0,0}{\underline{{\color[rgb]{0,0,1}{\color[rgb]{0,0.5,0}\texttt{llist}(\mathsfsl{original})}}}}}],[\texttt{reversed}\mapsto\mathsfsl{reversed},\texttt{original}\mapsto\mathsfsl{original}],\emptyset}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{}{//@{\@listingGroup{ltx_lst_space}{ }}open{\@listingGroup{ltx_lst_space}{ }}llist(original);}}}}}}\ \;\raisebox{-1.99997pt}[0.0pt][0.0pt]{\reflectbox{\includegraphics[height]{branch-left.pdf}}}\quad\color[rgb]{1,0.65,0}{\textsf{ConsumeChunk}(1)}\\ {\color[rgb]{0,0,1}[{\color[rgb]{0,0.5,0}\texttt{llist}(\mathsfsl{next})},{\color[rgb]{1,0,0}{\underline{{\color[rgb]{0,0,1}{\color[rgb]{0,0.5,0}\mathsf{points\_to}(\mathsfsl{original},\mathsfsl{next})}}}}},\texttt{llist}(\mathsfsl{reversed})],[\dots],\{\mathsfsl{original}\neq\mathsf{nullptr}\}}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{ltx_lst_keyword}{{if}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{original}}}.{\@listingGroup{ltx_lst_identifier}{{is\textunderscore null}}}(){\@listingGroup{ltx_lst_space}{ }}\textbackslash\textbraceleft{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_keyword}{{return}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{reversed}}};{\@listingGroup{ltx_lst_space}{ }}\textbackslash\textbraceright}}}}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language{\@listingGroup{ltx_lst_keyword}{{let}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_identifier}{{next}}}{\@listingGroup{ltx_lst_space}{ }}={\@listingGroup{ltx_lst_space}{ }}\textasteriskcentered({\@listingGroup{ltx_lst_identifier}{{original}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_keyword}{{as}}}{\@listingGroup{ltx_lst_space}{ }}\textasteriskcentered{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}\textasteriskcentered{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{}{u8}});}}}}\quad\color[rgb]{1,0.65,0}{\textsf{ConsumeChunk}(1)}\\ {\color[rgb]{0,0,1}[{\color[rgb]{1,0,0}{\underline{{\color[rgb]{0,0,1}{\color[rgb]{0,0.5,0}\mathsf{points\_to}(\mathsfsl{original},\mathsfsl{next})}}}}},\texttt{llist}(\mathsfsl{next}),\texttt{llist}(\mathsfsl{reversed})],[\texttt{next}\mapsto\mathsfsl{next}],\{\dots\}}\\ {\color[rgb]{0.5,0.5,0.5}\textrm{Auto-open $\mathsf{points\_to}(\mathsfsl{original},\mathsfsl{next})$}}\quad\color[rgb]{1,0.65,0}{\textsf{ConsumeChunk}(0)}\\ {\color[rgb]{0,0,1}[{\color[rgb]{1,0,0}{\underline{{\color[rgb]{0,0,1}{\color[rgb]{0,0.5,0}\mathsf{points\_to\_}(\mathsfsl{original},\mathsf{some}(\mathsfsl{next}))}}}}},\texttt{llist}(\mathsfsl{next}),\texttt{llist}(\mathsfsl{reversed})],[\dots],\{\dots\}}\\ \textrm{\lstinline{{\lst@@@set@language\lst@@@set@numbers\lst@@@set@frame\lst@@@set@rulecolor\lst@@@set@language\textasteriskcentered({\@listingGroup{ltx_lst_identifier}{{original}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{ltx_lst_keyword}{{as}}}{\@listingGroup{ltx_lst_space}{ }}\textasteriskcentered{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}\textasteriskcentered{\@listingGroup{ltx_lst_keyword}{{mut}}}{\@listingGroup{ltx_lst_space}{ }}{\@listingGroup{}{u8}}){\@listingGroup{ltx_lst_space}{

Read the complete text