Some remarks on Bisimulation and Coinduction Davide Sangiorgi - - PowerPoint PPT Presentation

some remarks on bisimulation and coinduction
SMART_READER_LITE
LIVE PREVIEW

Some remarks on Bisimulation and Coinduction Davide Sangiorgi - - PowerPoint PPT Presentation

Some remarks on Bisimulation and Coinduction Davide Sangiorgi University of Bologna Email: Davide.Sangiorgi@cs.unibo.it http://www.cs.unibo.it/sangio/ Edinburgh, April 2012 The 91 Turing Award to Arthur John Robin Gorell Milner page 1


slide-1
SLIDE 1

Some remarks on Bisimulation and Coinduction

Davide Sangiorgi

University of Bologna

Email: Davide.Sangiorgi@cs.unibo.it http://www.cs.unibo.it/˜sangio/

Edinburgh, April 2012

slide-2
SLIDE 2

The ’91 Turing Award to

Arthur John Robin Gorell Milner

page 1
slide-3
SLIDE 3

From http://amturing.acm.org/

“For three distinct and complete achievements:

  • 1. LCF
  • 2. ML
  • 3. CCS.

In addition, he formulated and strongly advanced full abstraction”

page 2
slide-4
SLIDE 4

No bisimulation and coinduction

page 3
slide-5
SLIDE 5

Another fundamental contribution for Milner: Bisimulation and Coinduction

page 4
slide-6
SLIDE 6

Bisimulation, bisimilarity, coinduction

Bisimulation: A relation R s.t. P α R Q α P R Q Bisimilarity (∼) :

∪ {R : R is a bisimulation }

(coind. definition) Hence: P R Q R is a bisimulation P ∼ Q (coind. proof principle)

page 5
slide-7
SLIDE 7

Major contributions to concurrency theory...

– To define equality on processes (fundamental !!) – To prove equalities ∗ even if bisimilarity is not the chosen equivalence · trying bisimilarity first · coinductive characterisations of the chosen equivalence – To justify algebraic laws – To minimise the state space – To abstract from certain details

page 6
slide-8
SLIDE 8

In fact, major contributions to computer science...

– Functional languages and OO languages – Program analysis – Verification tools: – Type theory – Databases – Compiler correctness

page 7
slide-9
SLIDE 9

And beyond computer science....

– Set Theory and Mathematics – Modal Logics – Artificial Intelligence – Cognitive Science – Philosophy – Physics

page 8
slide-10
SLIDE 10

The discovery of bisimulation and coinduction

page 9
slide-11
SLIDE 11

Robin Milner David Park

page 10
slide-12
SLIDE 12

Milner, early 1970s

page 11
slide-13
SLIDE 13

A formal notion of simulation between programs. Memo 14,

  • Comp. and Logic Research Group, University of Swansea, 1970

Program simulation: an extended formal notion.

Memo 17,

  • Comp. and Logic Research Group, University of Swansea, 1971

An algebraic definition of simulation between programs 2nd

International Joint Conferences on Artificial Intelligence, London, 1971

page 12
slide-14
SLIDE 14

– Programs: partial, sequential, imperative – Program correctness – When 2 programs realise the same algorithm? – Milner’s proposal: simulation – not quite today’s simulation the proof technique, locality – tree-like computation and concurrency mentioned for future work – ... but Milner never looked into that (bisimulation might have been discovered)

page 13
slide-15
SLIDE 15

Milner, later in the 1970s

A novel theory of processes (CCS) where behavioural equivalence is fundamental and based on locality P a ∼n+1 Q a P ∼n Q ∼0 P × P ∼ω

n ∼n

A Calculus of Communicating Systems

LNCS 92, Springer,

1980 Lemma ∼ω is not invariant under transitions

page 14
slide-16
SLIDE 16

Park, 80/81: sabbatical in Edinburgh

– Staying at Milner’s (!) – A fixed-point reading of Milner’s theory: The definition of ∼ω is based on a functional F that is ∗ monotone ∗ non-cocontinuous – Applying fixed-point theory: Bisimilarity (∼) gfp(F) A bisimulation : a post-fixed point of F Corollary : any bisimulation ⊆ ∼ ∼ λ ordinal Fλ(P × P)

page 15
slide-17
SLIDE 17

if you buy a big enough house you can benefit from other people’s ideas — Milner

page 16
slide-18
SLIDE 18

Milner’s insights

– an equivalence based on locality – the proof technique And he made popular both bisimulation and coinduction – CCS – Milner and Tofte. Co-induction in relational semantics. TCS, 1991, and Tech. Rep. LFCS, Edinburgh, 1988.

page 17
slide-19
SLIDE 19

Origins of the names

Milner and Park, after the breakfast in which bisimulation came up: We went for a walk in the hills in the after- noon, wondering what to call the equivalence. He wanted "mimicry", which I thought a bad idea (it’s a hard word to pronounce!). I sug- gested "bisimulation"; his first reaction was "too many syllables"; I replied that it was easy to

  • pronounce. I won.

— Milner

page 18
slide-20
SLIDE 20

Coinduction – Barwise and Etchemendy, “The Liar: an Essay in Truth and Circularity”, 1987 – Milner and Tofte, “Co-induction in relational semantics”.

  • Tech. Rep. LFCS, Edinburgh, 1988.
page 19
slide-21
SLIDE 21

Why bisimulation and coinduction discovered so late?

page 20
slide-22
SLIDE 22

Weak homomorphism in automata theory

– well-known in the 1960s

[cf: Ginzburg’s book]

– Milner’s simulation, algebraically

page 21
slide-23
SLIDE 23

Algorithm for minimisation of automata

[ Huffman 1954 and Moore 1956] [also: the Myhill-Nerode theorem 1957-58]

Find the non-equivalent states, as an inductive set N:

  • 1. If s final and t is not, then s N t
  • 2. if ∃ a s.t. σ(s, a) N σ(s, a) then s N t

The complement set: the equivalent states

page 22
slide-24
SLIDE 24

What is this complement set? The largest relation R s.t.

  • 1. s final and s R t imply t final, and the converse
  • 2. ∀ a, if s R t then σ(s, a) R σ(s, a)

[cf: bisimilarity ] NB: any relation with 1-2 above relates equivalent states [cf: bisimulation ]

page 23
slide-25
SLIDE 25

The appearance of bisimulation in Set Theory

Foundations of set theory (cf: non-well-founded sets) – Forti, Honsell ’80-83, Hinnion ’80-81 Bisimulations: f-conservative relations, contractions Coinduction? ∗ yes ∗ a little hidden (more attention to bisimulation equivalences than

bisimulations)

– Aczel ’85-89 nwf sets popular, motivated by Milner’s work on CCS the basis of the coalgebraic approach to semantics

page 24
slide-26
SLIDE 26

Much earlier than that....

– Dimitry Mirimanoff [1917] (“ensembles extraordinaires”) Isomorphism between two nwf sets E and E: A perfect correspondence can be established between the elements of E and E, in such a way that:

  • 1. all atoms e ∈ E corresponds to an atom e ∈ E and

conversely;

  • 2. all sets F ∈ E corresponds to a set F ∈ E so that the

perfect correspondence can also be established on F and F (ie, all atoms in F corresponds to an atom in F , and so forth)

page 25
slide-27
SLIDE 27

For Mirimanoff: isomorphism is not equality (cf: Zermelo’s extensionality axiom) Hence isomorphism remains different from bisimilarity Example: A = {B} and B = {A} isomorphic, not equal {A, B} not isomorphic to {A} or {B} Had one investigated the impact of isomorphism on extensionality, bisimulation and bisimilarity would have been discovered We have to wait 65 years : why?

page 26
slide-28
SLIDE 28

So: why bisimulation has been discovered so late?

– Dangers of circularity and paradoxes (like Burali-Forti’s and Russel’s) – Russel’s stratified approach – Common sense – Lack of concrete motivations

page 27
slide-29
SLIDE 29

So: why bisimulation has been discovered so late?

– Dangers of circularity and paradoxes (like Burali-Forti’s and Russel’s) – Russel’s stratified approach – Common sense – Lack of concrete motivations – none of these entirely convincing (cf: automata theory)

page 28
slide-30
SLIDE 30

So: why bisimulation has been discovered so late?

– Dangers of circularity and paradoxes (like Burali-Forti’s and Russel’s) – Russel’s stratified approach – Common sense – Lack of concrete motivations – none of these entirely convincing (cf: automata theory) – .... because Robin had not thought

about it earlier

page 29
slide-31
SLIDE 31

For the future

page 30
slide-32
SLIDE 32

– metatheory – probabilistic coinduction – higher-order languages – ...

page 31
slide-33
SLIDE 33

Enhancements of the bisimulation/coinduction proof method

page 32
slide-34
SLIDE 34

Ambients: syntax

Processes P ::= nP ambient

|

in n. P in action

|

  • ut n. P
  • ut action

|

  • pen n. P
  • pen action

|

P | P parallel

|

νn P restriction

|

. . .

page 33
slide-35
SLIDE 35

The in movement n in m.P | m Q

− →

m n P | Q The out movement m n

  • ut n.P1 | P2

| Q

− →

n P1 | P2 | m Q

page 34
slide-36
SLIDE 36

Enhancements of the method: an example

The perfect-firewall equation in Ambients P : a process with n not free in it νn nP ∼ 0 Proof: Let’s find a bisimulation...

page 35
slide-37
SLIDE 37

Is this a bisimulation? R { (νn nP , 0) }

page 36
slide-38
SLIDE 38

Is this a bisimulation? R { (νn nP , 0) } No!

Suppose P enter kQ − − − − − − − − − → P (the loop: simplifies the example, not necessary)

νn nP

enter kQ

R

enter kQ

kQ | νn nP R

  • kQ | 0

Try again...

page 37
slide-39
SLIDE 39

Is this a bisimulation? R { (νn nP , 0) }

∪k,Q

{ (kQ | νn nP , kQ | 0) }

page 38
slide-40
SLIDE 40

Is this a bisimulation? R { (νn nP , 0) }

∪k,Q

{ (kQ | νn nP , kQ | 0) } No!

Suppose Q = hout k. R | Q

kQ | νn nP R kQ | 0 kQ | νn nP | hR R

  • kQ | hR | 0

Try again...

page 39
slide-41
SLIDE 41

Is this a bisimulation? R { (νn nP , 0) }

∪k,Q

{ (kQ | νn nP , kQ | 0) } Also:

Suppose Q = in h. Q

kQ | νn nP

enter hR

R kQ | 0

enter hR

hR | kQ | νn nP R

  • hR | kQ | 0

Try again...

page 40
slide-42
SLIDE 42

The bisimulation: R ∪C is a static contexts {(S, T ) : S ∼ C[νn nP ] T ∼ C[0] } C ::= kC | P | C | νa C | [ ] We started with the singleton relation {(νn nP , 0)} The added pairs: redundant? (derivable, laws of ∼) Can we work with relations smaller than bisimulations? Advantage: fewer and simpler bisimulation diagrams

page 41
slide-43
SLIDE 43

Redundant pairs

What we would like to do: R R∗ − {some redundant pairs} P α R Q α P R∗ Q implies R ⊆ ∼

page 42
slide-44
SLIDE 44

Redundant pairs

What we would like to do: R R∗ − {some redundant pairs} P α R Q α P R∗ Q implies R ⊆ ∼ A wrong definition of redundant: S a set of inference rules valid for ∼ (P, Q) is redundant in (P, Q) ∪ R if S R ⊆ ∼ P ∼ Q

page 43
slide-45
SLIDE 45

False! Counterexample S a. P ∼ a. Q P ∼ Q R

  • {(a. b, a. c)}

R∗

  • R ∪ {(b, c)}
  • a. b

a R

  • a. c

a b R∗ c but

  • a. b ∼ a. c
page 44
slide-46
SLIDE 46

In some cases it works

– Rules for transitivity of ∼ (up-to ∼) [Milner] P α R Q α P ∼ P R Q ∼ Q implies R ⊆∼ Warning: in some cases it does not work, even though ∼ is transitive

page 45
slide-47
SLIDE 47

In some cases it works

– Rules for transitivity of ∼ (up-to ∼) – rules for substitutivity of ∼ (up-to context)

[Sangiorgi]

P α R Q α C

[P ]

R C

[Q]

implies R ⊆∼ Warning: in some cases it does not work, even though the contexts preserve ∼

page 46
slide-48
SLIDE 48

In some cases it works

– Rules for transitivity of ∼ (up-to ∼) – rules for substitutivity of ∼ (up-to context) – rules for invariance of ∼ under injective substitutions (up-to injective substitutions) P α R Q α P σ R Qσ σ: an injective function σ implies R ⊆∼

page 47
slide-49
SLIDE 49

Composition of techniques

diagram : P α R Q α P ∼ C

[P σ ] R C [Q σ ]

∼ Q More sophistication ⇒ – more powerful technique – harder soundness proof for the technique

page 48
slide-50
SLIDE 50

Proof of the firewall, composition of up-to techniques

We can prove νn nP ∼ 0 using the singleton relation νn nP

enter kQ

R

enter kQ

kQ | νn nP kQ | 0

page 49
slide-51
SLIDE 51

Proof of the firewall, composition of up-to techniques

We can prove νn nP ∼ 0 using the singleton relation νn nP

enter kQ

R

enter kQ

kQ | νn nP kQ | 0 ∼ ∼ kQ | νn nP kQ | 0

page 50
slide-52
SLIDE 52

Proof of the firewall, composition of up-to techniques

We can prove νn nP ∼ 0 using the singleton relation νn nP

enter kQ

R

enter kQ

kQ | νn nP kQ | 0 ∼ ∼ kQ |νn nP

  • R

kQ | 0

  • [Merro, Zappa Nardelli, JACM]

“up-to ∼” and “up-to context”

(full proof also needs up-to injective substitutions)

page 51
slide-53
SLIDE 53

Counterexample : up-to context that fails

P := f(P ) | a. P | 0 P a − → P P a − → P f(P ) a − → P Bisimulation is a congruence, yet:

  • a. 0

a R

  • a. a. 0

a ∼ f

(a. 0)

R f

(a. a. 0) ∼

  • a. 0
page 52
slide-54
SLIDE 54

Counterexample : up-to context that fails

P := f(P ) | a. P | 0 P a − → P P a − → P f(P ) a − → P Bisimulation is a congruence, yet:

  • a. 0

a R

  • a. a. 0

a ∼ f

  • (a. 0)

R f

  • (a. a. 0) ∼
  • a. 0
page 53
slide-55
SLIDE 55

Lessons

– Enhancements of the bisimulation proof methods: extremely useful ∗ essential in π-calculus-like languages, higher-order languages – Various forms of enhancement (“up-to techniques”) ∗ composition of techniques – Proofs of soundness of these techniques may be complex ∗ separate ad hoc proofs for each technique

page 54
slide-56
SLIDE 56

Needed

– A general theory of enhancements ∗ powerful techniques ∗ combination of techniques ∗ easy to derive their soundness Partial results: [ Pous, Sangiorgi] – What is a redundant pair? (i.e., a pair for which the bisimulation diagram is not necessary) – Robust definition of enhancement – Weak bisimilarity Partial results: [Hirschkoff, Pous] – Mechanical verification – Metatheory of bisimulation enhancements

page 55