On the Expressiveness of Attribute-based Communication

31
www.quanticol.eu On the Expressiveness of Attribute-based Communication Yehia Abd Alrahman, Joint work with R. De Nicola , M. Loreti January 29, 2016

Transcript of On the Expressiveness of Attribute-based Communication

Page 1: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

On the Expressiveness of Attribute-basedCommunication

Yehia Abd Alrahman,

Joint work withR. De Nicola , M. Loreti

January 29, 2016

Page 2: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Outline

1 Collective Adaptive Systems

2 AbC: A Process Calculus for CAS

3 Encoding other communication paradigms

4 Ongoing and Future work

Page 3: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Collective Adaptive Systems - CAS

CAS are software-intensive systems featuring� massively interconnected systems that are physically distributed.

� operating in open and non-deterministic environments

� dynamically adapting to new requirements and environmentalconditions

The Key Challenge of software development for CAS

Is the management of a transition from systems comprising relativelyisolated, small-scale elements to large-scale, massively interconnectedsystems that are physically distributed.

Page 4: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Message Passing Limitations

� Is not always practical (massive no.of distributed components ina small space).

� models are very detailed (all contributing components arespecified). shared space?

� local interactions of one component does not affect the others(limited adaptation).

� Consequently, does not scale well to model CAS!

Page 5: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Ants Emergent Behavior

Modeling this behavior in traditional approaches is hardly possible.

Page 6: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Ants Emergent Behavior

Modeling this behavior in traditional approaches is hardly possible.

Page 7: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Learned Lessons

� a system-as-a-whole needs to be considered more than simplythe sum of its parts.

� system models should be parametric to their workingspace/environment.

� individual sensing/modifying of the shared space/environmentmight influence co-located components (without explicitinteraction).

� individual components should have a window to their workingspace for sensing/modifying

The proposed approach

We have defined the AbC calculus with a minimal set of primitivesthat rely on attribute-based communication.

Page 8: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Learned Lessons

� a system-as-a-whole needs to be considered more than simplythe sum of its parts.

� system models should be parametric to their workingspace/environment.

� individual sensing/modifying of the shared space/environmentmight influence co-located components (without explicitinteraction).

� individual components should have a window to their workingspace for sensing/modifying

The proposed approach

We have defined the AbC calculus with a minimal set of primitivesthat rely on attribute-based communication.

Page 9: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

AbC through a running example

Case Study: video. . .

Page 10: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

AbC Components

(Components) C ::= Γ :P | C1‖C2 | νxC

� Single component Γ :P – Γ denotes sets of attributes and Pprocesses

� Parallel composition ‖ – of components

� Name restriction νx (to delimit the scope of name x) – inC1‖(νx)C2, name x is invisible from within C1

Running example (step 1/5)

� Each ant is modeled as an AbC component (Anti ) of thefollowing form (Γi :PA).

� Ants execute in parallel and collaborate.

Ant1‖ . . . ‖Antn

Page 11: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

AbC Components

(Components) C ::= Γ :P | C1‖C2 | νxC

� Single component Γ :P – Γ denotes sets of attributes and Pprocesses

� Parallel composition ‖ – of components

� Name restriction νx (to delimit the scope of name x) – inC1‖(νx)C2, name x is invisible from within C1

Running example (step 1/5)

� Each ant is modeled as an AbC component (Anti ) of thefollowing form (Γi :PA).

� Ants execute in parallel and collaborate.

Ant1‖ . . . ‖Antn

Page 12: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

AbC Processes

P ::= 0 | Act.P | 〈Π〉P | P1 + P2 | P1|P2 | K� 〈Π〉P – blocks P until the evaluation of Π under the local

environment becomes true.

� Act – communication and attribute update actions

Running example (step 2/5)

PA running on an ant has the following form:

PA , (Worker + Supplier)|Move

Page 13: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

AbC Processes

P ::= 0 | Act.P | 〈Π〉P | P1 + P2 | P1|P2 | K� 〈Π〉P – blocks P until the evaluation of Π under the local

environment becomes true.

� Act – communication and attribute update actions

Running example (step 2/5)

PA running on an ant has the following form:

PA , (Worker + Supplier)|Move

Page 14: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Example Cont.

AbC Actions

Act ::= Π(x) | (E )@Π | [a 7→ E ]

Running example (step 3/5)

Worker , 〈this.Istomach = 0% ∧ this.role = worker〉(this.odour ,Freq)@(Sstomach 6= 0%).((y = meal)(x , y).[this.Istomach 7→ 100%]()@ff.Follow+ Worker )

Follow , [this.direction 7→ this.attractive, this.state 7→ move]()@ff.Dispose

Move , 〈this.state 6= stop〉()@ff.Move

Page 15: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Example Cont.

AbC Actions

Act ::= Π(x) | (E )@Π | [a 7→ E ]

Running example (step 3/5)

Worker , 〈this.Istomach = 0% ∧ this.role = worker〉(this.odour ,Freq)@(Sstomach 6= 0%).((y = meal)(x , y).[this.Istomach 7→ 100%]()@ff.Follow+ Worker )

Follow , [this.direction 7→ this.attractive, this.state 7→ move]()@ff.Dispose

Move , 〈this.state 6= stop〉()@ff.Move

Page 16: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Example Cont.

AbC Actions

Act ::= Π(x) | (E )@Π | [a 7→ E ]

Running example (step 3/5)

Worker , 〈this.Istomach = 0% ∧ this.role = worker〉(this.odour ,Freq)@(Sstomach 6= 0%).((y = meal)(x , y).[this.Istomach 7→ 100%]()@ff.Follow+ Worker )

Follow , [this.direction 7→ this.attractive, this.state 7→ move]()@ff.Dispose

Move , 〈this.state 6= stop〉()@ff.Move

Page 17: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Example Cont.

AbC Actions

Act ::= Π(x) | (E )@Π | [a 7→ E ]

Running example (step 3/5)

Worker , 〈this.Istomach = 0% ∧ this.role = worker〉(this.odour ,Freq)@(Sstomach 6= 0%).((y = meal)(x , y).[this.Istomach 7→ 100%]()@ff.Follow+ Worker )

Follow , [this.direction 7→ this.attractive, this.state 7→ move]()@ff.Dispose

Move , 〈this.state 6= stop〉()@ff.Move

Page 18: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Running example cont.

Running example (step 4/5)

Dispose , 〈this.found 6= tt ∧ this.nest 6= tt〉()@ff.Dispose +

〈this.found = tt〉[this.state 7→ stop, this.found 7→ ff,this.Istomach 7→ 100%, this.Sstomach 7→ 100%]()@ff.Follow +

〈this.nest = tt〉Supplier

Page 19: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Running example cont.

Running example (step 4/5)

Dispose , 〈this.found 6= tt ∧ this.nest 6= tt〉()@ff.Dispose +

〈this.found = tt〉[this.state 7→ stop, this.found 7→ ff,this.Istomach 7→ 100%, this.Sstomach 7→ 100%]()@ff.Follow +

〈this.nest = tt〉Supplier

Page 20: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Running example cont.

Running example (step 4/5)

Dispose , 〈this.found 6= tt ∧ this.nest 6= tt〉()@ff.Dispose +

〈this.found = tt〉[this.state 7→ stop, this.found 7→ ff,this.Istomach 7→ 100%, this.Sstomach 7→ 100%]()@ff.Follow +

〈this.nest = tt〉Supplier

Page 21: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Running example cont.

Running example (step 4/5)

Supplier , (〈this.nest = tt ∧ this.Sstomach > 0%〉Feed +

〈this.nest = tt ∧ this.Sstomach = 0% ∧ this.drnd = 0〉Search )

Feed , (y = Freq)(x , y).(portion, meal)@(odour = x)[this.Sstomach 7→ this.Sstomach − 1%].Supplier

Search , [this.direction 7→ 2πRand(), this.state 7→ move]()@ff.Dispose

Page 22: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Running example cont.

Running example (step 4/5)

Supplier , (〈this.nest = tt ∧ this.Sstomach > 0%〉Feed +〈this.nest = tt ∧ this.Sstomach = 0% ∧ this.drnd = 0〉

Search )

Feed , (y = Freq)(x , y).(portion, meal)@(odour = x)[this.Sstomach 7→ this.Sstomach − 1%].Supplier

Search , [this.direction 7→ 2πRand(), this.state 7→ move]()@ff.Dispose

Page 23: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Running example cont.

Running example (step 4/5)

Supplier , (〈this.nest = tt ∧ this.Sstomach > 0%〉Feed +〈this.nest = tt ∧ this.Sstomach = 0% ∧ this.drnd = 0〉

Search )

Feed , (y = Freq)(x , y).(portion, meal)@(odour = x)[this.Sstomach 7→ this.Sstomach − 1%].Supplier

Search , [this.direction 7→ 2πRand(), this.state 7→ move]()@ff.Dispose

Page 24: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Running example cont.

Running example (step 4/5)

Supplier , (〈this.nest = tt ∧ this.Sstomach > 0%〉Feed +〈this.nest = tt ∧ this.Sstomach = 0% ∧ this.drnd = 0〉

Search )

Feed , (y = Freq)(x , y).(portion, meal)@(odour = x)[this.Sstomach 7→ this.Sstomach − 1%].Supplier

Search , [this.direction 7→ 2πRand(), this.state 7→ move]()@ff.Dispose

Page 25: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

AbC Calculus

(Components) C ::= Γ :P | C1‖C2 | νxC

(Processes) P ::=

(Inaction) 0

(Input) | Π(x).P

(Output) | (E )@Π.P

(Update) | [a 7→ E ].P

(Match) | 〈Π〉P(Choice) | P1 + P2

(Par) | P1|P2

(Call) | K

(Predicates) Π ::= tt | ff | E1 on E2 | Π1 ∧ Π2 | . . .(Data) E ::= v | x | a | this.a | . . .

Page 26: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Encoding other communicationparadigms

A number of alternative communication paradigms such as:

� Explicit Message Passing

� Group based Communications

� Publish-Subscribe

can be easily modelled by relying on AbC primitives

Page 27: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Encoding the bπ-calculus

A bπ-calculus process P is rendered as an AbC component Γ:P whereΓ = ∅.

Possible problem

Impossibility of specifying the channel along which the exchange hasto happen instantaneously.

Way out

Send the communication channel as a part of the transmitted valuesand the receiver checks its compatibility.

L ax .P M , (a, x)@(a = a).L P M

L a(x).P M , Π(y , x).L P M with Π = (y = a) and y 6∈ n(L P M)

Page 28: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Group based communication

Group-based interaction� A group name is encoded as an attribute in AbC.

� The constructs for joining or leaving a given group can beencoded as attribute updates.

� . . .

Γ1 : (msg , this.group)@(group = b).0‖Γ2 : (y = a)(x , y).0‖

...‖Γ7 : (y = a)(x , y) | [this.group 7→ b]()@ff.0

Let Γ1(group) = a, Γ2(group) = b, Γ7(group) = c

Page 29: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Publish-Subscribe

Publish-Subscribe interaction is a simple special case ofattribute-based communication:

� A Publisher sends tagged messages for all subscribers byexposing from his environment only the current topic.

� Subscribers check compatibility of messages according to theirsubscriptions.

Γ1 : (msg , this.topic)@(tt) ‖Γ2 : (y = this.subscription)(x , y) ‖

...

Γn : (y = this.subscription)(x , y) ‖

Observation

Dynamic updates of attributes and the possibility of controlling theirvisibility give AbC great flexibility and expressive power.

Page 30: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Ongoing & Future Work

We have concentrated on modelling behaviours of components andtheir interactions. We are currently tackling other research items.

� Implementing the linguistic primitives for attribute-basedcommunication.

� developing quantitative variants AbC to support components intaking decisions (e.g. via probabilistic model checking).

� Considering alternative semantics and behavioural equivalencesfor AbC

� Studying the impact of bisimulation (algebraic laws, axioms,proof techniques, . . . )

Page 31: On the Expressiveness of Attribute-based Communication

quan col. . ...............................www.quanticol.eu

Many thanks for your time.

Questions?