Resume - cs.nott.ac.ukpsznhn/MGS2007/LectureNotes/mgs... · 1 Resume...
Transcript of Resume - cs.nott.ac.ukpsznhn/MGS2007/LectureNotes/mgs... · 1 Resume...
1
Resume
• Started with looking at a particular process calculus, Milner’s CCS (Calculusof Communicating Systems)
• Some operators and rules for transitions: . prefix,∑
, |, \K
R(| com) E |Fτ−→E′ |F ′
Ea−→E′ F
a−→F ′
R(|) E |Fa−→E′ |F
Ea−→E′
E |Fa−→E |F ′
Fa−→F ′
• Transition Graphs and Flow Graphs
cps Midlands Graduate School today
2
Example
P ≡ F means that P abbreviates F .
Roaddef= car.up.ccross.down.Road
Raildef= train.green.tcross.red.Rail
Signaldef= green.red.Signal+ up.down.Signal
Crossing ≡ (Road | Rail | Signal)\K
K = {green, red, up, down}
cps Midlands Graduate School today
3
Flow Graphs
� �� �� ���� � �� �� ����
� �� �� ����� �� �� ���� �
� �� �� ����
��� ������ ������� �� �� ����
� �� �� ����������
� �� �� ���� ������
� �� �� ����� �� �� ��
!!!!!#""""
"$$$$&%%%%
' '( ( ) ) )* *+ + +, , , - -. . / /0 0 1 12 2
3 3 3 3 34 4 4 4 4 5 5 5 56 6 6 6
SignalRoad Rail
car
up
ccross
down train tcross up down
red red
green green
Crossing
train tcross
car
ccross
cps Midlands Graduate School today
4
Protocol that may lose messages
Senderdef= in(x).sm(x).Send1(x)
Send1(x)def= ms.sm(x).Send1(x) + ok.Sender
Mediumdef= sm(y).Med1(y)
Med1(y)def= mr(y).Medium+ τ.ms.Medium
Receiverdef= mr(x).out(x).ok.Receiver
Protocol ≡ (Sender | Medium | Receiver)\{sm, ms, mr, ok}
cps Midlands Graduate School today
5
Abstracting from silent activity
Difference between τ and “observable” actions.Assume E may at some time perform ok
(E | ok.Resource)\{ok}
Access to Resource is triggered by ok by E
Observation of ok = release of Resource
τ cannot be observed in this way
cps Midlands Graduate School today
6
Observable transitions
Eε
=⇒ F or Ea
=⇒ F where a 6= τ
R(ε
=⇒) Eε
=⇒ EE
ε=⇒ F
Eτ−→ E′ E′
ε=⇒ F
R(a
=⇒)E
a=⇒ F
Eε
=⇒ E′ E′a−→ F ′ F ′
ε=⇒ F
cps Midlands Graduate School today
7
Observable Transition Graphs
Cdef= in(x).out(x).ok.C
Udef= write(x).in(x).ok.U
Ucopdef= write(x).out(x).Ucop
cps Midlands Graduate School today
8
Observable Transition Graphs
1: (C|U)\{in,ok} 2: (C|in(v).ok.U)\{in,ok}__
\{in,ok} 3: (out(v).ok.C|ok.U)\{in,ok}4: (ok.C|ok.U)__
Ucop out(v).Ucop___
out(v)___
out(v)___
out(v)___
out(v)___
write(v)
write(v)
write(v)
write(v)
ε ε
ε
ε ε
ε
ε
ε
out(v)___
write(v)
cps Midlands Graduate School today
9
Summary
1. Syntax of CCS: prefix, sum, parallel composition, restriction (but not renaming)
2. Two types of transition,a−→
a=⇒
3. Two types of transition graph that abstracts from derivation of transitions
4. Flow Graphs
cps Midlands Graduate School today
10
Process Calculi
1. Lots of different process calculi (ACP, CSP, . . .)
2. Even “formats” for defining behavioural rules
3. Lots of added extras: time, probability, location, . . .
4. Consider the restricted process language where I is finite
E ::= P |∑
{ai.Ei : i ∈ I} | E1 | E2 | E\{a}
A (closed) process, a finite family {Pidef= Ei : 1 ≤ i ≤ n} of definitions,
where all the process names in each Ei belong to the set {P1, . . . , Pn}.
“Turing powerful” (simulate Turing machines)
cps Midlands Graduate School today
11
Doing a counter
Countdef= round.Count+ up.(Count1 | a.Count)\{a}
Count1def= down.a.0+ up.(Count2 | b.Count1)\{b}
Count2def= down.b.0+ up.(Count1 | a.Count2)\{a}
But so what?
1. unclear what the significance of this is
2. is there a concurrent version of Church-Turing thesis for sequential programs?
cps Midlands Graduate School today
12
Reasoning about processes
Are two descriptions equivalent?
Is Protocol equivalent to Cop?
Do descriptions have important (temporal) properties?
Crossing |= never has crashes?
Crossing |= whenever a car approaches eventually it crosses?
cps Midlands Graduate School today
13
Exercise
Is this pair equivalent?
Cldef= tick.Cl
Cl′def= tick.tick.Cl′
cps Midlands Graduate School today
14
Exercise
Are any of these equivalent?
Ven1def= 1p.1p.(tea.Ven1 + coffee.Ven1)
Ven2def= 1p.(1p.tea.Ven2 + 1p.coffee.Ven2)
Ven3def= 1p.1p.tea.Ven3 + 1p.1p.coffee.Ven3
cps Midlands Graduate School today
15
Pictorially
����������
�����
� �� ���� �
����� ���
����� �����
� � � �� � � �� � � �� � � �� � � �� � � �� � � �
� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �
� � �� � �� � �� � �� � �� � �� � �
����
���
����
���
Ven Ven
Ven
tea coffee
1p
1p
1p
1p 1p
1p 1p
1p 1p
tea coffee
tea coffee
1 2
3
cps Midlands Graduate School today
16
Equivalences
Unlimited choice of candidates for equivalence
Some criteria
1. Should be a congruence w.r.t. process combinators (Language equivalenceexcluded)
2. Should preserve “crucial properties” (Trace equivalence excluded)
3. Should have a nice mathematical theory (. . . excluded)
cps Midlands Graduate School today
17
Approaches to equivalence I
“Semantical approach” (compare λ-calculus)
1. E ≡ F if they have same “basic features”
2. Extend to a congruence: largest ≡c⊆≡ such that
for all process contexts C[ ], C[E] ≡ C[F ]
Sensitive to
what are basic features?
what are the process combinators?
is ≡c definable independently?
cps Midlands Graduate School today
18
Approaches to equivalence II
“Logical approach”
1. Give a logic L for properties of processes
2. E ≡ F iff for all properties Φ ∈ L. E |= Φ iff F |= Φ
Sensitive to
1. what is an appropriate logic?
2. is ≡ a congruence?
3. is ≡ definable independently?
cps Midlands Graduate School today
19
General logical approach
Ehrenfeucht-Fraisse Games
1. Two structures (e.g., processes)
2. How alike are they?
3. Play games to distinguish them
cps Midlands Graduate School today
20
Ingredients
1. Two players V (verifier) R (refuter)
R wants to show structures are distinguishable
V wants to show they are not
2. What is a move?
3. What is it to win?
cps Midlands Graduate School today
21
Distinguishable Processes
A pair of processes E and F is distinguishable if one has a transition the otherdoesnt
Ea−→ E′ and not(F
a−→) or F
a−→ F ′ and not(E
a−→)
Alternatively, w.r.t. observable disitinguishability
Ea
=⇒ E′ and not(Fa
=⇒) or Fa
=⇒ F ′ and not(Ea
=⇒)
cps Midlands Graduate School today
22
Bisimulation Game G(E0, F0)Play of G(E0, F0) is a finite/infinite sequence (E0, F0) . . . (Ei, Fi) . . .
If (E0, F0) . . . (Ej, Fj) then (Ej+1, Fj+1) is determined by move
• Player R chooses a transition Eja−→ Ej+1, then player V chooses a transition
with the same label Fja−→ Fj+1
• Player R chooses a transition Fja−→ Fj+1, then player V chooses a transition
with the same label Eja−→ Ej+1
Winning a play
R wins if reach a distinguishable pair
V wins otherwise (play is infinite or becomes stuck)
cps Midlands Graduate School today
23
Examples
V wins every play of G(Cl, Cl′)
Cldef= tick.Cl
Cl′def= tick.tick.Cl′
V and R both win plays of G(Ven1, Ven2)
Ven1def= 1p.1p.(tea.Ven1 + coffee.Ven1)
Ven2def= 1p.(1p.tea.Ven2 + 1p.coffee.Ven2)
Ven3def= 1p.1p.tea.Ven3 + 1p.1p.coffee.Ven3
However, V is able always to win G(Ven1, Ven2)
cps Midlands Graduate School today