Remarks on the Cellular Automaton Global Synchronisation Problem

. The global synchronisation problem consists in making a cellular automaton converge to a homogeneous blinking state from any initial condition. We here study this inverse problem for one-dimensional binary systems with periodic boundary conditions (i.e., rings). For small neighbourhoods, we present results obtained with the formulation of the problem as a SAT problem and the use of SAT solvers. Our observations suggest that it is not possible to solve this problem perfectly with deterministic systems. In contrast, the problem can easily be solved with stochastic rules.


Introduction
The study of inverse problems is becoming a fertile field in the research on cellular automata (CA). Among the recent achievements, we mention the construction of an exact solution to the parity problem [?], the construction of exact or approached solutions on the density classification problem [?,?,?,?] or the reinterpretation of the solution to the Firing squad problem with fields [?].
A common feature of these problems is the need to reach a global consensus: there exists a moment where all cells, or a large fraction, must agree on a given state that is interpreted as the output of the algorithm. The difficulty is related to the propagation of this information from a local to a global scale: in a decentralised framework such as cellular automata, how do the cells "agree" on a common state while they have only a local view of the system?
We here study the global synchronisation problem: in its original form, the question is to find a CA rule such that, from any initial condition, the system reaches a "blinking state" in which the two homogeneous configurations alternate. This problem can be generalised to more states but we will here restrict our study to the binary case.
Since its formulation by Das et al. in 1994 [?], the problem has received only a limited attention. This lack of interest is probably due to the fact that it is much easier to solve than other inverse problems such as the density classification problem. In fact, solutions with "100% success rates" were presented in the very paper where the problem was formulated [?]. The authors used genetically engineered solutions to show that it was possible to obtain a performance of "100%" for ring sizes going up to 999. Their interest was to find rules which attain a consensus by removing the "defects" that separate the non-synchronised regions of the system.
Our purpose in this note is to go one step forward and to ask if perfect solutions do exist. We will thus request that all initial conditions lead to the blinking cycle and not only a sample of configurations, drawn at random. After presenting the formal definitions of the problem (Sec. ??), we will present a simple "manual proof" that no ECA solves the problem (Sec. ??). This construction will guide us to formulate the problem as a SAT problem (Sec. ??) and to obtain a first set of results for larger neighbourhoods (Sec. ??). We then show that, in contrast, perfect solutions can easily been constructed (Sec. ??). We conclude by formulating a few questions.

CA definitions
We here consider finite binary cellular automata with periodic boundary conditions. The basic components of our systems are the cells; each cell can hold one of the two states: 0 or 1. The variable n is used to denote the number of cells that compose the system, the cells are arranged in a ring and the set of cells is denoted by L = Z/nZ.
A configuration x = (x i ) i∈L represents the state of the system at a given time. The set of configurations is denoted by E n = {0, 1} L . The interactions between the cells are local, that is, each cell can only "see" a finite subset of the cells of the system, the neighbourhood. Without loss of generality, we can consider that the neighbourhood N of our cellular automata are formed of discrete intervals: N = {−l, . . . , r}, with l ∈ N and r ∈ N * = {1, 2, . . . }. The width of this interval is called the size of the neighbourhood and is denoted by k, with k = l + r + 1.
The evolution of a cell follows a function f : {0, 1} k → {0, 1}, called the local rule. Following Wolfram's notation, a local rule of size k, that is, defined on a neighbourhood of size k, is assigned a code W which is an integer between 0 and 2 k − 1. This code is given by the formula: For a given ring size n, the global transition function F : E n → E n associated to the ring size n is the function that maps a configuration x t to a configuration x t+1 = F (x t ) such that x 0 = x and: (1) Note that to be perfectly rigorous, we should denote F with indices showing that it depends on f and n. We however drop these elements for the sake of clarity since f and n will be made clear from the context.

Formulation of the problem
We denote by 0 = 0 L and 1 = 1 L the two uniform configurations. In the following, we will require that 0 and 1 are two non-quiescent states, that is, f (0, . . . , 0) = 1 and f (1, . . . , 1) = 0. We call this condition the blinking condition.
We define the height h of a configuration x ∈ E n as the time needed to reach one of the two uniform configurations: with the convention that h(x) = ∞ if x t does not reach 0 or 1. Similarly, the height of a given configuration space E n is the maximum height of the configurations of E n . We say that F synchronises a configuration x ∈ E n if h(x) is finite. We also say that x is synchronised on 0 (resp. on 1) if the first homogeneous configuration that is met is 0 (resp. 1). Similarly, we say that F synchronises the size n if it synchronises all the configurations of E n . We can now formulate the global synchronisation problem: Does there exist a local rule f such that for all n ∈ N * , the associated global function F synchronises the size n?

Elementary properties
Let f be a local rule of size k. The reflexion R(f ) and the conjugate C(f ) are the local rules respectively obtained by the exchange of the left and right directions and by the exchange of the 0 and 1 states. Formally, ∀(q 1 , . . . , q k ) ∈ {0, 1} k , R(f )(q 1 , . . . , q k ) = f (q k , . . . , q 1 ), and C(f )(q 1 , . . . , q k ) = f (q 1 , . . . , q k ), where q = 1 − q denotes the inversion of states. Similarly, the reflexion-conjugate rule RC(f ) is the local rule obtained by composing the two previous symmetries: Proposition 1 (rule symmetries). f is a solution to the global synchronisation problem if and only if R(f ), C(f ), RC(f ) are also solutions.
Proof. Clearly, the property of synchronising a given size is preserved by the reflection and conjugation symmetries: for a given size n, if F, F r , F c , F rc are the global functions respectively associated to f, R(f ), C(f ) and RC(f ), then F synchronises the size n if and only if F r , F c , F rc synchronise the size n.
Let σ denote the (left) shift operator, that is, a function σ : E n → E n such that ∀i ∈ E, σ(x) i = x i+1 . We call the rotations of x the set of configurations that are obtained by applying a positive number of shifts on x; this set is denoted by Note that the rotation [·] defines an equivalence class: we say that a configuration y is equivalent to x if y is a rotation of x. It can be easily verified that this is an equivalence relation.
The next proposition states that the iterates of a configuration can not be contained in the rotations of this configuration.
Proposition 3 (images of a configuration). If F synchronises a configura- Proof. By contradiction, let us assume that there exists k ∈ N * and i ∈ N such that F k (x) = σ i (x). By recurrence, using the commutation of the shift with F , we have: F kn (x) = σ in (x). Since the space is a ring of size n, we have The configuration x thus evolves on a cycle of length k. The two homogeneous states 0 and 1 are excluded from this cycle -otherwise x would be reachable from these two states -and x can not be synchronised, which contradicts the hypothesis.
An immediate consequence of this proposition is that if F synchronises x, then x can not be a fixed point Proposition 4 (color-discernation). If a local rule f is a solution to the problem, then it is not color-blind, that is, Proof. By contradiction, let us assume that we have C(f ) = f . Let us take an even size n = 2m with m ∈ N and consider the configuration x = (01) m . Without loss of generality we can assume that x is synchronised on 0. Formally, if we denote by T = h(x) the height of x, this reads: we remark that these two equations are contradicting.

Direct inspection of the ECA space
As a starting point, let us consider Elementary Cellular Automata (ECA), that is, binary CA with N = {−1, 0, 1}.
Proposition 5. There exists no ECA which solves the synchronisation problem.
Proof. We have 256 rules to consider, these rule are defined with: . We now have to determine whether there exists an assignment of these eight boolean variables a, . . . , h which satisfies the problem.
Case n = 1: Given the specification of the problem, the states 0 and 1 are not quiescent: a = 1 and h = 0. We are thus left with 64 rules to search.
Case n = 2: Proposition ?? implies d = e. Indeed, if the two variables are not equal, 01 would be either a fixed point or a blinking point. We are now left with 32 rules.
Case n = 3: By noting that the configuration 001 can not be a fixed point and can not be translated (by Prop. ??), we obtain: s 1 = b + c + e = 1 (CondA). By symmetry, we have s 2 = d + f + g = 2 (CondB).
The case where a configuration of [001] is transformed into a configuration of [011] and vice-versa is also impossible, otherwise the uniform configurations would never be reached (Prop. ??). We thus have (s 1 , s 2 ) = (2, 1) (CondC). It is then easy to verify that these conditions are sufficient to achieve the synchronisation of size 3.
Case n = 4: It is easy to check that none of the remaining rules allows a synchronisation of size 4. For instance, we remark that 0001 is a translating point for rule 1 and 9 and that 0110 is a translating point for rule 19.

The synchronisation problem as a SAT problem
The previous method required a methodical inspection of the space but this approach can not easily been generalised to larger neighbourhoods. We now propose to do an "automated filtering" of the rules by transforming the problem into a SAT problem. The idea is to model the transition table as sequence of boolean variables and to express a boolean formula to state that a configuration is synchronised. We want to examine more and more initial conditions until we reach a point where we find that the problem is not satisfiable. If, on the contrary, we find that there exists a rule which synchronises all the initial conditions considered, then we would have a good "candidate" for solving the problem.

General SAT formulation
A SAT problem consists in finding a assignment to boolean variables that satisfies a given boolean formula. A clause is a conjunction of literals, that is, a boolean formula defined only with the or operator (e.g., a ∨ b ∨ c). The convention is that a SAT problem is formulated in a conjunctive normal form (CNF): it is a disjunction of clauses. In the sequel, we call a CNF formula any of such disjunction of clauses.
Let k be the size of the neighbourhood and M = 2 k the number of transitions 1 of this neighbourhood. We introduce M boolean variables t 0 , . . . , t M −1 to encode the transitions of a rule f ; the convention is that t i is true if and only if f b k (i), . . . , b 1 (i) = 1. For an initial condition x ∈ E n , we also introduce (τ + 1) · n additional variables, denoted by (ξ(t, i)) t∈{0,...,τ },i∈{0,...,n−1} , which correspond to the values (x t i ) ∈ {0, 1} taken by the cells in the evolution of x.

Blinking condition
The blinking condition f (q, . . . , q) = q is simply expressed by a CNF formula with two atomic clauses: F bl = t 0 ∧ ¬t M −1 .

Initial state
Let us now see how to encode the states of an initial condition x ∈ E n in a formula. The operation simply consists in "translating" the initial condition x into the CNF formula: where 1{V, q} is a function which associates to the boolean variable V and to a cell state q ∈ {0, 1} the variable V if q = 1 and the variable ¬V otherwise. For instance if we have x = 0011 as an initial condition, the associated formula will be: (4)

Synchronisation condition
Let τ be the maximum number of time steps to achieve the synchronisation. To express the condition that x is synchronised in at most τ steps, we can write x τ ∈ {0, 1}. Unfortunately, this can not be translated in a straightforward way into a CNF formula. Indeed, if we write: we need to distribute the and operator over the orto obtain a CNF. This is why we prefer to formulate this condition as: which simply represents the fact that all the states of x τ are equal. By noting that a = b is equivalent to (a ∨ ¬b) ∧ (¬a ∨ b), F sc becomes:

Consistency conditions
We now need to write a CNF formula for the condition: x t+1 = F (x t ) for t ∈ {0, . . . , τ − 1}. We call this formulation the "consistency condition", as it expresses the fact a given boolean formula in consistent with the evolution of the cellular automaton. We now give a precise description of this CNF formula. In order to ease the notations, let us detail this operation for the specific case of N = {−1, 0, 1}; it is easy to generalise it to other neighbourhoods. Locally, our condition is expressed by which is translated as: where i − = (i − 1) mod n and i + = (i + 1) mod n, and where ϕ is a function that remains to be found. Our goal is to find ϕ such that ϕ(y , x, y, z) is a CNF formula that expresses that y is the result of transition f (x, y, z). In a usual programming environment, one would need simply to calculate i = x + 2y + 4z and then to read the value of t i and assign it to y . Unfortunately, there is no direct way of "coding" these operations in a SAT formula. We thus need to enumerate all the possible values for the variables y , x, y, z and then write a consistency condition that expresses that y equals t i where i is the index which corresponds to the transition (x, y, z).
For example, if we take transition f (0, 1, 1) = 1, we have i = 3 and we write the formula with five clauses: where the two last clauses stand for y = t 3 . Formally, we write: ϕ(y , x, y, z) = λ∈{0,...,7} ϕ λ with: where λ i = b i (λ) is the value of the i-th bit of the binary representation of λ.
By distributing the and operator over the or, ϕ λ becomes: Each elementary transition of a given cell at a given time step is thus encoded with a formula ϕ which contains 2M = 2 k+1 = 16 clauses. As there are nτ such elementary conditions, the consistency condition is given by F e with 2 k+1 · nτ clauses:

Combining initial conditions
The last step that remains is to combine various initial conditions in order to: (a) either find out that the problem is not solvable for a given setting or (b) exhibit a good candidate to solve the problem. We proceed iteratively by increasing the size of the initial conditions to synchronise. From Prop. ??, we know that we do not need to consider all the initial conditions: for each size n, it is sufficient to select only one initial condition in each possible set of rotations. Formally, we say that a set of configurations is representative if the rotations of its members form a partition of the configuration space. Formally, let us denote by χ(n) the set of representative conditions; we write: The following table shows the growth of these sets 2 : n 1 2 3 4 5 6 7 8 9 |χ(n)| 2 3 4 6 8 14 20 36 60 To sum up, if we fix a set of ring sizes S = {n 1 , . . . , n s }, and a maximum synchronisation time τ , we construct a sequence of sets of configurations: X 1 , . . . , X s such that X i ∈ χ(n i ) and build the general formula: This is the final formula; it expresses the fact that all the configurations of size n ∈ S are synchronised in at most τ time steps.

First experimental results
The use of SAT solvers is a well-explored field of research in Computer science.
As we are not a specialist of these questions, we did not endeavour to optimise the search for a solution by any means. We simply used the minisat solver 3 and generated the formulae with our cellular automata simulation program FiatLux 4 .
By testing increasing values of n and setting the maximum synchronisation time τ equal to χ(n) (see Prop. ??), we found that the maximum synchronisation length of this neighbourhood is 6, that is, for S = {2, . . . , 7}, no solution is found.

The k = 5 space
We now examine a neighbourhood with one more cell: we take k = 5 and N = {−2, −1, 0, 1, 2}. The space contains 2 2 5 = 2 32 ∼ 4.10 10 rules. At this point, we reach the limits of our approach: The CNF formula of the problem has 74768 variables and 4563060 clauses. By progressively increasing the values of n and τ , our best result was to find a rule which synchronises the size interval S = {2, . . . , 11}: rule 1078270911. This rule has a height of 18 (see Fig. ??, p. ??).
There are probably other rules which solve the problem for τ higher than 18, but we leave this exploration for future work. For S = {2, . . . , 12}, no solution was found for τ = 30. Surprisingly, the non-satisfiability of the formula is given rapidly, which suggests that the maximum synchronisation length for k = 5 is equal to 12.
We also tested the SAT solver for k = 6, but τ = 12 is sufficient to generate SAT problems that are not solved after more than two hours of computation. We thus leave the exploration of these greater spaces for future work.

"Perfect" stochastic solutions
We now propose to examine what is the situation of the stochastic rules. In fact, if we allow randomness in the transitions of the rule, it becomes difficult not to solve the problem! For the sake of simplicity we restrict our study to the probabilistic ECA case. We thus take N = {−1, 0, 1} and define a local transition function φ : Q 3 → [0, 1], which associates to each neighbourhood state its probability to be updated to 1.
Formally, starting from a configuration x, the system can be described by a stochastic process (x t ) t∈N . The sequence (x t ) now denotes a sequence of random variables, which is constructed recursively with: x 0 = x (with probability 1) and where B(p) is the Bernoulli random variables, which equals 1 with probability p and 0 with probability 1 − p. Note that strictly speaking, the definition above is more a characterisation than a definition and that a "proper" definition would require the use of tools from measure theory (see e.g. [?]). We now need to redefine what it means to solve the problem perfectly. The blinking condition is easily translated to φ(0, 0, 0) = 1 and φ(1, 1, 1) = 0. For a rule which verifies the blinking condition and a given configuration x ∈ E n , we define the synchronisation time T (x) as the random variable which corresponds to the number of steps needed to attain one of the two homogeneous configurations: T (x) = min{t, x t ∈ {0, 1}}. The average synchronisation time of x is the expectancy of T (x), denoted by E{T (x)}. For a given size n, we define the worst expected synchronisation time (WEST) of x and the expected average synchronisation time (EAST) of x as: We say that f synchronises the size n if WEST(n) is finite. Clearly, this is equivalent as having a finite EAST(n). By extension, f is a solution to the global synchronisation problem if f synchronises all sizes n ∈ N.
Proof (Sketch). To show that T (x) is finite for every x ∈ E, it is sufficient to show that there is a non-zero probability to reach 0 from x in a finite number of steps.
Let Z(x) be the function such that Z(x) i = 1 if (x i−1 , x i , x i+1 ) = (0, 0, 0), 0 otherwise . The effect of Z is to change a cell to a 0 whenever there is a non-zero probability that this cells updates to 0. Let us denote by m the greatest time needed to shrink the regions of ones; clearly, m = n/2 . It can then easily be checked that: (a) ∀x = 1, Z m (x) ∈ {0, 1}, and (b) there is a non-zero probability to have ∀t ∈ {1, . . . , m}, x t = Z t (x). In other words, there is a non-zero probability that x is absorbed in the 0-1 cycle in at most m time steps. Viewing the system as a Markov chain, this corresponds to the fact that the only two recurrent states are 0 and 1 and all the other states are transient 5 .
Note that the proposition above only gives sufficient conditions to solve the problem; moreover, it does not give any idea on the time needed to converge to a fixed point. This means in particular that the function WEST(n) may scale exponentially with n, which is not what is expected for an efficient solution to the problem.
Proof (Sketch). By construction, the rule is the composition of two (commutative) operations: (a) an α-asynchronous left shift with α = 1/2 and (b) a global inversion (x → x). In the α-asynchronous updating each cell independently applies the local rule with probability α and keeps its state with probability 1 − α. This rule was analysed in a previous work [?] and it was shown that its WECT scales quadratically with n.
It can be verified that the global inversion preserves the dynamics of the asynchronous shift. Indeed, the effect of φ is simply to shift the interfaces between regions of 0s and regions of 1s. To formalise this, one could use a coupling between the original process and the asynchronous shift.