Petri Nets Based on Lawvere Theories
Jade Master

TL;DR
This paper introduces a generalized framework for Petri nets based on Lawvere theories, unifying various existing variants and providing a functorial, categorical semantics for these models.
Contribution
It defines $ ext{Q}$-nets as a generalization of Petri nets using Lawvere theories, establishing their functoriality and categorical semantics.
Findings
Unified framework for various Petri net variants
Functorial semantics for $ ext{Q}$-nets
Construction of semantics for multiple net types
Abstract
We give a definition of -net, a generalization of Petri nets based on a Lawvere theory , for which many existing variants of Petri nets are a special case. This definition is functorial with respect to change in Lawvere theory, and we exploit this to explore the relationships between different kinds of -nets. To justify our definition of -net, we construct a family of adjunctions for each Lawvere theory explicating the way in which -nets present free models of in . This gives a functorial description of the operational semantics for an arbitrary category of -nets. We show how this can be used to construct the semantics for Petri nets, pre-nets, integer nets, and elementary net systems.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Petri Nets Based on Lawvere Theories
Jade Master
Abstract
We give a definition of -net, a generalization of Petri nets based on a Lawvere theory , for which many existing variants of Petri nets are a special case. This definition is functorial with respect to change in Lawvere theory, and we exploit this to explore the relationships between different kinds of -nets. To justify our definition of -net, we construct a family of adjunctions for each Lawvere theory explicating the way in which -nets present free models of in Cat. This gives a functorial description of the operational semantics for an arbitrary category of -nets. We show how this can be used to construct the semantics for Petri nets, pre-nets, integer nets, and elementary net systems.
1 Introduction
Following the introduction of Petri nets in Carl Petri’s 1962 thesis [23], there has been an explosion of work on Petri nets. The bibliography hosted by Petri Nets World has over 8500 citations [22]. These papers include many variations of Petri nets which change both the structure of the nets and their semantics. In this work we help organize these definitions by putting some of the more popular variants under a common framework.
Petri nets can be thought of as commutative monoidal graphs: graphs whose edges have elements of a free commutative monoid as their source and target. In this paper we generalize this to graphs which are based in some other algebraic gadget — as long as that gadget comes from a Lawvere theory. Petri nets are given by a pair of functions from a set of transitions to the free commutative monoid on a set of places. For a Lawvere theory , a -net is a pair of functions from a set of transitions to a free model of in .
Many instances of this generalization are already studied. In 2000 Bruni, Meseguer, Montanari, and Sassone introduced pre-nets; a type of Petri net that has a free non-commutative monoid on its places [7]. The semantics of these showcase the individual token philosophy, which distinguishes between identical tokens and keeps track of causality within sequences of processes. In 2018, Herold and Genovese introduced integer nets, a type of Petri net which has a free abelian group of places [14] and are similar to lending nets introduced in [3]. These are useful for modeling credit in propositional contract logic [11]. The last example of -nets that we consider are elementary net systems [25]. These are Petri nets that can have a maximum of one token in each place. The above three examples give categories , , and of pre-nets, integer nets, and elementary net systems respectively. These are given by setting equal to the Lawvere theory of monoids, the Lawvere theory of abelian groups, and the Lawvere theory of semi-lattices in the definition of .
To elegantly illustrate the power of Petri nets, Messeguer and Montanari show that they present free monoidal categories [21]. The objects in these monoidal categories are given by the markings of our Petri net and the morphisms represent all possible firing sequences of the transitions in sequence and in parallel. In general, a description of the operational semantics of Petri nets consists of an adjunction between a category of Petri nets and a category of strictly commutative, strictly associative monoidal categories (see Definition 2.6). There are many ways to do this. In [6] the authors construct an adjunction from into a particular subcategory of , the category of commutative monoidal categories. Here we analyze and alter this adjunction to get an adjunction
[TABLE]
To justify our definition of -nets, we take a similar tack. We show that every -net presents a free model of the Lawvere theory in Cat by constructing an adjunction
[TABLE]
where is the category of models of in Cat. To turn a -net into a free model of in Cat, there are two steps which must be completed:
- •
the transitions of the -net must be freely closed under the operations of , and
- •
the transitions must be freely turned into a category by freely adding identities and composites.
Thus the adjunction is constructed as the composite of two smaller adjunctions corresponding to these steps. This adjunction defines an operational semantics for -nets. The objects and morphisms in the free -category on a -net represent all the possible firing sequences which can be built using composition and the operations and axioms of the Lawvere theory .
An outline of this paper is as follows:
- •
In Section 2 we review definitions for Petri nets and their categorical semantics.
- •
In Section 3 we define -nets, and we extend this definition to a functor from the category of Lawvere theories to . This allows us to explore various functors between different kinds of -nets. We also show that the category is complete and cocomplete.
- •
In Section 4 we construct a semantics functor for Petri nets as a two part composite. This serves as a blueprint for the more general construction.
- •
In Section 5 we prove the main theorem of this paper. For every Lawvere theory , there is an adjunction
[TABLE]
which gives the operational semantics of -nets.
- •
In Section 6 we show how our main theorem can give categorical descriptions of existing forms of semantics for various types of -nets. We show how to build the semantics of Petri nets, pre-nets, and integer nets using the individual and collective token philosophies. We also construct an operational semantics functor for elementary net systems.
- •
In Appendix A we give a brief introduction to Lawvere theories.
2 Petri Nets and Their Executions
Definition 2.1**.**
Let be the free commutative monoid functor, that is, the left adjoint of the functor that sends commutative monoids to their underlying sets and monoid homomorphisms to their underlying functions. Let
[TABLE]
be the free commutative monoid monad given by the composite .
For any set , is the set of formal finite linear combinations of elements of with natural number coefficients. The unit of is given by the natural inclusion of into , and for any function , is the unique monoid homomorphism that extends .
Definition 2.2**.**
We define a Petri net to be a pair of functions of the following form:
[TABLE]
We call the set of transitions, the set of places, the source function, and the target function.
Definition 2.3**.**
A Petri net morphism from the Petri net
\textstyle{T\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces}$$\scriptstyle{t}$$\scriptstyle{s}$$\textstyle{\mathbb{N}[S]} to the Petri net \textstyle{T^{\prime}\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces}$$\scriptstyle{t^{\prime}}$$\scriptstyle{s^{\prime}}$$\textstyle{\mathbb{N}[S^{\prime}]}
is a pair of functions such that the diagrams
[TABLE]
commute.
Definition 2.4**.**
Let be the category of Petri nets and Petri net morphisms, with composition defined by
[TABLE]
Our definition of Petri net morphism differs from the earlier definition used by Degano–Meseguer–Montanari [12] and Sassone [26, 27, 7]. The difference is that our definition requires that the homomorphism between free commutative monoids come from a function between the sets of places whereas the above references allow arbitrary commutative monoid homomorphisms. This difference of definition is present in our definition of the category of -nets as well. With this change, the categories and become complete and cocomplete as shown in Proposition 3.11.
Petri nets have a natural semantics which is described by the token game. This is a game where each place of a Petri net is equipped with a natural number of tokens. Players are then allowed to shuffle the tokens around in proportion given by their source and target. The token game is formalized by the notions of marking and firing.
Definition 2.5**.**
A marking of a Petri net P=\leavevmode\hbox to68.22pt{\vbox to25.78pt{\pgfpicture\makeatletter\hbox{\hskip 34.10933pt\lower-17.12357pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{\offinterlineskip{}{}{{{}}{{}}}{{{}}}{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-34.10933pt}{-8.65971pt}\pgfsys@invoke{ }\hbox{\vbox{\halign{\pgf@matrix@init@row\pgf@matrix@step@column{\pgf@matrix@startcell#\pgf@matrix@endcell}&#\pgf@matrix@padding&&\pgf@matrix@step@column{\pgf@matrix@startcell#\pgf@matrix@endcell}&#\pgf@matrix@padding\cr\hfil\hskip 7.92186pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-3.61632pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{T}} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}}}&\hskip 7.92186pt\hfil&\hfil\hskip 38.18745pt\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-9.88194pt}{0.0pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{\mathbb{N}[S]}} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}&\hskip 14.18748pt\hfil\cr}}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}{{{{}}}{{}}{{}}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {}{ {}{}{}}{}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{{{}{}}}{}{}{{{}{}}}\hbox{\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}}{}{{}}{}{{{{}}}{{{}}}}{{}}{{{}}{{}}}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}}{{{}}{{}}}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}}{}{{}}{}{{}} {}{}{}{}{{{}{}}}{}{{}}{}{}{}{{{}{}}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.39998pt}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{-18.06561pt}{-4.00694pt}\pgfsys@lineto{5.1344pt}{-4.00694pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{5.33438pt}{-4.00694pt}\pgfsys@invoke{ }\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-7.90625pt}{-1.65417pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{\scriptstyle{s}} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{ {}{}{}}{}{ {}{}{}}{}{ {}{}{}} {{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{}{}{{{}{}}}{}{}{{{}{}}}\hbox{\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}}{}{{}}{}{{{{}}}{{{}}}}{{}}{{{}}{{}}}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}}{{{}}{{}}}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{{}}{}{}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {{}}{}{{}}{}{{}} {}{}{}{}{{{}{}}}{}{{}}{}{}{}{{{}{}}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.39998pt}\pgfsys@invoke{ }{}{}{}{}{{}}{}{}{{}}\pgfsys@moveto{-18.06561pt}{-8.31248pt}\pgfsys@lineto{5.1344pt}{-8.31248pt}\pgfsys@stroke\pgfsys@invoke{ }{{}{{}}{}{}{{}}{{{}}}}{{}{{}}{}{}{{}}{{{}}{{{}}{\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{5.33438pt}{-8.31248pt}\pgfsys@invoke{ }\pgfsys@invoke{ \lxSVG@closescope }\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}{{}}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-7.52951pt}{-14.9708pt}\pgfsys@invoke{ }\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{\scriptstyle{t}} }}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{ {}{}{}}}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}} is an element , or equivalently, a function which is zero on all but a finite number of elements. A firing of is a tuple , where is a transition and and are markings of with and .
Firings can be chained together in sequence: for a firing and a firing we can define their composite as a tuple where is a formal symbol. Firings can also be performed in parallel: for two firings and there is a parallelization . This suggests that firings of a Petri net have the structure of a monoidal category. Meseguer and Montanari were the first to notice this and show how Petri nets can be turned into commutative monoidal categories [21].
Definition 2.6**.**
A commutative monoidal category is a commutative monoid object internal to Cat. Explicitly, a commutative monoidal category is a strict monoidal category , such that, for all objects , and morphisms , in
[TABLE]
Note that a commutative monoidal category is the same as a strict symmetric monoidal category where the symmetry isomorphisms are all identity morphisms. In fact, a commutative monoidal category is precisely a category where the objects and morphisms form commutative monoids and the structure maps are commutative monoid homomorphisms. A commutative monoidal category where the morphisms represent sequences of firings of a Petri net will be referred to as a semantics for . In this paper we characterize this semantics construction as an adjunction between the category of Petri nets and the following category.
Definition 2.7**.**
Let be the category whose objects are commutative monoidal categories and whose morphisms are strict monoidal functors.
Note that every monoidal functor between commutative monoidal categories is automatically a strict symmetric monoidal functor, so the adjective symmetric is not included in the above definition.
3 Q-Nets
Petri nets need not have a free commutative monoid of places, and this aspect can be generalized using Lawvere theories. A review of the basic definitions and properties of Lawvere theories can be found in the appendix. As in Definition A.4, let be the category of models of in ,
[TABLE]
be the adjunction generating free models of and let be the composite .
Definition 3.1**.**
Let be the category where
- •
objects are -nets, i.e. pairs of functions of the form
[TABLE]
- •
a morphism from the -net
\textstyle{T\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces}$$\scriptstyle{t}$$\scriptstyle{s}$$\textstyle{M_{\mathsf{Q}}S} to the -net \textstyle{T^{\prime}\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces}$$\scriptstyle{t^{\prime}}$$\scriptstyle{s^{\prime}}$$\textstyle{M_{\mathsf{Q}}S^{\prime}}
is a pair of functions such that the following diagrams commute:
[TABLE]
This definition is a construction. Let be as before and let be corresponding monad induced by a Lawvere theory . Every morphism of Lawvere theories induces a functor
[TABLE]
which composes every model of with . A left adjoint
[TABLE]
is given by the left Kan extension of each model along [10, 9]. Now, we have the following commutative diagram of functors
[TABLE]
all of which have left adjoints. Given this set of assumptions, there is a morphism of monads given by
[TABLE]
where is the unit of the adjunction . This can either be verified directly, or by using the adjoint triangle theorem [13]. In what follows we will use this morphism of monads to translate between different types of generalized -nets.
Definition 3.2**.**
Let
[TABLE]
be the functor which sends a Lawvere theory to the category and sends a morphism of Lawvere theories to the functor which sends a -net
[TABLE]
to the -net
[TABLE]
For a morphism of -nets , is . This is well-defined because of the naturality of .
Varying the Lawvere theory gives many known types of Petri nets.
Example 3.3**.**
Setting equal to , the Lawvere theory for commutative monoids, we obtain the category of Petri nets.
Definition 3.4**.**
Let denote the monad that the Lawvere theory induces via the correspondence in [19]. For a set , is given by the underlying set of the free monoid on . A pre-net is a pair of functions of the form
[TABLE]
A morphism of pre-nets from a pre-net to a pre-net is a pair of functions which preserves the source and target as in Definition 2.3. This defines a category .
Example 3.5**.**
If we take , the Lawvere theory of monoids, we get the category .
A description of can be found in the Appendix. has the same objects as the category introduced in Functorial Models for Petri Nets [7] but the morphisms are restricted as in Definition 2.3. Pre-nets are the same as tensor schemes introduced by Joyal and Street in ”The Geometry of Tensor Calculus I” [16]. The authors define a notion of free category on a tensor scheme and Bruni, Meseguer, Montanari, and Sassone construct an adjunction between pre-nets and a subcategory of the category of strict symmetric monoidal categories [7].
In Section 6.1 we construct a closely related adjunction
[TABLE]
which does not require the restriction to a subcategory of . Pre-nets are useful because after forming an appropriate quotient, the category for a pre-net is equivalent the category of strongly concatenable processes which can be performed on the net. This equivalence is important for realizing the individual token philosophy [7]. The individual token philosophy, as opposed to the collective token philosophy, gives identities to the individual tokens and keeps track of the causality in the executions of a Petri net.
Example 3.6**.**
In 2013 Bartoletti, Cimoli, and Pinna introduced lending Petri nets [3]. These are Petri nets where arcs can have a negative multiplicity and tokens can be borrowed in order to fire a transition. Lending nets are also equipped with a partial labeling of the places and transitions so they can be composed and are required to have no transitions which can be fired spontaneously. In 2018 Genovese and Herold introduced integer nets [14]. Let be the Lawvere theory of abelian groups. This Lawvere theory contains three generating operations
[TABLE]
representing the identies, inverses, and multiplication of an abelian group. These generating morphisms are required to satisfy the axioms of an abelian group; associativity, commutativity, and the existence of inverses and an identity. The category of integer nets, modulo a change in the definition of morphisms, can be obtained by taking in the definition of .
Definition 3.7**.**
Let be the free abelian group monad which for a set generates the free abelian group on the set . Note that is the monad induced by the Lawvere theory via the correspondence in [19]. An integer net is a pair of functions of the form
[TABLE]
A morphism of integer nets is a pair which makes the diagrams analogous to the definition of Petri net morphism (Definition 2.3) commute. Let be the category where objects are integer nets and morphism are morphisms of integer nets.
Integer nets are useful for modeling the concepts of credit and borrowing. There is a correspondence between lending Petri nets and propositional contract logic; a form of logic useful for ensuring that complex networks of contracts are honored [3]. Genovese and Herold constructed a categorical semantics for integer nets [14]. In Section 6 we will construct a variation of this semantics which uses the general framework developed in this paper.
Example 3.8**.**
Elementary net systems, introduced by Rozenberg and Thiagarajan in 1986, are are Petri nets with a maximum of one edge between a given place and transition [25].
Definition 3.9**.**
An elementary net system is a pair of functions
[TABLE]
where denotes the power set of .
Elementary net systems can be obtained from our general formalism. Let be the Lawvere theory for semi-lattices, i.e. commutative idempotent monoids. This Lawvere theory contains morphisms
[TABLE]
as in the theory of monoids. Also similar to , is quotiented by the associativity and unitality axioms given in Example A.2. In addition, has the following axioms representing commutativity and idempotence
[TABLE]
where is the braiding of the cartesian product and is the diagonal. For models in , The first diagram says that you can multiply two elements in either order and the get the same thing. The second diagram says that if you multiply an element by itself you get itself. As in Definition A.4, corresponds to a monad on . It is well known that this monad is the covariant power set monad
[TABLE]
which sends a set to its power set and a function to the mapping which sends subsets of to their image. This motivates the following:
Definition 3.10**.**
Let be the category of elementary net systems obtained as in Definition 3 for .
The functorial nature of Definition 3 can be exploited to generate functors between different categories of -nets. There is the diagram in Law
{\mathsf{SLAT}}$${\mathsf{CMON}}$${\mathsf{ABGRP}}$${\mathsf{MON}}$${\mathsf{GRP}}$$\scriptstyle{b}$$\scriptstyle{a}$$\scriptstyle{c}$$\scriptstyle{d}$$\scriptstyle{e}
where all the morphisms send their generating operations to their counterparts in the Lawvere theory of their codomain. These target Lawvere theories either have extra axioms or operations making the above functors not necessarily full or faithful:
- •
sends the morphism in to in to impose the idempotent law. All other other generating components are sent to their natural counterparts.
- •
and send every object and morphism to its natural analog. However, and have an extra operation representing inverses. This makes the functors and faithful but not full.
- •
and add the commutativity law; they send both the multiplication and the composite of the braiding to the multiplication map in the target Lawvere theory. This makes and not faithful.
Definition 3.2 can be used to give a network between different flavors of -nets. By applying to the above diagram we get the diagram of categories
{{\mathsf{SLAT}}\mathchar 45\relax\mathsf{Net}}$${\mathsf{Petri}}$${{\mathbb{Z}}\mathchar 45\relax\mathsf{Net}}$${\mathsf{PreNet}}$${{\mathsf{GRP}}\mathchar 45\relax\mathsf{Net}}$$\scriptstyle{{b}\mathchar 45\relax\mathsf{Net}}$$\scriptstyle{{a}\mathchar 45\relax\mathsf{Net}}$$\scriptstyle{{c}\mathchar 45\relax\mathsf{Net}}$$\scriptstyle{{d}\mathchar 45\relax\mathsf{Net}}$$\scriptstyle{{e}\mathchar 45\relax\mathsf{Net}}
The functors in this diagram are described as follows:
[TABLE]
is often called abelianization because it sends a pre-net to the Petri net which forgets about the ordering on the input and output of each transition. The authors of [7] use to explore the relationship between pre-nets and Petri nets. The functor gives the analogous relationship for integer nets.
[TABLE]
is the functor which does not change the source and target of a given place. The only difference is that the markings of a -net coming from a Petri net are thought of as elements of a free abelian group rather than a free abelian monoid. is the analogous functor for pre-nets.
[TABLE]
is the functor which sends a Petri net to the -net which forgets about the multiplicity of the edges between a given source and transition.
Before moving on to the semantics of -nets, we discuss a property of the category .
Proposition 3.11**.**
* is cocomplete.*
Proof.
We can construct as the comma category.
[TABLE]
where is the monad corresponding to the Lawvere theory , is the diagonal, and is the cartesian product in . An object in this category is a map
[TABLE]
which corresponds to a pair of maps which become the source and target maps of a -net. Morphisms in this comma category are commutative squares
[TABLE]
giving a map of -nets . The commutativity of the above square ensures that this map of -nets is well-defined.
Theorem 3, Section 5.2 of Computational Category Theory [24] says that given and then the comma category is cocomplete if
- •
is cocontinuous and,
- •
and are cocomplete,
Because is cocomplete and the identity functor preserves all colimits, we have that is cocomplete. Because is equivalent to this category, it is cocomplete as well. ∎
4 Generating Free Commutative Monoidal Categories From Petri Nets
In this section we examine in detail the motivating example for the main result of this paper, an adjunction generating the semantics of -nets for every Lawvere theory . This result can feel abstract on its own and the example of Petri nets provides invaluable intuition. A confident reader may skip this section, as it is not strictly necessary for the rest of this paper.
The operational semantics for Petri nets will take the form of an adjunction
[TABLE]
For a given Petri net , this adjunction will be constructed in two steps: first the transitions of will be freely closed under a commutative monoidal sum and then freely closed under composition. This will take the form of factoring the adjunction into the composite
[TABLE]
Here a left adjoint is indicated by a bullet on the left and a right adjoint is indicated by a bullet on the right. is the category of graphs internal to .
Definition 4.1**.**
A commutative monoidal graph is a graph
[TABLE]
where and are commutative monoids and and are commutative monoid homomorphisms. A morphism of commutative monoidal graphs is a tuple of commutative monoid homomorphisms making the diagrams
[TABLE]
commute. This defines a category where objects are commutative monoidal graphs and morphisms are as above. In short, is the category of graphs internal to .
We will now define these adjunctions but omit the proofs that they are indeed well-defined adjunctions, as this follows from the more general results of Section 5. The left adjoint is defined as follows:
Definition 4.2**.**
Let
[TABLE]
be the functor which sends a Petri net
[TABLE]
to the commutative monoidal graph
[TABLE]
where is the left adjoint of the adjunction in Definition 2.1 and is the natural isomorphism of that adjunction. sends a morphism of Petri nets
[TABLE]
to the morphism of commutative monoidal graphs given by
[TABLE]
In words, freely generates a commutative monoidal structure on the transitions of a Petri net and uniquely extends each component of a Petri net morphism to a commutative monoid homomorphism. The right adjoint of this functor is non-trivial:
Definition 4.3**.**
Let
[TABLE]
be the functor which sends a commutative monoidal graph
[TABLE]
to the Petri net
[TABLE]
is defined as
[TABLE]
where is the counit of the adjunction . and are given by the projection of onto its first and second coordinates respectively. sends a morphism of commutative monoidal graphs
[TABLE]
to the morphism of Petri nets
[TABLE]
where is the function which makes the assignment
[TABLE]
Remark 4.4**.**
Petri nets must have a free commutative monoid of places, so it is necessary to regard as the set of places for rather than having be the commutative monoid of places itself. The reader at this point may guess a simpler formula for the right adjoint which keeps the as the set of transitions and uses the unit of to construct the source and target maps. Unfortunately this construction is doomed to fail. For a commutative monoidal graph {E}$${V}$$\scriptstyle{s}$$\scriptstyle{t} , suppose that the right adjoint sends this graph to the Petri net
[TABLE]
A problem arises because this process unnaturally chunks the source and target of each transition. To see this consider the commutative monoidal graph
[TABLE]
The edge in can be depicted as
[TABLE]
With the above (faulty) description, is given by
[TABLE]
To avoid confusion, we denote the outer sum in by and the sum in by . Then, the faulty would turn into the transition
[TABLE]
To find a counit for this adjunction we seek a morphism
[TABLE]
A morphism of this sort is defined by its assignment on generators. A natural choice of morphism sends the places to the sum of the places and using the counit of . However, then the assignment of does not respect the source of and is therefore not a morphism of commutative monoidal graphs. The problem is that we want the source of in to be and not . To fix this we force the source of to be by upgrading to the tuple in . Now, the natural choice for the counit which sends to respects the source of .
The next part of the semantics adjunction for Petri nets freely generates the structure of a category on a given commutative monoidal graph. In Section 5 this is accomplished by rephrasing this construction in terms of free monoids. Here we provide an explicit description in the case of Petri nets.
Definition 4.5**.**
Let
[TABLE]
be the forgetful functor which sends a commutative monoidal category to its underlying commutative monoidal graph and a strict monoidal functor to its underlying morphism of commutative monoidal graphs. Then has a left adjoint
[TABLE]
which sends a commutative monoidal graph
[TABLE]
to the commutative monoidal category with objects given by and morphisms generated inductively by the rules:
- •
for every edge a morphism ,
- •
for every pair of morphisms and , a morphism ,
- •
for every object a morphism
This defines an evident composition operation on . There is also a sum on the defined using the sum of on objects. If and are edges of then the morphisms and already have a sum given by
[TABLE]
The morphisms of are quotiented by the axioms:
- •
for all tuples of morphisms
[TABLE]
- •
for all morphisms
[TABLE]
- •
We require that composition is a commutative monoid homomorphism. For tuples of morphisms we can form their sum and composite in two different ways. We quotient the morphisms of so that these are equal, i.e.
[TABLE]
- •
We require that the assignment of identities is a commutative monoid homomorphism. For objects and in we set
[TABLE]
5 Semantics Functors for Generalized Nets
In this section we construct semantics categories for -nets; categories whose morphisms represent possible sequences of firings which can be performed using a given -net. Let be a Lawvere theory and let
[TABLE]
be the adjunction it induces on . In this section we will use this adjunction to construct an adjunction
[TABLE]
which is analogous to the adjunction in Section 4 and where is the category of models of in Cat. This adjunction factors as
[TABLE]
where freely generates a model of on the transitions of a given -Net and freely generates the structure of a category on a given -graph.
These adjunctions are heavily motivated by the case when as this gives Petri nets. The main result of this paper is as follows:
Theorem 5.1**.**
There is an adjunction
[TABLE]
The left adjoint can be described using inference rules. Let be the -net
[TABLE]
The objects of are given by . That is, for every morphism in and every tuple of places there is an object . For an equation of morphisms in
{n}$${m}$${k}$$\scriptstyle{f}$$\scriptstyle{h}$$\scriptstyle{g}
the objects generated by each path must be equal. This means that there are equations of objects
[TABLE]
where the unlabeled index runs over the components of and the index runs over the components of and . The morphisms of are generated inductively by the rules
[TABLE]
[TABLE]
and is quotiented to satisfy the following:
- •
The morphisms must satisfy the same equations that the objects satisfy. That is, for an equation of morphisms in , the objects generated by each path must again be equal.
- •
is quotiented to satisfy the axioms of a category including the associative and unital laws
[TABLE]
for all morphisms , and in .
- •
is quotiented so that the structure maps of a category (source, target, identity and composition) are -model homomorphisms.
For a morphism of -nets, , the -functor
[TABLE]
is the unique extension of and which respects composition, unitality, and the operations of . The proof will require several lemmas.
The first step is to construct an adjunction which freely closes the transitions of a -net under the operations of . In this adjunction we will write the monad as and make use of the natural isomorphism
[TABLE]
for all sets and objects in .
Definition 5.2**.**
Let
[TABLE]
be the functor which makes the assignment
[TABLE]
on objects and morphisms.
Lemma 5.3**.**
* is well-defined.*
The next few proofs will make heavy use of the naturality equations for and its inverse:
[TABLE]
and
[TABLE]
Proof.
First we show that commutes with the source of . This follows from the chain of equalities:
[TABLE]
A similar equation holds for the target maps. ∎
Let be the -graph
[TABLE]
Because is not a free model of , there is no obvious forgetful way to turn this into a -net. A first guess for the -net might be the -net
[TABLE]
where is the unit of the monad applied to the set . However, as explained in Remark 4.4, this fails to be a right adjoint. An alternative approach was suggested by Mike Shulman in the comments of an nCafé blog post [20]. This solution was inspired by the construction of the free category on a tensor scheme introduced in The Geometry of Tensor Calculus I [16]. Instead of using as the set of transitions, we use
[TABLE]
where is the component of the counit for . Here and in what follows we are using to denote and to denote for notational simplicity. The source and target maps of the resulting -net are given by the projections of onto its second and third coordinates. The set can be described formally using pullbacks.
Definition 5.4**.**
Let
[TABLE]
be the functor which makes the assignment on objects and morphisms
[TABLE]
where
- •
is the pullback of sets
[TABLE]
where denotes the pairing of and , and denotes the cartesian product of the counits.
- •
is the composite
[TABLE]
and is the composite
[TABLE]
that is the maps which send an element of to its second and third coordinates.
- •
is induced by the universal property of as shown below
[TABLE]
More simply, makes the assignment
[TABLE]
Lemma 5.5**.**
* is well-defined.*
Proof.
We must show that is a well-defined morphism of -nets. and commute with the source and target maps. Indeed, using the elementary descriptions we get that
[TABLE]
A similar equation holds for the target maps. commutes with the identity maps:
[TABLE]
where the last two steps follow from naturality of and being a morphism of -graphs. ∎
Lemma 5.6**.**
* is a right adjoint to .*
Proof.
Let be the -net
[TABLE]
and be the -graph
[TABLE]
We define a natural isomorphism
[TABLE]
by the rule
[TABLE]
is defined by the universal property induced by and the diagram
[TABLE]
This diagram is well defined because is a competitor to the pullback i.e. it makes the lowest triangle commute. Checking this amounts to showing that the bottom square commutes and this can be verified componentwise:
[TABLE]
and similar equations hold for the target maps. Therefore, is well defined. Explicitly is the map which makes the assignment on transitions in
[TABLE]
is a well-defined morphism of -graphs by construction. The source and target functions map elements to their second and third coordinates so the equation
[TABLE]
is true.
An inverse to ,
[TABLE]
is defined as follows
[TABLE]
is defined by the universal property of and the diagram
[TABLE]
To show that is a well defined morphism of -graphs we perform the computation:
[TABLE]
where is the projection and the last two steps follow from the definition of and commutativity of the above diagram. This can be reduced using the fact that commutes with the source and target of and and naturality of . Indeed,
[TABLE]
A similar equation holds for target so this is a well-defined morphism of -graphs. is a natural isomorphism if it is a natural and a bijection in the places component and the transitions component. The places component is only an application of so it is both natural and a bijection. For the transition component let be the diagram
[TABLE]
where is the walking cospan. Let be the constant diagram which sends every object to and every morphism to . Then the universal property of can be expressed as the natural isomorphism
[TABLE]
where denotes the set of natural transformations from to . With this description, the transition component of can be described as follows
[TABLE]
where the angle brackets encase the components of a natural transformation. Similarly, the transition component of can be described as
[TABLE]
where the subscript indicates that we take the component of the natural transformation. With this description, we can verify that they are inverses on the transition component.
[TABLE]
and the other direction
[TABLE]
The transition component of and are natural because they are made up of components which are individually natural transformations. ∎
The next step in the proof of Theorem 5.1, is to construct an adjunction between and . A general property of algebraic theories and is the property that models of in the category of models of are the same as models of in the category of models of . In particular for a Lawvere theory , a model of in Cat is the same as a category internal to and this extends to an equivalence of categories
[TABLE]
Therefore, the adjunction we seek is between the categories and i.e. a construction of free categories internal to . The free category construction in this generality was first given in [5]. However, to build this adjunction we use a Theorem of Lack [17].
Theorem 5.7**.**
[Lack]* Let be a monoidal category with*
- •
finite limits,
- •
countable colimits and,
- •
the functors and preserve reflexive coequalizers and colimits of countable chains.
Then admits a free monoid construction, that is, a left adjoint to the forgetful functor
[TABLE]
which sends every monoid to its underlying object of .
By choosing an appropriate monoidal category we can use this construction to get free categories in . A span of -models of the form
[TABLE]
is a graph in . This description can be used to describe a monoidal category of graphs over .
Definition 5.8**.**
Let be the monoidal category where
- •
objects are given by spans in ,
- •
morphisms are given by maps making the diagram
[TABLE]
commute.
- •
monoidal product is given by chosen pullbacks. That is, for spans
[TABLE]
their monoidal product is the chosen pullback
[TABLE]
On morphisms and is the unique map
[TABLE]
induced by the universal property of .
A monoid in this monoidal category is a span along with multiplication and unit maps
[TABLE]
satisfying associativity and unitality. Interpreting as composition and as the map assigning identity morphisms, this gives a category internal to . Indeed, a category with object model is exactly a monoid in the category [4]. Therefore, if satisfies the hypotheses of Theorem 5.7, it gives a construction of free categories in . The hypotheses of Theorem 5.7 require that the following conditions hold:
- •
has finite limits and countable colimits. has these limits and colimits as shown in Theorem 3.4.5 of [8]. The corresponding limits and colimits in are computed on the apex of each span.
- •
The monoidal product of preserves colimits of countable chains. This is true if pullbacks in preserve these colimits.
- •
The monoidal product of preserves reflexive coequalizers. This is true if pullbacks in preserve reflexive coequalizers.
Corollary 3.4.3 of [8] states that finite limits commute with filtered colimits. In particular this means that pullbacks commute with colimits of countable chains and reflexive coequalizers. Therefore, Theorem 5.7 gives an adjunction
[TABLE]
However, we would like an adjunction between the category of all graphs and categories in . To accomplish this, we use the Grothendieck construction [8].
Definition 5.9**.**
Let
[TABLE]
be the functor which sends an object to the category of spans over . For a morphism in , let
[TABLE]
be the functor which makes the assignment
[TABLE]
on objects and morphisms. Let
[TABLE]
be the functor which sends an object to the category of small categories internal to with object model of given by . For a morphism , let
[TABLE]
be the functor which which makes the assignment
[TABLE]
on the underlying graphs of objects and morphisms.
The adjunction derived from Theorem 5.7 can be reframed in this context.
Proposition 5.10**.**
The family of adjunctions
[TABLE]
form components of natural transformations
[TABLE]
Furthermore, and form an adjoint pair in the 2-category where
- •
objects are functors ,
- •
morphisms are natural transformations whose components are functors and,
- •
2-morphisms are modifications . That is, for every object in a natural transformation of the type
[TABLE]
Proof.
For naturality, it suffices to show that the squares
[TABLE]
commute. This is verified by direct computation. To show that and are an adjoint pair we need the following fact: is a left adjoint to in if and only if the components
[TABLE]
form an adjoint pair in Cat. The counit-unit definition of adjunction requires that we have modifications and satisfying the snake equations. Unpacking this gives components and satisfying the snake equations. This is equivalent to each component being an adjunction. However, Theorem 5.7 says that each component is an adjunction so the claim is shown. ∎
So far we have the diagram
[TABLE]
of adjoint 1-cells in . We apply the Grothendieck construction to this diagram to get
[TABLE]
The Grothendieck construction is a 2-functor where denotes the 2-category of large categories, functors, and natural transformations. When composed with the forgetful 2-functor which remembers only the domain of each functor, we obtain the composite
[TABLE]
which we denote as in an abuse of notation.
A fundamental fact is that every 2-functor preserves adjunctions. Therefore the above diagram is an adjunction. Moreover, the following proposition shows that it is the adjunction we are looking for.
Proposition 5.11**.**
The category is equivalent to and the category is equivalent to .
Proof.
has
- •
pairs as objects and,
- •
pairs such that the diagram
[TABLE]
in commutes as morphisms.
An equivalence sends to the graph {E}$${V}
and a morphism to the evident morphism of graphs .
has
- •
pairs where is a category over as objects and,
- •
pairs where is an object fixing functor from to as morphisms.
An equivalence is given by sending objects to their second component and morphisms to the functor whose object component is and whose morphism component is the morphism component of . ∎
We denote the compositions of and with the above equivalences by and respectively.
Proof of Theorem 5.1. The composite adjunction is constructed by setting and . ∎
6 Applications
Theorem 5.1 has many applications: it can be used to help understand existing constructions of semantics for various -nets from a categorical perspective.
6.1 Semantics for Pre-nets
In [7] the authors construct an adjunction for pre-nets which highlights the individual token semantics. In this subsection we characterize a variation of this adjunction using Theorem 5.1. Theorem 5.1 gives the following adjunction for pre-nets:
Proposition 6.1**.**
Let be the underlying set functor and let be its left adjoint. Recall that the composite is denoted by . Let be the category of strict monoidal categories and strict monoidal functors. Let
[TABLE]
be the functor which makes the assignment on objects and morphisms
[TABLE]
where and the source and target maps are as defined in Definition 5.4. Then, has a left adjoint
[TABLE]
which sends a pre-net
[TABLE]
to the strict monoidal category where
- •
the objects are given by the free monoid and,
- •
morphisms are defined inductively as the closure of under composition , and monoidal product . This is quotiented by the axioms
- –
* (the associative law)*
- –
* (the left and right unit laws)*
- –
* whenever all composites are defined (the interchange law).*
For a morphism of pre-nets , has object component given by and a morphism component given by the unique composition preserving monoid homomorphism extending .
Under the individual token philosophy, monoidal categories are not yet a sufficient semantics for pre-nets. This is because in the individual token philosophy, the order of tokens going in and out of a Petri net must be accounted for. To represent this ordering, we can freely add a swapping morphism
[TABLE]
for every pair of objects and in . Every morphism in this new category, can now be regarded as having some permutation of the multisets in its inputs and outputs composed on either side. After choosing an initial ordering on your tokens, these permutations give an order in which tokens flow in and out of each process. Strict monoidal categories equipped with coherent swapping morphisms are called strict symmetric monoidal categories and there is a category where they are objects.
Definition 6.2**.**
Let be the category where
- •
objects are strict symmetric monoidal categories and,
- •
morphisms are strict symmetric monoidal functors.
Symmetries can be freely added to the category and this process is a left adjoint.
Definition 6.3**.**
Let
[TABLE]
be the forgetful functor which regards every symmetric strict monoidal category as a strict monoidal category and every strict symmetric monoidal functor as a strict monoidal functor.
Proposition 6.4**.**
* has a left adjoint.*
Proof.
Note that because everything here is strict, the construction of the adjunction between and is a simpler task than constructing an adjunction between their non-strict counterparts. To find a left adjoint to the forgetful functor from symmetric monoidal categories to monoidal categories, the tools of 2-dimensional category theory must be used. On the other hand, due to their strictness, the categories and can be characterized as the category of models for a finite limits theory [2, §3D]. To construct these finite limit theories, we start with : the well-known finite limit theory for categories. has two sorts: for morphisms and for objects. The generating operations of are
[TABLE]
which represent source, target, identity, and composition. These operations are quotiented to satisfy the operations of a category. To get , the theory of strict monoidal categories, we add the operations constituting the structure of a monoid on both the objects and the morphisms. These operations have types , , , and representing the identity and multiplications of each monoid. These operations are quotiented to satisfy equations expressing the monoid axioms and compatibility with the operations already in .
can be further upgraded to obtain , the finite limit theory for strict symmetric monoidal categories. contains all the generating objects and morphisms of in addition to a braiding operation with type . This braiding is required to satisfy the typical axioms of a symmetric monoidal category. Furthermore, there is an inclusion which sends every sort and operation of to the sort and operation in which plays the same role. In summary, there is a morphism of finite limit theories
[TABLE]
Gabriel–Ulmer duality [15, 1] establishes an equivalence between this sort of morphism and filtered colimit preserving right adjoints
[TABLE]
This right adjoint is the functor in Definition 6.3. ∎
To get the individual token semantics for pre-nets, first we freely close the transitions under composition and monoidal product using Theorem 5.1 then we freely add symmetries as shown above.
{\mathsf{PreNet}}$${\mathsf{MC}}$${\mathsf{SMC}}$$\scriptstyle{F_{\mathsf{MON}}}$$\scriptstyle{U_{\mathsf{MON}}}$$\scriptstyle{N}$$\scriptstyle{M}
This composite adjunction is the adjunction mentioned in Example 3.5. This doesn’t yet represent the standard individual token semantics for pre-nets. Let
[TABLE]
be a morphism in for a pre-net . Then, composing with a permutation
[TABLE]
should only represent a new process if . This point could be argued, but the idea is that permuting different places has no functional difference because it requires the same inputs and outputs. Therefore, to get a category which is equivalent to the category of strongly concatenable processes introduced in [26] we must quotient by requiring that
[TABLE]
commutes for every transition and permutations and . The key point here is that the permutations are from an element to itself. This only occurs when the permutation switches objects which are the same.
The difference between the adjunction and the adjunction introduced in Functorial Models for Petri Nets has to do with a change in definition of the morphisms in the category . We require that the places component come from a function between the sets of places whereas the authors of [7] do not. This change is made so that the category admits a smoother description of its semantics.
For practical purposes, it useful to construct semantics for Petri nets rather than pre-nets which have the individual token philosophy. For this we use the functor
[TABLE]
introduced in Section 3 which sends every pre-net to the Petri net which forgets about the ordering on the input and output of each transtion.
In [7] the authors suggest that an individual token semantics for a Petri net can computed by choosing a linearization of ; a pre-net in the preimage . Then, the semantics category is defined to be the individual token semantics of . Note that this process depends on a choice of linearization only up to isomorphism. Let and be linearizations of , then Theorem 2.5 of [7] proves that .
Choosing a linearization and then applying gives an individual token semantics for Petri nets but it is unclear about how to extend this to morphisms of Petri nets. For a functorial construction, we can try to reverse the functor in the diagram:
{\mathsf{Petri}}$${\mathsf{PreNet}}$${\mathsf{MC}}$${\mathsf{SMC}}$$\scriptstyle{{c}\mathchar 45\relax\mathsf{Net}}$$\scriptstyle{F_{\mathsf{MON}}}$$\scriptstyle{N}
An inverse to cannot be single valued because there are many linearizations of a given Petri net. For given transition of a Petri net, there are many possible orderings of is source and target. To avoid making a choice, you can make them all. Let be a Petri net and let be the set of linearizations of , that is the set . Let be the pre-net given by
[TABLE]
where and denote the copairing of the functions and respectively. Then, the mapping
[TABLE]
characterizes the category introduced by Sassone in On the Category of Petri Net Computations [26]. Unfortunately, Sassone showed that this at first only gives a pseudofunctor [26]. This is because there is no obvious way to turn a morphism of Petri nets into a functor between the fibers of their source and target. However Sassone showed that after performing the appropriate quotient on the target category this mapping can be turned into a functor and a left adjoint [26].
6.2 Semantics for Integer Nets
In Executions in (Semi-)Integer Petri Nets are Compact Closed Categories, Genovese and Herold show how compact closed symmetric monoidal categories give a categorical semantics for integer nets [14]. Note that these categories are strictly compact closed but not strictly symmetric, i.e., the braidings are not given by the identity. To get an operational semantics for integer nets where the braidings are given by the identity we can use Theorem 5.1. This adjunction gives for each integer net a description of its semantics under the collective token philosophy; the morphisms represent the possible executions of an integer net but do not keep track of the identities of the individual tokens.
Proposition 6.5**.**
Let
[TABLE]
be the adjunction making up the free abelian group monad in Definition 3.4. Then there is a left adjoint
[TABLE]
which sends a -net
[TABLE]
to the -category which has
- •
* as its free abelian group of objects and,*
- •
morphisms are given by the free closure of T under composition and identity, modulo the axioms of a category, and under monoidal product and inverses, modulo the axioms of an abelian group. We also require that the structure maps are abelian group homomorphisms.
For a morphism of -nets , is a morphism of -categories which is
- •
given by on objects and,
- •
and morphisms it is given by the unique extension of which respects the abelian group operation and composition.
If we wish to construct semantics for integer nets under the individual token philosophy we need our semantics categories to have braidings which are not given by identities. This can accomplished using a similar construction as the previous subsection. Indeed we have a diagram of categories as follows:
{{\mathbb{Z}}\mathchar 45\relax\mathsf{Net}}$${{\mathsf{GRP}}\mathchar 45\relax\mathsf{Net}}$${\mathsf{Mod}(\mathsf{GRP},\textup{{Cat}})}SCCC\scriptstyle{{e}\mathchar 45\relax\mathsf{Net}}$$\scriptstyle{F_{\mathsf{GRP}}}$$\scriptstyle{W}
The features of this diagram are as follows.
- •
is abelianization. It sends a -net to the integer net which forgets about the ordering on the input and output of each transition. sends morphisms of -nets to themselves.
- •
The functor is constructed using Theorem 5.1. This functor freely closes the transitions of a -net under the group operation, composition, and freely adds inverses and identites. These semantics categories are required to satisfy the axioms of a group and a category. The structure maps of these are categories are required to be group homomorphisms. This functor will not be explicitly described in this paper but it can be constructed using Theorem 5.1.
- •
SCCC is the category where
- –
An object is a strictly monoidal strictly compact closed category. This means that for every object in and in there are inverses with
[TABLE]
In addition, every pair of objects is equipped with a symmetry satisfying the axioms of a symmetric monoidal category.
- –
Morphisms in SCCC are strict symmetric monoidal functors. Preservation of inverses follows from being a strict monoidal functor.
- •
is a left adjoint of an adjunction which freely adds a symmetric braiding for every pair of objects. This adjunction is described as follows. The proof of this proposition follows the same argument as Proposition 6.4.
Proposition 6.6**.**
Let be the forgetful functor which sends objects and morphisms of SCCC to their underlying -categories and -functors. Then has a left adjoint
[TABLE]
which is specified by the following:
- •
for a -category , is a symmetric monoidal category such that for every pair of objects , in there is an isomorphism satisfiying the axioms of a symmetry in a symmetric monoidal category.
- •
for a -functor , is a the unique extension of which sends symmetries to symmetries.
In order to get individual token semantics for an integer net we can start with a -net which abelianizes to . This is also called a linearization of . The individual token semantics of can be defined as . To get a systematic mapping from integer nets to their individual token semantics we can combine all the linearizations of a given integer net. Let be the set of linearizations of , that is the set . Let be the -net given by
[TABLE]
where and denote the copairing of the functions and respectively. The mapping
[TABLE]
characterizes the category introduced in [14]. Like before, this assignment extends to a pseudofunctor rather than a functor. Analogously to the situation for Petri nets, Genovese and Herold prove that after performing some quotients on the target category this turns into a functor and a left adjoint [14].
6.3 Semantics for Elementary Net Systems
Theorem 5.1 can be used to construct a functorial description of the semantics of elementary net systems. This semantics matches the standard description which has not yet been made categorical. For an elementary net system , is a category where the objects are possible markings of and the morphisms are finite sequences of firings.
Proposition 6.7**.**
Let
[TABLE]
*be the adjunction whose associated monad is . Then there is a left adjoint *
[TABLE]
which sends an elementary net system
[TABLE]
to the -category with objects given by and with morphisms generated inductively by the rules:
- •
for every transition , a morphism is included,
- •
for every pair of morphisms and , their sum is included,
- •
for every pair of morphisms, and , their composite is included,
- •
these morphisms are quotiented to satisfy the axioms of an idempotent commutative monoid and of a category
- •
these morphisms are quotiented to make composition and the assignment of identities to be monoid homomorphisms.
For a morphism of -nets ,
[TABLE]
is the functor given by on objects and by the unique monoidal and functorial extension of on morphisms.
Acknowledgements
I would like to thank my advisor John Baez for his constant help and guidance. I would like to thank Christina Vasilokopoulou in particular for the slick proof of Proposition 3.11. I would like to thank Clemens Berger and Mike Schulman for helping me understand how morphisms of Lawvere theories turn into morphisms of monads. I would also like to thank Mike Shulman and Todd Trimble who found a mistake in an earlier draft and helped me fix it in a way which improved the paper. I thank Joe Moeller, Daniel Cicala, Kenny Courser, and Joshua Meyers for their feedback and support. Lastly, I would like to thank my friends and family for their love and support, I would not be where I am without them.
Appendix A Lawvere Theories
Introduced by Lawvere in his landmark thesis [18], Lawvere theories are a general framework for reasoning about algebraic structures [10, 9].
Definition A.1**.**
A Lawvere theory is a small category with finite products such that every object is isomorphic to the iterated finite product for a generic object and natural number . Equivalently, Lawvere theories can be thought of as categories whose objects are given by natural numbers and with cartesian product given by . The morphisms in a Lawvere theory are called operations.
The idea is that a Lawvere theory represents the platonic embodiment of an algebraic gadget.
Example A.2**.**
A canonical example is the Lawvere theory of monoids. Like all Lawvere theories, the objects of are given by natural numbers. In addition contains the morphisms
[TABLE]
For a monoid , this represents the multiplication map
[TABLE]
and the map
[TABLE]
which picks out the identity element of . These maps are required to satisfy the associative law
[TABLE]
and the unital laws for monoids.
[TABLE]
also contains all composites, tensor products, and maps necessary to make into the product induced by the maps and .
Like all good things, Lawvere theories form a category.
Definition A.3**.**
Let Law be the category where objects are Lawvere theories and morphisms are product preserving functors.
Note that because morphisms of Lawvere theories preserve products, they must send the generic object of their source to the generic object of their target. Therefore to specify a morphism of Lawvere theories, it suffices to make an assignment of the morphisms which are not part of the product structure.
Let be a Lawvere theory and a category with finite products. We can impose the axioms and operations of onto an object in via a product preserving functor . The image of the generating object gives the underlying object of and for an operation in , gives a specific instance of the algebraic operation represented by . There is a natural way to make a category of these functors.
Definition A.4**.**
Let be a Lawvere theory and a category with finite products. Then there is a category where
- •
objects are product preserving functors and,
- •
morphisms are natural transformations between these functors.
When is written without the second argument, it is assumed to be . We will refer to objects in as -models and morphisms in as -model homomorphisms. When , we will refer to these objects as -categories.
When the category of models is then there is a forgetful functor
[TABLE]
which sends a product preserving functor to image on the generating object and a natural transformation to component on the object . A classical result says that always has a left adjoint
[TABLE]
which for a set , is referred to as the free model of on . In fact, this construction extends to fully faithful functor
[TABLE]
which sends a Lawvere theory to the monad and where is the category of monads on [19]. For a Lawvere theory we will denote the monad it induces via this functor by .
For , is equivalent to the category Mon of monoids and monoid homomorphisms. In this case the functor turns monoids and monoid homomorphisms into their underlying sets and functions. has a left adjoint
[TABLE]
which sends a set to the free monoid . For a function , is the unique multiplication preserving extension of to .
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1AP [98] Jiří Adámek and Hans-E. Porst. Algebraic theories of quasivarieties. Journal of Algebra , 208(2):379–398, 1998. Available at http://www.math.uni-bremen.de/~porst/dvis/Alg Theocorr.pdf .
- 2AR [94] Jiří Adámek and Jiří Rosický. Locally Presentable and Accessible Categories . Cambridge University Press, 1994.
- 3BCP [15] Massimo Bartoletti, Tiziana Cimoli, and G. Michele Pinna. Lending Petri nets. Science of Computer Programming , 112:75–101, 2015. Available at https://www.sciencedirect.com/science/article/pii/S 0167642315001021 .
- 4Bet [96] Renato Betti. Formal theory of internal categories. Le Matematiche , 51(3):35–52, 1996. Available at https://lematematiche.dmi.unict.it/index.php/lematematiche/article/view/456 .
- 5BJT [97] Hans-Joachim Baues, Mamuka Jibladze, and Andy Tonks. Cohomology of monoids in monoidal categories. Contemporary Mathematics , 202:137–166, 1997.
- 6BM [20] John C. Baez and Jade Master. Open Petri nets. Mathematical Structures in Computer Science , 30(3):314–341, 2020. Available at http://dx.doi.org/10.1017/S 0960129520000043 . · doi ↗
- 7BMMS [01] Roberto Bruni, José Meseguer, Ugo Montanari, and Vladimiro Sassone. Functorial models for Petri nets. Information and Computation , 170(2):207–236, 2001.
- 8Bor [94] Francis Borceux. Handbook of Categorical Algebra: Volume 2, Categories and Structures . Cambridge University Press, 1994.
