CCS: Processes and Equivalences - PowerPoint PPT Presentation

1 / 28
About This Presentation
Title:

CCS: Processes and Equivalences

Description:

SO: need new theory to talk about behaviour instead of acceptance. 1kr. 1kr. tea. coffee ... Which are the basic relations between concurrency and non-determinism? ... – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 29
Provided by: mads7
Category:

less

Transcript and Presenter's Notes

Title: CCS: Processes and Equivalences


1
CCS Processes and Equivalences
Reading Peled 8.1, 8.2, 8.5
  • Mads Dam

2
Finite State Automata
  • Coffee machine A1
  • Coffee machine A2
  • Are the two machines the same?

1kr
1kr
tea
coffee
1kr
1kr
1kr
tea
coffee
3
Little Language Refresher
  • Automata recognize strings, e.g.
  • 1kr tea 1kr 1kr coffee
  • Language set of strings
  • A1 language recognized by A1
  • ? empty string
  • ST concatenation of S and T
  • S T union of S and T
  • S Iteration of S
  • S SS...S
  • Ardens rule
  • The equation
  • X SX T
  • has solution
  • X ST
  • If ? ? S the solution is unique


0 or more times
4
Now compute...
  • For A1
  • p1 1kr p2 ?
  • p2 1kr p3 tea p1
  • p3 coffee p1
  • ?
  • p2 1kr coffee p1 tea p1
  • ? (etc, use Arden)
  • p1 (1kr 1kr coffee 1kr tea)
  • q1
  • BUT p1, q1 should be different!
  • SO need new theory to talk about behaviour
    instead of acceptance

A1
1kr
p2
p3
1kr
tea
p1
coffee
q3
1kr
A2
1kr
1kr
q4
q1
q2
tea
coffee
5
Process Algebra
  • Calculus of concurrent processes
  • Main issues
  • How to specify concurrent processes in an
    abstract way?
  • Which are the basic relations between concurrency
    and non-determinism?
  • Which basic methods of construction ( operators)
    are needed?
  • When do two processes behave differently?
  • When do they behave the same?
  • Rules of calculation
  • Replacing equals for equals
  • Substitutivity
  • Specification and modelling issues

6
Process Equivalences
  • Sameness of behaviour equivalence of states
  • Many process equivalences have been proposed (cf.
    Peled 8.5)
  • For instance q1 q2 iff
  • q1 and q2 have the same paths, or
  • q1 and q2 may always refuse the same
    interactions, or
  • q1 and q2 pass the same tests, or
  • q1 and q2 have identical branching structure
  • CCS Focus on bisimulation equivalence

7
Bisimulation Equivalence
  • Intuition q1 q2 iff q1 and q2 have same
    branching structure
  • Idea Find relation which will relate two states
    with the same transition structure, and make sure
    the relation is preserved
  • Example

q1
q2
a
a
a
b
c
b
b
c
c
8
Strong Bisimulation Equivalence
  • Given Labelled transition system T (Q,?,R)
  • Looking for a relation S ? Q ? Q on states
  • S is a strong bisimulation relation if whenever
    q1 S q2 then
  • q1 ?? q1 implies q2 ?? q2 for some q2 such
    that q1 S q2
  • q2 ?? q2 implies q1 ?? q1 for some q1 such
    that q1 S q2
  • q1 and q2 are strongly bisimilar iff q1 S q2 for
    some strong bisimulation relation S
  • q1 ? q2 q1 and q2 are strongly bisimilar
  • Peled uses bis for

9
Example
q1
p0
a
b
a
a
q0
p1
a
b
b
a
q2
p2
a
a
Does q0 p0 hold?
10
Example
q0
p0
a
a
a
q1
p1
q2
c
c
b
b
p2
q3
q4
p3
Does q0 p0 hold?
11
Weak Transitions
  • What to do about internal activity?
  • ? Transition label for activity which is not
    externally visible
  • q )? q iff q q0 ?? q1 ?? ... ?? qn q, n ? 0
  • q )? q iff q )? q
  • q )? q iff q )? q1 ?? q2 )? q (? ? ?)
  • Beware that )? )? (non-standard notation)
  • Observational equivalence, v.1.0 Bisimulation
    equivalence with ? in place of ?
  • Let q1 ¼ q2 iff q1 q2 with )? in place of !?
  • Cumbersome definition Too many transitions q )?
    q to check

12
Observational Equivalence
  • Let S µ Q ? Q. The relation S is a weak
    bisimulation relation if whenever q1 S q2 then
  • q1 ?? q1 implies q2 ?? q2 for some q2 such
    that q1 S q2
  • q2 ?? q2 implies q1 ?? q1 for some q1 such
    that q1 S q2
  • q1 and q2 are observationally equivalent, or
    weakly bisimulation equivalent, if q1 S q2 for
    some weak bisimulation relation S
  • q1 ? q2 q1 and q2 are observationally
    equivalent/weakly bisimilar
  • Exercise Show that ¼ ¼

13
Examples
a
a
?
¼
a
a
?
¼
a
?
c
a
b
a
¼
b
a
?
c
?
c
14
Examples
b
b
a
?
a
b
?
All three are inequivalent
a
?
15
Calculus of Communicating Systems - CCS
  • Language for describing communicating transition
    systems
  • Behaviours as algebraic terms
  • Calculus Centered on observational equivalence
  • Elegant mathematical treatment
  • Emphasis on process structure and modularity
  • Recent extensions to security and mobile systems
  • CSP - Hoare Communicating Sequential Processes
    (85)
  • ACP - Bergstra and Klop Algebra of Communicating
    Processes (85)
  • CCS - Milner Communication and Concurrency (89)
  • Pi-calculus Milner (99), Sangiorgi and Walker
    (01)
  • SPI-calculus Abadi and Gordon (99)
  • Many recent successor for security and mobility
    (more in 2G1517)

16
CCS - Combinators
  • The idea 7 elementary ways of producing or
    putting together labelled transition systems
  • Pure CCS
  • Turing complete can express any Turing
    computable function
  • Value-passing CCS
  • Additional operators for value passing
  • Definable
  • Convenient for applications

17
Actions
  • Names a,b,c,d,...
  • Co-names a,b,c,d,...
  • Sorry Overbar not good in texpoint!
  • a a
  • In CCS, names and co-names synchronize
  • Labels l Names co-names
  • ? 2 Actions ? Labels ?
  • Define ? by
  • l l, and
  • ? ?

18
Flow Graphs
  • Often draw static process structures using simple
    diagrams like
  • Only labels listed may be made available at
    external interface
  • Composing flowgraphs
  • The chb names are now internal

cha0
chb0
cha1
chb1
cha0
chb0
chb0
chc0
cha1
chb1
chb1
chc1
19
CCS Combinators, II
  • Nil 0 No transitions
  • Prefix ?.P in.out.0 ?in out.0 ?out 0
  • Definition A P Buffer in.out.Buffer
  • Buffer ?in out.Buffer ?out Buffer

in
out
in
20
CCS Combinators, Choice
  • Choice P Q BadBuf in.(?.0
    out.BadBuf)
  • BadBuf ?in ?.0 out.BadBuf
  • ?? 0 or
  • ?out BadBuf
  • Obs No priorities between ?s, as or as
  • CCS doesnt know which labels represent input,
    and which output
  • May use ? notation

in
?
21
Example Boolean Buffer
  • 2-place Boolean Buffer
  • Flow graph
  • Buf2 Empty 2-place buffer
  • Buf20 2-place buffer holding a 0
  • Buf21 Do. holding a 1
  • Buf2_00 Do. Holding 00
  • ... etc. ...
  • Buf2 in0.Buf20 in1.Buf21
  • Buf20 out0.Buf2
  • in0.Buf200 in1.Buf201
  • Buf21 ...
  • Buf200 out0.Buf20
  • Buf201 out0.Buf21
  • Buf210 ...
  • Buf211 ...

in0
out0
in1
out1
22
Example Scheduler
  • ai start taski
  • bi stop taski
  • Requirements
  • a1,...,an to occur cyclically
  • ai/bi to occur alternately beginning with ai
  • Any a_i/b_i to be schedulable at any time,
    provided 1 and 2 not violated
  • Let X ? 1,...,n
  • Schedi,X
  • i to be scheduled
  • X pending completion
  • Scheduler Sched1,?
  • Schedi,X
  • ?j?Xbj.Schedi,X-j, if i ? X
  • ?j?Xbj.Schedi,X-j
  • ai.Schedi1,X?i, if i ? X

23
Example Counter
  • Basic example of infinite-state system
  • Count Count0
  • Count0 zero.Count0 inc.Count1
  • Counti1 inc.Counti2 dec.Counti
  • Can do stacks and queues equally easy try it!

24
CCS Combinators, Composition
  • Composition P Q Buf1 in.comm.Buf1
  • Buf2 comm.out.Buf2
  • Buf1 Buf2
  • ?in comm.Buf1 Buf2
  • ?? Buf1 out.Buf2
  • ?out Buf1 Buf2
  • But also, for instance
  • Buf1 Buf2
  • ?comm Buf1 out.Buf2
  • ?out Buf1 Buf2

25
Composition, Example
  • Buf1 in.comm.Buf1
  • Buf2 comm.out.Buf2
  • Buf1 Buf2

comm.Buf1Buf2
out
comm
in
comm
?
Buf1Buf2
comm.Buf1out.Buf2
comm
in
out
comm
Buf1out.Buf2
26
CCS Combinators, Restriction
  • Restriction P L Buf1 in.comm.Buf1
  • Buf2 comm.out.Buf2
  • (Buf1 Buf2) comm
  • ?in comm.Buf1 Buf2
  • ?? Buf1 out.Buf2
  • ?out Buf1 Buf2
  • But not
  • (Buf1 Buf2) comm
  • ?comm Buf1 out.Buf2
  • ?out Buf1 Buf2

27
CCS Combinators, Relabelling
  • Relabelling Pf Buf in.out.Buf1
  • Buf1 Bufcomm/out
  • in.comm.Buf1
  • Buf2 Bufcomm/in
  • comm.out.Buf2
  • Relabelling function f must preserve complements
  • f(a) f(a)
  • And ?
  • f(?) ?
  • Relabelling function often given by name
    substitution as above

28
Example 2-way Buffers
  • 1-place 2-way buffer
  • Bufab a.b-.Bufab b.a-.Bufab
  • Flow graph
  • LTS
  • Bufbc
  • Bufabc/b,c-/b-,b-/a,b/a-
  • (Obs Simultaneous substitution!)
  • Sys (Bufab Bufbc)\b,b-
  • Intention
  • What went wrong?

a
b-
a
b-
b-
c
a-
b
a-
b
b
c-
b-.Bufab
b-
a
Bufab
b
a-.Bufab
a-
Write a Comment
User Comments (0)
About PowerShow.com