DeepAI
Log In Sign Up

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

07/10/2012

On Formal Specification of Maple Programs

This paper is an example-based demonstration of our initial results on t...
11/06/2020

Extending Equational Monadic Reasoning with Monad Transformers

There is a recent interest for the verification of monadic programs usin...
07/02/2019

Specifying verified x86 software from scratch

We present a simple framework for specifying and proving facts about the...
12/20/2021

Advances of Proof Scores in CafeOBJ

Critical flaws continue to exist at the level of domain, requirement, an...
04/18/2019

Behavioural Equivalence via Modalities for Algebraic Effects

The paper investigates behavioural equivalence between programs in a cal...
02/16/2020

Robustness Verification for Transformers

Robustness verification that aims to formally certify the prediction beh...
08/06/2018

Polymorphic Iterable Sequential Effect Systems

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