An Automatic Algorithm to Generate a Reachability Tree for Large-Scale Fuzzy Petri Net by And/Or Graph

: Fuzzy Petri net (FPN) is widely used to repre sent, model and analyse knowledge-based systems (KBSs). Meanwhile, a reachability tree is an important tool to fully represent the ﬂow relationship of FPN and is widely applied to implement inference in industrial areas. However, the traditional reachability ignores recording the dependence relationships (‘and/or’ relationship) among the places in the neighbouring layers. This paper develops a modiﬁed reachability tree based on an and/or graph and presents a three-phase generation algorithm to model the reachability tree for the corresponding FPN automatically via fuzzy production rules (FPRs). Four cases are used to verify the correctness and feasibility of the proposed algorithm from different viewpoints, such as general FPRs, FPRs with a condition-sharing situation, FPRs with a conclusion-sharing situation, and FPRs with multi-conclusions. Simulation results reveal that the proposed approach has the ability to automatically generate the reachability tree for the corresponding FPN correctly.


Introduction
The fuzzy Petri net (FPN), a kind of backward extension high-level Petri net (HLPN), has been widely applied to model and analyse uncertainty systems or knowledge-based systems (KBSs) [1]. Due to two unique features of FPN-structural store representation for fuzzy information and visualization description for uncertainty reasoning, FPN has been widely applied in various industrial areas, such as robotics [2,3], intelligent manufacturing systems [4,5], traffic control [6,7], semantic network [8,9], etc.
According to the above two characteristics of FPN, the main mechanisms of a FPN model's application could be classified into two types, a reasoning algorithm using the reachability tree and a reasoning algorithm using the algebra form [10,11].
The reachability tree is an equivalent model of FPN to record the reasoning path(s) among places intuitively. Chen et al. proposed various reasoning algorithms to implement fault diagnosis based on the corresponding reachability tree of a FPN model utilizing the immediate reachable set (IRS) and reachable set (RS), such as forward-reasoning algorithm [12], backward-reasoning method [13] and weighted fuzzy reasoning [14]. Manoj et al. extended Chen et al.'s research and proposed a hierarchical FPN for all types of data abstraction based on a reachability tree model [15]. In industrial applications, the reachability tree method is also widely applied to implement special tasks. Wu et al. proposed a hybrid method to analyze the reliability of the solar array by employing fault tree analysis and a fuzzy reasoning Petri net. The simulation results reveal that the top two factors to cause the solar array fault are harsh thermal environment and impact caused by particles in

•
It difficult to directly describe the dependence relationships ('and' or 'or' relationship) among the places in the neighbouring layers; • It difficult to generate automatically a large reachability tree for a rather complex expert system.
To overcome the shortcomings mentioned above, the goal of this manuscript is to propose an algorithm to automatically generate a reachability tree for a corresponding large-scale FPN model with complex flow-relationships among places and transitions. To fulfil this goal, this paper includes three main phases. First, a modified reachability tree based on an and/or graph model [21], decision tree theory [22] and fuzzy relations [23] is presented to fully record the flow-relationship among places and describe the dependence relationships among places in the neighbouring layers. Furthermore, an automatic generation algorithm is proposed in this manuscript to the reachability tree for the corresponding large-scale FPN model for solving the state-explosion issue. Finally, four groups of cases are employed to test the feasibility of the proposed generation algorithm.
The organization of the remaining parts is as follows: the modified reachability is illustrated in Section 2 after discussing the general definition of FPN, fuzzy production rule (FPR) and and/or graph. Section 3 demonstrates the entire flowchart and reveals the algorithm complexity of the presented generation algorithm of the modified reachability tree. A series of examples are given to prove the validity and feasibility of the presented algorithm in Section 4. Section 5 summarises and gives a brief conclusion.

Modified Reachability Tree for Different Fuzzy Petri Net (FPN) Models
FPN and FPR are the two main formal ways to fulfil the KBS requirements. Meanwhile, the reachability tree is a stronger tool to fully represent flow-relationship among places of FPN. This section first introduces the basic concepts both of FPN, FPR. Then, the corresponding modified reachability trees of different types of FPN models are generated after introducing the improved thinking of the reachability tree utilizing the and/or graph.

FPN and Fuzzy Production Rule (FPR)
FPN is generally defined as the following 8-tuple formalism. where, P = {p 1 , p 2 , · · · , p n } represents a finite set of places; n represents the number of places in the rule; T = {t 1 , t 2 , · · · , t m } represents a finite set of transitions; m represents the number of transitions in the rule;I(O) is the input (output) function, i.e., the mapping relation between places and transitions; M = (m 1 , m 2 , · · · , m n ) T indicates the identity of places; w i indicates the weight of places p i , i.e., the support degree for the rule establishment by preconditions p i ; CF j indicates the credibility, i.e., the true extent of the conclusion after transitions t j fired; and µ : µ → (0, 1] , µ i is the threshold of transitions t j .
FPR is commonly used to represent the uncertainties in expert systems [20][21][22]. General FPRs are formalized and described as follows.
where, D is a limited set of preconditions; D = {D 1 , D 2 , · · · D n }; Q is a limited set of conclusions; Q = {Q 1 , Q 2 , · · · Q m }; λ is the true extent of each precondition; λ ∈ [0, 1]; CF is the credibility of the rule; CF ∈ (0, 1] is the credibility of the conclusion obtained after the rule is executed; µ is the threshold of the rule, µ ∈ (0, 1]; and w is the weight of each precondition, w ∈ (0, 1]. Moreover, FPRs can be divided into three main types, which are 'simple', 'or', and 'and' rules according to the different relationship among conditions. Type 1: Simple rule i f D(λ) then Q (w = 1, µ, CF)

A Modified Reachability Tree Based on And/Or Graph
The reachability tree was the main method to implement the inference process using FPN's capability for graphic description during the 20th century. According to [13], the reachability tree could be generated by the immediate reachability set (IRS) and reachability set (RS). Although the traditional reachability tree can fully represent the flow relationship among places, the logical relationship such as 'and' and 'or' among the connected places is ignored in the current version. Hence, a modified reachability tree is proposed in this section based on the and/or graph If the original problem can only be solved when solutions of multiple simple problems are simultaneously established, the relationship among these simple problems is an 'and' relation; if the original problem can be solved when multiple simple problems are established, the relationship among these simple problems is an 'or' relation; if the original problem can be solved when any simple problem is established, the relationship is called 'Simple' elation. The problem that can no longer be resolved is called the original problem [21].
Based on the characteristics of the and/or graph mentioned above, the differences between the traditional reachability tree and the modified reachability tree could be summarized into the following three aspects:

•
The symbol ' j CF indicates the credibility, i.e., the true extent of the conclusion after transitions j t fired; and : the threshold of transitions j t . FPR is commonly used to represent the uncertainties in expert systems [20][21][22]. General FPRs are formalized and described as follows.

A Modified Reachability Tree Based on And/Or Graph
The reachability tree was the main method to implement the inference process using FPN's capability for graphic description during the 20th century. According to [13], the reachability tree could be generated by the immediate reachability set (IRS) and reachability set (RS). Although the traditional reachability tree can fully represent the flow relationship among places, the logical relationship such as 'and' and 'or' among the connected places is ignored in the current version. Hence, a modified reachability tree is proposed in this section based on the and/or graph If the original problem can only be solved when solutions of multiple simple problems are simultaneously established, the relationship among these simple problems is an 'and' relation; if the original problem can be solved when multiple simple problems are established, the relationship among these simple problems is an 'or' relation; if the original problem can be solved when any simple problem is established, the relationship is called 'Simple' elation. The problem that can no longer be resolved is called the original problem [21].
Based on the characteristics of the and/or graph mentioned above, the differences between the traditional reachability tree and the modified reachability tree could be summarized into the following three aspects: · The symbol '︶' is used to mark the 'and' relation for the 'and' type FPR in the modified reachability tree.
· All parameters' values are marked in the modified reachability tree.
· The modified reachability reverse records the flow relationship between the input place(s) and the output place(s) to aid in decomposition and reasoning operations.
' is used to mark the 'and' relation for the 'and' type FPR in the modified reachability tree. • All parameters' values are marked in the modified reachability tree.

•
The modified reachability reverse records the flow relationship between the input place(s) and the output place(s) to aid in decomposition and reasoning operations.
According to the logic relations among conditions of FPRs, there are three types of FPR, which are the 'simple', 'or', and 'and' rules. Furthermore, the corresponding FPN model and the equivalent modified reachability tree of each type of FPR are drawn in Figures 1-3, respectively. According to the logic relations among conditions of FPRs, there are three types of FPR, which are the 'simple', 'or', and 'and' rules. Furthermore, the corresponding FPN model and the equivalent modified reachability tree of each type of FPR are drawn in Figures 1-3, respectively.

Introduction to Breadth-First Search (BFS)
Breadth-first search (BFS) is one of the classical algorithms to seek a tree or graph. The entire implementation of BFS starts at the tree root or some arbitrary node of a graph. Then, it moves on the nodes at the next depth level and executes the same operations once all the neighbouring nodes at the present prior depth are analyzed. The queue data structure is often used because of the non-recursive mechanism of BFS [24].

Algorithm to Generate the Reachability Tree for FPN
The proposed generation algorithm owns the capability to build the corresponding reachability tree for a large-scale FPN model. The main thinking of the presented algorithm includes three phases, which are: According to the logic relations among conditions of FPRs, there are three types of FPR, which are the 'simple', 'or', and 'and' rules. Furthermore, the corresponding FPN model and the equivalent modified reachability tree of each type of FPR are drawn in Figures 1-3, respectively.

Introduction to Breadth-First Search (BFS)
Breadth-first search (BFS) is one of the classical algorithms to seek a tree or graph. The entire implementation of BFS starts at the tree root or some arbitrary node of a graph. Then, it moves on the nodes at the next depth level and executes the same operations once all the neighbouring nodes at the present prior depth are analyzed. The queue data structure is often used because of the non-recursive mechanism of BFS [24].

Algorithm to Generate the Reachability Tree for FPN
The proposed generation algorithm owns the capability to build the corresponding reachability tree for a large-scale FPN model. The main thinking of the presented algorithm includes three phases, which are: According to the logic relations among conditions of FPRs, there are three types of FPR, which are the 'simple', 'or', and 'and' rules. Furthermore, the corresponding FPN model and the equivalent modified reachability tree of each type of FPR are drawn in Figures 1-3, respectively.

Introduction to Breadth-First Search (BFS)
Breadth-first search (BFS) is one of the classical algorithms to seek a tree or graph. The entire implementation of BFS starts at the tree root or some arbitrary node of a graph. Then, it moves on the nodes at the next depth level and executes the same operations once all the neighbouring nodes at the present prior depth are analyzed. The queue data structure is often used because of the non-recursive mechanism of BFS [24].

Algorithm to Generate the Reachability Tree for FPN
The proposed generation algorithm owns the capability to build the corresponding reachability tree for a large-scale FPN model. The main thinking of the presented algorithm includes three phases, which are:

Introduction to Breadth-First Search (BFS)
Breadth-first search (BFS) is one of the classical algorithms to seek a tree or graph. The entire implementation of BFS starts at the tree root or some arbitrary node of a graph. Then, it moves on the nodes at the next depth level and executes the same operations once all the neighbouring nodes at the present prior depth are analyzed. The queue data structure is often used because of the non-recursive mechanism of BFS [24].

Algorithm to Generate the Reachability Tree for FPN
The proposed generation algorithm owns the capability to build the corresponding reachability tree for a large-scale FPN model. The main thinking of the presented algorithm includes three phases, which are: Then, settle the conclusion-sharing case in KBS. In KBS, a common situation that exists is that many FPRs could obtain the same conclusion. The conclusion-sharing situation will lead to chaotic and complex flow-relationships in the reachability tree. Hence, in this algorithm, the conclusion-sharing situations will be checked first and the FPRs with the conclusion-sharing situations will be divided into two FPRs by using a virtual conclusion as follows.
< type(simple, or, and?), {condition(s)}, virtual conclusion , {parameters} > (1) < type(simple, or, and?), virtual conclusion (s) , previous conclusion , {parameters} > • Phase 2 is used to generate all reachability trees for each FPR and to calculate the number of all root-nodes. • Phase 3 is to expand the reachability tree of an any given root-node from the root-nodes' set by using the BFS mechanism repeatedly until the final completed reachability tree is gained, and to execute the BFS operation for each root-node.
The flowchart of the generation algorithm is illustrated as shown in Figure 4. Then, settle the conclusion-sharing case in KBS. In KBS, a common situation that exists is that many FPRs could obtain the same conclusion. The conclusion-sharing situation will lead to chaotic and complex flow-relationships in the reachability tree. Hence, in this algorithm, the conclusion-sharing situations will be checked first and the FPRs with the conclusion-sharing situations will be divided into two FPRs by using a virtual conclusion as follows.
( , , ?  Phase 3 is to expand the reachability tree of an any given root-node from the root-nodes' set by using the BFS mechanism repeatedly until the final completed reachability tree is gained, and to execute the BFS operation for each root-node.
The flowchart of the generation algorithm is illustrated as shown in Figure 4.

Redefine all FPRs using the proposed formalism
Generate the corresponding reachability tree for each FPR Whether exists conclusion-sharing stituation? Y Optimize the FPRs with conclusion-sharing situation by using virtual conclusion.
Expend the reachability tree of the any given root-node by using BFS based on the relationship between conditions(s) and conclusion.
Get any root-node from the root-nodes set Record all visited nodes. Once the current node has been visited , move on to the visited node for solving the sharing condition.

Experiments and Related Analysis
In this section, four groups of FPRs with different characteristics are used to test the feasibility of the proposed algorithm., which are: · FPRs with 'and' and 'or' relationships;

Experiments and Related Analysis
In this section, four groups of FPRs with different characteristics are used to test the feasibility of the proposed algorithm., which are:

Experimental Data and Simulation Results
Experiment one: in this experiment, four FPRs, includes one simple type, two 'and' rules and a 'or' rule, are used to generate the corresponding reachability tree. The FPRs are listed in Table 1 and the simulation result is demonstrated in Figure 5. Table 1. Four fuzzy production rules (FPRs) in a knowledge-based system (KBS).

Experimental Data and Simulation Results
Experiment one: in this experiment, four FPRs, includes one simple type, two 'and' rules and a 'or' rule, are used to generate the corresponding reachability tree. The FPRs are listed in Table 1 and the simulation result is demonstrated in Figure 5. Table 1. Four fuzzy production rules (FPRs) in a knowledge-based system (KBS). ( , , , , ) if R and R and R then R if Q or Q then Q w w w CF  Figure 5. The obtained reachability tree from Table 1.

No
Experiment two: in this experiment, two FPRs with sharing conditions are used to generate the corresponding reachability tree. The FPRs are listed in Table 2 and the simulation result is demonstrated in Figure 6.  Figure 6. The reachability tree obtained from Table 2.
Experiment three: in this experiment, a FPR with multi-conclusions is used to generate the corresponding reachability tree. The FPRs are listed in Table 3 and the simulation result is demonstrated in Figure 7. Experiment two: in this experiment, two FPRs with sharing conditions are used to generate the corresponding reachability tree. The FPRs are listed in Table 2 and the simulation result is demonstrated in Figure 6. Table 2. Two FPRs in a KBS.

Experimental Data and Simulation Results
Experiment one: in this experiment, four FPRs, includes one simple type, two 'and' rules and a 'or' rule, are used to generate the corresponding reachability tree. The FPRs are listed in Table 1 and the simulation result is demonstrated in Figure 5.  Table 2 and the simulation result is demonstrated in Figure 6.  Figure 6. The reachability tree obtained from Table 2.
Experiment three: in this experiment, a FPR with multi-conclusions is used to generate the corresponding reachability tree. The FPRs are listed in Table 3 and the simulation result is demonstrated in Figure 7. Experiment three: in this experiment, a FPR with multi-conclusions is used to generate the corresponding reachability tree. The FPRs are listed in Table 3 and the simulation result is demonstrated in Figure 7.   Figure 7. The reachability tree obtained from Table 3.
Experiment Four: in this experiment, two FPRs with a sharing conclusion are used to generate the corresponding reachability tree. The FPRs are listed in Table 4 and the simulation result is demonstrated in Figure 8.  Figure 8. The reachability tree obtained from Table 4.

Analysis of Simulation Results
The above four experiments test how feasible is the automatic reachability tree generation ability in the proposed algorithm from four aspects, which are generally FPRs, FPRs with sharing conditions, FPRs with sharing conclusion and FPR with multi-conclusions.
The simulation result of experiment 1 shows that the algorithm generates the correct reachability tree for simple FPRs. Then, experiment two reveals that the proposed algorithm owns the capability to find and merge the sharing conditions among FPRs. Based on experiments one and two, the condition-sharing situation and conclusion-sharing situation are both included in experiment three to verify the correctness of the proposed algorithm. For the conclusion-sharing case in experiment three, a virtual node is automatically added to represent the flow relationship among FPRs. Finally, the FPR with multi-conclusions is used to test the algorithm from the viewpoint of multi-input and multi-output cases in experiment four. The four simulation results reveal that the proposed algorithm can generate the corresponding reachability for the FPN model correctly.  Table 3.
Experiment Four: in this experiment, two FPRs with a sharing conclusion are used to generate the corresponding reachability tree. The FPRs are listed in Table 4 and the simulation result is demonstrated in Figure 8. Table 4. FPR with multi-conclusions.

No FPR
Experiment Four: in this experiment, two FPRs with a sharing conclusion are used to generate the corresponding reachability tree. The FPRs are listed in Table 4 and the simulation result is demonstrated in Figure 8. Table 4. FPR with multi-conclusions. Rule 1   1  2  3  1  2  11  12  13  11  11  12 ( , , , , , ) if R and R and R then Q and Q w w w CF CF  Figure 8. The reachability tree obtained from Table 4.

Analysis of Simulation Results
The above four experiments test how feasible is the automatic reachability tree generation ability in the proposed algorithm from four aspects, which are generally FPRs, FPRs with sharing conditions, FPRs with sharing conclusion and FPR with multi-conclusions.
The simulation result of experiment 1 shows that the algorithm generates the correct reachability tree for simple FPRs. Then, experiment two reveals that the proposed algorithm owns the capability to find and merge the sharing conditions among FPRs. Based on experiments one and two, the condition-sharing situation and conclusion-sharing situation are both included in experiment three to verify the correctness of the proposed algorithm. For the conclusion-sharing case in experiment three, a virtual node is automatically added to represent the flow relationship among FPRs. Finally, the FPR with multi-conclusions is used to test the algorithm from the viewpoint of multi-input and multi-output cases in experiment four. The four simulation results reveal that the proposed algorithm can generate the corresponding reachability for the FPN model correctly.

Analysis of Simulation Results
The above four experiments test how feasible is the automatic reachability tree generation ability in the proposed algorithm from four aspects, which are generally FPRs, FPRs with sharing conditions, FPRs with sharing conclusion and FPR with multi-conclusions.
The simulation result of experiment 1 shows that the algorithm generates the correct reachability tree for simple FPRs. Then, experiment two reveals that the proposed algorithm owns the capability to find and merge the sharing conditions among FPRs. Based on experiments one and two, the condition-sharing situation and conclusion-sharing situation are both included in experiment three to verify the correctness of the proposed algorithm. For the conclusion-sharing case in experiment three, a virtual node is automatically added to represent the flow relationship among FPRs. Finally, the FPR with multi-conclusions is used to test the algorithm from the viewpoint of multi-input and multi-output cases in experiment four. The four simulation results reveal that the proposed algorithm can generate the corresponding reachability for the FPN model correctly.

Conclusions
The current method neglects to record the dependence relationships ('and' or 'or' relationships) among the places in the neighbouring layers. Focusing on this issue, a modified reachability tree is proposed in this manuscript based on the and/or graph. Furthermore, an automatic generation algorithm is proposed to execute the modelling operation from FPN to the corresponding reachability tree. Four experiments from different cases are employed to test the feasibility of the proposed algorithm. Simulation results show that the proposed algorithm possesses the capability to generate the corresponding reachability tree for the large-scale FPN model automatically.