Reference. Dijkstra monads for all
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.
Cite
Cited by (2)
Algebraic Effects Meet Hoare Logic in Cubical Agda kidney-2024-algebraic
This paper presents a novel formalisation of algebraic effects with equations in Cubical Agda. Unlike previous work in the literature that employed setoids to deal with equations, the library presented here uses quotient types to faithfully encode the type of terms quotiented by laws. Apart from tools for equational reasoning, the library also provides an effect-generic Hoare logic for algebraic effects, which enables reasoning about effectful programs in terms of their pre- and post-conditions. A particularly novel aspect is that equational reasoning and Hoare-style reasoning are related by an elimination principle of Hoare logic.
Formalized High Level Synthesis with Applications to Cryptographic Hardware harrison-2023-formalized
Cites 52 works (0 here)
External (52)
- Signatures and induction principles for higher inductive-inductive types (2019)
- A Sound and Complete Logic for Algebraic Effects (2019)
- EverCrypt cryptographic provider offers developers greater security assurances (2019)
- A predicate transformer semantics for effects (functional pearl) (2019)
- Quantitative logics for equivalence of effectful programs (2019)
- Behavioural equivalence via modalities for algebraic effects (2018)
- Handling fibred algebraic effects (2017)
- Dijkstra monads for free (2016)
- Dependent types and multi-monadic effects in F* (2016)
- Generic Hoare Logic for Order-Enriched Effects with Exceptions (2016)
- Dijkstra and Hoare monads in monadic computation (2015)
- Turing-completeness totally free (2015)
- The biequivalence of locally cartesian closed categories and Martin-Löf type theories (2014)
- The enriched effect calculus: syntax and semantics (2014)
- Generic weakest precondition semantics from monads enriched with order (2014)
- Parametric effect monads and semantics of effect systems (2014)
- Dijkstra monads in monadic computation (2014)
- Exploring the boundaries of monad tensorability on set (2013)
- Hoare-style reasoning with (algebraic) continuations (2013)
- Relating computational effects by ⊤⊤-lifting (2013)
- Dependent Type Theory for Verification of Information Flow and Access Control Policies (2013)
- Handling algebraic effects (2013)
- Verifying higher-order programs with the dijkstra monad (2013)
- Update monads: cointerpreting directed containers (2013)
- Syntax and models of a non-associative composition of programs and proofs (2013)
- Coproducts of monads on set (2012)
- Exceptions for dependability (2012)
- Trace-based verification of imperative programs with I/O (2011)
- Monad transformers as monoid transformers (2010)
- Ynot: dependent types for imperative programs (2008)
- Hoare type theory, polymorphism and separation (2008)
- A Logic for Algebraic Effects (2008)
- Combining algebraic effects with continuations (2007)
- Efficient weakest preconditions (2005)
- Reducibility and ⊤⊤-lifting for computation types (2005)
- Algebraic Operations and Generic Effects (2003)
- Composing monads using coproducts (2002)
- Notions of Computation Determine Monads (2002)
- Monads and effects (2000)
- Monad transformers and modular interpreters (1995)
- A SEMANTICS FOR EVALUATION LOGIC (1995)
- Semantics of exceptions (1994)
- Programming from Specifications (1994)
- Comprehension Categories and the Semantics of Type Dependency (1993)
- Evaluation logic (1991)
- Computational lambda-calculus and monads (1989)
- Inductively defined types (1988)
- A categorical approach to probability theory (1982)
- Verifying properties of parallel programs: an axiomatic approach (1976)
- Guarded commands, nondeterminacy and formal derivation of programs (1975)
- An axiomatic basis for computer programming (1969)
- Nondeterministic Algorithms (1967)