Affiliation:
1. National University of Singapore, Singapore, Singapore
Abstract
Programming with user-defined effects and effect handlers has many practical use cases involving imperative effects. Additionally, it is natural and powerful to use multi-shot effect handlers for non-deterministic or probabilistic programs that allow backtracking to compute a comprehensive outcome. Existing works for verifying effect handlers are restricted in one of three ways: i) permitting multi-shot continuations under pure setting; ii) allowing heap manipulation for only one-shot continuations; or iii) allowing multi-shot continuations with heap-manipulation but under a restricted frame rule.
This work proposes a novel calculus called Effectful Specification Logic (ESL) to support unrestricted effect handlers, where zero-/one-/multi-shot continuations can co-exist with imperative effects and higher-order constructs. ESL captures behaviors in stages, and provides precise models to support invoked effects, handlers and continuations. To show its feasibility, we prototype an automated verification system for this novel specification logic, prove its soundness, report on useful case studies, and present experimental results. With this proposal, we have provided an extended specification logic that is capable of modeling arbitrary imperative higher-order programs with algebraic effects and continuation-enabled handlers.
Funder
Ministry of Education, Singapore
Publisher
Association for Computing Machinery (ACM)
Reference47 articles.
1. Programming with algebraic effects and handlers
2. Andrej Bauer and Matija Pretnar. 2020. Eff. http://www.eff-lang.org/
3. Effekt: extensible algebraic effects in Scala (short paper)
4. Effects as capabilities: effect handlers and lightweight effect polymorphism
5. James Brotherston. 2005. Cyclic proofs for first-order logic with inductive definitions. In International Conference on Automated Reasoning with Analytic Tableaux and Related Methods. 78–92.