[Paper Review] The Next 700 Relational Program Logics
This paper introduces a generic framework for defining relational program logics for arbitrary monadic effects within a dependent type theory. By modeling relational specifications as relative monads and using relational effect observations, it enables sound, composable verification across diverse effects—including state, I/O, nondeterminism, probabilities, and exceptions—while unifying existing logics like Relational Hoare Logic and Hoare Type Theory.
We propose the first framework for defining relational program logics for arbitrary monadic effects. The framework is embedded within a relational dependent type theory and is highly expressive. At the semantic level, we provide an algebraic presentation of relational specifications as a class of relative monads, and link computations and specifications by introducing relational effect observations, which map pairs of monadic computations to relational specifications in a way that respects the algebraic structure. For an arbitrary relational effect observation, we generically define the core of a sound relational program logic, and explain how to complete it to a full-fledged logic for the monadic effect at hand. We show that this generic framework can be used to define relational program logics for effects as diverse as state, input-output, nondeterminism, and discrete probabilities. We, moreover, show that by instantiating our framework with state and unbounded iteration we can embed a variant of Benton's Relational Hoare Logic, and also sketch how to reconstruct Relational Hoare Type Theory. Finally, we identify and overcome conceptual challenges that prevented previous relational program logics from properly dealing with control effects, and are the first to provide a relational program logic for exceptions.
Motivation & Objective
- To address the lack of a unified foundation for relational program logics across diverse monadic effects.
- To overcome conceptual limitations in prior logics that failed to handle control effects and exceptions.
- To provide a modular, extensible framework that generically derives sound relational logics from effect-specific observations.
- To embed and reconstruct existing relational logics such as Relational Hoare Logic and Relational Hoare Type Theory within a single semantic foundation.
- To establish a formal connection between relational specifications and monadic computations using algebraic structures like relative monads.
Proposed method
- Embedding the framework within a relational dependent type theory (e.g., Coq) to ensure expressiveness and formal verification.
- Defining relational specifications as a class of relative monads to capture the algebraic structure of relational properties.
- Introducing relational effect observations: functions mapping pairs of monadic computations to relational specifications that preserve algebraic structure.
- Deriving a core sound relational logic generically from any relational effect observation, with a systematic method to complete it into a full logic.
- Using the framework to instantiate logics for state, I/O, nondeterminism, discrete probabilities, and exceptions.
- Demonstrating how the framework can embed variants of Benton’s Relational Hoare Logic and sketch the reconstruction of Relational Hoare Type Theory.
Experimental results
Research questions
- RQ1How can a generic framework be designed to define relational program logics for arbitrary monadic effects?
- RQ2What algebraic structure underlies relational specifications, and how can it be captured using relative monads?
- RQ3How can relational effect observations be defined to ensure soundness and modularity across different effects?
- RQ4Can the framework unify and reconstruct existing relational logics such as Relational Hoare Logic and Relational Hoare Type Theory?
- RQ5How can control effects and exceptions—previously problematic in relational verification—be properly supported?
Key findings
- The framework successfully defines a sound core relational logic for any monadic effect via relational effect observations.
- The paper provides the first relational program logic for exceptions, resolving a long-standing conceptual challenge.
- By instantiating the framework with state and unbounded iteration, it recovers a variant of Benton’s Relational Hoare Logic.
- The framework supports a broad spectrum of effects, including state, I/O, nondeterminism, and discrete probabilities.
- The use of relative monads enables a clean, algebraic presentation of relational specifications, enhancing modularity and compositionality.
- The framework allows for the systematic reconstruction of existing relational logics, demonstrating its generality and expressiveness.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.