Article Dans Une Revue Journal of Functional Programming Année : 2025

Choice Trees: Representing and Reasoning About Nondeterministic, Recursive, and Impure Programs in Rocq

Résumé

This paper introduces Choice Trees (CTrees), a monad for modeling nondeterministic, recursive, and impure programs in Rocq. Inspired by Xia et al.'s ITrees, this novel data structure embeds computations into coinductive trees with three kinds of nodes: external events, internal steps, and delayed branching. This structure allows us to provide shallow embedding of denotational models with nondeterministic choice in the style of ccs, while recovering an inductive LTS view of the computation. CTrees leverage a vast collection of bisimulation and refinement tools well-studied on LTSs, 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 using 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.

Fichier principal
Vignette du fichier
ctrees.pdf (595.37 Ko) Télécharger le fichier
Origine Fichiers produits par l'(les) auteur(s)
Licence

Dates et versions

hal-05154458 , version 1 (09-07-2025)
hal-05154458 , version 2 (22-12-2025)

Licence

Identifiants

  • HAL Id : hal-05154458 , version 2

Citer

Nicolas Chappe, Paul He, Ludovic Henrio, Eleftherios Ioannidis, Yannick Zakowski, et al.. Choice Trees: Representing and Reasoning About Nondeterministic, Recursive, and Impure Programs in Rocq. Journal of Functional Programming, 2025. ⟨hal-05154458v2⟩
305 Consultations
299 Téléchargements

Partager

  • More