Building Extensible Program Logics through Effect Handlers (Extended Version)
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Computer Science. The day in computer science: software, systems and theory on arXiv.
Tom: I'm Tom.
Jane: And I'm Jane, here with Lu, Meng and our in-house large language model, Lalam.
Tom: We're looking at the paper: "Building Extensible Program Logics through Effect Handlers (Extended Version)".
Title and authors: Tom: Alright, we've looked at the title and authors of this paper, "Building Extensible Program Logics through Effect Handlers (Extended Version)," and the main takeaway is that they are providing an operational approach to building these complex program logics using effect handlers.
Jane: Basically, they’re showing how you can take a very basic concept—effect handlers—and use them as the foundation to build a much more powerful and extensible system for proving program correctness.
Lu: It moves away from just using existing logics, which they say is challenging because it's hard to reuse components or combine support for different effects when building new logics.
Meng: So the paper suggests a starting point: an expressive program logic written in a pure sequential language that already supports these effect handlers for concurrency and crash recovery.
Tom: Right, and from there, they prove properties about those handlers themselves to extend the logic and derive rules for reasoning about all those effects.
Jane: So the core message is that you don't need to invent an entirely new way to reason; you can build a system operationally by focusing on how these effect handlers behave.
Lu: It’s about using the handler as a modular and compositional feature, which is really helpful for adding new effects later on without breaking the existing structure.
Meng: From an engineering standpoint, if you can build it modularly, that means you can potentially add support for a new type of effect—say, network latency—by just adding a new handler module.
Tom: Exactly. And they introduce FicusLang as this minimal core language and Ficus as the separation logic for those handlers that they adapted from Hazel.
Jane: So the paper is setting up a foundation where you can build these complex reasoning tools piece by piece, starting from a very simple effect handler model.
Lu: They’re essentially showing how to bootstrap an expressive program logic capable of reasoning about a wide range of effects just by using this handler-based approach.
Meng: It's less about the final logic and more about the method—the way you structure the handlers—that makes it extensible.
Tom: And they highlight that this allows for deriving stronger proof rules, especially for concurrency, which can yield stronger invariant-opening rules than standard concurrent separation logics by using nonstandard semantics.
Jane: Stronger rules are always better if they mean we can prove more about how programs behave when they are running together.
Lu: It’s about that hierarchical building of effects allowing them to derive local prophecy variables from simpler global prophecies, which is a big structural advantage for the proof system.
Meng: That sounds like the derivation process gets cleaner and less messy as you move up the abstraction levels in your reasoning.
The paper's summary: Tom: Now we're looking at what they actually do in this paper, "Building Extensible Program Logics through Effect Handlers (Extended Version)." They summarize it by showing how their approach allows them to extend existing program logics by adding handlers modularly.
Jane: So, they take the idea of effect handlers and use them as a way to build these extensible program logics operationally, meaning you can add new effects by just plugging in new handlers.
Lu: They start with a foundational expressive program logic for sequential programs that has support for effect handlers modeling concurrency and crash recovery behavior.
Meng: So, the core is this language where you define things like do-statements or try statements, and these are augmented with these handler features that model those real-world behaviors.
Tom: Then they focus on proving properties about these handlers themselves, which lets them extend the logic and derive expressive rules for reasoning about all those effects.
Jane: This means instead of writing a massive set of rules for every possible effect, they are using the handler structure to generate those rules automatically.
Lu: They introduce FicusLang as this minimal stateless core language and Ficus as the separation logic for these handlers that they adapted from Hazel to handle things like distributed execution and crash recovery.
Meng: So, they give us a concrete language called FicusLang that is built around these effect handlers, which is pretty tangible.
Tom: And because of this handler-based approach, they can derive stronger proof rules for concurrency than what's available in standard concurrent separation logics using nonstandard semantics.
Jane: That’s the payoff—they are proving more about how things run together under these specific concurrency models than previous methods could manage.
Lu: They also developed RelFicus, a relational logic for proving contextual refinement in the presence of effect handlers, adapting Ficus protocols to the relational setting so it can be reused and extended.
Meng: So they’re not just building one thing; they have this reusable logic that allows you to prove refinements across different contexts using these handler ideas.
The paper's improvements: Tom: Moving on to what the authors suggest as improvements, the paper points out how this approach allows them to reconstruct and extend features from existing program logics.
Jane: So, they show concrete examples of how this works, like deriving local prophecy variables out of global ones and implicitly making prophecies without annotating programs with prophecy operations.
Lu: That’s a big structural improvement because it means you don't have to manually tag every part of the program with extra notes just to make the reasoning work for those prophecies.
Meng: It sounds like it makes the proof process much more automated or at least less error-prone when you are doing manual verification.
Jane: That’s interesting because it means they can reason about how data is written to disk asynchronously and figure out if it will be backed up before a system crash.
Lu: They also have this logic for distributed systems incorporating IronFleet style atomic blocks, which suggests they can model those kinds of coordinated operations reliably in the context of their effect handlers.
Meng: Modeling atomic blocks across a network sounds like tackling one of the hardest parts of distributed systems design, so if they have a specific logic for it that fits this framework, that's important.
Tom: They also discuss developing RelFicus for proving contextual equivalence between effectful programs, showing that inserting preemption points in the concurrency handler does not change program behavior.
Jane: So they can formally verify that adding a pause point in the code doesn't accidentally alter the program's observable behavior when dealing with concurrency.
Lu: They use mechanisms like extensible worlds to reason about thread coordination, and prophecy variables are used for speculating on future non-deterministic outcomes during proofs.
Meng: Speculating on non-deterministic outcomes during proofs is a powerful way to explore possibilities without needing exhaustive testing for every possible sequence of events.
Conclusion: Tom: So to wrap up the paper, "Building Extensible Program Logics through Effect Handlers (Extended Version)," they show that this method is a solid way to build extensible program logics operationally based on effect handlers.
Jane: The key implication here is that by focusing on the handler structure, you get stronger proof rules for concurrency and a more flexible way to handle various effects.
Lu: They demonstrate how to derive local prophecy variables from global ones and develop specialized logics like RelFicus for contextual refinement, which allows for reuse and extension of these ideas.
Meng: From an engineering viewpoint, this means we have tools that can help us model complex things like crash recovery and distributed atomic blocks in a structured way.
Tom: So overall, the paper is about taking effect handlers as the central mechanism to build a logic that can handle a whole range of real-world effects compositionally.
Jane: It gives us confidence that we have a systematic way to prove properties about programs written in languages that are designed around these handler concepts.
Lu: The authors also point out their limitations, for instance, they mention the work on crash-recovery reasoning with asynchronous durable storage and they provide a simpler model compared to Perennial.
Meng: That's fair; simplifying the model is often a trade-off when you want to achieve something practical in terms of modeling complexity.
Tom: So, this paper is about taking effect handlers as the central mechanism to build a logic that can handle a whole range of real-world effects compositionally.
Jane: It gives us confidence that we have a systematic way to prove properties about programs written in languages that are designed around these handler concepts.
New York University · CISPA Helmholtz Center for Information Security
cs.LO, cs.PL
Submitted: 2026-07-14
Updated: 2026-11-30
DOI: 10.1145/3871726
Code: https://github.com/u8cat/ficus
License: http://creativecommons.org/licenses/by/4.0/
Importance score: 99/100
The gist: The paper proposes an approach for operationally building extensible program logics based on effect handlers.
Key concepts
- Effect Handlers
- These are mechanisms used in the program logic to model complex behaviors like concurrency, distributed execution, and crash recovery. They allow the core sequential language to be extended with handlers that manage these non-pure aspects of computation.
- FicusLang
- This is a minimal, stateless core effect handler language designed as the foundation for building extensible program logics. It serves as the base protocol for reasoning about various effects and allows new effects to be added modularly.
- RelFicus
- This is a relational logic developed to prove contextual refinement between effectful programs. It adapts Ficus protocols to a relational setting, enabling reuse and extensibility when verifying how adding preemption points affects program behavior.
- Extensible Worlds
- These are mechanisms introduced to reason about thread coordination in concurrent systems. They allow protocols to model shared resources across different threads, which is essential for handling complex interactions in distributed environments.
Terminology
Summary
The paper proposes an approach for operationally building extensible program logics based on effect handlers. p. 0 Moreover, when developing new logics, it can be difficult to reuse components
from prior logics or combine support for different effects. In this paper, we propose an approach for operationally building extensible program logics based on effect
handlers. Our starting point is an expressive program logic for reasoning about programs written in a pure,
sequential language with support for effect handlers. Within this language, we implement handlers that model
concurrency, distributed execution, and crash-recovery behavior. Within this language, we implement handlers that model
concurrency, distributed execution, and crash-recovery behavior. Then, by proving properties about these
handlers, we extend the program logic and derive expressive rules for reasoning about these effects.Where the paper says it
Where the paper says it
Where the paper says it
The work introduces FicusLang as a minimal stateless core effect handler language and Ficus as a separation logic for effect handlers adapted from Hazel. p. 1 Our starting point is a minimal stateless core effect handler language called FicusLang. For reasoning about programs written in FicusLang, we develop Ficus, a separation logic for effect
handlers that is an adaptation of an earlier logic called Hazel [18]. In this work, we instead use effect handlers to bootstrap an expressive program logic for a range
of effects. Our starting point is a minimal stateless core effect handler language called FicusLang. A second source of stronger proof rules arises from using effect handlers to implement nonstandard versions of effects that are easier to reason about. For example, our handler for concurrency
generates fewer interleavings than a standard operational semantics for concurrency.Where the paper says it
Where the paper says it
Where the paper says it
Key contributions include:
-
Ficus Extension: Extending Hazel to develop Ficus, an extensible unary program logic based on effect handlers. Ficus uses protocols to decompose reasoning about handlers and client code using handlers, and introduces an extensible notion of worlds for resource sharing between client code. p. 1
Where the paper says it
To summarize, our work makes the following contributions: • We extend Hazel [18] to develop Ficus, an extensible unary program logic based on effect handlers (§2). Ficus uses protocols to decompose reasoning about handlers and client code
-
Relational Logic: Developing RelFicus, a relational logic for proving contextual refinement in the presence of effect handlers. RelFicus adapts Ficus protocols to the relational setting, enabling reuse and extensibility. p. 2
Where the paper says it
• We develop a relational logic, RelFicus, for proving contextual refinement in the presence of effect handlers (§4). RelFicus adapts Ficus protocols to the relational setting, similarly allowing for reuse and extensibility.
The paper demonstrates how to reconstruct and extend features from existing program logics using this method, including:
-
Deriving local prophecy variables out of global prophecies and implicitly making prophecies without annotating programs with prophecy operations.
-
Developing a logic for crash-recovery reasoning with asynchronous durable storage that recovers features from Perennial but with a simpler model, featuring novel support for crash-aware prophecy variables.
-
A logic for distributed systems incorporating IronFleet-style atomic blocks.
The paper also discusses the development of RelFicus for proving contextual equivalence between effectful programs, showing that inserting preemption points in the concurrency handler does not change program behavior, justifying semantics where preemption only occurs when effects are raised. Mechanisms like extensible worlds are introduced to reason about thread coordination in concurrent systems, and prophecy variables are used for speculating on future non-deterministic outcomes during proofs. p. 1 For example, we show
in §5 how to derive local prophecy variables [1, 30] from a simpler global prophecy by implementing
local prophecy variables as an effect handler. Later, when implementing the handlers for crashes
and recovery in §6, we attach prophecy variables to non-deterministic choices made during crashes,
which allows client proofs to reason about when crashes will occur.Where the paper says it
Formal results include several theorems establishing adequacy and soundness for FicusLang and PureFicusLang, such as Theorem 4. p. 6 In this way, we compositionally build logical support for a collection of effects starting from the
⊥ protocol, extending the core pure logic with support for these effects. This approach is grounded
in an adequacy theorem, which shows that the logic starting with the ⊥ protocol is sound. As with unary reasoning, handlers enable this relational logic to be developed in an extensible way. Additional Key Words and Phrases: Iris, Contextual refinement, Prophecy variables, Crash recovery, Distributed
systems
1 Introduction
Program logics have proven to be powerful tools for program verification.Where the paper says it
Where the paper says it
The implementation details involve specific protocols for effects like asynchronous disk operations (ADISK), where the ADISK_STORE protocol specifies how before-crash values are updated, and barrier effects issue global write barriers. The handler runproph is installed first to enable other handlers to use prophecy variables, which are associated with heap locations. p. 0 As with unary reasoning, handlers enable this relational logic to be developed in an extensible way. Additional Key Words and Phrases: Iris, Contextual refinement, Prophecy variables, Crash recovery, Distributed
systems
1 Introduction
Program logics have proven to be powerful tools for program verification.Where the paper says it
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
Extensible Program Logic Development: The approach allows for operationally building extensible program logics based on effect handlers, which enables developers to extend logic by adding handlers to model new effects modularly and compositionally.
-
Stronger Reasoning Rules: The handler-based approach can derive stronger proof rules than prior work because it allows effects to be built up hierarchically, enabling the derivation of local prophecy variables from simpler global prophecies.
-
Concurrency Modeling: The extensible worlds feature enables reasoning about coordination between threads by allowing protocols to model shared resources across different threads, facilitating the development of a protocol for the concurrency handler that can handle various outer effects.
-
Relational Reasoning for Equivalence: The relational logic RelFicus allows for proving contextual refinements between programs using effects, enabling verification of whether inserting additional preemption points in a concurrent handler changes the set of possible program behaviors.
-
Crash-Aware Asynchronous Disk Reasoning: By incorporating prophecy resolution into the crash handler, the system can model asynchronous disk operations with prophetic points-to assertions, allowing reasoning about whether a write will be backed up before a crash occurs.
-
Thread-Local Effect Specification: The introduction of per-thread specification resources allows for reasoning about each thread in a concurrent system individually, which is crucial for modeling complex distributed systems like IronFleet-style atomic blocks.
Abstract
One approach to reasoning about effectful programs is to use program logics that provide proof rules for various effects. However, developing program logics requires skills that are distinct from those needed for using program logics, making the development of new logics less accessible. Moreover, when developing new logics, it can be difficult to reuse components from prior logics or combine support for different effects. In this paper, we propose an approach for building extensible program logics based on effect handlers. Our starting point is an expressive program logic for reasoning about programs written in a pure, sequential language with support for effect handlers. Within this language, we implement handlers that model concurrency, distributed execution, and crash-recovery behavior. Then, by proving properties of these handlers within the logic, we derive expressive rules for reasoning about these effects. In some cases, this approach leads to stronger reasoning rules than those found in prior program logics. In addition, we develop a relational logic for proving contextual refinements between programs using effects. As with unary reasoning, handlers enable this relational logic to be developed in an extensible way.
Related papers
- Bit-Precise CHC Satisfiability Using Theory-Modular Reasoning
- interwhen: A Generalizable Framework for Steering Reasoning Models with Test-time Verification
- On Higher-Order Reachability Games vs May Reachability
- A Non-Dichotomy for CSPs of Stable omega-Categorical Structures
- A Deeper Look at Depth: Stable Generation Accounting for Quantifier Reasoning
- Formalizing Hyperspaces and Operations on Subsets of Polish Spaces over Abstract Exact Real Numbers