Dynamic and Local Typing for Mobile Ambients MYTHS / MIKADO / DART - - PowerPoint PPT Presentation

dynamic and local typing for mobile ambients
SMART_READER_LITE
LIVE PREVIEW

Dynamic and Local Typing for Mobile Ambients MYTHS / MIKADO / DART - - PowerPoint PPT Presentation

Dynamic and Local Typing for Mobile Ambients MYTHS / MIKADO / DART Meeting, Venice, June 14, 2004 M. Coppo 1 , M. Dezani 1 , E. Giovannetti 1 , R. Pugliese 2 (1) Dipartimento di Informatica Universit di Torino (2) Dip. di Sistemi e


slide-1
SLIDE 1

Dynamic and Local Typing for Mobile Ambients

MYTHS / MIKADO / DART Meeting, Venice, June 14, 2004

  • M. Coppo1, M. Dezani1, E. Giovannetti1, R. Pugliese2

(1) Dipartimento di Informatica – Università di Torino (2) Dip. di Sistemi e Informatica – Università di Firenze

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 1/21

slide-2
SLIDE 2

Modelling of wide-area distributed and mobile computing:

interacting components from different locations are unknown or only partially known to each other

each component must carry behavioural information, to be checked at runtime

Γ ⊢ t : T

assumptions on the world

component : behavioural properties

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 2/21

slide-3
SLIDE 3

A proposal

A typed ambient calculus with: behavioural type assumptions local to each ambient no global type assumptions on ambient names ambient types attached to single ambient constructions, not to ambient names runtime types used to check compatibility between components from different localities Specific features of the calculus: no ambient opening

  • nly local communication

general process mobility

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 3/21

slide-4
SLIDE 4

The typed calculus: mobility primitives

ambient mobility: in, out

(R-in)

n[ in m . P | Q ] | m[R] → m[ n[ P | Q ] | R ]

(R-out)

m[ n[ out m . P | Q ] | R ] → n[ P | Q ] | m[R]

process mobility: down, up

down n . P | n[Q] → n[P | Q] m[n[up m . P | Q] | R] → m[P | n[Q] | R]

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 4/21

slide-5
SLIDE 5

Process mobility: down

down m moves the continuation process from its ambient down to an enclosed ambient m

down m . P | m R m P | R

The down primitive

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 5/21

slide-6
SLIDE 6

Process mobility: up

up m moves the continuation process from its ambient up to the enclosing ambient m

m

| R

n up m . P | Q The up primitive m

| P | R

n Q

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 6/21

slide-7
SLIDE 7

Types

describe communication and mobility properties An ambient has:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 7/21

slide-8
SLIDE 8

Types

describe communication and mobility properties An ambient has:

active mobility – static typing: the ambients it may cross and the

ambients it may send processes to;

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 7/21

slide-9
SLIDE 9

Types

describe communication and mobility properties An ambient has:

active mobility – static typing: the ambients it may cross and the

ambients it may send processes to;

passive mobility – dynamic typing: the ambients by which it may be

crossed and the ones by which it may be sent processes to.

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 7/21

slide-10
SLIDE 10

Types

describe communication and mobility properties An ambient has:

active mobility – static typing: the ambients it may cross and the

ambients it may send processes to;

passive mobility – dynamic typing: the ambients by which it may be

crossed and the ones by which it may be sent processes to. A process has:

active mobility – static typing: the ambients to which it may drive its

enclosing ambient, and the ones to which it may go.

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 7/21

slide-11
SLIDE 11

Types

describe communication and mobility properties An ambient has:

active mobility – static typing: the ambients it may cross and the

ambients it may send processes to;

passive mobility – dynamic typing: the ambients by which it may be

crossed and the ones by which it may be sent processes to. A process has:

active mobility – static typing: the ambients to which it may drive its

enclosing ambient, and the ones to which it may go. are based on ambient groups:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 7/21

slide-12
SLIDE 12

Types

describe communication and mobility properties An ambient has:

active mobility – static typing: the ambients it may cross and the

ambients it may send processes to;

passive mobility – dynamic typing: the ambients by which it may be

crossed and the ones by which it may be sent processes to. A process has:

active mobility – static typing: the ambients to which it may drive its

enclosing ambient, and the ones to which it may go. are based on ambient groups: a group is a name that labels a set of ambients

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 7/21

slide-13
SLIDE 13

Types

describe communication and mobility properties An ambient has:

active mobility – static typing: the ambients it may cross and the

ambients it may send processes to;

passive mobility – dynamic typing: the ambients by which it may be

crossed and the ones by which it may be sent processes to. A process has:

active mobility – static typing: the ambients to which it may drive its

enclosing ambient, and the ones to which it may go. are based on ambient groups: a group is a name that labels a set of ambients different ambients with the same name may belong to different groups

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 7/21

slide-14
SLIDE 14

Types

describe communication and mobility properties An ambient has:

active mobility – static typing: the ambients it may cross and the

ambients it may send processes to;

passive mobility – dynamic typing: the ambients by which it may be

crossed and the ones by which it may be sent processes to. A process has:

active mobility – static typing: the ambients to which it may drive its

enclosing ambient, and the ones to which it may go. are based on ambient groups: a group is a name that labels a set of ambients different ambients with the same name may belong to different groups mobility properties are expressed via groups

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 7/21

slide-15
SLIDE 15

Static types: active mobility

process types Pro ::= g(G) g

group names

G ::= mc(C , E , T) mobcom (mobility + communication) types,

where:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 8/21

slide-16
SLIDE 16

Static types: active mobility

process types Pro ::= g(G) g

group names

G ::= mc(C , E , T) mobcom (mobility + communication) types,

where:

C set of groups of ambients into which the process may drive

(through an in or out action) its enclosing ambient

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 8/21

slide-17
SLIDE 17

Static types: active mobility

process types Pro ::= g(G) g

group names

G ::= mc(C , E , T) mobcom (mobility + communication) types,

where:

C set of groups of ambients into which the process may drive

(through an in or out action) its enclosing ambient

E

is the set of (groups of) ambients to which it may send (through a down or up action) a continuation process

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 8/21

slide-18
SLIDE 18

Static types: active mobility

process types Pro ::= g(G) g

group names

G ::= mc(C , E , T) mobcom (mobility + communication) types,

where:

C set of groups of ambients into which the process may drive

(through an in or out action) its enclosing ambient

E

is the set of (groups of) ambients to which it may send (through a down or up action) a continuation process

T is the process communication type

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 8/21

slide-19
SLIDE 19

Static types: active mobility

process types Pro ::= g(G) g

group names

G ::= mc(C , E , T) mobcom (mobility + communication) types,

where:

C set of groups of ambients into which the process may drive

(through an in or out action) its enclosing ambient

E

is the set of (groups of) ambients to which it may send (through a down or up action) a continuation process

T is the process communication type ambient type amb (atomic type)

no mobcom types for ambient names

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 8/21

slide-20
SLIDE 20

Runtime packing of static types

ambient mobility actions specify target’s name and group:

in/

  • ut α:g

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 9/21

slide-21
SLIDE 21

Runtime packing of static types

ambient mobility actions specify target’s name and group:

in/

  • ut α:g

parallel processes must have, as usual, the same process type;

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 9/21

slide-22
SLIDE 22

Runtime packing of static types

ambient mobility actions specify target’s name and group:

in/

  • ut α:g

parallel processes must have, as usual, the same process type; if P is well typed with type g(G) and m is an ambient name, the ambient construction of skeleton m[P] is always well typed, and g(G) is the ambient inner type;

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 9/21

slide-23
SLIDE 23

Runtime packing of static types

ambient mobility actions specify target’s name and group:

in/

  • ut α:g

parallel processes must have, as usual, the same process type; if P is well typed with type g(G) and m is an ambient name, the ambient construction of skeleton m[P] is always well typed, and g(G) is the ambient inner type; a process going up or down into an ambient must have a type compatible with the ambient’s inner type: runtime checking is needed, therefore:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 9/21

slide-24
SLIDE 24

Runtime packing of static types

ambient mobility actions specify target’s name and group:

in/

  • ut α:g

parallel processes must have, as usual, the same process type; if P is well typed with type g(G) and m is an ambient name, the ambient construction of skeleton m[P] is always well typed, and g(G) is the ambient inner type; a process going up or down into an ambient must have a type compatible with the ambient’s inner type: runtime checking is needed, therefore: ambient carries at runtime its inner type:

m:g(G)[X]

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 9/21

slide-25
SLIDE 25

Runtime packing of static types

ambient mobility actions specify target’s name and group:

in/

  • ut α:g

parallel processes must have, as usual, the same process type; if P is well typed with type g(G) and m is an ambient name, the ambient construction of skeleton m[P] is always well typed, and g(G) is the ambient inner type; a process going up or down into an ambient must have a type compatible with the ambient’s inner type: runtime checking is needed, therefore: ambient carries at runtime its inner type:

m:g(G)[X]

process mobility action carries the type of its continuation:

down/ up α:g with G

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 9/21

slide-26
SLIDE 26

The syntax of types

G ::= mc(C , E , T) mobcom type: mobility and communication type Pro ::= g(G) process type: processes of group g with mobcom type G Cap ::= g(G) g′(G′) capabilities that can be consumed by processes of type g(G) and leave processes of type g′(G′) as continuations W ::= message type Cap capability type group group amb ambient type T ::= communication type shh no communication − → W communication of messages of type − → W Σ ::= ∅ variable environment Σ, x : W

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 10/21

slide-27
SLIDE 27

Dynamic types: passive mobility

Each ambient contains a dynamic characterization of its passive mobility. Complete form of the ambient construct:

α:g(G)[c, eP]

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 11/21

slide-28
SLIDE 28

Dynamic types: passive mobility

Each ambient contains a dynamic characterization of its passive mobility. Complete form of the ambient construct:

α:g(G)[c, eP]

c,e: two multisets of dynamic mobility permissions (w.r.t. itself) granted to other ambients:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 11/21

slide-29
SLIDE 29

Dynamic types: passive mobility

Each ambient contains a dynamic characterization of its passive mobility. Complete form of the ambient construct:

α:g(G)[c, eP]

c,e: two multisets of dynamic mobility permissions (w.r.t. itself) granted to other ambients: execution of a statically allowed action:

  • nly possible if a corresponding dynamic permit is present;

consumes the permit

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 11/21

slide-30
SLIDE 30

Dynamic types: passive mobility

Each ambient contains a dynamic characterization of its passive mobility. Complete form of the ambient construct:

α:g(G)[c, eP]

c,e: two multisets of dynamic mobility permissions (w.r.t. itself) granted to other ambients: execution of a statically allowed action:

  • nly possible if a corresponding dynamic permit is present;

consumes the permit elements of infinite multiplicity, representing permanent permits, may be present in multisets.

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 11/21

slide-31
SLIDE 31

Dynamic types: passive mobility

Each ambient contains a dynamic characterization of its passive mobility. Complete form of the ambient construct:

α:g(G)[c, eP]

c,e: two multisets of dynamic mobility permissions (w.r.t. itself) granted to other ambients: c: multiset of groups of ambients allowed to go in or out of it; e: multiset of permits for processes to go up or down into it: element of e: a pair g′, G′, entrance permit for a g’-process with a G’-behaviour; constraint: G′ ≤ G execution of a statically allowed action:

  • nly possible if a corresponding dynamic permit is present;

consumes the permit elements of infinite multiplicity, representing permanent permits, may be present in multisets.

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 11/21

slide-32
SLIDE 32

Dynamic modification of mobility permits

c and e allow and forbid movements at runtime. They can therefore be changed dynamically without breaking the subject reduction, by:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 12/21

slide-33
SLIDE 33

Dynamic modification of mobility permits

c and e allow and forbid movements at runtime. They can therefore be changed dynamically without breaking the subject reduction, by: consuming one (non-permanent) permit: automatic when a movement action is performed;

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 12/21

slide-34
SLIDE 34

Dynamic modification of mobility permits

c and e allow and forbid movements at runtime. They can therefore be changed dynamically without breaking the subject reduction, by: consuming one (non-permanent) permit: automatic when a movement action is performed; adding a (possibly multiple) permit: explicitly by means of the permit-adding primitives:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 12/21

slide-35
SLIDE 35

Dynamic modification of mobility permits

c and e allow and forbid movements at runtime. They can therefore be changed dynamically without breaking the subject reduction, by: consuming one (non-permanent) permit: automatic when a movement action is performed; adding a (possibly multiple) permit: explicitly by means of the permit-adding primitives: addc gϕ in m:gm adds the group g with multiplicity ϕ to the c component of a local ambient of name m and group gm

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 12/21

slide-36
SLIDE 36

Dynamic modification of mobility permits

c and e allow and forbid movements at runtime. They can therefore be changed dynamically without breaking the subject reduction, by: consuming one (non-permanent) permit: automatic when a movement action is performed; adding a (possibly multiple) permit: explicitly by means of the permit-adding primitives: addc gϕ in m:gm adds the group g with multiplicity ϕ to the c component of a local ambient of name m and group gm adde g, G1ϕ in m:gm adds the group/type pair g, G1 ⊓ Gm with multiplicity ϕ to the e component of a local ambient m:gm(Gm)[c, eP] intersection preserves the invariant g′, G′ ∈ e ⇒ G′ ≤ Gm

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 12/21

slide-37
SLIDE 37

An example: a public transportation system

a top-level untrusted ambient, named world, which includes named ambients representing cities, countryside, etc.

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 13/21

slide-38
SLIDE 38

An example: a public transportation system

a top-level untrusted ambient, named world, which includes named ambients representing cities, countryside, etc. cities in turn contain stations (which are ambients)

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 13/21

slide-39
SLIDE 39

An example: a public transportation system

a top-level untrusted ambient, named world, which includes named ambients representing cities, countryside, etc. cities in turn contain stations (which are ambients) trains are mobile ambients moving between stations

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 13/21

slide-40
SLIDE 40

An example: a public transportation system

a top-level untrusted ambient, named world, which includes named ambients representing cities, countryside, etc. cities in turn contain stations (which are ambients) trains are mobile ambients moving between stations travellers, represented by mobile processes, get into and off trains at the stations in order to move between cities.

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 13/21

slide-41
SLIDE 41

An example: a public transportation system

a top-level untrusted ambient, named world, which includes named ambients representing cities, countryside, etc. cities in turn contain stations (which are ambients) trains are mobile ambients moving between stations travellers, represented by mobile processes, get into and off trains at the stations in order to move between cities.

A simplified system

two cities tur and flo, with their respective stations st tur and st flo

  • ne train commuting between st tur and st flo.

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 13/21

slide-42
SLIDE 42

A public transportation system: stations

A station is an ambient of group gst and of name st X, with X = tur, flor: st X:gst(Gst)[cst, est . . . ], where:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 14/21

slide-43
SLIDE 43

A public transportation system: stations

A station is an ambient of group gst and of name st X, with X = tur, flor: st X:gst(Gst)[cst, est . . . ], where: Gst specifies the station’s active properties, statically checked:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 14/21

slide-44
SLIDE 44

A public transportation system: stations

A station is an ambient of group gst and of name st X, with X = tur, flor: st X:gst(Gst)[cst, est . . . ], where: Gst specifies the station’s active properties, statically checked: Gst = mc(∅, )

  • 1. a station cannot go in or out of ambients (is immobile);

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 14/21

slide-45
SLIDE 45

A public transportation system: stations

A station is an ambient of group gst and of name st X, with X = tur, flor: st X:gst(Gst)[cst, est . . . ], where: Gst specifies the station’s active properties, statically checked: Gst = mc(∅, {gtr, gcity})

  • 1. a station cannot go in or out of ambients (is immobile);
  • 2. may send out processes (i.e., passengers)

to the train and to the surrounding city;

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 14/21

slide-46
SLIDE 46

A public transportation system: stations

A station is an ambient of group gst and of name st X, with X = tur, flor: st X:gst(Gst)[cst, est . . . ], where: Gst specifies the station’s active properties, statically checked: Gst = mc(∅, {gtr, gcity})

  • 1. a station cannot go in or out of ambients (is immobile);
  • 2. may send out processes (i.e., passengers)

to the train and to the surrounding city; cst, est specify station passive properties, dynamically checked:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 14/21

slide-47
SLIDE 47

A public transportation system: stations

A station is an ambient of group gst and of name st X, with X = tur, flor: st X:gst(Gst)[cst, est . . . ], where: Gst specifies the station’s active properties, statically checked: Gst = mc(∅, {gtr, gcity})

  • 1. a station cannot go in or out of ambients (is immobile);
  • 2. may send out processes (i.e., passengers)

to the train and to the surrounding city; cst, est specify station passive properties, dynamically checked:

  • 1. cst = {g∗

tr}

may be crossed by trains (which are ambients);

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 14/21

slide-48
SLIDE 48

A public transportation system: stations

A station is an ambient of group gst and of name st X, with X = tur, flor: st X:gst(Gst)[cst, est . . . ], where: Gst specifies the station’s active properties, statically checked: Gst = mc(∅, {gtr, gcity})

  • 1. a station cannot go in or out of ambients (is immobile);
  • 2. may send out processes (i.e., passengers)

to the train and to the surrounding city; cst, est specify station passive properties, dynamically checked:

  • 1. cst = {g∗

tr}

may be crossed by trains (which are ambients);

  • 2. est = {gtr, Garr∗, gcity, Gdep∗}

may receive processes (i.e., travellers) both from the city and from the train, in an unlimited number.

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 14/21

slide-49
SLIDE 49

A public transportation system: stations

A station is an ambient of group gst and of name st X, with X = tur, flor: st X:gst(Gst)[cst, est . . . ], where: Gst specifies the station’s active properties, statically checked: Gst = mc(∅, {gtr, gcity})

  • 1. a station cannot go in or out of ambients (is immobile);
  • 2. may send out processes (i.e., passengers)

to the train and to the surrounding city; cst, est specify station passive properties, dynamically checked:

  • 1. cst = {g∗

tr}

may be crossed by trains (which are ambients);

  • 2. est = {gtr, Garr∗, gcity, Gdep∗}

may receive processes (i.e., travellers) both from the city and from the train, in an unlimited number.

Garr, Gdep are accepted behaviours for processes entering the station: the constraints Gdep ≤ Gst and Garr ≤ Gst are statically checked.

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 14/21

slide-50
SLIDE 50

A public transportation system: the train

A train TRAINX,Y commuting between X and Y is a mobile ambient:

TRAIN

tr:gtr(Gtr)[ctr, etr ! out st X:gst . PATHXY . in st Y :gst . out st Y :gst . PATHYX . in st X:gst] where:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 15/21

slide-51
SLIDE 51

A public transportation system: the train

A train TRAINX,Y commuting between X and Y is a mobile ambient:

TRAIN

tr:gtr(Gtr)[ctr, etr ! out st X:gst . PATHXY . in st Y :gst . out st Y :gst . PATHYX . in st X:gst] where: Gtr = mc({gst, gcity, . . .}, is the train’s active mobility:

  • 1. the train may cross stations, cities, etc.;

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 15/21

slide-52
SLIDE 52

A public transportation system: the train

A train TRAINX,Y commuting between X and Y is a mobile ambient:

TRAIN

tr:gtr(Gtr)[ctr, etr ! out st X:gst . PATHXY . in st Y :gst . out st Y :gst . PATHYX . in st X:gst] where: Gtr = mc({gst, gcity, . . .}, {gst}) is the train’s active mobility:

  • 1. the train may cross stations, cities, etc.;
  • 2. may send out processes (i.e., passengers) only to stations

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 15/21

slide-53
SLIDE 53

A public transportation system: the train

A train TRAINX,Y commuting between X and Y is a mobile ambient:

TRAIN

tr:gtr(Gtr)[ctr, etr ! out st X:gst . PATHXY . in st Y :gst . out st Y :gst . PATHYX . in st X:gst] where: Gtr = mc({gst, gcity, . . .}, {gst}) is the train’s active mobility:

  • 1. the train may cross stations, cities, etc.;
  • 2. may send out processes (i.e., passengers) only to stations

ctr, etr is the train’s passive mobility:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 15/21

slide-54
SLIDE 54

A public transportation system: the train

A train TRAINX,Y commuting between X and Y is a mobile ambient:

TRAIN

tr:gtr(Gtr)[ctr, etr ! out st X:gst . PATHXY . in st Y :gst . out st Y :gst . PATHYX . in st X:gst] where: Gtr = mc({gst, gcity, . . .}, {gst}) is the train’s active mobility:

  • 1. the train may cross stations, cities, etc.;
  • 2. may send out processes (i.e., passengers) only to stations

ctr, etr is the train’s passive mobility: ctr = ∅ the cannot be crossed by ambients

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 15/21

slide-55
SLIDE 55

A public transportation system: the train

A train TRAINX,Y commuting between X and Y is a mobile ambient:

TRAIN

tr:gtr(Gtr)[ctr, etr ! out st X:gst . PATHXY . in st Y :gst . out st Y :gst . PATHYX . in st X:gst] where: Gtr = mc({gst, gcity, . . .}, {gst}) is the train’s active mobility:

  • 1. the train may cross stations, cities, etc.;
  • 2. may send out processes (i.e., passengers) only to stations

ctr, etr is the train’s passive mobility: ctr = ∅ the cannot be crossed by ambients etr = {gst, Gpsngn} may be entered by at most n processes coming from stations and exhibiting a certified good passenger behaviour Gpsng

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 15/21

slide-56
SLIDE 56

A public transportation system: the train

A train TRAINX,Y commuting between X and Y is a mobile ambient:

TRAIN

tr:gtr(Gtr)[ctr, etr ! out st X:gst . PATHXY . in st Y :gst . out st Y :gst . PATHYX . in st X:gst] where: Gtr = mc({gst, gcity, . . .}, {gst}) is the train’s active mobility:

  • 1. the train may cross stations, cities, etc.;
  • 2. may send out processes (i.e., passengers) only to stations

ctr, etr is the train’s passive mobility: ctr = ∅ the cannot be crossed by ambients etr = {gst, Gpsngn} may be entered by at most n processes coming from stations and exhibiting a certified good passenger behaviour Gpsng Gpsng = mc(∅, {gst}) a good passenger cannot drive any ambient (no train hijacking), and may only get off the train into a station

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 15/21

slide-57
SLIDE 57

A public transportation system: travellers

traveller TRAVELERX,Y from city X to city Y: is a mobile process that goes into X’s station where he becomes a passenger bound for Y:

TRAVELERX,Y down st X:gst with Gdep . PSNGY

Gdep = mc(∅, {gtr}): good behaviour for departing passengers (cannot move the station, may only leave the station by getting into a train)

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 16/21

slide-58
SLIDE 58

A public transportation system: travellers

traveller TRAVELERX,Y from city X to city Y: is a mobile process that goes into X’s station where he becomes a passenger bound for Y:

TRAVELERX,Y down st X:gst with Gdep . PSNGY

Gdep = mc(∅, {gtr}): good behaviour for departing passengers (cannot move the station, may only leave the station by getting into a train)

PSNGY

. A passenger bound for Y is a process that:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 16/21

slide-59
SLIDE 59

A public transportation system: travellers

traveller TRAVELERX,Y from city X to city Y: is a mobile process that goes into X’s station where he becomes a passenger bound for Y:

TRAVELERX,Y down st X:gst with Gdep . PSNGY

Gdep = mc(∅, {gtr}): good behaviour for departing passengers (cannot move the station, may only leave the station by getting into a train)

PSNGY

down tr:gtr with Gpsng . A passenger bound for Y is a process that:

  • 1. boards the train; Gpsng certifies good train-passenger behaviour;

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 16/21

slide-60
SLIDE 60

A public transportation system: travellers

traveller TRAVELERX,Y from city X to city Y: is a mobile process that goes into X’s station where he becomes a passenger bound for Y:

TRAVELERX,Y down st X:gst with Gdep . PSNGY

Gdep = mc(∅, {gtr}): good behaviour for departing passengers (cannot move the station, may only leave the station by getting into a train)

PSNGY

down tr:gtr with Gpsng . up st Y :gst with Garr A passenger bound for Y is a process that:

  • 1. boards the train; Gpsng certifies good train-passenger behaviour;
  • 2. gets off the train at the other station;

Garr = mc(∅, {gcity}): certificate of good arriving-passenger behaviour (cannot move the station; may only exit into the city)

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 16/21

slide-61
SLIDE 61

A public transportation system: travellers

traveller TRAVELERX,Y from city X to city Y: is a mobile process that goes into X’s station where he becomes a passenger bound for Y:

TRAVELERX,Y down st X:gst with Gdep . PSNGY

Gdep = mc(∅, {gtr}): good behaviour for departing passengers (cannot move the station, may only leave the station by getting into a train)

PSNGY

down tr:gtr with Gpsng . up st Y :gst with Garr . adde gst, Gpsng in tr : gtr A passenger bound for Y is a process that:

  • 1. boards the train; Gpsng certifies good train-passenger behaviour;
  • 2. gets off the train at the other station;

Garr = mc(∅, {gcity}): certificate of good arriving-passenger behaviour (cannot move the station; may only exit into the city)

  • 3. frees its place, by explicitly adding one entrance permit to the train;

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 16/21

slide-62
SLIDE 62

A public transportation system: travellers

traveller TRAVELERX,Y from city X to city Y: is a mobile process that goes into X’s station where he becomes a passenger bound for Y:

TRAVELERX,Y down st X:gst with Gdep . PSNGY

Gdep = mc(∅, {gtr}): good behaviour for departing passengers (cannot move the station, may only leave the station by getting into a train)

PSNGY

down tr:gtr with Gpsng . up st Y :gst with Garr . adde gst, Gpsng in tr : gtr . up Y :gcity with GY . P A passenger bound for Y is a process that:

  • 1. boards the train; Gpsng certifies good train-passenger behaviour;
  • 2. gets off the train at the other station;

Garr = mc(∅, {gcity}): certificate of good arriving-passenger behaviour (cannot move the station; may only exit into the city)

  • 3. frees its place, by explicitly adding one entrance permit to the train;
  • 4. goes out from the station into the city.

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 16/21

slide-63
SLIDE 63

A public transportation system: initial configuration

The initial configuration is with the train in tur: (ν tur, flo, st tur, st flo) world :gw(Gw)[cw, ew REST-OF-THE-WORLD | tur :gcity(Gtur)[ctur, eturRt | TRVLRStur,flo | st tur :gst(Gst)[cst, est TRAIN] ] | flo :gcity(Gflo) [cflo, efloRf | TRVLRSflo,tur | st flo :gst(Gst)[cst, est0 ] ] ] where TRVLRSX,Y is a parallel composition of processes TRAVELERX,Y. Properties: at most n PSNG processes can be within the train at the same time, by the initial definitions of etr and TRAVELERX,Y; no traveller can get into the train when this is outside a station: any such action is dynamically blocked by etr; . . .

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 17/21

slide-64
SLIDE 64

Public transportation system: static and dynamic checking

Let FLORENTINE be a process whose behaviour is accepted in flor. Then:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 18/21

slide-65
SLIDE 65

Public transportation system: static and dynamic checking

Let FLORENTINE be a process whose behaviour is accepted in flor. Then: the process TOURIST = up flor:gcity with Gflo . FLORENTINE, willing to exit into flor from a (possibly mobile) nested ambient, is well typed

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 18/21

slide-66
SLIDE 66

Public transportation system: static and dynamic checking

Let FLORENTINE be a process whose behaviour is accepted in flor. Then: the process TOURIST = up flor:gcity with Gflo . FLORENTINE, willing to exit into flor from a (possibly mobile) nested ambient, is well typed the process BADPSNG = down tr:gtr with Gbad . TOURIST, where Gbad = mc(∅, {gcity}), is also well typed, since:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 18/21

slide-67
SLIDE 67

Public transportation system: static and dynamic checking

Let FLORENTINE be a process whose behaviour is accepted in flor. Then: the process TOURIST = up flor:gcity with Gflo . FLORENTINE, willing to exit into flor from a (possibly mobile) nested ambient, is well typed the process BADPSNG = down tr:gtr with Gbad . TOURIST, where Gbad = mc(∅, {gcity}), is also well typed, since: Gbad truthfully declares TOURIST’s intention to get off into a city

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 18/21

slide-68
SLIDE 68

Public transportation system: static and dynamic checking

Let FLORENTINE be a process whose behaviour is accepted in flor. Then: the process TOURIST = up flor:gcity with Gflo . FLORENTINE, willing to exit into flor from a (possibly mobile) nested ambient, is well typed the process BADPSNG = down tr:gtr with Gbad . TOURIST, where Gbad = mc(∅, {gcity}), is also well typed, since: Gbad truthfully declares TOURIST’s intention to get off into a city no global assumptions on the ambient names like tr (there might be other trains named tr where getting off is always allowed . . . )

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 18/21

slide-69
SLIDE 69

Public transportation system: static and dynamic checking

Let FLORENTINE be a process whose behaviour is accepted in flor. Then: the process TOURIST = up flor:gcity with Gflo . FLORENTINE, willing to exit into flor from a (possibly mobile) nested ambient, is well typed the process BADPSNG = down tr:gtr with Gbad . TOURIST, where Gbad = mc(∅, {gcity}), is also well typed, since: Gbad truthfully declares TOURIST’s intention to get off into a city no global assumptions on the ambient names like tr (there might be other trains named tr where getting off is always allowed . . . ) the process TOURIST cannot be statically put within the train, since Gtr doesn’t allow processes to go directly to cities: gcity ∈ E (Gtr)

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 18/21

slide-70
SLIDE 70

Public transportation system: static and dynamic checking

Let FLORENTINE be a process whose behaviour is accepted in flor. Then: the process TOURIST = up flor:gcity with Gflo . FLORENTINE, willing to exit into flor from a (possibly mobile) nested ambient, is well typed the process BADPSNG = down tr:gtr with Gbad . TOURIST, where Gbad = mc(∅, {gcity}), is also well typed, since: Gbad truthfully declares TOURIST’s intention to get off into a city no global assumptions on the ambient names like tr (there might be other trains named tr where getting off is always allowed . . . ) the process TOURIST cannot be statically put within the train, since Gtr doesn’t allow processes to go directly to cities: gcity ∈ E (Gtr)

  • n the other hand, the process BADPSNG:

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 18/21

slide-71
SLIDE 71

Public transportation system: static and dynamic checking

Let FLORENTINE be a process whose behaviour is accepted in flor. Then: the process TOURIST = up flor:gcity with Gflo . FLORENTINE, willing to exit into flor from a (possibly mobile) nested ambient, is well typed the process BADPSNG = down tr:gtr with Gbad . TOURIST, where Gbad = mc(∅, {gcity}), is also well typed, since: Gbad truthfully declares TOURIST’s intention to get off into a city no global assumptions on the ambient names like tr (there might be other trains named tr where getting off is always allowed . . . ) the process TOURIST cannot be statically put within the train, since Gtr doesn’t allow processes to go directly to cities: gcity ∈ E (Gtr)

  • n the other hand, the process BADPSNG:

statically can be put inside a station, since Gst allows processes to go to trains: gtr ∈ E (Gst)

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 18/21

slide-72
SLIDE 72

Public transportation system: static and dynamic checking

Let FLORENTINE be a process whose behaviour is accepted in flor. Then: the process TOURIST = up flor:gcity with Gflo . FLORENTINE, willing to exit into flor from a (possibly mobile) nested ambient, is well typed the process BADPSNG = down tr:gtr with Gbad . TOURIST, where Gbad = mc(∅, {gcity}), is also well typed, since: Gbad truthfully declares TOURIST’s intention to get off into a city no global assumptions on the ambient names like tr (there might be other trains named tr where getting off is always allowed . . . ) the process TOURIST cannot be statically put within the train, since Gtr doesn’t allow processes to go directly to cities: gcity ∈ E (Gtr)

  • n the other hand, the process BADPSNG:

statically can be put inside a station, since Gst allows processes to go to trains: gtr ∈ E (Gst) dynamically is prevented from boarding the train, since no permit gst, Gbad is available in the train’s e-component.

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 18/21

slide-73
SLIDE 73

The global permit-granting hierarchy

Static global assumption of a partial order O over group names: the action add• δϕ in m:g (with • = c,e is statically allowed in a g′-process only if g ≤O g′.

  • g, g′

∈ O O; Σ ⊢ α : amb O; Σ ⊢ γ : group O; Σ ⊢ addc γϕ in α:g : g′(G) g′(G) (ADD-C)

  • g, g′

∈ O O; Σ ⊢ α : amb O; Σ ⊢ γ : group O; Σ ⊢ adde γ, Gϕ in α:g : g′(G′) g′(G′) (ADD-E)

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 19/21

slide-74
SLIDE 74

In the full paper:

Complete definitions of:

  • 1. typing rules
  • 2. (typed) reduction semantics
  • bservational equivalence (barbed congruence)
  • 3. typed LTS

bisimilarity

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 20/21

slide-75
SLIDE 75

In the full paper:

Complete definitions of:

  • 1. typing rules
  • 2. (typed) reduction semantics
  • bservational equivalence (barbed congruence)
  • 3. typed LTS

bisimilarity Results: subject reduction soundness of bisimilarity w.r.t. the barbed congruence

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 20/21

slide-76
SLIDE 76

Conclusions

A typed ambient/process calculus with: interplay between static and dynamic type-checking, and between active and passive rights, for handling the security requirements of global computing applications: static type-checking controls (communication and) active mobility rights; dynamic type-checking controls passive rights; packing of a type within a mobile process and its check at destination as a (very) abstract modelling of the proof-carrying code approach; purely local static type checking, except for the global O hierarchy. Some unsatisfactory aspects (future work?): authorization to add permits is too coarse-grain (either no adding, or adding with any multiplicity) absence of group restriction, useful for protection from external untrusted agents; lack of expressive synchronizing mechanisms (only communication), making awkward to control unwanted nondeterminism; ...

Dynamic and Local Typing for Mobile Ambients – Venice, June 14, 2004 – p. 21/21