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

11/13/2022
by   Nicolas Chappe, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/31/2019

Interaction Trees: Representing Recursive and Impure Programs in Coq (Work In Progress)

We present "interaction trees" (ITrees), a general-purpose data structur...
research
11/25/2017

Total Haskell is Reasonable Coq

We would like to use the Coq proof assistant to mechanically verify prop...
research
06/06/2022

A Category Theoretic View of Contextual Types: from Simple Types to Dependent Types

We describe the categorical semantics for a simply typed variant and a s...
research
06/26/2022

Applications of Recursively Defined Data Structures

A circular program contains a data structure whose definition is self-re...
research
05/22/2021

Choosing is Losing: How to combine the benefits of shallow and deep embeddings through reflection

Dependently-typed host languages empower users to verify a wide range of...
research
09/19/2017

Programming from Metaphorisms

This paper presents a study of the metaphorism pattern of relational spe...
research
04/23/2018

Top-down and Bottom-up Evaluation Procedurally Integrated

This paper describes how XSB combines top-down and bottom-up computation...

Please sign up or login with your details

Forgot password? Click here to reset