concurrency 3 - ccs - syntax and transitions,...

62
Introduction Syntax and Operational Semantics of CCS Concurrency 3 CCS - Syntax and transitions, Equivalences Catuscia Palamidessi INRIA Futurs and LIX - Ecole Polytechnique The other lecturers for this course: Jean-Jacques Lévy (INRIA Rocquencourt) James Leifer (INRIA Rocquencourt) Eric Goubault (CEA) http://pauillac.inria.fr/˜leifer/teaching/mpri-concurrency-2005/

Upload: dophuc

Post on 11-Sep-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Concurrency 3CCS - Syntax and transitions, Equivalences

Catuscia PalamidessiINRIA Futurs and LIX - Ecole Polytechnique

The other lecturers for this course:

Jean-Jacques Lévy (INRIA Rocquencourt)James Leifer (INRIA Rocquencourt)

Eric Goubault (CEA)

http://pauillac.inria.fr/˜leifer/teaching/mpri-concurrency-2005/

Page 2: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Outline

1 IntroductionMotivationsPrinciples in CCS design

2 Syntax and Operational Semantics of CCSSyntaxLabeled transition SystemWhat equivalence for CCS?

Page 3: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Outline

1 IntroductionMotivationsPrinciples in CCS design

2 Syntax and Operational Semantics of CCSSyntaxLabeled transition SystemWhat equivalence for CCS?

Page 4: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Why a Calculus for Concurrency?

The Calculus for Communicating Systems (CCS) wasdeveloped by R. Milner around the 80’s.Other Process Calculi were proposed at about the sametime: the Theory of Communicating Sequential Processesby T. Hoare and the Algebra of Communicating Processesby J. Bergstra and J.W. Klop.Researchers were looking for a calculus with few,orthogonal mechanisms, able to represent all the relevantconcepts of concurrent computations. More complexmechanisms should be built by using the basic ones.

To help understanding / reasoning about / developingformal tools for concurrency.To play a role, for concurrency, like that of the λ-calculus forsequential computation.

Page 5: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Inadequacy of standard models of computations

The λ calculus, the Turing machines, etc. are computationallycomplete, yet do not capture the features of concurrentcomputations like

Interaction and communicationInadequacy of functional denotationNondeterminism

Note: nondeterminism in concurrency is different from thenondeterminism used in Formal Languages, like for instancethe Nondeterministic Turing Machines.

Page 6: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

A few words about nondeterminism

In standard computationtheory, if we want to computethe partial function f s.t.f (0) = 1, a Turing Machinelike this one is considered ok

However, we would not behappy with a coffee machinethat behaves in the sameway

1

0

success

fail

Page 7: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

A few words about nondeterminism

In standard computationtheory, if we want to computethe partial function f s.t.f (0) = 1, a Turing Machinelike this one is considered ok

However, we would not behappy with a coffee machinethat behaves in the sameway

1

0

success

fail

success

fail

coin

coffee

coin

Page 8: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Nondeterminism in sequential models

Convenient tool for solving certain problems in an easyway or for characterizing complexity classes (examples:search for a path in a graph, search for a proof etc.)

Examples of nondeterministic formalisms:The nondeterminismistic Turing machinesLogic languages like Prolog and λ Prolog

The characteristics of nondeterminism in this setting:It can be eliminated without loss of computational power byusing backtracking.Failures don’t matter: all what we are interested on is theexistence of succesful computations. A failure is reportedonly if all possible alternatives fail.

Page 9: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Nondeterminism in sequential models

Convenient tool for solving certain problems in an easyway or for characterizing complexity classes (examples:search for a path in a graph, search for a proof etc.)

Examples of nondeterministic formalisms:The nondeterminismistic Turing machinesLogic languages like Prolog and λ Prolog

The characteristics of nondeterminism in this setting:It can be eliminated without loss of computational power byusing backtracking.Failures don’t matter: all what we are interested on is theexistence of succesful computations. A failure is reportedonly if all possible alternatives fail.

Page 10: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Nondeterminism in sequential models

Convenient tool for solving certain problems in an easyway or for characterizing complexity classes (examples:search for a path in a graph, search for a proof etc.)

Examples of nondeterministic formalisms:The nondeterminismistic Turing machinesLogic languages like Prolog and λ Prolog

The characteristics of nondeterminism in this setting:It can be eliminated without loss of computational power byusing backtracking.Failures don’t matter: all what we are interested on is theexistence of succesful computations. A failure is reportedonly if all possible alternatives fail.

Page 11: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Nondeterminism in sequential models

Convenient tool for solving certain problems in an easyway or for characterizing complexity classes (examples:search for a path in a graph, search for a proof etc.)

Examples of nondeterministic formalisms:The nondeterminismistic Turing machinesLogic languages like Prolog and λ Prolog

The characteristics of nondeterminism in this setting:It can be eliminated without loss of computational power byusing backtracking.Failures don’t matter: all what we are interested on is theexistence of succesful computations. A failure is reportedonly if all possible alternatives fail.

Page 12: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Nondeterminism in sequential models

Convenient tool for solving certain problems in an easyway or for characterizing complexity classes (examples:search for a path in a graph, search for a proof etc.)

Examples of nondeterministic formalisms:The nondeterminismistic Turing machinesLogic languages like Prolog and λ Prolog

The characteristics of nondeterminism in this setting:It can be eliminated without loss of computational power byusing backtracking.Failures don’t matter: all what we are interested on is theexistence of succesful computations. A failure is reportedonly if all possible alternatives fail.

Page 13: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Nondeterminism in sequential models

Convenient tool for solving certain problems in an easyway or for characterizing complexity classes (examples:search for a path in a graph, search for a proof etc.)

Examples of nondeterministic formalisms:The nondeterminismistic Turing machinesLogic languages like Prolog and λ Prolog

The characteristics of nondeterminism in this setting:It can be eliminated without loss of computational power byusing backtracking.Failures don’t matter: all what we are interested on is theexistence of succesful computations. A failure is reportedonly if all possible alternatives fail.

Page 14: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Nondeterminism in sequential models

Convenient tool for solving certain problems in an easyway or for characterizing complexity classes (examples:search for a path in a graph, search for a proof etc.)

Examples of nondeterministic formalisms:The nondeterminismistic Turing machinesLogic languages like Prolog and λ Prolog

The characteristics of nondeterminism in this setting:It can be eliminated without loss of computational power byusing backtracking.Failures don’t matter: all what we are interested on is theexistence of succesful computations. A failure is reportedonly if all possible alternatives fail.

Page 15: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Nondeterminism in concurrent models

Nondeterminism may arise because of interaction betweenprocesses.

The characteristics of nondeterminism in this setting:

It cannot be avoided. At least, not without loosing essentialparts of expressive power. All interesting models ofconcurrency cope with nondeterminism.Failures do matter. Chosing the wrong branch might bringto an "undesirable situation". Backtracking is usually notapplicable (or very costly), because the control isdistributed: we should restart not one but severalprocesses.

Hence controlling nondeterminism is very important. Insequential programming is just a matter of efficiency, here is amatter of avoiding getting stuck in a wrong situation.

Page 16: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Nondeterminism in concurrent models

Nondeterminism may arise because of interaction betweenprocesses.

The characteristics of nondeterminism in this setting:

It cannot be avoided. At least, not without loosing essentialparts of expressive power. All interesting models ofconcurrency cope with nondeterminism.Failures do matter. Chosing the wrong branch might bringto an "undesirable situation". Backtracking is usually notapplicable (or very costly), because the control isdistributed: we should restart not one but severalprocesses.

Hence controlling nondeterminism is very important. Insequential programming is just a matter of efficiency, here is amatter of avoiding getting stuck in a wrong situation.

Page 17: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Nondeterminism in concurrent models

Nondeterminism may arise because of interaction betweenprocesses.

The characteristics of nondeterminism in this setting:

It cannot be avoided. At least, not without loosing essentialparts of expressive power. All interesting models ofconcurrency cope with nondeterminism.Failures do matter. Chosing the wrong branch might bringto an "undesirable situation". Backtracking is usually notapplicable (or very costly), because the control isdistributed: we should restart not one but severalprocesses.

Hence controlling nondeterminism is very important. Insequential programming is just a matter of efficiency, here is amatter of avoiding getting stuck in a wrong situation.

Page 18: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Nondeterminism in concurrent models

Nondeterminism may arise because of interaction betweenprocesses.

The characteristics of nondeterminism in this setting:

It cannot be avoided. At least, not without loosing essentialparts of expressive power. All interesting models ofconcurrency cope with nondeterminism.Failures do matter. Chosing the wrong branch might bringto an "undesirable situation". Backtracking is usually notapplicable (or very costly), because the control isdistributed: we should restart not one but severalprocesses.

Hence controlling nondeterminism is very important. Insequential programming is just a matter of efficiency, here is amatter of avoiding getting stuck in a wrong situation.

Page 19: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Motivations

Nondeterminism in concurrent models

Nondeterminism may arise because of interaction betweenprocesses.

The characteristics of nondeterminism in this setting:

It cannot be avoided. At least, not without loosing essentialparts of expressive power. All interesting models ofconcurrency cope with nondeterminism.Failures do matter. Chosing the wrong branch might bringto an "undesirable situation". Backtracking is usually notapplicable (or very costly), because the control isdistributed: we should restart not one but severalprocesses.

Hence controlling nondeterminism is very important. Insequential programming is just a matter of efficiency, here is amatter of avoiding getting stuck in a wrong situation.

Page 20: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

Outline

1 IntroductionMotivationsPrinciples in CCS design

2 Syntax and Operational Semantics of CCSSyntaxLabeled transition SystemWhat equivalence for CCS?

Page 21: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (1/2)

A calculus should contain only the primary constructs. Forinstance, the primary form of interaction. But what is the primaryform of interaction?

In general, concurrent languages can offer various kinds ofcommunication. For instance:

Communications via shared memory.Communication via channels.Communication via broadcasting.

and we could make even more distinctionsone-to-one / one-to-manyOrdered / unordered (i.e. queues / bags)Bounded / unbounded.

So what is the basic kind of communication?

For CCS the answer was: none of the above!

Page 22: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (1/2)

A calculus should contain only the primary constructs. Forinstance, the primary form of interaction. But what is the primaryform of interaction?

In general, concurrent languages can offer various kinds ofcommunication. For instance:

Communications via shared memory.Communication via channels.Communication via broadcasting.

and we could make even more distinctionsone-to-one / one-to-manyOrdered / unordered (i.e. queues / bags)Bounded / unbounded.

So what is the basic kind of communication?

For CCS the answer was: none of the above!

Page 23: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (1/2)

A calculus should contain only the primary constructs. Forinstance, the primary form of interaction. But what is the primaryform of interaction?

In general, concurrent languages can offer various kinds ofcommunication. For instance:

Communications via shared memory.Communication via channels.Communication via broadcasting.

and we could make even more distinctionsone-to-one / one-to-manyOrdered / unordered (i.e. queues / bags)Bounded / unbounded.

So what is the basic kind of communication?

For CCS the answer was: none of the above!

Page 24: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (1/2)

A calculus should contain only the primary constructs. Forinstance, the primary form of interaction. But what is the primaryform of interaction?

In general, concurrent languages can offer various kinds ofcommunication. For instance:

Communications via shared memory.Communication via channels.Communication via broadcasting.

and we could make even more distinctionsone-to-one / one-to-manyOrdered / unordered (i.e. queues / bags)Bounded / unbounded.

So what is the basic kind of communication?

For CCS the answer was: none of the above!

Page 25: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (1/2)

A calculus should contain only the primary constructs. Forinstance, the primary form of interaction. But what is the primaryform of interaction?

In general, concurrent languages can offer various kinds ofcommunication. For instance:

Communications via shared memory.Communication via channels.Communication via broadcasting.

and we could make even more distinctionsone-to-one / one-to-manyOrdered / unordered (i.e. queues / bags)Bounded / unbounded.

So what is the basic kind of communication?

For CCS the answer was: none of the above!

Page 26: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (1/2)

A calculus should contain only the primary constructs. Forinstance, the primary form of interaction. But what is the primaryform of interaction?

In general, concurrent languages can offer various kinds ofcommunication. For instance:

Communications via shared memory.Communication via channels.Communication via broadcasting.

and we could make even more distinctionsone-to-one / one-to-manyOrdered / unordered (i.e. queues / bags)Bounded / unbounded.

So what is the basic kind of communication?

For CCS the answer was: none of the above!

Page 27: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (1/2)

A calculus should contain only the primary constructs. Forinstance, the primary form of interaction. But what is the primaryform of interaction?

In general, concurrent languages can offer various kinds ofcommunication. For instance:

Communications via shared memory.Communication via channels.Communication via broadcasting.

and we could make even more distinctionsone-to-one / one-to-manyOrdered / unordered (i.e. queues / bags)Bounded / unbounded.

So what is the basic kind of communication?

For CCS the answer was: none of the above!

Page 28: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (1/2)

A calculus should contain only the primary constructs. Forinstance, the primary form of interaction. But what is the primaryform of interaction?

In general, concurrent languages can offer various kinds ofcommunication. For instance:

Communications via shared memory.Communication via channels.Communication via broadcasting.

and we could make even more distinctionsone-to-one / one-to-manyOrdered / unordered (i.e. queues / bags)Bounded / unbounded.

So what is the basic kind of communication?

For CCS the answer was: none of the above!

Page 29: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (1/2)

A calculus should contain only the primary constructs. Forinstance, the primary form of interaction. But what is the primaryform of interaction?

In general, concurrent languages can offer various kinds ofcommunication. For instance:

Communications via shared memory.Communication via channels.Communication via broadcasting.

and we could make even more distinctionsone-to-one / one-to-manyOrdered / unordered (i.e. queues / bags)Bounded / unbounded.

So what is the basic kind of communication?

For CCS the answer was: none of the above!

Page 30: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (1/2)

A calculus should contain only the primary constructs. Forinstance, the primary form of interaction. But what is the primaryform of interaction?

In general, concurrent languages can offer various kinds ofcommunication. For instance:

Communications via shared memory.Communication via channels.Communication via broadcasting.

and we could make even more distinctionsone-to-one / one-to-manyOrdered / unordered (i.e. queues / bags)Bounded / unbounded.

So what is the basic kind of communication?

For CCS the answer was: none of the above!

Page 31: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (2/2)

In CCS, the fundamental model of interaction is synchronous andsymmetric, i.e. the partners act at the same time performingcomplementary actions.

This kind of interaction is called handshaking: the partners agreesimoultaneously on performing the two (complementary) actions.

In Java there is a separation between active objects (threads) andpassive objects (resources). CCS avoids this separation: Every(non-elementary) entity is a process.

For instance, consider two proceesses P and Q communicating via abuffer B. in CCS also B is a process and the communication is betweenP and B, and between Q and B.

Page 32: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (2/2)

In CCS, the fundamental model of interaction is synchronous andsymmetric, i.e. the partners act at the same time performingcomplementary actions.

This kind of interaction is called handshaking: the partners agreesimoultaneously on performing the two (complementary) actions.

In Java there is a separation between active objects (threads) andpassive objects (resources). CCS avoids this separation: Every(non-elementary) entity is a process.

For instance, consider two proceesses P and Q communicating via abuffer B. in CCS also B is a process and the communication is betweenP and B, and between Q and B.

Page 33: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (2/2)

In CCS, the fundamental model of interaction is synchronous andsymmetric, i.e. the partners act at the same time performingcomplementary actions.

This kind of interaction is called handshaking: the partners agreesimoultaneously on performing the two (complementary) actions.

In Java there is a separation between active objects (threads) andpassive objects (resources). CCS avoids this separation: Every(non-elementary) entity is a process.

For instance, consider two proceesses P and Q communicating via abuffer B. in CCS also B is a process and the communication is betweenP and B, and between Q and B.

Page 34: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

The basic kind of interaction (2/2)

In CCS, the fundamental model of interaction is synchronous andsymmetric, i.e. the partners act at the same time performingcomplementary actions.

This kind of interaction is called handshaking: the partners agreesimoultaneously on performing the two (complementary) actions.

In Java there is a separation between active objects (threads) andpassive objects (resources). CCS avoids this separation: Every(non-elementary) entity is a process.

For instance, consider two proceesses P and Q communicating via abuffer B. in CCS also B is a process and the communication is betweenP and B, and between Q and B.

Page 35: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Principles in CCS design

Example: P and Q communicating via a buffer B

P QBa b

ports (or channels)

let B = a(x).b(x).B , P = a(d).P' , Q = b(y).Q'[y]

in P | B | Q

sequential operatorparallel operator co-actions

Page 36: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Syntax

Outline

1 IntroductionMotivationsPrinciples in CCS design

2 Syntax and Operational Semantics of CCSSyntaxLabeled transition SystemWhat equivalence for CCS?

Page 37: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Syntax

Syntax of CCS

(channel, port) names: a, b, c, . . .

co-names: a, b, c, . . . Note: ¯a = a

silent action: τ

actions, prefixes: µ ::= a | a | τ

processes: P, Q ::= 0 inaction| µ.P prefix| P | Q parallel| P + Q (external) choice| (νa)P restriction| recK P process P with definition K = P| K (defined) process name

Page 38: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Syntax

Syntax of CCS

(channel, port) names: a, b, c, . . .

co-names: a, b, c, . . . Note: ¯a = a

silent action: τ

actions, prefixes: µ ::= a | a | τ

processes: P, Q ::= 0 inaction| µ.P prefix| P | Q parallel| P + Q (external) choice| (νa)P restriction| recK P process P with definition K = P| K (defined) process name

Page 39: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Syntax

Syntax of CCS

(channel, port) names: a, b, c, . . .

co-names: a, b, c, . . . Note: ¯a = a

silent action: τ

actions, prefixes: µ ::= a | a | τ

processes: P, Q ::= 0 inaction| µ.P prefix| P | Q parallel| P + Q (external) choice| (νa)P restriction| recK P process P with definition K = P| K (defined) process name

Page 40: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Syntax

Syntax of CCS

(channel, port) names: a, b, c, . . .

co-names: a, b, c, . . . Note: ¯a = a

silent action: τ

actions, prefixes: µ ::= a | a | τ

processes: P, Q ::= 0 inaction| µ.P prefix| P | Q parallel| P + Q (external) choice| (νa)P restriction| recK P process P with definition K = P| K (defined) process name

Page 41: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Syntax

Syntax of CCS

(channel, port) names: a, b, c, . . .

co-names: a, b, c, . . . Note: ¯a = a

silent action: τ

actions, prefixes: µ ::= a | a | τ

processes: P, Q ::= 0 inaction| µ.P prefix| P | Q parallel| P + Q (external) choice| (νa)P restriction| recK P process P with definition K = P| K (defined) process name

Page 42: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Syntax

Syntax of CCS

(channel, port) names: a, b, c, . . .

co-names: a, b, c, . . . Note: ¯a = a

silent action: τ

actions, prefixes: µ ::= a | a | τ

processes: P, Q ::= 0 inaction| µ.P prefix| P | Q parallel| P + Q (external) choice| (νa)P restriction| recK P process P with definition K = P| K (defined) process name

Page 43: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Labeled transition System

Outline

1 IntroductionMotivationsPrinciples in CCS design

2 Syntax and Operational Semantics of CCSSyntaxLabeled transition SystemWhat equivalence for CCS?

Page 44: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Labeled transition System

Labeled transition system

The semantics of CCS is defined by in terms of a labeledtransition system, which is a set of triples of the form

Pµ→ Q

Meaning: P evolves into Q by making the action µ.

The presence of the label µ allows us to keep track of theinteraction capabilities with the environment.

Page 45: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Labeled transition System

Structural operational semantics

The transitions of CCS are defined by a set of inductive rules.The system is also called structural semantics because theevolution of a process is defined in terms of the evolution of itscomponents.

[Act]µ.P

µ→ P[Res] P

µ→ P′ µ 6=a,a(νa)P

µ→ (νa)P′

[Sum1] Pµ→ P′

P+Qµ→ P′

[Sum2] Qµ→ Q′

P+Qµ→ Q′

[Par1] Pµ→ P′

P|Q µ→ P′|Q[Par2] Q

µ→ Q′

P|Q µ→ P|Q′

[Com] P a→ P′ Q a→ Q′

P|Q τ→ P′|Q′ [Rec] P[recK P/K ]µ→ P′

recK Pµ→ P′

Page 46: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Labeled transition System

Structural operational semantics

The transitions of CCS are defined by a set of inductive rules.The system is also called structural semantics because theevolution of a process is defined in terms of the evolution of itscomponents.

[Act]µ.P

µ→ P[Res] P

µ→ P′ µ 6=a,a(νa)P

µ→ (νa)P′

[Sum1] Pµ→ P′

P+Qµ→ P′

[Sum2] Qµ→ Q′

P+Qµ→ Q′

[Par1] Pµ→ P′

P|Q µ→ P′|Q[Par2] Q

µ→ Q′

P|Q µ→ P|Q′

[Com] P a→ P′ Q a→ Q′

P|Q τ→ P′|Q′ [Rec] P[recK P/K ]µ→ P′

recK Pµ→ P′

Page 47: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Labeled transition System

Some examples

(v a) (a.0 | a.0)

(va) (0 | 0)

ta.0 | 0

a

a.0 | a.0

a

a

0 | a.0

a

0 | 0

t

rec a.kk

a

rec a.k + b.0k

a

b

rec a.k | a.k

ak

a

a

aa

The restriction can be

used to enforce

synchronization

The parallel operator

may cause infinitely

many different states

The fragment of the

calculus without parallel

operator generates only

finite automata / regular

trees

Page 48: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Labeled transition System

Some examples

(v a) (a.0 | a.0)

(va) (0 | 0)

ta.0 | 0

a

a.0 | a.0

a

a

0 | a.0

a

0 | 0

t

rec a.kk

a

rec a.k + b.0k

a

b

rec a.k | a.k

ak

a

a

aa

The restriction can be

used to enforce

synchronization

The parallel operator

may cause infinitely

many different states

The fragment of the

calculus without parallel

operator generates only

finite automata / regular

trees

Page 49: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Labeled transition System

Some examples

(v a) (a.0 | a.0)

(va) (0 | 0)

ta.0 | 0

a

a.0 | a.0

a

a

0 | a.0

a

0 | 0

t

rec a.kk

a

rec a.k + b.0k

a

b

rec a.k | a.k

ak

a

a

aa

The restriction can be

used to enforce

synchronization

The parallel operator

may cause infinitely

many different states

The fragment of the

calculus without parallel

operator generates only

finite automata / regular

trees

Page 50: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

Labeled transition System

Some examples

(v a) (a.0 | a.0)

(va) (0 | 0)

ta.0 | 0

a

a.0 | a.0

a

a

0 | a.0

a

0 | 0

t

rec a.kk

a

rec a.k + b.0k

a

b

rec a.k | a.k

ak

a

a

aa

The restriction can be

used to enforce

synchronization

The parallel operator

may cause infinitely

many different states

The fragment of the

calculus without parallel

operator generates only

finite automata / regular

trees

Page 51: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

What equivalence for CCS?

Outline

1 IntroductionMotivationsPrinciples in CCS design

2 Syntax and Operational Semantics of CCSSyntaxLabeled transition SystemWhat equivalence for CCS?

Page 52: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

What equivalence for CCS?

Motivation

It is important to define formally when two system can beconsidered equivalent

There may be various "interesting" notion of equivalence, itdepends on what we want (which observables we want topreserve)

A good notion of equivalence should be a congruence, soto allow modular verification

Page 53: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

What equivalence for CCS?

Motivation

It is important to define formally when two system can beconsidered equivalent

There may be various "interesting" notion of equivalence, itdepends on what we want (which observables we want topreserve)

A good notion of equivalence should be a congruence, soto allow modular verification

Page 54: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

What equivalence for CCS?

Motivation

It is important to define formally when two system can beconsidered equivalent

There may be various "interesting" notion of equivalence, itdepends on what we want (which observables we want topreserve)

A good notion of equivalence should be a congruence, soto allow modular verification

Page 55: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

What equivalence for CCS?

Motivation

It is important to define formally when two system can beconsidered equivalent

There may be various "interesting" notion of equivalence, itdepends on what we want (which observables we want topreserve)

A good notion of equivalence should be a congruence, soto allow modular verification

Page 56: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

What equivalence for CCS?

Examples: possible definitions of a coffee machine

recK coin.(coffee.ccup.K + tea.tcup.K )

coin.recK (coffee.ccup.coin.K + tea.tcup.coin.K )

recK (coin.coffee.ccup.K + coin.tea.tcup.K )

Question: which of these machines can we safely considerequivalent?

Note that these machines have all the same traces.

Page 57: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

What equivalence for CCS?

Examples: possible definitions of a coffee machine

recK coin.(coffee.ccup.K + tea.tcup.K )

coin.recK (coffee.ccup.coin.K + tea.tcup.coin.K )

recK (coin.coffee.ccup.K + coin.tea.tcup.K )

Question: which of these machines can we safely considerequivalent?

Note that these machines have all the same traces.

Page 58: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

What equivalence for CCS?

Examples: possible definitions of a coffee machine

recK coin.(coffee.ccup.K + tea.tcup.K )

coin.recK (coffee.ccup.coin.K + tea.tcup.coin.K )

recK (coin.coffee.ccup.K + coin.tea.tcup.K )

Question: which of these machines can we safely considerequivalent?

Note that these machines have all the same traces.

Page 59: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

What equivalence for CCS?

Examples: possible definitions of a coffee machine

recK coin.(coffee.ccup.K + tea.tcup.K )

coin.recK (coffee.ccup.coin.K + tea.tcup.coin.K )

recK (coin.coffee.ccup.K + coin.tea.tcup.K )

Question: which of these machines can we safely considerequivalent?

Note that these machines have all the same traces.

Page 60: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

What equivalence for CCS?

Examples: possible definitions of a coffee machine

recK coin.(coffee.ccup.K + tea.tcup.K )

coin.recK (coffee.ccup.coin.K + tea.tcup.coin.K )

recK (coin.coffee.ccup.K + coin.tea.tcup.K )

Question: which of these machines can we safely considerequivalent?

Note that these machines have all the same traces.

Page 61: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

What equivalence for CCS?

Examples: possible definitions of a coffee machine

recK coin.(coffee.ccup.K + tea.tcup.K )

coin.recK (coffee.ccup.coin.K + tea.tcup.coin.K )

recK (coin.coffee.ccup.K + coin.tea.tcup.K )

Question: which of these machines can we safely considerequivalent?

Note that these machines have all the same traces.

Page 62: Concurrency 3 - CCS - Syntax and transitions, …pauillac.inria.fr/~leifer/teaching/mpri-concurrency-2005/c3/cours.pdf · Logic languages like Prolog and λ Prolog The characteristics

Introduction Syntax and Operational Semantics of CCS

What equivalence for CCS?

Exercises

Define in CCS a semaphore with initial value nShow that maximal trace equivalence is not a congruencein CCS. By maximal traces here we mean the traces of allpossible (finite or infinite) maximal runs.