1 Introduction
Population protocols have been introduced in [1, 2] as a restricted yet useful subclass of general distributed protocols. Each agent in a population protocol has a fixed amount of local storage, and an execution consists of selecting pairs of agents and letting them update their states based on an interaction. The choice of pairs is assumed to be performed by an adversary subject to a fairness condition. The fairness condition ensures that the adversary must allow the protocol to progress.
Typically, population protocols are studied from the point of view of recognising some properties of an input configuration. In this context population protocols and their subclasses have been studied from the point of view of expressive power [4], verification complexity [6, 10, 9], time to convergence [3, 7], necessary state count [5], etc.
The original target application of population protocols and related models is modelling networks of restricted sensors, starting from the original paper [1] on population protocols. Of course, in the modern applications the cheapest microcontrollers typically have tens of thousands of bits of volatile memory permitting the use of simpler and faster algorithms for recognising properties of an input configuration. So on the one hand, the original motivation for the restrictions in the population protocol model seems to have less relevance. On the other hand, verifying distributed systems benefits from access to a variety of restricted models with a wide range of tradeoffs between the expressive power and verification complexity, as most problems are undecidable in the unrestricted case. Complex, unrestricted, and impossible to verify distributed deployments lead to undesirable and hard to predict and sometimes even diagnose situations such as so called gray failures [12] and similar. On the other hand, desirable behaviours of distributed systems go beyond consensus about a single property of initial configuration. We find it natural to study what classes of properties a distributed system can eventually reach and then maintain indefinitely.
In the present paper we introduce a notion of constructive expressive power of a protocol model, formalising this question. We show that for population protocols, as well as for a useful subclass of population protocols, immediate observation (or oneway) population protocols, the constructive expressive power coincides with the classical expressive power.
We also show that immediate observation population protocols preserve their relatively low verification complexity in the constructive expressive power setting.
The rest of the present paper is organised as follows. First we provide the basic definitions and the previously known results about expressive power from the point of view of computing predicates. We continue by defining constructive expressive power. In the next section we establish the constructive expressive power of population protocols. Then in the following section we establish the constructive expressive power of immediate observation protocols and show that verification remains in in this setting just like in the setting of computing predicates. The paper ends with conclusion and future directions.
2 Basic definitions
First we define the population protocols, as well as their subclass, immediate observation population protocols.
A population protocol is defined by a finite set of states and a step relation . When there is no ambiguity about the protocol, we abbreviate as and call the quadruple a transition.
A population protocol is an immediate observation population protocol if implies . We say that an agent in the state changes its state to by observing and denote it .
A configuration of a population protocol is a multiset of states . We use the notation for a multiset such that is the number of times occurs among
. In some cases it is also convenient to interpret a multiset as a tuple or a vector with nonnegative integer coordinates and denote it e.g.
. Arithmetic operations and predicates apply to multisets pointwise (coordinatewise). The size of a configuration is the sum of images of all states, . An execution of a population protocol is a finite or infinite sequence of configurations such that for each between and the execution length we have and where . In other words, we let two agents with states and interact in some way permitted by the relation.Consider the set of states . The step relation described by , , , , , is a population protocol but not an immediate observation population protocol. An example execution is: . Here we use the first two steps, then twice the fourth step.
On the other hand, , , , , is an immediate observation population protocol that can also be described as , , , , . An example execution is: . Here we use the first two possible steps, then the last two possible steps.
Note that all the configurations in an execution have the same size.
We often consider executions with the steps chosen by an adversary. However, we need to restrict adversary to ensure that some useful computation remains possible. To prevent the adversary from e.g. only letting one pair of agents to interact, we require the executions to be fair. The fairness condition can also be described by comparison with random choice of steps to perform: fairness is a combinatorial way to exclude a zeroprobability set of bad executions.
Consider a population protocol .
A configuration is reachable from configuration iff there is a finite execution with the initial configuration and the final configuration .
A finite execution is fair if it is not a beginning of any longer execution.
An infinite execution is fair if for every configuration either is not reachable from some (and all the following configurations), or occurs among infinitely many times.
The finite executions in the example 2 are fair.
The most popular notion of expressive power for population protocols is computing predicates, defined in the following way.
Consider a population protocol with additionally defined nonempty set of input states , output alphabet and output function .
Support of a configuration is the set of all states with nonzero images, The states belonging to the support of a configuration are also called inhabited in the configuration. .
A configuration is an input configuration if its support is a subset of the set of the input states, .
A configuration is a consensus for some if the output function yields for all the inhabited states, A configuration is a stable consensus if it is a consensus together with all the configurations reachable from it. A configuration is called just a consensus or a stable consensus if it is a consensus (respectively stable consensus) for some .
A protocol computes a function iff for each input configuration every fair execution with initial configuration contains a stable consensus. We usually use the protocols computing predicates, which corresponds to .
If we define the set of input states , output set and the output function , both protocols in the example 2 compute the predicate .
The expressive power of population protocols and immediate observation population protocols has been studied in [4].
A cube is the set of configurations defined by a lower and an upper bound for the number of agents in each state. The lower bound can be zero, the upper bound can be infinite. A counting set is a finite union of cubes.
An integer cone is the set of multisets defined by a base multiset (or just base) and a finite number of period multisets (periods) . A multiset belongs to the cone if it can be represented as a sum of the base multiset and a nonnegative integer combination of periods. A semilinear set is a finite union of integer cones.
[[4]] Population protocols can compute membership in semilinear sets and no other predicates.
Immediate observation population protocols can compute membership in counting sets and no other predicates.
We now define constructive expressive power of protocols.
A configuration satisfies an output condition iff is . In other words, we consider the multiset of the outputs correspoding to the states of individual agents then apply to this multiset. A configuration ensures an output condition (given the protocol ) if every configuration reachable from (including ) satisfies . A protocol ensures from configuration , if every fair execution of starting from reaches a configuration that ensures . A protocol ensures , if it ensures from every input configuration.
An output condition and size are compatible if there exists a multiset of size satisfying , i.e. holds. An output condition is sizeflexible if it is compatible with every (nonnegative integer) size.
We interpret each multiset as an output condition .
Both protocols from the example 2 ensure the condition . This condition is ensured by any protocol computing a predicate.
Only sizeflexible conditions can be ensured.
Note that the same a protocol that ensures a predicate also ensures every predicate such that . Therefore defining constructive expressive power of a class of protocols requires an extra step.
A class of population protocols ensures a class of output conditions if for each sizeflexible there is a protocol that ensures .
A class ensures at most a class of output conditions if for each ensured by some protocol there is a sizeflexible condition implying , i.e. .
The class of protocols consisting of a single protocol, namely the immediate observation protocol from the example 2 with output function satisfying and , ensures the class of output conditions with a single condition , and at most that class.
Note that for a given class of protocols there is more than one class of output conditions such that ensures and at most . For example, adding a condition that follows from some to the class yields a class such that ensures and at most . We tolerate this and do not require minimality of because convenient classes of conditions, such as semilinear sets and counting sets, are not minimal.
3 Constructive power of population protocols
In this section we establish the constructive expressive power of general population protocols.
3.1 Constructing semilinear predicates
We start by providing a positive result, showing that every predicate that can be computed, can also be ensured.
The class of all population protocols ensures the class of semilinear output conditions.
The theorem follows from the following lemmas:
Each integer cone can be represented as a finite union of cones such that all the periods of each cone have the same size.
Proof.
Let the cone have base and periods for . Let be the least common multiple of . Consider all the bases where . We consider all the cones with such bases and periods . The size of all periods is ; it is easy to see that . ∎
For each integer cone with all periods having the same size there is a protocol such that the protocol ensures membership in from each input configuration of size compatible with .
Proof.
Let the cone have base and periods . Let and for each be sequences of output values enumerating the corresponding multisets with correct multiplicities.
Note that the sizes compatible with are sums of and a nonnegative multiple of as all the periods have the same length. In the special case of no periods, only size is compatible with . The idea of the construction is to select agents to output the base multiset, then split the remaining agents in groups of agents with the outputs forming the multiset . The split is performed by allowing some agents to recruit unassigned agents to positions in groups of size . If two such agents interact, one of them disbands the current group and becomes unassigned. Eventually we will have just one active agent having recruited every other agent in some group, and the last group is complete iff the total number of agents available is divisible by .
The protocol has the following states: for , and , , , for . The state plays a special role in the protocol and will also be denoted as . If there are no periods, we formally define to be also called and .
The only input state is if and otherwise. The transitions are as follows:

for all ;

;

for and
(for we produce ); 
for ;

.

for
(for the first agent also switches to the state ).
The output function yields for and for , , and .
It is easy to see that if there are at least agents, all states will eventually have exactly one agent, with the remaining agents switching to the state at some times during the execution.
Claim.
At every moment all the agents not in the states
can be split into groups with one agent in each state for from to some , plus one agent in the state or unless . Some of such groups contain only one agent in the state or .Indeed, this is true initially as there are either no agents except in the state or each agent forms a group being in the state , and each transition preserves the desired property.
In the following we will use the fairness condition to claim that if some property of configuration can always be destroyed by some transitions, it will eventually stop holding in any fair execution.
Note that once there are only agents in the states , the number of agents in the states cannot increase anymore, but will sometimes decrease until there is exactly one such agent. After that point, the sum of the indices of all the agents in the states with will only decrease until it becomes zero. Afterwards the number of agents in the state will only decrease until it reaches zero.
At that moment, if the difference between the number of agents and is divisible by , all agents will be divided into one group of agents with the multiset of outputs and some groups of agents each having multisets of outputs equal to . As all other sizes are not compatible with , this concludes the proof. ∎
The set of sizes compatible with an integer cone is a onedimensional integer cone.
Proof.
We identify the multisets with oneelement domain with natural numbers. The base of the cone is the size of the base configuration, and the periods are the sizes of the periods. We observe that using the same coefficients for nonnegative integer combinations proves that the constructed onedimensional cone contains exactly the sizes compatible with the original cone. ∎
Proof of the theorem 3.1.
Consider a sizeflexible semilinear set . We construct our protocol as a synchronous product of multiple subprotocols.
The set can be represented as a union of cones each having periods of the same size. We run synchronous product of protocols, ensuring membership in for all compatible sizes (using the lemma 3.1), and computing compatibility of configuration size with (this predicate is semilinear by the lemma 3.1 thus it can be computed by the theorem 2). The global output function is the output corresponding to construction of the first cone that is expected to be compatible with configuration size, where . If there is no such cone, we return the first element of the output set.
Eventually, all the protocols will converge to a stable consensus representing the true value of size compatibility. Therefore from some time on we will just use the output of corresponding to the first sizecompatible cone, which will be in from some point on by the lemma 3.1. ∎
3.2 Upper bound on constructive expressive power of population protocols
In this section we provide a matching upper bound for constructive expressive power.
The class of all population protocols ensures at most the class of semilinear output conditions.
The proof uses the fact from [13], describing the structure of reachability sets of VAS, a more general model than population protocols.
An asymptotic integer cone is a set of multisets defined by a base multiset (or just base) and a possibly infinite set of period multisets (periods) . We require that the domain of multisets and is finite; let its size be . We require that the convex hull of the origin and all the periods interpreted as vectors in is definable in . A multiset belongs to the cone if it can be represented as a sum of the base multiset and a nonnegative integer combination of periods. An almost semilinear set is a finite union of asymptotic integer cones.
The preimage of a set of configurations is the set such that iff there is some reachable from . The postimage of is the set such that iff it is reachable from some .
[[13], restriction of Corollary 6.3] For any semilinear sets of configurations and , the sets and are almost semilinear.
We also use the results on structure of mutual reachability from [8].
A configuration is a bottom configuration if for each configuration reachable from , the configuration is reachable from .
[[8], lemma 3 and proposition 14]
Each fair execution of a population protocol reaches a bottom configuration. The set of bottom configurations is semilinear.
Proof of the theorem 3.2.
Each fair execution reaches a reachable bottom configuration and then reaches it infinitely many times. Thus any output condition ensured by the protocol is satisfied by the output corresponding to any bottom configuration that is reachable from some input configuration. It suffices to find a sizeflexible semilinear set of reachable bottom configurations , as its image under the output function will also be sizeflexible and semilinear.
The proof idea is to consider underapproximations of the set of reachable bottom configuration using finite subsets of of periods. Observe that compatibility with any specific size can be demonstrated using just a finite number of periods; a simple divisibility argument shows that covering a finite set of sizes is sufficient.
We know that the set of bottom configuration is semilinear, and therefore the set of bottom configuration reachable from input configurations is almost semilinear. Let be the bases of corresponding asymptotic integer cones. Fix some enumeration of the periods of these cones, where is the th period of the th cone. Let be the maximum size of a base. Let be the least common multiple of for all from to corresponding to the cones with at least one period.
Note that compatibility with any given size can be demonstrated using a finite number of periods. Let be the maximal number of a period used to demonstrate compatibility with any size up to . We show that the semilinear set consisting of the integer cones with bases and periods for is sizeflexible. Indeed, consider any size . Let be the remainder of modulo . Consider the size . As this size is strictly larger than all the base sizes, its compatibility with has to be shown using an integer cone with base and a nonempty set of periods . Moreover, it can be demonstrated using only the periods , as and thus . We have , . As is divisible by , we can add the period to the configuration exactly times: and . This concludes the proof. ∎
4 Constructive expressive power of immediate observation protocols
In this section we switch to the study of constructive expressive power for a subclass of population protocols. namely immediate observation population protocols.
From the point of view of computing predicates, they have lower but still significant expressive power, but benefit from a much lower verification computational complexity than the general protocols, namely complete. We show that these properties also hold in the context of ensuring protocols.
4.1 Constructing counting sets
Just like in the case of general population protocols, we start by providing the feasibility result.
The class of immediate observation population protocols ensures the class of counting output conditions.
The proof is similar to the proof of the theorem 3.1.
For every multiset there is an immediate observation protocol with a single input state that ensures equality to from the input configuration of size .
Proof.
Let an enumeration for from to contain each element exactly times. The protocol has the input state and other states . The transitions are , and the output function is . It is easy to see that in a fair execution all agents will have different states and therefore produce output . ∎
For a multiset and output value consider the cube with the lower bounds specified by and the upper bounds specified by except for infinite upper bound for the value . Then there is an immediate observation protocol with a single input state that ensures membership in that cube from each input configuration of size at least .
Proof.
Again, let an enumeration for from to contain each element exactly times. The protocol has the input state and other states . The transitions are , and the output function is , . It is easy to see that in a fair execution with at least agents, states will contain one agent each with the rest of the agents in the state . Such a configuration will produce the output differing from only by increasing the multiplicity of , as required. ∎
Proof of the theorem 4.1.
Consider a sizeflexible counting constraint . It has to contain a cube with at least one infinite upper bound. Consider the smallest multiset in that cube, and the output value having an infinite upper bound. Let be the protocol corresponding to and by the lemma 4.1. Let for be the protocol constructed by the lemma 4.1 for some multiset of size satisfying the constraint .
By the theorem 2 there are immediate observation population protocols recognising equality of input size to respectively.
We consider the synchronous of all these protocols and define the output function to be the output of for the minimal such that outputs , or the output of if none does. Eventually, all the protocols provide correct configuration size information to each agent, and thus the outputs of the same or protocol are used by all the agents. By construction, the multiset of these outputs satisfies from some moment on. ∎
4.2 Structure of bottom configurations of immediate observation protocols
In this section we prove a structural lemma about the structure of bottom configurations of immediate observation protocols, which also implies an upper bound on constructive expressive power.
The set of bottom configurations of an immediate observation population protocol is a counting set.
We use the pruning techniques from [11]. The pruning approach is based on deanonymisation of the agents, giving agents identities and arbitrarily picking which specific agent performs the observation at each step in the execution. Note that there are usually many ways to deanonymise a single execution.
[[11], Pruning Lemma] Consider an immediate observation population protocol with the set of states , and a configuration reachable from another configuration . Consider an execution from to and its deanonymisation such that more than agents go from some state to a state , where and might be the same state. Then there is an execution from to and its deanonymisation where one less agent goes from to and for all other pairs of states the same number of agents go between them.
Proof of the theorem 4.2.
Consider an immediate observation population protocol with the set of states .
We prove the claim in the following equivalent form. For each bottom configuration , each configuration such that for each in the support of we have is also a bottom configuration.
The reformulated claim is proven by induction over the size if the configuration . If we have and the claim is obviously true. Otherwise let be such a state that . Consider any configuration reachable from and a deanonymised execution from to . By the pigeonhole principle, there is a state such that more than agents go from to .
We can prune the execution to obtain an execution from to . Note that . By the induction hypothesis, is a bottom configuration. Thus there is an execution from to . Let’s deanonymise it; if going from to and back permutes the agents, repeat this procedure the order of the permutation times. This yields an execution from to such that it moves all the agents back to the same states, undoing the execution from to .
Adding a noninteracting agent in the state provides an execution from to with most of the agents going in the opposite direction compared to . Combining this with the execution , we obtain an execution from to with only one agent going from to and the rest eventually going from their states back to the same states. Now we have at least agents going from to . We apply the lemma 4.2 for obtain an execution from to . We use again that is a bottom configuration to obtain an execution from to . Adding a noninteracting agent in the state provides an execution from to , proving that we can reach from via . As was an arbitrary configuration reachable from , this concludes the proof that is a bottom configuration. ∎
This structural result implies the desired constructive expressive power upper bound using one more lemma from [11].
[[11]] The set of configurations reachable from a given counting set of configurations is also a counting set.
The class of immediate observation population protocols ensures at most the class of counting output conditions.
Proof.
We observe that the set of reachable bottom configurations is a counting set as an intersection of the counting set of bottom configurations and the counting set of configurations reachable from input configuration. Then its image under the output function is a sizeflexible counting set implying the ensured output condition. ∎
4.3 Verification complexity for constructive immediate observation protocols
In this section we show that the relatively low verification complexity for immediate observation protocols is also applicable in the case of constructive expressive power.
The problem of verifying whether a given immediate observation protocol ensures a given counting output condition given as a list of cubes with bounds written in unary is in .
Here we use a convenient complexity claim from [9].
[[9], claim in the proof of Theorem 4.50] Given two functions that produce counting sets with membership and emptiness in and at most exponential constants from a counting set and a protocol, their boolean combinations as well as preimage and postimage also have the same properties.
Let and be two functions that take as arguments an IO protocol and a counting constraint , and return counting sets and respectively. Assume that and use bounds at most exponential in the size of the , and have decidable membership (given input , decide whether ) and emptiness.
Then the same is true about the counting sets
,
,
,
,
.
Proof of the theorem 4.3.
Given the output condition and a protocol, we have a counting set of configurations satisfying . The protocol ensures iff each reachable configuration can still reach a configuration in . In other words, no input configuration can reach a configuration outside the preimage of . This can be expressed as emptiness of where is the set of input configurations. As and are decidable in , repeated application of the lemma yields decidability of the desired emptiness. This concludes the proof. ∎
The proof of hardness of verification of immediate observation protocols given in [11] uses the constantly false protocol, thus it can be interpreted as hardness of verifying whether a protocol ensures .
5 Conclusion
We have introduced a notion of constructive expressive power for population protocols and have shown that both for general population protocols and for immediate observation population protocols it coincides with the expressive power in the classical setting of computing predicates. We have also shown that the relatively low verification complexity for immediate observation protocols is preserved.
The aim of being able to verify deployment strategies suggests further work in the direction of modelling failures, as well as selfstabilisation (i.e. making all states input states). On the other hand, deployment strategies often operate on heterogeneous fleets, requiring inputoutput conditions instead of pure output conditions to verify (e.g. we want to assign a fileserver role to some server with sufficient storage attached).
Inputoutput conditions also seem to be a promising direction for achieving generic composition of population protocol.
References
 [1] Dana Angluin, James Aspnes, Zoë Diamadi, Michael J. Fischer, and René Peralta. Computation in networks of passively mobile finitestate sensors. In Soma Chaudhuri and Shay Kutten, editors, PODC, pages 290–299. ACM, 2004. doi:10.1145/1011767.1011810.
 [2] Dana Angluin, James Aspnes, Zoë Diamadi, Michael J. Fischer, and René Peralta. Computation in networks of passively mobile finitestate sensors. Distributed Computing, 18(4):235–253, 2006.
 [3] Dana Angluin, James Aspnes, and David Eisenstat. Fast computation by population protocols with a leader. In Shlomi Dolev, editor, IN DISTRIBUTED COMPUTING: 20TH INTERNATIONAL SYMPOSIUM, DISC 2006, volume 4167 of Lecture Notes in Computer Science, pages 61–75. Springer, 2006.
 [4] Dana Angluin, James Aspnes, David Eisenstat, and Eric Ruppert. The computational power of population protocols. Distributed Computing, 20(4):279–304, 2007. URL: https://arxiv.org/abs/cs/0608084.
 [5] Michael Blondin, Javier Esparza, Blaise Genest, Martin Helfrich, and Stefan Jaax. Succinct population protocols for presburger arithmetic. in submission, 2019. URL: http://arxiv.org/abs/1910.04600.
 [6] Michael Blondin, Javier Esparza, Stefan Jaax, and Philipp J. Meyer. Towards efficient verification of population protocols. In Elad Michael Schiller and Alexander A. Schwarzmann, editors, PODC, pages 423–430. ACM, 2017.
 [7] David Doty and David Soloveichik. Stable leader election in population protocols requires linear time. In Yoram Moses, editor, DISC, volume 9363 of Lecture Notes in Computer Science, pages 602–616. Springer, 2015. URL: https://arxiv.org/abs/1502.04246.
 [8] Javier Esparza, Pierre Ganty, Jérôme Leroux, and Rupak Majumdar. Verification of population protocols. Acta Inf., 54(2):191–215, 2017.
 [9] Javier Esparza, Stefan Jaax, Mikhail A. Raskin, and Chana WeilKennedy. The complexity of verifying population protocols. in submission, 2019. URL: https://arxiv.org/abs/1912.06578.
 [10] Javier Esparza, Mikhail Raskin, and Chana WeilKennedy. Parameterized analysis of immediate observation petri nets, 2019. URL: http://arxiv.org/abs/1902.03025.
 [11] Javier Esparza, Mikhail Raskin, and Chana WeilKennedy. Parameterized analysis of immediate observation petri nets. In Susanna Donatelli and Stefan Haar, editors, Petri Nets, volume 11522 of Lecture Notes in Computer Science, pages 365–385. Springer, 2019. cite arxiv:1902.03025. URL: http://arxiv.org/abs/1902.03025.
 [12] Peng Huang, Chuanxiong Guo, Lidong Zhou, Jacob R. Lorch, Yingnong Dang, Murali Chintalapati, and Randolph Yao. Gray failure. In Proceedings of the 16th Workshop on Hot Topics in Operating Systems  HotOS '17. ACM Press, 2017. doi:10.1145/3102980.3103005.
 [13] Jérôme Leroux. Vector addition systems reachability problem (a simpler solution). In Andrei Voronkov, editor, Turing100, volume 10 of EPiC Series in Computing, pages 214–228. EasyChair, 2012.
Comments
There are no comments yet.