Relational program logic #
This is a formalization of the paper The next 700 relational program logics.
We follow the paper as well as the Coq formalization in SSProve.
Two monadic actions ma : m α
and mb : m β
are commutative if the following holds:
(do let a ← ma; let b ← mb; pure (a, b)) = (do let b ← mb; let a ← ma; pure (a, b))
Instances
A monad is commutative if any two monadic actions ma : m α
and mb : m β
can be applied
in any order. In other words, the following holds:
(do let a ← ma; let b ← mb; f (a, b)) = (do let b ← mb; let a ← ma; f (a, b))