A Concurrent Logical Relation

We present a logical relation for showing the correctness of program transformations based on a new type-and-effect system for a concurrent extension of an ML-like language with higher-order functions, higher-order store and dynamic memory allocation. We show how to use our model to verify a number of interesting program transformations that rely on effect annotations. In particular, we prove a Parallelization Theorem, which expresses when it is sound to run two expressions in parallel instead of sequentially. The conditions are expressed solely in terms of the types and effects of the expressions. To the best of our knowledge, this is the first such result for a concurrent higher-order language with higher-order store and dynamic memory allocation.

[1]  Nick Benton,et al.  Reading, Writing and Relations Towards Extensional Semantics for Effect Analyses , 2006 .

[2]  Viktor Vafeiadis Concurrent Separation Logic and Operational Semantics , 2011, MFPS.

[3]  David K. Gifford,et al.  Integrating functional and imperative programming , 1986, LFP '86.

[4]  Martin Hofmann,et al.  Relational semantics for effect-based program transformations with dynamic allocation , 2007, PPDP '07.

[5]  James Laird A Fully Abstract Trace Semantics for General References , 2007, ICALP.

[6]  Amal Ahmed,et al.  Semantics of types for mutable state , 2004 .

[7]  Martin Hofmann,et al.  Relational semantics for effect-based program transformations: higher-order store , 2009, PPDP '09.

[8]  Mads Tofte,et al.  Implementation of the typed call-by-value λ-calculus using a stack of regions , 1994, POPL '94.

[9]  Peter W. O'Hearn,et al.  Abstraction for Concurrent Objects , 2009, ESOP.

[10]  Mitchell Wand,et al.  Small bisimulations for reasoning about higher-order imperative programs , 2006, POPL '06.

[11]  Lars Birkedal,et al.  Step-Indexed Kripke Model of Separation Logic for Storable Locks , 2011, MFPS.

[12]  Fritz Henglein,et al.  Effect Types and Region-based Memory Management , 2005 .

[13]  Davide Sangiorgi,et al.  Environmental Bisimulations for Higher-Order Languages , 2007, 22nd Annual IEEE Symposium on Logic in Computer Science (LICS 2007).

[14]  Peter W. O'Hearn,et al.  Resources, concurrency, and local reasoning , 2007 .

[15]  Lars Birkedal,et al.  Step-Indexed Relational Reasoning for Countable Nondeterminism , 2011, CSL.

[16]  Lars Birkedal,et al.  Realizability Semantics of Parametric Polymorphism, General References, and Recursive Types , 2009, FoSSaCS.

[17]  Lars Birkedal,et al.  A kripke logical relation for effect-based program transformations , 2011, ICFP '11.

[18]  Eijiro Sumii A Complete Characterization of Observational Equivalence in Polymorphic λ-Calculus with General References , 2009 .

[19]  Lars Birkedal,et al.  From region inference to von Neumann machines via region representation inference , 1996, POPL '96.

[20]  Hongseok Yang,et al.  Step-indexed kripke models over recursive worlds , 2011, POPL '11.

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

[22]  David K. Gifford,et al.  Polymorphic effect systems , 1988, POPL '88.

[23]  Xinyu Feng,et al.  A rely-guarantee-based simulation for verifying concurrent program transformations , 2012, POPL '12.

[24]  Derek Dreyer,et al.  State-dependent representation independence , 2009, POPL '09.

[25]  Andrzej S. Murawski,et al.  Game Semantics for Good General References , 2011, 2011 IEEE 26th Annual Symposium on Logic in Computer Science.

[26]  Nick Benton,et al.  Semantics of an effect analysis for exceptions , 2007, TLDI '07.

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

[28]  Lars Birkedal,et al.  The impact of higher-order state and control effects on local relational reasoning , 2012, J. Funct. Program..

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

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

[31]  Aaron Turon,et al.  A separation logic for refining concurrent objects , 2011, POPL '11.