A separation logic for effect handlers
Paulo Emílio de Vilhena, François Pottier
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 15 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Tail Modulo Cons, OCaml, and Relational Separation Logic 引用了 Melocoton: A Program Logic for Verified Interoperability Between OCaml and C
- Modular Denotational Semantics for Effects with Guarded Interaction Trees 引用了 Interaction trees: representing recursive and impure programs in Coq
引用它的顶会 Paper15
- Modular Denotational Semantics for Effects with Guarded Interaction TreesDan Frumin, Amin Timany, Lars BirkedalPOPL 2024 · 13 次引用
- Melocoton: A Program Logic for Verified Interoperability Between OCaml and CArmaël Guéneau, Johannes Hostert, Simon Spies, Michael Sammler 等OOPSLA 2023 · 10 次引用
- Affect: An Affine Type and Effect SystemOrpheas van Rooij, Robbert KrebbersPOPL 2025 · 7 次引用
- The Logical Essence of Well-Bracketed Control FlowAmin Timany, Armaël Guéneau, Lars BirkedalPOPL 2024 · 5 次引用
- Tail Modulo Cons, OCaml, and Relational Separation LogicClément Allain, Frédéric Bour, Basile Clément, François Pottier 等POPL 2025 · 4 次引用
它引用的 Paper2
相关 Paper
- A Relational Separation Logic for Effect HandlersPaulo Emílio de Vilhena, Simcha van Collem, Ines Wright, Robbert KrebbersPOPL 2026 · 3 次引用
- Beyond Backtracking: Connections in Fine-Grained Concurrent Separation LogicIke Mulder, Lukasz Czajka, Robbert KrebbersPLDI 2023 · 2 次引用
- Program Logics à la CarteMax Vistrup, Michael Sammler, Ralf JungPOPL 2025 · 4 次引用
- Spy game: verifying a local generic solver in IrisPaulo Emílio de Vilhena, François Pottier, Jacques-Henri JourdanPOPL 2020 · 15 次引用
- Verified Lock-Free Session Channels with LinkingThomas Somers, Robbert KrebbersOOPSLA 2024 · 2 次引用
