Abstract

We present a new version of ReLoC: a relational separation logic for proving refinements of programs with higher-order state, fine-grained concurrency, polymorphism and recursive types. The core of ReLoC is its refinement judgment $e \precsim e' : \tau$, which states that a program $e$ refines a program $e'$ at type $\tau$. ReLoC provides type-directed structural rules and symbolic execution rules in separation-logic style for manipulating the judgment, whereas in prior work on refinements for languages with higher-order state and concurrency, such proofs were carried out by unfolding the judgment into its definition in the model. ReLoC's abstract proof rules make it simpler to carry out refinement proofs, and enable us to generalize the notion of logically atomic specifications to the relational case, which we call logically atomic relational specifications. We build ReLoC on top of the Iris framework for separation logic in Coq, allowing us to leverage features of Iris to prove soundness of ReLoC, and to carry out refinement proofs in ReLoC. We implement tactics for interactive proofs in ReLoC, allowing us to mechanize several case studies in Coq, and thereby demonstrate the practicality of ReLoC. ReLoC Reloaded extends ReLoC (LICS'18) with various technical improvements, a new Coq mechanization, and support for Iris's prophecy variables. The latter allows us to carry out refinement proofs that involve reasoning about the program's future. We also expand ReLoC's notion of logically atomic relational specifications with a new flavor based on the HOCAP pattern by Svendsen et al.

Highlights

  • A fundamental question in computer science is when two programs are equivalent? The “golden standard” of program equivalence is contextual equivalence, stated directly in terms of the operational semantics

  • We demonstrate the basic usage of ReLoC by using its type-directed structural and symbolic execution rules to prove contextual equivalence of two implementations of a simple program module

  • We provide a mechanization in Coq with tactical support that supports the same backwards reasoning style that is employed for proving weakest preconditions in Iris [KTB17]

Read more

Summary

Introduction

A fundamental question in computer science is when two programs are equivalent? The “golden standard” of program equivalence is contextual equivalence, stated directly in terms of the operational semantics. Let us consider the refinement of the fine-grained and coarse-grained concurrent counter from Figure 1: We wish to decompose the proof of this refinement into refinements for the read and increment operations. This refinement is insufficient if we want to prove that a program module that. ReLoC is the first fully mechanized relational logic enabling reasoning about contextual refinements of programs in a fine-grained concurrent higher-order imperative programming language.

The programming language
A tour of ReLoC
Example
A closer look at ReLoC
Relational specifications in ReLoC
Speculative reasoning using prophecy variables
The logical relations model of ReLoC
The Coq mechanization of ReLoC
Related work
10. Discussion and conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call