Provably correct implementations of services Roberto Bruni 1 Rocco De - - PowerPoint PPT Presentation

provably correct implementations of services
SMART_READER_LITE
LIVE PREVIEW

Provably correct implementations of services Roberto Bruni 1 Rocco De - - PowerPoint PPT Presentation

Provably correct implementations of services Roberto Bruni 1 Rocco De Nicola 2 Michele Loreti 2 Leonardo G. Mezzina 3 1 Dipartimento di Informatica, Universit` a di Pisa, Italy 2 Dipartimento di Sistemi e Informatica, Universit` a di Firenze,


slide-1
SLIDE 1

Provably correct implementations of services

Roberto Bruni1 Rocco De Nicola2 Michele Loreti2 Leonardo G. Mezzina3

1Dipartimento di Informatica, Universit`

a di Pisa, Italy

2Dipartimento di Sistemi e Informatica, Universit`

a di Firenze, Italy

3IMT Alti Studi Lucca, Italy

TGC 2008 — Barcelona, November, 3-4

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 1 / 27

slide-2
SLIDE 2
  • Outline. . .

1

Motivations

2

SOAM: Service Oriented Abstract Machine

3

Implementing Service Calculi with SOAM

4

Concluding Remarks

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 2 / 27

slide-3
SLIDE 3
  • Outline. . .

1

Motivations

2

SOAM: Service Oriented Abstract Machine

3

Implementing Service Calculi with SOAM

4

Concluding Remarks

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 3 / 27

slide-4
SLIDE 4
  • Motivations. . .

The explosive growth of the Web has led to the widespread use of communication centric applications, often referred as Web Services; the growth of a new computational paradigm known as Service Oriented Computing (SOC).

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 4 / 27

slide-5
SLIDE 5
  • Motivations. . .

The explosive growth of the Web has led to the widespread use of communication centric applications, often referred as Web Services; the growth of a new computational paradigm known as Service Oriented Computing (SOC). Service Oriented Computing (SOC) is calling for novel computational models and languages with primitives for client-server interaction,

  • rchestration and unexpected events handling

Important features of SOC are: compositionality, context-independence, encapsulation and re-usability.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 4 / 27

slide-6
SLIDE 6
  • Motivations. . .

The explosive growth of the Web has led to the widespread use of communication centric applications, often referred as Web Services; the growth of a new computational paradigm known as Service Oriented Computing (SOC). Service Oriented Computing (SOC) is calling for novel computational models and languages with primitives for client-server interaction,

  • rchestration and unexpected events handling

Important features of SOC are: compositionality, context-independence, encapsulation and re-usability. A number of formalisms have been defined to support the specification and analysis of service oriented applications at the right level of abstraction

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 4 / 27

slide-7
SLIDE 7
  • Motivations. . .

These formalisms are based on process algebras enriched with primitives specific of service orientation:

  • perators for manipulating semi-structured data

mechanisms for describing safe client-service interactions constructors for composing possibly unreliable services techniques for query and discovery of services.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 5 / 27

slide-8
SLIDE 8
  • Motivations. . .

These formalisms are based on process algebras enriched with primitives specific of service orientation:

  • perators for manipulating semi-structured data

mechanisms for describing safe client-service interactions constructors for composing possibly unreliable services techniques for query and discovery of services. A key point for the usefulness of process calculi is the availability of tools (types or logics) to specify, check and guarantee the correct behavior of the considered services.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 5 / 27

slide-9
SLIDE 9
  • Motivations. . .

We have defined a Service Oriented Abstract Machine (SOAM). . . equipped with a formal semantics that can be used to implement the service specification formalisms.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 6 / 27

slide-10
SLIDE 10
  • Motivations. . .

We have defined a Service Oriented Abstract Machine (SOAM). . . equipped with a formal semantics that can be used to implement the service specification formalisms. The operational semantics of SOAM can be used as the basis for guaranteeing that the properties that have been proved by reasoning on the calculi-based specification are preserved by the actual implementations.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 6 / 27

slide-11
SLIDE 11
  • Motivations. . .

We have defined a Service Oriented Abstract Machine (SOAM). . . equipped with a formal semantics that can be used to implement the service specification formalisms. The operational semantics of SOAM can be used as the basis for guaranteeing that the properties that have been proved by reasoning on the calculi-based specification are preserved by the actual implementations. Three representative service-oriented calculi will be considered.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 6 / 27

slide-12
SLIDE 12
  • Outline. . .

1

Motivations

2

SOAM: Service Oriented Abstract Machine

3

Implementing Service Calculi with SOAM

4

Concluding Remarks

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 7 / 27

slide-13
SLIDE 13

SOAM: Service Oriented Abstract Machine

SOAM is based on the notion of queues: model persistent, protected, communication lines; permit inter-task communication; are created on service invocation; messages are retrieved by means of pattern matching; can be either synchronous or asynchronous; naturally corresponds to the concept of session.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 8 / 27

slide-14
SLIDE 14

SOAM: Service Oriented Abstract Machine

SOAM network. . .

. . . can be: σ ⊢ C, a program C running with local store σ

◮ σ associates variable to values;

r : h, a queue r with associated a sequence of values h; N|M, the parallel composition of two networks.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 9 / 27

slide-15
SLIDE 15

SOAM: Service Oriented Abstract Machine

SOAM network. . .

. . . can be: σ ⊢ C, a program C running with local store σ

◮ σ associates variable to values;

r : h, a queue r with associated a sequence of values h; N|M, the parallel composition of two networks.

SOAM programs. . .

. . . are built from: standard imperative commands (iteration, selection,. . . ); primitives for queues (creation, input and output); service definitions and invocations.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 9 / 27

slide-16
SLIDE 16

SOAM: Service Oriented Abstract Machine

Queue actions: out, in

(Mout)

σ(w) = r σ ⊢ out(w, ˜ v); C|r : h → σ ⊢ C|r : ˜ v · h

(Min)

σ(w) = r match(σ, ˜ Fk, ˜ v) = ρ σ ⊢ in(w, Σj∈J( ˜ Fj.Cj)); D|r : h · ˜ v · h′ → σρ ⊢ Ck; D|r : h · h′

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 10 / 27

slide-17
SLIDE 17

SOAM: Service Oriented Abstract Machine

Queue actions: out, in

(Mout)

σ(w) = r σ ⊢ out(w, ˜ v); C|r : h → σ ⊢ C|r : ˜ v · h

(Min)

σ(w) = r match(σ, ˜ Fk, ˜ v) = ρ σ ⊢ in(w, Σj∈J( ˜ Fj.Cj)); D|r : h · ˜ v · h′ → σρ ⊢ Ck; D|r : h · h′

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 10 / 27

slide-18
SLIDE 18

SOAM: Service Oriented Abstract Machine

Queue actions: out, in

(Mout)

σ(w) = r σ ⊢ out(w, ˜ v); C|r : h → σ ⊢ C|r : ˜ v · h

(Min)

σ(w) = r match(σ, ˜ Fk, ˜ v) = ρ σ ⊢ in(w, Σj∈J( ˜ Fj.Cj)); D|r : h · ˜ v · h′ → σρ ⊢ Ck; D|r : h · h′

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 10 / 27

slide-19
SLIDE 19

SOAM: Service Oriented Abstract Machine

Queue actions: out, in

(Mout)

σ(w) = r σ ⊢ out(w, ˜ v); C|r : h → σ ⊢ C|r : ˜ v · h

(Min)

σ(w) = r match(σ, ˜ Fk, ˜ v) = ρ σ ⊢ in(w, Σj∈J( ˜ Fj.Cj)); D|r : h · ˜ v · h′ → σρ ⊢ Ck; D|r : h · h′

Queue creation: new

(MnewR)

r is fresh σ ⊢ new x; C → (νr)(σ[r/x] ⊢ C|r : ∅)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 10 / 27

slide-20
SLIDE 20

SOAM: Service Oriented Abstract Machine

Queue actions: out, in

(Mout)

σ(w) = r σ ⊢ out(w, ˜ v); C|r : h → σ ⊢ C|r : ˜ v · h

(Min)

σ(w) = r match(σ, ˜ Fk, ˜ v) = ρ σ ⊢ in(w, Σj∈J( ˜ Fj.Cj)); D|r : h · ˜ v · h′ → σρ ⊢ Ck; D|r : h · h′

Queue creation: new

(MnewR)

r is fresh σ ⊢ new x; C → (νr)(σ[r/x] ⊢ C|r : ∅)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 10 / 27

slide-21
SLIDE 21

SOAM: Service Oriented Abstract Machine

Queue actions: out, in

(Mout)

σ(w) = r σ ⊢ out(w, ˜ v); C|r : h → σ ⊢ C|r : ˜ v · h

(Min)

σ(w) = r match(σ, ˜ Fk, ˜ v) = ρ σ ⊢ in(w, Σj∈J( ˜ Fj.Cj)); D|r : h · ˜ v · h′ → σρ ⊢ Ck; D|r : h · h′

Queue creation: new

(MnewR)

r is fresh σ ⊢ new x; C → (νr)(σ[r/x] ⊢ C|r : ∅)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 10 / 27

slide-22
SLIDE 22

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-23
SLIDE 23

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-24
SLIDE 24

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-25
SLIDE 25

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-26
SLIDE 26

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-27
SLIDE 27

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-28
SLIDE 28

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-29
SLIDE 29

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-30
SLIDE 30

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-31
SLIDE 31

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-32
SLIDE 32

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-33
SLIDE 33

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

Task activation: fork

(Mfork)

r, r′ fresh ρi = [r/xi][r′/yi] σ ⊢ fork(x1, y1, C1, x2, y2, C2) → (νr)(νr′)(σρ1 ⊢ C1| σρ2 ⊢ C2|r : ∅|r′ : ∅)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-34
SLIDE 34

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

Task activation: fork

(Mfork)

r, r′ fresh ρi = [r/xi][r′/yi] σ ⊢ fork(x1, y1, C1, x2, y2, C2) → (νr)(νr′)(σρ1 ⊢ C1| σρ2 ⊢ C2|r : ∅|r′ : ∅)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-35
SLIDE 35

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

Task activation: fork

(Mfork)

r, r′ fresh ρi = [r/xi][r′/yi] σ ⊢ fork(x1, y1, C1, x2, y2, C2) → (νr)(νr′)(σρ1 ⊢ C1| σρ2 ⊢ C2|r : ∅|r′ : ∅)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-36
SLIDE 36

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

Task activation: fork

(Mfork)

r, r′ fresh ρi = [r/xi][r′/yi] σ ⊢ fork(x1, y1, C1, x2, y2, C2) → (νr)(νr′)(σρ1 ⊢ C1| σρ2 ⊢ C2|r : ∅|r′ : ∅)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-37
SLIDE 37

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

Task activation: fork

(Mfork)

r, r′ fresh ρi = [r/xi][r′/yi] σ ⊢ fork(x1, y1, C1, x2, y2, C2) → (νr)(νr′)(σρ1 ⊢ C1| σρ2 ⊢ C2|r : ∅|r′ : ∅)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-38
SLIDE 38

SOAM: Service Oriented Abstract Machine

Service invocations and definitions: invoke, offer

(Msynch)

r, r′ fresh ρi = [r/xi][r′/yi] σ1 ⊢ offer(a, x1, y1, C1); D| σ2 ⊢ invoke(a, x2, y2, C2); D′ → σ1 ⊢ D|σ2 ⊢ D′| (νr)(νr′)(r : ∅|r′ : ∅| σ1ρ1 ⊢ C1|σ2ρ2 ⊢ C2)

Task activation: fork

(Mfork)

r, r′ fresh ρi = [r/xi][r′/yi] σ ⊢ fork(x1, y1, C1, x2, y2, C2) → (νr)(νr′)(σρ1 ⊢ C1| σρ2 ⊢ C2|r : ∅|r′ : ∅)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 11 / 27

slide-39
SLIDE 39

SOAM: Service Oriented Abstract Machine

Syntax

C, D ::= skip (skip) | new n (new) | while e do C (while) | if e then C else D (if-then-else) | invoke(v, x, y, C) (new session inv) |

  • ffer(v, x, y, C)

(new session def) |

  • ut(w, ˜

v) (send) | in(w, Σj∈J( ˜ Fj.Cj)) (receive) | x := e (assignment) | fork(x1, y1, C1, x2, y2, C2) (fork and sync) | C; D (sequencing) N ::= O (empty net) | σ ⊢ C (running program) | N|M (network composition) | (νn)N (name restriction) | r : h (session queue)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 12 / 27

slide-40
SLIDE 40
  • Outline. . .

1

Motivations

2

SOAM: Service Oriented Abstract Machine

3

Implementing Service Calculi with SOAM

4

Concluding Remarks

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 13 / 27

slide-41
SLIDE 41

Implementing Service Calculi with SOAM

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 14 / 27

slide-42
SLIDE 42

Implementing Service Calculi with SOAM

Three service oriented calculi are considered: Session Language (SL); Calculus of Sessions and Pipelines (CaSPiS); and Orc.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 14 / 27

slide-43
SLIDE 43

Implementing Service Calculi with SOAM

Three service oriented calculi are considered: Session Language (SL); Calculus of Sessions and Pipelines (CaSPiS); and Orc. These calculi provide specific primitives for modelling SOC: sessions (SL and CaSPiS), session delegation (SL), pipelining (Orc and CaSPiS), session nesting and pattern matching (CaSPiS), and cancelation of activities (Orc).

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 14 / 27

slide-44
SLIDE 44

Implementing Service Calculi with SOAM

Three service oriented calculi are considered: Session Language (SL); Calculus of Sessions and Pipelines (CaSPiS); and Orc. These calculi provide specific primitives for modelling SOC: sessions (SL and CaSPiS), session delegation (SL), pipelining (Orc and CaSPiS), session nesting and pattern matching (CaSPiS), and cancelation of activities (Orc). For each of the above calculi we provide: a structural translation into the code of our abstract machine the operational correspondence between a process and its encoding.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 14 / 27

slide-45
SLIDE 45

Implementing Service Calculi with SOAM

Three service oriented calculi are considered: Session Language (SL); Calculus of Sessions and Pipelines (CaSPiS); and Orc. These calculi provide specific primitives for modelling SOC: sessions (SL and CaSPiS), session delegation (SL), pipelining (Orc and CaSPiS), session nesting and pattern matching (CaSPiS), and cancelation of activities (Orc). For each of the above calculi we provide: a structural translation into the code of our abstract machine the operational correspondence between a process and its encoding.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 14 / 27

slide-46
SLIDE 46

Calculus of Services with Pipelines and Sessions

Overview:

CaSPiS (Calculus of Services with Pipelines and Sessions) is a core calculus that relies on four three concepts:

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 15 / 27

slide-47
SLIDE 47

Calculus of Services with Pipelines and Sessions

Overview:

CaSPiS (Calculus of Services with Pipelines and Sessions) is a core calculus that relies on four three concepts:

1 service definition/invocation

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 15 / 27

slide-48
SLIDE 48

Calculus of Services with Pipelines and Sessions

Overview:

CaSPiS (Calculus of Services with Pipelines and Sessions) is a core calculus that relies on four three concepts:

1 service definition/invocation 2 bi-directional sessioning as a means for structuring client-service

interaction

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 15 / 27

slide-49
SLIDE 49

Calculus of Services with Pipelines and Sessions

Overview:

CaSPiS (Calculus of Services with Pipelines and Sessions) is a core calculus that relies on four three concepts:

1 service definition/invocation 2 bi-directional sessioning as a means for structuring client-service

interaction

3 pipelining as a means of composing services.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 15 / 27

slide-50
SLIDE 50

CaSPiS in a nutshell. . .

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 16 / 27

slide-51
SLIDE 51

CaSPiS in a nutshell. . .

Service definitions and invocations. . .

. . . are rendered respectively as s.P and s.Q: s is a service name P and Q implement the service and the client protocols

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 16 / 27

slide-52
SLIDE 52

CaSPiS in a nutshell. . .

Service definitions and invocations. . .

. . . are rendered respectively as s.P and s.Q: s is a service name P and Q implement the service and the client protocols news.“news item” | news.(?x)x↑Q

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 16 / 27

slide-53
SLIDE 53

CaSPiS in a nutshell. . .

Service definitions and invocations. . .

. . . are rendered respectively as s.P and s.Q: s is a service name P and Q implement the service and the client protocols news.“news item” | news.(?x)x↑Q ↓ (νr)

  • r+ ⊲ “news item” | r− ⊲ (?x)x↑Q
  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 16 / 27

slide-54
SLIDE 54

CaSPiS in a nutshell. . .

Service definitions and invocations. . .

. . . are rendered respectively as s.P and s.Q: s is a service name P and Q implement the service and the client protocols news.“news item” | news.(?x)x↑Q ↓ (νr)

  • r+ ⊲ “news item” | r− ⊲ (?x)x↑Q
  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 16 / 27

slide-55
SLIDE 55

CaSPiS in a nutshell. . .

Service definitions and invocations. . .

. . . are rendered respectively as s.P and s.Q: s is a service name P and Q implement the service and the client protocols news.“news item” | news.(?x)x↑Q ↓ (νr)

  • r+ ⊲ “news item” | r− ⊲ (?x)x↑Q
  • We assume session be polarised to distinguish the two sides of a session

(r+, r−): we let r+ = r− and r− = r+.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 16 / 27

slide-56
SLIDE 56

CaSPiS in a nutshell. . .

Abstractions and concretions. . .

Processes at the two sides of a session can interact with each other by means of: concretions: V sends value V over a session abstractions: (F)P retrieves a value matching pattern F.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 17 / 27

slide-57
SLIDE 57

CaSPiS in a nutshell. . .

Abstractions and concretions. . .

Processes at the two sides of a session can interact with each other by means of: concretions: V sends value V over a session abstractions: (F)P retrieves a value matching pattern F. (νr)

  • r+ ⊲ “news item” | r− ⊲ (?x)x↑Q
  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 17 / 27

slide-58
SLIDE 58

CaSPiS in a nutshell. . .

Abstractions and concretions. . .

Processes at the two sides of a session can interact with each other by means of: concretions: V sends value V over a session abstractions: (F)P retrieves a value matching pattern F. (νr)

  • r+ ⊲ “news item” | r− ⊲ (?x)x↑Q
  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 17 / 27

slide-59
SLIDE 59

CaSPiS in a nutshell. . .

Abstractions and concretions. . .

Processes at the two sides of a session can interact with each other by means of: concretions: V sends value V over a session abstractions: (F)P retrieves a value matching pattern F. (νr)

  • r+ ⊲ “news item” | r− ⊲ (?x)x↑Q

(νr)

  • r+ ⊲ P | r− ⊲ “news item”↑Q
  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 17 / 27

slide-60
SLIDE 60

CaSPiS in a nutshell. . .

Abstractions and concretions. . .

Processes at the two sides of a session can interact with each other by means of: concretions: V sends value V over a session abstractions: (F)P retrieves a value matching pattern F. (νr)

  • r+ ⊲ “news item” | r− ⊲ (?x)x↑Q

(νr)

  • r+ ⊲ P | r− ⊲ “news item”↑Q
  • Return. . .

Values can be returned outside a session to the enclosing environment using the return operator, · ↑.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 17 / 27

slide-61
SLIDE 61

CaSPiS in a nutshell. . .

Abstractions and concretions. . .

Processes at the two sides of a session can interact with each other by means of: concretions: V sends value V over a session abstractions: (F)P retrieves a value matching pattern F. (νr)

  • r+ ⊲ “news item” | r− ⊲ (?x)x↑Q

(νr)

  • r+ ⊲ P | r− ⊲ “news item”↑Q
  • Return. . .

Values can be returned outside a session to the enclosing environment using the return operator, · ↑.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 17 / 27

slide-62
SLIDE 62

CaSPiS in a nutshell. . .

  • Pipeline. . .

Values returned by a session can be used to start new activities. This is achieved using the pipeline operator: P > ˜ x > Q . A new instance of process Q is activated each time P emits a value.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 18 / 27

slide-63
SLIDE 63

CaSPiS in a nutshell. . .

  • Pipeline. . .

Values returned by a session can be used to start new activities. This is achieved using the pipeline operator: P > ˜ x > Q . A new instance of process Q is activated each time P emits a value. r ⊲ “news item”↑Q > z > emailMe.z

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 18 / 27

slide-64
SLIDE 64

CaSPiS in a nutshell. . .

  • Pipeline. . .

Values returned by a session can be used to start new activities. This is achieved using the pipeline operator: P > ˜ x > Q . A new instance of process Q is activated each time P emits a value. r ⊲ “news item”↑Q > z > emailMe.z

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 18 / 27

slide-65
SLIDE 65

CaSPiS in a nutshell. . .

  • Pipeline. . .

Values returned by a session can be used to start new activities. This is achieved using the pipeline operator: P > ˜ x > Q . A new instance of process Q is activated each time P emits a value. r ⊲ “news item”↑Q > z > emailMe.z ↓ r ⊲ Q > z > emailMe.z | emailMe.“news item”

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 18 / 27

slide-66
SLIDE 66

CaSPiS in a nutshell. . .

  • Pipeline. . .

Values returned by a session can be used to start new activities. This is achieved using the pipeline operator: P > ˜ x > Q . A new instance of process Q is activated each time P emits a value. r ⊲ “news item”↑Q > z > emailMe.z ↓ r ⊲ Q > z > emailMe.z | emailMe.“news item”

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 18 / 27

slide-67
SLIDE 67

Encoding CaSPiS in SOAM

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 19 / 27

slide-68
SLIDE 68

Encoding CaSPiS in SOAM

The translation of CaSPiS relies on of two functions: net, that returns the SOAM network associated to a process P; prg, that returns the static program associated to a process.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 19 / 27

slide-69
SLIDE 69

Encoding CaSPiS in SOAM

The translation of CaSPiS relies on of two functions: net, that returns the SOAM network associated to a process P; prg, that returns the static program associated to a process. Function net takes the references to the three queues used for identifying: the session used for retrieving input messages; the session used for delivering output messages; the session used for returning messages. These queues are referenced in prg(P) by variables m−

1 , m+ 1 and m2.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 19 / 27

slide-70
SLIDE 70

Encoding CaSPiS in SOAM

Sessions:

A pair of queues (r+, r−) is associated to each session r:

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 20 / 27

slide-71
SLIDE 71

Encoding CaSPiS in SOAM

Sessions:

A pair of queues (r+, r−) is associated to each session r: net((νr)P, ri, ro, rr) = (νr+)(νr−)(net(P, ri, ro, rr)|r+ : ∅|r− : ∅)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 20 / 27

slide-72
SLIDE 72

Encoding CaSPiS in SOAM

Sessions:

A pair of queues (r+, r−) is associated to each session r: net((νr)P, ri, ro, rr) = (νr+)(νr−)(net(P, ri, ro, rr)|r+ : ∅|r− : ∅)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 20 / 27

slide-73
SLIDE 73

Encoding CaSPiS in SOAM

Sessions:

A pair of queues (r+, r−) is associated to each session r: net((νr)P, ri, ro, rr) = (νr+)(νr−)(net(P, ri, ro, rr)|r+ : ∅|r− : ∅) Process executed within session rp retrieves messages from rp, sends messages in rp and returns values to ro:

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 20 / 27

slide-74
SLIDE 74

Encoding CaSPiS in SOAM

Sessions:

A pair of queues (r+, r−) is associated to each session r: net((νr)P, ri, ro, rr) = (νr+)(νr−)(net(P, ri, ro, rr)|r+ : ∅|r− : ∅) Process executed within session rp retrieves messages from rp, sends messages in rp and returns values to ro: net(rp ⊲ P, ri, ro, rr) = net(P, rp, rp, ro)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 20 / 27

slide-75
SLIDE 75

Encoding CaSPiS in SOAM

Sessions:

A pair of queues (r+, r−) is associated to each session r: net((νr)P, ri, ro, rr) = (νr+)(νr−)(net(P, ri, ro, rr)|r+ : ∅|r− : ∅) Process executed within session rp retrieves messages from rp, sends messages in rp and returns values to ro: net(rp ⊲ P, ri, ro, rr) = net(P, rp, rp, ro)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 20 / 27

slide-76
SLIDE 76

Encoding CaSPiS in SOAM

Sessions:

A pair of queues (r+, r−) is associated to each session r: net((νr)P, ri, ro, rr) = (νr+)(νr−)(net(P, ri, ro, rr)|r+ : ∅|r− : ∅) Process executed within session rp retrieves messages from rp, sends messages in rp and returns values to ro: net(rp ⊲ P, ri, ro, rr) = net(P, rp, rp, ro)

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 20 / 27

slide-77
SLIDE 77

Encoding CaSPiS in SOAM

Service definition and invocation:

These are directly mapped to SOAM service synchronization primitives where input and output queues are created after a synchronisation, while the return is performed in the current out queue: net(a.P, ri, ro, rr) = m2 → ro ⊢ offer(a, m+

1 , m− 1 , prg(P))

net(a.Q, ri, ro, rr) = m2 → ro ⊢ invoke(a, m−

1 , m+ 1 , prg(Q))

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 21 / 27

slide-78
SLIDE 78

Encoding CaSPiS in SOAM

Service definition and invocation:

These are directly mapped to SOAM service synchronization primitives where input and output queues are created after a synchronisation, while the return is performed in the current out queue: net(a.P, ri, ro, rr) = m2 → ro ⊢ offer(a, m+

1 , m− 1 , prg(P))

net(a.Q, ri, ro, rr) = m2 → ro ⊢ invoke(a, m−

1 , m+ 1 , prg(Q))

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 21 / 27

slide-79
SLIDE 79

Encoding CaSPiS in SOAM

Service definition and invocation:

These are directly mapped to SOAM service synchronization primitives where input and output queues are created after a synchronisation, while the return is performed in the current out queue: net(a.P, ri, ro, rr) = m2 → ro ⊢ offer(a, m+

1 , m− 1 , prg(P))

net(a.Q, ri, ro, rr) = m2 → ro ⊢ invoke(a, m−

1 , m+ 1 , prg(Q))

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 21 / 27

slide-80
SLIDE 80

Encoding CaSPiS in SOAM

Pipeline:

Values produced by P are stored in a fresh queue rt. A process continuously retrieves values from rt and executes a copy of Q: net(P > ˜ x > Q, ri, ro, rr) = (νrt)(net(P, ri, rt, rr)|rt : ∅ m+

1 → ro, m− 1 → ri, m2 → rr ⊢

while true do in(rt, ( ?x.fork(prg(Q), skip))))

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 22 / 27

slide-81
SLIDE 81

Encoding CaSPiS in SOAM

Pipeline:

Values produced by P are stored in a fresh queue rt. A process continuously retrieves values from rt and executes a copy of Q: net(P > ˜ x > Q, ri, ro, rr) = (νrt)(net(P, ri, rt, rr)|rt : ∅ m+

1 → ro, m− 1 → ri, m2 → rr ⊢

while true do in(rt, ( ?x.fork(prg(Q), skip))))

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 22 / 27

slide-82
SLIDE 82

Encoding CaSPiS in SOAM

Pipeline:

Values produced by P are stored in a fresh queue rt. A process continuously retrieves values from rt and executes a copy of Q: net(P > ˜ x > Q, ri, ro, rr) = (νrt)(net(P, ri, rt, rr)|rt : ∅ m+

1 → ro, m− 1 → ri, m2 → rr ⊢

while true do in(rt, ( ?x.fork(prg(Q), skip))))

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 22 / 27

slide-83
SLIDE 83

Encoding CaSPiS in SOAM

Pipeline:

Values produced by P are stored in a fresh queue rt. A process continuously retrieves values from rt and executes a copy of Q: net(P > ˜ x > Q, ri, ro, rr) = (νrt)(net(P, ri, rt, rr)|rt : ∅ m+

1 → ro, m− 1 → ri, m2 → rr ⊢

while true do in(rt, ( ?x.fork(prg(Q), skip))))

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 22 / 27

slide-84
SLIDE 84

Encoding CaSPiS in SOAM

Pipeline:

Values produced by P are stored in a fresh queue rt. A process continuously retrieves values from rt and executes a copy of Q: net(P > ˜ x > Q, ri, ro, rr) = (νrt)(net(P, ri, rt, rr)|rt : ∅ m+

1 → ro, m− 1 → ri, m2 → rr ⊢

while true do in(rt, ( ?x.fork(prg(Q), skip))))

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 22 / 27

slide-85
SLIDE 85

Encoding CaSPiS in SOAM

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 23 / 27

slide-86
SLIDE 86

Encoding CaSPiS in SOAM

Theorem (Completeness)

If P→Q then net(P) →∗≡ net(Q).

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 23 / 27

slide-87
SLIDE 87

Encoding CaSPiS in SOAM

Theorem (Completeness)

If P→Q then net(P) →∗≡ net(Q).

Theorem (Correctness)

If net(P) →∗ M then either M ≡ net(Q′) or there exists k > 0 s.t. M → . . . →

  • k

≡ net(Q′) and P →∗ Q with Q ≡ Q′.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 23 / 27

slide-88
SLIDE 88
  • Outline. . .

1

Motivations

2

SOAM: Service Oriented Abstract Machine

3

Implementing Service Calculi with SOAM

4

Concluding Remarks

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 24 / 27

slide-89
SLIDE 89
  • Conclusions. . .

We have introduced SOAM, a service oriented abstract machine that can be used to implement service oriented calculi. SOAM provides low-level primitives for programming service oriented applications. Queues are used for modelling persistent and protected communication lines.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 25 / 27

slide-90
SLIDE 90
  • Conclusions. . .

We have introduced SOAM, a service oriented abstract machine that can be used to implement service oriented calculi. SOAM provides low-level primitives for programming service oriented applications. Queues are used for modelling persistent and protected communication lines. We have used the proposed machine to implement three very different formalisms for service specification: the Session Language (SL), CaSPiS, and Orc. For all of them we have proved that the proposed implementation is

  • perationally correct (sound and complete).
  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 25 / 27

slide-91
SLIDE 91

Future work. . .

We plan to investigate the extensions that are needed to deal with more advanced features of service oriented computing such as

◮ controlled service closures, ◮ compensations, ◮ multiparty synchronization.

We plan to provide a complete prototype implementation of our machine.

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 26 / 27

slide-92
SLIDE 92

Thank You

  • M. Loreti (DSI@FI)

Provably correct implementations of services TGC08 27 / 27