Choice Trees: Representing Nondeterministic, Recursive, and Impure Programs in Coq - Archive ouverte HAL
Article Dans Une Revue Proceedings of the ACM on Programming Languages Année : 2023

Choice Trees: Representing Nondeterministic, Recursive, and Impure Programs in Coq

Résumé

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.
Fichier principal
Vignette du fichier
ctrees.pdf (683.82 Ko) Télécharger le fichier
Origine Fichiers produits par l'(les) auteur(s)
Licence

Dates et versions

hal-03886910 , version 1 (06-12-2022)

Licence

Identifiants

Citer

Nicolas Chappe, Paul He, Ludovic Henrio, Yannick Zakowski, Steve Zdancewic. Choice Trees: Representing Nondeterministic, Recursive, and Impure Programs in Coq. Proceedings of the ACM on Programming Languages, 2023, pp.1-31. ⟨10.1145/3571254⟩. ⟨hal-03886910⟩
66 Consultations
69 Téléchargements

Altmetric

Partager

More