A separation logic for effect handlers
نویسندگان
چکیده
User-defined effects and effect handlers are advertised advocated as a relatively easy-to-understand modular approach to delimited control. They offer the ability of suspending resuming computation allow information be transmitted both ways between computation, which requests certain service, handler, provides this service. Yet, key question remains, day, largely unanswered: how does one modularly specify verify programs in presence user-defined primitive effects, such heap-allocated mutable state? We answer by presenting Separation Logic with built-in support for handlers, shallow deep. The specification program fragment includes protocol that describes may perform well replies it can expect receive. logic allows local reasoning via frame rule bind rule. It is based on Iris inherits all its advanced features, including higher-order functions, ghost state, invariants. illustrate power several case studies, (1) generic formulation control inversion, turns producer ``pushes'' elements towards consumer into from ``pull'' demand, (2) simple system cooperative concurrency, where threads execute concurrently, spawn new threads, communicate promises.
منابع مشابه
Continuation Passing Style for Effect Handlers
We present Continuation Passing Style (CPS) translations for Plotkin and Pretnar’s effect handlers with Hillerström and Lindley’s row-typed fine-grain call-by-value calculus of effect handlers as the source language. CPS translations of handlers are interesting theoretically, to explain the semantics of handlers, and also offer a practical implementation technique that does not require special ...
متن کاملFusion for Free - Efficient Algebraic Effect Handlers
Algebraic effect handlers are a recently popular approach for modelling side-effects that separates the syntax and semantics of effectful operations. The shape of syntax is captured by functors, and free monads over these functors denote syntax trees. The semantics is captured by algebras, and effect handlers pass these over the syntax trees to interpret them into a semantic domain. This approa...
متن کاملEfficient algebraic effect handlers for Prolog
Recent work has provided delimited control for Prolog to dynamically manipulate the program control-flow, and to implement a wide range of control-flow and dataflow effects on top of. Unfortunately, delimited control is a rather primitive language feature that is not easy to use. As a remedy, this work introduces algebraic effect handlers for Prolog, as a high-level and structured way of defini...
متن کاملA separation logic for a promising semantics
We present SLR, the first expressive program logic for reasoning about concurrent programs under a weak memory model addressing the out-of-thin-air problem. Our logic includes the standard features from existing logics, such as RSL and GPS, that were previously known to be sound only under stronger memory models: (1) separation, (2) per-location invariants, and (3) ownership transfer via releas...
متن کاملA separation logic for a promising semantics
This is the technical appendix accompanying the article “A separation logic for a promising semantics”. It contains a soundness proof for the SLR logic. The programming language and logic presented in this appendix extends the programming language and logic presented in the paper with plain accesses. The programming language has further been extended with compare-and-swap operations and the log...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
ژورنال
عنوان ژورنال: Proceedings of the ACM on programming languages
سال: 2021
ISSN: ['2475-1421']
DOI: https://doi.org/10.1145/3434314