Mobile Escape Analysis for occam-pi CPA-2009 Fred Barnes School of - - PowerPoint PPT Presentation

mobile escape analysis for occam pi
SMART_READER_LITE
LIVE PREVIEW

Mobile Escape Analysis for occam-pi CPA-2009 Fred Barnes School of - - PowerPoint PPT Presentation

Mobile Escape Analysis for occam-pi CPA-2009 Fred Barnes School of Computing, University of Kent, Canterbury F.R.M.Barnes@kent.ac.uk http://www.cs.kent.ac.uk/~frmb/ Introduction Summary Weve been developing occam- programs for some time


slide-1
SLIDE 1

Mobile Escape Analysis for occam-pi

CPA-2009 Fred Barnes School of Computing, University of Kent, Canterbury

F.R.M.Barnes@kent.ac.uk http://www.cs.kent.ac.uk/~frmb/

slide-2
SLIDE 2

Introduction

Summary

We’ve been developing occam-π programs for some time now:

traditional process-oriented design of concurrent processes and communication dynamics added from Milner’s π-calculus: mobile data, channels and processes real applications for complex systems simulation (CoSMoS) and

  • perating systems (RMoX)

Semantics from CSP [1, Hoare-1985], on which the original occam language was based:

provides formal reasoning for parallel processes and their interactions

We also have CSP models for mobile data, channels and processes:

largely for an understanding of their operational behaviour

What we do not yet have:

a denotational and compositional understanding of how mobile systems evolve

slide-3
SLIDE 3

Introduction

Summary

We’ve been developing occam-π programs for some time now:

traditional process-oriented design of concurrent processes and communication dynamics added from Milner’s π-calculus: mobile data, channels and processes real applications for complex systems simulation (CoSMoS) and

  • perating systems (RMoX)

Semantics from CSP [1, Hoare-1985], on which the original occam language was based:

provides formal reasoning for parallel processes and their interactions

We also have CSP models for mobile data, channels and processes:

largely for an understanding of their operational behaviour

What we do not yet have:

a denotational and compositional understanding of how mobile systems evolve

slide-4
SLIDE 4

Introduction

Summary

We’ve been developing occam-π programs for some time now:

traditional process-oriented design of concurrent processes and communication dynamics added from Milner’s π-calculus: mobile data, channels and processes

foo bar zog

real applications for complex systems simulation (CoSMoS) and

  • perating systems (RMoX)

Semantics from CSP [1, Hoare-1985], on which the original occam language was based:

provides formal reasoning for parallel processes and their interactions

We also have CSP models for mobile data, channels and processes:

largely for an understanding of their operational behaviour

What we do not yet have:

a denotational and compositional understanding of how mobile systems evolve

slide-5
SLIDE 5

Introduction

Summary

We’ve been developing occam-π programs for some time now:

traditional process-oriented design of concurrent processes and communication dynamics added from Milner’s π-calculus: mobile data, channels and processes

foo bar zog

real applications for complex systems simulation (CoSMoS) and

  • perating systems (RMoX)

Semantics from CSP [1, Hoare-1985], on which the original occam language was based:

provides formal reasoning for parallel processes and their interactions

We also have CSP models for mobile data, channels and processes:

largely for an understanding of their operational behaviour

What we do not yet have:

a denotational and compositional understanding of how mobile systems evolve

slide-6
SLIDE 6

Introduction

Summary

We’ve been developing occam-π programs for some time now:

traditional process-oriented design of concurrent processes and communication dynamics added from Milner’s π-calculus: mobile data, channels and processes

foo bar zog

real applications for complex systems simulation (CoSMoS) and

  • perating systems (RMoX)

Semantics from CSP [1, Hoare-1985], on which the original occam language was based:

provides formal reasoning for parallel processes and their interactions

We also have CSP models for mobile data, channels and processes:

largely for an understanding of their operational behaviour

What we do not yet have:

a denotational and compositional understanding of how mobile systems evolve

slide-7
SLIDE 7

Introduction

Summary

We’ve been developing occam-π programs for some time now:

traditional process-oriented design of concurrent processes and communication dynamics added from Milner’s π-calculus: mobile data, channels and processes

foo bar zog

real applications for complex systems simulation (CoSMoS) and

  • perating systems (RMoX)

Semantics from CSP [1, Hoare-1985], on which the original occam language was based:

provides formal reasoning for parallel processes and their interactions

We also have CSP models for mobile data, channels and processes:

largely for an understanding of their operational behaviour

What we do not yet have:

a denotational and compositional understanding of how mobile systems evolve

slide-8
SLIDE 8

Introduction

Summary

We’ve been developing occam-π programs for some time now:

traditional process-oriented design of concurrent processes and communication dynamics added from Milner’s π-calculus: mobile data, channels and processes

foo bar zog

real applications for complex systems simulation (CoSMoS) and

  • perating systems (RMoX)

Semantics from CSP [1, Hoare-1985], on which the original occam language was based:

provides formal reasoning for parallel processes and their interactions

We also have CSP models for mobile data, channels and processes:

largely for an understanding of their operational behaviour

What we do not yet have:

a denotational and compositional understanding of how mobile systems evolve

slide-9
SLIDE 9

Introduction

Summary

We’ve been developing occam-π programs for some time now:

traditional process-oriented design of concurrent processes and communication dynamics added from Milner’s π-calculus: mobile data, channels and processes

foo bar zog

real applications for complex systems simulation (CoSMoS) and

  • perating systems (RMoX)

Semantics from CSP [1, Hoare-1985], on which the original occam language was based:

provides formal reasoning for parallel processes and their interactions

We also have CSP models for mobile data, channels and processes:

largely for an understanding of their operational behaviour

What we do not yet have:

a denotational and compositional understanding of how mobile systems evolve

slide-10
SLIDE 10

Introduction

Mobile Escape Analysis

Existing semantic models: traces, failures and divergences. New semantic model: mobility.

primarily interested in how mobiles move around a system. to determine the boundaries of any particular mobile item within the communication graph. where that graph may be dynamic and evolve at run-time.

slide-11
SLIDE 11

Semantic Models

Traces, Failures, Divergences

Using a simple occam-π process as an example:

PROC id (CHAN INT in?, out!) WHILE TRUE INT x: SEQ in ? x

  • ut ! x

:

id

in?

  • ut!

Can generate (automatically [2, Barnes,Ritson-2009]) a CSP model of this process: ID(in, out) = in → out → ID(in, out) And from that the semantic models: traces ID = {, in, in, out, in, out, in, ...} failures ID = {(, {out}), (in, {in}), (in, out, {out}), ...} divergences ID = {}

slide-12
SLIDE 12

Semantic Models

Traces, Failures, Divergences

Using a simple occam-π process as an example:

PROC id (CHAN INT in?, out!) WHILE TRUE INT x: SEQ in ? x

  • ut ! x

:

id

in?

  • ut!

Can generate (automatically [2, Barnes,Ritson-2009]) a CSP model of this process: ID(in, out) = in → out → ID(in, out) And from that the semantic models: traces ID = {, in, in, out, in, out, in, ...} failures ID = {(, {out}), (in, {in}), (in, out, {out}), ...} divergences ID = {}

slide-13
SLIDE 13

Semantic Models

Traces, Failures, Divergences

Using a simple occam-π process as an example:

PROC id (CHAN INT in?, out!) WHILE TRUE INT x: SEQ in ? x

  • ut ! x

:

id

in?

  • ut!

Can generate (automatically [2, Barnes,Ritson-2009]) a CSP model of this process: ID(in, out) = in → out → ID(in, out) And from that the semantic models: traces ID = {, in, in, out, in, out, in, ...} failures ID = {(, {out}), (in, {in}), (in, out, {out}), ...} divergences ID = {}

slide-14
SLIDE 14

Semantic Models

Mobility Analysis

Similar in concept to the traces model – and borrows its syntax.

describes what the mobile behaviour of a process is.

For the earlier ‘ID’ process (which does not involve mobiles): mobility ID = {} For an ‘MID’ process that transports/buffers mobiles: Same traces, failures and divergences as before, however: mobility MID = {in?a, out!a}

slide-15
SLIDE 15

Semantic Models

Mobility Analysis

Similar in concept to the traces model – and borrows its syntax.

describes what the mobile behaviour of a process is.

For the earlier ‘ID’ process (which does not involve mobiles): mobility ID = {} For an ‘MID’ process that transports/buffers mobiles: Same traces, failures and divergences as before, however: mobility MID = {in?a, out!a}

slide-16
SLIDE 16

Semantic Models

Mobility Analysis

Similar in concept to the traces model – and borrows its syntax.

describes what the mobile behaviour of a process is.

For the earlier ‘ID’ process (which does not involve mobiles): mobility ID = {} For an ‘MID’ process that transports/buffers mobiles:

PROC mid (CHAN MOBILE THING in?, out!) WHILE TRUE MOBILE THING x: SEQ in ? x

  • ut ! x

:

mid

in?

  • ut!

Same traces, failures and divergences as before, however: mobility MID = {in?a, out!a}

slide-17
SLIDE 17

Semantic Models

Mobility Analysis

Similar in concept to the traces model – and borrows its syntax.

describes what the mobile behaviour of a process is.

For the earlier ‘ID’ process (which does not involve mobiles): mobility ID = {} For an ‘MID’ process that transports/buffers mobiles:

PROC mid (CHAN MOBILE THING in?, out!) WHILE TRUE MOBILE THING x: SEQ in ? x

  • ut ! x

:

mid

in?

  • ut!

Same traces, failures and divergences as before, however: mobility MID = {in?a, out!a}

slide-18
SLIDE 18

Semantic Models

Mobility Sequences

Like traces, specify what a process might do, not necessarily what it does do (though the ‘ID’ processes can only progress one way). In general, S is a set of mobility sequences: S = {R1, R2, ...} Where each R is a sequence of mobile actions: R = X1, X2, X3, ... And each X is either a mobile input or a mobile output: X1 = C!x , X2 = D?v Names within a sequence (C, x, D, v) are bound within any particular set (including formal parameters) – renaming may be required to avoid capture. Other useful operations: concatenation : X1, X2, ...ˆY1, Y2, ... = X1, X2, ..., Y1, Y2, ... restriction : X1, C, ... − {C} = X1, ...

slide-19
SLIDE 19

Semantic Models

Mobility Sequences

Like traces, specify what a process might do, not necessarily what it does do (though the ‘ID’ processes can only progress one way). In general, S is a set of mobility sequences: S = {R1, R2, ...} Where each R is a sequence of mobile actions: R = X1, X2, X3, ... And each X is either a mobile input or a mobile output: X1 = C!x , X2 = D?v Names within a sequence (C, x, D, v) are bound within any particular set (including formal parameters) – renaming may be required to avoid capture. Other useful operations: concatenation : X1, X2, ...ˆY1, Y2, ... = X1, X2, ..., Y1, Y2, ... restriction : X1, C, ... − {C} = X1, ...

slide-20
SLIDE 20

Semantic Models

Mobility Sequences

Like traces, specify what a process might do, not necessarily what it does do (though the ‘ID’ processes can only progress one way). In general, S is a set of mobility sequences: S = {R1, R2, ...} Where each R is a sequence of mobile actions: R = X1, X2, X3, ... And each X is either a mobile input or a mobile output: X1 = C!x , X2 = D?v Names within a sequence (C, x, D, v) are bound within any particular set (including formal parameters) – renaming may be required to avoid capture. Other useful operations: concatenation : X1, X2, ...ˆY1, Y2, ... = X1, X2, ..., Y1, Y2, ... restriction : X1, C, ... − {C} = X1, ...

slide-21
SLIDE 21

Semantic Models

Mobility Sequences

Like traces, specify what a process might do, not necessarily what it does do (though the ‘ID’ processes can only progress one way). In general, S is a set of mobility sequences: S = {R1, R2, ...} Where each R is a sequence of mobile actions: R = X1, X2, X3, ... And each X is either a mobile input or a mobile output: X1 = C!x , X2 = D?v Names within a sequence (C, x, D, v) are bound within any particular set (including formal parameters) – renaming may be required to avoid capture. Other useful operations: concatenation : X1, X2, ...ˆY1, Y2, ... = X1, X2, ..., Y1, Y2, ... restriction : X1, C, ... − {C} = X1, ...

slide-22
SLIDE 22

Semantic Models

Mobility Sequences

Like traces, specify what a process might do, not necessarily what it does do (though the ‘ID’ processes can only progress one way). In general, S is a set of mobility sequences: S = {R1, R2, ...} Where each R is a sequence of mobile actions: R = X1, X2, X3, ... And each X is either a mobile input or a mobile output: X1 = C!x , X2 = D?v Names within a sequence (C, x, D, v) are bound within any particular set (including formal parameters) – renaming may be required to avoid capture. Other useful operations: concatenation : X1, X2, ...ˆY1, Y2, ... = X1, X2, ..., Y1, Y2, ... restriction : X1, C, ... − {C} = X1, ...

slide-23
SLIDE 23

Code Analysis

Generating Models of occam-π Programs

Input, output and assignment are largely straightforward: As are choice (ALT, IF, CASE) and parallelism (PAR).

simply the set union of the different branches. hiding is more complex – e.g. as above with ‘Lc’. essentially matching outputs with inputs, and combining those sequences (potentially expansive!)

slide-24
SLIDE 24

Code Analysis

Generating Models of occam-π Programs

Input, output and assignment are largely straightforward:

PROC P (CHAN MOBILE THING out!) MOBILE THING x: SEQ ... initialise ‘x’

  • ut ! x

:

As are choice (ALT, IF, CASE) and parallelism (PAR).

simply the set union of the different branches. hiding is more complex – e.g. as above with ‘Lc’. essentially matching outputs with inputs, and combining those sequences (potentially expansive!)

slide-25
SLIDE 25

Code Analysis

Generating Models of occam-π Programs

Input, output and assignment are largely straightforward:

PROC P (CHAN MOBILE THING out!) MOBILE THING x: SEQ ... initialise ‘x’

  • ut ! x

:

mobility P = {out!x} As are choice (ALT, IF, CASE) and parallelism (PAR).

simply the set union of the different branches. hiding is more complex – e.g. as above with ‘Lc’. essentially matching outputs with inputs, and combining those sequences (potentially expansive!)

slide-26
SLIDE 26

Code Analysis

Generating Models of occam-π Programs

Input, output and assignment are largely straightforward: mobility P = {out!x}

PROC Q (CHAN MOBILE THING in?) MOBILE THING y: SEQ in ? y ... use ‘y’ :

As are choice (ALT, IF, CASE) and parallelism (PAR).

simply the set union of the different branches. hiding is more complex – e.g. as above with ‘Lc’. essentially matching outputs with inputs, and combining those sequences (potentially expansive!)

slide-27
SLIDE 27

Code Analysis

Generating Models of occam-π Programs

Input, output and assignment are largely straightforward: mobility P = {out!x}

PROC Q (CHAN MOBILE THING in?) MOBILE THING y: SEQ in ? y ... use ‘y’ :

mobility Q = {in?y} As are choice (ALT, IF, CASE) and parallelism (PAR).

simply the set union of the different branches. hiding is more complex – e.g. as above with ‘Lc’. essentially matching outputs with inputs, and combining those sequences (potentially expansive!)

slide-28
SLIDE 28

Code Analysis

Generating Models of occam-π Programs

Input, output and assignment are largely straightforward: mobility P = {out!x} mobility Q = {in?y}

PROC R (CHAN MOBILE THING in?, out!) MOBILE THING v, w: SEQ in ? v w := v

  • ut ! w

:

As are choice (ALT, IF, CASE) and parallelism (PAR).

simply the set union of the different branches. hiding is more complex – e.g. as above with ‘Lc’. essentially matching outputs with inputs, and combining those sequences (potentially expansive!)

slide-29
SLIDE 29

Code Analysis

Generating Models of occam-π Programs

Input, output and assignment are largely straightforward: mobility P = {out!x} mobility Q = {in?y}

PROC R (CHAN MOBILE THING in?, out!) MOBILE THING v, w: SEQ in ? v w := v

  • ut ! w

:

mobility R = {in?v, Lc!v, Lc?w, out!w} \ {Lc} As are choice (ALT, IF, CASE) and parallelism (PAR).

simply the set union of the different branches. hiding is more complex – e.g. as above with ‘Lc’. essentially matching outputs with inputs, and combining those sequences (potentially expansive!)

slide-30
SLIDE 30

Code Analysis

Generating Models of occam-π Programs

Input, output and assignment are largely straightforward: mobility P = {out!x} mobility Q = {in?y}

PROC R (CHAN MOBILE THING in?, out!) MOBILE THING v, w: SEQ in ? v w := v

  • ut ! w

:

mobility R = {in?v, Lc!v, Lc?w, out!w} \ {Lc}

based on the equivalence:

x := y

CHAN INT c: PAR c ! y c ? x

= {in?u, out!u} As are choice (ALT, IF, CASE) and parallelism (PAR).

simply the set union of the different branches. hiding is more complex – e.g. as above with ‘Lc’. essentially matching outputs with inputs, and combining those sequences (potentially expansive!)

slide-31
SLIDE 31

Code Analysis

Generating Models of occam-π Programs

Input, output and assignment are largely straightforward: mobility P = {out!x} mobility Q = {in?y}

PROC R (CHAN MOBILE THING in?, out!) MOBILE THING v, w: SEQ in ? v w := v

  • ut ! w

:

mobility R = {in?v, Lc!v, Lc?w, out!w} \ {Lc}

based on the equivalence:

x := y

CHAN INT c: PAR c ! y c ? x

= {in?u, out!u} As are choice (ALT, IF, CASE) and parallelism (PAR).

simply the set union of the different branches. hiding is more complex – e.g. as above with ‘Lc’. essentially matching outputs with inputs, and combining those sequences (potentially expansive!)

slide-32
SLIDE 32

Code Analysis

Generating Models of occam-π Programs

Input, output and assignment are largely straightforward: mobility P = {out!x} mobility Q = {in?y}

PROC R (CHAN MOBILE THING in?, out!) MOBILE THING v, w: SEQ in ? v w := v

  • ut ! w

:

mobility R = {in?v, Lc!v, Lc?w, out!w} \ {Lc}

based on the equivalence:

x := y

CHAN INT c: PAR c ! y c ? x

= {in?u, out!u} As are choice (ALT, IF, CASE) and parallelism (PAR).

simply the set union of the different branches. hiding is more complex – e.g. as above with ‘Lc’. essentially matching outputs with inputs, and combining those sequences (potentially expansive!)

slide-33
SLIDE 33

Code Analysis

Higher Order Communication

Things get more interesting when we start moving channels around. The syntax ‘¯ x’ represents the server-end of a mobile channel-type.

Shared mobiles are represented as ‘x+’

The resulting expression here indicates a system in which a mobile ‘b’ is communicated internally over some mobile channel-bundle ‘x, ¯ x’, but which never escapes.

slide-34
SLIDE 34

Code Analysis

Higher Order Communication

Things get more interesting when we start moving channels around.

generator client server

The syntax ‘¯ x’ represents the server-end of a mobile channel-type.

Shared mobiles are represented as ‘x+’

The resulting expression here indicates a system in which a mobile ‘b’ is communicated internally over some mobile channel-bundle ‘x, ¯ x’, but which never escapes.

slide-35
SLIDE 35

Code Analysis

Higher Order Communication

Things get more interesting when we start moving channels around.

generator client server

PROC generator (CHAN CT.FOO! out.c!, CHAN CT.FOO? out.s!) CT.FOO? svr: CT.FOO! cli: SEQ cli, svr := MOBILE CT.FOO PAR

  • ut.c ! cli
  • ut.s ! svr

:

The syntax ‘¯ x’ represents the server-end of a mobile channel-type.

Shared mobiles are represented as ‘x+’

The resulting expression here indicates a system in which a mobile ‘b’ is communicated internally over some mobile channel-bundle ‘x, ¯ x’, but which never escapes.

slide-36
SLIDE 36

Code Analysis

Higher Order Communication

Things get more interesting when we start moving channels around.

generator client server

PROC generator (CHAN CT.FOO! out.c!, CHAN CT.FOO? out.s!) CT.FOO? svr: CT.FOO! cli: SEQ cli, svr := MOBILE CT.FOO PAR

  • ut.c ! cli
  • ut.s ! svr

:

The syntax ‘¯ x’ represents the server-end of a mobile channel-type.

Shared mobiles are represented as ‘x+’

The resulting expression here indicates a system in which a mobile ‘b’ is communicated internally over some mobile channel-bundle ‘x, ¯ x’, but which never escapes.

slide-37
SLIDE 37

Code Analysis

Higher Order Communication

Things get more interesting when we start moving channels around.

generator client server

PROC generator (CHAN CT.FOO! out.c!, CHAN CT.FOO? out.s!) CT.FOO? svr: CT.FOO! cli: SEQ cli, svr := MOBILE CT.FOO PAR

  • ut.c ! cli
  • ut.s ! svr

:

The syntax ‘¯ x’ represents the server-end of a mobile channel-type.

Shared mobiles are represented as ‘x+’

The resulting expression here indicates a system in which a mobile ‘b’ is communicated internally over some mobile channel-bundle ‘x, ¯ x’, but which never escapes.

slide-38
SLIDE 38

Code Analysis

Higher Order Communication

Things get more interesting when we start moving channels around.

generator client server

PROC generator (CHAN CT.FOO! out.c!, CHAN CT.FOO? out.s!) CT.FOO? svr: CT.FOO! cli: SEQ cli, svr := MOBILE CT.FOO PAR

  • ut.c ! cli
  • ut.s ! svr

:

The syntax ‘¯ x’ represents the server-end of a mobile channel-type.

Shared mobiles are represented as ‘x+’

The resulting expression here indicates a system in which a mobile ‘b’ is communicated internally over some mobile channel-bundle ‘x, ¯ x’, but which never escapes.

slide-39
SLIDE 39

Code Analysis

Higher Order Communication

Things get more interesting when we start moving channels around.

generator client server

PROC generator (CHAN CT.FOO! out.c!, CHAN CT.FOO? out.s!) CT.FOO? svr: CT.FOO! cli: SEQ cli, svr := MOBILE CT.FOO PAR

  • ut.c ! cli
  • ut.s ! svr

:

mobility GEN = {out.c!x, out.s!¯

x}

The syntax ‘¯ x’ represents the server-end of a mobile channel-type.

Shared mobiles are represented as ‘x+’

The resulting expression here indicates a system in which a mobile ‘b’ is communicated internally over some mobile channel-bundle ‘x, ¯ x’, but which never escapes.

slide-40
SLIDE 40

Code Analysis

Higher Order Communication

Things get more interesting when we start moving channels around.

generator client server

mobility GEN = {out.c!x, out.s!¯

x}

PROC client (CHAN CT.FOO! in?) CT.FOO! cli: MOBILE THING v: SEQ in ? cli ... initialise ‘v’ cli[c] ! v :

mobility CLI = {in?a, a!b} The syntax ‘¯ x’ represents the server-end of a mobile channel-type.

Shared mobiles are represented as ‘x+’

The resulting expression here indicates a system in which a mobile ‘b’ is communicated internally over some mobile channel-bundle ‘x, ¯ x’, but which never escapes.

slide-41
SLIDE 41

Code Analysis

Higher Order Communication

Things get more interesting when we start moving channels around.

generator client server

mobility GEN = {out.c!x, out.s!¯

x}

mobility CLI = {in?a, a!b}

PROC server (CHAN CT.FOO? in?) CT.FOO? svr: MOBILE THING x: SEQ in ? svr svr[c] ? x ... use ‘x’ :

mobility SVR = {in?¯

d, ¯

d?e} The syntax ‘¯ x’ represents the server-end of a mobile channel-type.

Shared mobiles are represented as ‘x+’

The resulting expression here indicates a system in which a mobile ‘b’ is communicated internally over some mobile channel-bundle ‘x, ¯ x’, but which never escapes.

slide-42
SLIDE 42

Code Analysis

Higher Order Communication

Things get more interesting when we start moving channels around.

generator client server

mobility GEN = {out.c!x, out.s!¯

x}

mobility CLI = {in?a, a!b} mobility SVR = {in?¯

d, ¯

d?e}

CHAN CT.FOO! c: CHAN CT.FOO? s: PAR generator (c!, s!) client (c?) server (s?)

c s

mobility = {c!x, s!¯

x, c?a, a!b,

s?¯

d, ¯

d?e} \ {c, s} The syntax ‘¯ x’ represents the server-end of a mobile channel-type.

Shared mobiles are represented as ‘x+’

The resulting expression here indicates a system in which a mobile ‘b’ is communicated internally over some mobile channel-bundle ‘x, ¯ x’, but which never escapes.

slide-43
SLIDE 43

Code Analysis

Higher Order Communication

Things get more interesting when we start moving channels around.

generator client server

mobility GEN = {out.c!x, out.s!¯

x}

mobility CLI = {in?a, a!b} mobility SVR = {in?¯

d, ¯

d?e}

CHAN CT.FOO! c: CHAN CT.FOO? s: PAR generator (c!, s!) client (c?) server (s?)

c s

mobility = {c!x, s!¯

x, c?a, a!b,

s?¯

d, ¯

d?e} \ {c, s} = {x!b, ¯ x?d} The syntax ‘¯ x’ represents the server-end of a mobile channel-type.

Shared mobiles are represented as ‘x+’

The resulting expression here indicates a system in which a mobile ‘b’ is communicated internally over some mobile channel-bundle ‘x, ¯ x’, but which never escapes.

slide-44
SLIDE 44

Code Analysis

Higher Order Communication

Things get more interesting when we start moving channels around.

generator client server

mobility GEN = {out.c!x, out.s!¯

x}

mobility CLI = {in?a, a!b} mobility SVR = {in?¯

d, ¯

d?e}

CHAN CT.FOO! c: CHAN CT.FOO? s: PAR generator (c!, s!) client (c?) server (s?)

c s

mobility = {c!x, s!¯

x, c?a, a!b,

s?¯

d, ¯

d?e} \ {c, s} = {x!b, ¯ x?d} The syntax ‘¯ x’ represents the server-end of a mobile channel-type.

Shared mobiles are represented as ‘x+’

The resulting expression here indicates a system in which a mobile ‘b’ is communicated internally over some mobile channel-bundle ‘x, ¯ x’, but which never escapes.

slide-45
SLIDE 45

Example

Using Mobile Analysis

delta choice gen plex sink

When composed in parallel, with renaming for parameter passing and avoiding capture, this gives the mobility set: mobility net = {A?a, X!a, A?b, p!b, B?c, q!c, B?d, r!d s!e, p?f , Y !f , q?g, Y !g, r?h, s?h} \ {p, q, r, s}

slide-46
SLIDE 46

Example

Using Mobile Analysis

delta choice gen plex sink delta

in?

  • ut0!
  • ut1!

mobility delta = {in?a, out0!a, in?b, out1!b}

When composed in parallel, with renaming for parameter passing and avoiding capture, this gives the mobility set: mobility net = {A?a, X!a, A?b, p!b, B?c, q!c, B?d, r!d s!e, p?f , Y !f , q?g, Y !g, r?h, s?h} \ {p, q, r, s}

slide-47
SLIDE 47

Example

Using Mobile Analysis

delta choice gen plex sink

mobility delta = {in?a, out0!a, in?b, out1!b}

choice

in?

  • ut0!
  • ut1!

mobility choice = {in?a, out0!a, in?b, out1!b}

When composed in parallel, with renaming for parameter passing and avoiding capture, this gives the mobility set: mobility net = {A?a, X!a, A?b, p!b, B?c, q!c, B?d, r!d s!e, p?f , Y !f , q?g, Y !g, r?h, s?h} \ {p, q, r, s}

slide-48
SLIDE 48

Example

Using Mobile Analysis

delta choice gen plex sink

mobility delta = {in?a, out0!a, in?b, out1!b} mobility choice = {in?a, out0!a, in?b, out1!b}

gen

  • ut!

mobility gen = {out!a}

When composed in parallel, with renaming for parameter passing and avoiding capture, this gives the mobility set: mobility net = {A?a, X!a, A?b, p!b, B?c, q!c, B?d, r!d s!e, p?f , Y !f , q?g, Y !g, r?h, s?h} \ {p, q, r, s}

slide-49
SLIDE 49

Example

Using Mobile Analysis

delta choice gen plex sink

mobility delta = {in?a, out0!a, in?b, out1!b} mobility choice = {in?a, out0!a, in?b, out1!b} mobility gen = {out!a}

plex

  • ut!

in0? in1?

mobility plex = {in0?a, out!a, in1?b, out!b}

When composed in parallel, with renaming for parameter passing and avoiding capture, this gives the mobility set: mobility net = {A?a, X!a, A?b, p!b, B?c, q!c, B?d, r!d s!e, p?f , Y !f , q?g, Y !g, r?h, s?h} \ {p, q, r, s}

slide-50
SLIDE 50

Example

Using Mobile Analysis

delta choice gen plex sink

mobility delta = {in?a, out0!a, in?b, out1!b} mobility choice = {in?a, out0!a, in?b, out1!b} mobility gen = {out!a} mobility plex = {in0?a, out!a, in1?b, out!b}

sink

in0? in1?

mobility sink = {in0?a, in1?b}

When composed in parallel, with renaming for parameter passing and avoiding capture, this gives the mobility set: mobility net = {A?a, X!a, A?b, p!b, B?c, q!c, B?d, r!d s!e, p?f , Y !f , q?g, Y !g, r?h, s?h} \ {p, q, r, s}

slide-51
SLIDE 51

Example

Using Mobile Analysis

mobility delta = {in?a, out0!a, in?b, out1!b} mobility choice = {in?a, out0!a, in?b, out1!b} mobility gen = {out!a} mobility plex = {in0?a, out!a, in1?b, out!b} mobility sink = {in0?a, in1?b}

delta choice gen plex sink

When composed in parallel, with renaming for parameter passing and avoiding capture, this gives the mobility set: mobility net = {A?a, X!a, A?b, p!b, B?c, q!c, B?d, r!d s!e, p?f , Y !f , q?g, Y !g, r?h, s?h} \ {p, q, r, s}

slide-52
SLIDE 52

Example

Using Mobile Analysis

mobility delta = {in?a, out0!a, in?b, out1!b} mobility choice = {in?a, out0!a, in?b, out1!b} mobility gen = {out!a} mobility plex = {in0?a, out!a, in1?b, out!b} mobility sink = {in0?a, in1?b}

delta choice gen plex sink

p q r s

A? B? X! Y!

net

When composed in parallel, with renaming for parameter passing and avoiding capture, this gives the mobility set: mobility net = {A?a, X!a, A?b, p!b, B?c, q!c, B?d, r!d s!e, p?f , Y !f , q?g, Y !g, r?h, s?h} \ {p, q, r, s}

slide-53
SLIDE 53

Example

Using Mobile Analysis

mobility delta = {in?a, out0!a, in?b, out1!b} mobility choice = {in?a, out0!a, in?b, out1!b} mobility gen = {out!a} mobility plex = {in0?a, out!a, in1?b, out!b} mobility sink = {in0?a, in1?b}

delta choice gen plex sink

p q r s

A? B? X! Y!

net

When composed in parallel, with renaming for parameter passing and avoiding capture, this gives the mobility set: mobility net = {A?a, X!a, A?b, p!b, B?c, q!c, B?d, r!d s!e, p?f , Y !f , q?g, Y !g, r?h, s?h} \ {p, q, r, s}

slide-54
SLIDE 54

Example

Using Mobile Analysis

Hiding the internal channels gives:

\{p}

− → {A?a, X!a, A?b, Y !b, B?c, q!c, B?d, r!d, s!e, q?g, Y !g, r?h, s?h}

\{q}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d, r!d, s!e, r?h, s?h}

\{r}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d, s!e, s?h}

\{s}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d}

net

A? B? X! Y!

Which indicates that mobiles arriving on A escape on X and Y; and that mobiles arriving on B escape on Y or are consumed internally.

by what is not present: no mobiles received on A are discarded internally; and that no internally generated mobiles escape.

slide-55
SLIDE 55

Example

Using Mobile Analysis

Hiding the internal channels gives:

\{p}

− → {A?a, X!a, A?b, Y !b, B?c, q!c, B?d, r!d, s!e, q?g, Y !g, r?h, s?h}

\{q}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d, r!d, s!e, r?h, s?h}

\{r}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d, s!e, s?h}

\{s}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d}

net

A? B? X! Y!

Which indicates that mobiles arriving on A escape on X and Y; and that mobiles arriving on B escape on Y or are consumed internally.

by what is not present: no mobiles received on A are discarded internally; and that no internally generated mobiles escape.

slide-56
SLIDE 56

Example

Using Mobile Analysis

Hiding the internal channels gives:

\{p}

− → {A?a, X!a, A?b, Y !b, B?c, q!c, B?d, r!d, s!e, q?g, Y !g, r?h, s?h}

\{q}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d, r!d, s!e, r?h, s?h}

\{r}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d, s!e, s?h}

\{s}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d}

net

A? B? X! Y!

Which indicates that mobiles arriving on A escape on X and Y; and that mobiles arriving on B escape on Y or are consumed internally.

by what is not present: no mobiles received on A are discarded internally; and that no internally generated mobiles escape.

slide-57
SLIDE 57

Example

Using Mobile Analysis

Hiding the internal channels gives:

\{p}

− → {A?a, X!a, A?b, Y !b, B?c, q!c, B?d, r!d, s!e, q?g, Y !g, r?h, s?h}

\{q}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d, r!d, s!e, r?h, s?h}

\{r}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d, s!e, s?h}

\{s}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d}

net

A? B? X! Y!

Which indicates that mobiles arriving on A escape on X and Y; and that mobiles arriving on B escape on Y or are consumed internally.

by what is not present: no mobiles received on A are discarded internally; and that no internally generated mobiles escape.

slide-58
SLIDE 58

Example

Using Mobile Analysis

Hiding the internal channels gives:

\{p}

− → {A?a, X!a, A?b, Y !b, B?c, q!c, B?d, r!d, s!e, q?g, Y !g, r?h, s?h}

\{q}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d, r!d, s!e, r?h, s?h}

\{r}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d, s!e, s?h}

\{s}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d}

net

A? B? X! Y!

Which indicates that mobiles arriving on A escape on X and Y; and that mobiles arriving on B escape on Y or are consumed internally.

by what is not present: no mobiles received on A are discarded internally; and that no internally generated mobiles escape.

slide-59
SLIDE 59

Example

Using Mobile Analysis

Hiding the internal channels gives:

\{p}

− → {A?a, X!a, A?b, Y !b, B?c, q!c, B?d, r!d, s!e, q?g, Y !g, r?h, s?h}

\{q}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d, r!d, s!e, r?h, s?h}

\{r}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d, s!e, s?h}

\{s}

− → {A?a, X!a, A?b, Y !b, B?c, Y !c, B?d}

net

A? B? X! Y!

Which indicates that mobiles arriving on A escape on X and Y; and that mobiles arriving on B escape on Y or are consumed internally.

by what is not present: no mobiles received on A are discarded internally; and that no internally generated mobiles escape.

slide-60
SLIDE 60

Backmatter

Conclusions

A semantic model that can be used to reason about the escape of mobile items within an occam-π system.

handles the movement of mobile channels and subsequent communication on then. can be used to reason about safety properties of systems involving mobiles – and to inform optimisation or distribution.

The paper contains more details on the semantics, as well as more complex examples taken from real systems. Future work includes:

generation of these models automatically by the compiler. tools to manipulate models (not as complex as FDR). complete denotational semantics. application of the techniques to other process-oriented systems.

slide-61
SLIDE 61

Backmatter

Conclusions

A semantic model that can be used to reason about the escape of mobile items within an occam-π system.

handles the movement of mobile channels and subsequent communication on then. can be used to reason about safety properties of systems involving mobiles – and to inform optimisation or distribution.

The paper contains more details on the semantics, as well as more complex examples taken from real systems. Future work includes:

generation of these models automatically by the compiler. tools to manipulate models (not as complex as FDR). complete denotational semantics. application of the techniques to other process-oriented systems.

slide-62
SLIDE 62

Backmatter

Conclusions

A semantic model that can be used to reason about the escape of mobile items within an occam-π system.

handles the movement of mobile channels and subsequent communication on then. can be used to reason about safety properties of systems involving mobiles – and to inform optimisation or distribution.

The paper contains more details on the semantics, as well as more complex examples taken from real systems. Future work includes:

generation of these models automatically by the compiler. tools to manipulate models (not as complex as FDR). complete denotational semantics. application of the techniques to other process-oriented systems.

slide-63
SLIDE 63

Backmatter

The End

Any questions?

This work was funded by EPSRC grant EP/D061822/1. Thanks to the anonymous reviewers and colleagues for their feedback.

slide-64
SLIDE 64

Backmatter

References

C.A.R. Hoare. Communicating Sequential Processes. Prentice-Hall, London, 1985. ISBN: 0-13-153271-5. Frederick R. M. Barnes and Carl G. Ritson. Checking process-oriented operating system behaviour using CSP and refinement. In PLOS 2009. ACM. To Appear.

  • R. Milner.

Communicating and Mobile Systems: the Pi-Calculus. Cambridge University Press, 1999. ISBN: 0-52165-869-1.

slide-65
SLIDE 65

Extras

Mobility Refinement

With the ordinary semantic models, we have a notion of refinement. no reason why one should not exist for the mobility model presented here: P ⊑M Q ≡ mobility Q ⊆ mobility P The informal interpretation is that Q is “less leaky” than P, when it comes to mobile escape.

some fudge required in the subset operation: e.g. {c?x} refines {c?x, d!x}, as does {d!y}. can arise in an implementation that copies data between mobiles.

slide-66
SLIDE 66

Extras

Expansive Hiding

Hiding is not always an reducing operation:

can easily blow-up, reflecting the different possibilities for mobiles.

{A?a, c!a, B?b, c!b, c?f , X!f , c?g, Y !g, c?h, Z!h}

\{c}

− → {A?a, X!a, A?a, Y !a, A?a, Z!a, B?b, X!b, B?b, Y !b, B?b, Z!b} Worse-case is limited by type compatibility.

slide-67
SLIDE 67

Extras

Denotational Semantics

Alphabets (for any particular occam-π process):

  • utput channels: Σ!, input channels: Σ?, such that Σ = Σ! ∪ Σ?.

also grouped by type: Σt, where t is a valid occam-π protocol and t ∈ T, where T is the set of valid occam-π protocols.

following on: Σt = Σ!

t ∪ Σ? t , and ∀ t : T · Σt ⊆ Σ.

for shared mobiles: Σ+ = Σ!

+ ∪ Σ? +.

Primitive processes: mobility SKIP = mobility STOP = mobility div = mobility CHAOS = {C!a | C ∈ Σ!} ∪ {D?x | D ∈ Σ?}∪ {C?v, D!v | ∀ t : T · (C, D) ∈ Σ?

t × Σ! t)}

slide-68
SLIDE 68

Extras

Denotational Semantics

Choice: mobility (P ✷ Q) = (mobility P) ∪ (mobility Q) mobility (P ⊓ Q) = (mobility P) ∪ (mobility Q) Interleaving and parallelism: mobility (P Q) = (mobilityP) ∪ (mobility Q) Hiding: mobility (P \ x) =

  • M ˆN[α/β] |
  • M ˆx!α, x?βˆN
  • ∈ mobility P × mobilityP
  • (mobility P) −
  • F ˆx!α | F ˆx!α ∈ mobility P
  • x?βˆG | x?βˆG ∈ mobility P
  • H | (H ˆx!α) ∈ mobility P ∧ (x?βˆI) /

∈ mobility P ∧ H =

  • J | (x?βˆJ) ∈ mobility P ∧ (J ˆx!α) /

∈ mobility P ∧ J =