Languages and Calculi for Collective Adaptive Systems
Rocco De Nicola Joint work with
- Y. A. Alrahman, M. Loreti, R. Pugliese and F. Tiezzi
Languages and Calculi for Collective Adaptive Systems Rocco De - - PowerPoint PPT Presentation
Languages and Calculi for Collective Adaptive Systems Rocco De Nicola Joint work with Y. A. Alrahman, M. Loreti, R. Pugliese and F. Tiezzi 27th Nordic Workshop on Programming Theory Reykjavik October 2015 Contents 1 Introduction 2
1/51
◮ massive numbers of components ◮ complex interactions among components, and other systems ◮ operating in open and non-deterministic environments ◮ dynamically adapting to new requirements, technologies and
◮ the dimension of the systems ◮ the need to adapt to changing environments and requirements ◮ the emergent behaviour resulting from complex interactions ◮ the uncertainty during design-time and run-time
Introduction
2/51
Introduction
3/51
◮ Systems must be specified as naturally as possible; ◮ distinctive aspects of the domain need to be first-class citizens to
◮ high-level abstract models guarantee feasible analysis; ◮ the analysis of results is based on systems features (not on their
Introduction
4/51
Introduction
5/51
Programming Abstractions for CAS
6/51
◮ Components have an interface exposing component attributes ◮ Ensembles are not rigid networks but highly flexible structures where
◮ Interaction between components is based on attributes and predicates
SCEL: A Language for CAS
7/51
◮ Components:
Knowledge
Processes
Interface
Policies
◮ Systems:
Knowledge
K
Processes
P
I
Interface
Π
Policies Knowledge
K
Processes
P
I
Interface
Π
Policies
Knowledge
K
Processes
P
I
Interface
Π
Policies
SCEL: A Language for CAS
8/51
Knowledge
Processes
Interface
Policies Normal flow Reasoner Integrator
Reasoner
Reasoning request
SCEL: A Language for CAS
9/51
SCEL: A Language for CAS
10/51
Collectives Formation in SCEL
11/51
◮ SCEL syntax does not have specific syntactic constructs for building
◮ Components Interfaces specify (possibly dynamic) attributes (features)
◮ Predicate-based communication tests attributes to select the
Collectives Formation in SCEL
12/51
◮ Ensembles are determined by the predicates validated by each
◮ There is no coordinator, hence no bottleneck or critical point of failure ◮ A component might be part of more than one ensemble
Collectives Formation in SCEL
13/51
◮ id ∈ {n, m, p} ◮ active = yes ∧ battery level > 30% ◮ rangemax >
◮ true ◮ trust level > medium ◮ . . . ◮ trousers = red ◮ shirt = green
Collectives Formation in SCEL
14/51
◮ the group of components with which the specific component wants to
◮ the components from which it is willing to accept invitations to join in
Collectives Formation in SCEL
15/51
◮ The structure of the aggregated components is static, defined once
◮ a component can be part of just one ensemble.
Collectives Formation in SCEL
16/51
Collectives Formation in SCEL
17/51
Collectives Formation in SCEL
17/51
◮ knowledge (a single interface that contains basic methods to
◮ policies (based on the pattern composite with policies structured
◮ . . .
Collectives Formation in SCEL
18/51
◮ have limited battery lifetime ◮ can discover target locations ◮ can inform other robots about their location
Collectives Formation in SCEL
19/51
WORKERS LANDMARKS VICTIM robot perception range
◮ Two kind of robots (landmarks and
◮ No obstacles (except room walls) ◮ Landmarks randomly walk until
◮ Workers initially motionless; they
Collectives Formation in SCEL
20/51
2 1 1 2 3 3
Collectives Formation in SCEL
21/51
◮ We obtain a sort of computational
◮ When workers reach a landmark at
Collectives Formation in SCEL
22/51
VictimSeeker = qry(“victimPerceived”, true)@self . put(“stop”)@self . put(“victim”, self , 0)@self DataForwarder = qry(“victim”, ?id, ?d)@(role = “landmark”). put(“stop”)@self . put(“victim”, self , d + 1)@self RandomWalk = put(“direction”, 2πrand())@self . qry(“collision”, true)@self . RandomWalk
GoToVictim = qry(“victim”, ?id, ?d)@(role = “landmark”). put(”start”)@self . put(“direction”, towards(id))@self . while(d > 0){ d := d − 1. qry(“victim”, ?id, d)@(role = “landmark”). put(“direction”, towards(id))@self } qry(“victimPerceived”, true)@self . put(“stop”)@self
Collectives Formation in SCEL
23/51
VictimSeeker = qry(“victimPerceived”, true)@self . put(“stop”)@self . put(“victim”, self , 0)@self DataForwarder = qry(“victim”, ?id, ?d)@(role = “landmark”). put(“stop”)@self . put(“victim”, self , d + 1)@self RandomWalk = put(“direction”, 2πrand())@self . qry(“collision”, true)@self . RandomWalk
GoToVictim = qry(“victim”, ?id, ?d)@(role = “landmark”). put(”start”)@self . put(“direction”, towards(id))@self . while(d > 0){ d := d − 1. qry(“victim”, ?id, d)@(role = “landmark”). put(“direction”, towards(id))@self } qry(“victimPerceived”, true)@self . put(“stop”)@self
Collectives Formation in SCEL
23/51
VictimSeeker = qry(“victimPerceived”, true)@self . put(“stop”)@self . put(“victim”, self , 0)@self public class VictimSeeker extends Agent { private int robotId; protected void doRun() throws IOException, InterruptedException{ query(new Template(new ActualTemplateField(”VICTIM PERCEIVED”), new ActualTemplateField(true)) , Self.SELF); put( new Tuple( ”stop” ) , Self.SELF); put( new Tuple( ”victim” , robotId , 0 ) , Self.SELF); } } }
Collectives Formation in SCEL
24/51
Collectives Formation in SCEL
25/51
1000 2000 3000 4000 5000
0.2 0.4 0.6 0.8 1
10 Landmarks 20 Landmarks 50 Landmarks 100 Landmarks
Collectives Formation in SCEL
26/51
Intermezzo
27/51
◮ CAS consist of large numbers of interacting components which exhibit
◮ CAS components may enter or leave the collective at anytime and
AbC: A Process Calculus for CAS
28/51
◮ Systems are represented as sets of parallel components, each of them
AbC: A Process Calculus for CAS
29/51
◮ Systems are represented as sets of parallel components, each of them
◮ Communication actions (send and receive) are decorated with
AbC: A Process Calculus for CAS
29/51
◮ Systems are represented as sets of parallel components, each of them
◮ Communication actions (send and receive) are decorated with
◮ Communication takes place in an implicit multicast fashion, and
AbC: A Process Calculus for CAS
29/51
◮ Systems are represented as sets of parallel components, each of them
◮ Communication actions (send and receive) are decorated with
◮ Communication takes place in an implicit multicast fashion, and
◮ Components are unaware of the existence of each other and they
AbC: A Process Calculus for CAS
29/51
◮ Systems are represented as sets of parallel components, each of them
◮ Communication actions (send and receive) are decorated with
◮ Communication takes place in an implicit multicast fashion, and
◮ Components are unaware of the existence of each other and they
◮ Components can offer different views of themselves and can
AbC: A Process Calculus for CAS
29/51
◮ Systems are represented as sets of parallel components, each of them
◮ Communication actions (send and receive) are decorated with
◮ Communication takes place in an implicit multicast fashion, and
◮ Components are unaware of the existence of each other and they
◮ Components can offer different views of themselves and can
◮ Semantics for output actions is non-blocking while input actions are
AbC: A Process Calculus for CAS
29/51
◮ A swarm of robots is spread throughout a disaster
◮ Robots have rˆ
◮ Initially all robots are explorers; a robot that finds a
◮ An explorer that receives information about a victim
◮ The rescuing procedure starts when the ensemble is
AbC: A Process Calculus for CAS
30/51
◮ Single component Γ :P – Γ denotes sets of attributes and P processes ◮ Parallel composition – of components ◮ Name restriction νx (to delimit the scope of name x) – in C1(νx)C2,
◮ Each robot is modeled as an AbC component (Roboti) of the following
◮ Robots execute in parallel and collaborate.
AbC: A Process Calculus for CAS
31/51
◮ new(x)P – Process name restriction ◮ ΠP – blocks P until the evaluation of Π under the local environment
◮ Act – communication and attribute update actions
◮ When Π evaluates to true (e.g., victim detection), the process
◮ Otherwise PR performs a2 to continue as P2 (help rescuing a victim).
AbC: A Process Calculus for CAS
32/51
◮ Π(˜
◮ ( ˜
◮ [a := E]: – updates the value of a with the result of evaluating E.
AbC: A Process Calculus for CAS
33/51
◮ Π(˜
◮ ( ˜
◮ [a := E]: – updates the value of a with the result of evaluating E.
◮ By specifying Π, a1, and a2, PR becomes:
AbC: A Process Calculus for CAS
33/51
◮ Π(˜
◮ ( ˜
◮ [a := E]: – updates the value of a with the result of evaluating E.
◮ By specifying Π, a1, and a2, PR becomes:
AbC: A Process Calculus for CAS
33/51
AbC: A Process Calculus for CAS
34/51
◮ we use the λ-label to range over broadcast, input, update and internal
◮ we use the α-label to range over all λ-labels plus the input-discarding
AbC: A Process Calculus for CAS
35/51
◮ Proc stands for Processes and Comp stands for a Components, ◮ PLAB stands stands for
◮ CLAB stands for {ν˜
AbC: A Process Calculus for CAS
36/51
Γ|s:(˜ v)@Π
v/˜ x]Γ=Π′
1
(Γ′| =Π′
1)
Π1(˜ x).P
Γ′:(˜ v)@Π2
Γ P[˜ v/˜ x]
◮ PR resides within a robot with Γ(id) = 1 ◮ Some possible evolutions where Γ′ = Γ1|{role} are:
[this.state:=stop]
Γ′:(1, qry)@(role=rescuer ∨ role=helping)
AbC: A Process Calculus for CAS
37/51
v)@Π2
v)@Π
v)@Π
v)@Π
◮ Rules like (FBrd) models the non-blocking nature of the broadcast; ◮ Rules like (FSum)), are instead used to control internal
◮ PR resides within a robot with
◮ PR can discard unwanted broadcasts.
2:(info)@(role=explorer)
AbC: A Process Calculus for CAS
38/51
P
Γ′:(˜ v)@Π
Γ P′ Γ : P
Γ′:(˜ v)@Π
Γ′:(˜ v)@Π
Γ P′ (Γ| =Π) Γ : P
Γ′:(˜ v)@Π
ν˜ xΓ:(˜ v)@Π
1
Γ:(˜ v)@Π
2
ν˜ xΓ:(˜ v)@Π
1 C ′ 2
2
AbC: A Process Calculus for CAS
39/51
◮ Assume Robot2 is “rescuer”, Robot3 is “helper”, and all others are
◮ Robot3 received victim information from Robot2 and now is in charge. ◮ Robot1 sent a msg containing its identity “this.id” and “qry” request
Γ:(<3,4>, ack)@(id=1)
R3
◮ Robot1 applies rule (C-Rcv) to receive victim information and
Γ:(<3,4>, ack)@(id=1)
2[< 3, 4 >/victimpos, ack/x]
AbC: A Process Calculus for CAS
40/51
◮ Robots can perform the above transitions since
◮ Now the overall system evolves by applying rule (Com) as follows:
Γ:(<3,4>, ack)@(id=1)
2[< 3, 4 >/victimpos, ack/x]
R3 . . . Γn :PRn
AbC: A Process Calculus for CAS
41/51
◮ =
∗ ◮ γ
γ
◮ ˆ γ
γ
◮
γ
◮ ∗ denotes()∗
A Behavioural Theory for AbC
42/51
ν˜ xΓ:(˜ v)@Π
∗ C ′ ↓Π.
∗ with .
A Behavioural Theory for AbC
43/51
γ
1 implies C2 ˆ γ
2 and (C ′ 1, C ′ 2) ∈ R
A Behavioural Theory for AbC
44/51
◮ Explicit Message Passing ◮ Group based Communications ◮ Publish-Subscribe
Communication Paradigms
45/51
Communication Paradigms
46/51
◮ A group name is encoded as an attribute in AbC. ◮ The constructs for joining or leaving a given group can be encoded as
◮ . . .
Communication Paradigms
47/51
◮ A Publisher sends tagged messages for all subscribers by exposing from
◮ Subscribers check compatibility of messages according to their
Communication Paradigms
48/51
◮ working on interaction policies for SCEL to study the possibility of
◮ considering different knowledge repositories and ways of expressing
◮ developping quantitative variants of SCEL and AbC to support
◮ Considering alternative semantics and behavioural equivalences for AbC ◮ Studying the impact of bisimulation (algebraic laws, axioms, proof
Ongoing and Future work
49/51
Ongoing and Future work
50/51
◮ Fellows are expected to be model citizens of the TCS community,
◮ INSTRUCTIONS: ◮ All nominees and nominators must be EATCS Members ◮ Submit by December 31 of the current year for Fellow
◮ The EATCS Fellows-Selection Committee ◮ Rocco De Nicola (IMT Lucca, Italy, chair) ◮ Paul Goldberg (Oxford, United Kingdom) ◮ Anca Muscholl (Bordeaux, France) ◮ Dorothea Wagner (Karlsruhe, Germany) ◮ Roger Wattenhofer (ETH Zurich, Switzerland)
Ongoing and Future work
51/51