Choice Trees: Representing Nondeterministic, Recursive, and Impure Programs in Coq
Nicolas Chappe, Paul He, Ludovic Henrio, Yannick Zakowski, Steve Zdancewic
Abstract
This paper introduces Choice Trees (CTrees), a monad for modeling nondeterministic, recursive, and impure programs in Coq. Inspired by Xia et al.'s ITrees, this novel data structure embeds computations into coinductive trees with three kind of nodes: external events, and two variants of nondeterministic branching. This apparent redundancy allows us to provide shallow embedding of denotational models with internal choice in the style of ccs, while recovering an inductive LTS view of the computation. CTrees inherit a vast collection of bisimulation and refinement tools, with respect to which we establish a rich equational theory.
We connect CTrees to the ITrees infrastructure by showing how a monad morphism embedding the former into the latter permits to use CTrees to implement nondeterministic effects. We demonstrate the utility of CTrees by using them to model concurrency semantics in two case studies: ccs and cooperative multithreading.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 4dc6d659-32b9-4acf-a978-57cbc5cbc4e7Cited by top-tier papers10
- Stuttering for FreeMinki Cho, Youngju Song, Dongjae Lee, Lennard Gäher et al.OOPSLA 2023 · 11 citations
- Fully Composable and Adequate Verified Compilation with Direct Refinements between Open ModulesLing Zhang, Yuting Wang, Jinhua Wu, Jérémie Koenig et al.POPL 2024 · 10 citations
- A HAT Trick: Automatically Verifying Representation Invariants using Symbolic Finite AutomataZhe Zhou, Qianchuan Ye, Benjamin Delaware, Suresh JagannathanPLDI 2024 · 7 citations
- Program Logics à la CarteMax Vistrup, Michael Sammler, Ralf JungPOPL 2025 · 4 citations
- ArchSem: Reusable Rigorous Semantics of Relaxed ArchitecturesThibaut Pérami, Thomas Bauereiss, Brian Campbell, Zongyuan Liu et al.POPL 2026 · 1 citation
Builds on6
- Interaction trees: representing recursive and impure programs in CoqLi-yao Xia, Yannick Zakowski, Paul He, Chung-Kil Hur et al.POPL 2020 · 133 citations
- Promising 2.0: global optimizations in relaxed memory concurrencySung-Hwan Lee, Minki Cho, Anton Podkopaev, Soham Chakraborty et al.PLDI 2020 · 48 citations
- The next 700 relational program logicsKenji Maillard, Catalin Hritcu, Exequiel Rivas, Antoine Van MuylderPOPL 2020 · 41 citations
- C4: verified transactional objectsMohsen Lesani, Li-yao Xia, Anders Kaseorg, Christian J. Bell et al.OOPSLA 2022 · 27 citations
- Refinement-Based Game Semantics for Certified Abstraction LayersJérémie Koenig, Zhong ShaoLICS 2020 · 17 citations
Related papers
- Dijkstra monads forever: termination-sensitive specifications for interaction treesLucas Silver, Steve ZdancewicPOPL 2021 · 17 citations
- Reasoning about recursive tree traversalsYanjun Wang, Jinwei Liu, Dalin Zhang, Xiaokang QiuPPoPP 2021 · 4 citations
- Probabilistic Strategies: Definability and the Tensor Completeness ProblemNathan J. Bowler, Sergey Goncharov, Paul Blain LevyLICS 2025
- Thin Coalgebraic Behaviours Are InductiveAnton Chernev, Corina Cîrstea, Helle Hvid Hansen, Clemens KupkeLICS 2025
- Combining Nondeterminism, Probability, and Termination: Equational and Metric ReasoningMatteo Mio, Ralph Sarkis, Valeria VignudelliLICS 2021 · 14 citations
