The Possibilities of Modeling Petri Nets and Their Extensions

This chapter is dedicated to several structure features of Petri nets. There is detailed description of appropriate access in Petri nets and reachable tree mechanism construction. There is an algorithm that describes the minimum sequence of possible transitions. The algorithm developed by us finds the shortest possible sequence for the network promotion state, which transfers the mentioned network state to the coverage state. The corresponding theorem is proven, which states that due to the describing algorithm, the number of transitions in the covering state is minimal. This chapter studies the interrelation of languages of colored Petri nets and traditional formal languages. The Venn diagram, modified by the author, is presented, which shows the relationship between the languages of the colored Petri nets and some traditional languages. As a result, it is shown that the language class of colored Petri nets includes an entire class of context-free languages and some other classes. The results obtained show that it is not possible to model the Patil problem using the well-known semaphores P and V or classical Petri nets, so the mentioned systems have limited properties.


Introduction
Modeling and designing systems cannot be imagined without the use of computer technology. When creating automated systems and designing them, the problem of choosing a formal model for representing systems first arises. From the model through the algorithmic to the software-this is the way of modern modeling and system design. When considering lumped physical systems, a convenient model is a linear graph, each vertex of which corresponds to a functional or constructive component, and an arc to a causal relationship.
Petri nets are a mathematical apparatus for modeling dynamic discrete systems. Their feature is the ability to display parallelism, asynchrony, and hierarchy. They were first described by Karl Petri in 1962.
The Petri net is a bipartite oriented graph consisting of two types of verticespositions and transitions-connected by arcs between each other; vertices of the same type cannot be directly connected. Positions can be placed tags (markers) that can move around the network [1].
Petri net-a tool for modeling dynamic systems. The theory of Petri nets makes it possible to model a system with a mathematical representation of it in the form of a Petri net, the analysis of which helps to obtain important information about the structure and dynamic behavior of the simulated system.
There are several ways of practical application of Petri nets in the design and analysis of systems. In one of the approaches, the Petri nets are considered as an auxiliary analysis tool. Here, to build the system, generally accepted design methods are used, then the constructed system is modeled by the Petri net, and the constructed model is analyzed.
In another approach, the entire process of design and characterization is carried out in terms of Petri nets. In this case, the task is to transform the representation of the Petri net into a real information system [2].
The undoubted advantage of Petri nets is a mathematically rigorous description of the model. This allows their analysis with the help of modern computing techniques (including those with a massively parallel architecture) [1].
In modern society, reliable transmission and protection of information are of wide use and are topical tasks. The main task of Petri nets is the modeling of realistic systems from the point of view of optimization. Systematic study of the properties of Petri nets and the possibility of using them for solving applied problems, mainly problems related to models and means of parallel processing of information.
The following issues can serve as examples of those problems that often arise in the design and study of discrete systems: • Does the system perform the functions for which it is intended?
• Does it function effectively?
• Can mistakes and emergencies occur in it?
• Does it have potential bottlenecks?
• Is it possible to simplify the system or replace its individual components and subsystems with more perfect ones, without disturbing its overall functioning?
• Is it possible to design more complex systems that meet the specified requirements from these systems, etc.?
These tasks are basically "qualitative" not quantitative. The goal of in-depth study of various extensions of Petri nets (from the point of view of optimization) for modeling real-time systems brings to the design of such technical equipment where one has to minimize resource costs and time and maximize speed.
Colored petri net (CPN) modeling mechanisms are a convenient graphic language for designing, modeling, and testing systems [3][4][5][6][7]. They are well suited for systems that discuss interaction issues and synchronize. The colored Petri nets are well suited for modeling distributed systems, automated production systems, and for the design of VLSI circuit chips [8][9][10].
Colored Petri nets are called if the chips are the values of some types of data, which are usually called color sets. Expressions are assigned to arcs in such a network. When transitions are triggered, the values of expressions on arcs are calculated. The results of the calculations are extracted from the markup of the input transition points and placed in the marking of the output points. Transitions may be assigned with security expressions. If the guard expression assumes the value "false," the transition is prohibited [3-6, 11, 12].
The language generated by CPN allows to represent a model that is a collection of modules, allowing you to hierarchically represent complex networks or systems.
In classical Petri nets, the tokens do not differ from each other; they are colorless. In colored Petri nets, a position can contain chips that are of arbitrary complexity, such as lists, etc., that allow you to simulate more reliable models [8][9][10]13].

The algorithm description of the shortest possible sequence of transitions in petri nets
To build models of discrete systems, it needs various components of the system with abstract operations: switching the transition from one state to another; the action of a program operator, machine, or conveyor; interruptions in the operating system; phase completion in the project; etc. The same system can work differently under different conditions, generating many processes that will bring nondeterministic work. In real systems, cases occur at certain periods and last a certain time. In synchronous models of discrete systems, events are correctly associated with certain pauses, moments during which all components simultaneously change the state of the system, changing the state of the system.
The modeling approach has several drawbacks when dealing with large systems. To make the model look impressive, first of all, with every change, the system must take into account all the components of its general condition.
Secondly, with the above approach, information in systems disappears between random links.
Thirdly, the so-called asynchronous systems can cause undefined events at time intervals.
Petri nets and the above types of models are called asynchronous. Causal relationships make it possible to more clearly describe the structural features of the system.
Asynchronous models of nonformal description of the case, in particular, Petri nets, must involve relationships of time (early, late, not at the same time, etc.), when it is convenient or accepted, but they represent a causal relationship. Great interplay of asynchronous systems, typically, has a complex dynamic structure.
The relationship between the two will be described more clearly if not immediate contacts are marked, or cases and situations in which the case can be realized. In this case, the conditions of implementation of the system of global situations are formed in the named local operations.
The term has its capacity. The term is not fulfilled (capacity is equal to 0), the term is fulfilled (capacity is equal to 1), and the term is fulfilled in n times (capacity is equal to n, where n-is a positive integer).
Most systems are suitable as discrete structures that consist of two elements: type of events and terms. Cases and terms in Petri nets, sets that do not intersect with each other, respectively, are called positions and transitions. Transitions are vertical lines and places with circles in a graphical representation of Petri nets [1,2].

The relationship of petri nets, reachable states, and reachable trees
Þis the network structure and μ is the network condition. P is positions and T is transitions, which are finite sets. I : T ! P ∞ , O : T ! P ∞ are input and output functions, respectively, where P ∞ are all possible multisets (repetitive elements) of P. μ : P ! N 0 is the function of condition, where N 0 ¼ 0, 1, ⋯ f gis the set of integers and included 0. Now, we will define a function that determines the number of elements in their entering numbers in the collection [8]. X element enters into collection of B, which we will appoint as # X, B ð Þ(called: X number in B). If we limit the number of elements in the collection so that 0 ≤ # X, B ð Þ≤ 1, then we will reach the idea of the set. Since # X, B ð Þfunction determines the X element entering collection of B, it follows that # X, B ð Þ≥ 0, the grouping of all the X and B. X element of the B collection, if # X, B ð Þ> 0, i.e. X ∈ B , : Identically, if # X, B ð Þ¼0, then X ∉ B: Let us set empty collection of ∅, which has members (i.e., all X : # X, B ð Þ¼0). |B| is the capacity of the entire number of elements entering B collection: Saying net state, we will understand the following: Suppose in μ state t j transition is allowed to implement and it is actually acted. In this case the net will appear in its new state, μ 0 , which is solved in the following way: Let us name R C, μ 0 ð Þas the reachable state set: 3. Other states do not belong to R C, μ 0 ð Þ. The R C, μ 0 ð Þcan be infinite μ " marking covers μ 0 marking if First, build a reachability tree. Then you need to look for the peak as follows. If there is no such peak, then the marking is not covered by any achievable marking, if it is located inside and gives an accessible marking that covers [14][15][16].
We construct the reachability tree of Petri nets in Figure 1. The state of this network is (1101), which shows the presence of tokens in the network at this moment. Tokens shown in Figure 1, which are depicted with small dots, correspond to the availability of resources. The network state changes due to the movement of tokens.
Let the states correspond to the vertices and transitions to the sides. The root corresponds to the first state of the network. Figure 1 corresponds to Figure 2, in which the reachable tree is infinite. To make the tree finite, we impose restrictions. If any peak is blocked, we will call it a terminal. If there is a state in any peak and there is another peak in the tree with the  same state that has already been developed, then we will call the new peak repeated and will not develop it.
If there is a path like / ** / in the tree, then the path through the second peak may repeat, and the states grow. Let us introduce the idea of infinite much as ω: ω ≥ ω, ω þ a ¼ ω, and ω À a ¼ ω, where a ¼ const: for example, instead of (5,⋯), we will write ω, ⋯ ð ). In this case the tree will become as finite, and we will have loss of information [2].
Let us give several definitions, which will be used in the entire work. Definition 2. A peak is called a boundary if it is in a processing state. Definition 3. The peak is called a terminal if it does not contain a subtree. Definition 4. The peak is called internal if it has already been processed. Definition 5. The boundary peak is repeated if there is an internal peak with the same state.
A description of the structure of the reachability tree algorithm can be seen in an earlier published article [8].
With the help of this algorithm, we will build (as in Figure 1) the Petri net reachable tree (see Figure 3).

The algorithm for finding the minimum number of transitions in a coverage state
Consider the Petri net in Figure 1 and the corresponding reachable tree TT (see Figure 3).
We note the set of states in Petri nets with P. Let T* denote the succession of transitions from the root TT to y, the transition sequence with G the succession of the peaks in T*.
Consider μ x ½ ¼ 0, 1, 15, 13 ð Þstate. Let us find the y peak of this reachable tree for which the following inequality holds: μ y ½ ≥ μ x ½ . Assume that such peaks are y 1 , … , y m . Let us choose one peak among the peaks on which we will use the algorithm.
For every y i peak, we profile μ y i Â Ã .
, ∀t k ∈ T * : We take the y i for which the S is the minimum. If for any peak, these numbers are equal, then we take the y i in which T * height is the minimum.
For example, μ x ½ , we will cover the following peak: We found out that in minimum number, S y 1 À Á ¼ S y 3 À Á , T * y 1 À Á ¼ 2, and T * y 3 À Á ¼ 3 ) need to take a y 1 peak. Choosing the appropriate peak coverage, we use the algorithm. Let it be a covering peak.
1. We choose the path connecting the root of the tree withy and T * ; for our example t 2 , t 3 let us mark t 0 i ¼ t j ,1 ≤ i ≤ T * j j, and t j ∈ T * . We get t 0 1 ¼ t 2 , and t 0 2 ¼ t 3 .

For each chosen transitions, t 0
i is corresponded with a i numbers in the following way: Moreover, for t 0 i transition we will correspond P j and P k positions. If instead of will correspond a i with σ and a i ¼ μ x ð Þ j . In this case, we will correspond σ with P j position. In the opposite case, if there is no t 0 i transition for 1 ≤ j ≤ P j j in the way that δ μ y 0 ½ , t 0 i À Á j ¼ ω, then a i ¼ 1, in which case there is no related position for t 0 i .

Figure 3.
The petri net reachable tree.
For example: Now, we will define the following action for a i : where n to t 0 i or in σ corresponding P j position, the number of tokens are in their first position, and m from t 0 i or σ to the number of the arrows in the state: If for t 0 i transition P 1 , ⋯, P k positions correspond, then we will take the P 1 position for which μ If there is no corresponding position for t 0 i transition, then we will leave a i to remain the same.
For example:

Cumulative move
We will take T * last transition or the succession of transition, fix it and mark as t α .
t α corresponding b 1 i is marked as α which we also fix. The fixed b j i does not change in the next moves.
We consider all T * items from the right to left, starting from t α . Suppose t 0 k is the considered transition or the transition succession and P 1 is the corresponding position of t 0 k . If P 1 ∈ I t α ð Þ, then t 0 k corresponding b j i in the next move will get the following value: where l from P 1 position t α is the number of arrows. Suppose t 0 k corresponds with P 1 , ⋯, P l positions. If ∃1 ≤ j ≤ l in the way thatP j ∈ I t α ð Þ, then b After that, we fix t α the previous transition action and denote it as t α . We denote the new t α corresponding to b j i as α and go to the second step again. It follows that for each transition or sequence of transitions, there will be a correspondingly fixed number b j i , which will mark the number of implementation of the transition or sequence of transitions. For example: The above shows that the t 0 1 transition must be implemented for 27 times and t 0 2 transition for 15 times. Given our denote, we get that state μ x ½ ¼ 0, 1, 15, 13 ð Þcovers state μ y ½ ¼ 1, 1, ω, ω ð Þ : To achieve the goal, we need to implement the t 2 transition 27 times and the t 3 transition for 15 times.
Let us assign t s y ð Þ ¼ Which means t s y ð Þ is y the number of enabled transitions. Lemma 1. Suppose there are y 1 and y 2 peaks in the way that In that case t s y 1 À Á ≤ t s y 2 À Á . Proof: We have.
In this number some b 0 i s are equal to 1. Without breaking the sense we will suppose that the first d 0 number of b 0 i s is equal to 1. We will get Suppose for b 00 i s, number of d 00 is equal to 1. Moreover d 00 ≤ d 0 , as S y 1 À Á < S y 2 À Á , The lemma is proven. Lemma 2. Suppose y 1 and y 2 are covering peaks. There is S y : in this case t s y 1 À Á < t s y 2 À Á . Proof: The lemma is proven.
Theorem. Through the abovementioned number of covering state, transition algorithm is in its minimal state.
Proof: Let y be the covering peak in our algorithm and t 0 1 , ⋯, t 0 k the succession of transitions. It must be shown that the number of t 0 1 , ⋯, t 0 k move is in minimal state. For this we need to show that À ∃y 0 covering peak has less number of transitions than the number of t 0 1 , ⋯, t 0 k .
Let us consider two cases: 1. y 6 ¼ y 0 Suppose the transition number of y 0 is less than t 0 1 , ⋯, t 0 k implementation number. According to the algorithm: S y ð Þ < S y 0 ð Þ or If S y ð Þ < S y 0 ð Þ ) according to Lemma 1: t s y ð Þ ≤ t s y 0 ð Þ. We've come into a controversy.
) according to Lemma 2: t s y ð Þ ≤ t s y 0 ð Þ. We've come into a controversy.

y ¼ y 0
Suppose succession transitions of y 0 is s 1 , ⋯, s r . As the tree does not contain any cycle, y ¼ y 0 ) t 0 1 , ⋯, t 0 k and s 1 , ⋯, s r are the same ) t s y ð Þ ≤ t s y 0 ð Þ. The theorem is proven.

Conclusion
The proven theorem and research reveal some important features of Petri nets from the point of view of optimization, that is, if the idea of Petri nets is used in technical devices, then the idea of sequential transitions save resources and time.

Interrelation of languages of colored Petri nets and some traditional languages
Definition. The mathematical definition of colored Petri net: CPN is a nine-tuple CPN ¼ Σ, P, T, A, N, C, G, E, I ð Þ , where: P is a finite set of non-empty types called color sets [17]. P is a finite set of places which are depicted as ovals/circles. T is a finite set of transitions which are depicted as rectangles.
A is a finite set of arches which are depicted as directed edges; moreover.
C is a color function, C : P ! Σ. G is a guard function. It is defined from T into expressions such that E is an arc expression function, which is defined as follows: I is an initialization function [3-6, 9, 10], The distribution of tokens, called marking, determines the state of the simulated system. The dynamic behavior of CPN is due to the triggering of a transition that transfers the system from one state to another. A transition is enabled if the associated arc expressions of all input arches can be evaluated as a multi-set, which is compatible with the current tokens in corresponding input places, and its guard is satisfied. After the transition is triggered, tokens are removed from the input places, respectively, by the specified expression of the arches of all incoming arches, and tokens are placed in the output places, respectively, by the specified expressions of the outgoing arches [3][4][5][6]17].

The example of modeling consumers' process with CPN
Let us suppose that there are two processes of producers and consumers [1,9]. The following picture shows the process diagram (Figure 4). There is a distribution problem in the described system. To use the channel, the pair P 1 , C 1 ð Þmust have priority toward P 2 , C 2 ð Þin the sense of using the channel. This is described as follows: while the buffer is not empty, the channel cannot report data from the buffer to the consumer. It is impossible to solve this problem with the help of classical Petri nets, since it is permissible in nature. The proof of this fact is described in the literature [1].
To solve that problem, it is needed to extend Petri net's several properties in such a manner that the proposed properties are headed toward the opportunity of checking the zero in Petri nets [13].

The modeling of context-free languages with colored Petri nets: the diagram of interrelation of colored Petri nets and traditional languages
It is known that the class of regular languages is one of the most studied simple classes of formal languages and any regular language is the language of Petri nets [2,18].
There are context-free languages that are not languages of Petri nets. Such examples of the context-free languages are ωω R =ω ∈ Σ * È É , L * ¼ L ∪ LL ∪ LLL … (in particular, a n b n =n > 1 f g ). The noted fact shows the limitation of Petri nets as a mechanism that generates languages [2].
In Petri nets one can only remember a sequence of limited length (similar to finite automata) [2].
It is clear that Petri nets do not possess the "capacity of pushdown memory" necessary for generating context-free languages. The relationship of the languages of Petri nets with other classes of languages (Venn diagram) is shown in Figure 6 [2, 10].

Results
A model of the L * ¼ L ∪ LL ∪ LLL … language (Klins' star) is constructed using colored Petri nets, in particular L ¼ a n b n =n ≥ 1 f g . Colored Petri net (Figure 7) generates such a language, which proves that the colored Petri net is a more powerful tool than the classical Petri nets. The following declaration is for the concept of data types.   The operation of the colored Petri net shown in Figure 7 is described in more detail in the literature [3,10].
Тhe colored Petri net (Figure 7), which is built for L * ¼ L ∪ LL ∪ LLL … language, suggests the following relationship between the languages of the colored Petri nets with some classes of traditional languages (see Figure 8) [10].
The Venn diagram, modified by the author (Figure 8), shows the relationship between the languages of the colored Petri nets and some traditional languages. This fact illustrates that the language class of colored Petri nets includes an entire class of languages without context.

On a solution to the cigarette smoker's problem with colored Petri nets
In 1971 Patil proved that P and V actions have insufficient capacity for resolving synchronization issues. His proposed solution to model problem is called smoking a cigarette [9].
The actions of the smokers without the coordination are as follows. Let X be the smoker with tobacco, Y the smoker with paper, Z the smoker with matches, and A the agent (see Table 1).
It is proven that the problem of smokers has no solution using semaphores [9]. Patil showed that there is no sequence of P and V actions to correctly solve the problem [1,2]. Modeling the problem using the classical Petri net, we get an inactive network. Since all tokens in classical Petri nets are of the same type, the ingredients will not differ from each other.
The author simulated a problem with the colored Petri net (see Figure 9) [3-6, 9, 18, 19]. The operation of the colored Petri net shown in Figure 9 is described in more detail in the literature [9].
If we were to represent this problem using the classical Petri net, then we need to use three transitions instead of one T transition. It also means that minimization of the network is ensured, which implies a reduction in costs due to the reduction of arches in positions and transitions.

Declaration
Color INT ¼ integer; Color U ¼ t; Color N ¼ P; Color Q ¼ m; Color E ¼ Product N * Q OR Product U * Q OR Product N * U f g ; Var K, l ð Þ : E; n : INT;

Conclusion
In the problem, we identify certain advantages of colored Petri net to P and V operations and classical Petri net with the synchronization problem. The mentioned studies allow identification of synchronization modeling opportunities with the help of colored Petri net.