Declarative Macro-Programming of Collective Systems with Aggregate Computing: An Experience Report

RobertoCasadei 19 views 58 slides Sep 10, 2024
Slide 1
Slide 1 of 58
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58

About This Presentation

Massive deployments of devices across all kinds of environments pose the need for engineering their collaborative, macro-level behaviour. To address this challenge, so-called macro-programming approaches have emerged. A prominent nature-inspired example of macro-programming is aggregate computing. I...


Slide Content

Declarative Macro-Programming of Collective Systems
with Aggregate Computing: An Experience Report
Roberto Casadei, Mirko Viroli
Department of Computer Science and Engineering (DISI)
ALMAMATERSTUDIORUM– Università of Bologna
26th Symposium on Principles and Practice of Declarative Programming,PPDP 2024
10-11 settembre 2024, Milano, Italy
https://www.slideshare.net/RobertoCasadei/
R. Casadei Context 1/32

Outline
1
Context: Collective Adaptive Systems (CAS) and Macro-Programming
2
Background: Aggregate Programming (AP)
3
Aggregate Programming and Declarativity: Retrospective
4
Wrap up

Problem:collective adaptive systems (CASs) engineering
Collective Adaptive System (CAS): a multitude of homogeneous agents inter/acting and
adapting as a whole with no central coordinator
eswarm missions: e.g., exploring an environment in formation, rescuing people, building a
communication network, dividing into teams...
ecrowd management: e.g., computing the crowding level, providing suggestions for dispersal,
navigation, etc.
esmart city services: e.g., waste collection, pollution tracking
ecomputational ecosystems: e.g., crowdsourcing, edge-cloud task allocation
Research Question (RQ):how to effectively engineercollective adaptive behaviour?
ói.e., supporting the1]
[1]R. Casadei, Artif. Life, 2023
R. Casadei Context 2/32

Problem:collective adaptive systems (CASs) engineering
Collective Adaptive System (CAS): a multitude of homogeneous agents inter/acting and
adapting as a whole with no central coordinator
eswarm missions: e.g., exploring an environment in formation, rescuing people, building a
communication network, dividing into teams...
ecrowd management: e.g., computing the crowding level, providing suggestions for dispersal,
navigation, etc.
esmart city services: e.g., waste collection, pollution tracking
ecomputational ecosystems: e.g., crowdsourcing, edge-cloud task allocation
Research Question (RQ):how to effectively engineercollective adaptive behaviour?
ói.e., supporting the1]
[1]R. Casadei, Artif. Life, 2023
R. Casadei Context 2/32

Problem:collective adaptive systems (CASs) engineering
Collective Adaptive System (CAS): a multitude of homogeneous agents inter/acting and
adapting as a whole with no central coordinator
eswarm missions: e.g., exploring an environment in formation, rescuing people, building a
communication network, dividing into teams...
ecrowd management: e.g., computing the crowding level, providing suggestions for dispersal,
navigation, etc.
esmart city services: e.g., waste collection, pollution tracking
ecomputational ecosystems: e.g., crowdsourcing, edge-cloud task allocation
Research Question (RQ):how to effectively engineercollective adaptive behaviour?
ói.e., supporting the1]
[1]R. Casadei, Artif. Life, 2023
R. Casadei Context 2/32

CAS engineering: a taxonomy of approaches
CI engineering(semi-)automatic approachesMARL [2]Program Synthesis [3]...“manual” approachesnode-centric...macro-programming [4]aggregate computing5]
[2]
algorithms,”CoRR, 2019. arXiv:1911.10635
[3] R. Casadei, and M. Viroli,
COORDINATION 2022 Proceedings, ser. Lecture Notes in Computer Science, Springer, 2022
[4]R. Casadei,
modelling,”ACM Comput. Surv., no. 13s, 2023
[5] R. Casadei, and D. Pianini,
calculus and aggregate computing,”J. Log. Algebraic Methods Program., 2019
R. Casadei Context 3/32

Language-based solutions
architectural description languages6]: aim at specifying the components of a system and
their relationships and constraints
multi-tier programming7]: mixes the logic of components residing in different tiers (e.g.,
client-server architectures) in thesame compilation unit
choreographies8]: high-level descriptions of the communication among multiple parties is
projectedto synthesise correct implementations
multiagent-oriented programming9]: cf. JaCaMo (agents, environment, organisations)
macroprogramming4]: aims at expressing the macroscopic, global behaviour of an entire
system of agents or computing devices with asingle program
Differentia, roughly
by target/assumptions:collectives vs. composites [10], agents vs. processes, ...
by goals:verication vs. behaviour
by abstractions: parties, channels, C&C, BDI, elds, ...
R. Casadei Context 4/32

Macroprogramming [4] Wenvironment
macro
program
macro
level
micro
level
micro
program(s)
macro-to-
micro
emergence
actual
macro
testing
macro-
programming
desired
macro
macro-
abstractions
Macroprogramming macroscopic
behaviourof systems of computational devices (whileabstracting low-level and
individual details)
[4]R. Casadei,
modelling,”ACM Comput. Surv., no. 13s, 2023
R. Casadei Context 5/32

Outline
1
Context: Collective Adaptive Systems (CAS) and Macro-Programming
2
Background: Aggregate Programming (AP)
Introduction
Examples in ScaFi
Summary
3
Aggregate Programming and Declarativity: Retrospective
4
Wrap up

Outline
1
Context: Collective Adaptive Systems (CAS) and Macro-Programming
2
Background: Aggregate Programming (AP)
Introduction
Examples in ScaFi
Summary
3
Aggregate Programming and Declarativity: Retrospective
4
Wrap up

Introduction
Aggregate Programming: idea [11]
Aggregate Programming (AP) : a (macro-)paradigm for self-org / collective systems
System model
a device has sensors and actuators
based on a neighbouring relationship ,
devices for m a communication
network (graph)
Exec. model: sense?compute?interact
1.: perceive local context ( sensed
data + neighbours' messages )
2.: r un program on local context
3.
( actuations + expor t data to nbrs )
[11] Computer , no. 9, 2015
R. Casadei Context 6/32

Introduction
Aggregate Programming: self-organisation building blocks
Usingrep,nbr,*hoodoperations,basic self-organisation patterns (building blocks)
can be programmed
ógradient:
G:Bool7!R(eld of minimum distances from sources)
óoutward information ows (Gradient-broadcast)
óinward information ows (Collection)distance-to
For actual collective behaviours, self-org building blocks arecomposedtogether
R. Casadei Context 9/32

Introduction
Aggregate Programming: an Engineering Stack sensors
local functions
actuators
Application
Code
Developer
APIs
Field Calculus
Constructs
Resilient
Coordination
Operators
Device
Capabilities
functions repnbr
TGCfunctions
communication state
Perception
summarize
average
regionMax

Action State
Collective Behavior
distanceTo
broadcast
partition

timer
lowpass
recentTrue

collectivePerception
collectiveSummary
managementRegions

Crowd Management
dangerousDensity crowdTracking
crowdWarning safeDispersal
restriction
s
e
lf
­
s
t
a
b
ilis
a
t
io
n
R. Casadei Context 10/32

Introduction
Aggregate Computing: ToolChain(s)
R. Casadei Context 11/32

Introduction
ScaFi: overview [20]
ScaFi(ScalaFields) is an
Research tool/project started in 2016 by Viroli & Casadei [15]
óGoal (short-term):leverage the power of FP/Scala to implement an internal DSL for the
calculus14]
óGoal (long-term):promote research on self-organising systems programming & collective
intelligence
Used in several research articles [16] [17]–[19]
Tool paper in SoftwareX [20], formalisation in [12]
Repo:https://github.com/scafi/scafi
Website:https://scafi.github.io
Online playground:https://scafi.github.io/web/ W
Û(live) a few examples abstracting from details
[15]R. Casadeiand M. Viroli, First Workshop on Programming Models
and Languages for Distributed Computing, PMLDC@ECOOP 2016, Rome, Italy, July 17, 2016, ACM, 2016
[16] R. Casadei, and M. Viroli,
programming,” COORDINATION 2023, Proceedings, ser. Lecture Notes in Computer Science, Springer, 2023
[12] R. Casadei, F. Damiani, and M. Viroli,
Distribution and Adaptivity with Functional Programming and Scala,”Log. Methods Comput. Sci., Jan. 2023
[20]R. Casadei, M. Viroli, G. Aguzzi, and D. Pianini,
SoftwareX, 2022
R. Casadei Context 12/32

Outline
1
Context: Collective Adaptive Systems (CAS) and Macro-Programming
2
Background: Aggregate Programming (AP)
Introduction
Examples in ScaFi
Summary
3
Aggregate Programming and Declarativity: Retrospective
4
Wrap up

Introduction
Examples
Web playground:https://scafi.github.io/web/ W[21]
[21] R. Casadei, N. Maltoni, D. Pianini, and M. Viroli,
coordination programming,” COORDINATION 2021, , Proceedings, ser. Lecture Notes in Computer Science, Springer,
2021
R. Casadei Context 13/32

Introduction
Examples: gradient [22]
Gradient: resiliently build the eld of shortest distances from a source area
­Multiple algorithms for self-healing gradients exist, with different tradeoffs in terms of
simplicity, assumptions, reactivity, smoothness, etc. [22]
[22] R. Casadei, F. Damiani, and M. Viroli,
2017 IEEE 11th International Conference on Self-Adaptive and Self-Organizing Systems (SASO), IEEE, 2017
R. Casadei Context 14/32

Introduction
Examples: channel (around obstacles)
Channel: resiliently dene a domain of devices providing the shortest path from a
source area to a destination area
R. Casadei Context 15/32

Introduction
Examples: channel (around obstacles)
R. Casadei Context 16/32

Introduction
Examples: channel (around obstacles)
R. Casadei Context 17/32

Introduction
Examples: SCR pattern [23]
Self-organising Coordination Regions (SCR) pattern: elect leaders!use
gradients to dene areas!spread & collect info in those areas to support feedback
loops
[23]R. Casadei, D. Pianini, M. Viroli, and A. Natali,
computing,” COORDINATION 2019, Proceedings, ser. Lecture Notes in Computer Science, Springer, 2019
R. Casadei Context 18/32

Introduction
From building blocks to applications
­Applications are built bycomposingelds/functions
óeach function comprisesbehaviour + interaction
óeach function generally steers someemergent collective behaviour
óoutput of a function (namely aeld) becomes the input of anothersource destination
gradient distancegradient
<=
+
dilate
width
37
10
1defchannel(source: Boolean, destination:
2 Boolean, width: Double) =
3 dilate(gradient(source) + gradient(destination) <=
4 distance(source, destination), width)Channel
gradient
(source)
gradient
(destination)
distanceBetween
source destination
Sub-
computations
Computation
Sensors
nbrRange
Input
Width
Platform
Local sensorsNeighbour data
R. Casadei Context 19/32

Introduction
From building blocks to applications
­Applications are built bycomposingelds/functions
óeach function comprisesbehaviour + interaction
óeach function generally steers someemergent collective behaviour
óoutput of a function (namely aeld) becomes the input of anothersource destination
gradient distancegradient
<=
+
dilate
width
37
10
1defchannel(source: Boolean, destination:
2 Boolean, width: Double) =
3 dilate(gradient(source) + gradient(destination) <=
4 distance(source, destination), width)Channel
gradient
(source)
gradient
(destination)
distanceBetween
source destination
Sub-
computations
Computation
Sensors
nbrRange
Input
Width
Platform
Local sensorsNeighbour data
R. Casadei Context 19/32

Outline
1
Context: Collective Adaptive Systems (CAS) and Macro-Programming
2
Background: Aggregate Programming (AP)
Introduction
Examples in ScaFi
Summary
3
Aggregate Programming and Declarativity: Retrospective
4
Wrap up

Introduction
Aggregate Computing/Programming in 1 Slide
Self-org-like programming model
interaction:continuousmsg exchange withneighbours
behaviour:continuousexecution of async rounds of
sense – compute – (inter)act
abstraction: (dev=evt7!V)
paradigm:
formal model of executions:event structures
formal core language:eld calculus [5]
semantics:(1) device; (2) network; (3) global comp. sensors
local functions
actuators
Application
Code
Developer
APIs
Field Calculus
Constructs
Resilient
Coordination
Operators
Device
Capabilities
functions repnbr
TGCfunctions
communication state
Perception
summarize
average
regionMax

Action State
Collective Behavior
distanceTo
broadcast
partition

timer
lowpass
recentTrue

collectivePerception
collectiveSummary
managementRegions

Crowd Management
dangerousDensity crowdTracking
crowdWarning safeDispersal
restriction
s
e
lf
­
s
t
a
b
ilis
a
t
io
n
J. Beal, D. Pianini, and M. Viroli,
things,”Computer, no. 9, 2015
0

1

2

3

4
devicetime

0
0

0
1

0
2

0
3

0
4

1
0

1
1

1
2

1
3

1
4

1
5

2
0

2
1

2
2

2
3

3
0

3
1

3
2

3
3

3
4

3
5

4
0

4
1

4
2
messageself-message reb o ot source destination
gradient distancegradient
<=
+
dilate
width
37
10
1defchannel(source: Boolean, destination:
2 Boolean, width: Double) =
3 dilate(gradient(source) + gradient(destination) <=
4 distance(source, destination), width)
R. Casadei Context 20/32

Outline
1
Context: Collective Adaptive Systems (CAS) and Macro-Programming
2
Background: Aggregate Programming (AP)
3
Aggregate Programming and Declarativity: Retrospective
4
Wrap up

AC and Declarativity: Overview
Key point #1:aggregate programming can be seen as a way ofdeclaring
computational eld(working as adenotation for distributed, space-time results) in
terms of other input computational elds
Key point #2:such a declarativity is achieved byabstractingmultiple aspects, including
óstructure
óscheduling and execution
ócommunication
ódeployment
(see next slides)
Key point #3:such declarativity/abstraction
óhas some (unclear?) implications on the programming practice and effectiveness for CAS
óenablesdeferring,optimising, andlearningexecution and implementation details
R. Casadei Context 21/32

AC and Declarativity: Overview
Key point #1:aggregate programming can be seen as a way ofdeclaring
computational eld(working as adenotation for distributed, space-time results) in
terms of other input computational elds
Key point #2:such a declarativity is achieved byabstractingmultiple aspects, including
óstructure
óscheduling and execution
ócommunication
ódeployment
(see next slides)
Key point #3:such declarativity/abstraction
óhas some (unclear?) implications on the programming practice and effectiveness for CAS
óenablesdeferring,optimising, andlearningexecution and implementation details
R. Casadei Context 21/32

AC and Declarativity: Overview
Key point #1:aggregate programming can be seen as a way ofdeclaring
computational eld(working as adenotation for distributed, space-time results) in
terms of other input computational elds
Key point #2:such a declarativity is achieved byabstractingmultiple aspects, including
óstructure
óscheduling and execution
ócommunication
ódeployment
(see next slides)
Key point #3:such declarativity/abstraction
óhas some (unclear?) implications on the programming practice and effectiveness for CAS
óenablesdeferring,optimising, andlearningexecution and implementation details
R. Casadei Context 21/32

AP: abstraction of systemstructure
The aggregate programabstracts from the logical structure
­communication depends on the orthogonalneighbouring relationship
otopology is important for the emergent result, but it is an orthogonal aspect
­structural aspects can be retrieved/promoted by the program (cf. leader election)
­taking this a step further,devices could also be dynamically synthesised (virtual
devices)[24]
Thelogical structure is independent of the physical structure
óphysical topology != logical topologyamorphous
(abstracted system)
logical system
cloud
physical system
abstraction
cloud
deployed system
[24]R. Casadei, D. Pianini, M. Viroli, and D. Weyns,
self-organising cyber-physical collectives,”Applied Sciences, no. 1, Dec. 2021
R. Casadei Context 22/32

AP: abstraction of systemstructure
The aggregate programabstracts from the logical structure
­communication depends on the orthogonalneighbouring relationship
otopology is important for the emergent result, but it is an orthogonal aspect
­structural aspects can be retrieved/promoted by the program (cf. leader election)
­taking this a step further,devices could also be dynamically synthesised (virtual
devices)[24]
Thelogical structure is independent of the physical structure
óphysical topology != logical topology
Host (thin/application-level)Host (thick/infrastructure-level)Logical deviceDevice's sensor setDevice's actuator setDevice's communication interfaceDevice's stateDevice's behaviourHost-to-host linkLogical, neighbouring linkTwin relationship12354
111
112
22
2233
3
3344
4
4455
5
55
[24]R. Casadei, D. Pianini, M. Viroli, and D. Weyns,
self-organising cyber-physical collectives,”Applied Sciences, no. 1, Dec. 2021
R. Casadei Context 22/32

Abstraction ofcommunication
Abstraction of theactual communication recipients
óthrough the orthogonal
Abstraction of theunderlying communication technology
ópoint-to-point vs. broadcasts
ópublish-subscribe services
óstigmergy (environment-mediated interaction)
R. Casadei Context 23/32

AP: abstraction ofscheduling and execution
Abstraction ofscheduling type
óround-based
óreactive25]
Abstraction ofscheduling policy
óhomogeneous vs. heterogeneous
óstatic vs. dynamic
ósynchronous vs. asynchronousagent
&omputationround
&onte[t
evaluation
$ggregate
program
evaluation
&onte[t
action
6cKeduling
polic\
6ensors
6tate
,nbound
0essagebo[
2utbound
0essagebo[
$ctuators
neigKbours
$ggregate
program




R. Casadei Context 24/32

AP: abstraction ofdeployment
Multipleapplication partitioning modelsare possible
ópulverisation26] as a notable example; functional decompositionalso possible [27]
Given an aggregate application partitioning,multiple deployment plansare possible
logical
device
behaviourcommunicationstatesensorsactuatorsneighbour
device
Host (thin/application-level)Host (thick/infrastructure-level)Logical deviceDevice's sensor setDevice's actuator setDevice's communication interfaceDevice's stateDevice's behaviourHost-to-host linkLogical, neighbouring linkTwin relationship12354
111
112
22
2233
3
3344
4
4455
5
55
[26]R. Casadei, D. Pianini, A. Placuzzi, M. Viroli, and D. Weyns,
Engineering the self-organizing logic separated from deployment,”Future Internet, no. 11, 2020
[27] R. Casadei,
macro-programming approach,” ACSOS 2024, In publication, IEEE, 2024
R. Casadei Context 25/32

AP declarativity: enablers and implications
Some enablers
self-stabilisation28]: guaranteed eventual convergence upon input stability
ócan be proved for a subset of FC fragments; preserved by composition (!)
device distribution independence29]: the ability of programming for an idealised
continuous environment, of which an actual system execution constitutes an
approximation
Some examples of implications
Ability tolearn optimised execution policies(e.g., with RL) [30]
Ability togenerate and assess deployment plans on heterogeneous multi-scale
infrastructures[31],even at runtime[32]
[30] R. Casadei, and M. Viroli,
platform-level reinforcement learning approach,” ACSOS 2022, IEEE, 2022
[31]R. Casadei, G. Fortino, D. Pianini, A. Placuzzi, C. Savaglio, and M. Viroli,
simulation-based toolchain for estimating deployment performance of smart collective services at the edge,”
IEEE Internet Things J., 2022
[32] R. Casadei, and M. Viroli,
deployment reconguration at runtime,”Future Gener. Comput. Syst., 2024
R. Casadei Context 26/32

AP and Declarativity: Remarks
emergent behaviour = environment + distributed aggregate computation (program +
execution model + deployment)
oa program mayassume/be correctonly for asubset of target environments/scenarios
­usually, disruptions (e.g., node/link failure) are “automatically” dealt with (as local contexts
will be affected, adapting device responses)
R. Casadei Context 27/32

Outline
1
Context: Collective Adaptive Systems (CAS) and Macro-Programming
2
Background: Aggregate Programming (AP)
3
Aggregate Programming and Declarativity: Retrospective
4
Wrap up

Conclusion
Our experience:we had, a working paradigm for CASs
óearly results stimulated us togeneraliseandseek for abstraction
óstimulated research related todeferring,optimising, andlearningexecution and
implementation detailsenvironment
macro
program
macro
level
micro
level
micro
program(s)
macro-to-
micro
emergence
actual
macro
testing
macro-
programming
desired
macro
macro-
abstractions neighborhood
device agent
&omputationround
&onte[t
evaluation
$ggregate
program
evaluation
&onte[t
action
6cKeduling
polic\
6ensors
6tate
,nbound
0essagebo[
2utbound
0essagebo[
$ctuators
neigKbours
$ggregate
program




R. Casadei Context 28/32

References
[1] R. Casadei, Artif. Life,
pp. 1–35, 2023,ISSN: 1064-5462.DOI:10.1162/artl_a_00408 .
[2]
algorithms,”CoRR, vol. abs/1911.10635, 2019. arXiv:1911.10635.
[3] R. Casadei, and M. Viroli,
COORDINATION 2022 Proceedings, ser. Lecture Notes in Computer Science, vol. 13271, Springer, 2022,
pp. 72–91.DOI:10.1007/978-3-031-08143-9\_5 .
[4] R. Casadei,
modelling,”ACM Comput. Surv., vol. 55, no. 13s, 2023,ISSN: 0360-0300.DOI:10.1145/3579353.
[5] R. Casadei, and D. Pianini,
calculus and aggregate computing,”J. Log. Algebraic Methods Program., vol. 109, 2019.
[6]
Theory and applications,”Int. J. Softw. Tools Technol. Transf., vol. 22, no. 4, pp. 437–455, 2020.DOI:
10.1007/S10009-020-00555-2 .
[7] ACM Comput. Surv., vol. 53,
no. 4, 81:1–81:35, 2021.DOI:10.1145/3397495.
[8] J. Autom. Reason.,
vol. 67, no. 2, p. 21, 2023.DOI:10.1007/S10817-023-09665-3 .
[9] Multi-agent oriented programming: programming multi-agent
systems using JaCaMo. Mit Press, 2020.
[10] Formal
Ontology in Information Systems - Proceedings of the 11th International Conference, FOIS 2020, ser. Frontiers in
Articial Intelligence and Applications, vol. 330, IOS Press, 2020, pp. 186–200.DOI:10.3233/FAIA200671.
R. Casadei Context 29/32

References
[11] Computer, vol. 48, no. 9,
pp. 22–30, 2015.
[12] R. Casadei, F. Damiani, and M. Viroli,
Distribution and Adaptivity with Functional Programming and Scala,”Log. Methods Comput. Sci., vol. Volume 19,
Issue 1, Jan. 2023.DOI:10.46298/lmcs-19(1:6)2023 .
[13] R. Casadei, F. Damiani, G. Salvaneschi, and M. Viroli,
programming language design for distributed collective systems,”J. Syst. Softw., vol. 210, p. 111 976, 2024.DOI:
10.1016/J.JSS.2024.111976 . [Online]. Available:https://doi.org/10.1016/j.jss.2024.111976 .
[14] ACM
Transactions on Computational Logic (TOCL), vol. 20, no. 1, pp. 1–55, 2019.
[15]R. Casadeiand M. Viroli, First Workshop on Programming Models
and Languages for Distributed Computing, PMLDC@ECOOP 2016, Rome, Italy, July 17, 2016, ACM, 2016, p. 5.
DOI:10.1145/2957319.2957372 . [Online]. Available:https://doi.org/10.1145/2957319.2957372 .
[16] R. Casadei, and M. Viroli,
programming,” COORDINATION 2023, Proceedings, ser. Lecture Notes in Computer Science, vol. 13908,
Springer, 2023, pp. 31–51.DOI:10.1007/978-3-031-35361-1\_2 .
[17]R. Casadei, M. Viroli, G. Audrito, D. Pianini, and F. Damiani,
aggregate processes,”Engineering Applications of Articial Intelligence, vol. 97, p. 104 081, 2020.
[18]R. Casadei, C. Tsigkanos, M. Viroli, and S. Dustdar,
SCC, IEEE, 2019, pp. 36–45.
[19]R. Casadei, A. Aldini, and M. Viroli,
Science of Computer Programming, vol. 167, pp. 114–137, 2018.
[20]R. Casadei, M. Viroli, G. Aguzzi, and D. Pianini,
SoftwareX, vol. 20, p. 101 248, 2022.DOI:10.1016/j.softx.2022.101248 .
R. Casadei Context 30/32

References
[21] R. Casadei, N. Maltoni, D. Pianini, and M. Viroli,
coordination programming,” COORDINATION 2021, , Proceedings, ser. Lecture Notes in Computer Science,
vol. 12717, Springer, 2021, pp. 285–299.DOI:10.1007/978-3-030-78142-2\_18 .
[22] R. Casadei, F. Damiani, and M. Viroli,
2017 IEEE 11th International Conference on Self-Adaptive and Self-Organizing Systems (SASO), IEEE, 2017,
pp. 91–100.
[23]R. Casadei, D. Pianini, M. Viroli, and A. Natali,
computing,” COORDINATION 2019, Proceedings, ser. Lecture Notes in Computer Science, vol. 11533,
Springer, 2019, pp. 182–199.DOI:10.1007/978-3-030-22397-7_11 .
[24]R. Casadei, D. Pianini, M. Viroli, and D. Weyns,
self-organising cyber-physical collectives,”Applied Sciences, vol. 12, no. 1, p. 349, Dec. 2021.DOI:
10.3390/app12010349.
[25]R. Casadei, F. Dente, G. Aguzzi, D. Pianini, and M. Viroli,
macro approach,” ACSOS 2023, IEEE, 2023.DOI:10.1109/ACSOS58161.2023.00026 .
[26]R. Casadei, D. Pianini, A. Placuzzi, M. Viroli, and D. Weyns,
Engineering the self-organizing logic separated from deployment,”Future Internet, vol. 12, no. 11, p. 203, 2020.
[27] R. Casadei,
macro-programming approach,” ACSOS 2024, In publication, IEEE, 2024.
[28]
self-stabilisation,”ACM Transactions on Modeling and Computer Simulation (TOMACS), vol. 28, no. 2, pp. 1–28,
2018.
[29] ACM
Trans. Auton. Adapt. Syst., vol. 12, no. 3, 12:1–12:29, 2017.DOI:10.1145/3105758.
R. Casadei Context 31/32

References
[30] R. Casadei, and M. Viroli,
reinforcement learning approach,” ACSOS 2022, IEEE, 2022, pp. 11–20.DOI:
10.1109/ACSOS55765.2022.00019 .
[31]R. Casadei, G. Fortino, D. Pianini, A. Placuzzi, C. Savaglio, and M. Viroli,
toolchain for estimating deployment performance of smart collective services at the edge,”IEEE Internet Things
J., pp. 1–1, 2022.DOI:10.1109/JIOT.2022.3172470 .
[32] R. Casadei, and M. Viroli,
reconguration at runtime,”Future Gener. Comput. Syst., vol. 161, pp. 545–558, 2024.DOI:
10.1016/J.FUTURE.2024.07.042 .
[33] R. Casadei, M. Viroli, and A. Natali,
coordination regions pattern,”Future Gener. Comput. Syst., vol. 114, pp. 44–68, 2021.
[34]R. Casadei, M. Viroli, A. Ricci, and G. Audrito,
COORDINATION 2021, Proceedings, ser. LNCS, vol. 12717, Springer, 2021, pp. 149–167.DOI:
10.1007/978-3-030-78142-2_10 .
[35]
Expert Syst. J. Knowl. Eng., vol. 35, no. 5, 2018.DOI:10.1111/exsy.12273.
[36] R. Casadei, M. Viroli, S. Mariani, and F. Zambonelli,
Programmable Distributed Schedulers,”Log. Methods Comput. Sci., vol. Volume 17, Issue 4, Nov. 2021.DOI:
10.46298/lmcs-17(4:13)2021 .
[37] R. Casadei, and M. Viroli, 42nd
IEEE International Conference on Distributed Computing Systems, ICDCS Workshops, Bologna, Italy, July 10,
2022, IEEE, 2022, pp. 119–124.DOI:10.1109/ICDCSW56584.2022.00032 .
R. Casadei Context 32/32

Self-Organising Coordination Regions (SCR) [33]
[33] R. Casadei, M. Viroli, and A. Natali,
coordination regions pattern,”Future Gener. Comput. Syst., 2021
R. Casadei Context 33/32

Aggregate processes [17] W
Concurrent, dynamic, overlapping collective tasks with evolving domains
Aggregate processes: dynamic concurrent eld computations
how would you code in ScaFi a limited multi-gradient?
1defmultiGradient(isSrc: Boolean, maxExtension: Double) =
2spawn[ID,Double,Double](src =>limit=>
3 gradient(src==mid,nbrRange) match{
4 casegifsrc==mid && !isSrc =>(g, Terminated)
5 casegifg>limit=>(g, External)
6 caseg=>(g, Output)
7 },
8 newKeys =if(isSrc) Set(mid) elseSet.empty,
9 args = maxExtension
10)
[17]R. Casadei, M. Viroli, G. Audrito, D. Pianini, and F. Damiani,
aggregate processes,”Engineering Applications of Articial Intelligence, 2020
R. Casadei Context 34/32

Situated tuples [34] [35] W
timespaceout
y
out
rd
y
rd
Mtimespace/devicesoutinM
0
in

0
M
C
y
in

y
out
[34]R. Casadei, M. Viroli, A. Ricci, and G. Audrito,
COORDINATION 2021, Proceedings, ser. LNCS, Springer, 2021
[35]
tuples,”Expert Syst. J. Knowl. Eng., no. 5, 2018
R. Casadei Context 35/32

PulverisationW
A model for partitioning/deployment of AC systems [26]
logical
device
behaviourcommunicationstatesensorsactuatorsneighbour
device
Host (thin/application-level)Host (thick/infrastructure-level)Logical deviceDevice's sensor setDevice's actuator setDevice's communication interfaceDevice's stateDevice's behaviourHost-to-host linkLogical, neighbouring linkTwin relationship12354
111
112
22
2233
3
3344
4
4455
5
55
[26]R. Casadei, D. Pianini, A. Placuzzi, M. Viroli, and D. Weyns,
Engineering the self-organizing logic separated from deployment,”Future Internet, no. 11, 2020
R. Casadei Context 36/32

A sim-based methodology for deployment evaluation [31]
[31] R. Casadei , G. For tino, D. Pianini, A. Placuzzi, C. Savaglio, and M. Viroli,
toolchain for estimating deployment perfor mance of smar t collective ser vices at the edge,? IEEE Inter net Things J. , 2022
R. Casadei Context 37/32

MacroSwarm [16]
MacroSwarm: a high-level API (backed by AC) for programming swarms
Experiments:https://github.com/AggregateComputing/
experiment-2023-coordination-swarm-behaviour
Video:https://youtu.be/1HKVlY-8bZY
Presentation (by G. Aguzzi):WMacro Swarm
Base Movement
FlockingLeader Based
Team Formation Pattern Formation Swarm
Planning
Resilient
Coordination
Operators
C G S
Field-Coordination
Constructs     
rep nbr branch
vShapelinecenteredCircle
plan
separation
execute
cohesionalignsinkAtalignWith
isTeamFormed teamFormation
goTo
explore
brownian
maintainUntil
[16] R. Casadei, and M. Viroli,
programming,” COORDINATION 2023, Proceedings, ser. Lecture Notes in Computer Science, Springer, 2023
R. Casadei Context 42/32

FRASP: functional reactive AC [25]
FRASP (Functional Reactive Approach to Self-organisation Programming): a FRP-based
reimplementation of AC
Presentation:https://www.slideshare.net/RobertoCasadei/
selforganisation-programming-a-functional-reactive-macro-approach
Videos:
óGradient example:https://youtu.be/3QIWfNq3yxU
óChannel example:https://youtu.be/j_JX5wW03-wChannel
gradient
(source)
gradient
(destination)
distanceBetween
source destination
Sub-
computations
Computation
Sensors
nbrRange
Input
Width
Platform
Local sensorsNeighbour data
[25]R. Casadei, F. Dente, G. Aguzzi, D. Pianini, and M. Viroli,
macro approach,” ACSOS 2023, IEEE, 2023
R. Casadei Context 43/32