-
Logic Explanation of AI Classifiers by Categorical Explaining Functors
Authors:
Stefano Fioravanti,
Francesco Giannini,
Paolo Frazzetto,
Fabio Zanasi,
Pietro Barbiero
Abstract:
The most common methods in explainable artificial intelligence are post-hoc techniques which identify the most relevant features used by pretrained opaque models. Some of the most advanced post hoc methods can generate explanations that account for the mutual interactions of input features in the form of logic rules. However, these methods frequently fail to guarantee the consistency of the extrac…
▽ More
The most common methods in explainable artificial intelligence are post-hoc techniques which identify the most relevant features used by pretrained opaque models. Some of the most advanced post hoc methods can generate explanations that account for the mutual interactions of input features in the form of logic rules. However, these methods frequently fail to guarantee the consistency of the extracted explanations with the model's underlying reasoning. To bridge this gap, we propose a theoretically grounded approach to ensure coherence and fidelity of the extracted explanations, moving beyond the limitations of current heuristic-based approaches. To this end, drawing from category theory, we introduce an explaining functor which structurally preserves logical entailment between the explanation and the opaque model's reasoning. As a proof of concept, we validate the proposed theoretical constructions on a synthetic benchmark verifying how the proposed approach significantly mitigates the generation of contradictory or unfaithful explanations.
△ Less
Submitted 20 March, 2025;
originally announced March 2025.
-
An Algebraic Approach to Moralisation and Triangulation of Probabilistic Graphical Models
Authors:
Antonio Lorenzin,
Fabio Zanasi
Abstract:
Moralisation and Triangulation are transformations allowing to switch between different ways of factoring a probability distribution into a graphical model. Moralisation allows to view a Bayesian network (a directed model) as a Markov network (an undirected model), whereas triangulation works in the opposite direction. We present a categorical framework where these transformations are modelled as…
▽ More
Moralisation and Triangulation are transformations allowing to switch between different ways of factoring a probability distribution into a graphical model. Moralisation allows to view a Bayesian network (a directed model) as a Markov network (an undirected model), whereas triangulation works in the opposite direction. We present a categorical framework where these transformations are modelled as functors between a category of Bayesian networks and one of Markov networks. The two kinds of network (the objects of these categories) are themselves represented as functors, from a `syntax' domain to a `semantics' codomain. Notably, moralisation and triangulation are definable inductively on such syntax, and operate as a form of functor pre-composition. This approach introduces a modular, algebraic perspective in the theory of probabilistic graphical models.
△ Less
Submitted 14 March, 2025;
originally announced March 2025.
-
String Diagrams for Graded Monoidal Theories with an Application to Imprecise Probability
Authors:
Ralph Sarkis,
Fabio Zanasi
Abstract:
We introduce string diagrams for graded symmetric monoidal categories. Our approach includes a definition of graded monoidal theory and the corresponding freely generated syntactic category. Also, we show how an axiomatic presentation for the graded theory may be modularly obtained from one for the grading theory and one for the base category. The Para construction on monoidal actegories is a moti…
▽ More
We introduce string diagrams for graded symmetric monoidal categories. Our approach includes a definition of graded monoidal theory and the corresponding freely generated syntactic category. Also, we show how an axiomatic presentation for the graded theory may be modularly obtained from one for the grading theory and one for the base category. The Para construction on monoidal actegories is a motivating example for our framework. As a case study, we show how to axiomatise a variant of the graded category ImP, recently introduced by Liell-Cock and Staton to model imprecise probability. This culminates in a representation, as string diagrams with grading wires, of programs with primitives for nondeterministic and probabilistic choices and conditioning.
△ Less
Submitted 12 May, 2025; v1 submitted 30 January, 2025;
originally announced January 2025.
-
Quantitative Monoidal Algebra: Axiomatising Distance with String Diagrams
Authors:
Gabriele Lobbia,
Wojciech Różowski,
Ralph Sarkis,
Fabio Zanasi
Abstract:
String diagrammatic calculi have become increasingly popular in fields such as quantum theory, circuit theory, probabilistic programming, and machine learning, where they enable resource-sensitive and compositional algebraic analysis. Traditionally, the equations of diagrammatic calculi only axiomatise exact semantic equality. However, reasoning in these domains often involves approximations rathe…
▽ More
String diagrammatic calculi have become increasingly popular in fields such as quantum theory, circuit theory, probabilistic programming, and machine learning, where they enable resource-sensitive and compositional algebraic analysis. Traditionally, the equations of diagrammatic calculi only axiomatise exact semantic equality. However, reasoning in these domains often involves approximations rather than strict equivalences. In this work, we develop a quantitative framework for diagrammatic calculi, where one may axiomatise notions of distance between string diagrams. Unlike similar approaches, such as the quantitative theories introduced by Mardare et al., this requires us to work in a monoidal rather than a cartesian setting. We define a suitable notion of monoidal theory, the syntactic category it freely generates, and its models, where the concept of distance is established via enrichment over a quantale. To illustrate the framework, we provide examples from probabilistic and linear systems analysis.
△ Less
Submitted 23 January, 2025; v1 submitted 11 October, 2024;
originally announced October 2024.
-
Disconnection Rules are Complete for Chemical Reactions
Authors:
Ella Gale,
Leo Lobski,
Fabio Zanasi
Abstract:
We provide a category theoretical framework capturing two approaches to graph-based models of chemistry: formal reactions and disconnection rules. We model a translation from the latter to the former as a functor, which is faithful, and full up to isomorphism. This allows us to state, as our main result, that the disconnection rules are sound, complete and universal with respect to the reactions.…
▽ More
We provide a category theoretical framework capturing two approaches to graph-based models of chemistry: formal reactions and disconnection rules. We model a translation from the latter to the former as a functor, which is faithful, and full up to isomorphism. This allows us to state, as our main result, that the disconnection rules are sound, complete and universal with respect to the reactions. Concretely, this means that every reaction can be decomposed into a sequence of disconnection rules in an essentially unique way. This provides a uniform way to store reaction data, and gives an algorithmic interface between (forward) reaction prediction and (backward) reaction search or retrosynthesis.
△ Less
Submitted 2 October, 2024;
originally announced October 2024.
-
A Fibrational Theory of First Order Differential Structures
Authors:
Matteo Capucci,
Geoffrey S. H. Cruttwell,
Neil Ghani,
Fabio Zanasi
Abstract:
We develop a categorical framework for reasoning about abstract properties of differentiation, based on the theory of fibrations. Our work encompasses the first-order fragments of several existing categorical structures for differentiation, including cartesian differential categories, generalised cartesian differential categories, tangent categories, as well as the versions of these categories axi…
▽ More
We develop a categorical framework for reasoning about abstract properties of differentiation, based on the theory of fibrations. Our work encompasses the first-order fragments of several existing categorical structures for differentiation, including cartesian differential categories, generalised cartesian differential categories, tangent categories, as well as the versions of these categories axiomatising reverse derivatives. We explain uniformly and concisely the requirements expressed by these structures, using sections of suitable fibrations as unifying concept. Our perspective sheds light on their similarities and differences, as well as simplifying certain constructions from the literature.
△ Less
Submitted 9 September, 2024;
originally announced September 2024.
-
A Complete Axiomatisation of Equivalence for Discrete Probabilistic Programming
Authors:
Robin Piedeleu,
Mateo Torres-Ruiz,
Alexandra Silva,
Fabio Zanasi
Abstract:
We introduce a sound and complete equational theory capturing equivalence of discrete probabilistic programs, that is, programs extended with primitives for Bernoulli distributions and conditioning, to model distributions over finite sets of events. To do so, we translate these programs into a graphical syntax of probabilistic circuits, formalised as string diagrams, the two-dimensional syntax of…
▽ More
We introduce a sound and complete equational theory capturing equivalence of discrete probabilistic programs, that is, programs extended with primitives for Bernoulli distributions and conditioning, to model distributions over finite sets of events. To do so, we translate these programs into a graphical syntax of probabilistic circuits, formalised as string diagrams, the two-dimensional syntax of symmetric monoidal categories. We then prove a first completeness result for the equational theory of the conditioning-free fragment of our syntax. Finally, we extend this result to a complete equational theory for the entire language. Note these developments are also of interest for the development of probability theory in Markov categories: our first result gives a presentation by generators and equations of the category of Markov kernels, restricted to objects that are powers of the two-elements set.
△ Less
Submitted 26 August, 2024;
originally announced August 2024.
-
Learning Closed Signal Flow Graphs
Authors:
Ekaterina Piotrovskaya,
Leo Lobski,
Fabio Zanasi
Abstract:
We develop a learning algorithm for closed signal flow graphs - a graphical model of signal transducers. The algorithm relies on the correspondence between closed signal flow graphs and weighted finite automata on a singleton alphabet. We demonstrate that this procedure results in a genuine reduction of complexity: our algorithm fares better than existing learning algorithms for weighted automata…
▽ More
We develop a learning algorithm for closed signal flow graphs - a graphical model of signal transducers. The algorithm relies on the correspondence between closed signal flow graphs and weighted finite automata on a singleton alphabet. We demonstrate that this procedure results in a genuine reduction of complexity: our algorithm fares better than existing learning algorithms for weighted automata restricted to the case of a singleton alphabet.
△ Less
Submitted 28 June, 2024;
originally announced July 2024.
-
Deep Learning with Parametric Lenses
Authors:
Geoffrey S. H. Cruttwell,
Bruno Gavranovic,
Neil Ghani,
Paul Wilson,
Fabio Zanasi
Abstract:
We propose a categorical semantics for machine learning algorithms in terms of lenses, parametric maps, and reverse derivative categories. This foundation provides a powerful explanatory and unifying framework: it encompasses a variety of gradient descent algorithms such as ADAM, AdaGrad, and Nesterov momentum, as well as a variety of loss functions such as MSE and Softmax cross-entropy, and diffe…
▽ More
We propose a categorical semantics for machine learning algorithms in terms of lenses, parametric maps, and reverse derivative categories. This foundation provides a powerful explanatory and unifying framework: it encompasses a variety of gradient descent algorithms such as ADAM, AdaGrad, and Nesterov momentum, as well as a variety of loss functions such as MSE and Softmax cross-entropy, and different architectures, shedding new light on their similarities and differences. Furthermore, our approach to learning has examples generalising beyond the familiar continuous domains (modelled in categories of smooth maps) and can be realised in the discrete setting of Boolean and polynomial circuits. We demonstrate the practical significance of our framework with an implementation in Python.
△ Less
Submitted 30 March, 2024;
originally announced April 2024.
-
Graphical Quadratic Algebra
Authors:
Dario Stein,
Fabio Zanasi,
Robin Piedeleu,
Richard Samuelson
Abstract:
We introduce Graphical Quadratic Algebra (GQA), a string diagrammatic calculus extending the language of Graphical Affine Algebra with a new generator characterised by invariance under rotation matrices. We show that GQA is a sound and complete axiomatisation for three different models: quadratic relations, which are a compositional formalism for least-squares problems, Gaussian stochastic process…
▽ More
We introduce Graphical Quadratic Algebra (GQA), a string diagrammatic calculus extending the language of Graphical Affine Algebra with a new generator characterised by invariance under rotation matrices. We show that GQA is a sound and complete axiomatisation for three different models: quadratic relations, which are a compositional formalism for least-squares problems, Gaussian stochastic processes, and Gaussian stochastic processes extended with non-determinisms. The equational theory of GQA sheds light on the connections between these perspectives, giving an algebraic interpretation to the interplay of stochastic behaviour, relational behaviour, non-determinism, and conditioning. As applications, we discuss various case studies, including linear regression, probabilistic programming, and electrical circuits with realistic (noisy) components.
△ Less
Submitted 5 July, 2024; v1 submitted 4 March, 2024;
originally announced March 2024.
-
A Categorical Approach to DIBI Models
Authors:
Tao Gu,
Jialu Bao,
Justin Hsu,
Alexandra Silva,
Fabio Zanasi
Abstract:
The logic of Dependence and Independence Bunched Implications (DIBI) is a logic to reason about conditional independence (CI); for instance, DIBI formulas can characterise CI in probability distributions and relational databases, using the probabilistic and relational DIBI models, respectively. Despite the similarity of the probabilistic and relational models, a uniform, more abstract account rema…
▽ More
The logic of Dependence and Independence Bunched Implications (DIBI) is a logic to reason about conditional independence (CI); for instance, DIBI formulas can characterise CI in probability distributions and relational databases, using the probabilistic and relational DIBI models, respectively. Despite the similarity of the probabilistic and relational models, a uniform, more abstract account remains unsolved. The laborious case-by-case verification of the frame conditions required for constructing new models also calls for such a treatment. In this paper, we develop an abstract framework for systematically constructing DIBI models, using category theory as the unifying mathematical language. In particular, we use string diagrams -- a graphical presentation of monoidal categories -- to give a uniform definition of the parallel composition and subkernel relation in DIBI models. Our approach not only generalises known models, but also yields new models of interest and reduces properties of DIBI models to structures in the underlying categories. Furthermore, our categorical framework enables a logical notion of CI, in terms of the satisfaction of specific DIBI formulas. We compare it with string diagrammatic approaches to CI and show that it is an extension of string diagrammatic CI under reasonable conditions.
△ Less
Submitted 11 January, 2024;
originally announced January 2024.
-
A Categorical Model for Retrosynthetic Reaction Analysis
Authors:
Ella Gale,
Leo Lobski,
Fabio Zanasi
Abstract:
We introduce a mathematical framework for retrosynthetic analysis, an important research method in synthetic chemistry. Our approach represents molecules and their interaction using string diagrams in layered props - a recently introduced categorical model for partial explanations in scientific reasoning. Such principled approach allows one to model features currently not available in automated re…
▽ More
We introduce a mathematical framework for retrosynthetic analysis, an important research method in synthetic chemistry. Our approach represents molecules and their interaction using string diagrams in layered props - a recently introduced categorical model for partial explanations in scientific reasoning. Such principled approach allows one to model features currently not available in automated retrosynthesis tools, such as chirality, reaction environment and protection-deprotection steps.
△ Less
Submitted 7 November, 2023;
originally announced November 2023.
-
String Diagrams for $λ$-calculi and Functional Computation
Authors:
Dan Ghica,
Fabio Zanasi
Abstract:
This tutorial gives an advanced introduction to string diagrams and graph languages for higher-order computation. The subject matter develops in a principled way, starting from the two dimensional syntax of key categorical concepts such as functors, adjunctions, and strictification, and leading up to Cartesian Closed Categories, the core mathematical model of the lambda calculus and of functional…
▽ More
This tutorial gives an advanced introduction to string diagrams and graph languages for higher-order computation. The subject matter develops in a principled way, starting from the two dimensional syntax of key categorical concepts such as functors, adjunctions, and strictification, and leading up to Cartesian Closed Categories, the core mathematical model of the lambda calculus and of functional programming languages. This methodology inverts the usual approach of proceeding from syntax to a categorical interpretation, by rationally reconstructing a syntax from the categorical model. The result is a graph syntax -- more precisely, a hierarchical hypergraph syntax -- which in many ways is shown to be an improvement over the conventional linear term syntax. The rest of the tutorial focuses on applications of interest to programming languages: operational semantics, general frameworks for type inference, and complex whole-program transformations such as closure conversion and automatic differentiation.
△ Less
Submitted 4 December, 2024; v1 submitted 30 May, 2023;
originally announced May 2023.
-
An Introduction to String Diagrams for Computer Scientists
Authors:
Robin Piedeleu,
Fabio Zanasi
Abstract:
This document is an elementary introduction to string diagrams. It takes a computer science perspective: rather than using category theory as a starting point, we build on intuitions from formal language theory, treating string diagrams as a syntax with its semantics. After the basic theory, pointers are provided to contemporary applications of string diagrams in various fields of science.
This document is an elementary introduction to string diagrams. It takes a computer science perspective: rather than using category theory as a starting point, we build on intuitions from formal language theory, treating string diagrams as a syntax with its semantics. After the basic theory, pointers are provided to contemporary applications of string diagrams in various fields of science.
△ Less
Submitted 22 November, 2023; v1 submitted 15 May, 2023;
originally announced May 2023.
-
Data-Parallel Algorithms for String Diagrams
Authors:
Paul Wilson,
Fabio Zanasi
Abstract:
We give parallel algorithms for string diagrams represented as structured cospans of ACSets. Specifically, we give linear (sequential) and logarithmic (parallel) time algorithms for composition, tensor product, construction of diagrams from arbitrary $Σ$-terms, and application of functors to diagrams. Our datastructure can represent morphisms of both the free symmetric monoidal category over an ar…
▽ More
We give parallel algorithms for string diagrams represented as structured cospans of ACSets. Specifically, we give linear (sequential) and logarithmic (parallel) time algorithms for composition, tensor product, construction of diagrams from arbitrary $Σ$-terms, and application of functors to diagrams. Our datastructure can represent morphisms of both the free symmetric monoidal category over an arbitrary signature as well as those with a chosen Special Frobenius structure. We show how this additional (hypergraph) structure can be used to map diagrams to diagrams of optics. This leads to a case study in which we define an algorithm for efficiently computing symbolic representations of gradient-based learners based on reverse derivatives. The work we present here is intended to be useful as a general purpose datastructure. Implementation requires only integer arrays and well-known algorithms, and is data-parallel by constuction. We therefore expect it to be applicable to a wide variety of settings, including embedded and parallel hardware and low-level languages.
△ Less
Submitted 1 May, 2023;
originally announced May 2023.
-
A Finite Axiomatisation of Finite-State Automata Using String Diagrams
Authors:
Robin Piedeleu,
Fabio Zanasi
Abstract:
We develop a fully diagrammatic approach to finite-state automata, based on reinterpreting their usual state-transition graphical representation as a two-dimensional syntax of string diagrams. In this setting, we are able to provide a complete equational theory for language equivalence, with two notable features. First, the proposed axiomatisation is finite. Second, the Kleene star is a derived co…
▽ More
We develop a fully diagrammatic approach to finite-state automata, based on reinterpreting their usual state-transition graphical representation as a two-dimensional syntax of string diagrams. In this setting, we are able to provide a complete equational theory for language equivalence, with two notable features. First, the proposed axiomatisation is finite. Second, the Kleene star is a derived concept, as it can be decomposed into more primitive algebraic blocks.
△ Less
Submitted 14 February, 2023; v1 submitted 29 November, 2022;
originally announced November 2022.
-
A Complete Diagrammatic Calculus for Boolean Satisfiability
Authors:
Tao Gu,
Robin Piedeleu,
Fabio Zanasi
Abstract:
We propose a calculus of string diagrams to reason about satisfiability of Boolean formulas, and prove it to be sound and complete. We then showcase our calculus in a few case studies. First, we consider SAT-solving. Second, we consider Horn clauses, which leads us to a new decision method for propositional logic programs equivalence under Herbrand model semantics.
We propose a calculus of string diagrams to reason about satisfiability of Boolean formulas, and prove it to be sound and complete. We then showcase our calculus in a few case studies. First, we consider SAT-solving. Second, we consider Horn clauses, which leads us to a new decision method for propositional logic programs equivalence under Herbrand model semantics.
△ Less
Submitted 20 February, 2023; v1 submitted 22 November, 2022;
originally announced November 2022.
-
String Diagrams for Layered Explanations
Authors:
Leo Lobski,
Fabio Zanasi
Abstract:
We propose a categorical framework to reason about scientific explanations: descriptions of a phenomenon meant to translate it into simpler terms, or into a context that has been already understood. Our motivating examples come from systems biology, electrical circuit theory, and concurrency. We demonstrate how three explanatory models in these seemingly diverse areas can be all understood uniform…
▽ More
We propose a categorical framework to reason about scientific explanations: descriptions of a phenomenon meant to translate it into simpler terms, or into a context that has been already understood. Our motivating examples come from systems biology, electrical circuit theory, and concurrency. We demonstrate how three explanatory models in these seemingly diverse areas can be all understood uniformly via a graphical calculus of layered props. Layered props allow for a compact visual presentation of the same phenomenon at different levels of precision, as well as the translation between these levels. Notably, our approach allows for partial explanations, that is, for translating just one part of a diagram while keeping the rest of the diagram untouched. Furthermore, our approach paves the way for formal reasoning about counterfactual models in systems biology.
△ Less
Submitted 31 July, 2023; v1 submitted 8 July, 2022;
originally announced July 2022.
-
Rewriting for Symmetric Monoidal Categories with Commutative (Co)Monoid Structure
Authors:
Aleksandar Milosavljevic,
Robin Piedeleu,
Fabio Zanasi
Abstract:
String diagrams are pictorial representations for morphisms of symmetric monoidal categories. They constitute an intuitive and expressive graphical syntax, which has found application in a very diverse range of fields including concurrency theory, quantum computing, control theory, machine learning, linguistics, and digital circuits. Rewriting theory for string diagrams relies on a combinatorial i…
▽ More
String diagrams are pictorial representations for morphisms of symmetric monoidal categories. They constitute an intuitive and expressive graphical syntax, which has found application in a very diverse range of fields including concurrency theory, quantum computing, control theory, machine learning, linguistics, and digital circuits. Rewriting theory for string diagrams relies on a combinatorial interpretation as double-pushout rewriting of certain hypergraphs. As previously studied, there is a `tension' in this interpretation: in order to make it sound and complete, we either need to add structure on string diagrams (in particular, Frobenius algebra structure) or pose restrictions on double-pushout rewriting (resulting in 'convex' rewriting). From the string diagram viewpoint, imposing a full Frobenius structure may not always be natural or desirable in applications, which motivates our study of a weaker requirement: commutative monoid structure. In this work we characterise string diagram rewriting modulo commutative monoid equations, via a sound and complete interpretation in a suitable notion of double-pushout rewriting of hypergraphs.
△ Less
Submitted 30 January, 2025; v1 submitted 8 April, 2022;
originally announced April 2022.
-
Categories of Differentiable Polynomial Circuits for Machine Learning
Authors:
Paul Wilson,
Fabio Zanasi
Abstract:
Reverse derivative categories (RDCs) have recently been shown to be a suitable semantic framework for studying machine learning algorithms. Whereas emphasis has been put on training methodologies, less attention has been devoted to particular \emph{model classes}: the concrete categories whose morphisms represent machine learning models. In this paper we study presentations by generators and equat…
▽ More
Reverse derivative categories (RDCs) have recently been shown to be a suitable semantic framework for studying machine learning algorithms. Whereas emphasis has been put on training methodologies, less attention has been devoted to particular \emph{model classes}: the concrete categories whose morphisms represent machine learning models. In this paper we study presentations by generators and equations of classes of RDCs. In particular, we propose \emph{polynomial circuits} as a suitable machine learning model. We give an axiomatisation for these circuits and prove a functional completeness result. Finally, we discuss the use of polynomial circuits over specific semirings to perform machine learning with discrete values.
△ Less
Submitted 9 May, 2022; v1 submitted 12 March, 2022;
originally announced March 2022.
-
String Diagram Rewrite Theory III: Confluence with and without Frobenius
Authors:
Filippo Bonchi,
Fabio Gadducci,
Aleks Kissinger,
Paweł Sobociński,
Fabio Zanasi
Abstract:
In this paper we address the problem of proving confluence for string diagram rewriting, which was previously shown to be characterised combinatorically as double-pushout rewriting with interfaces (DPOI) on (labelled) hypergraphs. For standard DPO rewriting without interfaces, confluence for terminating rewrite systems is, in general, undecidable. Nevertheless, we show here that confluence for DPO…
▽ More
In this paper we address the problem of proving confluence for string diagram rewriting, which was previously shown to be characterised combinatorically as double-pushout rewriting with interfaces (DPOI) on (labelled) hypergraphs. For standard DPO rewriting without interfaces, confluence for terminating rewrite systems is, in general, undecidable. Nevertheless, we show here that confluence for DPOI, and hence string diagram rewriting, is decidable. We apply this result to give effective procedures for deciding local confluence of symmetric monoidal theories with and without Frobenius structure by critical pair analysis. For the latter, we introduce the new notion of path joinability for critical pairs, which enables finitely many joins of a critical pair to be lifted to an arbitrary context in spite of the strong non-local constraints placed on rewriting in a generic symmetric monoidal theory.
△ Less
Submitted 18 April, 2022; v1 submitted 13 September, 2021;
originally announced September 2021.
-
Functorial String Diagrams for Reverse-Mode Automatic Differentiation
Authors:
Mario Alvarez-Picallo,
Dan R. Ghica,
David Sprunger,
Fabio Zanasi
Abstract:
We enhance the calculus of string diagrams for monoidal categories with hierarchical features in order to capture closed monoidal (and cartesian closed) structure. Using this new syntax we formulate an automatic differentiation algorithm for (applied) simply typed lambda calculus in the style of [Pearlmutter and Siskind 2008] and we prove for the first time its soundness. To give an efficient yet…
▽ More
We enhance the calculus of string diagrams for monoidal categories with hierarchical features in order to capture closed monoidal (and cartesian closed) structure. Using this new syntax we formulate an automatic differentiation algorithm for (applied) simply typed lambda calculus in the style of [Pearlmutter and Siskind 2008] and we prove for the first time its soundness. To give an efficient yet principled implementation of the AD algorithm we define a sound and complete representation of hierarchical string diagrams as a class of hierarchical hypergraphs we call hypernets.
△ Less
Submitted 28 July, 2021;
originally announced July 2021.
-
The Cost of Compositionality: A High-Performance Implementation of String Diagram Composition
Authors:
Paul Wilson,
Fabio Zanasi
Abstract:
String diagrams are an increasingly popular algebraic language for the analysis of graphical models of computations across different research fields. Whereas string diagrams have been thoroughly studied as semantic structures, much less attention has been given to their algorithmic properties, and efficient implementations of diagrammatic reasoning are almost an unexplored subject.
This work int…
▽ More
String diagrams are an increasingly popular algebraic language for the analysis of graphical models of computations across different research fields. Whereas string diagrams have been thoroughly studied as semantic structures, much less attention has been given to their algorithmic properties, and efficient implementations of diagrammatic reasoning are almost an unexplored subject.
This work intends to be a contribution in such a direction. We introduce a data structure representing string diagrams in terms of adjacency matrices. This encoding has the key advantage of providing simple and efficient algorithms for composition and tensor product of diagrams. We demonstrate its effectiveness by showing that the complexity of the two operations is linear in the size of string diagrams. Also, as our approach is based on basic linear algebraic operations, we can take advantage of heavily optimised implementations, which we use to measure performances of string diagrammatic operations via several benchmarks.
△ Less
Submitted 3 November, 2022; v1 submitted 19 May, 2021;
originally announced May 2021.
-
String Diagram Rewrite Theory II: Rewriting with Symmetric Monoidal Structure
Authors:
Filippo Bonchi,
Fabio Gadducci,
Aleks Kissinger,
Pawel Sobocinski,
Fabio Zanasi
Abstract:
Symmetric monoidal theories (SMTs) generalise algebraic theories in a way that make them suitable to express resource-sensitive systems, in which variables cannot be copied or discarded at will.
In SMTs, traditional tree-like terms are replaced by string diagrams, topological entities that can be intuitively thoughts as diagrams of wires and boxes. Recently, string diagrams have become increasin…
▽ More
Symmetric monoidal theories (SMTs) generalise algebraic theories in a way that make them suitable to express resource-sensitive systems, in which variables cannot be copied or discarded at will.
In SMTs, traditional tree-like terms are replaced by string diagrams, topological entities that can be intuitively thoughts as diagrams of wires and boxes. Recently, string diagrams have become increasingly popular as a graphical syntax to reason about computational models across diverse fields, including programming language semantics, circuit theory, quantum mechanics, linguistics, and control theory. In applications, it is often convenient to implement the equations appearing in SMTs as rewriting rules. This poses the challenge of extending the traditional theory of term rewriting, which has been developed for algebraic theories, to string diagrams.
In this paper, we develop a mathematical theory of string diagram rewriting for SMTs. Our approach exploits the correspondence between string diagram rewriting and double pushout (DPO) rewriting of certain graphs, introduced in the first paper of this series. Such a correspondence is only sound when the SMT includes a Frobenius algebra structure. In the present work, we show how an analogous correspondence may be established for arbitrary SMTs, once an appropriate notion of DPO rewriting (which we call convex) is identified.
As proof of concept, we use our approach to show termination of two SMTs of interest: Frobenius semi-algebras and bialgebras.
△ Less
Submitted 14 September, 2022; v1 submitted 29 April, 2021;
originally announced April 2021.
-
Categorical Foundations of Gradient-Based Learning
Authors:
G. S. H. Cruttwell,
Bruno Gavranović,
Neil Ghani,
Paul Wilson,
Fabio Zanasi
Abstract:
We propose a categorical semantics of gradient-based machine learning algorithms in terms of lenses, parametrised maps, and reverse derivative categories. This foundation provides a powerful explanatory and unifying framework: it encompasses a variety of gradient descent algorithms such as ADAM, AdaGrad, and Nesterov momentum, as well as a variety of loss functions such as as MSE and Softmax cross…
▽ More
We propose a categorical semantics of gradient-based machine learning algorithms in terms of lenses, parametrised maps, and reverse derivative categories. This foundation provides a powerful explanatory and unifying framework: it encompasses a variety of gradient descent algorithms such as ADAM, AdaGrad, and Nesterov momentum, as well as a variety of loss functions such as as MSE and Softmax cross-entropy, shedding new light on their similarities and differences. Our approach to gradient-based learning has examples generalising beyond the familiar continuous domains (modelled in categories of smooth maps) and can be realized in the discrete setting of boolean circuits. Finally, we demonstrate the practical significance of our framework with an implementation in Python.
△ Less
Submitted 13 July, 2021; v1 submitted 2 March, 2021;
originally announced March 2021.
-
Reverse Derivative Ascent: A Categorical Approach to Learning Boolean Circuits
Authors:
Paul Wilson,
Fabio Zanasi
Abstract:
We introduce Reverse Derivative Ascent: a categorical analogue of gradient based methods for machine learning. Our algorithm is defined at the level of so-called reverse differential categories. It can be used to learn the parameters of models which are expressed as morphisms of such categories. Our motivating example is boolean circuits: we show how our algorithm can be applied to such circuit…
▽ More
We introduce Reverse Derivative Ascent: a categorical analogue of gradient based methods for machine learning. Our algorithm is defined at the level of so-called reverse differential categories. It can be used to learn the parameters of models which are expressed as morphisms of such categories. Our motivating example is boolean circuits: we show how our algorithm can be applied to such circuits by using the theory of reverse differential categories. Note our methodology allows us to learn the parameters of boolean circuits directly, in contrast to existing binarised neural network approaches. Moreover, we demonstrate its empirical value by giving experimental results on benchmark machine learning datasets.
△ Less
Submitted 25 January, 2021;
originally announced January 2021.
-
Coalgebraic Semantics for Probabilistic Logic Programming
Authors:
Tao Gu,
Fabio Zanasi
Abstract:
Probabilistic logic programming is increasingly important in artificial intelligence and related fields as a formalism to reason about uncertainty. It generalises logic programming with the possibility of annotating clauses with probabilities. This paper proposes a coalgebraic semantics on probabilistic logic programming. Programs are modelled as coalgebras for a certain functor F, and two semanti…
▽ More
Probabilistic logic programming is increasingly important in artificial intelligence and related fields as a formalism to reason about uncertainty. It generalises logic programming with the possibility of annotating clauses with probabilities. This paper proposes a coalgebraic semantics on probabilistic logic programming. Programs are modelled as coalgebras for a certain functor F, and two semantics are given in terms of cofree coalgebras. First, the F-coalgebra yields a semantics in terms of derivation trees. Second, by embedding F into another type G, as cofree G-coalgebra we obtain a `possible worlds' interpretation of programs, from which one may recover the usual distribution semantics of probabilistic logic programming. Furthermore, we show that a similar approach can be used to provide a coalgebraic semantics to weighted logic programming.
△ Less
Submitted 9 April, 2021; v1 submitted 7 December, 2020;
originally announced December 2020.
-
String Diagram Rewrite Theory I: Rewriting with Frobenius Structure
Authors:
Filippo Bonchi,
Fabio Gadducci,
Aleks Kissinger,
Pawel Sobocinski,
Fabio Zanasi
Abstract:
String diagrams are a powerful and intuitive graphical syntax, originated in the study of symmetric monoidal categories. In the last few years, they have found application in the modelling of various computational structures, in fields as diverse as Computer Science, Physics, Control Theory, Linguistics, and Biology.
In many such proposals, the transformations of the described systems are modell…
▽ More
String diagrams are a powerful and intuitive graphical syntax, originated in the study of symmetric monoidal categories. In the last few years, they have found application in the modelling of various computational structures, in fields as diverse as Computer Science, Physics, Control Theory, Linguistics, and Biology.
In many such proposals, the transformations of the described systems are modelled as rewrite rules of diagrams. These developments demand a mathematical foundation for string diagram rewriting: whereas rewrite theory for terms is well-understood, the two-dimensional nature of string diagrams poses additional challenges.
This work systematises and expands a series of recent conference papers laying down such foundation. As first step, we focus on the case of rewrite systems for string diagrammatic theories which feature a Frobenius algebra. This situation ubiquitously appear in various approaches: for instance, in the algebraic semantics of linear dynamical systems, Frobenius structures model the wiring of circuits; in categorical quantum mechanics, they model interacting quantum observables.
Our work introduces a combinatorial interpretation of string diagram rewriting modulo Frobenius structures, in terms of double-pushout hypergraph rewriting. Furthermore, we prove this interpretation to be sound and complete. In the last part, we also see that the approach can be generalised to model rewriting modulo multiple Frobenius structures. As a proof of concept, we show how to derive from these results a termination strategy for Interacting Bialgebras, an important rewrite theory in the study of quantum circuits and signal flow graphs.
△ Less
Submitted 3 February, 2022; v1 submitted 3 December, 2020;
originally announced December 2020.
-
A String Diagrammatic Axiomatisation of Finite-State Automata
Authors:
Robin Piedeleu,
Fabio Zanasi
Abstract:
We develop a fully diagrammatic approach to the theory of finite-state automata, based on reinterpreting their usual state-transition graphical representation as a two-dimensional syntax of string diagrams. Moreover, we provide an equational theory that completely axiomatises language equivalence in this new setting. This theory has two notable features. First, the Kleene star is a derived concept…
▽ More
We develop a fully diagrammatic approach to the theory of finite-state automata, based on reinterpreting their usual state-transition graphical representation as a two-dimensional syntax of string diagrams. Moreover, we provide an equational theory that completely axiomatises language equivalence in this new setting. This theory has two notable features. First, the Kleene star is a derived concept, as it can be decomposed into more primitive algebraic blocks. Second, the proposed axiomatisation is finitary -- a result which is provably impossible to obtain for the one-dimensional syntax of regular expressions.
△ Less
Submitted 4 November, 2020; v1 submitted 30 September, 2020;
originally announced September 2020.
-
Concurrent Kleene Algebra with Observations: from Hypotheses to Completeness
Authors:
Tobias Kappé,
Paul Brunet,
Alexandra Silva,
Jana Wagemaker,
Fabio Zanasi
Abstract:
Concurrent Kleene Algebra (CKA) extends basic Kleene algebra with a parallel composition operator, which enables reasoning about concurrent programs. However, CKA fundamentally misses tests, which are needed to model standard programming constructs such as conditionals and $\mathsf{while}$-loops. It turns out that integrating tests in CKA is subtle, due to their interaction with parallelism. In th…
▽ More
Concurrent Kleene Algebra (CKA) extends basic Kleene algebra with a parallel composition operator, which enables reasoning about concurrent programs. However, CKA fundamentally misses tests, which are needed to model standard programming constructs such as conditionals and $\mathsf{while}$-loops. It turns out that integrating tests in CKA is subtle, due to their interaction with parallelism. In this paper we provide a solution in the form of Concurrent Kleene Algebra with Observations (CKAO). Our main contribution is a completeness theorem for CKAO. Our result resorts on a more general study of CKA "with hypotheses", of which CKAO turns out to be an instance: this analysis is of independent interest, as it can be applied to extensions of CKA other than CKAO.
△ Less
Submitted 22 February, 2020;
originally announced February 2020.
-
Contextual Equivalence for Signal Flow Graphs
Authors:
Filippo Bonchi,
Robin Piedeleu,
Pawel Sobocinski,
Fabio Zanasi
Abstract:
We extend the signal flow calculus---a compositional account of the classical signal flow graph model of computation---to encompass affine behaviour, and furnish it with a novel operational semantics. The increased expressive power allows us to define a canonical notion of contextual equivalence, which we show to coincide with denotational equality. Finally, we characterise the realisable fragment…
▽ More
We extend the signal flow calculus---a compositional account of the classical signal flow graph model of computation---to encompass affine behaviour, and furnish it with a novel operational semantics. The increased expressive power allows us to define a canonical notion of contextual equivalence, which we show to coincide with denotational equality. Finally, we characterise the realisable fragment of the calculus: those terms that express the computations of (affine) signal flow graphs.
△ Less
Submitted 20 February, 2020;
originally announced February 2020.
-
Bialgebraic Semantics for String Diagrams
Authors:
Filippo Bonchi,
Robin Piedeleu,
Pawel Sobocinski,
Fabio Zanasi
Abstract:
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 us…
▽ More
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.
△ Less
Submitted 2 July, 2019; v1 submitted 4 June, 2019;
originally announced June 2019.
-
On Series-Parallel Pomset Languages: Rationality, Context-Freeness and Automata
Authors:
Tobias Kappé,
Paul Brunet,
Bas Luttik,
Alexandra Silva,
Fabio Zanasi
Abstract:
Concurrent Kleene Algebra (CKA) is a formalism to study concurrent programs. Like previous Kleene Algebra extensions, developing a correspondence between denotational and operational perspectives is important, for both foundations and applications. This paper takes an important step towards such a correspondence, by precisely relating bi-Kleene Algebra (BKA), a fragment of CKA, to a novel type of…
▽ More
Concurrent Kleene Algebra (CKA) is a formalism to study concurrent programs. Like previous Kleene Algebra extensions, developing a correspondence between denotational and operational perspectives is important, for both foundations and applications. This paper takes an important step towards such a correspondence, by precisely relating bi-Kleene Algebra (BKA), a fragment of CKA, to a novel type of automata, pomset automata (PAs). We show that PAs can implement the BKA semantics of series-parallel rational expressions, and that a class of PAs can be translated back to these expressions. We also characterise the behavior of general PAs in terms of context-free pomset grammars; consequently, universality, equivalence and series-parallel rationality of general PAs are undecidable.
△ Less
Submitted 14 December, 2018; v1 submitted 7 December, 2018;
originally announced December 2018.
-
Kleene Algebra with Observations
Authors:
Tobias Kappé,
Paul Brunet,
Jurriaan Rot,
Alexandra Silva,
Jana Wagemaker,
Fabio Zanasi
Abstract:
Kleene algebra with tests (KAT) is an algebraic framework for reasoning about the control flow of sequential programs. Generalising KAT to reason about concurrent programs is not straightforward, because axioms native to KAT in conjunction with expected axioms for concurrency lead to an anomalous equation. In this paper, we propose Kleene algebra with observations (KAO), a variant of KAT, as an al…
▽ More
Kleene algebra with tests (KAT) is an algebraic framework for reasoning about the control flow of sequential programs. Generalising KAT to reason about concurrent programs is not straightforward, because axioms native to KAT in conjunction with expected axioms for concurrency lead to an anomalous equation. In this paper, we propose Kleene algebra with observations (KAO), a variant of KAT, as an alternative foundation for extending KAT to a concurrent setting. We characterise the free model of KAO, and establish a decision procedure w.r.t. its equational theory.
△ Less
Submitted 21 August, 2019; v1 submitted 16 November, 2018;
originally announced November 2018.
-
Causal Inference by String Diagram Surgery
Authors:
Bart Jacobs,
Aleks Kissinger,
Fabio Zanasi
Abstract:
Extracting causal relationships from observed correlations is a growing area in probabilistic reasoning, originating with the seminal work of Pearl and others from the early 1990s. This paper develops a new, categorically oriented view based on a clear distinction between syntax (string diagrams) and semantics (stochastic matrices), connected via interpretations as structure-preserving functors. A…
▽ More
Extracting causal relationships from observed correlations is a growing area in probabilistic reasoning, originating with the seminal work of Pearl and others from the early 1990s. This paper develops a new, categorically oriented view based on a clear distinction between syntax (string diagrams) and semantics (stochastic matrices), connected via interpretations as structure-preserving functors. A key notion in the identification of causal effects is that of an intervention, whereby a variable is forcefully set to a particular value independent of any prior propensities. We represent the effect of such an intervention as an endofunctor which performs `string diagram surgery' within the syntactic category of string diagrams. This diagram surgery in turn yields a new, interventional distribution via the interpretation functor. While in general there is no way to compute interventional distributions purely from observed data, we show that this is possible in certain special cases using a calculational tool called comb disintegration. We demonstrate the use of this technique on a well-known toy example, where we predict the causal effect of smoking on cancer in the presence of a confounding common cause. After developing this specific example, we show this technique provides simple sufficient conditions for computing interventions which apply to a wide variety of situations considered in the causal inference literature.
△ Less
Submitted 28 July, 2019; v1 submitted 20 November, 2018;
originally announced November 2018.
-
The Power of the Weak
Authors:
Facundo Carreiro,
Alessandro Facchini,
Yde Venema,
Fabio Zanasi
Abstract:
A landmark result in the study of logics for formal verification is Janin & Walukiewicz's theorem, stating that the modal $μ$-calculus ($μ\mathrm{ML}$) is equivalent modulo bisimilarity to standard monadic second-order logic (here abbreviated as $\mathrm{smso}$), over the class of labelled transition systems (LTSs for short). Our work proves two results of the same kind, one for the alternation-fr…
▽ More
A landmark result in the study of logics for formal verification is Janin & Walukiewicz's theorem, stating that the modal $μ$-calculus ($μ\mathrm{ML}$) is equivalent modulo bisimilarity to standard monadic second-order logic (here abbreviated as $\mathrm{smso}$), over the class of labelled transition systems (LTSs for short). Our work proves two results of the same kind, one for the alternation-free fragment of $μ\mathrm{ML}$ ($μ_D\mathrm{ML}$) and one for weak $\mathrm{mso}$ ($\mathrm{wmso}$). Whereas it was known that $μ_D\mathrm{ML}$ and $\mathrm{wmso}$ are equivalent modulo bisimilarity on binary trees, our analysis shows that the picture radically changes once we reason over arbitrary LTSs. The first theorem that we prove is that, over LTSs, $μ_D\mathrm{ML}$ is equivalent modulo bisimilarity to noetherian $\mathrm{mso}$ ($\mathrm{nmso}$), a newly introduced variant of $\mathrm{smso}$ where second-order quantification ranges over "well-founded" subsets only. Our second theorem starts from $\mathrm{wmso}$, and proves it equivalent modulo bisimilarity to a fragment of $μ_D\mathrm{ML}$ defined by a notion of continuity. Analogously to Janin & Walukiewicz's result, our proofs are automata-theoretic in nature: as another contribution, we introduce classes of parity automata characterising the expressiveness of $\mathrm{wmso}$ and $\mathrm{nmso}$ (on tree models) and of $μ_C\mathrm{ML}$ and $μ_D\mathrm{ML}$ (for all transition systems).
△ Less
Submitted 10 September, 2018;
originally announced September 2018.
-
Model Theory of Monadic Predicate Logic with the Infinity Quantifier
Authors:
Facundo Carreiro,
Alessandro Facchini,
Yde Venema,
Fabio Zanasi
Abstract:
This paper establishes model-theoretic properties of $\mathrm{FOE}^{\infty}$, a variation of monadic first-order logic that features the generalised quantifier $\exists^\infty$ (`there are infinitely many').
We provide syntactically defined fragments of $\mathrm{FOE}^{\infty}$ characterising four different semantic properties of $\mathrm{FOE}^{\infty}$-sentences: (1) being monotone and (2) (Scot…
▽ More
This paper establishes model-theoretic properties of $\mathrm{FOE}^{\infty}$, a variation of monadic first-order logic that features the generalised quantifier $\exists^\infty$ (`there are infinitely many').
We provide syntactically defined fragments of $\mathrm{FOE}^{\infty}$ characterising four different semantic properties of $\mathrm{FOE}^{\infty}$-sentences: (1) being monotone and (2) (Scott) continuous in a given set of monadic predicates; (3) having truth preserved under taking submodels or (4) invariant under taking quotients. In each case, we produce an effectively defined map that translates an arbitrary sentence $\varphi$ to a sentence $\varphi^{p}$ belonging to the corresponding syntactic fragment, with the property that $\varphi$ is equivalent to $\varphi^{p}$ precisely when it has the associated semantic property.
Our methodology is first to provide these results in the simpler setting of monadic first-order logic with ($\mathrm{FOE}$) and without ($\mathrm{FO}$) equality, and then move to $\mathrm{FOE}^{\infty}$ by including the generalised quantifier $\exists^\infty$ into the picture.
As a corollary of our developments, we obtain that the four semantic properties above are decidable for $\mathrm{FOE}^{\infty}$-sentences. Moreover, our results are directly relevant to the characterisation of automata and expressiveness modulo bisimilirity for variants of monadic second-order logic. This application is developed in a companion paper.
△ Less
Submitted 10 September, 2018;
originally announced September 2018.
-
Equivalence checking for weak bi-Kleene algebra
Authors:
Tobias Kappé,
Paul Brunet,
Bas Luttik,
Alexandra Silva,
Fabio Zanasi
Abstract:
Pomset automata are an operational model of weak bi-Kleene algebra, which describes programs that can fork an execution into parallel threads, upon completion of which execution can join to resume as a single thread. We characterize a fragment of pomset automata that admits a decision procedure for language equivalence. Furthermore, we prove that this fragment corresponds precisely to series-ratio…
▽ More
Pomset automata are an operational model of weak bi-Kleene algebra, which describes programs that can fork an execution into parallel threads, upon completion of which execution can join to resume as a single thread. We characterize a fragment of pomset automata that admits a decision procedure for language equivalence. Furthermore, we prove that this fragment corresponds precisely to series-rational expressions, i.e., rational expressions with an additional operator for bounded parallelism. As a consequence, we obtain a new proof that equivalence of series-rational expressions is decidable.
△ Less
Submitted 11 August, 2021; v1 submitted 5 July, 2018;
originally announced July 2018.
-
Interacting Hopf Algebras: the theory of linear systems
Authors:
Fabio Zanasi
Abstract:
As first main contribution, this thesis characterises the PROP SVk of linear subspaces over a field k - an important domain of interpretation for circuit diagrams appearing in diverse research areas. We present by generators and equations the PROP IH of string diagrams whose free model is SVk. IH stands for interacting Hopf algebras: its equations arise by distributive laws between Hopf algebras,…
▽ More
As first main contribution, this thesis characterises the PROP SVk of linear subspaces over a field k - an important domain of interpretation for circuit diagrams appearing in diverse research areas. We present by generators and equations the PROP IH of string diagrams whose free model is SVk. IH stands for interacting Hopf algebras: its equations arise by distributive laws between Hopf algebras, which we obtain using Lack's technique for composing PROPs. The significance of the result is two-fold. First, it offers a canonical diagrammatic syntax for linear algebra: linear maps, kernels, subspaces, etc... are all faithfully represented in the graphical language. Second, the equations of IH describe familiar algebraic structures - Hopf algebras and Frobenius algebras - which are at the heart of graphical formalisms as seemingly diverse as quantum circuits, signal flow graphs, simple electrical circuits and Petri nets. Our characterisation enlightens the provenance of these axioms and reveals their linear algebraic nature. Our second main contribution is an application of IH to the semantics of signal processing circuits. We develop a formal theory of signal flow graphs, featuring a diagrammatic circuit syntax, a structural operational semantics and a denotational semantics. We prove completeness of the equations of IH for denotational equivalence. Also, we study full abstraction: it turns out that the purely operational picture is too concrete - two denotationally equal graphs may exhibit different operational behaviour. We classify the ways in which this can occur and show that any graph can be realised - rewritten, using the equations of IH, into an executable form where the operational behaviour and the denotation coincide. This realisability theorem suggests a reflection about the role of causality in the semantics of signal flow graphs and, more generally, of computing devices.
△ Less
Submitted 4 May, 2018;
originally announced May 2018.
-
The Logical Essentials of Bayesian Reasoning
Authors:
Bart Jacobs,
Fabio Zanasi
Abstract:
This chapter offers an accessible introduction to the channel-based approach to Bayesian probability theory. This framework rests on algebraic and logical foundations, inspired by the methodologies of programming language semantics. It offers a uniform, structured and expressive language for describing Bayesian phenomena in terms of familiar programming concepts, like channel, predicate transforma…
▽ More
This chapter offers an accessible introduction to the channel-based approach to Bayesian probability theory. This framework rests on algebraic and logical foundations, inspired by the methodologies of programming language semantics. It offers a uniform, structured and expressive language for describing Bayesian phenomena in terms of familiar programming concepts, like channel, predicate transformation and state transformation. The introduction also covers inference in Bayesian networks, which will be modelled by a suitable calculus of string diagrams.
△ Less
Submitted 27 April, 2018; v1 submitted 3 April, 2018;
originally announced April 2018.
-
Rewriting in Free Hypergraph Categories
Authors:
Fabio Zanasi
Abstract:
We study rewriting for equational theories in the context of symmetric monoidal categories where there is a separable Frobenius monoid on each object. These categories, also called hypergraph categories, are increasingly relevant: Frobenius structures recently appeared in cross-disciplinary applications, including the study of quantum processes, dynamical systems and natural language processing. I…
▽ More
We study rewriting for equational theories in the context of symmetric monoidal categories where there is a separable Frobenius monoid on each object. These categories, also called hypergraph categories, are increasingly relevant: Frobenius structures recently appeared in cross-disciplinary applications, including the study of quantum processes, dynamical systems and natural language processing. In this work we give a combinatorial characterisation of arrows of a free hypergraph category as cospans of labelled hypergraphs and establish a precise correspondence between rewriting modulo Frobenius structure on the one hand and double-pushout rewriting of hypergraphs on the other. This interpretation allows to use results on hypergraphs to ensure decidability of confluence for rewriting in a free hypergraph category. Our results generalise previous approaches where only categories generated by a single object (props) were considered.
△ Less
Submitted 3 January, 2018; v1 submitted 27 December, 2017;
originally announced December 2017.
-
Universal Constructions for (Co)Relations: categories, monoidal categories, and props
Authors:
Brendan Fong,
Fabio Zanasi
Abstract:
Calculi of string diagrams are increasingly used to present the syntax and algebraic structure of various families of circuits, including signal flow graphs, electrical circuits and quantum processes. In many such approaches, the semantic interpretation for diagrams is given in terms of relations or corelations (generalised equivalence relations) of some kind. In this paper we show how semantic ca…
▽ More
Calculi of string diagrams are increasingly used to present the syntax and algebraic structure of various families of circuits, including signal flow graphs, electrical circuits and quantum processes. In many such approaches, the semantic interpretation for diagrams is given in terms of relations or corelations (generalised equivalence relations) of some kind. In this paper we show how semantic categories of both relations and corelations can be characterised as colimits of simpler categories. This modular perspective is important as it simplifies the task of giving a complete axiomatisation for semantic equivalence of string diagrams. Moreover, our general result unifies various theorems that are independently found in literature and are relevant for program semantics, quantum computation and control theory.
△ Less
Submitted 31 August, 2018; v1 submitted 10 October, 2017;
originally announced October 2017.
-
Concurrent Kleene Algebra: Free Model and Completeness
Authors:
Tobias Kappé,
Paul Brunet,
Alexandra Silva,
Fabio Zanasi
Abstract:
Concurrent Kleene Algebra (CKA) was introduced by Hoare, Moeller, Struth and Wehrman in 2009 as a framework to reason about concurrent programs. We prove that the axioms for CKA with bounded parallelism are complete for the semantics proposed in the original paper; consequently, these semantics are the free model for this fragment. This result settles a conjecture of Hoare and collaborators. Moreo…
▽ More
Concurrent Kleene Algebra (CKA) was introduced by Hoare, Moeller, Struth and Wehrman in 2009 as a framework to reason about concurrent programs. We prove that the axioms for CKA with bounded parallelism are complete for the semantics proposed in the original paper; consequently, these semantics are the free model for this fragment. This result settles a conjecture of Hoare and collaborators. Moreover, the techniques developed along the way are reusable; in particular, they allow us to establish pomset automata as an operational model for CKA.
△ Less
Submitted 26 February, 2018; v1 submitted 8 October, 2017;
originally announced October 2017.
-
Brzozowski Goes Concurrent - A Kleene Theorem for Pomset Languages
Authors:
Tobias Kappé,
Paul Brunet,
Bas Luttik,
Alexandra Silva,
Fabio Zanasi
Abstract:
Concurrent Kleene Algebra (CKA) is a mathematical formalism to study programs that exhibit concurrent behaviour. As with previous extensions of Kleene Algebra, characterizing the free model is crucial in order to develop the foundations of the theory and potential applications. For CKA, this has been an open question for a few years and this paper makes an important step towards an answer. We pres…
▽ More
Concurrent Kleene Algebra (CKA) is a mathematical formalism to study programs that exhibit concurrent behaviour. As with previous extensions of Kleene Algebra, characterizing the free model is crucial in order to develop the foundations of the theory and potential applications. For CKA, this has been an open question for a few years and this paper makes an important step towards an answer. We present a new automaton model and a Kleene-like theorem that relates a relaxed version of CKA to series-parallel pomset languages, which are a natural candidate for the free model. There are two substantial differences with previous work: from expressions to automata, we use Brzozowski derivatives, which enable a direct construction of the automaton; from automata to expressions, we provide a syntactic characterization of the automata that denote valid CKA behaviours.
△ Less
Submitted 22 October, 2017; v1 submitted 24 April, 2017;
originally announced April 2017.
-
A Universal Construction for (Co)Relations
Authors:
Brendan Fong,
Fabio Zanasi
Abstract:
Calculi of string diagrams are increasingly used to present the syntax and algebraic structure of various families of circuits, including signal flow graphs, electrical circuits and quantum processes. In many such approaches, the semantic interpretation for diagrams is given in terms of relations or corelations (generalised equivalence relations) of some kind. In this paper we show how semantic ca…
▽ More
Calculi of string diagrams are increasingly used to present the syntax and algebraic structure of various families of circuits, including signal flow graphs, electrical circuits and quantum processes. In many such approaches, the semantic interpretation for diagrams is given in terms of relations or corelations (generalised equivalence relations) of some kind. In this paper we show how semantic categories of both relations and corelations can be characterised as colimits of simpler categories. This modular perspective is important as it simplifies the task of giving a complete axiomatisation for semantic equivalence of string diagrams. Moreover, our general result unifies various theorems that are independently found in literature, including the cases of linear corelations (relevant for the semantics of electrical circuits), of partial equivalence relations and of linear subspaces (semantics of signal flow graphs and of the phase-free ZX calculus).
△ Less
Submitted 26 May, 2017; v1 submitted 23 March, 2017;
originally announced March 2017.
-
Rewriting modulo symmetric monoidal structure
Authors:
Filippo Bonchi,
Fabio Gadducci,
Aleks Kissinger,
Pawel Sobocinski,
Fabio Zanasi
Abstract:
String diagrams are a powerful and intuitive graphical syntax for terms of symmetric monoidal categories (SMCs). They find many applications in computer science and are becoming increasingly relevant in other fields such as physics and control theory.
An important role in many such approaches is played by equational theories of diagrams, typically oriented and applied as rewrite rules. This pape…
▽ More
String diagrams are a powerful and intuitive graphical syntax for terms of symmetric monoidal categories (SMCs). They find many applications in computer science and are becoming increasingly relevant in other fields such as physics and control theory.
An important role in many such approaches is played by equational theories of diagrams, typically oriented and applied as rewrite rules. This paper lays a comprehensive foundation of this form of rewriting. We interpret diagrams combinatorially as typed hypergraphs and establish the precise correspondence between diagram rewriting modulo the laws of SMCs on the one hand and double pushout (DPO) rewriting of hypergraphs, subject to a soundness condition called convexity, on the other. This result rests on a more general characterisation theorem in which we show that typed hypergraph DPO rewriting amounts to diagram rewriting modulo the laws of SMCs with a chosen special Frobenius structure.
We illustrate our approach with a proof of termination for the theory of non-commutative bimonoids.
△ Less
Submitted 23 February, 2016; v1 submitted 22 February, 2016;
originally announced February 2016.
-
Bialgebraic Semantics for Logic Programming
Authors:
Filippo Bonchi,
Fabio Zanasi
Abstract:
Bialgebrae provide an abstract framework encompassing the semantics of different kinds of computational models. In this paper we propose a bialgebraic approach to the semantics of logic programming. Our methodology is to study logic programs as reactive systems and exploit abstract techniques developed in that setting. First we use saturation to model the operational semantics of logic programs a…
▽ More
Bialgebrae provide an abstract framework encompassing the semantics of different kinds of computational models. In this paper we propose a bialgebraic approach to the semantics of logic programming. Our methodology is to study logic programs as reactive systems and exploit abstract techniques developed in that setting. First we use saturation to model the operational semantics of logic programs as coalgebrae on presheaves. Then, we make explicit the underlying algebraic structure by using bialgebrae on presheaves. The resulting semantics turns out to be compositional with respect to conjunction and term substitution. Also, it encodes a parallel model of computation, whose soundness is guaranteed by a built-in notion of synchronisation between different threads.
△ Less
Submitted 27 March, 2015; v1 submitted 21 February, 2015;
originally announced February 2015.
-
Interacting Hopf Algebras
Authors:
Filippo Bonchi,
Pawel Sobocinski,
Fabio Zanasi
Abstract:
We introduce the theory IH of interacting Hopf algebras, parametrised over a principal ideal domain R. The axioms of IH are derived using Lack's approach to composing PROPs: they feature two Hopf algebra and two Frobenius algebra structures on four different monoid-comonoid pairs. This construction is instrumental in showing that IH is isomorphic to the PROP of linear relations (i.e. subspaces) ov…
▽ More
We introduce the theory IH of interacting Hopf algebras, parametrised over a principal ideal domain R. The axioms of IH are derived using Lack's approach to composing PROPs: they feature two Hopf algebra and two Frobenius algebra structures on four different monoid-comonoid pairs. This construction is instrumental in showing that IH is isomorphic to the PROP of linear relations (i.e. subspaces) over the field of fractions of R.
△ Less
Submitted 11 November, 2015; v1 submitted 27 March, 2014;
originally announced March 2014.
-
How to Kill Epsilons with a Dagger -- A Coalgebraic Take on Systems with Algebraic Label Structure
Authors:
Filippo Bonchi,
Stefan Milius,
Alexandra Silva,
Fabio Zanasi
Abstract:
We propose an abstract framework for modeling state-based systems with internal behavior as e.g. given by silent or $ε$-transitions. Our approach employs monads with a parametrized fixpoint operator $\dagger$ to give a semantics to those systems and implement a sound procedure of abstraction of the internal transitions, whose labels are seen as the unit of a free monoid. More broadly, our approach…
▽ More
We propose an abstract framework for modeling state-based systems with internal behavior as e.g. given by silent or $ε$-transitions. Our approach employs monads with a parametrized fixpoint operator $\dagger$ to give a semantics to those systems and implement a sound procedure of abstraction of the internal transitions, whose labels are seen as the unit of a free monoid. More broadly, our approach extends the standard coalgebraic framework for state-based systems by taking into account the algebraic structure of the labels of their transitions. This allows to consider a wide range of other examples, including Mazurkiewicz traces for concurrent systems.
△ Less
Submitted 1 March, 2014; v1 submitted 17 February, 2014;
originally announced February 2014.
-
Weak MSO: Automata and Expressiveness Modulo Bisimilarity
Authors:
Facundo Carreiro,
Alessandro Facchini,
Yde Venema,
Fabio Zanasi
Abstract:
We prove that the bisimulation-invariant fragment of weak monadic second-order logic (WMSO) is equivalent to the fragment of the modal $μ$-calculus where the application of the least fixpoint operator $μp.\varphi$ is restricted to formulas $\varphi$ that are continuous in $p$. Our proof is automata-theoretic in nature; in particular, we introduce a class of automata characterizing the expressive p…
▽ More
We prove that the bisimulation-invariant fragment of weak monadic second-order logic (WMSO) is equivalent to the fragment of the modal $μ$-calculus where the application of the least fixpoint operator $μp.\varphi$ is restricted to formulas $\varphi$ that are continuous in $p$. Our proof is automata-theoretic in nature; in particular, we introduce a class of automata characterizing the expressive power of WMSO over tree models of arbitrary branching degree. The transition map of these automata is defined in terms of a logic $\mathrm{FOE}_1^\infty$ that is the extension of first-order logic with a generalized quantifier $\exists^\infty$, where $\exists^\infty x. φ$ means that there are infinitely many objects satisfying $φ$. An important part of our work consists of a model-theoretic analysis of $\mathrm{FOE}_1^\infty$.
△ Less
Submitted 22 January, 2014; v1 submitted 17 January, 2014;
originally announced January 2014.