An introduction to Concurrency Theoryfvalenci/papers/tutorial-clei.pdf · An introduction to...

153

Transcript of An introduction to Concurrency Theoryfvalenci/papers/tutorial-clei.pdf · An introduction to...

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

An introduction to Concurrency TheoryCommunicating and Mobile Systems

Frank D. Valencia

French National Center for Scienti�c Research (CNRS)Computer Science Laboratory of École Polytechnique de Paris (LIX)

Oct 2005/CLEI'05

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concurrency is everywhere...

Concurrent Systems

Multiple agents (processes) that interact among each other.

Some fundamental concurrent systems:

Reactive Systems.

Synchronous Communicating Systems

Mobile Systems.

Concurrent systems can combine:

Example

E.g., The Internet (a complex one!)

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concurrency is everywhere...

Concurrent Systems

Multiple agents (processes) that interact among each other.

Some fundamental concurrent systems:

Reactive Systems.

Synchronous Communicating Systems

Mobile Systems.

Concurrent systems can combine:

Example

E.g., The Internet (a complex one!)

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concurrency is everywhere...

Concurrent Systems

Multiple agents (processes) that interact among each other.

Some fundamental concurrent systems:

Reactive Systems.

Synchronous Communicating Systems

Mobile Systems.

Concurrent systems can combine:

Example

E.g., The Internet (a complex one!)

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concurrency is everywhere...

Concurrent Systems

Multiple agents (processes) that interact among each other.

Some fundamental concurrent systems:

Reactive Systems.

Synchronous Communicating Systems

Mobile Systems.

Concurrent systems can combine:

Example

E.g., The Internet (a complex one!)

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concurrency is everywhere...

Concurrent Systems

Multiple agents (processes) that interact among each other.

Some fundamental concurrent systems:

Reactive Systems.

Synchronous Communicating Systems

Mobile Systems.

Concurrent systems can combine:

Example

E.g., The Internet (a complex one!)

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concurrency is everywhere...

Concurrent Systems

Multiple agents (processes) that interact among each other.

Some fundamental concurrent systems:

Reactive Systems.

Synchronous Communicating Systems

Mobile Systems.

Concurrent systems can combine:

Example

E.g., The Internet (a complex one!)

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concurrency is everywhere...

Concurrent Systems

Multiple agents (processes) that interact among each other.

Some fundamental concurrent systems:

Reactive Systems.

Synchronous Communicating Systems

Mobile Systems.

Concurrent systems can combine:

Example

E.g., The Internet (a complex one!)

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concurrency: A Serious Challenge...

Models of Concurrency

Formal Models to describe and analyze concurrent systems.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concurrency: A Serious Challenge...

Models of Concurrency

Formal Models to describe and analyze concurrent systems.

As other models of reality, these models must be

be simple

be expressive,

be formal

provide reasoning techniques.

Just like λ−calculus model of sequential computation !

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concurrency: A Serious Challenge...

Models of Concurrency

Formal Models to describe and analyze concurrent systems.

Models for sequential computation don't apply. Concurrent com-putation is usually

Non-Terminating

Reactive (or Interactive)

Nondeterministic (Unpredictable).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concurrency: A Serious Challenge...

Models of Concurrency

Formal Models to describe and analyze concurrent systems.

In concurrency theory

Each model focuses in a fundamental phenomenon: E.g.,Synchrony and Mobility.

But there is no yet a �cannonical model �.

...Probably because concurrency is a very broad (young) area.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concurrency: A Serious Challenge...

Models of Concurrency

Formal Models to describe and analyze concurrent systems.

Some well established model of concurrency:

Process Calculi (Like λ-calculi)

CCS (Synchronous communication)π-calculus (CCS Extension to Mobility)

Petri Nets (Like Automata)

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Mobility

What kind of mobility will we consider in this tutorial ?

Processes move.

Links move√

The last one, because it is the π-calculus' choice; for �exibility andsimplicity.

π-calculus has the ability of sending private and public links

(names).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Mobility

What kind of mobility will we consider in this tutorial ?

Processes move.

Links move√

The last one, because it is the π-calculus' choice; for �exibility andsimplicity.

π-calculus has the ability of sending private and public links

(names).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Mobility

What kind of mobility will we consider in this tutorial ?

Processes move.

Links move√

The last one, because it is the π-calculus' choice; for �exibility andsimplicity.

π-calculus has the ability of sending private and public links

(names).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Link Mobility

Mobile phones

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Link Mobility

Mobile phones

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

A �avour of the pi-calculus

In the π calculus:(νa)(ba.S ‖ a(x).P) ‖ b(c).cd .C

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

A �avour of the pi-calculus

In π the pi-calculus:(νa)(ba.S ‖ a(x).P) ‖ b(c).cd .C −→ S ‖ (νa)(a(x).P ‖ ad .C )

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Outline

1 From Computability to Concurrency TheoryBasic Concepts from Automata TheoryBisimilarity Equivalence

2 Calculus of Comunicating Systems CCSGeneral Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

3 Mobility and the pi calculusSyntax and SemanticsApplicationsEquivalences

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Outline

1 From Computability to Concurrency TheoryBasic Concepts from Automata TheoryBisimilarity Equivalence

2 Calculus of Comunicating Systems CCSGeneral Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

3 Mobility and the pi calculusSyntax and SemanticsApplicationsEquivalences

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Classic Automata TheoryAutomata

De�nition

An automata A over an alphabet Act is a tuple (Q,Q0,Qf ,T )where

S(A) = Q = {q0, q1, . . .} is the set of states,

S0(A) = Q0 ⊆ Q is the set of initial states,

Sf (A) = Qf ⊆ Q is the set of accepting (or �nal) states,

T (A) = T ⊆ Q × Act × Q is the set of transitions.

Write qa−→ q′ for (q, a, q′) ∈ T . Omit Act when it is understood.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Classic Automata TheoryAutomata

Example: A Typical Graph Representation

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Classic Automata TheoryRegular Sets and Expressions

De�nition (Acceptance, Regularity)

A accepts a1...an i� there is a path q0a1−→ q1

a2−→· · · an−→ qnin T (A) with q0 ∈ So(A) and qn ∈ Sf (A).

The Language of (or recognized by) A, L(A), is the set ofsequences accepted by A.

Regular sets are those recognized by �nite-state automata

(FSA).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Classic Automata TheoryRegular Sets and Expressions

De�nition (Acceptance, Regularity)

A accepts a1...an i� there is a path q0a1−→ q1

a2−→· · · an−→ qnin T (A) with q0 ∈ So(A) and qn ∈ Sf (A).

The Language of (or recognized by) A, L(A), is the set ofsequences accepted by A.

Regular sets are those recognized by �nite-state automata

(FSA).

Fact

Regular Expressions (e.g. a.(b + c)∗) are as expressive as FSA.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Classic Automata TheoryRegular Sets and Expressions

Example

An string accepted: 10001.

The language accepted: All binary strings with an evennumber of 1's.

A Corresponding Regular Expression: 0∗(10∗10∗)∗

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Classic Automata TheorySome Nice Properties and Exercises

Fact

1 Deterministic and NonDeterministic FSA are equallyexpressive.

2 Regular sets are closed under (a) union, (b) complement, (c)

intersection.

Exercises

1 Prove 2.b and 2.c.

2 Prove that emptiness problem of a given FSA is decidable.

3 Prove that language equivalence of two given FSA isdecidable.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Classic Automata TheorySome Nice Properties and Exercises

Fact

1 Deterministic and NonDeterministic FSA are equallyexpressive.

2 Regular sets are closed under (a) union, (b) complement, (c)

intersection.

Exercises

1 Prove 2.b and 2.c.

2 Prove that emptiness problem of a given FSA is decidable.

3 Prove that language equivalence of two given FSA isdecidable.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Classic Automata TheoryWhat is good for ?

Classic Automata Theory is solid and foundational with severalapplications in computer science. BUT...

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Classic Automata TheoryWhat is good for ?

Classic Automata Theory is solid and foundational with severalapplications in computer science. BUT...

Example: A FSA Vending Machine Representation

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Classic Automata TheoryWhat is good for ?

Classic Automata Theory is solid and foundational with severalapplications in computer science. BUT...

Example: A FSA Vending Machine Representation

•L(B1) = L(B2) but B2 would represent an annoying vendingmachine! CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Classic Automata TheoryWhat is good for ?

Classic Automata Theory is solid and foundational with severalapplications in computer science. BUT...

Fact

Language equivalence may be too weak for interactive behavior.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Classic Automata Theory.

The Problem with Language Equivalence

In automata theory a · (b + c) = a · b + a · c . I.e., p0 and qo areequivalent.

•We need stronger equivalences that does not validate the above.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Outline

1 From Computability to Concurrency TheoryBasic Concepts from Automata TheoryBisimilarity Equivalence

2 Calculus of Comunicating Systems CCSGeneral Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

3 Mobility and the pi calculusSyntax and SemanticsApplicationsEquivalences

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Bisimilarity: The Equivalence of Reactive Systems.

Transition Systems

Transition systems are just automata in which initial and �nalstates are irrelevant.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Bisimilarity: The Equivalence of Reactive Systems.

Simulation

Let T be transition system. A relation R ⊆ S(T )× S(T ) is asimulation i� for each (p, q) ∈ R :. If p

a−→ p′ then there is q′ s.t. qa−→ q′ and (p′, q′) ∈ R .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Bisimilarity: The Equivalence of Reactive Systems.

Bisimulation

A relation R is a bisimulation i� R and its converse R−1 are bothsimulations.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Bisimilarity: The Equivalence of Reactive Systems.

Similaridad & Bisimilaridad

. p simulates q i� there exists a simulation R s.t (p, q) ∈ R .

. p and q are bisimilar, written p ∼ q, if there exists abisimulation R s.t. (p, q) ∈ R .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Bisimilarity: The Equivalence of Reactive Systems.

Example: Trace Equivalence is not Bisimilarity

Here p0 simulates q0 but q0 does not simulate p0, so p0 and q0 arenot bisimilar.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Bisimilarity: The Equivalence of Reactive Systems.

Example: Bisimilarity is not graph equivalence

Bisimilarity equates LTS with di�erent graph structure: E.g., p0and q0 are bisimilar. But how do we prove they are bisimilar ?

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Bisimilarity: The Equivalence of Reactive Systems.

Example: Proving Bisimilarity

To prove that p0and q0 are bisimilar simply exhibit a bisimulationR . E.g. R = {(p0, q0), (p0, q2), (p1, q1), (p2, q1)}.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Bisimilarity: The Equivalence of Reactive Systems.

Example: Proving Bisimilarity

To prove that p0and q0 are bisimilar simply exhibit a bisimulationR . E.g. R = {(p0, q0), (p0, q2), (p1, q1), (p2, q1)}.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Bisimilarity: The Equivalence of Reactive Systems.

Example: Bisimilarity and simulation

Suppose that p simulates q and q simulates p. Are p and q

necesarly bisimilar ?

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Concepts from Automata TheoryBisimilarity Equivalence

Bisimilarity: The Equivalence of Reactive Systems.

Example: Bisimilarity and simulation

No! Here p simulatesq and q simulates p but they are not bisimilar.Notice that p is less reliable than q; i.e., it deadlocks after a.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Outline

1 From Computability to Concurrency TheoryBasic Concepts from Automata TheoryBisimilarity Equivalence

2 Calculus of Comunicating Systems CCSGeneral Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

3 Mobility and the pi calculusSyntax and SemanticsApplicationsEquivalences

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Process Calculi

Process calculi treat processes much like λ-calculus treatscomputable functions:

Structure of terms represent the structure of processes. E.g.:

P ‖ Q

Operational Semantics to represent computational steps.E.g.:

PARP −→ P ′

P ‖ Q −→ P ′ ‖ Q

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Process Calculi

Process calculi treat processes much like λ-calculus treatscomputable functions:

Structure of terms represent the structure of processes. E.g.:

P ‖ Q

Operational Semantics to represent computational steps.E.g.:

PARP −→ P ′

P ‖ Q −→ P ′ ‖ Q

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Process Calculi

Process calculi treat processes much like λ-calculus treatscomputable functions:

Structure of terms represent the structure of processes. E.g.:

P ‖ Q

Operational Semantics to represent computational steps.E.g.:

PARP −→ P ′

P ‖ Q −→ P ′ ‖ Q

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Typical Issues in Developing Process Calculi

Which process constructs �t the intended phenomena?E.g. atomic actions, parallelism, nondeterminism.

How should these constructs be given meaning ?E.g. Operational Semantics, Denotational Semantics.

How should processes be compared ?E.g. Observable Behavior, Process Equivalences.

How should process properties be speci�ed and proved ?E.g. Logic for expressing process speci�cations (like in Hoare'sLogic).

How expressive is the calulus ?E.g. Expressiveness of a nice fragment of the calculus.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Typical Issues in Developing Process Calculi

Which process constructs �t the intended phenomena?E.g. atomic actions, parallelism, nondeterminism.

How should these constructs be given meaning ?E.g. Operational Semantics, Denotational Semantics.

How should processes be compared ?E.g. Observable Behavior, Process Equivalences.

How should process properties be speci�ed and proved ?E.g. Logic for expressing process speci�cations (like in Hoare'sLogic).

How expressive is the calulus ?E.g. Expressiveness of a nice fragment of the calculus.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Typical Issues in Developing Process Calculi

Which process constructs �t the intended phenomena?E.g. atomic actions, parallelism, nondeterminism.

How should these constructs be given meaning ?E.g. Operational Semantics, Denotational Semantics.

How should processes be compared ?E.g. Observable Behavior, Process Equivalences.

How should process properties be speci�ed and proved ?E.g. Logic for expressing process speci�cations (like in Hoare'sLogic).

How expressive is the calulus ?E.g. Expressiveness of a nice fragment of the calculus.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Typical Issues in Developing Process Calculi

Which process constructs �t the intended phenomena?E.g. atomic actions, parallelism, nondeterminism.

How should these constructs be given meaning ?E.g. Operational Semantics, Denotational Semantics.

How should processes be compared ?E.g. Observable Behavior, Process Equivalences.

How should process properties be speci�ed and proved ?E.g. Logic for expressing process speci�cations (like in Hoare'sLogic).

How expressive is the calulus ?E.g. Expressiveness of a nice fragment of the calculus.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Typical Issues in Developing Process Calculi

Which process constructs �t the intended phenomena?E.g. atomic actions, parallelism, nondeterminism.

How should these constructs be given meaning ?E.g. Operational Semantics, Denotational Semantics.

How should processes be compared ?E.g. Observable Behavior, Process Equivalences.

How should process properties be speci�ed and proved ?E.g. Logic for expressing process speci�cations (like in Hoare'sLogic).

How expressive is the calulus ?E.g. Expressiveness of a nice fragment of the calculus.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Outline

1 From Computability to Concurrency TheoryBasic Concepts from Automata TheoryBisimilarity Equivalence

2 Calculus of Comunicating Systems CCSGeneral Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

3 Mobility and the pi calculusSyntax and SemanticsApplicationsEquivalences

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

CCS Syntax

Basic Entities of CCS:

A set N = a, b, . . . of names and N = {a | a ∈ N} ofco-names.

A set L = N ∪N of labels (ranged over by l , l ′, . . .).

A set Act = L ∪ {τ} of actions (ranged over by a,b, . . .).

Action τ is called the silent or unobservable action.

Actions a and a are viewed as being �complementary�. I.e.,a = a.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

CCS Syntax

De�nition (CCS Syntax of Processes)

P,Q, . . . := 0 | a.P | P ‖ Q | P + Q | (νa)P | A(a1, ..., an)

Bound names of P , fn(P): Those with a bound occurrence inP .

Free names of P , bn(P): Those with a not bound occurrencein P .

For each (call) A(a1, . . . , an) there is a unique processde�nition A(b1 . . . bn) = P, with fv(P) ⊆ {b1, . . . , bn}.The set of all processes is denoted by P.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

CCS: Operational Semantics.

ACTa.P

a−→ P

SUM1

Pa−→ P′

P + Qa−→ P′

SUM2

Qa−→ Q′

P + Qa−→ Q′

COM1

Pa−→ P′

P ‖ Q a−→ P′ ‖ QCOM2

Qa−→ Q′

P ‖ Q a−→ P ‖ Q′

COM3

Pl−→ P′ Q

l−→ Q′

P ‖ Q τ−→ P′ ‖ Q′

RESP

a−→ P′

(νa)Pa−→ (νa)P′

if a 6= a and a 6= a

RECPA[b1, . . . , bn/a1, . . . , an ]

a−→ P′

A 〈b1, . . . , bn〉a−→ P′

if A(a1, . . . , an)def= PA

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Outline

1 From Computability to Concurrency TheoryBasic Concepts from Automata TheoryBisimilarity Equivalence

2 Calculus of Comunicating Systems CCSGeneral Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

3 Mobility and the pi calculusSyntax and SemanticsApplicationsEquivalences

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

CCS: Bisimilarity

Labeled Transition System of CCS

The LTS of CCS has P as its states and its transitions given by

the operational semantics. De�ne P ∼ Q i� the statescorresponding to P and Q are bisimilar.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

CCS: Bisimilarity

Labeled Transition System of CCS

The LTS of CCS has P as its states and its transitions given by

the operational semantics. De�ne P ∼ Q i� the statescorresponding to P and Q are bisimilar.

Example: Processes and LTS states

P = a.(b.0 + c.0) corresponds to p0 and Q = a.b.0 + a.c .0corresponds to q0. Hence P 6∼ Q.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

CCS: Bisimilarity

Labeled Transition System of CCS

The LTS of CCS has P as its states and its transitions given by

the operational semantics. De�ne P ∼ Q i� the statescorresponding to P and Q are bisimilar.

Some Basic Equalities

. P ‖ Q ∼ Q ‖ P

. P ‖ 0 ∼ P

. (P ‖ Q) ‖ R ∼ P ‖ (Q ‖ R)

. (νa)0 ∼ 0

. P ‖ (νa)Q ∼ (νa)(P ‖ Q) ?

. (νa)P ∼ (νb)P[b/a] ?

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

CCS: The expansion law.

Notice that a.0 ‖ b.0 is bisimilar to a.b.0 + b.a.0.

More generally, we have the expansion law:(ν~a)(P1 ‖ . . . ‖ Pn) ∼

Σ{ai .(ν~a)(P1 ‖ . . . ‖ P ′i ‖ . . . ‖ Pn | Pi

ai−→ P ′i , a, ai 6∈ ~a}

+

Σ{τ.(νa)(P1 ‖ . . . ‖ P ′i ‖ . . . ‖ P ′

j . . . ‖ Pn |Pil−→ P ′

i , Pjl−→ P ′

j}

So, every move in (ν~a)(P1 ‖ . . . ‖ Pn) is either one of the Pi

or a communication between some Pi and Pj .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

CCS: The expansion law.

Notice that a.0 ‖ b.0 is bisimilar to a.b.0 + b.a.0.

More generally, we have the expansion law:(ν~a)(P1 ‖ . . . ‖ Pn) ∼

Σ{ai .(ν~a)(P1 ‖ . . . ‖ P ′i ‖ . . . ‖ Pn | Pi

ai−→ P ′i , a, ai 6∈ ~a}

+

Σ{τ.(νa)(P1 ‖ . . . ‖ P ′i ‖ . . . ‖ P ′

j . . . ‖ Pn |Pil−→ P ′

i , Pjl−→ P ′

j}

So, every move in (ν~a)(P1 ‖ . . . ‖ Pn) is either one of the Pi

or a communication between some Pi and Pj .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

CCS: The expansion law.

Notice that a.0 ‖ b.0 is bisimilar to a.b.0 + b.a.0.

More generally, we have the expansion law:(ν~a)(P1 ‖ . . . ‖ Pn) ∼

Σ{ai .(ν~a)(P1 ‖ . . . ‖ P ′i ‖ . . . ‖ Pn | Pi

ai−→ P ′i , a, ai 6∈ ~a}

+

Σ{τ.(νa)(P1 ‖ . . . ‖ P ′i ‖ . . . ‖ P ′

j . . . ‖ Pn |Pil−→ P ′

i , Pjl−→ P ′

j}

So, every move in (ν~a)(P1 ‖ . . . ‖ Pn) is either one of the Pi

or a communication between some Pi and Pj .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Congruence issues

Suppose that P ∼ Q. We would like P ‖ R ∼ Q ‖ R .More generally we would like

C [P] ∼ C [Q]

where C [.] is a process context. I.e., we want ∼ to be acongruence.

The notion of congruence allows us to replace �equals withequals�.

In fact, ∼ is a congruence. How can we prove this ?.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Congruence issues

Suppose that P ∼ Q. We would like P ‖ R ∼ Q ‖ R .More generally we would like

C [P] ∼ C [Q]

where C [.] is a process context. I.e., we want ∼ to be acongruence.

The notion of congruence allows us to replace �equals withequals�.

In fact, ∼ is a congruence. How can we prove this ?.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Congruence issues

Suppose that P ∼ Q. We would like P ‖ R ∼ Q ‖ R .More generally we would like

C [P] ∼ C [Q]

where C [.] is a process context. I.e., we want ∼ to be acongruence.

The notion of congruence allows us to replace �equals withequals�.

In fact, ∼ is a congruence. How can we prove this ?.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Congruence issues

Suppose that P ∼ Q. We would like P ‖ R ∼ Q ‖ R .More generally we would like

C [P] ∼ C [Q]

where C [.] is a process context. I.e., we want ∼ to be acongruence.

The notion of congruence allows us to replace �equals withequals�.

In fact, ∼ is a congruence. How can we prove this ?.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Observable Behavior

In principle, P and Q should be equivalent i� another process(the environment, an observer) cannot observe any di�erencein their behavior.

Notice τ.P 6∼ P , although τ is an unobservable action. So ∼could be too strong:).

We look for other notion of equivalence focused in terms of

observable actions (i.e., actionsl−→, l ∈ L).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Observable Behavior

In principle, P and Q should be equivalent i� another process(the environment, an observer) cannot observe any di�erencein their behavior.

Notice τ.P 6∼ P , although τ is an unobservable action. So ∼could be too strong:).

We look for other notion of equivalence focused in terms of

observable actions (i.e., actionsl−→, l ∈ L).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Observable Behavior

In principle, P and Q should be equivalent i� another process(the environment, an observer) cannot observe any di�erencein their behavior.

Notice τ.P 6∼ P , although τ is an unobservable action. So ∼could be too strong:).

We look for other notion of equivalence focused in terms of

observable actions (i.e., actionsl−→, l ∈ L).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Outline

1 From Computability to Concurrency TheoryBasic Concepts from Automata TheoryBisimilarity Equivalence

2 Calculus of Comunicating Systems CCSGeneral Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

3 Mobility and the pi calculusSyntax and SemanticsApplicationsEquivalences

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Observations

Think of anyl−→ with l 6= τ as an observation.

Think of an experiment e as a sequence l1.l2 . . . ln ofobservable actions.

Notation: If s = a1 . . . an ∈ Act∗ then de�ne

s=⇒= (

τ−→)∗a1−→ (

τ−→)∗ . . . (τ−→)∗

an−→ (τ−→)∗

Notice thate

=⇒ for e = l1.l2 . . . ln ∈ L denotes a sequence ofobservable actions inter-spread with τ actions: The notion ofexperiment.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Observations

Think of anyl−→ with l 6= τ as an observation.

Think of an experiment e as a sequence l1.l2 . . . ln ofobservable actions.

Notation: If s = a1 . . . an ∈ Act∗ then de�ne

s=⇒= (

τ−→)∗a1−→ (

τ−→)∗ . . . (τ−→)∗

an−→ (τ−→)∗

Notice thate

=⇒ for e = l1.l2 . . . ln ∈ L denotes a sequence ofobservable actions inter-spread with τ actions: The notion ofexperiment.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Observations

Think of anyl−→ with l 6= τ as an observation.

Think of an experiment e as a sequence l1.l2 . . . ln ofobservable actions.

Notation: If s = a1 . . . an ∈ Act∗ then de�ne

s=⇒= (

τ−→)∗a1−→ (

τ−→)∗ . . . (τ−→)∗

an−→ (τ−→)∗

Notice thate

=⇒ for e = l1.l2 . . . ln ∈ L denotes a sequence ofobservable actions inter-spread with τ actions: The notion ofexperiment.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Observations

Think of anyl−→ with l 6= τ as an observation.

Think of an experiment e as a sequence l1.l2 . . . ln ofobservable actions.

Notation: If s = a1 . . . an ∈ Act∗ then de�ne

s=⇒= (

τ−→)∗a1−→ (

τ−→)∗ . . . (τ−→)∗

an−→ (τ−→)∗

Notice thate

=⇒ for e = l1.l2 . . . ln ∈ L denotes a sequence ofobservable actions inter-spread with τ actions: The notion ofexperiment.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Trace Equivalence

De�nition (Trace Equivalence)

P and Q are trace equivalent, written P ∼t Q, i� for everyexperiment (here called trace) e = l1 . . . ln ∈ L∗

Pe

=⇒ i� Qe

=⇒

Observations:

τ.P ∼t P (nice!)

a.b.0 + a.c .0 ∼t a.(b.0 + c .0) (not that nice:)

a.b.0 + a.0 ∼t a.b.0 (not sensitive to deadlocks)

a.0 + b.0 ∼t (νc)(c .0 ‖ c.a.0 ‖ c .b.0)

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Trace Equivalence

De�nition (Trace Equivalence)

P and Q are trace equivalent, written P ∼t Q, i� for everyexperiment (here called trace) e = l1 . . . ln ∈ L∗

Pe

=⇒ i� Qe

=⇒

Observations:

τ.P ∼t P (nice!)

a.b.0 + a.c .0 ∼t a.(b.0 + c .0) (not that nice:)

a.b.0 + a.0 ∼t a.b.0 (not sensitive to deadlocks)

a.0 + b.0 ∼t (νc)(c .0 ‖ c.a.0 ‖ c .b.0)

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Failures Equivalence

De�nition (Failures Equivalence)

A pair (e, L), where e ∈ L∗ (a trace) and L ⊂ L, is a failure for Pi� there is P ′ s.t.:

(1)Pe

=⇒ P ′, (2)P ′ 6 l−→ for all l ∈ L, and (3)P ′ 6 τ−→

P ∼f Q i� P and Q have the same failures.

Observations:

τ.P ∼f P .a.b.0 + a.c .0 6∼f a.(b.0 + c .0) (Exercise: why?)a.b.0 + a.0 6∼f a.b.0.a.0 + b.0 6∼f (νc)(c.0 ‖ c .a.0 ‖ c .b.0) (Exercise)a.(b.c.0 + b.d .0) ∼f a.b.c.0 + a.b.d .0.Let D = τ.D. We have τ.0 6∼f D.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Failures Equivalence

De�nition (Failures Equivalence)

A pair (e, L), where e ∈ L∗ (a trace) and L ⊂ L, is a failure for Pi� there is P ′ s.t.:

(1)Pe

=⇒ P ′, (2)P ′ 6 l−→ for all l ∈ L, and (3)P ′ 6 τ−→

P ∼f Q i� P and Q have the same failures.

Observations:

τ.P ∼f P .a.b.0 + a.c .0 6∼f a.(b.0 + c .0) (Exercise: why?)a.b.0 + a.0 6∼f a.b.0.a.0 + b.0 6∼f (νc)(c.0 ‖ c .a.0 ‖ c .b.0) (Exercise)a.(b.c.0 + b.d .0) ∼f a.b.c.0 + a.b.d .0.Let D = τ.D. We have τ.0 6∼f D.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Weak Bisimilarity (Observational Equivalence)

De�nition (Weak Bisimilarity)

A symmetric relation R is a weak bisimulation i� for every(P,Q) ∈ R :

. If Pe

=⇒ P ′ then there is Q ′ s.t. Qe

=⇒ Q ′ and (P ′,Q ′) ∈ R .De�ne P ≈ Q i� (P,Q) ∈ R for some weak bisimulation R.

Observations:

τ.P ≈ P , a.τ.P ≈ a.P

However, a.0 + b.0 6≈ a.0 + τ.b.0

a.(b.c.0 + b.d .0) 6≈ a.b.c .0 + a.b.d .0.(Exercise)

Let D = τ.D. We have τ.0 ≈ D.

a.0 + b.0 6≈ (νc)(c .0 ‖ c.a.0 ‖ c .b.0) (Exercise)CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Weak Bisimilarity (Observational Equivalence)

De�nition (Weak Bisimilarity)

A symmetric relation R is a weak bisimulation i� for every(P,Q) ∈ R :

. If Pe

=⇒ P ′ then there is Q ′ s.t. Qe

=⇒ Q ′ and (P ′,Q ′) ∈ R .De�ne P ≈ Q i� (P,Q) ∈ R for some weak bisimulation R.

Observations:

τ.P ≈ P , a.τ.P ≈ a.P

However, a.0 + b.0 6≈ a.0 + τ.b.0

a.(b.c.0 + b.d .0) 6≈ a.b.c .0 + a.b.d .0.(Exercise)

Let D = τ.D. We have τ.0 ≈ D.

a.0 + b.0 6≈ (νc)(c .0 ‖ c.a.0 ‖ c .b.0) (Exercise)CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Process Logic: Veri�cation and Speci�cation

Processes can be used to specify and verify behaviouralproperties:E.g., 2p.tea.0 + 2p.co�e.0 speci�es a machine which does notsatisfy the behaviour speci�ed by a 2p.(tea.0 + co�e.0).

Alternatively, a logic can be used. An example of a property is�P will never not execute a bad action� or �P eventuallyexecutes execute a good action�.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Process Logic: Veri�cation and Speci�cation

Processes can be used to specify and verify behaviouralproperties:E.g., 2p.tea.0 + 2p.co�e.0 speci�es a machine which does notsatisfy the behaviour speci�ed by a 2p.(tea.0 + co�e.0).

Alternatively, a logic can be used. An example of a property is�P will never not execute a bad action� or �P eventuallyexecutes execute a good action�.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Outline

1 From Computability to Concurrency TheoryBasic Concepts from Automata TheoryBisimilarity Equivalence

2 Calculus of Comunicating Systems CCSGeneral Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

3 Mobility and the pi calculusSyntax and SemanticsApplicationsEquivalences

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Hennessy&Milner Logic

De�nition (Logic Syntax)

F := true | false | F1 ∧ F2 | F1 ∨ F2 | 〈K 〉F | [K ]F

where K is a set of actions

The boolean operators are interpreted as in propositional logic.

〈K 〉F (possibility) asserts (of a given P): It is possible for Pto do a a ∈ K and then evolve into a Q that satisfy F .

[K ]F (necessity) asserts (of a given P): If P can do a a ∈ K

then it must evolve into a Q which satis�es F .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Hennessy&Milner Logic

De�nition (Logic Syntax)

F := true | false | F1 ∧ F2 | F1 ∨ F2 | 〈K 〉F | [K ]F

where K is a set of actions

The boolean operators are interpreted as in propositional logic.

〈K 〉F (possibility) asserts (of a given P): It is possible for Pto do a a ∈ K and then evolve into a Q that satisfy F .

[K ]F (necessity) asserts (of a given P): If P can do a a ∈ K

then it must evolve into a Q which satis�es F .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Hennessy&Milner Logic

De�nition (Logic Syntax)

F := true | false | F1 ∧ F2 | F1 ∨ F2 | 〈K 〉F | [K ]F

where K is a set of actions

The boolean operators are interpreted as in propositional logic.

〈K 〉F (possibility) asserts (of a given P): It is possible for Pto do a a ∈ K and then evolve into a Q that satisfy F .

[K ]F (necessity) asserts (of a given P): If P can do a a ∈ K

then it must evolve into a Q which satis�es F .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Hennessy&Milner Logic

De�nition (Logic Syntax)

F := true | false | F1 ∧ F2 | F1 ∨ F2 | 〈K 〉F | [K ]F

where K is a set of actions

The boolean operators are interpreted as in propositional logic.

〈K 〉F (possibility) asserts (of a given P): It is possible for Pto do a a ∈ K and then evolve into a Q that satisfy F .

[K ]F (necessity) asserts (of a given P): If P can do a a ∈ K

then it must evolve into a Q which satis�es F .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Semantics of Hennessy-Milner Logic

De�nition

The compliance of P with the speci�cation F , written P |= F , isgiven by:

P 6|= false

P |= true

P |= F1 ∧ F2 i� P |= F1 and P |= F2P |= F1 ∨ F2 i� P |= F1 or P |= F2P |= 〈K 〉F i� for some Q, P

a−→ Q, a ∈ K and Q |= F

P |= [K ]F i� if Pa−→ Q and a ∈ K then Q |= F

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Hennessy&Milner Logic and Bisimilarity

Example

Let P1 = a.(b.0 + c .0), P2 = a.b.0 + a.c.0. Also let

F = 〈{a}〉 (〈{b}〉 true∧ 〈{c}〉 true).

Notice that P1 |= F but P2 6|= F .

Theorem

P ∼ Q if and only, for every F , P |= F i� Q |= F .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Hennessy&Milner Logic and Bisimilarity

Example

Let P1 = a.(b.0 + c .0), P2 = a.b.0 + a.c.0. Also let

F = 〈{a}〉 (〈{b}〉 true∧ 〈{c}〉 true).

Notice that P1 |= F but P2 6|= F .

Theorem

P ∼ Q if and only, for every F , P |= F i� Q |= F .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

A Linear Temporal Logic.

De�nition (Logic Syntax)

F := true | false | L | F1 ∨ F2 | F1 ∧ F2 | ♦F | �F

where L is a set of non-silent actions.

Formulae assert properties of traces.

Boolean operators are interpreted as usual

L asserts (of a given trace s) that the �rst action of s must bein L ∪ {τ}♦F asserts (of a given trace s) that at some point in s, Fholds.

�F asserts (of a given trace s) that at every point in s, Fholds.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

A Linear Temporal Logic.

De�nition (Logic Syntax)

F := true | false | L | F1 ∨ F2 | F1 ∧ F2 | ♦F | �F

where L is a set of non-silent actions.

Formulae assert properties of traces.

Boolean operators are interpreted as usual

L asserts (of a given trace s) that the �rst action of s must bein L ∪ {τ}♦F asserts (of a given trace s) that at some point in s, Fholds.

�F asserts (of a given trace s) that at every point in s, Fholds.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

A Linear Temporal Logic.

De�nition (Logic Syntax)

F := true | false | L | F1 ∨ F2 | F1 ∧ F2 | ♦F | �F

where L is a set of non-silent actions.

Formulae assert properties of traces.

Boolean operators are interpreted as usual

L asserts (of a given trace s) that the �rst action of s must bein L ∪ {τ}♦F asserts (of a given trace s) that at some point in s, Fholds.

�F asserts (of a given trace s) that at every point in s, Fholds.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

A Linear Temporal Logic.

De�nition (Logic Syntax)

F := true | false | L | F1 ∨ F2 | F1 ∧ F2 | ♦F | �F

where L is a set of non-silent actions.

Formulae assert properties of traces.

Boolean operators are interpreted as usual

L asserts (of a given trace s) that the �rst action of s must bein L ∪ {τ}♦F asserts (of a given trace s) that at some point in s, Fholds.

�F asserts (of a given trace s) that at every point in s, Fholds.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

A Linear Temporal Logic.

De�nition (Logic Syntax)

F := true | false | L | F1 ∨ F2 | F1 ∧ F2 | ♦F | �F

where L is a set of non-silent actions.

Formulae assert properties of traces.

Boolean operators are interpreted as usual

L asserts (of a given trace s) that the �rst action of s must bein L ∪ {τ}♦F asserts (of a given trace s) that at some point in s, Fholds.

�F asserts (of a given trace s) that at every point in s, Fholds.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Semantics of the temporal logic.

De�nition

An in�nite sequence of actions s = a1.a2 . . . satis�es (or is a modelof) F , written s |= F , i� 〈s, 1〉 |= F , where

〈s, i〉 |= true

〈s, i〉 6|= false

〈s, i〉 |= L i� ai ∈ L ∪ τ〈s, i〉 |= F1 ∨ F2 i� 〈s, i〉 |= F1 or 〈s, i〉 |= F2〈s, i〉 |= F1 ∧ F2 i� 〈s, i〉 |= F1 and 〈s, i〉 |= F2〈s, i〉 |= �F i� for all j ≥ i 〈s, j〉 |= F

〈s, i〉 |= ♦F i� there is a j ≥ i s.t. 〈s, j〉 |= F

P |= F i� whenever Ps

=⇒ then s |= F , where s = s.τ.τ. . . .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Temporal Logic and Trace Equivalence

Example

Consider the trace equivalent processes

A(a, b, c)def

= a.(b.A(a, b, c) + c .A(a, b, c)) and

B(a, b, c)def

= a.b.B(a, b, c) + a.c .B(a, b, c), and the propertyF = �♦(b ∨ c).We have A(a, b, c) |= F and B(a, b, c) |= F .

Theorem

P ∼t Q then for every linear temporal formula F ,

P |= F i� Q |= F

Question. Does the other direction of the theorem hold ?

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Temporal Logic and Trace Equivalence

Example

Consider the trace equivalent processes

A(a, b, c)def

= a.(b.A(a, b, c) + c .A(a, b, c)) and

B(a, b, c)def

= a.b.B(a, b, c) + a.c .B(a, b, c), and the propertyF = �♦(b ∨ c).We have A(a, b, c) |= F and B(a, b, c) |= F .

Theorem

P ∼t Q then for every linear temporal formula F ,

P |= F i� Q |= F

Question. Does the other direction of the theorem hold ?

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

General Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

Temporal Logic and Trace Equivalence

Example

Consider the trace equivalent processes

A(a, b, c)def

= a.(b.A(a, b, c) + c .A(a, b, c)) and

B(a, b, c)def

= a.b.B(a, b, c) + a.c .B(a, b, c), and the propertyF = �♦(b ∨ c).We have A(a, b, c) |= F and B(a, b, c) |= F .

Theorem

P ∼t Q then for every linear temporal formula F ,

P |= F i� Q |= F

Question. Does the other direction of the theorem hold ?

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Outline

1 From Computability to Concurrency TheoryBasic Concepts from Automata TheoryBisimilarity Equivalence

2 Calculus of Comunicating Systems CCSGeneral Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

3 Mobility and the pi calculusSyntax and SemanticsApplicationsEquivalences

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Mobility and the pi calculus

What kind of mobility are we talking about?

Processes move.

Links move√

The last one, because it is the π-calculus' choice; for �exibility andsimplicity.

π-calculus has the ability of sending private and public links

(names).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Mobility and the pi calculus

What kind of mobility are we talking about?

Processes move.

Links move√

The last one, because it is the π-calculus' choice; for �exibility andsimplicity.

π-calculus has the ability of sending private and public links

(names).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Mobility and the pi calculus

What kind of mobility are we talking about?

Processes move.

Links move√

The last one, because it is the π-calculus' choice; for �exibility andsimplicity.

π-calculus has the ability of sending private and public links

(names).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Link Mobility

Mobile phones

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Link Mobility

Mobile phones

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

π−Calculus: Syntax

De�nition (Syntax)

P,Q, . . . := P ‖ Q | Σi∈I α.P | (νa)P | !P | if a = b then P

where α := τ | ab | a(x).

Names=Channels=Ports=Links.

ab.P : �send b on channel a and then activate P�

a(x).P : �receive a name on channel a (if any), and replace x

with it in P�

(νa)P : �create a fresh name a private to P�

(νa)P and a(x).Q are the only binders.

!P : �replicate P� i.e., !P represents P ‖ P ‖ P ‖ . . .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

π−Calculus: Syntax

De�nition (Syntax)

P,Q, . . . := P ‖ Q | Σi∈I α.P | (νa)P | !P | if a = b then P

where α := τ | ab | a(x).

Names=Channels=Ports=Links.

ab.P : �send b on channel a and then activate P�

a(x).P : �receive a name on channel a (if any), and replace x

with it in P�

(νa)P : �create a fresh name a private to P�

(νa)P and a(x).Q are the only binders.

!P : �replicate P� i.e., !P represents P ‖ P ‖ P ‖ . . .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

π−Calculus: Syntax

De�nition (Syntax)

P,Q, . . . := P ‖ Q | Σi∈I α.P | (νa)P | !P | if a = b then P

where α := τ | ab | a(x).

Names=Channels=Ports=Links.

ab.P : �send b on channel a and then activate P�

a(x).P : �receive a name on channel a (if any), and replace x

with it in P�

(νa)P : �create a fresh name a private to P�

(νa)P and a(x).Q are the only binders.

!P : �replicate P� i.e., !P represents P ‖ P ‖ P ‖ . . .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

π−Calculus: Syntax

De�nition (Syntax)

P,Q, . . . := P ‖ Q | Σi∈I α.P | (νa)P | !P | if a = b then P

where α := τ | ab | a(x).

Names=Channels=Ports=Links.

ab.P : �send b on channel a and then activate P�

a(x).P : �receive a name on channel a (if any), and replace x

with it in P�

(νa)P : �create a fresh name a private to P�

(νa)P and a(x).Q are the only binders.

!P : �replicate P� i.e., !P represents P ‖ P ‖ P ‖ . . .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

π−Calculus: Syntax

De�nition (Syntax)

P,Q, . . . := P ‖ Q | Σi∈I α.P | (νa)P | !P | if a = b then P

where α := τ | ab | a(x).

Names=Channels=Ports=Links.

ab.P : �send b on channel a and then activate P�

a(x).P : �receive a name on channel a (if any), and replace x

with it in P�

(νa)P : �create a fresh name a private to P�

(νa)P and a(x).Q are the only binders.

!P : �replicate P� i.e., !P represents P ‖ P ‖ P ‖ . . .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

π−Calculus: Syntax

De�nition (Syntax)

P,Q, . . . := P ‖ Q | Σi∈I α.P | (νa)P | !P | if a = b then P

where α := τ | ab | a(x).

Names=Channels=Ports=Links.

ab.P : �send b on channel a and then activate P�

a(x).P : �receive a name on channel a (if any), and replace x

with it in P�

(νa)P : �create a fresh name a private to P�

(νa)P and a(x).Q are the only binders.

!P : �replicate P� i.e., !P represents P ‖ P ‖ P ‖ . . .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

π−Calculus: Syntax

De�nition (Syntax)

P,Q, . . . := P ‖ Q | Σi∈I α.P | (νa)P | !P | if a = b then P

where α := τ | ab | a(x).

Names=Channels=Ports=Links.

ab.P : �send b on channel a and then activate P�

a(x).P : �receive a name on channel a (if any), and replace x

with it in P�

(νa)P : �create a fresh name a private to P�

(νa)P and a(x).Q are the only binders.

!P : �replicate P� i.e., !P represents P ‖ P ‖ P ‖ . . .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

A �avour of the pi-calculus

In the π calculus:(νa)(ba.S ‖ a(x).P) ‖ b(c).cd .C

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

A �avour of the pi-calculus

In π the pi-calculus:(νa)(ba.S ‖ a(x).P) ‖ b(c).cd .C −→ S ‖ (νa)(a(x).P ‖ ad .C )

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Mobile Exercises

Write an agent that:

reads something from port a and sends it twice along port b

generates in�nitely many di�erent names�and send themalong channel a.

encodes biadic-comunication: xz1z2.P which outputs both y1and y2 on channel x , and x(y1, y2).Q which inputs two namessent on channel x .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Mobile Exercises

Write an agent that:

reads something from port a and sends it twice along port b

generates in�nitely many di�erent names�and send themalong channel a.

encodes biadic-comunication: xz1z2.P which outputs both y1and y2 on channel x , and x(y1, y2).Q which inputs two namessent on channel x .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Mobile Exercises

Write an agent that:

reads something from port a and sends it twice along port b

generates in�nitely many di�erent names�and send themalong channel a.

encodes biadic-comunication: xz1z2.P which outputs both y1and y2 on channel x , and x(y1, y2).Q which inputs two namessent on channel x .

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Reaction Semantics of π.

The reactive semantics of π consists of an structural congruence≡ and the reactive rules.

The relation≡ describes irrelevant syntactic aspects

The reactive semantics describes evolutions due tosynchronous communication.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Reaction Semantics of π.

The reactive semantics of π consists of an structural congruence≡ and the reactive rules.

The relation≡ describes irrelevant syntactic aspects

The reactive semantics describes evolutions due tosynchronous communication.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Reaction Semantics of π.

The reactive semantics of π consists of an structural congruence≡ and the reactive rules.

The relation≡ describes irrelevant syntactic aspects

The reactive semantics describes evolutions due tosynchronous communication.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Structural Equivalence

Structural Congruence

Structural Congruence ≡ is the congruence given by:

P ≡ Q if P can be α-converted into Q.

P ‖ 0 ≡ P , P ‖ Q ≡ Q ‖ P , (P ‖ Q) ‖ R = P ‖ (Q ‖ R).

(νa)0 = 0,(νa)(νb)P ≡ (νb)(νa)P ,

(νa)(P ‖ Q) ≡ P ‖ (νa)Q if a 6∈ fn(P).

!P ≡ P ‖!P .

Example

(1) (νa)P ≡ P if a 6∈ fn(P)?(2) x(y).y(z) ≡ x(z).y(y) ?(3) x ‖ y ≡ x .y + y .x ?

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Structural Equivalence

Structural Congruence

Structural Congruence ≡ is the congruence given by:

P ≡ Q if P can be α-converted into Q.

P ‖ 0 ≡ P , P ‖ Q ≡ Q ‖ P , (P ‖ Q) ‖ R = P ‖ (Q ‖ R).

(νa)0 = 0,(νa)(νb)P ≡ (νb)(νa)P ,

(νa)(P ‖ Q) ≡ P ‖ (νa)Q if a 6∈ fn(P).

!P ≡ P ‖!P .

Example

(1) (νa)P ≡ P if a 6∈ fn(P)?(2) x(y).y(z) ≡ x(z).y(y) ?(3) x ‖ y ≡ x .y + y .x ?

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Reactive Rules

TAUτ.P + M −→ P

REACT(a(x).P + M) ‖ (ab.Q + N) −→ P[b/x] ‖ Q

PARP −→ P′

P ‖ Q −→ P′ ‖ P

RESP −→ P′

(νa)P −→ (νa)P′

STRUCTP ≡ P′ −→ Q′ ≡ Q

P −→ Q

Exercise. Assume a 6∈ fn(S) ∪ fn(C ). Write a derivation for ourServer example:

(νa)(ba.S ‖ a(x).P) ‖ b(c).cd .C −→ S ‖ (νa)(a(x).P ‖ ad .C )

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Outline

1 From Computability to Concurrency TheoryBasic Concepts from Automata TheoryBisimilarity Equivalence

2 Calculus of Comunicating Systems CCSGeneral Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

3 Mobility and the pi calculusSyntax and SemanticsApplicationsEquivalences

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Applications: Persistent and Mutable Data Structures

De�nition

A cell is basis for de�ning mutable and persistent data structures.

Cell(u, r , z)def

= u(z ′).Cell(u, r , z ′) + r(x).xz .Cell(u, r , z)

The cell current contents z can be updated via u or read via r .

But we do not have recursive de�nitions in the π-calculus. Can theabove cell be rewritten in with the π-calculus primitives ?

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Applications: Persistent and Mutable Data Structures

De�nition

A cell is basis for de�ning mutable and persistent data structures.

Cell(u, r , z)def

= u(z ′).Cell(u, r , z ′) + r(x).xz .Cell(u, r , z)

The cell current contents z can be updated via u or read via r .

But we do not have recursive de�nitions in the π-calculus. Can theabove cell be rewritten in with the π-calculus primitives ?

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Recursive De�nitions

We wish invocations A(z) to recursive de�nition (as in CCS)

A(x)def

= P . Do we need to extend the calculus ?No! Jus take an a 6∈ fn(P):

1 Replace in P every invocation A(u) with au. Call P theresulting processes.

1 Encode A(x) = P as !a(x).P .

1 Encode A(z) as (νa)(a(z) ‖!a(x).P).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Recursive De�nitions

We wish invocations A(z) to recursive de�nition (as in CCS)

A(x)def

= P . Do we need to extend the calculus ?No! Jus take an a 6∈ fn(P):

1 Replace in P every invocation A(u) with au. Call P theresulting processes.

1 Encode A(x) = P as !a(x).P .

1 Encode A(z) as (νa)(a(z) ‖!a(x).P).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Recursive De�nitions

We wish invocations A(z) to recursive de�nition (as in CCS)

A(x)def

= P . Do we need to extend the calculus ?No! Jus take an a 6∈ fn(P):

1 Replace in P every invocation A(u) with au. Call P theresulting processes.

1 Encode A(x) = P as !a(x).P .

1 Encode A(z) as (νa)(a(z) ‖!a(x).P).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Recursive De�nitions

We wish invocations A(z) to recursive de�nition (as in CCS)

A(x)def

= P . Do we need to extend the calculus ?No! Jus take an a 6∈ fn(P):

1 Replace in P every invocation A(u) with au. Call P theresulting processes.

1 Encode A(x) = P as !a(x).P .

1 Encode A(z) as (νa)(a(z) ‖!a(x).P).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

π Equivalences

Should P = x(z) ‖ yu be equivalent to Q = x(z).yu + yu.x(z) inπ�like in CCS?

Take R = a(x).P and S = a(x).Q.

Hence, ay can tell R and S apart!. I.e., ay ‖ R .

Passing links around complicates matters�not unduly, though:).Need to consider substitutions, contexts, etc!

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

π Equivalences

Should P = x(z) ‖ yu be equivalent to Q = x(z).yu + yu.x(z) inπ�like in CCS?

Take R = a(x).P and S = a(x).Q.

Hence, ay can tell R and S apart!. I.e., ay ‖ R .

Passing links around complicates matters�not unduly, though:).Need to consider substitutions, contexts, etc!

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

π Equivalences

Should P = x(z) ‖ yu be equivalent to Q = x(z).yu + yu.x(z) inπ�like in CCS?

Take R = a(x).P and S = a(x).Q.

Hence, ay can tell R and S apart!. I.e., ay ‖ R .

Passing links around complicates matters�not unduly, though:).Need to consider substitutions, contexts, etc!

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Outline

1 From Computability to Concurrency TheoryBasic Concepts from Automata TheoryBisimilarity Equivalence

2 Calculus of Comunicating Systems CCSGeneral Aspects of Process CalculiSyntax and SemanticsBisimilarityObservable Behaviour and other EquivalencesVeri�cation and Speci�cation

3 Mobility and the pi calculusSyntax and SemanticsApplicationsEquivalences

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Barbed Equivalence

Intuitively we write P ↓x (P ↓x) i� P can receive (send) a link onchannel x .Formally, P ↓l where l ∈ L is given by:

x(y).P ↓x .xz .P ↓x .Σi∈Iαi .Pi ↓l i� for some i ∈ I , αi .Pi ↓lP ‖ Q ↓l i� either P ↓l or Q ↓l(νz)P ↓l i� l 6= z , l 6= z and P ↓l

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Barbed Equivalence

De�nition

R is a barbed simulation i� for every (P,Q) ∈ R :(1) If P −→ P ′ then ∃Q ′: Q −→ Q ′ ∧ (P ′,Q ′) ∈ R .(2) If P ↓l then Q ↓l .

De�nition

Barbed bisimilarity: P ∼B Q i� there is R such that R and R−1

are barbed simulations and (P,Q) ∈ R .

Example

Let P = x(z) ‖ yu and Q = x(z).yu + yu.x(z). Then P ∼B Q

anda(x).P ∼B a(x).Q.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Barbed Equivalence

De�nition

R is a barbed simulation i� for every (P,Q) ∈ R :(1) If P −→ P ′ then ∃Q ′: Q −→ Q ′ ∧ (P ′,Q ′) ∈ R .(2) If P ↓l then Q ↓l .

De�nition

Barbed bisimilarity: P ∼B Q i� there is R such that R and R−1

are barbed simulations and (P,Q) ∈ R .

Example

Let P = x(z) ‖ yu and Q = x(z).yu + yu.x(z). Then P ∼B Q

anda(x).P ∼B a(x).Q.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Barbed Equivalence

De�nition

R is a barbed simulation i� for every (P,Q) ∈ R :(1) If P −→ P ′ then ∃Q ′: Q −→ Q ′ ∧ (P ′,Q ′) ∈ R .(2) If P ↓l then Q ↓l .

De�nition

Barbed bisimilarity: P ∼B Q i� there is R such that R and R−1

are barbed simulations and (P,Q) ∈ R .

Example

Let P = x(z) ‖ yu and Q = x(z).yu + yu.x(z). Then P ∼B Q

anda(x).P ∼B a(x).Q.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Barbed Congruence.

Let ≈B be the congruence induced by ∼B . I.e:

De�nition

P ≈B Q i� for every context C [.], C [P] ∼B C [Q]

Example

Note that x(z) ‖ yu 6≈B x(z).yu + yu.x(z).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Barbed Congruence.

Let ≈B be the congruence induced by ∼B . I.e:

De�nition

P ≈B Q i� for every context C [.], C [P] ∼B C [Q]

Example

Note that x(z) ‖ yu 6≈B x(z).yu + yu.x(z).

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

A Labelled Semantics for Pi.

Transitions Pα−→ Q where α ∈ {ab, a(x), τ, a νu} are given by:

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Early Bisimilarity for Pi

De�nition

R is a simulation i� for ∀(P,Q) ∈ R :If P

α−→ P ′ then(1) If α is an input a(x) then ∀u, ∃Q ′:Q

α−→ Q ′ ∧ (P ′[u/x ],Q ′[u/x ]) ∈ R

(2) If α is not an input then ∃Q : Qα−→ Q ′ ∧ (P ′,Q ′) ∈ R

.

De�nition

(Early) Bisimilarity: P ∼E Q i� there is R such R and R−1 aresimulations and (P,Q) ∈ R .

Example: Let P = x(z) ‖ yu and Q = x(z).yu + yu.x(z).Then a(x).P 6∼E a(x).Q but P ∼E Q.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Early Congruence for Pi.

De�nition

De�ne P ≈E Q i� Pσ ∼E Qσ for all substitutions σ.

Example: Note that x(z) ‖ yu 6≈E x(z).yu + yu.x(z). In fact,

The relation ≈E is a congruence. Furthermore ≈E=≈B !.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Thanks

Example

On �rst slide.

Example

On second slide.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Thanks

Example

On �rst slide.

Example

On second slide.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Make Titles Informative.

Theorem

On �rst slide.

Corollary

On second slide.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Make Titles Informative.

Theorem

On �rst slide.

Corollary

On second slide.

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Make Titles Informative.

Theorem

In left column.

Corollary

In right column.

New line

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Syntax and SemanticsApplicationsEquivalences

Make Titles Informative.

Theorem

In left column.

Corollary

In right column.

New line

CLEI'05 Cali Communicating and Mobile Systems

From Computability to Concurrency TheoryCalculus of Comunicating Systems CCS

Mobility and the pi calculusSummary

Summary

The �rst main message of your talk in one or two lines.

The second main message of your talk in one or two lines.

Perhaps a third message, but not more than that.

Outlook

What we have not done yet.

Even more stu�.

CLEI'05 Cali Communicating and Mobile Systems