Abstractness of Continuation Semantics for Asynchronous Concurrency - - PowerPoint PPT Presentation

abstractness of continuation semantics for asynchronous
SMART_READER_LITE
LIVE PREVIEW

Abstractness of Continuation Semantics for Asynchronous Concurrency - - PowerPoint PPT Presentation

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion Abstractness of Continuation Semantics for Asynchronous Concurrency Gabriel Ciobanu, Eneia Nicolae Todoran A.I. Cuza University, Iasi,


slide-1
SLIDE 1

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Abstractness of Continuation Semantics for Asynchronous Concurrency

Gabriel Ciobanu, Eneia Nicolae Todoran

”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania

Federated Logic Conference 2018 Workshop Domains

Oxford, UK July 7-8, 2018

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-2
SLIDE 2

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

1

Introduction

2

Continuations for Concurrency

3

Weak Abstractness

4

An Asynchronous Formalism

5

Conclusion

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-3
SLIDE 3

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Motivation and Aim

A continuation is a semantic representation of the rest a computation [Stratchey and Wadsworth 1974] Traditional continuations can express: non-local exits, coroutines, even multitasking and ADA-like rendez-vous

However, the traditional continuations do not work well enough in the presence of concurrency [Hieb, Dybvig and Anderson 1994]

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-4
SLIDE 4

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Motivation and Aim

In [Todoran 2000, Ciobanu and Todoran 2014] we introduced a continuation semantics for concurrency (CSC) CSC can express concurrent composition as well as various communication and synchronization mechanisms

Intuitively, CSC is a denotational scheduler

In the CSC approach continuations are application-specific structures of computations

Rather than the functions to some answer used in the classic technique of continuations

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-5
SLIDE 5

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Motivation and Aim

In this talk we survey some applications of CSC and we investigate the abstractness of CSC We present an optimality criterion specific of continuation semantics that we name weak abstractness which

Relaxes the completeness condition Preserves the correctness condition of the classic full abstractness criterion [Milner 1977]

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-6
SLIDE 6

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Continuation Semantics for Traditional Concurrent Programming Concepts

CSP-like synchronous communication Warren’s Andorra Model and asynchronous communication [Todoran and Papaspyrou 2000] [Todoran 2000] p ::= (y = x; )∗x x ::= g | ≪ o ≫ | l | #l CSP Extended with Multiple | y | x x Channels Communication g ::= a | fail [Ciobanu and Todoran 2015] l ::= ǫ | g?x (+g?x)∗

  • ::= ǫ | g : x (+g : x)∗

j ::= c?v | j&j a ::= v := e | c!e | j s ::= a | y | s; s | s + s | s s ≪ o ≫ a a1?x1 + a2?x2 l1 · · · ln c1!e1 · · · cn!en (c1?v1& · · · cn?vn) ≡ (v1, . . . , vn := e1, . . . , en)

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-7
SLIDE 7

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Continuation Passing Semantics for Nature Inspired Formalisms

Membrane Computing Spiking Neural P-Systems [Ciobanu and Todoran 2017] [Ciobanu and Todoran 2018] ρ = (D; x), x = o1 o4 ρ′ = (D′, x′), D = membrane M0 { x′ = send(a2k−1, {N1}) send(a, {N3}) [o1, o4] ⇒ o2 o4; [o2] ⇒ o3 new(M1, l1, o1 o5); D′ = neuron N0 { rǫ | {N1, N2, N3} } [o2] ⇒ o4; neuron N1 { a+/[a] → a; 2 | {N2} } [o3] ⇒ in(l1, o5) o5; neuron N2 { [ak] → a; 1 | {N3} } [o4, o4, o5] ⇒ o5; }; neuron N3 { [a] → a; 0 | {N0} } } membrane M1 { [o1] ⇒ o4 out(o4); [o5, o5] ⇒ δ }. }

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-8
SLIDE 8

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

On the Abstractness of Continuation Semantics

The full abstractness condition is in general difficult to establish [Milner 1977]

Even more difficult in continuation semantics

We are not aware of any full abstractness result for a concurrent language designed with continuations Continuation-passing semantics for sequential languages are not fully abstract [Cartwright, Curien & Felleisen 1994]

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-9
SLIDE 9

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

On the Abstractness of Continuation Semantics

Weak abstractness may be useful when full abstractness is difficult (or impossible) to achieve We offer a denotational semantics [ [·] ] for an asynchronous formalism; we use a domain of continuations D = Cont → P Cont = · · · D · · · The semantics is designed by using metric domains [De Bakker and Zucker 1982, America and Rutten 1989]

Like the classic domains [Scott 1976, Scott 1982], metric spaces can also be used to express denotational semantics We prove that [ [·] ] is weakly abstract w.r.t. an O[ [·] ]

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-10
SLIDE 10

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Classic Full Abstractness [Milner 1977]

A denotational semantics D : L → D is said to be fully abstract with respect to a (corresponding) operational semantics O : L → O if

D it is correct with respect to O

∀x1, x2 ∈ L[D(x1) = D(x2) ⇒ ∀S[O(S(x1)) = O(S(x2))]]

D and complete with respect to O

∀x1, x2 ∈ L[D(x1) = D(x2) ⇒ ∃S[O(S(x1)) = O(S(x2))]]

(S is an L syntactic context)

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-11
SLIDE 11

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Abstractness of Continuation Semantics

In continuation semantics, D : L → D, D = Cont → F, the completeness condition (of full abstractness) is:

∀x1, x2 ∈ L[ (∃γ ∈ Cont[D(x1)γ = D(x2)γ]) ⇒ (∃S[O(S(x1)) = O(S(x2))]) ]

In continuation semantics for concurrency (CSC) [Todoran 2000, Ciobanu and Todoran 2014] we cannot prove this condition for the whole domain of continuations

A weaker condition can be established if we restrict the investigation to the class of denotable continuations

Which is closed under arbitrary computations

This condition we call weak completeness

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-12
SLIDE 12

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

The Class of Metric Domains for CSC

A metric denotational domain of CSC is given as the unique solution of an equation [America and Rutten 1989]

D ∼ = Γ Γ

1

→F

The class (Γ Γ ∈)DCONT of domains for CSC is:

Γ Γ ::= 1

2 · D | M → Γ

Γ | M × Γ Γ | M + Γ Γ | Γ Γ × Γ Γ | Γ Γ + Γ Γ

(M is an arbitrary set (m ∈)M endowed with the discrete metric)

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-13
SLIDE 13

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Resumptions and Denotable Continuations

In the CSC approach a continuation is a structured configuration of (partially evaluated) denotations Following [De Bakker and De Vink 1996] we use the term resumption as an operational counterpart of the term continuation Let (x ∈)X be a fixed set. We define a class (R ∈)RES(X)

  • f sets of resumptions for X by:

R ::= X | M → R | M × R | M + R | R × R | R + R

(here (m ∈)M is an arbitrary set)

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-14
SLIDE 14

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Resumptions and Denotable Continuations

For any language (x ∈)L and CSC domain Γ Γ we can construct a corresponding set of resumptions by a homomorphism resL(·) : DCONT → RES(L)

resL( 1

2 · D) = L

resL(M → Γ Γ) = M → resL(Γ Γ), resL(M × Γ Γ) = M × resL(Γ Γ) resL(M + Γ Γ) = M + resL(Γ Γ) resL(Γ Γ1 × Γ Γ2) = resL(Γ Γ1) × resL(Γ Γ2) resL(Γ Γ1 + Γ Γ2) = resL(Γ Γ1) + resL(Γ Γ2)

resL(·) maps a complete metric space to a plain set

M is a metric space, given by an arbitrary set (m ∈)M endowed with the discrete metric

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-15
SLIDE 15

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

The Class of Denotable Continuations

Let (x ∈)L be a language. Let D : L → D, D ∼ = Γ Γ

1

→F, be a denotational semantics of L designed with CSC

(γ ∈)ΓCls = {[ [ [c] ] ]L

Γ Γ | c ∈ resL(Γ

Γ)} is the class of denotable continuations for D, where for any Γ Γ ∈ DCONT , [ [ [·] ] ]L

Γ Γ : resL(Γ

Γ) → Γ Γ is given by

[ [ [x ] ] ]L

1 2 · D

= D(x) [ [ [λm . c] ] ]L

M→Γ Γ

= λm . [ [ [c] ] ]L

Γ Γ

[ [ [(m, c)] ] ]L

M×Γ Γ

= (m, [ [ [c] ] ]L

Γ Γ)

[ [ [(i, c)] ] ]L

M+Γ Γ2

= (1, c) if i = 1 (2, [ [ [c] ] ]L

Γ Γ2)

if i = 2 [ [ [(c1, c2)] ] ]L

Γ Γ1×Γ Γ2

= ([ [ [c1] ] ]L

Γ Γ1, [

[ [c2] ] ]L

Γ Γ2)

[ [ [(i, c)] ] ]L

Γ Γ1+Γ Γ2

= (1, [ [ [c] ] ]L

Γ Γ1)

if i = 1 (2, [ [ [c] ] ]L

Γ Γ2)

if i = 2

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-16
SLIDE 16

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

The (Metric) Domain of Denotable Continuations

Let (γ ∈)ΓDom = co(ΓCls|Γ Γ) be the metric completion of ΓCls with respect to Γ Γ constructed as in the following Remark.

We call ΓDom the domain of denotable continuations for D. Remark Let (M, d) be a complete metric space and let X be a subset of M, X ⊆ M. We use the notation co(X|M) to represent the set co(X|M)

not.

= {x | x ∈ M, x = limi xi, ∀i ∈ N : xi ∈ X, (xi)i is a Cauchy sequence in X} where the limits are taken with respect to d (as (M, d) is complete limi xi ∈ M). If we endow co(X|M) with dco(X|M) = d↾co(X|M) and X with dX = d↾X, then (co(X|M), dco(X|M)) is a metric completion of (X, dX). Recall that each metric space has a completion which is unique up to isometry

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-17
SLIDE 17

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

The (Metric) Domain of Denotable Continuations

We have

ΓCls ✁ ΓDom, and (by construction) ΓDom ✁ Γ Γ, but in general, ΓDom = Γ Γ

((M, d) ✁ (M′, d′), whenever M ⊆ M′ and d′↾M = d)

In general we do not know whether ΓCls itself is a complete metric space (where it is, ΓCls = ΓDom) For a simple asynchronous language, in [Ciobanu and Todoran 2012] it is constructed a continuation γǫ ∈ Γ Γ such that d(γ, γǫ) ≥ 1

2, for any γ ∈ ΓDom Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-18
SLIDE 18

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Weak Abstractness for CSC

Definition Let (x ∈)L be a language and let D : L → D, D ∼ = Γ Γ

1

→F, be a denotational semantics of L designed with CSC. Let also O : L → O be an operational semantics of L and S a typical element of the class of syntactic contexts for L. (a) D is correct with respect to O iff

∀x1, x2 ∈ L[D(x1) = D(x2) ⇒ ∀S[O(S(x1)) = O(S(x2))]]

(b) Let (γ ∈)ΓDom be the domain of denotable continuations for D. We say that D is weakly complete with respect to O iff

∀x1, x2 ∈ L[(∃γ ∈ ΓDom[D(x1)γ = D(x2)γ]) ⇒ (∃S[O(S(x1)) = O(S(x2))])]

(c) We say that D is weakly abstract with respect to O iff D is correct and weakly complete with respect to O.

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-19
SLIDE 19

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Weak Abstractness for CSC

It suffices to verify the weak completeness property for the class of denotable continuations ΓCls

If weak completeness can be established for ΓCls then it holds for the whole domain of denotable continuations ΓDom Lemma Let (x ∈)L be a language and let D : L → D, D ∼ = Γ Γ

1

→F, be a denotational semantics of L designed with CSC. Let also O : L → O be an operational semantics of L and S a typical element of the class

  • f syntactic contexts for L. D is weakly complete w.r.t. O iff

∀x1, x2 ∈ L[(∃γ ∈ ΓCls[D(x1)γ = D(x2)γ]) ⇒ (∃S[O(S(x1)) = O(S(x2))])] where ΓCls is the class of denotable continuations for D.

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-20
SLIDE 20

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

The Language L - a Paradigm for Asynchronous Communication [Boer, Kok, Palamidessi, Rutten 1993]

Definition (a) (Statements) x(∈ X) ::= a | y | x + x | x; x | x ⌊ ⌊ x | x x (b) (Guarded statements) g(∈ G) ::= a | g + g | g; x | g⌊ ⌊ x | gg (c) (Declarations, Programs) (D ∈)Decl = Y →G, (ρ ∈)L = Decl × X (a ∈)Act is a set of atomic actions (δ ∈ Act) (y ∈)Y is a set of recursion variables I : Act → Σ → ({↑} ∪ Σ) is an interpretation function

If I(a)(σ) =↑ then a is suspended in σ (I(δ)(σ) =↑, ∀σ ∈ Σ)

Instances of the paradigm: asynchronous CCS, asynchronous CSP [Jifeng, Josephs, Hoare 1990], concurrent constraint programming [Saraswat 1993], await statement [Owicki, Gries 1976]

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-21
SLIDE 21

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Structure of Continuations (and Resumptions) for L

(α ∈)A = {1, 2}∗ - identifiers (ǫ is the empty sequence) α ≤ α’ iff α′ = α · i1 · · · in (n ≥ 0)

  • partial order

Notation for partially ordered bags (multisets) of computations { |X| } = Pfin(A) × (A → X) A continuation is a cactus stack (finite tree, active elements at leaves) ν : (A × { |X| }) → Bool (ν(α, (π, θ)) iff α is a leaf in ({α} ∪ π, ≤{α}∪π))

[ [(x′ x′′); x ] ] ⇒

α⋅1 → [[ x’ ]] α⋅2 → [[ x’’ ]] α → [[ x ]]

Cannot define multisets using (X → N)

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-22
SLIDE 22

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Operational Semantics O[ [·] ]

Semantic universe, configurations, (consistent) resumptions (p ∈)P = Pnco(Σ∗ ∪ Σ∗ · {δ} ∪ Σω) Conf = (X × CRes′ × Σ) ∪ (KRes × Σ) CRes = A × KRes, (k ∈)KRes = { |X | }, k0 = (∅, λα . δ) ∈ KRes CRes′ = {(α, k) | α ∈ A, k ∈ KRes, ν(α, k)} Operational semantics O[ [·] ] : X → Σ → P (O : Conf → P) O[ [x] ](σ) = O(x, (α0, k0), σ) O(t) =    {Λ} if t terminates {δ} if t blocks {σ · O(k, σ) | t → (k, σ)} otherwise

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-23
SLIDE 23

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Transition System Specification for L

(a, (α, k), σ) → (k, σ′) if I(a)(σ) = σ′ (y, (α, k), σ) ր (D(y), (α, k), σ) (x1 + x2, (α, k), σ) ր (x1, (α, k), σ) (x1 + x2, (α, k), σ) ր (x2, (α, k), σ) (x1; x2, (α, k), σ) ր (x1, (α · 1, [k | α → x2]), σ) (x1⌊ ⌊ x2, (α, k), σ) ր (x1, (α · 1, [k | α · 2 → x2]), σ) (x1 x2, (α, k), σ) ր (x1, (α · 1, [k | α · 2 → x2]), σ) (x1 x2, (α, k), σ) ր (x2, (α · 1, [k | α · 2 → x1]), σ) (k, σ) ր (k(α), (α, k \ {α}), σ) ∀α ∈ max(id(k))

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-24
SLIDE 24

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

CSC Domains and Evaluation Mechanism

CSC domains (ϕ ∈)D ∼ = Cont

1

→Σ →P (γ ∈)Cont = A × Kont (κ ∈)Kont = { | 1

2 · D|

} CSC evaluation mechanism Cont - open continuations (evaluation contexts) Kont - closed continuations (manipulated by the scheduler) ”Evaluate-normalize-schedule” loop

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-25
SLIDE 25

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Auxiliary Operators

Nondeterministic choice (+ : (P × P) → P) p1 + p2 = {q | q ∈ p1 ∪ p2, q = δ} ∪ {δ | δ ∈ p1 ∩ p2} Denotational scheduler kc : Kont →Σ →P kc(κ)(σ) = if (id(κ) = ∅) then {Λ} else +α∈max(id(κ)) κ(α)(α, κ \ {α})(σ) [ [x ] ](α, κ)(σ) =c p is an abbreviation for: [ [x ] ](α, κ)(σ) = p if ν(α, κ) {δ}

  • therwise

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-26
SLIDE 26

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Denotational Semantics [ [·] ] : X → D (D[ [·] ] : X → Σ → P)

[ [a] ](α, κ)(σ) =c if (I(a)(σ) =↑) then {δ} else I(a)(σ) · kc(κ)(I(a)(σ)) [ [y ] ](α, κ)(σ) =c [ [D(y)] ](α, κ)(σ) [ [x1 + x2] ](α, κ)(σ) =c [ [x1] ](α, κ)(σ) + [ [x2] ](α, κ)(σ) [ [x1; x2] ](α, κ)(σ) =c [ [x1] ](α · 1, [κ | α → [ [x2] ]])(σ) [ [x1⌊ ⌊ x2] ](α, κ)(σ) =c [ [x1] ](α · 1, [κ | α · 2 → [ [x2] ]])(σ) [ [x1 x2] ](α, κ)(σ) =c [ [x1] ](α · 1, [κ | α · 2 → [ [x2] ]])(σ) + [ [x2] ](α · 1, [κ | α · 2 → [ [x1] ]])(σ) D[ [x] ] = [ [x ] ](α0, κ0), α0 = ǫ, κ0 = (∅, λα.[ [δ] ]) [ [a] ](α, κ)(σ) =c if (I(a)(σ) =↑) then {δ} else I(a)(σ) · kc(κ)(I(a)(σ))

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-27
SLIDE 27

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Isomorphic Resumptions

Definition Two open resumptions (α1, k1), (α2, k2) ∈ CRes are isomorphic, written (α1, k1) ∼ = (α2, k2), iff either (1) or (2) is satisfied: (1) ¬ν(α1, k1) and ¬ν(α2, k2) ((α1, k1) and (α2, k2) are both inconsistent) (2) ν(α1, k1) and ν(α2, k2) ((α1, k1) and (α2, k2) are both consistent) and there exists a bijection µ : ({α1} ∪ id(k1)) → ({α2} ∪ id(k2)) such that:

(i) µ(α1) = α2 (ii) µ(α′) ≤ µ(α′′) ⇔ α′ ≤α′′, ∀α′, α′′ ∈ ({α1} ∪ id(k1)) (iii) k2(µ(α′)) = k1(α′), ∀α′ ∈ id(k1)

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-28
SLIDE 28

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Class of Denotable Continuations

Definition We define [ [ [·] ] ] : KRes → Kont, [ [ [k ] ] ] = (id(k), λα.[ [k(α)] ]). The class of (open) denotable continuations for L is ContCls = {(α, [ [ [k ] ] ]) | (α, k) ∈ CRes} = A × KontCls where (κ ∈)KontCls = {[ [ [k ] ] ] | k ∈ KRes}.

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-29
SLIDE 29

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Syntactic Contexts for L

Definition The class of syntactic contexts for L is given by: S ::= (·) | a | y | S; S | S + S | SS | S⌊ ⌊S S(x) is the result of substituting x for all occurrences of (·) in S. Let x, x ∈ X. When [ [S(x)] ](α, [ [ [k ] ] ]) = [ [S(x)] ](α, [ [ [k ] ] ]) (∗) for for all contexts S and for all isomorphic resumptions (α, k) ∼ = (α, k) (∈ CRes), we write: x ≃ x

(∗) implies D[

[S(x)] ] = D[ [S(x)] ], for all contexts S

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-30
SLIDE 30

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Concurrency Laws in Continuation Semantics [Ciobanu and Todoran 2014]

x1 + x2 ≃ x2 + x1 (x1 + x2) + x3 ≃ x1 + (x2 + x3) x + x ≃ x (x1 + x2); x3 ≃ x1; x3 + x2; x3 x1; (x2 + x3) ≃ x1; x2 + x1; x3 x1; (x2; x3) ≃ (x1; x2); x3 x + δ ≃ x δx ≃ δ x1 x2 ≃ x1⌊ ⌊ x2 + x2⌊ ⌊ x1 a⌊ ⌊ x ≃ a; x a; x1⌊ ⌊ x2 ≃ a; (x1 x2) (x1 + x2)⌊ ⌊ x3 ≃ x1⌊ ⌊ x3 + x2⌊ ⌊ x3

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-31
SLIDE 31

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Concurrency Laws over the Domain of Denotable Continuations

We do not know whether the class ContCls of denotable continuations is a complete metric space However, in CSC computations are (nonexpansive and thus) continuous functions, because D ∼ = Cont

1

→Σ → P It is reasonable to study semantic properties in the metric completion of the class ContCls, i.e., in the domain of denotable continuations ContDom = co(ContCls|Cont)

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-32
SLIDE 32

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Concurrency Laws over the Domain of Denotable Continuations

Definition We say that two open denotable continuations (α, κ), (α, κ) ∈ ContDom are isomorphic, and we write (α, κ) ∼ = (α, κ), iff there exist sequences (αi, ki)i, (αi, ki)i, (with (αi, ki), (αi, ki) ∈ CRes, ∀i ∈ N) such that: (α, κ) = limi(αi, [ [ [ki ] ] ]), (α, κ) = limi(αi, [ [ [ki ] ] ]), and (αi, ki) ∼ = (αi, ki), ∀i ∈ N.

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-33
SLIDE 33

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Concurrency laws hold for the whole domain ContDom

  • f denotable continuations

Let x, x ∈ X. When [ [S(x)] ](α, κ) = [ [S(x)] ](α, κ) for all L syntactic contexts S and for all isomorphic denotable continuations (α, κ) ∼ = (α, κ) ∈ ContDom, we write: x ∼ x Proposition x ≃ x ⇒ x ∼ x, for all x, x ∈ X. Remark Not all continuations are denotable: ContCls ✁ ContDom and ContDom ✁ Cont, but ContDom = Cont [Ciobanu and Todoran 2012]. As a consequence, [ [·] ] is not fully abstract.

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-34
SLIDE 34

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Weak Abstractness for L

Recall that D ∼ = Cont

1

→(Σ → P), Cont = A × { | 1

2 · D|

}. If we expand the notation { | · | } we get (Cont ∈ DCONT ): Cont = A × (Pfin(A) × (A → 1

2 · D))

The corresponding set of resumptions is (CRes ∈ RES(X)) CRes = resX(Cont) = A × (Pfin(A) × (A → X)) The class of denotable continuations is ContCls = {[ [ [(α, k)] ] ]X

Cont | (α, k) ∈ resX(Cont)}

= {(α, [ [ [k ] ] ]) | (α, k) ∈ CRes}. Lemma For any x ∈ X, (α, k) ∈ CRes there is an L syntactic context S such that: [ [x ] ](α, [ [ [k ] ] ]) = D[ [S(x)] ] = [ [S(x)] ](α0, κ0). Furthermore, S does not depend on x, it only depends on (α, k).

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-35
SLIDE 35

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Weak Abstractness for L

Theorem The denotational semantics [ [·] ] of L is weakly abstract with respect to the operational semantics O[ [·] ].

Proof. One can check that D[ [x] ] = O[ [x] ], ∀x ∈ X, which implies correctness of [ [·] ] with respect to O[ [·] ] [Todoran 2000, Ciobanu and Todoran 2012] For weak completeness, suppose x1, x2 ∈ X, (α, k) ∈ CRes are such that [ [x1] ](α, [ [ [k ] ] ]) = [ [x2] ](α, [ [ [k ] ] ]). By previous Lemma ∃S such that

D[ [S(x1)] ] = [ [x1] ](α, [ [ [k ] ] ]) = [ [x2] ](α, [ [ [k ] ] ]) = D[ [S(x2)] ]

Hence, O[ [S(x1)] ] = D[ [S(x1)] ] = D[ [S(x2)] ] = O[ [S(x2)] ], We conclude that [ [·] ] is (weakly complete and thus) weakly abstract with respect to O[ [·] ].

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-36
SLIDE 36

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

Concluding Remarks and Future Research

We introduce an optimality criterion specific of continuation semantics that we call weak abstractness

Which relaxes the completeness condition of the classic full abstractness criterion [Milner 1977].

To illustrate the approach we presented a weakly abstract continuation semantics for an asynchronous language

We believe similar weak abstractness results can be

  • btained for various advanced concurrent control concepts

Andorra Model [Todoran and Papaspyrou 2000] Multiparty interactions [Ciobanu and Todoran 2015] Nature inspired formalisms [Ciobanu and Todoran 2017]

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-37
SLIDE 37

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

References

P . America, J.J.M.M. Rutten, ”Solving reflexive domain equations in a category of complete metric spaces,”

  • J. of Comp. Syst. Sci, vol. 39(3), pp. 343–375, 1989.

J.W. De Bakker, J. Zucker, ”Processes and the Denotational Semantics of Concurrency,” Information and Control, vol. 54, pp. 70–120, 1982. J.W. De Bakker, E.P . De Vink, Control Flow Semantics, MIT Press, 1996.

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-38
SLIDE 38

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

References

J.C.M. Baeten, W.P . Weijland, Process Algebra, Cambridge Univ. Press, 1990. F.S. De Boer, J.N. Kok, C. Palamidessi, J.J.M.M. Rutten, ”A Paradigm for Asynchronous Communication and its Application to Concurrent Constraint Programming,” In K.R. Apt, J.W. De Bakker, J.J.M.M. Rutten, eds., Logic Programming Languages: Constraints, Functions and Objects, pp. 82-114, MIT Press, 1993. S.D. Brookes, ”Full Abstraction for a Shared-Variable Parallel Language,”’ Information and Computation, vol. 127(2), pp. 145–163, 1996.

  • R. Cartwright, P

.L. Curien, M. Felleisen, Fully Abstract Semantics for Observably Sequential Languages, Information and Computation, vol. 111(2), 297401, 1994.

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-39
SLIDE 39

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

References

  • G. Ciobanu and E.N. Todoran,

”Abstract Continuation Semantics for Asynchronous Concurrency,” Technical Report FML-12-02, Romanian Academy, 2012. Available at

http://iit.iit.tuiasi.ro/TR/reports/fml1202.pdf

  • G. Ciobanu, E.N. Todoran,

”Continuation Semantics for Asynchronous Concurrency,” Fundamenta Informaticae, vol. 131(3-4), pp. 373–388, 2014.

  • G. Ciobanu, E.N. Todoran,

”Continuation Semantics for Concurrency with Multiple Channels Communication,” Proceedings of 17th International Conference on Formal Engineering Methods (ICFEM 2015), Lecture Notes in Computer Science, vol. 9407, pp. 400–416, Springer, 2015.

  • G. Ciobanu, E.N. Todoran,

”Denotational Semantics of Membrane Systems by using Complete Metric Spaces,” Theoretical Computer Science, Elsevier, 2017 (in press).

  • G. Ciobanu, E.N. Todoran,

A Semantic Investigation of Spiking Neural P-Systems, 19th Int. Conf. on Membrane Computing (CMC 19), Dresden, 2018 (accepted).

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-40
SLIDE 40

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

References

  • O. Danvy,

”On Evaluation Contexts, Continuations and the Rest of the Computation,” Proceedings of 4th ACM SIGPLAN Continuations Workshop, pp. 13–23, 2004.

  • R. Hieb, R. K. Dybvig, C.W. Anderson,

Subcontinuations, Lisp and Symbolic Computation, vol.7(1), 83110, 1994.

  • K. Honda, M. Tokoro,

”An Object Calculus for Asynchronous Communication,” Lecture Notes in Computer Science, vol. 512, pp. 133–147, Springer, 1991.

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-41
SLIDE 41

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

References

  • H. Jifeng, M. Josephs, C.A.R. Hoare.

A theory of synchrony and asynchrony. In Proc. of IFIP Working Conference on Programming Concepts and Methods, pp. 459-478, 1990.

  • R. Milner,

”Fully Abstract Models of Typed λ-Calculi,” Theoretical Computer Science, vol. 4, pp. 1–22, 1977.

  • S. Owicki, D. Gries.

An Axiomatic Proof Technique for Parallel Programs. Acta Informatica, 6:319–340, 1976.

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-42
SLIDE 42

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

References

  • C. Palamidessi,

”Comparing the Expressive Power of the Synchronous and the Asynchronous π-Calculus,”

  • Math. Structures in Comp. Sci., vol. 13(5), pp. 685–719, 2003.

J.J.M.M. Rutten, ”Semantic Correctness for a Parallel Object Oriented Language,” SIAM Journal of Computing, vol. 19(2), pp. 341–383, 1990.

  • V. Saraswat.

Concurrent constraint programming. MIT Press, 1993. D.S. Scott. Data Types as Latices. SIAM J. Comput., vol. 5, pp. 522-587, 1976. D.S. Scott. Domains for denotational semantics.

  • Proc. 9th ICALP, pp. 577-613, LNCS 140, 1982.

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency

slide-43
SLIDE 43

Introduction Continuations for Concurrency Weak Abstractness An Asynchronous Formalism Conclusion

References

  • C. Strachey and C.P

. Wadsworth, Continuations: A Mathematical Semantics for Handling Full Jumps, Higher-Order and Symbolic Computation, vol. 13(1/2), pp. 135152, 2000. Reprint of the technical monograph PRG-11, Oxford University. E.N. Todoran, ”Metric Semantics for Synchronous and Asynchronous Communication: a Continuation-based Approach,” Electronic Notes in Theoretical Computer Science, vol. 28, pp. 101–127, Elsevier, 2000. E.N. Todoran and N. Papaspyrou, ”Continuations for Parallel Logic Programming,” Proceedings of the 2nd International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (PPDP 2000), pp. 257–267, ACM Press, 2000.

Gabriel Ciobanu, Eneia Nicolae Todoran ”A.I. Cuza” University, Iasi, Technical University, Cluj-Napoca, Romania Abstractness of Continuation Semantics for Asynchronous Concurrency