Recognizing the Repeatable Configurations of Time-reversible Generalized Langton's Ant Is Pspace-hard

Chris Langton proposed a model of an artificial life that he named " ant " : an agent-called ant-that is over a square of a grid moves by turning to the left (or right) accordingly to black (or white) color of the square where it is heading, and the square then reverses its color. Bunimovich and Troubetzkoy proved that an ant's trajectory is always unbounded, or equivalently, there exists no repeatable configuration of the ant's system. On the other hand, by introducing a new type of color where the ant goes straight ahead and the color never changes, repeatable configurations are known to exist. In this paper, we prove that determining whether a given finite configuration of generalized Langton's ant is repeatable or not is PSPACE-hard. We also prove the PSPACE-hardness of the ant's problem on a hexagonal grid.


Generalized Langton's Ant
The virtual ant defined by Chris Langton [1][2][3] is the following cellular automaton.The "ant", represented by a pair of a lattice point and a direction ,

OPEN ACCESS
moves around on a two-dimensional square lattice , where each lattice point, referred to as a "cell", is colored by white or black (later we will also introduce gray cells).Initially, the ant is sitting on a given cell with a given direction, say and .It proceeds to travel from cell to cell according to the following rule (see Figure 1): the ant moves to when is a white cell, and to when is a black cell; the cell then reverses its color.In other words, the ant moves in the direction it is heading; when it lands on a white (or black) cell it rotates its direction to the right (left); after that, the color of the cell changes to black (or white).Langton's ant has been investigated independently as one model of Lorentz Lattice Gas Cellular Automata (LLGCA).Langton's ant corresponds to the Flipping Rotator (FR) model on [4].In more general terms, the FR model was investigated on a triangular lattice [5] and on a hexagonal lattice [6], too.On the ant , where and , moves to and when is white and black, respectively (see Figure 1), and the cell then reverses its color.Another generalization of Langton's ant on is to introduce a third type of cell, called "gray" cell [7].The ant moves to if is a grey cell, and the cell never changes its color but remains gray forever (see Figure 1).In LLGCA models, gray cells were introduced naturally as empty lattice points.We remark that the topology does not allow having such a gray cell.We denote by R, L and S the ant's valid moves corresponding to the Right-turn, Left-turn and Straight-ahead respectively under these transaction rules; e.g., by R, L and S, the ant on moves to , and , respectively.

Recognizing the Repeatable Configurations of GLA
These transaction rules assure that Generalized Langton's Ant (GLA) is a time-reversible cellular automaton: the current configuration of GLA, consisting of a coloring of the cells and an ant's starting cell and direction, determines the past configurations as well as the future ones.As a consequence, the configurations of GLA are divided into the following two kinds: an ant's trajectory starting from a configuration of one kind is unbounded, never repeating the same configuration again; an ant's trajectory starting from a configuration of the other kind is bounded, repeating a finite series of configurations an infinitive number of times.
A "finite" configuration of GLA is defined by a finite coloring of the cells and an ant's starting cell and direction.Here, a coloring is finite if it has only a finite number of non-background-color cells.In this paper, we use the all white, all black, and half-and-half coloring as the background, where the half-and-half coloring gives white (black) color to the cells on the upper-half (lower-half) plane (see Figure 2Figure 2).We define size of a configuration by the minimum size of a closed square which contains the ant's starting cell and the all non-background-color cells.In this paper, we study the computational complexity of determining whether a given finite configuration of GLA is repeatable or not.

Figure 2.
The half-and-half coloring.[4] proved the following: when there is no gray cell, an ant's trajectory on is always unbounded, or equivalently, there exists no repeatable configuration of the ant's system.As a matter of fact, the set of repeatable configurations of GLA on with no gray cell is empty, hence its recognition problem is trivial.On the other hand, repeatable configurations exist of GLA on with some gray cells (see Figure 3, see also [8]).The model is also known to have repeatable configurations (see Figure 3, see also [6]).

Bunimovch and Troubetskoy
The long-run behavior of Langton's ant on has been studied using both theories and experiments for more than two decades, yet it is still highly unpredictable.As a result, indicating hardness of the prediction, Gajardo, Moreira and Goles [9] proved that the following problem on with no gray cell is PTIME-hard: "Does the ant ever visit this given cell?".

New Results
In this paper, we prove the following theorems: Theorem 1. Recognizing the repeatable configurations of GLA on with gray cells is PSPACE-hard.Theorem 2. Recognizing the repeatable configurations of GLA on is PSPACE-hard.
To prove these theorems, we should have unbounded trajectories of the ant on each of the topologies.For the half-and-half background, Figure 2 shows such unbounded trajectories where the ant, starting from the arrow, walks from left to right by repeating the LLRR (LLLRRR) moves forever on ( ).On the other hand, for the monochromatic background, we do have the famous diagonal highway on (see Figure 4), but no provable unbounded trajectory is known on [6].For this reason, we can prove Theorem 1 for both of the monochromatic and half-and-half backgrounds, but Theorem 2 for only the half-and-half background.We will prove Theorem 1 for "everywhere sparse" gray cells.For a given function , we say that a configuration is colored by -sparse gray cells if the configuration size is and its coloring has no more than one gray cell within any closed square of size no more than .For example, a configuration colored by -sparse gray cells, for any constant , contains no more than gray cells, and a configuration colored by -sparse gray cells could have an arbitrary number of gray cells.We prove the following theorem: Theorem 3.For any ε > 0 recognizing the repeatable configurations of GLA on colored by n ε -sparse gray cells is PSPACE-complete.

Reduction
To prove Theorems 1-3, it is enough to reduce a known PSPACE-hard problem to the ant's problems on square and hexagonal grids.In this paper, we will reduce QBF (Quantified Boolean Formula) evaluation problem to the ant's problems.An instance of QBF is given by a closed CNF (Conjunctive Normal Form) formula, which is written as by an open CNF formula and arbitrary Boolean quantifiers .Then, QBF evaluation problem asks the truth value of a given closed CNF formula.QBF evaluation problem is a well known PSPACE-complete problem [10].

Preparation
A (ant's walking) course is a sequence of ant's consecutive valid moves; it also represents a sequence of the induced coloring.When a coloring of the ant's system turns to a coloring by an ant's walking course , we write as .When the ant, at a place , moves to another place by , we write it as .The reverse of the ant is .By time reversibility, we can define the reverse of by the following walking course: reverse the order of the coloring in , and reverse the ants therein.We write , meaning that turns to by , and turns to by .

Gadgets
A gadget is a collection of GLA's coloring written on the all white background with an associated transition diagram and several input and output marked arrows.A polynomial number of gadgets are seamlessly connected to form an entire coloring of GLA, where some gadgets may be used after rotation or reflection.Note that the colors of reflected gadgets should be switched.

Path
We connect the rotations and reflections of PATH gadgets (see Figure 5) to form a long path along which the ant is guided.Its coloring is initially , which turns to by a course .

Switch & Pass
A Switch & Pass (S&P) gadget (see Figure 6) can memorize 1 bit information by its coloring state.The coloring is initially , which turns to by a walking course ; in other words, the ant is "Switching" the coloring state and "Passing" through it.When the coloring is , the ant entering at walks along and exits at , changing the coloring to .When the coloring is , the ant entering at walks along and exits at , changing the coloring to .

Switch & Turn
A Switch & Turn (S&T) gadget (see Figure 7) can memorize 1 bit information by its coloring state, too.The coloring is initially , which turns to by an ant's walking course ; in other words, since is the reverse of , the ant is "Switching" the coloring state and "Turning" around.When the coloring is , the ant entering at IN walks along and exits at .When the coloring is , the ant entering at walks along and exits at .

Conjunction
The CONJunction (CONJ) gadget (see Figure 8, see also [9]) has two entrances and one exit.The coloring is initially .The ant entering at walks along and exits at OUT, for each .

Pseudo-Crossing
A Pseudo-Crossing (PC) gadget (see Figure 9, see also [9]) has two entrances and and two exits and such that the ant entering at walks along and exits at for each

Crossing
A CROSSing (CROSS) gadget (see Figure 10) is placed at each crossing point of two intersecting paths on 2D plane.It is built by one S&P gadget and three PC gadgets, named PC 1 , PC 2 and PC 3 .The coloring of a CROSS gadget can be represented by the coloring of all gadgets composing it, that are S&P, PC 1 , PC 2 , PC 3 , two CONJ gadgets and many PATH gadgets connecting them.We indicate the coloring of a CROSS gadget only by those of (S&P, PC 1 , PC 2 , PC 3 ).The coloring of CONJ (PATH) gadgets and PATH gadgets are initially , that turn to ( ) when the ant has passed through them.The ant can take mutually intersecting courses by first and secondly , as well as by first and secondly .In Figure 10, each of these paths are depicted by thick lines, where those gadgets that passed through are shown by the thick lines that have turned to used coloring, while the other gadgets remain in their initial coloring.

CNF Formulae Evaluation
In this section, we construct an gadget for evaluating the truth value of a CNF formula by inputting a given truth-value assignment .By these three Cases, Lemma 2 has shown to hold for when .Since is a logical dual of , a gadget of the case is obtained from Figure 12 by switching the labels and for and .Accordingly, rewriting the above proof attains that of the case.

Polynomial-Time Reduction
For a given closed QBF formula , Lemma 2 and its proof gives a polynomial-time construction of an gadget such that if ( ) then the ant placed at of coloring of finally reaches ( ).So, as illustrated in Figure 13, plugging reflectors (see Figure 3) in both and , and a diagonal highway (see Figure 4) in gives an initial configuration of GLA such that ( ) if, and only if, the ant stays in a bounded area (goes out of any bounded area).This establishes an efficient reduction from the evaluation problem to the recognition problem of the repeatable coloring of GLA on with gray cells, proving Theorem 1.For the model, plugging a highway along the horizon of the half-and-half background (see Figure 1) to gives an efficient reduction, too, proving Theorem 2. Among our gadgets on given in Section 2, only Switch & Turn gadget uses gray cell.In addition, the Switch & Turn gadget contains only one gray cell.So, putting these Switch & Turn gadgets mutually away from each other makes a size-configuration of GLA colored by n ε -sparse gray cells for the reduction, proving Theorem 3.

Open Questions
We can construct all gadgets shown in Section 2 on the (triangular lattice) model with gray cells, excepting the Switch & Turn gadget.Although we are lacking the Switch & Turn gadget, we believe that the recognition problem of the repeatable configurations of GLA on with gray cells is PSPACE-hard.The experimental results by Wang and Cohen [6] showed that randomly generated configurations of GLA on for the monochromatic background, fall into the repeatable configurations with high probability.As far as we know, it is challenging to find even one provably unrepeatable configuration of GLA on for the monochromatic background.Perhaps it is more challenging to prove the following: "an ant's trajectory starting from a repeatable size-configuration

Figure 1 .
Figure 1.Transaction rules on each topology and each color of the cell that the ant is heading to.

Figure 4 .
Figure 4.The ant starting from the arrow proceeds as RLRLRLRLRL, and then starts repeating 104 steps forever, forming the famous diagonal highway going in a southeast direction.
in this order in 2D plane, these two walking courses and should be mutually crossing.Beginning from the initial coloring , the ant can take mutually intersecting courses, first and secondly in order, changing the coloring to .

Figure 13 .
Figure 13.Reduction from QBF evaluation problem to the recognition problem of the repeatable coloring of GLA.
always at most a polynomial of ".If this were true, then the recognition problem of the repeatable configurations of GLA would belong to PSPACE.