Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace - - PowerPoint PPT Presentation

concurrency theory
SMART_READER_LITE
LIVE PREVIEW

Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace - - PowerPoint PPT Presentation

Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence Joost-Pieter Katoen and Thomas Noll Software Modeling and Verification Group RWTH Aachen University https://moves.rwth-aachen.de/teaching/ws-19-20/ct/ Introduction


slide-1
SLIDE 1

Concurrency Theory

Winter Semester 2019/20 Lecture 11: Trace Equivalence Joost-Pieter Katoen and Thomas Noll Software Modeling and Verification Group RWTH Aachen University

https://moves.rwth-aachen.de/teaching/ws-19-20/ct/

slide-2
SLIDE 2

Introduction Outline of Lecture 11 Introduction Preliminaries Requirements on Behavioural Equivalences Trace Equivalence Revisited Other Forms of Trace Equivalence Summary

2 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-3
SLIDE 3

Introduction Introduction

  • When using process algebras like CCS, an important approach is to model both the

specification and implementation as CCS processes, say Spec and Impl.

3 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-4
SLIDE 4

Introduction Introduction

  • When using process algebras like CCS, an important approach is to model both the

specification and implementation as CCS processes, say Spec and Impl.

  • This gives rise to the natural question: when are two CCS processes behaving the same?

3 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-5
SLIDE 5

Introduction Introduction

  • When using process algebras like CCS, an important approach is to model both the

specification and implementation as CCS processes, say Spec and Impl.

  • This gives rise to the natural question: when are two CCS processes behaving the same?
  • As there are many different interpretations of “behaving the same”, different behavioural

equivalences have emerged.

3 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-6
SLIDE 6

Introduction Behavioural Equivalence Implementation CM = coin.coffee.CM CS = pub.coin.coffee.CS Uni = (CM CS) \ {coin, coffee}

4 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-7
SLIDE 7

Introduction Behavioural Equivalence Implementation CM = coin.coffee.CM CS = pub.coin.coffee.CS Uni = (CM CS) \ {coin, coffee} Specification Spec = pub.Spec

4 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-8
SLIDE 8

Introduction Behavioural Equivalence Implementation CM = coin.coffee.CM CS = pub.coin.coffee.CS Uni = (CM CS) \ {coin, coffee} Specification Spec = pub.Spec Question Are the specification Spec and implementation Uni behaviourally equivalent: Spec

?

≡ Uni

4 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-9
SLIDE 9

Preliminaries Outline of Lecture 11 Introduction Preliminaries Requirements on Behavioural Equivalences Trace Equivalence Revisited Other Forms of Trace Equivalence Summary

5 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-10
SLIDE 10

Preliminaries Equivalence Relations Some reasonable required properties

  • Reflexivity: P ≡ P for every process P
  • Symmetry: P ≡ Q if and only if Q ≡ P
  • Transitivity: Spec0 ≡ . . . ≡ Specn ≡ Impl implies that Spec0 ≡ Impl

6 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-11
SLIDE 11

Preliminaries Equivalence Relations Some reasonable required properties

  • Reflexivity: P ≡ P for every process P
  • Symmetry: P ≡ Q if and only if Q ≡ P
  • Transitivity: Spec0 ≡ . . . ≡ Specn ≡ Impl implies that Spec0 ≡ Impl

Definition 11.1 (Equivalence) A binary relation ≡ ⊆ S × S over a set S is an equivalence if

  • it is reflexive: s ≡ s for every s ∈ S,
  • it is symmetric: s ≡ t implies t ≡ s for every s, t ∈ S,
  • it is transitive: s ≡ t and t ≡ u implies s ≡ u for every s, t, u ∈ S.

6 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-12
SLIDE 12

Preliminaries Equivalence Relations Some reasonable required properties

  • Reflexivity: P ≡ P for every process P
  • Symmetry: P ≡ Q if and only if Q ≡ P
  • Transitivity: Spec0 ≡ . . . ≡ Specn ≡ Impl implies that Spec0 ≡ Impl

Definition 11.1 (Equivalence) A binary relation ≡ ⊆ S × S over a set S is an equivalence if

  • it is reflexive: s ≡ s for every s ∈ S,
  • it is symmetric: s ≡ t implies t ≡ s for every s, t ∈ S,
  • it is transitive: s ≡ t and t ≡ u implies s ≡ u for every s, t, u ∈ S.

Remark: equivalences induce quotient structures with equivalence classes as elements

6 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-13
SLIDE 13

Preliminaries Isomorphism: An Example Behavioural Equivalence Definition 11.2 (LTS isomorphism) Two LTSs T1 = (S1, Act1, −

→1) and T2 = (S2, Act2, − →2) are isomorphic, denoted

T1 ≡iso T2, if there exists a bijection f : S1 → S2 such that s

α

− → 1 t

if and only if f(s)

α

− → 2 f(t).

7 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-14
SLIDE 14

Preliminaries Isomorphism: An Example Behavioural Equivalence Definition 11.2 (LTS isomorphism) Two LTSs T1 = (S1, Act1, −

→1) and T2 = (S2, Act2, − →2) are isomorphic, denoted

T1 ≡iso T2, if there exists a bijection f : S1 → S2 such that s

α

− → 1 t

if and only if f(s)

α

− → 2 f(t).

It follows immediately that ≡iso is an equivalence. (Why?)

7 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-15
SLIDE 15

Preliminaries Isomorphism: An Example Behavioural Equivalence Definition 11.2 (LTS isomorphism) Two LTSs T1 = (S1, Act1, −

→1) and T2 = (S2, Act2, − →2) are isomorphic, denoted

T1 ≡iso T2, if there exists a bijection f : S1 → S2 such that s

α

− → 1 t

if and only if f(s)

α

− → 2 f(t).

It follows immediately that ≡iso is an equivalence. (Why?) Example 11.3 (Abelian monoid laws for + and ) For all CCS processes P, Q ∈ Prc,

  • 1. LTS(P + Q) ≡iso LTS(Q + P), LTS(P Q) ≡iso LTS(Q P)
  • 2. LTS((P + Q) + R) ≡iso LTS(P + (Q + R)), LTS((P Q) R) ≡iso LTS(P (Q R))
  • 3. LTS(P + nil) ≡iso LTS(P nil) ≡iso LTS(P)

7 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-16
SLIDE 16

Preliminaries Isomorphism II Assumption From now on, we will consider processes modulo isomorphism, i.e., we do not distinguish CCS processes with isomorphic LTSs.

8 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-17
SLIDE 17

Preliminaries Isomorphism II Assumption From now on, we will consider processes modulo isomorphism, i.e., we do not distinguish CCS processes with isomorphic LTSs. Caveat But: isomorphism is very distinctive. For instance, X = a.X and Y = a.a.Y are distinguished although both can (only) execute infinitely many a-actions and should thus be considered equivalent.

8 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-18
SLIDE 18

Requirements on Behavioural Equivalences Outline of Lecture 11 Introduction Preliminaries Requirements on Behavioural Equivalences Trace Equivalence Revisited Other Forms of Trace Equivalence Summary

9 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-19
SLIDE 19

Requirements on Behavioural Equivalences The Wish List for Behavioural Equivalences

  • 1. Less distinctive than isomorphism: an equivalence should distinguish less processes than

LTS isomorphism does, i.e., ≡ should be coarser than LTS isomorphism: LTS(P) ≡iso LTS(Q) =

⇒ P ≡ Q.

10 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-20
SLIDE 20

Requirements on Behavioural Equivalences The Wish List for Behavioural Equivalences

  • 1. Less distinctive than isomorphism: an equivalence should distinguish less processes than

LTS isomorphism does, i.e., ≡ should be coarser than LTS isomorphism: LTS(P) ≡iso LTS(Q) =

⇒ P ≡ Q.

  • 2. More distinctive than trace equivalence: an equivalence should distinguish more processes

than trace equivalence does, i.e., ≡ should be finer than trace equivalence: P ≡ Q =

⇒ Tr(P) = Tr(Q).

10 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-21
SLIDE 21

Requirements on Behavioural Equivalences The Wish List for Behavioural Equivalences

  • 1. Less distinctive than isomorphism: an equivalence should distinguish less processes than

LTS isomorphism does, i.e., ≡ should be coarser than LTS isomorphism: LTS(P) ≡iso LTS(Q) =

⇒ P ≡ Q.

  • 2. More distinctive than trace equivalence: an equivalence should distinguish more processes

than trace equivalence does, i.e., ≡ should be finer than trace equivalence: P ≡ Q =

⇒ Tr(P) = Tr(Q).

  • 3. Congruence property: the equivalence must be substitutive with respect to all CCS
  • perators (see next slide).

10 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-22
SLIDE 22

Requirements on Behavioural Equivalences The Wish List for Behavioural Equivalences

  • 1. Less distinctive than isomorphism: an equivalence should distinguish less processes than

LTS isomorphism does, i.e., ≡ should be coarser than LTS isomorphism: LTS(P) ≡iso LTS(Q) =

⇒ P ≡ Q.

  • 2. More distinctive than trace equivalence: an equivalence should distinguish more processes

than trace equivalence does, i.e., ≡ should be finer than trace equivalence: P ≡ Q =

⇒ Tr(P) = Tr(Q).

  • 3. Congruence property: the equivalence must be substitutive with respect to all CCS
  • perators (see next slide).
  • 4. Deadlock preservation: equivalent processes should have the same deadlock behaviour,

i.e., equivalent process can either both deadlock, or both cannot.1

1Later, we will generalise this to a set of properties that can be expressed in a logic.

10 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-23
SLIDE 23

Requirements on Behavioural Equivalences The Wish List for Behavioural Equivalences

  • 1. Less distinctive than isomorphism: an equivalence should distinguish less processes than

LTS isomorphism does, i.e., ≡ should be coarser than LTS isomorphism: LTS(P) ≡iso LTS(Q) =

⇒ P ≡ Q.

  • 2. More distinctive than trace equivalence: an equivalence should distinguish more processes

than trace equivalence does, i.e., ≡ should be finer than trace equivalence: P ≡ Q =

⇒ Tr(P) = Tr(Q).

  • 3. Congruence property: the equivalence must be substitutive with respect to all CCS
  • perators (see next slide).
  • 4. Deadlock preservation: equivalent processes should have the same deadlock behaviour,

i.e., equivalent process can either both deadlock, or both cannot.1

  • 5. Optional: the coarsest possible equivalence: there should be no less discriminating

equivalence satisfying all these requirements.

1Later, we will generalise this to a set of properties that can be expressed in a logic.

10 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-24
SLIDE 24

Requirements on Behavioural Equivalences What is a Congruence?

11 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-25
SLIDE 25

Requirements on Behavioural Equivalences What is a Congruence? CCS contexts informally A CCS context is a CCS process fragment with a “hole” in it (examples on the board).

11 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-26
SLIDE 26

Requirements on Behavioural Equivalences What is a Congruence? CCS contexts informally A CCS context is a CCS process fragment with a “hole” in it (examples on the board). CCS congruences informally Relation ≡ is a CCS congruence whenever P ≡ Q implies C(P) ≡ C(Q) for every CCS context C.

11 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-27
SLIDE 27

Requirements on Behavioural Equivalences The Importance of Congruences CCS congruences informally Relation ≡ is a congruence whenever P ≡ Q implies C(P) ≡ C(Q) for every CCS context C.

12 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-28
SLIDE 28

Requirements on Behavioural Equivalences The Importance of Congruences CCS congruences informally Relation ≡ is a congruence whenever P ≡ Q implies C(P) ≡ C(Q) for every CCS context C. Example 11.4 (Congruence) Let a ≡ b for a, b ∈ Z whenever a mod k = b mod k, for some k ∈ N+. Equivalence relation ≡ is a congruence for addition and multiplication.

12 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-29
SLIDE 29

Requirements on Behavioural Equivalences The Importance of Congruences CCS congruences informally Relation ≡ is a congruence whenever P ≡ Q implies C(P) ≡ C(Q) for every CCS context C. Example 11.4 (Congruence) Let a ≡ b for a, b ∈ Z whenever a mod k = b mod k, for some k ∈ N+. Equivalence relation ≡ is a congruence for addition and multiplication. Important motivations of requiring ≡ to be a congruence on processes:

  • 1. Model-based development through refinement: replacing an abstract model Spec by a

more detailed model Impl

  • 2. Optimisation: replacing an implementation Impl by a more efficient implementation Impl′.

12 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-30
SLIDE 30

Requirements on Behavioural Equivalences CCS Congruences Formally Definition 11.5 (CCS congruence) An equivalence relation ≡ ⊆ Prc × Prc is a CCS congruence if it is preserved by all CCS constructs, i.e., if P, Q ∈ Prc with P ≡ Q then:

α.P ≡ α.Q

for every α ∈ Act P + R ≡ Q + R for every R ∈ Prc P R ≡ Q R for every R ∈ Prc P \ L ≡ Q \ L for every L ⊆ A P[f] ≡ Q[f] for every f : A → A

13 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-31
SLIDE 31

Requirements on Behavioural Equivalences CCS Congruences Formally Definition 11.5 (CCS congruence) An equivalence relation ≡ ⊆ Prc × Prc is a CCS congruence if it is preserved by all CCS constructs, i.e., if P, Q ∈ Prc with P ≡ Q then:

α.P ≡ α.Q

for every α ∈ Act P + R ≡ Q + R for every R ∈ Prc P R ≡ Q R for every R ∈ Prc P \ L ≡ Q \ L for every L ⊆ A P[f] ≡ Q[f] for every f : A → A Thus, a CCS congruence is substitutive for all possible CCS contexts.

13 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-32
SLIDE 32

Requirements on Behavioural Equivalences Deadlocks Definition 11.6 (Deadlock) Let P, Q ∈ Prc and w ∈ Act∗ such that P

w

− → Q and Q − →. Then Q is called a

w-deadlock of P.

14 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-33
SLIDE 33

Requirements on Behavioural Equivalences Deadlocks Definition 11.6 (Deadlock) Let P, Q ∈ Prc and w ∈ Act∗ such that P

w

− → Q and Q − →. Then Q is called a

w-deadlock of P. Example 11.7 P = a.b.nil + a.nil has an a-deadlock, whereas Q = a.b.nil has not. Such properties are important as it can be crucial that a certain action is eventually possible.

14 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-34
SLIDE 34

Requirements on Behavioural Equivalences Deadlocks Definition 11.6 (Deadlock) Let P, Q ∈ Prc and w ∈ Act∗ such that P

w

− → Q and Q − →. Then Q is called a

w-deadlock of P. Example 11.7 P = a.b.nil + a.nil has an a-deadlock, whereas Q = a.b.nil has not. Such properties are important as it can be crucial that a certain action is eventually possible. Definition 11.8 (Deadlock sensitivity) Relation ≡ ⊆ Prc × Prc is deadlock sensitive whenever: P ≡ Q implies (∀w ∈ Act∗. P has a w-deadlock iff Q has a w-deadlock) .

14 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-35
SLIDE 35

Trace Equivalence Revisited Outline of Lecture 11 Introduction Preliminaries Requirements on Behavioural Equivalences Trace Equivalence Revisited Other Forms of Trace Equivalence Summary

15 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-36
SLIDE 36

Trace Equivalence Revisited Trace Equivalence Trace language (Definition 3.2) The trace language of P ∈ Prc is defined by: Tr(P) := {w ∈ Act∗ | ∃P′ ∈ Prc. P

w

− → P′}.

16 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-37
SLIDE 37

Trace Equivalence Revisited Trace Equivalence Trace language (Definition 3.2) The trace language of P ∈ Prc is defined by: Tr(P) := {w ∈ Act∗ | ∃P′ ∈ Prc. P

w

− → P′}.

Trace equivalence (Definition 3.2) P, Q ∈ Prc are called trace equivalent iff Tr(P) = Tr(Q).

16 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-38
SLIDE 38

Trace Equivalence Revisited Trace Equivalence Trace language (Definition 3.2) The trace language of P ∈ Prc is defined by: Tr(P) := {w ∈ Act∗ | ∃P′ ∈ Prc. P

w

− → P′}.

Trace equivalence (Definition 3.2) P, Q ∈ Prc are called trace equivalent iff Tr(P) = Tr(Q). Trace equivalence is evidently an equivalence relation and is less discriminative than isomorphism.

16 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-39
SLIDE 39

Trace Equivalence Revisited Trace Equivalence is a Congruence Theorem 11.9 Trace equivalence is a CCS congruence.

17 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-40
SLIDE 40

Trace Equivalence Revisited Trace Equivalence is a Congruence Theorem 11.9 Trace equivalence is a CCS congruence. Proof. By structural induction over the syntax of CCS processes.

17 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-41
SLIDE 41

Trace Equivalence Revisited Trace Equivalence is a Congruence Theorem 11.9 Trace equivalence is a CCS congruence. Proof. By structural induction over the syntax of CCS processes. For + this proceeds as follows:

17 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-42
SLIDE 42

Trace Equivalence Revisited Trace Equivalence is a Congruence Theorem 11.9 Trace equivalence is a CCS congruence. Proof. By structural induction over the syntax of CCS processes. For + this proceeds as follows:

  • Let P, Q ∈ Prc with Tr(P) = Tr(Q).

17 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-43
SLIDE 43

Trace Equivalence Revisited Trace Equivalence is a Congruence Theorem 11.9 Trace equivalence is a CCS congruence. Proof. By structural induction over the syntax of CCS processes. For + this proceeds as follows:

  • Let P, Q ∈ Prc with Tr(P) = Tr(Q).
  • Then for R ∈ Prc it holds:

Tr(P + R) = Tr(P) ∪ Tr(R) = Tr(Q) ∪ Tr(R) = Tr(Q + R).

17 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-44
SLIDE 44

Trace Equivalence Revisited Trace Equivalence is a Congruence Theorem 11.9 Trace equivalence is a CCS congruence. Proof. By structural induction over the syntax of CCS processes. For + this proceeds as follows:

  • Let P, Q ∈ Prc with Tr(P) = Tr(Q).
  • Then for R ∈ Prc it holds:

Tr(P + R) = Tr(P) ∪ Tr(R) = Tr(Q) ∪ Tr(R) = Tr(Q + R).

  • Thus, P + R and Q + R are trace equivalent.

17 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-45
SLIDE 45

Trace Equivalence Revisited Trace Equivalence is a Congruence Theorem 11.9 Trace equivalence is a CCS congruence. Proof. By structural induction over the syntax of CCS processes. For + this proceeds as follows:

  • Let P, Q ∈ Prc with Tr(P) = Tr(Q).
  • Then for R ∈ Prc it holds:

Tr(P + R) = Tr(P) ∪ Tr(R) = Tr(Q) ∪ Tr(R) = Tr(Q + R).

  • Thus, P + R and Q + R are trace equivalent.

For the other CCS constructs, the proof goes along similar lines. Exercise: do the proof for .

17 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-46
SLIDE 46

Trace Equivalence Revisited Two Coffee/Tea Machines Example 11.10 Consider the coffee/tea machines CTM and its variant CTM’: CTM = coin.

  • coffee.CTM + tea.CTM
  • CTM’ = coin.coffee.CTM’ + coin.tea.CTM’.

18 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-47
SLIDE 47

Trace Equivalence Revisited Two Coffee/Tea Machines Example 11.10 Consider the coffee/tea machines CTM and its variant CTM’: CTM = coin.

  • coffee.CTM + tea.CTM
  • CTM’ = coin.coffee.CTM’ + coin.tea.CTM’.

Note the difference between the two processes. Nevertheless: Tr(CTM) = Tr(CTM’).

18 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-48
SLIDE 48

Trace Equivalence Revisited Two Coffee/Tea Machines Example 11.10 Consider the coffee/tea machines CTM and its variant CTM’: CTM = coin.

  • coffee.CTM + tea.CTM
  • CTM’ = coin.coffee.CTM’ + coin.tea.CTM’.

Note the difference between the two processes. Nevertheless: Tr(CTM) = Tr(CTM’). Are we satisfied?

18 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-49
SLIDE 49

Trace Equivalence Revisited Two Coffee/Tea Machines Example 11.10 Consider the coffee/tea machines CTM and its variant CTM’: CTM = coin.

  • coffee.CTM + tea.CTM
  • CTM’ = coin.coffee.CTM’ + coin.tea.CTM’.

Note the difference between the two processes. Nevertheless: Tr(CTM) = Tr(CTM’). Are we satisfied? No, as CTM and CTM’ differ in the context: C(·) = ( ·

  • hole

CA) \ {coin, coffee, tea} with CA = coin.coffee.CA.

18 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-50
SLIDE 50

Trace Equivalence Revisited Two Coffee/Tea Machines Example 11.10 Consider the coffee/tea machines CTM and its variant CTM’: CTM = coin.

  • coffee.CTM + tea.CTM
  • CTM’ = coin.coffee.CTM’ + coin.tea.CTM’.

Note the difference between the two processes. Nevertheless: Tr(CTM) = Tr(CTM’). Are we satisfied? No, as CTM and CTM’ differ in the context: C(·) = ( ·

  • hole

CA) \ {coin, coffee, tea} with CA = coin.coffee.CA.

Why? C(CTM’) may yield a deadlock, but C(CTM) does not.

18 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-51
SLIDE 51

Trace Equivalence Revisited Checking Trace Equivalence Traces by automata For finite-state P, the trace language Tr(P) of process P is accepted by the (non-deterministic) finite automaton obtained from the LTS of P with initial state P and making all states accepting (final).

19 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-52
SLIDE 52

Trace Equivalence Revisited Checking Trace Equivalence Traces by automata For finite-state P, the trace language Tr(P) of process P is accepted by the (non-deterministic) finite automaton obtained from the LTS of P with initial state P and making all states accepting (final). Theorem 11.11 Checking trace equivalence of two finite processes is PSPACE-complete.

19 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-53
SLIDE 53

Trace Equivalence Revisited Checking Trace Equivalence Traces by automata For finite-state P, the trace language Tr(P) of process P is accepted by the (non-deterministic) finite automaton obtained from the LTS of P with initial state P and making all states accepting (final). Theorem 11.11 Checking trace equivalence of two finite processes is PSPACE-complete. Proof. Checking whether Tr(P) = Tr(Q), for finite-state P and Q, boils down to deciding whether their non-deterministic automata accept the same language. As this problem in automata theory is PSPACE-complete, it follows that checking Tr(P) = Tr(Q) is PSPACE-complete.

19 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-54
SLIDE 54

Trace Equivalence Revisited Traces and Deadlocks Example 11.12 (Traces and deadlocks) Traces and deadlocks are independent in the following sense: P Q P Q a ւց a

↓ a

a ւց b a ւց c b ↓

↓ b

b c

same traces different traces different deadlocks same deadlocks

20 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-55
SLIDE 55

Trace Equivalence Revisited Traces and Deadlocks Example 11.12 (Traces and deadlocks) Traces and deadlocks are independent in the following sense: P Q P Q a ւց a

↓ a

a ւց b a ւց c b ↓

↓ b

b c

same traces different traces different deadlocks same deadlocks But: processes with finite trace sets and identical deadlocks are trace equivalent (since every trace is a prefix of some deadlock).

20 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-56
SLIDE 56

Other Forms of Trace Equivalence Outline of Lecture 11 Introduction Preliminaries Requirements on Behavioural Equivalences Trace Equivalence Revisited Other Forms of Trace Equivalence Summary

21 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-57
SLIDE 57

Other Forms of Trace Equivalence Completed Trace Equivalence Definition 11.13 (Completed traces) A completed trace of P ∈ Prc is a sequence w ∈ Act∗ such that: P

w

− → Q

and Q −

for some Q ∈ Prc.

22 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-58
SLIDE 58

Other Forms of Trace Equivalence Completed Trace Equivalence Definition 11.13 (Completed traces) A completed trace of P ∈ Prc is a sequence w ∈ Act∗ such that: P

w

− → Q

and Q −

for some Q ∈ Prc. The completed traces of process P may be seen as capturing its deadlock behaviour, as they are precisely the action sequences that can lead to a process from which no transition is possible (i.e., is a deadlock).

22 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-59
SLIDE 59

Other Forms of Trace Equivalence Completed Trace Equivalence Definition 11.13 (Completed traces) A completed trace of P ∈ Prc is a sequence w ∈ Act∗ such that: P

w

− → Q

and Q −

for some Q ∈ Prc. The completed traces of process P may be seen as capturing its deadlock behaviour, as they are precisely the action sequences that can lead to a process from which no transition is possible (i.e., is a deadlock). Exercise Check whether completed trace equivalence is a congruence for restriction.

22 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-60
SLIDE 60

Other Forms of Trace Equivalence Further Variations of Trace Equivalence

Definition 11.14 (Ready trace equivalence) (Baeten et al.) A sequence A0α0A1α1 . . . αnAn with Ai ⊆ Act and αi ∈ Act (i ∈ N) is a ready trace of process P if P = P0

α0

− → P1

α1

− → . . .

αn

− → Pn such that Ai = {α ∈ Act | Pi

α

− →}. Processes

P and Q are ready-trace equivalent if they have exactly the same set of ready traces.

23 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-61
SLIDE 61

Other Forms of Trace Equivalence Further Variations of Trace Equivalence

Definition 11.14 (Ready trace equivalence) (Baeten et al.) A sequence A0α0A1α1 . . . αnAn with Ai ⊆ Act and αi ∈ Act (i ∈ N) is a ready trace of process P if P = P0

α0

− → P1

α1

− → . . .

αn

− → Pn such that Ai = {α ∈ Act | Pi

α

− →}. Processes

P and Q are ready-trace equivalent if they have exactly the same set of ready traces. Definition 11.15 (Failure trace equivalence) (Reed and Roscoe) A sequence A0α0A1α1 . . . αnAn with Ai ⊆ Act and αi ∈ Act (i ∈ N) is a failure trace of process P if P = P0

α0

− → P1

α1

− → . . .

αn

− → Pn such that Ai ∩ {α ∈ Act | Pi

α

− →} = ∅.

Processes P and Q are failure-trace equivalent if they have exactly the same set of failure traces.

23 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-62
SLIDE 62

Other Forms of Trace Equivalence Further Variations of Trace Equivalence

Definition 11.14 (Ready trace equivalence) (Baeten et al.) A sequence A0α0A1α1 . . . αnAn with Ai ⊆ Act and αi ∈ Act (i ∈ N) is a ready trace of process P if P = P0

α0

− → P1

α1

− → . . .

αn

− → Pn such that Ai = {α ∈ Act | Pi

α

− →}. Processes

P and Q are ready-trace equivalent if they have exactly the same set of ready traces. Definition 11.15 (Failure trace equivalence) (Reed and Roscoe) A sequence A0α0A1α1 . . . αnAn with Ai ⊆ Act and αi ∈ Act (i ∈ N) is a failure trace of process P if P = P0

α0

− → P1

α1

− → . . .

αn

− → Pn such that Ai ∩ {α ∈ Act | Pi

α

− →} = ∅.

Processes P and Q are failure-trace equivalent if they have exactly the same set of failure traces. Example 11.16 P := a.b + a.c and Q := a.(b + c) are

  • trace equivalent: Tr(P) = {ε, a, ab, ac} = Tr(Q), but
  • not ready equivalent: {a} a {b, c} b ∅ ∈ rTr(Q) \ rTr(P)

23 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-63
SLIDE 63

Summary Outline of Lecture 11 Introduction Preliminaries Requirements on Behavioural Equivalences Trace Equivalence Revisited Other Forms of Trace Equivalence Summary

24 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-64
SLIDE 64

Summary Summary

  • 1. Behavioural equivalences should be
  • i. less distinctive than isomorphism
  • ii. more distinctive than trace equivalence
  • iii. a CCS congruence
  • iv. deadlock sensitive

25 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-65
SLIDE 65

Summary Summary

  • 1. Behavioural equivalences should be
  • i. less distinctive than isomorphism
  • ii. more distinctive than trace equivalence
  • iii. a CCS congruence
  • iv. deadlock sensitive
  • 2. Trace equivalence
  • i. equates processes that have the same traces, i.e., action sequences
  • ii. is implied by LTS isomorphism
  • iii. is a CCS congruence
  • iv. is not deadlock sensitive
  • v. checking trace equivalence is PSPACE-complete

25 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence

slide-66
SLIDE 66

Summary Summary

  • 1. Behavioural equivalences should be
  • i. less distinctive than isomorphism
  • ii. more distinctive than trace equivalence
  • iii. a CCS congruence
  • iv. deadlock sensitive
  • 2. Trace equivalence
  • i. equates processes that have the same traces, i.e., action sequences
  • ii. is implied by LTS isomorphism
  • iii. is a CCS congruence
  • iv. is not deadlock sensitive
  • v. checking trace equivalence is PSPACE-complete
  • 3. Variations: completed, ready, and failure traces

25 of 25 Concurrency Theory Winter Semester 2019/20 Lecture 11: Trace Equivalence