A Programming Framework for Collective Adaptive
Ecosystems
Roberto Casadei
roby.casadei@unibo.it
PhD Student @
Department of Computer Science and Engineering (DISI), Cesena
Alma Mater Studiorum – Università of Bologna
October 5, 2018
https://www.slideshare.net/robertocasadei
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 1/55
Context (1/3)
How do we exploit such abundance?
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 2/55
Context (2/3)
How do we (smartly) exploit such resources/architectures?
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 3/55
Context (3/3)
Environment + (Mobile, Large-scale) Networks of { devices + people }
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 4/55
Introduction Computational Field Calculus
Outline
1 Background: Aggregate Computing
Introduction
Computational Field Calculus
2 SCAFI: Practical Aggregate Programming in Scala
3 Perspectives and Research Directions
4 Conclusion
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 5/55
Introduction Computational Field Calculus
Outline
1 Background: Aggregate Computing
Introduction
Computational Field Calculus
2 SCAFI: Practical Aggregate Programming in Scala
3 Perspectives and Research Directions
4 Conclusion
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 6/55
Introduction Computational Field Calculus
The Aggregate Computing approach
Issues proposed solution
Getting local-to-global mapping right is hard
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 7/55
Introduction Computational Field Calculus
The Aggregate Computing approach
Issues proposed solution
Getting local-to-global mapping right is hard
global spec + automatic global-to-local
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 7/55
Introduction Computational Field Calculus
The Aggregate Computing approach
Issues proposed solution
Getting local-to-global mapping right is hard
global spec + automatic global-to-local
Horizontal scalability (cf., bottlenecks..) & fault-tolerance (cf., SPoF)
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 7/55
Introduction Computational Field Calculus
The Aggregate Computing approach
Issues proposed solution
Getting local-to-global mapping right is hard
global spec + automatic global-to-local
Horizontal scalability (cf., bottlenecks..) & fault-tolerance (cf., SPoF)
asynchronous, decentralised computation
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 7/55
Introduction Computational Field Calculus
The Aggregate Computing approach
Issues proposed solution
Getting local-to-global mapping right is hard
global spec + automatic global-to-local
Horizontal scalability (cf., bottlenecks..) & fault-tolerance (cf., SPoF)
asynchronous, decentralised computation
Environment change, open system boundaries
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 7/55
Introduction Computational Field Calculus
The Aggregate Computing approach
Issues proposed solution
Getting local-to-global mapping right is hard
global spec + automatic global-to-local
Horizontal scalability (cf., bottlenecks..) & fault-tolerance (cf., SPoF)
asynchronous, decentralised computation
Environment change, open system boundaries
“continuous execution”, self-*
Exploit available infrastructure
flexible application partitioning & execution
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 7/55
Introduction Computational Field Calculus
Aggregate Computing
Motto: program the aggregate, not individual devices!
1) Ref. computing machine the entire aggregate of devices
Like a single “computational body”
As a discrete approximation of the actual space
2) Ref. elaboration process atomic manipulation of collective data structures (fields)
3) Actual computation a proximity-based self-organised system (“under-the-hood”)
neighborhood
device
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 8/55
Introduction Computational Field Calculus
Aggregate Programming Stack [BPV15]
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 9/55
Introduction Computational Field Calculus
Past, Present, Future of Aggregate Computing [VBDACP18]
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 10/55
Introduction Computational Field Calculus
Aggregate Computing » Applications
Applications
Crowd management services [BPV15; CPV16; CFPRSV18]
Rescue scenarios in emergency situations [VPRC17]
Distributed sensing/event recognition [CV18]
Sharing of airborne sensors [BULM16]
Geometric self-construction [BDUVC13]
Swarms, flock formations, etc. [BDUVC13]
Coordinating recovery operations for networks of enterprise services [CBP15]
Particular pieces of (distributed, adaptive) logic in larger systems [CV18]
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 11/55
Introduction Computational Field Calculus
Outline
1 Background: Aggregate Computing
Introduction
Computational Field Calculus
2 SCAFI: Practical Aggregate Programming in Scala
3 Perspectives and Research Directions
4 Conclusion
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 12/55
Introduction Computational Field Calculus
Computational fields [DVB16] (1/2)
A field as a space-time (event) structure: φ : D → V
Event E: a triple δ, t, p – device δ, “firing” at time t in position p
Events domain D: a coherent set of events (e.g., devices cannot move too fast)
Computational values V: any data value
Time
Space
Domain
Time Space
Field


  


 
Field computations:
(Computable, causal) Functions over fields: φ × φ × . . . × φ → φ
− Input/output fields share the same domain D
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 13/55
Introduction Computational Field Calculus
Computational fields [DVB16] (2/2)
Fields can be considered across different perspectives
Computational: fields map devices to the results of their computations
“Converge” with density of events (losing track of device identities) [BVPD17]
Spatio-temporal: fields map space-time to values
Situated devices approximate space-time
Dynamical: fields evolve over time as devices compute
(Hopefully) Eventually reaching a fixpoint (self-stabilisation) [VABDP18]
Structural: the domain of fields is equipped with a neighbouring relation (communication)
Functional (I/O): field computations as functions from sensor fields to actuation fields
neighborhood
device
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 14/55
Introduction Computational Field Calculus
Computational fields » a detailed view
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 15/55
Introduction Computational Field Calculus
The “channel” example: computing a route (1/5)
Stabilised time-snapshot of the “channel” boolean field
How to program it to be unaware of the map, resilient to changes/faults, and
infrastructure-independent?
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 16/55
Introduction Computational Field Calculus
The “channel” example: computing a route (2/5)
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 17/55
Introduction Computational Field Calculus
The “channel” example: computing a route (3/5)
Functional approach: what we want to express
class ChannelProgram extends AggregateProgram with ChannelAPI {
def main = channel(isSource, isDestination, width)
}
Just give this aggregate program to every device in the system
The AC platform will transparently handle necessary computations and interactions
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 18/55
Introduction Computational Field Calculus
The “channel” example: computing a route (4/5)
def channel(src: Boolean, dest: Boolean, width: Double) =
distTo(src) + distTo(dest) <= distBetween(src,dest) + width
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 19/55
Introduction Computational Field Calculus
The “channel” example: computing a route (5/5)
1 trait ChannelAPI extends Language with Builtins {
2 def channel(src: Boolean, dest: Boolean, width: Double) =
3 distanceTo(src) + distanceTo(dest) <= distBetween(src, dest) + width
4
5 def G[V:OB](src: Boolean, field: V, acc: V=>V, metric: =>Double): V =
6 rep( (Double.MaxValue, field) ){ dv =>
7 mux(src) { (0.0, field) } { minHoodMinus {
8 val (d, v) = nbr { (dv._1, dv._2) }
9 (d + metric, acc(v))
10 } }
11 }._2
12
13 def broadcast[V:OB](source: Boolean, field: V): V =
14 G[V](source, field, x=>x, nbrRange())
15
16 def distanceTo(source: Boolean): Double =
17 G[Double](source, 0, _ + nbrRange(), nbrRange())
18
19 def distBetween(source: Boolean, target: Boolean): Double =
20 broadcast(source, distanceTo(target))
21
22 def nbrRange(): Double = nbrvar[Double](NBR_RANGE_NAME)
23 def isSource = sense[Boolean]("source")
24 def isDestination = sense[Boolean]("destination")
25 }
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 20/55
Introduction Computational Field Calculus
Field calculus [DVPB15]
Key idea
a sort of λ-calculus with “everything is a field” philosophy!
Syntax (slightly refactored, semi-formal version of [DVPB15])
e ::= x v e(e1, . . . , en) rep(e0){e} nbr{e} (expr)
v ::= < standard-values > λ (value)
λ ::= f o (x)=>e (functional value)
F ::= def f(x) {e} (function definition)
Few explanations
v includes basic types (numbers, bools, strings..), collection types (tuples, maps, ..), etc.
f is a user-defined function (the key aggregate computing abstraction)
o is a built-in local operator (pure math, local sensors,..)
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 21/55
Introduction Computational Field Calculus
Intuition of global-level (denotational) semantics
The four main constructs at work
e ::= . . . v e(e1, . . . , en) rep(e0){e} nbr{e}
0
(x)=>x+1
true t<0,1>
()0
1
+
-
1
-1
ef(0,1)
ef
rep
0
(x)=>x+1
t
v0
t
v1
..
rep(0){(x)=>x+1}
nbr de
nbr{e}
φd=[d1→v1,..,dn→vn]
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 22/55
Introduction Computational Field Calculus
On the field calculus
Practically, it can express:
complex spreading / aggregation / decay functions [BPV15]
spatial leader election, partitioning, consensus [DVB16]
distributed spatio-temporal sensing [PBV16]
splitting in parallel independent subprocesses [PBV16]
dynamic deployment/spreading of code [DVPB15]
implicit/explicit device selection of what code execute [VPRBC15]
“collective teams” forming based on the selected code [VPRBC15]
distributed trust mechanisms [CAV18a]
⇒ ..and critically, we can smoothly compose/nest the above features..
Key properties
Self-stabilising fragment [VABDP18]
Eventual consistent fragment (a.k.a. density-independence) [BVPD17]
Universality [ABDV18]
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 23/55
Aggregate Computing API/DSL Aggregate Computing Platform
Outline
1 Background: Aggregate Computing
2 SCAFI: Practical Aggregate Programming in Scala
Aggregate Computing API/DSL
Aggregate Computing Platform
3 Perspectives and Research Directions
4 Conclusion
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 24/55
Aggregate Computing API/DSL Aggregate Computing Platform
Current Toolchain for Aggregate Computing
Field Calculus
Protelis
Xtext parsing
Static analysis Interpreter
Alchemist
Android/Rest/Cloud
Formal 
foundation
Programming
Language
Language 
tools
Simulation
Execution
Properties
Scala
simGUI
Scafi Core
Scafi­Akka
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 25/55
Aggregate Computing API/DSL Aggregate Computing Platform
SCAFI: Scala with Computational Fields
Goal: bring Aggregate Computing to mainstream SW development
What
SCAFI [CV16] is a library/framework for building aggregate systems
Scala-internal DSL for expressing aggregate computations
Linguistic support + execution support (interpreter/VM)
Correct, complete, efficient impl. of the Higher-Order Field Calculus [DVPB15]
Distributed platform for execution of aggregate systems
Actor-based implementation (based on Akka)
Support for multiple architectural styles and system configurations
⇒ https://github.com/scafi/scafi
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 26/55
Aggregate Computing API/DSL Aggregate Computing Platform
Outline
1 Background: Aggregate Computing
2 SCAFI: Practical Aggregate Programming in Scala
Aggregate Computing API/DSL
Aggregate Computing Platform
3 Perspectives and Research Directions
4 Conclusion
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 27/55
Aggregate Computing API/DSL Aggregate Computing Platform
Aggregate Programs
So, what is an aggregate program?
The “global” program
“Local” programs automatically obtained via global-to-local mapping
An aggregate program consists of
1) A set of function definitions
2) A body of expressions.
Example: an aggregate program in SCAFI
class MyProgram extends AggregateProgram with MyAPI {
def isSource = sense[Boolean]("source")
// Entry point for execution
override def main() = gradient(isSource)
}
Each device of the aggregate system is given an instance of MyProgram
Each device repeatedly runs main at async rounds of execution
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 28/55
Aggregate Computing API/DSL Aggregate Computing Platform
Computing with fields
Expressing aggregate/field computations in SCAFI
trait Constructs {
def rep[A](init: A)(fun: (A) => A): A
def nbr[A](expr: => A): A
def foldhood[A](init: => A)(acc: (A,A)=>A)(expr: => A): A
def branch[A](cond: => Boolean)(th: => A)(el: => A): A
// Foundational built-ins
def mid(): ID
def sense[A](name: LSNS): A
def nbrvar[A](name: NSNS): A
}
Mechanisms for context-sensitiveness: nbr, nbrvar, sense
Mechanisms for field evolution: rep
Mechanisms for (structurally aligned) interaction: nbr
Mechanisms for field domain restriction/partitioning: branch
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 29/55
Aggregate Computing API/DSL Aggregate Computing Platform
Aggregate (computing) systems & Execution model
Structure network/graph
A set of devices (aka nodes/points/things)
Communication links based on an neighbouring relation
App-specific; usually mirrors space-time locality (cf., broadcast range)
Asynchronous, round-based dynamics
(1) Retrieve context
⇐ Local state at the previous round (cf., reps)
⇐ Messages from neighbours (cf., nbrs)
⇐ Sensor values (cf., senses)
(2) Aggregate program execution
⇒ export (a tree-like descriptor) + output (result of main expr)
(3) Broadcast export to neighbourhood
(4) Execute actuation
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 30/55
Aggregate Computing API/DSL Aggregate Computing Platform
How Aggregate Computing works
Repeated execution provides reactivity and incremental adaptivity
Broadcast + aligned interaction allows building & spreading local/global contexts
Neighbour trees Evaluation tree
rep
if
nbr fun
time
persistence
domain
restriction
neighbour
alignment
tree
expansion
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 31/55
Aggregate Computing API/DSL Aggregate Computing Platform
A mini-tutorial
http://github.com/metaphori/coord18-demos
[00] 1 // Local & field value (constant, uniform)
[01] 2 + 3 // Expression
[02] (10, 20) // Tuple
[03] Random.nextInt(1000) // Random int < 1000 (implementation-specific)
[04] sense[Boolean]("sens1")// Read sensor (non-const, non-uniform)
[05] if(sense[Boolean]("sens1") && sense("sens2")) "hot" else "cold"
[06] mid() // Dev IDs (const for fixed domain, non-uniform)
[07] def sense1() = sense[Boolean]("sens1") // Function for reuse
foldhood(0)(_+_){ if(nbr{sense1}) 1 else 0 }
// Fold over neighbouring value with given init val and aggregator
[08] (minHood{nbrRange}, minHoodPlus{nbrRange})
[09] rep(0){ x => x + 1 }
[10] rep(Random.nextInt(100)){ x => x }
[11] rep(0){ x => x + rep(Random.nextInt(100))(y => y) }
[12] rep(Double.PositiveInfinity)(distance =>
mux(sense[Boolean]("source")){ 0.0 }{
minHoodPlus(nbr{distance} + nbrRange)
})
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 32/55
Aggregate Computing API/DSL Aggregate Computing Platform
Exports
Interaction protocol: export broadcasting to neighbours
Exports are descriptors for local computations
Support aligned interaction and hence compositionality
Bigger programs ⇒ bigger exports, still same protocol!
def distanceTo(src: Boolean): Double = rep(Double.PositiveInfinity)(d =>
mux(src){ 0.0 }{ minHoodPlus(nbr{d} + nbrRange) })
def main: Double =
branch(sense[Boolean]("withinAreaOfInterest")){ // Splits the domain
distanceTo(sense[Boolean]("source")) // * 'then' branch
}{ Double.PositiveInfinity } // * 'else' branch
yields an export like the following (on nodes where sensor is active)
Map(P:/ -> 2.0, // Root value (computation result)
P:/Branch(0,true) -> 2.0 // Node corresp. to branch(c){t}{e}
P:/Branch(0,true)/Rep(0) -> 2.0,
P:/Branch(0,true)/Rep(0)/FoldHood(0) -> 2.0, // Cf., *hoodPlus ops
P:/Branch(0,true)/Rep(0)/FoldHood(0)/Nbr(0) -> 5, // For nbr{distance}
P:/Branch(0,true)/Rep(0)/FoldHood(0)/Nbr(1) -> 2.0))
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 33/55
Aggregate Computing API/DSL Aggregate Computing Platform
Example: distributed sensing
trait DSensing extends BlockG with BlockC with BlockS { I: AggregateProgram =>
def distributedSense(size:Double, metric: =>Double, v:Double): Double = {
val leaders = S(size, metric)
val potential = distanceTo(leaders, metric)
val collection = sumCollect(potential, v)
val count = sumCollect(potential, 1.0)
val avg = collection / count
broadcast(leaders, avg)
}
def sumCollect(potential: Double, v: Double): Double = C(potential, _+_, v, 0)
def broadcast[V: Bounded](src: Boolean, v: V): V = G(src, v, x => x, nbrRange)
}
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 34/55
Aggregate Computing API/DSL Aggregate Computing Platform
Example: distributed sensing
trait DSensing extends BlockG with BlockC with BlockS { I: AggregateProgram =>
def distributedSense(size:Double, metric: =>Double, v:Double): Double = {
val leaders = S(size, metric)
val potential = distanceTo(leaders, metric)
val collection = sumCollect(potential, v)
val count = sumCollect(potential, 1.0)
val avg = collection / count
broadcast(leaders, avg)
}
def sumCollect(potential: Double, v: Double): Double = C(potential, _+_, v, 0)
def broadcast[V: Bounded](src: Boolean, v: V): V = G(src, v, x => x, nbrRange)
}
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 34/55
Aggregate Computing API/DSL Aggregate Computing Platform
Example: distributed sensing
trait DSensing extends BlockG with BlockC with BlockS { I: AggregateProgram =>
def distributedSense(size:Double, metric: =>Double, v:Double): Double = {
val leaders = S(size, metric)
val potential = distanceTo(leaders, metric)
val collection = sumCollect(potential, v)
val count = sumCollect(potential, 1.0)
val avg = collection / count
broadcast(leaders, avg)
}
def sumCollect(potential: Double, v: Double): Double = C(potential, _+_, v, 0)
def broadcast[V: Bounded](src: Boolean, v: V): V = G(src, v, x => x, nbrRange)
}
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 34/55
Aggregate Computing API/DSL Aggregate Computing Platform
Example: distributed sensing
trait DSensing extends BlockG with BlockC with BlockS { I: AggregateProgram =>
def distributedSense(size:Double, metric: =>Double, v:Double): Double = {
val leaders = S(size, metric)
val potential = distanceTo(leaders, metric)
val collection = sumCollect(potential, v)
val count = sumCollect(potential, 1.0)
val avg = collection / count
broadcast(leaders, avg)
}
def sumCollect(potential: Double, v: Double): Double = C(potential, _+_, v, 0)
def broadcast[V: Bounded](src: Boolean, v: V): V = G(src, v, x => x, nbrRange)
}
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 34/55
Aggregate Computing API/DSL Aggregate Computing Platform
Outline
1 Background: Aggregate Computing
2 SCAFI: Practical Aggregate Programming in Scala
Aggregate Computing API/DSL
Aggregate Computing Platform
3 Perspectives and Research Directions
4 Conclusion
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 35/55
Aggregate Computing API/DSL Aggregate Computing Platform
Akka-based distributed platform
Goal: easy configuration and execution of aggregate systems
Setup of an aggregate application
Setup of individual nodes/subsystems
Support for multiple architectural styles and system configurations
Fully peer-to-peer
Server-based (mediating communications)
Implemented on top of the Akka actor framework
An actor is a (re)active entity that
encapsulates a state, behaviour, and control (autonomy);
has a global UID that allows for location transparency;
interacts with other actors via async message passing
SCAFI components are actors: devices, sensors, schedulers...
OO-facade API & message-based API (exposing underlying actors)
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 36/55
Aggregate Computing API/DSL Aggregate Computing Platform
(Fully operational) Device actors
Responsibilities (each assigned to an actor)
(i) Sensing/actuating
(ii) Aggregate program execution
(iii) Broadcasting/receiving the exports of computation to/from neighbours
(iv) Storing state (last computation, exports from neighbours)
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 37/55
Aggregate Computing API/DSL Aggregate Computing Platform
Setup of an (actor-based) aggregate system
// STEP 1: CHOOSE INCARNATION
import scafi.incarnations.{ BasicActorP2P => Platform }
import Platform.{AggregateProgram,Settings,PlatformConfig}
// STEP 2: DEFINE AGGREGATE PROGRAM SCHEMA
class Program extends AggregateProgram with DSensing {
// Specify "distributed sensing" aggregate computation
override def main(): Any =
distributedSense(size = 10.0,
metric = nbrRange,
v = sense[Double]("temperature"))
}
// STEP 3: PLATFORM SETUP
val settings = Settings()
val platform = PlatformConfig.setupPlatform(settings)
// STEP 4: NODE SETUP
val sys = platform.newAggregateApplication()
val dm = sys.newDevice(id = Utils.newId(),
program = Program,
neighbours = Utils.discoverNbrs())
val devActor = dm.actorRef // get underlying actor
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 38/55
Aggregate Computing API/DSL Aggregate Computing Platform
Aggregate Computing and Actor Systems [CV18]
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 39/55
Outline
1 Background: Aggregate Computing
2 SCAFI: Practical Aggregate Programming in Scala
3 Perspectives and Research Directions
4 Conclusion
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 40/55
State-of-the-art
Main results
Higher-Order Field Calculus & code mobility [DVPB15]
Self-stabilisation and substitution semantics [VABDP18]
Space-Time Universality [ABDV18]
“Eventual” consistency [BVPD17]
Variants of key algorithms
Gradients: Flex, CRF, BIS, SVD, ULT [ACDV17]
Collection: single-path, (weighted) multi-path, via time-replicated gossip [PBV16]
Toolchain
DSLs: Protelis [PBV15], SCAFI [CV16; CPV16]
Platform [VCP16; CV18]
Miscellaneous
Attack-resistant aggregate computations via trust [CAV18b]
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 41/55
Future work
Research directions
Elaboration of libraries – modular; type safe; usable; ..
Techniques to control dynamics – feedback; stability; convergence; ..
Security — code mobility, trust fields [CAV18a]
Applications
IoT scenarios in dense urban environments (cf., Smart City)
Drones, unmanned vehicles
Coordination service for networked systems
Development of software platforms/middlewares
Management of mobile devices and processes
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 42/55
Aggregate Computing Platforms: Roadmap
Solid support for distributed Aggregate Systems
⇓
Flexible deployment and execution
Design-time, manual
⇓
Dynamic deployment and execution
Run-time, manually triggered
⇓
Self-adaptive deployment and execution
Run-time, automatic (strategically optimising)
⇓
Opportunistic deployment and execution
Run-time, automatic (tactically optimising)
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 43/55
Execution strategies and architectures [VCP16]
Adaptivity requirements demand for fluid responsibilities
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 44/55
Aggregate Processes (1/2)
Motivation
Field calculus is space-time universal [ABDV18], but expressing
a dynamic number of dynamically managed aggregate computations
is not currently as straightforward as it should be.
The Aggregate Process notion
From a single computation for the entire system
To a set of parallel computations (processes)
- with ad-hoc spatial and temporal extension
- i.e., opportunistically executed by a dynamic coalition of device
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 45/55
Aggregate Processes (2/2)
New construct: spawn
Generation: activation of new process instances
Evolution: propagation and retraction of processes
Fusion: merging of “identical” process instances
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 46/55
Aggregate Processes: time-replicated gossip [PBV16]
Gossip #1Gossip #1
Gossip #3Gossip #3
Gossip #2Gossip #2
…
Time
p
k=3
Gossip #4Gossip #4
def replicated[T,R](proc: T => R)
(arg: T, p: Double, k: Int): Map[Long,R] = {
val pid = sharedClock(p, dt())
val newProcs = if(changed(pid)) Set(pid) else Set[Long]()
spawn[Long,T,R]((thisPid) => (arg) => {
(proc(arg), if(thisPid-pid < k){Output} else {External})
}, newProcs, arg)
}
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 47/55
Outline
1 Background: Aggregate Computing
2 SCAFI: Practical Aggregate Programming in Scala
3 Perspectives and Research Directions
4 Conclusion
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 48/55
Wrap-up
Aggregate Computing: key takeaways
Aggregate computing:
1) has a functional compositional model for distributed algorithms
2) has a practical toolchain (SCAFI): you can experiment with it
3) targets abstractions and platforms for future IoT ecosystems
* A bunch of results and tools emerged, many to come
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 49/55
Who we are
Raytheon BBN Technologies, USA
Jacob Beal, Senior Scientist
Alma Mater Studiorum – Università di Bologna, Italy
Mirko Viroli, Full Professor
Danilo Pianini, Post-Doc
Roberto Casadei, PhD Student – roby.casadei@unibo.it
Università degli Studi di Torino, Italy
Ferruccio Damiani, Associate Professor
Giorgio Audrito, Post-Doc
R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 50/55
References (1/5)
[ABDV18] Giorgio Audrito, Jacob Beal, Ferruccio Damiani, and Mirko Viroli. “Space-Time
Universality of Field Calculus”. In: International Conference on Coordination Languages
and Models. Springer. 2018, pp. 1–20.
[ACDV17] Giorgio Audrito, Roberto Casadei, Ferruccio Damiani, and Mirko Viroli. “Compositional
Blocks for Optimal Self-Healing Gradients”. In: Self-Adaptive and Self-Organising
Systems (SASO), IEEE International Conference on. IEEE. 2017.
[BDUVC13] Jacob Beal, Stefan Dulman, Kyle Usbeck, Mirko Viroli, and Nikolaus Correll. “Organizing
the Aggregate: Languages for Spatial Computing”. In: Formal and Practical Aspects of
DSLs: Recent Developments. A longer version at:
http://arxiv.org/abs/1202.5509. IGI Global, 2013. Chap. 16, pp. 436–501.
ISBN: 978-1-4666-2092-6.
[BPV15] Jacob Beal, Danilo Pianini, and Mirko Viroli. “Aggregate Programming for the Internet of
Things”. In: IEEE Computer (2015). ISSN: 1364-503X.
[BULM16] Jacob Beal, Kyle Usbeck, Joseph Loyall, and James Metzler. “Opportunistic sharing of
airborne sensors”. In: Distributed Computing in Sensor Systems (DCOSS), 2016
International Conference on. IEEE. 2016, pp. 25–32.
[BVPD17] Jacob Beal, Mirko Viroli, Danilo Pianini, and Ferruccio Damiani. “Self-adaptation to
Device Distribution in the Internet of Things”. In: ACM Transactions on Autonomous and
Adaptive Systems (TAAS) 12.3 (2017), p. 12.
R. Casadei Appendix References 51/55
References (2/5)
[CAV18a] Roberto Casadei, Alessandro Aldini, and Mirko Viroli. “Combining Trust and Aggregate
Computing”. In: Software Engineering and Formal Methods. Ed. by Antonio Cerone and
Marco Roveri. Cham: Springer International Publishing, 2018, pp. 507–522. ISBN:
978-3-319-74781-1.
[CAV18b] Roberto Casadei, Aldini Alessandro, and Mirko Viroli. “Towards attack-resistant
Aggregate Computing using trust mechanisms”. In: Science of Computer Programming
167 (2018), pp. 114–137. ISSN: 0167-6423. DOI: 10.1016/j.scico.2018.07.006.
URL: http:
//www.sciencedirect.com/science/article/pii/S0167642318303046.
[CBP15] Shane S Clark, Jacob Beal, and Partha Pal. “Distributed recovery for enterprise
services”. In: Self-Adaptive and Self-Organizing Systems (SASO), 2015 IEEE 9th
International Conference on. IEEE. 2015, pp. 111–120.
[CFPRSV18] Roberto Casadei, Giancarlo Fortino, Danilo Pianini, Wilma Russo, Claudio Savaglio,
and Mirko Viroli. “Modelling and Simulation of Opportunistic IoT Services with
Aggregate Computing”. In: Future Generation Computer Systems 91 (2018),
pp. 252–262. ISSN: 0167-739X. DOI: 10.1016/j.future.2018.09.005. URL:
https://doi.org/10.1016/j.future.2018.09.005.
[CPV16] Roberto Casadei, Danilo Pianini, and Mirko Viroli. “Simulating Large-scale Aggregate
MASs with Alchemist and Scala”. In: Proceedings of the Federated Conference on
Computer Science and Information Systems (FedCSIS 2016). Ed. by Maria Ganzha,
Leszek Maciaszek, and Marcin Paprzycki. Gdansk, Poland: IEEE Computer Society
Press, 2016.
R. Casadei Appendix References 52/55
References (3/5)
[CV16] Roberto Casadei and Mirko Viroli. “Towards Aggregate Programming in Scala”. In: First
Workshop on Programming Models and Languages for Distributed Computing. PMLDC
’16. Rome, Italy: ACM, 2016, 5:1–5:7. ISBN: 978-1-4503-4775-4. DOI:
10.1145/2957319.2957372. URL:
http://doi.acm.org/10.1145/2957319.2957372.
[CV18] Roberto Casadei and Mirko Viroli. “Programming Actor-Based Collective Adaptive
Systems”. In: Programming with Actors: State-of-the-Art and Research Perspectives.
Ed. by Alessandro Ricci and Philipp Haller. Vol. 10789. Lecture Notes in Computer
Science. Springer International Publishing, 2018, pp. 94–122. DOI:
10.1007/978-3-030-00302-9_4. URL:
https://doi.org/10.1007/978-3-030-00302-9_4.
[DVB16] Ferruccio Damiani, Mirko Viroli, and Jacob Beal. “A type-sound calculus of
computational fields”. In: Science of Computer Programming 117 (2016), pp. 17 –44.
ISSN: 0167-6423. DOI: http://dx.doi.org/10.1016/j.scico.2015.11.005.
URL: http:
//www.sciencedirect.com/science/article/pii/S0167642315003573.
[DVPB15] Ferruccio Damiani, Mirko Viroli, Danilo Pianini, and Jacob Beal. “Code Mobility Meets
Self-organisation: A Higher-Order Calculus of Computational Fields”. English. In: Formal
Techniques for Distributed Objects, Components, and Systems. Vol. 9039. Lecture
Notes in Computer Science. Extended version submitted to ACM TOCL journal.
Springer International Publishing, 2015, pp. 113–128. ISBN: 978-3-319-19194-2. DOI:
10.1007/978-3-319-19195-9_8.
R. Casadei Appendix References 53/55
References (4/5)
[PBV15] Danilo Pianini, Jacob Beal, and Mirko Viroli. “Practical Aggregate Programming with
PROTELIS”. In: ACM Symposium on Applied Computing (SAC 2015). 2015.
[PBV16] Danilo Pianini, Jacob Beal, and Mirko Viroli. “Improving gossip dynamics through
overlapping replicates”. In: Lecture Notes in Computer Science (including subseries
Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 9686 (2016),
pp. 192–207. ISSN: 16113349. DOI: 10.1007/978-3-319-39519-7_12.
[VABDP18] Mirko Viroli, Giorgio Audrito, Jacob Beal, Ferruccio Damiani, and Danilo Pianini.
“Engineering resilient collective adaptive systems by self-stabilisation”. In: ACM
Transactions on Modeling and Computer Simulation (TOMACS) 28.2 (2018), p. 16.
[VBDACP18] Mirko Viroli, Jacob Beal, Ferruccio Damiani, Giorgio Audrito, Roberto Casadei, and
Danilo Pianini. “From Field-Based Coordination to Aggregate Computing”. In:
Coordination Models and Languages - 20th IFIP WG 6.1 International Conference,
COORDINATION 2018, Held as Part of the 13th International Federated Conference on
Distributed Computing Techniques, DisCoTec 2018, Madrid, Spain, June 18-21, 2018.
Proceedings. Ed. by Giovanna Di Marzo Serugendo and Michele Loreti. Vol. 10852.
Lecture Notes in Computer Science. Springer, 2018, pp. 252–279. DOI:
10.1007/978-3-319-92408-3_12. URL:
https://doi.org/10.1007/978-3-319-92408-3_12.
[VCP16] Mirko Viroli, Roberto Casadei, and Danilo Pianini. “On Execution Platforms for
Large-Scale Aggregate Computing”. In: 3rd International Workshop on Collective
Adaptation in Very Large Scale Ubicomp (VLSU): Towards a Superorganism of
Wearables - UbiComp. Heidelberg, Germany, 2016.
R. Casadei Appendix References 54/55
References (5/5)
[VPRBC15] Mirko Viroli, Danilo Pianini, Alessandro Ricci, Pietro Brunetti, and Angelo Croatti.
“Multi-agent Systems Meet Aggregate Programming: Towards a Notion of Aggregate
Plan”. In: PRIMA 2015: Principles and Practice of Multi-Agent Systems - 18th
International Conference, Bertinoro, Italy, October 26-30, 2015, Proceedings. 2015,
pp. 49–64. DOI: url{10.1007/978-3-319-25524-8_4}. URL:
url{http://dx.doi.org/10.1007/978-3-319-25524-8_4}.
[VPRC17] Mirko Viroli, Danilo Pianini, Alessandro Ricci, and Angelo Croatti. “Aggregate plans for
multiagent systems”. In: International Journal of Agent-Oriented Software Engineering
4.5 (2017), pp. 336–365. ISSN: 1746-1375.
R. Casadei Appendix References 55/55

A Programming Framework for Collective Adaptive Ecosystems

  • 1.
    A Programming Frameworkfor Collective Adaptive Ecosystems Roberto Casadei roby.casadei@unibo.it PhD Student @ Department of Computer Science and Engineering (DISI), Cesena Alma Mater Studiorum – Università of Bologna October 5, 2018 https://www.slideshare.net/robertocasadei R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 1/55
  • 2.
    Context (1/3) How dowe exploit such abundance? R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 2/55
  • 3.
    Context (2/3) How dowe (smartly) exploit such resources/architectures? R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 3/55
  • 4.
    Context (3/3) Environment +(Mobile, Large-scale) Networks of { devices + people } R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 4/55
  • 5.
    Introduction Computational FieldCalculus Outline 1 Background: Aggregate Computing Introduction Computational Field Calculus 2 SCAFI: Practical Aggregate Programming in Scala 3 Perspectives and Research Directions 4 Conclusion R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 5/55
  • 6.
    Introduction Computational FieldCalculus Outline 1 Background: Aggregate Computing Introduction Computational Field Calculus 2 SCAFI: Practical Aggregate Programming in Scala 3 Perspectives and Research Directions 4 Conclusion R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 6/55
  • 7.
    Introduction Computational FieldCalculus The Aggregate Computing approach Issues proposed solution Getting local-to-global mapping right is hard R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 7/55
  • 8.
    Introduction Computational FieldCalculus The Aggregate Computing approach Issues proposed solution Getting local-to-global mapping right is hard global spec + automatic global-to-local R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 7/55
  • 9.
    Introduction Computational FieldCalculus The Aggregate Computing approach Issues proposed solution Getting local-to-global mapping right is hard global spec + automatic global-to-local Horizontal scalability (cf., bottlenecks..) & fault-tolerance (cf., SPoF) R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 7/55
  • 10.
    Introduction Computational FieldCalculus The Aggregate Computing approach Issues proposed solution Getting local-to-global mapping right is hard global spec + automatic global-to-local Horizontal scalability (cf., bottlenecks..) & fault-tolerance (cf., SPoF) asynchronous, decentralised computation R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 7/55
  • 11.
    Introduction Computational FieldCalculus The Aggregate Computing approach Issues proposed solution Getting local-to-global mapping right is hard global spec + automatic global-to-local Horizontal scalability (cf., bottlenecks..) & fault-tolerance (cf., SPoF) asynchronous, decentralised computation Environment change, open system boundaries R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 7/55
  • 12.
    Introduction Computational FieldCalculus The Aggregate Computing approach Issues proposed solution Getting local-to-global mapping right is hard global spec + automatic global-to-local Horizontal scalability (cf., bottlenecks..) & fault-tolerance (cf., SPoF) asynchronous, decentralised computation Environment change, open system boundaries “continuous execution”, self-* Exploit available infrastructure flexible application partitioning & execution R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 7/55
  • 13.
    Introduction Computational FieldCalculus Aggregate Computing Motto: program the aggregate, not individual devices! 1) Ref. computing machine the entire aggregate of devices Like a single “computational body” As a discrete approximation of the actual space 2) Ref. elaboration process atomic manipulation of collective data structures (fields) 3) Actual computation a proximity-based self-organised system (“under-the-hood”) neighborhood device R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 8/55
  • 14.
    Introduction Computational FieldCalculus Aggregate Programming Stack [BPV15] R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 9/55
  • 15.
    Introduction Computational FieldCalculus Past, Present, Future of Aggregate Computing [VBDACP18] R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 10/55
  • 16.
    Introduction Computational FieldCalculus Aggregate Computing » Applications Applications Crowd management services [BPV15; CPV16; CFPRSV18] Rescue scenarios in emergency situations [VPRC17] Distributed sensing/event recognition [CV18] Sharing of airborne sensors [BULM16] Geometric self-construction [BDUVC13] Swarms, flock formations, etc. [BDUVC13] Coordinating recovery operations for networks of enterprise services [CBP15] Particular pieces of (distributed, adaptive) logic in larger systems [CV18] R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 11/55
  • 17.
    Introduction Computational FieldCalculus Outline 1 Background: Aggregate Computing Introduction Computational Field Calculus 2 SCAFI: Practical Aggregate Programming in Scala 3 Perspectives and Research Directions 4 Conclusion R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 12/55
  • 18.
    Introduction Computational FieldCalculus Computational fields [DVB16] (1/2) A field as a space-time (event) structure: φ : D → V Event E: a triple δ, t, p – device δ, “firing” at time t in position p Events domain D: a coherent set of events (e.g., devices cannot move too fast) Computational values V: any data value Time Space Domain Time Space Field          Field computations: (Computable, causal) Functions over fields: φ × φ × . . . × φ → φ − Input/output fields share the same domain D R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 13/55
  • 19.
    Introduction Computational FieldCalculus Computational fields [DVB16] (2/2) Fields can be considered across different perspectives Computational: fields map devices to the results of their computations “Converge” with density of events (losing track of device identities) [BVPD17] Spatio-temporal: fields map space-time to values Situated devices approximate space-time Dynamical: fields evolve over time as devices compute (Hopefully) Eventually reaching a fixpoint (self-stabilisation) [VABDP18] Structural: the domain of fields is equipped with a neighbouring relation (communication) Functional (I/O): field computations as functions from sensor fields to actuation fields neighborhood device R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 14/55
  • 20.
    Introduction Computational FieldCalculus Computational fields » a detailed view R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 15/55
  • 21.
    Introduction Computational FieldCalculus The “channel” example: computing a route (1/5) Stabilised time-snapshot of the “channel” boolean field How to program it to be unaware of the map, resilient to changes/faults, and infrastructure-independent? R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 16/55
  • 22.
    Introduction Computational FieldCalculus The “channel” example: computing a route (2/5) R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 17/55
  • 23.
    Introduction Computational FieldCalculus The “channel” example: computing a route (3/5) Functional approach: what we want to express class ChannelProgram extends AggregateProgram with ChannelAPI { def main = channel(isSource, isDestination, width) } Just give this aggregate program to every device in the system The AC platform will transparently handle necessary computations and interactions R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 18/55
  • 24.
    Introduction Computational FieldCalculus The “channel” example: computing a route (4/5) def channel(src: Boolean, dest: Boolean, width: Double) = distTo(src) + distTo(dest) <= distBetween(src,dest) + width R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 19/55
  • 25.
    Introduction Computational FieldCalculus The “channel” example: computing a route (5/5) 1 trait ChannelAPI extends Language with Builtins { 2 def channel(src: Boolean, dest: Boolean, width: Double) = 3 distanceTo(src) + distanceTo(dest) <= distBetween(src, dest) + width 4 5 def G[V:OB](src: Boolean, field: V, acc: V=>V, metric: =>Double): V = 6 rep( (Double.MaxValue, field) ){ dv => 7 mux(src) { (0.0, field) } { minHoodMinus { 8 val (d, v) = nbr { (dv._1, dv._2) } 9 (d + metric, acc(v)) 10 } } 11 }._2 12 13 def broadcast[V:OB](source: Boolean, field: V): V = 14 G[V](source, field, x=>x, nbrRange()) 15 16 def distanceTo(source: Boolean): Double = 17 G[Double](source, 0, _ + nbrRange(), nbrRange()) 18 19 def distBetween(source: Boolean, target: Boolean): Double = 20 broadcast(source, distanceTo(target)) 21 22 def nbrRange(): Double = nbrvar[Double](NBR_RANGE_NAME) 23 def isSource = sense[Boolean]("source") 24 def isDestination = sense[Boolean]("destination") 25 } R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 20/55
  • 26.
    Introduction Computational FieldCalculus Field calculus [DVPB15] Key idea a sort of λ-calculus with “everything is a field” philosophy! Syntax (slightly refactored, semi-formal version of [DVPB15]) e ::= x v e(e1, . . . , en) rep(e0){e} nbr{e} (expr) v ::= < standard-values > λ (value) λ ::= f o (x)=>e (functional value) F ::= def f(x) {e} (function definition) Few explanations v includes basic types (numbers, bools, strings..), collection types (tuples, maps, ..), etc. f is a user-defined function (the key aggregate computing abstraction) o is a built-in local operator (pure math, local sensors,..) R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 21/55
  • 27.
    Introduction Computational FieldCalculus Intuition of global-level (denotational) semantics The four main constructs at work e ::= . . . v e(e1, . . . , en) rep(e0){e} nbr{e} 0 (x)=>x+1 true t<0,1> ()0 1 + - 1 -1 ef(0,1) ef rep 0 (x)=>x+1 t v0 t v1 .. rep(0){(x)=>x+1} nbr de nbr{e} φd=[d1→v1,..,dn→vn] R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 22/55
  • 28.
    Introduction Computational FieldCalculus On the field calculus Practically, it can express: complex spreading / aggregation / decay functions [BPV15] spatial leader election, partitioning, consensus [DVB16] distributed spatio-temporal sensing [PBV16] splitting in parallel independent subprocesses [PBV16] dynamic deployment/spreading of code [DVPB15] implicit/explicit device selection of what code execute [VPRBC15] “collective teams” forming based on the selected code [VPRBC15] distributed trust mechanisms [CAV18a] ⇒ ..and critically, we can smoothly compose/nest the above features.. Key properties Self-stabilising fragment [VABDP18] Eventual consistent fragment (a.k.a. density-independence) [BVPD17] Universality [ABDV18] R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 23/55
  • 29.
    Aggregate Computing API/DSLAggregate Computing Platform Outline 1 Background: Aggregate Computing 2 SCAFI: Practical Aggregate Programming in Scala Aggregate Computing API/DSL Aggregate Computing Platform 3 Perspectives and Research Directions 4 Conclusion R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 24/55
  • 30.
    Aggregate Computing API/DSLAggregate Computing Platform Current Toolchain for Aggregate Computing Field Calculus Protelis Xtext parsing Static analysis Interpreter Alchemist Android/Rest/Cloud Formal  foundation Programming Language Language  tools Simulation Execution Properties Scala simGUI Scafi Core Scafi­Akka R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 25/55
  • 31.
    Aggregate Computing API/DSLAggregate Computing Platform SCAFI: Scala with Computational Fields Goal: bring Aggregate Computing to mainstream SW development What SCAFI [CV16] is a library/framework for building aggregate systems Scala-internal DSL for expressing aggregate computations Linguistic support + execution support (interpreter/VM) Correct, complete, efficient impl. of the Higher-Order Field Calculus [DVPB15] Distributed platform for execution of aggregate systems Actor-based implementation (based on Akka) Support for multiple architectural styles and system configurations ⇒ https://github.com/scafi/scafi R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 26/55
  • 32.
    Aggregate Computing API/DSLAggregate Computing Platform Outline 1 Background: Aggregate Computing 2 SCAFI: Practical Aggregate Programming in Scala Aggregate Computing API/DSL Aggregate Computing Platform 3 Perspectives and Research Directions 4 Conclusion R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 27/55
  • 33.
    Aggregate Computing API/DSLAggregate Computing Platform Aggregate Programs So, what is an aggregate program? The “global” program “Local” programs automatically obtained via global-to-local mapping An aggregate program consists of 1) A set of function definitions 2) A body of expressions. Example: an aggregate program in SCAFI class MyProgram extends AggregateProgram with MyAPI { def isSource = sense[Boolean]("source") // Entry point for execution override def main() = gradient(isSource) } Each device of the aggregate system is given an instance of MyProgram Each device repeatedly runs main at async rounds of execution R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 28/55
  • 34.
    Aggregate Computing API/DSLAggregate Computing Platform Computing with fields Expressing aggregate/field computations in SCAFI trait Constructs { def rep[A](init: A)(fun: (A) => A): A def nbr[A](expr: => A): A def foldhood[A](init: => A)(acc: (A,A)=>A)(expr: => A): A def branch[A](cond: => Boolean)(th: => A)(el: => A): A // Foundational built-ins def mid(): ID def sense[A](name: LSNS): A def nbrvar[A](name: NSNS): A } Mechanisms for context-sensitiveness: nbr, nbrvar, sense Mechanisms for field evolution: rep Mechanisms for (structurally aligned) interaction: nbr Mechanisms for field domain restriction/partitioning: branch R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 29/55
  • 35.
    Aggregate Computing API/DSLAggregate Computing Platform Aggregate (computing) systems & Execution model Structure network/graph A set of devices (aka nodes/points/things) Communication links based on an neighbouring relation App-specific; usually mirrors space-time locality (cf., broadcast range) Asynchronous, round-based dynamics (1) Retrieve context ⇐ Local state at the previous round (cf., reps) ⇐ Messages from neighbours (cf., nbrs) ⇐ Sensor values (cf., senses) (2) Aggregate program execution ⇒ export (a tree-like descriptor) + output (result of main expr) (3) Broadcast export to neighbourhood (4) Execute actuation R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 30/55
  • 36.
    Aggregate Computing API/DSLAggregate Computing Platform How Aggregate Computing works Repeated execution provides reactivity and incremental adaptivity Broadcast + aligned interaction allows building & spreading local/global contexts Neighbour trees Evaluation tree rep if nbr fun time persistence domain restriction neighbour alignment tree expansion R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 31/55
  • 37.
    Aggregate Computing API/DSLAggregate Computing Platform A mini-tutorial http://github.com/metaphori/coord18-demos [00] 1 // Local & field value (constant, uniform) [01] 2 + 3 // Expression [02] (10, 20) // Tuple [03] Random.nextInt(1000) // Random int < 1000 (implementation-specific) [04] sense[Boolean]("sens1")// Read sensor (non-const, non-uniform) [05] if(sense[Boolean]("sens1") && sense("sens2")) "hot" else "cold" [06] mid() // Dev IDs (const for fixed domain, non-uniform) [07] def sense1() = sense[Boolean]("sens1") // Function for reuse foldhood(0)(_+_){ if(nbr{sense1}) 1 else 0 } // Fold over neighbouring value with given init val and aggregator [08] (minHood{nbrRange}, minHoodPlus{nbrRange}) [09] rep(0){ x => x + 1 } [10] rep(Random.nextInt(100)){ x => x } [11] rep(0){ x => x + rep(Random.nextInt(100))(y => y) } [12] rep(Double.PositiveInfinity)(distance => mux(sense[Boolean]("source")){ 0.0 }{ minHoodPlus(nbr{distance} + nbrRange) }) R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 32/55
  • 38.
    Aggregate Computing API/DSLAggregate Computing Platform Exports Interaction protocol: export broadcasting to neighbours Exports are descriptors for local computations Support aligned interaction and hence compositionality Bigger programs ⇒ bigger exports, still same protocol! def distanceTo(src: Boolean): Double = rep(Double.PositiveInfinity)(d => mux(src){ 0.0 }{ minHoodPlus(nbr{d} + nbrRange) }) def main: Double = branch(sense[Boolean]("withinAreaOfInterest")){ // Splits the domain distanceTo(sense[Boolean]("source")) // * 'then' branch }{ Double.PositiveInfinity } // * 'else' branch yields an export like the following (on nodes where sensor is active) Map(P:/ -> 2.0, // Root value (computation result) P:/Branch(0,true) -> 2.0 // Node corresp. to branch(c){t}{e} P:/Branch(0,true)/Rep(0) -> 2.0, P:/Branch(0,true)/Rep(0)/FoldHood(0) -> 2.0, // Cf., *hoodPlus ops P:/Branch(0,true)/Rep(0)/FoldHood(0)/Nbr(0) -> 5, // For nbr{distance} P:/Branch(0,true)/Rep(0)/FoldHood(0)/Nbr(1) -> 2.0)) R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 33/55
  • 39.
    Aggregate Computing API/DSLAggregate Computing Platform Example: distributed sensing trait DSensing extends BlockG with BlockC with BlockS { I: AggregateProgram => def distributedSense(size:Double, metric: =>Double, v:Double): Double = { val leaders = S(size, metric) val potential = distanceTo(leaders, metric) val collection = sumCollect(potential, v) val count = sumCollect(potential, 1.0) val avg = collection / count broadcast(leaders, avg) } def sumCollect(potential: Double, v: Double): Double = C(potential, _+_, v, 0) def broadcast[V: Bounded](src: Boolean, v: V): V = G(src, v, x => x, nbrRange) } R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 34/55
  • 40.
    Aggregate Computing API/DSLAggregate Computing Platform Example: distributed sensing trait DSensing extends BlockG with BlockC with BlockS { I: AggregateProgram => def distributedSense(size:Double, metric: =>Double, v:Double): Double = { val leaders = S(size, metric) val potential = distanceTo(leaders, metric) val collection = sumCollect(potential, v) val count = sumCollect(potential, 1.0) val avg = collection / count broadcast(leaders, avg) } def sumCollect(potential: Double, v: Double): Double = C(potential, _+_, v, 0) def broadcast[V: Bounded](src: Boolean, v: V): V = G(src, v, x => x, nbrRange) } R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 34/55
  • 41.
    Aggregate Computing API/DSLAggregate Computing Platform Example: distributed sensing trait DSensing extends BlockG with BlockC with BlockS { I: AggregateProgram => def distributedSense(size:Double, metric: =>Double, v:Double): Double = { val leaders = S(size, metric) val potential = distanceTo(leaders, metric) val collection = sumCollect(potential, v) val count = sumCollect(potential, 1.0) val avg = collection / count broadcast(leaders, avg) } def sumCollect(potential: Double, v: Double): Double = C(potential, _+_, v, 0) def broadcast[V: Bounded](src: Boolean, v: V): V = G(src, v, x => x, nbrRange) } R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 34/55
  • 42.
    Aggregate Computing API/DSLAggregate Computing Platform Example: distributed sensing trait DSensing extends BlockG with BlockC with BlockS { I: AggregateProgram => def distributedSense(size:Double, metric: =>Double, v:Double): Double = { val leaders = S(size, metric) val potential = distanceTo(leaders, metric) val collection = sumCollect(potential, v) val count = sumCollect(potential, 1.0) val avg = collection / count broadcast(leaders, avg) } def sumCollect(potential: Double, v: Double): Double = C(potential, _+_, v, 0) def broadcast[V: Bounded](src: Boolean, v: V): V = G(src, v, x => x, nbrRange) } R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 34/55
  • 43.
    Aggregate Computing API/DSLAggregate Computing Platform Outline 1 Background: Aggregate Computing 2 SCAFI: Practical Aggregate Programming in Scala Aggregate Computing API/DSL Aggregate Computing Platform 3 Perspectives and Research Directions 4 Conclusion R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 35/55
  • 44.
    Aggregate Computing API/DSLAggregate Computing Platform Akka-based distributed platform Goal: easy configuration and execution of aggregate systems Setup of an aggregate application Setup of individual nodes/subsystems Support for multiple architectural styles and system configurations Fully peer-to-peer Server-based (mediating communications) Implemented on top of the Akka actor framework An actor is a (re)active entity that encapsulates a state, behaviour, and control (autonomy); has a global UID that allows for location transparency; interacts with other actors via async message passing SCAFI components are actors: devices, sensors, schedulers... OO-facade API & message-based API (exposing underlying actors) R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 36/55
  • 45.
    Aggregate Computing API/DSLAggregate Computing Platform (Fully operational) Device actors Responsibilities (each assigned to an actor) (i) Sensing/actuating (ii) Aggregate program execution (iii) Broadcasting/receiving the exports of computation to/from neighbours (iv) Storing state (last computation, exports from neighbours) R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 37/55
  • 46.
    Aggregate Computing API/DSLAggregate Computing Platform Setup of an (actor-based) aggregate system // STEP 1: CHOOSE INCARNATION import scafi.incarnations.{ BasicActorP2P => Platform } import Platform.{AggregateProgram,Settings,PlatformConfig} // STEP 2: DEFINE AGGREGATE PROGRAM SCHEMA class Program extends AggregateProgram with DSensing { // Specify "distributed sensing" aggregate computation override def main(): Any = distributedSense(size = 10.0, metric = nbrRange, v = sense[Double]("temperature")) } // STEP 3: PLATFORM SETUP val settings = Settings() val platform = PlatformConfig.setupPlatform(settings) // STEP 4: NODE SETUP val sys = platform.newAggregateApplication() val dm = sys.newDevice(id = Utils.newId(), program = Program, neighbours = Utils.discoverNbrs()) val devActor = dm.actorRef // get underlying actor R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 38/55
  • 47.
    Aggregate Computing API/DSLAggregate Computing Platform Aggregate Computing and Actor Systems [CV18] R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 39/55
  • 48.
    Outline 1 Background: AggregateComputing 2 SCAFI: Practical Aggregate Programming in Scala 3 Perspectives and Research Directions 4 Conclusion R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 40/55
  • 49.
    State-of-the-art Main results Higher-Order FieldCalculus & code mobility [DVPB15] Self-stabilisation and substitution semantics [VABDP18] Space-Time Universality [ABDV18] “Eventual” consistency [BVPD17] Variants of key algorithms Gradients: Flex, CRF, BIS, SVD, ULT [ACDV17] Collection: single-path, (weighted) multi-path, via time-replicated gossip [PBV16] Toolchain DSLs: Protelis [PBV15], SCAFI [CV16; CPV16] Platform [VCP16; CV18] Miscellaneous Attack-resistant aggregate computations via trust [CAV18b] R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 41/55
  • 50.
    Future work Research directions Elaborationof libraries – modular; type safe; usable; .. Techniques to control dynamics – feedback; stability; convergence; .. Security — code mobility, trust fields [CAV18a] Applications IoT scenarios in dense urban environments (cf., Smart City) Drones, unmanned vehicles Coordination service for networked systems Development of software platforms/middlewares Management of mobile devices and processes R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 42/55
  • 51.
    Aggregate Computing Platforms:Roadmap Solid support for distributed Aggregate Systems ⇓ Flexible deployment and execution Design-time, manual ⇓ Dynamic deployment and execution Run-time, manually triggered ⇓ Self-adaptive deployment and execution Run-time, automatic (strategically optimising) ⇓ Opportunistic deployment and execution Run-time, automatic (tactically optimising) R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 43/55
  • 52.
    Execution strategies andarchitectures [VCP16] Adaptivity requirements demand for fluid responsibilities R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 44/55
  • 53.
    Aggregate Processes (1/2) Motivation Fieldcalculus is space-time universal [ABDV18], but expressing a dynamic number of dynamically managed aggregate computations is not currently as straightforward as it should be. The Aggregate Process notion From a single computation for the entire system To a set of parallel computations (processes) - with ad-hoc spatial and temporal extension - i.e., opportunistically executed by a dynamic coalition of device R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 45/55
  • 54.
    Aggregate Processes (2/2) Newconstruct: spawn Generation: activation of new process instances Evolution: propagation and retraction of processes Fusion: merging of “identical” process instances R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 46/55
  • 55.
    Aggregate Processes: time-replicatedgossip [PBV16] Gossip #1Gossip #1 Gossip #3Gossip #3 Gossip #2Gossip #2 … Time p k=3 Gossip #4Gossip #4 def replicated[T,R](proc: T => R) (arg: T, p: Double, k: Int): Map[Long,R] = { val pid = sharedClock(p, dt()) val newProcs = if(changed(pid)) Set(pid) else Set[Long]() spawn[Long,T,R]((thisPid) => (arg) => { (proc(arg), if(thisPid-pid < k){Output} else {External}) }, newProcs, arg) } R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 47/55
  • 56.
    Outline 1 Background: AggregateComputing 2 SCAFI: Practical Aggregate Programming in Scala 3 Perspectives and Research Directions 4 Conclusion R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 48/55
  • 57.
    Wrap-up Aggregate Computing: keytakeaways Aggregate computing: 1) has a functional compositional model for distributed algorithms 2) has a practical toolchain (SCAFI): you can experiment with it 3) targets abstractions and platforms for future IoT ecosystems * A bunch of results and tools emerged, many to come R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 49/55
  • 58.
    Who we are RaytheonBBN Technologies, USA Jacob Beal, Senior Scientist Alma Mater Studiorum – Università di Bologna, Italy Mirko Viroli, Full Professor Danilo Pianini, Post-Doc Roberto Casadei, PhD Student – roby.casadei@unibo.it Università degli Studi di Torino, Italy Ferruccio Damiani, Associate Professor Giorgio Audrito, Post-Doc R. Casadei Background: Aggregate Computing SCAFI Perspectives and Research Directions Conclusion 50/55
  • 59.
    References (1/5) [ABDV18] GiorgioAudrito, Jacob Beal, Ferruccio Damiani, and Mirko Viroli. “Space-Time Universality of Field Calculus”. In: International Conference on Coordination Languages and Models. Springer. 2018, pp. 1–20. [ACDV17] Giorgio Audrito, Roberto Casadei, Ferruccio Damiani, and Mirko Viroli. “Compositional Blocks for Optimal Self-Healing Gradients”. In: Self-Adaptive and Self-Organising Systems (SASO), IEEE International Conference on. IEEE. 2017. [BDUVC13] Jacob Beal, Stefan Dulman, Kyle Usbeck, Mirko Viroli, and Nikolaus Correll. “Organizing the Aggregate: Languages for Spatial Computing”. In: Formal and Practical Aspects of DSLs: Recent Developments. A longer version at: http://arxiv.org/abs/1202.5509. IGI Global, 2013. Chap. 16, pp. 436–501. ISBN: 978-1-4666-2092-6. [BPV15] Jacob Beal, Danilo Pianini, and Mirko Viroli. “Aggregate Programming for the Internet of Things”. In: IEEE Computer (2015). ISSN: 1364-503X. [BULM16] Jacob Beal, Kyle Usbeck, Joseph Loyall, and James Metzler. “Opportunistic sharing of airborne sensors”. In: Distributed Computing in Sensor Systems (DCOSS), 2016 International Conference on. IEEE. 2016, pp. 25–32. [BVPD17] Jacob Beal, Mirko Viroli, Danilo Pianini, and Ferruccio Damiani. “Self-adaptation to Device Distribution in the Internet of Things”. In: ACM Transactions on Autonomous and Adaptive Systems (TAAS) 12.3 (2017), p. 12. R. Casadei Appendix References 51/55
  • 60.
    References (2/5) [CAV18a] RobertoCasadei, Alessandro Aldini, and Mirko Viroli. “Combining Trust and Aggregate Computing”. In: Software Engineering and Formal Methods. Ed. by Antonio Cerone and Marco Roveri. Cham: Springer International Publishing, 2018, pp. 507–522. ISBN: 978-3-319-74781-1. [CAV18b] Roberto Casadei, Aldini Alessandro, and Mirko Viroli. “Towards attack-resistant Aggregate Computing using trust mechanisms”. In: Science of Computer Programming 167 (2018), pp. 114–137. ISSN: 0167-6423. DOI: 10.1016/j.scico.2018.07.006. URL: http: //www.sciencedirect.com/science/article/pii/S0167642318303046. [CBP15] Shane S Clark, Jacob Beal, and Partha Pal. “Distributed recovery for enterprise services”. In: Self-Adaptive and Self-Organizing Systems (SASO), 2015 IEEE 9th International Conference on. IEEE. 2015, pp. 111–120. [CFPRSV18] Roberto Casadei, Giancarlo Fortino, Danilo Pianini, Wilma Russo, Claudio Savaglio, and Mirko Viroli. “Modelling and Simulation of Opportunistic IoT Services with Aggregate Computing”. In: Future Generation Computer Systems 91 (2018), pp. 252–262. ISSN: 0167-739X. DOI: 10.1016/j.future.2018.09.005. URL: https://doi.org/10.1016/j.future.2018.09.005. [CPV16] Roberto Casadei, Danilo Pianini, and Mirko Viroli. “Simulating Large-scale Aggregate MASs with Alchemist and Scala”. In: Proceedings of the Federated Conference on Computer Science and Information Systems (FedCSIS 2016). Ed. by Maria Ganzha, Leszek Maciaszek, and Marcin Paprzycki. Gdansk, Poland: IEEE Computer Society Press, 2016. R. Casadei Appendix References 52/55
  • 61.
    References (3/5) [CV16] RobertoCasadei and Mirko Viroli. “Towards Aggregate Programming in Scala”. In: First Workshop on Programming Models and Languages for Distributed Computing. PMLDC ’16. Rome, Italy: ACM, 2016, 5:1–5:7. ISBN: 978-1-4503-4775-4. DOI: 10.1145/2957319.2957372. URL: http://doi.acm.org/10.1145/2957319.2957372. [CV18] Roberto Casadei and Mirko Viroli. “Programming Actor-Based Collective Adaptive Systems”. In: Programming with Actors: State-of-the-Art and Research Perspectives. Ed. by Alessandro Ricci and Philipp Haller. Vol. 10789. Lecture Notes in Computer Science. Springer International Publishing, 2018, pp. 94–122. DOI: 10.1007/978-3-030-00302-9_4. URL: https://doi.org/10.1007/978-3-030-00302-9_4. [DVB16] Ferruccio Damiani, Mirko Viroli, and Jacob Beal. “A type-sound calculus of computational fields”. In: Science of Computer Programming 117 (2016), pp. 17 –44. ISSN: 0167-6423. DOI: http://dx.doi.org/10.1016/j.scico.2015.11.005. URL: http: //www.sciencedirect.com/science/article/pii/S0167642315003573. [DVPB15] Ferruccio Damiani, Mirko Viroli, Danilo Pianini, and Jacob Beal. “Code Mobility Meets Self-organisation: A Higher-Order Calculus of Computational Fields”. English. In: Formal Techniques for Distributed Objects, Components, and Systems. Vol. 9039. Lecture Notes in Computer Science. Extended version submitted to ACM TOCL journal. Springer International Publishing, 2015, pp. 113–128. ISBN: 978-3-319-19194-2. DOI: 10.1007/978-3-319-19195-9_8. R. Casadei Appendix References 53/55
  • 62.
    References (4/5) [PBV15] DaniloPianini, Jacob Beal, and Mirko Viroli. “Practical Aggregate Programming with PROTELIS”. In: ACM Symposium on Applied Computing (SAC 2015). 2015. [PBV16] Danilo Pianini, Jacob Beal, and Mirko Viroli. “Improving gossip dynamics through overlapping replicates”. In: Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 9686 (2016), pp. 192–207. ISSN: 16113349. DOI: 10.1007/978-3-319-39519-7_12. [VABDP18] Mirko Viroli, Giorgio Audrito, Jacob Beal, Ferruccio Damiani, and Danilo Pianini. “Engineering resilient collective adaptive systems by self-stabilisation”. In: ACM Transactions on Modeling and Computer Simulation (TOMACS) 28.2 (2018), p. 16. [VBDACP18] Mirko Viroli, Jacob Beal, Ferruccio Damiani, Giorgio Audrito, Roberto Casadei, and Danilo Pianini. “From Field-Based Coordination to Aggregate Computing”. In: Coordination Models and Languages - 20th IFIP WG 6.1 International Conference, COORDINATION 2018, Held as Part of the 13th International Federated Conference on Distributed Computing Techniques, DisCoTec 2018, Madrid, Spain, June 18-21, 2018. Proceedings. Ed. by Giovanna Di Marzo Serugendo and Michele Loreti. Vol. 10852. Lecture Notes in Computer Science. Springer, 2018, pp. 252–279. DOI: 10.1007/978-3-319-92408-3_12. URL: https://doi.org/10.1007/978-3-319-92408-3_12. [VCP16] Mirko Viroli, Roberto Casadei, and Danilo Pianini. “On Execution Platforms for Large-Scale Aggregate Computing”. In: 3rd International Workshop on Collective Adaptation in Very Large Scale Ubicomp (VLSU): Towards a Superorganism of Wearables - UbiComp. Heidelberg, Germany, 2016. R. Casadei Appendix References 54/55
  • 63.
    References (5/5) [VPRBC15] MirkoViroli, Danilo Pianini, Alessandro Ricci, Pietro Brunetti, and Angelo Croatti. “Multi-agent Systems Meet Aggregate Programming: Towards a Notion of Aggregate Plan”. In: PRIMA 2015: Principles and Practice of Multi-Agent Systems - 18th International Conference, Bertinoro, Italy, October 26-30, 2015, Proceedings. 2015, pp. 49–64. DOI: url{10.1007/978-3-319-25524-8_4}. URL: url{http://dx.doi.org/10.1007/978-3-319-25524-8_4}. [VPRC17] Mirko Viroli, Danilo Pianini, Alessandro Ricci, and Angelo Croatti. “Aggregate plans for multiagent systems”. In: International Journal of Agent-Oriented Software Engineering 4.5 (2017), pp. 336–365. ISSN: 1746-1375. R. Casadei Appendix References 55/55