{'fraction_non_alphanumeric': 0.033178770599661636, 'fraction_numerical': 0.010652296509806378, 'mean_word_length': 4.447857996245093, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Categorical Semantics for Hierarchical Petri Nets

We show how a particular variety of hierarchical nets, where the firing of a transition in the parent net must correspond to an execution in some child net, can be modelled utilizing a functorial semantics from a free category -- representing the parent net -- to the category of sets and spans between them. This semantics can be internalized via Grothendieck construction, resulting in the category of executions of a Petri net representing the semantics of the overall hierarchical net. We conclude the paper by giving an engineering-oriented overview of how our model of hierarchical nets can be implemented in a transaction-based smart contract environment.


Introduction
This paper is the fourth instalment in a series of works [24,23,22] devoted to describing the semantics of extensions of Petri nets using categorical tools.
Category theory has been applied to Petri nets starting in the nineties [31]; see also [6,11,8,7,3,10,4,9,12,5]. The main idea is that we can use different varieties of free monoidal categories to describe the executions (or runs) of a net [30,20]. These works have been influential since they opened up an avenue of applying high-level methods to studying Petri nets and their properties. For instance, in [2] the categorical approach allowed to describe glueing of nets leveraging on colimits and double categories, while category-theory libraries such as [19] can be leveraged to implement nets in a formally verified way. These libraries implement category theory directly, so that one could translate the categorical definitions defining some model object directly and obtain an implementation.
In [24], we started another line of research, where we were able to define a categorical semantics for coloured nets employing monoidal functors. The Grothendieck construction was then used to internalize this semantics, obtaining the well-known result that coloured nets can be "compiled back" to Petri nets.
In [23,22], we extended these ideas further, and we were able to characterize bounded nets and mana-nets -a new kind of nets useful to model chemical reactions -in terms of generalized functorial semantics.
This approach, based on the correspondence between slice categories and lax monoidal functors to the category of spans [33], has still a lot to give. In this paper, we show how it can be used to model hierarchical nets.
There are a lot of different ways to define hierarchical nets [26,18,32,25,14], which can be seen as a graph-based model. It means that we have one "parent" Petri net and a bunch of "child" nets. A transition firing in the parent net corresponds to some sort of run happening in a corresponding child net. The main net serves to orchestrate and coordinate the executions of many child nets in the underlayer. This paper will contain very little new mathematics. Instead, we will reinterpret results obtained in [24] to show how they can be used to model hierarchical nets, moreover, in a way that makes sense from an implementation perspective.
It is worth noting that category theory in this paper is used in a way that is slightly different than the usage in graph transformations research: We won't be using category theory to generalize definitions and proofs to different classes of graph(-related) objects. Instead, we will employ categorical concepts to actually build a semantics for hierarchical Petri nets.

Nets and their executions
We start by recalling some basic constructions of category theory and some basic facts about Petri nets and their categorical formalization. The notions of bicategory, pseudofunctor, lax functor and bimodule are not strictly necessary to understand this paper: They only show up in results that we cite and that could in principle be taken for granted while skimming on the details. In any case, we list these notions here for the reader interested in parsing these results in full depth. The first definition we recall is the one of bicategory. Intuitively, bicategories are categories where we also allow for "morphisms between morphisms", called 2-cells. This in turn allows to define a version of the associativity and identity laws that is weaker than for usual categories, holding only up to isomorphism.

Definition 1 (Bicategory).
A (locally small) bicategory B consists of the following data.

A family of compositions
defined for any triple of objects A, B,C. This is a family of functors between hom-categories, and its action on morphisms is called horizontal composition of natural transformations, that we denote α • β .

For every object
To this basic structure we add 1. a family of invertible maps α f gh : natural in all its arguments f , g, h, which taken together form the associator isomorphisms; 2. a family of invertible maps which taken together form the left unitor and right unitor isomorphisms.
Finally, these data are subject to the following axioms.
1. For every quadruple of 1-cells f , g, h, k we have that the diagram 2. For every pair of composable 1-cells f , g, Definition 2 (2-category). A 2-category is a bicategory where the associator and unitors are the identity natural transformations. In other words, a 2-category is precisely a bicategory where horizontal composition is strictly associative, and the identities id A work as strict identities for the horizontal composition operation.
Some sources call '2-category' what we call a bicategory, and 'strict 2-category' what we call a 2-category. Something similar happens for monoidal categories: a monoidal category is called strict if its associator and left/right unitors are identity natural transformations. This is not by chance: a (strict) monoidal category V is exactly a (strict) 2-category with a single object * (so that the category V can be identified with the category of endomorphisms of * ).

Example 1.
• There is a 2-category Cat where 0-cells are small categories, and the hom categories Cat(C, D) are the categories of functors and natural transformations. Composition of functors is strictly associative and unital.
• Every category C is trivially a 2-category by taking the 2-cells to be identities. This is sometimes called the 'discrete' 2-category obtained from a category C .
• There is a 2-category where 0-cells are partially ordered sets (P, ≤), and where the category Pos(P, Q) is the partially ordered set of monotone functions f : P → Q and pointwise order ( f g iff ∀p. f p ≤ gp in Q). Composition is strictly associative and unital. Given any diagram of 2-cells like . This is usually called the interchange law in B.
Pseudofunctors and lax functors, defined below, are some of the most widely used notions of morphism between bicategories. These are useful to parse the deep results on which Section 6 relies. These data are subject to the following commutativity conditions for every 1-cell A → B: (we denote invariably α, λ , ρ the associator and unitor of B, C ). A lax functor is defined by the same data, but both the 2-cells µ : F f • Fg ⇒ F( f g) and η : id FA ⇒ F(id A ) can be non-invertible; the same coherence diagrams in Definition 3 hold. A colax functor reverses the direction of the cells µ, η, and the commutativity of the diagrams in Definition 3 changes accordingly.
Another notion that we will make heavy use of is the one of comonad. On the other hand, monads and morphisms between them, called bimodules, will only appear in Theorem 1. We will only use a straightforward consequence of this theorem, and the hurrying reader may not linger too much on these definitions.
Definition 4 (Monad, comonad). Let C be a category; a monad on C consists of an endofunctor T : C → C endowed with two natural transformations • µ : T • T ⇒ T , the multiplication of the monad, and • η : id C ⇒ T , the unit of the monad, such that the following axioms are satisfied: • the multiplication is associative, i.e. the diagram • the multiplication has the transformation η as unit, i.e. the diagram Dually, let C be a category; a comonad on C consists of an endofunctor T : C → C endowed with two natural transformations • σ : T ⇒ T • T , the comultiplication of the comonad, and • ε : T ⇒ id C , the counit of the comonad, such that the following axioms are satisfied: • the comultiplication is coassociative, i.e. the diagram • the comultiplication has the transformation ε as counit, i.e. the diagram . Given a bicategory B having finite colimits (in the 2-categorical sense of [27]), define the 2-category Mod(B) of bimodules as in [38, 2.19]: • 0-cells are the monads in B; • 1-cells T → S are bimodules, i.e. 1-cells H : C → D (assuming T is a monad on C, and S a monad on D) equipped with suitable action maps: ρ : HT → H and λ : SH → H satisfying suitable axioms expressing the fact that T acts on the right over H, via ρ (resp., S acts on the left on H, va λ ); • 2-cells are natural transformations α : H ⇒ K : T → S compatible with the action maps.

Categorical Petri nets
Having recalled some of the category theory we are going to use, we now summarize some needed definitions underlying the study of Petri nets from a categorical perspective.
Notation 1. Let S be a set; a multiset is a function S → N. Denote with S ⊕ the set of multisets over S. Multiset sum and difference (only partially defined) are defined pointwise and will be denoted with ⊕ and , respectively. The set S ⊕ together with ⊕ and the empty multiset is isomorphic to the free commutative monoid on S.
Definition 6 (Petri net). A Petri net is a pair of functions T s,t − → S ⊕ for some sets T and S, called the set of places and transitions of the net, respectively. s,t are called input and output functions, respectively, or equivalently source and target.
A morphism of nets is a pair of functions f : T → T and g : S → S such that the following square commutes, with g ⊕ : S ⊕ → S ⊕ the obvious lifting of g to multisets: Petri nets and their morphisms form a category, denoted Petri. Details can be found in [31]. The main insight of categorical semantics for Petri nets is that the information contained in a given net is enough to generate a free symmetric strict monoidal category representing all the possible ways to run the net. There are multiple ways to do this [34,20,21,30,1]. In this work, we embrace the individual-token philosophy, where tokens are considered distinct and distinguishable and thus require the category in Definition 8 to have non-trivial symmetries.
Definition 8 (Category of executions -individual-token philosophy). Let N : T s,t − → S ⊕ be a Petri net. We can generate a free symmetric strict monoidal category (FSSMC), F (N), as follows: • The monoid of objects is the free monoid generated by S. Monoidal product of objects A, B is denoted with A ⊗ B.
• Morphisms are generated by T : each u ∈ T corresponds to a morphism generator (u, su,tu), pictorially represented as an arrow 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 [30].
In this definition, objects represent markings of a net. For instance, the object 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 if and only if there is a morphism between them. An example is provided in Fig. 1. Figure 1: Graphical representation of a net's execution.

Hierarchical nets
Now we introduce the main object of study of the paper, hierarchical nets. As we pointed out in Section 1, there are many different ways to model hierarchy in Petri nets [26], often incompatible with each other. We approach the problem from a developer's perspective, wanting to model the idea that "firing a transition" amounts to call another process and waiting for it to finish. This is akin to calling subroutines in a piece of code. Moreover, we do not want to destroy the decidability of the reachability relation for our nets [17], as it happens for other hierarchical models such as the net-within-nets framework [28]. We consider this to be an essential requirement for practical reasons.
We will postpone any formal definition to Section 5. In the present work, we focus on giving an intuitive explanation of what our requirements are. Looking at the net in Fig. 2, we see a net on the top, which we call parent. To each transition of the parent net is attached another net, which we call child. Transitions can only have one child, but the parent net may have multiple transitions, and hence multiple children overall. Connecting input and output places of a transition in the parent net with certain places in the corresponding child, we can represent the orchestration by saying that each time a transition in the parent net fires, its input tokens are transferred to the corresponding child net, that takes them across until they reach a place connected with the output place in the parent net. This way, the atomic act of firing a transition in the parent net results in an execution of the corresponding child. Notice that we are not interested in considering the semantics of such hierarchical net to be akin to the one in Fig. 3, where we replaced transitions in the parent net with their corresponding children. Indeed, this way of doing things is similar to what happens in [32]: In this model, transitions in the parent net are considered as placeholders for the children nets. There are two reasons why we distance ourselves from this approach: First, we want to consider transition firings in the parent net as atomic events, and replacing nets as above destroys this property. Secondly, such replacement is not so conceptually easy given that we do not impose any relationship between the parent net's topologies and its children. Indeed, the leftmost transition of the parent net in Fig. 2 consumes two inputs, while the corresponding leftmost transition in its child only takes one. How do we account for this in specifying rewriting-based semantics for hierarchical nets?

Local semantics for Petri nets
We concluded the last section pointing out reasons that make defining a semantics for hierarchical nets less intuitive than one would initially expect. Moreover, requiring the transition firings in the parent net to be considered as atomic events basically rules out the majority of the previous approaches to hierarchical Petri nets, as the one sketched in [26,32]. Embracing an engineering perspective, we could get away with some ad-hoc solution to conciliate that parent and child net topologies are unrelated. One possible way, for instance, would be imposing constraints between the shapes of the parent net and its children. However, in defining things ad-hoc, the possibility for unforeseen corner cases and situations we do not know how to deal with becomes high. To avoid this, we embrace a categorical perspective and define things up to some degree of canonicity.
Making good use of the categorical work already carried out on Petri nets, our goal is to leverage it and get to a plausible definition of categorical semantics for hierarchical nets. Our strategy is to consider a hierarchical net as an extension of a Petri net: The parent net will be the Petri net we extend, whereas the children nets will be encoded in the extension. This is precisely the main idea contained in [24], that is, the idea of describing net extensions with different varieties of monoidal functors. Indeed, we intend to show how the theory presented in [24], and initially serving a wholly different purpose, can be reworked to represent hierarchical nets with minimal effort.
As for semantics, we will use strict monoidal functors and name it local because the strict-monoidality requirement amounts to endow tokens with properties that cannot be shared with other tokens. To understand this choice of naming a little bit better, it may be worth comparing it with the notion of non-local semantics, defined in terms of lax-monoidal-lax functors, that we gave in [23]. Nets equipped with S -semantics and their morphisms form a monoidal category denoted Petri S , with the monoidal structure arising from the product in Cat.
In [24], we used local semantics to describe guarded Petri nets, using Span as our category of choice. We briefly summarize this, as it will become useful later.
Definition 10 (The category Span). We denote by Span the 1-category of sets and spans, where isomorphic spans are identified. This category is symmetric monoidal. From now on, we will work with the strictified version of Span, respectively.

Notation 2. Recall that a morphism A → B in Span consists of a set S and a pair of functions A ← S → B.
When we need to extract this data from f , we write We sometimes consider the span as a function f : S f → A × B, thus we may write f (s) = (a, b) for s ∈ S f with f 1 (s) = a and f 2 (s) = b.
Definition 11 (Guarded nets with side effects). A guarded net with side effects is an object of Petri Span . A morphism of guarded nets with side effects is a morphism in Petri Span .

Example 2. Let us provide some intuition behind the definition of Petri Span .
Given a net N, its places (generating objects of F (N)) are sent to sets. Transitions (generating morphisms of F (N)) are mapped to spans. Spans can be understood as relations with witnesses, provided by elements in the apex of the span: Each path from the span domain to its codomain is indexed by some element of the span apex, as it is shown in Fig. 4. Witnesses allow considering different paths between the same elements. These paths represent the actions of processing the property a token is enowed with according to some side effect. Indeed, 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 chosen path, which we interpret as having side-effects interpreted outside of our model. In Fig. 4 the composition of paths is the empty span: Seeing things from a reachability point of view, the process given by firing the left transition and then the right will never occur. This is because the rightmost transition has a guard that only accepts yellow tokens, so that a green token can never be processed by it. This is witnessed by the fact that there is no path connecting the green dot with any dot on its right. The relation with reachability can be made precise by recasting Definition 8.
Definition 12 (Markings for guarded nets). Given a guarded Petri net with side effects N, N , a marking for N, N is a pair (X, x) where X is an object of F (N) and x ∈ N X. We say that a marking (Y, y) is reachable from (X, x) if there is a morphism f : X → Y in F (N) and an element s ∈ S f such that N f (s) = (x, y). In the span semantics we can encode externalities in the tips of the spans to which we send transitions. That is, given a bunch of tokens endowed with some properties, to fire a transition, we need to provide a witness that testifies how these properties have to be handled. The central intuition of this paper is that we can use side effects to encode the runs of some other net: To fire a transition in the parent net, we need to provide a trace of the corresponding child net. So we are saying that to fire a transition in the parent net, a valid execution of the corresponding child net must be provided. Relying on the results in Section 2, we know that such valid executions are exactly the morphims in the free symmetric strict monoidal category generated by the child net. Putting everything together, we want the tips of our spans to "represent" morphisms in the monoidal categories corresponding to the children nets. The following result makes this intuition precise, explaining how monoidal categories and spans are related: It is worth pointing out, at least intuitively, how this result works: Given a category C , we denote with C • and C → the sets 1 of objects and morphisms of C , respectively. Then we can form a span:

Theorem 1 ([38, Section 2.4.3]). Given a category A with finite limits, a category internal in
where the legs send a morphism to its domain and codomain, respectively. This is clearly not enough, since in a category we have a notion of identity and composition, but asking for a monad provides exactly this. For instance, the monad multiplication in this setting becomes a span morphism which gives composition of arrows. Similarly, the monad unit singles out identities, and the monad laws witness the associativity and identity laws. In a similar way, monoidal categories are represented as above, but we furthermore require C • and C → to be endowed with a monoid structure (representing the action of the monoidal structure on the objects and morphisms of C , respectively), and that this structure is preserved by the span legs, while the bimodule structure on top of the monad witnesses the monoidal symmetries.
For the scope of our applications, we remember that each Petri net N generates a free symmetric strict monoidal category F (N), which will correspond to a bimodule in Span(Mon). So, in particular, we have a span of monoids 2 underlying a bimodule, with N • and N → , representing the objects and arrows of the category, respectively, both free. We will refer to such a span as the FSSMC N (in Span(Mon)).
Definition 14 (Category of hierarchical Petri nets). Nets N, N in the category Petri Span with N having the shape of Definition 13 form a subcategory, denoted with Petri , and called the category of hierarchical Petri nets.
Remark 3. Using the obvious forgetful functor Mon → Set we obtain a functor Span(Mon) → Span, which allows to recast our non-local semantics in a more liberal setting. In particular, we could send a transition to spans whose components are subsets of the monoids heretofore considered. We could select only a subset of the executions/states of the child net as valid witnesses to fire a transition in the parent. Everything we do in this work will go through smoothly, but we consider this approach less elegant; thus, we will not mention it anymore.

Internalization
In Section 5 we defined hierarchical nets as nets endowed with a specific kind of functorial semantics to Span. As things stand now, Petri nets correspond to categories, while hierarchical nets correspond to functors. This difference makes it difficult to say what a Petri net with multiple levels of hierarchy is: intuitively, it is easy to imagine that the children of a parent net N can be themselves parents of other nets, which are thus "grandchildren" of N, and so on and so forth.
In realizing this, we are blocked by having to map N to hierarchical nets, which are functors and not categories. To make such an intuition viable, we need a way to internalize the semantics in Definition 13 to obtain a category representing the executions of the hierarchical net.
Luckily, there is a way to turn functors into categories, which relies on an equivalence between the slice 2-category over a given category C , denoted Cat/C , and the 2-category of lax-functors C → Span [33]. This is itself the "1-truncated" version of a more general equivalence between the slice of Cat over C , and the 2-category of lax normal functors to the bicategory Prof of profunctors (this has been discovered by Bénabou [13]; a fully worked out exposition, conducted in full detail, is in [29]).
Here, we gloss over these abstract motivations and just give a very explicit definition of what this means, as what we need is just a particular case of the construction we worked out for guarded nets in [24].
Definition 15 (Internalization). Let M, M ∈ Petri be a hierarchical net. We define its internalization, denoted M , as the following category: • The objects of M are pairs (X, x), where X is an object of F (M) and x is an element of M X. Concisely: and s ∈ S M f in the apex of the corresponding span that connects x to y. Concisely: The category N , called the Grothendieck construction applied to N , produces 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 in Figure 5. Notice that in Fig. 5, on the left, each path between coloured dots is a triple (a, x, b) as in Remark 2. This amounts to promote every possible trace of the child net -together with a selection of initial and accepting states -to a transition in the parent net. This interpretation is justified by the following theorem, which we again proved in [24]: Theorem 2 defines a functor Petri Span → FSSMC, the category of FSSMCs and strict monoidal functors between them. As Petri is a subcategory of Petri Span , we can immediately restrict Theorem 2 to hierarchical nets. A net in the form N for some hiearchical net N, N is called the internal categorical semantics for N (compare this with Definition 13, which we called external).
Remark 4. Notice how internalization is very different from just copy-pasting a child net in place of a transition in the parent net as we discussed in Section 3. Here, each execution of the child net is promoted to a transition, preserving the atomicity requirement of transitions in the parent net.
Clearly, now we can define hierarchical nets with a level of hierarchy higher than two by just mapping a generator f of the parent net to a span where N f is in the form N for some other hierarchical nets N, and the process can be recursively applied any finite number of times for each transition.

Engineering perspective
We deem it wise to spend a few words on why we consider this way of doing things advantageous from an applicative perspective. Petri nets have been considered as a possible way of producing software for a long time, with some startups even using them as a central tool in their product offer [35]. Providing some form of hierarchical calling is needed to make the idea of "Petri nets as a programming language/general-purpose design tool" practical. Our definition of hierarchy has the advantage of not making hierarchical nets more expressive than Petri nets. If this seems like a downside, notice that a consequence of this is that decidability of any reachability-related question is exactly as for Petri nets, which is a great advantage from the point of view of model checking. The legitimacy of this assertion is provided by internalization, that allows us to reduce hierarchical nets back to Petri nets. A further advantage of this is that we can use already widespread tools for reachability checking [37] to answer reachability questions for our hierarchical nets, without having necessarily to focus on producing new ones.
Moreover, and more importantly, our span formalism works really well in modelling net behaviour in a distributed setting. To better understand this, imagine an infrastructure where each Petri net is considered as a smart contract (as it would be, for instance, if we were to implement nets as smart contracts on a blockchain). A smart contract is nothing more than a piece of code residing at a given address. Interaction with smart contracts is transactional: One sends a request to the contract address with some data to be processed (for example a list of functions to be called on some parameters). The smart contract executes as per the transaction and returns the data processed.
In our Petri net example things do not change: A user sends a message consisting of a net address, the transaction the user intends to fire, and some transaction data. The infrastructure replies affirmatively or negatively if the transaction can be fired, which amounts to accept or reject the transaction. As we already stressed, this is particularly suitable for blockchain-related contexts and it is how applications such as [36] implement Petri nets in their services. from: 832344009d to: dbbfe69836 command: OK data: Figure 6: In this diagram we describe the interaction between a user and a net, with downward pointing arrows representing the flow of time. The user, having id dbbfe69836, sends a request to a net having address 832344009d. The user is requesting to fire transition t 1 in the net. As the transition is enabled and able to fire, the request is granted, the state of the net updated, and a reply to the user is sent.
From this point of view, a hierarchical net would work exactly as a standard Petri net, with the exception that in sending a transaction to the parent net, the user also has to specify, in the transaction data, a proper execution of the child net corresponding to the firing transition.
Again, from a smart contract standpoint, this means that the smart contract corresponding to the parent net will call the contract corresponding to the child net with some execution data, and will respond from: dbbfe69836 to: 832344009d command: t 1 data:u 1 u 2 from: 832344009d to: 2f9b1ee0dc command: u 1 u 2 data: from: 2f9b1ee0dc to: 832344009d command: OK data: from: 832344009d to: dbbfe69836 command: OK data: Figure 7: In this diagram we describe the interaction between a user and a hierarchical net. This time the user, having id dbbfe69836, sends a request to a net having address 832344009d. This net is hierarchical, so in calling transition t 1 in the parent net, the user has also to provide a valid execution for its child. This is provided as transaction data, in this case u 1 u 2 . The parent net stores the address to the child net corresponding to t 1 , which in this case is 2f9b1ee0dc. The request to fire u 1 and then u 2 is forwarded to 2f9b1ee0dc, which changes its state and responds affirmatively. This means that 832344009d can itself change its state and respond affirmatively to dbbfe69836. Should any of these steps fail, the entire transaction is rejected and each net reverts to its previous state.
affirmatively to the user only if the generated call resolves positively.
Recalling the results in previous sections of this work, all the possible ways of executing the contracts above form a category, which is obtained by internalizing the hierarchical net via Theorem 2. Internalized categories being free, they are presented by Petri nets, which we can feed to any mainstream model checker. Now, all sorts of questions about liveness and interaction of the contracts above can be analyzed by model-checking the corresponding internalized net. This provides an easy way to analyze complex contract interaction, relying on tools that have been debugged and computationally optimized for decades.

Conclusion and future work
In this work, we showed how a formalism for guarded nets already worked out in [24] can be used to define the categorical semantics of some particular variety of hierarchical nets, which works particularly well from a model-checking and distributed-implementation point of view. Our effort is again part of a more ample project focusing on characterizing the categorical semantics of extensions of Petri nets by studying functors from FSSMCs to spans [23,22].
As a direction of future work, we would like to obtain a cleaner way of describing recursively hierarchical nets. In this work, we relied on the Grothendieck construction to internalize a hierarchical net, so that we could use hierarchical nets as children of some other another parent net, recursively. This feels a bit like throwing all the carefully-typed information that the external semantics gives into the same bucket, and as such it is a bit unsatisfactory. Ideally, we would like to get a fully external semantics for recursively hierarchical nets, and generalize the internalization result to this case.
Another obvious direction of future work is implementing the findings hereby presented, maybe relying on some formally verified implementation of category theory such as [19].