Type Theory for Mobility and Locality Thesis Proposal Jonathan - - PowerPoint PPT Presentation

type theory for mobility and locality
SMART_READER_LITE
LIVE PREVIEW

Type Theory for Mobility and Locality Thesis Proposal Jonathan - - PowerPoint PPT Presentation

Type Theory for Mobility and Locality Thesis Proposal Jonathan Moody Committee: Frank Pfennning, Karl Crary, Jeannette Wing, Andrew Gordon (MSR) School of Computer Science Carnegie Mellon University Type Theory forMobility and Locality


slide-1
SLIDE 1

Type Theory for Mobility and Locality

Thesis Proposal Jonathan Moody Committee: Frank Pfennning, Karl Crary, Jeannette Wing, Andrew Gordon (MSR) School of Computer Science Carnegie Mellon University

Type Theory forMobility and Locality – p.1/49

slide-2
SLIDE 2

Introduction

Distributed computation — programming at more than

  • ne location.

Are the locations distinguishable?

Type Theory forMobility and Locality – p.2/49

slide-3
SLIDE 3

Introduction

Distributed computation — programming at more than

  • ne location.

program env.

Are the locations distinguishable?

No — We can safely ignore locations, we’re done...

Type Theory forMobility and Locality – p.2/49

slide-4
SLIDE 4

Introduction

Distributed computation — programming at more than

  • ne location.

program env.

Are the locations distinguishable?

No — We can safely ignore locations, we’re done... Yes — Must be careful when programs or values move.

Type Theory forMobility and Locality – p.2/49

slide-5
SLIDE 5

Introduction

Benefits of being location-aware: account for localized code or values. reflect trust or administration boundaries. permit/deny some interactions between locations. reflect costs of remote access (bandwidth/latency). A location-aware type theory: Specify and statically check properties defined in terms of location....

Type Theory forMobility and Locality – p.3/49

slide-6
SLIDE 6

Introduction

Mobility and locality as aspects of location: Mobility — “is it location-independent?”

✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✝ ✞ ✟ ✠

Type Theory forMobility and Locality – p.4/49

slide-7
SLIDE 7

Introduction

Mobility and locality as aspects of location: Mobility — “is it location-independent?”

✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎

Locality — “is it here? or there?”.

✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✒ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗

Type Theory forMobility and Locality – p.4/49

slide-8
SLIDE 8

Thesis statement

“Modal logic can be understood as a type theory defining mobility and locality; This has practical applications to distributed programming.”

Type Theory forMobility and Locality – p.5/49

slide-9
SLIDE 9

Thesis statement

“Modal logic can be understood as a type theory defining mobility and locality; This has practical applications to distributed programming.” Proposed contributions: Relate modal logic to distributed computation.

Type Theory forMobility and Locality – p.5/49

slide-10
SLIDE 10

Thesis statement

“Modal logic can be understood as a type theory defining mobility and locality; This has practical applications to distributed programming.” Proposed contributions: Relate modal logic to distributed computation. Core calculus with mobility and locality types.

Type Theory forMobility and Locality – p.5/49

slide-11
SLIDE 11

Thesis statement

“Modal logic can be understood as a type theory defining mobility and locality; This has practical applications to distributed programming.” Proposed contributions: Relate modal logic to distributed computation. Core calculus with mobility and locality types. Extensions that interact with mobility/locality.

Type Theory forMobility and Locality – p.5/49

slide-12
SLIDE 12

Thesis statement

“Modal logic can be understood as a type theory defining mobility and locality; This has practical applications to distributed programming.” Proposed contributions: Relate modal logic to distributed computation. Core calculus with mobility and locality types. Extensions that interact with mobility/locality. Apply to distributed grid programming.

Type Theory forMobility and Locality – p.5/49

slide-13
SLIDE 13

Propositions as types

Functional language typing rules are often logical:

“proof

that

is true” “term has type

✚✛ ✘ ✜ ✢ ✙ ✜ ✣ ✢✥✤ ✦ ✙

Proposition

✚✛

Type Proof

✚ ✛

Program

  • Pf. Normalization
✚ ✛

Evaluation

Type Theory forMobility and Locality – p.6/49

slide-14
SLIDE 14

Propositions as types

Natural Deduction Term Typing

✜★✧ ✙ ✢ ✩ ✜ ✢ ✙ ✪ ✩ ✪ ✫ ✜ ✣ ✧ ✙ ✢ ✤ ✩ ✜ ✣ ✢ ✤ ✙ ✪ ✩ ✪ ✫ ✜ ✢ ✙ ✪ ✩ ✜ ✢ ✙ ✜ ✢ ✩ ✪ ✬ ✜ ✣ ✢ ✤ ✙ ✪ ✩ ✜ ✣ ✢ ✤ ✙ ✜ ✣ ✢ ✤ ✩ ✪ ✬

Type Theory forMobility and Locality – p.7/49

slide-15
SLIDE 15

Propositions as types

Natural Deduction Term Typing

✜★✧ ✙ ✢ ✩ ✜ ✢ ✙ ✪ ✩ ✪ ✫ ✜ ✣ ✧ ✭ ✦ ✙ ✢ ✤ ✦ ✩ ✜ ✣ ✢ ✤ ✮ ✭ ✦ ✙ ✯ ✦ ✙ ✪ ✩ ✪ ✫ ✜ ✢ ✙ ✪ ✩ ✜ ✢ ✙ ✜ ✢ ✩ ✪ ✬ ✜ ✣ ✢ ✤ ✦ ✙ ✪ ✩ ✜ ✣ ✢ ✤ ✰ ✦ ✙ ✜ ✣ ✢ ✤ ✰ ✦ ✩ ✪ ✬

Type Theory forMobility and Locality – p.7/49

slide-16
SLIDE 16

Consequences

Simplicity: the minimal (logically) complete calculus.

Type Theory forMobility and Locality – p.8/49

slide-17
SLIDE 17

Consequences

Simplicity: the minimal (logically) complete calculus. Some properties/behaviors are not captured: Concurrency (permitted, but not described by types). Complex, 2-way communication patterns.

Type Theory forMobility and Locality – p.8/49

slide-18
SLIDE 18

Consequences

Simplicity: the minimal (logically) complete calculus. Some properties/behaviors are not captured: Concurrency (permitted, but not described by types). Complex, 2-way communication patterns. Features that may introduce deadlock, interference, non-determinism are absent in the minimal core.

Type Theory forMobility and Locality – p.8/49

slide-19
SLIDE 19

Consequences

Generality: new modal types defined orthogonally.

Type Theory forMobility and Locality – p.9/49

slide-20
SLIDE 20

Consequences

Generality: new modal types defined orthogonally. Consider mobility and locality in a familiar framework: products (

), sums (

), etc... polymorphism (

✳✵✴

), abstract types (

✶ ✴

) refinement types, intersection (

), union (

), dependent types

✹ ✺

,

✻ ✺

information flow, resource bounds, correctness specifications (if type system sufficiently powerful)

Type Theory forMobility and Locality – p.9/49

slide-21
SLIDE 21

Related work

Constructive modal logic: “Judgmental Reconstruction of Modal Logic” (Pfenning, Davies ’01) “Proof Theory and Semantics of I.M.L.” (Simpson ’94) Parallel efforts: modal logic

✼ ✛

distributed calculus. “Modal Proofs As Distributed Programs” (Jia, Walker ’03)

  • ngoing at CMU... (Crary, Murphy, et al.)

“Constructive Logic for Services and Info. Flow...” (Borghuis, Feijs ’00)

Type Theory forMobility and Locality – p.10/49

slide-22
SLIDE 22

Related work (contd.)

Process Calculi (some which model locations): Mobile Ambients & Ambient Logic: (various) (Cardelli, Caires, Ghelli, Gordon ’98-’02) DPI: “Resource Access Control...” (Hennessy, et al. ’02) Klaim: “Types for Access Control” (De Nicola, Ferrari, et al. ’00)

Type Theory forMobility and Locality – p.11/49

slide-23
SLIDE 23

Outline

Introduction and methodology. Concepts of modal mogic. Core modal calculus. Properties of extensions. Proposed work.

Type Theory forMobility and Locality – p.12/49

slide-24
SLIDE 24

Concepts of modal logic

Modal logics distinguish modes or degrees of truth. We have worlds related by accessibility.

Type Theory forMobility and Locality – p.13/49

slide-25
SLIDE 25

Concepts of modal logic

Modal logics distinguish modes or degrees of truth. We have worlds related by accessibility.

A true A true B true C true C true B true

Judgments for the modes of truth:

✙✾✽ ✿ ❀ ❁

— true at this world.

✩ ❂ ❃ ❄ ❅ ❆

— true at all accessible world(s).

❇❉❈ ❊❋ ❋ ❅

— true at some accessible world.

Type Theory forMobility and Locality – p.13/49

slide-26
SLIDE 26

Concepts of modal logic

Modal logics distinguish modes or degrees of truth. We have worlds related by accessibility.

B valid

Judgments for the modes of truth:

✙✾✽ ✿ ❀ ❁

— true at this world.

✩ ❂ ❃ ❄ ❅ ❆

— true at all accessible world(s).

❇❉❈ ❊❋ ❋ ❅

— true at some accessible world.

Type Theory forMobility and Locality – p.13/49

slide-27
SLIDE 27

Concepts of modal logic

Modal logics distinguish modes or degrees of truth. We have worlds related by accessibility.

B valid B true B true B true B true

Judgments for the modes of truth:

✙✾✽ ✿ ❀ ❁

— true at this world.

✩ ❂ ❃ ❄ ❅ ❆

— true at all accessible world(s).

❇❉❈ ❊❋ ❋ ❅

— true at some accessible world.

Type Theory forMobility and Locality – p.13/49

slide-28
SLIDE 28

Concepts of modal logic

Modal logics distinguish modes or degrees of truth. We have worlds related by accessibility.

C poss

Judgments for the modes of truth:

✙✾✽ ✿ ❀ ❁

— true at this world.

✩ ❂ ❃ ❄ ❅ ❆

— true at all accessible world(s).

❇❉❈ ❊❋ ❋ ❅

— true at some accessible world.

Type Theory forMobility and Locality – p.13/49

slide-29
SLIDE 29

Concepts of modal logic

Modal logics distinguish modes or degrees of truth. We have worlds related by accessibility.

C poss C true

Judgments for the modes of truth:

✙✾✽ ✿ ❀ ❁

— true at this world.

✩ ❂ ❃ ❄ ❅ ❆

— true at all accessible world(s).

❇❉❈ ❊❋ ❋ ❅

— true at some accessible world.

Type Theory forMobility and Locality – p.13/49

slide-30
SLIDE 30

Concepts of modal logic

Modal logics distinguish modes or degrees of truth. We have worlds related by accessibility.

C poss C true

Judgments for the modes of truth:

✙✾✽ ✿ ❀ ❁

— true at this world.

✩ ❂ ❃ ❄ ❅ ❆

— true at all accessible world(s).

❇❉❈ ❊❋ ❋ ❅

— true at some accessible world.

Type Theory forMobility and Locality – p.13/49

slide-31
SLIDE 31

Concepts of modal logic

Modal logics distinguish modes or degrees of truth. We have worlds related by accessibility.

C poss C true

Judgments for the modes of truth:

✙✾✽ ✿ ❀ ❁

— true at this world.

✩ ❂ ❃ ❄ ❅ ❆

— true at all accessible world(s).

❇❉❈ ❊❋ ❋ ❅

— true at some accessible world.

Type Theory forMobility and Locality – p.13/49

slide-32
SLIDE 32

Hypothetical judgments

— “global” assumptions

✙ ❂ ❃ ❄ ❅ ❆ ✜

— “local” assumptions

✙✾✽ ✿ ❀ ❁ ❍ ✢ ✙ ❂ ❃ ❄ ❅ ❆ ❍❏■ ✜ ✢ ✙✾✽ ✿ ❀ ❁ ❍❏■ ✜ ✢ ✙ ❈ ❊❋ ❋ ❅

Type Theory forMobility and Locality – p.14/49

slide-33
SLIDE 33

Hypothetical judgments

— “global” assumptions

✙ ❂ ❃ ❄ ❅ ❆ ✜

— “local” assumptions

✙✾✽ ✿ ❀ ❁ ❍ ✢ ✙ ❂ ❃ ❄ ❅ ❆ ❍❏■ ✜ ✢ ✙✾✽ ✿ ❀ ❁ ❍❏■ ✜ ✢ ✙ ❈ ❊❋ ❋ ❅
❁ ❍ ✢ ✙ ❂ ❃ ❄ ❅ ❆ ❑ ❍❏■▼▲ ✢ ✙✾✽ ✿ ❀ ❁

Type Theory forMobility and Locality – p.14/49

slide-34
SLIDE 34

Modal propositions

◆ ✙

— “necessarily

❍ ✧ ✙ ❂ ❃ ❄ ❅ ❆ ■ ✜ ✢ ✙ ✽ ✿ ❀ ❁ ❖✵P◗ ✣ ❍❏■▼▲ ✢ ✙✾✽ ✿ ❀ ❁ ❍❏■ ✜ ✢ ◆ ✙ ✽ ✿ ❀ ❁ ◆ ✫ ❍❏■ ✜ ✢ ◆ ✙✾✽ ✿ ❀ ❁ ❍ ✧ ✙ ❂ ❃ ❄ ❅ ❆ ■ ✜ ✢ ❇❘✽ ✿ ❀ ❁ ❍❏■ ✜ ✢ ❇❘✽ ✿ ❀ ❁ ◆ ✬

Type Theory forMobility and Locality – p.15/49

slide-35
SLIDE 35

Modal propositions

◆ ✙

— “necessarily

❍ ✧ ✙ ❂ ❃ ❄ ❅ ❆ ■ ✜ ✢ ✙ ✽ ✿ ❀ ❁ ❖✵P◗ ✣ ❍❏■▼▲ ✢ ✙✾✽ ✿ ❀ ❁ ❍❏■ ✜ ✢ ◆ ✙ ✽ ✿ ❀ ❁ ◆ ✫ ❍❏■ ✜ ✢ ◆ ✙✾✽ ✿ ❀ ❁ ❍ ✧ ✙ ❂ ❃ ❄ ❅ ❆ ■ ✜ ✢ ❇❘✽ ✿ ❀ ❁ ❍❏■ ✜ ✢ ❇❘✽ ✿ ❀ ❁ ◆ ✬ ❙ ✙

— “possibly

❍❏■ ✜ ✢ ✙✾✽ ✿ ❀ ❁ ❍❏■ ✜ ✢ ✙ ❈ ❊❋ ❋ ❅
❁ ◗ ❚❯ ❯ ❍❏■ ✜ ✢ ✙ ❈ ❊❋ ❋ ❅
❁ ❍❏■ ✜ ✢ ❙ ✙✾✽ ✿ ❀ ❁ ❙ ✫ ❍❏■ ✜ ✢ ❙ ✙✾✽ ✿ ❀ ❁ ❍❏■ ✙✾✽ ✿ ❀ ❁ ✢ ❇ ❈ ❊❋ ❋ ❅
❁ ❍❏■ ✜ ✢ ❇ ❈ ❊❋ ❋ ❅
❁ ❙ ✬

Type Theory forMobility and Locality – p.15/49

slide-36
SLIDE 36

Outline

Introduction and methodology. Concepts of modal logic. Core modal calculus. Properties of extensions. Proposed work.

Type Theory forMobility and Locality – p.16/49

slide-37
SLIDE 37

Towards a distributed calculus

Judgements Logical Typing Operational

❍❏■ ✜ ✢ ✙✾✽ ✿ ❀ ❁ ❍ ✣ ■ ✜ ✣ ✢ ✦ ✙

“evaluate to

locally”

❍❏■ ✜ ✢ ✙ ❈ ❊❋ ❋ ❅
❁ ❍ ✣ ■ ✜ ✣ ✢ ✬❲❱ ✙

“produce

somewhere” Propositions Prop/Type Logical Reading Type Reading

◆ ✙

“necessarily

” “mobile

❙ ✙

“possibly A” “remote

Type Theory forMobility and Locality – p.17/49

slide-38
SLIDE 38

Typing:

❍ ✧ ❀ ✦ ✦ ✙ ■ ✜ ✢ ❀ ✦ ✙ ❖ P ◗ ✣ ❍❏■▼▲ ✢ ✦ ✙ ❍❏■ ✜ ✢

box

✦ ◆ ✙ ◆ ✫ ❍❏■ ✜ ✢ ✦ ◆ ✙ ❍ ✧ ❀ ✦ ✦ ✙ ■ ✜ ✢ ✰ ✦ ✩ ❍ ■ ✜ ✢

let box

= in

✰ ✦ ✩ ◆ ✬

Type Theory forMobility and Locality – p.18/49

slide-39
SLIDE 39

Operational:

Intuition

let box u = box M in N

Type Theory forMobility and Locality – p.19/49

slide-40
SLIDE 40

Operational:

Intuition

let box u = box M in N {..., M}

Type Theory forMobility and Locality – p.19/49

slide-41
SLIDE 41

Operational:

Intuition

N ... u ... V

Type Theory forMobility and Locality – p.19/49

slide-42
SLIDE 42

Operational:

Intuition

N ... u ... V

Formally

❳❩❨ ❬ ❭ ❪ ❫

let box

= box

in

❛ ❜❝ ❞ ❡ ❳❩❨ ❢ ❭ ❵ ❝❤❣ ❳ ❨ ❬ ❭ ❪ ❫ ❫ ❫ ❨ ❢ ✐ ❴ ❜ ❜ ❛ ❜ ❝ ❳❩❨ ❢ ❭ ❥ ❝❤❣ ❳❩❨ ❬ ❭ ❪ ❫ ❨ ❢ ❜❝ ❞ ❡ ❳❩❨ ❢ ❭ ❥ ❝❤❣ ❳❩❨ ❬ ❭ ❪ ❫ ❥ ❜❝ ❳❩❨ ❬ ❭ ❪ ❫

let box

= box

in

❛ ❜❝ ❞ ❡ ❳❩❨ ❬ ❭ ❪ ❫ ❫ ❫ ❥ ✐ ❴ ❜ ❜ ❛ ❜❝

Opportunistic concurrent evaluation — not essential to logical necessity.

Type Theory forMobility and Locality – p.19/49

slide-43
SLIDE 43

Example: Higher-order mobility

(* times_k :

nat ->

(nat->nat) *) fun times_k k = let box u = k in box (

x:nat . x * u) Lexically-scoped mobile closures capture mobile bindings (

❀ ❦ ❍

).

Type Theory forMobility and Locality – p.20/49

slide-44
SLIDE 44

Example: Higher-order mobility

(* pmap :

(nat->nat) -> list

nat

  • > list

nat *) fun pmap f [] = [] pmap f (x::tl) = let box f’ = f box x’ = x box v = box (f’ x’) (* spawn work *) in ((box v)::(pmap f tl)) (* double_lst : list

nat -> list

nat *) val double_lst = pmap (times_k (box 2)) Clean account of mobility at function types

◆ ❧ ✙ ✪ ✩ ♠

.

Type Theory forMobility and Locality – p.21/49

slide-45
SLIDE 45

Example: Divide & conquer

(* fib ::

nat -> nat *) mfun fib x = let box n = x in if (n < 2) then n else let (* spawn a,b concurrently *) box a = box (fib box(n-1)) box b = box (fib box(n-2)) in (a + b) Note: mfun defines a mobile recursive function.

Type Theory forMobility and Locality – p.22/49

slide-46
SLIDE 46

Typing:

❍❏■ ✜ ✢ ✦ ✙ ❍❏■ ✜ ✢

{ }

❱ ✙ ◗ ❚❯ ❯ ❍❏■ ✜ ✢ ✬ ❱ ✙ ❍ ■ ✜ ✢

dia

✬ ✦ ❙ ✙ ❙ ✫ ❍❏■ ✜ ✢ ✦ ❙ ✙ ❍❏■ ✭ ✦ ✙ ✢ ♥ ❱ ✩ ❍❏■ ✜ ✢

let dia

= in

♥ ❱ ✩ ❙ ✬

Type Theory forMobility and Locality – p.23/49

slide-47
SLIDE 47

Operational:

Intuition

let dia x = in F dia V

*

Type Theory forMobility and Locality – p.24/49

slide-48
SLIDE 48

Operational:

Intuition

{...x, F}

2

l

2

let dia x = dia in F [V/x] F l

Type Theory forMobility and Locality – p.24/49

slide-49
SLIDE 49

Operational:

Intuition

[V/x] F

Type Theory forMobility and Locality – p.24/49

slide-50
SLIDE 50

Operational:

Intuition

[V/x] F

Formally

❳ ♦ ❬ ❭ ♣ ❫

let dia

q

= dia

♦ ❢

in

r ❜❝ ❣ ❳ ♦ ❢ ❭

{

}

❝ ❞ ❡ ❳ ♦ ❬ ❭ ♣ ❫ ♦ s ❢ ❜❝ ❣ ❳ ♦ s ❢ ❭ ❫ ❥ ✐ q ❜ r ❝ ❣ ❳ ♦ ❢ ❭

{

}

❝ ❳ ♦ ❬ ❭ ♣ ❫

let dia

q

= dia {

} in

r ❜❝ ❞ ❡ ❳ ♦ ❬ ❭ ♣ ❫ ❫ ❥ ✐ q ❜ r ❜ ❝

Type Theory forMobility and Locality – p.24/49

slide-51
SLIDE 51

Example: A remote queue

(* rqueue :

({insert:nat->unit, ...}) *) val rqueue = bind_queue ... (* insert (x :

nat) into rqueue *) let box v = x dia q = rqueue (* jump to queue *) in let val _ = q.insert v (* v mobile *) in ... Requires a mobile value (

nat) because queue is remote.

Type Theory forMobility and Locality – p.25/49

slide-52
SLIDE 52

Core calculus — summary

Type

✙ ✧ ✩ ✦ ✦ ✼ ✙ ✪ ✩ t ◆ ✙ t ❙ ✙

Term

✧ ✰ ✦ ✦ ✼ ✭ t ❀ t ✮ ✭ ✦ ✙ ✯ t ✰ t

box

t

dia

✬ t

let box

= in

Expr.

✬ ✧ ♥ ✦ ✦ ✼

{ }

t

let box

= in

♥ t

let dia

= in

Type Theory forMobility and Locality – p.26/49

slide-53
SLIDE 53

Core calculus — summary

Type

✙ ✧ ✩ ✦ ✦ ✼ ✙ ✪ ✩ t ◆ ✙ t ❙ ✙

Term

✧ ✰ ✦ ✦ ✼ ✉ t ✭ t ❀ t ✮ ✭ ✦ ✙ ✯ t ✰ t

box

t

dia

✬ t

let box

= in

Expr.

✬ ✧ ♥ ✦ ✦ ✼ ✈ t

{ }

t

let box

= in

♥ t

let dia

= in

Label

✇ ✦ ✦ ✼ ✉ t ✈

Process

① ✦ ✦ ✼ ② ✉ ✦ ③ t ② ✈ ✦ ✬ ③

Config.

❇ ✦ ✦ ✼ ▲ t ❇ ✧ ①

Type Theory forMobility and Locality – p.26/49

slide-54
SLIDE 54

Process configurations

❇ ✼ ✛ ❇ ④

— “

steps to

❇ ④

”. Non-deterministic choice of process (concurrency). Synchronization rule either lazy or strict (don’t care).

Type Theory forMobility and Locality – p.27/49

slide-55
SLIDE 55

Process configurations

❇ ✼ ✛ ❇ ④

— “

steps to

❇ ④

”. Non-deterministic choice of process (concurrency). Synchronization rule either lazy or strict (don’t care).

⑤ ✢ ⑥ ❇ ✦ ⑦

— “conf.

has type

(under

)”.

⑦ ✼ ✉ ⑧ ✦ ✦ ✙ ✧ ✯ ✯ ✯ ✧ ✈⑩⑨ ❱ ✙ ✧ ✯ ✯ ✯ ⑤

— determines scope/accessibility of labels.

Type Theory forMobility and Locality – p.27/49

slide-56
SLIDE 56

Properties

Type preservation:

⑤ ✢ ⑥ ❇ ✦ ⑦

and

❇ ✼ ✛ ❇ ④ ✼ ✛ ✶ ⑦ ④❷❶ ⑦ ✯ ✶ ⑤ ④ ✯ ⑤ ④ ✢ ⑥ ❇ ④ ✦ ⑦ ④ ⑦ ④

and

⑤ ④

grow as processes are created.

Type Theory forMobility and Locality – p.28/49

slide-57
SLIDE 57

Properties

Type preservation:

⑤ ✢ ⑥ ❇ ✦ ⑦

and

❇ ✼ ✛ ❇ ④ ✼ ✛ ✶ ⑦ ④❷❶ ⑦ ✯ ✶ ⑤ ④ ✯ ⑤ ④ ✢ ⑥ ❇ ④ ✦ ⑦ ④ ⑦ ④

and

⑤ ④

grow as processes are created. Progress:

⑤ ✢ ⑥ ❇ ✦ ⑦

and

⑤❹❸ ❊ ❸ ❺ ❻ ❺ ❄ ❅ ❺ ✼ ✛ ✶ ❇ ④ ✯ ❇ ✼ ✛ ❇ ④
  • r

terminal

⑤ ❸ ❊ ❸ ❺ ❻ ❺ ❄ ❅ ❺

— permits inductive argument. deadlocked:

② ✉ ⑧ ✦ ✉ ⑨ ❧ ✮ ✭ ✦ ✙ ✯ ✭ ♠ ③ ✧ ② ✉ ⑨ ✦ ✉ ⑧ ❧ ✮ ✭ ✦ ✙ ✯ ✭ ♠ ③

Type Theory forMobility and Locality – p.28/49

slide-58
SLIDE 58

Properties

Termination: sequences

❇ ⑧ ✼ ✛ ❇ ⑨ ✼ ✛ ✯ ✯ ✯

halt core calculus (without fixpoints).

⑤ ✢ ⑥ ❇ ⑧ ✦ ⑦ ⑧

— well-formed configuration.

⑤ ❸ ❊ ❸ ❺ ❻ ❺ ❄ ❅ ❺

— no recursion through “backdoor”.

Type Theory forMobility and Locality – p.29/49

slide-59
SLIDE 59

Properties

Termination: sequences

❇ ⑧ ✼ ✛ ❇ ⑨ ✼ ✛ ✯ ✯ ✯

halt core calculus (without fixpoints).

⑤ ✢ ⑥ ❇ ⑧ ✦ ⑦ ⑧

— well-formed configuration.

⑤ ❸ ❊ ❸ ❺ ❻ ❺ ❄ ❅ ❺

— no recursion through “backdoor”. Confluence holds for well-formed config: under same general conditions as above... modulo (

❇ ❑ ❼

) synchronization-equiv.

G H C D C D * * * * C’ D’

Type Theory forMobility and Locality – p.29/49

slide-60
SLIDE 60

Outline

Introduction and methodology. Concepts of modal logic. Core modal calculus. Properties of extensions. Proposed work.

Type Theory forMobility and Locality – p.30/49

slide-61
SLIDE 61

Example: marshalling

(* marshall_nat :: nat ->

nat *) fun marshall_nat n = case n of zero => box zero (* boxed val *) | succ(x) => let box u = marshall_nat x in box (succ(u)) (* boxed val *) Spawning a concurrent process is optional.

Type Theory forMobility and Locality – p.31/49

slide-62
SLIDE 62

Example: marshalling

PROHIBITED: marshalling arbitrary closures. (* closure over binding c *) val c = 42 fun f y = if y > 0 then c else y (* marshall_n2n: (nat->nat) ->

(nat->nat) fun marshall_n2n f = box f (* ill-typed occurrence *) An arbitrary (nat

nat) may capture local binding.

Type Theory forMobility and Locality – p.32/49

slide-63
SLIDE 63

Locality of effects

Locality and effects are naturally connected. Observable effects should execute at definite locations. Machine state underlying effects is localized.

Type Theory forMobility and Locality – p.33/49

slide-64
SLIDE 64

Locality of effects

Locality and effects are naturally connected. Observable effects should execute at definite locations. Machine state underlying effects is localized. Nutshell: add effect monad (

) and local computations. Typing Operational

❍❏■ ✜ ✢ ✦ ✙

“evaluate to

locally”

❍❏■ ✜ ✢ ❽ ✦ ❾ ✙

“produce

locally with effects”

❍❏■ ✜ ✢ ✬❲❱ ✙

“produce

somewhere with effects”

Type Theory forMobility and Locality – p.33/49

slide-65
SLIDE 65

Example: mutable ref

PROHIBITED: mobility for mutable refereces. (* counter : ref nat *) val counter = ref 0 (* bump :: unit -> unit *) mfun bump () = counter := !counter + 1 box _ = box (bump ()) (* bump *) box _ = box (bump ()) (* twice *) (* !counter = 0? *) Type system (

) disallows effects in spawned terms. See proposal document for details...

Type Theory forMobility and Locality – p.34/49

slide-66
SLIDE 66

Outline

Introduction and methodology. Concepts of modal logic. Core modal calculus. Properties of extensions. Proposed work.

Type Theory forMobility and Locality – p.35/49

slide-67
SLIDE 67

Progress

Proposed contributions:

Type Theory forMobility and Locality – p.36/49

slide-68
SLIDE 68

Progress

Proposed contributions: ✓ Relate modal logic to distributed computation.

Type Theory forMobility and Locality – p.36/49

slide-69
SLIDE 69

Progress

Proposed contributions: ✓ Relate modal logic to distributed computation. ✓ Core calculus with mobility and locality types.

Type Theory forMobility and Locality – p.36/49

slide-70
SLIDE 70

Progress

Proposed contributions: ✓ Relate modal logic to distributed computation. ✓ Core calculus with mobility and locality types. Extensions that interact with mobility/locality.

Type Theory forMobility and Locality – p.36/49

slide-71
SLIDE 71

Progress

Proposed contributions: ✓ Relate modal logic to distributed computation. ✓ Core calculus with mobility and locality types. Extensions that interact with mobility/locality. Apply to distributed grid programming.

Type Theory forMobility and Locality – p.36/49

slide-72
SLIDE 72

Extensions

Complete Concrete data: products, sums, recursive types. Effects: effect monad (

), mutable refs.

Type Theory forMobility and Locality – p.37/49

slide-73
SLIDE 73

Extensions

Complete Concrete data: products, sums, recursive types. Effects: effect monad (

), mutable refs. Proposed: Polymorphism (

), abstract types (

). Well-known problem sharing abstract values

between locations. Permutations of

✶ ✴ ✯ ✩

and

◆ ❙

seem interesting...

Type Theory forMobility and Locality – p.37/49

slide-74
SLIDE 74

Application: ConCert grid

ConCert runtime for trustless grid computing: Trustless — execute certified fragments of code. Grid — network of peers provide compute cycles. Certification is based on type/proof checking, not trust.

Type Theory forMobility and Locality – p.38/49

slide-75
SLIDE 75

Application: ConCert grid

ConCert runtime for trustless grid computing: Trustless — execute certified fragments of code. Grid — network of peers provide compute cycles. Certification is based on type/proof checking, not trust. Mobility and locality matter in ConCert: All the general reasons, plus... ☞ confidentiality, abstraction. ☞ efficiency (space/bandwidth costs). ☞ safety policies (move only certified code).

Type Theory forMobility and Locality – p.38/49

slide-76
SLIDE 76

Application: ConCert grid

Prototype compiler Hemlock: Programming with spawn and sync model. Type system: assume all values are mobile. Marshalling mutable refs — by copying. code — problematic for local libraries.

Type Theory forMobility and Locality – p.39/49

slide-77
SLIDE 77

Application: ConCert grid

Prototype compiler Hemlock: Programming with spawn and sync model. Type system: assume all values are mobile. Marshalling mutable refs — by copying. code — problematic for local libraries. Mobility and locality types provide: Statically safe variant of spawn/sync (

◆ ✙

). Link with local libraries (trusted/certified mix). Bind and use remote resources (

❙ ✙

).

Type Theory forMobility and Locality – p.39/49

slide-78
SLIDE 78

Details

Hemlock extensions/modifications: Type system for

,

and effects.

Type Theory forMobility and Locality – p.40/49

slide-79
SLIDE 79

Details

Hemlock extensions/modifications: Type system for

,

and effects. Code generation for new box/dia features.

Type Theory forMobility and Locality – p.40/49

slide-80
SLIDE 80

Details

Hemlock extensions/modifications: Type system for

,

and effects. Code generation for new box/dia features. Marshalling: migrate to format compatible with (

◆ ✙

).

Type Theory forMobility and Locality – p.40/49

slide-81
SLIDE 81

Details

Hemlock extensions/modifications: Type system for

,

and effects. Code generation for new box/dia features. Marshalling: migrate to format compatible with (

◆ ✙

). ConCert runtime extensions (support

,

model): Mapping, binding to (

❙ ✙

) resources.

Type Theory forMobility and Locality – p.40/49

slide-82
SLIDE 82

Details

Hemlock extensions/modifications: Type system for

,

and effects. Code generation for new box/dia features. Marshalling: migrate to format compatible with (

◆ ✙

). ConCert runtime extensions (support

,

model): Mapping, binding to (

❙ ✙

) resources. Targeted “closures”

❿ ✭ ➀ ✪ ➁ ■ ✬ ➂

(arising from let dia

= in

)

Type Theory forMobility and Locality – p.40/49

slide-83
SLIDE 83

Strategy: Tasks and priorities

Priority Effort Task high med Polymorphism, abstract types high med Parsing, typechecking (

,

, & effects) high high Hemlock runtime marshalling code (TALT) high high TALT code gen. box/dia features

Type Theory forMobility and Locality – p.41/49

slide-84
SLIDE 84

Strategy: Tasks and priorities

Priority Effort Task high med Polymorphism, abstract types high med Parsing, typechecking (

,

, & effects) high high Hemlock runtime marshalling code (TALT) high high TALT code gen. box/dia features med med ConCert runtime support (

) (ML) med high Abstract resources (

❙ ✶

), Modules?

Type Theory forMobility and Locality – p.41/49

slide-85
SLIDE 85

Strategy: Tasks and priorities

Priority Effort Task high med Polymorphism, abstract types low med Dependent types, policy-related types high med Parsing, typechecking (

,

, & effects) high high Hemlock runtime marshalling code (TALT) high high TALT code gen. box/dia features med med ConCert runtime support (

) (ML) med high Abstract resources (

❙ ✶

), Modules?

Type Theory forMobility and Locality – p.41/49

slide-86
SLIDE 86

End

Questions?

Type Theory forMobility and Locality – p.42/49

slide-87
SLIDE 87

Strategy: Tasks and Priorities

Time Date Task 1 1 Polymorphism, abstract types ? ? Dependent types, policy-related types 2-4 3-5 Parsing, typechecking (

,

, & effects) 3-4 6-9 Hemlock runtime marshalling code (TALT) 3-4 9-13 TALT code gen. box/dia features 2-3 11-16 ConCert runtime support (

) (ML) 2-3 13-19 Abstract resources (

❙ ✶

), Modules?

Type Theory forMobility and Locality – p.43/49

slide-88
SLIDE 88

Programming Models

,nat,

,

,... (local pure functional programs).

(spawn mobile terms).

◆ ❙

(spawn mobile terms, jump among locations). (local effects)

(spawn mobile, local effects)

◆ ❙

(spawn, local effects, jumping, remote effects)

Type Theory forMobility and Locality – p.44/49

slide-89
SLIDE 89

S4 and P2P Grid

Recall that ConCert assumes P2P grid with unreliable nodes... Some characteristics of the S4 formalism: No explicit world annotations necessary in calculus. Non-trivial

◆ ❙ ✙

values are extra-logical. Programmer can’t create them (

✙ ➃ ✪ ◆ ❙ ✙

). This simplifies the runtime support layer: Flexible scheduling. Program fragments run anywhere, or nearly anywhere. Most locations are “stateless”. Node can leave network after producing result.

Type Theory forMobility and Locality – p.45/49

slide-90
SLIDE 90

Typing Rules

➄➆➅ ➇ ❣ q ❭ ➈ ❣ ➇ s ➉➋➊ q ❭ ➈ ➌➎➍➏ ➄ ➅ ➇ ❣ q ❭ ➈ ➉➐➊ ❵ ❭ ➑ ➄ ➅ ➇ ➉➋➊ ➒ q ❭ ➈➔➓ ❵ ❭ ➈➣→ ➑ → ↔ ➄ ❣ ❴ ❭ ❭ ➈ ❣ ➄ s ➅ ➇ ➉➋➊ ❴ ❭ ➈ ➌➎➍ ➏ ↕ ➄ ➅ ➇ ➉➐➊ ❵ ❭ ➈ → ➑ ➄ ➅ ➇ ➉➐➊ ❛ ❭ ➈ ➄ ➅ ➇ ➉➋➊ ❵ ❛ ❭ ➑ → ➙ ➄ ➅ ➛ ➉➐➊ ➜ ❵ ❭ ➈ ➄ ➅ ➇ ➉ ➊

box

❵ ❭ ➝ ➈ ➝ ↔ ➄➆➅ ➇ ➉➐➊ ❵ ❭ ➝ ➈ ➄ ❣ ❴ ❭ ❭ ➈ ➅ ➇ ➉➐➊ ❛ ❭ ➑ ➄ ➅ ➇ ➉ ➊

let box

=

in

❛ ❭ ➑ ➝ ➙ ➄ ➅ ➇ ➉➐➊ ❵ ❭ ➈ ➄ ➅ ➇ ➉➋➊

{

}

➞ ➈ ➏➟ ➠ ➠ ➄ ➅ ➇ ➉➐➊ ❵ ❭ ➡ ➈ ➄➆➅ q ❭ ➈ ➉ ➊ ➜ r ➞ ➑ ➄➆➅ ➇ ➉➋➊

let dia

q

=

in

r ➞ ➑ ➡ ➙ ➄ ➅ ➇ ➉➐➊ ➙ ➞ ➈ ➄ ➅ ➇ ➉ ➊

dia

➙ ❭ ➡ ➈ ➡ ↔ ➄ ➅ ➇ ➉ ➊ ❵ ❭ ➝ ➈ ➄ ❣ ❴ ❭ ❭ ➈ ➅ ➇ ➉➐➊ r ➞ ➑ ➄➆➅ ➇ ➉➋➊

let box

=

in

r ➞ ➑ ➝ ➙➤➢

Type Theory forMobility and Locality – p.46/49

slide-91
SLIDE 91

Extensions

The type theory of (

✪ ◆ ❙

) is easily extensible: products (

✙ ✱ ✩

), sums (

✙ ✲ ✩

), recursive types (

➥ ✴ ✯ ✩

) ... (straightforward)

➄➆➅ ➇ ➉ ❵ ❭ ➈ ➄ ➅ ➇ ➉ ❛ ❭ ➑ ➄ ➅ ➇ ➉

(

,

)

❭ ➈➧➦ ➑ ➄➆➅ ➇ ➉ ❵ ❭ ➈ ➦ ➑ ➄➆➅ ➇ ➉

fst

❵ ❭ ➑ ➄ ➅ ➇ ➉ ❵ ❭ ➈➧➦ ➑ ➄➆➅ ➇ ➉

snd

❵ ❭ ➈

Type Theory forMobility and Locality – p.47/49

slide-92
SLIDE 92

Extensions

The type theory of (

✪ ◆ ❙

) is easily extensible: products (

✙ ✱ ✩

), sums (

✙ ✲ ✩

), recursive types (

➥ ✴ ✯ ✩

) ... (straightforward)

➄➆➅ ➇ ➉ ❵ ❭ ➈ ➄ ➅ ➇ ➉ ❛ ❭ ➑ ➄ ➅ ➇ ➉

(

,

)

❭ ➈➧➦ ➑ ➄➆➅ ➇ ➉ ❵ ❭ ➈ ➦ ➑ ➄➆➅ ➇ ➉

fst

❵ ❭ ➑ ➄ ➅ ➇ ➉ ❵ ❭ ➈➧➦ ➑ ➄➆➅ ➇ ➉

snd

❵ ❭ ➈

Fixpoints: fixv

❧ ❀ ✦ ✦ ✙ ♠ ✯

and fix

❧ ✭ ✦ ✙ ♠ ✯ ❍ ✧ ❀ ✦ ✦ ✙ ■▼▲ ✢ ✦ ✙ ❍❏■ ✜ ✢

fixv

❧ ❀ ✦ ✦ ✙ ♠ ✯ ✦ ✙ ❍ ■ ✜ ✧ ✭ ✦ ✙ ✢ ✦ ✙ ❍❏■ ✜ ✢

fix

❧ ❀ ✦ ✙ ♠ ✯ ✦ ✙

Type Theory forMobility and Locality – p.47/49

slide-93
SLIDE 93

Extensions

Each extension interacts with mobility and locality.

Type Theory forMobility and Locality – p.48/49

slide-94
SLIDE 94

Extensions

Each extension interacts with mobility and locality. A heuristic... Location-neutral

✼ ✛

term

✦ ✙

Location-dependent

✼ ✛

expression

✬ ❱ ✙

(actually or potentially)

Type Theory forMobility and Locality – p.48/49

slide-95
SLIDE 95

Extensions

Each extension interacts with mobility and locality. A heuristic... Location-neutral

✼ ✛

term

✦ ✙

Location-dependent

✼ ✛

expression

✬ ❱ ✙

(actually or potentially) (

✙ ✪ ◆ ✙

) —

can be made mobile (marshalling) Some values

are location-independent. Others not!

Type Theory forMobility and Locality – p.48/49

slide-96
SLIDE 96

Effect Typing

➄ ➅ ➇ ➉ ➊ ➨ ❭ ➩ ➈ ➄➆➅ ➇ ➉➋➊

comp

➨ ❭ ➫ ➈ ➫ ↔ ➄ ➅ ➇ ➉➐➊ ❵ ❭ ➫ ➈ ➄ ➅ ➇ ❣ q ❭ ➈ ➉ ➊ ➭ ❭ ➩ ➑ ➄➆➅ ➇ ➉➋➊

let comp

q

=

in

➭ ❭ ➩ ➑ ➫ ➙ ➄ ➅ ➇ ➉➐➊ ❵ ❭ ➈ ➄ ➅ ➇ ➉ ➊

[

]

❭ ➩ ➈ ➯ ➟ ➲ ➏ ➄ ➅ ➇ ➉➐➊ ❵ ❭ ➝ ➈ ➄ ❣ ❴ ❭ ❭ ➈ ➅ ➇ ➉➐➊ ➭ ❭ ➩ ➑ ➄➆➅ ➇ ➉➋➊

let box

=

in

➭ ❭ ➩ ➑ ➝ ➙➵➳ ➄➆➅ ➇ ➉➐➊ ➨ ❭ ➩ ➈ ➄➆➅ ➇ ➉➋➊

{

}

➞ ➈ ➏➟ ➠ ➠ s ➄ ➅ ➇ ➉ ➊ ❵ ❭ ➫ ➈ ➄ ➅ ➇ ❣ q ❭ ➈ ➉➐➊ r ➞ ➑ ➄➆➅ ➇ ➉➋➊

let comp

q

=

in

r ➞ ➑ ➫ ➙ ➢

Primitive effects:

➸ ❞ ➸ ❬ ❣ ➺ ➻ ❭ ➈ ❣ ➸ ❢ ➸ ➅ ➄ ➅ ➇ ➉ ➻ ➺ ➻ ❭

ref

➈ ➺ ➼ ➼ ❨ ➄ ➅ ➇ ➉➋➊ ❵ ❭ ➈ ➄ ➅ ➇ ➉ ➊

ref

❵ ❭ ➩

ref

➈ ➽ ➺ ♦ ♦ ➟ ➯ ➄➆➅ ➇ ➉➋➊ ❵ ❭

ref

➈ ➄ ➅ ➇ ➉➋➊

!

❵ ❭ ➩ ➈ ➽➣➾➚ ➽ ➄➆➅ ➇ ➉➋➊ ❵ ❭

ref

➈ ➄ ➅ ➇ ➉➋➊ ❛ ❭ ➈ ➄➆➅ ➇ ➉➋➊ ❵

:=

❛ ❭ ➩

1

➽ ➠ ➚ ➽

Type Theory forMobility and Locality – p.49/49