A practical formalization of monadic equational reasoning in dependent-type theory

被引:0
|
作者
Affeldt, Reynald [1 ]
Garrigue, Jacques [2 ]
Saikawa, Takafumi [2 ]
机构
[1] Natl Inst Adv Ind Sci & Technol, Digital Architecture Res Ctr, Tokyo, Japan
[2] Nagoya Univ, Grad Sch Math, Nagoya, Japan
关键词
D O I
10.1017/S0956796824000157
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页数:40
相关论文
共 50 条
  • [41] Reasoning in extensional type theory with equality
    Brown, CE
    AUTOMATED DEDUCTION - CADE-20, PROCEEDINGS, 2005, 3632 : 23 - 37
  • [42] An Ontology Formalization of Relation Type Hierarchy in Conceptual Structure Theory
    Nguyen, Philip H. P.
    Kaneiwa, Ken
    Corbett, Dan R.
    Nguyen, Minh-Quang
    AI 2008: ADVANCES IN ARTIFICIAL INTELLIGENCE, PROCEEDINGS, 2008, 5360 : 79 - +
  • [43] Ethics Done Right: Practical Reasoning as a Foundation for Moral Theory
    Cullity, Garrett
    ETHICS, 2009, 119 (03) : 581 - 585
  • [44] Ethics done right: Practical reasoning as a foundation for moral theory
    Brassington, Iain
    PHILOSOPHY, 2006, 81 (318) : 685 - 690
  • [45] Towards a practical theory of reformulation for reasoning about physical systems
    Choueiry, BY
    Iwasaki, Y
    McIlraith, S
    ARTIFICIAL INTELLIGENCE, 2005, 162 (1-2) : 145 - 204
  • [46] Lateral Control of Autonomous Ground Vehicles via a New Homogeneous Polynomial Parameter Dependent-Type Fuzzy Controller
    Ren, Yunshuai
    Xie, Xiangpeng
    Li, Yongfu
    IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS, 2024, 20 (09) : 11233 - 11241
  • [47] Towards Probabilistic Reasoning in Type Theory - The Intersection Type Case
    Ghilezan, Silvia
    Ivetic, Jelena
    Kasterovic, Simona
    Ognjanovic, Zoran
    Savic, Nenad
    FOUNDATIONS OF INFORMATION AND KNOWLEDGE SYSTEMS, FOIKS 2020, 2020, 12012 : 122 - 139
  • [48] An introduction to dependent type theory
    Barthe, G
    Coquand, T
    APPLIED SEMANTICS, 2002, 2395 : 1 - 41
  • [49] Multimodal Dependent Type Theory
    Gratzer, Daniel
    Kavvos, G. A.
    Nuyts, Andreas
    Birkedal, Lars
    PROCEEDINGS OF THE 35TH ANNUAL ACM/IEEE SYMPOSIUM ON LOGIC IN COMPUTER SCIENCE (LICS 2020), 2020, : 492 - 506
  • [50] A DEPENDENT NOMINAL TYPE THEORY
    Cheney, James
    LOGICAL METHODS IN COMPUTER SCIENCE, 2012, 8 (01)