Skip to main content
QUICK REVIEW

[Paper Review] Separation Logic for Small-step Cminor

Andrew W. Appel, Sandrine Blazy|ArXiv.org|Jul 30, 2007
Logic, programming, and type systemsComputer Science12 references9 citations
TL;DR

This paper presents a small-step operational semantics and a machine-checked soundness proof for a separation logic in a redesigned version of Cminor, a mid-level language used in verified compilers. The work enables formal verification of low-level C-like programs with nontermination, I/O, and future concurrent extensions, and establishes the first large-scale machine-checked soundness proof of separation logic with respect to small-step semantics in Coq.

ABSTRACT

Cminor is a mid-level imperative programming language; there are proved-correct optimizing compilers from C to Cminor and from Cminor to machine language. We have redesigned Cminor so that it is suitable for Hoare Logic reasoning and we have designed a Separation Logic for Cminor. In this paper, we give a small-step semantics (instead of the big-step of the proved-correct compiler) that is motivated by the need to support future concurrent extensions. We detail a machine-checked proof of soundness of our Separation Logic. This is the first large-scale machine-checked proof of a Separation Logic w.r.t. a small-step semantics. The work presented in this paper has been carried out in the Coq proof assistant. It is a first step towards an environment in which concurrent Cminor programs can be verified using Separation Logic and also compiled by a proved-correct compiler with formal end-to-end correctness guarantees.

Motivation & Objective

  • To redesign Cminor with a small-step operational semantics to support reasoning about nonterminating, I/O, and concurrent programs.
  • To enable formal verification of low-level C-like programs using separation logic with support for nonlocal control constructs like return and exit.
  • To provide a foundation for end-to-end verified compilation from high-level languages to machine code via a certified compiler stack.
  • To extend the semantics and logic to support future concurrent extensions in a modular, extensible way using oracles and a layered proof architecture.

Proposed method

  • Redesign Cminor with a small-step semantics based on continuations to support nonlocal control and future concurrency.
  • Define a separation logic for Cminor using sextuples (pre/postconditions with control-flow tracking) to handle return and exit statements.
  • Implement the logic and semantics in the Coq proof assistant, using a modular, parameterized approach to allow extensibility with new straight-line statements.
  • Prove soundness of the separation logic by verifying each rule as a Coq lemma, with a main theorem ensuring safety of the main function.
  • Use oracles to model extended instructions (e.g., spawn, lock, unlock) in a way that preserves sequential soundness while enabling concurrent reasoning.
  • Establish semantic equivalence between the new small-step semantics and the big-step semantics of CompCert, ensuring compatibility with the certified compiler.

Experimental results

Research questions

  • RQ1Can a separation logic be soundly defined and verified with respect to a small-step operational semantics for a low-level imperative language like Cminor?
  • RQ2How can nonlocal control constructs (e.g., return, exit) be formally modeled in a separation logic within a small-step semantics?
  • RQ3Can the resulting logic be extended to support concurrent features such as threads, locks, and shared memory while preserving soundness?
  • RQ4Is it possible to build a modular, extensible framework in Coq that supports both sequential verification and future concurrent reasoning in Cminor?
  • RQ5Can the small-step semantics be made compatible with the existing big-step semantics of the CompCert compiler to ensure end-to-end verification guarantees?

Key findings

  • The paper presents the first machine-checked soundness proof of a separation logic with respect to a small-step semantics, verified in Coq.
  • The small-step semantics supports nonlocal control constructs like return and exit through a continuation-based design, enabling reasoning about nonterminating and I/O programs.
  • The separation logic is extended to sextuples to track control-flow effects, allowing correct reasoning about procedures with early returns or exits.
  • The soundness proof is modular and extensible: new straight-line statements (e.g., spawn, lock) can be added via oracles without re-proving the core logic.
  • The new small-step semantics is semantically equivalent to the big-step semantics of CompCert, ensuring that programs verified in the new logic can be compiled using the certified CompCert compiler.
  • The framework is designed to support future work on concurrent Cminor, with a clear path to proving noninterference and correctness of concurrent programs using concurrent separation logic.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.