     • date post

11-Jun-2020
• Category

## Documents

• view

0

0

Embed Size (px)

### Transcript of Resume - cs.nott.ac.uk psznhn/MGS2007/LectureNotes/mgs...آ  1 Resume...

• 1

Resume

• Started with looking at a particular process calculus, Milner’s CCS (Calculus of Communicating Systems)

• Some operators and rules for transitions: . prefix, ∑

, |, \K

R(| com) E |F τ −→E′ |F ′

E a −→E′ F

a −→F ′

R(|) E |F a −→E′ |F

E a −→E′

E |F a −→E |F ′

F a −→F ′

• Transition Graphs and Flow Graphs

• 2

Example

P ≡ F means that P abbreviates F .

Rail def = train.green.tcross.red.Rail

Signal def = green.red.Signal+ up.down.Signal

Crossing ≡ (Road | Rail | Signal)\K

K = {green, red, up, down}

• 3

Flow Graphs

� �� �� ���� � �� �� ����

� �� �� ���� � �� �� ���� �

� �� �� ����

��� ������ ������ � �� �� ����

� �� �� ���� ������

� �� �� ���� ������

� �� �� ���� � �� �� ��

!!!! !# """"

" \$\$\$\$&%%%%

' '( ( ) ) )* *+ + +, , , - -. . / /0 0 1 12 2

3 3 3 3 34 4 4 4 4 5 5 5 56 6 6 6

car

up

ccross

down train tcross up down

red red

green green

Crossing

train tcross

car

ccross

• 4

Protocol that may lose messages

Sender def = in(x).sm(x).Send1(x)

Send1(x) def = ms.sm(x).Send1(x) + ok.Sender

Medium def = sm(y).Med1(y)

Med1(y) def = mr(y).Medium+ τ.ms.Medium

Protocol ≡ (Sender | Medium | Receiver)\{sm, ms, mr, ok}

• 5

Abstracting from silent activity

Difference between τ and “observable” actions. Assume E may at some time perform ok

(E | ok.Resource)\{ok}

Observation of ok = release of Resource

τ cannot be observed in this way

• 6

Observable transitions

E ε

=⇒ F or E a

=⇒ F where a 6= τ

R( ε

=⇒) E ε

=⇒ E E

ε =⇒ F

E τ −→ E′ E′

ε =⇒ F

R( a

=⇒) E

a =⇒ F

E ε

=⇒ E′ E′ a −→ F ′ F ′

ε =⇒ F

• 7

Observable Transition Graphs

C def = in(x).out(x).ok.C

U def = write(x).in(x).ok.U

Ucop def = write(x).out(x).Ucop

• 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)

• 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

• 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 {Pi def = 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)

• 11

Doing a counter

Count def = round.Count+ up.(Count1 | a.Count)\{a}

Count1 def = down.a.0+ up.(Count2 | b.Count1)\{b}

Count2 def = 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?

• 12

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?

• 13

Exercise

Is this pair equivalent?

Cl def = tick.Cl

Cl′ def = tick.tick.Cl′

• 14

Exercise

Are any of these equivalent?

Ven1 def = 1p.1p.(tea.Ven1 + coffee.Ven1)

Ven2 def = 1p.(1p.tea.Ven2 + 1p.coffee.Ven2)

Ven3 def = 1p.1p.tea.Ven3 + 1p.1p.coffee.Ven3

• 15

Pictorially

����� �����

�����

� �� ���� �

�����

���

����� �����

� � � �� � � �

� � � �� � � �

� � � �� � � �

� � � �

� � � �� � � �

� � � �� � � �

� � � �� � � �

� � � � � � � �� � � �

� � � �� � � �

� � � �� � � �

� � � �

� � �� � �

� � �� � �

� � �� � �

� � �

�� ��

�� �

�� ��

�� �

Ven Ven

Ven

tea coffee

1p

1p

1p

1p 1p

1p 1p

1p 1p

tea coffee

tea coffee

1 2

3

• 16

Equivalences

Unlimited choice of candidates for equivalence

Some criteria

1. Should be a congruence w.r.t. process combinators (Language equivalence excluded)

2. Should preserve “crucial properties” (Trace equivalence excluded)

3. Should have a nice mathematical theory (. . . excluded)

• 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?

• 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?

• 19

General logical approach

Ehrenfeucht-Fraisse Games

1. Two structures (e.g., processes)

2. How alike are they?

3. Play games to distinguish them

• 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?

• 21

Distinguishable Processes

A pair of processes E and F is distinguishable if one has a transition the other doesnt

E a −→ E′ and not(F

a −→) or F

a −→ F ′ and not(E

a −→)

Alternatively, w.r.t. observable disitinguishability

E a

=⇒ E′ and not(F a

=⇒) or F a

=⇒ F ′ and not(E a

=⇒)

• 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 Ej a −→ Ej+1, then player V chooses a transition

with the same label Fj a −→ Fj+1

• Player R chooses a transition Fj a −→ Fj+1, then player V chooses a transition

with the same label Ej a −→ Ej+1

Winning a play

R wins if reach a distinguishable pair

V wins otherwise (play is infinite or becomes stuck)