Concurrent Process Histories and Resource Transducers
Posted by Emily Riehl
guest post by Clémence Chanavat and Luke Morris
Let’s motivate this blog post by first formalizing what a resource theory is. Coecke et al. represent a resource theory in “A mathematical theory of resources” as a symmetric monoidal category (SMC), which is a familiar construction in applied category theory. Elegantly, each of the concepts used in defining a symmetric monoidal category has a simple physical intuition:
- Objects are resources
- Morphisms transform resources to other resources
- Composition is sequential transformation
- Tensoring is parallel transformation
- The unit is the “void resource”
Using the usual string diagram approach, we get diagrams representing resource transformations for free! We thus have a very expressive visual language for expressing resource transformations, and a familiar ACT formalization.
The most immediate shortcoming arises when we want to talk about concurrent processes. Although we can talk about “vertical” transformations forward in time, we want to now talk about “horizontal” transformations between parties, concurrently. As Nester puts it, we want resource “transducers”.
Taking a software engineer’s approach, let’s approach this problem by looking at what components we need to fill in and how we need to link them together. We have a way to encode process histories as SMCs already. We want:
- to find some way to formalize resource transducers, and
- to find some way to gather these together into a single mathematical object.
Let’s fill in #2 first. An ideal solution should be a familiar ACT construction, and should exhibit both “horizontal” and “vertical” notions of composition. A nice candidate is the single-object double category. A single-object double category has:
- A horizontal edge monoid
- A vertical edge monoid
- Cells with top and bottom boundaries from , and left and right boundaries from .
Now for #1. An ideal solution should be a familiar ACT construction, and should capture some notion of passing things/ polarity. We can introduce polarity by taking our resource theory, and making a copy of it for Alice and a copy for Bob. That is, for a resource theory , we take . To denote a series of exchanges, we can take the free monoid of . These exchanges should satisfy some simple constraints to accurately model resource transducers, which we will get into immediately:
The horizontal free cornering
Let be a resource theory. The horizontal free cornering is a way to introduce concurrency in our model. Any exchange will now involve a left (say Alice) and a right (say Bob) participant. The category has objects and , for , with interpretation that an element is the resource being sent from Alice to Bob, while is going from Bob to Alice. These exchanges happen in order, is first Alice giving to Bob, then Bob giving to Alice. A morphism in this category is a transducer, operated on the domain by Alice and on the codomain by Bob. For instance, consider the morphism:
To operate the transducer, Alice must supply water and will receive bread, while Bob must supply flour, receive dough, and finally supply bread. In this category, an isomorphism is to be though as an equivalent exchange, i.e. a sequence of event with the same end result. With this intuition in mind, we have the following expected results:
- , exchanging nothing is the same as doing nothing;
- and , it does not matter in which order Alice gives items to Bob, and vice versa;
- and , giving away a collection is giving away its components.
Moreover, there is a parametrized adjunction between giving to the left, and giving to the right, that is, for all , we have
The proof is by yanking, once we defined and , respectively by:
we can prove the triangular identities by yanking two times, as in:
On top of this duality, we have the fact that if we receive some resources before we are required to send any, then we can send some of the resources that we receive, however, if we must send the resource first, this is no longer possible. In short, we have a morphism that need not to be an isomorphism. This reflects some sort of causal structure of : sending and receiving do not commute, but sending and sending always do, as we saw in the point 2. above. Note that this asymmetry stem from the fact that Alice operates the transducers on the left and Bob on the right.
To conclude, we give hints on how to present axiomatically . We create a category by first freely adding objects and for each , and morphisms , , for each in . Then, we add structural morphisms, that are split in two groups:
The ones in the blue box correspond to the isomorphisms specified above, while the two in the orange box to the parametrized adjunctions . Once we have this free structure, we quotient by (a lot) of equations. To see them more easily, we give a graphical calculus:
and we specify interactions between all these morphisms. For instance, we require:
Let us take a specific example:
It means that
commutes, i.e. that given an exchange , the two ways of getting to the identity by either
- swapping , then annihilating and with the counit;
- or, swapping , then annihilating and with the counit,
give the same end result, hence should give an equality of morphisms in the category. Thus, this free monoidal category quotiented by all the relations can be shown to be isomorphic to .
Conclusion
We have seen how the Nester framework for resource transducers makes use of SMCs and single-object double categories. We then studied how the horizontal free cornering represents concurrency, and gave an axiomatic presentation of this construction. The next step taken by Nester in his latest paper “Protocol Choice and Iteration for the Free Cornering” is to extend the free cornering to support branching communication protocols and iterated communication protocols, by means of coproducts.