Revisiting: Algebraic laws for nondeterminism and concurrency - - PowerPoint PPT Presentation

revisiting algebraic laws for nondeterminism and
SMART_READER_LITE
LIVE PREVIEW

Revisiting: Algebraic laws for nondeterminism and concurrency - - PowerPoint PPT Presentation

Revisiting: Algebraic laws for nondeterminism and concurrency Matthew Hennessy Milner-Symposium, Edinburgh April 2012 1/29 History of a paper Algebraic laws for nondeterminism and concurrency, JACM 1985 Matthew Hennessy and Robin Milner


slide-1
SLIDE 1

Revisiting: Algebraic laws for nondeterminism and concurrency

Matthew Hennessy Milner-Symposium, Edinburgh April 2012

1/29

slide-2
SLIDE 2

History of a paper

Algebraic laws for nondeterminism and concurrency, JACM 1985

Matthew Hennessy and Robin Milner

◮ Research in late 1979

33 years ago

◮ Results presented at ICALP 1980

32 years ago (On Observing Nondeterminism and Concurrency)

◮ Rejected for publication 1982 ◮ Rejected for publication 1983 ◮ Published in JACM 1985

2/29

slide-3
SLIDE 3

Edinburgh 1979 33 years ago

◮ No Labelled Transition Systems ◮ No CCS

No CSP No ACP No . . .

◮ No street lightening ◮ What happened to the sun ? ◮ Lots of mushrooms ◮ No Bisimulations ◮ When does the summer arrive? ◮ Walks on Arthurs seat ◮ Lots of parking near George Square ◮ . . . . . . ◮ . . . . . .

3/29

slide-4
SLIDE 4

Edinburgh 1979: Lots of denotational semantics

D ∼ = [D → D]

functions Scott, 1969

P ∼ = V → (V × P)

transformers Milner 1971

R ∼ = P(S⊥ + (P(S⊥) ⊗ R⊥))S

resumptions Plotkin 1976

PL ∼ = P(

  • β∈L

(Uβ × (Vβ → PL)) )

processes Milne&Milner 1979

4/29

slide-5
SLIDE 5

Edinburgh 1979: Lots of algebraic semantics

The Auld Alliance

◮ Jean-Marie Cadiou (1972): Recursive Definitions of Partial Functions and

their Computations

◮ Jean Vuillemin (1973): Proof Techniques for Recursive Programs ◮ Bruno Courcelle, Maurice Nivat (1978): The Algebraic Semantics of

Recursive Programme Schemes

◮ Irene Guessarian (1981): Algebraic Semantics

5/29

slide-6
SLIDE 6

Edinburgh 1979: Lots of algebraic semantics

The Auld Alliance

◮ Jean-Marie Cadiou (1972): Recursive Definitions of Partial Functions and

their Computations

◮ Jean Vuillemin (1973): Proof Techniques for Recursive Programs ◮ Bruno Courcelle, Maurice Nivat (1978): The Algebraic Semantics of

Recursive Programme Schemes

◮ Irene Guessarian (1981): Algebraic Semantics ◮ Magmas: ordered sets with operators ◮ Ideal completions: adding limit points ◮ Initial algebra semantics

5/29

slide-7
SLIDE 7

A behavioural equivalence

ICALP 1980:

6/29

slide-8
SLIDE 8

Observatonal equivalence

1979

◮ Reduction semantics: P −

→ Q well-known

7/29

slide-9
SLIDE 9

Observatonal equivalence

1979

◮ Reduction semantics: P −

→ Q well-known

◮ Observational semantics: P µ

− → Q new to me

7/29

slide-10
SLIDE 10

Observatonal equivalence

1979

◮ Reduction semantics: P −

→ Q well-known

◮ Observational semantics: P µ

− → Q new to me

Observing processes:

◮ p ∼o q for all p, q

zero observations

◮ p ∼n+1 q if for every µ

(n + 1) observations

(i) p

µ

− → p′ implies q

µ

− → q′ such that p′ ∼n q′ (ii) q

µ

− → q′ implies p

µ

− → p′ such that p′ ∼n q′

Transfer properties 7/29

slide-11
SLIDE 11

Observatonal equivalence

1979

◮ Reduction semantics: P −

→ Q well-known

◮ Observational semantics: P µ

− → Q new to me

Observing processes:

◮ p ∼o q for all p, q

zero observations

◮ p ∼n+1 q if for every µ

(n + 1) observations

(i) p

µ

− → p′ implies q

µ

− → q′ such that p′ ∼n q′ (ii) q

µ

− → q′ implies p

µ

− → p′ such that p′ ∼n q′

Transfer properties

Observational equivalence:

p ∼ q if p (∩n≥0 ∼n) q

7/29

slide-12
SLIDE 12

Observing processes

P2 a a a a b c b c Q2 a a a a b c b c

8/29

slide-13
SLIDE 13

Observing processes

P2 a a a a b c b c Q2 a a a a b c b c P2 ∼o Q2 P2 ∼1 Q2 P2 ∼2 Q2 P2 ∼3 Q2

8/29

slide-14
SLIDE 14

Observing processes

P2 a a a a b c b c Q2 a a a a b c b c P2 ∼o Q2 P2 ∼1 Q2 P2 ∼2 Q2 P2 ∼3 Q2 Life could get much more complicated: Pn ∼n Qn Pn ∼(n+1) Qn

8/29

slide-15
SLIDE 15

Observational equivalence: Where from?

A Denotational Model

Milne&Milner 1979

PL ∼ = P(

  • β∈L

(Uβ × (Vβ → PL)) )

◮ L: set of ports ◮ Uβ: output values on port β ◮ Vβ: input values on port β

A simplification Uβ = Vβ = 1:

PL ∼ = P(

  • µ∈L

PL ) How would you compare two elements p, q from PL?

9/29

slide-16
SLIDE 16

Observational equivalence: a theorem

ICALP 1980:

10/29

slide-17
SLIDE 17

First research experiment

Process language:

finite non-deterministic machines

p ∈ WΣ1 ::= 0 | p + p | µ.p

11/29

slide-18
SLIDE 18

First research experiment

Process language:

finite non-deterministic machines

p ∈ WΣ1 ::= 0 | p + p | µ.p

Result:

∩n≥0(∼n) is a Σ1- congruence

◮ p

∩n≥0(∼n) q iff p =A q

Axioms (A): x + (y + z) = (x + y) + z x + y = y + x x + x = x x + 0 = x 11/29

slide-19
SLIDE 19

First research experiment

Process language:

finite non-deterministic machines

p ∈ WΣ1 ::= 0 | p + p | µ.p

Result:

∩n≥0(∼n) is a Σ1- congruence

◮ p

∩n≥0(∼n) q iff p =A q

Axioms (A): x + (y + z) = (x + y) + z x + y = y + x x + x = x x + 0 = x

Denotational semantics:

p ∩n≥0(∼n) q iff p(WΣ1 \A) = q(WΣ1 \A) (WΣ1\A) : Initial algebra over WΣ1 generated by axioms A

11/29

slide-20
SLIDE 20

Robin had a lot of background

◮ 1973: Processes: A Mathematical model . . . ◮ 1978: Algebras for Communicating Systems ◮ 1978: Synthesis of Communicating Behaviour ◮ 1978: Flowgraphs and Flow Algebras ◮ 1979: An Algebraic Theory for Synchronisation ◮ 1979: Concurrent Processes and Their Syntax

12/29

slide-21
SLIDE 21

Robin had a lot of background

◮ 1973: Processes: A Mathematical model . . . ◮ 1978: Algebras for Communicating Systems ◮ 1978: Synthesis of Communicating Behaviour ◮ 1978: Flowgraphs and Flow Algebras ◮ 1979: An Algebraic Theory for Synchronisation ◮ 1979: Concurrent Processes and Their Syntax

Combinators and their Laws proposed:

12/29

slide-22
SLIDE 22

Robin had a lot of background

◮ 1973: Processes: A Mathematical model . . . ◮ 1978: Algebras for Communicating Systems ◮ 1978: Synthesis of Communicating Behaviour ◮ 1978: Flowgraphs and Flow Algebras ◮ 1979: An Algebraic Theory for Synchronisation ◮ 1979: Concurrent Processes and Their Syntax

Combinators and their Laws proposed:

◮ Flowgraphs and flow algebras for static structure ◮ Synchronisation trees for dynamics

12/29

slide-23
SLIDE 23

Justifying equations

Flowgraphs:

13/29

slide-24
SLIDE 24

Justifying equations

Flowgraphs: Synchronisation trees:

Let p =

i λi.pi, q = j µj.qj. Then

p|q =

  • i

λi.(pi|q) +

  • j

µj.(p|qj) +

  • µj=λi

τ.(pi|qj)

13/29

slide-25
SLIDE 25

Theorems for free

Σ2 = Σ1 plus

◮ Parallelism: | ◮ Restriction: \λ ◮ Renaming: [S]

S a function over names

Result:

(∩n≥0 ∼n) is a Σ2- congruence

◮ p

(∩n≥0 ∼n) q iff p =A2 q

14/29

slide-26
SLIDE 26

Theorems for free

Σ2 = Σ1 plus

◮ Parallelism: | ◮ Restriction: \λ ◮ Renaming: [S]

S a function over names

Result:

(∩n≥0 ∼n) is a Σ2- congruence

◮ p

(∩n≥0 ∼n) q iff p =A2 q A2 = A1 + existing axioms for |, \λ, [S]

14/29

slide-27
SLIDE 27

Weak case: abstracting from internal activity τ

◮ Weak observational semantics:

P

µ

= ⇒ Q meaning P

τ

− →

∗ µ

− →

τ

− →

∗ Q

External observations:

◮ p ≈o q for all p, q

zero observations

◮ p ≈n+1 q if for every µ ∈ Actτ

(n + 1) observations

(i) p

µ

= ⇒ p′ implies q

µ

= ⇒ q′ such that p′ ≈n q′ (ii) q

µ

= ⇒ q′ implies p

µ

= ⇒ p′ such that p′ ≈n q′

Weak transfer properties look: no hats 15/29

slide-28
SLIDE 28

Weak case: abstracting from internal activity τ

◮ Weak observational semantics:

P

µ

= ⇒ Q meaning P

τ

− →

∗ µ

− →

τ

− →

∗ Q

External observations:

◮ p ≈o q for all p, q

zero observations

◮ p ≈n+1 q if for every µ ∈ Actτ

(n + 1) observations

(i) p

µ

= ⇒ p′ implies q

µ

= ⇒ q′ such that p′ ≈n q′ (ii) q

µ

= ⇒ q′ implies p

µ

= ⇒ p′ such that p′ ≈n q′

Weak transfer properties look: no hats

Weak observational equivalence:

p ≈ q if p (∩n≥0 ≈n) q

15/29

slide-29
SLIDE 29

Equational characterisation

◮ Problem: (∩n≥0 ≈n) is NOT preserved by operators + or |

16/29

slide-30
SLIDE 30

Equational characterisation

◮ Problem: (∩n≥0 ≈n) is NOT preserved by operators + or | ◮ Result: In Σ1, p (∩n≥0 ≈n)c q iff p =WA1 q

Axioms WA1: add to A1 the τ-axioms: x + τ.x = τ.x

✭✭✭✭✭✭✭✭✭✭✭✭✭✭ ✭

µ.(x + τ.y) = µ.(x + y) + µ.y µ.τ.y = µ.y µ.(x + τ.y) = µ.(x + τ.y) + µ.y

16/29

slide-31
SLIDE 31

Equational characterisation

◮ Problem: (∩n≥0 ≈n) is NOT preserved by operators + or | ◮ Result: In Σ1, p (∩n≥0 ≈n)c q iff p =WA1 q

Axioms WA1: add to A1 the τ-axioms: x + τ.x = τ.x

✭✭✭✭✭✭✭✭✭✭✭✭✭✭ ✭

µ.(x + τ.y) = µ.(x + y) + µ.y µ.τ.y = µ.y µ.(x + τ.y) = µ.(x + τ.y) + µ.y Where did these come from?

16/29

slide-32
SLIDE 32

An exercise in Behaviour Algebra notes by Robin on modelling queues

17/29

slide-33
SLIDE 33

An exercise in Behaviour Algebra notes by Robin on modelling queues

17/29

slide-34
SLIDE 34

Hennessy Milner Logic where did this come from?

Observational equivalence p (∩n≥0 ∼n) q

◮ Inspired by identity in domain PL ∼

= P(

µ∈L PL )

18/29

slide-35
SLIDE 35

Hennessy Milner Logic where did this come from?

Observational equivalence p (∩n≥0 ∼n) q

◮ Inspired by identity in domain PL ∼

= P(

µ∈L PL ) ◮ Requires independent justification

18/29

slide-36
SLIDE 36

Hennessy Milner Logic where did this come from?

Observational equivalence p (∩n≥0 ∼n) q

◮ Inspired by identity in domain PL ∼

= P(

µ∈L PL ) ◮ Requires independent justification

Why are these behaviourally different:

P2

a a a a b c b c

Q2

a a a a b c b c Discover difference using interaction games:

◮ can do action x ◮ can not do action x

18/29

slide-37
SLIDE 37

Discovering differences

P2

a a a a b c b c

Q2

a a a a b c b c Q2 can perform a so that every time a is subsequently performed both b and c can be performed

19/29

slide-38
SLIDE 38

Discovering differences

P2

a a a a b c b c

Q2

a a a a b c b c Q2 can perform a so that every time a is subsequently performed both b and c can be performed Q2 | = a[a](btt ∧ ctt) P2 | = . . .

19/29

slide-39
SLIDE 39

Hennessy Milner Logic

A, B ∈ L ::= tt | A ∧ B | ¬A | µA

◮ p |

= µA if p

µ

− → p′ such that p′ ⊢ A

◮ p |

= A ∧ B if . . . . . .

Result:

◮ p

(∩n≥0 ∼n) q iff L(p) = L(q)

requires image-finiteness

◮ p✘✘✘✘✘✘

(∩n≥0 ∼n) q iff p | = A and q | = A, for some A ∈ L. A is an explanation of why p, q are different

20/29

slide-40
SLIDE 40

Enter . . . David Park

1935 - 1990 21/29

slide-41
SLIDE 41

Enter . . . David Park

1935 - 1990

Fixpoint induction:

1970 machine intelligence

If F(H) ≤ H then minX.F(X) ≤ H

requires monotonicity 21/29

slide-42
SLIDE 42

Enter . . . David Park

1935 - 1990

Fixpoint induction:

1970 machine intelligence

If F(H) ≤ H then minX.F(X) ≤ H

requires monotonicity

Fair merge:

1979

fairmerge = maxX.minY .(Fm(minZ.Fm(Z, X), Y ) where Fm(X, Y ) = {(ǫ, x, x)|x ∈ Σ∞} ∪ {(x, ǫ, x)|x ∈ Σ∞} = {(ax, y, az)|a ∈ Σ, (x, y, z) ∈ X} = {(x, ay, az)|a ∈ Σ, (x, y, z) ∈ Y }

Σ∞: finite and infinite strings over Σ 21/29

slide-43
SLIDE 43

Using Maximal Fixpoints

Icalp 1980:

Hennessy & Milner

Extensive use in meta-theory of processes:

◮ Theorem 2.1 If each Ri is image-finite then ∼ is the maximal

solution to S = E(S)

◮ ALNC, page 157: Now let ≈′ be the maximal solution to the

equation S = E ′(S)

22/29

slide-44
SLIDE 44

Using Maximal Fixpoints

Icalp 1980:

Hennessy & Milner

Extensive use in meta-theory of processes:

◮ Theorem 2.1 If each Ri is image-finite then ∼ is the maximal

solution to S = E(S)

◮ ALNC, page 157: Now let ≈′ be the maximal solution to the

equation S = E ′(S)

David Park:

Use maximal fixpoints in object-theory of processes Replace (∩n≥0 ∼n) with a maximal fixpoint ∼bis

22/29

slide-45
SLIDE 45

Co-induction `

a la David Park

Transfer property:

For R ⊆ P × P, define B(R) ⊆ P × P by p B(R) q whenever (i) p

µ

− → p′ implies q

µ

− → q′ such that p R q (ii) q

µ

− → q′ implies p

µ

− → p′ such that p R q

Bisimulations:

◮ R ⊆ P × P is a bisimulation if B(R) ⊆ R ◮ p ∼bis q if p R q for some bisimulation R

Elegant proof for establishing p ∼bis q

23/29

slide-46
SLIDE 46

Co-induction `

a la David Park Robin Milner: A Calculus of Communicating Systems, LNCS 1980 24/29

slide-47
SLIDE 47

Co-induction `

a la David Park Robin Milner: A Calculus of Communicating Systems, LNCS 1980

Robin Milner: Communication and Concurrency, Prentice-Hall, 1984

◮ elegant theory ◮ lots of worked examples ◮ detailed proofs

24/29

slide-48
SLIDE 48

Jim Morris and his style of equivalences

25/29

slide-49
SLIDE 49

Jim Morris and his style of equivalences

James H Morris, PhD Thesis: Lambda Calculus Models of Programming Languages, 1968.

◮ Proposed Theorem:

In Lambda, if FA ⊑ A then YF ⊑ A

25/29

slide-50
SLIDE 50

Jim Morris and his style of equivalences

James H Morris, PhD Thesis: Lambda Calculus Models of Programming Languages, 1968.

◮ Proposed Theorem:

In Lambda, if FA ⊑ A then YF ⊑ A

◮ Question: What is ⊑ ?

25/29

slide-51
SLIDE 51

Jim Morris and his style of equivalences

James H Morris, PhD Thesis: Lambda Calculus Models of Programming Languages, 1968.

◮ Proposed Theorem:

In Lambda, if FA ⊑ A then YF ⊑ A

◮ Question: What is ⊑ ?

Morris Preorder:

A ⊑morris B if for every context C[ ] C[A] has a normal form implies C[B] has a normal form

25/29

slide-52
SLIDE 52

Morris - style of equivalences

Ingredients:

◮ A reduction semantics: P → Q ◮ Results: P ⇓ v

barbs

◮ Language syntax for contexts C[ ]

Contextual equivalence:

P ≅cxt Q if for every context, for every barb, C[P] →∗ P′ ⇓ v iff C[Q] →∗ Q′ ⇓ v

26/29

slide-53
SLIDE 53

Morris - style of equivalences

Ingredients:

◮ A reduction semantics: P → Q ◮ Results: P ⇓ v

barbs

◮ Language syntax for contexts C[ ]

Contextual equivalence:

P ≅cxt Q if for every context, for every barb, C[P] →∗ P′ ⇓ v iff C[Q] →∗ Q′ ⇓ v Where are the quantifiers?

26/29

slide-54
SLIDE 54

Justifying Bisimulation Equivalence

Barbed congruence:

Milner, Sangiorgi 1992

For image-finite CCS processes, P ≈bism Q iff P ≅barb Q

27/29

slide-55
SLIDE 55

Justifying Bisimulation Equivalence

Barbed congruence:

Milner, Sangiorgi 1992

For image-finite CCS processes, P ≈bism Q iff P ≅barb Q

Reduction barbed congruence:

Honda, Yoshida 1993

For arbitrary CCS processes, P ≈bism Q iff P ≅rbc Q

27/29

slide-56
SLIDE 56

Justifying Bisimulation Equivalence

Barbed congruence:

Milner, Sangiorgi 1992

For image-finite CCS processes, P ≈bism Q iff P ≅barb Q

Reduction barbed congruence:

Honda, Yoshida 1993

For arbitrary CCS processes, P ≈bism Q iff P ≅rbc Q Both contextual equivalences are reduction closed:

◮ P →∗ P′ implies Q →∗ Q′ s.t. P′ ≅· Q′ ◮ Q →∗ Q′ implies P →∗ Q′ s.t. P′ ≅· Q′

27/29

slide-57
SLIDE 57

Bisimulations in the Modern World

Pick your favourite process language

28/29

slide-58
SLIDE 58

Bisimulations in the Modern World

Pick your favourite process language

◮ Bisimulations do not provide a behavioural theory of processes

per se

◮ Bisimulations provide a proof methodology for demonstrating

processes to be equivalent

◮ HML provide a methodology for explaining why processes are

not equivalent

28/29

slide-59
SLIDE 59

Bisimulations in the Modern World

Pick your favourite process language

◮ Bisimulations do not provide a behavioural theory of processes

per se

◮ Bisimulations provide a proof methodology for demonstrating

processes to be equivalent

◮ HML provide a methodology for explaining why processes are

not equivalent

◮ Bisimulations are very often sound w.r.t. the natural

contextual equivalence ≅cxt

◮ Bisimulations are sometimes complete w.r.t. the natural

contextual equivalence ≅cxt

◮ Formulating complete bisimulations very often sheds light

process behaviour

28/29

slide-60
SLIDE 60

Examples a very small sample

◮ Asynchronous Picalculus:

Honda, Tokoro 1991, Amadio Castellani Sangiorgi 1998

◮ Mobile Ambients:

Merro, Zappa Nardelli 1985

◮ Existential and recursive types in lambda-calculus:

Sumii, Pierce 2007

◮ Higher-order processes:

environmental bisimulations Sangiorgi, Kobayahsi, Sumii 2007

◮ Aspects in a functional language:

  • pen bisimulations Jagadeesan, Pitcher, Riely 2007

◮ Concurrent Probabilistic processes:

Deng, Hennessy 2011 29/29

slide-61
SLIDE 61

Examples a very small sample

◮ Asynchronous Picalculus:

Honda, Tokoro 1991, Amadio Castellani Sangiorgi 1998

◮ Mobile Ambients:

Merro, Zappa Nardelli 1985

◮ Existential and recursive types in lambda-calculus:

Sumii, Pierce 2007

◮ Higher-order processes:

environmental bisimulations Sangiorgi, Kobayahsi, Sumii 2007

◮ Aspects in a functional language:

  • pen bisimulations Jagadeesan, Pitcher, Riely 2007

◮ Concurrent Probabilistic processes:

Deng, Hennessy 2011

◮ Bigraphs:

Robin and co-workers ◮ Bigraphs: all encompassing descriptive language ◮ Recovery of LTS from reduction semantics ◮ ensuring soundness of bisimulations 29/29