Skip to main content
Springer Nature - PMC COVID-19 Collection logoLink to Springer Nature - PMC COVID-19 Collection
. 2020 May 31;12150:57–74. doi: 10.1007/978-3-030-51372-6_4

A Categorical Semantics for Guarded Petri Nets

Fabrizio Genovese 10,, David I Spivak 11
Editors: Fabio Gadducci8, Timo Kehrer9
PMCID: PMC7314712

Abstract

We build on the correspondence between Petri nets and free symmetric strict monoidal categories already investigated in the literature, and present a categorical semantics for Petri nets with guards. This comes in two flavors: Deterministic and with side-effects. Using the Grothendieck construction, we show how the guard semantics can be internalized in the net itself.

Introduction

Category theory has been used to study Petri nets at least since the beginning of the nineties [6]. Throughout this time, the main effort in this direction of research consisted in showing how Petri nets can be thought of as presenting various flavors of free monoidal categories [2, 5, 6, 8] This idea has been very influential, successfully modeling the individual-token philosophy via process semantics.

On the other hand, shortly after Petri’s first publications about the nets that carry his name [7] researchers started investigating what happens when nets are enriched with new features. One of the most successful extensions of Petri nets is guarded (or coloured) nets [3]. Modulo different flavors of modeling what boils down to be the same concept, a guarded net is a Petri net with the following extra properties:

  • To each token is attached some “attribute”. The kind of attributes we can attach to tokens depends on the place the token is in;

  • Each arc is decorated with an expression, which modifies tokens’ attributes as they flow through the net;

  • Each transition is decorated with a predicate and only fires on tokens whose attributes satisfy the predicate.

At a fist glance, guarded nets allow for a more expressive form of modeling with respect to their unguarded counterparts, but as we will see shortly, this is not necessarily the case. Indeed, depending on the underlying theory from which properties, expressions, and predicates are drawn the gain in expressive power with respect to undecorated nets may be nil: With a wise choice of underlying theory, coloured nets amount to be nothing more than syntactic sugar for standard nets, though of course the availability of such syntactic sugar can greatly simplify the modeling of complex processes using the Petri net formalism.

Recently there has been renewed interest in employing Petri nets as the basis for a programming language [10]. In this setting, the categorical correspondence between nets and symmetric monoidal categories has been of the utmost importance, single-token philosophy being considered necessary to make the programming language usable [9]. Clearly, extending nets with new features such as guards or timings is desirable to make the language more expressive.

In this work we try to unify these two longstanding directions of research – the categorical approach to Petri nets and the study of guarded nets – by showing how guarded nets can be modeled as ordinary Petri nets with a particular flavor of semantics in the style of [1].

Importantly, we are able to define both a deterministic semantics and a non-deterministic semantics in our formalism. The first models the traditional notion of guards deterministically modifying data attached to tokens, while the second describes a setting where token data is modified depending on side effects.

Using the Grothendieck construction, we show how the guard semantics can be internalized in the net itself, providing a categorical proof that in our model, guarded nets do not increase expressivity, as compared to traditional nets. This is a desired feature, since it means that many nice properties of nets such as termination or decidability of the reachability relation are preserved. It also shows that the core mathematical abstraction in computer implementations of Petri nets need not be modified when offering users the flexibility of guarded nets.

We save all proofs for the appendix, which starts on page 14.

Guarded Nets

Having given an intuitive version of what a guarded net is, we now start modeling the concept formally. We will use the formalism developed in [1], of which we recall some core concepts.

We denote by Inline graphic the free symmetric strict monoidal category associated to a Petri net N, and with Inline graphic the Petri net associated to the free symmetric strict monoidal category Inline graphic. We denote composition in diagrammatic order; i.e. given Inline graphic and Inline graphic, we denote their composite by Inline graphic.

Definition 1

Given a strict monoidal category Inline graphic, a Petri net with Inline graphic -semantics is a pair Inline graphic, consisting of a Petri net N and a strict monoidal functor

graphic file with name M9.gif

A morphism Inline graphic is just a strict monoidal functor Inline graphic such that Inline graphic.

Nets equipped with Inline graphic-semantics and their morphisms form a monoidal category denoted Inline graphic, with the monoidal structure arising from the product in Inline graphic.

Definition 2

We denote by Inline graphic the category of sets and partial functions, and by Inline graphic the 1-category of sets and spans, where isomorphic spans are identified. Both these categories are symmetric monoidal. From now on, we will work with the strictified version of Inline graphic and Inline graphic, respectively.

Example 1

Let Inline graphic denote the terminal symmetric monoidal category. A Petri net with Inline graphic-semantics is just a Petri net. Petri nets are in bijective correspondence with free symmetric strict monoidal categories, so Inline graphic denotes the usual category of free symmetric strict monoidal categories and strict monoidal functors between them.

Notation 1

Recall that a morphism Inline graphic in Inline graphic consists of a set S and a pair of functions Inline graphic. When we need to notationally extract this data from f, we write

graphic file with name M25.gif

We sometimes consider the span as a function Inline graphic, thus we may write Inline graphic for Inline graphic with Inline graphic and Inline graphic.

Perhaps unsurprisingly, Inline graphic and Inline graphic will be the target semantics corresponding to two different flavors for our guards, with Inline graphic allowing for some form of nondeterminism – expressed as the action of side-effects – whereas Inline graphic models a purely deterministic semantics. Expressing things formally:

Definition 3

A guarded net is an object of Inline graphic. A guarded net with side effects is an object of Inline graphic. A morphism of guarded nets (with side effects) is a morphism in Inline graphic (resp. in Inline graphic).

Remark 1

Although it doesn’t affect our formalism by any means, in practice the choice of semantics, both for Inline graphic and Inline graphic, is limited by computational requirements: the places in a net are usually sent to finite sets, while transitions are usually sent to computable functions and spans1, respectively. Such restrictions are necessary to make sure the net is executable and to keep model checking decidable.

Let us unroll the cryptic Definition 3, starting from the case Inline graphic. An object in Inline graphic is a net N together with a strict monoidal functor Inline graphic. It assigns to each place p of N – corresponding to a generating object of Inline graphic – a set Inline graphic, representing all the possible colours a token in p can assume. A transition Inline graphic – corresponding to a generating morphism of Inline graphic – gets sent to a partial function Inline graphic, representing how token colours are transformed during firing. Importantly, the fact that the functions in the semantics are partial means that a transition may not be defined for tokens of certain colors. An example of this is the net in Fig. 1a, which is shown together with its semantics. Although reachability in the base net seems quite straightforward, we see that a token in the leftmost place will never reach the rightmost place, since the rightmost transition is not defined on the tokens output by the leftmost one.

Fig. 1.

Fig. 1.

The same net (below), equipped with a partial function and span semantics, respectively (above).

In the case of Inline graphic the intuition is similar. Objects are sent to sets, exactly as in Inline graphic, but transitions are mapped to spans. Spans can be understood as relations with witnesses, provided by elements in the apex of the span. Practically, this means that each path from the span domain to its codomain is indexed by some element of the span apex, as it is shown in Fig. 1b. The presence of witnesses allows to consider different paths between the same elements. Moreover, an element in the domain can be sent to different elements in the codomain via different paths. We interpret this as non-determinism: The firing of the transition is not only a matter of the tokens input and output, it also includes the path chosen, which we interpret as having side-effects that are interpreted outside of our model. As one can see, in both Figs. 1a and 1b the composition of paths is the empty function (resp. span). Seeing things from a reachability point of view, the process given by firing the left transition and then the right will never occur. Let us make this intuition precise:

Definition 4

Given a guarded Petri net (with side effects) Inline graphic, a marking for Inline graphic is a pair (Xx) where X is an object of Inline graphic and Inline graphic. We say that a marking (Yy) is reachable from (Xx) if there is a morphism Inline graphic in Inline graphic such that Inline graphic.

The goal we will pursue in the next section will be to internalize the guard semantics in the free category Inline graphic associated to a net.

Internalizing Guards

By “internalizing the semantics of a guarded net N in Inline graphic” we mean obtaining an unguarded net M such that Inline graphic represents all the possible runs of N. For readers familiars with coloured Petri nets, this corresponds to the claim that reachability in a coloured net is equivalent to reachability in a suitably constructed “standard” net [3].

Since our point of view is process-theoretic, and we are working with symmetric strict monoidal categories and functors, such internalization must be built categorically. The main tool we will use is the Grothendieck construction [4], which in our context we will specialize to functors to Inline graphic and Inline graphic, respectively.

Definition 5

Let Inline graphic be a guarded net. We define its internalization, denoted Inline graphic, as the following category:

  • The objects of Inline graphic are pairs (Xx), where X is an object of Inline graphic and x is an element of Inline graphic. Concisely:
    graphic file with name M68.gif
  • A morphism from (Xx) to (Yy) in Inline graphic is a morphism Inline graphic in Inline graphic such that x is sent to y via Inline graphic. Concisely:
    graphic file with name M73.gif

It is worth giving some intuition of what the Grothendieck construction does in our context. It basically makes a place for each element of the set we send a place to, and makes a transition for each path between these elements, as shown below: graphic file with name 495607_1_En_4_Figa_HTML.jpg An equivalent definition exists when the semantics is taken to be in Inline graphic, which is the following:

Definition 6

Let Inline graphic be a guarded net with side effects. We define the internalization of Inline graphic, denoted with Inline graphic, as the following category:

  • The objects of Inline graphic are pairs (Xx), where X is an object of Inline graphic and x is an element of Inline graphic. Concisely:
    graphic file with name M81.gif
  • A morphism from (Xx) to (Yy) in Inline graphic is a pair (fs) where Inline graphic in Inline graphic and Inline graphic in the apex of the corresponding span connects x to y. Concisely:
    graphic file with name M86.gif

The intuition in the span case is exactly as for partial functions, and we don’t deem it useful to draw the same picture again. Looking at the example, though, a couple of things become clear. The first is that to justify the idea of the Grothendieck construction turning an assignment of semantics into a net we have to prove that the resulting category is symmetric strict monoidal and free. The second is that the net thus built is fibered over the base net, and there should be an opposite construction sending Inline graphic to M. Both of these claims are true, as we now prove:

Lemma 1

In the case of both Inline graphic and Inline graphic, the category Inline graphic has a strict symmetric monoidal structure.

Theorem 1

In both the case of Inline graphic and of Inline graphic the strict symmetric monoidal category Inline graphic is free.

Counterexample 1

(Relations). Theorem 1 does not hold – the Grothendieck construction does not yield a free symmetric strict monoidal category – if we replace Inline graphic or Inline graphic with Inline graphic. To see this, consider Inline graphic in the case that Inline graphic. Let M be the Petri net consisting of three places XYZ and two transitions Inline graphic and Inline graphic. Let Inline graphic send X to Inline graphic, Y to Inline graphic, and Z to Inline graphic. On morphisms, let Inline graphic send f to the maximal relation on Inline graphic and g to the maximal relation on Inline graphic. Then we have the following four generating morphisms in Inline graphic:

graphic file with name M109.gif

There is an equality Inline graphic as morphisms Inline graphic in Inline graphic, proving Inline graphic is not free.

The reason that Theorem 1 holds in the span case is that spans keep track of different paths between elements, whereas relations do not. To see this, consider the span composition:graphic file with name 495607_1_En_4_Figb_HTML.jpg

It is clear that in this composition the two paths from x to z are considered as separated in the Inline graphic case, and witnessed by Inline graphic respectively, while in the case of Inline graphic they would have been conflated to one. The result is that these paths correspond to the same morphism in the relational case of Inline graphic, introducing new equations and breaking freeness, while they stay separated in the span case.

Lemma 2

In the case of both Inline graphic and Inline graphic, there is a strict monoidal functor Inline graphic sending (Xx) to X and Inline graphic to Inline graphic (resp. Inline graphic to Inline graphic).

Remark 2

In general, Inline graphic is not an opfibration. This is because our target categories Inline graphic and Inline graphic allow for partial functions. Indeed, if Inline graphic in M is sent by Inline graphic to a partial function that is not defined on Inline graphic, then there is no coCartesian lift emanating from (Xx) for the morphism f.

We conclude this section by proving that the reachability semantics of a guarded net coincides with the reachability semantics of its internalization.

Theorem 2

Let Inline graphic be a guarded Petri net (with side effects). (Yy) is reachable from (Xx) if and only if (Yy) is reachable from (Xx) in the net Inline graphic.

Properties of Internalizations

The Grothendieck construction provides a way to internalize partial function and span semantics to nets. As such, it acts on objects of the categories Inline graphic and Inline graphic, respectively. It is thus worth asking what happens to morphisms in these categories. The answer is, luckily, easy to find:

Lemma 3

Let Inline graphic be a morphism in Inline graphic (resp. in Inline graphic). Then it lifts to strict monoidal functor Inline graphic (resp. Inline graphic), such that the following diagram on the left (resp. on the right) commutes: graphic file with name 495607_1_En_4_Figc_HTML.jpg

Notation 2

The notation for the liftings in Lemma 3 is easy to remember: The arrow over Inline graphic looks like a stylized function, while the hat over Inline graphic looks like a sylized span.

The lifting of Lemma 3 is quite well-behaved. First of all, it is worth stressing how it preserves some relevant categorical properties:

Lemma 4

For any map Inline graphic in Inline graphic (respectively in Inline graphic), the functor F is faithful if and only if Inline graphic is faithful (resp. Inline graphic is faithful). If F is full, then so is Inline graphic (resp. Inline graphic).

Having ascertained that “basic” categorical properties are preserved, it is worth asking what happens to particular classes of functors in Inline graphic and Inline graphic, respectively.

Following [1], there are three relevant kinds of morphisms in a category of Petri nets with semantics. On one hand there are transition-preserving functors, which represent morphisms of free monoidal categories arising purely from the topological structure of their underlying net. On the other there are functors representing glueings of nets, which are themselves divided into synchronizations (defined in terms of addition and erasing of generators, that is, double pushouts) and identifications (defined in terms of pushouts). Let us investigate which ones of these properties are preserved.

Definition 7

A strict symmetric monoidal functor F between FSSMCs Inline graphic, Inline graphic is said to be transition-preserving when each generating morphism f of Inline graphic is mapped to Inline graphic for some generating morphism g of Inline graphic and symmetries Inline graphic.

Lemma 5

If F is transition-preserving, so are Inline graphic and Inline graphic.

Lemma 6

If F is injective on objects, so are Inline graphic and Inline graphic.

Another interesting class of morphisms is identifications:

Definition 8

A Petri net Inline graphic is said to be an identification of Inline graphic if there is a morphism Inline graphic such that:

  • There is a Petri net O, and a pair of transition-preserving functors Inline graphic;

  • Inline graphic; and

  • F is the coequalizer of l and r.

Identifications are also preserved. The ultimate reason for this is that identifications are defined purely in terms of coequalizers of transition-preserving functors, which are preserved by the Grothendieck construction.

Lemma 7

If Inline graphic is an identification of Inline graphic via F and witnesses Olr, then Inline graphic is an identification of Inline graphic via Inline graphic and witnesses Inline graphic. The span case is analogous.

Preservation of identifications also entails that addition of generators for a net are preserved by internalizations.

Definition 9

A net Inline graphic is an addition of generating morphisms to Inline graphic via Ww if:

  • There is a net W together with a strict monoidal functor Inline graphic which sends generating objects to generating objects, is injective on objects and faithful;

  • Inline graphic is the pushout of Inline graphic and Inline graphic, where Inline graphic denotes the net with the same places of W and no transitions; and

  • Inline graphic arises from the universal property of the pushout.

Lemma 8

Let Inline graphic be an addition of generating morphisms to Inline graphic via Ww. Then Inline graphic is an addition of generating morphisms to Inline graphic via Inline graphic. The span case is analogous.

Finally, we investigate what happens when considering erasings of generators from a net. To do this, we first follow [1] to define subnets:

Definition 10

Given Petri nets Inline graphic, we say that Inline graphic is a subnet of N if its places and transitions are a subset of places and transitions of N, and input and output functions on Inline graphic are restrictions of the input and output functions on N. If Inline graphic is a subnet of N, then there is an obvious identity on objects, identity on morphisms strict monoidal functor, Inline graphic between their associated free symmetric strict monoidal categories. From this, we say that a net Inline graphic is a subnet of Inline graphic if Inline graphic is a subnet of N and Inline graphic.

This enables us to define erasings of generators:

Definition 11

Let Inline graphic be a subnet of Inline graphic. An erasing of generators of Inline graphic via Inline graphic is a net Inline graphic such that:

  • Inline graphic is a subnet of Inline graphic;

  • Inline graphic, where Inline graphic denotes the net with the same places of Inline graphic and no transitions, is a subnet of Inline graphic; and

  • Inline graphic is the pushout of Inline graphic; and Inline graphic.

Indeed, erasings of generators are preserved as well by our internalization:

Lemma 9

Let Inline graphic be an erasing of generating morphisms from Inline graphic via a subnet Inline graphic. Then Inline graphic is an erasing of generators from Inline graphic via Inline graphic. The span case is analogous.

Surprisingly, even if erasing and addition of generators are preserved by internalizations, synchronizations are not. Indeed, following [1], Inline graphic is a synchronization of Inline graphic via Ww when Inline graphic is defined to be the result of applying the following double pushout rewrite rule to Inline graphic:

graphic file with name 495607_1_En_4_Equ23_HTML.gif

Here, we require that w factorizes through Inline graphic. In internalizing this construction the pushouts are preserved, but the rewrite rule is not! This becomes evident by lifting the definition of synchronization altogether, where in the following diagram we are sticking to the notation developed in [1]:graphic file with name 495607_1_En_4_Figd_HTML.jpg The black arrows are just the definition of synchronization. The dotted arrows denote the pushout arrows, while the dashed arrows arise from the universal property of the pushout. The maroon arrows and objects represent the Grothendieck construction and the lifting of the functors obtained from Lemma 3, while the Inline graphics stand for the functors obtained in Lemma 2, where we omitted subscripts to avoid clutter.

As one can see the pushout squares are both preserved, but Inline graphic is not a synchronization of Inline graphic via Inline graphic since

graphic file with name 495607_1_En_4_Equ24_HTML.gif

In other words, Inline graphic is too big of a subcategory of Inline graphic to make Inline graphic into a synchronization. An analogous observation holds for spans.

Counterexample 2

(Synchronizations not preserved). We provide a practical counterexample of why synchronizations are not preserved by internalizations. Consider the following nets, where we are borrowing the graphical notation developed in [1], decorating net elements with their images in Inline graphic. graphic file with name 495607_1_En_4_Fige_HTML.jpg At the base level we have two nets, M on the left and N on the right. Eliding the functor Inline graphic, the places of N are mapped to sets:

graphic file with name 495607_1_En_4_Equ25_HTML.gif

While transitions are mapped to partial functions Inline graphic and Inline graphic, defined as follows:

graphic file with name M214.gif

M is clearly a synchronization of N via F: The generators f and g have been erased and a generator corresponding to Inline graphic has been added. Taking the Grothendieck construction on M and N (top left and top right in the figure, respectively), we see how the erasing of generators is problematic: The morphism g in N branches into Inline graphic and Inline graphic in Inline graphic, of which only Inline graphic forms a path with f(x). In lifting the synchronization M to Inline graphic, we would expect Inline graphic and f(x) to be erased and conflated into Inline graphic, whereas Inline graphic stays. But this is not the case, since in M the generator g has already been erased “before being allowed to branch”, taking Inline graphic with it when we take Inline graphic!

As we said before, this ultimately depends on the fact that the internalization of the subnet provided by the synchronization witness contains too many morphisms, and ends up erasing more generators than we would like it to.

Internalization as a Functor

In this final section, we put together some of the properties we have proved so far about internalizations, and prove that internalization is a functor. The intuitive argument behind the results that are about to follow is this: If Inline graphic internalizes the semantics of Inline graphic, in either the case Inline graphic or Inline graphic, then Inline graphic should be considered as “just a ne”, that is, an object of Inline graphic; see Example 1.

Putting together results about lifting of functors obtained in the previous section, we are indeed able to prove this.

Theorem 3

Denote with Inline graphic the terminal category, together with the trivial symmetric monoidal structure on it. There is a faithful, strong monoidal functor Inline graphic defined as follows:

  • On objects, it sends Inline graphic to Inline graphic.

  • On morphisms, we send the functor Inline graphic to the functor2
    graphic file with name M235.gif

Similarly, there is a faithful, strong monoidal functor Inline graphic defined as follows:

  • On objects, it sends Inline graphic to Inline graphic.

  • On morphisms, we send the functor Inline graphic to the functor3
    graphic file with name M240.gif

Finally, it is worth nothing that for each choice of semantics Inline graphic there is another obvious functor from Inline graphic to Inline graphic, which just forgets the semantics altogether. It is worth asking how this functor and the ones provided in Theorem 3 are related.

Proposition 1

Denote with

graphic file with name M244.gif

the “forgetful” functors defined by sending each Petri net Inline graphic to Inline graphic. Then there are natural transformations: graphic file with name 495607_1_En_4_Figf_HTML.jpg

Conclusion and Future Work

In this work, we described guarded Petri nets as Petri nets endowed with a functorial semantics. We provided two different styles of semantics: a deterministic one, realized using the category of sets and partial functions, and a non-deterministic one that allows for side effects, realized using the category of partial functions and that of spans.

We moreover showed how, using the Grothendieck construction, the guards can be internalized, obtaining a Petri net whose reachability relation is equivalent to the one of the guarded one. We proved that internalizations have nice properties, and the internalization construction is functorial in the choice of the guarded net we start from.

Regarding directions of future work, a pretty straightforward thing to do would be to figure out which semantics, other than Inline graphic and Inline graphic, are internalizable. That is, if Inline graphic is a symmetric monoidal functor, which properties do Inline graphic and F need to have so that Inline graphic is a free symmetric strict monoidal category.

Acknowledgements

David Spivak acknowledges support from Honeywell Inc. as well as from AFOSR grants FA9550-17-1-0058 and FA9550-19-1-0113. Fabrizio Genovese wants to thank his fellow team members at Statebox for useful discussion and support.

Appendix – Proofs

Lemma 1. In the case of both Inline graphic and Inline graphic, the category Inline graphic has a strict symmetric monoidal structure.

Proof

We start with the case of Inline graphic. Since Inline graphic is strict monoidal, Inline graphic. Thus on objects, we can set Inline graphic. On morphisms, we just use the monoidal product Inline graphic from Inline graphic. The monoidal unit is Inline graphic, where I is the monoidal unit of Inline graphic and Inline graphic is the unique element of the monoidal unit Inline graphic of Inline graphic. The rest of the proof is a straightforward check.

Now we consider the case of Inline graphic. On objects, we set again Inline graphic. On morphisms, we set Inline graphic, where Inline graphic is as in Inline graphic and (st) is the pair of span-apex elements: graphic file with name 495607_1_En_4_Figg_HTML.jpg The monoidal unit is Inline graphic, where I is the monoidal unit of Inline graphic and Inline graphic is the unique element of the monoidal unit Inline graphic of Inline graphic.

The remainder of the proof is as in the previous case.   Inline graphic

Theorem 1. In both the case of Inline graphic and of Inline graphic the strict symmetric monoidal category Inline graphic is free.

Proof

We start with the case of Inline graphic. Consider the free symmetric strict monoidal category Inline graphic generated as follows:

  • Object generators are pairs (Xx), with X object generator in Inline graphic and Inline graphic;

  • A morphism generator Inline graphic is a morphism generator Inline graphic of Inline graphic such that Inline graphic.

We want to prove that Inline graphic and Inline graphic are isomorphic.

First, let (Xx) be an object in Inline graphic. Then X is an object of Inline graphic, which is free, and hence we have Inline graphic for generating objects Inline graphic in Inline graphic. By definition, we have Inline graphic. Being Inline graphic strict, this means:

graphic file with name M294.gif

Hence (Xx) = Inline graphic, and the object generators of Inline graphic are the pairs (Xx) with X object generator in Inline graphic and Inline graphic. This means that there is a bijection on objects of Inline graphic and Inline graphic:

graphic file with name M301.gif

We can then define a symmetric monoidal functor Inline graphic that is bijective on objects, and sends a generating morphism Inline graphic of Inline graphic to the morphism Inline graphic in Inline graphic.

We want to prove that T is full and faithful. Faithfulness is obvious; given Inline graphic in Inline graphic, if Inline graphic then in particular Inline graphic in Inline graphic. It follows from the fact that Inline graphic is at most single-valued – i.e. Inline graphic and Inline graphic imply Inline graphic – that Inline graphic also in Inline graphic. For fullness, take a morphism Inline graphic in Inline graphic, and notice the following:

  • If Inline graphic is equal to Inline graphic, where Inline graphic and Inline graphic, then we have:
    graphic file with name 495607_1_En_4_Equ26_HTML.gif
    So there is a Inline graphic such that Inline graphic and Inline graphic. This means that Inline graphic and Inline graphic are morphisms in Inline graphic;
  • If Inline graphic is equal to Inline graphic, where Inline graphic and Inline graphic, then we have:
    graphic file with name M333.gif
    This means that Inline graphic and Inline graphic, and hence that Inline graphic and Inline graphic are morphisms in Inline graphic.

By definition, since Inline graphic is free, any morphism Inline graphic can be decomposed into a composition of monoidal products of morphism generators, symmetries and identities. The points above prove that Inline graphic can be decomposed in the same way, and hence is in the image of T; thus it is full.

Our correspondence is bijective on objects and fully faithful, proving that Inline graphic and Inline graphic are isomorphic as categories. Since Inline graphic is free so is Inline graphic, completing the proof.

We now consider the case of Inline graphic. The structure of the proof is similar. Consider the free symmetric strict monoidal category Inline graphic generated as follows:

  • Object generators are pairs (Xx), with X object generator in Inline graphic and Inline graphic;

  • For each morphism generator Inline graphic and Inline graphic such that Inline graphic, there is a morphism generator Inline graphic.

We want to prove that Inline graphic and Inline graphic are isomorphic.

On objects, the proof of bijectivity is as in the previous case. We can then define a symmetric monoidal functor Inline graphic that is bijective on objects, and sends a generating morphism Inline graphic of Inline graphic to the morphism Inline graphic in Inline graphic.

We want to prove that this functor is full and faithful. Faithfulness is again straightforward. Suppose given Inline graphic in Inline graphic. By construction, Inline graphic in Inline graphic if and only if Inline graphic in Inline graphic and Inline graphic. But this means that Inline graphic also in Inline graphic.

For fullness, take a morphism Inline graphic in Inline graphic, and notice the following:

  • Each morphism (fs) such that f is a generator, an identity or a symmetry in Inline graphic is also in Inline graphic;

  • If Inline graphic is such that Inline graphic, where Inline graphic and Inline graphic, then by definition of composition in Inline graphic, we have Inline graphic for some tu with Inline graphic and Inline graphic. This means that Inline graphic and Inline graphic are morphisms in Inline graphic;

  • If Inline graphic is such that Inline graphic, where Inline graphic and Inline graphic, then Inline graphic for some Inline graphic, and we have:
    graphic file with name M390.gif
    This means that Inline graphic and Inline graphic, and hence that Inline graphic and Inline graphic are morphisms in Inline graphic.

By definition, since Inline graphic is free, any morphism f can be decomposed into a composition of monoidal products of morphism generators, symmetries and identities. The points above prove that each of such morphisms is also in Inline graphic, and hence in Inline graphic. So f in Inline graphic is the image of f in Inline graphic, and the functor is full.

Since our correspondence is bijective on objects and fully faithful, this proves that Inline graphic and Inline graphic are isomorphic as categories. Since Inline graphic is free so is Inline graphic, completing the proof.   Inline graphic

Theorem 2. Let Inline graphic be a guarded Petri net (with side effects). (Yy) is reachable from (Xx) if and only if (Yy) is reachable from (Xx) in the net Inline graphic.

Proof

By definition (Yy) is reachable from (Xx) if and only if there is a morphism Inline graphic in Inline graphic such that Inline graphic (resp. Inline graphic for some Inline graphic). Again by definition, this means that Inline graphic (resp. Inline graphic) is a morphism of Inline graphic. Since Inline graphic is free, f (resp. Inline graphic) can be decomposed as a composition of monoidal products of generating morphisms. But every generating morphism of Inline graphic corresponds to a transition of Inline graphic, from which the thesis follows.    Inline graphic

Lemma 5. If F is transition-preserving, so are Inline graphic and Inline graphic.

Proof

The proof is obvious considering that, by construction, Inline graphic is a generator (resp. a symmetry) in Inline graphic if and only if it is a generator (resp. a symmetry) in Inline graphic.

An analogous argument holds for Inline graphic.    Inline graphic

Theorem 3. Denote with Inline graphic the terminal category, together with the trivial symmetric monoidal structure on it. There is a faithful, strong monoidal functor Inline graphic defined as follows:

  • On objects, it sends Inline graphic to Inline graphic.

  • On morphisms, we send the functor Inline graphic to the functor4
    graphic file with name 495607_1_En_4_Equ27_HTML.gif

Similarly, there is a faithful, strong monoidal functor Inline graphic defined as follows:

  • On objects, it sends Inline graphic to Inline graphic.

  • On morphisms, we send the functor Inline graphic to the functor5
    graphic file with name M434.gif

Proof

The proofs for Inline graphic and Inline graphic are very similar, so we just provide the one for Inline graphic. Clearly if F is the identity functor Inline graphic then so is Inline graphic. For composition, consider Inline graphic and Inline graphic. We have to prove that Inline graphic. On objects, Inline graphic sends (Xx) in Inline graphic to Inline graphic in Inline graphic, so it coincides with Inline graphic. Now consider a morphism Inline graphic in Inline graphic. This is sent by Inline graphic to Inline graphic, and applying Inline graphic to it one gets Inline graphic. Since Inline graphic is Inline graphic, we are done. This proves that Inline graphic is a functor. Faithfulness is trivial.

Now we focus on monoidality. First of all we have to prove that

graphic file with name M449.gif

Remembering from Definition 1 that for each choice of semantics Inline graphic the monoidal structure on Inline graphic is defined in terms of coproduct of symmetric monoidal categories, and hence from the coproduct of the underlying nets, this means that:

graphic file with name M452.gif

Since Inline graphic preserves isomorphisms and coproducts, it is sufficient to prove:

graphic file with name M454.gif
  • By definition, objects of Inline graphic are pairs (Xx) with Inline graphic and Inline graphic. This is clearly isomorphic to Inline graphic.

  • Again by definition, we have
    graphic file with name M459.gif
    This follows noting that by definition the set of morphisms of Inline graphic is the disjoint union of the sets of morphisms of Inline graphic and Inline graphic.

Then we have to prove that Inline graphic. Unrolling definitions this amounts to prove that Inline graphic, which is obvious.

Finally, we need to prove that Inline graphic preserves the monoidal unit. Notice that for each choice of semantics Inline graphic the monoidal unit in Inline graphic is taken to be Inline graphic. Inline graphic is the free category consisting of only the monoidal unit I, and Inline graphic sends the monoidal unit to the monoidal unit and its identity to itself. In our case, the monoidal unit of Inline graphic is Inline graphic, with Inline graphic sending the monoidal unit of Inline graphic to the singleton set Inline graphic in Inline graphic. In particular, this means that Inline graphic, proving that

graphic file with name M477.gif

   Inline graphic

Proposition 1. Denote with

graphic file with name 495607_1_En_4_Equ28_HTML.gif

the functors defined by sending each Petri net Inline graphic to Inline graphic. Then there are natural transformations:graphic file with name 495607_1_En_4_Figh_HTML.jpg

Proof

For each object Inline graphic in Inline graphic, we set

graphic file with name M483.gif

to be the functor Inline graphic, where Inline graphic is defined as in Lemma 3. The naturality condition follows from Lemma 3 as well. The span case is analogous.    Inline graphic

Footnotes

1

A computable span is one for which both legs are computable functions.

2

To be absolutely precise, we are referring to the functor Inline graphic.

3

To be absolutely precise, we are referring to the functor Inline graphic.

4

To be absolutely precise, we are referring to the functor Inline graphic.

5

To be absolutely precise, we are referring to the functor Inline graphic.

Contributor Information

Fabio Gadducci, Email: gadducci@di.unipi.it.

Timo Kehrer, Email: timo.kehrer@informatik.hu-berlin.de.

Fabrizio Genovese, Email: research@statebox.io.

David I. Spivak, Email: dspivak@mit.edu

References

  • 1.Genovese, F.: The essence of petri net gluings. http://arxiv.org/abs/1909.03518
  • 2.Genovese, F., Herold, J.: Executions in (semi-)integer petri nets are compact closed categories, vol. 287, pp. 127–144. 10.4204/EPTCS.287.7
  • 3.Jensen K, Kristensen LM. Coloured Petri Nets. Berlin and Heidelberg: Springer; 2009. [Google Scholar]
  • 4.MacLane S, Moerdijk I. Sheaves in Geometry and Logic, a First Introduction to Topos Theory, Universitext. Heidelberg: Springer; 1994. [Google Scholar]
  • 5.Master, J.: Generalized petri nets. http://arxiv.org/abs/1904.09091
  • 6.Meseguer, J., Montanari, U.: Petri nets are monoids. 88(2), 105–155. 10.1016/0890-5401(90)90013-8
  • 7.Petri, C., Reisig, W.: Petri net. http://www.scholarpedia.org/article/Petri_net
  • 8.Sassone V. On the category of Petri net computations. In: Mosses PD, Nielsen M, Schwartzbach MI, editors. TAPSOFT ’95: Theory and Practice of Software Development; Heidelberg: Springer; 1995. pp. 334–348. [Google Scholar]
  • 9.Statebox Team: The mathematical specification of the statebox language. http://arxiv.org/abs/1906.07629
  • 10.Statebox Team: Statebox github page. https://github.com/statebox/

Articles from Graph Transformation are provided here courtesy of Nature Publishing Group

RESOURCES