Population Protocols over Ordered Agents
Abstract
Population protocols are a distributed computation model in which a collection of anonymous, finite-state agents interact in randomly chosen pairs and update their states according to a fixed transition function. The computation is defined by the eventual stabilization of the population to a consensus that represents the output. In practice, it is natural to allow each agent to carry a unique identifier and compare it with that of another agent before interacting. We model this extension by having agents be totally ordered and interactions between two agents to be fireable only if their pair of identifiers falls in some condition set. For instance, allows for two agents to interact only if the first one appears before the second one.
We study population protocols over ordered agents where is a set of predicates available to restrict transition firing. We also study , the immediate observation fragment of where only one agent changes state per interaction. Our main result is that recognizes exactly the unambiguous star-free languages, which admits many other characterizations, such as two-variable first-order logic or two-way deterministic partially-ordered automata. We also provide a logic and an automaton model that fits in . We further show that if the successor predicate appears in a set of -computable predicates, then . Finally, we investigate the problem of deciding whether a given population protocol always stabilizes to a consensus. While this problem is decidable for unordered population protocols, we show that this is undecidable already for and , but conditionally decidable for .
Keywords and phrases:
Population protocols, First-order logic, Partially-ordered automata, Unambiguous star-free languagesCategory:
Track B: Automata, Logic, Semantics, and Theory of ProgrammingFunding:
Michael Blondin: supported by a Discovery Grant from the Natural Sciences and Engineering Research Council of Canada (NSERC).Copyright and License:
Corto Mascle, and Isa Vialard; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Formal languages and automata theory ; Theory of computation Distributed computing models ; Theory of computation Logic and verificationAcknowledgements:
We thank the anonymous reviewers of ICALP 2026 for their thorough reading and valuable suggestions.Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele PuppisSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Population protocols form a well-established model of distributed computing where anonymous agents, with very limited individual computational power, work collectively to achieve a common task [3]. In this model, an input is scattered among agents that interact pairwise and must take a decision by reaching a consensus that is stable, that is, agents must eventually all agree on the output (“consensus”) and stop changing their mind (“stable”). Population protocols provide a theoretical framework for reasoning about a wide range of distributed systems, including networks of mobile sensors, chemical reaction networks, and social networks [5, 10, 11].
To familiarize the reader with population protocols, we present a classical protocol for the task of majority voting. A population consists of agents (who are not aware of ), each carrying a state from a finite set. Here, agents start with either or as their state. The population aims at collectively determining whether there are initially more ’s than ’s. At each discrete moment, a pair of agents is chosen arbitrarily and their respective state, from , is updated according to these rules:
| active to passive | propagation of winning side | tiebreaker |
|---|---|---|
Since agents are unordered, each rule also stands for . Here are three possible executions of the protocol starting from three different “inputs,” that is, assignments of an initial state or to each agent:
Assuming fair scheduling (e.g., choosing agents uniformly at random), one can show that the population stabilizes (almost surely) to the correct outcome: if there is a majority of ’s initially, then agents eventually remain in , otherwise they eventually remain in .
As agents and rules are unordered, each configuration can be seen as a multiset where indicates the number of agents in state . It is known that population protocols compute precisely the subsets of that are semilinear [4], or, equivalently, that are definable in Presburger arithmetic (the first-order theory of the naturals with order and addition). In particular, majority voting amounts to computing the predicate .
From a modeling perspective, the fact that agents are unordered is meant to correspond to a situation in which agents are replicated and anonymous entities, and hence have no identifiers and are indistinguishable. Yet, it is natural to allow replicated agents to be totally ordered, e.g., they could be devices with a unique identifier, such as a serial number, stored in read-only memory. In this context, interactions may depend on the relationships between these identifiers.
From the perspective of automata theory, this corresponds to considering population protocols where configurations are words rather than multisets. Standard population protocols can be seen as computing commutative properties of words, such as , while the word setting additionally allows for noncommutative properties, such as “the middle agent has an ” or “agents strictly alternate between and .”
Contribution
Motivated by the above, we propose to study population protocols with totally-ordered agents. The class of population protocols so defined, , is parameterized by a set of predicates over positions that can be used to restrict transition firings. Central to our study is the class , in which a transition can only be applied to two agents in respective states and if the first agent appears before the second agent. We consider a well-studied restriction called immediate observation [4] where an interaction can only update a single agent, called the “observer.”
Our main result, Theorem 12, establishes that has the same expressive power as unambiguous star-free languages, an important subclass of regular languages that admits a trove of characterizations (see [32] for a lovely survey on the pervasiveness of this class in automata theory). Hence, is the class of languages captured by these formalisms over finite words:
-
partially-ordered unambiguous automata [25];
-
partially-ordered two-way deterministic automata [31];
-
: linear temporal logic with past and future operators [15];
-
: the two-variable fragment of first-order logic with order [33];
-
: the intersection of the and fragments of first-order logic with order [27];
-
languages recognized by finite monoids from the variety [30].
This provides the first characterization of this class in terms of distributed computing, rather than automata, logic, or algebra. We will provide in Example 3 an example of a protocol whose language is not regular, and therefore not expressible by protocols.
In addition, we explore systematically the classes induced by our definitions:
-
In Section 3, we provide a toolbox to study population protocols over ordered agents , regardless of . We study protocols that need to stabilize only if they reach a positive consensus, which we call semi-deciders, as opposed to protocols that always stabilize to a consensus, dubbed deciders. We also refine the technology of protocols with stabilizing inputs, studied in [29], which enables a form of composition between protocols.
-
In Section 6, we explore the expressiveness of and when the successor predicate is available, that is, when transitions can be restricted to fire only if they act on two adjacent agents. We show that if all the predicates of are computable, then – this is arguably less surprising than our main result on , as the successor allows for the left-to-right propagation of information.
-
Finally, since protocols are only well-behaved when they are deciders, and since this property is semantic, we explore in Section 7 whether we can check if a given population protocol is a decider. We thus ask if the syntax of deciders is decidable – this is sometimes called the well-specification problem. We show that it is undecidable for , , and , and conditionally decidable for .
Related work
Our model is closely related to the community protocols of Guerraoui and Ruppert [19]. These are population protocols where each agent has a unique identifier; each agent can store a constant number of identifiers; and interactions depend on these identifiers but only with respect to their relative order. The motivation of Guerraoui and Ruppert was to devise an extension of population protocols, as mild as possible, which would be fault-tolerant. They proved that community protocols can decide languages from while tolerating Byzantine failures of a constant number of agents [19]. The unique identifier of each agent is considered to be stored in read-only memory, as in real-world low-cost chips, and so exempt from Byzantine failures. Our model corresponds to community protocols where each agent has a single immutable register initialized to its unique identifier.
Bournez, Cohen, and Rabie introduce homonym protocols, a parameterized restriction of community protocols, where the agents have identifiers [8]. The cases of and are respectively population protocols (everyone has the same identifier) and community protocols (there are as many identifiers as agents). Identifiers are from and agents can compare them with respect to , , and .
In [17], Gańczorz et al. introduce selective population protocols as an extension of population protocols where the state space is partitioned into finitely many “groups,” and where an interaction picks at random an initiator in state , and then a responder in state from the group of , provided it is nonempty. This is a powerful model that allows for zero-tests, i.e., checking whether no agent holds a certain state. Thus, selective population protocols are orthogonal to our model. However, the authors dedicate a section to the median problem: . They show that if selective population protocols are extended with the possibility of comparing keys, then they can solve the median problem in time . The authors further provide a short proof that, without leveraging the “selective” aspect of their model (i.e., groups and zero-tests), any population protocol for the median problem must work in expected time . This latter setting, only briefly discussed in [17], corresponds to our model.
Further extensions include mediated population protocols [24], where communication edges have an internal state; population protocols with unordered data [6], where the input alphabet is infinite; and population protocols for graph class identification problems [37, 2], where agents aim at determining whether the communication topology satisfies some property. For other work on immediate-observation protocols, see [14, 35, 12, 34].
2 Preliminaries
Automata and logic.
We assume some familiarity with formal languages, automata theory and logic over finite words (e.g., see the textbook [12]). For a word , we write for the -th letter of , starting at 1, and for the infix . For , we write for the number of occurrences of in .
We write to denote first-order logic over words, where quantifiers range over positions, that is, the set for a given word , and where holds with respect to iff (see, e.g., [12, Chap. 8] for formal definitions). We write for the extension of with the numerical predicate , that allows to test whether for two positions and . For example, the sentence describes the language . By abuse of notation, stands for both the set of syntactic sentences and for the class of languages described by these sentences. It is well known that is the class of star-free (regular) languages.
We write (resp. ) for the fragment of of sentences in prenex normal form with blocks of alternating quantifiers starting with (resp. ). For example, belongs to due to the form of our example . We let .
Population protocols over ordered agents.
A population protocol (PP) describes how a totally-ordered set of finite-state agents interact and reach a decision about their overall initial states. Interactions can happen between any pair of agents, and predicates are used to restrict how transitions can be taken, based on the position of the agents in the order.
(Syntax.) We extend classical PPs to allow for transitions to carry a test on the positions of the totally-ordered agents. Let be any set, whose elements we call numerical predicates: these will be used as the allowed tests on a transition.111These are sometimes called uniform numerical predicates in the literature, to emphasize the fact that they do not depend on the total number of agents. A natural predicate that is not uniform is which is true if is the position of the last agent. This technical difference will not impact our results. We let be the always-true predicate. The set of PPs over is the set of transition systems where is a finite set of states, is a distinguished subset of initial states, maps each state to an opinion, and is a set of transitions. An element of is denoted , expressing, intuitively, that if two distinct agents meet, the first being in position and state , the second in position and state , such that , then the first agent changes its state to and the second to . We use for the set of initial states as we would like to see such protocols as language acceptors: The initial configuration should be thought of as an input word over alphabet .
If , we write for . Classical PPs can be seen as the class , recalling that we assume that true is always available as a numerical predicate. Our main interest is in the class , where is seen as the set of pairs with , but we will study more expressive predicates in Sections 3 and 6.
A PP is immediate-observation if at most one agent changes state in each interaction, i.e., every transition is of the form or . We write for the class of protocols in that are immediate-observation.
(Semantics.) Since our agents are totally ordered, we define the configuration of a system as a word of . Initial configurations are words of . Let and be two configurations of the same length, we say that leads to , denoted , if the two configurations are equal except at potentially two distinct positions and , and there is a transition with . We let be the reflexive transitive closure of .
Consensus and stability.
With a configuration, let be the common opinion of all states appearing in , if there is one; otherwise is undefined. A configuration is a -consensus if . It is further -stable if implies that is a -consensus.
Example 1.
We give an example of a protocol in . Consider the transition system , with , , and transitions and with “” standing for any state. Every input configuration belongs to and is therefore a -consensus (all agents output initially). However, such configurations need not be -stable. For instance, starting from we can apply the rule and obtain , which is -stable. In contrast, every configuration in is -stable: it is a -consensus and no transition is enabled.
Language of a PP.
Consider an infinite sequence of configurations, which we call a run. We say that it is fair if for every that appears infinitely often, each configuration of appears infinitely often as well. By induction, fairness guarantees that each configuration of appears infinitely often as well. Intuitively, fairness ensures that reachable configurations cannot be avoided forever (in a probabilistic setting, where the scheduling induces a probability distribution on the runs, the resulting runs are almost surely fair). We will assume that any configuration can be extended into a run, and so into a fair run, by implicitly adding “no operation” transitions.
The language of a PP is the set of initial configurations from which there is a fair run that visits a -stable configuration. Naturally, an initial configuration can be the origin of a fair run visiting a -stable configuration, another run visiting a -stable configuration, or even a run that visits no stable configurations. We single out PPs that have more crisp behaviors. We say that a PP is a decider when for all , there is a such that all fair runs from visit a -stable configuration (i.e., for all finite runs from to some configuration , there is a path from to a -stable configuration). This is usually called well-specified in the literature and we justify our nomenclature in Section 3.1. We say that is -decidable or -decidable with the obvious meaning. We will identify and with the class of languages decidable by these protocols.
Note that since population protocols are ill-defined when no agents are present, we adopt the convention, when working with their languages, to disregard the empty word.
Example 2.
Consider the protocol of from Example 1. We show that it decides the language . Every input in is already -stable. Conversely, if an input word is not in , then it contains the factor . Hence, in any fair run, the transition is eventually executed. From that point on, every remaining agent eventually interacts with a -agent and is converted to , so the run reaches a configuration in , which is -stable.
Example 3.
Consider the median language . Let us describe a protocol that decides . The states are defined as . The components respectively represent the input letter; a belief on whether the center is on the right, here, or on the left; and a belief on the output.
We identify input with state , and each input with . We set . The set is defined by these rules, each describing a family of transitions:
| Population halving | |||||
| (1) | |||||
| Center finding | |||||
| (2) | |||||
| (3) | |||||
| Output propagation | |||||
| (4) | for | ||||
| (5) | for | ||||
By fairness, the first rule must be used until one or zero remains. Moreover, by fairness, the second and third rules will respectively move the ’s to the left, and the ’s to the right. If some remains, then, by fairness and the fourth rule, it will propagate its output , which is iff , by the choice of initial states and by rule (2–3). Otherwise, if the population is of even length, the fifth rule will be used to propagate .
Figure 1 depicts all configurations reachable from the initial configuration . Any fair run of a population protocol leads to a bottom strongly connected component of such a reachability graph. Thus, in this example, every fair runs leads to , which is -stable. Note that is a -consensus, but is not -stable.
Further observe that the reachability graph of Figure 1 has non-trivial cycles, for instance:
Informally, the first and second agents are fighting to convince the third agent. However, by fairness, this is not allowed to happen indefinitely. Eventually, the configuration , at the bottom, is reached.
In the above specific protocol , for each initial configuration, the reachability graph has a unique trivial bottom strongly connected component, made of one configuration of the form or . However, in general, it needs not be unique or trivial. A fair run becomes -stable iff it visits a bottom strongly connected component whose configurations are all -consensuses.
In a decider, for a given initial configuration, all bottom strongly connected components must consist only of stable configurations, all of the same output.
We now provide a generic upper bound on the complexity of languages decided by population protocols; we will exhibit a matching lower bound in Section 6 for . Recall that is the class of languages recognized by linear-bounded nondeterministic Turing machines, i.e., nondeterministic machines that require space over inputs of size . Languages of this class are exactly the context-sensitive languages [22].
Theorem 4.
Let be a set of numerical predicates, all of which decidable in . We have .
Proof.
Recall that a configuration is -stable if every reachable configuration from it is a -consensus (i.e., all agents have opinion ). Consider a protocol in . The set of configurations that are not -stable is decidable in . Indeed, it is sufficient to nondeterministically guess a partial run (i.e., a finite sequence of configurations ) that leads to a configuration that is not a -consensus. Each transition can be guessed, its condition checked, and its effect applied in .
By the Immerman–Szelepcsényi theorem, is closed under complement, and so the set of -stable configurations is in . Since the protocol is a decider, to check that a word is accepted, it is sufficient to nondeterministically guess a partial run from , and check that it ends in a -stable configuration. These are all tasks in .
3 Semantic restrictions of population protocols: a toolbox
In this section, we define two restrictions of population protocols that will be used to simplify our constructions.
We first define semi-deciders, which do not require the full behavior of deciders with respect to stable configurations. Throughout the next sections, we will see that semi-deciders are much easier to define for some languages, and we will rely on the forthcoming Lemma 6 to combine semi-deciders into deciders.
We then define protocols with stabilizing inputs, which are protocols where agents can change their mind about their input. Such protocols are harder to design, since they are more robust to change, but we show, in Lemma 11, that they exhibit a strong closure property: they are closed under alphabet rewriting.
3.1 Semi-deciders
Definition 5.
We say that a PP semi-decides if for all and every fair run starting from , we have iff contains a -stable configuration. We use the terms -semi-decidable and -semi-decidable with the obvious meaning.
Note that a decider is a semi-decider in which we additionally require that iff visits a -stable configuration; that is, all fair runs visit a stable configuration. Illustrating the differences, Figure 2 shows the situations that can occur for runs from an input .
Our naming convention is justified by the following property:
Lemma 6.
A language is -decidable iff and its complement are -semi-decidable. The same holds for .
Proof sketch.
We combine the two semi-deciders for and for by running them in parallel. Each agent stores a pair of states, one for each semi-decider, together with a belief indicating which semi-decider it currently trusts. Transitions either simulate one step of one of the semi-deciders, or flip the belief so that beliefs can align; in particular, an agent may flip when it meets an agent with the opposite belief, or when its currently trusted component produces a -witness. For any input , exactly one of the two simulations eventually provides such a witness (since exactly one of or holds), which forces all agents to converge to the correct belief and yields a stable consensus, hence a decider.
We note these elementary closure properties:
Lemma 7.
If are -semi-decidable, then it is also the case for and . This further holds for and deciders.
3.2 Protocols with stabilizing inputs
Agents of a protocol are generally not aware that they have reached a stable consensus and hence “terminated.” To carry out a task A and use its output in a subsequent task B, a protocol has to perform both tasks concurrently. The protocol for task B thus guesses what the output of task A is going to be, but ought to be able to self-correct if it becomes clear that the guess was wrong. In this subsection, we introduce a formal notion for this “self-correction” which will simplify the design of composable protocols; this is inspired by a recent presentation of [29] for .
Let us consider protocols where each agent keeps a copy of its input. Formally, a protocol is said to be input-saving if
-
for some finite set ;
-
Each is identified with for some ; and
-
The first component of any state is left unchanged by all transitions of .
For all , let be the projection of onto its first component. Given , we write if either , or equals except at a single position where and . This second type of transitions models a “change of mind” of agent on its input. We write for the reflexive transitive closure of . Note what we do not change the definition of run, which still relies on only.
Definition 8.
We say that semi-decides with stabilizing inputs if (a) is input-saving, and (b) for all , all and every fair run starting from , it is the case that iff visits a -stable configuration. We use the term “decides” if (b) is strengthened with the condition that iff visits a -stable configuration.
Note that this is more robust than simply semi-deciding: if semi-decides with stabilizing inputs, then it semi-decides . Intuitively, after , the configuration of the population (i.e., the projection of onto the second component) may be incompatible with since agents have possibly changed their mind several times on their input. Computing with stabilizing inputs means that the protocol is able to fix its configuration so that it reflects the expected output on .
It is known that any language can be decided, and hence semi-decided, with stabilizing inputs222It was claimed earlier by [2], but definitions and proofs were deferred to a full paper that never appeared. [29]. Let us turn to an example, which will be useful later:
Proposition 9.
The language is -semi-decidable with stabilizing inputs.
Proof sketch.
Let and . The protocol for is defined by , , each identified with , and these rules:
The purpose of the first rule is to detect a misordering. The second rule allows any agent to nondeterministically reset itself.
We now turn to closure properties of protocols with stabilizing inputs. We first cover union and intersection, then move on to (nondeterministic) alphabet rewriting.
Lemma 10.
If are -semi-decidable with stabilizing inputs, then it is also the case for and . This further holds for and deciders.
Given and , let . For example, if and , then . We extend this notion to languages: .
Lemma 11.
Let . If is -semi-decidable with stabilizing inputs, then is -semi-decidable with stabilizing inputs. This further holds for .
Proof sketch.
The construction builds a protocol that semi-decides by simulating, in its second component, the input-saving semi-decider for on a guessed word compatible with the real input (i.e., ). Agents may revise this guess: whenever a opinion is observed in the simulated component, an agent is allowed to change its guessed letter to any consistent with its input letter (preserving letterwise). If , fairness ensures that the population can eventually rewrite the guessed word into some , after which the simulation of the semi-decider for reaches a -stable configuration and changes become disabled; if , reaching a -stable configuration would force the simulated input to lie in , which is not possible.
4 Expressiveness of IO-PP
In this section, we provide a precise characterization of the languages decided by . For any language , let us write for the syntactic congruence of , i.e., iff for all . A language is in the class if it is regular, and satisfies, writing for the set of letters appearing in a word :
| (1) |
It is a fascinating result of Pin and Weil [27] that . We will leverage both characterizations to show the theorem below. The left-to-right inclusion will rely on (1), and the converse on , semi-deciders, and protocols with stabilizing inputs.
Theorem 12.
.
4.1 IO-PP DA
We first show that the set of stable configurations in a , and thus in an , admits a simple description. Given a finite alphabet and two words , we say that is a subword of , written , if can be obtained from by removing letters. It is well known that is a well-quasi-order over [21]. A consequence is that every strictly decreasing sequence of subword-closed sets must be finite.
Lemma 13.
Any protocol in is a well-structured transition system w.r.t. , that is, for all with and , there exists such that and . Further, the set of -stable configurations is subword-closed and computable.
As expected from the definition of , the core of the argument showing the inclusion of in will rely on a pumping argument. As a first observation, we show that, in an , an infix of the form with can, in some sense, mimic the behavior of the protocol on the simpler infix .
Lemma 14.
In an , if with and , then for all with , there exists such that and .
We use this first result to show a pumping lemma on . It results from the fact that the sets of -stable and -stable configurations are subword-closed and Lemma 14.
Lemma 15.
Let . There exists a computable such that, for all and with , we have .
Proof sketch.
Lemma 13 indicates that for both , the set of -stable configurations is subword-closed. As a consequence, writing for , it is a finite union of languages of the form with subsets of , the set of states of our protocol [20, Sect. 6.1.1]. Let be the maximal factorization size over all those languages, and . Lemma 13 also states that the set of -stable configurations is computable for both , in particular we can compute and .
Intuitively, if we have a run from to a -stable configuration , then we can match with one of the expressions above, and some is entirely contained in some .
We then use Lemma 14 to expand the run to a run from to some -stable configuration , by expanding the section into .
We can thus show that if is accepted, so is . Similarly, we show that if is not accepted, then it can reach a -stable configuration, and so can . We conclude that one is in the language if and only if the other is. To prove the congruence relation we only need to add words and around , which does not significantly alter the proof.
We can now show that -decidable languages satisfy the definition of . In Lemma 16, we show that Equation 1 is satisfied, and in Lemma 17, that the languages are regular, concluding the proof.
Lemma 16.
Let and let be such that . It is the case that for all .
Proof.
Lemma 15 implies that there is a (computable) number such that , and since , we obtain as claimed.
Lemma 17.
Every -decidable language is regular. Moreover, given an -protocol , we can construct a finite automaton with the same language.
Proof sketch.
We show that beyond some length, every word must contain a pattern of the form with . By Lemma 15, this means that every sufficiently long word is -equivalent to a shorter one, meaning that has finitely many equivalence classes. Since we can compute , we can compute this automaton.
4.2 DA IO-PP
Recall that iff . Since is equal to , it is enough to prove that languages are -semi-decidable, appealing to Lemma 6 to conclude. Note that is the set of languages expressible as finite unions of languages of the form with the ’s being subalphabets (see, e.g., [26, Thm. 8.8]). Since semi-deciders are closed under union by Lemma 7, we need only show that is -semi-decidable to conclude. We start with a technical proposition that extends a result of [29] to immediate-observation protocols, then provide a semi-decider for in Proposition 19. Since all constructions used here are effective, our proof also implies that given a finite automaton recognizing a language, we can effectively construct an -protocol recognizing the same language.
Proposition 18.
The language is -semi-decidable with stabilizing inputs.
Proof sketch.
Each agent stores its current input, its last input, and a belief on the output. If the current input of an agent mismatches its former one, then it resets itself to the current one. Each agent eventually stabilizes to a fixed input . The belief component then controls the consensus: an agent can turn any with to , while the presence of any can spread to other agents. Finally, if an -agent observes another , it switches to ; combined with the rule that lets an -agent reset itself to , this makes -agents alternate forever between and whenever there are at least two ’s, preventing stabilization in that case. As a result, if the input contains no then every fair run reaches a -stable consensus; if it contains exactly one then every fair run reaches a -stable consensus; and if it contains at least two ’s then some agent flips its belief forever.
Proposition 19.
The language is -semi-decidable (with stabilizing inputs).
Proof.
Let , and . By Proposition 9, is -semi-decidable with stabilizing inputs. Furthermore, by Propositions 18 and 10, is -semi-decidable with stabilizing inputs. By Lemma 10, is -semi-decidable with stabilizing inputs. Let for even , and otherwise. We are done by Lemma 11 since .
5 Expressiveness of PP
The crisp characterization of the previous section ties to a wealth of computational models with strikingly different flavors. Chief among them, is characterized by a logic, , and by partially-ordered unambiguous automata. A natural question is thus whether also admits such a diverse array of characterizations. We fall short of providing exact characterizations, but offer, in this section, two large classes of languages, one logically-defined and one based on partially-ordered automata, that are -decidable.
Our formalisms will involve Presburger arithmetic, the first-order theory of the naturals with order and addition; e.g., holds iff is a positive even number. Write for the equivalence of naturals modulo . It is well known that Presburger arithmetic together with with any admits quantifier elimination. For our purposes, a Presburger formula is a (quantifier-free) Boolean combination of predicates of the form or , where , and variables are over .
5.1 First-order logic over word intervals
Definition 20.
For and , let be the function that counts the number of occurrences of between two positions of , i.e., . We define as first-order logic over word intervals, that is, with access to numerical values where and are either first-order variables, the first position (denoted “”) or the last position (denoted “”). We will study , where we allow numerical values to be compared, added, and tested modulo for any constant . Note that a variable can be expressed as , we will thus assume that the atomic formulas only have terms of the form , though we write for , and for . The logics , , and are naturally defined.
Example 21.
Let us show that the median language belongs to . The following predicate asserts that is the middle position: . The median language can either be expressed by , or by . Note that is the same as .
We now provide a convenient characterization of languages in .
Lemma 22.
Any language from is a finite union of languages of the form where and is a Presburger formula over variables .
Thanks to the previous lemma, we are able to build a protocol semi-deciding any language in , by building semi-deciders with stabilizing inputs for each , and then using the closure properties presented in Section 3.2.
Proposition 23.
Any language from is -semi-decidable.
Proof.
Let . By Lemma 22, is a finite union of languages of the form where and is a Presburger formula. It suffices to show that is -semi-decidable with stabilizing inputs. Indeed, by Lemma 10, that class of languages is closed under union.
Let , , and . We justify that the three following languages , and over alphabet are semi-decided with stabilizing inputs:
-
,
-
,
-
(recall for ).
Let and . We have . By Propositions 9 and 11, is -semi-decidable with stabilizing inputs. Since , these two languages are -decidable with stabilizing inputs [2, 29].
By Lemma 10, the language is -semi-decidable with stabilizing inputs. Let . We are done by Lemma 11 since .
Corollary 24.
.
In the forthcoming Conjecture 40, we postulate that these two classes coincide.
5.2 Partially-ordered Parikh automata
A partially-ordered nondeterministic Parikh automaton (poPA) is a tuple where:
-
is a finite set of states equipped with a partial order ;
-
is a finite alphabet;
-
is the transition relation, that satisfies for all ; if , the transition is dubbed a self-loop, and otherwise, a progress transition;
-
is the initial state, and is the set of final states;
-
is a Presburger formula over variables .
For all , we write and . We naturally lift these notations to sequences. A word is accepted by if there exist and such that , and holds. The language of is the set of words it accepts. Figure 3 depicts two examples of poPA.
Lemma 22 allows us to translate a formula from into a poPA by guessing a factorization with a progress transition for each , and a self-loop for each ; and then using the Presbuger acceptance formula of the automaton to verify the guess. We can also translate a poPA into a formula of by guessing the position of the progress transitions and verifying the validity of the path. This yields:
Theorem 25.
A language is recognized by some poPA iff it belongs to .
Recall that is characterized by partially-ordered automata, while is characterized by unambiguous partially-ordered automata. We explore a similar notion for and poPA. A poPA is weakly unambiguous333The nomenclature, introduced in [7], stems from prior studies [9] which called “unambiguous” the PA with an unambiguous underlying automaton. We note that the examples of Figure 3 can be shown, using the tools of [9], not to be expressible with unambiguous PA. if every is accepted by at most one path (w.r.t. and ). Note that the automata of Figure 3 are weakly unambiguous and can be complemented. By Theorem 25, this means that both languages belong to . More generally, we conjecture that weakly-unambiguous poPA are closed under complement.
Observation 26.
If weakly-unambiguous poPA are closed under complement, then any language recognized by a weakly-unambiguous poPA belongs to .
In the forthcoming Conjecture 40, we postulate that these two classes coincide. We note, as a sanity check, that since is characterized by unambiguous partially-ordered automata, . The strictness of the inclusion is in particular witnessed by the regular language over alphabet , which trivially belongs to with formula .
Remark 27 (Two-way models).
Recall that is also characterized by two-way deterministic partially-ordered automata. We can show that two-way poPA are equivalent to poPA. However, defining two-way deterministic PA as two-way deterministic automata with a Presburger constraint, it is known that the model is as expressive as unambiguous PA [16], which cannot express the languages of Figure 3.
5.3 The regular languages of PP
Lemma 22 gives a clear form for the languages of . If the language therein is regular, this points to the formula not arithmetically linking the ’s between one another nor imposing nonregular constraints on any single . Hence we have naturally:
Conjecture 28.
Let be the set of commutative regular languages. Let be the set of languages that are finite unions of languages with and letters. We conjecture that the regular languages of are exactly .
The class has been studied in previous works: [1] conjectures that they correspond to the regular languages requiring communication and [18] shows that it is included in the largest class of languages, closed under the so-called positive variety operations, that does not contain . We recall, for contrast, that is the largest class of aperiodic regular languages, closed under the variety operations, that does not contain . To give additional credence to our conjecture, we show:
Proposition 29.
The language does not belong to .
The class is defined similarly as , except that we require that every word in the marked concatenation has a unique decomposition with . It is known [28] that . We naturally postulate, in Conjecture 40, that the regular languages of are exactly .
6 Expressiveness of IO-PP and PP when successor is available
We now consider protocols where transitions may be fired only when two agents are adjacent. Formally, we look at and with , where (sometimes written in the literature) is the predicate . This study is reminiscent of the classic study of [15, 23, 33, 36] that followed that of , the two-variable fragment of that is as expressive as .
Example 30.
Recall that the set of all -stable configurations of a is subword-closed, and hence regular. The following has a non-regular set of -stable configurations:
Let us set the opinion of each state to , except for . The protocol is constructed so that from a configuration of the form , one marker moves to the right along the ’s, while the other synchronously moves to the left along the ’s. If they meet at the frontier between ’s and ’s, it means there are as many ’s and ’s, and that state appears.
The set of -stable configurations cannot be regular since, from , the state will appear iff , e.g.,
The main result of this section is:
Theorem 31.
Let be a set of -decidable numerical predicates that contains . We have .
To show this result, it is enough to prove that , since has been established beforehand in Theorem 4.
6.1
We start by showing that transitions using the successor predicate can be simulated with immediate-observation transitions.
Lemma 32.
Let be a -semi-decidable language. There exists a -protocol semi-deciding and such that each -transition of is immediate-observation.
Proof sketch.
The construction turns a -protocol into a new -protocol by replacing each transition with a short four-step handshake along the successor relation, using auxiliary markers and . The four rules are:
Intuitively, one agent announces that it wants to perform , the neighbor acknowledges, and the two agents then update one after the other; additional clean-up rules erase incomplete handshakes so that executions cannot block when several handshakes overlap.
Lemma 33.
The language of a linear-bounded nondeterministic Turing machine is -semi-decidable.
Proof sketch.
Given a linear-bounded nondeterministic Turing machine , we construct an -protocol that simulates under stabilizing inputs. Thanks to Lemma 32, we only need to ensure that true-transitions are immediate-observation.
Let be the tape alphabet of . The protocol works over where . For example, represents the configuration of in state , with the head on the second cell, and the tape containing .
The protocol simulates using -transitions with the agent containing the current state . If accepts, then spreads across the population. There are two challenges:
-
1.
Since we want to semi-decide under stabilizing inputs, must reset the population and the simulation of whenever an agent changes its mind on its input. This is implemented as follows. Any agent who has changed its mind can flag the last agent. Using -transitions, this can spread from right to left, resetting the population along the way.
-
2.
If the input of is an invalid configuration of , then the population should not reach a stable -consensus. For example, if two agents both represent the head of , then they change their belief to upon meeting. Similarly, we must detect whether “fst” and “lst” occur exactly in the first and last agent.
The resulting protocol does not semi-decide the language of , but rather the set of configurations of leading to acceptance. So, we need to intersect with the set of initial configurations, and then project onto the second component of . This can be done thanks to Propositions 9, 18, 10, and 11.
Corollary 34.
.
Proof.
7 Decidability of checking whether a population protocol is a decider
A good portion of our results assumes that a given population protocol is a decider or a semi-decider in order to construct an object (a Turing machine in Theorem 4, a formula in Theorem 12, etc.). To fully understand how constructive these proofs are, we ought to study whether it is decidable, given a population protocol, to check if it is a decider. In other words, is the syntax of deciders decidable? From the perspective of formal verification, this is also a natural problem, known as the well-specification problem. It is decidable for [13], and undecidable when protocols are extended with an infinite alphabet (where agents carry data from an infinite domain, and transitions can use equality constraints between those data), except for immediate-observation protocols [34].
We show that the problem is undecidable already for and , and provide a natural conjecture that would entail that the problem is decidable for .
7.1 The syntax of PP, and deciders are undecidable
First, we consider the emptiness problem: given a protocol , is there an execution from an initial configuration to a -stable one? We use a technique from [34] to show a general reduction to the syntax problem.
Lemma 35.
The emptiness problem for (resp. ) reduces to deciding the complement of the syntax of (resp. ) deciders.
Proof sketch.
From a protocol , we construct a protocol such that is not a decider iff can reach a -stable configuration. The construction adds a fresh sink state with , and for every state with we add a transition allowing an agent in to switch to .
As a consequence, from any configuration that contains a -agent, a fair execution can drive the system to the -stable consensus . On the other hand, if a -stable configuration is reachable in , then the same configuration is reachable in and remains -stable there: none of the added transitions to are enabled from -states. Therefore is not a decider.
Conversely, if has no reachable -stable configuration, then no fair run of stabilizes to . Every fair run stabilizes to and decides the empty language. The construction preserves immediate observation, as each new transition updates at most one agent.
This reduction, combined with the translation from linear-bounded Turing machines to from Section 6, already yields the following result.
Corollary 36.
The syntax of and deciders are undecidable.
Theorem 37.
The emptiness problem is undecidable for . Hence the syntax of deciders is also undecidable.
Proof sketch.
We reduce from the Post correspondence problem. Specifically, we take two homomorphisms and construct a that can reach a -stable configuration if and only if there is a word such that . We obtain it as a product of three protocols. One makes sure that we can only reach a -stable configuration from an initial one of the form with and . The two others check that we can reach a -stable configuration only when and , respectively. Each one does so by making agents simulate two reading heads going through and in lockstep and verifying that . Initially all agents have opinion , and in order to change it they must carry the reading head at some point, hence we cannot skip any letter in order to reach a -stable configuration.
Hence, a -stable configuration is reachable iff there exist with .
7.2 The syntax of IO-PP deciders is decidable, conditionally
We present a conjecture on the reachability relation of , then show that it entails decidability of the syntax of their deciders:
Conjecture 38.
The set of configurations reachable from a language in an protocol is also a language.
Theorem 39.
If Conjecture 38 holds, then the syntax of deciders is decidable.
Proof sketch.
We use two semi-decision procedures. The first one checks, for each length , if the protocol is a decider on words of length . If the input protocol is not a decider, we will observe it for some . The second one looks for invariants witnessing that the protocol is a decider. We look for two disjoint languages such that every input word is in one of the two, they are closed under transitions of the protocol, and from everywhere in we can reach a -stable configuration. Assuming the conjecture, we can assume that those invariants are in . We show that we can enumerate potential regular invariants and check the requirements, yielding the second semi-decision procedure.
In fact, one could slightly strengthen the statement above: it suffices to know that the set of configurations reachable from a language in (instead of in every -protocol) is also a language, to be able to check whether is a decider. This means that if we can prove Conjecture 38 over only a subclass of -protocols, then we know that the syntax of that subclass is decidable.
8 Open questions
The most tantalizing open question left open by this work is the characterization of . We conjecture that the logic and automata models introduced in Section 5 are tight:
Conjecture 40.
is the class of languages recognized by and the class of languages recognized by weakly unambiguous poPA. The regular languages of are exactly .
Conjecture 40 would entail in particular that weakly unambiguous poPA are closed under complement. We note that it is not known whether weakly unambiguous PA themselves are closed under complement, but it may be easier to show such closure under the partially ordered assumption.
Conjecture 38 is also very natural and left open.
References
- [1] Anil Ada. On the non-deterministic communication complexity of regular languages. In Proc. International Conference on Developments in Language Theory (DLT), pages 96–107, 2008. doi:10.1007/978-3-540-85780-8_7.
- [2] Dana Angluin, James Aspnes, Melody Chan, Michael J. Fischer, Hong Jiang, and René Peralta. Stably computable properties of network graphs. In First IEEE International Conference on Distributed Computing in Sensor Systems (DCOSS), pages 63–74, 2005. doi:10.1007/11502593_8.
- [3] Dana Angluin, James Aspnes, Zoë Diamadi, Michael J. Fischer, and René Peralta. Computation in networks of passively mobile finite-state sensors. Distributed Computing, 18(4):235–253, 2006. doi:10.1007/s00446-005-0138-3.
- [4] Dana Angluin, James Aspnes, David Eisenstat, and Eric Ruppert. The computational power of population protocols. Distributed Computing, 20(4):279–304, 2007. doi:10.1007/s00446-007-0040-2.
- [5] James Aspnes and Eric Ruppert. An introduction to population protocols. In Middleware for Network Eccentric and Mobile Applications, pages 97–120. Springer, 2009. doi:10.1007/978-3-540-89707-1_5.
- [6] Michael Blondin and François Ladouceur. Population protocols with unordered data. In Proc. International Colloquium on Automata, Languages, and Programming (ICALP), pages 115:1–115:20, 2023. doi:10.4230/LIPIcs.ICALP.2023.115.
- [7] Alin Bostan, Arnaud Carayol, Florent Koechlin, and Cyril Nicaud. Weakly-unambiguous Parikh automata and their link to holonomic series. In Proc. International Colloquium on Automata, Languages, and Programming (ICALP), pages 114:1–114:16, 2020. doi:10.4230/LIPIcs.ICALP.2020.114.
- [8] Olivier Bournez, Johanne Cohen, and Mikaël Rabie. Homonym population protocols. Theory of Computing Systems, 62(5):1318–1346, 2018. doi:10.1007/S00224-017-9833-2.
- [9] Michaël Cadilhac, Alain Finkel, and Pierre McKenzie. Unambiguous constrained automata. International Journal of Foundations of Computer Science, 24(7):1099–1116, 2013. doi:10.1142/S0129054113400339.
- [10] Ho-Lin Chen, David Doty, and David Soloveichik. Deterministic function computation with chemical reaction networks. Natural Computing, 13(4):517–534, 2014. doi:10.1007/S11047-013-9393-6.
- [11] Zoë Diamadi and Michael J Fischer. A simple game for the study of trust in distributed systems. Wuhan University Journal of Natural Sciences, 6(1):72–82, 2001. doi:10.1007/BF03160228.
- [12] Javier Esparza and Michael Blondin. Automata theory: An algorithmic approach. The MIT Press, 2023.
- [13] Javier Esparza, Pierre Ganty, Jérôme Leroux, and Rupak Majumdar. Verification of population protocols. In Proc. International Conference on Concurrency Theory (CONCUR), pages 470–482, 2015. doi:10.4230/LIPIcs.CONCUR.2015.470.
- [14] Javier Esparza, Pierre Ganty, Rupak Majumdar, and Chana Weil-Kennedy. Verification of immediate observation population protocols. In Proc. International Conference on Concurrency Theory (CONCUR), volume 118, pages 31:1–31:16, 2018. doi:10.4230/LIPIcs.CONCUR.2018.31.
- [15] Kousha Etessami, Moshe Y. Vardi, and Thomas Wilke. First-order logic with two variables and unary temporal logic. Information and Computation, 179(2):279–295, 2002. doi:10.1006/INCO.2001.2953.
- [16] Emmanuel Filiot, Shibashis Guha, and Nicolas Mazzocchi. Two-way Parikh automata. In Proc. IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS), pages 40:1–40:14, 2019. doi:10.4230/LIPIcs.FSTTCS.2019.40.
- [17] Adam Ganczorz, Leszek Gasieniec, Tomasz Jurdzinski, Jakub Kowalski, and Grzegorz Stachowiak. Selective population protocols. In Proc. International Symposium on Stabilization, Safety, and Security of Distributed Systems (SSS), pages 225–239, 2024. doi:10.1007/978-3-031-74498-3_16.
- [18] Antonio Cano Gómez, Giovanna Guaiana, and Jean-Éric Pin. Regular languages and partial commutations. Information and Computation, 230:76–96, 2013. doi:10.1016/J.IC.2013.07.003.
- [19] Rachid Guerraoui and Eric Ruppert. Names trump malice: Tiny mobile agents can tolerate Byzantine failures. In Proc. International Colloquium Automata, Languages and Programming (ICALP), pages 484–495, 2009. doi:10.1007/978-3-642-02930-1_40.
- [20] Simon Halfon. On Effective Representations of Well Quasi-Orderings. (Représentations Effectives des Beaux Pré-Ordres). PhD thesis, Université Paris-Saclay, France, 2018. URL: https://tel.archives-ouvertes.fr/tel-01945232.
- [21] Graham Higman. Ordering by divisibility in abstract algebras. Proceedings of the London Mathematical Society, s3-2(1):326–336, 1952. doi:10.1112/plms/s3-2.1.326.
- [22] Sige-Yuki Kuroda. Classes of languages and linear-bounded automata. Information and Control, 7(2):207–223, 1964. doi:10.1016/S0019-9958(64)90120-2.
- [23] Kamal Lodaya, Paritosh K. Pandya, and Simoni S. Shah. Around dot depth two. In Proc. International Conference on Developments in Language Theory (DLT), pages 303–315, 2010. doi:10.1007/978-3-642-14455-4_28.
- [24] Othon Michail, Ioannis Chatzigiannakis, and Paul G. Spirakis. Mediated population protocols. Theoretical Computer Science, 412(22):2434–2450, 2011. doi:10.1016/J.TCS.2011.02.003.
- [25] J. Andres Montoya. Asymptotic reasoning with two variables. In Proc. International Workshop on Logic, Language, Information, and Computation (WoLLIC), pages 38–55, 2025. doi:10.1007/978-3-031-99536-1_3.
- [26] Jean-Éric Pin. Syntactic semigroups. In Handbook of Formal Languages, Volume 1: Word, Language, Grammar, pages 679–746. Springer, 1997. doi:10.1007/978-3-642-59136-5_10.
- [27] Jean-Éric Pin and Pascal Weil. Polynomial closure and unambiguous product. In Proc. International Colloquium on Automata, Languages and Programming (ICALP), pages 348–359, 1995. doi:10.1007/3-540-60084-1_87.
- [28] Thomas Place and Marc Zeitoun. All about unambiguous polynomial closure. TheoretiCS, 2, 2023. doi:10.46298/THEORETICS.23.11.
- [29] Michael Raskin. Modular population protocols. In Proc. International Symposium on Algorithmics of Wireless Networks (ALGOWIN), pages 173–187, 2024. doi:10.1007/978-3-031-74580-5_13.
- [30] Marcel-Paul Schützenberger. Sur le produit de concaténation non ambigü. Semigroup Forum, 13(1):47–75, 1976. doi:10.1007/bf02194921.
- [31] Thomas Schwentick, Denis Thérien, and Heribert Vollmer. Partially-ordered two-way automata: A new characterization of DA. In Proc. International Conference on Developments in Language Theory (DLT), pages 239–250, 2001. doi:10.1007/3-540-46011-X_20.
- [32] Pascal Tesson and Denis Thérien. Diamonds are forever: The variety DA. In Semigroups, algorithms, automata and languages, pages 475–499. World Scientific, 2002. doi:10.1142/5050.
- [33] Denis Thérien and Thomas Wilke. Over words, two variables are as powerful as one quantifier alternation. In Proc. Annual ACM Symposium on the Theory of Computing (STOC), pages 234–240, 1998. doi:10.1145/276698.276749.
- [34] Steffen van Bergerem, Roland Guttenberg, Sandra Kiefer, Corto Mascle, Nicolas Waldburger, and Chana Weil-Kennedy. Verification of population protocols with unordered data. In Proc. International Colloquium on Automata, Languages, and Programming (ICALP), pages 156:1–156:20, 2024. doi:10.4230/LIPIcs.ICALP.2024.156.
- [35] Chana Weil-Kennedy. Observation Petri Nets. PhD thesis, Technical University of Munich, Germany, 2023. URL: https://nbn-resolving.org/urn:nbn:de:bvb:91-diss-20230320-1691161-1-3.
- [36] Philipp Weis and Neil Immerman. Structure theorem and strict alternation hierarchy for on words. In Proc. International Workshop on Computer Science Logic (CSL), pages 343–357, 2007. doi:10.1007/978-3-540-74915-8_27.
- [37] Hiroto Yasumi, Fukuhito Ooshita, and Michiko Inoue. Population protocols for graph class identification problems. In Proc. International Conference on Principles of Distributed Systems, (OPODIS), pages 13:1–13:19, 2021. doi:10.4230/LIPIcs.OPODIS.2021.13.
