Dijkstra Monads for All

03/04/2019
by   Kenji Maillard, et al.
0

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 simplifying the task of 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 Plotkin and Power's algebraic operations for Dijkstra monads, together with a corresponding notion of 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 partiality, exceptions, nondeterminism, state, and input-output.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/10/2012

On Formal Specification of Maple Programs

This paper is an example-based demonstration of our initial results on t...
research
12/22/2022

Sum and Tensor of Quantitative Effects

Inspired by the seminal work of Hyland, Plotkin, and Power on the combin...
research
01/24/2023

Higher-Order Weakest Precondition Transformers via a CPS Transformation

Weakest precondition transformers are essential notions for program veri...
research
11/06/2020

Extending Equational Monadic Reasoning with Monad Transformers

There is a recent interest for the verification of monadic programs usin...
research
05/13/2023

Morpheus: Automated Safety Verification of Data-dependent Parser Combinator Programs

Parser combinators are a well-known mechanism used for the compositional...
research
07/02/2019

Specifying verified x86 software from scratch

We present a simple framework for specifying and proving facts about the...
research
08/06/2018

Polymorphic Iterable Sequential Effect Systems

Effect systems are lightweight extensions to type systems that can verif...

Please sign up or login with your details

Forgot password? Click here to reset