BACKGROUND ON PLACE/TRANSITION NETS

Một phần của tài liệu Formal methods in manufacturing (Trang 24 - 28)

In this section, we provide some background on P/T nets. For more details on this topic, we address the reader to [10,29,31].

1.2.1 PETRINETSTRUCTURE

A place/transition net, or simply a P/T net, is a bipartite weighted directed graph. Vertices may be of two different types: places, represented by circles, and transitions, represented by bars.

Definition 1.1 The structure of a P/T net is fully described by the quadruple N=(P, T, Pre, Post) where the following applies:

P= {p1, p2,. . .pm}is the set of m places.

T = {t1, t2,. . .tn}is the set of n transitions.

Pre:P×T −→Nis the pre-incidence function that specifies the number of arcs directed from places to transitions (‘pre’ arcs) and is represented as an m×n matrix.

Post:P×T−→Nis the post-incidence function that specifies the number of arcs directed from transitions to places (‘post’ arcs) and is represented as an m×n matrix.

3

t1 p3

p2

p1 t2 p4 t3

t4

3

3 3

FIGURE 1.1 A P/T net.

Example 1.1

Consider the P/T net in Figure 1.1. In such a case, it holds P= {p1, p2, p3, p4}, T= {t1, t2, t3, t4}, Pre= [1 0 0 0; 0 3 0 3; 0 1 0 0; 0 0 1 0]and Post= [0 0 1 0; 3 0 0 3; 1 0 0 0; 0 1 0 0].

The element Post[p2, t1] = 3 denotes that there are three arcs from transition t1 to place p2. This is represented in the figure by means of a single barred arc with weight (or multi-

plicity) 3.

The column of Pre relative to t is denoted as Pre[ã, t], while Pre[p,ã]denotes the row of Pre relative to p. The same notation is used for matrix Post.

The incidence matrix of a P/T net is an m×n matrix of integers defined as

C=PostPre. (1.1)

Obviously the incidence matrix does not contain, in general, sufficient information to reconstruct the net structure. For instance, in the net in Figure 1.1, there exist both a pre and a post arc with multiplicity 3 between place p2 and transition t4; we say that p2 and t4 form a self-loop, that is, a directed cycle in the graph of the net only involving one place and one transition. In such a case, it holds C[p2, t4] =0, hiding the existence of arcs between these two vertices in the incidence matrix.

A net without self-loops is called pure. A pure net can be represented by its incidence matrix C.

A net having all arcs with unitary multiplicity is called ordinary. A state machine is an ordinary net whose transitions have exactly one input and one output arc, while a marked graph is an ordinary net whose places have exactly one input and one output transition.

Finally, given a transition tT, we denote its set of input and output places, respectively, as

t = {pP| Pre[p, t]>0}and t• = {pP| Post[p, t]>0}. Analogously, given a place pP, we denote its set of input and output transitions, respectively, as•p= {tT | Post[p, t]>0}and p•= {tT| Pre[p, t]>0}.

1.2.2 MARKING ANDSTATEEQUATION The state of a P/T net is called marking.

Definition 1.2 A marking is a function m : P→Nthat assigns to each place a nonnegative integer

number of tokens.

Graphically, tokens are represented as black bullets inside places. See, for example, the token in place p1in Figure 1.1. A marking is usually denoted as a column vector with as many entries as the number m of places. As an example, in the net in Figure 1.1, the current marking is m= [1 0 0 0]T.

Definition 1.3 A PN N with an initial marking m0is called marked PN or PN system and is denoted

N, m0.

A marked net is a DES with a dynamical behaviour that is governed by the firing of transitions. A transition should satisfy a given condition to fire, and its firing leads to a marking update according to the following rules.

Definition 1.4 A transition t is enabled at a marking m if

mPre[ã, t], (1.2)

that is, if each place pP contains a number of tokens greater than or equal to Pre[p, t]. To denote that t is enabled at m, we write m[t. To denote that tis not enabled at m, we writeơm[t. In the marked net in Figure 1.1, the only enabled transition is t1. To be enabled, transition t2

requires at least three tokens in p2 and one token in p3. On the contrary, only one token is required in p4to enable t3. Finally, three tokens in p2are required to enable t4.

A transition with no input arcs is called a source transition. A source transition t is always enabled, since, being in such a case Pre[ã, t] =0, the condition in Equation 1.2 is satisfied for all markings m.

Definition 1.5 A transition t enabled at a marking m can fire. The firing of t removes Pre[p, t]tokens from each place pP and adds Post[p, t]tokens in each place pP, yielding a new marking

m=mPre[ã, t] +Post[ã, t] =m+C[ã, t]. (1.3) To denote that the firing of t from m leads to m, we write m[tm. Consider the net in Figure 1.1 at marking m= [1 0 0 0]T. If t1 fires, m = [0 3 1 0]T is reached.

At marking m, two transitions may fire, namely, t2and t4. The firing of t2 leads to a new marking m = [0 0 0 1]T. On the contrary, the firing of t4 keeps the marking unchanged, that is, it holds m[t4m. Note that t4 may fire an arbitrary number of times at m, obviously always keeping the marking unaltered. At marking m, the only enabled transition is t3, and its firing leads to the initial marking m.

Definition 1.6 A firing sequence at a marking m0 is a string of transitionsσ= tj1tj2ã ã ãtjrT∗, where T∗denotes the Kleene closure∗of T, such that

m0[tj1m1[tj2m2ã ã ã [tjrmr,

that is, for all k∈ {1,. . ., r}transition tjkis enabled at mk−1and its firing leads to mk=mk−1+C[ã, tjk].

To denote that the sequenceσis enabled at m, we write m[σ. To denote that the firing ofσat m leads to the marking m, we write mm.

∗The Kleene closure of a generic set X is an infinite set that contains all sequences that can be obtained combining elements in X.

The empty sequenceε(i.e., the sequence of zero length) is enabled at all markings m and is such

that mm.

In the net in Figure 1.1, a possible sequence of transitions enabled at marking m = [1 0 0 0]T is σ=t1t4t2t3, whose firing leads again to m.

Definition 1.6 enables us to generalize Equation 1.3. Indeed, to each sequenceσ∈T∗, we may associate a vectorσ∈ Nn whose generic ith entryσ[i]is equal to the number of times transition ti

is contained inσ. Vectorσ ∈ Nnis called the firing vector (or counting vector) ofσ. Now, if we consider a sequenceσ=tj1tj2ã ã ãtjrT∗as in Definition 1.6 that leads from m0to mr, it holds

mr =m0+Cσ. (1.4)

Equation 1.4 is called the state equation of the net.

Let us now introduce the notion of conflict.

Definition 1.7 Two transitions t and tare in structural conflict if•t∩•t = ∅, that is, if there exists a place p with a pre arc to both t and t.

Given a marking m, we say that transitions t and t are in behavioural conflict (or in conflict for short) if mPre[ã, t]and mPre[ã, t]but mPre[ã, t] +Pre[ã, t], that is, they are both enabled at m, but m does not contain enough tokens to allow the firing of both transitions.

Consider the net in Figure 1.1. Transitions t2 and t4 are in structural conflict. Such a conflict is also behavioural at marking m = [0 3 1 0]T since p2 ∈ •t2∩•t4 only contains three tokens that allow the firing of only one of the two transitions. On the contrary, the conflict is not behavioural at m= [1 0 0 0]Tsince the two transitions are not enabled. Analogously, the conflict is not behavioural at markingm˜ = [0 6 1 0]T, since p2 contains enough tokens to allow the firing of both transitions, and the enabling conditions of t2is also satisfied by place p3.

1.2.3 LANGUAGE ANDREACHABILITYSET

We now introduce two sets that characterize the possible evolutions of a net in terms of firing sequences and reachable markings, respectively.

Definition 1.8 The language of a marked netN, m0is the set of firing sequences enabled at the initial marking, that is, the set

L(N, m0)= {σ∈T∗|m0[σ}.

Definition 1.9 A marking m is reachable inN, m0 if there exists a firing sequenceσsuch that m0[σm. The reachability set of a marked netN, m0is the set of markings that can be reached from the initial marking, that is, the set

R(N, m0)= {m∈Nm | ∃σ∈L(N, m0): m0[σm}.

Note that in the previous definition, the empty sequence, which contains no transition, is also considered. Indeed, since m0[εm0, it holds m0∈R(N, m0).

A marked PN with a finite reachability set is said to be bounded; otherwise, it is called unbounded.

As an example, the net in Figure 1.1 is bounded. On the contrary, its language is infinite since sequences of arbitrary length may fire. Indeed, as already discussed previously, sequences t1t∗4 are enabled at the initial marking. However, it is easy to show that from the initial marking, only three markings may be reached.

The simplest example of an unbounded net is given by a net consisting of a transition with an output and no input place (source transition). In such a case the transition may fire an arbitrary number of times, always leading to an increasing marking. Finally, an example of a net with a finite language is given by the net in Figure 1.1 where both transitions t3 and t4 are removed. In such a case, after the firing of sequence t1t2, no transition is enabled and the net is said to be in a deadlock state (see the following Section 1.2.4).

If the reachability set is finite, an exhaustive enumeration of R(N, m0)is obviously possible. This is commonly done constructing the reachability graph of the net. Given a marked netN, m0, the main steps for its construction are summarized in the following algorithm.

Một phần của tài liệu Formal methods in manufacturing (Trang 24 - 28)

Tải bản đầy đủ (PDF)

(703 trang)