A predicate transformer semantics for effects (functional pearl)

Reasoning about programs that use effects can be much harder than reasoning about their pure counterparts. This paper presents a predicate transformer semantics for a variety of effects, including exceptions, state, non-determinism, and general recursion. The predicate transformer semantics gives rise to a refinement relation that can be used to relate a program to its specification, or even calculate effectful programs that are correct by construction.

[1]  Wouter Swierstra,et al.  Beauty in the Beast A Functional Semantics for the Awkward Squad , 2007 .

[2]  Oleg Kiselyov,et al.  Freer monads, more extensible effects , 2015, Haskell.

[3]  Tom Schrijvers,et al.  Effect handlers in scope , 2014, Haskell 2014.

[4]  Adam Chlipala,et al.  The End of History? Using a Proof Assistant to Replace Language Design with Library Design , 2017, SNAPL.

[5]  Wouter Swierstra,et al.  Embedding the refinement calculus in Coq , 2018, Sci. Comput. Program..

[6]  Philip Wadler,et al.  A critique of Abelson and Sussman or why calculating is better than scheming , 1987, SIGP.

[7]  Richard S. Bird,et al.  Algebra of programming , 1997, Prentice Hall International series in computer science.

[8]  Christine Paulin-Mohring,et al.  The coq proof assistant reference manual , 2000 .

[9]  Venanzio Capretta,et al.  General recursion via coinductive types , 2005, Log. Methods Comput. Sci..

[10]  Conor McBride Turing-Completeness Totally Free , 2015, MPC.

[11]  Matija Pretnar,et al.  Logic and handling of algebraic effects , 2010 .

[12]  Peter Hancock,et al.  Specifying Interactions With Dependent Types , 2000 .

[13]  Gordon D. Plotkin,et al.  Algebraic Operations and Generic Effects , 2003, Appl. Categorical Struct..

[14]  Nikhil Swamy,et al.  Dijkstra monads for free , 2016, POPL.

[15]  G. Hutton,et al.  Chapter 25 Reasoning About Effects : Seeing the Wood Through the Trees , 2008 .

[16]  Lars Birkedal,et al.  Polymorphism and separation in hoare type theory , 2006, ICFP '06.

[17]  Juan Chen,et al.  Secure distributed programming with value-dependent types , 2013, J. Funct. Program..

[18]  Aleksandar Nanevski,et al.  Dependent type theory of stateful higher-order functions , 2005 .

[19]  Wouter Swierstra,et al.  Data types à la carte , 2008, Journal of Functional Programming.

[20]  Wouter Swierstra,et al.  A functional specification of effects , 2009 .

[21]  Jeremy Gibbons,et al.  Unifying Theories of Programming with Monads , 2012, UTP.

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

[23]  Ralph-Johan Back,et al.  Refinement Calculus: A Systematic Introduction , 1998 .

[24]  Pierre-Yves Strub,et al.  Dependent types and multi-monadic effects in F* , 2016, POPL.

[25]  Matthieu Sozeau,et al.  Partiality and recursion in interactive theorem provers – an overview , 2014, Mathematical Structures in Computer Science.

[26]  Peter Morris,et al.  Indexed Containers , 2009, 2009 24th Annual IEEE Symposium on Logic In Computer Science.

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

[28]  Edwin Brady,et al.  Idris, a general-purpose dependently typed programming language: Design and implementation , 2013, Journal of Functional Programming.

[29]  Tetsuya Sato,et al.  Preorders on Monads and Coalgebraic Simulations , 2013, FoSSaCS.

[30]  Jim Grundy,et al.  The Refinement Calculator: Proof Support for Program Refinement , 1997 .

[31]  Georg Struth,et al.  A Program Construction and Verification Tool for Separation Logic , 2015, MPC.

[32]  Edwin Brady,et al.  Programming and reasoning with algebraic effects and dependent types , 2013, ICFP.

[33]  Edsger W. Dijkstra,et al.  Guarded commands, nondeterminacy and formal derivation of programs , 1975, Commun. ACM.

[34]  Janis Voigtländer,et al.  Asymptotic Improvement of Computations over Free Monads , 2008, MPC.

[35]  Gordon D. Plotkin,et al.  Combining effects: Sum and tensor , 2006, Theor. Comput. Sci..

[36]  U. Norell,et al.  Towards a practical programming language based on dependent type theory , 2007 .

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

[38]  Wouter Swierstra,et al.  From Proposition to Program - Embedding the Refinement Calculus in Coq , 2016, FLOPS.

[39]  Thorsten Altenkirch,et al.  Beauty in the beast , 2007, Haskell '07.

[40]  Sylvain Boulmé,et al.  Intuitionistic Refinement Calculus , 2007, TLCA.

[41]  Ralph-Johan Back,et al.  Refinement Concepts Formalized in Higher Order Logic , 1989, Programming Concepts and Methods.

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

[43]  Richard S. Bird,et al.  Pearls of Functional Algorithm Design , 2010 .

[44]  Peter Hancock,et al.  Interactive Programs in Dependent Type Theory , 2000, CSL.

[45]  Ralf Hinze,et al.  Just do it: simple monadic equational reasoning , 2011, ICFP.

[46]  Gordon D. Plotkin,et al.  Notions of Computation Determine Monads , 2002, FoSSaCS.

[47]  Robert Atkey,et al.  Dijkstra monads for all , 2019, Proc. ACM Program. Lang..

[48]  Venanzio Capretta,et al.  Modelling general recursion in type theory , 2005, Mathematical Structures in Computer Science.

[49]  Carroll Morgan,et al.  Programming from specifications , 1990, Prentice Hall International Series in computer science.