consurrent processes and reaction

32
Concurrent Processes and Reaction John Justine Villar Jhoirene Clemente January 10, 2013 John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 1 / 30

Upload: jhoirene-clemente

Post on 04-Jul-2015

245 views

Category:

Documents


0 download

DESCRIPTION

Presentation is based from Robin Milner's Communicating ang Mobile Systems: the Pi-calculus

TRANSCRIPT

Page 1: Consurrent Processes and Reaction

Concurrent Processes and Reaction

John Justine Villar Jhoirene Clemente

January 10, 2013

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 1 / 30

Page 2: Consurrent Processes and Reaction

Sequential Process Expression

A Process Expression carries information about both the behaviour and thestructure of the system.

Definition 1 (Sequential Process Expression)

The set Pseq of sequential process expressions is defined by the followingsyntax: P ::= A < a1, . . . , an > |

∑i∈I αi.Pi where I is any finite indexing

set. We use P, Q, Pi, . . . to stand for process expressions.

Here are some notations defined in Section 3.

Process identifiers: A, B, . . .

Process with name parameters: A < a, b, c >

We write ~a to denote a sequence of names a1, a2, . . . , an

The notation {~b/~a}P means replacing ai by bi in P where 1 ≤ i ≤ n.

The notation fn(P) denotes the set of names which occur in a processexpression. (‘fn’ stands for free names)

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 2 / 30

Page 3: Consurrent Processes and Reaction

Sequential Process Expression

We also assume that every process identifier A has a defining equation of theform

A(~a)def= PA

where PA is a summation, and the names ~a = a1, . . . , an include all the freenames fn(PA) of PA.

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 3 / 30

Page 4: Consurrent Processes and Reaction

Labels and Flowgraphs

Outline

1 Labels and Flowgraphs

2 Observation and Reactions

3 Concurrency Process Expressions

4 Structural Congruence

5 Reaction Rules

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 4 / 30

Page 5: Consurrent Processes and Reaction

Labels and Flowgraphs

Labels and Flowgraphs

Definition 2 (Labels)Label L is the union of the set of names and co-names.

Ldef= N ∪ N

where N is an infinite set of names,N is and infinite set of co-names, andN ∩ N = ∅.

Labels are used in Labelled Transition Systems (LTS).Labels are used as buttons of black boxes.

We call a the complement of a.As an extension of complementation,

¯adef= a

.John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 5 / 30

Page 6: Consurrent Processes and Reaction

Labels and Flowgraphs

Labels and Flowgraphs

Figure: Black box A with buttons a and b.

Every complementary pair (a, a) of labels will represent a means ofinteraction between black boxes. So if we have another black box B withbuttons b and c, we have the following system.

Figure: The system containing black box A and B with interaction on thecomplementary pair (b, b).

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 6 / 30

Page 7: Consurrent Processes and Reaction

Labels and Flowgraphs

Labels and Flowgraphs

This is an example of a single flowgraph.

Figure: The system containing black box A and B with interaction on thecomplementary pair (b, b).

Definition 3 (Flowgraph)Flowgraph depicts the structure of a system, i.e. linkage among itscomponents.

Flowgraphs should not be confused with transition systems.Flowgraphs do not depict the dynamic property of a system.John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 7 / 30

Page 8: Consurrent Processes and Reaction

Labels and Flowgraphs

Labels and Flowgraphs

Here is another example of a flowgraph

Figure: System containing a scheduler with client processes P1, . . . ,Pn.

Note that each Pi may have many other labelled ports and a port may bear anynumber of arcs.John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 8 / 30

Page 9: Consurrent Processes and Reaction

Observation and Reactions

Outline

1 Labels and Flowgraphs

2 Observation and Reactions

3 Concurrency Process Expressions

4 Structural Congruence

5 Reaction Rules

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 9 / 30

Page 10: Consurrent Processes and Reaction

Observation and Reactions

Observation and Reactions

The complementary label (b, b) is not to be thought of as a buffer or channelhaving some capacity. It is a means of synchronized action or handshake.Suppose we think of black boxes A and B as separate sequential processes.The defining equations are

Adef= a.A′

A′def= b.A

Bdef= b.B′

B′def= c.B

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 10 / 30

Page 11: Consurrent Processes and Reaction

Observation and Reactions

Observation and Reactions

The composite system consisting of A and B running concurrently, with nointerdependence except that any action b by A must be synchronized with anaction b by B and conversely.

the transition a occurs, leading to states A′ and B holding simultaneously;the shared transition occurs, leading to A and B′;the transitions a and c occur in either order, or simultaneously, leading toA′ and B again;and so on.

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 11 / 30

Page 12: Consurrent Processes and Reaction

Observation and Reactions

Observation and Reactions

We shall think of the labels b and b as representing observable actions, orobservations.

We observe b by interactingwith it, i.e. by performingits complement b, and conversely.Observations = InteractionsThe shared transition in the figureabove is unobservable; we can think of it as internal action or a reaction.

Definition 4 (Reaction)Reaction is the interaction (i.e. mutual observation) between two componentsof the system, which will be denoted as τ ; being unobservable, it has nocomplement.

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 12 / 30

Page 13: Consurrent Processes and Reaction

Observation and Reactions

Observation and Reactions

Definition 5 (Act)

Actdef= L ∪ {τ}

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 13 / 30

Page 14: Consurrent Processes and Reaction

Concurrency Process Expressions

Outline

1 Labels and Flowgraphs

2 Observation and Reactions

3 Concurrency Process Expressions

4 Structural Congruence

5 Reaction Rules

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 14 / 30

Page 15: Consurrent Processes and Reaction

Concurrency Process Expressions

Concurrency Process Expressions

Summation∑i∈I αi.Pi

CompositionP | QRestriction(new a) P, where a is a bound name and fn(P) is the set of all namesoccurring free, or those that are not bound to P.

Definition 6 (Concurrent Process Expression)

The set P of (concurrent) process expressions is defined by the followingsyntax:

P := A < a1, . . . , an > |∑i∈I

αi.Pi| P1|P2 | (new a) P

where I is any finite indexing set.

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 15 / 30

Page 16: Consurrent Processes and Reaction

Concurrency Process Expressions

Concurrency Process Expressions

Changing a bound name into a fresh name us called alpha-conversion. Twoterms are structurally congruent if one is derived from the other byalpha-conversion.Example:

(new b)a.b = (new b′)a.b′

Alpha-conversion is also used to perform substitutionExample:

P = (new b)a.b

{b/a}P = (new b′)b.b′

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 16 / 30

Page 17: Consurrent Processes and Reaction

Concurrency Process Expressions

Concurrency Process Expressions

To illustrate a reaction,let P = A′|B, where A′ = b.A and B = b.B′. Thus

P ≡ b.A |b.B′,

so reaction between b and b will occur.We have the reaction

P→ A|B′

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 17 / 30

Page 18: Consurrent Processes and Reaction

Concurrency Process Expressions

Concurrency Process Expressions

To illustrate an alternative reaction,let P = new a ((a.Q1 + b.Q2)|a.0) | (b.R1 + a.R2)

P→ new a Q1|(b.R1 + a.R2)

andP→ new a (Q2|a)|R1

Note that, a’s in a.Q1 and a.R2 are different. Therefore,

P 9 new a(Q1|a)|R2

P ≡ new a′((a′.Q1 + b.Q2)|a′|(b.R1 + a.R2))

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 18 / 30

Page 19: Consurrent Processes and Reaction

Concurrency Process Expressions

Concurrency Process Expressions

To illustrate an alternative reaction,let P = new a ((a.Q1 + b.Q2)|a.0) | (b.R1 + a.R2)

P→ new a Q1|(b.R1 + a.R2)

andP→ new a (Q2|a)|R1

Note that, a’s in a.Q1 and a.R2 are different. Therefore,

P 9 new a(Q1|a)|R2

P ≡ new a′((a′.Q1 + b.Q2)|a′|(b.R1 + a.R2))

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 18 / 30

Page 20: Consurrent Processes and Reaction

Structural Congruence

Outline

1 Labels and Flowgraphs

2 Observation and Reactions

3 Concurrency Process Expressions

4 Structural Congruence

5 Reaction Rules

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 19 / 30

Page 21: Consurrent Processes and Reaction

Structural Congruence

Structural Congruence

Definition 7 (Process Context)A process context C is, informally speaking, a process expression containing ahole, represented by [ ]. Formally, process context are given by the syntax

C := [ ] | α.C + M |new a C | C|P | P|C

C[Q] denotes the results of filling the hole in the context C by the process Q.The elementary contexts are α.[ ] + M, new a [ ], [ ]|P, P|[ ].Note in particular that C = [ ] is the identify context; in this case C[Q] = Q.

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 20 / 30

Page 22: Consurrent Processes and Reaction

Structural Congruence

Structural Congruence

Definition 8 (Process Congruence)

Let ∼= be an equivalence relation over P, i.e. it is reflexive (P ∼= P),symmetric (if P ∼= Q then Q ∼

= P) and transitive (if P ∼= Q and Q ∼= R then

P ∼= R). Then ∼= is said to be a process congruence if it is preserved by allelementary contexts; that is, if P ∼= Q then

α.P + M ∼= α.Q + M

new a P ∼= new a Q

P|R ∼= Q|R

R|P ∼= R|Q

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 21 / 30

Page 23: Consurrent Processes and Reaction

Structural Congruence

Structural Congruence

Proposition 4.1

An arbitrary equivalence relation ∼= is a process congruence if and only if ,for all contexts C,

P ∼= Q implies C[P]∼= C[Q].

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 22 / 30

Page 24: Consurrent Processes and Reaction

Structural Congruence

Structural Congruence

Definition 9 (Structural Congruence)

Structural Congruence, written ≡, is the process congruence over Pdetermined by the following equations:

1 Change of bound name (alpha-conversion)2 Reordering of terms in a summation3 P|0 ≡ P, P|Q ≡ Q|P, P|(Q|R) ≡ (P|Q)|R4 new a (P|Q) ≡ P|new a Q if a /∈ fn(P)

new a 0 ≡ 0, new ab P ≡ new ba P

5 A(~b) ≡ {~b/~a}PA if A(~a)def= PA

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 23 / 30

Page 25: Consurrent Processes and Reaction

Structural Congruence

Structural Congruence

Definition 10 (Standard Form)

A process expression new ~a (M1| . . . |Mn), where each Mi is a non-empty sum,is said to be in standard form. (If n = 0 we take M1| . . . | Mn to mean 0, If ~a isempty then there is no restriction.)

Theorem 11Every process is structurally congruent to a standard form.

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 24 / 30

Page 26: Consurrent Processes and Reaction

Structural Congruence

Structural Congruence

Definition 10 (Standard Form)

A process expression new ~a (M1| . . . |Mn), where each Mi is a non-empty sum,is said to be in standard form. (If n = 0 we take M1| . . . | Mn to mean 0, If ~a isempty then there is no restriction.)

Theorem 11Every process is structurally congruent to a standard form.

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 24 / 30

Page 27: Consurrent Processes and Reaction

Structural Congruence

Structural Congruence

Linking

Binary linking operator

P Qdef= new m({m/r}P | {m/l}Q)

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 25 / 30

Page 28: Consurrent Processes and Reaction

Structural Congruence

Structural Congruence

Linking in a more general case

The linking operator can be generalised thus:

P Qdef= new ~m({~m/~r}P) | {~m/~l}Q)

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 26 / 30

Page 29: Consurrent Processes and Reaction

Reaction Rules

Outline

1 Labels and Flowgraphs

2 Observation and Reactions

3 Concurrency Process Expressions

4 Structural Congruence

5 Reaction Rules

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 27 / 30

Page 30: Consurrent Processes and Reaction

Reaction Rules

Reaction Rules

REACT Rule

TAU Rule

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 28 / 30

Page 31: Consurrent Processes and Reaction

Reaction Rules

Reaction Rules

Example 1:

Q = a.(b.B|bC)

Example 2:

a.A|Q

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 29 / 30

Page 32: Consurrent Processes and Reaction

Reaction Rules

Reaction Rules

Example 3:

P = new a((a.Q1 + b.Q2)|a.0)|(b.R1 + a.R2)

John Justine Villar, Jhoirene Clemente () Concurrent Processes and Reaction January 10, 2013 30 / 30