Cosmo: A Concurrent Separation Logic for Multicore OCaml

被引:9
|
作者
Mevel, Glen [1 ]
Jourdan, Jacques-Henri [2 ]
Pottier, Francois [3 ]
机构
[1] Univ Paris Saclay, Lab Rech Informat, CNRS, INRIA, F-91405 Orsay, France
[2] Univ Paris Saclay, Lab Rech Informat, CNRS, F-91405 Orsay, France
[3] INRIA, Orsay, France
关键词
separation logic; program verification; concurrency; weak memory;
D O I
10.1145/3408978
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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 Cosrno, without any knowledge of the weak memory model.
引用
收藏
页数:29
相关论文
共 50 条
  • [1] Tail Modulo Cons, OCaml, and Relational Separation Logic
    Allain, Clement
    Bour, Frederic
    Clement, Basile
    Pottier, Francois
    Scherer, Gabriel
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2025, 9 (POPI):
  • [2] INDEPENDENCE AND CONCURRENT SEPARATION LOGIC
    Hayman, Jonathan
    Winskel, Glynn
    LOGICAL METHODS IN COMPUTER SCIENCE, 2008, 4 (01)
  • [3] Concurrent Incorrectness Separation Logic
    Raad, Azalea
    Berdine, Josh
    Dreyer, Derek
    O'Hearn, Peter W.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2022, 6
  • [4] Granularity and Concurrent Separation Logic
    Hayman, Jonathan
    CONCUR 2011: CONCURRENCY THEORY, 2011, 6901 : 219 - 234
  • [5] A semantics for concurrent separation logic
    Brookes, S
    CONCUR 2004 - CONCURRENCY THEORY, PROCEEDINGS, 2004, 3170 : 16 - 34
  • [6] A semantics for concurrent separation logic
    Brookes, Stephen
    THEORETICAL COMPUTER SCIENCE, 2007, 375 (1-3) : 227 - 270
  • [7] Revisiting concurrent separation logic
    Soares, Pedro
    Ravara, Antonio
    de Sousa, Simao Melo
    JOURNAL OF LOGICAL AND ALGEBRAIC METHODS IN PROGRAMMING, 2017, 89 : 41 - 66
  • [8] Barriers in Concurrent Separation Logic
    Hobor, Aquinas
    Cherghina, Cristian
    PROGRAMMING LANGUAGES AND SYSTEMS, 2011, 6602 : 276 - 296
  • [9] Concurrent incorrectness separation logic
    Raad, Azalea
    Berdine, Josh
    Dreyer, Derek
    O'Hearn, Peter W.
    Proceedings of the ACM on Programming Languages, 2022, 6 (POPL)
  • [10] Independence and concurrent separation logic
    Hayman, Jonathan
    Winskel, Glynn
    21ST ANNUAL IEEE SYMPOSIUM ON LOGIC IN COMPUTER SCIENCE, PROCEEDINGS, 2006, : 147 - +