35
Intro Mobility Communication Conclusion A dependently typed ambient calculus C. Lhoussaine V. Sassone University of Sussex, UK Global Computing 2004 (9.03.04) C. Lhoussaine, V. Sassone A dependently typed ambient calculus

C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion

A dependently typed ambient calculus

C. Lhoussaine V. Sassone

University of Sussex, UK

Global Computing 2004 (9.03.04)

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 2: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion

1 IntroductionThe problemA type based approach

2 MobilityTypesScope crossingSelected rules

3 CommunicationPer-client servicesTracing communication

4 Conclusion

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 3: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion The problem A type based approach

The Objective

In general:Resource access control in global computing systems

Specifically:Boundary control in mobile agent systems.

Ambient calculus

complete, yet small set of primitives for mobility

hierarchical structure

local communication

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 4: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion The problem A type based approach

The Objective

In general:Resource access control in global computing systems

Specifically:Boundary control in mobile agent systems.

Ambient calculus

complete, yet small set of primitives for mobility

hierarchical structure

local communication

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 5: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion The problem A type based approach

Troy HorseRequired Policy: No Achaean inside the City walls.

Troy

TROJANS

Odysseus

inHorse.outHorse.DESTROY TROY

Horse

inTroy

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 6: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion The problem A type based approach

Troy HorseRequired Policy: No Achaean inside the City walls.

Troy

TROJANS

Horse

Odysseus

outHorse.DESTROY TROYinTroy

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 7: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion The problem A type based approach

Troy HorseRequired Policy: No Achaean inside the City walls.

Troy

TROJANS

Horse

Odysseus

outHorse.DESTROY TROY

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 8: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion The problem A type based approach

Troy HorseRequired Policy: No Achaean inside the City walls.

Troy

TROJANS

Horse Odysseus

DESTROY TROY

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 9: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion The problem A type based approach

Troy HorseRequired Policy: No Achaean inside the City walls.

Observe:Scope restriction does not prevent Odysseus ending up in Troy

Odysseus

inHorse.outHorse.DESTROY TROY

νTroy

Troy

TROJANS

Horse

inTroy

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 10: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion The problem A type based approach

Type based approach

The past: Groups. Types specify allowed parents’ groups.

Odysseus : Achean[mob{Ground, Toy, City}]Horse : Toy[mob{Ground, City}]

Troy : City[ ]

The present: Dependent types. A simpler, more flexible andfine-grained approach.

Odysseus : mob[∅, {Horse, Troy}]Horse : mob[{Odysseus}, {Troy}]

Troy : mob[{Horse, Odysseus}, ∅]

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 11: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion The problem A type based approach

Type based approach

The past: Groups. Types specify allowed parents’ groups.

Odysseus : Achean[mob{Ground, Toy, City}]Horse : Toy[mob{Ground, City}]

Troy : City[ ]

Ill-typed unless Odysseus declares parent group City.

The present: Dependent types. A simpler, more flexible andfine-grained approach.

Odysseus : mob[∅, {Horse, Troy}]Horse : mob[{Odysseus}, {Troy}]

Troy : mob[{Horse, Odysseus}, ∅]

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 12: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion The problem A type based approach

Type based approach

The past: Groups. Types specify allowed parents’ groups.

Odysseus : Achean[mob{Ground, Toy, City}]Horse : Toy[mob{Ground, City}]

Troy : City[ ]

The present: Dependent types. A simpler, more flexible andfine-grained approach.

Odysseus : mob[∅, {Horse, Troy}]Horse : mob[{Odysseus}, {Troy}]

Troy : mob[{Horse, Odysseus}, ∅]

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 13: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion The problem A type based approach

Dynamic Types

Via communication can express dynamic, ad-hoc,personalised services and security policies.

〈Horse〉 | (x).

νTroy : mob[{x}, ∅]

Troy

TROJANS

x

inTroy

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 14: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

1 IntroductionThe problemA type based approach

2 MobilityTypesScope crossingSelected rules

3 CommunicationPer-client servicesTracing communication

4 Conclusion

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 15: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

The Types

Ambient types:

a :mob[P, C]

P : set of possible parents for aC : set of possible children for a

Capability types:

ina :cap[P]

P : set of ambients where ina might be exercised

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 16: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

Typing Contexts and Coherence

Typing contexts:Γ ::= a1 : mob[P1, C1], . . . , an : mob[Pn, Cn]

Coherence:

a : mob[{b}, ∅], b : mob[P, C] ⇒ a ∈ Ca : mob[∅, {b}], b : mob[P, C] ⇒ a ∈ P

Need accurate context updating

Horse : mob[P, C]

νTroy : mob[∅, {Horse}]

Troy : mob[∅, {Horse}]Horse : mob[P ∪ {Troy}, C]

Γ(b:mob[P,C]), b : mob[P, C]: the coherent updating of Γ wrt.the new assignment b : mob[P, C].

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 17: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

Typing Contexts and Coherence

Typing contexts:Γ ::= a1 : mob[P1, C1], . . . , an : mob[Pn, Cn]

Coherence:

a : mob[{b}, ∅], b : mob[P, C] ⇒ a ∈ Ca : mob[∅, {b}], b : mob[P, C] ⇒ a ∈ P

Need accurate context updating

Horse : mob[P, C]

νTroy : mob[∅, {Horse}]

Troy : mob[∅, {Horse}]Horse : mob[P ∪ {Troy}, C]

Γ(b:mob[P,C]), b : mob[P, C]: the coherent updating of Γ wrt.the new assignment b : mob[P, C].

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 18: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

Matrioshka (nesting) Horses

Horse

Odysseus

outHorse.outHorse

inHorse

Troy : mob[∅, {Horse}]Horse : mob[{Horse}, {Horse, Odysseus}]Odysseus : mob[{Horse}, ∅]

Actual type for Horse:

mob[{Horse, Troy}, {Horse, Odysseus}]

νTroy : mob[∅, {Horse}]

Troy

TROJANS

Horse

inTroy

Troy : mob[∅, {Horse}]Horse : mob[{Horse, Troy}, {Horse, Odysseus}]Odysseus : mob[{Horse}, ∅]

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 19: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

Matrioshka (nesting) Horses

Horse

Odysseus

outHorse.outHorse

inHorse

Troy : mob[∅, {Horse}]

Horse : mob[{Horse}, {Horse, Odysseus}]Odysseus : mob[{Horse}, ∅]

Actual type for Horse:

mob[{Horse, Troy}, {Horse, Odysseus}]

νTroy : mob[∅, {Horse}]

Troy

TROJANS

Horse

inTroy

Troy : mob[∅, {Horse}]Horse : mob[{Horse, Troy}, {Horse, Odysseus}]Odysseus : mob[{Horse}, ∅]

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 20: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

Matrioshka (nesting) Horses

Horse

Odysseus

outHorse.outHorse

inHorse

Troy : mob[∅, {Horse}]

Horse : mob[{Horse}, {Horse, Odysseus}]Odysseus : mob[{Horse}, ∅]

Actual type for Horse:

mob[{Horse, Troy}, {Horse, Odysseus}]

νTroy : mob[∅, {Horse}]

Troy

TROJANS

Horse

inTroy

Troy : mob[∅, {Horse}]Horse : mob[{Horse, Troy}, {Horse, Odysseus}]Odysseus : mob[{Horse}, ∅]

I Need to account for the potential new capabilities acquiredduring Odysseus’s execution: Abstract names

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 21: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

Matrioshka (nesting) Horses

Horse

Odysseus

outHorse.outHorse

inHorse

Troy : mob[∅, {Horse}]Horse : mob[{Horse}, {Horse, Odysseus}]Odysseus : mob[{Horse}, ∅]

Actual type for Horse:

mob[{Horse, Troy}, {Horse, Odysseus}]

νTroy : mob[∅, {Horse}]

Troy

TROJANS

Horse

inTroy

Troy : mob[∅, {Horse}]Horse : mob[{Horse, Troy}, {Horse, Odysseus}]Odysseus : mob[{Horse}, ∅]

I Outside “νTroy,” Odysseus is ill-typed.

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 22: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

Abstract Contexts

Abstract Context:

Θ,Ξ ::= a1 : mob[P1, C1], . . . , an : mob[Pn, Cn]

Typing judgements:

Γ `Θ a : mob[P, C] Γ `Θ;Ξa P

Γ : “concrete” typing contextΘ : local abstract contextΞ : external abstract contexta : current location

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 23: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

Actual ambient type

mob[P, C] = (Γ;Θ,Ξ)[b]

Γ `Θ;Ξa b : mob[P, C]

. . . , Horse : mob[{Horse}{Horse, Odysseus}

]`∅;Troy:mob[∅,{Horse}] Horse : mob

[{Horse, Troy}{Horse, Odysseus}

]

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 24: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

Typing in capability

Γ `Θ a : mob[P, C] P ′ ⊆ CΓ `Θ ina : cap[P ′]

. . . , Troy : mob[∅, {Horse}] `∅ inTroy : cap[{Horse}]

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 25: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

Typing out capability

Γ `Θ a : mob[P, C], ai : mob[Pi , Ci ] P ⊆ Pi

Γ `Θ outa : cap[{a1, . . . , an}]

· · · `Troy:mob[∅,{Horse}] Horse : mob[{Horse, Troy}, {Horse, Odysseus}]· · · `Troy:mob[∅,{Horse}] Odysseus : mob[{Horse}, ∅]

· · · 6` Troy:mob[∅,{Horse}]outHorse : cap[{Odysseus}]

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 26: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

Scope restriction

Γ(a:mob[P,C]), a : mob[P, C] `Ξ;Θb P

Γ `a:mob[P,C],Ξ;Θb (νa : mob[P, C])P

Horse : mob[{Horse, Troy}, {Horse, Odysseus}]Odysseus : mob[Horse, ∅]Troy : mob[∅, {Horse}]

`∅;∅ (· · · )

Horse : mob[{Horse}, {Horse, Odysseus}]Odysseus : mob[Horse, ∅]

`Troy:mob[∅,{Horse}];∅ (νTroy : mob[∅, {Horse}])(· · · )

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 27: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Types Scope crossing Selected rules

Parallel composition

Γ `Θ1;Ξ,Θ2 P Γ `Θ2;Ξ,Θ1 Q

Γ `Θ1,Θ2;Ξ P | Q

Γ `∅;Troy:mob[∅,{Horse}] Horse[· · · ] Γ `Troy:mob[∅,{Horse}];∅ (νTroy)(· · · )

Γ `Troy:mob[∅,{Horse}];∅ Horse[· · · ] | (νTroy)(· · · )

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 28: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Per-client services Tracing communication

1 IntroductionThe problemA type based approach

2 MobilityTypesScope crossingSelected rules

3 CommunicationPer-client servicesTracing communication

4 Conclusion

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 29: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Per-client services Tracing communication

The Effect of Communication: Dynamic Types

〈Elephant〉 | 〈Horse〉 | (x).

Horse : mob[∅, ∅]Elephant : mob[∅, ∅]

νTroy : mob[∅, {x}]

Troy

TROJANS

x

inTroy

Troy : mob[∅, {x}]Horse : mob[∅, ∅]Elephant : mob[∅, ∅]

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 30: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Per-client services Tracing communication

The Effect of Communication: Dynamic Types

〈Elephant〉 | 〈Horse〉 | (x).

Horse : mob[∅, ∅]Elephant : mob[∅, ∅]

νTroy : mob[∅, {x}]

Troy

TROJANS

x

inTroy

Troy : mob[∅, {x}]Horse : mob[∅, ∅]Elephant : mob[∅, ∅]

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 31: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Per-client services Tracing communication

〈Horse〉 |

νTroy : mob[∅, {Elephant}]

Troy

TROJANS

Elephant

inTroy

Troy : mob[∅, {Elephant}]Horse : mob[∅, ∅]Elephant : mob[{Troy}, ∅]

〈Elephant〉 |

νTroy : mob[∅, {Horse}]

Troy

TROJANS

Horse

inTroy

Troy : mob[∅, {Horse}]Horse : mob[{Troy}, ∅]Elephant : mob[∅, ∅]

I Orthogonal policies depending on possible communications:need to track of all possible types

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 32: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion Per-client services Tracing communication

New types

Ambient typesa : amb[mob[P, C], com[E ,L]]

E : set of ambient names where a might becommunicated

L : set of ambient names that might be communicatedinside a

Variable typesx : var[B]

B : set of ambient names that might be bound to x

Multiple types

Horse :

{amb[mob[∅, ∅], com[{top, ∅}]],amb[mob[{Troy}, ∅], com[{top, ∅}]]

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 33: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion

Conclusion

Name dependent typing:

simple and intuitive types against “nasty” typing rules;still relatively easy, yet more flexible and expressive thangroups;sensible application: access control for personalised,dynamic services.

Central technical notion: abstract names and contexts.Keep track of capabilities “acquirable” dynamically by“crossing” names’ scopes.

Related work in the literature:

MIKADO’s dynamic types for DPI (Hennessy et al.).Yoshida’s existential dependent types for DPI.DART’s dependent types for the Ambient Calculus(Amtoft and Wells).

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 34: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion

Conclusion

Name dependent typing:

simple and intuitive types against “nasty” typing rules;still relatively easy, yet more flexible and expressive thangroups;sensible application: access control for personalised,dynamic services.

Central technical notion: abstract names and contexts.Keep track of capabilities “acquirable” dynamically by“crossing” names’ scopes.

Related work in the literature:

MIKADO’s dynamic types for DPI (Hennessy et al.).Yoshida’s existential dependent types for DPI.DART’s dependent types for the Ambient Calculus(Amtoft and Wells).

C. Lhoussaine, V. Sassone A dependently typed ambient calculus

Page 35: C. Lhoussaine V. Sassone · C. Lhoussaine, V. Sassone A dependently typed ambient calculus. Intro Mobility Communication Conclusion The problem A type based approach Type based approach

Intro Mobility Communication Conclusion

Conclusion

Name dependent typing:

simple and intuitive types against “nasty” typing rules;still relatively easy, yet more flexible and expressive thangroups;sensible application: access control for personalised,dynamic services.

Central technical notion: abstract names and contexts.Keep track of capabilities “acquirable” dynamically by“crossing” names’ scopes.

Related work in the literature:

MIKADO’s dynamic types for DPI (Hennessy et al.).Yoshida’s existential dependent types for DPI.DART’s dependent types for the Ambient Calculus(Amtoft and Wells).

C. Lhoussaine, V. Sassone A dependently typed ambient calculus