The Kell Calculus A Family of Higher-Order Distributed Process - - PowerPoint PPT Presentation

the kell calculus a family of higher order distributed
SMART_READER_LITE
LIVE PREVIEW

The Kell Calculus A Family of Higher-Order Distributed Process - - PowerPoint PPT Presentation

The Kell Calculus A Family of Higher-Order Distributed Process Calculi MYTHS/MIKADO/DART Meeting Alan Schmitt Jean-Bernard Stefani Introduction Calculus motivated by work in the Sardes project Goal: to model and simulate


slide-1
SLIDE 1

The Kell Calculus A Family of Higher-Order Distributed Process Calculi

MYTHS/MIKADO/DART Meeting Alan Schmitt Jean-Bernard Stefani

slide-2
SLIDE 2

MYTHS/MIKADO/DART Meeting, June 15th 2004, 2

Introduction

◮ Calculus motivated by work in the Sardes project ◮ Goal: to model and simulate component-based programs and

their environment

◮ Why the environment? ⊲ to model resource access and monitoring ⊲ to model different modes of failure

slide-3
SLIDE 3

MYTHS/MIKADO/DART Meeting, June 15th 2004, 3

Outline

◮ Design Choices for a Component Modelling Calculus ◮ The Calculus and some Examples ◮ Equivalences

slide-4
SLIDE 4

MYTHS/MIKADO/DART Meeting, June 15th 2004, 4

A component

✂☎✄ ✆ ✝✟✞ ✆ ✠ ✡ ✠ ☛ ✄ ✆ ✠ ☛ ✡ ✠ ☛ ✡ ☞ ☛ ✡ ✌ ✠ ✍ ✎ ✏ ✠ ☛ ✡ ✌ ✑ ✍ ✄ ✡ ✏ ✠ ☛ ✡ ✌ ✠ ✍ ✎ ✏ ✠ ☛ ✡ ✌ ✑ ✍ ✄ ✡ ✄ ✆ ✠ ☛ ✌ ✆ ✎ ✎ ✡ ✌ ✂ ✏ ✠ ✒ ✏ ✠ ✓
slide-5
SLIDE 5

MYTHS/MIKADO/DART Meeting, June 15th 2004, 5

What we want to model

Fractal (http://fractal.objectweb.org)

◮ Hierarchical components ◮ Dynamic component deployment and failure ◮ Dynamic interface binding between components ◮ Messaging through bound interfaces ◮ Control capabilities

slide-6
SLIDE 6

MYTHS/MIKADO/DART Meeting, June 15th 2004, 6

Why we want to model

◮ Play the role of a precise and formal semantics ⊲ Abstract machines ⊲ Implementations ◮ Build some verification tools

Static Type systems, static analyses

⊲ Component binding ⊲ Checking dependencies ⊲ Equivalent components

Dynamic Correct code instrumentation for

⊲ security properties ⊲ fault detection ⊲ causality and resource monitoring

slide-7
SLIDE 7

MYTHS/MIKADO/DART Meeting, June 15th 2004, 7

Design Principles

◮ π-calculus core ⊲ Parameterized on the input patterns ◮ Hiearchical localities (Kells) ⊲ Encapsulation ◮ Local actions ⊲ Tradeoff between implementation and of usability ⊲ Atomicity decisions left to programmer ⊲ Dynamic binding ◮ Higher-order communication and locality passivation ⊲ To model deployment, migration, and different failure modes ◮ Programmable membranes ⊲ To model control features and network failure

slide-8
SLIDE 8

MYTHS/MIKADO/DART Meeting, June 15th 2004, 8

Related work

◮ First order π-calculus with localities and migration primitives

(D-Join, Dπ, Nomadic Pict, Seal, . . . )

◮ Mobile Ambients and variants ◮ Distributed higher-order calculi ⊲ Facile, CHOCS, higher-order Dπ, Klaim, M-calculus

Kell-calculus: simplification of the M-calculus:

◮ No routing rules built in ◮ Simpler localities

slide-9
SLIDE 9

MYTHS/MIKADO/DART Meeting, June 15th 2004, 9

Outline

◮ Design Choices for Component Modelling Calculus ◮ The Calculus and some Examples ◮ Equivalences

slide-10
SLIDE 10

MYTHS/MIKADO/DART Meeting, June 15th 2004, 10

Syntax

P, Q ::= 0 | P | Q | νa.P | x | | ◮ π calculus core

slide-11
SLIDE 11

MYTHS/MIKADO/DART Meeting, June 15th 2004, 11

Syntax

P, Q ::= 0 | P | Q | νa.P | x | aP.Q | a [P] .Q | ◮ π calculus core ◮ Higher-order output

slide-12
SLIDE 12

MYTHS/MIKADO/DART Meeting, June 15th 2004, 12

Syntax

P, Q ::= 0 | P | Q | νa.P | x | aP.Q | a [P] .Q | (ξ ⊲ P) ◮ π calculus core ◮ Higher-order output ◮ Input parameterized by patterns ξ

slide-13
SLIDE 13

MYTHS/MIKADO/DART Meeting, June 15th 2004, 13

Syntax

P, Q ::= 0 | P | Q | νa.P | x | aP.Q | a [P] .Q | (ξ ⊲ P) ◮ π calculus core ◮ Higher-order output ◮ Input parameterized by patterns ξ ◮ Simplest patterns (jK): ξ ::= ξk | M | M | ξk M ::= ξm | ξ↓ | ξ↑ | M | M ξk ::= a [x] ξm ::= ax ξ↓ ::= ax↓ ξ↑ ::= ax↑

slide-14
SLIDE 14

MYTHS/MIKADO/DART Meeting, June 15th 2004, 14

Reduction Examples

aQ.T | (ax ⊲ P) − → T | P{Q/x} aQ.T | b

  • (ax↑ ⊲ P)
  • .S −

→ T | b [P{Q/x}] .S b [aQ.T | R] .S | (ax↓ ⊲ P) − → b [T | R] .S | P{Q/x} a [Q] .T | (ax ⊲ P) − → T | P{Q/x}

slide-15
SLIDE 15

MYTHS/MIKADO/DART Meeting, June 15th 2004, 15

Join patterns

a     (dx↓ | uy↑ | b [z] ⊲ x | y | z) c [dPd.Qd] .Qc b [Pb] .Qb     .Qa

  • uPu.Qu −

→ a     Pd | Pu | Pb c [Qd] .Qc Qb     .Qa

  • Qu
slide-16
SLIDE 16

MYTHS/MIKADO/DART Meeting, June 15th 2004, 16

Join patterns

a     (dx↓ | uy↑ | b [z] ⊲ x | y | z) c [dPd.Qd] .Qc b [Pb] .Qb     .Qa

  • uPu.Qu −

→ a     Pd | Pu | Pb c [Qd] .Qc Qb     .Qa

  • Qu
slide-17
SLIDE 17

MYTHS/MIKADO/DART Meeting, June 15th 2004, 17

Encoding recursion

(ξ P)

= νt.(ξ | tx ⊲ P | x | tx) | t(ξ | tx ⊲ P | x | tx)

Assume that t and x are fresh in ξ, P, Q, and P ′, and that

(ξ ⊲ P) | Q − → P ′ (ξ P) | Q

= νt.(ξ | tx ⊲ P | x | tx) | t(ξ | tx ⊲ P | x | tx) | Q

slide-18
SLIDE 18

MYTHS/MIKADO/DART Meeting, June 15th 2004, 18

Encoding recursion

(ξ P)

= νt.(ξ | tx ⊲ P | x | tx) | t(ξ | tx ⊲ P | x | tx)

Assume that t and x are fresh in ξ, P, Q, and P ′, and that

(ξ ⊲ P) | Q − → P ′ (ξ P) | Q

= νt.(ξ | tx ⊲ P | x | tx) | t(ξ | tx ⊲ P | x | tx) | Q

slide-19
SLIDE 19

MYTHS/MIKADO/DART Meeting, June 15th 2004, 19

Encoding recursion

(ξ P)

= νt.(ξ | tx ⊲ P | x | tx) | t(ξ | tx ⊲ P | x | tx)

Assume that t and x are fresh in ξ, P, Q, and P ′, and that

(ξ ⊲ P) | Q − → P ′ (ξ P) | Q

= νt.(ξ | tx ⊲ P | x | tx) | t(ξ | tx ⊲ P | x | tx) | Q − → νt.P ′ | (ξ | tx ⊲ P | x | tx) | t(ξ | tx ⊲ P | x | tx)

slide-20
SLIDE 20

MYTHS/MIKADO/DART Meeting, June 15th 2004, 20

Encoding recursion

(ξ P)

= νt.(ξ | tx ⊲ P | x | tx) | t(ξ | tx ⊲ P | x | tx)

Assume that t and x are fresh in ξ, P, Q, and P ′, and that

(ξ ⊲ P) | Q − → P ′ (ξ P) | Q

= νt.(ξ | tx ⊲ P | x | tx) | t(ξ | tx ⊲ P | x | tx) | Q − → νt.P ′ | (ξ | tx ⊲ P | x | tx) | t(ξ | tx ⊲ P | x | tx)

= (ξ P) | P ′

slide-21
SLIDE 21

MYTHS/MIKADO/DART Meeting, June 15th 2004, 21

Using passivation

◮ A kell a [P] is both an evaluation context and a resource ◮ One may ⊲ freeze a kell in a message: (a [x] ⊲ ax) ⊲ destroy a kell: (a [x] ⊲ 0) ⊲ copy and rename a kell: (a [x] ⊲ a [x] | b [x]) ⊲ insert new content into a kell: (a [x] ⊲ a [x | b [P]])

slide-22
SLIDE 22

MYTHS/MIKADO/DART Meeting, June 15th 2004, 22

Matching and Parametric Patterns

◮ Generic matching ⊲ Outer shape of patterns fixed (Local Action) ⊲ Join patterns built in match(ξ | ξ′, M | M ′) = match(ξ, M) ⊕ match(ξ′, M ′) match(ξm, aP) = matchm(ξm, aP) match(ξ↓, aP↓b) = match↓(ξ↓, aP↓b) match(ξ↑, aP↑b) = match↑(ξ↑, aP↑b) match(ξk, a [P]) = matchk(ξk, a [P]) ◮ Instantiation with jK patterns matchm(ax, aP)

= {P/

x}

match↓(ax,↓ aP↓b)

= {P/

x}

match↑(ax,↑ aP↑b)

= {P/

x}

matchk(a [x] , a [P])

= {P/

x}

slide-23
SLIDE 23

MYTHS/MIKADO/DART Meeting, June 15th 2004, 23

Outline

◮ Design Choices for Component Modelling Calculus ◮ The Calculus and some Examples ◮ Equivalences

slide-24
SLIDE 24

MYTHS/MIKADO/DART Meeting, June 15th 2004, 24

Context Bisimulation: a Tutorial

In the setting of the Higher-order π-calculus:

◮ An input evolves to an abstraction: a(X).P

a

− → (X).P = F ◮ An output evolves to a concretion: aP1P2

a

− → P1P2 = C ◮ They communicate: a(X).P | aP1P2

τ

− → F@C = P{P1/

X} | P2

slide-25
SLIDE 25

MYTHS/MIKADO/DART Meeting, June 15th 2004, 25

Context Bisimulation: a Tutorial

In the setting of the Higher-order π-calculus:

◮ An input evolves to an abstraction: a(X).P

a

− → (X).P = F ◮ An output evolves to a concretion: aP1P2

a

− → P1P2 = C ◮ They communicate: a(X).P | aP1P2

τ

− → F@C = P{P1/

X} | P2

The relation R is a (early) context simulation iff P R Q implies

◮ For all P

τ

− → P ′, there exists Q′ such that Q

τ

− → Q′ and P ′ R Q′; ◮ For all P

a

− → F and for all C, there exists G such that Q

a

− → G and F@C R G@C; ◮ For all P

a

− → C and for all F, there exists D such that Q

a

− → D and F@C R F@D.

slide-26
SLIDE 26

MYTHS/MIKADO/DART Meeting, June 15th 2004, 26

Context Bisimulation for the Kell-calculus

Approach similar to the Higher-order π calculus Abstractions We need to remember the whole pattern

◮ join patterns ◮ message source (local, up, down) or nature (message, kell) ◮ (ξ ⊲ P)

α

− → (ξ)P

Concretions We need to make sure that every case of message source is covered (see next slide)

◮ aP.Q

a

− → aP Q

Congruence properties are harder to prove, as some processes in concretions are also in evaluation context

slide-27
SLIDE 27

MYTHS/MIKADO/DART Meeting, June 15th 2004, 27

What labels?

◮ Complex labels and concretions, but simple bisimulations

a

− → aP Q = C1 and F@C1 aP.Q

a↓b

− → aP↓b Q = C2 and F@C2

a↑b

− → aP↑b Q = C3 and F@C3 ◮ Simple labels and concretions, but complex bisimulations

and F@C

aP.Q

a

− → aP Q = C and F@b [C]

and b [F] @C

◮ Our current choice: very simple labels (sets of names)

slide-28
SLIDE 28

MYTHS/MIKADO/DART Meeting, June 15th 2004, 28

Observables

Like labels, observables ↓a are very simple:

P ↓a

iff

P ≡ ν c.a [Pa] .Qa | Q

with a ∈

c

  • r P ≡ ν

c.aPa.Qa | Q

with a ∈

c

  • r P ≡ ν

c.b [aPa.Qa | Pb] .Qb | Q

with a ∈

c P ↓ξ.sk

iff

P ≡ ν c.(ξ ⊲ Q) | R

with ξ.sk ∩

c = ∅

  • r P ≡ ν

c.b [(ξ ⊲ Q) | Pb] .Qb | R

with ξ.sk ∩

c = ∅ ξ.sk is the multiset on names used for input. For instance: aP.sk = aP↓.sk = aP↑.sk = a [P] .sk = a (M | M ′).sk = M.sk | M ′.sk

slide-29
SLIDE 29

MYTHS/MIKADO/DART Meeting, June 15th 2004, 29

Theorems

◮ Strong context bisimilarity ∼c is based on the LTS

α

− → ◮ Strong barbed bisimilarity ∼b is based on the reduction − → and

a definition for observables We have:

◮ For all P and Q, P

τ

− → ≡ Q iff P − → Q. ◮ Under some conditions for the pattern languages (matching

may not distinguish bisimilar messages), ∼c is a congruence.

◮ If the pattern language also contains the jK simple patterns,

the largest congruence included in ∼b coincides with ∼c. Technical details in LNCS volume on Global Computing 2004

slide-30
SLIDE 30

MYTHS/MIKADO/DART Meeting, June 15th 2004, 30

Current and Future work

◮ Equivalences ⊲ Tractable Bisimulations (no universal quantification on

concretions and abstractions)

⊲ Weak approach ◮ Type systems ⊲ Inspired by the M-calculus and Dπ type systems ◮ Testing the calculus expressivity ⊲ Complete modelisation of Fractal ⊲ Application to Dream (http://dream.objectweb.org) ◮ Locality sharing ⊲ In Fractal, a component may have more than one parent ⊲ Very useful feature to represent shared resources ⊲ Joint work with ENS Lyon

slide-31
SLIDE 31

MYTHS/MIKADO/DART Meeting, June 15th 2004, 31

Bonus slide: Complex patterns

ξ ::= J | ξk | J | ξk J ::= ξm | ξ↓ | ξ↑ | J | J ξm ::= aρ ξ↑ ::= aρ↑ ξ↓ ::= aρ↓ ξk ::= a [x] ρ ::= aρ | ρ | ρ ρ ::= x | ρ | (a)ρ | aρ | ((m) = a)ρ |