Answer Refinement Modification: Refinement Type System for Algebraic Effects and Handlers
Fuga Kawamata, Hiroshi Unno, Taro Sekiyama, Tachio Terauchi

TL;DR
This paper introduces a novel refinement type system for algebraic effects and handlers, enabling precise effect tracking and verification in effectful programs, with a focus on delimited continuations and practical implementation in OCaml 5.
Contribution
It proposes the answer refinement modification (ARM) concept, formalizes a sound type system supporting ARM, and demonstrates its practical utility through implementation and evaluation.
Findings
ARM effectively tracks effect occurrence and order.
The type system is sound and supports verification.
The approach is practical and applicable to OCaml 5.
Abstract
Algebraic effects and handlers are a mechanism to structure programs with computational effects in a modular way. They are recently gaining popularity and being adopted in practical languages, such as OCaml. Meanwhile, there has been substantial progress in program verification via refinement type systems. However, thus far there has not been a satisfactory refinement type system for algebraic effects and handlers. In this paper, we fill the void by proposing a novel refinement type system for algebraic effects and handlers. The expressivity and usefulness of algebraic effects and handlers come from their ability to manipulate delimited continuations, but delimited continuations also complicate programs' control flow and make their verification harder. To address the complexity, we introduce a novel concept that we call answer refinement modification (ARM for short), which allows the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Software Testing and Debugging Techniques · Software Engineering Research
