Complexity

Volume 2019, Article ID 6573793, 11 pages

https://doi.org/10.1155/2019/6573793

## A Fully Operational Framework for Handling Cellular Automata Templates

^{1}Programa de Pós-Graduação em Engenharia Elétrica e Computação, Universidade Presbiteriana Mackenzie, Rua da Consolação 896, Consolação, 01302-907 São Paulo, SP, Brazil^{2}Faculdade de Computação e Informática, Universidade Presbiteriana Mackenzie, Rua da Consolação 896, Consolação, 01302-907 São Paulo, SP, Brazil

Correspondence should be addressed to Pedro P. B. de Oliveira; rb.eiznekcam@bordep

Received 6 December 2018; Accepted 24 March 2019; Published 3 April 2019

Academic Editor: Carlos Gershenson

Copyright © 2019 Mauricio Verardo and Pedro P. B. de Oliveira. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

Cellular automata are fully discrete, computational, or dynamical systems, characterised by a local, totally decentralised action. Although extremely simple in structure, they are able to represent arbitrarily complex phenomena. However, due to the very big number of rules in any nontrivial space, finding a local rule that globally unfolds as desired remains a challenging task. In order to help along this direction, here we present the current state of cellular automata* templates*, a data structure that allows for the representation of sets of cellular automata in a compact manner. The template data structure is defined, along with processes by which interesting templates can be built. In the end, we give an illustrative example showcasing how templates can be used to explore a very large cellular automaton space. Although the idea itself of template has been introduced before, only now its conceptual underpinnings and computational robustness rendered the notion effective for practical use.

#### 1. Introduction

Cellular automata (CAs) can be regarded as both fully discrete computational and dynamical systems, characterised by a local, totally decentralised action. What makes them an attractive object of study is the fact that, in spite of their extremely simple structure, they may present arbitrarily complex behaviour, depending on the local rule chosen to govern the system [1]. The rule acts by changing the discrete state of every position (a cell) of a regular grid, according to its current state and those of its neighbouring cells.

The set of all possible one-dimensional CAs can be partitioned using two important parameters: the number of states the CA allows a cell to take on at any given time step and the size of its neighbourhood, defined by the number of neighbours a cell has to check in order to decide which state it will be at the next time step. Each resulting block of the partition defines a CA space or family.

Except for the small elementary space (made up of only 256 one-dimensional rules, with 2 states per cells and 3 cells in the neighbourhood), whenever there is the necessity of searching for CAs with a given behaviour in a given space, one is overwhelmed by the very high number of possibilities to check. This is why many applications end up revolving around the elementary rules, as in [2].

The approaches used to perform searches in larger spaces have usually been made automatic by means of search algorithms, especially evolutionary, designed to look for rules that would have particular emergent features, such as those that can be associated with the solution of particular computational problems [3], or the direct attempt to analyse constrained CA spaces, defined by required properties of the rule tables or the expected behaviour to be observed [4, 5]. In order to escape from the arbitrariness of the latter, different representational tools sometimes are employed, most notably the DeBruijn graphs, used in [6], to explore the parity problem’s solvability for CAs in different spaces, and the conditionally matching rules, explored in [7].

Regardless of the case, the fact is that the possibility of representing families of CA rules in a compact way would be greatly beneficial, both theoretically and for practical applications. A particularly powerful representational tool in this context is the* template*. First introduced in [8], templates are data structures which represent potentially extremely large sets of CAs, further allowing to combine and manipulate them with operations such as the intersection, before effectively enumerating the whole set.

Even though the idea itself of template has been introduced before, only now its conceptual underpinnings and computational robustness rendered the notion effective for practical use. In tune with that, the idea has now been crystallised into an open-source package for the Wolfram* Mathematica* system [9] called* CATemplates* [10]. The explanations provided in this paper are partially based on the implementations used in* CATemplates*.

Although cellular automata can be defined in any number of dimensions, here we focus on the one-dimensional case, first because the major benchmarking problems from the literature are one-dimensional and second because this is the case implemented in* CATemplates*.

The rest of this paper is organised as follows. Section 2 is a brief overview of cellular automata and their inner workings, Section 3 defines a cellular automata template, and Section 4 provides explanations about the operations applicable to them. Section 5 then presents examples of template builder functions, Section 6 discusses a sample application of templates to find rules that share both totality and captivity in extremely large CA spaces, and Section 7 closes the paper with some concluding remarks and ideas for future work.

#### 2. Cellular Automata

Cellular automata are dynamical, decentralised systems, governed by simple, local rules. Given the relative simplicity of CAs, they serve as a good model to analyse how the interaction among simple components can give rise to complex behaviour in dynamical systems, in particular, how solutions to global problems like the density classification task arise [11].

CAs are composed of a regular lattice of finite automata (the* cells*), whose states change with time, following a predetermined local rule. The lattice can be arranged in any number of dimensions and can have a finite or infinite number of cells. From now on, whenever a CA is mentioned, we always mean one-dimensional CAs (whose lattices are arranged as a line), each cell can take on a discrete state value, and the update is parallel, at discrete time steps.

A CA’s cell state is usually represented by numbers in the interval, or a colour from a set of colours previously defined. The local rule of a CA acts on each cell’s neighbourhood, which is a set composed of the cell itself together with its adjacent cells, with being the* radius* of the rule, that is, the number of cells at each side. The fractional value for indicates that the neighbourhood is asymmetric, as in , meaning that the center cell has 2 neighbours on one side and 1 on the other (in* CATemplates*, by convention, the left-hand side contains the larger number of neighbours).

By defining a value for and , a space (or family) of CAs is established. The* elementary space* is currently one of the most extensively studied CA families, as it is composed of only 256 rules, even though displaying a rich phenomenology [1].

The size of a CA space is a function of and . In the one-dimensional case, this means . As a consequence, the increase of or quickly leads to exponentially large space sizes; for instance, the space of binary CAs with radius 2 is composed of rules.

Every CA’s temporal evolution is governed by a local rule. This local rule is usually represented as a rule table, consisting of state transitions that point every possible neighbourhood to an output state. At every time step, every cell in the lattice is updated according to its neighbourhood, following its state transition table.

Since a rule table has to cover all possible neighborhoods in the lattice, it consists of state transitions ordered using Wolfram’s lexicographic order, in which the first transition is the one corresponding to the neighbourhood formed only by cells in the state, and the last one is the transition corresponding to the neighbourhood of zeros. To illustrate the point, the rule table for elementary CA 184 is shown in Table 1.