← Ongoing work

In progress

Mechanising CSP in Agda with Process Trees

A coinductive mechanisation of CSP in Agda based on process trees, an extension of interaction trees, covering operators and algebraic laws, failures-divergences refinement, bisimulation and LTL. It is the foundation of my Cardano network verification.

State of the art & contributions

Process algebras such as CSP are usually given an operational semantics as a labelled transition system, with denotational models (traces, failures, divergences) layered on top. This library instead takes a single coinductive process tree as the one semantic object.

The key design is a fused branching node: a single react node carries both a visible offer map (external choice) and a silent τ-branch map (internal choice). Because one node can offer visible events and have an enabled τ at the same time, the model expresses sliding / timeout states directly — something separate visible and branching nodes cannot.

On this one type the library develops the behavioural theories generically, independent of any particular operator set: strong, weak and divergence-respecting bisimulation; stable refusals and stable failures; the failures-divergences model with its refinement orders and equivalence; and an LTL layer. Bridges connect bisimulation to failures-divergences equivalence.

Architecture

The formalisation is layered in Agda:

Architecture of the Agda formalisation: core process trees, generic semantics, the CSP layer and examples.

What it can do

A probabilistic extension of the process-tree model is planned.

Applications

Cardano network modelling

The library is the semantic basis for modelling and verifying the Cardano peer-to-peer network, developed on kangfeng/* branches of agda-cardano-common:

Security protocols

The process-tree model underpins a framework for verifying security protocols in Agda. A protocol is written as role terms in a small modelling language and composed in parallel with a Dolev–Yao intruder; secrecy and agreement are stated as trace refinements, proved with rank functions in the style of Schneider, and negative results are refutations at concrete traces of the same composition.

Worked examples include:

How to use it

With Agda 2.8.0 and the standard-library and standard-library-classes libraries installed, type-check from the repository root:

agda src/CSP/Operators.agda

Modules are type-checked transitively, so checking an entry point pulls in its dependencies. The library is laid out under src/, with Semantics/ for the generic theory and CSP/ for the operators, laws and examples.

Resources