In this section, we propose new concepts that enable us to identify the existence of deadlocks in systems modeled by an LPN. A system under consideration in this research is supposed to be arbitrarily labeled, i.e., no condition or restriction is imposed on the labeling function . Hence, the system may contain undistinguishable transitions, i.e., at a marking M, two (or more) enabled transitions may share the same label (e.g., a). We denote the set of undistinguishable transitions with respect to a label as . Moreover, the set of distinguishable transitions in an LPN is denoted by . By definition, holds, where is the set of undistinguishable transitions. Hence, the set of transitions can be partitioned as follows , where is the set of undistinguishable transitions but observable, i.e., , where .
Consider a system modeled with an LPN and consistent with the aforementioned description. With respect to the concept of basis reachability graph, we can classify the set of implicit reachable states from each basis marking to three main subsets: minimal explanations, non minimal explanations, and non explanation sequences. As we have proven in the previous section, if a deadlock state is reachable by firing an explicit transition preceded by one of its minimal explanations, the BRG can identify such a deadlock state. However, the BRG is still unable to identify deadlocks reachable by firing non minimal explanations or implicit sequences that can never belong to the set of entire explanations.
6.1. Dangerous Implicit Markings (DIMs) and Dangerous Implicit Vectors (DIVs)
At the beginning of this subsection, let us introduce some results that will be used in the following to minimize the related computations.
Theorem 2.
Suppose that is firable starting from a marking with in an PLN. It holds:
Proof. Let
and
. This implies that
. Suppose that
is firable from
with
. Then, we have
. Hence we get the following system
which indicates
. Accordingly, we conclude that from
we necessarily have
and the reachable marking is
. □
Corollary 2. Given two sequences , where , , and , suppose that there is a marking from which are firable sequentially with . If is firable from with , then holds.
Proof. The proof of this corollary derives from Theorem 2. In fact, suppose that from a marking we have . This implies that (1) with and . If , then (2) and . By (1) and (2) we conclude and . □
As a matter of fact, Corollary 2 is a generalization of Theorem 2. In what follows, we touch upon a primary notion called dangerous implicit marking which is pivotal to the development of this research.
Definition 11. Given an LPN , a basis marking , and a vector , let with and such that . Then is said to be a dangerous implicit vector (DIV) while is called a dangerous implicit marking (DIM).
Thus, we define the set of Dangerous Implicit Vectors (DIVs) at by
Moreover, we define the set of Dangerous Implicit Markings (DIMs) reachable from as
In words, consider a basis marking and a vector feasible at . The vector is dangerous because it can never be an explanation vector of any explicit transition at , i.e., for any feasible implicit sequence of transition at , where is the marking reachable by firing from , the sequence can never belong to the set of entire explanations at . In this case, the marking reachable by firing an implicit sequence from , with , is called a dangerous implicit marking.
Theorem 3.
Given an LPN , a basis marking , and a sequence of implicit transitions satisfying:
let be a set of markings, where denotes the prefix set of .3 Then, for any , .
Proof. Let be a basis marking and be two implicit sequences with . Suppose that and verify Theorem 3. Since and , we have . Let us consider now . We aim to prove that for all , .
- (a)
By , . Moreover, there does not exist such that due to .
- (b)
As known, the -induced subnet is acyclic, implying that the predicate holds: : . That is to say, from the marking , we cannot co-reach by firing only implicit transitions.
By (a) and (b), we conclude that for all , holds. □
In simple words, consider an LPN , an arbitrary basis partition , and a basis marking . Under the assumption that the -induced subnet is acyclic, we have proven by Theorem 3 that any marking reached by firing an implicit sequence that does not belong to , the prefix-closure of the set of entire explanations , is either a dead marking or a marking that inevitably leads the system to a blocking state. Thus, belongs necessarily to the dead Zone (DZ).
Proposition 2. Given an LPN , a basis marking , and a dangerous implicit vector with , is a DIM and for all such that , holds.
Proof. Given a basis marking and a sequence of implicit transitions firable from with , suppose that is a DIV, i.e., there does not exist such that . This implies that for all , there does not exist such that . We have for all such that , is true and thus by Theorem 3, holds. □
By virtue of DIV and DIM notions, Proposition 2 represents a generalization of Theorem 3. In fact, when checking the safeness of each non dead-basis marking, if an implicit vector is feasible at a basis marking () and there does not exist any explanation vector feasible at such that , we do not need to check the maximal cardinality that the implicit vector can reach, since it is certain by Proposition 2 that we will never find a vector included in the set of entire e-vectors.
In the following, Algorithm 2 is introduced to check the safeness of each non-dead basis marking. Given a basis marking and its set of entire e-vectors , the role of the proposed algorithm is to check if there exists any DIV, i.e., any implicit vector feasible at and does not belong to the set of entire explanations , that can threaten the system deadlock-freedom, thereby providing more information about deadlocks that can be reached from the basis marking .
Algorithm 2 works in a breadth-first manner. Considering the set of entire explanation vectors, this algorithm checks whether there exist any undesirable implicit vectors that can fire and lead to deadlocks. A first test is done by step 6 to verify the existence of the sufficient condition given by Theorem 3 and Proposition 2. Specifically, the matrix defines the set of entire e-vectors. If there does not exist any row in C such that , the conditions given by Theorem 3 and Proposition 2 are satisfied. Hence, the reached marking will be added to the set of dangerous implicit markings without adding it to the set . A second condition is introduced by step 9 of Algorithm 2. Indeed, this test aims to minimize the computation by checking whether the conditions in Theorem 2 and Corollary 2 are satisfied. Once becomes empty, a set of dangerous implicit vectors DIVs and its corresponding set of implicit dangerous markings DIMs are obtained by .
Proposition 3. The complexity of Algorithm 2 is .
Proof. In the worst case, the first step of the algorithm, i.e., the while loop, takes time of , where represents the number of implicit transitions of the studied Petri net. In the second step, browsing through the matrix takes the time of . The third step considers the checking of the existence of the new implicit vector in the two matrices B and of size and respectively, with being the cardinality of the set of entire e-vectors of . Therefore, the total cost for “the else if statement” is . Finally, the asymptotic total cost of Algorithm 2 is . □
Although, in the worst case, the number of iterations of Algorithm 2 may grow exponentially with the diameter (i.e., length of the maximal path) of the implicit subnet, in most practical cases, this number is quite reasonable, and Algorithm 2 has good performance since each iteration mainly consists of simple additions or comparisons of vectors.
Example 3. Let us consider the Petri net system shown in Figure 8, which consists of 9 places and 8 transitions . The transition set partition is defined by with and . Consider the initial marking . The reachability graph, shown in Figure 9, contains 16 reachable markings, 12 of which are legal markings and 4 of which are deadlock markings. In Figure 10, we present its BRG composed of 6 markings.
Let us focus on the basis marking which is the marking in the reachability graph. As shown in the BRG, is not a DBM. However, from the reachability graph one observes that is a dead marking reachable implicitly from and neglected by the BRG. By applying Algorithm 2, we can easily obtain with and . In fact, the set of entire e-vectors at contains only one element which belongs to . However, the vector is feasible from . Since there does not exist any vector such that , is a dangerous implicit vector at and is its corresponding DIM. As Theorem 3 and Proposition 3 indicate, this DIM belongs to the dead zone DZ.
6.2. Non Minimal Explanations
As we have previously mentioned, the concept of dangerous implicit markings is able to deal with the deadlock states reachable by an implicit sequence that can never be an explanation of any explicit transition at a given basis marking. However, in this subsection, we touch upon the last type of dead markings reachable from a basis marking which is a non minimal explanation. In plain words, the principle of the basis reachability graph is to find the minimal implicit path to activate each explicit transition. By this principle, non minimal explanations will not be considered.
Proposition 4. Given an LPN , a basis partition , a marking M, and a sequence such that , if , is not a dead marking.
Proof. Let be a marking and be a sequence of implicit transitions firable from M. signifies that there exists a transition such that . We can then conclude that does not lead to a dead marking. □
By definition, an explanation is a sequence of implicit transitions feasible at a given basis marking to enable an explicit transition. Thus, we conclude that a marking reachable from a basis one by firing an explanation of any explicit transition is not a dead marking.
Theorem 4. Given an LPN , a basis marking , an explicit transition , and that is a non minimal explanation vector of at , let be a marking reachable by firing preceded by , an explanation consistent with . If M is a dead marking, then there exists a basis marking reachable from by firing , where is a minimal explanation of at in comparison with , from which a dangerous implicit marking M is reachable, i.e., , and .
Proof. Consider a basis marking
, an implicit transition
, and a non minimal explanation vector
, i.e.,
. Suppose that
is a dead marking. The fact that
is a non minimal e-vector implies that there exists an e-vector
verifying
. That is to say that there exists a vector
such that
. Thus we have
We conclude that M can be reached from the basis marking by firing an implicit sequence of transitions such that . However, M is a dead marking. Hence, there does not exist any e-vector such that . Finally, we obtain . □
By Theorem 4, we have proved that if a dead state is reachable by firing a non minimal explanation, we can certainly reach it by firing only implicit transitions from a basis marking. Thus, the concept of dangerous implicit reach can cover this type of dead reachable states and identify dangerous sequences leading to such markings.
Example 4. Consider again the LPN in Figure 8 whose unobservable subnet is acyclic. Let us focus our attention on the basis marking . The set of explanations of at is . Therefore, we have and . In the BRG, only the minimal explanation is considered. Although this minimal explanation leads the system to a legal state, we can observe that according to the reachability graph, the non minimal explanations and conduct the system inevitably to the dead state . Since with is the minimal explanation in comparison with the aforementioned two explanations, one sees .