Bialgebraic Semantics for String Diagrams

by   Filippo Bonchi, et al.

Turi and Plotkin's bialgebraic semantics is an abstract approach to specifying the operational semantics of a system, by means of a distributive law between its syntax (encoded as a monad) and its dynamics (an endofunctor). This setup is instrumental in showing that a semantic specification (a coalgebra) satisfies desirable properties: in particular, that it is compositional. In this work, we use the bialgebraic approach to derive well-behaved structural operational semantics of string diagrams, a graphical syntax that is increasingly used in the study of interacting systems across different disciplines. Our analysis relies on representing the two-dimensional operations underlying string diagrams in various categories as a monad, and their bialgebraic semantics in terms of a distributive law over that monad. As a proof of concept, we provide bialgebraic compositional semantics for a versatile string diagrammatic language which has been used to model both signal flow graphs (control theory) and Petri nets (concurrency theory). Moreover, our approach reveals a correspondence between two different interpretations of the Frobenius equations on string diagrams and two synchronisation mechanisms for processes, à la Hoare and à la Milner.



page 1

page 2

page 3

page 4


Universal Constructions for (Co)Relations: categories, monoidal categories, and props

Calculi of string diagrams are increasingly used to present the syntax a...

Interacting Hopf Algebras: the theory of linear systems

As first main contribution, this thesis characterises the PROP SVk of li...

Compositional Modeling with Stock and Flow Diagrams

Stock and flow diagrams are widely used in epidemiology to model the dyn...

A String Diagrammatic Axiomatisation of Finite-State Automata

We develop a fully diagrammatic approach to the theory of finite-state a...

The Cost of Compositionality: A High-Performance Implementation of String Diagram Composition

String diagrams are an increasingly popular algebraic language for the a...

Operational Semantics with Hierarchical Abstract Syntax Graphs

This is a motivating tutorial introduction to a semantic analysis of pro...

Petri Nets and Machines of Things That Flow

Petri nets are an established graphical formalism for modeling and analy...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Starting from the seminal works of Hoare and Milner, there was an explosion [Hoare:1978:CSP, Milner:1982:CCS, Sangiorgi:2001:PiCalculus, Cardelli2000, Castagna2005] of interest in process calculi: formal languages for specifying and reasoning about concurrent systems. The beauty of the approach, and often the focus of research, lies in compositionality: essentially, the behaviour of composite systems—usually understood as some kind of process equivalence, the most famous of which is bisimilarity—ought to be a function of the behaviour of its components. The central place of compositionality led to the study of syntactic formats for semantic specifications [de1985higher, bloom1995bisimulation, groote1993transition]; succinctly stated, syntactic operations with semantics defined using such formats are homomorphic wrt the semantic space of behaviours.

Another thread of concurrency theory research [Reisig1985, jensen2013coloured, harel1987statecharts] uses graphical formalisms, such as Petri nets. These often have the advantage of highlighting connectivity, distribution and the communication topology of systems. They tend to be popular with practitioners in part because of their intuitive and human-readable depictions, an aspect that should not be underestimated: indeed, pedagogical texts introducing CCS [Hoare:1978:CSP] and CSP [Milner:1982:CCS] often resort to pictures that give intuition about topological aspects of syntactic specifications. However, compositionality has not—historically—been a principal focus of research.

In this paper we propose a framework that allows us to eat our cake and have it too. We use string diagrams [Selinger2009] which have an intuitive graphical rendering, but also come with algebraic operations for composition. String diagrams combine the best of both worlds: they are a (2-dimensional) syntax, but also convey important topological information about the systems they specify. They have been used in recent years to give compositional accounts of quantum circuits[Abramsky2004, Coecke2008], signal flow graphs [Bonchi2015, BaezErbele-CategoriesInControl, Fong2015], Petri nets [BonchiHPSZ19], and electrical circuits [Fong2013, Ghica13], amongst several other applications.

Our main contribution is the adaptation of Turi and Plotkin’s bialgebraic semantics (abstract GSOS[turi1997towards, klin2011bialgebras] for string diagrams. By doing so, we provide a principled justification and theoretical framework for giving definitions of operational semantics to the generators and operations of string diagrams, which are those of monoidal categories. More precisely we deal with string diagrams for symmetric monoidal categories which organise themselves as arrows of a particularly simple and well-behaved class known as props. Similar operational definitions have been used in the work on the algebra of Span(Graph) [Katis1997a], tile logic [Gadducci2000], the wire calculus [wirecalc] and recent work on modelling signal flow graphs and Petri nets [Bonchi2015, BonchiHPSZ19]. In each case, semantics was given either monolithically or via a set of SOS rules. The link with bialgebraic framework—developed in this paper—provides us a powerful theoretical tool that (i) justifies these operational definitions and (ii) guarantees compositionality.

In a nutshell, in the bialgebraic approach, the syntax of a language is the initial algebra (the algebra of terms) for a signature functor . A certain kind of distributive law, an abstract GSOS specification [turi1997towards], induces a coalgebra (a state machine) capturing the operational semantics of the language. The final -coalgebra provides the denotational universe: intuitively, the space of all possible behaviours. The unique coalgebra map represents the denotational semantics assigning to each term its behaviour.