Content area

Abstract

One can perform equational reasoning about computational effects with a purely functional programming language thanks to monads. Even though equational reasoning for effectful programs is desirable, it is not yet mainstream. This is partly because it is difficult to maintain pencil-and-paper proofs of large examples. We propose a formalization of a hierarchy of effects using monads in the Coq proof assistant that makes monadic equational reasoning practical. Our main idea is to formalize the hierarchy of effects and algebraic laws as interfaces like it is done when formalizing hierarchy of algebras in dependent-type theory. Thanks to this approach, we clearly separate equational laws from models. We can then take advantage of the sophisticated rewriting capabilities of Coq and build libraries of lemmas to achieve concise proofs of programs. We can also use the resulting framework to leverage on Coq’s mathematical theories and formalize models of monads. In this article, we explain how we formalize a rich hierarchy of effects (nondeterminism, state, probability, etc.), how we mechanize examples of monadic equational reasoning from the literature, and how we apply our framework to the design of equational laws for a subset of ML with references.

Details

Business indexing term
Title
A practical formalization of monadic equational reasoning in dependent-type theory
Author
Affeldt, Reynald 1   VIAFID ORCID Logo  ; Garrigue, Jacques 2   VIAFID ORCID Logo  ; Saikawa, Takafumi 3   VIAFID ORCID Logo 

 Digital Architecture Research Center, National Institute of Advanced Industrial Science and Technology (AIST), Tokyo, Japan (e-mail: [email protected]
 Graduate School of Mathematics, Nagoya University, Nagoya, Japan (e-mail: [email protected]
 Graduate School of Mathematics, Nagoya University, Nagoya, Japan (e-mail: [email protected]
Publication title
Volume
35
Publication year
2025
Publication date
Jan 2025
Publisher
Cambridge University Press
Place of publication
Cambridge
Country of publication
United Kingdom
ISSN
09567968
e-ISSN
14697653
Source type
Scholarly Journal
Language of publication
English
Document type
Journal Article
Publication history
 
 
Online publication date
2025-01-08
Milestone dates
2023-12-02 (Received); 2024-07-12 (Revised); 2024-10-10 (Accepted)
Publication history
 
 
   First posting date
08 Jan 2025
ProQuest document ID
3152436729
Document URL
https://www.proquest.com/scholarly-journals/practical-formalization-monadic-equational/docview/3152436729/se-2?accountid=208611
Copyright
© The Author(s), 2025. Published by Cambridge University Press. This work is licensed under the Creative Commons Attribution License This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited. (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.
Last updated
2025-01-08
Database
ProQuest One Academic