On Spatial Conjunction as Second-Order Logic

Spatial conjunction is a powerful construct for reasoning about dynamically al- located data structures, as well as concurrent, distribute d and mobile computation. While researchers have identified many uses of spatial conjunctio n, its precise expressive power compared to traditional logical constructs was not previously known. In this paper we establish the expressive power of spatial conjunction. We construct an embedding from first-order logic with spatial conjunction i nto second-order logic, and more surprisingly, an embedding from full second order logic into first-order logic with spatial conjunction. These embeddings show that the satisfiability of formulas in first-order logic with spatial conjunction is equivalent to the satisfiabilit y of formulas in second-order logic. These results explain the great expressive power of spatial conjunction and can be used to show that adding unrestricted spatial conjunction to a decidable logic leads to an un- decidable logic. As one example, we show that adding unrestricted spatial conjunction to two-variable logic leads to undecidability. On the side of decidability, the embedding into second-order logic immediately implies the decidability of first-order logic with a form of spatial conj unction over trees. The embedding into spatial conjunction also has useful consequences: because a restricted form of spatial conjunction in two-variable logic preserves decidability, we obtain that a correspondingly restricted form of second-order quantification in two-vari able logic is decidable. The result- ing language generalizes the first-order theory of boolean a lgebra over sets and is useful in reasoning about the contents of data structures in object-o riented languages.

[1]  Hans Hermes,et al.  Introduction to mathematical logic , 1973, Universitext.

[2]  Robert DeLine,et al.  Enforcing high-level protocols in low-level software , 2001, PLDI '01.

[3]  John C. Reynolds,et al.  Intuitionistic reasoning about shared mutable data structure , 1999 .

[4]  Egon Börger,et al.  Abstract State Machines , 2003 .

[5]  Robert DeLine,et al.  Adoption and focus: practical linear types for imperative programming , 2002, PLDI '02.

[6]  Viktor Kuncak,et al.  The First-Order Theory of Sets with Cardinality Constraints is Decidable , 2004, ArXiv.

[7]  John C. Reynolds,et al.  Separation logic: a logic for shared mutable data structures , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[8]  Erich Grädel,et al.  Two-variable logic with counting is decidable , 1997, Proceedings of Twelfth Annual IEEE Symposium on Logic in Computer Science.

[9]  Bruno Blanchet,et al.  Escape analysis: correctness proof, implementation and experimental results , 1998, POPL '98.

[10]  Roman Manevich,et al.  Partially Disjunctive Heap Abstraction , 2004, SAS.

[11]  Hubert Comon,et al.  Tree automata techniques and applications , 1997 .

[12]  Thomas W. Reps,et al.  Interconvertibility of a class of set constraints and context-free-language reachability , 2000, Theor. Comput. Sci..

[13]  Alexander Aiken,et al.  The set constraint/CFL reachability connection in practice , 2004, PLDI '04.

[14]  Luca Cardelli,et al.  A spatial logic for concurrency (part I) , 2003, Inf. Comput..

[15]  Eran Yahav,et al.  Verifying Temporal Heap Properties Specified via Evolution Logic , 2003, Log. J. IGPL.

[16]  David Walker,et al.  Alias Types , 2000, ESOP.

[17]  Hanne Riis Nielson,et al.  Kleene's Logic with Equality , 2001, Inf. Process. Lett..

[18]  Peter W. O'Hearn,et al.  Local Reasoning about Programs that Alter Data Structures , 2001, CSL.

[19]  Peter W. O'Hearn,et al.  The Logic of Bunched Implications , 1999, Bulletin of Symbolic Logic.

[20]  Luís Caires,et al.  Elimination of quantifiers and undecidability in spatial logics for concurrency , 2006, Theor. Comput. Sci..

[21]  Luca Cardelli,et al.  Deciding validity in a spatial logic for trees , 2003, TLDI '03.

[22]  Reinhard Wilhelm,et al.  Parametric shape analysis via 3-valued logic , 1999, POPL '99.

[23]  R. Stärk,et al.  Abstract State Machines , 2003, Springer Berlin Heidelberg.

[24]  Roman Manevich,et al.  Compactly Representing First-Order Structures for Static Analysis , 2002, SAS.

[25]  Lars Birkedal,et al.  Local reasoning about a copying garbage collector , 2004, POPL '04.

[26]  Viktor Kuncak,et al.  Generalized Records and Spatial Conjunction in Role Logic , 2004, SAS.

[27]  Peter W. O'Hearn,et al.  BI as an assertion language for mutable data structures , 2001, POPL '01.

[28]  Luca Cardelli,et al.  A Query Language Based on the Ambient Logic , 2001, SEBD.

[29]  David Walker,et al.  Alias Types for Recursive Data Structures , 2000, Types in Compilation.

[30]  Reinhard Wilhelm,et al.  Shape Analysis , 2000, CC.

[31]  Peter W. O'Hearn,et al.  A Decidable Fragment of Separation Logic , 2004, FSTTCS.

[32]  Michael I. Schwartzbach,et al.  The pointer assertion logic engine , 2000, PLDI '01.

[33]  Thomas Reps,et al.  A decidable logic for linked data structures , 1999 .

[34]  Alexander Aiken,et al.  Checking and inferring local non-aliasing , 2003, PLDI '03.

[35]  Luca Cardelli,et al.  A Spatial Logic for Querying Graphs , 2002, ICALP.

[36]  Escape Analysis for Java. Theory and Practice , 2003 .

[37]  Martin Rinard,et al.  On Our Experience with Modular Pluggable Analyses , 2004 .

[38]  Luís Caires,et al.  Elimination of quantifiers and undecidability in spatial logics for concurrency , 2006, Theor. Comput. Sci..

[39]  Luís Caires Behavioral and Spatial Observations in a Logic for the pi-Calculus , 2004, FoSSaCS.

[40]  Eran Yahav,et al.  Verifying safety properties of concurrent Java programs using 3-valued logic , 2001, POPL '01.

[41]  Luca Cardelli,et al.  Anytime, anywhere: modal logics for mobile ambients , 2000, POPL '00.

[42]  Peter W. O'Hearn,et al.  Computability and Complexity Results for a Spatial Assertion Language for Data Structures , 2001, APLAS.

[43]  Patrick Cousot,et al.  Systematic design of program analysis frameworks , 1979, POPL.

[44]  Thomas W. Reps,et al.  Putting static analysis to work for verification: A case study , 2000, ISSTA '00.

[45]  Viktor Kuncak,et al.  Role analysis , 2002, POPL '02.

[46]  Viktor Kuncak,et al.  On Role Logic , 2003, ArXiv.