Abstract
By analyzing the evolution nature of a Petri net, this article reports a generalized state equation for Petri nets, including Petri nets with inhibitor and enabling arcs. By proposing the generalized state equations, all enabled transitions meeting the firing condition can fire concurrently. Conflicts can be found when any component of a resulting marking vector by firing the enabled transitions at some marking becomes negative. We first formulate a novel state equation for regular Petri nets. Then, it is extended to the nets with inhibitor and enabling arcs. A classical problem with conflicts and concurrency, that is, the dining philosophers problem, is taken as an example to validate the proposed state equations of Petri nets.
Introduction
Petri nets provide a powerful mathematical formalism for modeling concurrent systems and their behavior. Some researchers propose extensive application in modeling, control, and scheduling of a variety of industrial processes (Li and Zhou, 2006)1,2. Since they were proposed by Petri, 3 many researchers and engineers from different fields have been working on Petri nets and their applications to real-world systems. 4 Petri nets are a graphical and mathematical modeling tool that is applicable to many contemporary technological systems, such as communication protocols, computer networks, traffic systems, distributed database, software, production systems, C3I (command, control, communication, and intelligence), Internet web services, social services, workflow management, and even logistics security systems. 5 As a graphical tool, Petri nets can be used as visual communication aid similar to flow charts, block diagrams, and networks. In addition, tokens are used in a net to simulate the dynamic and concurrent activities of systems. As a mathematic tool, it is possible to set up state equations, algebraic equations, and other mathematical models governing the behavior of systems. 6 A mathematical approach is applicable to almost every system, no matter it is complicated or simple. Due to the inherent properties, Petri nets with their variations have received more and more attentions from academic and industry communities.
In fact, Petri nets as well as digraphs are becoming a major mathematical tool to characterize, analyze, and control various problems in resource allocation systems, including flexible manufacturing systems (FMS) (Li and Zhou 2006). 7 The graph-theoretic approaches are suitable for describing the interaction between jobs and resources even in complex resource allocation systems. 8 As a formalism, Petri nets are used to describe the behavior of FMS and to develop appropriate deadlock resolution methods (Li and Zhou, 2006). 9 The major strategies using Petri net techniques to cope with deadlocks in FMS are deadlock detection and recovery, deadlock avoidance, and deadlock prevention.10–13 In FMS, deadlock prevention is usually achieved either by effective system design or using an offline mechanism to control the requests for resources to ensure that deadlocks never occur. 14 Monitors or control places and related arcs are often used to achieve such purposes.15–17
In addition to the deadlock control problem,18–20 Petri nets have found extensive application to many problems in contemporary resource allocation systems,14,21,22 such as scheduling (Wu and Zhou, 2012),13,23–25,65–67 supervisory control,26,27 performance evaluation, and fault diagnosis.28–31 Some extensions to the basic Petri net structure are developed to overcome this problem by introducing extended concepts, such as enabling arcs and inhibitor arcs to control a transition enabling. Petri nets with inhibitor and enabling arcs can improve the modeling ability and facilitate the development of system control approaches. However, it is difficult for us to use state equations to compute large and complex systems.
The studies on the state equation of a variety of Petri nets are essential to their applications, leading to a lot of results,32–45since they can provide an algebraic approach to the analysis of a Petri net. Burns and Bidanda30 use the concept of transition variables to translate a safe Petri net into sequential Boolean equations but not to formulate the state equation. Chamas and Singh 33 extend the state equations for standard Petri nets to continuous time systems. However, the involved equations are differential equations rather than linear or algebraic equations. 33 Lee and Lee 34 generate a new state equation whose transition values are replaced with transition variables, and it is useful for analyzing token flows in a Petri net. Baskocagil and Kurtulan 35 propose a generalized state equation by taking into account both inhibitor and enabling arcs. Inhibitor arcs have been addressed in the works by Chen and Li, 46 Chen et al., 47 Wu et al., 48 and Lorenz et al., 49 and enabling arcs in the work by Wu et al. 50 Petri nets are used to model discrete event systems and apply the matrix representation to make the analysis of controllability and reachability for Petri nets. 37 Petri nets with inhibitor and enabling arcs can increase the modeling power and facilitate the development of system control. But it is difficult for us to use those equations to compute large and complex systems. However, all enabled transitions meeting the firing condition can fire concurrently in our equations. Furthermore, we can obtain the transition vector only by the equations we proposed.
Specifically, in a Petri net, if all the enabled transitions at a marking do not have priority and there is no conflict among the enabled transitions, we can fire them at the same time. This study proposes a novel state equation for a variety of extended Petri nets. Furthermore, the transition firing vector is generated due to the novel state equation, which helps us to decide the enabled transitions, firing or not, depending on the number of tokens of the subsequent markings. If they meet the firing condition, the enabled transitions can fire at the same time. Otherwise, conflicts can be found immediately when any component of a marking vector becomes negative.
The rest of this article is organized as follows: section “Preliminaries and notations” introduces some preliminaries and notations of general Petri nets. Section “Basic Petri nets and their state equations” presents a state equation representation, enabling and firing rules, and a classical example illustrating concurrency efficiently. We propose the state equation of Petri nets with enabling arcs and then show its application in section “Petri nets with enabling arcs and their state equations.” Based on section “Petri nets with enabling arcs and their state equations,” section “Extended Petri nets and their state equations” proposes the generalized state equations of extended Petri nets, namely, the Petri net with enabling and inhibitor arcs and then an application is shown. Finally, section “Conclusion” concludes this article.
Preliminaries and notations
Basics of Petri nets
A Petri net
51
is defined as a five-tuple
In a Petri net, a transition
1. A transition
2. Once an enabled
where
We define
where
It is appealing to analyze a Petri net using a set of linear algebraic equations. This article deals with the state equation of Petri nets with some extensions. As known,
We use
In a state
where
Reachability is a fundamental problem for studying the dynamic properties of a system modeled with Petri nets.
6
A Petri net is said to be reachable from a state
Parallel activities or concurrency can be easily expressed in terms of Petri nets.
6
In general, two transitions are said to be parallel or concurrent if they are causally independent, that is, one transition may fire before, after, or in parallel with the other, as in the case of

A Petri net representing a deterministic parallel activity.
Two transitions

Petri nets representing conflict and confusion.
Inhibitor and enabling arcs
An inhibitor arc is a type of arcs from a place to a transition and its semantics is to disable the transition when the place contains one or more tokens.46,47,52–55 It makes the net have the ability to test the absence of tokens in a place. As the complementary of inhibitor arcs, the concept of enabling arcs is introduced by Uzam. 53 It is a type of arcs from a place to a transition and its semantics is to enable the transition when the place contains one or more tokens,46,47,53 and if the transition fires, it does not change the token count in the place. It makes the net have the ability to test the presence of tokens in a place.

An inhibitor arc.

An enabling arc.
Basic Petri nets and their state equations
State equations
In this section, we extend the concept of state equations to a more general case. Before defining the novel state equations, we present an auxiliary definition as follows.
where
That a Petri net is legal at state
The state equation of a Petri net can be represented by equation (8), where the first equation is called the transition equation, and the second is called the place equation.
where
From this definition, if
If

An illustration of the state equation.
In Figure 5
Modeling the dining philosophers problem using Petri nets
Here, we introduce a classical problem, the dining philosophers problem, to illustrate the proposed state equation. The dining philosophers problem is proposed by Dijkstra.
56
Dijkstra describes the philosophers dining system in the work by Dijkstra
56
as follows: Five philosophers, numbered from 1 to 5, are living in a house where the table is laid for them, each philosopher having his own place at the table. Their only problem, besides those of philosophy, is that the dish served is a kind of noodles that have to be eaten with two forks. There are two forks next to each plate. However, no neighbors may be eating simultaneously.
Unfortunately, there may be a situation that all the five philosophers take their left forks simultaneously. None will be able to take their right forks and then they will wait indefinitely. Thus, a deadlock occurs. The Petri net model
57
for this problem in Figure 6 eliminates the deadlock. In Figure 6, G, R, H, and E stand for “get forks,”“return forks,”“thinking,” and “eating,” respectively, and the philosophers are denoted by indices

Petri net model for the dining philosopher problem.
Equal opportunity is provided by symmetry; if all the forks are available, each philosopher may switch from thinking to eating, while if a fork is missing, its replacement immediately enables the waiting philosopher.58,62–64
We can see that the initial marking enables each philosopher’s “get forks” transition, in competition with his neighbor’s “get forks” transitions. Hence, it has many different runs for sequential runs, on which most of the mentioned literature is based.
Now, we turn to consider concurrency in the model. For this example, there is no priority for the philosophers and then they may take the forks simultaneously, which leads to the fact that none of them can eat noodles successfully. We use the proposed state equations to explain the problem as follows.
First, we define marking vector
Similarly, we define transition vector
Then, we can find
Using equation (8) and
Thus, we have
From equation (9), we can find that
Equation (10) shows that the tokens in the places representing forks become negative, which is equivalent to a test on the net. Thus, we conclude that there exist conflicts or confusions in the net at the initial state, which can be found easily by equation (10). However, for this model, it is possible that two philosophers could collude to starve the third. To solve the collision problem, we propose Petri nets with enabling arcs and their state equations. Actually, it generates the priority for the transition that represents “get forks” of the five philosophers, and the net becomes deterministic, that is, it can determine which two philosophers can eat at the same time.
Petri nets with enabling arcs and their state equations
Definition
A Petri net with enabling arcs is formally defined as a six-tuple
Similarly, the evolution of PN1 is described by the movement of tokens between places and accomplished by the firing of the enabled transitions. Without loss of generality, let

Two types of arcs from
Once the enabled transition
In order to mathematically describe and analyze a Petri net with enabling arcs defined by Definition 6, an enabling arc matrix
where
Similarly, at step
The rule of operator “*” is the same as equation (8), and an algorithm for computing
By Algorithm 1, the marking of each place can be computed. First, we can obtain
By Algorithm 1, the marking of each place can be computed. Its computational complexity is related to the number of places and transitions. In this article,
Modeling the dining philosophers problem using Petri nets with enabling arcs
Figure 8 shows a controlled net consisting of five places and five transitions. In the net, there are two tokens flowing through the net. To prevent the occurrence of deadlocks, the two tokens cannot exist in any two adjacent places. Actually, we can understand this solution just like the arbitrator approach: a philosopher can only get the two forks or none by introducing an arbitrator, for example, a waiter. In order to get the forks, a philosopher must ask permission of the waiter. The waiter gives permission to only one philosopher at a time until he has gotten his two forks. Here, the two tokens in the controlled net can be regarded as two waiters, who ask the five philosophers by turn. In fact, the forks are available again when the waiter turns to one philosopher, and hence, the two waiters cannot ask adjacent philosophers, otherwise, conflicts may happen again.

A controlled net.
We apply the controlled net to the original net through enabling arcs, as shown in Figure 9. Only when the right and left forks of a philosopher are available, and one waiter walks to him and allows him to eat, can the philosopher pick up his left and right forks. In the following, we use the proposed state equations to explain and verify its validity.

Petri net controller with enabled arcs.
First, we define marking vector
Similarly, we define transition vector
Then, we can find
According to the state equation of a Petri net with enabling arcs, we can compute
Results of the enabling arcs solution.
From Table 1, we can find that the enabled transitions at any time can fire simultaneously because of the strong concurrency of this system. A philosopher will eat two times continuously, and some other philosophers keep thinking. In order to ensure that the five philosophers can eat by turns, we propose a new class of Petri nets as well as their state equation.
Extended Petri nets and their state equations
Definition
An extended Petri net with enabling arcs and inhibitor arcs is formally defined as a seven-tuple
Similarly, the evolution of EPN is also described by the movement of tokens between places and accomplished by firing the enabled transitions. Without loss of generality, let

Three types of arcs from
Transition
Once
In order to mathematically describe and analyze Petri net with enabling arcs given in Definition 7, we define an inhibitor arc matrix
The operation rule of operator “∘” is defined by
An algorithm for the reachability set using
The description of this algorithm is the same as Algorithm 1. Finally, we can obtain the transition vector and the markings of places. Then, we will explain how to solve the Five Dining Philosophers Problem without continuously eating two times by a philosopher through applying extended Petri nets proposed in this article.
Modeling the dining philosophers problem using extended Petri nets
In this solution, we apply weighted inhibitor arcs to the control of the dining philosophers problem, as shown in Figure 11, which will ensure that the five philosophers can eat by turns. From the definition of a weighted inhibitor arc whose weight is

Application of an extended Petri net to the control of the dining philosophers problem.
Then, we use the state equations to explain the solution. First, we define marking vector
Similarly, we define transition vector
Then, we can find
Finally, we can obtain equation (12). Now, from Figure 10, the initial marking is
Our goal is to observe transitions
Results of an extended Petri net solution.
This table shows the transition vector and the marking vector in every state. The remarks show which philosopher can eat when the enabled transitions fire in a transition vector. Then, we use the state equations to explain the solution. The regular arc matrices
From Table 2, we can see that this method can ensure that the five philosophers eat by turn in accordance with their seats. The phenomenon that a philosopher eats two times continuously can be eliminated.
Example of the extended Petri net
As known, deadlocks often occur in a resource allocation system owing to the existence of shared resources (Wu and Zhou, 2012).19,20,28 It can make an impact on the running of a system. Petri nets have an important effect on modeling and controlling these computer-integrated systems.14,18,21,24 The reachability graph analysis is also useful for us to solve the deadlock problem. The reachability graph obtained by analyzing the net model can entirely reflect the flow of tokens in the places, as well as the dynamic behavior of a system. An extended Petri net is given in Figure 12.

Example of an extended Petri net.
In Figure 12, we add some arcs between places and transitions to achieve the deadlock control purpose. A weighted enabling arc is added connecting
When there are no weighted enabling and inhibitor arcs in Figure 12, we use the state equations of Petri nets proposed in our article to compute the reachability graph. According to the equations, all enabled transitions can fire concurrently. By equations (3) and (8), we know that M = [1 1 1 0 0 1 2 0 0 1 0 0 0 0] is a dead marking, which shows there exists deadlock in this Petri net.
Then, we apply the weighted enabling and inhibitor arcs to solve the deadlock problem shown in Figure 12 and compute markings by the proposed state equations.
First, we define marking vector
According to the state equation of a Petri net with the weighted enabling and inhibitor arcs, we can compute
Results of the enabling and inhibitor arcs solution.
This table shows the transition vector and the marking vector in every state. The remarks show which transitions can enable and fire in a transition vector. Then, we use the state equations to explain the solution. The regular arc matrices
From Table 3, we can see that the system has no deadlock problem. The transitions can be enabled by turns and the markings computed by the proposed state equations form a cycle from
Conclusion
This article proposes new state equations for Petri nets. Using the inhibitor and enabling arcs, we can solve the dining philosophers problem and validate the proposed equations. The proposed state equation takes the form similar to the state–space representation of a linear (continuous time-invariant) system with multiple inputs and outputs. Under this state equation, all enabled transitions meeting the firing condition can fire concurrently. It is useful for analyzing concurrent systems. We can use the equations to compute the transition vectors and the markings of places and also test whether there exist conflicts or confusions. If there is no conflict in the net at the initial state, we can obtain legal subsequent markings with the simultaneous firing. The definition of the state matrix takes regular arcs, enabling arcs, and weighted inhibitor arcs into account, which is convenient for analyzing extended Petri nets with the three types of arcs.
Future work includes the algebraic equation description for siphons and traps that are important to the development of deadlock prevention policies for resource allocation systems modeled with Petri nets.26,59,60 We will also investigate the state equations of Petri nets with interval inhibitor arcs 46 and date decision arcs. 61
Footnotes
Appendix 1
Appendix 2
Appendix 3
Acknowledgements
R.Z. proposed a new mathematical method to describe the behavior of Petri nets and wrote this paper. Y.Z. and R.Z. built state equations of the dining philosophers by applying above suggestion. Y.Z. and L.Y. validated the equations by a computer program.
Academic Editor: ZhiWu Li
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the National Natural Science Foundation of China under Grant No. 61673309 and the Fundamental Research Funds for the Central Universities under Grant Nos JB160401 and JBG160415.
