Dijkstra and Hoare monads in monadic computation

The Dijkstra and Hoare monads have been introduced recently for capturing weakest precondition computations and computations with pre- and post-conditions, within the context of program verification, supported by a theorem prover. Here we give a more general description of such monads in a categorical setting. We first elaborate the recently developed view on program semantics in terms of a triangle of computations, state transformers, and predicate transformers. Instantiating this triangle for different computational monads T shows how to define the Dijkstra monad associated with T, via the logic involved.Subsequently we give abstract definitions of the Dijkstra and Hoare monad, parametrised by a computational monad. These definitions presuppose a suitable (categorical) predicate logic, defined on the Kleisli category of the underlying monad. When all this structure exists, we show that there are maps of monads (Hoare) ? (State) ? (Dijkstra), all parametrised by a monad T.

[1]  Edsger W. Dijkstra,et al.  Predicate Calculus and Program Semantics , 1989, Texts and Monographs in Computer Science.

[2]  Bart Jacobs,et al.  Categorical Logic and Type Theory , 2001, Studies in logic and the foundations of mathematics.

[3]  Albert L. Baker,et al.  JML: A Notation for Detailed Design , 1999, Behavioral Specifications of Businesses and Systems.

[4]  Robert W. J. Furber,et al.  From Kleisli Categories to Commutative C*-algebras: Probabilistic Gelfand Duality , 2013, Log. Methods Comput. Sci..

[5]  Bart Jacobs,et al.  The Expectation Monad in Quantum Foundations , 2011, ArXiv.

[6]  Samson Abramsky,et al.  Domain Theory in Logical Form , 1991, LICS.

[7]  E. Manes,et al.  A triple theoretic construction of compact algebras , 1969 .

[8]  Steve Awodey,et al.  Category Theory , 2006 .

[9]  Bart Jacobs,et al.  Coreflections in Algebraic Quantum Logic , 2012 .

[10]  Wouter Swierstra A Hoare Logic for the State Monad , 2009, TPHOLs.

[11]  Bart Jacobs,et al.  New Directions in Categorical Logic, for Classical, Probabilistic and Quantum Logic , 2012, Log. Methods Comput. Sci..

[12]  D. Foulis,et al.  Effect algebras and unsharp quantum logics , 1994 .

[13]  M. H. Stone Postulates for the barycentric calculus , 1949 .

[14]  Yoshihiro Maruyama,et al.  Categorical Duality Theory: With Applications to Domains, Convexity, and the Distribution Monad , 2013, CSL.

[15]  Bart Jacobs,et al.  Convexity, Duality and Effects , 2010, IFIP TCS.

[16]  Prakash Panangaden,et al.  Quantum weakest preconditions , 2005, Mathematical Structures in Computer Science.

[17]  Bart Jacobs,et al.  Measurable Spaces and Their Effect Logic , 2013, 2013 28th Annual ACM/IEEE Symposium on Logic in Computer Science.

[18]  Juan Chen,et al.  Verifying higher-order programs with the dijkstra monad , 2013, PLDI.

[19]  Lars Birkedal,et al.  Ynot: dependent types for imperative programs , 2008, ICFP.

[20]  A. Carboni,et al.  PREFRAME PRESENTATIONS PRESENT , 1991 .

[21]  Rasmus Ejlers Møgelberg,et al.  Linearly-Used State in Models of Call-by-Value , 2011, CALCO.

[22]  Bart Jacobs Two of the Grand Changes through Computer and Network Technology , 2013, Privacy and Identity Management.

[23]  Sylvia Pulmannová,et al.  New trends in quantum structures , 2000 .

[24]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[25]  Gordon D. Plotkin,et al.  Computational Effects and Operations: An Overview , 2004, Electron. Notes Theor. Comput. Sci..

[26]  Bart Jacobs,et al.  Dijkstra Monads in Monadic Computation , 2014, CMCS.

[27]  Sylvia Pulmannová,et al.  Representation theorem for convex effect algebras , 1998 .

[28]  Bart Jacobs,et al.  Introduction to Coalgebra: Towards Mathematics of States and Observation , 2016, Cambridge Tracts in Theoretical Computer Science.

[29]  J. van Leeuwen,et al.  Theorem Proving in Higher Order Logics , 1999, Lecture Notes in Computer Science.

[30]  Bart Jacobs,et al.  Semantics of Weakening and Contraction , 1994, Ann. Pure Appl. Log..

[31]  Paul Hudak,et al.  Monad transformers and modular interpreters , 1995, POPL '95.

[32]  T. Heinosaari,et al.  The Mathematical Language of Quantum Theory: From Uncertainty to Entanglement , 2012 .

[33]  Benjamin Grégoire,et al.  Formal certification of code-based cryptographic proofs , 2009, POPL '09.