Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Error-correcting Petri nets

Anastasia Pagnoni
Published online: 26 August 2009
Springer Science+Business Media B.V. 2009
Abstract The paper introduces error-correcting Petri nets, an algebraic methodology for
designing synthetic biologic systems with monitoring capabilities. Linear error-correcting
codes are used to extend the nets structure in a way that allows for the algebraic detection
and correction of non-reachable net markings. The presented methodology is based on
modulo-p Hamming codeswhich are optimal for the modulo-p correction of single
errorsbut also works with any other linear error-correcting code.
Keywords Petri net Reachability Error-correction Linear code
Monitoring
1 Introduction
Petri nets are used to represent concurrent systems from the viewpoint of their causal
structure and dynamics. They are not deterministic models of reality. Like in real life,
absent perfect knowledge of the world, possible actions may or may not take place, and
absent a central clock, action occurrences are just partially ordered. As a consequence,
starting the same initial state, quite different stories can play out on the same net. These
uncertainties not withstanding, Petri nets are intrinsically prescriptive models of reality,
widely applied to design system behavior. Unwanted actions can be taken into account, and
explicitly represented in a net if the causal dynamics of their occurrence is sufciently
understood. At net level, such planned-for faulty situations are not any different from
any other situation, and do not amount to erroneous behavior, because the nets causal
structure is not violated. Now, what if we use a Petri net to monitor real-world systems
where the unexpected happens all the time, and unexpected states are reached? Sure
enough, in the Petri net mirror image of a real-world system non-reachable markings would
be reached, but how would we know them from the reachable ones? And, how would we
correct them?
A. Pagnoni (&)
Dipartimento di Informatica e Comunicazione, Universita` degli Studi di Milano, Milano, Italy
e-mail: anastasia.pagnoni@unimi.it
1 3
Nat Comput (2011) 10:711725
DOI 10.1007/s11047-009-9150-z
These questions have a particular impact in the framework of synthetic biology (de
Lorenzo et al. 2006; Heinemann and Panke 2006). When a Petri net is used to engineer a
biological system, how do we monitor its actual workings? How do we detect unexpected
outcomes? And, how would we correct them?
The trouble is that deciding whether an observed marking is reachable from the given
initial marking is a complex taskindeed, it is a NP complete problem, more often than
not computationally intractable for nets of real-world size (Mayr and Meyer 1981; Reisig
and Rozenberg 1989). Also, once we have proven that an observed marking is a
non-reachable one, the theory at hand is ill suited to correct the erroneous situation.
This paper presents an algebraic solution to these kind of problems, based on the well-
established theory of linear error-correcting codes (Adamek 1991; Rhee 1989; van Lint
1992). We will show how to turn regular place-transition nets into error-correcting Petri
nets (EC nets), i.e., nets in which reachable markings are words of an error-correcting code.
This done, telling reachable markings from non-reachable ones becomes as straightforward
as checking whether a marking is a solution of a linear equation. If an observed marking
turns out to be a non-reachable one, a fast error-correction algorithm computes the (only)
reachable marking closest the faulty one, so that the erroneous situation can be corrected in
the most economical way. As our algorithms require working over nite elds, error
correction will be carried out modulo a prime p. This limitation does not place unac-
ceptable constraints on applications because a large enough prime can always be chosen.
Overall, our methodology can be sketched as follows. Let place-transition net N rep-
resent real-world system S, which we want to monitor, and let N be the EC Petri net
associated to N. As we will see, N is obtained by adding a number of control places to N,
and connecting them to the existing transitions so that the reachable markings of N will be
far apart points of V
n
, the linear space the of (all) markings of N. The proper scattering
of reachable markings over V
n
is achieved by means of a linear error-correcting code that
corrects t errors. This way, the distortion of t components of a reachable marking of N will
never lead to an other reachable marking of N: This construction has two useful conse-
quences. In the rst place, checking whether a marking is a reachable one is as straight-
forward as verifying whether the marking vector is a solution of a linear homogeneous
equation. Secondly, if the latter is not the case, the unique reachable marking of N closest
to the non-reachable one can be easily computed via the codes error-correction algorithm.
For this monitoring system to work, the control places of N must be implemented in S
e.g., as modulo p counters integrated in system S in accordance to the causal structure of N:
With the monitoring system in place, at chosen times, error control will take place: the
current marking will be assessed, checked for reachability, and if necessary corrected.
In this paper we apply modulo p Hamming codes, which are optimal codes for the
correction of single errors, but any other linear error-correcting code may be applied instead.
The core of this paper consists of two parts: Sect. 2in which we formally introduce
EC nets, with their properties and algorithmsand Sect. 3in which we work out a
didactical example in full detail. We assume readers to be familiar with the basic notions of
Petri net theory, but shall introduce the required notions of coding theory.
2 Error-correcting Petri nets
Error correcting Petri nets allow for the algebraic detection of unreachable markings, and
their correction to the closest reachable one. This is achieved by extending ordinary Petri
nets by a number of control places in a way that turns reachable markings into the words of
712 A. Pagnoni
1 3
a linear error-correcting code. In this paper we apply this approach to bounded place-
transition nets, but it is easy to see how to extend it to any class of bounded Petri nets. This
approach was rst introduced by the author Pagnoni (1996) to provide for modulo-2 error-
correction in condition-event nets in 1996.
Coding theory (van Lint 1992) provides a substantial array of linear codes with fast
coding/decoding algorithms for the correction of errors in vectors over nite elds. In
particular, BCH codes allow for the correction of any number of errors in such vectors
(Rhee 1989). Linear error-correcting codes work by extending the vectors to be protected
by a number of so-called control components, which are linearly dependent from the
original ones in a way that makes error detection and correction possible.
Two crucial steps when applying error-correcting codes consist in (a) assessing the
maximum number of wrongly marked entries to be expected in a vector, and (b) chosing a
prime number p, modulo which error correction will be performed. As to be expected,
handling a larger number of errors requires more control components, and therefore comes
to a computational cost. The same holds true for the choice of prime p, the error correction
modulo. Again the trade-off is between the possibility of handling a wider range of
errorsusing a larger pand a lighter computational burden.
In this paper we will assume a single-error scenariomeaning that non-reachable
markings to have one wrongly marked component at mostand apply Hamming codes
over Z
p
, the eld of rest classes modulo prime p.
In the next subsection we introduce linear codes over Z
p
; and, in particular, Hamming
codes over Z
p
. Readers already familiar with these topics can skip directly to Subsect. 2.3.
2.1 Linear error-correcting codes over eld Z
p
Let p be a prime, Z
p
the eld of modulo p rest classes, and 1
n
the n-dimensional linear
space dened over Z
p
equipped with its canonical basis. Agreeing on a specic basis for 1
n
is necessary in order to represent the points of 1
n
as vectors.
We will denote matrices with capital letters, but vectorsthat is, n 9 1 matriceswith
bold lowercase letters. The transpose of matrix A and vector a will be denoted as A
T
and
a
T
; respectively.
In order to turn a linear space into an error-correcting code we must equip it with a
metric. In this paper, we are going to apply Hamming codes, which are based on the
so-called Hamming distance. This distance is very well suited for modeling white-noise
errorsthat is, random errors at well-identied system nodes. The applicability of other
metrics to our operational contex is a quite interesting problem that lies, however, beyond
the scope of this paper.
Denition 1 Let h and n be positive integers, with h \n. We will call any non-trivial
h-dimensional linear subspace of 1
n
an h -dimensional linear code of order n over Z
p
, and
denote it as /(n; h). The elements of a linear code will be called (code) words.
Denition 2 Let x and y be two words of a linear code. We will call Hamming distance
between x and ydenoted as d
H
(x; y)the number of components in which vectors x and
y differ modulo p, that is
\x; y /(n; h) : d
H
(x; y) = cardi [ x(i) ,= y(i)
Denition 3 The Hamming distance of linear code /(n; h)denoted as d
H
(/)is the
minimum Hamming distance between two different code words, that is
Error-correcting Petri nets 713
1 3
d
H
(/) = min d
H
(x; y) [ x; y /(n; h) . x ,= y
It is easy to verify that the Hamming distance satises the axioms of a distance function:
d
H
(x; y) _0
d
H
(x; y) = d
H
(y; x)
d
H
(x; x) = 0
Denition 4 We say that /(n; h) corrects t (t C 1) errors if for any two code words x; y
with x ,= y; and any vector x
/
1
n
d
H
(x; x
/
) _t d
H
(x
/
; y) [t
Theorem 1 Linear code /(n; h) corrects t errors if, and only if, d
H
(/) [2t:
Proof Let the Hamming distance of linear code /(n; h) be d
H
(/) = d:
(1) We will prove that if d B 2t, linear code /(n; h) does not correct t errors. Let
x; y /(n; h) such that d
H
(x; y) = d: We have two possibilities: (a) d \t ? 1, and
(b) t ? 1 B d B 2t. If (a) holds, by changing the d components in which x differs
from y to the corresponding components of y we transform word x into code word y.
This erroneous distortion of d components of x is undetectable because it transforms a
code word into a code word. Cosider now case (b). Here by changing the rst t
components in which x differs from y to the corresponding components of y, we
obtain a message x
/
that differs in d - t B 2t - t = t components from code word y.
Again, this erroneous distortion, though detectable, cannot be corrected, as message
x
/
has the same Hamming distance from code word x from code word y. Also, by the
above denition, /(n; h) does not correct t errors.
(2) We will prove that if d [2t, linear code /(n; h) corrects t errors. Let x be a code
word and x
/
1
n
such that d
H
(x; x
/
) _t. For any code word y the triangular
inequality yields
d(x; x
/
) d(x
/
; y) _d(x; y) _d
H
(/) _2t 1
d(x
/
; y) _2t 1 d(x; x
/
) [2t 1 (t 1) [t h
Coding theory provides us with a rich choice of error-correcting codes with fast error
coding/decoding algorithms. A major result are BCH (Bose, Chaudhuri, Hocquenghem)
codes (Adamek 1991), that allow for the fast and elegant correction of any number of
errors in vectors over nite elds.
Any linear error-correcting code can be used to dene a class of EC nets, without any
methodological changes. As said, here we are going to use Hamming codes over eld Z
p

a widely applied family of BCH codes for the correction of single errors. Hamming codes
are optimal codes: the number of control components they require is minimal (Rhee 1989),
and grows logarithmically with the length of vectors.
The theory of linear spaces (Mac Lane and Birkoff 1979) yields the following
proposition.
Proposition 1 The words of linear code /(n; h) are the solutions of a homogeneous
linear system
Hx = 0
714 A. Pagnoni
1 3
where H is a (n - h) 9 n matrix of maximal rank over Z
p
, and x = [x
1
; x
2
; :::; x
n
[
T
:
Moreover, among the n components of x, h are linearly independent, and k = n - h
linearly dependent.
Notice that as more than one of the (n - h) 9 (n - h) submatrices of M can be non-
singular, there can be several sets of h linearly independent components of x.
As code words are dened over Z
p
, the h linearly independent components of a vector
can assume h
p
different congurations, that can be used to store information. In EC Petri
nets we will use them to represent the markings of the original Petri net.
The above proposition can be used to check wether a vector is a code word. Therefore,
we have
Denition 5 Equation
Hx = s (1)
will be called the decoding equation, and matrix H the parity check matrix of linear code
/(n; h): Vector s will be called the syndrome of vector x.
Remark 1 By the above proposition, vector x is a code word if, and only if, its syndrome
is the null vector.
Without loss of generality we can assume the rst h components of code word
x = x
1
; x
2
; :::; x
n
[ [
T
to be the linarly independent ones, or equivalently, matrix H to have the
following form
H = A [ I
nh
[ [
where I
n-h
is the identity matrix of order n-h.
Denition 6 A linear code will be called systematic if its parity check matrix has the
above (systematic) form.
Denition 7 We will call any matrix, the rows of which are the elements of the basis of
/(n; h), the generator matrix of linear code /(n; h).
The following theorem allows us to compute the generator matrix of a systematic code
easily.
Theorem 2 If H = A [ I
nh
[ [ is the (n - h) 9 n parity check matrix of linear code
/(n; h), the corresponding generator matrix is G = I
h
[ A
T
[ [; and vice versa.
Proof By Gaussian diagonalization of linear homogeneous system Hx = 0 matrix H can
be brought in explicit formthat is, in a form that expresses each one of its n variables
both dependent and independent onesas a linear combination of the h independent
variables. Having assumed code /(n; h) to be systematicthat is, x
1
, x
2
, ..., x
h
to be the
independent components of xits generator matrix will be a h 9 n matrix of type
G = I
h
[ B [ [
with B a h 9 (n - h) matrix, and every code word x will be such that
x
T
= x
1
x
2
::: x
n
[ [ = x
1
x
2
::: x
h
[ [ I
h
[ B [ [
Hence
Error-correcting Petri nets 715
1 3
Hx = A [ I
nh
[ [x = A [ I
nh
[ [ x
1
x
2
::: x
h
[ [ I
h
[ B [ [ ( )
T
= A [ I
nh
[ [ I
h
[ B [ [
T
x
1
x
2
::: x
h
[ [
T
= A B
T

x
1
x
2
::: x
h
[ [
T
which equals zero identically if, and only if, A = -B
T
. h
Denition 8 Equation
x
T
= x
1
x
2
::: x
h
[ [G (2)
will be called the coding equation of linear code /(n; h).
We are now prepared to introduce Hamming codes over Z
p
, a generalization of binary
Hamming codes. As mentioned above, these codes detect and correct single errors modulo
a chosen prime p. They work under the assumption that at most one component per code
word has been distorted. Multiplication of a vector with the codes parity check matrix will
assess whether it is a correct code word, or a distorted one, and if so, how to correct it.
Denition 9 Linear code H(n; h) is called a Hamming code over Z
p
or, simply, a
Hamming codeif the columns of its parity matrix, H
1
, H
2
, ..., H
n
, are (n - h)-tuples over
Z
p
such that
(i) \i(i = 1; :::; n) : H
i
,= 0 mod p
(ii) \i; j(i; j = 1; :::; n) : i ,= j H
i
H
j
= 0 mod p:
Denition 10 Hamming codes over Z
2
are called binary Hamming codes.
Denition 11 H(n; h) is called an ordinary Hamming code if H
1
; H
2
; :::; H
n
is a
maximal set of (n - h)-tuples over Z
p
satisfying conditions (i) and (ii) in Denition 1.
Otherwise, H(n; h) is called a shortened Hamming code.
An easy way to write the parity check matrix of a Hamming code over Z
p
is to chose for
its columns the modulo p representation of n subsequent natural numbers, with the extra
provision that the most signicant component of their representation be 1.
Without loss of generality, we can assume the last n - h columns of the parity check
matrix of H(n; h) to contain the identity matrix I
n - h
, that is, the Hamming code to be
systematic (cfr. above denition.) With this choice, the control components of code words
will be the last n - h entries of code words, and the information components the rst h
ones.
Remark 2 As there are p
k1
p
k2
p
1
1 non-null, linearly independent k-
tuples over Z
p
having leading entry equal to 1, we have
n =p
k1
p
k2
p
1
1
h =p
k1
p
k2
p
1
1 k
which shows that the number of information components grows exponentially with the
number of control components. For EC Petri nets, this means that the number of control
places necessary to be added to a place-transition net in order to achieve error correction,
will decreases very rapidly with the size of the original net.
Depending on the number of places in the place-transition net to be controlled, short-
ened Hamming codes may be applied, for which
716 A. Pagnoni
1 3
n _p
k1
p
k2
p
1
1
h _p
k1
p
k2
p
1
1 k
Example 1 For p = 3 and k = 4, we get n = 3
3
? 3
2
? 3
1
? 1 = 40. Therefore, we can
chose among 40 possible columns for the parity check matrix of a Hamming code over Z
3
with 4 control components. With 4 control components, a Hamming code over Z
3
can have
words with up to 40 - 4 = 36 information components. For instance, for n = 15 we get
Hamming code H(15; 11), whose systematic parity check matrix is
H =
0 0 0 0 0 0 0 0 0 0 1 1 0 0 0
0 0 1 1 1 1 1 1 1 1 0 0 1 0 0
1 1 0 0 1 1 1 2 2 2 0 0 0 1 0
1 2 1 2 0 1 2 0 1 2 1 0 0 0 1
2
6
6
4
3
7
7
5
Code words will have 11 information componentsthe rst 11 entries of code wordsand
4 control componentsthe last 4 entries.
The fast and elegant error correction algorithm of Hamming codes is based on the
following theorem.
Theorem 3 The minimum distance of a Hamming code is 3.
Proof Let H denote the parity check matrix of Hamming code H(n; h), and H
i
(i = 1 ...,
n) its columns.
Let x; x
/
H(n; h) with x ,= x
/
; and assume per absurdum that d
H
(x; x
/
)\3: There are
two possibilities: either (1) d
H
(x; x
/
) = 1; or (2) d
H
(x; x
/
) = 2: If (1) holds true, then
x = x
/
0 0 ::: c
i
::: 0 [ [
T
mod p with c
i
,= 0
and therefore
Hx =Hx
/
H 0 0 ::: c
i
::: 0 [ [
T
= 0 c
i
H
i
,= 0
Hence, x , H(n; h); against our hypothesis.
If (2) holds true, then
x = x
/
0 ::: 0 c
i
0 ::: 0 c
j
0 ::: 0 [ [
T
mod p with c
i
; c
j
,= 0
and
Hx = Hx
/
H 0 ::: 0 c
i
0 ::: 0 c
j
0 ::: 0 [ [
T
= 0 H
i
H
j
,= 0
because the columns of H are pairwise distinct by denition. Hence, x , H(n; h); against
our hypothesis.
We have proven that d
H
(x; x
/
) _3: However, as by the denition of a Hamming code
three columns of H may sum up to zero, there are pairs of (correct) code words with
Hamming distance 3. Therefore, the minimum distance of a Hamming code is d
H
(H) = 3;
as we set out to prove. h
Corollary 1 Hamming codes correct single errors.
Remark 3 For a linear code to detect and correct single errors the Hamming distance
between a code word and a non-code word must be equal to 3 so that (a) by distorting one
component of a code word you do not get another code word, and (b) you do not get any
ambiguity about which the original code word was. With a minimum Hamming distance of
Error-correcting Petri nets 717
1 3
2, single errors would still get detected, but could not be corrected, because in this case the
same wrong vector can result by distorting two different (correct) code words.
2.2 Error-correction algorithm
The error-correction algorithm of Hamming codes over Z
p
assumes that code words can get
distorted in one of their components at most. The algorithm detects and corrects errors
modulo p. Recall that for x H(n; h) and y = x 0 0 ::: c
i
::: 0 [ [
T
mod p, with
c
i
= 0, x is a solution of the decoding equationHx = 0while y is not. This will be
used to perform error detection, while error correction relies on the fact that
Hy = Hx c
i
H 0 ::: 0 1 0 ::: 0 [ [
T
= 0 cH
i
= cH
i
mod p:
The error-correction algorithm consists of the following steps:
1. input vector y
2. compute Hy mod p
3. if Hy = 0 mod p, then y is a correct code word, else
4. Hy = cH
i
,= 0 mod p, and y is not a correct code wordan error is detected
5. correct y to the closest correct code word x = y 0 0 ::: c
i
::: 0 [ [
T
:
In the next section we will show how to apply this algorithm to monitor the behavior of
systems represented as place-transition nets.
2.3 Error-correcting place-transition nets
Let N = (P; T; C; m
0
) be a place-transition net, with P = {p
1
, p
2
, ..., p
h
} its set of places,
T = {t
1
, t
2
, ..., t
q
} its set of transitions, C = c
i;j

its incidence matrix, and m
0
=
m
0
1
m
0
2
::: m
0
h

T
its initial marking. Moreover, let p be a prime and H(n; h) a modulo-
p systematic Hamming code with parity check matrix H = A [ I
nh
[ [ and generator matrix
G = I
h
[ A
T
[ [.
Denition 12 The error-correcting (EC) net N associated to place-transition net N is the
Petri net N = (P; T; C; m
0
; p; H(n; h)) obtained from the original place-transition net N =
(P; T; C; m
0
) by
1. extending P to P by introducing k = n - h so-called control places
2. maintaining the same set of transitions of N
3. computing C = G
T
C mod p, the incidence matrix of N
4. connecting places and transitions of N with modulo-p labelled arcs as mandated by
Cold arcs will be the same, modulo p
5. computing m
0
= G
T
m
0
, the initial marking of Nold places will get the same
marking, modulo p
6. adopting the following ring rule. The ring of the transitions in N is triggered by the
ring of the correspondent transitions of N. When transition t res, mthe current
marking of net Ngets changed to the new marking m = mC
j
where C
j
is the
column of C corresponding to transition t.
Remark 4 Since C is dened over Z
p
arc orientation is superuous in N, but may be kept
for the sake of readability. Also, transitions of N are always enabled, though their ring
will depend on the corresponding original transition being able to re.
The error-correction capabilities of EC nets are based on the following two theorems.
718 A. Pagnoni
1 3
Theorem 4 Markings of EC net N which are reachable from initial marking m
0
are
words of the Hamming code H(n; h):
Proof We will prove that (1) the initial marking m
0
belongs to H(n; h), and (2) net
markings that are reachable from m
0
belong to H(n; h):
(1) By the denition of EC nets, m
0
is a word H(n; h). (2) For marking m to be reachable
from initial marking m
0
a ring sequence t
i
1
; t
i
2
; :::; t
i
s
must exist, such that
m = m
0
C
i
1
C
i
2
C
i
s
mod p (3)
where C
i
j
is the column of incidence matrix C corresponding to transition t
i
j
: By the
denition of EC nets, C = G
T
C mod p: Hence, every column of C is a linear combination
of the rows of G. Because the rows of generator matrix G form a basis of H(n; h), every
column of C is a code word, and because Hamming codes are linear codes, a sum of code
words is a code word. Therefore, m is a code word. h
Remark 5 Each reachable marking of a net N is a linear combination of the initial
marking m
0
and the columns C
j
of its incidence matrix C; but generally not vice versa: not
every linear combination is necessarily a reachable marking. Thus, the Hamming code
generally includes reachable and non-reachable markings.
Theorem 5 Markings of EC net N obtained by distorting one component of a reachable
marking do not belong to H(n; h):
Proof Hamming codes have a minimal distance of 3. As explained in Remark 1 the
Hamming distance between two different reachable markings of N is 3. In particular,
markings obtained by distorting one component of a reachable marking will have a
Hamming distance of 1 from a reachable one. That is, for every such marking y a reachable
marking m exists such that y = m 0 0 ::: c
i
::: 0 [ [
T
mod p with c
i
=0 mod p.
Hence
Hy = HmH 0 0 ::: c
i
::: 0 [ [
T
= 0 c
i
H
i
,= 0:
Hence, y , H(n; h): h
3 Hands-on EC Net construction: an example
We shall now demonstrate the error-correction capabilities of EC nets by working out a
handy example (courtesy of Monika Heiner). Consider place-transition net N, represented
in Fig. 1 at its initial marking.
The incidence matrix of N is
C =
1 1 0 0 0 0 0 0 1
1 1 1 0 0 0 0 0 0
0 0 1 1 1 0 0 0 0
0 0 0 1 1 0 0 1 0
0 0 1 0 0 1 1 0 0
0 0 0 0 0 1 1 1 0
0 0 0 0 0 0 0 1 1
2
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
5
with rows orderly associated to places p
1
, p
2
, ..., p
7
, and columns to transitions t
1
, t
2
, ..., t
9
.
Error-correcting Petri nets 719
1 3
Let the initial marking of N be m
0
= 4 0 0 0 0 1 0 [ [
T
, and let p = 3. In order
to achieve the wanted error correction capabilityi.e., the modulo 3 detection and cor-
rection of one wrongly marked place per net markingwe have to dene the parameters of
our systematic Hamming code. To this end, the k control places we are going to add to the
7 original ones must be such that their 3
k
possible markings are numerous enough to
discriminate between 2(k ? 7) possible error situationsthat is, one out of the total k ? 7
places wrongly marked, with 2 possible errors eachplus the (single) situation of cor-
rectness. Notice that there are two possible errors per place, because place markings over
Z
3
can be 0, 1 or 2. Hence
3
k
_2(k 7) 1 = 2k 15
The smallest k satisfying this inequality is k = 3. Therefore, we will use the systematic
Hamming code H(10; 7): N will have a total of 10 placesthe 7 original places ones, p
1
,
..., p
7
, plus three new control places, p
8
, p
9
, p
10
. The transitions of N will be the nine
original transitions of N, t
1
, ..., t
9
.
To compute the incidence matrix C and the initial marking m
0
of EC net N, we need the
parity check matrix of the associated Hamming code.
As the number of places to be controlled is 10, we will use a systematic Hamming code
of order 10. Its parity matrix is the 3 9 10 matrix H = A [ I
3
[ [ the rst 7 columns of which
are 3-digit modulo 3 representations of 7 subsequent non-zero natural numbers with
leading digit equal to 1, that is
H =
0 0 1 1 1 1 1 1 0 0
1 1 0 0 1 1 1 0 1 0
1 2 1 2 0 1 2 0 0 1
2
4
3
5
By theorem 2 the corresponding generator matrix is
p1
4
p2
p3
p4
p5 p6
p7
t1
t2
t4
t5
t6
t7
t9
t3
t8
Fig. 1 Net N at its initial marking
720 A. Pagnoni
1 3
G = I
7
[ A
T

=
1 0 0 0 0 0 0 0 2 2
0 1 0 0 0 0 0 0 2 1
0 0 1 0 0 0 0 2 0 2
0 0 0 1 0 0 0 2 0 1
0 0 0 0 1 0 0 2 2 0
0 0 0 0 0 1 0 2 2 2
0 0 0 0 0 0 1 2 2 1
2
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
5
mod 3
We dened the incidence matrix of EC net N as C = G
T
C mod 3. Therefore
C =
1 0 0 0 0 0 0 0 2 2
0 1 0 0 0 0 0 0 2 1
0 0 1 0 0 0 0 2 0 2
0 0 0 1 0 0 0 2 0 1
0 0 0 0 1 0 0 2 2 0
0 0 0 0 0 1 0 2 2 2
0 0 0 0 0 0 1 2 2 1
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
5
T
1 1 0 0 0 0 0 0 1
1 1 1 0 0 0 0 0 0
0 0 1 1 1 0 0 0 0
0 0 0 1 1 0 0 1 0
0 0 1 0 0 1 1 0 0
0 0 0 0 0 1 1 1 0
0 0 0 0 0 0 0 1 1
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
5
mod 3
C =
2 1 0 0 0 0 0 0 1
1 2 2 0 0 0 0 0 0
0 0 1 2 1 0 0 0 0
0 0 0 1 2 0 0 2 0
0 0 2 0 0 2 1 0 0
0 0 0 0 0 1 2 1 0
0 0 0 0 0 0 0 1 2
0 0 0 0 0 0 0 2 1
0 0 2 0 0 0 0 1 0
2 1 1 2 1 2 1 2 1
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
5
mod 3
By denition, the initial marking of EC net N will be
m
0
= G
T
m
0
Error-correcting Petri nets 721
1 3
m
0
=
1 0 0 0 0 0 0 0 2 2
0 1 0 0 0 0 0 0 2 1
0 0 1 0 0 0 0 2 0 2
0 0 0 1 0 0 0 2 0 1
0 0 0 0 1 0 0 2 2 0
0 0 0 0 0 1 0 2 2 2
0 0 0 0 0 0 1 2 2 1
2
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
5
T
4
0
0
0
0
1
0
2
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
5
mod 3 =
1
0
0
0
0
1
0
2
1
1
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
5
Figure 2 represents control net N at its initial marking m
0
. For the sake of readability,
we kept the arcs belonging to original place-transition net N in their original, oriented
form.
By denition, the ring of transitions of N is triggered by the correspondent rings in N.
Suppose now that in N transition sequence t
1
, t
7
, t
3
enabled at initial marking m
0
res,
turning m
0
into the following marking m
m = m
0
C
1
C
7
C
3
mod 3
m =
4
0
0
0
0
1
0
2
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
5

1
1
0
0
0
0
0
2
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
5

0
0
0
0
1
1
0
2
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
5

0
1
1
0
1
0
0
2
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
5
mod 3 =
0
0
1
0
0
0
0
2
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
5
mod 3
The EC net marking corresponding to m is m = G
T
m, or
t1
t2
t4
t5
t6
t7
t9
t3 t8
p1
p2
p3
p4
p5 p6
p7
p8
p10
p9
2
2
2
2
2
2
Fig. 2 Error-correcting net N at its initial marking
722 A. Pagnoni
1 3
m =
1 0 0 0 0 0 0 0 2 2
0 1 0 0 0 0 0 0 2 1
0 0 1 0 0 0 0 2 0 2
0 0 0 1 0 0 0 2 0 1
0 0 0 0 1 0 0 2 2 0
0 0 0 0 0 1 0 2 2 2
0 0 0 0 0 0 1 2 2 1
2
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
5
T
0
0
1
0
0
0
0
2
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
5
mod 3 =
0
0
1
0
0
0
0
2
0
2
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
5
mod 3
The same result can be obtained by ring the same transition sequence, t
1
; t
7
; t
3
( ), in N
directly
m = m
0
C
1
C
7
C
3
=
1
0
0
0
0
1
0
2
1
1
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
5

2
1
0
0
0
0
0
0
0
2
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
5

0
0
0
0
1
2
0
0
0
1
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
5

0
2
1
0
2
0
0
0
2
1
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
5
mod 3 =
0
0
1
0
0
0
0
2
0
2
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
5
mod 3
As expected
Hm =
0 0 1 1 1 1 1 1 0 0
1 1 0 0 1 1 1 0 1 0
1 2 1 2 0 1 2 0 0 1
2
4
3
5
0
0
1
0
0
0
0
2
0
2
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
5
mod 3 = 0 mod 3
On the contrary, suppose that something went wrong in the implemented systeme.g.,
a mutation occurredso that after the ring of transition sequence t
1
; t
7
; t
3
( ) the observed
system state is not represented by marking
m = 0 0 1 0 0 0 0 2 0 2 [ [
T
but by wrong marking
w = 0 0 1 2 0 0 0 2 0 2 [ [
T
As we can see, the fourth component of m has been corrupted, and has a 2 unit
difference from its right value.
w is wrong in the sense that this marking cannot be reached from the initial marking
of net N. We know this to be true because the reachable markings of N are code words of
H(10; 7), a linear code with minimal distance is 3. Having Hamming distance 1 from
reachable marking m; w cannot be a reachable marking.
Error-correcting Petri nets 723
1 3
In general, the only way to nd out that w is a non-reachable marking of a Petri net is to
construct and search the nets reachability graph. In an EC net, the reachability status of
marking w can be assessed right away, by a simple multiplication:
Hw =
0 0 1 1 1 1 1 1 0 0
1 1 0 0 1 1 1 0 1 0
1 2 1 2 0 1 2 0 0 1
2
4
3
5
0
0
1
2
0
0
0
2
0
2
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
4
3
7
7
7
7
7
7
7
7
7
7
7
7
7
7
5
mod 3 =
2
0
1
2
4
3
5
mod 3
= 2
1
0
2
2
4
3
5
mod 3 = 2H
4
,= 0
where H
4
denotes the fourth column of H. We found that w is a not a reachable marking of
N, because Hw ,= 0: And, we know that the reachable marking closest to w can be easily
computed by subtracting 2, modulo 3, from the forth component of w. As expected, this
returns correcti.e., reachablemarking m:
4 Final remarks
ECnets are designed for the modulo-p correction of single errors in observed markings. With
no methodological change, it is possible to design ECnets for the correction of any number of
errors. To this end one just needs to substitute a suitable BCH code (van Lint 1992) for the
Hamming code we applied. As to be expected, this added capability will come to a com-
putational price: the number of control places to be added will growwith the number of errors
to be corrected. Fortunately, BCH codes offer very fast detection/correction algorithms.
The beauty of Hamming codes, which made them one of the most applied error-
correction codes, lies in the simplicity of their algorithms, and in the fact that the number
of control components to be added grows only logarithmically with the number of infor-
mation components to be protected. In Petri net terms: the larger the original place-
transition net, the smaller the number of control places to be added. The following table
lists the number of control places required to perform modulo-3 single-error correction on
place-transition nets having h net places.
k
h =
P
k
i=1
3
ki
3
3 10
4 37
5 118
10 29.521 9 10
3
15 7.174450 9 10
6
50 ~3:58 10
23
724 A. Pagnoni
1 3
Acknowledgements The author thanks collegue and friend Monika Heiner for the motivation to write this
paper, and for her insightful revision of it. Theorem 5 benetted from her intervention particularly. The Petri
nets in this paper have been drawn with Snoopy 2.0, courtesy of the Brandenburg University of Technology.
Our thanks also go to two anonimous referees, who helped us with useful suggestions and necessary
corrections. This work has been nancially supported by FIRST (Fondo Italiano per la Ricerca Scientica e
Technologica).
References
Adamek J (1991) Foundations of coding. Wiley, Chichester-New York
de Lorenzo V et al (2006) Synthetic biology: challenges ahead. Bioinformatics 22(2):127128
Heinemann M, Panke S (2006) Synthetic biologyputting engineering into biology. Bioinformatics
22(22):27902799
Mac Lane S, Birkoff G (1979) Algebra. MacMillan Publishing Co., Collier MacMillan Publishers,
New York, London
Mayr EV, Meyer AR (1981) The complexity of the nal containment problem for Petri nets. J ACM, 3
Pagnoni A (1996) Detecting and correcting operation errors in distributed systems. Bull Eur Assoc Theoret
Comput Sci 58
Rhee MY (1989) Error-correcting coding theory. McGraw-Hill, New York
Reisig W, Rozenberg G (eds) (1989) Lectures on Petri nets I. Springer-Verlag, Berlin-Heidelberg
van Lint JH (1992) Introduction to coding theory. Springer-Verlag, Berlin-Heidelberg
Error-correcting Petri nets 725
1 3

You might also like