One Monad to Prove Them All (Functional Pearl)

05/21/2018
by   Jan Christiansen, et al.
0

One Monad to Prove Them All is a modern fairy tale about curiosity and perseverance, two important properties of a successful PhD student. We follow the PhD student Mona on her adventurous journey of proving properties about Haskell programs in the proof assistant Coq. In quest for a solution Mona goes on an educating journey through the land of functional programming. We follow her on her journey when she learns about concepts like free monads and containers as well as basics and restrictions of proof assistants like Coq. These concepts are well-known individually, but their interplay gives rise to a solution for Mona's problem that has not been presented before. More precisely, Mona's final solution does not only work for a specific monad instance but even allows her to prove monad-generic properties. That is, instead of proving properties over and over again for specific monad instances she is able to prove properties that hold for all monads. In the end of her journey Mona comes to the land of functional logic and the land of probabilistic programming. She learns that, because her proofs are monad-generic, they even hold in languages with other effects like non-determinism or probabilism. If you are a citizen of the land of functional programming or are at least familiar with its customs, had a journey that involved reasoning about functional programs of your own, or are just a curious soul looking for the next story about monads and proofs, then this tale is for you.

READ FULL TEXT

page 1

page 2

page 3

page 4

05/13/2022

From Logic to Functional Logic Programs

Logic programming is a flexible programming paradigm due to the use of p...
07/26/2022

Teaching Functional Programmers Logic and Metatheory

We present a novel approach for teaching logic and the metatheory of log...
04/11/2018

Constraint-Based Synthesis of Coupling Proofs

Proof by coupling is a classical technique for proving properties about ...
08/07/2017

Deriving Law-Abiding Instances

Liquid Haskell's refinement-reflection feature augments the Haskell lang...
05/24/2022

Modeling Asymptotic Complexity Using ACL2

The theory of asymptotic complexity provides an approach to characterizi...
02/16/2022

Galois connecting call-by-value and call-by-name

We establish a general framework for reasoning about the relationship be...
03/29/2013

Formalizing the Confluence of Orthogonal Rewriting Systems

Orthogonality is a discipline of programming that in a syntactic manner ...