Challenges in Application of Petri Nets in Manufacturing Systems

: Petri nets are a useful mathematical formalism for speciﬁcation of manufacturing systems, supported by various analysis and veriﬁcation methods. The progress made in automating control systems and the widespread use of Industry 4.0 pose a number of challenges to their application, starting from the education at university level and ending with modelling of real case studies. The paper aims to present and analyse the most relevant challenges and opportunities related to the use of Petri nets as a modelling technique of manufacturing systems. The review of the literature is primarily based on the years 2019–2020 to reﬂect the current state of the art. The newest approaches to deadlock prevention and recovering, but also other important analysis problems and difﬁculties in modelling real industrial processes are discussed. Trends for the future are also identiﬁed.


Introduction
Petri nets are a well-established mathematical representation of a discrete event system inspired by a PhD thesis of Carl Adam Petri from 1962 [1]. They are considered in the theory domain at the intersection of computer science, automatic control, and operations research [2]. Petri nets (PNs) allow for a simple representation of the discrete event systems [3], and hence they are widely used in control [4] and manufacturing systems [5]. The conference paper [6] from 2019 offers a good introduction to the topic and shows how Petri nets have been efficiently used as a tool for modelling, simulation, analysis, and control of automated manufacturing systems. Various aspects of behaviour, such as choice, concurrency, synchronisation, or shared resources, can be modelled in an easy way. The systems can be modelled both using the top-down and bottom-up methodologies. To address the specific application domains, several extensions of PNs have been proposed, including interpreted models and timed models.
The main benefit of using Petri nets is that they are a formal model, which means that various mathematical analytic methods [7][8][9] and verification techniques, including model checking [10][11][12][13], can be directly applied to them. There are also multiple tools that support system modelling [14], such as Yasper [15], CPN Tools [16], PIPE2 [17], GPenSIM [18], or IOPT-tools [19], to name just a few. Certain models and modelling languages used for manufacturing systems and posing similar challenges have been known for a long time but are still actual and present in the recent literature, including Grafcet [20], Business Process Model and Notation (BMPN) [21], Unified Modelling Language (UML) [22], Systems Modelling Language (SysML) [23], max-plus algebra [24], or Markov models [25]. Petri nets, as a general-purpose mathematical tool used in discrete event systems of different kinds, cover a well-established knowledge base arising from various application areas. Their simplicity of use and formal notation allow their application to various formal analysis or verification methods, as well as their automatic translation into models that are very close to the implementation. Important from the point of view of the user is the intuitiveness of graphical representation.
The motivation to write this review paper was to provide both the researchers and the practitioners the latest state of the art of using Petri nets in manufacturing systems. To address this, the literature from the last couple of years has been analysed in order to reveal the current challenges. The obtained results may help indicate future works and research areas that still need to be investigated.
The article aims to present the most relevant recent approaches to the application of Petri net theory in manufacturing systems. Petri nets can be successfully applied as a tool for modelling the manufacturing systems themselves, the control systems, and the fault detection mechanisms [26]. The economic and industrial growth, together with the development of new modern and future oriented technologies evolving within Industry 4.0, requires continuous changes in the methodologies used thus far. Industry 4.0 can be described as a digital transformation of manufacturing processes that are nowadays supported by information and communication technology. There is still a growing trend towards automation in order to automate repetitive and dangerous activities, as well as decision making [27]. Despite the extensive support in theoretical scientific literature, there are still many challenges in the employment of Petri nets in the area. The analysis of the latest research papers also reveals some trends for the future and points out potential research directions. The challenges, revealed in the most recent literature on the application of PNs in manufacturing systems, have been divided into main four groups: education in respect of application of PN models, deadlock prevention and recovery, other analysis problems, and difficulties in modelling of real industrial processes. Here, additionally, the research papers that try to address these challenges are discussed, in order to provide the reader with the latest achievements in these fields.
The main contributions of this paper are as follows: (1) showing the recent works using Petri nets in the domain of manufacturing systems; (2) identifying the current challenges; (3) indicating the future trends in research.
The goal was to focus most of all on the latest approaches shown in the literature in the years 2019 and 2020.
The article is structured as follows: Section 2 provides a brief overview of Petri net theory. Section 3 describes the review methodology and reports the recent application of PNs in the literature, focusing mostly on journal papers. Section 4 identifies and discusses the current challenges regarding education, Section 5-regarding deadlock prevention and recovering, and Section 6-regarding other analysis problems. Section 7 focuses on difficulties in modelling real industrial processes. Finally, Section 8 summarises and concludes the paper, indicating trends for the future.

A Brief Theory Background
A Petri net (PN) is a bipartite directed graph with places and transitions [2,3]. It is basically represented as a triple PN = (P, T, F), where P is a non-empty finite set of places, T is a non-empty finite set of transitions, P ∩ T = ∅, and F is a non-empty finite set of arcs describing the connections between places and transitions as F ⊆ (P × T) ∪ (T × P). It should be noted that it is not allowed to connect two places with each other, nor is it allowed for two transitions. A sample PN model of a manufacturing system, for sorting and packaging of two types of components, is shown in Figure 1. Here, the interpreted PN concept is used to include input and output signals communication with the environment (input signals are associated with transitions, while output signals with places). Initially, the boxes for ready components are empty. After the start button is pressed, the production line with components starts moving. The robot sorts the components and puts them into one of the boxes. If a box is full, the appropriate assembly line moves that box and prepares an empty box again (of type A or type B, each time one). The initial state of the system is reflected by the initial marking, represented by tokens in appropriate places (in the example: in place p1). The choice of initial marking is crucial for the basic properties of the net. For example, the reachability of places depends on initially marked places.
A distribution of tokens in a Petri net is called a marking. A marking of the net evolves when the transitions fire. A transition is said to be enabled (it may be fired) if each of its input places contain a token (in the example: transition after place p1 is enabled). Then, a token is removed from each of its input places (consumed) and added to each of its output places (produced). Additionally (in the high level or interpreted PNs), a transition may be guarded, which means that some conditions are assigned to it, and they have to be fulfilled in order to fire it (in the example: signals associated with transitions). A marking is said to be reachable if there is a firing sequence that results in such a marking. A PN is live if it is possible to fire any transition starting from any reachable marking. A deadlock occurs when a marking can be reached, such that no transition is enabled. A PN is bounded if each of its places can contain a limited number of tokens. Finally, a PN is reversible if it is possible to return to the initial marking from any reachable marking.
Petri nets have evolved to meet the needs of complex systems, and various types of them have been created for particular domains and application scenarios. Thus, nowadays different types of them appear in the worldwide literature and they are used in various research studies, including timed, coloured, interpreted, stochastic, or even fuzzy models.

Review Methodology
To reflect the latest state of the art regarding application of Petri nets in manufacturing systems, we performed the research through a search for recent papers, independently by both authors of the manuscript, including the following databases: Elsevier, IEEE Xplore Library, MDPI, and Springer. The search was conducted between 1 January and 30 June 2021 with the keywords "Petri nets" combined with particular topic ("manufacturing", "deadlock prevention", "deadlock recovery", "analysis", "education", "teaching", "industrial", "industry 4.0") and then restricted only to the years 2019 and 2020. The matching papers were judged on the basis of the full text content. If a paper was not applicable for manufacturing systems at all, it was excluded from consideration, unless it provided other useful information. Then, the time period was extended to the years 2017-2020 to cover also other, quite recent, essential publications that influence the current state-of-the-art knowledge. Finally, considering especially the queries related to education and teaching, the time period was unlimited, due to the limited number of articles contributing to this topic.
The main research questions were defined: The review methodology is schematically illustrated in Figure 2. Additionally, some details of the obtained literature are provided. In order to select only relevant papers that could help to answer the research questions, we defined some inclusion and exclusion criteria. The inclusion criteria were specified as follows: IC1: The paper contributes to the theory of Petri nets. IC2: The paper is strictly related to the area of manufacturing systems. IC3: The paper was published either in 2019 or in 2020. IC4: The paper is written in English.
After the initial literature review, the inclusion criterion IC3 was extended to the time period 2017-2020, and for education and teaching, without any restriction.
The exclusion criteria were specified as follows: EC1: Approach not applicable in practice. EC2: The paper does not introduce a new concept. EC3: The paper is not written in English.
The analysis of selected papers was intended to answer the research questions. Recent application of Petri nets (RQ1) is highlighted in the following subsection. Sections 4-7 refer to research questions RQ2-RQ5. The last research question (RQ6) is addressed in Section 8. In the article, the most significant and recent works contributing to the topic have been included.
The extensive search through popular databases also revealed that the interest of the scientific world in Petri net theory has remained at a similar level for many years, as shown in Figure 3. The substantial decrease can only be observed in IEEE conference papers; however, the trend should be investigated further, as a possible reason might be that not all conference papers from the year 2020 have already been indexed in the second quarter of year 2021.

Recent Applications of Petri Nets
Petri nets have been used in various research projects in recent years, not only in manufacturing systems, but even supporting the fight against the COVID-19 pandemic. Timed coloured PNs applied as models used to manage healthcare systems turned out to be valuable in these especially challenging times [28]. Simulation techniques can prepare hospitals for a virus outbreak, as the hitherto workflow was not optimal for COVID-19 patients (according to a study conducted in Iran). A discrete-event simulation led to a significant reduction in patient waiting time.
Classical manufacturing systems used in the industry for decades are being increasingly replaced by smart manufacturing systems [29,30]. Cyber-physical systems (CPS) [31], integrating physical and software components, play an important role in the smart manufacturing systems and are the core of Industry 4.0 [32]. The common problem addressed in the literature is the construction of a PN model and enormous size of its state space in real-life applications, resulting in great computational complexity of analysis. There are therefore many works aiming at reduction of the reachability graph and the analysis time. Development of modern complex production processes for Industry 4.0 can be supported by code generation for Arduino [33]. Petri nets can also enhance the human-machine safety interaction and improve production efficiency [34].
Flexible manufacturing systems that adapt to facts and situations in order to remain competitive in the market [35] are also widely supported by PN formalism. Even large Petri nets can be efficiently used when they are decomposed into smaller subnets [36]. Practical implementation of a set of PN controllers based on PLCs within a reasonable time is shown in [37]. To make the analysis of big PNs more effective, additional tools may be used, e.g., GPenSIM [18] (General Purpose Petri Net Simulator) that enriches the MATLAB platform with PN language. The flexibility of production can be also simulated with PNs, as shown in reference [38]. Process dynamics in a microcontroller-based radiation monitoring system are studied in [39]. Modular PNs are especially suitable for large real-life systems [40], as the size of the models is reduced to simplify the analysis performance. Smaller modules after decomposition allow us to exhaustively analyse the whole state space. Production processes are also modelled using a PN concept with two types of transitions (independent or controlled) [41]. PNs, combined with graph convolutional network and deep reinforcement learning, can also be applied to solve the dynamic scheduling problems [42], e.g., involving shared resources or route flexibility. The problem of modelling, control, and validation of dynamic changes is also addressed in reference [43].
Design and verification aspects of CPSs are discussed in [44], wherein the control part is specified with a safe and live Petri net. Methods for analysis of concurrency and sequentiality relations are provided in [45]. Going somewhat beyond CPSs into the domain of power engineering, PNs can also be used for specification of control algorithm of matrix converters [46], formally verified with symbolic model checking and rule-based logical model [12] and implemented in an FPGA device. Other approaches combine PNs with synchronous dataflow (SDF) [47] to reduce and predict the total amount of initial data SDF channels. Coloured PNs can be applied in design of multi resident smart home data generator [48] or for maintainability evaluation [49]. The concepts of the so-called process PNs and traceability PNs have been introduced for dynamic manufacturing processes in CPSs [50], proved to be successful in a real-life quality control system for bee products in China.
Some authors have also focused on fuzzy models, which can deal with imprecise, vague, or fuzzy information [51]. Thus, fuzzy interpreted PNs (FIPN) for control of a discrete event system are used in [52], with the advantage of quick creation of PLC program code. Fuzzy reasoning PNs (FRPS) are integrated in a reliability-based and cost-oriented product optimisation method, together with particle swarm optimisation in [53]. Dynamic adaptive fuzzy reasoning PNs (DAFRPN) for modelling of energy saving operations in manufacturing systems are in turn proposed in [54]. Another approach uses fuzzy PNs in modelling and simulation of the algorithms for self-navigating robots [55], benefiting from mathematical representation. It is worth mentioning here that fuzzy logic controllers for autonomous mobile robot navigation are gaining popularity in the recent years and now play an important role in shaping academic research [56]. A DAFRPN concept is also used [57] to evaluate reliability of a manufacturing system with multiple production lines.
Many researchers have also devoted their attention to timed models that integrate time variables into PNs [58]. In [59], timed coloured PNs are applied in flexible manufacturing systems. Timed PNs are also used in [60] to solve some scheduling problems. Generalised Stochastic Timed PNs for performance evaluation of real-time systems in the manufacturing domain are proposed in [61]. Flexible manufacturing in uncertain environments, where uncontrollable events may occur, can also be modelled with timed PNs [62]. For each solution, the risk of firing of uncontrollable transitions is evaluated. Anomaly detection in discrete manufacturing systems, supported by PNs, in shown in [63]. Although the article focuses on two algorithms with pattern relation tables, their effectiveness is tested by artificial data sets generated by timed PNs. General multi-objective scheduling problems are modelled with PNs in [64].
There are also various research papers close to the pure manufacturing domain, focusing on smart, autonomous, and transportation systems. A comprehensive survey on PN models for transportation systems and freight logistics is provided in [65], focusing on various types of transport. Extended object-oriented PNs (EOOPN) are used in [66] for a vulnerability model and an evaluation procedure of a communication-based train control system. The PN models are used to analyse effectively the distributed multi-level structures. Input-Output Place-Transition (IOPT) PNs with web-based IOPT-Tools [19] were applied in the NOVA-MAS project [67] to support data acquisition, analysis, and infrastructure control along public roads. Batch PNs for modelling of road traffic flow in intelligent transportation systems are proposed in [68]. Generalised nondeterministic batch Petri net (GNBPN) models are combined with a dynamic estimation of intersection turning movement counts for predicting the road traffic flow in [69]. A message-driven PN framework with hierarchical interpreted binary PNs for implementing autonomous driving behaviours is introduced in [70]. The decision-making process in the context of energy and environmental management is represented as a PN model in [71]. Formal verification of robotic systems, without modelling them with a specific formalism, is proposed in [72]. PNs for simulation of multi-constraint analysis for the process of integrated modular avionic dynamic reconfiguration are used in [73]. A PN conceptual model can also be mapped into FlexSim (simulation tool) format to simplify the verification of simulation models [74]. The chance of introducing errors is minimised and the time needed to start the verification is reduced. This approach is one of the few from the literature that uses professional commercial software.
To summarise the above overview on the most recent applications of Petri nets in manufacturing systems, various research projects are conducted worldwide, focusing on diverse aspects and applying miscellaneous types of Petri nets. The modern technology within Industry 4.0 strongly influences the research objects, and the researchers try to improve and simplify the design process by ensuring at the same time the proper, safe, and reliable functionality of systems.

Challenges Regarding Education in Respect of Application of Petri Net Models
Petri nets, as a mathematical formalism, have been since the beginning of their development mostly used in research laboratories and academic institutions [75], and rarely in the everyday practice of industrial engineers. However, as in other domains of science, some of the approaches can be practically applied, as already shown in the previous section. In the learning and development of engineers, PN theory appears during various academic courses. There are not many recent publications regarding Petri nets in education, and hence the rest of the section is based on some older articles, while the current state of the art in education is updated and described to the best of the authors' knowledge. The considered aspects related to education can be divided into the main thematic groups as shown in Table 1.
The trends in industrial electronic education for the last 10 years have been identified in [76]. The big challenge, despite the limited time for courses that have to combine the classical theory with the newest content, is the interdisciplinary and multidisciplinary approach. Indeed, the application of PNs in modern manufacturing systems necessitates the knowledge becoming much broader than pure computer science. Recommended principles for teaching formal methods for software engineering [77] include, among others, making various tools available to the students and teaching by using examples from a domain familiar to the target group.
Already in the year 2010, the authors of [76] predicted that an increasing number of students would not attend lectures or labs personally, and that the educational tools should nonetheless be available to them. A short while earlier, namely, at the beginning of the 21st century, a PN software tool called P3 was proposed, which was developed especially for learning purposes [78,79]. It has been evaluated through the subjective experience of students (fourth year undergraduate studies of computer engineering at the Military Academy in Belgrade) and teachers. All students were consistent in agreeing that the P3 tool was useful for understanding PN concepts; moreover, the average student score was higher with P3 than without it (by a slight amount). Thus, P3 has been claimed as a convenient tool for realising the need of PN model analysis, especially suitable in the first phase of learning. Another tool intended to teach the beginners is shown in [80]. It is relatively simple to use yet sufficiently detailed to aid in understanding the important concepts of Petri nets. An extensible PN editor and analyser for education and research, called PetriDotNet, is proposed in [81]. It has been successfully used at the Budapest University of Technology and Economics. Although initially dedicated to students, it has been proven to be able to serve both academic and industrial needs [82]. Proposed in [83] is a more recent tool, called GreatTeach, for teaching PNs (in particular, stochastic PNs), resulting from teaching master students at the University of Torino. It has some enhanced features for graphical visualisation and a streamlined interface, such that basic learning objectives require just an easy interaction with the tool. A software tool, called PN2ARDUINO, for modelling and control of discrete-event and hybrid systems using timed interpreted PNs has been recently introduced in [84,85] to improve education and practice in cyber-physical systems. It offers a graphical environment, making it especially suitable for beginners. CPN Tools [16], which allows for editing, simulating, and analysis of classical, timed, interpreted, and coloured Petri nets, are used successfully at the AGH University of Science and Technology (Poland) in the Formal Methods course.
From the perspective of time, remote laboratories-first dedicated to student autonomous learning activities and to support life-long learning [86]-have become a necessity. The role of remote laboratories, which provide continuous access to specialised software and hardware platforms, has been significantly increasing recently. Programming and testing of physical devices can now be performed in a remote way [87], as well as building and testing of real analogue electronic circuits [88], even supported by speech recognition technology [89]. Remote laboratories for controlled education that offer flexible time access to best utilise the available laboratory equipment have been evaluated at a university in Chile [90] as being especially effective. The global situation has changed to a large extent, especially due to the COVID-19 pandemic that has temporarily closed most of the universities in highly developed countries. Students have been isolated at their homes and have had to get used to the new remote education, with remote lectures, laboratories, and practical exercises. Universities worldwide had to move towards online learning, where the self-motivation of students plays an important role [91].
To the best of the authors' knowledge, only a few papers focus on teaching Petri nets in detail. An interactive approach to teaching coloured PNs is proposed in [92]. It involves an interactive model building with active audience participation and is suitable for short, intensive courses. However, it is said that more time is needed for the audience to better understand the formalism used. An implementation of project-based learning to a graduate course focusing on the event-driven simulation with coloured PNs is described and evaluated in [93]. Project-based learning is a student-centred pedagogy and is nowadays gaining more attention in engineering education [94]. The teaching of Petri nets for software development is discussed in [95]. Practical experiments on students have been carried out, with an introductory phase followed by an intensification phase. Explicated process models have been used to restructure and augment worksheets. The resulting improved learning materials allow the students to work more independently with less confusion and frustration.
From the cited works, it can be concluded that Petri net education may be realised in various forms, provided that enough time is reserved to get to know the theory and perform some practical exercises. Hence, the current challenges regarding education are mainly twofold: (1) remote education and (2) how to fit interdisciplinary aspects into the limited duration of a course.
Generally, teaching Petri nets has changed a large amount since the beginning of the PN theory, but the changes took place gradually, mainly due to the technological progress, hardware possibilities, and available software. What differs greatly over the last two years is the suddenly forced remote education, which has affected all areas of education. Its influence on the future engineers will be known soon. Table 1. Thematic groups of publications and contributions regarding education.

Thematic Group Publication Year Contributions
Trends in industrial electronic education [76] 2010 Identification of trends. Discussion for the needs and challenges of industrial electronic education both at university level and in lifelong learning. Overview of state-of-the-art learning methodologies and tools.
Remote laboratories and education [76] 2010 Analysis of trends. Prediction about the increasing popularity of remote laboratories.
Overview of state-of-the-art technologies in the development of remote laboratories.
[87] 2017 Remote programming and testing of physical devices. Proposition of practical classes in several subjects at the University of Huelva (Spain). [88] 2016 Remote building and testing of real analogue electronic circuits.
[89] 2020 A remote laboratory application that aims to increase the accessibility of electronic circuit design and analysis courses by using speech recognition technology.
[90] 2016 Remote laboratories for controlled education with flexible time access. Introducing remote laboratories at the Universidad del Bío-Bío (Chile).

[91] 2020
Emphasising self-motivation of students. Highlighting that staff members should use technology to enhance learning. Online and remote learning as a necessity in times of lockdowns and social distancing due to COVID-19 pandemic.
Petri net software tools for education [78,79] 2003, 2004 P3-PN software tool. Learning PNs in a more obvious and quicker way in order to use them for hardware modelling. [80] 2011 Simple tool intended to teach the beginners [81,82] 2016, 2018 PetriDotNet-an extensible PN editor and analyser for education and research. Suitable also for design, development, and analysis of industrial systems. [83] 2018 GreatTeach-a tool for teaching stochastic PNs [84,85] 2020, 2019 PN2ARDUINO-a tool for modelling and control of discrete-event and hybrid systems using timed interpreted PNs.
The proposed tool can improve education and practice in cyber-physical systems (Industry 4.0).

Teaching
Petri nets [77] 2015 Recommended principles for teaching formal methods for software engineering. [92] 2018 An interactive approach to teaching coloured PNs. Suitable for short and intensive courses.
[93] 2019 Project-based learning to a graduate course focusing on the event-driven simulation with coloured PNs. [94] 2017 Project-based learning in engineering education.
[95] 2016 The teaching of PNs for software development. Best practices for teaching in practice.

Challenges Regarding Deadlock Prevention and Recovering
An important topic related to the application of Petri nets in modelling the manufacturing systems is dealing with deadlocks. PNs are a convenient formalism to deal with deadlock problems and are widely used in this area. The theory of deadlocks is extensively developed.
Deadlocks are considered as undesirable states in a manufacturing system and block its functioning. For this reason, either a system should be constructed in such a way that the deadlocks cannot happen, or it should be able to recover from the deadlocks. These two options correspond to the two main approaches to the deadlock problem: their prevention or recovery (in some cases classifying a method as belonging to one of the mentioned groups is not unequivocal). The importance of the problem is confirmed by a great number of recent publications on this topic.
Automated manufacturing systems in the context of deadlock prevention are usually modelled by means of special classes of PNs, representing the simple sequential processes and the resources they share (presented by the places) or more complicated models of a similar kind. The classical paper of this area is [96]. There are two main approaches to solving the problem of deadlock prevention: one is by adding the control places (monitors; composition of such control places is called a supervisor) ensuring that no siphon can become empty, which guarantees deadlock freeness; another is a deadlock avoiding policy forbidding firing of certain transitions in certain states that lead to the deadlocks [97]. Clearly, the first approach requires structural analysis of the PNs, and the second one requires state space exploration. The developers of the deadlock prevention methods try to provide a maximum permissive behaviour of the system, which means that the optimal deadlock prevention forbids only "bad" markings, leaving all the "good" markings reachable. A "bad" marking is a deadlock or such a marking that, after reaching it, the system cannot avoid deadlocking after a finite number of transition firings.
A large number of recent papers have developed deadlock prevention methods. In [98], the classical method from [96] is combined with a method of transformation of a PN model into a ladder diagram for an automated manufacturing system. Several challenges are listed in this paper, including development of deadlock control methods for the models involving fault tolerance and reconfiguration and for different kinds of non-pure PNs. In [99], a method of deadlock avoidance in the resource allocation systems within the agent-based flexible manufacturing systems is presented. The resource allocation systems are modelled with PNs, and the minimal siphons of such nets are computed using the linear algebraic approach (it is stressed that the computational complexity of such calculation is polynomial for the considered systems). Then, the control places are added to the elementary siphons. This enforces deadlock-freeness, liveness, and reversibility. However, in some cases, the transformed nets still may have partial deadlocks, and the trial-and-error method has to be used to find the initial markings of the monitors to guarantee deadlock-freeness. The focus of the paper is an efficient application of a PN-based deadlock avoidance policy to the agent-based manufacturing systems. A method in which a control place and a control transition are added to a siphon of an ordinary PN is described in [100]. It is claimed that the resulting controlled PN is live and has the same number of reachable markings as the original net, and hence this number is higher than a maximally permissive deadlock avoidance policy can provide. Another algorithm for construction of the supervisors for deadlock avoidance in the PNs is proposed in [101], which, according to the experimental results, is competitive in time consumption compared to other methods and provides a maximally permissive policy.
In [102], the siphon-based approach is also used; however, it is combined with the state space exploration. The proper connections of the control places with the rest of the net to ensure the forbidding of the illegal markings can be obtained via solving the integer linear programming (ILP) problems. This method is time-consuming, not only because of the need of the reachability analysis, but also because the number of ILP problems that have to be solved may be large. The authors propose several ideas to reduce the computations. First, they introduce an alternative coloured PN model of the automated manufacturing systems, called a resource-oriented PN (ROPN), instead of the better-known process-oriented PN models, and argue that in such nets, the number of the illegal markings is much lower. Then, the markings not belonging to the set of first-met illegal markings are excluded from the consideration, in so far as they are forbidden, and all other illegal markings are made unreachable (this idea is used in several earlier publications; the notion of the first-met bad markings was defined in [103]). Further simplification is obtained by taking advantage of the ROPN structure. The linear programming problems to be solved in forbidding a marking are also simplified. The proposed method provides maximally permissive deadlock prevention. Minimisation of the number of control places (which may be redundant) and further reduction of computational complexity are mentioned as open problems.
The deadlock control problem in automated manufacturing systems is addressed in [104], with a discussion of often used solutions based on structural analysis (e.g., siphons) and a proposal of improved multi-step look-ahead control policies. They are claimed to be fully applicable to more complex systems, including a model with an one-unit resource shared by two or more perfect resource-transition circuits not containing each other. A two-step robust deadlock control policy for systems of the simple sequential process with resources based on elementary siphons is proposed in [105], and the developed controller does not need to compute reachability graphs.
Simplification of the monitor part of the nets is the topic of some other recent publications, where special kinds of partitions are used for such simplification. Another point of view is presented in [106], where the coloured capacity concept is proposed in coloured resource-oriented PN. A new execution rule for transitions is introduced and the coloured capacity function of each place can be obtained, which makes the structure of the net simpler than in case of the net with control places. A two-step robust deadlock control approach is described in [107]. Firstly, a controlled PN model is developed on the basis of strict minimal siphons. Then, all added control places are merged into one control place, which may contain the tokens of different colours and serves as a monitor for all minimal siphons. The experiments described in the paper show that the obtained net is simpler than the nets obtained with the known methods, and less computation is needed. In the paper GPenSIM Tool is also presented, which has been designed (by one of the authors-R. Davidrajuh) to model, control, simulate, and analyse discrete event systems, including PNs. According to the authors, the most challenging research topic in this area is developing deadlock control policy methods for the reconfigurable systems.
Indeed, in most of the publications in this area, the structure of the modelled system is considered to be stable, and no part of it can be changed or fail. Of course, sometimes possibilities of changes such as resource failures have to be taken into account. In [108], deadlock avoidance in manufacturing systems with multiple resource failures is considered. The proposed method is siphon-based, and the control places are added in a different way to the siphons with reliable and unreliable resources. A resource is considered as a machine, and the proposed control policy is oriented toward continuing of production of what can be produced without the failed resource. The authors claim that their method provides a better permissive behaviour and higher robust control level than other similar methods. Similar problems are dealt with in [109], where a new PN model-a simple sequential process with resources and part-re-entry-is proposed, and which can model a limited reconfigurability, i.e., the systems in which a failure of production and re-entry of a failed part is considered. The proposed siphon-based policy prevents deadlocks and guarantees boundedness and reversibility. Generalisation of the results to wider PN classes and increasing of the computational efforts by means of avoiding a complete siphon enumeration are mentioned as future work. An automatic supervisory controller for deadlock control in reconfigurable manufacturing systems with dynamic changes is modelled with PNs in [110]. The architecture of a system may be modified during its operation, which requires a quick and accurate reconfiguration of the model.
The novel approach to verify the nonblockingness of a PN is introduced in [111]. Nonblockingness means that at least one of the selected final markings is reachable from every reachable marking of the net. To verify it, a basis reachability graph (containing only a subset of the reachable markings) is constructed, and a set of integer linear programming problems is solved. Duplicated transition labels are proposed in [112] to avoid deadlocks in PN models. Algorithms with polynomial-time complexity are proposed to correct every inconsistent substructure (substructure that yields deadlocks) by adding a new transition associated to an event symbol already assigned to a transition in the inconsistent substructure. Deadlock-freeness in timed PN systems with uncontrollable transitions is addressed in [113], with the enforcement of generalised mutual exclusion constraints. A control function is designed in order to restrict the firing intervals of transitions, and thus the system can avoid entering the forbidden states. Computation of the state graph is performed online, on the basis of the concept of Reduced Modified State Class Graph.
The main contributions in recent publications regarding deadlock, involving deadlock prevention and deadlock recovery, are summarised in Tables 2 and 3. It can be concluded that deadlock detection and prevention is much more often investigated than deadlock recovery, mainly because of the problem of complexity. Table 2. Main contributions in the most recent publications regarding deadlock prevention.

Authors and Reference Year Contributions
Kaid, H. at al. [98] 2019 Classical method from [96] combined with transformation of a PN model into a ladder diagram, an effective method for PLC implementation from a controlled system model represented by PNs. Messinis, S. and Vosniakos, G.C. [99] 2020 Efficient design of a controller using agents. Computation of minimal siphons using the linear algebra.

Li, S. et al. [100] 2017
Control place and transition added to a siphon of an ordinary PN. The proposed deadlock control algorithm can obtain a live controlled system, whose reachable number (MRN) is the same as that of an original uncontrolled net.

Rezig, S. et al. [101] 2019
Optimal PN supervisor able to respect the control specifications is calculated. Design a set of controllers based on the properties of PNs and not on reachability graph generation for bounded PNs.

Chen, H.F. et al. [102] 2019
Resource-oriented PNs used to model systems for deadlock prevention. Various types of illegal markings that can be structurally identified. Illegal markings prevented by using polynomial algorithms or by solving the linear programming problems.

Gu, C. et al. [104] 2018
Improved multi-step look-ahead control policies. Deadlock avoidance polices applicable to complex situations, including a model with one-unit resource shared by two or more perfect resource-transition circuits not containing each other.

Authors and Reference Year Contributions
Pan, Y.-L. [114] 2020 Transition-based control policy to solve the deadlock problem. Detection of all legal markings and all deadlock markings via state space exploration. The system can recover from all initial deadlock and quasi-deadlock markings.
Dong, Y. et al. [115] 2019 Solving deadlock problems by adding a set of recovery transitions. A vector intersection approach to compute a recovery transition to recover multiple deadlock markings, with lower computational complexity.
Row, T.C. et al. [116] 2019 Iterative method to obtain maximally permissive states on the basis of control transitions. Adding special transitions to recover from the deadlock markings, with full state space exploration. Focus on crucial dead markings. All markings are live and reachable once these crucial markings are controlled.
Hu, M. et al. [117] 2020 Computationally efficient method to find dead markings. Bad markings detected by solving an integer linear programming problem to detect possible markings with empty syphons and the set of markings in the dead-zone is calculated to find all first-met bad markings.
In contrast to deadlock prevention approaches, there are less publications on deadlock recovery. One of the newest is [114], where the idea is to detect all legal markings and all deadlock markings via state space exploration and to consider adding the transitions leading from a deadlock marking to a legal marking. The proposed algorithm adds the transitions in such a way that their number is minimised. The method is computationally complex because it requires the construction of a full reachability graph and consideration of all pairs with deadlock marking-legal marking, but the resulting net in many cases is simpler than the nets obtained by other known methods. A less straightforward, iterative method of solving the same problem is presented in [115]. The method applies a vector intersection approach, which has lower computational complexity, but does not guarantee the minimal number of recovery transitions. However, in the paper, the same known examples of the nets are considered, as in [114], with the same or similar results. Another deadlock recovery method based on adding the special transitions to recover from the deadlock markings of the original net is presented in [116]. The method is iterative and, according to the authors, leads to the obtaining of a live net in which all the markings of the original net are reachable. However, the method requires full state space exploration. One more method of deadlock recovery for manufacturing systems is presented in [117]. The bad markings only are detected, instead of executing a full state space exploration, by means of solving an integer linear programming problem to detect possible markings with empty syphons, and then the set of markings in the dead-zone is calculated to find all first-met bad markings. The main advantage of the approach is that only a part of the reachability graph has to be searched. However, the method may lead to the detection of the unreachable markings among the bad ones; moreover, it does not guarantee that after the introduction of the monitors all the legal markings will remain reachable.
In the classical Petri net theory, the deadlock detection methods are deeply investigated, while the approaches dealing with deadlock avoidance and recovery are relatively newer. Comparing the recent research on deadlock avoidance with the older approaches, some of the novel methods can be noticed, that (a) take into account more general models, including the ones with changeable structure or involving time; (b) are less computationally complex than the previously known; (c) introduce less and simpler changes to the systems to avoid deadlocks; (d) provide more permissive policy. Certainly, none of the methods covers all the mentioned items.
Deadlock recovery is rather a new topic, at least in respect of Petri nets. There are publications on deadlock recovering in other models; however, according to our knowledge, deadlock recovery methods for Petri nets started to be developed during the last 10 years. The recent publications mainly present the research efforts in two different directions, namely, minimisation of number of recovery transitions and decreasing the computational complexity of the methods.
In sum, the following main challenges in the area of deadlock avoidance and recovery have been identified: (1) more permissive policy for the systems with unreliable resources and the systems with possible failures, (2) deadlock avoidance and/or deadlock recovery for the reconfigurable systems, (3) simplification of the structure of the monitor part of the systems and decreasing of computational complexity of the methods, and (4) developing of deadlock control and recovery methods for extended models such as PN with inhibitor arcs and enabling arcs.

Challenges Regarding Other Analysis Problems
Although Petri nets in their classical form have only a few kinds of elements (places, transitions, arcs, tokens), they can be easily combined in a way that creates a system with complex behaviour. Some additions that may be practically important in modelling of manufacturing systems, such as transition guards, complicate the analysis of their behaviour even more. Review of the latest research results presented in the literature (please refer also to Section 3) has revealed some challenges that are still actual. The most desirable properties, in general, are liveness and deadlock-freeness. In some applications, other properties may also be essential, such as boundedness, reversibility, or determinism. Certainly, analysis of the specific properties that can be specified by means of the temporal logics formulae and verified, e.g., with the model checking approach is also very important. Many analyses and verification methods are based on state space exploration. The state space analysis and state explosion problem (exponential growth of the state space with growth of the system) continues to be an important challenge for several decades [5,40,50,117,118]. In complex systems the state space can be huge or even infinite, which makes their analysis difficult. Petri net analysis methods suffer therefore from combinatorial and complexity problems, especially when the embedded systems have to be analysed [73], and it is sometimes not an easy task to use them for the analysis of models of complex systems with a significant number of states.
One of the recent publications in this area is [119], where an algorithm to solve the reachability problem is proposed. The reachability problem is fundamental for PNs and, generally, for the analysis of parallel systems, because many other problems of analysis can be reduced to reachability. The authors propose a method based on the net reduction and state compression technique, which allows for the generation and storage of state spaces in an efficient way; however, it is still time-consuming (exponential in the worst case). Moreover, [119] includes an interesting overview of the existing methods of handling the state explosion problem New analysis tools for PNs and their extensions have been developed. One of them is a new model checker for PNs (AdamMC) presented in [120]. It is able to check LTL formulae for safe PNs. Moreover, it deals with the extension of PNs, the so-called PNs with transits, which allow, with safe PNs as their underlying structure, the modelling of data flows. It can be seen as an alternative approach compared to coloured PNs. The authors also develop a temporal logic called Flow-LTL, being an extension of LTL. Flow-LTL allows for the specification of the flow of data and the use of both places and transitions of PNs as the atomic propositions, specifying the fairness assumptions in an easy way. AdamMC is the first model checker that makes it possible to check whether a PN with transits satisfies a Flow-LTL formula (it reduces this problem to checking an LTL formula for a safe PN). The parallel approach implemented in the model checker leads, according to the experiments, to essential performance gains.
In sum, the main innovations in the considered area are connected with development of methods limiting the state explosion during analysis and with development of new analysis software tools, including model checkers.
The main challenge in the analysis of Petri net models, including the models applied to manufacturing systems, is dealing with the already mentioned state explosion problem. This challenge is in a sense permanent, in so far as some such problems are NP-complete or belong to other classes of problems which are difficult to solve [121]. It is important (and is going to remain so) to detect the subclasses of the models which can be analysed in polynomial time and to develop the methods decreasing the computational complexity of analysis in other cases. In some practical cases, the development of approximation algorithms can be justified (in this context it may be, e.g., an algorithm which detects a fault in a model, not in 100% of cases, but with high probability).
Other challenges, such as efficient composition and decomposition of big systems and analysis of specific models and behavioural properties, are mentioned in recent publications. Moreover, development of the analytical approaches to the extended PN models used in modelling of real-life systems is important. Developing efficient software tools for analysis is also ongoing, in so far as they are necessary for the practical application of the analytic methods.

Difficulties in Modelling of Real Industrial Processes
In real industrial processes, some aspects become more important than in theoretical considerations. One of these is the concept of time. To precisely reflect the time points in the models, Petri nets have to be equipped with a clock structure [50]. Such models are then especially valuable for time series analysis and dynamic optimal control. Another aspect related to time is determinism. Although this refers to the net structure, it is also a challenge in practical applications.
Determinism, as a property of a model, guarantees a predictable behaviour of the system. Initially, PNs were fully non-deterministic [2], but soon there appeared various approaches that allowed the modelling of determinism. Some types of PNs use additional time variables to ensure the deterministic behaviour. For example, deterministic timed PNs (DTPNs) [122] introduced deterministic time delays into the net structure, while in discrete deterministic and stochastic PNs (DDSPNs) [123], transitions can fire either in zero time or according to arbitrary firing times (represented as time to absorption in a finite absorbing discrete-time Markov chain). The deterministic behaviour can also be achieved with the net structure by assigning some guards to transitions in an appropriate way, e.g., for transitions in conflict, they should contradict. An alternative way of solving the conflicts is by introducing priorities. Then, whenever two or more conflicting transitions are simultaneously enabled, the transition with higher priority fires first [3]. These classical approaches in the literature are also supported by some recent research. Determinism is now especially important in cyber-physical systems [31], where the determinism in software does not always result in the determinism of hardware. A determinism-oriented modelling technique with interpreted PNs for the control part of a CPS is proposed in [124]. The determinism can be handled in concurrent control systems in two ways-either weakly or strongly. The strong approach relates more to a local determinism, where the occurrence of particular input signals directly controls all reactions in the system (i.e., even in the concurrent parts the processes are fully determined). In turn, the weak approach can be treated as more global and the occurrence of the particular input signals controls only some reactions in the system (i.e., in the concurrent parts the processes remain independent). Hence, a PN consisting of weakly deterministic parts is also weakly deterministic. However, a PN consisting of strongly deterministic parts may also be weakly deterministic-and such a situation is typical for concurrent control systems (necessary to benefit from the real concurrency).
To model determinism correctly, two different notions of time can be used [125,126]a logical one and a physical one. Logical time is usually distinct from physical time. It corresponds more to the model than to the implementation (in contrast to physical time), and this may result in the fact that some logically simultaneous actions are indeed realised in a nondeterministic order. The relationship between the state of the software (usually concurrent and distributed) and the state of the physical system can be complex, because of the nature of the physical components. Thus, in real applications, it is often not known in which order the two actions will be performed, which may sometimes be dangerous (e.g., in a train, locking the door and starting to move can be logically simultaneous, but physically not, and thus it may happen that the train starts to move before the door is closed [127]). An approach to overcome this problem, presented in the example of the train [127], is based on the construction of transition system models for the software components of a CPS at different levels of abstraction and with various graininess. A possible solution, known for years from the theory of concurrency and distributed algorithms [128], can also be to ensure that the determinism is already built in at the specification level-so that the logical time refers by some means to the expected physical time-by the use of acknowledgements to guarantee the safety. In systems specified with PNs, it can be done by checking whether the appropriate command has already been executed (i.e., for the above-mentioned example by checking if the door has really been closed before starting to move).
Petri net models of real-time systems can become enormous [40,41]. Their construction is not a trivial task and requires a great deal of experience [75]. Additionally, their simulation and analysis may become slow and ineffective. The analysis of a large PN for its structural and behavioural properties is a time-consuming task. Despite huge state spaces, there are also other pitfalls in modelling and simulation of CPSs [129], including inaccurate or incomplete requirements, precision and complexity, or interpretation of results, where aspects related to CPS structure, behaviour, and environmental conditions have to be taken into account.
Other important issues related to real manufacturing systems are fault-resistance, fault-diagnosis, and fault-recovery, each one gaining a large amount of attention in the literature, and also in the case of PNs [130][131][132][133][134]. Faults may cause undesired reactions and shut-down of a controlled plant, resulting in potential damages to the plant, to personnel, or to the environment [135]. Hence, in order to increase safety and availability, system architecture must be adjusted (e.g., by employing redundant components), and appropriate mechanisms have to be implemented [136].
The correlation between large state spaces and their efficient analysis, together with the nature of continuous processes in various real industrial systems, also appears in the research related to formal verification of such systems. The model checking technique [137] is especially valuable in proving that some requirements are satisfied (or not) in the model. However, the technique also suffers from the state explosion problem [138]. To handle it, model abstractions can be used that reduce the generated state space. The overviews of various approaches to the state explosion problem over many years are presented in [118,138]. Statistical model checking [139,140], which combines simulation and statistical methods for the analysis of stochastic systems, can be used as an alternative to symbolic model checking with the exhaustive exploration of the whole state space. Both formal verification methods are currently being applied to a wide variety of systems, including manufacturing systems [141][142][143][144] or even in the nuclear industry [145]. Formal verification can also be applied for specifications based on Petri nets [12,13,44,120].
One more difficulty in modelling of the modern manufacturing systems is the necessity of taking into account their reconfigurability. The standard PN models do not allow for efficient representation and analysis of large sets of variants in systems. In [146], a notion of PN product line (a variable PN model, which can be used, e.g., for modelling flexible assembly lines) is presented. A prototype tool is described that allows the analysis of certain structural properties of this kind of model.
Certain structural problems represent also actual phenomena, such as the issues of compositionality. In [147], a concept of composition and decomposition of big systems from/to the components with interfaces is proposed. The concept is demonstrated using PNs and can be applied, among others, to workflow models. Identification of the components and their interfaces (perhaps using the theory of regions) is mentioned among the challenges for PN-based modelling of big systems.
As can be seen from the above, the main novelties of the research on modelling the industrial processes and systems are related to better understanding of determinism and time topics, development of the methods of fault diagnostics, recovery and repair using the formal models, and applying of the formal analysis and verification methods to a wide range of manufacturing and industrial systems.
To summarise the above discussions, the current challenges regarding modelling of real industrial processes with the application of Petri nets are mainly threefold: (1) how to properly construct large fault-tolerant models, (2) how to deal with large state spaces, and (3) how to correctly incorporate time into models.

Conclusions and Trends for the Future
Petri nets, although introduced in the 1960s of the 20th century, are still an important research object in many research centres around the world. The characteristics of the designed and developed systems has changed a lot since then, and the continuous technological progress constantly forces further changes. Researchers try to adapt and extend the existing concepts or methodologies, in some cases introducing some completely new approaches, in order to meet the new realities. Just as operators within Industry 4.0 should be equipped with digital skills to manage complex modern technologies [148], so should engineers working with Petri nets take into account the variety of systems, components, their characteristics, and their interactions.
In the article, the recently published research results (mostly over the past two years), have been presented and analysed in order to identify the most relevant challenges and opportunities related to the use of PNs for modelling of manufacturing systems. In university-level education, the multidisciplinary and interdisciplinary aspects need to fit into a limited duration of a course, which is especially difficult in distance learning settings. Application of PNs for modelling of modern and flexible manufacturing systems, despite the well-established knowledge in PN theory, still faces various problems related to the structure of the models and their analysis. Regardless of the branch of industry, the models are supposed to be live and not become stuck in any deadlock state. The construction and analysis of the reachability graph is sometimes very difficult, due to the large size of real systems. Finally, coming closer to practice, time needs to be correctly incorporated into models so that the future implementation reflects exactly the modelled system. PN-based modelling of real industrial fault-tolerant manufacturing systems is still a nontrivial task. The current challenges are summarised in Table 4. Moreover, the paper has provided comprehensive answers to the research questions (defined in Section 3.1). To summarise the most important aspects, current application areas of PNs in manufacturing systems (RQ1, addressed in Section 3.2) are cyber-physical systems, flexible manufacturing systems, complex production processes for Industry 4.0, human-machine safety, solving scheduling problems, maintainability, reliability, and performance evaluation. Recent contributions to PN education (RQ2, addressed in Section 4) mainly involve new software tools, interactive courses, and project-based learning. The relevant contributions in regard to deadlock prevention and recovering are shortly pointed out in Tables 2 and 3 (RQ3, addressed in Section 5). Other important analysis problems include, among others, analysis of specific properties (e.g., boundedness, reversibility, determinism), dealing with the state explosion problem and efficient composition/decomposition of big systems (RQ4, addressed in Section 6). Modelling of real industrial processes still encounters difficulties in respect to determinism, reconfigurability, incorporating time into models, fault-resistance, fault-diagnosis, and fault-recovery, but also ineffective analysis (RQ5, addressed in Section 7). Finally, from the recent literature overview, some further research directions can be established (RQ6).
The following trends for the future (RQ6) have been identified regarding the application of PNs in manufacturing systems: (1) Development and application of extended and high-level models and of methods for their analysis; (2) Developing models able to represent reconfigurability, unreliable resources and fault occurrences, and methods of analysis for such models; (3) Reducing the reachability graph or even eliminating it in the process of design analysis and verification; (4) Incorporating time into general models; (5) Simulations based on PN models; (6) Putting PNs into practice to enable everyday use of the thus-far developed approaches.
Some implications for the researchers should be especially emphasised. Classical methods of Petri net analysis, similar as most of the new ones, are intended for analysis of the systems with a stable structure. On the other hand, necessity of taking into account faults, reconfiguration, and other changes which can happen to a structure of the modelled system leads to the need for development of new analysis and verification methods for the models with a changing structure. An example may be a Petri net-based model in which, under certain limitations and according to the defined rules, number of places and transitions and/or connections between them can be changed dynamically. Some of the publications describing the research in this direction are mentioned in this paper, but it is definitely not enough, and more effort in this area is going to be practically important.
Another essential topic is related to the computational complexity of the analysis methods or methods related to, for example, deadlock prevention. Their complexity is often too high to make the methods acceptable for large models, especially when they involve time. Of course, the high computational complexity may be not a critical problem if the analysis is performed only at the stage of system design and not during its functioning. Sometimes, however, if a system structure can be modified when the system works, an on-the-fly analysis may be needed. This means that it makes sense to develop the methods which are not exact, but have low computational complexity. On the other hand, e.g., a deadlock prevention or avoidance method should not be inexact in the sense that it can miss some of possible deadlocks, which would be dangerous for practical applications. Rather, it may be not fully permissive. Another prospective approach-often applied, but it seems that still much more can be done in this direction-is reducing the complexity of the tasks to be solved by means of system decomposition.
Engineers rarely use formal models, such as PNs, for design and verification of manufacturing systems, tending to underestimate them. It is right that many important details and aspects of functioning of such systems cannot be easily captured by formal models. However, some verification tasks, such as deadlock prevention, most probably cannot be solved fully enough without formal models and formal algorithms of their analysis. The multitude of existing methods developed in this area provides a broad range of possibilities which can be applied in practice. Generally, formal verification of various properties, e.g., performed using model checking (developed also for the PN based models), can be extremely important practically, preventing crashes and other accidents.
Certainly, some of existing formal methods may have limited practical applicability because they are "too formal". For example, methods of deadlock avoidance may forbid some necessary system behaviours, and in such cases the problem can be solved not by just applying a deadlock avoidance policy, even if it is maximally permissive, but by correction of the system. Moreover, a deadlock recovery method generally provides "evacuation" from the initially deadlock marking to one of the legal markings without additional limitations, which may be practically impossible or unacceptable in the modelled systems. For such reasons, a dialogue between practitioners and researchers in order to formulate the tasks to make the formal methods and algorithms more practically useful can be fruitful.
The main limitation of the study is that only publications written in English have been taken into account. Some preliminary results, contributing also to the research topic but published in other languages (e.g., presented at local conferences), may have been omitted.
The significant number of articles focusing on the application of Petri nets in manufacturing systems, published in the last two years, confirms that it is still a valid research topic. The recognised challenges will definitely be addressed in the near future.