paperbot · PL 论文追踪

全部论文 待读 收藏

P2 VIP: verifying real-world C idioms with integer-pointer casts

VIP:验证带有整数-指针转换的真实世界 C 惯用法
POPL 6(POPL)2022匹配度 2/10 · 该论文研究 C 语言整数-指针转换的内存模型与形式化验证工具,属于程序验证/形式语义方向,与用户关注的“LLM/Agent 改进静态分析或形式化验证”仅有形式验证这一间接关联,未涉及 LLM、Agent、浮点程序分析或贝叶斯程序分析。引用 11 inbox
Rodolphe Lepigre, Michael Sammler, Kayvan Memarian, Robbert Krebbers, Derek Dreyer, Peter Sewell
crossref: 2026-09-10

AI 速览

一句话:提出 VIP 内存模型,用显式 provenance 构造简化整数-指针转换,并实现可验证真实 C 代码的 RefinedC-VIP。

系统代码常需对指针值做底层操作,这超出 C 基本指针算术,需借助整数-指针转换。已有内存对象模型(如 PNVI)虽现实但复杂,难以用于验证,且尚无工具能在 PNVI 下验证 C 程序。本文提出 VIP:面向 C 验证的新内存对象模型,增加构造让程序员显式表达整数-指针转换的预期 provenance,从而绕开 PNVI 复杂性,并证明 VIP 与 PNVI 兼容,使基于 VIP 的验证受益于 PNVI 的实践检验。作者实现 RefinedC-VIP,扩展 RefinedC 并生成 Coq 基础证明,在多种系统代码惯用法上评估,并通过 Cerberus 实现验证 VIP 的表达能力。

问题
系统代码中的整数-指针转换需要现实的内存对象模型语义,但现有 PNVI 过于复杂,缺少可在其下验证 C 程序的工具。
方法
提出 VIP 模型,引入显式 provenance 构造,证明其与 PNVI 兼容,并实现可生成 Coq 基础证明的 RefinedC-VIP 验证工具。
评估
在多种系统代码惯用法上评估 RefinedC-VIP,并用 Cerberus 实现验证 VIP 的表达能力。
原文摘要(Abstract)

Systems code often requires fine-grained control over memory layout and pointers, expressed using low-level ( e.g. , bitwise) operations on pointer values. Since these operations go beyond what basic pointer arithmetic in C allows, they are performed with the help of integer-pointer casts . Prior work has explored increasingly realistic memory object models for C that account for the desired semantics of integer-pointer casts while also being sound w.r.t. compiler optimisations, culminating in PNVI, the preferred memory object model in ongoing discussions within the ISO WG14 C standards committee. However, its complexity makes it an unappealing target for verification, and no tools currently exist to verify C programs under PNVI. In this paper, we introduce VIP, a new memory object model aimed at supporting C verification. VIP sidesteps the complexities of PNVI with a simple but effective idea: a new construct that lets programmers express the intended provenances of integer-pointer casts explicitly. At the same time, we prove VIP compatible with PNVI, thus enabling verification on top of VIP to benefit from PNVI’s validation with respect to practice. In particular, we build a verification tool, RefinedC-VIP, for verifying programs under VIP semantics. As the name suggests, RefinedC-VIP extends the recently developed RefinedC tool, which is automated yet also produces foundational proofs in Coq. We evaluate RefinedC-VIP on a range of systems-code idioms, and validate VIP’s expressiveness via an implementation in the Cerberus C semantics.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1587,
  title = {VIP: verifying real-world C idioms with integer-pointer casts},
  author = {Rodolphe Lepigre and Michael Sammler and Kayvan Memarian and Robbert Krebbers and Derek Dreyer and Peter Sewell},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {POPL},
  year = {2022},
  doi = {10.1145/3498681}
}