Searcharxiv⌕ Search

arXiv · 2610.23604

A Taxonomy of Predicate Transformer Monads for Specifying Monadic Programs

Abstract

Monads of weakest precondition predicate transformers are the foundation of several verification frameworks for monadic programs. For specifying monadic computations with nondeterminism and nontermination, in addition to weakest preconditions, we introduce the first strongest postcondition monads covering all combinations of angelic or demonic nondeterminism and partial or total interpretations of nontermination. For extending these base strongest postcondition monads with side effects such as mutable state, monad transformers do not yield the expected monads, so we instead generalize the base monads to arrows and use arrow transformers. We give a taxonomy of weakest precondition and strongest postcondition monads, for the base monads and for their versions with state, and show that the known relationships between under- and over-approximate triples based on predicate transformers already hold at the level of the predicate transformers themselves. We use the predicate transformer monads to define under- and over-approximate triples and, where possible, Dijkstra monads. Finally, we relate these two specification styles.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Abigail Pribisova, Yao Li, Catalin Hritcu, Cezar-Constantin Andrici, Kenji Maillard, Exequiel Rivas. 2026-10-16. A Taxonomy of Predicate Transformer Monads for Specifying Monadic Programs. https://arxiv.org/abs/2610.23604

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Operon: Incremental Construction of Ragged Data via Named Dimensions

Modern data processing workflows frequently encounter ragged data: collections with variable-length elements that arise naturally in domains like natural language processing, scientific measurements, and autonomous AI agents. Existing workflow engines lack native support for tracking the shapes and dependencies inherent to ragged data, forcing users to manage complex indexing and dependency bookkeeping manually. We present Operon, a Rust-based workflow engine that addresses these challenges through a novel formalism of named dimensions with explicit dependency relations. Operon provides a domain-specific language where users declare pipelines with dimension annotations that are statically verified for correctness, while the runtime system dynamically schedules tasks as data shapes are incrementally discovered during execution. We formalize the mathematical foundation for reasoning about partial shapes and prove that Operon's incremental construction algorithm guarantees deterministic and confluent execution in parallel settings. The system's explicit modeling of partially-known states enables robust persistence and recovery mechanisms, while its per-task multi-queue architecture achieves efficient parallelism across heterogeneous task types. Empirical evaluation demonstrates that Operon outperforms an existing workflow engine with 14.94x baseline overhead reduction while maintaining near-linear end-to-end output rates as workloads scale, making it particularly suitable for large-scale data generation pipelines in machine learning applications.

cs.PL↗

Mizzle: A Complete Concurrent Incorrectness Logic with Applications to Agentic Bug Certification

Large language models are increasingly used to find bugs in real-world programs, but they also produce a flood of false alarms that waste developers' time. We propose to prevent these false alarms by requiring an LLM to accompany each bug report with a machine-checked proof, in a program logic, that the reported bug is real. Unlike a test, such a proof is unaffected by how rarely a concurrency bug manifests, and can certify a bug against a library's specification rather than its implementation. We follow the approach of incorrectness logics, whose under-approximate reasoning establishes that a claimed behavior is genuinely reachable, and hence a true positive. In our case, however, the logic must model a realistic programming language, be mechanized so that proofs can be checked, and be complete, so that no real bug is ruled out for want of a derivation. We present Mizzle, an incorrectness separation logic for concurrent programs written in a substantial subset of OCaml, parametric in the notion of incorrectness. We mechanize Mizzle in the Rocq proof assistant on top of the Iris framework, and we prove that it is both sound, so that it never justifies a false alarm, and complete, so that every incorrect execution admits a derivation. We instantiate Mizzle with three notions of incorrectness: stuckness (triggering undefined behavior), the presence of a memory race (in a sequentially consistent setting), and the non-linearizability of a data structure. We show that an LLM agent can use Mizzle to certify seeded memory races and linearizability bugs for under a dollar per bug on average. We also report two previously unknown linearizability bugs in an OCaml library of concurrent data structures.

cs.PL↗

Arbitrary Functors as Modalities in a Linear Calculus

We study modalities in the linear lambda calculus, by interpreting them as endofunctors in monoidal closed categories. We support functors that do not distribute over products, including (co)monads. We also support arbitrary natural transformations as conversion between modalities. We provide a generic categorical semantics, which we then specialise to a sound and complete resource semantics. We use this resource semantics to derive normalisation by evaluation. Along the way, we describe several applications of such models. This work aims at providing a foundation for future programming languages with modalities. The paper is backed by a mechanisation in Agda.

cs.PL↗