Affiliation:
1. University of Pennsylvania, USA
2. Inria, France
Abstract
Monadic computations built by interpreting, or
handling
, operations of a
free monad are a compelling formalism for modeling language semantics and
defining the behaviors of effectful systems.
The resulting layered semantics offer the promise of modular reasoning principles
based on the equational theory of the underlying monads.
However, there are a number of obstacles to using such layered
interpreters in practice. With more layers comes more boilerplate and glue
code needed to define the monads and interpreters involved. That overhead is
compounded by the need to define and justify the relational reasoning
principles that characterize the equivalences at each layer.
This paper addresses these problems by significantly extending the
capabilities of the Coq
interaction trees
(ITrees) library, which
supports layered monadic interpreters. We characterize a rich class of
interpretable monads
---obtained by applying monad transformers to
ITrees---and show how to generically lift interpreters through them. We
also introduce a corresponding framework for relational reasoning about
"equivalence of monads up to a relation R". This collection of
typeclasses, instances, new reasoning principles, and tactics greatly
generalizes the existing theory of the ITree library, eliminating large
amounts of unwieldy boilerplate code and dramatically simplifying proofs.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference52 articles.
1. A core calculus of dependency
2. Dijkstra monads for free
3. Amal Jamil Ahmed. 2004. Semantics of Types for Mutable State. Ph. D. Dissertation. USA. AAI3136691 Amal Jamil Ahmed. 2004. Semantics of Types for Mutable State. Ph. D. Dissertation. USA. AAI3136691
4. Heinrich Apfelmus . 2010. The Operational Monad Tutorial. The Monad.Reader , Issue 15 ( 2010 ). Heinrich Apfelmus. 2010. The Operational Monad Tutorial. The Monad.Reader, Issue 15 (2010).
5. An indexed model of recursive types for foundational proof-carrying code
Cited by
3 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Algebraic Effects Meet Hoare Logic in Cubical Agda;Proceedings of the ACM on Programming Languages;2024-01-05
2. Calculating Compilers for Concurrency;Proceedings of the ACM on Programming Languages;2023-08-30
3. Choice Trees: Representing Nondeterministic, Recursive, and Impure Programs in Coq;Proceedings of the ACM on Programming Languages;2023-01-09