NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Two for the Price of One: Lifting Separation Logic Assertions

Jacob Thamsborg, Lars Birkedal, Hongseok Yang

TL;DR

This paper introduces a novel semantic analysis for separation logic that allows for proving representation independence of data abstractions. By developing "lifting theorems," the authors provide a precise condition for when implications in standard separation logic proofs can be safely translated to relational interpretations, ensuring clients cannot distinguish between different module implementations.

What Problem Does This Paper Address?

Data abstraction is a fundamental software engineering principle, allowing modules to hide their internal implementation details. In formal verification, separation logic has emerged as a powerful tool for reasoning about programs with complex memory structures, and it has been successfully applied to prove correctness of programs using data abstraction. However, a key challenge is proving representation independence: ensuring that a client program, which relies on an abstract interface, behaves identically regardless of which of several valid implementations of that module it uses. Existing approaches often struggle to guarantee this property when clients use standard proof rules like the rule of consequence, which can lead to implications that hold in a standard interpretation but fail in a relational one. This paper addresses this gap by providing a formal semantic framework to determine when such implications can be "lifted" to the relational setting, thus guaranteeing representation independence.

Methods

The core of the paper's contribution lies in its novel semantic analysis using Reynolds's relational parametricity. The authors define n-ary relations on heaps to capture the relational meaning of assertions. They then introduce "lifting theorems" that provide a sound and, in a sense, complete characterization of when an implication between assertions, valid in the standard (unary) interpretation, also holds in the binary (relational) interpretation. These theorems are based on analyzing the "layout" of assertion variables within the implication. The paper also proposes an algorithm that uses these theorems to identify "abstraction-respecting" client-side proofs, ensuring they guarantee representation independence.

Datasets

Not discussed in the paper.

Key Insights and Ideas

  • Lifting Implications is Key to Representation Independence: The central insight is that representation independence for clients boils down to whether the implications used in their proofs (specifically via the rule of consequence) can be lifted from a standard interpretation to a relational one.
  • Variable Layout Matters: The "layout" of assertion variables in an implication (how they are distributed across conjuncts and disjuncts) is crucial for determining if lifting is possible. This is visualized using bipartite graphs.
  • Three Lifting Theorems: The paper presents three distinct theorems that provide sufficient conditions (based on variable layout) for an implication to lift. These conditions are related to concepts like "shadows" and "parametricity."
  • Completeness of Lifting Criteria: The authors demonstrate that if an implication fails all three lifting theorems, then it's possible to construct a counterexample where the implication holds in the unary interpretation but not the binary one, highlighting the completeness of their criteria.
  • Intuitionistic Separation Logic: The work is framed within intuitionistic separation logic, which is suitable for languages with garbage collection and aligns with practical verification tools.

Key Results

  • Sound and Complete Characterization: The paper provides a sound and, in a sense, complete characterization of when semantic implications in separation logic with assertion variables can be lifted to a relational interpretation.
  • Algorithm for Abstraction-Respecting Proofs: An algorithm is presented that identifies client-side proofs that respect data abstraction and guarantee representation independence.
  • Demonstration with Examples: Several examples, including a two-stage counter, illustrate the application of the lifting theorems and the conditions under which representation independence holds or fails. For instance, Example 4.9 shows an implication that is valid on the unary level but not the binary, demonstrating a failure to lift.

Limitations and Future Work

  • Fragment of Separation Logic: The authors acknowledge that they consider a restricted fragment of separation logic, specifically excluding ordinary and separating implications from assertions. They suggest revisiting challenges in a classical, non-intuitionistic setting.
  • Supported Assertions: The paper proposes investigating "supported assertions" as a potential simplification for future work, which might make matters more manageable.
  • Higher Arities: While the paper focuses on binary lifting, it touches upon higher arities and their relation to parametric polymorphism, suggesting further exploration.
  • Practical Applications: The authors note that while their lifting theorems are stronger than strictly necessary for representation independence (which only requires binary validity), they are unaware of practical applications that leverage this extra strength.
  • Undecidability: The paper mentions that the Parametricity Condition, while semantically precise, is likely undecidable in general.

Summary updated

BibTeX
@inproceedings{thamsborg2012two,
  author = {Jacob Thamsborg and Lars Birkedal and Hongseok Yang},
  title = {{Two for the Price of One: Lifting Separation Logic Assertions}},
  booktitle = {Log. Methods Comput. Sci},
  year = {2012},
  url = {https://openreview.net/forum?id=-4uTI0-asOs},
}
Figure