Equivalent Transformation of Nonlinear Constraints to Linear Constraints in Petri Nets

1School of Electro-Mechanical Engineering, Xidian University, No. 2 South Taibai Road, Xi’an 710071, China 2Cedric Lab and Computer Science Department, Conservatoire National des Arts et Métiers, 75141 Paris, France 3FARCAMT, Advanced Manufacturing Institute, King Saud University, Riyadh 11421, Saudi Arabia 4Industrial Engineering Department, College of Engineering, King Saud University, Riyadh 11421, Saudi Arabia 5School of Management, Fudan University, No. 220 Handan Road, Yangpu District, Shanghai 200433, China 6Institute of Systems Engineering, Macau University of Science and Technology, Taipa, Macau


Introduction
Petri nets [1] are a suitable tool to model and control discrete event systems (DESs) [2][3][4][5][6][7][8][9].The control of a DES is to restrict its behavior to satisfy the desired control specifications, for example, state forbidding or liveness enforcement.Supervisory control [10,11] is a well-known mechanism to enforce external constraints on a system to be controlled.In the framework of Petri nets, supervisory control is often represented by a set of control places such that only the desired behavior is allowed.
Constraints associated with reachable states in a DES are a typical and important control specification in supervisory control theory of DESs [12,13].In Petri nets, control specifications are often formulated as linear constraints on the states of a system.Linear constraints in Petri nets, also called generalized mutual exclusion constraints (GMECs) [14], are an important concept in the supervisory control of DESs.A well-established approach to enforce a GMEC is to add a control place (monitor) to construct a place invariant (PI) [15,16] in a Petri net.The PI-based approach has been widely studied by researchers and engineers.Yamalidou et al. [16] design control places to enforce a variety of GMECs.Iordache and Antsaklis [17,18] propose an approach to implement the disjunctive GMECs.In [19], a good survey is presented on the design of control places by PI-based methods.Up to now, most of the work dealing with deadlocks by Petri nets is based on PIs [20][21][22][23][24][25][26][27][28][29].
However, not all specifications can be represented as GMECs.In some cases, the specifications are given as a nonlinear constraint on a net model.In this case, the PI-based method fails to find a supervisor to enforce a nonlinear constraint.Therefore, this work deals with nonlinear constraints in Petri nets by finding a set of GMECs that are equivalent to a given nonlinear constraint.A nonlinear constraint is said to be equivalent to a set of GMECs if they allow the same behavior of a net model.Motivated by the work in [30][31][32], given a Petri net and a constraint, its reachability graph is divided into two parts: an admissible-zone (AZ) and a forbidden-zone (FZ), where the AZ contains all admissible markings, that is, those satisfying the constraint, and the FZ includes all forbidden markings, that is, those which do not satisfy the constraint.Then, we formulate the concept of border forbidden markings (BFMs) of a net model.A BFM is a forbidden marking that represents the very first entry from the AZ to the FZ.Thus, once all BFMs are forbidden, all forbidden markings are forbidden.Based on the reachability graph analysis, a set of GMECs can be found to forbid all BFMs but not admissible markings.In this sense, a nonlinear constraint is equivalent to a set of GMECs since they have the identical AZ.
There are two types of admissible marking space to be considered: convex and nonconvex.Based on the equivalence of different constraints, we propose an approach to find a set of conjunctive GMECs that are equivalent to a given nonlinear constraint if its admissible marking space is convex.Meanwhile, an integer linear programming problem (ILPP) is formulated to minimize the number of computed GMECs.That is to say, given a nonlinear constraint, we can find a minimal number of conjunctive GMECs that, once enforced, achieve the same control purposes as specified by the nonlinear one.In the case that the admissible marking space decided by a nonlinear constraint is nonconvex but its BFMs space is convex, we formulate another ILPP to find a minimal number of disjunctive GMECs that are equivalent to it; that is, we can find a minimal number of disjunctive GMECs that are enforced to achieve the same control purpose as the nonlinear one.
The rest of the paper is organized as follows.In Section 2, some basics of Petri nets and the design of control places by PIs are recalled.Section 3 reports the concepts and properties of nonlinear constraints and defines the equivalence of constraints by means of reachability graph analysis.In Section 4, two ILPPs are formulated to obtain a minimal number of conjunctive GMECs and a minimal number of disjunctive GMECs, respectively, which are equivalent to a given nonlinear constraint.Examples are provided to demonstrate the proposed method in Section 5. Finally, we make conclusions in Section 6.

Preliminaries
This section recalls the basics of Petri nets [1] and the computation of control places by PIs [16].
Let (,  0 ) be a net system with  = (, , , ).A transition A -vector is a column vector  :  → Z indexed by  and a -vector is a column vector  :  → Z indexed by , where Z is the set of integers.-vector  is called a -invariant (place invariant, PI for short) if  ̸ = 0 and   [] = 0  .A invariant  is said to be a -semiflow if  ≥ 0. Let  be a PI of (,  0 ).Then, ∀ ∈ (,  0 ), we have    =    0 .

Control Place for GMECs.
Let [] be the incidence matrix of a plant with  places and  transitions and [  ] the incidence matrix of the control places.In what follows, we briefly recall the computation of control places by PIs [16].Definition 1.A generalized mutual exclusion constraint (GMEC) is a pair (l, ) where l ∈ Z  and  ∈ N. A GMEC defines a set of admissible markings: Let   be the th component of l.Then a GMEC (l, ) can be represented as where   denotes the marking of place   .This inequality constraint can be transformed into an equality by introducing a nonnegative slack variable   as where   represents the marking of control place   that is usually called a monitor.A set of GMECs can be grouped into a matrix form as follows: where ⃗   is the marking vector of the Petri net model, [𝐿] is an   ×  nonnegative integer matrix, ⃗  is an   × 1 nonnegative integer vector, and   is the number of GMECs.
Input: A Bounded Petri net (,  0 ) and a constraint  Output: The set M  of admissible markings and the set M  of BFMs (1) M  := M  := { 0 }./ * M  denotes the set of markings whose successors are not computed.* / (2) while {M  ̸ = 0} do ∀ ∈ M  , remove  from M  , that is, M  := M  − {}.for each {transition  enabled at } do Algorithm 1: Computation of the set of admissible markings and the set of BFMs.
By introducing a nonnegative slack vector   , these inequality constraints can be transformed into equalities: where ⃗   is an   × 1 vector representing the marking of the control places.According to PI equation   [] = 0  , the supervisor [  ] can be computed as follows: Equation ( 5) is also true at the initial marking ⃗  0 of a net.Thus, the initial marking ⃗   0 of the supervisor can be computed as follows:

Generalizations of Nonlinear Constraints
In this section, we present basic concepts of nonlinear constraints in Petri nets in the sense of reachability graph analysis.We focus on the general definitions of nonlinear constraints since the linear case can always be considered as a special case of nonlinear constraints.
Let  be a constraint that restricts the tokens in a subset of places in a Petri net model (,  0 ).In this work, the constraints are only marking dependent while no firing functions of transitions are considered.
A constraint  classifies the reachable markings of a net into two groups: admissible ones that satisfy  and forbidden ones that do not satisfy , as defined below.Definition 3. Let  be a constraint on a Petri net model (,  0 ).A marking  ∈ (,  0 ) is said to be admissible with respect to  if   () = 1.The set of admissible markings with respect to  is denoted by M  .A reachable marking  of (,  0 ) is said to be forbidden with respect to  if   () = 0.The set of forbidden markings with respect to  is denoted by M  .
A supervisor is maximally permissive, or optimal, if it can always disable any transition whose firing leads to a forbidden marking.In this sense, a maximally permissive supervisor for a constraint  should keep all admissible markings with respect to  in the controlled system and exclude the reachability of any forbidden marking decided by .
Given a constraint on a Petri net model (,  0 ), we assume that its initial marking always satisfies the constraint.Then, the reachability graph of (,  0 ) can be classified into two parts: an admissible-zone (AZ) and a forbidden-zone (FZ).The AZ includes all admissible markings with respect to , from which the initial marking is reachable, and the FZ contains all forbidden markings with respect to .A border forbidden marking (BFM) with respective to  is a marking in the FZ that is the direct successor of some marking in the AZ.Mathematically, the set M  of BFMs is defined as follows.
Definition 4. Let  be a constraint on (,  0 ).The set of BFMs is defined as If all BFMs cannot be reached, their successors cannot be reached.Thus, there is no need to compute the whole reachability graph of a net system.Definition 4 motivates us to generate a part of the reachability graph, that is, M  and M  .An algorithm to compute the two sets is presented in Algorithm 1.
Algorithm 1 can find all admissible markings and BFMs without generating the whole reachability graph of a net.Next, the equivalence between two constraints is defined by means of reachability graph analysis.Definition 5. Let C =  1 ∧  2 ∧, . . ., ∧   be a set of conjunctive constraints on a Petri net model (,  0 ).A reachable marking  of (,  0 ) is said to be admissible with respect to C if, ∀  ∈ C,    () = 1.The set of admissible markings with respective to C is denoted by M C .A reachable marking  of (,  0 ) is said to be forbidden with respect to C if ∃  ∈ C,    () = 0.The set of forbidden markings with respective to C is denoted by M C .
Similarly, we have the following definition for the set C of disjunctive constraints; that is, C =  1 ∨  2 ∨, . . ., ∨   .Definition 6.Let C =  1 ∨  2 ∨, . . ., ∨   be a set of disjunctive constraints on a Petri net model (,  0 ).A reachable marking  of (,  0 ) is said to be admissible with respect to The set of admissible markings with respect to C is denoted by M C .A reachable marking  of (,  0 ) is said to be forbidden with respect to C if, ∀  ∈ C,    () = 0.The set of forbidden markings with respect to C is denoted by M C .By Definitions 5 and 6, we can define the equivalence between the sets of constraints.In the following, C  ( = 1, 2) can be a set of conjunctive or disjunctive constraints.Definition 7. Let C 1 and C 2 be two sets of constraints on (,  0 ).C 1 and C 2 are said to be equivalent with respect to Since a GMEC can be directly enforced through a control place by the PI-based method [16], Definition 7 motivates us to develop an approach to replace a nonlinear constraint by a set of GMECs.That is to say, given a nonlinear constraint, we can possibly find a set of linear constraints that achieve the same control purposes by the reachability graph analysis.

From Nonlinear Constraints to GMECs
In the case that the admissible marking space decided by a nonlinear constraint is convex, this constraint can be transformed into a set of conjunctive GMECs that have the same admissible marking space as the nonlinear one.That is to say, a nonlinear constraint is equivalent to a set of GMECs from the viewpoint of constraint enforcement purposes.Similarly, if the admissible marking space decided by a nonlinear constraint is nonconvex but its BFMs space is convex, it can be transformed into a set of disjunctive GMECs.

The Minimal Number of Conjunctive Constraints.
A set of conjunctive GMECs can be easily enforced by a set of control places using the method presented in Section 2.2.In this section, we first transform a nonlinear constraint into a set of conjunctive GMECs.In the following, Suppose that there is a nonlinear constraint  on a Petri net (,  0 ) with  places and  transitions.A set of conjunctive GMECs on (,  0 ), which is equivalent to , can be expressed as where   is the number of the constraints,  , 's are integers, and   is a nonnegative integer.
Let   denote the th constraint; that is,   := ∑  =1  , ⋅   ≤   .All admissible markings with respect to , whose set is denoted by M  , should be reachable.Thus, we have Now, we introduce a set of variables  , 's ( ∈ N  ) to represent the relation between   and   in M  .Then, ( 10) is modified to be where  is a positive integer constant that must be big enough and  , ∈ {0, 1} is a binary variable.In (11),  , = 1 indicates that   is forbidden by   and  , = 0 implies that   cannot be forbidden by   .For   , all constraints in the type of (11) for BFMs in M  are grouped as: In fact, the number of constraints, for example,   , to be computed is much less than that of the elements in M  .Therefore, we can formulate an ILPP to find the minimal number of constraints.Now, by introducing variable ℎ  ∈ {0, 1} ( = 1, 2, . . .,   ) for   , we have the following constraint where ℎ  = 1 implies that   is selected and otherwise ℎ  = 0. Equation ( 13) means that if   is not selected, it cannot forbid any BFM.For a BFM   , we also have Equation ( 14) ensures that any BFM   in M  must be forbidden by at least one constraint.As a result, we have the following ILPP to obtain the minimal number of conjunctive constraints, which is denoted The objective function ℎ is used to minimize the number of constraints to be computed.Denote its optimal solution as ℎ * .If MNCCP has an optimal solution, we can claim that the given constraint is equivalent to the minimal number ℎ * of linear constraints, as stated below.
Theorem 8. Given a Petri net model (,  0 ) and a nonlinear constraint  on it, if MNCCP has an optimal solution ℎ * , then one can obtain the minimal number ℎ * of conjunctive GMECs that are equivalent to  with respect to (,  0 ).
Proof.By (16), each computed constraint does not forbid any admissible marking.By (17) and (19), every BFM is forbidden by at least one constraint.Thus, all forbidden markings are accordingly forbidden.Equation (18) ensures that only the selected constraints are used to forbid BFMs.In addition, the objective function ensures that the minimal number of constraints is selected.Since ℎ represents the number of the selected constraints, the minimal number equals the optimal solution ℎ * .In summary, the conclusion holds.
For MNCCP, we need to set a proper initial value for   .In the worst case, we need to design a constraint for each BFM.Thus, we have 1 ≤   ≤ |M  |.Suppose that MNCCP has an optimal solution with the minimal number of constraints and it is denoted as  *  .If   is too small, that is,   <  *  , MNCCP has no solution.In this case, we can increase   and solve MNCCP again.Therefore, the proper range for   is from  *  to |M  |.If MNCCP has no solution for   = |M  |, the proposed ILPP fails to find a set of conjunctive constraints that are equivalent to the given constraint.The closer the given   is to  *  , the more efficient MNCCP becomes since it has less constraints and variables.Table 1 shows the number of constraints and variables in MNCCP.

The Minimal Number of Disjunctive Constraints.
If the admissible marking space with respect to a nonlinear constraint  is nonconvex, we cannot find a set of GMECs whose conjunctions are equivalent to .However, if its BFMs space is convex, it is possible to find a set of GMECs whose disjunctions are equivalent to .In the following, N  denotes { |   ∈ M  }.The disjunctions of GMECs can be written as Equation (21) indicates that at least one of the constraints must be satisfied.Hence, a marking is reachable if it satisfies at least one of the constraints.Any marking   ∈ M  must be reachable.Therefore, we have Equation ( 22) cannot be directly considered as a constraint for an ILPP.Hence, we introduce a set of binary variables  , 's ( , ∈ {0, 1}) to represent the relation between each marking   and the th constraint.In particular,  , = 1 indicates that   satisfies the th constraint and  , = 0 implies that   does not satisfy the th constraint.Then, ( 22) is rewritten as A marking is forbidden if it is forbidden by every constraint.Any marking   ∈ M  must be forbidden.Therefore, we have We do not know how many constraints are needed.In the worst case, each admissible marking in M  is associated with a constraint.That is to say, 1 ≤   ≤ |M  |.In fact, the number of constraints to be computed is much less than the cardinality of M  .Suppose that there are   constraints initially.Next, we select the minimal number of constraints from the   constraints.A variable ℎ  (ℎ  ∈ {0, 1},  ∈ {1, 2, . . .,   }) is introduced for the th constraint and we have the following facts: where ℎ  = 1 implies that the th constraint is selected and ℎ  = 0 indicates that the th constraint is redundant and thus there is no need to add it as a constraint in (21).Equation (26) means that if the th constraint is not selected, no admissible marking necessarily satisfies it.For any admissible marking   , we also have Equation ( 27) ensures that any admissible marking   in M  must satisfy at least one constraint.Finally, we formulate the following ILPP to find the minimal number of disjunctive GMECs that are equivalent to the given constraint , which is denoted as the minimal number of disjunctive constraints problem (MNDCP).
MNDCP is shown as follows: subject to The objective function ℎ is used to minimize the number of constraints that are selected.Denote its optimal value by  ℎ * .If MNDCP has an optimal solution, then we can find the minimal number ℎ * of disjunctive GMECs that are equivalent to the give nonlinear constraint, as stated below.
Theorem 9. Given a Petri net model (,  0 ) and a nonlinear constraint , if MNDCP has an optimal solution ℎ * , then we can obtain the minimal number ℎ * of disjunctive GMECs that are equivalent to  with respect to (,  0 ).
Proof.Equation (29) ensures that every obtained constraint can forbid all BFMs in M  .Thus, no forbidden marking is reachable.According to (30) and (31), every marking in M  satisfies at least one obtained constraint.Hence, the disjunctions of all obtained constraints, that is, (21), can make all admissible markings reachable.Finally, the objective function ensures that the minimal number of constraints is selected, that is, the optimal solution ℎ * .In summary, the conclusion holds.
Similar to MNCCP, we also need to set a proper initial value for   in MNDCP.In the worst case, we need to design a constraint for each admissible marking.Thus, we have 1 ≤   ≤ |M  |.Suppose that MNDCP has an optimal solution with the minimal number of constraints.We denote the minimal number as  *  .If   is too small, that is,   <  *  , MNDCP has no solution.In this case, we can increase   and solve MNDCP again.Therefore, the proper range for   is from  *  to |M  |.If MNDCP has no solution for   = |M  |, the proposed ILPP fails to find a set of disjunctive constraints that are equivalent to the given constraint.The closer the given   is to  *  , the more efficient the MNDCP becomes since it has less constraints and variables.
As stated previously, the computational time for finding an optimal solution of an ILPP greatly depends on the number of the constraints and variables in it.Therefore, we provide the numbers of constraint and variables in MNDCP in Table 2.
The disjunctions of GMECs cannot be directly implemented by designing a control place for each constraint by the PI-based method.However, one can find some existing approaches in [17,18] that deal with disjunctive constraints in the framework of supervisory control.In this work, we do not recall it due to the limited space.

Examples for Nonlinear Constraints
In this section, a number of nonlinear constraints are considered to demonstrate the proposed approach.
Example 1.We consider a simple constraint to illustrate the proposed approach: The admissible markings are shown in   the second column represents the nonlinear constraints, and the third column provides the minimal number of equivalent conjunctive GMECs.
Example 3. We show the results for two constraints  1 : max( 1 ,  2 ) +  2 ≤ 4 and  2 : min( 1 ,  2 ) +  2 ≤ 4. It can be seen that the admissible marking space with respect to  1 is convex but that with respect to  2 is nonconvex.In this case, we can find a set of conjunctive GMECs that are equivalent to  1 and a set of disjunctive GMECs that are equivalent to  2 .The results are shown in Table 5.
Example 4. A flexible manufacturing system is shown in Figure 4(a).It consists of robot  that can hold one part at a time, two machines 1 and 2, each of which can process one part at a time, two loading buffers 1 and 2, and two unloading buffers 1 and 2.Two part types are considered in the system: 1 and 2.The production sequences are shown in Figure 4(b).The Petri net model of the system is depicted in Figure 5(a).The model has 20 reachable markings.in Figure 5(b) is live with the 15 admissible markings.That is to say, the nonlinear constraint  is equivalent to the two GMECs.

Conclusions
This paper deals with the enforcement of the nonlinear constraints on Petri nets.Two ILPPs are proposed, one is to obtain the minimal number of GMECs whose conjunctions are equivalent to a given nonlinear constraint if its admissible markings space is convex and the other is to obtain the minimal number of GMECs whose disjunctions are equivalent to a given nonlinear constraint if its admissible markings space is nonconvex but its forbidden markings space is convex.The two ILPPs require to generate all the admissible markings and BFMs for a given constraint, which are not efficient for large-sized problems.In the future, we will focus on the computational efficiency.

Figure 5 :
Figure 5: (a) A Petri net model and (b) the controlled net model.

Table 1 :
The number of constraints and variables in MNCCP.

Table 4 :
Equivalent constraints for classical nonlinear constraints.

Table 5 :
Equivalent constraints for two nonlinear constraints.Suppose that the control specification (deadlock control) can be represented as a nonlinear constraint : ( 2 +  3 + 2) 2 + ( 5 +  6 + 2) 2 ≤ 17.Then, there are 15 admissible markings and five BFMs.We formulate an MNCCP for .By solving the MNCCP, we can obtain an optimal solution with two GMECs 2 2 +  5 +  6 ≤ 2 and  3 +  5 ≤ 1.Two control places   1 and   2 are designed for the two GMECs, respectively, as shown in Figure5(b).It can be verified that the controlled net