paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Cosmo: a concurrent separation logic for multicore OCaml

Cosmo:多核 OCaml 的并发分离逻辑
ICFP 4(ICFP)2020匹配度 2/10 · 该论文研究多核 OCaml 的并发分离逻辑与程序验证,属于形式化验证/程序逻辑方向,但未涉及 LLM/Agent、静态分析工具在机器学习或 Agentic 程序中的应用,也不涉及浮点程序分析或贝叶斯程序分析,与用户研究画像的核心交叉点距离较远。引用 24 inbox
Glen Mével, Jacques-Henri Jourdan, François Pottier
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:为多核 OCaml 的弱内存模型构建分层并发分离逻辑 Cosmo,支持从底层到高层的程序验证。

多核 OCaml 的弱内存模型已有操作语义,但缺乏可用于编写与验证代码的推理规则。本文将 Iris(并发分离逻辑的现代实现)实例化到多核 OCaml,得到暴露内存模型细节的底层程序逻辑;并在此基础上构建高层逻辑 Cosmo,以一定表达力为代价,提供简洁规则:以无数据竞争方式访问非原子位置,利用原子位置的顺序一致行为及 release/acquire 行为。案例研究验证了多种锁实现相对于与内存模型无关的经典规约;使用锁作为唯一同步手段的粗粒度应用可在 Cosmo 的并发分离逻辑片段中验证,无需了解弱内存模型。

问题
多核 OCaml 的弱内存模型虽有操作语义,但缺少面向程序编写与验证的推理规则。
方法
将 Iris 实例化到多核 OCaml,构建暴露内存模型细节的底层程序逻辑,并在此基础上派生高层逻辑 Cosmo。
评估
通过多个锁实现的案例研究,验证它们相对于与内存模型无关的经典规约的正确性。
原文摘要(Abstract)

Multicore OCaml extends OCaml with support for shared-memory concurrency. It is equipped with a weak memory model, for which an operational semantics has been published. This begs the question: what reasoning rules can one rely upon while writing or verifying Multicore OCaml code? To answer it, we instantiate Iris, a modern descendant of Concurrent Separation Logic, for Multicore OCaml. This yields a low-level program logic whose reasoning rules expose the details of the memory model. On top of it, we build a higher-level logic, Cosmo, which trades off some expressive power in return for a simple set of reasoning rules that allow accessing nonatomic locations in a data-race-free manner, exploiting the sequentially-consistent behavior of atomic locations, and exploiting the release/acquire behavior of atomic locations. Cosmo allows both low-level reasoning, where the details of the Multicore OCaml memory model are apparent, and high-level reasoning, which is independent of this memory model. We illustrate this claim via a number of case studies: we verify several implementations of locks with respect to a classic, memory-model-independent specification. Thus, a coarse-grained application that uses locks as the sole means of synchronization can be verified in the Concurrent-Separation-Logic fragment of Cosmo, without any knowledge of the weak memory model.

链接与引用

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

BibTeX
@article{MevelJP20,
  title = {Cosmo: a concurrent separation logic for multicore OCaml},
  author = {Glen Mével and Jacques-Henri Jourdan and François Pottier},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {4},
  number = {ICFP},
  year = {2020},
  doi = {10.1145/3408978}
}