An approach for the identification of Time Petri Net ...

2 downloads 0 Views 377KB Size Report
produce a mathematical model expressed as a Petri Net. (PN) or a finite state ...... [10] F. Basile, P. Chiacchio, J. Coppola, and G. De Tom- masi, “Identification of ...
An approach for the identiſcation of Time Petri Net systems Francesco Basile, Pasquale Chiacchio, Jolanda Coppola∗

Abstract This paper deals with the identiſcation of time Petri net systems. The proposed algorithm identiſes a time Petri net model on the basis of the observed behavior, extending existing approach for untimed systems. A mixed-integer programming problem is formulated to take into account that the ſring of a transition requires that the enabling condition is met but, for time net systems, it is also required that the ſring interval of a transition is congruent with the observed ſring instant times.

1

Introduction

The interest for the identiſcation of DESs usually comes from reverse engineering for (partially) unknown systems, fault diagnosis, or system veriſcation. Inputs and/or outputs sequences are observed during the operation of the system within its environment. The methods presented in the literature for the identiſcation of DESs produce a mathematical model expressed as a Petri Net (PN) or a ſnite state automaton model of the system behavior from sequences observed during the system operation [1]. When the resulting model is a PN, the net structure (places, transitions and arcs) and its initial marking must be identiſed. The explicit consideration of time is crucial for the speciſcation and veriſcation of some Discrete Event Systems (DESs) such as communication protocols, circuits, real-time systems, or fault diagnosis [2]. In time PNs [3] the ſring duration of transitions can assume any value of a given interval I. This paper focuses on the identiſcation of time PNs. There are approaches to DES identiſcation where it is assumed that either the whole state space of the system, or the whole language generated by it, is known [4, 5, 6, 7]. In this case, the net system is typically built starting from the available data. In other approaches a set of observed strings, i.e., a subset of the system language, and/or a set of observed net markings, are available [8, 9, 10]. In such a framework the main goal is to periodically perform the ∗ Francesco Basile, Pasquale Chiacchio and Jolanda Coppola are with Dip. Ingegneria dell’Informazione, Ingegneria elettrica e Matematica applicata, Univ. di Salerno, Italy. This work was supported by the Italian Ministry of Education, University and ResearchResearch Project of National Interest ROCOCO (PRIN 2009).

identiſcation of the system, until the identiſed model is satisfactory for the given purpose. The problem addressed in this paper is the identiſcation of a time PN from a set of observed timed sequences. To the best of our knowledge, only a few works have been published on this topic [11, 12] where the identiſcation of the net structure and the initial marking are obtained at a ſrst stage and then the timing structure is inferred from additional observations using the net structure identiſed at the ſrst stage. In this paper the identiſcation process reduces to a single stage. This has two main advantages: a more compact net system is obtained and a unique set of observations is used. As for the set of observations, a logical system has a different behavior with respect to a timed one having the same structure, the proposed approach works on effective observations produced by these systems: two events can occur at same time in a timed system, while this is not possible in logical systems. Given a set of timed sequences, a number of places m and a set of transitions T , the considered identiſcation problem consists in determining the structure of a net N , i.e., the matrices Pre, Post and its initial marking m0 , the timing structure I : T → I such that the set of timed sequences generated by this net is congruent with the timed language of the observed system, i.e. it belongs to the language of the observed system. The presence of a timing structure implies that when a transition t ſres at a time τ , i) it has been enabled at a time τ  ≤ τ (= stays for immediate transitions) and ii) its ſring duration is congruent with the observation, i.e. τ − τ  ∈ I(t). Enabling of transitions and their ſring time instants are characterized in terms of linear mixed-integer constraints as in [4]. To accelerate the identiſcation, it is assumed to know an estimation of timing structure. For selecting among different solutions, a performance index involving the arc weights and the number of tokens in the initial markings and the ſring duration of transitions is minimized.

2

Notation and Assumptions

2.1 PN background For a complete review on Petri nets the reader can refer to [13]. A Place/Transition net (P/T net) is a 4-tuple N = (P, T, Pre, Post), where P is a set of m places (represented by circles), T is a set of n transitions (represented by boxes), Pre : P × T → N (Post : P × T →

978-1-4799-0864-6/13/$31.00 ©2013 IEEE

N) is the pre (post-) incidence matrix. Pre(p, t) = w (Post(p, t) = w) means that there is an arc with weight w from p to t (from t to p); C = Post − Pre is the incidence matrix. The symbols • p (• t) and p • (t • ) are used for the pre-set and post-set of a place p ∈ P (transition  t ∈ T ), respectively, e.g. • t = p ∈ P | Pre(p, t) = 0 . A marking is a function m : P → N that assigns to each place of a net a non-negative integer number of tokens, drawn as black dots. It is useful to represent the marking of a net with a vector m ∈ Nm . A net system S = N, m0  is a net N with an initial marking m0 . A transition t is enabled at m iff m ≥ Pre(·, t) and this is denoted as m[t. An enabled transition t may ſre yielding the marking m = m + C(·, t) and this is denoted as m[tm . A ſring sequence from m is a sequence of transitions   σ = t1 . . . tk such that m t1 m1 t2 m2 . . . tk mk , and this is denoted as m[σmk . An enabled sequence σ is  denoted as m σ, while ti ∈ σ denotes that the transition ti belongs to the sequence σ. A marking m is said to be reachable from m0 iff there exists a sequence σ such that m0 [σm . R(N, m0 ) denotes the set of reachable markings of the net system N, m0 . Given a sequence σ we will denote with |σ| its length. The function σ : T → N, where σ(t) represents the number of occurrences of t in σ, is called ſring count vector of the ſring sequence σ. As it has been done for the marking of a net, the ſring count vector is often denoted as a vector σ ∈ Nn . Note that, if a sequence is made by a single transition, i.e., σ = ti , then the corresponding ſring count vector is the i-th canonical basis vector denoted as ei . If m0 [σm, then it is possible to write in vector form   m = m0 + Post − Pre · σ = m0 + C · σ , (1) which is called the state equation of the net system. Deſnition 1 (Deterministic time P/T net system) Let I be the set of closed intervalswith a lower bound in Q+ and an upper bound in Q+ ∞. A deterministic time P/T net system is the 3-ple T = N, m0 , I, where N is a standard P/T net, m0 is the initial marking, and I : T → I is the statical ſring time interval function which assigns a ſring interval [lj , uj ] to each transition tj ∈ T [14]. It is assumed that there is a start-up transition that ſres only once at time zero producing tokens considered by the initial marking. A transition t can be ſred at time τ if the time elapsed since the marking enabled it belongs to its interval I(t). Moreover, for all enabled transitions, time cannot progress when the upper bound is reached, thus enforcing urgency. If li = ui = 0 (and consequently I(ti ) = 0) transition ti is said immediate otherwise it is said timed. Timed and immediate transitions will be represented by empty and ſlled boxes, respectively. ♦ In the following we denote as T t the set of the timed

transition with cardinality nt and as T im the set of immediate transitions with cardinality nim . 2.2 Notations and Assumptions Assumption 1 (Free labeled nets) Throughout this paper it is assumed that there is an isomorphism between the events set and the transitions set T . ♦ For a better presentation of the approach proposed in this paper it is useful to collect in the same set all those transitions that ſre at the same time τ . For this reason the timed ſring sequence σT is deſned. Deſnition 2 (Timed ſring sequence) A sequence σT = (T1 , τ1 ) . . . (Tq , τq ) . . . (TL , τL ) , where Tq is the set of transitions ſred at time τq and τ1 ≤ τ2 · · · ≤ τL denote ſring time instants is called timed ſring sequence. The position q the couple (Tq , τq ) occupies in the sequence is called time step, so (T1 , τ1 ) occurs at step 1, (T2 , τ2 ) occurs at step 2 and so on; the number of couples (Tq , τq ) in σT is called length L of the timed ſring sequence. ♦ Deſnition 3 (Timed Language) Given a deterministic time P/T net system T = N, m0 , I, its timed language, named L(T ), is deſned as the set of timed ſring sequences generated by T from the initial marking m0 . The marking the system reaches after the ſring of all the transitions in Tq is called mq . The set Tq is made up both of timed transitions and immediate ones (see Fig. 1(a)). Occurrence of immediate transitions at time τq always follows the ſring of the timed transitions. To understand this fact suppose, ad absurdum, that an immediate transition observed at time τq was enabled by marking mq−1 . Since the transition is immediate, it should be ſred at time τq−1 . For this reason, the couple (Tq ,τq ) can be written as (Tqt ,τq )(Tqim ,τq ), where the ſring of Tqt always precedes the one of Tqim (note that since I(tj ) = 0 ∀tj ∈ Tqim , they ſre at the same time τq ), (see Fig. 1(b)). The marking reached after the ſring of the set Tqt is called mq0 ; when Tqim = ∅, mq0 is a vanishing marking1 , otherwise it is a tangible marking. Firing of tj ∈ T im at time τq can be enabled soon after the ſring of transitions in Tqt or after the ſring of other immediate transitions. As for example, consider the net of Fig. 2: t5 and t7 can ſre soon after the ſring of the timed transitions, while t6 requires that t7 ſres before to be enabled. Hence, a couple (Tqim , τq ) can be im im im , τq )(Tq2 , τq ) . . . (Tqn , τq ), where nq is written as (Tq1 q the number of successive ſrings of immediate transitions at time τq (see Fig. 1(b)), and (Tq , τq ) can be written as 1 A vanishing marking is a marking in which at least an immediate transition is enabled, otherwise a marking is called tangible marking [15].

T

T ௤

୧୫

t7 t6 t5

୯

୯୧୫

௤

୯୲

t4 t

୧୫

t7 t6 t5

T ୧୫ ୯ଵ

t4 t3

௤ ୲ t32

୯୲

௤ ୲ t2

t1

t1

ʏk



ʏq-3

ʏq-2

ʏq-1

mk



mq-3

mq-2

mq-1

ʏq ʏ

mq m

mq0

(a)

୧୫ ୯ଶ

୯୧୫ ୯

mq1 mq2 ൙ mq m

(b)

ɷ(tj)

ɷmax(tj)

tj ੣௤



ɷmin(tj)

ʏk mk

… …

ʏq-3 mq-3

ʏq-2 mq-2

ʏq-1 mq-1

ʏq ʏ mq m

(c)

Figure 1. (a) Firing of timed (Tqt ) and immediate (Tqim ) transitions at time τq ; (b) successive ſrings of immediate transitions at time τq ; (c) set of markings that can enable the ſring of timed transition tj at τq .

im im (Tqt , τq )(Tq1 , τq )...(Tqn , τq ). After the ſring of each set q im of immediate transitions Tqs , with s = 1, . . . , (nq − 1), the vanishing marking mqs is reached. Then, the marking mq , reached when all transition at time τq have been ſred, can be seen as the last of nq + 1 markings such that mq0 [σq0  . . . [σq(nq −1) mqnq = mq , so it is always a tangible marking. Given a timed ſring sequence σT , let P rev(tj , q) : {T × N → R+ 0 } be the function that returns (if there exists) the ſring time of the last ſring of tj , occurred before of step q, otherwise it returns τq . As example if σT = (t1 , 1)(t2 , 3)(t1 , 4), P rev(t1 , 3) = 1 while P rev(t2 , 3) = 3.

Assumption 2 It is assumed to know if a transition is immediate, i.e. having a null ſring duration. Considering the timed ſring sequence σT , it is always possible to know the order of successive ſrings of immediate transitions at a time instant. Moreover, it is assumed that the set I, the ſring time interval of timed transitions, has values that belong to ]0, ∞[. ♦ This is reasonable since immediate transitions model control decisions, not physical activities. Then, in practice immediate events belonging to successive steps at a same time τq , as for example steps qs and q(s + 1) with s > 0, are generated by control devices in a negligible time duration with respect to event associated to physical activities. Moreover, it is reasonable that timed transitions cannot behave as immediate ones since li > 0, ∀i, so the minimum ſring time they can have makes always possible to include in Tq+1 the ſring of any timed transitions enabled by the ſring of transition in Tq . Assumption 3 Given a deterministic time net system 1. single-server ſring semantic is assumed, i.e., no concurrent ſrings of the same transition are possible; 2. enabling memory policy of timed transitions is assumed, i.e., when a new marking is reached and a timed transition is not enabled, the elapsed time is reset. ♦ The identiſcation approach presented in the follow is not limited to single-server semantic (more details in [14]): it

has been assumed only for the sake of simplicity. Having assumed enabling memory policy (more details in [14]) for timed transitions, the next assumption is necessary so as to have effective choices, otherwise the fastest transition will always ſre ſrst. Assumption 4 All the transitions that make up a choice – i.e., all the transitions t ∈ p• with card(p• ) > 1 – must be immediate2 . Hence if card(p• ) > 1 ⇒ I(t) = ♦ 0 ∀ t ∈ p• , for all the places in P . Assumption 4 is motivated by the consideration that, when a timed activity is associated with transitions, a conƀict resolution policy may be a race between conƀicting transitions, that has no sense in presence of a physical plant. The following lemma [10] introduces a set of linear algebraic constraints that must be fulſlled in order to guarantee that Assumption 4 holds for a given time net. Lemma 1 Given a deterministic time net T , Assumption 4 is satisſed if and only if the following set of linear algebraic constraints is fulſlled ⎧ T ei · Pre · ej − zji V ≤ 0 ∀ tj ∈ T ⎪ ⎪ ⎪ ⎪ nt ⎪  ⎪ ⎪ i ⎪ zα ≤1 ⎪ ⎪ ⎪ ⎪ α=1 ⎪ ⎨ nt n  B(pi ) :    i ⎪ · n − n zα + zβi ≤ n − nt ⎪ t ⎪ ⎪ ⎪ α=1 β=nt +1 ⎪ ⎪ ⎪ ⎪ ⎪ m×n ⎪ Pre ∈ N ⎪ ⎪ ⎩ i zj ∈ N

(2a) (2b) (2c) (2d) (2e)

for all places pi ∈ P . The constant V is such that V > maxi ,j eTi · Pre · ej . Assumption 5 For each timed transition tj ∈ T t it is available a maximum ſring time upper bound umax (tj ), i.e. a time such that uj ≤ umax (tj ), and a minimum ſring time lower bound lmin (tj ), i.e. a time such that lj ≥ lmin (tj ). Given a marking mks , with s = 0, . . . , nk , reached at time τk , if a timed transition tj does not ſre in a time 2 Given

a set S, card(S) denotes the cardinality of S.

… …

t2, I(t2) t1, I(t1)

3

t4, I(t4)



t5 …

t3, I(t3) t7

t6…

Figure 2. Firing dependence between immediate transitions.

equal to umax (tj ) then mks does not enable the ſring of tj (see Fig. 1(c)). When umax (tj ) is not explicitly deſned, then it is assumed umax (tj ) = ∞ and consequently ſring of tj at step q can be enabled by any marking mks reached at time τk < τq . Given a marking mks , with s = 0, . . . , nk , reached at time τk , a timed transition tj , enabled by mks ſres in a time greater than or equal to lmin (tj ) (see Fig. 1(c)). When lmin (tj ) is not explicitly deſned, then it is assumed lmin (tj ) = 0. Assumption 5 consists in the knowledge of minimum and maximum bounds for the timing structure. This helps to devise timed counterexamples, that are words that do not belong to the timed language of a time PN. Deſnition 4 (Timed Counterexample) For each σT ∈ L(T ) of length L, it is called timed counterexample each timed ſring sequence σT (tj , τq ) of length ≤ L such that σT is a preſx of σT , and i) σT = (T1 , τ1 ) . . . (Tq−1 , τq−1 ) and tj is a timed transition whose ſring does not occur at τq , and ∀mk : k < q, (τk + lj ) ≤ τq ≤ (τk + uj ), q  = q : k < q  , (τk +lj ) ≤ τq ≤ (τk +uj ), s.t. tj ∈ Tqt Such a condition assures that the ſring of tj does not occur neither in τq , nor in any other time τq reachable starting from τk and varying the ſring time of tj in I(tj ). im ii) σT = (T1 , τ1 ) . . . (Tqs , τq ) and tj ∈ T im \ Tqs , i.e. tj is an immediate transition whose ſring does not occur at step qs. ♦

The computation of all counterexamples requires the knowledge of timed net language, that is assumed to be not available in this paper. Indeed, the proposed approach is based on a set of observed timed sequences, that are a subset of the timed net language. However, by replacing lj and uj by lmin (tj ) and umax (tj ) respectively in Deſnition 4, a reduced set of counterexamples is obtained, since the computation of the whole set of counterexamples require the knowledge of lj and uj , that are unknown in the problem considered in this paper. Note that the approach used in the paper works also without Assumption 5, since the knowledge of minimum and maximum bounds for the timing structure just accelerates the identiſcation procedure.

Transformation of logical propositions into linear inequalities

In the following two rules from [4] are ſrst recalled, then new transformations are presented. R  r1 Inequality constraints. nConsider the constraint i=1 ai ≤ 0n where ai ∈ R , i = 1, . . . , r, and denotes the logical or operator. Such constraint can be rewritten as linear algebraic constraints: ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩

a1 ≤ z1 · K . .. ar ≤ zr · K z1 + · · · + zr = r

−1 z1 , . . . , zr = 0, 1

(3)

where K is any constant vector in Rn that satisſes the following relation: Kj > maxi∈{1,...,r} ai (j), j = 1, . . . , n ♦ R Consider the constraint r2 Equality constraints. n a = b where a , b ∈ R , i = 1, . . . , r. Such coni i i i i=1 straint can be rewritten as linear algebraic constraints: ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩

a1 − b 1 ≤ z1 · K a1 − b1 ≥ −z1 · K . . . ar − b r ≤ zr · K ar − br ≥ −zr · K z1 + · · · + zr = r

−1 z1 , . . . , zr = 0, 1

(4)

where K is any constant vector in Rn that satisſes the following relation: Kj > maxi∈{1,...,r} |ai (j) − bi (j)|, j = 1, . . . , n ♦ Inspired by the results in [16] and [4], some other rules to convert logical statements into linear inequalities are here presented, whose proofs, for the sake of brevity, are omitted. R 3 The logical statements a ≥ b ↔ z = 0; a < b ↔ z = 0 where a, b ∈ Rn and ↔ stands for “if and only if”, can be rewritten in terms of algebraic constraints as: ⎧ a+z·K ≥b ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ a − z · K ≤ b − 1n z+z =1 ⎪

⎪ ⎪ ⎪ z, z ∈ 0, 1 ⎪ ⎩ a, b ∈ Rn

with K ∈ Rn : Kj > |a(j) − b(j)| R 4 The logical statement a = b (a = b) ↔ z = 0 (z = 0)

(5a) (5b) (5c) (5d) (5e)



where a, b ∈ Rn and can be rewritten in terms of algebraic constraints as: ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨

a+z·K ≥b

(6a)

a−z·K ≤b

(6b)

a − z · K + zg · K ≥ b + 1n

(6c)

a − z · K − zl · K ≤ b − 1n

(6d)

⎪ z+z =1 ⎪ ⎪ ⎪ ⎪ ⎪ zg + zl = 1 ⎪ ⎪ ⎪

⎪ ⎪ z, z, zg , zl ∈ 0, 1 ⎪ ⎪ ⎩ a, b ∈ Rn

with K ∈ Rn : Kj > |a(j) − b(j)|

(6e) (6f) (6g) (6h)



R 5 The logical statement

4.1

Enabling and disabling conditions for timed transitions

At the aim to write in a more compact way the enabling and the function τen (tj , k, q) :   disabling conditions, is introduced, deſned as follows: T × N → R+ 0 τen (tj , k, q) = τk if τk ≥ P rev(tj , q), otherwise τen (tj , k, q) = P rev(tj , q). The marking mks that enables the ſring of timed transition tj at time τq belongs to the set of nM arkjq markings for which k < q, lmin (tj ) ≤ τq − τk ≤ umax (tj ). As more mks must satisſes the following condition:

IF a = b THEN c ≥ d ELSE e ≤ f

where a, c, e, b, d, f ∈ Rn , can be rewritten in terms of algebraic constraints as: ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨

a+z·K ≥b

(7a)

a−z·K ≤b

(7b)

a + z · K + zg · K ≥ b + 1n

(7c)

a − z · K − zl · K ≤ b − 1n

(7d)

c+z·K ≥d ⎪ ⎪ ⎪ e−z·K ≤f ⎪ ⎪ ⎪ ⎪ ⎪ z+z =1 ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ zl + zg = 1 ⎪ ⎪

⎩ z, zl , zg ∈ 0, 1

(7e)



(lj ≤ τq − τen (tj , k, q) ≤ uj ) 

a

(8)

b

From now on we refer to (8.a) as state enabling condition and to condition (8.b) as time constraint condition.

(7f) (7g) (7h) (7i)

with K ∈ Rn : Kj > max(|a(j) − b(j)|, |c(j) − d(j)|, |e(j) − f (j)|) ♦

4

mks ≥ Pre(•, tj ) 

Identiſcation of time deterministic P/T net systems

The identiſcation problem can be formally deſned: Given a set of observed timed sequences that belongs to the timed language L(T  ) of the system T  to be identiſed and a set of places P of cardinality m, we want to identify the structure of a net T = N, m0 , I and an initial marking m0 such that the timed language L(T ) of the identiſed system is congruent with L(T  ) , i.e. the set of observed timed sequences belongs to L(T ). The unknowns are the matrices Pre, Post, the vector m0 and the lower and upper bounds of each timed transition tj ∈ T t . The proposed approach is based on the formulation of a MIPP (Mixed Integer Programming Problem) where the constraints are obtained by the set of linear inequalities, named G(σT ), representing the enabling and disabling conditions for ſrings of transitions (both timed and immediate) at the step q and included in each timed ſring sequence σT . These linear inequalities are presented in Subsections 4.1 and 4.2. The system of equations G(σT ) provides a linear algebraic characterization of the deterministic time P/T nets with m places and n transitions, such that L(T ) is congruent with L(T  ) with respect to σT . Notice that while n is known, m is not. A common approach ([11]) is to assign to it a starting value (e.g. m = n) and try to solve the system: if it gives no solutions, m is incremented. In words, the place set P is given.

Proposition 1 (Enabling marking system) Consider the timed transition tj ſred at step q, a marking mks such that m0 [σks mks , with k < q, τk + umax (tj ) ≥ τq and τk + lmin (tj ) ≤ τq , s = 0, . . . , nk and the systems Mm (k, s, tj , q) : ⎧ m + Post · σ + 0 ks ⎪ ⎪ ⎪ ⎪ − Pre · (σ + ej ) + zksjq · K 1 ≥ 0m ⎪ ks ⎪ ⎪ ⎪ ⎨ m0 + Post · σ ks + ⎪ − Pre · (σ ks − ej ) − z ksjq · K 1  −1m ⎪ ⎪ ⎪ ⎪ ⎪ z ksjq + z ksjq = 1 ⎪ ⎪

⎩ zksjq , z ksjq , ∈ 0, 1

(9a) (9b) (9c) (9d)

Me (k, s, tj , q) : ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩

Mm (k, s, tj , q)

(10a)

uj + rksjq · K2 + dksjq · K2 ≥ τq − τen (tj , k, q)

(10b)

lj − rksjq · K2 − dksjq · K2 ≤ τq − τen (tj , k, q)

(10c)

lj + rksjq · K2 + dksjq · K2 + + zgksjq · K2 > τq − τen (tj , k, q) (10d) uj − rksjq · K2 − dksjq · K2 + − zlksjq · K2 < τq − τen (tj , k, q) z ksjq + rksjq ≥ 1

(10e) (10f)

dksjq + rksjq ≥ 1

(10g)

zksjq + rksjq + dksjq + aksjq · K3 ≥ 0

(10h)

zksjq − rksjq − dksjq − aksjq · K3 ≤ 0

(10i)

zksjq + rksjq + dksjq + aksjq · K3 ≥ 2

(10j)

dksjq + dksjq = 1

(10k)

zgksjq + zlksjq = 1

(10l)

aksjq + aksjq = 1

(10m)

zksjq , z ksjq , rksjq , zgksjq , zlksjq ,

dksjq , dksjq , aksjq , bksjq ∈ 0, 1

(10n)

Mrules (k, s, tj , q) : ⎧  rksjq = (nM arkjq − 1) ⎪ ⎪ ⎪ ⎪ ⎪ ∀k ⎪ ⎪ ⎪ ⎪ zksjq + rksjq + sksjq · K3 ≥ 0 ⎪ ⎪ ⎪ ⎪ ⎪ zksjq + rksjq − sksjq · K3 ≤ 0 ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ zksjq + rksjq + sksjq · K3 > 0 ⎪ ⎪ ⎪ ⎪ ⎪ qksjq + sksjq · K3 ≥ 0 ⎪ ⎪ ⎪ ⎪ ⎪ qksjq − sksjq · K3 ≤ 0 ⎪ ⎪ ⎪ ⎪ ⎪ qksjq + sksjq · K3 ≥ 1 ⎪ ⎪ ⎪ ⎪ ⎨ qksjq − sksjq · K3 ≤ 1

(11a) (11b) (11c) (11d) (11e) (11f)

Me (k, s, tj , q) Mrules (k, s, tj , q) ♦

Proof: From R3 it follows that Eq. (9a) and (9b) implement that mks ≥ Pre(•, tj ) ↔ zksjq = 0, since using the state equation (1) mks can be written as m0 + Post · σ ks − Pre · (σ ks + ej ).



Md (k, s, tj , q) :

(11h)

where K 1 ∈ Rn is a vector of positive constants such that K 1 (i) > maxk,s,i [mks (pi )], K2 ∈ R+ is a positive constant such that K2 > maxk τk , K3 ∈ N is a positive constant such that K3 > 2, K4 ∈ N is a positive constant such that K4 > nenjq , K5 ∈ N is a positive constant such that K5 > nM arkjq , nenjq is the number of steps preceding step ks, that satisfy conditions k  < q, τk + umax (tj ) ≥ τq and τk + lmin (tj ) ≤ τq , s = 0, . . . , nk . The marking mks enables the ſring of transition tj ∈ Tqt at time τq iff system

is satisſed with zksjq = dksjq = rksjq = 0

Lemma 2 (Disabling marking system) Consider the timed transition tj ∈ Tqt ſred at step q. Given a marking mks whose indexes satisfy conditions k < q , τk + umax (tj ) < τq and τk > P rev(tj , q) and s = 0, . . . , nk the following system has to be satisſed:

(11g)

−zksjq − r ksjq + pksjq = 0 (11i) ⎪ ⎪ ⎪  ⎪ ⎪ ⎪ ⎪ qk s jq − c1ksqj · K4 ≤ (nenjq − 1) (11j) ⎪ ⎪ ⎪ ⎪ ∀k ,s ⎪ ⎪ ⎪  ⎪ ⎪ ⎪ qksjq + ⎪ ⎪ ⎪ ⎪ ∀q  P rev(tj , q) cannot enable the ſring of tj at time τq because of the hypothesis that a timed transition surely ſres if a time equal to uj is passed from its enabling. This means that mks < Pre(•, tj ) and consequently, as seen in Proposition 1, zksjq = 1. Indeed suppose ad absurdum zksjq = 0; it means that mks ≥ Pre(•, tj ): marking mks enables the ſring of tj consequently tj ſres at time τq ≤ τk + umax (tj ), but in this way the initial hypothesis is violated.  Proposition 2 (Counterexamples) Consider a timed counterexample σT (tj , τq ) as deſned in Deſnition 4, a marking mks whose indexes satisfy conditions k < q, lmin (tj ) ≤ τq − τk ≤ umax (tj ) and s = 0, . . . , nq . The following system  Mc (k, s, tj , q) :

Me (k, s, tj , q, )

(15a)

zksjq + dksjq ≥ 1

(15b)

has to be satisſed.



Proof: Since tj is the last transition of the counterexample σT (tj , τq ) occurred at time τq , it does not exist a marking mks , whose indexes satisfy conditions lmin (tj ) ≤ τq − τk ≤ umax (tj ) and s = 0, . . . , nq for which condition (8) holds neither in τq nor in any other time τq s.t. lmin (tj ) ≤ τq − τk ≤ umax (tj ). Consequently rksjq = 1 ∀mks having k < q s.t. lmin (tj ) ≤ τq − τk ≤ umax (tj ) and s = 0, . . . , nq . Eq. (15b) imposes that at least one between zksjq and dksjq is equal to 1 and from Proposition 1 it follows that  rksjq = 1. 4.2

Enabling and disabling conditions for immediate transitions Lemma 3 The marking mq(s−1) enables the ſring of the immediate transition tj at step qs iff the system Mm (k, s, tj , q) is satisſed for zksjq = 0, with k = q and s = s − 1. ♦ Proof: Proof follows from Proposition 1



Proposition 3 (Immediate counterexamples) Consider im the immediate transition tj ∈ T im \ Tqs not ſred at step  qs and such that σT (tj , τq ) is a timed counterexample, as deſned in Deſnition 4. The following set of equations is satisſed with z qs−1jq = 0 or with zhqi = 1

Mid (s, tj , q) :

⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨

Mm (q, s − 1, tj , q)

(16a)

∀pi ∈ P, ∀th ∈ T im , Pre(pi , th ) + zqshq · K 1 (i) + ghqi · K 1 (i) ≥ 1

(16b)

im , ∀pi ∈ P, ∀th ∈ Tqs

−zqsjq · K 1 (i) + gjqi +

⎪ ⎪ − zhqi · K 1 (i) + ghqi ≤ 0 ⎪ ⎪ ⎪ ⎪ m ⎪  ⎪ ⎪ ⎪ gjqi ≤ (m − 1) ⎪ ⎪ ⎪ ⎪ i=1 ⎪ ⎪ ⎪ ⎪ m ⎪   ⎪ ⎪ ⎪ zhqi ≤ (nim ⎪ qs · m) − 1 ⎪ ⎩

(16c) (16d) (16e)

∀h∈T im \tj i=1



im where nim qs = card(Tqs ) has to be satisſed.

Proof: There are only two conditions because an immediate transition tj does not ſre at the step qs. 1. mq(s−1) < Pre(•, tj )

⎧ (17a) Me (k, s, tj , q), ∀tj ∈ Tqt , ⎪ ⎪ ⎪ ⎪ ⎪ ∀k : lmin (tj ) ≤ τq − τk ≤ umax (tj ), ∀s = 0, . . . , nk ⎪ ⎪ ⎪ ⎪ ⎪ Mrules (k, s, tj , q), ∀tj ∈ Tqt , (17b) ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ∀k : lmin (tj ) ≤ τq − τk ≤ umax (tj ), ∀s = 0, . . . , nk ⎪ ⎪ ⎪ ⎪ ⎨ Md (k, s, tj , q), ∀tj ∈ Tqt , (17c) ∀k : τk + umax (tj ) < τq , ∀s = 0, . . . , nk ⎪ ⎪ ⎪ ⎪ im ⎪ ⎪ Mm (q, s − 1, tj , q), ∀tj ∈ Tqs (17d) ⎪ ⎪ ⎪ ⎪ t t ⎪ ⎪ M (k, s, t , q), ∀t ∈ T \ T , (17e) c j j ⎪ q ⎪ ⎪ ⎪ ⎪ (t ) ≤ τ − τ ≤ u (t ), ∀s = 0, . . . , n ∀k : l q max min j j k k ⎪ ⎪ ⎪ ⎩ im Mid (s, tj , q), ∀tj ∈ T im \ Tqs (17f)

In general the solution of the G(σT ) is not unique, thus there exists more than one time P/T system T such that L(T ) is congruent with L(T  ). To select one among these systems a performance index is given and, solving an appropriate MIPP, a time P/T system that minimizes the considered performance index is determined. In particular, if f (m0 , Pre, Post, l, u) is the considered performance n index, where l, u ∈ Q+ are, respectively the vectors of the lower and upper bounds ſring times, an identiſcation problem can be formally stated as follows   f m0 , Pre, Post, l, u min s.t.G(σT )∀σT ∈ LT , B(p)∀p ∈ P

Pre(•, tj ) 2. mq(s−1) ≥ im : • th • tj = ∅ Tqs

and

∃th



As seen previously, condition 1 is satisſed iff z ksjq = 0, with k = q and s = s − 1. Condition 2 means that transition tj is in conƀict with the immediate transition th , and th ſres at step qs. Since im , for Lemma 3, zkshq = 0. th ∈ Tqs Equations (16b) and (16d) impose that, ∀th ∈ T im , it exits at least a place pi ∈ P such that pi ∈ • th : suppose Pre(pi , th ) = 0 for all pi , consequently to satisfy (16b), ghqi = 1, ∀pi , but in this way Eq. (16d) is violated. Equations (16c) and (16e) impose that there exists at im least one transition th ∈ Tqs \ tj and one place pi ∈ • • • th such that pi ∈ tj th : if pi ∈ • th and pi ∈ / • tj • • (pi ∈ / th and pi ∈ tj ), so from Eq. (16b), ghqi = 0 and gjqi = 1 (ghqi = 1 and gjqi = 0). In this case Eq. im (16c) is satisſed • only if zhqi = 1. If ∀th ∈ Tqs \ tj , • th then zhqi = 1, ∀i = 1 . . . m but in this pi ∈ tj way Eq. (16e) is violated.  4.3

MIPP formulation of identiſcation problem

Let O be the set of observed timed sequences and P the place set of the system to identify. A solution to the identiſcation problem can be computed solving the system G(σ T ), where G(σT ) is obtained by writing for σT ∈O each (Tq , τq ) ∈ σT the following set of equations named I(Tq , τq ), devised in Subsections 4.1 and 4.2, which each observed sequence σT must satisfy:

(18) Different choices can be made for the cost function, in particular if the cost function is chosen as   f m0 , Pre, Post,  l, u =  T T T 1m · m0 + 1m · Pre + Post · 1n − 1T n · l + 1n · u ,

(19)

the solution minimizes the sum of the tokens in the initial marking, the sum of the arc weights [4] and the width of the ſring interval I(tj ) for each timed transition. 4.4 Example The example considered does not include immediate transitions, since it is an adapted version of the system used in [11]. It is made up of two cars C1 and C2 (Fig. 3(a)), that starting from an arbitrary position in the home space (delimited by points h1A and h1B for C1 and h2A and h2B for C2, in the ſgure) move independently to reach points a and b respectively. When C1 (C2) arrive at a (b), the car starts to move along right direction until c (d) is reached (the time units (t.u.) a car takes to arrive in the designed points are indicated in the ſgure). Then, C1 (C2) stops and remains in this state until both cars are in their right positions. It takes from 1.7 to 2 t.u. to return cars in home position and to start a new cycle. In [11], the net of Fig. 3(b) is obtained to describe the behavior of the system using a two stage approach. c has been used as optimization tool. Cplex The solution of the identiſcation problem (18), with respect to the single observed timed sequence σT = ({t1 , t2 }, 1) ({t3 }, 3) ({t4 }, 4) ({t5 }, 6) ({t2 }, 7) ({t1 }, 7.2) ({t3 }, 9.2) ({t4 }, 10) ({t5 }, 11.7) ({t1 , t2 }, 13) ({t3 }, 15) ({t4 }, 16) ({t5 }, 17.9) ({t1 }, 19) ({t2 }, 19.1) ({t3 }, 21) ({t4 }, 22.1) ({t5 }, 24.1), when

C1

a

C2

b 1

1.3

h1B h1A h2B h2A 2

(a)

t1,[1,1.3] t3,[2,2]

c d 2

t1,[1,1.3] t3,[2,2] t5,[1.7,2] t2,[1,1.3] t4,[3,3]

t2,[1,1.3] t4,[3,3]

1.7 3

t5,[1.7,2] (b)

(c)

Figure 3. (a) System of the example: two cars going towards right and returning; (b) time PN modeling the system; (c) identiſed net.

the objective function is the one in (19), leads to the PN model represented in Fig. 3(c). Notice that L(T ) is congruent with L(T  ) but the net have a minor number of places and arcs than the one in Fig. 3(b). As more, even if a ſnite timed ſring sequence has been used, a cyclical net has been obtained. This occurs because of the particular cost function used in the MIPP that tries to minimize the number of arcs and it opens the door to the identiſcation of inſnite timed language from a ſnite set of observations, if the system exhibits a cyclic behavior.

References [1] A. P. Estrada-Vargas, E. Lopez-Mellado, and J.-J. Lesage, “A Comparative Analysis of Recent Identiſcation Approaches for Discrete-Event Systems,” Mathematical Problems in Engineering, 2010. [2] F. Basile, P. Chiacchio, and G. D. Tommasi, “Improving on-line fault diagnosis for discrete event systems using time,” 3rd IEEE International Conference on Automation Science and Engineering (CASE 2007), Scottsdale, AZ, USA, pp. 26–32, 2007. [3] P. M. Merlin, “A study of the recoverability of computing systems.” Ph.D. dissertation, University of California, Irvine, 1974. [4] M. P. Cabasino, A. Giua, and C. Seatzu, “Identiſcation of Petri nets from knowledge of their language,” Discrete Event Dynamic Systems, vol. 17, pp. 447– 474, December 2007. [5] K. Hiraishi, “Construction of a class of safe Petri nets by presenting ſring sequences,” in Lecture Notes in Computer Science, vol. 616. Springer– Verlag, 1992, pp. 244–262. [6] J. Cortadella, M. Kishinevsky, L. Lavagno, and A. Yakovlev, “Deriving Petri nets from ſnite transition systems,” IEEE Trans. on Computers, vol. 47, no. 8, pp. 859–852, August 1998. [7] P. Darondeau, “Region Based Synthesis of P/T-Nets and Its Potential Applications,” in Lecture Notes in Computer Science, vol. 1825. Springer–Verlag, 2000, pp. 16–23.

[8] M. E. Meda-Campana and E. Lopez-Mellado, “Required event sequences for identiſcation of discrete event systems,” in 41st Conf. on Decision and Control, Maui, Hawaii, December 2003, pp. 3778–3783. [9] M. Dotoli, M. P. Fanti, and A. M. Mangini, “Real time identiſcation of discrete event systems using Petri nets,” Automatica, vol. 44, no. 5, pp. 1209 – 1219, 2008. [10] F. Basile, P. Chiacchio, J. Coppola, and G. De Tommasi, “Identiſcation of Petri nets using timing information,” 3rd International Workshop on Dependable Control of Discrete Systems (DCDS 11), Saarbrucken, Germany, pp. 154 –161, 2011. [11] S. Ould El Mehdi, R. Bekrar, N. Messai, E. Leclercq, D. Lefebvre, and B. Riera, “Design and identiſcation of stochastic and deterministic stochastic Petri nets,” IEEE Trans. on Systems, Man and Cybernetics, Part A: Systems and Humans, vol. 42, no. 4, pp. 931–946, 2012. [12] M. Meda-Campana and S. Medina-Vazquez, “Synthesis of timed Petri net models for on-line identiſcation of discrete event systems,” 9th IEEE International Conference on Control and Automation (ICCA’11), Santiago, Chile, pp. 1201–1206, 2011. [13] T. Murata, “Petri nets: Properties, analysis and applications,” Proceedings of IEEE, vol. 77, no. 4, pp. 541–580, April 1989. [14] C. Seatzu, M. Silva, and J. H. van Schuppen, Eds., Control of Discrete-Event Systems, ser. Lecture Notes in Control and Information Sciences. Springer, 2013, vol. 433. [15] M. A. Marsan, A. Bobbio, and S. Donatelli, “Petri Nets in Performance Analysis: An Introduction,” in Lecture Notes in Computer Science, vol. 1491. Springer–Verlag, 1998, pp. 211–256. [16] A. Bemporad and M. Morari, “Control of systems integrating logic, dynamics, and constraints,” Automatica, vol. 35, pp. 407–427, 1999.

Suggest Documents