Nets with Mana: A Framework for Chemical Reaction Modelling
NNets with Mana: A Framework for ChemicalReaction Modelling
Fabrizio Genovese Q [0000 − − − , Fosco Loregian Q , and DanielePalombi Q [0000 − − − University of Pisa [email protected] Tallinn University of Technology [email protected] Sapienza University of Rome [email protected]
Abstract.
We use categorical methods to define a new flavor of Petrinets which could be useful in modelling chemical reactions.
Albeit they have found great use outside their original domain, Petri nets havebeen invented to describe chemical reactions [16]. The interpretation is as simpleas it can get: Places of the net represent types of compounds (be it atoms ormolecules); tokens represent the amount of each compound we have available;transitions represent reactions transforming compounds.
ATPH O ADPP i ATPH O ADPP i (1)Still, things are not so easy in real chemistry: Reactions often need “context” tohappen, be it a given temperature, energy, presence of enzymes and catalysts. Thisis particularly true in biochemical processes, where very complicated reactionsare mediated by enzymes of all sorts. Importantly, these enzymes tend to degradeover time, resulting in reactions that do not keep happening forever [11]. This isone of the (many) reasons why organisms wither and die, but it is not capturedby the picture above, where the transition can fire every time it is enabled.Borrowing the terminology from the popular Turing machine Magic: Thegathering [19, 6] we propose a possible solution to this problem by endowingtransitions in a net with mana [18], representing the “viability” of reactions: a r X i v : . [ m a t h . C T ] J a n F. Genovese, F. Loregian, D. Palombi
Once a reaction is out of mana, it cannot fire anymore. compound Acompound B compound Cmana
Obviously, we could just represent mana by adding another place for eachtransition in a net. Indeed, this is the idea we will start with. Still, beingaccustomed to the yoga of type-theoretic reasoning we are also aware thatthrowing everything in the same bucket rarely is a good idea: Albeit mana can bea chemical compound, it is more realistic to consider it as conceptually separatedfrom the reactions it catalyzes.Resorting to categorical methods, we show how we can axiomatize the ideaof mana in a better way. We do so by relaxing the definitions in the categoricalapproach to coloured nets already developed in [10], defining a functorial seman-tics representing the equipment of a net with mana. Then, we will prove howcategorical techniques allow us to internalize such a semantics, obtaining exactlywhat we represented in the picture above.Finally, we will show how the categorical semantics naturally leads to a furthergeneralization, where transitions not only need mana to function, but also providebyproducts that can be used as mana for other transitions. This allows us torepresent catalysts (i.e. cards ‘adding ∞ to the mana pool’, or rather mana thatdoes not deteriorate over time) and in general nets apt to describe two-layered chemical processes, the first layer being the usual one represented by Petri netsand the second layer being the one of enzymes and catalysts being consumed andexchanged by different reactions. Before presenting the construction itself, It is worth recapping the main pointsabout categorical semantics for Petri nets. The definition of net commonly usedin the categorical line of work is the following:
Notation 1.
Let S be a set; denote with S ⊕ the set of multisets over S . Multisetsum will be denoted with ⊕ , multiplication with (cid:12) and difference (only partiallydefined) with (cid:9) . S ⊕ with ⊕ and the empty multiset is isomorphic to the freecommutative monoid on S . Definition 1 (Petri net).
We define a
Petri net as a couple functions T s,t −→ S ⊕ for some sets T and S , called the set of places and transitions of the net,respectively. An unrelated categorical approach to nets with catalysts can be found in [2].ets with Mana: A Framework for Chemical Reaction Modelling 3 A morphism of nets is a couple of functions f : T → T (cid:48) and g : S → S (cid:48) suchthat the following square commutes, with g ⊕ : S ⊕ → S (cid:48)⊕ the obvious lifting of g to multisets: S ⊕ T S ⊕ S (cid:48)⊕ T (cid:48) S (cid:48)⊕ ss (cid:48) t (cid:48) tg ⊕ g ⊕ f Petri nets and their morphisms form a category, denoted
Petri . Details can befound in [14].
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 eabled in a marking M if M (cid:9) s ( u ) is defined. An enabled transition can fire ,moving tokens in the net. Firing is considered an atomic event, and the markingresulting from firing u in M is M (cid:9) s ( u ) ⊕ t ( u ).Category theory provides a slick definition to represent all the possible ex-ecutions of a net – all the ways one can fire transitions starting from a givenmarking – as morphisms in a category. There are various ways to do this [14,13, 17, 8, 9, 3], depending if we want to consider tokens as indistinguishable(common-token philosophy) or not (individual-token philosophy). In this work,we focus on chemical reactions. Since atoms and molecules of the same kind areconsidered to be physically indistinguishable, we will adopt the common-tokenphilosophy point of view. In this case, the category of executions of a net is a commutative monoidal category – a monoidal category whose monoid of objectsis commutative. 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 Definition 3 (Category of executions – common-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: F. Genovese, F. Loregian, D. Palombi – 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 morphism gener-ator ( u, su, tu ), pictorially represented as an arrow su u −→ tu ; morphisms areobtained by considering all the formal (monoidal) compositions of generatorsand identities.A detailed description of this construction can be found in [13].As shown in the picture above, objects in C ( N ) represent markings of a net: A ⊕ A ⊕ B means “two tokens in A and one token in B ”. Morphisms representexecutions of a net, mapping markings to markings. A marking is reachable fromanother one if and only if there is a morphism between them.The correspondence between Petri nets and their executions is categoricallywell-behaved, defining an adjunction between the category Petri and the category
CSMC of commutative strict monoidal categories, with Definition 3 buildingthe left-adjoint
Petri → CSMC . Details can be found in [13].
The idea presented in the introduction can na¨ıvely be formalised by just attachingan extra input place to any transition in a net, representing the mana a giventransition can consume. We call the following construction internal because itbuilds a category directly, in contrast with an external equivalent constructiongiven in Definition 6.
Definition 4 (Internal mana construction).
Let N : T s,t −→ S ⊕ be a Petrinet, and consider C ( N ), its corresponding FCSMC. The internal mana construc-tion of N is given by the FCSMC C M ( N ) generated as follows: – The generating objects of C M ( N ) are the coproduct of the generating objectsof C ( N ) and T ; – For each generating morphism A ⊕ · · · ⊕ A n u −→ B ⊕ · · · ⊕ B m in C ( N ), we introduce a morphism generator in C M ( N ): A ⊕ · · · ⊕ A n ⊕ u u −→ B ⊕ · · · ⊕ B m Notice that the writing above makes sense because u is an element of T .Because of the adjunction between Petri and
CSMC , every FCSMC ispresented by a Petri net. The category of Definition 4 is presented preciselyby the net obtained from N as we did in Section 1: The additional generatingobjects of C M ( N ) represent the places containing the mana associated with eachtransition. ets with Mana: A Framework for Chemical Reaction Modelling 5 Example 1.
Performing the construction in Definition 4 on the category of exe-cutions of the net on the left gives the category of executions of the net on theright, as we expect: compound Acompound B compound C compound Acompound B compound Cmana
Proposition 1.
The assignment C ( N ) (cid:55)→ C M ( N ) defines a comonad in thecategory 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 M ( F ) : C M ( N ) → C M ( M ) as the following monoidal functor: – C M ( F ) agrees with F on generating objects coming from C ( N ). If u is agenerating morphism of C ( N ) and it is F u = f , then C M ( F ) u = f N , with f N being the multiset counting how many times each generating morphismof C ( M ) is used in f . – C M ( F ) agrees with F on generating morphisms.Identities and compositions are clearly respected, making C M ( ) an endofunctorin FCSMC . As a counit, on each component N we define the strict monoidalfunctor (cid:15) N : C M ( N ) → C ( N ) sending: – Generating objects coming from C ( N ) to themselves, every other generatingobject to the monoidal unit. – Generating morphisms are sent to themselves.The procedure is natural in the choice of N , making (cid:15) into a natural transformation C M ( ) → id FCSMC .As for the comultiplication, on each component N we define the strict monoidalfunctor δ N : C M ( N ) → C M ( C M ( N )) sending: – Generating objects coming from C ( N ) to themselves, every other generatingobject u is sent to u ⊕ u . – Generating morphisms are again sent to themselves.Naturality of δ and the comonadicity conditions are a straightforward check. This makes sense since C ( M ) is free, hence decomposition of morphisms in terms of(monoidal) compositions of generators and identities is unique modulo the axioms ofmonoidal categories, which do not introduce nor remove generating objects. F. Genovese, F. Loregian, D. Palombi As we stressed in Section 1, the construction as in Definition 4 has the disadvantageof throwing everything in the same bucket: In performing it, we do not keep anymore a clear distinction between the different layers of our chemical reactionnetworks, given by mana and compounds.In the spirit of [10], we now recast the mana construction externally , as Petrinets with a semantics attached to them. A semantics for a Petri net is a functorfrom its category of executions to some other monoidal category S .A huge conceptual difference is that in [10] this functor was required to bestrict monoidal. This backed up the interpretation that a semantics “attachesextra information to tokens”, to be used by the transitions in some way. In here,we require this functor to be lax-monoidal : Lax-monoidality amounts to say thatwe can attach non-local information to tokens: Tokens may “know” somethingabout the overall state of the net and the laxator represents the process of “tokensjoining knowledge”.In terms of mana construction, we want to endow each token with a local“knowledge” of how much mana each transition has available. Laxating amountsto consider ensembles of tokens together – as entangled, if you wish – where theirknowledge is merged. Example 2. u v mana u : 3mana v : 0mana u : 1mana v : 8 u v mana u : 4mana v : 8Laxator If token a knows that transition f has 3 mana left, and token b knows thattransitions f and g have 1 and 8 mana left, respectively, then tokens a and b ,considered together, know that transitions f and g have 3 + 1 = 4 and 0 + 8 = 8mana left, respectively. Definition 5 (Non-local semantics – common-token philosophy).
Let N be a Petri net and let S be a monoidal category. A Petri net with a non-localcommutative semantics is a couple (cid:0)
N, N (cid:93) (cid:1) , with N (cid:93) a lax-monoidal functor C ( N ) → S . A morphism (cid:0) N, N (cid:93) (cid:1) → (cid:0) M, M (cid:93) (cid:1) of Petri nets with commutativesemantics is a strict monoidal functor C ( N ) F −→ C ( M ).We denote the category of Petri nets with a non-local commutative semanticswith Petri S .We now provide an external version of the mana construction. Notation 2.
We denote with
Span the bicategory of sets, spans and spanmorphisms between them. Recall that a morphism A → B in Span consists of aset S and a pair of functions A ← S → B . When we need to notationally extractthis information from f , we write A f ←− S f f −→ B . We sometimes consider aspan as a morphism f : S f → A × B , thus we may write f ( s ) = ( a, b ) for s ∈ S f ets with Mana: A Framework for Chemical Reaction Modelling 7 with f ( s ) = a and f ( s ) = b . Recall moreover that a 2-cell in Span f ⇒ g is afunction θ : S f → S g such that f = θ (cid:35) g . Definition 6 (External mana construction).
Given a Petri net N : T s,t −→ S ⊕ , define the following functor N (cid:93) : C ( N ) → Span : – Each object A of C ( N ) is mapped to the set T ⊕ , the set of multisets overthe transitions of N ; – Each morphism A f −→ B is sent to the span N (cid:93) f defined as: T ⊕ −⊕ f N ←−−−− T ⊕ = T ⊕ With f N being the multiset counting how many times each generating mor-phism of C ( M ) is used in f . Proposition 2.
The functor of Definition 6 is lax monoidal. Functors as in Def-inition 6 form a subcategory of
Petri
Span , which we call
Petri M . Proof.
Functor laws are obvious: id N A is the empty multiset for each object A ,hence N (cid:93) id A = id T ⊕ . The composition is preserved since T ⊕ T ⊕ T ⊕ T ⊕ T ⊕ T ⊕−⊕ g N −⊕ g N −⊕ f N = T ⊕ T ⊕ T ⊕−⊕ f N ⊕ g N The laxator is the morphism S ⊕ × S ⊕ ⊕ −→ S ⊕ that evaluates two multisets totheir sum, embedded in a span. The naturality condition for the laxator reads: T ⊕ × T ⊕ T ⊕ × T ⊕ T ⊕ T ⊕ N (cid:93) f × N (cid:93) gN (cid:93) ( f ⊕ g ) ⊕ ⊕ And the two morphisms from T ⊕ × T ⊕ → T ⊕ are: T ⊕ × T ⊕ T ⊕ × T ⊕ T ⊕ T ⊕ × T ⊕ T ⊕ × T ⊕ T ⊕ × T ⊕ ⊕ ( −⊕ f N ) × ( −⊕ g N ) = T ⊕ × T ⊕ T ⊕ T ⊕ T ⊕ × T ⊕ T ⊕ T ⊕ × T ⊕ ⊕ ( −⊕ f N ) × ( −⊕ g N ) −⊕ f N ⊕ g N ⊕ which evidently coincide. Interaction with associators, unitors and symmetries isguaranteed by the fact that they are all identities in C ( N ). F. Genovese, F. Loregian, D. Palombi
The external mana construction has the advantage of keeping the reactionlayer and the mana layer completely separated. In this setting, we say that amarking of the net is a couple (
X, u ), with X an object of C ( N ) and u ∈ T ⊕ representing the initial distribution of mana for our transitions. A transition X f −→ Y is again a generating morphism of C ( N ) and we say that it is enabled if N (cid:93) f hits u , or, more explicitly, if u (cid:9) f N is defined. Since f N for f a morphismgenerator is defined to be 0 everywhere and 1 on f , this amounts to say that f isenabled when u ( f ) − ≥
0. In that case, the resulting marking after the firing is(
Y, u ( f ) − Example 3.
Consider the net compound Acompound B compound C
In the marking ( A ⊕ B, C, not enabled in the marking ( A ⊕ B,
0) or ( A, Having given two different definitions of endowing a net with mana, it seemsright to say how the two are connected. As we already stressed, we abide by thepraxis already established in [10] and prove that the external and internal manaconstructions describe the same thing from different points of view :
Theorem 1.
Let (cid:0)
N, N (cid:93) (cid:1) be an object of
Petri M . The category C M ( N ) of Def-inition 4 is isomorphic to the category of elements (cid:82) N (cid:93) . Explicitly: – Objects of (cid:82) N (cid:93) are couples ( X, x ) where X is a object of C M ( N ) and x ∈ N (cid:93) X . – Morphisms ( X, x ) → ( Y, y ) of (cid:82) N (cid:93) are morphisms ( f, s ) with f : X → Y of C M ( N ) and s such that N (cid:93) f s = ( x, y ) .Proof. First of all we need to define a commutative strict monoidal structure on (cid:82) N (cid:93) . Given the particular shape of N (cid:93) , the objects of its category of elementsare pairs where the first component is a multiset on the places of N and thesecond one is a multiset on its transition. Hence we can define:( C, x ) (cid:2) ( D, y ) := ( C ⊕ D, x ⊕ y )(Note that in order to obtain an element in N (cid:93) ( C ⊕ D ), we have implicitlyapplied the laxator ⊕ : N (cid:93) C × N (cid:93) D → N (cid:93) ( C ⊕ D ) to the elements in thesecond coordinate.) Commutativity of (cid:2) follows from the commutativity of ⊕ .On morphisms, if we have ( A , x ) ( f ,s ) −−−−→ ( B , y ) and ( A , x ) ( f ,s ) −−−−→ ( B , y )then it is N (cid:93) f s = ( x , y ) and N (cid:93) f s = ( x , y ), and hence by naturality ets with Mana: A Framework for Chemical Reaction Modelling 9 of the laxator N (cid:93) ( f ⊕ f )( s , s ) = (( x ⊕ x ) , ( y ⊕ y )), allowing us to set f (cid:2) f = f ⊕ f . Associators and unitors are defined as in C ( N ).Now we prove freeness: By definition, objects form a free monoid generatedby couples ( p, I ) and ( I, u ) with p a generating object of C ( N ) (a place of N ), u a generating morphism of C M ( N ) (a transition of N ), and I the tensor unit.These generators are in bijection with the coproduct of places and transitions of N . As such, the monoid of objects of (cid:82) N (cid:93) is isomorphic to the one of C B ( N ).On morphisms, notice that every morphism in (cid:82) N (cid:93) can be written univocally– modulo the axioms of a commutative strict monoidal category – as a compositionof monoidal products of identities and morphisms of the form ( A, u ) ( f,u ) −−−→ ( B, u (cid:48) ),with f a morphism generator in C ( N ) and u = u (cid:48) ⊕ f N .The isomorphism between (cid:82) N (cid:93) and C B ( N ) Follows by observing that thefollowing mappings between objects and morphism generators are bijections:( A, u ) (cid:55)→ A ⊕ u ( A, u ) ( f,u ) −−−→ ( B, u (cid:48) ) (cid:55)→ A ⊕ u f −→ B ⊕ u (cid:48) Example 4.
The internalization of the net in Example 3 gives exactly the netof Example 1.
Focusing more on the external mana construction of Definition 6, we realize thatit is somehow restrictive: It makes sense to map each generating object of anFCSMC C M ( N ) to the set of multisets over the transitions of N . This capturesthe idea of endowing each transition with an extra place representing its mana.On the other hand, the only requirement we would expect on morphisms is that,to fire, a transition must consume mana only from its mana pool. In Definition 6we do much more than this, hardcoding that “one firing = one mana” in thestructure of the functor.A reasonable generalization can be provided by replacing the mapping onmorphisms in Definition 6 with the following span T ⊕ −⊕ ( α (cid:12) f N ) ←−−−−−−− T ⊕ −⊕ ( β f ) −−−−−→ T ⊕ With α and β f arbitrary multisets. In doing so, the only thing we are disallowingin our new definition is for transitions to consume mana of other transitions:Each transition may use only the mana in its own mana pool. Still, it is nowpossible for transitions to: – Fire without consuming mana; – Consume more than 1 unit of mana to fire; – Produce mana – also for other transitions – upon firing.
These are all useful conditions in practical applications. The first models chemicalreactions that do not need any additional compound to work; the second isintended to model reactions that need more than one molecule of a given com-pound to work; the third models both catalysts – which completely regeneratetheir mana at the end of the reactions they aid – and reactions that produce, asbyproducts, enzymes needed by other reactions.
Example 5.
It is worth giving an explicit description of how the internalizedversion of a net as in our temptative generalized definition looks like. In thepicture below, each transition has its own mana, but now this mana does nothave to be necessarily used, as for transition u , or can be used more than once,as for transition u . Furthermore, transitions such as u regenerate their ownmana after firing (catalysts), while transitions such as u and u produce manafor each other, in a closed loop. u also produces more than one kind of mana asbyproduct of its firing. It is worth noticing that this formalism allows to modelnets that never run out of mana, and that we think of as “self-sustaining” [11]. u u u u When looking at technicalities, unfortunately, things are not so easy. Defining α and the family β f so that functorial laws are respected is tricky. Luckilyenough, we do not need to do so explicitly. Indeed, we can generalize the internalmana-net construction of Definition 4 to the following one, that subsumes netsas in Example 5: Definition 7 (Generalized internal mana construction).
Let N : T s,t −→ S ⊕ be a Petri net, and consider C ( N ), its corresponding FCSMC. A generalizedinternal mana construction for N is any FCSMC C M ( N ) such that: – The generating objects of C M ( N ) are the coproduct of the generating objectsof C ( N ) and T ; – Generating morphisms A ⊕ · · · ⊕ A n u −→ B ⊕ · · · ⊕ B m in C ( N ) are in bijection with generating morphisms in C M ( N ): A ⊕ · · · ⊕ A n ⊕ U u −→ U ⊕ B ⊕ · · · ⊕ B m With U a multiset over T being 0 on any u (cid:48) (cid:54) = u , and U being an arbitrarymultiset over T . ets with Mana: A Framework for Chemical Reaction Modelling 11 Notice moreover that, for each generalized mana-net C M ( N ), we obtain a strictmonoidal functor F : C M ( N ) → C ( N ) as in Proposition 1: We send generatingobjects of C ( N ) to themselves, all the other generating objects to the monoidalunit, and generating morphisms to themselves. We keep calling F the counit of C M ( N ), even if it won’t be in general true that we still get a comonad.Counits can be turned into functors C ( N ) → Span using the following pieceof abstract machinery:
Theorem 2 (Grothendieck construction, [15]).
Let C be a category. there isan equivalence Cat / C (cid:39) Cat l [ C , Span ] , with Cat l [ C , Span ] being the category oflax functors C → Span . A functor F : D → C defines a functor Γ F : C → Span as follows: – On objects, C is mapped to the set { D ∈ D | F D = C } ; – On morphisms, C f −→ C (cid:48) is mapped to the span { D ∈ C | F D = C } s ←− { g ∈ D | F f = g } t −→ { D ∈ C | F D = C (cid:48) } The other way around, regarding C as a locally discrete bicategory and letting F : C → Span be a lax functor, F is mapped to the functor Σ F , from the pullback(in Cat ) below: (cid:82) F Span • C Span Σ F UF where Span • is the bicategory of spans between pointed sets, and U is the forgetfulfunctor.More concretely, (cid:82) F is defined as the category (all 2-cells are identities, dueto the 2-discreteness of C ) having – (cid:82) F are couples ( X, x ) where X is a 0-cell of C and x ∈ F X ; – ( X, x ) → ( Y, y ) of (cid:82) 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 (cid:55)→ ( x, y ) .Finally, the categories (cid:82) F and D are isomorphic. This result is a particular case of a more general correspondence between slicecategories and lax normal functors to the category of profunctors [12], whichis well-known in category theory and dates back to B´enabou [5, 4]. It gives afully abstract way to switch from/to and define internal/external semantics formana-nets. Indeed, with a proof partly similar to the one carried out in 1, wecan show that:
Proposition 3.
Monoidality of C M ( N ) F −→ C ( N ) implies Γ F is lax-monoidal.
We can thus define the external semantics of a generalized mana-net byapplying Γ to F . A generalization of Theorem 1 then holds by definition.Summarizing, we were able to show that the mana-net construction can begeneralized to more useful applications, and that the correspondence between a“na¨ıve” internal semantics and a “type-aware” external one is still preserved. Theobvious price we have to pay for our generalization is that our external semanticsis now not just lax-monoidal, but lax-monoidal-lax. In this work, we introduced a new notion of Petri net where transitions comeendowed with “mana”, a quality representing how many times a transition willbe able to fire before losing its effectiveness. We believe this may me especiallyuseful in modelling chemical processes mediated by enzymes that degrade overtime.Importantly, we showed how a categorical point of view on the matter allowsto give two different definitions: A na¨ıve, “hands-on” one, that we called internal ,and a type-aware, functorial one, that we called external , which we proved to betwo faces of the same coin.Indeed, the equivalence between internal and external semantics is the con-sequence of a much deeper result in category theory, connecting slice cateoriesand categories of lax monoidal functors. We were able to rely on this result togeneralize our mana-nets further, while keeping the equivalence between theinternal and external points of view.We believe that further generalizations of the external semantics presentedhere may prove valuable to produce a categorical semantics for nets with inhibitorarcs [1]. An inhibitor arc is an input arc to a transition that is enabled only whenthere are no tokens in its place. This concept is powerful enough to turn Petrinets into a Turing-complete model of computation [20, 21].Indeed, we notice that relaxing Definition 6 to allow any span T ⊕ → T ⊕ , wecan model situations where a transition can fire only if it has no mana (e.g, we canmap transition f to a span that is defined only when its source multiset has value0 on f ). The similarity in behavior with inhibitor arcs is evident, and constitutesa direction of future work that we will surely pursue. The various technicalitiesinvoved are nevertheless tricky, and necessitate a careful investigation.Another direction of future work is about implementing the ideas herebypresented using already available category theory libraries, such as [7]. Acknowledgements
The first author was supported by the project MIUR PRIN 2017FTXR7S “IT-MaTTerS” and by the Independent Ethvestigator Program. The second authorwas supported by the ESF funded Estonian IT Academy research measure (project2014-2020.4.05.19-0001). ets with Mana: A Framework for Chemical Reaction Modelling 13
References [1] T. Agerwala. “Complete model for representing the coordination of asyn-chronous processes”. 1974 (cit. on p. 12).[2] J. C. Baez, J. Foley, and J. Moeller. “Network Models from Petri Netswith Catalysts”. In:
Compositionality
Categories of Nets .2021. arXiv: (cit. on p. 3).[4] J. B´enabou and T. Streicher. “Distributors at work”. Lecture notes writtenby Thomas Streicher. 2000 (cit. on p. 11).[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. 11).[6] A. Churchill, S. Biderman, and A. Herrick. “Magic: The gathering is Turingcomplete”. In: arXiv preprint arXiv:1904.09828 (2019) (cit. on p. 1).[7] F. Genovese, A. Gryzlov, J. Herold, A. Knispel, M. Perone, E. Post, andA. Videla.
Idris-Ct: A Library to Do Category Theory in Idris . 2019. arXiv: (cit. on p. 12).[8] F. Genovese, A. Gryzlov, J. Herold, M. Perone, E. Post, and A. Videla.
Computational Petri Nets: Adjunctions Considered Harmful . 2019. arXiv: (cit. on p. 3).[9] 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. 3).[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 Interna-tional Publishing, 2020, pp. 57–74 (cit. on pp. 2, 6, 8).[11] J. Letelier, J. Soto-Andrade, F. Guinez, A. Cornish-Bowden, and M.C´ardenas. “Organizational invariance and metabolic closure: Analysis interms of M; R systems”. In:
Journal of theoretical biology
238 (2006),pp. 949–61 (cit. on pp. 1, 10).[12] F. Loregian. “Coend Calculus”. In: to appear in
LMS Lecture Notes inMathematics (2020). arXiv: (cit. on p. 11).[13] J. Master. “Petri Nets Based on Lawvere Theories”. In:
MathematicalStructures in Computer Science (cit. on pp. 3, 4).[14] J. Meseguer and U. Montanari. “Petri Nets Are Monoids”. In:
Informationand Computation
Category Theory and Computer Science . Ed. by E. Moggi and G. Rosolini.Red. by G. Goos, J. Hartmanis, and J. van Leeuwen. Vol. 1290. LectureNotes in Computer Science. Berlin, Heidelberg: Springer Berlin Heidelberg,1997, pp. 147–158 (cit. on p. 11). [16] C. Petri and W. Reisig.
Petri Net . Scholarpedia. 2008. url : (cit. on p. 1).[17] 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. 3).[18] Wikipedia.
Magic (Game Terminology) . 2020. url : https://en.wikipedia.org/wiki/Magic_(game_terminology) (cit. on p. 1).[19] Wikipedia. Magic: The Gathering . 2020. url : https://en.wikipedia.org/wiki/Magic:_The_Gathering (cit. on p. 1).[20] D. A. Zaitsev. “Universal Petri Net”. In: Cybernetics and Systems Analysis