• Aucun résultat trouvé

De/compositional Mw Automaton-Based Reachability Algorithm

N/A
N/A
Protected

Academic year: 2022

Partager "De/compositional Mw Automaton-Based Reachability Algorithm"

Copied!
14
0
0

Texte intégral

(1)

De/compositional M

w

Automaton-Based Reachability Algorithm

Štefan Korečko, Štefan Hudák, Jozef Doboš, Slavomír Šimoňák

Department of Computers and Informatics, Faculty of Electrical Engineering and Informatics,

Technical University of Košice, Letná 9, 041 20 Košice, Slovakia

[email protected], [email protected], [email protected], [email protected]

Abstract

This paper introduces a new reachability problem (RP) solving algorithm for the (pure) place/transition nets. This algorithm combines the existing Mw automaton-based method with the de/compositional approach called T-junction. The existing method is built around a special type of finite state automaton, called Mw automaton, and reduces RP to an instance of modified integer linear programming problem. The T-junction divides a place/transition net into subnets with common transitions. Possibilities of parallel implementation of the new algorithm are also described.

Keywords: Petri nets, reachability problem, Mw automaton, T-junction de/composition, parallelisation

1. Introduction

In [3] an original method (algorithm) to analyse and solve the reachability problem (RP) for (pure) place/transition (P/T) nets [1] in general case was introduced. The preliminary version of the method was presented at The Second Workshop on Applications and Theory of Petri Nets in September 1981, at Bad Honnef, Germany. The centrepiece of the method is a structure named finite state automaton of the type Mw or simply Mw automaton. The analysis of the structure is based on results of automata theory and the convex analysis of the state space represented by Mw. The notion of Mw coincides to some extent to that of the coverability graph [11], but they differ in significant details. The reachability analysis by the method reduces the reachability problem (RP) to the integer linear programming problem (ILP), to be more precise to an instance of the modified ILP (MILP)[3]. The latter adds to ILP a requirement of proving validity of some predicate con, which holds if and only if there is a path in the state space leading from the ILP solution point X to the initial point in the hypercube C(X). Recently it was discovered [4] that the Mw automaton allows to coin a new approach to reveal deadlocks in P/T net, based solely on the net in question and its automaton.

Despite of its age the method presented in [3] maintains its originality even compared to the newest approaches to RP solving, such as [7], [8] and [9]: The method [3] is based on a study of linguistic properties of P/T net computations while the other approaches are state- oriented. However, we found a strong relation among results presented in [8], [9] and our ones, for example marked reachability graphs [8] and production graphs [9] have properties similar to Mw and sets of (co-)reachable configurations from [8] are close to prefix and suffix

(2)

languages from [3]. The advantages of the method [3] are a systematic way of Mw

construction and a reusability of Mw for every RP instance of a given net. In addition, the work [3] also contains a derivation of the worst-case time complexity of RP and an estimation of the lower bound of the RP space complexity. The upper bound of the worst-case time complexity has been established as (2 )

.2 2k1k

O b

, where k a is number of places of given P/T net and b is some constant, b>0. It should be also noted that in the case of unbounded P/T nets the Mw automaton represents a decomposition of state space that reminds the classical Kosaraju-Lambert-Mayr-Sacerdote-Tenney (KLMST) decomposition (the shortcut is borrowed from [9]). This is quite natural because the method [3] and the results of Kosaraju [6] and Mayr [10] originated from the same time period, as it is also noticed in [5].

The complexity is the main obstacle to solve RP in the cases of practical size, expressed in terms of cardinality of the set of places of P/T net in question. To cope with this tremendous complexity three de/compositional approaches to RP solving have been introduced [2], [3]: T-junction, where the net is split into subnets with some common transitions, P-junction, where subnets have some common places and PT-junction with common places and transitions. T-junction turned out to be the most promising one for several reasons. First, it promises the most effective reduction of the complexity, as the number of places plays the prominent role in it. The second one is relative simplicity of backward composition of final result of RP solving. And, finally, it has nice properties with respect to a possible parallel implementation of the algorithm.

This paper extends the existing theory of the T-junction de/composition [2], [3] by introducing a new RP solving algorithm that combines the original method from [3] with the T-junction approach and by reasoning about possibilities of parallelisation of the new algorithm. The rest of the paper is organised as follows: The next section deals with basic definitions and notations. The RP algorithm from [3], which we call here RP/Mw algorithm, is briefly described in section 3 and the new one is presented in section 4. In the final section we summarize the contribution of the paper and work related to it and outline some tasks for future research and development.

2. Preliminary

By N we denote the set of natural numbers {0,1,2,...}, by Zthe set of all integers and by Zk(Nk) the set of k-dimensional (non-negative) integer vectors. For these vectors we use the relations=, and < defined as

}

=, {<, , : )

(1   

 op op

opr i i k qi ri

q

where q=(q1,,qk) and r=(r1,,rk). By the symbol ω we mean a value greater than any integer. This implies that a(aN):a=a=. If pq and pq we say that q covers p.

The cardinality of a set A is denoted as |A|.

If some object x has both an “ordinary” and a vector form, we will denote the ordinary form as x and the vector form as x. The letter “T” in upper index always stands for matrix (vector) transposition. For matrices we use the standard notation, i.e. a matrix A with m rows

(3)

and n columns is defined as A=(Ai,j)mn and Ai,j is the entry in the i-th row and j-th column of A. 0m,n is the zero matrix of dimensions mn and 0k is the k-dimensional zero vector. If

v is a sequence of symbols from V (i.e. a string vV*) and aV then by v(a) we mean the number of occurrences of a in v.

P/T nets represent one of the most researched and well-known version of Petri nets, a formal language able to specify non-deterministic and concurrent systems. A P/T net can be defined as follows:

Definition 1 ((Pure) P/T net). A P/T net is a 5-tupleN0=(P,T,pre,post,m0), where

} , , {

= p1 pk

P is a finite set of places, T={t1,,tn} is a finite set of transitions, pre:PTNis a preset function, post:PTNis a postset function and m0:PNis the initial marking. A pure P/T net is a P/T net for which it holds that (pP,tT):pre(p,t)>0post(p,t)>0.

The functions pre and post have the same purpose as the flow relation and weight functions in the P/T net definition from [1] - to define arcs in P/T net graph. If pre(p,t)=x and

0

>

x then there is an arc from a place pP to a transition tT with a weight x. The function post defines arcs from transitions to places in the similar way.

A marking of P/T net N0 is a function m :PN. Value of m(p) is the number of tokens in the place p. Markings can be written as vectors, i.e.

)) ( , ), ( (

= m p1 m pk

m

and we distinguish between different markings by using lower and upper indices (m1,

m, etc.). The initial marking m0 is a marking assigned to the net when initialised.

The functions pre and post can be represented as matrices, namely as

 the pre-matrix Pre, Pre=(Prei,j)kn, Prei,j= pre(pi,tj),

 the post-matrix Post, Post=(Posti,j)kn, Posti,j =post(pi,tj) and

 the incidence matrix C, C=(Ci,j)kn, C=PostPre.

Then for each tjT we can define its vector form tj =(C1,j,,Ck,j)

and related vectors

) , , (

= 1,j k,j

pre

j Pre Pre

t

and tjpost =(Post1,j,,Postk,j)

.

A transition tjT is enabled (feasible) in a marking m (denoted

tj

m), if and only if

. 0k

pre

tj

m

When tj is enabled, it can be executed (fired). The result of its execution is a new marking m,m m tj

= . We say that m is reachable from m via tj and denote it m m

tj

. A sequence of transitions =tj1tj2...tjr is an admissible firing sequence in PN N0, provided a sequence of markings m0,m1,...,mr exists such that i i

tj

i m

m r i

i

(1 ): 1 . In that case we write

(4)

mr

m

0 or just m mr

*

0 if is immaterial. The marking mr is called a reachable marking in

N0 from m0 (via ). The set of reachable markings of PN N0 is the set ( )={ | }

* 0

0 m m m

N

R .

Given a P/T net N0 and any qNk a problem whether qR(N0) is called (an instance of) the reachability problem of N0 (with respect to q). We will denote it RP(q,N0).

The marking mr can be computed as mr =m0()CT, where ()=((t1),,(tn)) is the Parikh mapping of . For any T* we define [] as a column vector []=CT().

The reachability algorithm in [3] is defined for vector addition systems (VAS), which are equivalent to the pure P/T nets. In [3] a k-dimensional VAS has been defined as

), , (

= q0W

Wk where q0Nkis the initial state of Wk and W is a finite set of k- dimensional integer vectors. Given q,qNk and wW, the enabling and execution for VAS can be defined as qw def qw0kand q q def q q w

w

= . The VAS equivalent to N0 has the form

}) , , { , (

= )

( 0 0 1 n

k N m t t

W

.

The requirement that a net has to be pure is only a technical obstacle: we can eliminate self-lops by inserting a dummy place-transition pair into each of them. Because of this we will refer to the RP/Mw algorithm as to a reachability algorithm for P/T nets and not for VAS.

p1

t3

t4

t2

p2 p

3

t1

t6

t5

p6 p5 p4

Figure 1. Graph of unbounde d P/T net

Figure 1 shows an example of unbounded P/T net. The initial marking of the net is

,0) (0,1,1,0,0

0= m

and some of the vectors are t1=(0,0,0,1,1,0)

, t2=(1,1,1,0,0,0)

,

,0) (0,0,1,0,1

3 = tpost

, t5pre=(0,0,1,0,1,0)

.

3. Reachability Problem Algorithm

The RP/Mw algorithm for an instance RP(q,N0) can be formulated in six steps:

Step 1. For N0 construct the finite state automaton (fsa) Mw(N0). If states of Mw(N0) are - vectors (i.e. vectors containing at least one -coordinate), go to Step 3. Otherwise go to Step 2. This step is demonstrated in section 3.1.

Step 2. In Mw search for a state equal to q. If there is such state, go to Step 5, otherwise go to Step 6.

(5)

Step 3. In Mw search for a state covering q. If there is such state, go to Step 4, otherwise go to Step 6.

Step 4. Formulate and solve the modified integer linear programming problem

)) ( , ,

0(A X Bq

MILPN . If the result is true go to Step 5, otherwise go to Step 6. This step is in more detail treated in section 3.2.

Step 5. Answer qR(N0). Stop.

Step 6. Answer qR(N0). Stop.

The fsa Mw(N0), created in the first step, represents the state space of N0. It is defined as Mw(N0)=(Q,W,,0) where Q is a set of states, W is an input alphabet, W=T, QWQ

is a transition function and 0Q is the initial state. Each qQ has a vector form

q(N{})k

. According to the boundedness of N0, Mw(N0) can fall into one of the following two classes:

RG-like. If N0 is bounded then Mw(N0) is identical to its reachability graph, Q=R(N0)

and 0=0

m .

CG-like. If N0 is unbounded then Mw(N0) is similar but not identical to its coverablity graph. The most significant difference is that there is no extra state for m0 in Mw. In CG-like Mw each Q has a form of an -vector and represents an infinite subspace of R(N0), namely all mR(N0) such that

m . This implies 0 0

m . The states of

) (N0

Mw are also called macrostates and are mutually incomparable.

3.1. Mw Construction

In [3] the creation of Mw(N0) is defined by a sequence of transformations T<x of so- called vector state tree (VST) of VAS Wk(N0), which is identical to the reachability tree of N0. Any state q in VST is assigned the language Y ={u T*| q :q q}

u k

q N ,that is called the suffix language of q. The transformation T<x replaces an infinite path consisting of subpaths q q,

T*

, such that qq, by the loop , =T<x(q)=T<x(q), =Aq. By Aq we denote a vector obtained from q by replacing all the coordinates listed in A by .A, A{1k}, is a set of indices in which the strong inequality between q and q exists. T<x has the invariant property

)

< (

*

:

,q q Yq YT xq

q   

. The sequence of transformations is always finite. The theory of Mw construction can be found in [3], here we demonstrate it on an example.

(6)

0,1,1,0,0,0 m0

1,0,0,0,0,0 0,1,1,0,1,0

t2

t4

0,1,1,0,ω,0

1,0,0,0,ω,0 t2 t

4

m1

m2

ω{5}m

0

ω{5}m

1

T<t

1

0,1,1,0,ω,0

1,0,0,0,ω,0 t2 t4 ω{5}m

0

ω{5}m1

0,1,1,1,ω,0 ω{5}m

3

ω

0,1,1,ω,ω,0

1,0,0,ω,ω,0 t2 t4 ω{4,5}m0

ω{4,5}m1

T<t

2t4

t1

t1, t

3, t

5, t

6

A={3,4,5,6}

0,1,ω,ω,ω,ω

1,0,ω,ω,ω,ω t2 t

4

ρ0= ω

Am0

ρ1=ω

Am1

t1, t3, t5, t6

ω

a) b) c)

Figure 2: Mw automaton construction for the net from Fig. 1: step one (a), two (b) and the final result (c).

Example 1. In practice the construction of Mw automaton proceeds in such a way that we apply transformations as soon as possible. So, in the case of the net from Fig. 1 we apply

4

<t2t

T immediately after finding out that m0m2. The transformation “omegalizes” the fifth coordinate of the vectors on the corresponding path and create the loop t2,t4 (Fig. 2 a). In the second step a new replaces fourth coordinate of {5}m0 and {5}m3, but this also propagates to {5}m1 (Fig. 2 b). The rest of the transformations consists of steps similar to the second one for t3, t5 and t6 and the resulting Mw automaton is shown in Fig. 2 c).

3.2. Modified ILP Problem

If Mw(N0) is CG-like then the structure of its state diagram consists of n1 strongly connected components1 (scc) and a corresponding RP instance RP(q,N0) transforms to an instance of a problem2 we call modified integer linear programming problem (MILP)

)) ( , , ( ))

( , , ( ))

( , ,

( 0 0

0 AX Bq ILP AX Bq con AX Bq

MILPN N N (1)

Its first part is an ILP instance and is constructed in the following way: Assume that we found a state of Mw such that q and is in the same scc, scc0, as 0. Also assume that v,vT* is the only path from 0 to . Now we have to find all distinct simple loops in

0

scc . By a simple loop we mean a non-loop cycle in the graph of Mw. Let’s say that the simple loops of

0

scc form the set ={ , , , }

2 0

1 d

WL , i(1id0):iT*. Then we can formulate the system of linear equations (2).

] [

= ) ( ), (

=Bq Bq q m0 v

AX T T

, =([ ],[ ] [ ])

2 0

1 d

A (2)

1 scc of Mw reminds marked reachability graphs from [8] and the structure of Mw is a case of KLMST decomposition.

2 In [3] the MILP (1) is defined as MILP (A,X,B(q)) ILP (A,X0,B(q)) con (A,X0,B0)

Wk Wk

Wk . Modifications have been made to get

rid of notation not used in this paper. Actually, Wk is Wk(N0), X0 is related to minimal solutions of (2) and B0=B(q)-q.

(7)

Solving the ILP instance means solving (2). If there is a solution X to (2) that is a non- negative integer vector, then ILPN (A,X,B(q))=true

0 .

The ILP solution informs us about the number of loops passed on the way from m0 to q, but not about their ordering. Therefore an additional test, expressed in the predicate

)) ( , ,

0(AX Bq

conN , has been defined. The test is about checking whether there is an admissible firing sequence in N0 in which number of occurrences of each transition is given by the solution vector X and the structure of simple loops in

0

scc . There is no need to compute

N0

con if the reachability set of N0 is semilinear and results provided in [3] indicate that the class of PN for which it is satisfactory to solve ILP can be even wider, however they require addition examination. Nevertheless, the need to compute conre-occurs when using the T- junction de/compositional approach, as it is described in the next section.

If Mw(N0) has more than one scc and q is covered by a state that is not in the initial

0

scc , we proceed in the similar way but the set WL and the matrix A in (2) have to include loops from all scc-s on the way from 0 to. It should be also noted that if q and  0

then there can be more than one path from 0 to . This means more ILP instances to be solved.

Example 2. Let’s say that we would like to know whether q=(0,1,1,1,0,1) is a reachable marking of the net N0 from Fig. 1. After constructing the corresponding Mw (Fig. 2 c) we know that q0. The whole Mw(N0) is one scc with WL={1,2,3,5,6}, 2=t2,t4 and i=ti

for i=1,3,5,6. This yields the equation system

0 0 1 0 0 0

=

1 1 0 0 0

0 1 1 1 1

1 0 1 0 1

1 1 1 0 0

0 0 0 0 0

0 0 0 0 0

6 5 3 2 1

X X X X X

and its solution is X =(2,2,1,1,0)T

, so ILPN =true

0 and qR(N0). The conN =true

0 , too as there is an admissible sequence t2,t4,t1,t2,t3,t1,t4,t5 from m0 to q.

4. RP Solving with T-junction De/composition

Provided that N0 is as in Definition 1, by T-junction we can split N0 into subnets N1, N2

such that (z{1,2}):

0 0

2 1 2 1

2 2 1 1 2

1 2 1

0

=

, ) (

= , ) (

=

,

= ,

=

,

| =

| ,

| =

| ,

= ,

=

), , , , , (

=

m P m

post T

P post pre T P pre

T T T T T T

k P k P P

P P P P

m post pre T P N

z z

z z z z

z z

s z z z z z z

(3)

(8)

and we denote this situation as N0=TJUNC[Ts(N1,N2)]. The symbol “” stands for the domain restriction. The common transitions form the set Ts, which is called the set of synchronic transitions.

The relation between solutions of RP for N1, N2 and N0 is formulated in Theorem 1, which is a slightly reformulated version of the similar one from [2]. Here

Ts

| is the projection of onto Ts, i.e. we obtain

Ts

| from by dropping away all transitions that don’t belong to

Ts from .

Theorem 1. Let N0,N1,N2 be P/T nets such that N0=TJUNC[Ts(N1,N2)]. Then for any

qNk it holds that

.

|

=

|

|

=

|

= : ) ,

, (

) ( )

(

) , (

= :

) , ( )

(

2 1 2 2 2 02 1 1 1 01

2 2 1 1

* 2 2

* 1 1

*

2 2 1 1

2 1 2

2 1 1 2 1 0

Ts Ts

T T

k k

N in q m N in q m

T T

T

N R q N R q

q q q q

q q q N

R q

N N

(4)

In what follows we formulate and prove a new theorem that brings the result of Theorem 1 closer to an actual implementation of a RP algorithm utilizing T-junction. Before doing this we need to specify the sets of places and transitions from (3) in more detail:

} , , {

= }, , , {

= }, , , {

=

} , , {

= }, , , {

=

} , , , , , , {

= }, , , , , , {

=

2 1

1

1 2 1

1

1 1

1

c b s n b c

k a a

n c b k

a a

t t T t t T t t T

p p

P p p P

t t t t T p p

p p P

For the sake of simplicity we assume that solving RP in N1 and N2 yields to only one ILP instance in each of them.

Theorem 2. Let N0, N1, N2 be as in Theorem 1 and qNk, q1Nk1 and q2Nk2 such that q=(q1,q2). Moreover, let

T dz z z z

dz z z z z

d z z z

L

z T

z T z z z z z

x x X

A W

v m q q B q B X A

) , , (

=

]) [ ], ([

= }, , , {

=

], [

= ) ( ), (

=

, .1

. .1 .

.1

0

(5) be the IPL instances ILPNz(Az,Xz,B(qz)) for RP(qz,Nz) and

AzXz=B(qz) (6) be their explicit solutions, z=1,2. Then it holds that the equation system (7)





1.2 2 1

2 1

2 1

1 2 ,

, 2 1

) (

) (

= 0

0

B q B

q B X X L L

A A

d a k

d a

(7)

Références

Documents relatifs

If the algorithm of partial unfolding is used for checking reachability property of goal and safety states then algorithm should check those states after each work of

If the given connected loopless bridgeless planar graph corresponds to the black regions of a knot (link) then to construct its companion graph, all one needs to

The AAID evaluations of these registration results for the Concord image and Hestain image are compared in Figure 18, where the proposed fusion-based methods achieve much

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

Assuming a cohort of n ≥ 4 robots devoid of sense of direction, if it is possible to solve the leader election problem, then the pattern formation problem is solvable, provided that

The computation of K requires one division but in later jumps to the procedure onfy two multiplications, three righi-shifts and at most three subtractions will be needed, provided

One of the interesting techniques for leader election is used in the WBS (Wait Before Starting) algorithm, in which each node in the network will wait for a time corresponding to

In order to cover the whole double- precision domain for input arguments, we suggest using Payne and Hanek’s algorithm for huge arguments..