Model Identification of Unobservable Behavior of Discrete Event Systems Using Petri Nets

This paper deals with the problem of identifying a Petri net that models the unobservable behavior of a system from the knowledge of its dynamical evolution. We assume that a partial Petri net model that represents the observable behavior of a system is given in which all the transitions are observable. An identifier monitors the system evolution and records the observed transition sequence (and possible correspondingmarkings). Some unobservable transitionsmodeling the unknown systembehavior are identified from the transition sequence by formulating and solving integer linear programming problems.These identified unobservable transitions together with the given partial Petri net model characterize the whole system, including observable and unobservable behavior. Two different cases are considered. First, we assume that no place is observable. In such a case, a transition sequence is observed only during the evolution of the system. Second, we assume that a subset of places is observable; i.e., the observation contains not only the transition sequence but the corresponding markings as well. Hence an additional constraint should be imposed on the unobservable transition in the related programming problems according to the observed markings such that a more authentic unobservable transition can be found.


Introduction
Dynamic systems can always be modeled as continuous time systems or discrete event systems (DESs) [1].In the framework of DESs, the dynamic behavior of a system is usually characterized by its output in the form of numbers, symbols, text, etc.An interesting issue is to infer a system model from the knowledge of system's output information such that its behavior can be verified, controlled [2,3], or diagnosed [4][5][6][7].The identification of a DES consists in determining a mathematical model from the data set of inputoutput signals of a system that describes all or part of the system behavior.
In the DES context, the model setting for the identification problem mainly includes automata and Petri nets.In the early work, Gold [8] shows that the problem of whether there exists an automaton that agrees with the given data is NPcomplete.On the basis of an automaton model, Angluin [9] presents a family of efficient algorithms for inferring the kreversible languages from finite positive samples.
Given some information on the evolution of a system, several studies discuss the identification problem of DES using Petri nets.Roughly speaking, the existing approaches can be divided into three categories: (a) given a finite language describing the system behavior, it consists in determining the structure and initial marking of a Petri net system whose language coincides with the given one [10][11][12], (b) given an event sequence (transition sequence) as well as the corresponding system states (markings), the goal is to determine a Petri net system such that the given event sequence is firable from its initial marking [13][14][15], and (c) assuming that the net to be identified has special structure (e.g., safe Petri nets) or properties (e.g., exhibiting cyclic behavior), the net is identified from finite data using the customized algorithm [16][17][18][19].In general, an integer linear programming problem (ILPP) is defined to impose certain constraints on the structure of the net to be identified in cases (a) and (b).It may require heavy computational costs to solve an ILPP; however this technique is very general.On the other hand, a customized algorithm is designed based on the knowledge of the structure and property of the net in case (c), and the algorithm often has polynomial time complexity.Nevertheless, it can only be applied to a special class of Petri nets.
Giua and Seatzu [10] present an integer programming technique for the identification of a free-labeled net, i.e., a net without an associated labelling function, from a finite prefix-closed language with the length of its longest word less than or equal to a given positive integer.In their approach, both positive examples and counterexamples can be derived from the given language, and the constraint set of the programming problem allows the positive examples but forbids the counterexamples.The approach is general, but it has high computational complexity.Cabasino et al. [11] extend this approach to the identification of a deterministic -free-labeled Petri net, i.e., a net where two transitions can share the same label (cannot be an empty string).
Unlike the studies in [10,11] in which no information about places is known, Dotoli et al. [13] assume that a transition sequence and the corresponding reached marking after transition fires are observed.A net system is identified by solving an ILPP such that the transition sequence is firable from its initial marking and each marking after firing a transition in the sequence equals the observed one.
Hiraishi [16] proposes an approach which constructs a safe Petri net from the knowledge of firing sequences.Firstly, a finite state automaton is identified from the given firing sequences, and then the structure of the Petri net is estimated.The approach has polynomial time complexity, but it can only be applied to safe Petri nets.Bekrar et al. [19] provide an algorithm that identifies a safe Petri net from the data set of I/O signals of a system.They assume that the considered system is cyclic and all its cycles start from the same initial state.Meda et al. in [17,18] discuss the identification problem by using Interpreted Petri nets, i.e., a Petri net associated with an input function and an output function, assuming that the dependency between transitions is known.All studies in [16][17][18][19] fall into case (c).These approaches are not general and can only be applied to Petri nets with special structure or behavior.
The problems of fault diagnosis and diagnosability have received a lot of attention since the work by Sampath et al. [20].In the context of Petri nets, it is usually assumed that the faulty model describing not only the fault-free but faulty behavior of a system is known and that the fault events are modeled by unobservable transitions [4][5][6][7].In other words, when we build the Petri net model of a system for diagnosis, both fault-free system behavior and faulty behavior should be considered simultaneously.However, it is not realistic to figure out all possible faulty behavior when one models a system [21].Thus an issue arises: how to identify faulty (unobservable) behavior to improve the accuracy of the faulty model.In this issue, the fault-free model is assumed to be known.We have to decide whether some unobservable behaviors occur according to the observed event sequence.To the best of our knowledge, there are few studies focusing on the identification of unobservable transitions using Petri nets.
Cabasino et al. [12] propose an approach based on the work in [10] to identify the faulty (unobservable) transitions by assuming that the fault-free model is known and that the system contains at most one unobservable loop-free transition.The main idea is to define and solve an integer programming problem according to the positive examples and counterexamples that can be computed by comparing the given language and the observed language.The main drawbacks of this approach are the computational complexity and the limitation that only one unobservable transition can be identified.Dotoli et al. [15] also assume that the nominal model without unobservable transitions is known.An online approach is proposed to identify recursively an unobservable subnet from the knowledge of an observed transition sequence and the corresponding reached markings.
In this paper, we extend the work in [15], where all places are assumed to be observable, to the case of partial observable places.Our work is motivated by the fact that in the practical application it is difficult to associate each place with a sensor because of the technical or financial consideration.
This paper deals with the identification of unobservable transitions from the knowledge of an observed transition sequence.An identifier monitors the system and, upon the observation of a transition, an integer programming problem is solved to decide whether an unobservable transition should be introduced.If it is true, an unobservable transition is identified by solving another integer programming problem.An online algorithm is also presented to identify an unobservable subnet consisting of identified unobservable transitions.
In contrast to the work [15], the proposed approach is more general since only part of places need to be observable (all places are assumed to be observable in [15]), and they have the same computational complexity.More specifically, the number  of observable places in our approach satisfies 0 ≤  ≤ , where  is the number of places in a net.For  = 0, i.e., no place is observable, the observed output is a transition sequence.For 0 <  < , i.e., a subset of places is observable, the observation is a transition-partial-marking sequence, where a partial marking is a marking of observable places.If  = , then the problem to solve is the same as [15].This paper is organized as follows.Section 2 presents basic definitions about Petri nets as well as some preliminary results.In Section 3, we first present some results that are theoretical basis of the subsequent identification algorithm, and then an online algorithm and its computational complexity are discussed.In Section 4, we extend the algorithm to the case that some of places are observable.Finally, we conclude this paper with the further work in Section 5.

Preliminary
This section recalls basic concepts of Petri nets and some preliminary results.In addition, several definitions used in this paper are given.For more details on Petri nets, the reader is referred to [1,22].

Basics of Petri Nets.
A Petri net is a four-tuple  = (, , , ), where  is the set of places,  is the set of transitions,  :  ×  → N, and  :  ×  → N are the pre-and postincidence matrices, respectively, which specify the structure of the Petri net.For  ∈ ,  ∈ , and  ∈ N, (, ) =  if there exists an arc with weight  from  to , 0 otherwise; (, ) =  if an arc with weight  goes from  to , 0 otherwise.Here N is the set of nonnegative integers.We denote by  = || the number of places and  = || that of transitions.The incidence matrix of a net is denoted as  =  − .For  ∈ , its preset is defined as •  = { ∈  | (, ) > 0}, and its postset is defined as All the markings reachable from  0 comprise the reachability set of a Petri net and it is denoted as (,  0 ).The set of sequences enabled at the initial marking  0 is denoted as which is called the language of a Petri net.
We define an -dimensional column vector  →  :  → N (called firing vector) for the corresponding transition sequence  such that  →  () =  if transition  occurs  times in .For an enabled transition sequence  at  0 such that  0 [⟩, we have the following state equation: which is called the state equation of a Petri net system.

Labeled Petri
where  →  is a variable in R  ; i.e., we add a variable  →  ≥  → 0 and two additional constraints −  →  ≤  →  and  →  ≤  →  .
In fact, for the real numbers  1 and  1 that are the first entries of vectors  →  and  →  , respectively, there are three different cases. ( Because of the constraint  1 ≤  1 ,  1 is necessarily at least as large as  1 .On the other hand,  1 is in the objective function such that it trends to be as small as possible.Thus  1 will be equal to  1 , i.e.,  1 = abs( 1 ).(2)  1 = 0.In this case, constraints − 1 ≤  1 and  1 ≤  1 are always verified because of  1 ≥ 0. Moreover  1 is in the objective function, and thus it trends to be zero, i.e.,  1 = abs( 1 ).
In plain words, given a transition sequence  ∈  * , the operator   computes the projection of  on observable transition set   and the operator   computes the projection of  on unobservable transition set   .Note that  −1  denotes the inverse of projection   .
Given a sequence  ∈ (,  0 ),  =   () is the observed sequence.The set of all observed sequences can be represented by A Petri net is said to be acyclic if it has no directed circuit.Equation (2) shows that there exists a nonnegative integer  →  such that  =  0 +  ⋅  →  if  is reachable from  0 , which is a necessary but not sufficient condition.However, for an acyclic Petri net, it is necessary and sufficient, as shown by the following theorem.
A net  = (, , , ) is pure if it has no self-loop; namely, ∀ ∈ , (, ) × (, ) = 0 for each  ∈ .Note that the structure of a pure net can be represented by its incidence matrix.Moreover, it is trivially verified that an acyclic net is pure.Definition 4. Consider net system ⟨,  0 ⟩ with  =   ∪   .Let  ∈ Ω(,  0 ) be an observed sequence.The sequences of unobservable transitions which enable the occurrence of  are denoted by and the   -dimensional firing vectors of sequences of unobservable transitions associated with  are denoted by Example 5. Figure 1 shows a net system with   = { 1 ,  2 },   = { 1 ,  2 ,  3 }, and  0 = [1, 0, 0, 0]  .If an observed transition sequence is  =  1  2 , by Definition 4, we observe

Model Identification without Observable Places
3.1.Problem Statement.Assume that the observable subnet   and the initial marking  0 are known.We monitor the system evolution and record the occurred event.Upon the occurrence of an event, a transition  ∈   is observed and it is appended to the tail of the observed sequence.If the observed transition sequence is V, then two different situations are taken into account.
(i)  0 [V⟩ holds, i.e., V ∈ (  ,  0 ).In such a case the observable subnet is sufficient to describe the observed transition sequence.
(ii)  0 [V⟩ does not hold.We infer that one or more unobservable transitions not included in   occur.
We can infer a net  = (, , , ) with  =   ⊗   from the observed transition sequence V such that it can describe the observable and unobservable system behavior.To correctly identify the unobservable subnet, we make the following assumptions.
(A1) The unobservable behavior of a system can be characterized by an acyclic subnet, denoted by   = (,   ,   ,   ).
Given an observable subnet   that models the observable behavior of a system, Assumption (A1) means that we can always find a solution of an acyclic unobservable subnet   such that the combined net  =   ⊗   describes the whole system.On the other hand, Assumption (A1) provides a necessary and sufficient condition for the reachability of the unobservable subnet   .
To combine the known observable subnet   and the identified unobservable subnet   , the preincidence matrix of the whole net  is computed by  = [    ], and its postincidence matrix is represented by  = [    ].Correspondingly, we have  = [    ].Problem 6. Assume that an observable subset   = (,   ,   ,   ) and the initial marking  0 are given and that the observed transition sequence is  ∈  *  .Under Assumption (A1), the problem consists in finding a Petri net  = (, , , ) such that  =   ⊗   and  ∈ Ω(,  0 ).
The structure of a pure net can be represented by its incidence matrix.Thus, by Assumption (A1), we only need to compute the incidence matrix   of the unobservable  subnet   to determine its structure.On the other hand, the observable subset   is known, and thus we can obtain the net .The solution to (8) is not unique, and we can choose a performance index to select a solution among the set of admissible ones such that it is most suitable for the current situation.In particular, we can consider the performance index  → 1

Main
⋅  →   which minimizes the sum of the firing times of unobservable transitions.We define the following ILPP: where  → 1 is a row vector of dimension   with each element being 1.
Example 8. Consider the net system in Figure 2, where  = { 1 ,  2 ,  3 },   = { 1 ,  2 ,  3 },   = { 1 }, and the dashed lines represent the arcs connected with unobservable transitions.Assume that the observed sequence is V =  1 and that the corresponding firing vector of unobservable transitions is Let us consider (10) again.When the cardinality of set   is zero, i.e., |  | = 0, the incidence matrix   is a 0 × 0 matrix and we can set   ⋅  →  =  → 0 .On the other hand, there may be more than one solution satisfying the linear constraint set represented by (10), and we can define a performance index to select a solution among those solutions.In particular, if which minimizes the sum of weights of the arcs connected with the unobservable transition   , the following integer programming problem is formulated: where  is a constant that is large enough.

If the performance index
the solution of ( 11) is always  →   ≥ 0; namely, we can always obtain a source transition.In practical applications, because of the limited resources, a source transition that models behavior of a system is not common.In order to forbid the solution containing source transitions, we impose the additional constraints (a) on the unobservable transition to guarantee that at least one component of the solution  →   is a negative integer; i.e., the solution cannot be a source transition.Here, that at least a component of a vector is less than or equal to zero can be characterized by the logical OR operator which can be easily converted into some linear constraints [23], such as constraints (a) in (11).
On the other hand, the optimization problem represented by ( 11) is nonlinear because of the absolute value in the objective function.We have shown in Section 2.3 that the absolute value in a programming problem can be removed by adding additional variables and constraints.Thus (11) can be rewritten as follows: where  →  and (b) are, respectively, the additional variables and constraints associated with abs(  →   ) in (11) Note that the net system in Figure 3(c) is also a solution of Example 10.Moreover, it has a smaller sum of weights of the arcs connected with  2 .In fact, we can make use of the previously obtained unobservable transitions when we compute the new unobservable transition to obtain a simpler solution.
The following proposition provides a technique to make use of the previously identified unobservable transitions.

Online Identification Algorithm.
There may be different approaches that can provide a solution to Problem 6; however we propose an online identification algorithm that recursively determines the structure of the unobservable subnet.Upon each observed transition , we record  and decide whether a new unobservable transition should be introduced by solving ILPP 1.If it is the case, we obtain the unobservable transition by solving ILPP 3 and update the structure of the unobservable subnet.The identification procedure is shown by Algorithm 1, which monitors the system evolution and waits until a transition is observed.The inputs of Algorithm 1 are the observable subnet   and the initial marking  0 , i.e.,   ,   , and  0 , and its output is the unobservable subnet   such that we can obtain the whole net  =   ⊗   .
In line (1), the algorithm initializes the variables.Initially, the unobservable subnet   is null, i.e.,   = 0,   is a 0 × 0 matrix, and the vector  →  is also null.Note that the vector  →  is maintained and updated by Algorithm 1 when a transition is observed.In addition,   denotes the number of unobservable transitions, and it is the subscript when we name the newly identified transition    .
In line (3), if   equals zero, i.e., no unobservable transition is identified, it is not necessary to solve ILPP 1. Instead, the condition of line ( 4) is checked.
In line (10), ILPP 1 has a feasible solution; then we only update the firing vector  →  and go back to line (2).In lines ( 14) and ( 15), a new unobservable transition is identified and we will update the corresponding variables.First, we add the solution  →    to   as the last column, and the corresponding unobservable transition is called   u .Note that   increases by one when a new unobservable transition is identified such that the unobservable transitions are named  1 ,  2 ,  3 ,...We also obtain the value of variable  →   that represents the firing vector of the previously identified unobservable transitions to enable the observed transition .Hence we add  →  by  →   and add the dimension of  →  by one, which means that the new identified unobservable transition    fires once.
In line (19), it happens that ILPP 3 has no feasible solution, which probably stems from the necessity of a source transition or the inaccurate sensor reading.
Initially, the observed sequence V is an empty string,   = 0, both   and  →  are null, and   = 0.
Occurrence of  1 : the relation  0 ≥   (⋅,  1 ) holds, and thus we do not have to solve ILPP 3 to find an unobservable transition.The algorithm sets V =  1 .
Occurrence of Input: (2) wait until transition  is observed; V = V; goto 2; (6) else (7) goto 13; (8) end if (9) else (10)  In other words, the number of integer variables in ILPP 3 is linear (the coefficient is 1) with respect to that of unobservable transitions.Thus ILPP 3 is a simple integer programming problem that can be solved efficiently.For example, the unobservable subnet with three unobservable transitions in Example 13 is identified using LPSOLVE (a mixed integer linear programming solver [24]) in 0.0541 seconds on a notebook computer with 2 GHz processor and 8 GB RAM.In addition, we test the presented algorithm on an observable subnet with 43 places, 40 transitions, 140 arcs.In this setting, 15 unobservable transitions are found by solving 25 integer programming problems in 0.3698 seconds on the same computer using LPSOLVE solver.

Model Identification with Partial
Observable Places 4.1.Problem Statement.In Section 3, we assume that no place is observable.In such a setting, we may not be able to determine an unobservable transition that describes exactly the unknown behavior of a system by solving ILPP 3. The main reasons are the limited knowledge of system evolution and the possibility that there is more than one solution that satisfies the considered linear constraint set even if we choose a performance index.To determine a more authentic unobservable transition, more information on system evolution is needed.In this section, we consider that some of places are observable.
If some of places in a Petri net model are observable, the observed information during system evolution includes not only the observed transitions but also the corresponding partial markings.We denote the output of the system with observable places by  = It is clear that the sequence  cannot be generated by the net in Figure 4(a) and thus some unobservable transitions must occur.for  = 1, . . ., .Problem 16.This subsection discusses whether an unobservable transition has to be introduced or not under the assumption that some of places are observable.Moreover, we present a technique to show how the unobservable transitions can be introduced.

The Solution to
The solution to Problem 16 can be obtained by making slight changes to Algorithm 1, i.e., replacing ILPP 1 and ILPP 3 with ILPP 4 and ILPP 5, respectively.

𝑝𝑜k 1 𝑇𝑚𝑇𝑚
are chosen only.Thus, this proposition is proved.Although constraint (19b) is imposed to choose the solutions satisfying the observed partial markings, the solution of (19a), (19b), (19c), (19d), and (19e) is still not unique.As shown in ILPP 3, we choose  → ⋅ abs(  →   ) as the performance index and obtain the following programming problem: ⋅ abs (  →   ) ..Eq. (19a) , (19b) , (19c) , (19d) , and (19e) transition  is said to be a source transition if it satisfies •  = 0.A marking of a Petri net is a vector  :  → N, and () indicates the number of tokens in place .A net system ⟨,  0 ⟩ is a Petri net with an initial marking  0 .A transition   ∈  is enabled at marking  if ∀ ∈ •   , () ≥ (,   ), which is denoted by [  ⟩.An enabled transition   at  can fire yielding a new marking   such that   =  + (⋅,   ) − (⋅,   ), which is denoted as [  ⟩  .If [  ⟩  holds, by the definition of incidence matrix , we have   =  + C(⋅,   ), which can be rewritten  is the -dimensional canonical basic vector and its -th entry is one.Given a transition sequence  and a marking , [⟩ denotes that  is enabled at marking  and [⟩  denotes that a new marking   is reachable from  after firing .
Net.Given a Petri net  = (, , , ) and the set of events , a labeling function  :  →  ∪ {} assigns to each transition  ∈  either a symbol from the event set  or an empty string .A transition with label  is called an unobservable transition and the set of unobservable transitions is denoted as   = { ∈  | () = } with   = |  | being the cardinality of set   .All other transitions whose labels are not  comprise the set of observable transitions   = { ∈  | () ̸ = } and   = |  |.Thus the set  is divided into two disjoint subsets   and   with  =   ∪   .We assume that each label  ∈  can only be assigned to one transition, i.e., the set  is isomorphic to the set of observable transitions   , and thus without loss of generality we assume  =   .A place  ∈  is said to be observable if it is equipped with a sensor that allows observation of the number of its tokens.For each   ∈  *  , we define an   -dimensional vector  →   :   → N and  →  o () =  if  ∈   occurs  times in   .Analogously, for each   ∈  *  , an   -dimensional vector  →   :   → N is defined and  →   () =  if  ∈   occurs  times in   .2.3.Linear Reformulation.An optimization problem with an absolute value is nonlinear.Absolute value functions are not continuously differentiable, and it is difficult to perform standard optimization procedure on them.However, we can convert an absolute value function into several linear constraints such that the optimization can be solved using the standard linear programming technique.We here only consider this situation: there is an absolute value in the objective function.Let us consider the following optimization problem: where  →  and  →  are variables in R  and R  , respectively,  →  and  →  are constant vectors in (R ≥0 )  and R  , respectively, abs(  →  ) denotes the absolute value of vector  →  , and  denotes the linear constraints in this programming problem.Note that  →  is a column vector consisting of nonnegative real Definition 1.Given a Petri net  = (, , , ) with  =   ∪   ,  can be partitioned into two components denoted by  =   ⊗  .Here   = (,   ,   ,   ) is the observable subnet, where  is the set of places,   is the set of observable transitions, and   and   are the restrictions of  and  to   , respectively;   = (,   ,   ,   ) is the unobservable subnet, where   is the set of unobservable transitions and   and   are the restrictions of  and  to   , respectively.
the transition  2 is now observed, we find a solution  →   = [1]  by solving ILPP 1.According to Theorem 7, we have V =  1  2 ∈ Ω(,  0 ).In fact, there exists a firing sequence  =  1  1  1  2 such that  0 [⟩.If (8) has no feasible solution, we can only add a new unobservable transition to Petri net  to obtain a new Petri net   such that V ∈ Ω(  ,  0 ).Assume that   is the considered unobservable transition.Let   =   ⊗    ; i.e., Petri nets  and   have the same observable subnet   ; however the unobservable subnet    is obtained by adding the unobservable transition   to   .By Assumption (A1), the structure of   can be determined by its incidence matrix   .Assume that  →   is the column in the incidence matrix associated with   and then the incidence matrix of    is    = [   →   ]; i.e.,    retains the structure of   but includes an additional transition   .The following proposition provides a method to compute the unobservable transition.Given a net system ⟨,  0 ⟩ with  =   ⊗   , let V ∈ Ω(,  0 ) be the current observed sequence and  →  ∈ (V) be a corresponding firing vector of unobservable transitions.Assume that a new transition  is observed.If there exists a vector  →   satisfying (10), then V ∈ Ω(  ,  0 ), where   is a Petri net obtained by adding an unobservable transition   with the corresponding incidence matrix column being  →   to . is the last column of incidence matrix    , by Theorem 3,   +    (⋅,   ) =   ≥   (⋅, ) holds, where   denotes the new unobservable transition whose incidence matrix column is  →   .Thus   [  ⟩  [⟩ holds, i.e., V ∈ Ω(  ,  0 ).
Occurrence of  3 : since   > 0, we solve ILPP 1 1   2 . . .   with  ≥ 1 and the corresponding reached partial markings by     ∈   and    is the observed partial marking after transition    for  = 1, . . ., .Consider again the observable subnet shown in Figure 4(a).If the set of observable places is Problem 16.Assume that the observable subnet   = (,   ,   ,   ) and the initial marking  0 are given and  = {  1 ,   2 , . ..,   ℎ } ⊆  with ℎ ≤ is the set of observable places.The observed output includes the transition sequence  =   1   2 . . .   with  ≥ 1 and the corresponding reached partial markings     ∈   and    is the observed partial marking after transition    for  = 1, . . ., .The problem consists in determining a Petri net  with  =   ⊗   such that  ∈ Ω(,  0 ) and each marking   ∈ (,  0 ) after    fires satisfies   |  =