Abstract 1 Introduction 2 Preliminaries 3 Semantic restrictions of population protocols: a toolbox 4 Expressiveness of IO-PP[<] 5 Expressiveness of PP[<] 6 Expressiveness of IO-PP[𝓝] and PP[𝓝] when successor is available 7 Decidability of checking whether a population protocol is a decider 8 Open questions References

Population Protocols over Ordered Agents

Michael Blondin ORCID Département d’informatique, Université de Sherbrooke, Canada    Michaël Cadilhac ORCID DePaul University, Chicago, IL, USA    Benjamin Courchesne ORCID Département d’informatique, Université de Sherbrooke, Canada    Lucie Guillou ORCID MPI for Software Systems, Kaiserslautern, Germany    Corto Mascle ORCID MPI for Software Systems, Kaiserslautern, Germany    Isa Vialard ORCID MPI for Software Systems, Saarbrücken, Germany
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 𝖭𝖲𝖯𝖠𝖢𝖤(n)-computable predicates, then 𝖨𝖮-𝖯𝖯[𝒩]=𝖯𝖯[𝒩]=𝖭𝖲𝖯𝖠𝖢𝖤(n). 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 𝖨𝖮-𝖯𝖯[+1], but conditionally decidable for 𝖨𝖮-𝖯𝖯[<].

Keywords and phrases:
Population protocols, First-order logic, Partially-ordered automata, Unambiguous star-free languages
Category:
Track B: Automata, Logic, Semantics, and Theory of Programming
Funding:
Michael Blondin: supported by a Discovery Grant from the Natural Sciences and Engineering Research Council of Canada (NSERC).
Copyright and License:
[Uncaptioned image] © Michael Blondin, Michaël Cadilhac, Benjamin Courchesne, Lucie Guillou,
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 verification
Related Version:
The full version with proofs is available at: https://arxiv.org/abs/2605.09937
Acknowledgements:
We thank the anonymous reviewers of ICALP 2026 for their thorough reading and valuable suggestions.
Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele Puppis

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 n agents (who are not aware of n), each carrying a state from a finite set. Here, agents start with either a or b as their state. The population aims at collectively determining whether there are initially more a’s than b’s. At each discrete moment, a pair of agents is chosen arbitrarily and their respective state, from Q={a,b,a¯,b¯}, is updated according to these rules:

active to passive propagation of winning side tiebreaker
a,ba¯,b¯ a,b¯a,a¯ a¯,b¯b¯,b¯
b,a¯b,b¯

Since agents are unordered, each rule p,qp,q also stands for q,pq,p. Here are three possible executions of the protocol starting from three different “inputs,” that is, assignments of an initial state a or b to each agent:

aaabb aaa¯bb¯ aa¯a¯b¯b¯ aa¯a¯a¯b¯ aa¯a¯a¯a¯,
aabbb aa¯b¯bb aa¯a¯bb a¯a¯a¯b¯b a¯a¯b¯b¯b a¯b¯b¯b¯b, b¯b¯b¯b¯b,
aabb aa¯b¯b a¯a¯b¯b¯ a¯b¯b¯b¯ b¯b¯b¯b¯.

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 a’s initially, then agents eventually remain in {a,a¯}, otherwise they eventually remain in {b,b¯}.

As agents and rules are unordered, each configuration can be seen as a multiset 𝒄:Q where 𝒄(q) indicates the number of agents in state q. It is known that population protocols compute precisely the subsets of Q 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 φ(𝒄)=𝒄(a)>𝒄(b).

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 |w|a>|w|b, while the word setting additionally allows for noncommutative properties, such as “the middle agent has an a” or “agents strictly alternate between a and b.”

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 p,q<r,s can only be applied to two agents in respective states p and q 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];

  • 𝖫𝖳𝖫[𝐅1,𝐅]: linear temporal logic with past and future operators [15];

  • 𝖥𝖮2[<]: the two-variable fragment of first-order logic with order [33];

  • Δ2[<]: 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 4, we prove the aforementioned characterization of 𝖨𝖮-𝖯𝖯[<], and in Section 5, we provide a natural logic and an automaton model expressible in 𝖯𝖯[<]. In this latter section, we fall short of showing exact characterizations, but provide conjectures based on our new models.

  • 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 𝖭𝖲𝖯𝖠𝖢𝖤(n) computable, then 𝖨𝖮-𝖯𝖯[𝒩]=𝖯𝖯[𝒩]=𝖭𝖲𝖯𝖠𝖢𝖤(n) – 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 𝖨𝖮-𝖯𝖯[+1], 𝖯𝖯[+1], 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 𝖭𝖲𝖯𝖠𝖢𝖤(nlogn) 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 n agents have f(n) identifiers [8]. The cases of f(n)=1 and f(n)=n are respectively population protocols (everyone has the same identifier) and community protocols (there are as many identifiers as agents). Identifiers are from [0..f(n)1] and agents can compare them with respect to x<y, x=y, x=y+1 and x=0.

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 s, and then a responder in state s from the group of s, 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: n0ΣnaΣn. They show that if selective population protocols are extended with the possibility of comparing keys, then they can solve the median problem in time 𝒪(log4n). 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 Ω(n). 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 wΣ, we write w[i] for the i-th letter of w, starting at 1, and w[i..j] for the infix w[i]w[i+1]w[j]. For σΣ, we write |w|σ for the number of occurrences of σ in w.

We write 𝖥𝖮 to denote first-order logic over words, where quantifiers range over positions, that is, the set {1,,|w|} for a given word w, and where a(x) holds with respect to w iff w[x]=a (see, e.g., [12, Chap. 8] for formal definitions). We write 𝖥𝖮[<] for the extension of 𝖥𝖮 with the numerical predicate <, that allows to test whether x<y for two positions x and y. For example, the sentence φ=(x)(y)[a(x)((x<y)b(y))] describes the language Σab. 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 Σi[<] (resp. Πi[<]) for the fragment of 𝖥𝖮[<] of sentences in prenex normal form with i blocks of alternating quantifiers starting with (resp. ). For example, Σab belongs to Σ2[<] due to the form of our example φ. We let Δi[<]=Σi[<]Πi[<].

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 𝒩2× 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 𝐦𝐚𝐱(x) which is true if x is the position of the last agent. This technical difference will not impact our results. We let true=2 be the always-true predicate. The set 𝖯𝖯[𝒩] of PPs over 𝒩 is the set of transition systems (Q,Σ,O,Δ) where Q is a finite set of states, ΣQ is a distinguished subset of initial states, O:Q{,} maps each state to an opinion, and ΔQ2×(𝒩{true})×Q2 is a set of transitions. An element of Δ is denoted q1,q2𝑃q3,q4, expressing, intuitively, that if two distinct agents meet, the first being in position i and state q1, the second in position j and state q2, such that (i,j)P, then the first agent changes its state to q3 and the second to q4. 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 𝒩={P1,P2,}, we write 𝖯𝖯[P1,P2,] 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 (i,j) with i<j, 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 a,b𝑃a,c or a,b𝑃c,b. 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 Q+. Initial configurations are words of Σ+. Let u and v be two configurations of the same length, we say that u leads to v, denoted uv, if the two configurations are equal except at potentially two distinct positions i and j, and there is a transition u[i],u[j]𝑃v[i],v[j]Δ with (i,j)P. We let be the reflexive transitive closure of .

Consensus and stability.

With w a configuration, let O(w){,} be the common opinion of all states appearing in w, if there is one; otherwise O(w) is undefined. A configuration w is a b-consensus if O(w)=b. It is further b-stable if wv implies that v is a b-consensus.

Example 1.

We give an example of a protocol in 𝖯𝖯[<]. Consider the transition system 𝒫=({a,b,q},{a,b},O,Δ), with O(a)=O(b)=, O(q)=, and transitions b,a<q,q and q,_trueq,q with “_” standing for any state. Every input configuration belongs to (a+b)+ and is therefore a -consensus (all agents output initially). However, such configurations need not be -stable. For instance, starting from ba we can apply the rule b,a<q,q and obtain qq, which is -stable. In contrast, every configuration in ab is -stable: it is a -consensus and no transition is enabled.

Language of a PP.

Consider an infinite sequence w0w1w2 of configurations, which we call a run. We say that it is fair if for every wi that appears infinitely often, each configuration of {vwiv} appears infinitely often as well. By induction, fairness guarantees that each configuration of {vwiv} 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 L(𝒫) 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 wΣ, there is a b{,} such that all fair runs from w visit a b-stable configuration (i.e., for all finite runs from w to some configuration u, there is a path from u to a b-stable configuration). This is usually called well-specified in the literature and we justify our nomenclature in Section 3.1. We say that L(𝒫) 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 ab. Every input in ab is already -stable. Conversely, if an input word is not in ab, then it contains the factor ba. Hence, in any fair run, the transition (b,a)(q,q) is eventually executed. From that point on, every remaining agent eventually interacts with a q-agent and is converted to q, so the run reaches a configuration in q, which is -stable.

Example 3.

Consider the median language L=nΣnaΣn. Let us describe a protocol 𝒫=(Q,Σ,O,Δ) that decides L. The states are defined as Q=Σ×{,,}×{,}. 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 a with state (a,,), and each input σa with (σ,,). We set O((x,y,z))=z. The set Δ is defined by these rules, each describing a family of transitions:

Population halving
(1) (x,,z),(x,,z) < (x,,),(x,,)
Center finding
(2) (x,,z),(x,,z) < (x,,),(x,,x=a)
(3) (x,,z),(x,,z) < (x,,x=a),(x,,)
Output propagation
(4) (x,y,z),(x,,z) true (x,y,z),(x,,z) for y{,}
(5) (x,y,),(x,y,) true (x,y,),(x,y,) for y,y{,}

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 (x,,y) remains, then, by fairness and the fourth rule, it will propagate its output y, which is iff x=a, 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 aabL. 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 aab, which is -stable. Note that aab is a -consensus, but is not -stable.

Figure 1: Configurations reachable from aab, where xyz stands for (x,y,z). Self-loops arising from “no operation” transitions are omitted. The hatched nodes are consensuses; the bottom one is stable.

Further observe that the reachability graph of Figure 1 has non-trivial cycles, for instance:

aabaabaabaab

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 aab, 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 nn or nn. However, in general, it needs not be unique or trivial. A fair run becomes b-stable iff it visits a bottom strongly connected component whose configurations are all b-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 𝖨𝖮-𝖯𝖯[+1]. Recall that 𝖭𝖲𝖯𝖠𝖢𝖤(n) is the class of languages recognized by linear-bounded nondeterministic Turing machines, i.e., nondeterministic machines that require space O(n) over inputs of size n. 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 𝖭𝖲𝖯𝖠𝖢𝖤(n). We have 𝖯𝖯[𝒩]𝖭𝖲𝖯𝖠𝖢𝖤(n).

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 𝖭𝖲𝖯𝖠𝖢𝖤(n). Indeed, it is sufficient to nondeterministically guess a partial run (i.e., a finite sequence of configurations w0w1wn) that leads to a configuration that is not a -consensus. Each transition can be guessed, its condition checked, and its effect applied in 𝖭𝖲𝖯𝖠𝖢𝖤(n).

By the Immerman–Szelepcsényi theorem, 𝖭𝖲𝖯𝖠𝖢𝖤(n) is closed under complement, and so the set of -stable configurations is in 𝖭𝖲𝖯𝖠𝖢𝖤(n). Since the protocol is a decider, to check that a word w is accepted, it is sufficient to nondeterministically guess a partial run from w, and check that it ends in a -stable configuration. These are all tasks in 𝖭𝖲𝖯𝖠𝖢𝖤(n).

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 LΣ+ if for all uΣ+ and every fair run ρ starting from u, we have uL 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 uL 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 w.

Figure 2: Configurations labeled , and ns are -stable, -stable, and configurations from which no stable configurations are reachable. Arrows depict partial, finite runs. Situations (1-6) can happen in PP. Only situations (4-6) can happen in semi-deciders, while only situations (5-6) can in deciders.

Our naming convention is justified by the following property:

Lemma 6.

A language L is 𝖯𝖯[𝒩]-decidable iff L and its complement are 𝖯𝖯[𝒩]-semi-decidable. The same holds for 𝖨𝖮-𝖯𝖯[𝒩].

Proof sketch.

We combine the two semi-deciders for L and for Σ+L 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 u, exactly one of the two simulations eventually provides such a witness (since exactly one of uL or uL 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 L1,L2Σ+ are 𝖯𝖯[𝒩]-semi-decidable, then it is also the case for L1L2 and L1L2. 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 𝒫=(Q,Σ,O,Δ) is said to be input-saving if

  • Q=Σ×R for some finite set R;

  • Each σΣ is identified with (σ,rσ) for some rσR; and

  • The first component σ of any state (σ,r)Q is left unchanged by all transitions of Δ.

For all wQ+, let ι(w)Σ+ be the projection of w onto its first component. Given u,vQn, we write uv if either uv, or v equals u except at a single position i where u[i]=(σ,r) and v[i]=(σ,r). This second type of transitions models a “change of mind” of agent i 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 LΣ+ with stabilizing inputs if (a) 𝒫 is input-saving, and (b) for all uΣ+, all uv and every fair run ρ starting from v, it is the case that ι(v)L iff ρ visits a -stable configuration. We use the term “decides” if (b) is strengthened with the condition that ι(v)L iff ρ visits a -stable configuration.

Note that this is more robust than simply semi-deciding: if 𝒫 semi-decides L with stabilizing inputs, then it semi-decides L. Intuitively, after uv, the configuration of the population (i.e., the projection of v onto the second component) may be incompatible with ι(v) 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 ι(v).

It is known that any language L𝖯𝖯[] 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 01k is 𝖨𝖮-𝖯𝖯[<]-semi-decidable with stabilizing inputs.

Proof sketch.

Let Σ={0,1,,k} and L=01k. The protocol 𝒫=(Q,Σ,Δ,O) for L is defined by Q=Σ×{,}, O((σ,o))=o, each σΣ identified with (σ,), and these rules:

(x,),(y,o) <(x,),(y,o) for x>y,
(x,),(y,o) true(x,),(y,o).

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 L1,L2Σ+ are 𝖯𝖯[𝒩]-semi-decidable with stabilizing inputs, then it is also the case for L1L2 and L1L2. This further holds for 𝖨𝖮-𝖯𝖯[𝒩] and deciders.

Given f:Σ2Γ and wΣn, let f(w)={w1wnwif(wi) for each i[1..n]}. For example, if f(0)={a,b} and f(1)={b,c}, then f(01)={ab,ac,bb,bc}. We extend this notion to languages: f(L)=wLf(w).

Lemma 11.

Let f:Σ2Γ. If LΣ+ is 𝖯𝖯[𝒩]-semi-decidable with stabilizing inputs, then f(L) is 𝖯𝖯[𝒩]-semi-decidable with stabilizing inputs. This further holds for 𝖨𝖮-𝖯𝖯[𝒩].

Proof sketch.

The construction builds a protocol that semi-decides f(L) by simulating, in its second component, the input-saving semi-decider for L on a guessed word vΣ+ compatible with the real input uΓ+ (i.e., uf(v)). 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 uf(v) letterwise). If uf(L), fairness ensures that the population can eventually rewrite the guessed word into some vL, after which the simulation of the semi-decider for L reaches a -stable configuration and changes become disabled; if uf(L), reaching a -stable configuration would force the simulated input to lie in L, 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 LΣ, let us write L for the syntactic congruence of L, i.e., wLw iff uwvLuwvL for all u,vΣ. A language is in the class 𝖣𝖠 if it is regular, and satisfies, writing α(w)Σ for the set of letters appearing in a word w:

(wΣ)[wLw2(hα(w))[wLwhw]], (1)

It is a fascinating result of Pin and Weil [27] that 𝖣𝖠=Δ2[<]. We will leverage both characterizations to show the theorem below. The left-to-right inclusion will rely on (1), and the converse on 𝖣𝖠=Δ2[<], 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 u,vΣ, we say that u is a subword of v, written uv, if u can be obtained from v 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 u,u,wQ with uw and uu, there exists w such that uw and ww. Further, the set of b-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 wzw with α(z)α(w) can, in some sense, mimic the behavior of the protocol on the simpler infix w.

Lemma 14.

In an 𝖨𝖮-𝖯𝖯[<], if uwvuwv with |u|=|u| and |v|=|v|, then for all z with α(z)α(w), there exists z such that uwzwvuwzwv and α(z)α(w).

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 L𝖨𝖮-𝖯𝖯[<]. There exists a computable m1 such that, for all w1,,wmΣ+ and zΣ with α(w1)==α(wm)α(z), we have w1wmL(w1wm)z(w1wm).

Proof sketch.

Lemma 13 indicates that for both b{,}, the set of b-stable configurations is subword-closed. As a consequence, writing Bε for B{ε}, it is a finite union of languages of the form A1B1εAkBkε with Ai,Bi subsets of Q, the set of states of our protocol [20, Sect. 6.1.1]. Let Kb be the maximal factorization size k over all those languages, K=max(K,K) and m=2K+1. Lemma 13 also states that the set of b-stable configurations is computable for both b, in particular we can compute K,K and m.

Intuitively, if we have a run from w1wm to a -stable configuration w=w1wm, then we can match w with one of the expressions above, and some wi is entirely contained in some Aj.

We then use Lemma 14 to expand the run ww to a run from w=w1wmzw1wm to some b-stable configuration w~, by expanding the wi section into wiwmzw1wi.

We can thus show that if w is accepted, so is w. Similarly, we show that if w is not accepted, then it can reach a -stable configuration, and so can w. 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 u and v around w, 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 L𝖨𝖮-𝖯𝖯[<] and let wΣ be such that wLw2. It is the case that wLwhw for all hα(w).

Proof.

Lemma 15 implies that there is a (computable) number m such that wmhwmLwm, and since wLw2, we obtain wLwhw 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 (w1wm)z(w1wm) with α(w1)==α(wm)α(z). By Lemma 15, this means that every sufficiently long word is L-equivalent to a shorter one, meaning that L has finitely many equivalence classes. Since we can compute m, we can compute this automaton.

4.2 DA IO-PP[<]

Recall that LΠ2[<] iff ΣLΣ2[<]. Since 𝖣𝖠 is equal to Δ2[<]=Σ2[<]Π2[<], it is enough to prove that Σ2[<] languages are 𝖨𝖮-𝖯𝖯[<]-semi-decidable, appealing to Lemma 6 to conclude. Note that Σ2[<] is the set of languages expressible as finite unions of languages of the form L=A0a1A2am1Am with the Ai’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 L 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 L 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 {wΣ+|w|a=1} 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 (a,a,) agent can turn any (σ,σ,) with σa to , while the presence of any (σ,σ,) can spread to other agents. Finally, if an a-agent observes another a, it switches to ; combined with the rule that lets an a-agent reset itself to , this makes a-agents alternate forever between and whenever there are at least two a’s, preventing stabilization in that case. As a result, if the input contains no a then every fair run reaches a -stable consensus; if it contains exactly one a then every fair run reaches a -stable consensus; and if it contains at least two a’s then some agent flips its belief forever.

Proposition 19.

The language L=A0a1A2am1Am is 𝖨𝖮-𝖯𝖯[<]-semi-decidable (with stabilizing inputs).

Proof.

Let Γ={0,1,,m}, K=01m and K=aΓ,a odd{wΓ+|w|a=1}. By Proposition 9, K is 𝖨𝖮-𝖯𝖯[<]-semi-decidable with stabilizing inputs. Furthermore, by Propositions 18 and 10, K is 𝖨𝖮-𝖯𝖯[]-semi-decidable with stabilizing inputs. By Lemma 10, KK is 𝖨𝖮-𝖯𝖯[<]-semi-decidable with stabilizing inputs. Let f(i)=Ai for even i, and f(i)={ai} otherwise. We are done by Lemma 11 since L=f(KK).

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, Δ2[<], 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., ϕ(x)=(y)[y1x=2y] holds iff x is a positive even number. Write c for the equivalence of naturals modulo c. It is well known that Presburger arithmetic together with c with any c2 admits quantifier elimination. For our purposes, a Presburger formula is a (quantifier-free) Boolean combination of predicates of the form i=1naixi<b or i=1naixicb, where ai,b, c2 and variables xi are over .

5.1 First-order logic over word intervals

Definition 20.

For wΣn and σΣ, let #σ:{1,,n}×{1,,n} be the function that counts the number of occurrences of σ between two positions of w, i.e., #σ(x,y)=|w[x..y]|σ. We define 𝖥𝖮int as first-order logic over word intervals, that is, with access to numerical values #a(x,y) where x and y are either first-order variables, the first position (denoted “1”) or the last position (denoted “𝐦𝐚𝐱”). We will study 𝖥𝖮int[<,+,], where we allow numerical values to be compared, added, and tested modulo c for any constant c. Note that a variable x can be expressed as σΣ#σ(1,x), we will thus assume that the atomic formulas only have terms of the form #a(x,y), though we write 1 for σΣ#σ(1,1), and 𝐦𝐚𝐱 for σΣ#σ(1,𝐦𝐚𝐱). The logics Σkint, Πkint, and Δkint are naturally defined.

Example 21.

Let us show that the median language nΣnaΣn belongs to Δ1int[<,+,]. The following predicate asserts that x is the middle position: ψ(x)=σΣ#σ(1,x)=σΣ#σ(x,𝐦𝐚𝐱). The median language can either be expressed by (x)[ψ(x)a(x)], or by (x)[(ψ(x)a(x))𝐦𝐚𝐱21]. Note that a(x) is the same as #a(x,x)=1.

We now provide a convenient characterization of languages in Σ1int[<,+,].

Lemma 22.

Any language from Σ1int[<,+,] is a finite union of languages of the form K={a0w1a1wmamwiΣ,aiΣ,φ(xi,σ|wi|σ,yi,σ|ai|σ)} where m0 and φ is a Presburger formula over variables {xi,σi[1..m],σΣ}{yi,σi[0..m],σΣ}.

Thanks to the previous lemma, we are able to build a protocol 𝖯𝖯[<] semi-deciding any language in Σ1int[<,+,], by building semi-deciders with stabilizing inputs for each K, and then using the closure properties presented in Section 3.2.

Proposition 23.

Any language from Σ1int[<,+,] is 𝖯𝖯[<]-semi-decidable.

Proof.

Let LΣ1int[<,+,]. By Lemma 22, L is a finite union of languages of the form L={a0w1a1wmamwiΣ,aiΣ,φ(xi,σ|wi|σ,yi,σ|ai|σ)} where m0 and φ is a Presburger formula. It suffices to show that L is 𝖯𝖯[𝒩]-semi-decidable with stabilizing inputs. Indeed, by Lemma 10, that class of languages is closed under union.

Let Σ¯={σ¯σΣ}, Ai=Σ¯×{i}, Wi=Σ×{i} and Γ=i[0..m]Aii[1..m]Wi. We justify that the three following languages K, K and K′′ over alphabet Γ are semi-decided with stabilizing inputs:

  • K=A0W1A1WmAm,

  • K={wΓ+φ(xi,σ|w|(σ,i),yi,σ|w|(σ¯,i))},

  • K′′={wΓ+γA1|w|γ=1γAm|w|γ=1} (recall AiAj= for ij).

Let f(2i)=Ai and f(2i+1)=Wi+1. We have f(012(2m))=K. By Propositions 9 and 11, K is 𝖯𝖯[<]-semi-decidable with stabilizing inputs. Since K,K′′𝖯𝖯[], these two languages are 𝖯𝖯[]-decidable with stabilizing inputs [2, 29].

By Lemma 10, the language KKK′′ is 𝖯𝖯[<]-semi-decidable with stabilizing inputs. Let g((σ,i))=g((σ¯,i))={σ}. We are done by Lemma 11 since L=g(KKK′′).

Corollary 24.

Δ1int[<,+,]𝖯𝖯[<].

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 𝒜=(Q,Σ,δ,q0,F,Ψ) where:

  • Q is a finite set of states equipped with a partial order ;

  • Σ is a finite alphabet;

  • δQ×Σ×Q is the transition relation, that satisfies pq for all (p,σ,q)δ; if p=q, the transition is dubbed a self-loop, and otherwise, a progress transition;

  • q0Q is the initial state, and FQ is the set of final states;

  • Ψ is a Presburger formula over variables δ.

For all t=(q,σ,q)δ, we write qtq and πΣ(t)=σ. We naturally lift these notations to sequences. A word wΣ is accepted by 𝒜 if there exist ρδ and qF such that q0ρq, πΣ(ρ)=w and Ψ(t|ρ|t) holds. The language of 𝒜 is the set L(𝒜) of words it accepts. Figure 3 depicts two examples of poPA.

Figure 3: Example of poPA for the median language n0ΣnaΣn (left) and the coDyck-witness language {anvn1,v{,}n,|v[1..n]|>|v[1..n]|} (right).

Lemma 22 allows us to translate a formula from Σ1int[<,+,] into a poPA by guessing a factorization a0w1a1wmam with a progress transition for each ai, and a self-loop for each wi; and then using the Presbuger acceptance formula of the automaton to verify the guess. We can also translate a poPA into a formula of Σ1int[<,+,] 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 Σ1int[<,+,].

Recall that Σ2[<] is characterized by partially-ordered automata, while Δ2[<] is characterized by unambiguous partially-ordered automata. We explore a similar notion for Δ1int[<,+,] 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 wL(𝒜) is accepted by at most one path (w.r.t. F 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 Δ1int[<,+,]. 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 Δ1int[<,+,].

In the forthcoming Conjecture 40, we postulate that these two classes coincide. We note, as a sanity check, that since Δ2[<] is characterized by unambiguous partially-ordered automata, 𝖨𝖮-𝖯𝖯[<]=𝖣𝖠=Δ2[<]Δ1int[<,+,]. The strictness of the inclusion is in particular witnessed by the regular language {a2nn1} over alphabet {a}, which trivially belongs to Δ1int[<,+,] with formula 𝐦𝐚𝐱20.

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 Σ1int[<,+,]. If the language K therein is regular, this points to the formula φ not arithmetically linking the wi’s between one another nor imposing nonregular constraints on any single wi. Hence we have naturally:

Conjecture 28.

Let Com be the set of commutative regular languages. Let Pol(Com) be the set of languages that are finite unions of languages L0a1L1anLn with LiCom and ai letters. We conjecture that the regular languages of Σ1int[<,+,] are exactly Pol(Com).

The class Pol(Com) has been studied in previous works: [1] conjectures that they correspond to the regular languages requiring O(logn) 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 (ab)+. We recall, for contrast, that 𝖣𝖠 is the largest class of aperiodic regular languages, closed under the variety operations, that does not contain (ab)+. To give additional credence to our conjecture, we show:

Proposition 29.

The language (ab)+ does not belong to Σ1int[<,+,].

The class UPol(Com) is defined similarly as Pol(Com), except that we require that every word w in the marked concatenation has a unique decomposition w=w0a1w1anwn with wiLi. It is known [28] that UPol(Com)=Pol(Com)Pol(Com)¯. We naturally postulate, in Conjecture 40, that the regular languages of 𝖯𝖯[<] are exactly UPol(Com).

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 +1𝒩, where +1 (sometimes written 𝐬𝐮𝐜𝐜 in the literature) is the predicate {(x,x+1)x}. This study is reminiscent of the classic study of 𝖥𝖮2[<,+1] [15, 23, 33, 36] that followed that of 𝖥𝖮2[<], the two-variable fragment of 𝖥𝖮[<] that is as expressive as 𝖨𝖮-𝖯𝖯[<].

Example 30.

Recall that the set of all b-stable configurations of a 𝖯𝖯[<] is subword-closed, and hence regular. The following 𝖯𝖯[+1] has a non-regular set of -stable configurations:

a,b truea,b a,a +1,a a,b +1  , 
b,b +1b,

Let us set the opinion of each state to , except for . The protocol is constructed so that from a configuration of the form aabb, one marker moves to the right along the a’s, while the other synchronously moves to the left along the b’s. If they meet at the frontier between a’s and b’s, it means there are as many a’s and b’s, and that state appears.

The set of -stable configurations cannot be regular since, from waabb, the state will appear iff |w|a=|w|b, e.g.,

aabbaabbabbabab    .

The main result of this section is:

Theorem 31.

Let 𝒩 be a set of 𝖭𝖲𝖯𝖠𝖢𝖤(n)-decidable numerical predicates that contains +1. We have 𝖨𝖮-𝖯𝖯[𝒩]=𝖯𝖯[𝒩]=𝖭𝖲𝖯𝖠𝖢𝖤(n).

To show this result, it is enough to prove that 𝖭𝖲𝖯𝖠𝖢𝖤(n)𝖨𝖮-𝖯𝖯[+1], since 𝖯𝖯[𝒩]𝖭𝖲𝖯𝖠𝖢𝖤(n) 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 L be a 𝖯𝖯[+1]-semi-decidable language. There exists a 𝖯𝖯[+1]-protocol 𝒫 semi-deciding L and such that each +1-transition of 𝒫 is immediate-observation.

Proof sketch.

The construction turns a 𝖯𝖯[+1]-protocol 𝒫 into a new 𝖯𝖯[+1]-protocol 𝒫 by replacing each transition δ=(a,b)+1(c,d) with a short four-step handshake along the successor relation, using auxiliary markers aδ and b𝖺𝖼𝗄,δ. The four rules are:

a,b +1aδ,b aδ,b +1aδ,b𝖺𝖼𝗄,δ
aδ,b𝖺𝖼𝗄,δ +1c,b𝖺𝖼𝗄,δ c,b𝖺𝖼𝗄,δ +1c,d

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 𝖨𝖮-𝖯𝖯[+1]-semi-decidable.

Proof sketch.

Given a linear-bounded nondeterministic Turing machine M, we construct an 𝖨𝖮-𝖯𝖯[+1]-protocol 𝒫 that simulates M under stabilizing inputs. Thanks to Lemma 32, we only need to ensure that true-transitions are immediate-observation.

Let Σ be the tape alphabet of M. The protocol 𝒫 works over Γ where Γ=(P{})×Σ×{fst,,lst}. For example, w=(,a,fst)(p,a,)(,b,lst) represents the configuration of M in state p, with the head on the second cell, and the tape containing aab.

The protocol 𝒫 simulates M using +1-transitions with the agent containing the current state p. If M accepts, then 𝒫 spreads across the population. There are two challenges:

  1. 1.

    Since we want to semi-decide under stabilizing inputs, 𝒫 must reset the population and the simulation of M 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 +1-transitions, this can spread from right to left, resetting the population along the way.

  2. 2.

    If the input of 𝒫 is an invalid configuration of M, then the population should not reach a stable -consensus. For example, if two agents both represent the head of M, 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 M, but rather the set of configurations of M 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.

𝖭𝖲𝖯𝖠𝖢𝖤(n)𝖨𝖮-𝖯𝖯[+1].

Proof.

Let L𝖭𝖲𝖯𝖠𝖢𝖤(n). As 𝖭𝖲𝖯𝖠𝖢𝖤(n) is closed under complement, there exist two linear-bounded nondeterministic Turing machines M and M¯ recognizing L and Σ+L, respectively. By Lemma 33, we can build two 𝖨𝖮-𝖯𝖯[+1]-protocols, say 𝒫M and 𝒫M¯, that semi-decide L and Σ+L, respectively. Lemma 6 allows to conclude.

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 𝖨𝖮-𝖯𝖯[+1], 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 u 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 𝒫=(Q,Σ,O,Δ), we construct a protocol 𝒫 such that 𝒫 is not a decider iff 𝒫 can reach a -stable configuration. The construction adds a fresh sink state q with O(q)=, and for every state q with O(q)= we add a transition allowing an agent in q to switch to q.

As a consequence, from any configuration that contains a -agent, a fair execution can drive the system to the -stable consensus q. 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 q 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 q 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 𝖨𝖮-𝖯𝖯[+1] from Section 6, already yields the following result.

Corollary 36.

The syntax of 𝖨𝖮-𝖯𝖯[+1] and 𝖯𝖯[+1] 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 h1,h2:BA and construct a 𝖯𝖯[<] that can reach a -stable configuration if and only if there is a word u such that h1(u)=h2(u). 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 #1v#2u#3 with vB and uA. The two others check that we can reach a -stable configuration only when h1(u)=v and h2(u)=v, respectively. Each one does so by making agents simulate two reading heads going through u and v in lockstep and verifying that hi(u)=v. 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 u,v with h1(u)=v=h2(u).

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 n, if the protocol is a decider on words of length n. If the input protocol is not a decider, we will observe it for some n. The second one looks for invariants witnessing that the protocol is a decider. We look for two disjoint languages K,K such that every input word is in one of the two, they are closed under transitions of the protocol, and from everywhere in Kb we can reach a b-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 Δ1int[<,+,] and the class of languages recognized by weakly unambiguous poPA. The regular languages of 𝖯𝖯[<] are exactly UPol(Com).

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. 12th 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. 50th 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. 47th 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. 26th 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. 29th 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. 39th 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. 26th 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. 36th 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. 14th 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. 31st 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. 22nd 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. 20th 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. 5th 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. 30th 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. 51st 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 FO2 on words. In Proc. 21st 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. 25th International Conference on Principles of Distributed Systems, (OPODIS), pages 13:1–13:19, 2021. doi:10.4230/LIPIcs.OPODIS.2021.13.