Theory of Concurrency

Theory of Concurrency
Spring 2017
http://liacs.leidenuniv.nl/∼kleijnhcm/thvc1-1617.html
Seventh lecture: April 4
Conclude Chapter 6. Processes
7. Comparison of Partial and Linear Order
third exercise class April 11, 2017
all exercises for Chapters 6 and 7
April 18: Intermediate Test
9. P/T Systems
Eighth and ninth lecture: 25 April and 2 May 2017
Fourth exercise class, Results of Test, May 9 and ???
Exam June 8, 2017
1
7. Comparison of Linear and Partial Order
First (Thm 115): M and M ′ contact-free EN systems.
If LPO(M ) ≡ LPO(M ′) then FS(M ) = FS(M ′).
p v3
e
f
p v5
v1
v4
c v2
e
v6
Fig. 66. An acyclic labelled graph.
2
Definition 110. A topological order of an acyclic labelled graph
G = (V, Γ, Σ, φ) is a sequence u1 · · · un ∈ V ∗,
with ui ∈ V for 1 ≤ i ≤ n, and
(1) all ui are distinct,
(2) V = {u1, . . . , un}, and
(3) for all 1 ≤ i, j ≤ n, if (ui, uj ) ∈ Γ, then i < j.
top(G) is the set of all topological orders of G.
φ(u1) · · · φ(un ) ∈ Σ∗ with u1 · · · un ∈ top(G) is a word of G.
words(G) = {φ(u1) · · · φ(un ) | u1 · · · un ∈ top(G)}.
3
p v3
e
f
p v5
v1
c v2
v4
e
v6
Fig. 66. An acyclic labelled graph.
Examples of topological orders:
v3v1v4v2v6v5 gives word pef cep
v1v2v3v4v5v6 gives word ecpf pe
Not a topological order:
v3 v4 v6 v4 v1
v3 v4 v1 v2 v6 v5
4
Lemma 111. Let G and G′ be acyclic labelled graphs.
If tra(G) = tra(G′), then
top(G) = top(G′) and words(G) = words(G′).
Exercise:
Show that for every acyclic graph G,
top(G) = top(tra(G))
5
Lemma 113. Let N = (P, T, F, ◦N ) be a process net, C ⊆ P ,
and t1, . . . , tn ∈ T .
Then ◦N [t1 · · · tniC
iff
(1) all ti are distinct,
(2) →C ∩ T = {t1, . . . , tn},
(3) for all 1 ≤ i, j ≤ n,
if (ti, tj ) ∈ F + , then i < j, and
(4) C is a slice.
6
bf
p1
c1
p
e
be
p2
c2
c
f
bf
p1
c1
p
e
be
p2
c2
7
Theorem 112.
t1, . . . , tn ∈ T .
Let N = (P, T, F ) be a process net and let
Then ◦N [t1 · · · tniN ◦
iff
(1) all ti are distinct,
(2) T = {t1, . . . , tn }, and
(3) for all 1 ≤ i, j ≤ n,
if (ti, tj ) ∈ F + , then i < j.
8
Theorem 114. Let M be a contact-free EN system. Then
FS(M ) =
S
{words(G) | G ∈ LPO(M )}.
Theorem 115. Let M and M ′ be two contact-free EN systems
and let β be a bijection from use(TM ) to use(TM ′ ).
If LPO(M ) ≡β LPO(M ′) then β(FS(M )) = FS(M ′).
9
Theorem 107. Let M be a contact-free EN system and let
N, N ′ be two processes of M .
Let α be the identity on PM and β the identity on use(TM ).
′
′
N ≡α
β N iff pru(ctr(N )) ≡β pru(ctr(N )).
Proof
Only-if direction: both ctr and pru preserve isomorphism.
If-direction:
Construct N from one of its words (a firing sequence).
10
Theorem 115. Let M and M ′ be two contact-free EN systems
and let β be a bijection from use(TM ) to use(TM ′ ).
If LPO(M ) ≡β LPO(M ′) then β(FS(M )) = FS(M ′).
Next (Thm 125):
M and M ′ contact-free EN systems.
If β(FS(M )) = FS(M ′) then LPO(M ) ≡ LPO(M ′).
11
Definition 116. Let Σ be an alphabet.
A relation I ⊆ Σ × Σ is an independency relation (over Σ)
if I is irreflexive and symmetric.
Definition 119. Let Σ be an alphabet and I an independency
relation over Σ.
Let x = t1 · · · tn ∈ Σ∗, with n ≥ 0 and t1, . . . , tn ∈ Σ.
(1) The dependency graph of x (over I), denoted by depI (x), is
the labelled graph (V, Γ, Σ, φ), where
V = {v1, . . . , vn},
φ(vi) = ti for all 1 ≤ i ≤ n, and,
for all 1 ≤ i, j ≤ n,
(vi, vj ) ∈ Γ iff i < j and (ti , tj ) ∈
/ I.
(2) The pruned dependency graph of x (over I) is pru(depI (x)).
12
v1
e
v2
c
v1
e
v2
c
v3
p
v3
p
v4
f
v4
f
v5
p
v5
p
v6
e
v6
e
Fig. 67. A dependency graph.
Fig. 68. A pruned dependency graph.
13
Definition 117. Let M = (P, T, F, Cin) be an EN system.
(1) The independency relation of M is the independency relation
ind(M ) over use(T ) defined by
ind(M ) = {(s, t) ∈ T × T | s 6= t and ∃C ∈ CM : {s, t} con C}.
(2) The dependency relation of M is the relation dep(M ) defined
by dep(M ) = (use(T ) × use(T )) − ind(M ).
14
ind(M ) = {(s, t) ∈ T × T | s 6= t and ∃C ∈ CM : {s, t} con C}
Lemma 118. Let M = (P, T, F, Cin) be an EN system. Then
ind(M ) =
{(s, t) ∈ T × T | ∃x ∈ T ∗ : xst ∈ FS(M ) and xts ∈ FS(M )}.
15
Theorem 122. Let N = (P, T, F, φ1, φ2) be a process of a
contact-free EN system M and let ◦N [s1 · · · sniN ◦.
Let β be the identity on use(TM ).
Then pru(ctr(N )) ≡β pru(depM (φ(s1) · · · φ(sn ))).
Theorem 123. Let M be a contact-free EN system, and
let β be the identity on use(TM ).
Then LPO(M ) ≡β {pru(depM (x)) | x ∈ FS(M )}.
16
bf
p1
c1
p
e
be
p2
c2
c
f
bf
p1
c1
p
e
be
p2
c2
17
p
e
f
c
p
e
or
p
e
c
f
p
e
Fig. 62. Pruned/contracted version.
18
v1
e
v2
v3
p
c
v4
f
v5
p
v6
e
Fig. 68. A pruned dependency graph.
p v3
e
f
p v5
v1
v4
c v2
e
v6
Fig. 66. An acyclic labelled graph.
Example of topological order:
v1v2v3v4v5v6 gives word ecpf pe
19
Lemma 124. Let M and M ′ be EN systems and
let β : use(TM ) → use(TM ′ ) be a bijection.
If β(FS(M )) = FS(M ′) then
{pru(depM (x)) | x ∈ FS(M )} ≡β {pru(depM ′ (x)) | x ∈ FS(M ′)}.
Theorem 125. Let M and M ′ be two contact-free EN systems
and let β : use(TM ) → use(TM ′ ) be a bijection.
If β(FS(M )) = FS(M ′) then LPO(M ) ≡β LPO(M ′).
20
Theorem 126. Two contact-free EN systems are lpo-equivalent
iff they are firing sequence equivalent.
Corollary 127. If two contact-free EN systems are configuration
equivalent, then they are lpo-equivalent.
Corollary 128. There is an algorithm that, for two arbitrary
contact-free EN systems M and M ′, decides whether or not M
and M ′ are lpo-equivalent.
21
a
b
c
M
a
a
b
c
M′
Fig. 69. Two labelled EN systems M and M ′ that are
lpo-equivalent but not weakly configuration equivalent.
22
a
b
a
b
b
a
M
M′
Fig. 70. Two labelled EN systems M and M ′ that are
configuration equivalent but not lpo-equivalent.
23
7.2 Equivalence of firing sequences
Definition 129. Let M be a contact-free EN system and let
x, x′ ∈ FS(M ).
Then x and x′ are lpo-equivalent, x ≈lpo x′,
∗
if there exist a process N of M and two firing sequences y, y ′ ∈ TN
such that
◦N [yiN ◦ , φ (y) = x, ◦N [y ′ iN ◦ , and φ (y ′ ) = x′ .
N
N
24
Theorem 130. Let M be a contact-free EN system and let
x, x′ ∈ FS(M ). Then
x ≈lpo x′ iff pru(depM (x)) ≡β pru(depM (x′)),
where β is the identity on use(TM ).
25
Definition 131. Let I be an independency relation over Σ.
.
The relation =I ⊆ Σ∗ × Σ∗ is defined as follows:
for x, y ∈ Σ∗,
.
x =I y iff there exist a, b ∈ Σ and x1, x2 ∈ Σ∗, such that
x = x1abx2, y = x1bax2, and (a, b) ∈ I.
The relation ≈I ⊆ Σ∗ × Σ∗ is then defined as the smallest equiv.
alence relation that contains =I .
If x ≈I y then x and y are trace equivalent (over I).
[x]I denotes the equivalence class of ≈I (trace) that contains x.
26
Lemma 132. Let I be an independency relation over Σ, and let
x, y ∈ Σ∗.
(1) x ≈I y iff there exist n ≥ 0 and x0, . . . , xn ∈ Σ∗ such that
.
x0 = x, xn = y, and xi−1 =I xi for all 1 ≤ i ≤ n.
(2) x ≈I y implies |x| = |y|.
27
Lemma 133. Let G = (V, Γ, Σ, φ) be an acyclic graph. Let
J ⊆ V × V be the independency relation (of G) defined by:
for all u, w ∈ V , (u, w) ∈ J iff u 6= w, (u, w) ∈
/ Γ, and (w, u) ∈
/ Γ.
Then, for every topological order u1 · · · un of G,
top(G) = {w1 · · · wn ∈ V ∗ | u1 · · · un ≈J w1 · · · wn}. *
Theorem 134. Let I be an independency relation over Σ, and
x ∈ Σ∗.
Then [x]I = words(depI (x)). *
28
Theorem 135. Let I be an independency relation over Σ, and
let x, y ∈ Σ∗. Then the following four statements are equivalent.
(1) x ≈I y,
(2) [x]I = [y]I ,
(3) depI (x) ≡β depI (y),
(4) pru(depI (x)) ≡β pru(depI (y)), where β is the identity on Σ.
29
Theorem 136. Let M be a contact-free EN system and
x, x′ ∈ FS(M ). Then x ≈lpo x′ iff x ≈ind(M ) x′.
A trace language (over an independency relation I) is a set of
equivalence classes of ≈I .
TR(M ) = {[x]ind(M ) | x ∈ FS(M )}, i.e., the language FS(M ) in
which trace equivalent words are grouped together.
Trace equivalence coincides with lpo-equivalence.
30