Verifying Custom Synchronization Constructs Using Higher-Order Separation Logic

Synchronization constructs lie at the heart of any reliable concurrent program. Many such constructs are standard (e.g., locks, queues, stacks, and hash-tables). However, many concurrent applications require custom synchronization constructs with special-purpose behavior. These constructs present a significant challenge for verification. Like standard constructs, they rely on subtle racy behavior, but unlike standard constructs, they may not have well-understood abstract interfaces. As they are custom built, such constructs are also far more likely to be unreliable. This article examines the formal specification and verification of custom synchronization constructs. Our target is a library of channels used in automated parallelization to enforce sequential behavior between program statements. Our high-level specification captures the conditions necessary for correct execution; these conditions reflect program dependencies necessary to ensure sequential behavior. We connect the high-level specification with the low-level library implementation to prove that a client’s requirements are satisfied. Significantly, we can reason about program and library correctness without breaking abstraction boundaries. To achieve this, we use a program logic called iCAP (impredicative Concurrent Abstract Predicates) based on separation logic. iCAP supports both high-level abstraction and low-level reasoning about races. We use this to show that our high-level channel specification abstracts three different, increasingly complex low-level implementations of the library. iCAP’s support for higher-order reasoning lets us prove that sequential dependencies are respected, while iCAP’s next-generation semantic model lets us avoid ugly problems with cyclic dependencies.

[1]  Cliff B. Jones,et al.  Tentative steps toward a development method for interfering programs , 1983, TOPL.

[2]  Gavin M. Bierman,et al.  Separation logic and abstraction , 2005, POPL '05.

[3]  Andrew W. Appel,et al.  Oracle Semantics for Concurrent Separation Logic , 2008, ESOP.

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

[5]  Matthew J. Parkinson,et al.  Explicit Stabilisation for Modular Rely-Guarantee Reasoning , 2010, ESOP.

[6]  Lars Birkedal,et al.  Joins: A Case Study in Modular Specification of a Concurrent Reentrant Higher-Order Library , 2013, ECOOP.

[7]  Peter W. O'Hearn,et al.  Permission accounting in separation logic , 2005, POPL '05.

[8]  Xinyu Feng,et al.  Deny-Guarantee Reasoning , 2009, ESOP.

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

[10]  Rasmus Ejlers Møgelberg,et al.  First Steps in Synthetic Guarded Domain Theory: Step-Indexing in the Topos of Trees , 2011, 2011 IEEE 26th Annual Symposium on Logic in Computer Science.

[11]  Ilya Sergey,et al.  Communicating State Transition Systems for Fine-Grained Concurrent Resources , 2014, ESOP.

[12]  Jan Smans,et al.  Deadlock-Free Channels and Locks , 2010, ESOP.

[13]  Monica S. Lam,et al.  Semantic foundations of Jade , 1992, POPL '92.

[14]  Andrew W. Appel,et al.  Concurrent Separation Logic for Pipelined Parallelization , 2010, SAS.

[15]  Viktor Vafeiadis,et al.  Concurrent Abstract Predicates , 2010, ECOOP.

[16]  Peter W. O'Hearn,et al.  Separation Logic Semantics for Communicating Processes , 2008, FICS.

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

[18]  Marieke Huisman,et al.  Reasoning about Java's Reentrant Locks , 2008, APLAS.

[19]  Frank Piessens,et al.  Modular full functional specification and verification of lock-free data structures , 2009 .

[20]  Philippa Gardner,et al.  TaDA: A Logic for Time and Data Abstraction , 2014, ECOOP.

[21]  Lars Birkedal,et al.  Unifying refinement and hoare-style reasoning in a logic for higher-order concurrency , 2013, ICFP.

[22]  Suresh Jagannathan,et al.  Resource-sensitive synchronization inference by abduction , 2012, POPL '12.

[23]  Cristiano Calcagno,et al.  Tracking Heaps That Hop with Heap-Hop , 2010, TACAS.

[24]  Alexey Gotsman,et al.  Local Reasoning for Storable Locks and Threads , 2007, APLAS.

[25]  Lars Birkedal,et al.  Verifying event-driven programs using ramified frame properties , 2010, TLDI '10.

[26]  Suresh Jagannathan,et al.  Modular reasoning for deterministic parallelism , 2011, POPL '11.

[27]  Suresh Jagannathan,et al.  Safe futures for Java , 2005, OOPSLA '05.

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

[29]  Xiangyu Zhang,et al.  Quasi-static scheduling for safe futures , 2008, PPoPP.

[30]  Jeffrey Overbey,et al.  A type and effect system for deterministic parallel Java , 2009, OOPSLA 2009.

[31]  Lars Birkedal,et al.  Impredicative Concurrent Abstract Predicates , 2014, ESOP.

[32]  Emery D. Berger,et al.  Grace: safe multithreaded programming for C/C++ , 2009, OOPSLA '09.

[33]  Josh Berdine Local reasoning about storable locks , 2007, PPDP '07.

[34]  Philippa Gardner,et al.  A simple abstraction for complex concurrent indexes , 2011, OOPSLA '11.

[35]  Jeffrey Overbey,et al.  A type and effect system for deterministic parallel Java , 2009, OOPSLA '09.