Compilation of Linearizable Data Structures

Modern programming languages provide libraries for concurrent data structures. For better performance, these are implemented with fine-grained concurrency. Still, such implementations are linearizable: the programmer can safely assume that they behave atomically. We formalize this insight in Coq as an end-to-end theorem establishing the semantic preservation of a compiler translating abstract, atomic data structures into their concrete, fine-grained concurrent implementation. This embeds the notion of linearizable data structures in a formally verified compiler. At the crux of the proof lies a generic result establishing, once and for all, a simulation relation, starting from a carefully crafted rely-guarantee specification. Inspired by the work of Vafeiadis, implementations are annotated with linearization points, which instrument programs semantics to reflect the behavior of abstract data structures. We successfully applied our generic theorem to concurrent buffers, a data structure used in the implementation of concurrent garbage collectors.

[1]  Xinyu Feng,et al.  Modular verification of linearizability with non-fixed linearization points , 2013, PLDI 2013.

[2]  Cliff B. Jones,et al.  Specification and Design of (Parallel) Programs , 1983, IFIP Congress.

[3]  Maurice Herlihy,et al.  Linearizability: a correctness condition for concurrent objects , 1990, TOPL.

[4]  Jan Vitek,et al.  Verifying a Concurrent Garbage Collector Using a Rely-Guarantee Methodology , 2017, ITP.

[5]  Lars Birkedal,et al.  Iris: Monoids and Invariants as an Orthogonal Basis for Concurrent Reasoning , 2015, POPL.

[6]  D. M. Hutton,et al.  The Art of Multiprocessor Programming , 2008 .

[7]  Xinyu Feng,et al.  On the Relationship Between Concurrent Separation Logic and Assume-Guarantee Reasoning , 2007, ESOP.

[8]  Peter W. O'Hearn,et al.  Abstraction for concurrent objects , 2009, Theor. Comput. Sci..

[9]  John Derrick,et al.  Verifying Linearisability , 2015, ACM Comput. Surv..

[10]  Peter W. O'Hearn,et al.  Resources, Concurrency and Local Reasoning , 2004, CONCUR.

[11]  FengXinyu,et al.  Rely-Guarantee-Based Simulation for Compositional Verification of Concurrent Program Transformations , 2014 .

[12]  Ilya Sergey,et al.  Mechanized verification of fine-grained concurrent programs , 2015, PLDI.

[13]  Keith Allman,et al.  About the Companion Website , 2015 .

[14]  Viktor Vafeiadis,et al.  Modular fine-grained concurrency verification , 2008 .

[15]  Xavier Leroy,et al.  A Formally Verified Compiler Back-end , 2009, Journal of Automated Reasoning.

[16]  John Derrick,et al.  Mechanically verified proof obligations for linearizability , 2011, TOPL.

[17]  Jan Vitek,et al.  Atomicity Refinement for Verified Compilation , 2014, ACM Trans. Program. Lang. Syst..

[18]  Erez Petrank,et al.  Implementing an on-the-fly garbage collector for Java , 2000, ISMM '00.

[19]  Viktor Vafeiadis,et al.  A Marriage of Rely/Guarantee and Separation Logic , 2007, CONCUR.