Analysis of Distributed Systems

Analysis of
Distributed
Systems
Máté Tejfel
Lecture 10
Analysis of Distributed Systems
Lecture 10 - Labelled Transition Systems
Máté Tejfel
Analysis of
Distributed
Systems
Labelled Transition Systems
Máté Tejfel
Lecture 10
Definition 1 (Labelled Transition System)
A Labelled Transition System is a triple (C , A, →), where
• C is a set of configurations (states),
• A is a set of actions, and
• → is a transition relation (→ ⊆ C × A × C )
Notations
a
• c → c 0 : < c, a, c 0 >∈→
a
• ∀a ∈ A : → = {(c, c 0 )| < c, a, c 0 >∈→}
a
• c → c 0 : ∃a ∈ A : c → c 0
a
a
• c → : ∃c 0 ∈ C : c → c 0
• c 6→: 6 ∃c 0 ∈ C : c → c 0
• →∗ ⊆ C × A∗ × C is the transitive closure of →
Analysis of
Distributed
Systems
Labelled Transition Systems
Máté Tejfel
Lecture 10
An example.
A is an arbitrary set.
Definition of C is inductive:
• nil ∈ C ,
• ap ∈ C , if a ∈ A, p ∈ C ,
• p + q ∈ C , if p, q ∈ C ,
• C is the smallest set satisfying the previous 3 rules.
Definition of → is also inductive:
a
• ap → p, where a ∈ A, p ∈ C ,
a
•
p → p0
a
p+q → p 0
•
p → p0
a
q+p → p 0
a
, where a ∈ A, p, q, p 0 ∈ C ,
, where a ∈ A, p, q, p 0 ∈ C ,
• → is the smallest set satisfying the previous 3 rules.
Analysis of
Distributed
Systems
Labelled Transition Systems
Máté Tejfel
Lecture 10
Semantics
• Operational semantics
• consider the meaning of program steps
• useful for implementation
• Denotational semantics
• consider the program as a whole
• from parts to complete (useful for program synthesis)
• Axiomatic semantics
• basic properties of the program
• useful for verification
Analysis of
Distributed
Systems
LTS operational semantics
Máté Tejfel
Lecture 10
Consider the process with its environment.
• (p, e) ∈ C × C
a
a
0
e0
• p||e : p → p a, e →
0
0
p||e → p ||e
Definition 2
The process p corresponds to an environment e (p sat e),
∗ 0
0 and p 0 ||e 0 6→
if and only if ∀p 0 , e 0 ∈ C : p||e → p e||e
.
0 =nil
(In every case the environment is reduceable into nil.)
Definition 3 (Equivalence in operational semantics)
Two processes p and q are equivalent according to the
operational semantics (p equo q), if and only if
∀e ∈ C : p sat e ⇔ q sat e
Analysis of
Distributed
Systems
LTS denotational semantics
Máté Tejfel
Lecture 10
Definition 4
τ : P → P(A∗ )
- τ (nil) = - ∀a ∈ A, p ∈ P : τ (ap) = aτ (p),
where aT = {at|t ∈ T } (T ⊆ A∗ )
every sequence which can be produced by ’p’ with an
additional ’a’ in the beginning
- ∀p, q ∈ P : τ (p + q) = τ (p) ∪ τ (q)
Definition 5 (Equivalence in denotational semantics)
Two processes p and q are equivalent according to the
denotational semantics (p equd q), if and only if τ (p) = τ (q)
Analysis of
Distributed
Systems
Relationship between different
semantics
Máté Tejfel
Lecture 10
Theorem 1
The operational and the denotational semantics of LTS are not
equivalent, ∃p, q ∈ P : (p equo q) 6⇔ (p equd q)
Proof.
∃p, q ∈ P : (p equd q) 6⇒ (p equo q) :
(a(p + q) equd ap + aq), but ¬(a(p + q) equo ap + aq),
(where a ∈ A, p, q ∈ P)
(a(p + q) equd ap + aq):
- τ (a(p + q)) = aτ (p + q) = a(τ (p) ∪ τ (q)) = aτ (p) ∪ aτ (q)
- τ (ap + aq) = τ (ap) ∪ τ (aq) = aτ (p) ∪ aτ (q)
Analysis of
Distributed
Systems
Máté Tejfel
Relationship between different
semantics
Lecture 10
¬(a(p + q) equo ap + aq) :
- let p = ap1 , and q = bq1 (where p1 , q1 ∈ P, b ∈ A, and
a 6= b),
- let e = aanil,
a
- a(p + q) sat e : (a(ap1 + bq1 ) || aanil) →
a
(ap1 + bq1 || anil) → (p1 || nil)
a
- ¬(ap + aq sat e) : aap1 + abq1 || aanil → bq1 || anil 6→
Analysis of
Distributed
Systems
Relationship between different
semantics
Máté Tejfel
Lecture 10
∃p, q ∈ P : (p equo q) 6⇒ (p equd q) :
- p equo (p + nil)
- p=
6 nil ⇒ ¬(p equd (p + nil)) :
– τ (p + nil) = τ (p) ∪ τ (nil) = τ (p) ∪ Analysis of
Distributed
Systems
LTS denotational semantics
(alternative version)
Máté Tejfel
Lecture 10
Definition 6
τ 0 : P → P(A∗ )
- τ 0 (nil) = - ∀a ∈ A, p ∈ P : τ 0 (ap) = aτ 0 (p) ∪ ,
- ∀p, q ∈ P : τ 0 (p + q) = τ 0 (p) ∪ τ 0 (q)
Note 1
τ 0 (p) is prefix closed.
Analysis of
Distributed
Systems
LTS denotational semantics
(alternative version)
Máté Tejfel
Lecture 10
Definition 7 (Equivalence in denotational semantics
(alternative version))
Two processes p and q are equivalent according to the modified
denotational semantics (p equ’d q), if and only if τ 0 (p) = τ 0 (q)
Theorem 2
∀p, q ∈ P : (p equo q) ⇒ (p equ’d q) :
Analysis of
Distributed
Systems
LTS axiomatic semantics
Máté Tejfel
Lecture 10
A1 p + (q + r ) = (p + q) + r
A2 p + q = q + p
A3 p + p = p
A4 p + nil = p
A5 a(p + q) = ap + aq
Definition 8 (Equivalence in axiomatic semantics)
Two processes p and q are equivalent according to the
axiomatic semantics (p equa q), if and only if p is
transformable to q using axioms A1-A5.
Analysis of
Distributed
Systems
Relationship between different
semantics
Máté Tejfel
Lecture 10
Theorem 3
∀p, q ∈ P : (p equa q) ⇔ (p equ’d q) :
Definition 9 (Weak equivalence in axiomatic semantics)
Two processes p and q are weak equivalent according to the
axiomatic semantics (p equ wa q), if and only if p is
transformable to q using axioms A1-A4.
Theorem 4
∀p, q ∈ P : (p equ wa q) ⇒ (p equo q) :
Note 2
∀a, b, c ∈ A : abnil + acnil equo (abnil + acnil) + a(bnil + cnil),
but ¬(abnil + acnil equ wa (abnil + acnil) + a(bnil + cnil))