A separation logic for effect handlers
Paulo Emílio de Vilhena, François Pottier
Abstract
User-defined effects and effect handlers are advertised and advocated as a relatively easy-to-understand and modular approach to delimited control. They offer the ability of suspending and resuming a computation and allow information to be transmitted both ways between the computation, which requests a certain service, and the handler, which provides this service. Yet, a key question remains, to this day, largely unanswered: how does one modularly specify and verify programs in the presence of both user-defined effect handlers and primitive effects, such as heap-allocated mutable state? We answer this question by presenting a Separation Logic with built-in support for effect handlers, both shallow and deep. The specification of a program fragment includes a protocol that describes the effects that the program may perform as well as the replies that it can expect to receive. The logic allows local reasoning via a frame rule and a bind rule. It is based on Iris and inherits all of its advanced features, including support for higher-order functions, user-defined ghost state, and invariants. We illustrate its power via several case studies, including (1) a generic formulation of control inversion, which turns a producer that pushes'' elements towards a consumer into a producer from which one can pull'' elements on demand, and (2) a simple system for cooperative concurrency, where several threads execute concurrently, can spawn new threads, and communicate via promises.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 4fa4bc70-a5df-4317-849d-e7ed0a37b103Cited by top-tier papers15
- Modular Denotational Semantics for Effects with Guarded Interaction TreesDan Frumin, Amin Timany, Lars BirkedalPOPL 2024 · 13 citations
- Melocoton: A Program Logic for Verified Interoperability Between OCaml and CArmaël Guéneau, Johannes Hostert, Simon Spies, Michael Sammler et al.OOPSLA 2023 · 10 citations
- Affect: An Affine Type and Effect SystemOrpheas van Rooij, Robbert KrebbersPOPL 2025 · 7 citations
- The Logical Essence of Well-Bracketed Control FlowAmin Timany, Armaël Guéneau, Lars BirkedalPOPL 2024 · 5 citations
- Tail Modulo Cons, OCaml, and Relational Separation LogicClément Allain, Frédéric Bour, Basile Clément, François Pottier et al.POPL 2025 · 4 citations
Builds on2
Related papers
- A Relational Separation Logic for Effect HandlersPaulo Emílio de Vilhena, Simcha van Collem, Ines Wright, Robbert KrebbersPOPL 2026 · 3 citations
- Beyond Backtracking: Connections in Fine-Grained Concurrent Separation LogicIke Mulder, Lukasz Czajka, Robbert KrebbersPLDI 2023 · 2 citations
- Program Logics à la CarteMax Vistrup, Michael Sammler, Ralf JungPOPL 2025 · 4 citations
- Spy game: verifying a local generic solver in IrisPaulo Emílio de Vilhena, François Pottier, Jacques-Henri JourdanPOPL 2020 · 15 citations
- Verified Lock-Free Session Channels with LinkingThomas Somers, Robbert KrebbersOOPSLA 2024 · 2 citations
