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 条
  • [21] Ruling passions: A theory of practical reasoning
    Bratman, ME
    PHILOSOPHICAL REVIEW, 2000, 109 (04): : 586 - 589
  • [22] Ruling passions: A theory of practical reasoning
    Beals, CW
    INTERNATIONAL PHILOSOPHICAL QUARTERLY, 2000, 40 (03) : 402 - 402
  • [23] Political Theory and Practical Public Reasoning
    Weale, Albert
    POLITICAL STUDIES, 2010, 58 (02) : 266 - 281
  • [24] AN OCCURRENT THEORY OF PRACTICAL AND THEORETICAL REASONING
    WALKER, AF
    PHILOSOPHICAL STUDIES, 1985, 48 (02) : 199 - 210
  • [25] Ruling passions:: A theory of practical reasoning
    Kölbel, M
    MIND, 2002, 111 (442) : 373 - 380
  • [26] Compositional Pre-processing for Automated Reasoning in Dependent Type Theory
    Blot, Valentin
    Cousineau, Denis
    Crance, Enzo
    de Prisque, Louise Dubois
    Keller, Chantal
    Mahboubi, Assia
    Vial, Pierre
    PROCEEDINGS OF THE 12TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON CERTIFIED PROGRAMS AND PROOFS, CPP 2023, 2023, : 63 - 77
  • [27] FORMALIZATION OF CONTEXTS IN TYPE THEORY WITH RECORDS AND MODULES
    Domanov, Oleg A.
    VESTNIK TOMSKOGO GOSUDARSTVENNOGO UNIVERSITETA-FILOSOFIYA-SOTSIOLOGIYA-POLITOLOGIYA-TOMSK STATE UNIVERSITY JOURNAL OF PHILOSOPHY SOCIOLOGY AND POLITICAL SCIENCE, 2019, 52 : 23 - 38
  • [28] Ruling passions. A theory of practical reasoning
    Quante, M
    ZEITSCHRIFT FUR PHILOSOPHISCHE FORSCHUNG, 2000, 54 (01): : 143 - 147
  • [29] Ruling passions. A theory of practical reasoning
    Cuypers, SE
    TIJDSCHRIFT VOOR FILOSOFIE, 2001, 63 (01): : 110 - 111
  • [30] Ruling passions: A theory of practical reasoning.
    Shafer-Landau, R
    ETHICS, 2001, 111 (04) : 799 - 804