paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Melocoton: A Program Logic for Verified Interoperability Between OCaml and C

Melocoton:一种用于验证 OCaml 与 C 互操作的程序逻辑
OOPSLA 7(OOPSLA2)2023匹配度 2/10 · 该论文属于程序逻辑与形式化验证,虽与形式化验证方向沾边,但核心是 OCaml/C FFI 的多语言程序逻辑,未涉及用户重点关注的大模型/Agent 改进静态分析或形式化验证、浮点程序分析、贝叶斯程序分析等交叉方向。引用 10 inbox
Armaël Guéneau, Johannes Hostert, Simon Spies, Michael Sammler, Lars Birkedal, Derek Dreyer
crossref: 2026-09-10

AI 速览

一句话:首个形式化 OCaml FFI 语义并验证 OCaml/C 互操作的多语言程序逻辑,已在 Coq 中机器化。

现有程序逻辑大多假设程序完全由单一语言写成,但实际软件常由不同语言组件通过 FFI 互操作,因而缺乏多语言验证基础。本文提出 Melocoton,一个针对 OCaml、C 及其通过 OCaml FFI 交互的多语言程序验证系统。它给出了 OCaml FFI 大子集的第一个形式语义(此前仅有手册中的自然语言描述),并构建了首个用于推理 OCaml 与 C 组件交互的程序逻辑。Melocoton 在 Coq 中基于 Iris 分离逻辑框架完全机器化,为多语言程序验证迈出第一步。

问题
现有程序逻辑假定程序完全用单一语言编写,难以验证通过 FFI 交互的多语言程序;OCaml FFI 此前也缺乏形式语义。
方法
定义 OCaml FFI 大子集的形式语义,并基于 Iris 分离逻辑在 Coq 中构建多语言程序逻辑,用于推理 OCaml 与 C 组件及其 FFI 交互。
评估
论文在 Coq 中基于 Iris 分离逻辑框架完全机器化其形式语义与程序逻辑,以此检验多语言验证系统的形式化实现。
原文摘要(Abstract)

In recent years, there has been tremendous progress on developing program logics for verifying the correctness of programs in a rich and diverse array of languages. Thus far, however, such logics have assumed that programs are written entirely in a single programming language. In practice, this assumption rarely holds since programs are often composed of components written in different programming languages, which interact with one another via some kind of foreign function interface (FFI). In this paper, we take the first steps towards the goal of developing program logics for multi-language verification. Specifically, we present Melocoton, a multi-language program verification system for reasoning about OCaml, C, and their interactions through the OCaml FFI. Melocoton consists of the first formal semantics of (a large subset of) the OCaml FFI—previously only described in prose in the OCaml manual—as well as the first program logic to reason about the interactions of program components written in OCaml and C. Melocoton is fully mechanized in Coq on top of the Iris separation logic framework.

链接与引用

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

BibTeX
@article{paperbot1850,
  title = {Melocoton: A Program Logic for Verified Interoperability Between OCaml and C},
  author = {Armaël Guéneau and Johannes Hostert and Simon Spies and Michael Sammler and Lars Birkedal and Derek Dreyer},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {OOPSLA2},
  year = {2023},
  doi = {10.1145/3622823}
}