CASP: An evaluation dataset for formal verification of C code
Niclas Hertzberg, Merlijn Sevenhuijsen, Liv K{\aa}reborn, and Anna Lokrantz

TL;DR
This paper introduces CASP, a curated dataset of 506 verified C code and formal specifications in ACSL, designed to benchmark formal verification tools and improve automated code correctness in C programming.
Contribution
The paper presents the first systematic dataset of verified C code with formal specifications, created through multi-stage filtering, annotation, and manual verification, enabling benchmarking of formal verification methods.
Findings
Created a dataset of 506 verified C-ACSL pairs
Employs multi-stage filtering and manual verification
Facilitates benchmarking of formal verification tools
Abstract
Recent developments in Large Language Models (LLMs) have shown promise in automating code generation, yet the generated programs lack rigorous correctness guarantees. Formal verification can address this shortcoming, but requires expertise and is time-consuming to apply. Currently, there is no dataset of verified C code paired with formal specifications that enables systematic benchmarking in this space. To fill this gap, we present a curated evaluation dataset of C code paired with formal specifications written in ANSI/ISO C Specification Language (ACSL). We develop a multi-stage filtering process to carefully extract 506 pairs of C code and formal specifications from The Stack 1 and The Stack 2. We first identify C files annotated with formal languages. Then, we ensure that the annotated C files formally verify, and employ LLMs to improve non-verifying files. Furthermore, we…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
