Dijkstra monads for all
Maillard, Kenji and Ahman, Danel and Atkey, Robert and Martínez, Guido and Hritcu, Catalin and Rivas, Exequiel and Tanter, Éric (2019) Dijkstra monads for all. Proceedings of the ACM on Programming Languages (PACMPL), 3 (ICFP). 104. ISSN 2475-1421 (https://doi.org/10.1145/3341708)
Preview |
Text.
Filename: Maillard_etal_ACM_PL_2019_Dijkstra_monads_for_all.pdf
Final Published Version License: Download (533kB)| Preview |
Abstract
This paper proposes a general semantic framework for verifying programs with arbitrary monadic side-effects using Dijkstra monads, which we define as monad-like structures indexed by a specification monad. We prove that any monad morphism between a computational monad and a specification monad gives rise to a Dijkstra monad, which provides great flexibility for obtaining Dijkstra monads tailored to the verification task at hand. We moreover show that a large variety of specification monads can be obtained by applying monad transformers to various base specification monads, including predicate transformers and Hoare-style pre- and postconditions. For defining correct monad transformers, we propose a language inspired by Moggi's monadic metalanguage that is parameterized by a dependent type theory. We also develop a notion of algebraic operations for Dijkstra monads, and start to investigate two ways of also accommodating effect handlers. We implement our framework in both Coq and F*, and illustrate that it supports a wide variety of verification styles for effects such as exceptions, nondeterminism, state, input-output, and general recursion.
ORCID iDs
Maillard, Kenji, Ahman, Danel, Atkey, Robert ORCID: https://orcid.org/0000-0002-4414-5047, Martínez, Guido, Hritcu, Catalin, Rivas, Exequiel and Tanter, Éric;-
-
Item type: Article ID code: 68964 Dates: DateEvent1 August 2019Published25 June 2019AcceptedSubjects: Science > Mathematics > Electronic computers. Computer science Department: Faculty of Science > Computer and Information Sciences Depositing user: Pure Administrator Date deposited: 22 Jul 2019 14:39 Last modified: 11 Nov 2024 12:22 URI: https://strathprints.strath.ac.uk/id/eprint/68964