Michael Blondin
email: michael.blondin@usherbrooke.ca

Javier Esparza
email: esparza@in.tum.de

Blaise Genest
email: blaise.genest@irisa.fr

Martin Helfrich
email: helfrich@in.tum.de

Stefan Jaax
email: jaax@in.tum.de

Succinct Population Protocols for Presburger Arithmetic

Keywords: 2012 ACM Subject Classification Theory of computation → Distributed computing models; Theory of computation → Automata Population protocols, Presburger arithmetic, state complexity Digital Object Identifier 10.4230/LIPIcs.STACS.2020.40 Succinct Population Protocols for Presburger Arithmetic

, Angluin et al. proved that population protocols compute exactly the predicates definable in Presburger arithmetic (PA), the first-order theory of addition. As part of this result, they presented a procedure that translates any formula ϕ of quantifier-free PA with remainder predicates (which has the same expressive power as full PA) into a population protocol with 2 O(poly(|ϕ|)) states that computes ϕ. More precisely, the number of states of the protocol is exponential in both the bit length of the largest coefficient in the formula, and the number of nodes of its syntax tree.

, where we constructed such protocols for a fragment of PA. For large enough inputs, we can get rid of these leaders. If the input is not large enough, then it is small, and we design another construction producing a succinct protocol with one leader that computes ϕ. Our last construction gets rid of this leader for small inputs.

Introduction

Population protocols [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF][START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF] are a model of distributed computation by indistinguishable, mobile finite-state agents, intensely investigated in recent years (see e.g. [START_REF] Alistarh | Recent algorithmic advances in population protocols[END_REF][START_REF] Elsässer | Recent results in population protocols for exact majority and leader election[END_REF]). Initially introduced to model networks of passively mobile sensors, they have also been applied to the analysis of chemical reactions under the name of chemical reaction networks (see e.g. [14]). In a population protocol, a collection of agents, called a population, randomly interact in pairs to decide whether their initial configuration satisfies a given property, e.g. whether there are initially more agents in some state A than in some state B. Since agents are indistinguishable and finite-state, their configuration at any time moment is completely characterized by the mapping that assigns to each state the number of agents that currently populate it. A protocol is said to compute a predicate if for every initial configuration where the predicate holds, the agents eventually reach consensus 1, and they eventually reach consensus 0 otherwise.

In a seminal paper, Angluin et al. proved that population protocols compute exactly the predicates definable in Presburger arithmetic (PA) [START_REF] Angluin | Stably computable predicates are semilinear[END_REF]. As part of the result, for every Presburger predicate Angluin et al. construct a leaderless protocol that computes it. The construction uses the quantifier elimination procedure for PA: every Presburger formula ϕ can be transformed into an equivalent boolean combination of threshold predicates of the form α • x > β and remainder predicates of the form α • x ≡ β (mod m), where α is an integer vector, and β, m are integers [12]. Slightly abusing language, we call the set of these boolean combinations quantifier-free Presburger arithmetic (QFPA) 1 . Using that PA and QFPA have the same expressive power, Angluin et al. first construct protocols for all threshold and remainder predicates, and then show that the predicates computed by protocols are closed under negation and conjunction.

The construction of [START_REF] Angluin | Stably computable predicates are semilinear[END_REF] is simple and elegant, but it produces large protocols. Given a formula ϕ of QFPA, let n be the number of bits of the largest coefficient of ϕ in absolute value, and let m be the number of atomic formulas of ϕ, respectively. The number of states of the protocols of [START_REF] Angluin | Stably computable predicates are semilinear[END_REF] grows exponentially in both n and m. In terms of |ϕ| (defined as the sum of the number of variables, n, and m) they have O(2 poly(|ϕ|) ) states. This raises the question of whether succinct protocols with O(poly(|ϕ|)) states exist for every formula ϕ of QFPA. We give an affirmative answer by proving that every formula of QFPA has a succinct and leaderless protocol.

Succinct protocols are the state-complexity counterpart of fast protocols, defined as protocols running in polylogarithmic parallel time in the size of the population. Angluin et al. showed that every predicate has a fast protocol with a leader [START_REF] Angluin | Fast computation by population protocols with a leader[END_REF], but Alistarh et al., based on work by Doty and Soloveichik [START_REF] Doty | Stable leader election in population protocols requires linear time[END_REF], proved that in the leaderless case some predicates need linear parallel time [START_REF] Alistarh | Timespace trade-offs in population protocols[END_REF]. Our result shows that, unlike for time complexity, succinct protocols can be obtained for every QFPA formula in both the leaderless case and the case with leaders.

The proof of our result overcomes a number of obstacles. Designing succinct leaderless protocols is particularly hard for inputs with very few input agents, because there are less resources to simulate leaders. So we produce two completely different families of protocols, one for small inputs with O(|ϕ| 3 ) agents, and a second for large inputs with Ω(|ϕ| 3 ) agents, and combine them appropriately.

1 Remainder predicates cannot be directly expressed in Presburger arithmetic without quantifiers.

Large inputs.

The family for large inputs is based on our previous work [START_REF] Blondin | Large flocks of small birds: On the minimal size of population protocols[END_REF]. However, in order to obtain leaderless protocols we need a new succinct construction for boolean combinations of atomic predicates. This obstacle is overcome by designing new protocols for threshold and remainder predicates that work under reversible dynamic initialization. Intuitively, agents are allowed to dynamically "enter" and "leave" the protocol through the initial states (dynamic initialization). Further, every interaction can be undone (reversibility), until a certain condition is met, after which the protocol converges to the correct output for the current input. We expect protocols with reversible dynamic initialization to prove useful in other contexts, since they allow a protocol designer to cope with "wrong" non-deterministic choices.

Small inputs. The family of protocols for small inputs is designed from scratch. We exploit that there are few inputs of small size. So it becomes possible to design one protocol for each possible size of the population, and combine them appropriately. Once the population size is fixed, it is possible to design agents that check if they have interacted with all other agents. This is used to simulate the concatenation operator of sequential programs, which allows for boolean combinations and succinct evaluation of linear combinations.

Relation to previous work. In [START_REF] Blondin | Large flocks of small birds: On the minimal size of population protocols[END_REF], we designed succinct protocols with leaders for systems of linear equations. More precisely, we constructed a protocol with O((m + k)(n + log m)) states and O(m(n + log m)) leaders that computes a given predicate Ax ≥ c, where A ∈ Z m×k and n is the number of bits of the largest entry in A and c, in absolute value. Representing Ax ≥ c as a formula ϕ of QFPA, we obtain a protocol with O(|ϕ| 2 ) states and O(|ϕ| 2 ) leaders that computes ϕ. However, in [START_REF] Blondin | Large flocks of small birds: On the minimal size of population protocols[END_REF] no succinct protocols for formulas with remainder predicates are given, and the paper makes extensive use of leaders.

Organization. Sections 2 and 3 introduce basic notation and definitions. Section 4 presents the main result. Sections 5 and 6 present the constructions of the protocols for large and small inputs, respectively. Section 7 presents conclusions. For space reasons, several proofs are only sketched. Detailed proofs are given in the full version of this paper [START_REF] Blondin | Succinct population protocols for Presburger arithmetic[END_REF].

Preliminaries

Notation. We write Z to denote the set of integers, N to denote the set of non negative integers {0, 1, . . .}, [n] to denote {1, 2, . . . , n}, and N E to denote the set of all multisets over E, i.e. unordered vectors with components labeled by E. The size of a multiset v ∈ N E is defined as

|v| def = e∈E v(e).
The set of all multisets over E with size s ≥ 0 is Presburger arithmetic. Presburger arithmetic (PA) is the first-order theory of N with addition, i.e. FO(N, +). For example, the PA formula ψ(x, y, z) = ∃x ∃z (x = x + x ) ∧ (y = z +z )∧ ¬(z = 0) states that x is even and that y > z. It is well-known that for every formula S TA C S 2 0 2 0 40:4 Succinct Population Protocols for Presburger Arithmetic of PA there is an equivalent formula of quantifier-free Presburger arithmetic (QFPA) [13], the theory with syntax given by the grammar

E s def = v ∈ N E : |v| = s .
ϕ(v) ::= a • v > b | a • v ≡ c b | ϕ(v) ∧ ϕ(v) | ϕ(v) ∨ ϕ(v) | ¬ϕ(v)
where a ∈ Z X , b ∈ Z, c ∈ N ≥2 , and ≡ c denotes equality modulo c. For example, the formula ψ(x, y, z) above is equivalent to (x ≡ 2 0) ∧ (y -z ≥ 1). Throughout the paper, we refer to any formula of QFPA, or the predicate N X → {0, 1} it denotes, as a predicate. Predicates of the form a • v > b and a • v ≡ c b are atomic, and they are called threshold and remainder predicates respectively. The max-norm ϕ of a predicate ϕ is the largest absolute value among all coefficients occurring within ϕ. The length len(ϕ) of a predicate ϕ is the number of boolean operators occurring within ϕ. The bit length of a predicate ϕ, over variables X, is defined as |ϕ| def = len(ϕ) + log ϕ + |X|. We lift these definitions to sets of predicates in the natural way: given a finite set P of predicates, we define its size size(P ) as the number of predicates in P , its length as len(P ) def = ϕ∈P len(ϕ), its norm as P def = max{ ϕ : ϕ ∈ P }, and its bit length as |P | def = size(P ) + len(P ) + log P + |X|. Note that len(P ) = 0 iff P only contains atomic predicates.

Population protocols

A population protocol is a tuple P = (Q, T, L, X, I, O) where Q is a finite set whose elements are called states;

T ⊆ {(p, q) ∈ N Q × N Q : |p| = |q|} is a finite set of transitions containing the set {(p, p) : p ∈ N Q , |p| = 2}; L ∈ N Q is the leader multiset;
X is a finite set whose elements are called input variables; I : X → Q is the input mapping; O : Q → {0, 1, ⊥} is the output mapping.

For readability, we often write t : p → q to denote a transition t = (p, q). Given ∆ ≥ 2, we say that t is ∆-way if |p| ≤ ∆.

In the standard syntax of population protocols T is a subset of N 2 ×N 2 , and O : Q → {0, 1}. These differences are discussed at the end of this section.

Inputs and configurations.

An input is a multiset v ∈ N X such that |v| ≥ 2, and a configuration is a multiset C ∈ N Q such that |C| ≥ 2. Intuitively, a configuration represents a population of agents where C(q) denotes the number of agents in state q. The initial configuration C v for input v is defined as

C v def = L + v(x) • I(x) : x ∈ X .
The support and b-support of a configuration C are respectively defined as andO(C) def = ⊥ otherwise. Loosely speaking, if O(q) = ⊥ then agents in state q have no output, and a population has output b ∈ {0, 1} if all agents with output have output b.

C def = {q ∈ Q : C(q) > 0} and C b = {q ∈ C : O(q) = b}. The output of a configuration C is defined as O(C) def = b if C b = ∅ and C ¬b = ∅ for some b ∈ {0, 1},
Executions. A transition t = (p, q) is enabled in a configuration C if C ≥ p, and disabled otherwise. Because of our assumption on T , every configuration enables at least one transition. If t is enabled in C, then it can be fired leading to configuration

C def = C p + q, which we denote C t - → C . For every set of transitions S, we write C S -→ C if C t - → C for some t ∈ S.

40:5

We denote the reflexive and transitive closure of S -→ by S * --→. If S is the set of all transitions of the protocol under consideration, then we simply write -→ and *

-→. An execution is a sequence of configurations σ = C 0 C 1 • • • such that C i - → C i+1 for every i ∈ N. We write σ i to denote configuration C i . The output of an execution σ is defined as follows. If there exist i ∈ N and b ∈ {0, 1} such that O(σ i ) = O(σ i+1 ) = • • • = b, then O(σ) def = b, and otherwise O(σ) def = ⊥.
Computations. An execution σ is fair if for every configuration D the following holds:

if |{i ∈ N : σ i * -→ D}| is infinite, then |{i ∈ N : σ i = D}| is infinite.
In other words, fairness ensures that an execution cannot avoid a configuration forever. We say that a population protocol computes a predicate ϕ : N X → {0, 1} if for every v ∈ N X and every fair execution σ starting from C v , it is the case that O(σ) = ϕ(v). Two protocols are equivalent if they compute the same predicate. It is known that population protocols compute precisely the Presburger-definable predicates [START_REF] Angluin | Stably computable predicates are semilinear[END_REF]11].

Example 1. Let P n = (Q, T, 0, {x}, I, O) be the protocol where Q def = {0, 1, 2, 3, . . . , 2 n }, I(x) def = 1, O(a) = 1 def ⇐⇒ a = 2 n , and T contains a transition, for each a, b ∈ Q, of the form a, b → 0, a + b if a + b < 2 n , and a, b → 2 n , 2 n if a + b ≥ 2 n . It is readily seen that P n computes ϕ(x) def = (x ≥ 2 n ).
Intuitively, each agent stores a number, initially 1. When two agents meet, one of them stores the sum of their values and the other one stores 0, with sums capping at 2 n . Once an agent reaches this cap, all agents eventually get converted to 2 n . Now, consider the protocol

P n = (Q , T , 0, {x}, I , O ), where Q def = {0, 2 0 , 2 1 , . . . , 2 n }, I (x) def = 2 0 , O (a) = 1 def ⇐⇒ a = 2 n ,
and T contains a transition for each 0 ≤ i < n of the form 2 i , 2 i → 0, 2 i+1 , and a transition for each a ∈ Q of the form a, 2 n → 2 n , 2 n . Using similar arguments as above, it follows that P n also computes ϕ, but more succinctly: While P n has 2 n + 1 states, P n has only n + 1 states.

Types of protocols. A protocol P = (Q, T, L, X, I, O) is

leaderless if |L| = 0, and has |L| leaders otherwise; ∆-way if all its transitions are ∆-way;

simple if there exist f, t ∈ Q such that O(f) = 0, O(t) = 1 and O(q) = ⊥ for every q ∈ Q \ {f, t} (i.e.
, the output is determined by the number of agents in f and t.) Protocols with leaders and leaderless protocols compute the same predicates [START_REF] Angluin | Stably computable predicates are semilinear[END_REF]. Every ∆-way protocol can be transformed into an equivalent 2-way protocol with a polynomial increase in the number of transitions [START_REF] Blondin | Large flocks of small birds: On the minimal size of population protocols[END_REF]. Finally, every protocol can be transformed into an equivalent simple protocol with a polynomial increase in the number of states [START_REF] Blondin | Succinct population protocols for Presburger arithmetic[END_REF].

Main result

The main result of this paper is the following theorem:

Theorem 2. Every predicate ϕ of QFPA can be computed by a leaderless population protocol P with O(poly(|ϕ|)) states. Moreover, P can be constructed in polynomial time.

To prove Theorem 2, we first provide a construction that uses ∈ O(|ϕ| 3 ) leaders. If there are at least |v| ≥ input agents v (large inputs), we will show how the protocol can be made leaderless by having agents encode both their state and the state of some leader. Otherwise, |v| < (small inputs), and we will resort to a special construction, with a single S TA C S 2 0 2 0 40:6 Succinct Population Protocols for Presburger Arithmetic leader, that only works for populations of bounded size. We will show how the leader can be simulated collectively by the agents. Hence, we will construct succinct protocols computing ϕ for large and small inputs, respectively. Formally, we prove: Lemma 3. Let ϕ be a predicate over variables X. There exist ∈ O(|ϕ| 3 ) and leaderless protocols P ≥ and P < with O(poly(|ϕ|)) states such that: (a) P ≥ computes predicate (|v| ≥ ) → ϕ(v), and (b)

P < computes predicate (|v| < ) → ϕ(v).
Theorem 2 follows immediately from the lemma: it suffices to take the conjunction of both protocols, which only yields a quadratic blow-up on the number of states, using the classical product construction [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]. The rest of the paper is dedicated to proving Lemma 3. Parts (a) and (b) are shown in Sections 5 and 6, respectively.

In the remainder of the paper, whenever we claim the existence of some protocol P, we also claim polynomial-time constructibility of P without mentioning it explicitly.

Succinct protocols for large populations

We show that, for every predicate ϕ, there exists a constant ∈ O(|ϕ| 3 ) and a succinct protocol P ≥ computing (|v| ≥ ) → ϕ(v). Throughout this section, we say that n ∈ N is large if n ≥ , and that a protocol computes ϕ for large inputs if it computes (|v| ≥ ) → ϕ(v).

We present the proof in a top-down manner, by means of a chain of statements of the form "A ← B, B ← C, C ← D, and D". Roughly speaking, and using notions that will be defined in the forthcoming subsections: Section 5.1 introduces protocols with helpers, a special class of protocols with leaders.

The section shows: ϕ is computable for large inputs by a succinct leaderless protocol (A), if it is computable for large inputs by a succinct protocol with helpers (B). Section 5.2 defines protocols that simultaneously compute a set of predicates. The section proves: (B) holds if the set P of atomic predicates occurring within ϕ is simultaneously computable for large inputs by a succinct protocol with helpers (C). Section 5.3 introduces protocols with reversible dynamic initialization. The section shows: (C) holds if each atomic predicate of P is computable for large inputs by a succinct protocol with helpers and reversible dynamic initialization (D). Section 5.4 shows that (D) holds by exhibiting succinct protocols with helpers and reversible dynamic initialization that compute atomic predicates for large inputs.

From protocols with helpers to leaderless protocols

Intuitively, a protocol with helpers is a protocol with leaders satisfying an additional property: adding more leaders does not change the predicate computed by the protocol. Formally, let P = (Q, T, L, X, I, O) be a population protocol computing a predicate ϕ. We say that P is a protocol with helpers if for every L L the protocol P = (Q, T, L , X, I, O) also computes ϕ, where L L def = ∀q ∈ Q : (L (q) = L(q) = 0 ∨ L (q) ≥ L(q) > 0). If |L| = , then we say that P is a protocol with helpers.

40:7

Proof sketch. By [8, Lemma 3], P can be transformed into a 2-way population protocol (with helpers 2 ) computing the same predicate ϕ, and with at most |Q| + 3∆ • |T | states. Thus, we assume P to be 2-way in the rest of the sketch.

For simplicity, assume X = {x} and L = 3 • q, 5 • q ; that is, P has 8 helpers, and initially 3 of them are in state q, and 5 are in q . We describe a leaderless protocol P that simulates P for every input v such that |v| ≥ |L| = . Intuitively, P runs in two phases:

In the first phase each agent gets assigned a number between 1 and 8, ensuring that each number is assigned to at least one agent (this is the point at which the condition |v| ≥ is needed). At the end of the phase, each agent is in a state of the form (x, i), meaning that the agent initially represented one unit of input for variable x, and that it has been assigned number i. To achieve this, initially every agent is placed in state (x, 1).

Transitions are of the form (x, i), (x, i) → (x, i + 1), (x, i) for every 1 ≤ i ≤ 7. The transitions guarantee that all but one agent is promoted to (x, 2), all but one to (x, 3), etc. In other words, one agent is "left behind" at each step.

In the second phase, an agent's state is a multiset: agents in state (x, i) move to state I(x), q if 1 ≤ i ≤ 3, and to state I(x), q if 4 ≤ i ≤ 8. Intuitively, after this move each agent has been assigned two jobs: simultaneously simulate a regular agent of P starting at state x, and a helper of L starting at state q or q . Since in the first phase each number is assigned to at least one agent, P has at least 3 agents simulating helpers in state q, and at least 5 agents simulating helpers in state q . There may be many more helpers, but this is harmless, because, by definition, additional helpers do not change the computed predicate.

The transitions of P are designed according to this double role of the agents of P . More precisely, for all multisets p, q, p , q of size two, p, q → p , q is a transition of P iff (p + q) -→ (p + q ) in P.

From multi-output protocols to protocols with helpers

A k-output population protocol is a tuple Q = (Q, T, L, X, I, O) where O : [k] × Q → {0, 1, ⊥} and Q i def = (Q, T, L, X, I, O i ) is a population protocol for every i ∈ [k],
where O i denotes the mapping such that O i (q) def = O(i, q) for every q ∈ Q. Intuitively, since each Q i only differs by its output mapping, Q can be seen as a single population protocol whose executions have k outputs. More formally, Q computes a set of predicates

P = {ϕ 1 , ϕ 2 , . . . , ϕ k } if Q i computes ϕ i for every i ∈ [k]. Furthermore, we say that Q is simple if Q i is simple for every i ∈ [k].
Whenever the number k is irrelevant, we use the term multi-output population protocol instead of k-output population protocol. Proof sketch. Consider a binary tree decomposing the boolean operations of ϕ. We design a protocol for ϕ by induction on the height of the tree.

The case where the height is 0, and ϕ is atomic, is trivial. We sketch the induction step for the case where the root is labeled with ∧, that is ϕ = ϕ 1 ∧ ϕ 2 , the other cases are similar. By induction hypothesis, we have simple protocols P 1 , P 2 computing ϕ 1 , ϕ 2 , 2 Lemma 3 of [START_REF] Blondin | Large flocks of small birds: On the minimal size of population protocols[END_REF] deals with leaders and not the more specific case of helpers. Nonetheless, computation under helpers is preserved as the input mapping of P remains unchanged in the proof of the lemma.

S TA C S 2 0 2 0 40:8

Succinct Population Protocols for Presburger Arithmetic

respectively. Let t j , f j be the output states of P j for j ∈ {1, 2} such that O j (t j ) = 1 and O j (f j ) = 0. We add two new states t, f (the output states of the new protocol) and an additional helper starting in state f. To compute ϕ 1 ∧ ϕ 2 we add the following transitions for every b

1 ∈ {t 1 , f 1 }, b 2 ∈ {t 2 , f 2 }, and b ∈ {t, f}: b 1 , b 2 , b → b 1 , b 2 , t if b 1 = t 1 ∧ b 2 = t 2 , and b 1 , b 2 , b → b 1 , b 2 , f otherwise.
The additional helper computes the conjunction as desired.

From reversible dynamic initialization to multi-output protocols

Let P = {ϕ 1 , . . . , ϕ k } be a set of k ≥ 2 atomic predicates of arity n ≥ 1 over a set X = {x 1 , . . . , x n } of variables. We construct a multi-output protocol P for P of size poly(|ϕ

1 | + • • • + |ϕ k |).
Let P 1 , . . . , P k be protocols for ϕ 1 , . . . , ϕ k . Observe that P cannot be a "product protocol" that executes P 1 , . . . , P k synchronously. Indeed, the states of such a P are tuples (q 1 , . . . , q k ) of states of P 1 , . . . , P k , and so P would have exponential size in k. Further, P cannot execute P 1 , . . . , P k asynchronously in parallel, because, given an input x ∈ N n , it must dispatch k • x agents (x to the input states of each P j ), but it only has x. Such a P would need (k -1)|x| helpers, which is not possible, because a protocol of size poly(|ϕ

1 | + • • • + |ϕ k |) can only use poly(|ϕ 1 | + • • • + |ϕ k |) helpers, whatever the input x.
The solution is to use a more sophisticated parallel asynchronous computation. Consider two copies of inputs, denoted X = {x 1 , . . . , x n } and X = {x 1 , . . . , x n }. For each predicate ϕ over X, consider predicate φ over X ∪ X satisfying φ(x, x) = ϕ(kx + x) for every (x, x) ∈ N X∪X . We obtain φ(x, x) = ϕ(x) whenever kx + x = x, e.g. for x := x k and x := x mod k. With this choice, P needs to dispatch a total of k (|x + x|) ≤ |x| + n • (k -1) 2 agents to compute φ1 (x, x), . . . , φk (x, x). That is, n • (k -1) 2 helpers are sufficient to compute P. Formally, we define φ in the following way:

For ϕ(x) = n i=1 α i x i > β , we define φ(x, x) := n i=1 (k • α i )x i + α i x i > β
and similarly for modulo predicates. For instance, if ϕ(x 1 , x 2 ) = 3x 1 -2x 2 > 6 and k = 4, then φ(x 1 , x 1 , x 2 , x 2 ) = 12x 1 + 3x 1 -8x 2 -2x 2 > 6. As required, φ(x, x) = ϕ(kx + x).

Let us now describe how the protocol P computes φ1 (x, x), . . . , φk (x, x). Let P1 , . . . , Pk be protocols computing φ1 , . . . , φk . Let X = {x 1 , . . . , x n } be the input states of P, and let x j 1 , . . . , x j n and x j 1 , . . . , x j n be the input states of Pj for every 1 ≤ j ≤ k. Protocol P repeatedly chooses an index 1 ≤ i ≤ n, and executes one of these two actions: (a) take k agents from x i , and dispatch them to x 1 i , . . . , x k i (one agent to each state); or (b) take one agent from x i and (k -1) helpers, and dispatch them to x 1 i , . . . , x k i . The index and the action are chosen nondeterministically. Notice that if for some input x i , all agents of x i are dispatched, then kx j i + x j i = for all j. If all agents of x i are dispatched for every 1 ≤ i ≤ n, then we say that the dispatch is correct.

The problem is that, because of the nondeterminism, the dispatch may or may not be correct. Assume, e.g., that k = 5 and n = 1. Consider the input x 1 = 17, and assume that P has n • (k -1) 2 = 16 helpers. P may correctly dispatch x 1 = 17 5 = 3 agents to each of x 1 1 , . . . , x 1 5 and x 1 = (17 mod 5) = 2 to each of x 1 1 , . . . , x 1 5 ; this gives a total of (3 + 2) • 5 = 25 agents, consisting of the 17 agents for the input plus 8 helpers. However, it may also wrongly dispatch 2 agents to each of x 1 1 , . . . , x 1 5 and 4 agents to each of x 1 1 , . . . , x 1 5 , with a total of (2 + 4) • 5 = 30 agents, consisting of 14 input agents plus 16 helpers. In the second case, each P j wrongly computes φj (2, 4) = ϕ j (2 • 5 + 4) = ϕ j (14), instead of the correct value ϕ j (17).

To solve this problem we ensure that P can always recall agents already dispatched to P1 , . . . , Pk as long as the dispatch is not yet correct. This allows P to "try out" dispatches until it dispatches correctly, which eventually happens by fairness. For this we design P so that (i) the atomic protocols P1 , . . . , Pk can work with inputs agents that arrive over time (dynamic initialization), and (ii) P1 , . . . , Pk can always return to their initial configuration and send agents back to P, unless the dispatch is correct (reversibility). To ensure that P stops redistributing after dispatching a correct distribution, it suffices to replace each reversing transition p → q by transitions p + x i → q + x i , one for each 1 ≤ i ≤ n: All these transitions become disabled when x 1 , . . . , x n are not populated.

Reversible dynamic initialization.

Let us now formally introduce the class of protocols with reversible dynamic initialization that enjoys all properties needed for our construction. A simple protocol with reversible dynamic initialization (RDI-protocol for short) is a tuple L,X,I,O) is a simple population protocol, and T † is the set of transitions making the system reversible, called the RDI-transitions.

P = (Q, T ∞ , T † , L, X, I, O), where P ∞ = (Q, T ∞ ,
Let T def = T ∞ ∪ T † ,
(t) = 1. For every configuration C, let [C] def = {C : C (f) + C (t) = C(f) + C(t) and C (q) = C(q) for all q ∈ Q \ {f, t}}.
Intuitively, all configurations C ∈ [C] are equivalent to C in all but the output states.

An RDI-protocol is required to be reversible, that is for every initialization sequence π with effective input w, and such that L Intuitively, an RDI-protocol can never have more agents in an input state than the effective number of agents it received via the input and output transitions. Further, an RDI-protocol can always reverse all sequences that do not contain input or output transitions. This reversal does not involve the states f and t, which have a special role as output states. Since RDI-protocols have a default output, we need to ensure that the default output state is populated when dynamic initialization ends, and reversal for f and t would prevent that.

An RDI-protocol P computes ϕ if for every initialization sequence π with effective input w such that L π -→ C for some L L, the standard population protocol P ∞ computes ϕ(w) from C (that is with T † disabled). Intuitively, if the dynamic initialization terminates, the RDI-transitions T † become disabled, and then the resulting standard protocol P ∞ converges to the output corresponding to the dynamically initialized input.

Atomic predicates under reversible dynamic initialization

Lastly, we show that atomic predicates are succinctly computable by RDI-protocols: where places (circles), transitions (squares) and tokens (smaller filled circles) represent respectively states, transitions and agents. Non-helper agents remember their input variable (labeled here within tokens). The depicted configuration is obtained from input x = 2, y = 1 by firing the bottom leftmost transition (dark blue).

The protocols for arbitrary threshold and remainder predicates satisfying the conditions of Theorem 7, and their correctness proofs, are given in [START_REF] Blondin | Succinct population protocols for Presburger arithmetic[END_REF]. Note that the threshold protocol is very similar to the protocol for linear inequalities given in Section 6 of [START_REF] Blondin | Large flocks of small birds: On the minimal size of population protocols[END_REF]. Thus, as an example, we will instead describe how to handle the remainder predicate 5x -y ≡ 7 4. Note, that the predicate can be rewritten as (5x + 6y ≥ 4 (mod 7)) ∧ (5x + 6y ≥ 5 (mod 7)). As we can handle negations and conjunctions separately in Section 5.2, we will now explain the protocol for ϕ def = 5x + 6y ≥ 4 (mod 7). The protocol is partially depicted in Figure 1 using Petri net conventions for the graphical representation.

The protocol has an input state x for each variable x ∈ X, output states f and t, a neutral state 0, and numerical states of the form +2 i for every 0 ≤ i ≤ n, where n is the smallest number such that 2 n > ϕ . Initially, (at least) one helper is set to f and (at least) 2n helpers set to 0. In order to compute 5x + 6y ≥ 4 (mod 7) for x := r and y := s, we initially place r and s agents in the states x and y, i.e., the agents in state x encode the number r in unary, and similarly for y. The blue transitions on the left of Figure 1 "convert" each agents in input states to a binary representation of their corresponding coefficient. In our example, agents in state x are converted to a(x) = 5 = 0101 2 by putting one agent in 4 and another one in 1. Since two agents are needed to encode 5, the transition "recruits" one helper from state 0. Observe that, since the inputs can be arbitrarily large, but a protocol can only use a constant number of helpers, the protocol must reuse helpers in order to convert all agents in input states. This happens as follows. If two agents are in the same power of two, say +2 i , then one of them can be "promoted" to +2 i+1 , while the other one moves to state 0, "liberating" one helper. This allows the agents to represent the overall value of all converted agents in the most efficient representation. That is, from any configuration, one can always reach a configuration where there is at most one agent in each place 2 0 , . . . , 2 n-1 , there are at most the number of agents converted from input places in place 2 n , and hence there are at least n agents in place 0, thus ready to convert some agent from the input place. Similar to promotions, "demotions" to smaller powers of two can also happen. Thus, the agents effectively shift through all possible binary representations of the overall value of all converted agents. The ≡ 7 transition in Figure 1 allows 3 agents in states 4, 2 and 1 to "cancel out" by moving to state 0, and it moves the output helper to f. Furthermore, there are RDI-transitions that allow to revert the effects of conversion and cancel transitions. These are not shown in Figure 1.

We have to show that this protocol computes ϕ under reversible dynamic initialization. First note, that while dynamic initialization has not terminated, all transitions have a corresponding reverse transition. Thus, it is always possible to return to wrong initial configurations. However, reversing the conversion transitions can create more agents in input states than the protocol effectively received. To forbid this, each input agent is "tagged" with its variable (see tokens in Figure 1). Therefore, in order to reverse a conversion transitions, the original input agent is needed. This implies, that the protocol is reversible.

Next, we need to argue that the protocol without the RDI-transitions computes ϕ once the dynamic initialization has terminated. The agents will shift through the binary representations of the overall value. Because of fairness, the ≡ 7 transition will eventually reduce the overall value to at most 6. There is a ≥ 4-transition which detects the case where the final value is at least 4 and moves the output helper from f to state t. Notice that whenever transition ≡ 7 occurs, we reset the output by moving the output helper to state f.

Succinct protocols for small populations

We show that for every predicate ϕ and constant = O(|ϕ| 3 ), there exists a succinct protocol P < that computes the predicate (|v| < ) → ϕ(v). In this case, we say that P < computes ϕ for small inputs. Further, we say that a number n ∈ N (resp. an input v) is small with respect to ϕ if n ≤ (resp. |v| ≤ ). We present the proof strategy in a top-down manner. Section 6.1 proves: There is a succinct leaderless protocol P that computes ϕ for small inputs (A), if for every small n some succinct protocol P n computes ϕ for all inputs of size n (B). Intuitively, constructing a succinct protocol for all small inputs reduces to the simpler problem of constructing a succinct protocol for all small inputs of a fixed size. Section 6.2 introduces halting protocols. It shows: There is a succinct protocol that computes ϕ for inputs of size n, if for every atomic predicate ψ of ϕ some halting succinct protocol computes ψ for inputs of size n (C). Thus, constructing protocols for arbitrary predicates reduces to constructing halting protocols for atomic predicates. Section 6.3 proves (C). Given a threshold or remainder predicate ϕ and a small n, it shows how to construct a succinct halting protocol that computes ϕ for inputs of size n.

From fixed-sized protocols with one leader to leaderless protocols

We now define when a population protocol computes a predicate for inputs of a fixed size.

Intuitively, it should compute the correct value for every initial configurations of this size; for inputs of other sizes, the protocol may converge to the wrong result, or may not converge.

Proof sketch. We only sketch the construction for ϕ = ϕ 1 ∧ ϕ 2 . The main intuition is that, since P 1 and P 2 are halting, we can construct a protocol that, given an input v, first simulates P 1 on v, and, after P 1 halts, either halts if P 1 converges to 0, or simulates P 2 on v if P 1 converges to 1. Each agent remembers in its state the input variable it corresponds to, in order to simulate P 2 on v.

Computing atomic predicates for fixed-size inputs

We describe a halting protocol that computes a given threshold predicate for fixed-size inputs.

Theorem 12. Let ϕ(x, y)

def = α • x -β • y > 0.
For every i ∈ N, there exists a halting protocol with one leader and O(i 2 (|ϕ| + log i) 3 ) states that computes (ϕ | i).

We first describe a sequential algorithm Greater-Sum(x, y), that for every input x, y satisfying |x| + |y| = i decides whether α • xβ • y > 0 holds. Then we simulate Greater-Sum by means of a halting protocol with i agents.

Since each agent can only have O(log i + log |ϕ|) bits of memory (the logarithm of the number of states), Greater-Sum must use at most O(i • (log i + log |ϕ|)) bits of memory, otherwise it cannot be simulated by the agents. Because of this requirement, Greater-Sum cannot just compute, store, and then compare α • x and β • y; this uses too much memory.

Greater-Sum calls procedures Probe 1 (j) and Probe 2 (j) that return the j-th bits of αx and βy, respectively, where j = 1 is the most significant bit. Since |x| ≤ i, and the largest constant in α is at most ||ϕ||, we have α • x ≤ i • ||ϕ||, and so α • x has at most m def = |ϕ| + log(i) + 1 bits, and the same holds for βy. So we have 1 ≤ j ≤ m. Let us first describe Greater-Sum, and then Probe 1 (j); the procedure Probe 2 (j) is similar.

Greater-Sum(x, y) loops through j = 1, . . . , m. For each j, it calls Probe 1 (j) and Probe 2 (j). If Probe 1 (j) > Probe 2 (j), then it answers ϕ(x, y) = 1, otherwise it moves to j + 1. If Greater-Sum reaches the end of the loop, then it answers ϕ(x, y) = 0. Observe that Greater-Sum only needs to store the current value of j and the bits returned by Probe 1 (j) and Probe 2 (j). Since j ≤ m, Greater-Sum only needs O(log(|ϕ| + log i)) bits of memory.

Probe 1 (j) uses a decreasing counter k = m, . . . , j to successively compute the bits b 1 (k) of α • x, starting at the least significant bit. To compute b 1 (k), the procedure stores the carry c k ≤ i of the computation of b 1 (k + 1); it then computes the sum s k := c k + α(k) • x (where α(k) is the k-th vector of bits of α), and sets b k := s k mod 2 and c k-1 := s k ÷ 2. The procedure needs O(log(|ϕ| + log i)) bits of memory for counter k, log(i) + 1 bits for encoding s k , and O(log(i)) bits for encoding c k . So it only uses O(log(|ϕ| + log i)) bits of memory.

Let us now simulate Greater-Sum(x, y) by a halting protocol with one leader agent. Intuitively, the protocol proceeds in rounds corresponding to the counter k. The leader stores in its state the value j and the current values of the program counter, of counter k, and of variables b k , s k , and c k . The crucial part is the implementation of the instruction s k := c k + α(k) • x of Probe 1 (j). In each round, the leader adds input agents one by one. As the protocol only needs to work for populations with i agents, it is possible for each agent to know if it already interacted with the leader in this round, and for the leader to count the number of agents it has interacted with this round, until it reaches i to start the next round.

Conclusion and further work

We have proved that every predicate ϕ of quantifier-free Presburger arithmetic (QFPA) is computed by a leaderless protocol with poly(|ϕ|) states. Further, the protocol can be computed in polynomial time. The number of states of previous constructions was exponential S TA C S 2 0 2 0 40:14 Succinct Population Protocols for Presburger Arithmetic both in the bit-length of the coefficients of ϕ, and in the number of occurrences of boolean connectives. Since QFPA and PA have the same expressive power, every computable predicate has a succinct leaderless protocol. This result completes the work initiated in [START_REF] Blondin | Large flocks of small birds: On the minimal size of population protocols[END_REF], which also constructed succinct protocols, but only for some predicates, and with the help of leaders.

It is known that protocols with leaders can be exponentially faster than leaderless protocols. Indeed, every QFPA predicate is computed by a protocol with leaders whose expected time to consensus is polylogarithmic in the number of agents [START_REF] Angluin | Fast computation by population protocols with a leader[END_REF], while every leaderless protocol for the majority predicate needs at least linear time in the number of agents [START_REF] Alistarh | Timespace trade-offs in population protocols[END_REF]. Our result shows that, if there is also an exponential gap in state-complexity, then it must be because some family of predicates have protocols with leaders of logarithmic size, while all leaderless families need polynomially many states. The existence of such a family is an open problem.

The question of whether protocols with poly(|ϕ|) states exist for every PA formula ϕ, possibly with quantifiers, also remains open. However, it is easy to prove that no algorithm for the construction of protocols from PA formulas runs in time 2 p(n) for any polynomial p.

Theorem 13. For every polynomial p, every algorithm that accepts a formula ϕ of PA as input, and returns a population protocol computing ϕ, runs in time 2 ω(p(|ϕ|)) .

Therefore, if PA also has succinct protocols, then they are very hard to find.

Our succinct protocols for QFPA have slow convergence (in the usual parallel time model, see e.g. [START_REF] Alistarh | Recent algorithmic advances in population protocols[END_REF]), since they often rely on exhaustive exploration of a number of alternatives, until the right one is eventually hit. The question of whether every QFPA predicate has a succinct and fast protocol is very challenging, and we leave it open for future research.

  We sometimes write multisets using set-like notation, e.g. a, 2•b denotes the multiset v such that v(a) = 1, v(b) = 2 and v(e) = 0 for every e ∈ E \ {a, b}. The empty multiset is instead denoted 0 for readability. For every u, v ∈ N E , we write u ≥ v if u(e) ≥ v(e) for every e ∈ E. Moreover, we write u + v to denote the multiset w ∈ N E such that w(e) def = u(e) + v(e) for every e ∈ E. The multiset u v is defined analogously withinstead of +, provided that u ≥ v.

Theorem 4 .

 4 Let P = (Q, T, L, X, I, O) be a ∆-way population protocol with -helpers computing some predicate ϕ. There exists a 2-way leaderless population protocol with O( • |X| + (∆ • |T | + |Q|) 2 ) states that computes (|v| ≥ ) → ϕ(v).

Proposition 5 .

 5 Assume that every finite set A of atomic predicates is computed by some |A|-way multi-output protocol with O(|A| 3 ) helpers and states, and O(|A| 5 ) transitions. Every QFPA predicate ϕ is computed by some simple |ϕ|-way protocol with O(|ϕ| 3 ) helpers and states, and O(|ϕ| 5 ) transitions.

  and let In def = {in x : x ∈ X} and Out def = {out x : x ∈ X} be the sets of input and output transitions, respectively, where in x def = (0, I(x) ) and out x def = ( I(x) , 0). An initialization sequence is a finite execution π ∈ (T ∪ In ∪ Out) * from the initial configuration L with L L. The effective input of π is the vector w such that w(x) def = |π| inx -|π| outx for every x ∈ X. Intuitively, a RDI-protocol starts with helpers only, and is dynamically initialized via the input and output transitions. Let f, t ∈ Q be the unique states of P with O(f) = 0 and O

π-→

  C for some L L, the following holds: if C T * --→ D and D ∈ [D], then D T * --→ C for some C ∈ [C], and C(I(x)) ≤ w(x) for all x ∈ X.

Theorem 6 .

 6 Assume that for every atomic predicate ϕ, there exists a |ϕ|-way RDI-protocol with O(|ϕ|) helpers, O(|ϕ| 2 ) states and O(|ϕ| 3 ) transitions that computes ϕ. For every finite set P of atomic predicates, there exists a |P |-way simple multi-output protocol, with O(|P | 3 ) helpers and states, and O(|P | 5 ) transitions, that computes P . S TA C S 2 0 2 0 40:10 Succinct Population Protocols for Presburger Arithmetic

Theorem 7 .Figure 1

 71 Figure 1Partial representation of the protocol computing 5x + 6y ≥ 4 (mod 7) as a Petri net, where places (circles), transitions (squares) and tokens (smaller filled circles) represent respectively states, transitions and agents. Non-helper agents remember their input variable (labeled here within tokens). The depicted configuration is obtained from input x = 2, y = 1 by firing the bottom leftmost transition (dark blue).

Javier Esparza, Pierre Ganty, Jérôme Leroux, and Rupak Majumdar. Verification of population protocols. Acta Informatica, 54(2):191-215, 2017. doi:10.1007/s00236-016-0272-3.

Christoph Haase. A survival guide to Presburger arithmetic. SIGLOG News, 5(3):67-82, 2018.

Mojżesz Presburger. Über die Vollständigkeit eines gewissen Systems der Arithmetik ganzer Zahlen, in welchem die Addition als einzige Operation hervortritt. Comptes rendus du I er Congrès des mathématiciens des pays slaves, pages 192-201, 1929.

David Soloveichik, Matthew Cook, Erik Winfree, and Jehoshua Bruck. Computation with finite stochastic chemical reaction networks. Natural Computing, 7(4):615-633, 2008.

Supported by an ERC Advanced Grant (787367: PaVeS). Michael Blondin: Supported by a Quebec-Bavaria project funded by the Fonds de recherche du Québec (FRQ), by a Discovery Grant from the Natural Sciences and Engineering Research Council of Canada (NSERC), and by the Fonds de recherche du Québec -Nature et technologies (FRQNT).

Definition 8. Let ϕ be a predicate and let i ≥ 2. A protocol P computes ϕ for inputs of size i, denoted "P computes (ϕ | i)", if for every input v of size i, every fair execution of P starting at C v stabilizes to ϕ(v).

We show that if, for each small number i, some succinct protocol computes (ϕ | i), then there is a single succinct protocol that computes ϕ for all small inputs. Theorem 9. Let ϕ be a predicate over a set of variables X, and let ∈ N. Assume that for every i ∈ {2, 3, . . . , -1}, there exists a protocol with at most one leader and at most m states that computes (ϕ | i). Then, there is a leaderless population protocol with

Proof sketch. Fix a predicate ϕ and ∈ N. For every 2 ≤ i < , let P i be a protocol computing (ϕ | i). We describe the protocol

The input mapping I is the identity. During the computation, agents never forget their initial state -that is, all successor states of an agent are annotated with their initial state. The protocol initially performs a leader election. Each provisional leader stores how many agents it has "knocked out" during the leader election in a counter from 0 to -1. After increasing the counter to a given value i < , it resets the state of i agents and itself to the corresponding initial state of P i+1 , annotated with X, and initiates a simulation of P i+1 . When the counter of an agent reaches -1, the agent knows that the population size must be ≥ , and turns the population into a permanent 1-consensus. Now, if the population size i is smaller than , then eventually a leader gets elected who resets the population to the initial population of P i . Since P i computes (ϕ | i), the simulation of P i eventually yields the correct output.

Computing boolean combinations of predicates for fixed-size inputs

We want to produce a population protocol P for a boolean combination ϕ of atomic predicates (ϕ i ) i∈[k] for which we have population protocols (P i ) i∈ [k] . As in Section 5.3, we cannot use a standard "product protocol" that executes P 1 , . . . , P k synchronously because the number of states would be exponential in k. Instead, we want to simulate the concatenation of (P i ) i∈ [k] . However, this is only possible if for all i ∈ [k], the executions of P i eventually "halt", i.e. some agents are eventually certain that the output of the protocol will not change anymore, which is not the case in general population protocols. For this reason we restrict our attention to "halting" protocols.

Definition 10. Let P be a simple protocol with output states f and t. We say that P is a halting protocol if every configuration C reachable from an initial configuration satisfies:

> 0 for every q ∈ {f, t} and every configuration C .

Intuitively, a halting protocol is a simple protocol in which states f and t behave like "final states": If an agent reaches q ∈ {f, t}, then the agent stays in q forever. In other words, the protocol reaches consensus 0 (resp. 1) iff an agent ever reaches f (resp. t).

Theorem 11. Let k, i ∈ N. Let ϕ be a boolean combination of atomic predicates (ϕ j ) j∈ [k] . Assume that for every j ∈ [k], there is a simple halting protocol P j = (Q j , L j , X, T j , I j , O j ) with one leader computing (ϕ j | i). Then there exists a simple halting protocol P that computes