Skip to main content
Cornell University
We gratefully acknowledge support from the Simons Foundation, member institutions, and all contributors. Donate
arxiv logo > cs > arXiv:2312.06103

Help | Advanced Search

arXiv logo
Cornell University Logo

quick links

  • Login
  • Help Pages
  • About

Computer Science > Logic in Computer Science

arXiv:2312.06103 (cs)
[Submitted on 11 Dec 2023]

Title:A Practical Formalization of Monadic Equational Reasoning in Dependent-type Theory

Authors:Reynald Affeldt, Jacques Garrigue, Takafumi Saikawa
View a PDF of the paper titled A Practical Formalization of Monadic Equational Reasoning in Dependent-type Theory, by Reynald Affeldt and Jacques Garrigue and Takafumi Saikawa
View PDF
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.
Comments: 38 pages
Subjects: Logic in Computer Science (cs.LO)
Cite as: arXiv:2312.06103 [cs.LO]
  (or arXiv:2312.06103v1 [cs.LO] for this version)
  https://doi.org/10.48550/arXiv.2312.06103
arXiv-issued DOI via DataCite
Journal reference: J. Funct. Prog. 35 (2025) e1
Related DOI: https://doi.org/10.1017/S0956796824000157
DOI(s) linking to related resources

Submission history

From: Reynald Affeldt [view email]
[v1] Mon, 11 Dec 2023 04:15:52 UTC (109 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled A Practical Formalization of Monadic Equational Reasoning in Dependent-type Theory, by Reynald Affeldt and Jacques Garrigue and Takafumi Saikawa
  • View PDF
  • TeX Source
  • Other Formats
view license
Current browse context:
cs.LO
< prev   |   next >
new | recent | 2023-12
Change to browse by:
cs

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar
a export BibTeX citation Loading...

BibTeX formatted citation

×
Data provided by:

Bookmark

BibSonomy logo Reddit logo

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
  • About
  • Help
  • contact arXivClick here to contact arXiv Contact
  • subscribe to arXiv mailingsClick here to subscribe Subscribe
  • Copyright
  • Privacy Policy
  • Web Accessibility Assistance
  • arXiv Operational Status
    Get status notifications via email or slack