一句话:在Iris中分层验证带链接操作的无锁会话通道,并用Coq机器化证明其高层会话类型规范。
基于会话类型的高级推理与真实计算机上的低层实现之间存在鸿沟:现代会话通道支持异步发送、双向缓冲和link(forward)操作,使无锁实现更复杂,而此前工作多针对π演算等高层语义验证。本文以会话类型高层规范为标尺,用Iris并发分离逻辑对无锁会话通道进行分层验证。作者先给出单向队列的抽象规范及其链表与数组段实现,再逐步构造具备上述特性的会话通道;为支持分层验证,提出带幽灵链接的队列和配对不变式,分别刻画原子性与链接导致的端点变化。所有结果均在Coq中机器化。
Type systems and program logics based on session types provide powerful high-level reasoning principles for message-passing concurrency. Modern versions employ bidirectional session channels that (1) are asynchronous so that send operations do not block, (2) have buffers in both directions so that both parties can send messages in parallel, and (3) feature a link operation (also called forward ) to concisely write programs in process style . These features complicate a low-level lock-free implementation of channels and therefore increase the gap between the meta theory of prior work—which is verified w.r.t. a high-level semantics of channels ( e.g ., π -calculus)—and the code that runs on an actual computer. We address this problem by verifying a low-level lock-free implementation of session channels w.r.t. a high-level specification based on session types. We carry out our verification in a layered manner by employing the Iris framework for concurrent separation logic. We start with an abstract specification of (unidirectional) queues—of which we provide a linked-list and array-segment based implementation—and gradually build up to session channels with all of the aforementioned features. To make a layered verification possible we develop two logical abstractions— queues with ghost linking and pairing invariants —to reason about the atomicity and changing endpoints due to linking, respectively. All our results are mechanized in the Coq proof assistant.
@article{SomersK24,
title = {Verified Lock-Free Session Channels with Linking},
author = {Thomas Somers and Robbert Krebbers},
journal = {Proceedings of the ACM on Programming Languages},
volume = {8},
number = {OOPSLA2},
year = {2024},
doi = {10.1145/3689732}
}