Monad algebras #
This file contains two layers:
- A minimal
MonadAlgebrainterface used by existingToMathlibfiles. - A Loom-style ordered monad algebra interface
MAlgOrderedwithwp/triple.
Public credit / attribution:
- Loom project: https://github.com/verse-lab/loom
- POPL 2026 paper: "Foundational Multi-Modal Program Verifiers", Vladimir Gladshtein, George Pîrlea, Qiyuan Zhao, Vitaly Kurin, and Ilya Sergey. DOI: https://doi.org/10.1145/3776719
The ordered monad algebra perspective (MAlgOrdered, wp, triple) in this file is adapted from
Loom's MonadAlgebras development.
Loom-style ordered monad algebras #
Ordered monad algebra interface used for quantitative WP/triple reasoning.
- μ : m l → l
Instances
Weakest precondition induced by μ.
Instances For
Hoare-style triple induced by wp.
Instances For
wp is functorial in the program return value.
wp preserves applicative sequencing.
Rule for pure computations in Triple.
Rule for map in Triple.
Monotonicity of Triple in its postcondition.
Monotonicity of Triple in its precondition.
Transformer lifting instances #
Lift an ordered monad algebra through StateT.
Lift an ordered monad algebra through ReaderT.
Lift an ordered monad algebra through ExceptT by interpreting exceptions as ⊥.
Lift an ordered monad algebra through OptionT by interpreting none as ⊥.