arXiv:2609.40119cs.PLSep 2026

Manuscript Offprint

arXiv:2609.40119

Automatically Building Machine-Checked Assurance Cases from C Codebases to Requirements

Haokun Li, Zhongyi Wang, Guanyan Li, Xiao Yi, Shengchao Qin, Jianwei Yin, Mingshuai Chen

HAOKUN LI †^{\dagger}, Zhejiang University, China

ZHONGYI WANG †^{\dagger}, Zhejiang University, China

GUANYAN LI, University of Oxford, UK

XIAO YI, The Chinese University of Hong Kong, China

SHENGCHAO QIN, Xidian University, China

JIANWEI YIN, Zhejiang University, China

MINGSHUAI CHEN ∗^{*}, Zhejiang University, China

Large language models (LLMs) have shown promise in automating interactive theorem proving, yet verification of real-world C codebases requires more than discharging individual proof goals. The task involves jointly constructing expressive function specifications and their proofs, and ensuring that library interfaces compose along intended call sequences even without a designated client. This paper presents CCV, an LLM-assisted framework for building machine-checked assurance cases: structured, auditable artifacts supporting the claim that a C codebase meets its intended requirements. To model intended cross-interface use in open libraries, CCV constructs an interface protocol that exposes permitted call sequences and resource assumptions for review, with a conditional safety guarantee under verified contracts and caller obligations. CCV coordinates two complementary phases: (i) requirement-guided analysis and bottom-up construction of candidate specifications and protocols; and (ii) modular proof construction with feedback that revises the specifications and proofs. Implemented using VST in Rocq, CCV verifies memory safety and leak freedom for all 299 function definitions across six C benchmarks, including industrial cryptographic components, with less than one person-day of reported human effort per benchmark. The guarantees depend on disclosed contracts and assumptions; human review supplies the conformance judgments connecting the formal artifacts to the intended requirements.

CCS Concepts: • Theory of computation → Program verification; Program specifications; • Software and its engineering → Formal software verification.

Additional Key Words and Phrases: Deductive verification, Separation logic, Large language models, VST/Rocq

ACM Reference Format:

Haokun Li, Zhongyi Wang, Guanyan Li, Xiao Yi, Shengchao Qin, Jianwei Yin, and Mingshuai Chen. 2026. Automatically Building Machine-Checked Assurance Cases from C Codebases to Requirements. Proc. ACM Program. Lang. 1, 1 (October 2026), 20 pages. https://doi.org/10.1145/nnnnnnn.nnnnnnn

1 INTRODUCTION

C codebases continue to carry the weight of safety-critical systems, and their formal verification rests on a machine-checked foundation: Hoare-style deductive verification represents intended behavior by function contracts (a.k.a., specifications) and proves that implementations satisfy them [22].

∗^{*}Corresponding author

†^{\dagger}Both authors contributed equally to this research.

Authors' Contact Information: Haokun Li, Zhejiang University, Hangzhou, China, College of Computer Science and Technology, ker@pm.me; Zhongyi Wang, Zhejiang University, Hangzhou, China, College of Computer Science and Technology, zhongyi.wang@zju.edu.cn; Guanyan Li, University of Oxford, Oxford, UK, guanyan.li.cs@gmail.com; Xiao Yi, The Chinese University of Hong Kong, Hong Kong, China, yixiao5428@link.cuhk.edu.hk; Shengchao Qin, Xidian University, Xi'an, China, shengchao.qin@gmail.com; Jianwei Yin, Zhejiang University, Hangzhou, China, College of Computer Science and Technology, zjuyjw@zju.edu.cn; Mingshuai Chen, Zhejiang University, Hangzhou, China, College of Computer Science and Technology, m.chen@zju.edu.cn.

  1. ACM 2475-1421/2026/10-ART

https://doi.org/10.1145/nnnnnnn.nnnnnnn

Mingshuai Chen, Zhongyi Wang and Haokun Li

Interactive theorem provers (ITPs) support a proof-producing style of verification: an ITP justifies a formal statement that the code meets its stated contracts, yielding machine-checked evidence for that statement [28, 33]. Such verification has provided assurance of critical systems, but developing the necessary contracts and proofs remains costly human work [27, 33].

Recent work has made substantial progress in using large language models (LLMs) to automate proof construction (and repair) in ITPs [19, 25, 29, 35, 40, 43, 48, 50]. Yet proof-construction automation alone does not meet the verification needs of a large real-world C codebase. Typically it necessitates establishing an end-to-end assurance case [23, 37]: not only formal evidence that the implementation satisfies its specifications, but also an auditable argument that those specifications, taken together, conform to the intended requirements. This raises two challenges at different levels.

First, how to construct function-level verification—the specification of a function and a machine-checked proof that its body satisfies the specification? The two obligations are coupled: the concrete form of a specification—what it promises and how it is phrased—decisively shapes whether a body proof can go through, and proof attempts in turn expose where the specification is too strong, too weak, or mis-expressed. A usable, provable pair is therefore the outcome of an iterative co-evolution, not of a single synthesis pass. Methods that construct proofs [19, 25, 29, 35, 40, 43, 48, 50] of stated theorems take the specification as given, and methods that synthesize contracts [36, 51, 52]—typically validated by auto-active backends rather than an ITP kernel—stop before a machine-checked body proof. We develop this first challenge in Section 2.1.

Second, how to establish library-level conformance—that the exported interfaces, taken together, conform to the intended requirements? A library is a collection of modules, and the specifications of its externally callable functions (e.g., typically the module-entry functions) form its interfaces. An open library has no designated client functions (e.g., a main), a category that a substantial part of real-world codebases falls into [6, 21]. Verifying an open library therefore raises a common difficulty: proofs can establish that each module satisfies its interface, but the requirements of a library are often stated over the order in which its interfaces may be called, and per-module proofs do not by themselves show that those interfaces, taken together, support the call sequences the requirements expect. Yet existing LLM-assisted methods stop at function-level verification, leaving whether the library’s interfaces, taken together, conform to the requirements an open problem that typically becomes a manual-review obligation. We develop this second challenge in Section 2.2.

In response to these challenges, we present CCV, an LLM-assisted framework for building machine-checked assurance cases from C codebases to their requirements. To model intended cross-interface use in open libraries, CCV constructs an interface protocol that describes permitted calls, their possible outcomes, and the resources carried between them. The protocol guides the synthesis of composable interfaces and exposes their call sequences and assumptions for review. Its soundness theorem provides a conditional safety guarantee under verified function contracts and the stated caller obligations.

CCV coordinates specification synthesis and proof construction in two complementary phases. The first phase uses top-down analysis to derive natural-language function contracts from requirements and caller demands, then formalizes these contracts bottom-up and constructs a candidate interface protocol. The second phase constructs modular proofs that function bodies satisfy their contracts and that the contracts support the protocol. Proof feedback drives revisions to the specifications, protocol, and proofs, rather than treating the initial specifications as fixed. This specification–proof co-evolution connects function-level verification to the library-level requirements expressed through the protocol.

We implement CCV using VST in Rocq and apply it to six C libraries, including four cryptographic components of openHiTLS. The delivered proofs establish memory safety and leak freedom for all 299 function definitions under disclosed contracts and assumptions, with less than one person-day of reported human effort per benchmark. Machine checking validates the formal evidence; human review supplies the conformance judgments linking the specifications and protocol to the intended requirements.

Contributions.

  • An end-to-end assurance-case framework that automates the joint construction of specifications and proofs through a two-phase method, with explicit human conformance review.

  • A resource-aware interface protocol that models intended cross-interface use, guides the synthesis of composable interfaces, and provides a conditional safety guarantee for protocol-following calls.

  • An implementation and evaluation on six C benchmarks, verifying memory safety and leak freedom for all 299 function definitions with less than one person-day of reported human effort per benchmark.

Paper Structure. After the motivating examples (Section 2), we present the assurance case (Section 3), interface protocol (Section 4), and two-phase CCV framework (Section 5). We then report the evaluation (Section 6), discuss related work (Section 7), and conclude (Section 8).

References (30)