=Paper=
{{Paper
|id=None
|storemode=property
|title=Verification of Systems: Deadlock Analysis Based on Petri Nets
|pdfUrl=https://ceur-ws.org/Vol-848/ICTERI-2012-CEUR-WS-SMSV-paper-5-p-321-343.pdf
|volume=Vol-848
|dblpUrl=https://dblp.org/rec/conf/icteri/Hudak12
}}
==Verification of Systems: Deadlock Analysis Based on Petri Nets==
Verification of Systems:
Deadlock Analysis Based on Petri Nets
Štefan Hudák
Department of Computers and Informatics
FEI TU 04011 Košice,
Letná 9, Slovak Republic,
e-mail:stefan.hudak@tuke.sk
Abstract. T he present work is devoted to the study of deadlock prob-
lem in Place/Transition (P/T) nets, particularly to the exploration of
how a deadlocks’ presence can be revealed solely on the basis of the
P/T net N0 in question and a structure, here termed as the fsa of the
type Mw , that represents the reachability set <(N0 ) of N0 . The structure
can be obtained from N0 following the original algorithm for solving the
reachability problem RP for Petri Nets in general case by the author.
It turns out, that the structure of Mw bears some important properties
with respect to the deadlock analysis.
Deadlock analysis is an important part of system verification, so the
results achieved can be of some value to that. It is demonstrated that
results presented are quite significant, and cover some gap in both, theory
and practice of the deadlock analysis of state-based systems, particularly
those whose specification can be expressed via Petri Nets.
Keywords. Place/Transition Nets, deadlock analysis, reachability, fi-
nite state representation of the state reachability set, finite state au-
tomaton of the type Mw .
Key Terms. Mathematical Model, Specification Process, Verification
Process
1 Introduction
In the development of (state-based) system, the design of a system in ques-
tion, is the core of the process. The latter is actually a realization of the what
requirement specification is about. There are two intrinsic activities of any de-
velopment:validation and verification. The validation is the process of assurance
that the design will produce the right system (according to requirements), while
the verification assures that the design is carried on properly (according to a
particular design principle)[21]. Verifying the system designed on the presence
(absence) of deadlock situations (deadlock analysis-DA) might be a part of ver-
ification process. In the paper we pay attention to the deadlock analysis.
322 Š. Hudák
The approach to deadlock analysis applied in the paper is based on the reach-
ability analysis [6] made on the representation (model) of the system designed
in Petri Nets [8]. In [6] an original method (algorithm) to analyze and solve the
reachability problem (RP) for Petri Nets in general case was introduced. The
method is based on the structure, we have called it the finite state automa-
ton of the type Mw , that is created by the algoritm, and the analysis of the
structure based on results of automata theory and the convex analysis of the
state space represented by Mw . Some authors in the field of Petri Nets used to
use for representing state space of reachable states of Petri nets the structure
termed as coverability graph. The two notions coincide to some extent, but differ
in significant number of cases.
The approach is founded on the information that was neglected and suppressed
by the RP algorithm while creating Mw , and thus hidden in it. The modification
of Mw construction, that is introduced in this paper, discloses the information
previously hidden to serve the purpose mentioned.
The paper consists of four parts. In the first part basic notions and results con-
cerned Petri Nets, reachability and deadlock analysis are given. The second part
deals with the algebraic properties of Mw . It turns out that Mw is finite state
automaton, with some interpretations of its states via k -dimensional nonega-
tive integer ω vectors. Each such ω vector represents a state subspace of PN
in question, and can be thought of as a poset. That view on ω states allows
us to establish relation among deadlocks and minimal or least elements of such
the posets. In the third part we deal with the issue of disclosing the informa-
tion previously hidden, and define more precisely the new notion and denotation
of ωcoordinates. The fourth part consists of an application of the theory of
ωcoordinates developed. The application is made to two PNs, which was in-
troduced by T.Murata [1] as manifestation of the fact, that using coverability
graphs as the representation of state space of PN is weak and insufficient for
disclosing deadlocks in PN. The same conclusion was jumped to in [2].
2 Some basic preliminaries to DA
In the paper we denote by IN the set of natural numbers {0, 1, 2, . . .}, by Z the set
of all integers, Zk (INk ) the set of k-dimensional (nonnegative)integer vectors.
A notion of (k-dimensional) vector addition system (VAS) Wk is a couple
Wk = (q0 , W )
where q0 ∈ INk is the initial state of Wk , W is a finite set of (k- dimensional
integer) vectors. We call a reachable state vector of Wk each q ∈ INk such that
1. q = q0 + wi1 + . . . + win for some integer n ≥ 0, wij ∈ W, j = 1, . . . , n
and
2. for ∀j(1 ≤ j < n) : qj = q0 + wi1 + . . . + wij ∈ INk
Here by + we mean the operation of vector addition. We call the set of all such
vectors the reachability set of VAS Wk , and denote it as R(Wk ). Given any VAS
Verification of Systems: Deadlock Analysis Based on Petri Nets 323
Wk = (q0 , W ) then or any q ∈ INk a problem whether q ∈ R(Wk ) is called the
reachability problem of VAS (with respect to q). We will occasionally use the
abbreviation RP (q, Wk ) for it.
With any VAS Wk = (q0 , W ) we can associate a tree structure, which we
call the vector state tree, V STw , and we mean by that a double labelled oriented
rooted tree V STw = (Tw , Lab(V ), Lab(E), q0 ), Tw = (V, E, r0 ) is an oriented
rooted tree , V - a set of vertices, E ⊆ V × V - a set of edges, r0 ∈ V - the
root of Tw , Lab(V ) ⊆ INk -a set of vertex labels, Lab(E) ⊆ W - a set of edge
labels that are defined as follows: there are two labelling mappings lab1 : V →
Lab(V ), lab2 : E → Lab(E) such that lab1 (r1 ) = q0 and any vertex of Tw v ∈ V
with lab1 (v) = q has a son u ∈ V with lab1 (u) = q 0 and lab(v, u) = a iff q 0 = q+a.
As a very consequence of the above definition we have that Lab(V ) = R(Wk )
where Wk = (q0 , W ) is the VAS and we can alternatively write V STw =
(Tw , R(Wk ), Lab(E), q0 )
2.1 Place/Transition Nets (P/T Nets).
Place/Transition (P/T) Nets stand here for a class of Petri Nets in which
multiple arcs are allowed and places have unlimited capacities. For more de-
tails on PN we refer the reader to the literature , e.g. [8]. For any P/T net
N0 = (P, T, pre, post, m0 ), where P is a finite set of places, T is a finite set of
transitions, pre : P × T −→ IN - preset function, and post : P × T −→ IN -
postset function, that all define a structure on the set P ∪ T . It is very common
to represent the P/T Net /1 by the oriented bipartite graph (Fig. 1).
Here we have:
Fig. 1. Graph representation of Petri Net
1
We will use Petri Net (PN) occasionally instead of P/T Net, so we consider them as
synonyms
324 Š. Hudák
P = {p1 , p2 , p3 , p4 , p5 }
T = {t1 , t2 , t3 , t4 }
pre and post functions are given in Table 1 and Table 2 respectively.
Table 1: Table 2:
P T pre(p,t) P T post(p,t)
p1 t 1 1 p1 t 2 1
p2 t 2 1 p2 t 1 1
p5 t 2 1 p3 t 1 1
p3 t 3 1 p4 t 1 1
p4 t 4 1 p4 t 3 1
p5 t 4 1
otherwise 0 otherwise 0
In Fig. 2 there is a correspondence shown between the graph representation
of PN N and pre and post functions.
Fig. 2. The correspondence between the graph representation of PN and the pre and
post functions
The following useful notations can be defined:
•
t = {p | pre(p, t) 6= 0} the set of preconditions of t
t• = {p | post(p, t) 6= 0} the set of postconditions of t
p• = {t | pre(p, t) 6= 0}
•
p = {t | post(p, t) 6= 0}
By the marking of PN N = (P, T, pre, post) we mean a totally defined function
m : P −→ IN (1)
(2)
We use m to describe the situation or configuration in PN N . Namely we say
the condition represented by the place p in PN N holds iff m(p) 6= 0. Without
loss of generality we assume that P and T have k and m elements respectively.
Verification of Systems: Deadlock Analysis Based on Petri Nets 325
i.e. P = {p1 , p2 , , ..., pk }, T = {t1 , t2 , , ..., tm } and we fix some ordering of
both, places and transitions from now on. Using the ordering of places we can
→
consider m to be the k-dimensional nonnegative integer vector, i.e. m ∈ INk .
More formally
→
m = (m(p1 ), m(p2 ), ..., m(pk ))
and m(pi ) is the value of m in pi , i = 1, 2, ..., k, according to (1). In our
→
example (Fig. 1) m(pi ) = 1 iff i = 1, or alternatively m = (1, 0, 0, 0, 0).
For the simplicity we will use the denotation m for either interpretations of the
marking m when it doesn’t cause any troubles. We say t is enabled in m, and
denote it m t , iff for every p ∈• t, m(p) ≥ pre(p, t). In Fig. 1 t1 is enabled
in m = (1, 0, 0, 0, 0) because • t1 = {p1 } and m(p1 ) = 1, and pre(p1 , t1 ) = 1.
In general, given PN N, a marking m of N, several transitions from T can be
enabled in m. Once the transition t is enabled it can fire. The effect of the firing
t in m is the creation of a new marking m0 that depends on m and t. We use a
denotation
m t m0
and m0 is defined in the following way:
p ∈ • t \ t•
m(p) − pre(p, t)
p ∈ t • \• t
m(p) + post(p, t)
m0 (p) =
m(p) − pre(p, t) + post(p, t) p ∈ • t ∩ t•
m(p) otherwise
In PN N of Fig. 1 we can write m = (1, 0, 0, 0, 0) t1 m0 = (0, 1, 1, 1, 0).
Notice transitions t3 ,t4 will be enabled in m0 either.
We say the sequence of transitions σ = t1 t2 ...tr is admissible firing sequence
in PN N, provided a sequence of markings m0 , m1 , ..., mr exists and such that
mi−1 ti mi , i = 1, 2, ..., r. In that case we write m0 σ mr , or simply m0 ? mr ,
when σ is immaterial. The marking m is to be called the reachable marking in
N from m0 (via σ). We fix the marking m0 to be the initial marking of PN N =
(P, T, pre, post) and we denote it N0 = (N, m0 ) or N0 = (P, T, pre, post, m0 ).
Given PN N0 = (P, T, pre, post, m0 ) we define the set of reachable markings
R(N0 ) = {m | m0 σ m, },
We can define the language of PN N0
L(N0 ) = {σ ∈ T ∗ | m0 σ m, σ ∈ T ∗ }
and we call it PN language.
326 Š. Hudák
2.2 VAS and Petri Nets.
Let N0 = (P, T, pre, post, m0 ) be a Petri Net with the initial marking m0 . Recall
m0 can be represented as a k-dimensional nonnegative integer vector, i.e. m0 ∈
Zk and m0 = (m0 (p1 ), . . . , m0 (pk )). Let us fix an ordering of places in P and
transitions in T, i.e. P = {p1 , . . . , pk } and T = {t1 , . . . , tm }.
In PN literature (e.g. [6],[8]) we have the following characterization of the
marking obtained (reached) in N0 from initial marking m0 under firing transition
sequence σ ∈ T ∗
σ
m0 m ⇔ m = m0 + (c · Ψ T (σ))T
and Ψ (σ) is the Parikh mapping over the (ordered) alphabet T, and Ψ T (σ) stands
for the transposition of the row vector Ψ (σ).
Any transition t ∈ T can be represented as a k-dimensional integer vector
t = post(t) − pre(t)
and
post(t) = ((post(p1 , t), . . . , post(pk , t)
pre(t) = ((pre(p1 , t), . . . , pre(pk , t))
It can be easily seen that
t
m0 m ⇔ m = m0 + t
and we can construct for PN N0 = (P, T, pre, post, m0 ) the vector addition sys-
tem Wk = (q0 , W ) an such that q0 = m0 , W = {t|t ∈ T } , and k = cardP . The
following result holds
Theorem 1. [6]
For any PN N0 = (P, T, pre, post, m0 ) there is an vector addition system Wk =
(q0 , W ) and such that R(Wk ) = R(N0 ), and k = cardP .
Proof:That follows from the above construction.
2.3 Reachability Problem
Reachability problem for Petri nets attracted a lot of attention of experts in
computer science community. It lasted pretty long time (almost 20 years) a so-
lution to RP had been obtained [9],[10],[11],[12],[4]. A full account of the solution
of RP by the author, including the complexity issue of RP- the upper bound of
the worst-case time complexity of the solution, can be found in [6].
We are going now to describe shortly main steps of the author’s RP solution.
Verification of Systems: Deadlock Analysis Based on Petri Nets 327
1. Any P/T net N0 = (P, T, pre, post, m0 ) can be assigned a vector adition
system (VAS) Wk = (q0 , W n
) via a representation of transitions of P/T net
→ o →
N0 as vectors, where W = ti |ti ∈ T , (q0 = m0 ) and ti = (post(p1 , ti ) −
pre(p1 , ti ), ..., post(pk , ti ) − pre(pk , ti )), provided P = {p1 , ..., pk }. By that
virtue the computations of P/T net N0 are in 1-1 correspondence with com-
putations of the VAS Wk and R(Wk ) = R(N0 ) (see Theorem 1). The com-
putations of the VAS Wk can be represented via rooted labelled tree, termed
as vector state tree - V STw , whose vertices are labelled by reachable states
and edges are labelled by vectorized transitions.
2. Given V STw and its vertex with the label q, it can be characterized by two
languages:Xq , Yq , preffix and suffix language respectively/ which denotes
labelling of paths leading to or from the vertex with the label q. The paths
on V STw can be classified, based on the length of the paths: finite and
infinite, on the one side, and also based on the finite or infinite set of vector-
states: vertex labellings on the other side. Any path on V STw , outgoing from
the root vertex r0 , labelled by q0 , can be assigned a sequence of its vertex
labels (reachable) vector-states
s = {q0 , q1 , ..., qi , ...} (3)
The states in (3) are reachable states, that are vectors, i.e. qi ∈ Nk (k=||P ||),
so for any pair of states in (3)- (qi , qj ), i < j, we can test their comparabil-
ity, w.r.t. the relation ≤ defined on vectors. (of the same dimension). The
sequence (3) can be accompanied by the sequence of suffix(prefix) languages
associated with the states of the sequence (3) . By the nature and due to
properties of VASs and their computations that is clear that
qi ≤ q j ⇒ Y q i ⊆ Y q j (4)
The necessary and sufficient conditions can be formulated for a path being
infinite with finite or infinite set of reachable states. Based on that a theory
of transformation of infinite paths (a graph morphism), that allows pruning
infinite paths and replacing them by loop-like subgraphs and thus transform-
ing the tree into a rooted graph (vector state graph-vsg). The transformation
(T 1 qρ,i is the macrostate covering a set of
minimal elements of the poset Sρ .
We will call the macrostates labelling states of Mw the reachable macrostates.
Any macrostate π ≤ ρ we will call also the reachable macrostate. From that
point of view we may consider elements of Baseρ as the collection of reachable
macrostates.
Still another notion should be introduced; we define
³ 00 00 00
´
qρB = q1 , q2 , ..., qk (10)
where 00
qj = r ⇔ ρ j = $
00
qj = ρj ⇔ ρj ∈ N
i,t,∆j
n o
∆
and $ ∈ ωr j , ωr , ωr for some r ∈ N.
It is clear that
qρB ≤ ρ
The crucial problem is to decide whether qρB is reachable state or not. In the
latter case it will be called spurious state [1]. We will postpone answering that
question later on.
Any deadlock state of P/T net
N0 = (P, T, pre, post, q0 )
is such a state q, that is
1. reachable state, i.e. q ∈ R(N0 ), and
2. for any transition t ∈ T and at least one p ∈• t, pre(p, t) > q(p)
In other words there are not enough tokens at least in one of pre-places • t of
any t ∈ T .
Assume we have a deadlock state d ∈ ρ; that means that any reachable state
q ∈ ρ and such that q ≤ d will be a deadlock state either. From that we have
immediately, that if qρB were reachable state, it would be a deadlock state of
P/T net N0 = (P, T, pre, post, q0 ) since it would have been either the least or
minimal element of the poset Sρ . We can summarize the properties described.
Verification of Systems: Deadlock Analysis Based on Petri Nets 333
Assertion 1 Let Sρ = (Sρ , ≤, t, u) be the poset formed by the macrostate ρ
of the fsa Mw representing the set of reachable states of a P/T net N0 =
(P, T, pre, post, q0 ). Then if there exists a deadlock state d in ρ, then at least
one of minimal elements or the least element of the poset Sρ - qmin will be the
deadlock state too and such that qmin ≤ d.
So, it means that the least and minimal elements of the poset Sρ , if they
exist, serve as a good indicator of presence and/or absence of deadlocks in the
system represented by any P/T net.
In the algorithm of the construction of fsa Mw [6] we apply some transfor-
mations to the paths of the tree of computations of the VAS Wk = (q0 , W ),
which results in introducing ω values into corresponding coordinates of a state
vector. We have shown above there are three types of ω coordinates (ωcords in
short):independent, dependent and overflowed ωcords.
The issue of creating independent ω coordinate is depicted in Fig. 4.
Fig. 4. Path transformation creating independent ωs
There is a state q, having values a and b in its i-th and j-th coordinate re-
spectively. There are also two transitions (vectors) say ta and tb that are firable
(applicable) in q. An aplication of ta at q followed by other transitions leads
0 0
to a state q 0 = (q1, ...a , ..., b, ...qk ) , where a < a is a new value of the i-th
334 Š. Hudák
coordinate, and according to the algorithm which construts automaton M w the
transformation T 1 ωcoordinates have been accom-
plished [7]. In every case there that has been proven, that either Baseρ ⊆ <(N 0 ),
or qρB ∈ <(N0 ). The case of n=2 ωcoordinates is quite simple. The case of n ≥ 3 is
more complicated. There is few typical situations in the case of n=3 ωcoordinates
that shows the table below.
In the table the entry (1, 1 →, 1) stands for a dependence of ωcord dep on
ow, and the entry (1, ← 1, 1) stands for a dependence of ωcord dep on ind.
We illustrate that only for two cases:(3,0,0).
Verification of Systems: Deadlock Analysis Based on Petri Nets 335
Table:Case analysis for 3 ωcords
Type of ωcords
N 0 ind dep ow
1 3 0 0
2 2 1 0
3 2 0 1
4 1 0 2
5 1 1→ 1
6 1 ←1 1
7 1 ←2 0
8 0 2→ 1
9 0 1→ 2
10 0 0 3
Table 1. Case analysis for 3 ωcords
The results on creating ωcoordinates for the case ||A|| ≤ 3 can be generalized
to any n ∈ N. The conclusion we have come to is that ωcoordinates can assume
one of the following forms.
a) single indices
indωcord Bdepωcord owωcord
B,tb ,∆j
ωa∆i ωb ωc
B⊆K
b) multiple indices
indωcord
∆i ,− ∆i ,−,−
ωa∆i ωa, a0
ωa, a0 ,a00
Bdepωcord
B,tb ,∆j B,tb ,∆j ,− B,tb ,∆j ,−,−
ωb ωb, b0
ωb, b0 ,b00
B⊆K
owωcord
ωc ωc,c0 ωc,c0 ,c00
336 Š. Hudák
We propose to use a generalized form to represent ωcoordinates, and we will
call it as form (f).
·µ ¶¸
h1 , · · · h k
ω (11)
d1 , · · · d k
where
µ ¶ ¶ µ
½µ ¶¾
h1 ∆i A, t, ∆i
∈ ,
d1 a b
µ ¶ ½µ ¶ µ ¶¾
hi − λ
∈ ,
di i>1
a c
(12)
Here λ stands for empty symbol. Basically, in the case of overflowed ωcoordinates
we will use just ωc instead of ωcλ or ωc− . In the case of independent and dependent
ωcoordinates we will use instead of empty symbol ’-’ to visualize the correspon-
dence of high and low indices.
In our consideration we will use shorthand notation for indexed ωcoordinates
as
µ ¶
h1 , · · · , h k
ω [Ik ] where Ik =
d1 , · · · , d k
The following results have been proven as far as the generalization of the process
of indexed ωcoordinates is concerned:
1. the form (f) of ωcoordinates has been chosen correctly, and it will be pre-
served by any application of T<ωA transformation, and
2. the procedure to obtain the set of minimal elements of the poset represented
by a macrostate ρ- Baseρ, is determined by a choice of proper combination
of low indices.
5 A case study and further analysis of ωcoordinates
In his paper [1] T.Murata studied two PNs (Fig. 5) with respect to discovering
liveness or deadlock, based on the coverability graphs of Petri Nets, the struc-
ture that is widely used to represent the state space of their reachable states. He
showed that two PNs having the identical coverability graphs differ what con-
cerns of liveness or deadlock properties. In this section we will use our method
based on the finite automaton Mw and the properties of ωcoordinates to demon-
strate the power of the approach to discover safely the deadlock of Petri nets in
general and it will be demonstrated by the example Petri nets by T. Murata.
Verification of Systems: Deadlock Analysis Based on Petri Nets 337
Fig. 5. Case study: Two Petri Nets with identical coverability graphs
Let us have a closer look at the two PNs. Comparing coverabiity graphs of the
two PNs we can see they are indeed identical. Now we are going to apply the
aproach based on the methodology developed, that is backed by our algorithm of
constructing fsa of the type Mw (in some cases state diagrams of Mw and cover-
ability graph coincide, but in some cases they look quite different). Construction
of fsas of the type Mw fo the two nets can be seen in Fig. 6 and Fig. 7.
We can see that Mw automata are isomorphic, but they differ in ωcords as
far as their indices are concerned.
Let us have a closer look at the Mw automata from that perspective. In
Mw automaton of PN N1 we have two macrostates: ρ1 = (1, 0, ω01 ) and ρ2 =
(0, 1, ω0,1 ). If we look at ρ1 = (1, 0, ω01 ) as at the poset, we can have the only
minimal and thus the least (infimum) state
qρB1 = (1, 0, 0)
In the case of ρ2 = (0, 1, ω0,1 ) we have the basis of this poset
Base(ρ2 ) = {(0, 1, 0), (0, 1, 1)}
There are actually 2 minimal states.
Let us turn our atention to the net N2 . In Mw automaton of PN N2 we have
2,−
also two macrostates: ρ1 = (1, 0, ω0,1 ) and ρ2 = (0, 1, ω0,2 ). If we look at ρ1 as
at the poset, we can have here no infimum state, but we still have two minimal
states that creates :
Base(ρ1 ) = {(1, 0, 0), (1, 0, 1)}
338 Š. Hudák
Fig. 6. Mw construction for the live Petri Net N1 with inexed ωcords
If we look at ρ2 as at the poset, we can have also here no infimum state, but
we still have two minimal states that creates :
Base(ρ2 ) = {(0, 1, 0), (0, 1, 2)}
5.1 Deadlock analysis
In [6] the deadlock problem is dealt with, based on the use of original RP algo-
rithm. We wil use of the notion ’deadlock candidates’ states introduced there.
The latter can be derived from the structure of PN in question.
→ → →
Let us consider PN N = (P, T, pre, post) and let t = − pre(p, t) + post(p, t).
For any t ∈ T and p ∈ P we say
p covers t ⇔df pre(p, t) 6= 0 (13)
In other words we are saying by (13) that
p covers t ⇔df t ∈ p• (14)
The (13) and (14) simply mean that p is included in t’s enabling. That is
reasonable to define
C(p) = {t ∈ T |p covers t}
Verification of Systems: Deadlock Analysis Based on Petri Nets 339
Fig. 7. Mw construction for the deadlock Petri Net N2 with inexed ωcords
Obviously C(p) = p• . We are now looking for such a minimal subset Ci of P,
that the union of the covers of places form the subset that will give the whole
set T. We propose to call such the subset Ci the minimal cover of T. The notion
minimal is connected with the number of places covering the set T. Notice, there
can be more than one minimal cover of T.
We associate with each total cover of T -Ci , the set of deadlock markings,
denoted as - CanMi .
CanMi = { m ∈ INk |m ≤Ci mi , p ∈ Ci ⇒ mi (p) ≤ r − 1,
r = minri {ri |pre(p, ti ) = ri , ti ∈ p• } }
where m ≤Ci mi ⇔df ∀p ∈ Ci : m(p) ≤ mi (p).
We can define the notion
CovT = {Ci |Ci ⊆ P, Ci is total cover of T} (15)
Based on the CovT we may define now the overall set of dead markings
n
CanM = m ∈ INk |∃Ci ∈ CovT : m ≤Ci mi , p ∈ Ci ⇒ mi (p) ≤ r − 1,
r = minri {ri |pre(p, ti ) = ri , ti ∈ p• } (16)
340 Š. Hudák
Notice that notions CanMi and CanM are based only on the structure of PN
in question and nothing is known about the reachability of the states contained
there. That is why we have used to call them ’deadlock candidates’, or potential
deadlock states. Any of such the states becomes real deadlock provided it is
reachable, the issue connected with dynamic aspect of the PN in question.
Now we are prepared to formalize the procedure, based on the method devel-
oped so far, as far as deadlock analysis is concerned. We do it in the form of a
procedure.
DA(N0 ):Algorithm for doing the deadlock analysis of Nets (P/T nets).
Input:
Petri Net (P/T net) N0 = (P, T.pre, post, m0 ), of the type Mw
of PN N0
Output:
yes, if D(N0 ) 6= Φ
no, if D(N0 ) = Φ
Method:
Method is based on the results achieved in the analysis of nature
of ωcoordinates, that occur in ω macrostates ρ = ωA q. Approach
is based on interpretation of any such ω macrostate ρ = ωA q as
a representaion of the poset of reachable states in PN N0 , having
minimal or the least elements (MoL states). The special procedure
CanM(N0 ) is used for creation of the set of potential deadlocks of
PN N0 .
Body of the algorithm:
begin
D(N0 ) ← Φ; */D(N0 ) - the set of MoL deadlock states/*
D ← Φ; */D - variable - buffer for the actual set of
MoL deadlock states/*
C ← CanM (N0 ); */D - variable - container of
potential deadlock states /*
S ← Qω ; */Qω - the set of states of fsa Mw = (Qω , W, δ, ρ0 )
W-the set of vectorized transitions,δ-transition function,ρ0 containing m0 /*
while S 6= Φ do;
begin
choose ρ ∈ S;
M oL ← Baseρ;
S ← S − {ρ} ;
if C ∩ M oL 6= Φ then D ← D ∪ C ∩ M oL;
end
if D = Φ then return NO
else D(N0 ) ← D;
return YES:D(N0 )
end
Verification of Systems: Deadlock Analysis Based on Petri Nets 341
The algorithm DA(N0 ) guarantees all MoL deadlocks will be found out and
delivered as the set D(N0 ). Actually that can be considered as solving the prob-
lem of discovering presence or absence of deadlock states in the PN N0 .
5.2 Case study continued
We can now continue to analyze state diagrams of the two PNs. We wil use the
results of previous section and particularly the result of the Lemma ??.
So according to that we have to calculate now total covers for the two PNs.
In the tables below there are calculated both:the minimal total cover of T and
pre-set for the net N1 .
Total Cover of T for PN N1 Function pre for PN N1
t1 t2 t3 t4 Total Cover of T pre p1 p2 p3
p1 ∨ ∨ C1 = {p1 , p2 } t1 1
p2 ∨ ∨ t2 1
p3 ∨ ∨ t3 1
t4 1
Can M = Can M1 = {0, 0, ω}
inf (1, 0, ω01 ) = (1, 0, 0) ∈
/ CanM
inf (0, 1, ω0,1 ) nejestvuje
Base((0, 1, ω0,1 )) = {(0, 1, 0), (0, 1, 1)} ∩ CanM = {(0, 0, ω)} = Φ
So we jump to the conclusion that PN N1 does not contain any deadlock!
Now we are going to turn our attention to the PN N2 . First we calculate
minimal total cover of PN N2 and pre-set for the PN N2 .
Total Cover of T for PN N2 Function pre for PN N2
t1 t2 t3 t4 Total Cover of T pre p1 p2 p3
p1 ∨ ∨ C1 = {p1 , p2 } t1 1
p2 ∨ ∨ C2 = {p1 , p3 } t2 1 1
p3 ∨ ∨ ∨ t3 1 2
t4 1 1
CanM1 = {(0, 0, ω)} , CanM2 = {(0, ω, 0)}
CanM = {(0, 0, ω), (0, ω, 0)}
2,−
Base((1, 0, ω0,1 )) = {(1, 0, 0), (1, 0, 1)}
Base((0, 1, ω0,2 )) = {(0, 1, 0), (0, 1, 2)}
2,−
Base((1, 0, ω0,1 )) ∩ CanM = Φ
Base(0, 1, ω0,2 ) ∩ CanM = {(0, 1, 0), (0, 1, 2)} ∩ {(0, 0, ω), (0, ω, 0)} = {(0, 1, 0)}
So we may jump to the conclusion that PN N2 has indeed deadlock state
{(0, 1, 0)}!
342 Š. Hudák
6 Conclusion
The issue of deadlock analysis is important for the development of discrete state-
based systems. The method of discovering a presence, or an absence of deadlocks
in the system coined and demonstrated in the paper is based on the study
of the properties of the automaton Mw . We should mention that the results
presented in the paper manifest the depth and the vitality of the new method
to deal with the issue of reachability in Petri Nets, particularly the part which
was connected with the study of the algebraic properties of interpretations of
the automaton of the type Mw . In [6] there are some results presented on the
nature of that interpretation. The automaton Mw bears some similarity with
coverability graphs used in Petri Nets, but as it was proven, it is more powerful
to deal with deadlock analysis. Beside of that, the structure of the automaton
Mw plays the central role in reachability analysis of the systems (represented
via PN) with infinite state space [6]. The most important property of Mw is its
reusability for reachability analysis of the PN in question wrt to any other state,
not only wrt to that it was constructed for initially. On the other side it turns
out that one automaton of the type Mw , say M can serve in that role for whole
class of PNs with the same number of places and some structure that induces
corresponding set of transitions wich are consistent with the M structure. There
is still another way how the Mw structure can be used. The fsa M can be thought
of as a couple M=(M,I), where M and I stand for basic fsa without interpreted
states and interpretation respectively. For any k ∈ IN- the number of places and
given structure of basic fsa M we can construct corresponding interpretation I
consistent with M. By that virtue, the same applies wrt doing deadlock analysis.
Due to space we have not dealt with the issue of modification of the algo-
rithm of M construction, and also many details and proofs have been skipped.
There can be found in [7]. At the workplace of the author there has been envi-
ronment - termed as mFDTE [16], developed. The results will be implemented
in the environment. The latter combines three formal descriptions of systems:
Petri Nets, process algebra, and B AMN. The latter substantiate the acronym
mFDTE-multi Formal Description Techniques Environment. More details can
be found in [16].
Acknowledgments. This work was supported by the Slovak Research and
Development Agency grant on Modelling, simulation and implementation of
GPGPU-enabled architectures of high-throughput network security tools,under
the contract No. APVV-0008-10. Further it was also partially supported by the
grants No. 1/3140/06 of the VEGA-The Scientific Grant Agency of Slovakia,
NATO CLG982698 grant, APVV grants No.APVV-0073-07, and SK-UA-0026-
07.
References
1. Murata, T.: Petri Nets: Properties, Analysis and Applications. Proceedings of the
IEEE. 77 (1989)
Verification of Systems: Deadlock Analysis Based on Petri Nets 343
2. Xinning Y., JiantaoZ., and Xiaoyu S.: On Reachability Graphs of Petri Nets. Com-
puters & Electrical Engineering. 29, 263–272 (2003)
3. Hudák, Š.: Extensions to Petri Nets. Habilitation Thesis (in Slovak), TU Košice,
107 p. (1980)
4. Hudák, Š.: The Recursive Decidability of the Reachability Problem for Vector Ad-
dition Systems. ASMM/84, Computing Laboratory, The University of Newcastle
upon Tyne, England, 78 p. (1981)
5. Hudák, Š.: On the Reachability Problem for Vector Addition Systems. Proceedings
of The Second European Workshop on Application and Theory of Petri Nets, Bad
Honnef, Germany, 38 p. (1981)
6. Hudák, Š.: Reachability Analysis of Systems Based on Petri Nets.elfa s.r.o. Košice,
ISBN 80-88964-07-5, 272 p. (1999)
7. Hudák, Š.: Deadlock Analysis of Place/Transition Nets.Manuscript, DCI FEI TU
Kosice, 79 p. (2010)
8. Reisig, W.: Petri Nets: An Introduction. Springer Verlag, Heidelberg (1985)
9. Sacerdote, G.S., Tenney, L.: The Decidability of the Reachability Problem for Vector
Addition Systems (preliminary version). Proceedings of the 9th Ann. ACM Sympo-
sium on Theory of Computing, New York (1977)
10. Muller, H.: On the Reachability Problem for Persistent Vector Replacement Sys-
tems. Computing Suppl. 3, 89–104. In: Knodel, H., Schneider, H.J. (eds.) Parallel
Processes and Related Automata (1981)
11. Mayr, E.W.: An Algorithm for the General Reachability Problem in Petri Nets.
SIAM J. of Computing. 13 (1984)
12. Kosaraju, S.R.: Decidability of Reachability in Vector Addition Systems. In Proc.
14th Annual ACM STOC, 267–281 (1982)
13. Valk, R.: Generalizations of Petri Nets. In: Gruska, J., Chytil, M. (eds.) MFCS
1981. LNCS vol.118, pp. 140–155 (1981)
14. Karp, R.M., Miller, R.E.: Parallel Program Schemata. Journal of Computer and
System Sciences. 3, 147–195 (1969)
15. Keller, R.M.: Vector Replacement Systems: A formaism for Modeling Asynhronous
Problms. Technical Report 117, Princeton University (1972)
16. Hudák, Š. et al.: A Support Tool for the Reachability and Other Petri Nets- Re-
lated Problems and Formal Design and Analysis of Discrete Systems. Problems in
Programming. 20, 613-621, ISSN 1727-4907 (2008)
17. Hudák, Š.: De/compositional Reachability Analysis. Journal of Electrical Engi-
neering, CS ISSN 0013-578X. 45, 424-431 (1994)
18. Stone, H.S.: Discrete Mathematical Structures and Their Applications. Science
Research Associates Inc., Chicago, 402pp. (1973)
19. Best, E.: Semantics of Sequential and Parallel Programs. Prentice Hall Europe,
ISBN 0-13-460643-4, 352pp. (1996)
20. Aho, A.V., Hopcroft, J.E., Ullman, J.D.: Formal Languages and Their Relations
to Automata. Addison Wesley, Reading, Mass (1969)
21. Lano, K.: The B Language and Method. A Guide to Practical Formal Development.
Springer-Verlag London, ISBN 3-540-76033-4, 232pp (1996)