A Categorical Semantics for Bounded Petri Nets
aa r X i v : . [ m a t h . C T ] J a n A Categorical Semantics for Bounded Petri Nets
Fabrizio Genovese Q [0000 − − − ,Fosco Loregian Q [0000 − − − X ] , andDaniele Palombi Q [0000 − − − University of Pisa [email protected] Tallinn University of Technology [email protected] Sapienza University of Rome [email protected]
Abstract.
We provide a categorical semantics for bounded Petri nets,both in the collective- and individual-token philosophy. In both cases, wedescribe the process of bounding a net internally, by just constructingnew categories of executions of a net using comonads, and externally, us-ing lax-monoidal-lax functors. Our external semantics is non-local, mean-ing that tokens are endowed with properties that say something aboutthe global state of the net. We then prove, in both cases, that the inter-nal and external constructions are equivalent, by using machinery builton top of the Grothendieck construction. The individual-token case isharder, as it requires a more explicit reliance on abstract methods.
Acknowledgements
The first author was supported by the project MIURPRIN 2017FTXR7S “IT-MaTTerS” and by the Independent Ethvestigator Program.The second author was supported by the ESF funded Estonian IT Academyresearch measure (project 2014-2020.4.05.19-0001).A video presentation of this paper can be found on Youtube at mv4dyTNgz60.
A Petri net is a simple thing: it consists of places – depicted as circles – and transitions – depicted as squares. Places are seen as holding resources, called tokens and represented by black circles, while transitions are seen as processesthat convert a pre-determined amount of some resource into a pre-determinedamount of some other resource. The action of transitions is considered as atomic,and such an event is called firing . Sequences of firings are also called executions . F. Genovese, F. Loregian, D. Palombi
This innocent definition [16] has proven very useful in domains ranging fromconcurrency[11, 18], where it is used to represent resource flow in distributedcomputing, to chemistry [17, 3], where it models chemical reactions. In bothcases, it becomes important to characterize which sequences of transitions carry agiven distribution of tokens for the net – called marking – to some other marking.Here is where the similitude between applications specializes: for instance, inchemistry tokens represent molecules/atoms of a given type, which is specifiedby the place they live in. As such, two tokens in the same place are phisicallyindistinguishable and we do not care of which token is consumed by a fixedtransition. In computer science applications – e.g. [21] – tokens are instead seenas terms of a given type, and as such it is important to distinguish between them.These two philosphies are called collective-token and individual-token philosophy,respectively [22].In any case, one other important question is to establish when a given Petrinet is bounded , meaning that starting from a given marking no place will holdmore than a pre-determined number of tokens throughout any possible firing [17].Traditionally, there is a simple way of turning any net into a bounded one: wedouble-up the places adding what we call anti-places (depicted in red), and edittransitions so that each input (output) from (to) a place is now paired with acorresponding output (input) to (from) the corresponding anti-place:It is easy to see that for any marking the amount of tokens in each anti-placewill determine the maximum number of tokens the corresponding place can holdthrough any execution, and vice-versa.Building on the long-standing tradition of looking at Petri nets through acategorical lens [14], we want to give a category-theoretic interpretation of thisprocess, both in the collective-token philosophy and in the individual-token one.In each case, we will provide two different categorical ways to bound a net, whichwe will call internal and external , respectively. Then, we will prove that internaland external bounding are conceptually the same thing, generalizing a techniquealready established in [10]. Importantly, in doing so we will employ a new kindof categorical semantics for Petri nets, which we call non-local [9], where tokenscome endowed with information concerning global properties of the net itself.
Notation 1.
Let S be a set; denote with S ⊕ the set of multisets over S . Multisetsum will be denoted with ⊕ , difference (only partially defined) with ⊖ . S ⊕ with ⊕ and the empty multiset is isomorphic to the free commutative monoid on S . Categorical Semantics for Bounded Petri Nets 3
Definition 1 (Petri net). A Petri net is a couple functions T s,t −→ S ⊕ for somesets T and S , called the set of places and transitions of the net, respectively. Definition 2 (Markings and firings). A marking for a net T s,t −→ S ⊕ is anelement of S ⊕ , representing a distribution of tokens in the net places. A transition u is enabled in a marking M if M ⊖ s ( u ) is defined. An enabled transition can fire , moving tokens in the net. Firing is considered an atomic event, and themarking resulting from firing u in M is M ⊖ s ( u ) ⊕ t ( u ).As we said, depending if we want to consider tokens as intistinguishable ornot, we can interpret nets under two different philosphies, traditionally calledcollective-token and individual-token, respectively. Category theory is helpfulin pinpointing precisely the meaning of this distinction by providing differentnotions for the category of executions of a given net . In the collective-token phi-losophy, the executions of a Petri net are taken to be morphisms in a commutativemonoidal category – a category whose monoid of objects is commutative: Definition 3 (Category of executions – collective-token philosophy).
Let N : T s,t −→ S ⊕ be a Petri net. We can generate a free commutative strictmonoidal category (FCSMC) , C ( N ), as follows: – The monoid of objects is S ⊕ . Monoidal product of objects A, B , denotedwith A ⊕ B , is given by the multiset sum. – Morphisms are generated by T : each u ∈ T corresponds to a morphismgenerator su u −→ tu ; morphisms are obtained by considering all the formal(monoidal) compositions of generators and identities.A detailed description of this construction can be found in [13]. Example 1.
In Definition 3 objects represent markings of a net: A ⊕ A ⊕ B means“two tokens in A and one token in B ”. Morphisms represent executions of a net,mapping markings to markings. A marking is reachable from another one iffthere is a morphism between them. p t p v up p p t p v up p p t p v up p p t p v up p t v up p p p p p p p p p F. Genovese, F. Loregian, D. Palombi
As for the individual-token philosophy, we obtain a suitable semantics byrelaxing the commutativity requirement in Definition 3.
Definition 4 (Category of executions – individual-token philosophy).
Let N : T s,t −→ S ⊕ be a Petri net. We can generate a free symmetric strictmonoidal category (FSSMC) , F ( N ), as follows: – The monoid of objects is S ⊗ , the set of strings over S . Monoidal product ofobjects A, B , denoted A ⊗ B , is given by string concatenation. – Morphisms are generated by T : each u ∈ T corresponds to a morphismgenerator su u −→ tu , where su, tu are obtained by choosing some orderingon their underlying multisets; morphisms are obtained by considering allthe formal horizontal and vertical compositions of generators, identities andsymmetries.A detailed description of this construction can be found in [7]. Example 2.
The interpretation of Definition 4 is as in Definition 3, but nowswitching tokens around is not anymore a trivial operation. For instance, thefollowing morphisms are considered different in Definition 4, and equal in Defi-nition 3:
AB BCf g AB BCf g
A great deal of work has been devoted in understanding how categories ofPetri nets and categories of (commutative, symmetric) strict monoidal categoriesare related [14, 19, 8, 2, 4, 6, 1]. We won’t focus on these issues in this paper;instead, we will be interested in recovering the idea of “bounding a net” as afunctor between the category of executions of a net and some other category.The approach we pursue will be very similar to the one we already adoptedfor coloured nets in [10], with the difference that our functors will have to belax-monoidal-lax, something we already partially exploited in [9]. For obviousreasons, we start from the collective-token case, which is simpler.
We briefly described the process of turning a Petri net into a bounded onein Section 1. Categorically, this process can be implemented in the executionssemantics, as follows.
Definition 5 (Internal bound semantics – collective-token philosphy).
Let N be a Petri net, and consider C ( N ), its corresponding FCSMC. The internalbound semantics of N in the collective-token philosophy is given by the FCSMC C B ( N ) generated as follows: – For each generating object A in C ( N ), we introduce object generators A + , A − . Categorical Semantics for Bounded Petri Nets 5 – For each generating morphism L ni =1 A i u −→ L mj =1 B j in C ( N ), we introduce a morphism generator: L m ∨ ni =1 (cid:0) A + i ⊕ B i − (cid:1) u −→ L m ∨ ni =1 (cid:0) A − i ⊕ B i + (cid:1) where we adopt the convention that, if n < m (respectively m > n ), then A n +1 , . . . , A m (respectively B m , . . . , B n ) are taken to be equal to I , themonoidal unit, and m ∨ n := max { m, n } . Example 3.
Notice that by definition every FCSMC is presented by a Petri net.Following Definition 5, it is easy to see that if we consider N to be the netin Section 1, then C B ( N ) is presented exactly by the bounded net we na¨ıvelyassociated to it. Indeed, generating objects of type A + represent a token inthe place A of the net while generating objects of type A − represent tokens inthe corresponding anti-place. Generating morphisms of C B ( N ) have inputs andoutputs exactly as the transitions in the net obtained by bounding N . Proposition 1.
The assignment C ( N ) C B ( N ) defines a comonad in the cat-egory of FCMSCs and strict monoidal functors between them, FCSMC . Proof.
First of all we have to prove that the procedure is functorial. For anystrict monoidal functor F : C ( N ) → C ( M ) we define the action on morphisms C B ( F ) : C B ( N ) → C B ( M ) as the following monoidal functor: – If for a generating object A of C ( N ) it is F A = B , then C B ( F ) A + = B + and C B ( F ) A − = B − . – If for a generating morphism t of C ( N ) it is F t = u , then C B ( F ) t = u .Identities and compositions are clearly respected, making C B ( ) an endofunctorin FCSMC . As a counit, on each component N we define the strict monoidalfunctor ε N : C B ( N ) → C ( N ) sending: – The generating object A + to A , and the generating object A − to I , themonoidal unit of C ( N ). – A generating morphism L m ∨ ni =1 (cid:0) A + i ⊕ B i − (cid:1) u −→ L m ∨ ni =1 (cid:0) A − i ⊕ B i + (cid:1) To the generating morphism L ni =1 A i u −→ L mj =1 B j The procedure is natural in the choice of N , making ε into a natural trans-formation C B ( ) → id FCSMC .As for the comultiplication, on each component N we define the strict monoidalfunctor δ N : C B ( N ) → C B ( C B ( N )) sending: F. Genovese, F. Loregian, D. Palombi • The generating object A + is sent to the generating object A ++ ⊕ A = . • The generating object A − is sent to the generating object A ∓ ⊕ A ± . • A generating morphism of C B ( N ) L m ∨ ni =1 (cid:0) A + i ⊕ B i − (cid:1) u −→ L m ∨ ni =1 (cid:0) A − i ⊕ B i + (cid:1) Is sent to the generating morphism C B ( C B ( N )) L m ∨ ni =1 (cid:0) A ++ i ⊕ A = i ⊕ B ± i ⊕ B ∓ i (cid:1) u −→ L m ∨ ni =1 (cid:0) A ∓ i ⊕ A ± i ⊕ B = i ⊕ B ++ i (cid:1) The naturality of δ , its coassociativity and the fact that ε is a counit areall straightforward checks.In the spirit of [10], our goal is now to frame this comonad into a biggercontext, namely the one of Petri nets with a semantics attached to them. Asemantics for a Petri net is just a functor from its category of executions (modulochoice of token philosophy) to some other monoidal category S .In [10], this functor was required to be strict monoidal. This backed up theinterpretation that a semantics “attaches extra information to tokens”, which isthen used by the transitions in some way.In here, we require this functor to be lax-monoidal-lax . Laxity amounts to saythat we can attach non-local information to tokens: they may “know” somethingabout the overall state of the net, and the laxator represents the process of“tokens joining knowledge”. If this sounds handwavy, we guarantee it will bemade clear shortly. Definition 6 (Non-local semantics – collective-token philosophy).
Let N be a Petri net and let S be a monoidal bicategory [20]. A Petri net with acommutative non-local semantics is a couple (cid:0)
N, N ♯ (cid:1) , with N ♯ a lax-monoidal-laxfunctor C ( N ) → S .A morphism (cid:0) N, N ♯ (cid:1) → (cid:0) M, M ♯ (cid:1) of Petri nets with commutative semantics isa strict monoidal functor C ( N ) F −→ C ( M ) making the obvious triangle commute.We denote the category of Petri nets with a non-local commutative semanticswith Petri S .We now show how we can encode the information of a net being bounded assome particular kind of non-local semantics. Notation 2.
Let
Span be the monoidal bicategory of sets, spans and span mor-phisms. A morphism A → B in Span consists of a set S and a pair of func-tions A ← S → B . When we need to notationally extract this information from f , we write A f ←− S f f −→ B . We sometimes consider a span as a morphism f : S f → A × B , thus we may write f ( s ) = ( a, b ) for s ∈ S f with f ( s ) = a and f ( s ) = b . Recall moreover that a 2-cell in Span f ⇒ g is a function θ : S f → S g such that f = θ g .Remark 1. In a free commutative (resp. symmetric) strict monoidal categorythere are no equations between generators. As such, even if a morphism can
Categorical Semantics for Bounded Petri Nets 7 be decomposed in a composition of tensors of generators (and symmetries) inmultiple ways, the generators used – as well as how many times they are used– is an invariant of this decomposition. Given this, there exists a well-definedfunction χ : Hom F ( N ) n generator mor-phisms of F ( N ) ⊕ o mapping each morphism f to a multiset counting how many times each morphismgenerator is used in the decomposition of f . Definition 7 (External bound semantics – collective-token philosphy).
Given a Petri net N : T s,t −→ S ⊕ , define the following lax-monoidal-lax functor N ♯ : C ( N ) → Span : – Each object A of C ( N ) is mapped to the set S ⊕ , the set of objects of C ( N ). – Each morphism A f −→ B is sent to the span: S ⊕ t ←− χ ( f ) − s −→ S ⊕ with s, t denoting source and target, respectively, of a morphism in C ( N ). Proposition 2.
The functor of Definition 7 is lax-monoidal-lax. Functors asin Definition 7 form a subcategory of
Petri
Span , which we call
Petri
Span B . Proof.
Since χ (id A ) is the empty multiset, and identities and symmetries co-incide, χ (id A ) − coincides with the set of objects of C ( N ), and identities arepreserved strictly. As for composition, the laxating 2-cell is given by the obviousinclusion χ ( f ) − × S ⊕ χ ( g ) − → χ ( f g ) − obtained by composition. A very sim-ilar argument holds for the monoidal product noticing that χ ( f g ) = χ ( f ⊕ g ).The coherence conditions are tedious to check but straightforward, given thatthe structure of the laxators is very simple. Example 4.
We now try to shed some light on Definition 7. Consider the netbelow. It has three places, which according to to Definition 7 are all sent to theset of multisets over themselves. We interpret tokens as endowed with elements ofsuch set. These represent markings on the anti-places of the net. In our example,the token in p “knows” that there is one token in the anti-place p − and fourtokens in the anti-place p − , while p “knows” that there are three tokens in p − and p − , two in p − . The laxator allows to consider these two tokens as a uniqueentity, with ther respectively “local knowledges” summing up. p p p u u p : 1 p : 0 p : 4 p : 3 p : 3 p : 2 p p p u u p : 4 p : 3 p : 6Laxator If this seems very strange, recall Example 2. As objects commute, morphisms in C ( C ) obey a very weak causal flow, and composition and monoidal product arequite similar. F. Genovese, F. Loregian, D. Palombi Transitions u , u generate the morphisms of the category of executons of the net.Looking at our definition, u is mapped to the span function that subtracts p to the multiset in input and adds p to it. This represent the flow of antitokens,which goes in the opposite way wrt the flow of tokens of u . This again backsup our intuition, since anti-places are wired to transitions in the opposite wayof their corresponding places. As of now, we defined two different kinds of bound semantics for Petri nets in thecollective-token philosophy, specified by Definition 5 and Definition 7. The formeris labelled internal , because places and anti-places are all put together in thesame category, while the latter is labelled external , since the information aboutbounded tokens is encoded in a functor. We now show that the two approachesare one and the same.
Theorem 1.
Let (cid:0)
N, N ♯ (cid:1) be an object of Petri
Span B . The category C B ( N ) of Def-inition 5 is isomorphic to the category R N ♯ defined as follows: – Objects of R N ♯ are couples ( X, x ) where X is a object of C and x ∈ N ♯ X . – Morphisms ( X, x ) → ( Y, y ) of R N ♯ are couples ( f, s ) with f : X → Y amorphism of C and s ∈ S N ♯ f such that N ♯ f ( s ) = ( x, y ) .Proof. Leveraging on the equivalence of categories: Γ : Cat / C ( N ) ≃ Cat l [ C ( N ) , Span ] : R (more details in Definitions 10 and 11, and Theorem 2), it is sufficient to considerthe counit ε N : C B ( N ) → C ( N ) of Proposition 1, and to notice that Γ ε N = N ♯ .Then Theorem 2 guarantees that R Γ ε N ≃ ε N , from which the thesis follows. We now want to generalize the results of Section 3 to the individual-token philos-ophy. In doing so, we will also prove the worthiness of the categorical approach:defining an external semantics in the individual-token case is considerably harder,but instead of having to do so explicitly, we will be relying on abstract resultsfrom higher category theory.
Definition 8 (Internal bound semantics – individual-token philosphy).
Let N be a Petri net, and consider F ( N ), its corresponding FSSMC. The in-ternal bound semantics of N in the individual-token philosophy is given by theFSSMC F B ( N ) generated by the same information of Definition 5.Even if Definition 5 and 8 look nearly identical, things are instantly com-plicated by the presence of symmetries. Indeed, proving comonadicity withoutresorting to abstract methods becomes very hard, as all naturality squares re-quire to carefully – and consistently – selecting symmetries to commute. Categorical Semantics for Bounded Petri Nets 9
Proposition 3.
The assignment F B ( ): F ( N ) F B ( N ) defines a comonad inthe category of FCMSCs and strict monoidal functors between them, FSSMC . Proof.
As we will prove in Theorem 3, the category F B ( N ) fits in a pullback F B ( N ) Span • F ( N ) Span Qε N UN ♯ We will use the universal property of such pullback to find a comultiplicationand a counit map and to show the comonad laws; an evident candidate to bea counit is the arrow ε N : F B ( N ) → F ( N ); a candidate comultiplication map α N : F B ( N ) ⇒ F B ( N ) is obtained from the diagram F B ( N ) F B ( N ) Span • F B ( N ) Span α Q Q ε UN ♯ As the unique red arrow filling the diagram above, if N ♯ is the common value ofthe diagonal ε N N ♯ = Q U as in Section 4, and the pair ( Q , ε ) is obtainediterating the pullback of Section 4.Now that we have the candidate maps (obviously natural in their component,because they are defined via a universal property that is functorial in F ( N )), werecall the comonad laws in the component N : F B ( N ) F B ( N ) F B ( N ) F B ( N ) α N α N α F B ( N ) F B ( α N ) F B ( N ) F B ( N ) F B ( N ) F B ( N ) F B ( ε N ) ε F B ( N ) α N α N The laws are shown as follows: – The coassociativity requires us to compute the arrows F B ( α N ) and α F B ( N ) :First, we build the definition of F B ( N ), as the upper left corner in thediagram F B ( N ) Span • F B ( N ) Span • F B ( N ) Span • F ( N ) Span Q ε α F B ( N ) Q ε α N Qε N UN ♯ Now, according to the definitions, α F B ( N ) is the arrow working as a rightinverse of ε , whereas F B ( α N ) results from the diagram F B ( N ) F B ( N ) Span • F B ( N ) Span • F B ( N ) Span F B ( N ) Span α N Q ε UQ ε F B ( α N ) UN ♯ N ♯ α N The coassociativity property is implied from the fact that ( α N α F B ( N ) ε = α N F B ( α N ) ε α N α F B ( N ) Q = α N F B ( α N ) Q (1)since the projection maps ( ε , Q ) from a pullback are jointly monic (as alwayswhen computing a limit). Eq. (1) hold because of the commutativities foundso far: α N α F B ( N ) ε = α N id F B ( N ) = id F B ( N ) α N = α N ε α N = α N F B ( α N ) ε α N α F B ( N ) Q = α N α F B ( N ) Q id Span • = α N α F B ( N ) ε Q = α N id F B ( N ) Q = α N Q id Span • = α N F B ( α N ) Q – The left and right counit laws follow from a similar chain of reasoning, andall in all from the definition of the counit and comultiplication.As for the commutative case, we now want to provide a semantics that is theexternal counterpart of Definition 8. Definition 6 can be ported almost verbatim:
Definition 9 (Non-local semantics – individual-token philosophy).
Let N be a Petri net and let S be a monoidal bicategory. A Petri net with a non-localsemantics is a couple (cid:0)
N, N ♯ (cid:1) , with N ♯ a lax-monoidal-lax functor F ( N ) → S .A morphism (cid:0) N, N ♯ (cid:1) → (cid:0) M, M ♯ (cid:1) of Petri nets with non-local semantics is astrict monoidal functor F ( N ) F −→ F ( M ) making the obvious triangle commute.Overloading notation, we denote the category of Petri nets with a non-localsemantics with Petri S . Categorical Semantics for Bounded Petri Nets 11
Yet, actually producing a lax-monoidal-lax functor F ( N ) → Span akin tothe one in Definition 7 is not as easy: As pointed out in Example 2, in the com-mutative case, it doesn’t really matter which object we apply a given morphismto, but only how many objects of some sort are turned into objects of someother sort. This allowed us to represent morphisms between anti-places usingspans with the preimage of χ in their tips, and kept things manageable at thelevel of intuition.When non-trivial symmetries are around, the causal relationship betweenmorphisms becomes meaningful: for instance f g and f ⊗ g will in general actvery differently on objects. Moreover, looking at the fibre of χ over a morphismgenerator f , we can describe it quite explicitly as the set of all (possibly empty)stackings of string diagrams h σEσW σNEσNσNW σSEσSσSW where various symmetries σ W , σ E , σ NE , . . . “surround” f on each side. If f isan identity, say over an object A , then χ − (1 A ) coincides with the set of allsymmetries of F ( N ), making it clear that a lax-monoidal-lax semantics for theindividual-token case won’t preserve identities strictly. With such a great deal of technicality, generalizing Definition 5 “manually” caneasily go wrong. As we did already in [9], we solve the problem by inverting ourreasoning: We will use abstract machinery to obtain a lax-monoidal-lax functorfrom the counit F B ( N ) → F ( N ) of the comonad in Proposition 3, in such a waythat the isomorphism with F B ( N ) will be guaranteed after internalizing. Definition 10 (Total category, [15]).
Let C be a 1-category, regarded as alocally discrete bicategory, and let F : C →
Span be a lax monoidal-lax functor.Tthe total category of F is the 1-category R F defined as the pullback (in Cat ) R F Span • C Span ε F UF where Span • is the bicategory of spans between pointed sets, and U is theforgetful functor. More concretely, R F is defined as the category having – R F are couples ( X, x ) where X is a 0-cell of C and x ∈ F X . All 2-cells are identities, due to the 2-discreteness of C .2 F. Genovese, F. Loregian, D. Palombi – X, x ) → ( Y, y ) of R F are couples ( f, s ) where f : X → Y is a 1-cellof C and s ∈ S F f with
F f ( s ) = ( x, y ). Representing a span as a function( S, s ) → ( X × Y, ( x, y )) between (pointed) sets, a morphism is a pair ( f, s )such that F f : s ( x, y ). Definition 11.
Let C and D be 1-categories, and let F : D → C be a functor.There is a lax functor
Γ F : C →
Span , with C regarded as a locally discretebicategory, defined as follows: – On objects, C ∈ C is mapped to the set { D ∈ D | F D = C } . – On morphisms, C f −→ C ′ in C is mapped to the span: { D ∈ D | F D = C } dom ←−−− { g ∈ D | F g = f } cod −−→ { D ∈ D | F D = C ′ } The following fact was first observed by J. B´enabou in [5] (see also [12, Th.5.4.5]) where instead of
Span there is the bicategory of profunctors:
Theorem 2 ([15]).
For any category C , There is an equivalence of categories Γ : Cat / C ≃
Cat l [ C , Span ] : R Where
Cat l is the 1-category of categories and lax monoidal functors, and R , Γ are defined as in Definition 10 and Definition 11, respectively. In particular, for F : D → C , R Γ F is isomorphic to D . Relying upon Definition 11, we are ready to define our external semantics.
Definition 12 (External bound semantics – individual-token philos-phy).
We define a lax-monoidal-lax functor N ♯ : F ( N ) → Span as Γ ε N , Where ε N : F B ( N ) → F ( N ) is the functor sending any anti-place to the monoidal unit,and generating morphisms to themselves. Proposition 4.
The functor of Definition 12 is lax-monoidal-lax.
Proof.
That N ♯ is lax is true by definition. We need to prove that it laxly pre-serves the monoidal structure. This is readily done by noticing that N ♯ sends allobjects to the set of multisets on the set of object generators of F B ( N ) whichare in the form A − . This set is isomorphic to S ⊗ , the set of objects of F ( N ),and we obtain an obvious laxator S ⊗ × S ⊗ → S ⊗ by concatenating strings.The laxator diagram commutes only up of a 2-cell, which is to be expectedgiven that we are working with lax-functors. This 2-cell is readily obtained fromthe following inclusion { h ∈ D | F h = f ⊗ g } ⊆ { h ∈ D | F h = f } × { h ∈ D | F h = g } Between the span tips of N ♯ ( f ⊗ g ) and N ♯ f × N ♯ g , respectively. Categorical Semantics for Bounded Petri Nets 13
Theorem 3.
Let (cid:0)
N, N ♯ (cid:1) be an object of Petri
Span B . The category F B ( N ) of Def-inition 5 is isomorphic to the category resulting from the following pullback in Cat : R N ♯ Span • F ( N ) Span ε N♯ UN ♯ where Span • is the bicategory of spans between pointed sets, and U is the forgetfulfunctor. Explicitly: – Objects of R N ♯ are couples ( X, x ) where X is a object of C and x ∈ N ♯ X . – Morphisms ( X, x ) → ( Y, y ) of R N ♯ are couples ( f, s ) with f : X → Y amorphism of C and s ∈ S N ♯ f such that N ♯ f ( s ) = ( x, y ) .Proof. Unrolling definitions, this is just Theorem 2.
In this work, we proved how the functorial semantics approach developed in [10]to model guarded nets can be generalized to include other traditionally familiarconstructions such as bounding. To achieve such a result, we refined a techniquealready developed in [9], by endowing nets with a lax-monoidal-lax functorialsemantics. This is a conceptually relevant leap: if in [10] strong monoidal functorsendowed tokens with properties that could be only locally true, in [9] and heretokens can be endowed with properties about the global state of the net (such asdistributions of tokens in other places). The tension between the intrinsic localnature of tokens and the global properties they are endowed with is mediated bythe laxity requirements, that allow considering ensembles of tokens as one thing.Mathematically, our deepest contribution is proving how the formalism offunctorial semantics is mature enough to scale to complicated situations, suchas non-local semantics in the presence of symmetries. This requires adopting ahigher-categorical point of view, and resorting to the fully abstract descriptionof many constructions that we were able to implement naively in the collective-token case.As for directions of future work, we want to investigate what else our for-malism can cover, hierarchic nets [11] and nets with inhibitor arcs [24, 23] beingstrong candidates. In general, we are now convinced of the following fact, whichwe consider a significative conceptual contribution:
Studying the categorical semantics of extensions of Petri nets amounts toclassifying lax functors
C →
Span with C free (commutative, symmetric)monoidal. References [1] J. C. Baez, F. Genovese, J. Master, and M. Shulman.
Categories of Nets .2021. arXiv: (cit. on p. 4).[2] J. C. Baez and J. Master. “Open Petri Nets”. In:
Mathematical Structuresin Computer Science (cit. onp. 4).[3] J. C. Baez and B. S. Pollard. “A Compositional Framework for ReactionNetworks”. In:
Reviews in Mathematical Physics (cit. on p. 2).[4] P. Baldan, F. Bonchi, and F. Gadducci. “Encoding Asynchronous Inter-actions Using Open Petri Nets”. In:
CONCUR 2009 - Concurrency The-ory . Ed. by M. Bravetti and G. Zavattaro. Vol. 5710. Berlin, Heidelberg:Springer Berlin Heidelberg, 2009, pp. 99–114 (cit. on p. 4).[5] J. B´enabou. “Introduction to Bicategories”. In: J. B´enabou, R. Davis, A.Dold, J. Isbell, S. MacLane, U. Oberst, and J. .-E. Roos.
Reports of theMidwest Category Seminar . Vol. 47. Berlin, Heidelberg: Springer BerlinHeidelberg, 1967, pp. 1–77 (cit. on p. 12).[6] R. Bruni, H. Melgratti, U. Montanari, and P. Sobocinski. “Connector Al-gebras for C/E and P/T Nets’ Interactions”. In:
Logical Methods in Com-puter Science (cit. onp. 4).[7] F. Genovese, A. Gryzlov, J. Herold, M. Perone, E. Post, and A. Videla.
Computational Petri Nets: Adjunctions Considered Harmful . 2019. arXiv: (cit. on p. 4).[8] F. Genovese and J. Herold. “Executions in (Semi-)Integer Petri Nets AreCompact Closed Categories”. In:
Electronic Proceedings in TheoreticalComputer Science
287 (2019), pp. 127–144 (cit. on p. 4).[9] F. Genovese, F. Loregian, and D. Palombi.
Nets with Mana: A Frameworkfor Chemical Reaction Modelling . 2021. arXiv: (cit. on pp. 2, 4, 11, 13).[10] F. Genovese and D. I. Spivak. “A Categorical Semantics for Guarded PetriNets”. In:
Graph Transformation . Ed. by F. Gadducci and T. Kehrer.Vol. 12150. Lecture Notes in Computer Science. Cham: Springer Inter-national Publishing, 2020, pp. 57–74 (cit. on pp. 2, 4, 6, 13).[11] K. Jensen and L. M. Kristensen.
Coloured Petri Nets . Berlin, Heidelberg:Springer Berlin Heidelberg, 2009 (cit. on pp. 2, 13).[12] F. Loregian. “Coend Calculus”. In: to appear in
LMS Lecture Notes inMathematics (2020). arXiv: (cit. on p. 12).[13] J. Master. “Petri Nets Based on Lawvere Theories”. In:
MathematicalStructures in Computer Science (cit. on p. 3).[14] J. Meseguer and U. Montanari. “Petri Nets Are Monoids”. In:
Informationand Computation
Cat-egory Theory and Computer Science . Ed. by E. Moggi and G. Rosolini. Red.
Categorical Semantics for Bounded Petri Nets 15 by G. Goos, J. Hartmanis, and J. van Leeuwen. Vol. 1290. Lecture Notesin Computer Science. Berlin, Heidelberg: Springer Berlin Heidelberg, 1997,pp. 147–158 (cit. on pp. 11, 12).[16] C. Petri and W. Reisig.
Petri Net . Scholarpedia. 2008. url : (cit. on p. 2).[17] W. Reisig. Understanding Petri Nets: Modeling Techniques, Analysis Meth-ods, Case Studies . Berlin, Heidelberg: Springer-Verlag, 2013. 230 pp. (cit.on p. 2).[18] R.-C. Riemann.
Modelling of Concurrent Systems: Structural and Seman-tical Methods in the High Level Petri Net Calculus . Munchen: Herbert UtzVerlag, 1999. 252 pp. (cit. on p. 2).[19] V. Sassone. “On the Category of Petri Net Computations”. In:
TAPSOFT’95: Theory and Practice of Software Development . Ed. by P. D. Mosses,M. Nielsen, and M. I. Schwartzbach. Red. by G. Goos, J. Hartmanis, andJ. Leeuwen. Vol. 915. Berlin, Heidelberg: Springer Berlin Heidelberg, 1995,pp. 334–348 (cit. on p. 4).[20] C. J. Schommer-Pries.
The Classification of Two-Dimensional ExtendedTopological Field Theories . 2014. arXiv: (cit. on p. 6).[21] Statebox Team.
The Mathematical Specification of the Statebox Language .2019. arXiv: (cit. on p. 2).[22] R. J. van Glabbeek. “Petri Nets, Configuration Structures and HigherDimensional Automata”. In:
CONCUR’99 Concurrency Theory . Ed. byJ. C. M. Baeten and S. Mauw. Red. by G. Goos, J. Hartmanis, and J.van Leeuwen. Vol. 1664. Lecture Notes in Computer Science. Berlin, Hei-delberg: Springer Berlin Heidelberg, 1999, pp. 21–27 (cit. on p. 2).[23] D. A. Zaitsev. “Universal Petri Net”. In:
Cybernetics and Systems Analysis
A Small Universal Petri net . 2013. arXiv:1309.1274