^{*}

This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution license (http://creativecommons.org/licenses/by/3.0/).

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.

The virtual ant defined by Chris Langton [^{2} ≔ ℤ + ^{2}, 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

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 ℤ^{2} [^{2} the ant (^{2} and
^{2} is to introduce a third type of cell, called “gray” cell [^{2} 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 (^{2} moves to

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

Bunimovch and Troubetskoy [^{2} 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 ℤ^{2} with no gray cell is empty, hence its recognition problem is trivial. On the other hand, repeatable configurations exist of GLA on ℤ^{2} with some gray cells (see ^{2} model is also known to have repeatable configurations (see

The long-run behavior of Langton's ant on ℤ^{2} 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 [^{2} with no gray cell is PTIME-hard: “Does the ant ever visit this given cell?”.

In this paper, we prove the following theorems:

Recognizing the repeatable configurations of GLA on ℤ^{2} with gray cells is PSPACE-hard.

Recognizing the repeatable configurations of GLA on ^{2} 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, ^{2} (^{2}). On the other hand, for the monochromatic background, we do have the famous diagonal highway on ℤ^{2} (see ^{2} [

We will prove Theorem 1 for “everywhere sparse” gray cells. For a given function ^{2}-sparse gray cells could have an arbitrary number of gray cells. We prove the following theorem:

For any ε > 0 recognizing the repeatable configurations of GLA on ℤ^{2} colored by n^{ε}-sparse gray cells is PSPACE-complete.

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 Q_{1}_{1}Q_{2}_{2}^{…}Q_{n}x_{n}ϕ_{1},…,_{n}_{1},…,_{n}_{i}

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 ^{−1} of ^{−1}.

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.

We connect the rotations and reflections of PATH gadgets (see

A Switch & Pass (S&P) gadget (see _{2} and exits at _{OFF}_{3} and exits at _{ON}

A Switch & Turn (S&T) gadget (see _{S&T} is the reverse of _{S&T}, the ant is “Switching” the coloring state and “Turning” around. When the coloring is _{2} and exits at _{OFF}_{3} and exits at _{ON}

The CONJunction (CONJ) gadget (see _{j}_{j}

A Pseudo-Crossing (PC) gadget (see _{1} and _{2} and two exits _{1} and _{2} such that the ant entering at _{j}_{j}_{j}_{1}, _{2}, _{1}, _{2} are placed clockwise in this order in 2D plane, these two walking courses _{1} and _{2} should be mutually crossing. Beginning from the initial coloring

A CROSSing (CROSS) gadget (see _{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 _{j} (

In this section, we construct an EVAL_{ϕ}_{FALSE} and _{TRUE}. The ant entering at _{FALSF} (_{TRUE}) if

Let POS = {_{1},…,_{n}_{1},…, −_{n}_{i,j}_{1},…,_{n}_{i}_{i,j}_{ϕ}_{i,j}_{i,j}_{ϕ}_{1,1} (see _{i,j}_{OFF} (_{ON}) of S&P_{i,j}_{i,j+1} (see _{i,ki}_{OFF} (_{ON}) of S&P_{i,ki}_{FALSE} (see _{m,j}_{ON} (_{OFF}) of S&P_{m,j}_{TRUE} (see

For each _{k}_{ϕ}_{xk}_{xk}_{xi}_{i,j}_{k}, -x_{k}_{xi}_{x1}, _{x1}, _{x2}, _{x2},…,_{xn}, O_{xn}

Suppose that the coloring of the composing gadgets of EVAL_{ϕ}^{n}_{a}_{ϕ}_{xk}_{xk}_{k}_{xk}_{a}_{i,j}_{i,j}_{k}_{k}_{k}

If the coloring of EVAL_{ϕ}_{a} and _{FALSE} (_{TRUE}).

First, suppose that _{ℓ}_{ℓ,j}_{ℓ,j}_{i}_{i}_{i,ji}_{i,ji}_{i}_{i,j}_{i,j}_{FALSE} in the following way: _{1,1}; _{i,j}_{OFF}_{ON}_{i,j}_{i,j}_{+1}; _{i,ji}_{ON}_{OFF}_{i,ji}_{i}_{+1,1}; _{ℓ,j}_{OFF}_{ON}_{ℓ,j}_{ℓ,j}_{+1}; _{ℓ,kℓ}_{OFF}_{ON}_{ℓ,kℓ}_{OFF}_{1} V −_{2}) Λ (−_{1} V _{2}) and (_{1}, _{2}) = (TRUE, FALSE), where the gadgets have passed through, shown by the thick line, have turned to used coloring states, while the other gadgets still remain in their initial coloring.

Secondly, suppose that _{i}_{i}_{i,ji}_{i,ji}_{i}_{i,j}_{i,j}_{TRUE}_{1,1}; _{i,j}_{OFF}_{ON}_{i,j}_{i,j}_{+1}; _{i,ji}_{ON}_{OFF}_{i,ji}_{i}_{+1,1}; _{m,j}_{OFF}_{ON}_{m,j}_{m,j}_{+1}; _{m,jm}_{ON}_{OFF}_{m,jm}_{ON}_{1} V −_{2}) Λ (−_{1} V _{2}) and (_{1}, _{2}) = (TRUE, TRUE).

Let _{a}_{ϕ}_{a}_{ϕ}

Let _{1},…,_{n}_{1},…,_{n}_{i}_{i}_{1},…,_{i}_{i}_{+1}_{i}_{+1}Q_{i}_{+2}_{i}_{+2} … Q_{n}x_{n}ϕ_{1},…,_{n}_{n}_{1},…,_{n}_{1},…,_{n}_{n}_{ϕ}_{n,a}_{a}_{n}^{n}_{i}_{i, a}^{i}_{i}_{i}_{+1} = ∀, containing an already constructed EVAL_{i}_{+1} gadget. We describe the coloring of EVAL_{i}_{i}_{+1}) gadgets therein. For ^{i}_{1}_{i},b^{i}^{+1}. Let _{i,a}_{i}_{i}_{+1}) gadgets as (_{i+1 (a, FALSE)}); the coloring of the other gadgets are set to be initialized. Then, we denote by _{i, a}_{i, a}_{i}_{n, a}_{a}_{i, a}

For every a ∈ {FALSE, TRUE}^{i}_{i}_{i, a}_{i}_{1},…,a_{i}) = FALSE (TRUE) then the ant entering to the EVAL_{i}_{i}_{i, FALSE} (_{i, TRUE}).

Lemma 1 proves the ^{i}_{i}_{+1}(_{i}_{+1}(_{i}_{i}_{∀}.

Suppose that _{i}_{+1}(_{i}_{i}_{+l}, changing the coloring of (S&T, CONJ) from (_{1}); next, since the coloring of EVAL_{i}_{+1} is _{i+1,(a, FALSE)}, by Lemma 2 for _{i}_{+1}(_{i}_{+1} reaches to _{i+1, FALSE}, which changes the coloring of EVAL_{i}_{+1} from _{i+1, (a, FALSE)} to _{i+1, (a, FALSE)}; finally, the ant walks from _{i}_{+1, FALSE} to _{i, FALSE}.

Suppose _{i}_{+1}(_{i}_{+1}(_{i}_{i}_{+1}; next, since _{i}_{+1}(_{i}_{+1} at _{i}_{+1} reaches to _{i}_{+1, TRUE}, changing the coloring of EVAL_{i}_{+1} from _{i}_{+1, (}_{a}_{, FALSE)} to _{i+1 (a, FALSE)}; after that, the ant walks as _{i}_{+1, TRUE} → _{OFF}_{S&T}, which change the coloring of the S&P gadget from _{S&T}, switching the coloring of the S&T gadget from

Secondly, the ant takes the following reversed walking course (see _{S&T} → S&P → EVAL_{i}_{+1} → CONJ → _{i}_{+1}, CONJ) from (_{i+1, (a, FALSE)}, _{1}) to (_{(a, FALSE)},

We remark that the gadgets that passed through, shown by the dotted line in _{1,2} CROSS gadgets, will never be used without being initialized in this manner.

Finally, the ant walks as follows (see _{ON}_{S&P} → _{S&P} → _{xi}_{ϕ}_{xi}_{ϕ}_{i}_{+1}, changing the coloring of (S&T, S&P, EVAL_{i}_{+1}, CONJ) from (_{(a, FALSE)}, _{(a, TRUE)}, _{2}); we remark that, as shown in _{xi}_{xi}_{ϕ}_{xj}_{xj}_{ϕ}_{i}_{+1}(_{i}_{+1} at _{i}_{+1} reaches _{i}_{+1,FALSE}; finally, the ant walks as _{i}_{+1, FALSE} → _{i, FALSE}.

Suppose _{i}_{+1}(_{i}_{+1}(_{i}_{i}_{+1} → _{i}_{+1,TRUE} → _{OFF}_{S&T} → _{S&T} → S&P → EVAL_{i}_{+1} → CONJ → _{ON}_{S&P} → _{S&P} → _{xi}_{ϕ}_{xi}_{ϕ}_{i}_{+1}.

Secondly, the ant walks as follows (see _{i}_{+1} has become _{(a, TRUE)} and _{i}_{+1} (_{i}_{+1,TRUE}; after that, since the coloring of the S&P gadget has become _{i}_{+1,TRUE} → _{ON}_{i,TRUE}.

By these three Cases, Lemma 2 has shown to hold for _{i}_{i}_{i}_{i′,TRUE} and _{i′, FALSE} for _{i}

For a given closed QBF formula _{0}, Lemma 2 and its proof gives a polynomial-time construction of an EVAL_{0} gadget such that if _{0} = FALSE (TRUE) then the ant placed at _{0} of _{0, FALSEn} coloring of EVAL_{0} finally reaches _{0, FALSE} (_{0,TRUE}). So, as illustrated in _{0} and _{0, FALSEn} and a diagonal highway (see _{0,TRUE} gives an initial configuration of GLA such that _{0} = FALSE (TRUE) if, and only if, the ant stays in a bounded area (goes out of any bounded area). This establishes an efficient reduction from the QBF evaluation problem to the recognition problem of the repeatable coloring of GLA on ℤ^{2} with gray cells, proving Theorem 1. For the ^{2} model, plugging a highway along the horizon of the half-and-half background (see _{0,TRUE} gives an efficient reduction, too, proving Theorem 2.

Among our gadgets on ℤ^{2} 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-^{ε}

We can construct all gadgets shown in Section 2 on the ^{2} (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 ^{2} with gray cells is PSPACE-hard. The experimental results by Wang and Cohen [^{2} 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 ^{2} for the monochromatic background. Perhaps it is more challenging to prove the following: “an ant's trajectory starting from a repeatable size-

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

The half-and-half coloring.

Repeatable configurations of GLA.

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.

PATH.

Switch & Pass.

Switch & Turn.

CONJunction (CONJ).

PC.

CROSS.

EVAL_{ϕ}

EVAL_{i}_{i}

Reduction from QBF evaluation problem to the recognition problem of the repeatable coloring of GLA.