Fibered Separation Logic: Weakest Preconditions, Universal Constructions, and Local Independence
John M. Li, Ryan Doenges, Pedro H. Azevedo de Amorim
Abstract
This paper introduces a categorical framework for models of higher-order separation logic including the weakest precondition modality. Weakest preconditions are interpreted by strong monads on a category fibered over a model of Moggi's computational lambda calculus. The fibered categories in question are termed bunched fibrations and shown to be equivalent to BI hyperdoctrines. Well-known heuristic techniques for obtaining weakest preconditions are shown to be expressible in categorical terms and are proved sound. The ``baking in the frame rule'' trick is shown to satisfy a universal property. Constructions are given for extending a program logic with cost credits. Our largest case study is parametrized by a category having local independent product (LIP) structure, a notion due to Simpson that axiomatizes name generation, randomness, and local state. From an LIP category, we construct an allocation monad, a bunched fibration, and a monad lifting. We instantiate our construction to obtain a novel probabilistic separation logic for measure-theoretic probability that both simplifies and clarifies prior work.
Create a lesson
Related papers
Preserving Separation Logic Specifications through Compilation
Shared title terminology · Carmine Abate, Kleio Liotati, František Farka et al.
Logical Relations on Display
Shared title terminology · Steven Schaefer, Johnson He, Max S. New
Meta Build Systems as Logic Programs
Shared title terminology · Alex Reinking
CFGKAT: A Complete Calculus for Non-Local Control Flow
Shared title terminology · Spencer Van Koevering, Alexandra Silva, Cheng Zhang et al.
Linking as Evaluation: Correct Separate Compilation via First-Class Environments
Shared title terminology · Jam Kabeer Ali Khan, Jinhao Tan, Bruno C. d. S. Oliveira
Functional Logic Programming: Improving Logic Programs with Ease
Shared title terminology · Michael Hanus