Patterns for computational effects arising from a monad or a comonad
Jean-Guillaume Dumas (LJK), Dominique Duval (LJK), Jean-Claude Reynaud, (RC)

TL;DR
This paper develops equational logics for reasoning about programming language effects using monads and comonads, providing dual inference patterns that unify effect reasoning and are applicable to various effects like exceptions and state.
Contribution
It introduces two dual inference system patterns for monads and comonads, enabling systematic proof of properties in effectful programming languages.
Findings
Inference system for states is Hilbert-Post complete
Logic can be instantiated with monads or comonads for different effects
Applicable to languages with exceptions and state effects
Abstract
This paper presents equational-based logics for proving first order properties of programming languages involving effects. We propose two dual inference system patterns that can be instanciated with monads or comonads in order to be used for proving properties of different effects. The first pattern provides inference rules which can be interpreted in the Kleisli category of a monad and the coKleisli category of the associated comonad. In a dual way, the second pattern provides inference rules which can be interpreted in the coKleisli category of a comonad and the Kleisli category of the associated monad. The logics combine a 3-tier effect system for terms consisting of pure terms and two other kinds of effects called 'constructors/observers' and 'modifiers', and a 2-tier system for 'up-to-effects' and 'strong' equations. Each pattern provides generic rules for dealing with any monad…
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.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Logic, Reasoning, and Knowledge · Formal Methods in Verification
