A Fully Operational Framework for Handling Cellular...

12
Research Article A Fully Operational Framework for Handling Cellular Automata Templates Mauricio Verardo 1 and Pedro P. B. de Oliveira 1,2 1 Programa de P´ os-Graduac ¸˜ ao em Engenharia El´ etrica e Computac ¸˜ ao, Universidade Presbiteriana Mackenzie, Rua da Consolac ¸˜ ao 896, Consolac ¸˜ ao, 01302-907 S˜ ao Paulo, SP, Brazil 2 Faculdade de Computac ¸˜ ao e Inform´ atica, Universidade Presbiteriana Mackenzie, Rua da Consolac ¸˜ ao 896, Consolac ¸˜ ao, 01302-907 S˜ ao Paulo, SP, Brazil Correspondence should be addressed to Pedro P. B. de Oliveira; [email protected] 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. is 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. 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. e 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]. e 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. e 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. is is why many applications end up revolving around the elementary rules, as in [2]. e 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 Hindawi Complexity Volume 2019, Article ID 6573793, 11 pages https://doi.org/10.1155/2019/6573793

Transcript of A Fully Operational Framework for Handling Cellular...

Page 1: A Fully Operational Framework for Handling Cellular ...downloads.hindawi.com/journals/complexity/2019/6573793.pdf · is a brief overview of cellular automata and their inner workings,

Research ArticleA Fully Operational Framework for Handling CellularAutomata Templates

Mauricio Verardo1 and Pedro P B de Oliveira 12

1Programa de Pos-Graduacao em Engenharia Eletrica e Computacao Universidade Presbiteriana MackenzieRua da Consolacao 896 Consolacao 01302-907 Sao Paulo SP Brazil2Faculdade de Computacao e Informatica Universidade Presbiteriana Mackenzie Rua da Consolacao 896 Consolacao01302-907 Sao Paulo SP Brazil

Correspondence should be addressed to Pedro P B de Oliveira pedrobmackenziebr

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

Academic Editor Carlos Gershenson

Copyright copy 2019 Mauricio Verardo and Pedro P B de Oliveira This is an open access article distributed under the CreativeCommons Attribution License which permits unrestricted use distribution and reproduction in any medium provided theoriginal work is properly cited

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

1 Introduction

Cellular automata (CAs) can be regarded as both fullydiscrete computational and dynamical systems characterisedby a local totally decentralised action What makes theman attractive object of study is the fact that in spite oftheir extremely simple structure they may present arbitrarilycomplex behaviour depending on the local rule chosen togovern the system [1] The rule acts by changing the discretestate of every position (a cell) of a regular grid according toits current state and those of its neighbouring cells

The set of all possible one-dimensional CAs can bepartitioned using two important parameters the number ofstates the CA allows a cell to take on at any given time stepand the size of its neighbourhood defined by the number ofneighbours a cell has to check in order to decide which stateit will be at the next time step Each resulting block of thepartition defines a CA space or family

Except for the small elementary space (made up of only256 one-dimensional rules with 2 states per cells and 3 cells

in the neighbourhood) whenever there is the necessity ofsearching forCAswith a given behaviour in a given space oneis overwhelmed by the very high number of possibilities tocheckThis iswhymany applications end up revolving aroundthe elementary rules as in [2]

The approaches used to perform searches in larger spaceshave usually been made automatic by means of searchalgorithms especially evolutionary designed to look forrules that would have particular emergent features such asthose that can be associated with the solution of particularcomputational problems [3] or the direct attempt to analyseconstrained CA spaces defined by required properties of therule tables or the expected behaviour to be observed [4 5] Inorder to escape from the arbitrariness of the latter differentrepresentational tools sometimes are employed most notablythe DeBruijn graphs used in [6] to explore the parityproblemrsquos solvability for CAs in different spaces and theconditionally matching rules explored in [7]

Regardless of the case the fact is that the possibility ofrepresenting families of CA rules in a compact way would

HindawiComplexityVolume 2019 Article ID 6573793 11 pageshttpsdoiorg10115520196573793

2 Complexity

be greatly beneficial both theoretically and for practicalapplications A particularly powerful representational toolin this context is the template First introduced in [8]templates are data structures which represent potentiallyextremely large sets of CAs further allowing to combine andmanipulate them with operations such as the intersectionbefore effectively enumerating the whole set

Even though the idea itself of template has been intro-duced before only now its conceptual underpinnings andcomputational robustness rendered the notion effective forpractical use In tune with that the idea has now beencrystallised into an open-source package for the WolframMathematica system [9] called CATemplates [10] The expla-nations provided in this paper are partially based on theimplementations used in CATemplates

Although cellular automata can be defined in any numberof dimensions here we focus on the one-dimensional casefirst because the major benchmarking problems from theliterature are one-dimensional and second because this is thecase implemented in CATemplates

The rest of this paper is organised as follows Section 2is a brief overview of cellular automata and their innerworkings Section 3 defines a cellular automata templateand Section 4 provides explanations about the operationsapplicable to them Section 5 then presents examples oftemplate builder functions Section 6 discusses a sampleapplication of templates to find rules that share both totalityand captivity in extremely large CA spaces and Section 7closes the paper with some concluding remarks and ideas forfuture work

2 Cellular Automata

Cellular automata are dynamical decentralised systems gov-erned by simple local rules Given the relative simplicity ofCAs they serve as a good model to analyse how the inter-action among simple components can give rise to complexbehaviour in dynamical systems in particular how solutionsto 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 pre-determined local rule The lattice can be arranged in anynumber of dimensions and can have a finite or infinitenumber of cells From now on whenever a CA is mentionedwe always mean one-dimensional CAs (whose lattices arearranged as a line) each cell can take on a discrete state valueand the update is parallel at discrete time steps

A CArsquos cell state is usually represented by numbers inthe [0 119896 minus 1] interval or a colour from a set of 119896 colourspreviously defined The local rule of a CA acts on each cellrsquosneighbourhood which is a set composed of the cell itselftogether with its 2119903 adjacent cells with 119903 being the radiusof the rule that is the number of cells at each side Thefractional value 5 for 119903 indicates that the neighbourhood isasymmetric as in 119903 = 15 meaning that the center cell has 2neighbours onone side and 1 on the other (inCATemplates byconvention the left-hand side contains the larger number ofneighbours)

Table 1 Rule table for the elementary CA 184

(111) 1(110) 0(101) 1(100) 1(011) 1(010) 0(001) 0(000) 0

By defining a value for 119896 and 119903 a space (or family) ofCAs is established The elementary space is currently one ofthe most extensively studied CA families as it is composed ofonly 256 rules even though displaying a rich phenomenology[1]

The size of a CA space is a function of 119896 and 119903 Inthe one-dimensional case this means 119904(119896 119903) = 119896119896lfloor2119903+1rfloor As a consequence the increase of 119896 or 119903 quickly leads toexponentially large space sizes for instance the space ofbinary CAs with radius 2 is composed of 232 rules

Every CArsquos temporal evolution is governed by a local ruleThis local rule is usually represented as a rule table consistingof state transitions that point every possible neighbourhoodto an output state At every time step every cell in the latticeis updated according to its neighbourhood following its statetransition table

Since a rule table has to cover all possible neighborhoodsin the lattice it consists of 119896lfloor2119903+1rfloor state transitions orderedusingWolframrsquos lexicographic order in which the first transi-tion is the one corresponding to the neighbourhood formedonly by cells in the 119896minus1 state and the last one is the transitioncorresponding to the neighbourhood of zeros To illustratethe point the rule table for elementary CA 184 is shown inTable 1

It is possible to compress the rule table by using its 119896-aryrepresentation By discarding Table 1rsquos first column we areleft with the outputs of each transition (1 0 1 1 1 0 0 0)Since we are still following Wolramrsquos convention we canswitch freely between both representations If interpreted asa binary number this representation can be converted to itsdecimal form 184 which is referred to as the rule (Wolfram)number

The nature of the 119904(119896 119903) function represents a greatchallenge when searching for specific sets of CAs Oneof the employed strategies for this kind of search is torestrict these very large spaces into smaller ones using staticproperties of CAs The template framework described inthis paper aims to automate this process Static propertiesare those we can draw directly from the rule table insteadof looking at the temporal evolution This means that theydetermine specific ways a rule table should be built so thatthe resulting rule would possess them As will be detailedin Section 5 template builder functions use this idea inorder to create templates representing specific subsets of CAspaces

Complexity 3

3 Cellular Automata Templates

A cellular automaton template (referred to simply as tem-plate from here on) is a data structure that allows for therepresentation of a (potentially large) subset of a CArsquos familyin a compact manner

Template builder functions are defined as a means to cre-ate templates of interesting subsets of CAs usually followinga well defined static property derived from CArsquos rule tablesThey are explained in detail in Section 5

Two main operations are defined over templates Expan-sion and Intersection Expansion is used to convert a templateinto the rule set it represents and Intersection is applied totwo templates to generate a third representing the rule setof the resulting intersection Both operations are detailed inSection 4

The template concept was first described in [8 12] andhas gone through significant improvements since then Forinstance the templatersquos core essentially what was describedas the template itself in the original papers is now a part ofa tuple composed by important attributes as shown in thedefinition below

Also new template builder algorithms have been devel-oped the concept of expansion modifier functions has beenimplemented and the intersection operation at that timeimplicitly couched in terms of a superseded ldquocompositionrdquooperationmdashwhich was just a part of the original templatebuilder algorithms described in the original papersmdashhasbeen made explicit and evolved into a generalised operation

Furthermore the original work was totally restricted tobinary rules which no longer is the case the code wascompletely ad hoc (and therefore private to the authors) withno internal structure that would allow it to grow toward ausable and useful system beyond its original conception andonly two rule properties have been accounted for (additionalinformation about these two properties is given later in thepaper)

So in its origin there was a still immature but promis-ing idea that was conveyed at the time to two distinctaudiences the early technical details of the implementa-tion to Mathematica users [8] and the actual idea andits prospects as a short communication to the cellularautomata community [12] From then on the work devel-oped until reaching the required degree of maturation that itdeserved as embodied in the present report All the furtherdevelopments are now consolidated as a fully functionalopen-source implementation in the form of the CATem-plates package [10] within Wolfram Mathematica software[9]

Armed with this framework one can efficiently buildand manipulate templates as needed and avoid the expensiveenumeration of the sets they stand for until a template isobtained representing a small enough rule set

Definition 1 (template) A template is the tuple (119896 119903 119888 119890)where 119896 and 119903 are the number of states and the neighbour-hood radius respectively of the cellular automata rules of thespace that is being represented 119888 is the template core and 119890 isan expansion modifier function

The core is by far the most important part of a templateIt is essentially a rule table in 119896-ary form with a twistevery output of this rule table is allowed to be a function ofthe other outputs This is achieved by introducing variablessemantically bounded across all transitions of the classicalrule-table representation By means of the core a template isable to represent a set of CAs The following template (1198791) isan example

1198791 = (2 10 (0 1 minus 1199091 0 1 1199093 1 1199091 0) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903) (1)

The 119868119889119890119899119905119894119905119910119872119886119901119901119890119903 and other expansion modifier func-tions will be explained in more detail in Section 4

Remark In the CATemplates package 119896 119903 and 119890 may beomitted in which case the default values of 119896 = 2 119903 = 10and 119890 = 119868119889119890119899119905119894119905119910119872119886119901119901119890119903 are assumed similarly but forthe sake of simplicity from now on in this paper wheneverwe refer to a templatersquos core in isolation say 119888(1198791) thereader should assume the same previous default values for thecorresponding template (1198791)

We indicate the state transitions of the templatersquos coreby an index starting at 0 on the right-most position upto 119896lfloor2119903+1rfloor minus 1 on the left-most so as to mirror their cor-respondence to the neighborhoods they represent As suchwhenever 1198791rsquos transition 0 is mentioned we are referringto the first 0 that appears in 1198791rsquos core from right to leftTransition 1 refers to 1199091 and so on1198791rsquos transition 0 is a sample of a fixed output This meansany CA with a value different from 0 on its rule tablersquos firsttransitionmdashwhich is the same as the state transition (000)leading to 1mdashis not an element of the set represented by 11987911198791rsquos transition 1 is a sample of a free variable (1199091) Afree variable is assumed to represent any value in the range[0 119896minus1] As a convention free variables are indexed followingthe transition where they first appear Were we to consideronly1198791 rsquos first two transitions we could say it represents the set(0 0) (1 0) since the first transition is fixed and the secondis a free variable

Transition 6 is a sample of a function As 1198791 is a binarytemplate (since 119896 = 2) the expression 1 minus 1199091 means thistransition will always be evaluated to the opposite of the valueof transition 1 It is important to note that we could use anyalgebraic expression here potentially referring to any othervariable in the template and we would still be able to derivethe set this template represents This is actually done in sometemplate builder functions as will be seen in Section 5

It follows from the previous observations that 1198791 actuallycorresponds to the binary rule set (0 1 0 1 0 1 0 0) (0 10 1 1 1 0 0) (0 0 0 1 0 1 1 0) (0 0 0 1 1 1 1 0) whichcould also be written as 22 30 84 92 following Wolframrsquosnumbering convention

A template whose core is made of only free variables iscalled a Base Template and essentially represents the wholeCA space given by k and 119903 for instance the Base Template forthe elementary CAs is

(2 10 (1199097 1199096 1199095 1199094 1199093 1199092 1199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903) (2)

4 Complexity

Base templates are often used by template builder func-tions as a starting point

4 Template Operations

Currently templatesrsquo processing supports two operationsexpansion (119864) and intersection (119868) This section presentsdetails on how they work

41 Expansion Every template represents a set 119877 of 119896-aryrule tables This set is obtained by means of the expansionoperation

The 119894-th expansion of template119879 denoted as119864119894 (119879) beginswith the extraction of all variables present in the templatersquoscore in a total of 119898 variables For instance given thetemplatersquos core 119888(1198791) = (0 1minus1199091 0 1 1199093 1 1199091 0) the orderedlist of extracted variables would be (1199093 1199091) ordered by thevariablersquos index in decreasing order Next 119894 is converted tobase 119896 padded with zeros to the left up to achieving119898 digitsFor 119894 = 2 we would have the ordered list of digits (1 0) since10 is 2 in binary We then pair the extracted variables with thedigits in order and replace every occurrence of the variablewith the corresponding value like (0 1minus0 0 1 1 1 0 0) Anyalgebraic expression left in the core is then resolved resultingin 1198642(1198791) = (0 1 0 1 1 1 0 0)

With the process to find the 119894-th expansion defined itis only a matter of mapping it over every number in theinterval [0 119896119898 minus 1] and we have the set 119877 of CA rule tablesrepresented by the template This is how the full expansion119864(119879) is implemented

Still considering 1198791 since 119898 = 2 we only have 1198962 =4 possible expansions for this template By performing theexpansion procedure with 119894 isin 0 1 2 3 we end upwith the set 119877 = (0 1 0 1 0 1 0 0) (0 1 0 1 1 1 0 0)(0 0 0 1 0 1 1 0) (0 0 0 1 1 1 1 0)

Upon expansion templates can generate invalid resultsfor instance let us consider the templatersquos core 119888(119879119894119899V119886119897119894119889) =(0 0 0 0 2 minus 1199093 1 1 1)

Since 119898 = 1 and 119896 = 2 this template has 2 possibleexpansions namely 119864(119879119894119899V119886119897119894119889) = (0 0 0 0 2 1 1 1) (0 00 0 1 1 1 1) however the set contains an invalid statetransition as it leads to the 2-state which is not in the [0 119896minus1]range

Expansion modifier functions can be used as a mecha-nism by which the template provides auxiliary informationfor the expansion operation in terms of some details it shouldabide by

Every template has at least one expansion modifierfunction defined Whenever the expansion operation isperformed on the 119894-th expansion its result is passed on to thetemplatersquos expansion modifier function which is defined bythe template builder function

This means that every template itself is able to definespecific behaviours to the expansion operation deciding howto deal with unwanted results

Expansion modifier functions are currently divided intotwo categories Mappers and Filters

411 Mappers A Mapper is a function that receives the i-thexpansion result and performs some kind of transformationon it So far we have identified the need for two expansionmodifier functions of the Mapper kind ModKMapper andIdentityMapper

(i) IdentityMapper simply receives the expansion andleaves it untouched

(ii) ModKMapper performs the 119898119900119889119906119897119906119904 operation oneach transition of the expansion result using the tem-platersquos 119896 as divisor thus obtaining a valid expansion

As an example of the latter let us define 119879119898119900119889119896 as avariation of 119879119894119899V119886119897119894119889 that uses ModKMapper instead of theIdentityMapper

119879119898119900119889119896= (2 10 (0 0 0 0 2 minus 1199093 1 1 1) 119872119900119889119870119872119886119901119901119890119903) (3)

Now the result of expanding 119879119898119900119889119896 becomes

119864 (119879119898119900119889119896) = (0 0 0 0 0 1 1 1) (0 0 0 0 1 1 1 1) (4)

412 Filters A Filter is a function that checks the expansionresult and decides whether it is an acceptable result forthe given template If it finds an unacceptable expansioncandidate it filters out this result by removing it from theset 119877 So far we have identified the need for two expansionmodifier functions of the Filter kind FilterKOutOfRange andFilterVariableAssignments

(i) FilterKOutOfRange simply removes any invalidexpansion For instance by defining 119879119891119894119897119905119890119903119870 as avariation of 119879119894119899V119886119897119894119889 that uses FilterKOutOfRangeinstead of the IdentityMapper and this results in119864(119879119891119894119897119905119890119903119870) = (0 0 0 0 1 1 1 1)

(ii) FilterVariableAssignments serves a different kind ofneed It allows for templates to define annotations onits corersquos variables which dictate the values from the[0 119896 minus 1] range the variable is allowed to have

The annotation referred to in FilterVariableAssignmentsis expressed with a special syntax on the templatersquos coreConsider the following template 119879V119886 and its 119894 = 0 expansion

119879V119886 = (2 10 (0 0 0 0 1199093 isin 1 1 1 1) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (5)

The process should result in the expansion candidate (0 00 0 0 isin 1 1 1 1) But since 0 isin 1 is false FilterVariable-Assignments detects this as unacceptable and removes it from119877

In the binary case FilterVariableAssignments is seldomneeded since the expression 119909119891119903119890119890 isin 0 1 is equivalentto a free variable 119909119891119903119890119890 and the expression 119909119891119894119909119890119889 isin 0 isequivalent to the fixed value 0

Therefore this expansionmodifier function becomes use-ful when 119896 gt 2 for various reasons For further clarificationSection 52 discusses an application of this filter

Complexity 5

42 Intersection Template intersection is a function of twotemplates which results in a template whose associated set 119877is equivalent to intersecting the 119877 sets of the two templatesreceived as arguments In another form

119868 (1198791 1198792) = 1198793 lArr997904 119864 (1198793) = 119864 (1198791) cap 119864 (1198792) (6)

Template intersection initially consists of building anequation system with the templatersquos cores received asoperands The equation system is then submitted to Mathe-maticarsquos Solve function [9] which solves it for the variablesthat admit a solution and elicits the relations among theremaining variables The resulting set of variable values andrelations is then applied to any of the two operands and theoutcome is a new template representing only the intersectionbetween both of the input templates

If the system has no solution this means both templatesrepresent disjoint 119877 sets and by definition do not intersect

As an example consider the template cores 119888(1198791) =(1199097 0 1199095 0 1 0 1199092 1199090) and 119888(1198792) = (1 0 1 minus 1199091 1 minus1199093 1199093 0 1199091 0)The associated equation system thus becomes

1199097 = 10 = 01199095 = 1 minus 11990910 = 1 minus 11990931 = 11990930 = 01199091 = 11990911199090 = 0

(7)

The solution set of the equation system as given by Math-ematicarsquos Solve is 119878 = 1199090 = 0 1199093 = 1 1199092 = 1199091 1199095 =1 minus 1199091 1199097 = 1 We can then substitute the variablesin 119888(1198791) using this set thus rendering the templatersquos core(1 0 1 minus 1199091 0 1 0 1199091 0) Notice that the same result wouldbe achieved had we applied the substitutions to 119888(1198792)

If a templatersquos core has variable restrictions a second stepis needed to guarantee that the solution found will not violatethem

For instance consider the templatesrsquo cores 119888(1198791199031) and119888(1198791199031) both with restricted variables 119888(1198791199031) = (1199097 0 1199095 0 10 1199092 isin 0 1 1199090) and 119888(1198791199032) = (1 0 1 minus 1199091 1 minus 1199093 1199093 0 1199091 isin0 0) To intersect 1198791199031 and 1198791199032 we first extract the variablerestriction expressions and then build and solve the systemas usual This time however the substitutions are appliedto both arguments therefore resulting in the set (1 0 1 minus1199091 0 1 0 1199091 isin 0 1 0) (1 0 1 minus 1199091 0 1 0 1199091 isin 0 0)

Now we extract variable restriction expressions andcreate a second equation system whose solutions indicatewhich values the variables may have In the example the setof expressions 1199091 isin 0 1 1199091 isin 0 would be extracted thusyielding the equation system

1199091 = 1 or 1199091 = 01199091 = 0 (8)

By solving this system the solution set 119878 = 1199091 = 0 canfinally be applied to 119888(1198791199031) yielding (1 0 1 0 1 0 0 0) as theresult

5 Template Builders

So far we have seen how templates can be built in orderto represent specific subsets of CA families We can nowgo about making evident the true power of templates byconsidering template builder functions

Template builder functions are algorithms tailored togenerate templates for specific subsets of CAs that share agiven static property

Currently six template builders for static properties areimplemented associated to rules of the following kindscaptive totalistic outer-totalistic number conserving col-orblind and maximum internal symmetry values (see [1])for reflection conjugacy and their composition The lattertwo are not discussed herein partly because we have alreadydiscussed them previously (see [8]) and at least in thecontext number conservation the corresponding templatebuilder simply did not change since its conception Howeverthe builder for rule table symmetries has undergone ageneralisation that now allows for any value of symmetry tobe accounted for not only maximum As such the CATem-plates package contains the SymmetryTemplate builder fullyavailable for use including its corresponding documentationbut we decided not to include it in the paper because itcannot yet handle arbitrary number of states in the case ofconjugation

So this section discusses builder functions for totalisticouter-totalistic captive and colorblind templates

51 Template Builder for Totalistic and Outer-Totalistic CAs

Definition 2 (totality) A totalistic CAmdashor alternatively aCA that presents the totality propertymdashis one whose statetransitions only depend on the sum of the state values of thecells in a given neighbourhood

Formally let 119891 be the local transition function of a CAdefined over the set119873 of possible neighborhoods for the CArsquosspace Let 119899 be the size of a neighbourhood of 119873 Let 119860 =(1205721 120572119899) and 119861 = (1205731 120573119899) be neighborhoods of 119873 ACA is said to be totalistic if and only if the following conditionis true

forall119860 119861 isin 119873( 119899sum119894=1

120572119894 = 119899sum119895=1

120573119895) lArrrArr (119891 (119860) = 119891 (119861)) (9)

Since totality is a static property we can derive a generalalgorithm to find all rule tables of CAs that share the totalityproperty given a value for 119896 and 119903

6 Complexity

The algorithm receives as arguments the values of 119896 and119903 for which the template will be generated It then proceedsto enumerate all possible neighborhoods of the defined spaceand calculates their sum

Now for every sum value found in the previous step thealgorithm picks the neighbourhood representing the smallest119896-ary number and assigns a variable corresponding to thatneighbourhoodrsquos decimal value to all of the state transitionsthat shared a result with it For instance let us considerall neighborhoods of the elementary space whose statessum equals 2 (1 1 0) (1 0 1) (0 1 1) Since the smallestneighbourhood in this set is (0 1 1) which is decimal 3 weassign to their respective transitions the result 1199093

The templatersquos core for the elementary space becomes

119888 (119879119905119900119905119886119897119894119904119905119894119888119864119878) = (1199097 1199093 1199093 1199091 1199093 1199091 1199091 1199090) (10)

Upon expansion this template yields the rule tables ofthe 16 totalistic elementary CAs Notice that this templatersquoscore is composed of only free variables and references toother free variables This being the case every expansionof this template shall yield a valid result excluding theneed to define any expansion modifier function other than119868119889119890119899119905119894119905119910119872119886119901119901119890119903

For 119896 = 3 and 119903 = 1 the resulting template would be

11987911990511990011990531 = (3 10 (11990926 11990917 1199098 11990917 1199098 1199095 1199098 1199095 1199092 11990917 11990981199095 1199098 1199095 1199092 1199095 1199092 1199091 1199098 1199095 1199092 1199095 1199092 1199091 1199092 1199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903)

(11)

Upon expansion this template yields the 2187 totalisticrules of the referred space

Definition 3 (outer-totality) An outer-totalistic CAmdashor al-ternatively a CA that presents the outer-totality propertymdashis one whose local rule considers the sum of the state valuesof the external cells of a neighbourhood (ie those except thecenter cell) in addition to the state value of the center cellitself

Formally let 119891 be the local transition function of a CAdefined over the set119873 of possible neighborhoods for the CArsquosspace Let 119899 be the size of a neighbourhood of 119873 and let119898 = lceil1198992rceil be the index of the cell that is meant to undergoa state change (ie the center cell when 119899 is an odd number)Let 119860 = (1205721 120572119898 120572119899) and 119861 = (1205731 120573119898 120573119899) beneighborhoods of119873 A CA is said to be outer-totalistic if andonly if the following condition is true

forall119860 119861 isin 119873((119898minus1sum119894=1

120572119894 + 119899sum119894=119898+1

120572119894 = 119898minus1sum119895=1

120573119895 + 119899sum119895=119898+1

120573119895)

and (120572119898 = 120573119898)) lArrrArr (119891 (119860) = 119891 (119861)) (12)

The algorithm for outer-totalistic templates is almost thesame as the one for totalistic rules with the exception that

it considers the sum of external cells in the neighbourhoodinstead of its entirety

The algorithmrsquos output for the elementary space is

119888 (119879119900119906119905119890119903minus119905119900119905119886119897119894119904119905119894119888119864119878) = (1199097 1199093 1199095 1199091 1199093 1199092 1199091 1199090) (13)

Upon expansion this template generates the 64 outer-totalistic elementary CAs

For reference here is the result for 119896 = 3 and 119903 = 1whichafter expansion would yield the 14 348 907 outer-totalisticrules of the space since 15 distinct variables are present inthe template

119879119900119906119905119890119903minus11990511990011990531 = (3 10 (11990926 11990917 1199098 x23 11990914 1199095 11990920 11990911 119909211990917 1199098 1199097 11990914 1199095 1199094 11990911 1199092 1199091 1199098 1199097 1199096 1199095 1199094 1199093 11990921199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903)

(14)

52 Template Builder for Captive CAs

Definition 4 (captivity [13]) A CA is said to be captivemdashoralternatively to have the captivity static propertymdashwhenevery transition of its rule table outputs a state that appearsin the corresponding neighbourhood

Formally if 119891 is the local transition function of a CA119860 =(1205721 120572119898 120572119899) is a neighbourhood of size 119899 out of allpossible neighborhoods 119873 and 120573 is an arbitrary state a CAis said to be captive if and only if the following condition istrue

forall119860 isin 119873119891 (1205721 120572119899) = 120573 lArrrArr 120573 isin 1205721 120572119899 (15)

In the binary case this naturally simplifies to the fact thatevery CA with 119891(01 02 0119899) = 0 and 119891(11 12 1119899) = 1is captive for any radius 119903

As a static property a general algorithm to find templatesof captive CAs for a given space does exist As such thealgorithm receives the values for 119896 and 119903 and starts bygenerating all possible neighborhoods for the space

It then uses the following simple rules to decide how totransform this neighbourhood in a template output

(i) If the neighbourhood is homogeneous like (1 1 1)the transition should output the only state thatappears in the neighbourhood (1)

(ii) If the neighbourhood is composed of all of the valuesin the interval [0 119896 minus 1] like (1 2 0) for 119896 = 3 and119903 = 1 the transition should output a free variableindexed by the decimal value of the neighbourhoodnamely 11990915 (since 120 in base 119896 = 3 corresponds tothe decimal 15)

(iii) If the neighbourhood is composed of only some of thepossible states the states of the interval [0 119896 minus 1] like(0 2 0) for 119896 = 3 and 119903 = 1 the output should bea variable indexed by the neighbourhood this timerestricted by the present values (1199096 isin 0 2)This typeof neighbourhood only appears when 119896 gt 2

Complexity 7

Note that since this template uses restricted variables itmust use the 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904 expansion modifierfunction

As a result of all the latter the captivity template for theelementary space becomes

119879119888119886119901119905119894V119890 = (2 10 (1 1199096 1199095 1199094 1199093 1199092 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (16)

while for 119896 = 3 and 119903 = 1 the template is

119879119888119886119901119905119894V11989031 = (3 10 (2 11990925 isin 1 2 11990924 isin 0 2 11990923isin 1 2 11990922 isin 1 2 11990921 11990920 isin 0 2 11990919 11990918isin 0 2 11990917 isin 1 2 11990916 isin 1 2 11990915 11990914isin 1 2 1 11990912 isin 0 1 11990911 11990910 isin 0 1 1199099isin 0 1 1199098 isin 0 2 1199097 1199096 isin 0 2 1199095 1199094isin 0 1 1199093 isin 0 1 1199092 isin 0 2 1199091 isin 0 1 0) 119865119894119897119905119890119903119873119900119905119860119897119897119900119908119890119889)

(17)

53 Template Builder for Colorblind CAs In order to fullygrasp the notion of colorblind rules let us first discuss themeaning of permutations in the context of CAs

Definition 5 (colour permutation (120587)) Let framework 119870 bethe set of possible states for a CA in the range [0 119896 minus 1] Acolour permutation 120587 is a bijective function of 119870 to itselfwhich can be written as a set of rules of the form 119896119894 997888rarr 119896119895meaning that a cell in state 119896119894 should be switched to state 119896119895when this permutation is applied

For instance a valid permutation for the case where 119870 =0 1 2 is 1205871 = 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0It is important to notice that every colour permutation

can be represented by an algebraic function that interpolatesthe points defined by the permutation For instance 1205871 couldbe written as 1205871(119909) = 1 + (1 minus 32(minus1 + 119909))119909Definition 6 (symmetric group (119878119870)) The symmetric group119878119870 of a set119870 is the set of all possible permutations over 119870

For instance the symmetric group for119870 = 0 1 2 is119878119870 = 0 997888rarr 0 1 997888rarr 1 2 997888rarr 2

0 997888rarr 0 1 997888rarr 2 2 997888rarr 1 0 997888rarr 1 1 997888rarr 0 2 997888rarr 2 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0 0 997888rarr 2 1 997888rarr 0 2 997888rarr 1 0 997888rarr 2 1 997888rarr 1 2 997888rarr 0

(18)

Definition 7 (neighbourhood permutation (120588(120587))) Let120587 be acolour permutation and let119873 be the set of all possible neigh-borhoods for a given CA The neighbourhood permutation

120588(120587) is a permutation 119873 that uses 120587 to transform 119899119894 isin 119873 intoneighbourhood 119899119895 isin 119873 by applying 120587 to every cell of 119899119894

For instance with119870 = 0 1 2 119903 = 1 and 1205871 = (0 1 2)a valid transformation due to 120588(1205871) would be (0 2 2) 997888rarr(1 0 0) The other transformations can be derived by apply-ing the same reasoning to all of the neighborhoods of119873

Definition 8 (cycle notation of a permutation) A permuta-tion can be written by means of a cycle notation formedby a set of vectors that represent cycles associated with thepermutation

For instance the colour permutation 1205872 = 0 997888rarr 1 1 997888rarr0 2 997888rarr 2 can be written as 1205872 = (0 1) (2) whereeach vector has the form (1199091198941 1199091198942 119909119894119895) 1 le 119895 le 119896 andrepresents a cycle due to the permutation namely the two-step cycle 0 997888rarr 1 997888rarr 0 and the self-loop 2 997888rarr 2Similarly The previous 1205871 permutation would be written incycle notation as 1205871 = (0 1 2)

As for neighbourhood permutations 120588(1205871) for examplewould be represented as follows

120588 (1205871) = ((0 2 2) (1 0 0) (2 1 1)) ((0 2 1) (1 0 2) (2 1 0)) ((0 2 0) (1 0 1) (2 1 2)) ((0 1 2) (1 2 0) (2 0 1)) ((0 1 1) (1 2 2) (2 0 0)) ((0 1 0) (1 2 1) (2 0 2)) ((0 0 2) (1 1 0) (2 2 1)) ((0 0 1) (1 1 2) (2 2 0)) ((0 0 0) (1 1 1) (2 2 2))

(19)

With the previous characterisations we can now define colorblindness

Definition 9 (color blindness [14]) A CA whose cells can bein any of the states of the set 119870 is said to be colorblindmdashoralternatively to possess the color blindness propertymdashif itsspace-time evolution does not change unless by a colourchange after applying any neighbourhood permutation120588(120587) 120587 isin 119878119870 to all state transitions that define its rule table

Notice that for a CA to be invariant to 120588(1205871) its ruletablersquos outputs 119900119894 should be consistent with the cycles formedby the application of 120588(1205871) over its neighborhoods 119887119894 119894 beingthe index of the state transition on the CArsquos rule table

In other words for a rule to be invariant to 1205871 theoutput of say neighbourhood (0 2 2) should be equal tothe application of 1205871 to the output of neighbourhood (1 0 0)since (0 2 2) is transformed into (1 0 0) due to 1205871 for thesame reason the output of (1 0 0) should be equal to theapplication of1205871 to the output of neighbourhood (2 1 1)Thesame happens analogously for the remaining cycles of 120588(1205871)

8 Complexity

Now in order to generate a template representing CAsthat are invariant to the neighbourhood permutation 120588(1205871)we need to assign an output to every neighbourhood andderive a rule table that could be turned into a template

So that outputs follow 120588(1205871) we use its cycle notationrepresentation to assign to every cycle start a free variableindexed by its corresponding neighbourhoodrsquos decimal rep-resentation ending upwith a tuple formed by neighbourhoodand output The (0 2 2) neighbourhood being a cycle startis turned into the tuple ((0 2 2) 1199098) for instance

For every remaining neighbourhood in a cycle we nowapply 1205871 to the free variable found in the previous step 119889times 119889 being the distance from this neighbourhood tothe start of the cycle The cycle ((0 2 2) (1 0 0) (2 1 1))is turned into (((0 2 2) 1199098) ((1 0 0) 1205871(1199098)) ((2 1 1)1205871(1205871(1199098)))) for instance

Applying this procedure to every cycle of 1205871 we obtainthe set(((0 2 2) 1199098) ((1 0 0) 1205871 (1199098))

((2 1 1) 120587 (1205871 (1199098)))) (((0 2 1) 1199097) ((1 0 2) 1205871 (1199097)) ((2 1 0) 120587 (1205871 (1199097)))) (((0 2 0) 1199096) ((1 0 1) 1205871 (1199096)) ((2 1 2) 120587 (1205871 (1199096)))) (((0 1 2) 1199095) ((1 2 0) 1205871 (1199095)) ((2 0 1) 120587 (1205871 (1199095)))) (((0 1 1) 1199094) ((1 2 2) 1205871 (1199094)) ((2 0 0) 120587 (1205871 (1199094)))) (((0 1 0) 1199093) ((1 2 1) 1205871 (1199093)) ((2 0 2) 120587 (1205871 (1199093)))) (((0 0 2) 1199092) ((1 1 0) 1205871 (1199092)) ((2 2 1) 120587 (1205871 (1199092)))) (((0 0 1) 1199091) ((1 1 2) 1205871 (1199091)) ((2 2 0) 120587 (1205871 (1199091)))) (((0 0 0) 1199090) ((1 1 1) 1205871 (1199090)) ((2 2 2) 120587 (1205871 (1199090))))

(20)

We can now flatten a level of this set and turn it into anordered list sorted lexicographically by neighbourhood Thisprocedure yields the rule table shown in Table 2

The core of a template for CAs invariant to 120588(1205871) can nowbe found by compressing this rule table into its 119896-ary form

119879120588(1205871) = (120587 (1205871 (1199090)) 120587 (1205871 (1199092)) 120587 (1205871 (1199091)) 120587 (1205871 (1199096)) 120587 (1205871 (1199098)) 120587 (1205871 (1199097)) 120587 (1205871 (1199093)) 120587 (1205871 (1199095)) 120587 (1205871 (1199094)) 1205871 (1199094) 1205871 (1199093) 1205871 (1199095) 1205871 (1199091) 1205871 (1199090) 1205871 (1199092) 1205871 (1199097) 1205871 (1199096) 1205871 (1199098) 11990981199097 1199096 1199095 1199094 1199093 1199092 1199091 1199090))

(21)

Remember from Definition 5 that any permutation 120587 canbe represented by an algebraic function which is the actual

Table 2 Rule table for the template representative of CAs invariantto 1205871(2 2 2) 120587(1205871(1199090)(2 2 1) 120587(1205871(1199092)(2 2 0) 120587(1205871(1199091)(2 1 2) 120587(1205871(1199096)(2 1 1) 120587(1205871(1199098)(2 1 0) 120587(1205871(1199097)(2 0 2) 120587(1205871(1199093)(2 0 1) 120587(1205871(1199095)(2 0 0) 120587(1205871(1199094)(1 2 2) 1205871(1199094)(1 2 1) 1205871(1199093)(1 2 0) 1205871(1199095)(1 1 2) 1205871(1199091)(1 1 1) 1205871(1199090)(1 1 0) 1205871(1199092)(1 0 2) 1205871(1199097)(1 0 1) 1205871(1199096)(1 0 0) 1205871(1199098)(0 2 2) 1199098(0 2 1) 1199097(0 2 0) 1199096(0 1 2) 1199095(0 1 1) 1199094(0 1 0) 1199093(0 0 2) 1199092(0 0 1) 1199091(0 0 0) 1199090

representation used by the algorithm We use the 120587 nota-tion here since it is compact and serves the explanationrsquospurpose

The same procedure can now be repeated for every per-mutation of the 119878119896 set essentially mapping each permutationof the set to a corresponding template of CAs invariant to thatpermutation It is now only a matter of intersecting all of thetemplates found and the result is a template that representsall colorblind rules of the space defined by 119896 and 119903

When applied to 119896 = 2 and 119903 = 1 we obtain119879119888119900119897119900119906119903119887119897119894119899119889

= (1 minus 1199090 1 minus 1199091 1 minus 1199092 1 minus 1199093 1199093 1199092 1199091 1199090) (22)

whereas for 119896 = 3 and 119903 = 1 the result becomes

11987911988811990011989711990011990611990311988711989711989411989911988931 = (2 2 minus 1199091 2 minus 21199091 2 minus 1199093 2 minus 1199094 2minus 1199095 2 minus 2 1199093 2 minus 21199095 2 minus 21199094 1 minus 21199094 1 minus 21199093 1minus 21199095 1 minus 21199091 1 1 + 21199091 1 + 21199095 1 + 21199093 1+ 21199094 21199094 21199095 21199093 1199095 1199094 1199093 21199091 1199091 0)

(23)

Complexity 9

6 A Detailed Example

Here we discuss a detailed application for the templateframework presented in this paper which is to find the rulesthat share a set of static properties This can be achieved withthe template builder functions provided with CATemplatesor one could implement custom builder functions on top ofthe core concepts provided by the package What follows isa sample of how the framework can be used to conduct anexperiment of this sort

More specifically let us suppose we are interested in therules which are both totalistic and captive This might comefrom a purely theoretical interest or motivated by the needfor obtaining rules of this type for some practical application

We then start by building the templates for totalisticand captive rules of the elementary space as shown in theprevious sections (119879119905119900119905119886119897119894119904119905119894119888 and 119879119888119886119901119905119894V119890) By performing theirintersection we end up with a template representing alltotalistic and captive rules of the elementary space as follows

11987911989621199031 = (2 10 (1 1199093 1199093 1199091 1199093 1199091 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (24)

Upon expansion this template yields the 4 totalisticelementary CAs which are also captive 128 150 232 254Notice that the template being expanded has only 2 variableswhichmeans the expansion has to consider only 4 expansioncandidates which is a substantially smaller subset of theoriginal space which has 256 rules

Since the elementary space is a small one let us performthe same example in larger spaces We can generate theequivalent templates for the space defined by 119896 = 3 and 119903 = 1and perform the intersection between them The result is

11987911989631199031 = (3 10 (2 11990917 isin 1 2 2 11990917isin 1 2 2 1 2 1 0 11990917 isin 1 2 2 1 2 1 0 1 0 1199091isin 0 1 2 1 0 1 0 1199091 isin 0 1 0 1199091 isin 0 1 0)FilterVariableAssignments)

(25)

Notice that this template also has two variables 1199091 and11990917 This means there are only 32 = 9 possible expansions forthis template from which some will be filtered out becauseof the variable assignment annotations After expansion thistemplate yields the 4 totalistic rules of the spacewhich are alsocaptive 223160992 223161514 265235104 265235626

This means that we took a space with 327 = 7 625 597484 987 rules and found out that only 4 of those sharethe totality and captivity properties all without actuallyenumerating the whole space (which would be not feasiblegiven its size) Notice that this space could be further reducedby intersecting this resulting template with templates fromother properties like color blindness

Extending the previous case we may now ask the generalquestion of up to which rule space size could we still manageto get access to totalistic and captive rulesWithout templatesthe rules would have to be obtained directly by scanningthe rule space and selecting those having the two properties

But with 119896 = 3 this approach would already be impracticaleven for 119903 = 1 on a standard personal computer since thespace has ≃ 76 times 1012 rules A first alternative now usingtemplates could be accessing the rules say by first expandingthe totalistic rules directly from the corresponding templateand then filtering out the captive ones This certainly helpsIn fact by doing so progressively starting with radius 119903 = 05and increasing its value in steps of 05 in a standard personalcomputer it would hardly be possible to reach beyond 119903 = 2(which corresponds to a space with ≃ 87 times 10115 rules)because of the substantial increase in computational timeas we would go from a given 119903 to its subsequent valueWe omit actual values of processing time here as this maystrongly vary among different machine architectures andtheir software environment

However by relying on the generation of the individualtemplates of each property and expanding the intersectionbetween them we easily access spaces up to 119903 = 4 (possiblyeven beyond) which contains ≃ 15times109391 rules It turns outthat in this space only 256 rules share the two properties anextremely smaller space to reason about

Furthermore the analysis of all the data generated fromthe previous experiment suggests that the number of ruleswith 119896 = 3 and the shared properties of totality andcaptivity seems to be given by 4119903 for symmetric rules (thosewith integer radius) whereas no rule would be present forasymmetric rules This is quite a remarkable general resultderived from direct probing of the corresponding rule spacesthat the full usage of templates allowed us

As a final note it is worth emphasising that templateexpansion is only made when the actual rules representedin a template are needed which is at the end of the processof answering which rules satisfy a given set of propertiesUntil then it suffices to operate directly with the tem-plates this is where the conciseness of template usage liesAnd although expansion may be computationally intensiveit is certainly much less than if the entire correspond-ing spaces would have to be manipulated directly all theway

7 Concluding Remarks

Searching for cellular automata with specific behaviours(such as global problem solvers) is a daunting task for anyonelooking further than the elementary space

In this paper we presented the current state of cellularautomata templates a valuable ally in this front We havedescribed what templates are and how the two currentlyimplemented operations (expansion and intersection) workwent into details of the implementations of template builderfunctions for captive totalistic outer-totalistic and color-blind rules and have shown a sample application of theframework established here

The sample application has led us to the discovery thatonly a handful of CAs share both of the properties of totalityand captivity (only 64 rules on the 119896 = 3 119903 = 3 spacefor instance) This little experiment shows how the proposedframework can be used as a means to sieve through very largespaceswhen searching forCAs that present a given behaviour

10 Complexity

As mentioned in distinct parts of the text the notionof templates and the implementation of the computationalsystem to support it underwent a long way since its originup to its current degree of structural maturity

The natural course from here is to develop new templatebuilders and whichever other operations we might conceiveMore concretely with respect to the latter we should say thatduring the last couple of years we have been investigating thenotion of ldquodifferencerdquo between templates an operationwhoseoutput would yield another template representing the rulesthat have the property associated with the first template butnot having the property associated with the second In spiteof a conference publication we have on the topic (see [15]) itis not yet mature to go into the publicly available package Butin due time we intend to do so

As for new template builders a generalisation of oneto handle arbitrary values of symmetry by conjugation ismore pressing As mentioned earlier we decided not toinclude this template builder mostly because the existing onecannot yet handle arbitrary number of states in the caseof conjugation However noticing that the notion of colorblindness is essentially the notion of rules with maximumsymmetry by conjugation generalised for any 119896-state ruleusing the same idea implemented for color blindness it isnow possible to face the generalisation of arbitrary values ofsymmetry by conjugation This is clearly future work to bedone

Also it is tempting to add completely new templatebuilders to the present package referring to other parameterslike those in [16] In fact we hope that this paper triggerscollaborative participation from the cellular automata com-munity in terms of both the systemrsquos expansion and its usein applications This is why we decided to keep the work inGitHub publicly available

As for the possibility of extending the framework tosupport rules in higher dimensions we would say this wouldbe readily possible for all current properties but one numberconservation This is due to the fact that the underlyingalgorithm we used to implement the corresponding tem-plate builder comes from [17] which is restricted to one-dimensional rules In order to change that a general algo-rithm would have to be used quite likely the one describedin [18]This is certainly feasible and desirable but we had notyet had the opportunity to go about that

Data Availability

The data used to support the findings of this study are avail-able from the corresponding author upon request and theCATemplates Mathematica package directly from GitHub[10]

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

The authors are grateful to financial support fromIPM (Instituto Presbiteriano Mackenzie) and CAPES

(Coordenacao de Aperfeicoamento de Pessoal de NıvelSuperior Brazil) by means of STIC-AmSud (CoDANet)project no 888811974562018-01 and PrInt project no 888873102812018-00

References

[1] S Wolfram A New Kind of Science WolframMedia Inc 2002[2] J L Zapotecatl D A Rosenblueth and C Gershenson ldquoDelib-

erative self-organizing traffic lights with elementary cellularautomatardquo Complexity vol 2017 Article ID 7691370 15 pages2017

[3] D Wolz and P P B de Oliveira ldquoVery effective evolutionarytechniques for searching cellular automata rule spacesrdquo Journalof Cellular Automata vol 3 no 4 pp 289ndash312 2008

[4] I Barragan-Vite J C Seck-Tuoh-MoraN Hernandez-RomeroJMedina-Marin and E S Hernandez-Gress ldquoDistributed con-trol of a manufacturing system with one-dimensional cellularautomatardquo Complexity vol 2018 Article ID 7235105 15 pages2018

[5] J Yang W Liu Y Li X Li and Q Ge ldquoSimulating intraurbanland use dynamics under multiple scenarios based on fuzzycellular automata a case study of Jinzhou District DalianrdquoComplexity vol 2018 Article ID 7202985 17 pages 2018

[6] H Betel P P B De Oliveira and P Flocchini ldquoSolving theparity problem in one-dimensional cellular automatardquo NaturalComputing vol 12 no 3 pp 323ndash337 2013

[7] M Bidlo ldquoOn routine evolution of complex cellular automatardquoIEEE Transactions on Evolutionary Computation vol 20 no 5pp 742ndash754 2016

[8] P de Oliveira andMVerardo ldquoRepresenting families of cellularautomata rulesrdquoThe Mathematica Journal vol 16 no 8 2014

[9] Wolfram Research ldquoWolfram mathematica 11rdquo httpwwwwolframcommathematica 2018

[10] M Verardo and P P B de Oliveira ldquoCATemplatesrdquo httpsgithubcommverardoCATemplates 2019

[11] P P B de Oliveira ldquoOn density determination with cellularautomata Results constructions and directionsrdquo Journal ofCellular Automata vol 9 no 5-6 pp 357ndash385 2014

[12] P P B de Oliveira andMVerardo ldquoTemplate based representa-tion of cellular automata rulesrdquo inProceedings of the ExploratoryPapers - AUTOMATA 2014 - 20th International Workshop onCellular Automata and Discrete Complex Systems T IsokawaK Imai N Matsiu F Peper and H Umeo Eds pp 199ndash2042014

[13] G Theyssier ldquoCaptive cellular automatardquo in MathematicalFoundations of Computer Science vol 3153 of Lecture Notes inComputer Science pp 427ndash438 2004

[14] V Salo and I Torma ldquoColor blind cellular automatardquo inCellularAutomata and Discrete Complex Systems J Kari M Kutrib andAMalcher Eds pp 139ndash154 SpringerHeidelberg Berlin 2013

[15] Z Soares M Verardo and P P de Oliveira ldquoThe differenceoperation between templates of binary cellular automatardquo inNew Advances in Information Systems and Technologies ARocha A M Correia H Adeli L P Reis and M M TeixeiraEds vol 444 of Advances in Intelligent Systems and Computingpp 707ndash715 Springer International Publishing Cham Swizer-land 2016

Complexity 11

[16] G M Oliveira P P Oliveira and N Omar ldquoDefinitionand application of a five-parameter characterization of one-dimensional cellular automata rule spacerdquo Artificial Life vol 7no 3 pp 277ndash301 2001

[17] N Boccara and H Fuks ldquoNumber-conserving cellular automa-ton rulesrdquo Fundamenta Informaticae vol 52 no 1-3 pp 1ndash132002

[18] B Durand E Formenti and Z Roka ldquoNumber-conservingcellular automata I decidabilityrdquoTheoretical Computer Sciencevol 299 no 1-3 pp 523ndash535 2003

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 2: A Fully Operational Framework for Handling Cellular ...downloads.hindawi.com/journals/complexity/2019/6573793.pdf · is a brief overview of cellular automata and their inner workings,

2 Complexity

be greatly beneficial both theoretically and for practicalapplications A particularly powerful representational toolin this context is the template First introduced in [8]templates are data structures which represent potentiallyextremely large sets of CAs further allowing to combine andmanipulate them with operations such as the intersectionbefore effectively enumerating the whole set

Even though the idea itself of template has been intro-duced before only now its conceptual underpinnings andcomputational robustness rendered the notion effective forpractical use In tune with that the idea has now beencrystallised into an open-source package for the WolframMathematica system [9] called CATemplates [10] The expla-nations provided in this paper are partially based on theimplementations used in CATemplates

Although cellular automata can be defined in any numberof dimensions here we focus on the one-dimensional casefirst because the major benchmarking problems from theliterature are one-dimensional and second because this is thecase implemented in CATemplates

The rest of this paper is organised as follows Section 2is a brief overview of cellular automata and their innerworkings Section 3 defines a cellular automata templateand Section 4 provides explanations about the operationsapplicable to them Section 5 then presents examples oftemplate builder functions Section 6 discusses a sampleapplication of templates to find rules that share both totalityand captivity in extremely large CA spaces and Section 7closes the paper with some concluding remarks and ideas forfuture work

2 Cellular Automata

Cellular automata are dynamical decentralised systems gov-erned by simple local rules Given the relative simplicity ofCAs they serve as a good model to analyse how the inter-action among simple components can give rise to complexbehaviour in dynamical systems in particular how solutionsto 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 pre-determined local rule The lattice can be arranged in anynumber of dimensions and can have a finite or infinitenumber of cells From now on whenever a CA is mentionedwe always mean one-dimensional CAs (whose lattices arearranged as a line) each cell can take on a discrete state valueand the update is parallel at discrete time steps

A CArsquos cell state is usually represented by numbers inthe [0 119896 minus 1] interval or a colour from a set of 119896 colourspreviously defined The local rule of a CA acts on each cellrsquosneighbourhood which is a set composed of the cell itselftogether with its 2119903 adjacent cells with 119903 being the radiusof the rule that is the number of cells at each side Thefractional value 5 for 119903 indicates that the neighbourhood isasymmetric as in 119903 = 15 meaning that the center cell has 2neighbours onone side and 1 on the other (inCATemplates byconvention the left-hand side contains the larger number ofneighbours)

Table 1 Rule table for the elementary CA 184

(111) 1(110) 0(101) 1(100) 1(011) 1(010) 0(001) 0(000) 0

By defining a value for 119896 and 119903 a space (or family) ofCAs is established The elementary space is currently one ofthe most extensively studied CA families as it is composed ofonly 256 rules even though displaying a rich phenomenology[1]

The size of a CA space is a function of 119896 and 119903 Inthe one-dimensional case this means 119904(119896 119903) = 119896119896lfloor2119903+1rfloor As a consequence the increase of 119896 or 119903 quickly leads toexponentially large space sizes for instance the space ofbinary CAs with radius 2 is composed of 232 rules

Every CArsquos temporal evolution is governed by a local ruleThis local rule is usually represented as a rule table consistingof state transitions that point every possible neighbourhoodto an output state At every time step every cell in the latticeis updated according to its neighbourhood following its statetransition table

Since a rule table has to cover all possible neighborhoodsin the lattice it consists of 119896lfloor2119903+1rfloor state transitions orderedusingWolframrsquos lexicographic order in which the first transi-tion is the one corresponding to the neighbourhood formedonly by cells in the 119896minus1 state and the last one is the transitioncorresponding to the neighbourhood of zeros To illustratethe point the rule table for elementary CA 184 is shown inTable 1

It is possible to compress the rule table by using its 119896-aryrepresentation By discarding Table 1rsquos first column we areleft with the outputs of each transition (1 0 1 1 1 0 0 0)Since we are still following Wolramrsquos convention we canswitch freely between both representations If interpreted asa binary number this representation can be converted to itsdecimal form 184 which is referred to as the rule (Wolfram)number

The nature of the 119904(119896 119903) function represents a greatchallenge when searching for specific sets of CAs Oneof the employed strategies for this kind of search is torestrict these very large spaces into smaller ones using staticproperties of CAs The template framework described inthis paper aims to automate this process Static propertiesare those we can draw directly from the rule table insteadof looking at the temporal evolution This means that theydetermine specific ways a rule table should be built so thatthe resulting rule would possess them As will be detailedin Section 5 template builder functions use this idea inorder to create templates representing specific subsets of CAspaces

Complexity 3

3 Cellular Automata Templates

A cellular automaton template (referred to simply as tem-plate from here on) is a data structure that allows for therepresentation of a (potentially large) subset of a CArsquos familyin a compact manner

Template builder functions are defined as a means to cre-ate templates of interesting subsets of CAs usually followinga well defined static property derived from CArsquos rule tablesThey are explained in detail in Section 5

Two main operations are defined over templates Expan-sion and Intersection Expansion is used to convert a templateinto the rule set it represents and Intersection is applied totwo templates to generate a third representing the rule setof the resulting intersection Both operations are detailed inSection 4

The template concept was first described in [8 12] andhas gone through significant improvements since then Forinstance the templatersquos core essentially what was describedas the template itself in the original papers is now a part ofa tuple composed by important attributes as shown in thedefinition below

Also new template builder algorithms have been devel-oped the concept of expansion modifier functions has beenimplemented and the intersection operation at that timeimplicitly couched in terms of a superseded ldquocompositionrdquooperationmdashwhich was just a part of the original templatebuilder algorithms described in the original papersmdashhasbeen made explicit and evolved into a generalised operation

Furthermore the original work was totally restricted tobinary rules which no longer is the case the code wascompletely ad hoc (and therefore private to the authors) withno internal structure that would allow it to grow toward ausable and useful system beyond its original conception andonly two rule properties have been accounted for (additionalinformation about these two properties is given later in thepaper)

So in its origin there was a still immature but promis-ing idea that was conveyed at the time to two distinctaudiences the early technical details of the implementa-tion to Mathematica users [8] and the actual idea andits prospects as a short communication to the cellularautomata community [12] From then on the work devel-oped until reaching the required degree of maturation that itdeserved as embodied in the present report All the furtherdevelopments are now consolidated as a fully functionalopen-source implementation in the form of the CATem-plates package [10] within Wolfram Mathematica software[9]

Armed with this framework one can efficiently buildand manipulate templates as needed and avoid the expensiveenumeration of the sets they stand for until a template isobtained representing a small enough rule set

Definition 1 (template) A template is the tuple (119896 119903 119888 119890)where 119896 and 119903 are the number of states and the neighbour-hood radius respectively of the cellular automata rules of thespace that is being represented 119888 is the template core and 119890 isan expansion modifier function

The core is by far the most important part of a templateIt is essentially a rule table in 119896-ary form with a twistevery output of this rule table is allowed to be a function ofthe other outputs This is achieved by introducing variablessemantically bounded across all transitions of the classicalrule-table representation By means of the core a template isable to represent a set of CAs The following template (1198791) isan example

1198791 = (2 10 (0 1 minus 1199091 0 1 1199093 1 1199091 0) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903) (1)

The 119868119889119890119899119905119894119905119910119872119886119901119901119890119903 and other expansion modifier func-tions will be explained in more detail in Section 4

Remark In the CATemplates package 119896 119903 and 119890 may beomitted in which case the default values of 119896 = 2 119903 = 10and 119890 = 119868119889119890119899119905119894119905119910119872119886119901119901119890119903 are assumed similarly but forthe sake of simplicity from now on in this paper wheneverwe refer to a templatersquos core in isolation say 119888(1198791) thereader should assume the same previous default values for thecorresponding template (1198791)

We indicate the state transitions of the templatersquos coreby an index starting at 0 on the right-most position upto 119896lfloor2119903+1rfloor minus 1 on the left-most so as to mirror their cor-respondence to the neighborhoods they represent As suchwhenever 1198791rsquos transition 0 is mentioned we are referringto the first 0 that appears in 1198791rsquos core from right to leftTransition 1 refers to 1199091 and so on1198791rsquos transition 0 is a sample of a fixed output This meansany CA with a value different from 0 on its rule tablersquos firsttransitionmdashwhich is the same as the state transition (000)leading to 1mdashis not an element of the set represented by 11987911198791rsquos transition 1 is a sample of a free variable (1199091) Afree variable is assumed to represent any value in the range[0 119896minus1] As a convention free variables are indexed followingthe transition where they first appear Were we to consideronly1198791 rsquos first two transitions we could say it represents the set(0 0) (1 0) since the first transition is fixed and the secondis a free variable

Transition 6 is a sample of a function As 1198791 is a binarytemplate (since 119896 = 2) the expression 1 minus 1199091 means thistransition will always be evaluated to the opposite of the valueof transition 1 It is important to note that we could use anyalgebraic expression here potentially referring to any othervariable in the template and we would still be able to derivethe set this template represents This is actually done in sometemplate builder functions as will be seen in Section 5

It follows from the previous observations that 1198791 actuallycorresponds to the binary rule set (0 1 0 1 0 1 0 0) (0 10 1 1 1 0 0) (0 0 0 1 0 1 1 0) (0 0 0 1 1 1 1 0) whichcould also be written as 22 30 84 92 following Wolframrsquosnumbering convention

A template whose core is made of only free variables iscalled a Base Template and essentially represents the wholeCA space given by k and 119903 for instance the Base Template forthe elementary CAs is

(2 10 (1199097 1199096 1199095 1199094 1199093 1199092 1199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903) (2)

4 Complexity

Base templates are often used by template builder func-tions as a starting point

4 Template Operations

Currently templatesrsquo processing supports two operationsexpansion (119864) and intersection (119868) This section presentsdetails on how they work

41 Expansion Every template represents a set 119877 of 119896-aryrule tables This set is obtained by means of the expansionoperation

The 119894-th expansion of template119879 denoted as119864119894 (119879) beginswith the extraction of all variables present in the templatersquoscore in a total of 119898 variables For instance given thetemplatersquos core 119888(1198791) = (0 1minus1199091 0 1 1199093 1 1199091 0) the orderedlist of extracted variables would be (1199093 1199091) ordered by thevariablersquos index in decreasing order Next 119894 is converted tobase 119896 padded with zeros to the left up to achieving119898 digitsFor 119894 = 2 we would have the ordered list of digits (1 0) since10 is 2 in binary We then pair the extracted variables with thedigits in order and replace every occurrence of the variablewith the corresponding value like (0 1minus0 0 1 1 1 0 0) Anyalgebraic expression left in the core is then resolved resultingin 1198642(1198791) = (0 1 0 1 1 1 0 0)

With the process to find the 119894-th expansion defined itis only a matter of mapping it over every number in theinterval [0 119896119898 minus 1] and we have the set 119877 of CA rule tablesrepresented by the template This is how the full expansion119864(119879) is implemented

Still considering 1198791 since 119898 = 2 we only have 1198962 =4 possible expansions for this template By performing theexpansion procedure with 119894 isin 0 1 2 3 we end upwith the set 119877 = (0 1 0 1 0 1 0 0) (0 1 0 1 1 1 0 0)(0 0 0 1 0 1 1 0) (0 0 0 1 1 1 1 0)

Upon expansion templates can generate invalid resultsfor instance let us consider the templatersquos core 119888(119879119894119899V119886119897119894119889) =(0 0 0 0 2 minus 1199093 1 1 1)

Since 119898 = 1 and 119896 = 2 this template has 2 possibleexpansions namely 119864(119879119894119899V119886119897119894119889) = (0 0 0 0 2 1 1 1) (0 00 0 1 1 1 1) however the set contains an invalid statetransition as it leads to the 2-state which is not in the [0 119896minus1]range

Expansion modifier functions can be used as a mecha-nism by which the template provides auxiliary informationfor the expansion operation in terms of some details it shouldabide by

Every template has at least one expansion modifierfunction defined Whenever the expansion operation isperformed on the 119894-th expansion its result is passed on to thetemplatersquos expansion modifier function which is defined bythe template builder function

This means that every template itself is able to definespecific behaviours to the expansion operation deciding howto deal with unwanted results

Expansion modifier functions are currently divided intotwo categories Mappers and Filters

411 Mappers A Mapper is a function that receives the i-thexpansion result and performs some kind of transformationon it So far we have identified the need for two expansionmodifier functions of the Mapper kind ModKMapper andIdentityMapper

(i) IdentityMapper simply receives the expansion andleaves it untouched

(ii) ModKMapper performs the 119898119900119889119906119897119906119904 operation oneach transition of the expansion result using the tem-platersquos 119896 as divisor thus obtaining a valid expansion

As an example of the latter let us define 119879119898119900119889119896 as avariation of 119879119894119899V119886119897119894119889 that uses ModKMapper instead of theIdentityMapper

119879119898119900119889119896= (2 10 (0 0 0 0 2 minus 1199093 1 1 1) 119872119900119889119870119872119886119901119901119890119903) (3)

Now the result of expanding 119879119898119900119889119896 becomes

119864 (119879119898119900119889119896) = (0 0 0 0 0 1 1 1) (0 0 0 0 1 1 1 1) (4)

412 Filters A Filter is a function that checks the expansionresult and decides whether it is an acceptable result forthe given template If it finds an unacceptable expansioncandidate it filters out this result by removing it from theset 119877 So far we have identified the need for two expansionmodifier functions of the Filter kind FilterKOutOfRange andFilterVariableAssignments

(i) FilterKOutOfRange simply removes any invalidexpansion For instance by defining 119879119891119894119897119905119890119903119870 as avariation of 119879119894119899V119886119897119894119889 that uses FilterKOutOfRangeinstead of the IdentityMapper and this results in119864(119879119891119894119897119905119890119903119870) = (0 0 0 0 1 1 1 1)

(ii) FilterVariableAssignments serves a different kind ofneed It allows for templates to define annotations onits corersquos variables which dictate the values from the[0 119896 minus 1] range the variable is allowed to have

The annotation referred to in FilterVariableAssignmentsis expressed with a special syntax on the templatersquos coreConsider the following template 119879V119886 and its 119894 = 0 expansion

119879V119886 = (2 10 (0 0 0 0 1199093 isin 1 1 1 1) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (5)

The process should result in the expansion candidate (0 00 0 0 isin 1 1 1 1) But since 0 isin 1 is false FilterVariable-Assignments detects this as unacceptable and removes it from119877

In the binary case FilterVariableAssignments is seldomneeded since the expression 119909119891119903119890119890 isin 0 1 is equivalentto a free variable 119909119891119903119890119890 and the expression 119909119891119894119909119890119889 isin 0 isequivalent to the fixed value 0

Therefore this expansionmodifier function becomes use-ful when 119896 gt 2 for various reasons For further clarificationSection 52 discusses an application of this filter

Complexity 5

42 Intersection Template intersection is a function of twotemplates which results in a template whose associated set 119877is equivalent to intersecting the 119877 sets of the two templatesreceived as arguments In another form

119868 (1198791 1198792) = 1198793 lArr997904 119864 (1198793) = 119864 (1198791) cap 119864 (1198792) (6)

Template intersection initially consists of building anequation system with the templatersquos cores received asoperands The equation system is then submitted to Mathe-maticarsquos Solve function [9] which solves it for the variablesthat admit a solution and elicits the relations among theremaining variables The resulting set of variable values andrelations is then applied to any of the two operands and theoutcome is a new template representing only the intersectionbetween both of the input templates

If the system has no solution this means both templatesrepresent disjoint 119877 sets and by definition do not intersect

As an example consider the template cores 119888(1198791) =(1199097 0 1199095 0 1 0 1199092 1199090) and 119888(1198792) = (1 0 1 minus 1199091 1 minus1199093 1199093 0 1199091 0)The associated equation system thus becomes

1199097 = 10 = 01199095 = 1 minus 11990910 = 1 minus 11990931 = 11990930 = 01199091 = 11990911199090 = 0

(7)

The solution set of the equation system as given by Math-ematicarsquos Solve is 119878 = 1199090 = 0 1199093 = 1 1199092 = 1199091 1199095 =1 minus 1199091 1199097 = 1 We can then substitute the variablesin 119888(1198791) using this set thus rendering the templatersquos core(1 0 1 minus 1199091 0 1 0 1199091 0) Notice that the same result wouldbe achieved had we applied the substitutions to 119888(1198792)

If a templatersquos core has variable restrictions a second stepis needed to guarantee that the solution found will not violatethem

For instance consider the templatesrsquo cores 119888(1198791199031) and119888(1198791199031) both with restricted variables 119888(1198791199031) = (1199097 0 1199095 0 10 1199092 isin 0 1 1199090) and 119888(1198791199032) = (1 0 1 minus 1199091 1 minus 1199093 1199093 0 1199091 isin0 0) To intersect 1198791199031 and 1198791199032 we first extract the variablerestriction expressions and then build and solve the systemas usual This time however the substitutions are appliedto both arguments therefore resulting in the set (1 0 1 minus1199091 0 1 0 1199091 isin 0 1 0) (1 0 1 minus 1199091 0 1 0 1199091 isin 0 0)

Now we extract variable restriction expressions andcreate a second equation system whose solutions indicatewhich values the variables may have In the example the setof expressions 1199091 isin 0 1 1199091 isin 0 would be extracted thusyielding the equation system

1199091 = 1 or 1199091 = 01199091 = 0 (8)

By solving this system the solution set 119878 = 1199091 = 0 canfinally be applied to 119888(1198791199031) yielding (1 0 1 0 1 0 0 0) as theresult

5 Template Builders

So far we have seen how templates can be built in orderto represent specific subsets of CA families We can nowgo about making evident the true power of templates byconsidering template builder functions

Template builder functions are algorithms tailored togenerate templates for specific subsets of CAs that share agiven static property

Currently six template builders for static properties areimplemented associated to rules of the following kindscaptive totalistic outer-totalistic number conserving col-orblind and maximum internal symmetry values (see [1])for reflection conjugacy and their composition The lattertwo are not discussed herein partly because we have alreadydiscussed them previously (see [8]) and at least in thecontext number conservation the corresponding templatebuilder simply did not change since its conception Howeverthe builder for rule table symmetries has undergone ageneralisation that now allows for any value of symmetry tobe accounted for not only maximum As such the CATem-plates package contains the SymmetryTemplate builder fullyavailable for use including its corresponding documentationbut we decided not to include it in the paper because itcannot yet handle arbitrary number of states in the case ofconjugation

So this section discusses builder functions for totalisticouter-totalistic captive and colorblind templates

51 Template Builder for Totalistic and Outer-Totalistic CAs

Definition 2 (totality) A totalistic CAmdashor alternatively aCA that presents the totality propertymdashis one whose statetransitions only depend on the sum of the state values of thecells in a given neighbourhood

Formally let 119891 be the local transition function of a CAdefined over the set119873 of possible neighborhoods for the CArsquosspace Let 119899 be the size of a neighbourhood of 119873 Let 119860 =(1205721 120572119899) and 119861 = (1205731 120573119899) be neighborhoods of 119873 ACA is said to be totalistic if and only if the following conditionis true

forall119860 119861 isin 119873( 119899sum119894=1

120572119894 = 119899sum119895=1

120573119895) lArrrArr (119891 (119860) = 119891 (119861)) (9)

Since totality is a static property we can derive a generalalgorithm to find all rule tables of CAs that share the totalityproperty given a value for 119896 and 119903

6 Complexity

The algorithm receives as arguments the values of 119896 and119903 for which the template will be generated It then proceedsto enumerate all possible neighborhoods of the defined spaceand calculates their sum

Now for every sum value found in the previous step thealgorithm picks the neighbourhood representing the smallest119896-ary number and assigns a variable corresponding to thatneighbourhoodrsquos decimal value to all of the state transitionsthat shared a result with it For instance let us considerall neighborhoods of the elementary space whose statessum equals 2 (1 1 0) (1 0 1) (0 1 1) Since the smallestneighbourhood in this set is (0 1 1) which is decimal 3 weassign to their respective transitions the result 1199093

The templatersquos core for the elementary space becomes

119888 (119879119905119900119905119886119897119894119904119905119894119888119864119878) = (1199097 1199093 1199093 1199091 1199093 1199091 1199091 1199090) (10)

Upon expansion this template yields the rule tables ofthe 16 totalistic elementary CAs Notice that this templatersquoscore is composed of only free variables and references toother free variables This being the case every expansionof this template shall yield a valid result excluding theneed to define any expansion modifier function other than119868119889119890119899119905119894119905119910119872119886119901119901119890119903

For 119896 = 3 and 119903 = 1 the resulting template would be

11987911990511990011990531 = (3 10 (11990926 11990917 1199098 11990917 1199098 1199095 1199098 1199095 1199092 11990917 11990981199095 1199098 1199095 1199092 1199095 1199092 1199091 1199098 1199095 1199092 1199095 1199092 1199091 1199092 1199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903)

(11)

Upon expansion this template yields the 2187 totalisticrules of the referred space

Definition 3 (outer-totality) An outer-totalistic CAmdashor al-ternatively a CA that presents the outer-totality propertymdashis one whose local rule considers the sum of the state valuesof the external cells of a neighbourhood (ie those except thecenter cell) in addition to the state value of the center cellitself

Formally let 119891 be the local transition function of a CAdefined over the set119873 of possible neighborhoods for the CArsquosspace Let 119899 be the size of a neighbourhood of 119873 and let119898 = lceil1198992rceil be the index of the cell that is meant to undergoa state change (ie the center cell when 119899 is an odd number)Let 119860 = (1205721 120572119898 120572119899) and 119861 = (1205731 120573119898 120573119899) beneighborhoods of119873 A CA is said to be outer-totalistic if andonly if the following condition is true

forall119860 119861 isin 119873((119898minus1sum119894=1

120572119894 + 119899sum119894=119898+1

120572119894 = 119898minus1sum119895=1

120573119895 + 119899sum119895=119898+1

120573119895)

and (120572119898 = 120573119898)) lArrrArr (119891 (119860) = 119891 (119861)) (12)

The algorithm for outer-totalistic templates is almost thesame as the one for totalistic rules with the exception that

it considers the sum of external cells in the neighbourhoodinstead of its entirety

The algorithmrsquos output for the elementary space is

119888 (119879119900119906119905119890119903minus119905119900119905119886119897119894119904119905119894119888119864119878) = (1199097 1199093 1199095 1199091 1199093 1199092 1199091 1199090) (13)

Upon expansion this template generates the 64 outer-totalistic elementary CAs

For reference here is the result for 119896 = 3 and 119903 = 1whichafter expansion would yield the 14 348 907 outer-totalisticrules of the space since 15 distinct variables are present inthe template

119879119900119906119905119890119903minus11990511990011990531 = (3 10 (11990926 11990917 1199098 x23 11990914 1199095 11990920 11990911 119909211990917 1199098 1199097 11990914 1199095 1199094 11990911 1199092 1199091 1199098 1199097 1199096 1199095 1199094 1199093 11990921199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903)

(14)

52 Template Builder for Captive CAs

Definition 4 (captivity [13]) A CA is said to be captivemdashoralternatively to have the captivity static propertymdashwhenevery transition of its rule table outputs a state that appearsin the corresponding neighbourhood

Formally if 119891 is the local transition function of a CA119860 =(1205721 120572119898 120572119899) is a neighbourhood of size 119899 out of allpossible neighborhoods 119873 and 120573 is an arbitrary state a CAis said to be captive if and only if the following condition istrue

forall119860 isin 119873119891 (1205721 120572119899) = 120573 lArrrArr 120573 isin 1205721 120572119899 (15)

In the binary case this naturally simplifies to the fact thatevery CA with 119891(01 02 0119899) = 0 and 119891(11 12 1119899) = 1is captive for any radius 119903

As a static property a general algorithm to find templatesof captive CAs for a given space does exist As such thealgorithm receives the values for 119896 and 119903 and starts bygenerating all possible neighborhoods for the space

It then uses the following simple rules to decide how totransform this neighbourhood in a template output

(i) If the neighbourhood is homogeneous like (1 1 1)the transition should output the only state thatappears in the neighbourhood (1)

(ii) If the neighbourhood is composed of all of the valuesin the interval [0 119896 minus 1] like (1 2 0) for 119896 = 3 and119903 = 1 the transition should output a free variableindexed by the decimal value of the neighbourhoodnamely 11990915 (since 120 in base 119896 = 3 corresponds tothe decimal 15)

(iii) If the neighbourhood is composed of only some of thepossible states the states of the interval [0 119896 minus 1] like(0 2 0) for 119896 = 3 and 119903 = 1 the output should bea variable indexed by the neighbourhood this timerestricted by the present values (1199096 isin 0 2)This typeof neighbourhood only appears when 119896 gt 2

Complexity 7

Note that since this template uses restricted variables itmust use the 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904 expansion modifierfunction

As a result of all the latter the captivity template for theelementary space becomes

119879119888119886119901119905119894V119890 = (2 10 (1 1199096 1199095 1199094 1199093 1199092 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (16)

while for 119896 = 3 and 119903 = 1 the template is

119879119888119886119901119905119894V11989031 = (3 10 (2 11990925 isin 1 2 11990924 isin 0 2 11990923isin 1 2 11990922 isin 1 2 11990921 11990920 isin 0 2 11990919 11990918isin 0 2 11990917 isin 1 2 11990916 isin 1 2 11990915 11990914isin 1 2 1 11990912 isin 0 1 11990911 11990910 isin 0 1 1199099isin 0 1 1199098 isin 0 2 1199097 1199096 isin 0 2 1199095 1199094isin 0 1 1199093 isin 0 1 1199092 isin 0 2 1199091 isin 0 1 0) 119865119894119897119905119890119903119873119900119905119860119897119897119900119908119890119889)

(17)

53 Template Builder for Colorblind CAs In order to fullygrasp the notion of colorblind rules let us first discuss themeaning of permutations in the context of CAs

Definition 5 (colour permutation (120587)) Let framework 119870 bethe set of possible states for a CA in the range [0 119896 minus 1] Acolour permutation 120587 is a bijective function of 119870 to itselfwhich can be written as a set of rules of the form 119896119894 997888rarr 119896119895meaning that a cell in state 119896119894 should be switched to state 119896119895when this permutation is applied

For instance a valid permutation for the case where 119870 =0 1 2 is 1205871 = 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0It is important to notice that every colour permutation

can be represented by an algebraic function that interpolatesthe points defined by the permutation For instance 1205871 couldbe written as 1205871(119909) = 1 + (1 minus 32(minus1 + 119909))119909Definition 6 (symmetric group (119878119870)) The symmetric group119878119870 of a set119870 is the set of all possible permutations over 119870

For instance the symmetric group for119870 = 0 1 2 is119878119870 = 0 997888rarr 0 1 997888rarr 1 2 997888rarr 2

0 997888rarr 0 1 997888rarr 2 2 997888rarr 1 0 997888rarr 1 1 997888rarr 0 2 997888rarr 2 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0 0 997888rarr 2 1 997888rarr 0 2 997888rarr 1 0 997888rarr 2 1 997888rarr 1 2 997888rarr 0

(18)

Definition 7 (neighbourhood permutation (120588(120587))) Let120587 be acolour permutation and let119873 be the set of all possible neigh-borhoods for a given CA The neighbourhood permutation

120588(120587) is a permutation 119873 that uses 120587 to transform 119899119894 isin 119873 intoneighbourhood 119899119895 isin 119873 by applying 120587 to every cell of 119899119894

For instance with119870 = 0 1 2 119903 = 1 and 1205871 = (0 1 2)a valid transformation due to 120588(1205871) would be (0 2 2) 997888rarr(1 0 0) The other transformations can be derived by apply-ing the same reasoning to all of the neighborhoods of119873

Definition 8 (cycle notation of a permutation) A permuta-tion can be written by means of a cycle notation formedby a set of vectors that represent cycles associated with thepermutation

For instance the colour permutation 1205872 = 0 997888rarr 1 1 997888rarr0 2 997888rarr 2 can be written as 1205872 = (0 1) (2) whereeach vector has the form (1199091198941 1199091198942 119909119894119895) 1 le 119895 le 119896 andrepresents a cycle due to the permutation namely the two-step cycle 0 997888rarr 1 997888rarr 0 and the self-loop 2 997888rarr 2Similarly The previous 1205871 permutation would be written incycle notation as 1205871 = (0 1 2)

As for neighbourhood permutations 120588(1205871) for examplewould be represented as follows

120588 (1205871) = ((0 2 2) (1 0 0) (2 1 1)) ((0 2 1) (1 0 2) (2 1 0)) ((0 2 0) (1 0 1) (2 1 2)) ((0 1 2) (1 2 0) (2 0 1)) ((0 1 1) (1 2 2) (2 0 0)) ((0 1 0) (1 2 1) (2 0 2)) ((0 0 2) (1 1 0) (2 2 1)) ((0 0 1) (1 1 2) (2 2 0)) ((0 0 0) (1 1 1) (2 2 2))

(19)

With the previous characterisations we can now define colorblindness

Definition 9 (color blindness [14]) A CA whose cells can bein any of the states of the set 119870 is said to be colorblindmdashoralternatively to possess the color blindness propertymdashif itsspace-time evolution does not change unless by a colourchange after applying any neighbourhood permutation120588(120587) 120587 isin 119878119870 to all state transitions that define its rule table

Notice that for a CA to be invariant to 120588(1205871) its ruletablersquos outputs 119900119894 should be consistent with the cycles formedby the application of 120588(1205871) over its neighborhoods 119887119894 119894 beingthe index of the state transition on the CArsquos rule table

In other words for a rule to be invariant to 1205871 theoutput of say neighbourhood (0 2 2) should be equal tothe application of 1205871 to the output of neighbourhood (1 0 0)since (0 2 2) is transformed into (1 0 0) due to 1205871 for thesame reason the output of (1 0 0) should be equal to theapplication of1205871 to the output of neighbourhood (2 1 1)Thesame happens analogously for the remaining cycles of 120588(1205871)

8 Complexity

Now in order to generate a template representing CAsthat are invariant to the neighbourhood permutation 120588(1205871)we need to assign an output to every neighbourhood andderive a rule table that could be turned into a template

So that outputs follow 120588(1205871) we use its cycle notationrepresentation to assign to every cycle start a free variableindexed by its corresponding neighbourhoodrsquos decimal rep-resentation ending upwith a tuple formed by neighbourhoodand output The (0 2 2) neighbourhood being a cycle startis turned into the tuple ((0 2 2) 1199098) for instance

For every remaining neighbourhood in a cycle we nowapply 1205871 to the free variable found in the previous step 119889times 119889 being the distance from this neighbourhood tothe start of the cycle The cycle ((0 2 2) (1 0 0) (2 1 1))is turned into (((0 2 2) 1199098) ((1 0 0) 1205871(1199098)) ((2 1 1)1205871(1205871(1199098)))) for instance

Applying this procedure to every cycle of 1205871 we obtainthe set(((0 2 2) 1199098) ((1 0 0) 1205871 (1199098))

((2 1 1) 120587 (1205871 (1199098)))) (((0 2 1) 1199097) ((1 0 2) 1205871 (1199097)) ((2 1 0) 120587 (1205871 (1199097)))) (((0 2 0) 1199096) ((1 0 1) 1205871 (1199096)) ((2 1 2) 120587 (1205871 (1199096)))) (((0 1 2) 1199095) ((1 2 0) 1205871 (1199095)) ((2 0 1) 120587 (1205871 (1199095)))) (((0 1 1) 1199094) ((1 2 2) 1205871 (1199094)) ((2 0 0) 120587 (1205871 (1199094)))) (((0 1 0) 1199093) ((1 2 1) 1205871 (1199093)) ((2 0 2) 120587 (1205871 (1199093)))) (((0 0 2) 1199092) ((1 1 0) 1205871 (1199092)) ((2 2 1) 120587 (1205871 (1199092)))) (((0 0 1) 1199091) ((1 1 2) 1205871 (1199091)) ((2 2 0) 120587 (1205871 (1199091)))) (((0 0 0) 1199090) ((1 1 1) 1205871 (1199090)) ((2 2 2) 120587 (1205871 (1199090))))

(20)

We can now flatten a level of this set and turn it into anordered list sorted lexicographically by neighbourhood Thisprocedure yields the rule table shown in Table 2

The core of a template for CAs invariant to 120588(1205871) can nowbe found by compressing this rule table into its 119896-ary form

119879120588(1205871) = (120587 (1205871 (1199090)) 120587 (1205871 (1199092)) 120587 (1205871 (1199091)) 120587 (1205871 (1199096)) 120587 (1205871 (1199098)) 120587 (1205871 (1199097)) 120587 (1205871 (1199093)) 120587 (1205871 (1199095)) 120587 (1205871 (1199094)) 1205871 (1199094) 1205871 (1199093) 1205871 (1199095) 1205871 (1199091) 1205871 (1199090) 1205871 (1199092) 1205871 (1199097) 1205871 (1199096) 1205871 (1199098) 11990981199097 1199096 1199095 1199094 1199093 1199092 1199091 1199090))

(21)

Remember from Definition 5 that any permutation 120587 canbe represented by an algebraic function which is the actual

Table 2 Rule table for the template representative of CAs invariantto 1205871(2 2 2) 120587(1205871(1199090)(2 2 1) 120587(1205871(1199092)(2 2 0) 120587(1205871(1199091)(2 1 2) 120587(1205871(1199096)(2 1 1) 120587(1205871(1199098)(2 1 0) 120587(1205871(1199097)(2 0 2) 120587(1205871(1199093)(2 0 1) 120587(1205871(1199095)(2 0 0) 120587(1205871(1199094)(1 2 2) 1205871(1199094)(1 2 1) 1205871(1199093)(1 2 0) 1205871(1199095)(1 1 2) 1205871(1199091)(1 1 1) 1205871(1199090)(1 1 0) 1205871(1199092)(1 0 2) 1205871(1199097)(1 0 1) 1205871(1199096)(1 0 0) 1205871(1199098)(0 2 2) 1199098(0 2 1) 1199097(0 2 0) 1199096(0 1 2) 1199095(0 1 1) 1199094(0 1 0) 1199093(0 0 2) 1199092(0 0 1) 1199091(0 0 0) 1199090

representation used by the algorithm We use the 120587 nota-tion here since it is compact and serves the explanationrsquospurpose

The same procedure can now be repeated for every per-mutation of the 119878119896 set essentially mapping each permutationof the set to a corresponding template of CAs invariant to thatpermutation It is now only a matter of intersecting all of thetemplates found and the result is a template that representsall colorblind rules of the space defined by 119896 and 119903

When applied to 119896 = 2 and 119903 = 1 we obtain119879119888119900119897119900119906119903119887119897119894119899119889

= (1 minus 1199090 1 minus 1199091 1 minus 1199092 1 minus 1199093 1199093 1199092 1199091 1199090) (22)

whereas for 119896 = 3 and 119903 = 1 the result becomes

11987911988811990011989711990011990611990311988711989711989411989911988931 = (2 2 minus 1199091 2 minus 21199091 2 minus 1199093 2 minus 1199094 2minus 1199095 2 minus 2 1199093 2 minus 21199095 2 minus 21199094 1 minus 21199094 1 minus 21199093 1minus 21199095 1 minus 21199091 1 1 + 21199091 1 + 21199095 1 + 21199093 1+ 21199094 21199094 21199095 21199093 1199095 1199094 1199093 21199091 1199091 0)

(23)

Complexity 9

6 A Detailed Example

Here we discuss a detailed application for the templateframework presented in this paper which is to find the rulesthat share a set of static properties This can be achieved withthe template builder functions provided with CATemplatesor one could implement custom builder functions on top ofthe core concepts provided by the package What follows isa sample of how the framework can be used to conduct anexperiment of this sort

More specifically let us suppose we are interested in therules which are both totalistic and captive This might comefrom a purely theoretical interest or motivated by the needfor obtaining rules of this type for some practical application

We then start by building the templates for totalisticand captive rules of the elementary space as shown in theprevious sections (119879119905119900119905119886119897119894119904119905119894119888 and 119879119888119886119901119905119894V119890) By performing theirintersection we end up with a template representing alltotalistic and captive rules of the elementary space as follows

11987911989621199031 = (2 10 (1 1199093 1199093 1199091 1199093 1199091 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (24)

Upon expansion this template yields the 4 totalisticelementary CAs which are also captive 128 150 232 254Notice that the template being expanded has only 2 variableswhichmeans the expansion has to consider only 4 expansioncandidates which is a substantially smaller subset of theoriginal space which has 256 rules

Since the elementary space is a small one let us performthe same example in larger spaces We can generate theequivalent templates for the space defined by 119896 = 3 and 119903 = 1and perform the intersection between them The result is

11987911989631199031 = (3 10 (2 11990917 isin 1 2 2 11990917isin 1 2 2 1 2 1 0 11990917 isin 1 2 2 1 2 1 0 1 0 1199091isin 0 1 2 1 0 1 0 1199091 isin 0 1 0 1199091 isin 0 1 0)FilterVariableAssignments)

(25)

Notice that this template also has two variables 1199091 and11990917 This means there are only 32 = 9 possible expansions forthis template from which some will be filtered out becauseof the variable assignment annotations After expansion thistemplate yields the 4 totalistic rules of the spacewhich are alsocaptive 223160992 223161514 265235104 265235626

This means that we took a space with 327 = 7 625 597484 987 rules and found out that only 4 of those sharethe totality and captivity properties all without actuallyenumerating the whole space (which would be not feasiblegiven its size) Notice that this space could be further reducedby intersecting this resulting template with templates fromother properties like color blindness

Extending the previous case we may now ask the generalquestion of up to which rule space size could we still manageto get access to totalistic and captive rulesWithout templatesthe rules would have to be obtained directly by scanningthe rule space and selecting those having the two properties

But with 119896 = 3 this approach would already be impracticaleven for 119903 = 1 on a standard personal computer since thespace has ≃ 76 times 1012 rules A first alternative now usingtemplates could be accessing the rules say by first expandingthe totalistic rules directly from the corresponding templateand then filtering out the captive ones This certainly helpsIn fact by doing so progressively starting with radius 119903 = 05and increasing its value in steps of 05 in a standard personalcomputer it would hardly be possible to reach beyond 119903 = 2(which corresponds to a space with ≃ 87 times 10115 rules)because of the substantial increase in computational timeas we would go from a given 119903 to its subsequent valueWe omit actual values of processing time here as this maystrongly vary among different machine architectures andtheir software environment

However by relying on the generation of the individualtemplates of each property and expanding the intersectionbetween them we easily access spaces up to 119903 = 4 (possiblyeven beyond) which contains ≃ 15times109391 rules It turns outthat in this space only 256 rules share the two properties anextremely smaller space to reason about

Furthermore the analysis of all the data generated fromthe previous experiment suggests that the number of ruleswith 119896 = 3 and the shared properties of totality andcaptivity seems to be given by 4119903 for symmetric rules (thosewith integer radius) whereas no rule would be present forasymmetric rules This is quite a remarkable general resultderived from direct probing of the corresponding rule spacesthat the full usage of templates allowed us

As a final note it is worth emphasising that templateexpansion is only made when the actual rules representedin a template are needed which is at the end of the processof answering which rules satisfy a given set of propertiesUntil then it suffices to operate directly with the tem-plates this is where the conciseness of template usage liesAnd although expansion may be computationally intensiveit is certainly much less than if the entire correspond-ing spaces would have to be manipulated directly all theway

7 Concluding Remarks

Searching for cellular automata with specific behaviours(such as global problem solvers) is a daunting task for anyonelooking further than the elementary space

In this paper we presented the current state of cellularautomata templates a valuable ally in this front We havedescribed what templates are and how the two currentlyimplemented operations (expansion and intersection) workwent into details of the implementations of template builderfunctions for captive totalistic outer-totalistic and color-blind rules and have shown a sample application of theframework established here

The sample application has led us to the discovery thatonly a handful of CAs share both of the properties of totalityand captivity (only 64 rules on the 119896 = 3 119903 = 3 spacefor instance) This little experiment shows how the proposedframework can be used as a means to sieve through very largespaceswhen searching forCAs that present a given behaviour

10 Complexity

As mentioned in distinct parts of the text the notionof templates and the implementation of the computationalsystem to support it underwent a long way since its originup to its current degree of structural maturity

The natural course from here is to develop new templatebuilders and whichever other operations we might conceiveMore concretely with respect to the latter we should say thatduring the last couple of years we have been investigating thenotion of ldquodifferencerdquo between templates an operationwhoseoutput would yield another template representing the rulesthat have the property associated with the first template butnot having the property associated with the second In spiteof a conference publication we have on the topic (see [15]) itis not yet mature to go into the publicly available package Butin due time we intend to do so

As for new template builders a generalisation of oneto handle arbitrary values of symmetry by conjugation ismore pressing As mentioned earlier we decided not toinclude this template builder mostly because the existing onecannot yet handle arbitrary number of states in the caseof conjugation However noticing that the notion of colorblindness is essentially the notion of rules with maximumsymmetry by conjugation generalised for any 119896-state ruleusing the same idea implemented for color blindness it isnow possible to face the generalisation of arbitrary values ofsymmetry by conjugation This is clearly future work to bedone

Also it is tempting to add completely new templatebuilders to the present package referring to other parameterslike those in [16] In fact we hope that this paper triggerscollaborative participation from the cellular automata com-munity in terms of both the systemrsquos expansion and its usein applications This is why we decided to keep the work inGitHub publicly available

As for the possibility of extending the framework tosupport rules in higher dimensions we would say this wouldbe readily possible for all current properties but one numberconservation This is due to the fact that the underlyingalgorithm we used to implement the corresponding tem-plate builder comes from [17] which is restricted to one-dimensional rules In order to change that a general algo-rithm would have to be used quite likely the one describedin [18]This is certainly feasible and desirable but we had notyet had the opportunity to go about that

Data Availability

The data used to support the findings of this study are avail-able from the corresponding author upon request and theCATemplates Mathematica package directly from GitHub[10]

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

The authors are grateful to financial support fromIPM (Instituto Presbiteriano Mackenzie) and CAPES

(Coordenacao de Aperfeicoamento de Pessoal de NıvelSuperior Brazil) by means of STIC-AmSud (CoDANet)project no 888811974562018-01 and PrInt project no 888873102812018-00

References

[1] S Wolfram A New Kind of Science WolframMedia Inc 2002[2] J L Zapotecatl D A Rosenblueth and C Gershenson ldquoDelib-

erative self-organizing traffic lights with elementary cellularautomatardquo Complexity vol 2017 Article ID 7691370 15 pages2017

[3] D Wolz and P P B de Oliveira ldquoVery effective evolutionarytechniques for searching cellular automata rule spacesrdquo Journalof Cellular Automata vol 3 no 4 pp 289ndash312 2008

[4] I Barragan-Vite J C Seck-Tuoh-MoraN Hernandez-RomeroJMedina-Marin and E S Hernandez-Gress ldquoDistributed con-trol of a manufacturing system with one-dimensional cellularautomatardquo Complexity vol 2018 Article ID 7235105 15 pages2018

[5] J Yang W Liu Y Li X Li and Q Ge ldquoSimulating intraurbanland use dynamics under multiple scenarios based on fuzzycellular automata a case study of Jinzhou District DalianrdquoComplexity vol 2018 Article ID 7202985 17 pages 2018

[6] H Betel P P B De Oliveira and P Flocchini ldquoSolving theparity problem in one-dimensional cellular automatardquo NaturalComputing vol 12 no 3 pp 323ndash337 2013

[7] M Bidlo ldquoOn routine evolution of complex cellular automatardquoIEEE Transactions on Evolutionary Computation vol 20 no 5pp 742ndash754 2016

[8] P de Oliveira andMVerardo ldquoRepresenting families of cellularautomata rulesrdquoThe Mathematica Journal vol 16 no 8 2014

[9] Wolfram Research ldquoWolfram mathematica 11rdquo httpwwwwolframcommathematica 2018

[10] M Verardo and P P B de Oliveira ldquoCATemplatesrdquo httpsgithubcommverardoCATemplates 2019

[11] P P B de Oliveira ldquoOn density determination with cellularautomata Results constructions and directionsrdquo Journal ofCellular Automata vol 9 no 5-6 pp 357ndash385 2014

[12] P P B de Oliveira andMVerardo ldquoTemplate based representa-tion of cellular automata rulesrdquo inProceedings of the ExploratoryPapers - AUTOMATA 2014 - 20th International Workshop onCellular Automata and Discrete Complex Systems T IsokawaK Imai N Matsiu F Peper and H Umeo Eds pp 199ndash2042014

[13] G Theyssier ldquoCaptive cellular automatardquo in MathematicalFoundations of Computer Science vol 3153 of Lecture Notes inComputer Science pp 427ndash438 2004

[14] V Salo and I Torma ldquoColor blind cellular automatardquo inCellularAutomata and Discrete Complex Systems J Kari M Kutrib andAMalcher Eds pp 139ndash154 SpringerHeidelberg Berlin 2013

[15] Z Soares M Verardo and P P de Oliveira ldquoThe differenceoperation between templates of binary cellular automatardquo inNew Advances in Information Systems and Technologies ARocha A M Correia H Adeli L P Reis and M M TeixeiraEds vol 444 of Advances in Intelligent Systems and Computingpp 707ndash715 Springer International Publishing Cham Swizer-land 2016

Complexity 11

[16] G M Oliveira P P Oliveira and N Omar ldquoDefinitionand application of a five-parameter characterization of one-dimensional cellular automata rule spacerdquo Artificial Life vol 7no 3 pp 277ndash301 2001

[17] N Boccara and H Fuks ldquoNumber-conserving cellular automa-ton rulesrdquo Fundamenta Informaticae vol 52 no 1-3 pp 1ndash132002

[18] B Durand E Formenti and Z Roka ldquoNumber-conservingcellular automata I decidabilityrdquoTheoretical Computer Sciencevol 299 no 1-3 pp 523ndash535 2003

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 3: A Fully Operational Framework for Handling Cellular ...downloads.hindawi.com/journals/complexity/2019/6573793.pdf · is a brief overview of cellular automata and their inner workings,

Complexity 3

3 Cellular Automata Templates

A cellular automaton template (referred to simply as tem-plate from here on) is a data structure that allows for therepresentation of a (potentially large) subset of a CArsquos familyin a compact manner

Template builder functions are defined as a means to cre-ate templates of interesting subsets of CAs usually followinga well defined static property derived from CArsquos rule tablesThey are explained in detail in Section 5

Two main operations are defined over templates Expan-sion and Intersection Expansion is used to convert a templateinto the rule set it represents and Intersection is applied totwo templates to generate a third representing the rule setof the resulting intersection Both operations are detailed inSection 4

The template concept was first described in [8 12] andhas gone through significant improvements since then Forinstance the templatersquos core essentially what was describedas the template itself in the original papers is now a part ofa tuple composed by important attributes as shown in thedefinition below

Also new template builder algorithms have been devel-oped the concept of expansion modifier functions has beenimplemented and the intersection operation at that timeimplicitly couched in terms of a superseded ldquocompositionrdquooperationmdashwhich was just a part of the original templatebuilder algorithms described in the original papersmdashhasbeen made explicit and evolved into a generalised operation

Furthermore the original work was totally restricted tobinary rules which no longer is the case the code wascompletely ad hoc (and therefore private to the authors) withno internal structure that would allow it to grow toward ausable and useful system beyond its original conception andonly two rule properties have been accounted for (additionalinformation about these two properties is given later in thepaper)

So in its origin there was a still immature but promis-ing idea that was conveyed at the time to two distinctaudiences the early technical details of the implementa-tion to Mathematica users [8] and the actual idea andits prospects as a short communication to the cellularautomata community [12] From then on the work devel-oped until reaching the required degree of maturation that itdeserved as embodied in the present report All the furtherdevelopments are now consolidated as a fully functionalopen-source implementation in the form of the CATem-plates package [10] within Wolfram Mathematica software[9]

Armed with this framework one can efficiently buildand manipulate templates as needed and avoid the expensiveenumeration of the sets they stand for until a template isobtained representing a small enough rule set

Definition 1 (template) A template is the tuple (119896 119903 119888 119890)where 119896 and 119903 are the number of states and the neighbour-hood radius respectively of the cellular automata rules of thespace that is being represented 119888 is the template core and 119890 isan expansion modifier function

The core is by far the most important part of a templateIt is essentially a rule table in 119896-ary form with a twistevery output of this rule table is allowed to be a function ofthe other outputs This is achieved by introducing variablessemantically bounded across all transitions of the classicalrule-table representation By means of the core a template isable to represent a set of CAs The following template (1198791) isan example

1198791 = (2 10 (0 1 minus 1199091 0 1 1199093 1 1199091 0) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903) (1)

The 119868119889119890119899119905119894119905119910119872119886119901119901119890119903 and other expansion modifier func-tions will be explained in more detail in Section 4

Remark In the CATemplates package 119896 119903 and 119890 may beomitted in which case the default values of 119896 = 2 119903 = 10and 119890 = 119868119889119890119899119905119894119905119910119872119886119901119901119890119903 are assumed similarly but forthe sake of simplicity from now on in this paper wheneverwe refer to a templatersquos core in isolation say 119888(1198791) thereader should assume the same previous default values for thecorresponding template (1198791)

We indicate the state transitions of the templatersquos coreby an index starting at 0 on the right-most position upto 119896lfloor2119903+1rfloor minus 1 on the left-most so as to mirror their cor-respondence to the neighborhoods they represent As suchwhenever 1198791rsquos transition 0 is mentioned we are referringto the first 0 that appears in 1198791rsquos core from right to leftTransition 1 refers to 1199091 and so on1198791rsquos transition 0 is a sample of a fixed output This meansany CA with a value different from 0 on its rule tablersquos firsttransitionmdashwhich is the same as the state transition (000)leading to 1mdashis not an element of the set represented by 11987911198791rsquos transition 1 is a sample of a free variable (1199091) Afree variable is assumed to represent any value in the range[0 119896minus1] As a convention free variables are indexed followingthe transition where they first appear Were we to consideronly1198791 rsquos first two transitions we could say it represents the set(0 0) (1 0) since the first transition is fixed and the secondis a free variable

Transition 6 is a sample of a function As 1198791 is a binarytemplate (since 119896 = 2) the expression 1 minus 1199091 means thistransition will always be evaluated to the opposite of the valueof transition 1 It is important to note that we could use anyalgebraic expression here potentially referring to any othervariable in the template and we would still be able to derivethe set this template represents This is actually done in sometemplate builder functions as will be seen in Section 5

It follows from the previous observations that 1198791 actuallycorresponds to the binary rule set (0 1 0 1 0 1 0 0) (0 10 1 1 1 0 0) (0 0 0 1 0 1 1 0) (0 0 0 1 1 1 1 0) whichcould also be written as 22 30 84 92 following Wolframrsquosnumbering convention

A template whose core is made of only free variables iscalled a Base Template and essentially represents the wholeCA space given by k and 119903 for instance the Base Template forthe elementary CAs is

(2 10 (1199097 1199096 1199095 1199094 1199093 1199092 1199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903) (2)

4 Complexity

Base templates are often used by template builder func-tions as a starting point

4 Template Operations

Currently templatesrsquo processing supports two operationsexpansion (119864) and intersection (119868) This section presentsdetails on how they work

41 Expansion Every template represents a set 119877 of 119896-aryrule tables This set is obtained by means of the expansionoperation

The 119894-th expansion of template119879 denoted as119864119894 (119879) beginswith the extraction of all variables present in the templatersquoscore in a total of 119898 variables For instance given thetemplatersquos core 119888(1198791) = (0 1minus1199091 0 1 1199093 1 1199091 0) the orderedlist of extracted variables would be (1199093 1199091) ordered by thevariablersquos index in decreasing order Next 119894 is converted tobase 119896 padded with zeros to the left up to achieving119898 digitsFor 119894 = 2 we would have the ordered list of digits (1 0) since10 is 2 in binary We then pair the extracted variables with thedigits in order and replace every occurrence of the variablewith the corresponding value like (0 1minus0 0 1 1 1 0 0) Anyalgebraic expression left in the core is then resolved resultingin 1198642(1198791) = (0 1 0 1 1 1 0 0)

With the process to find the 119894-th expansion defined itis only a matter of mapping it over every number in theinterval [0 119896119898 minus 1] and we have the set 119877 of CA rule tablesrepresented by the template This is how the full expansion119864(119879) is implemented

Still considering 1198791 since 119898 = 2 we only have 1198962 =4 possible expansions for this template By performing theexpansion procedure with 119894 isin 0 1 2 3 we end upwith the set 119877 = (0 1 0 1 0 1 0 0) (0 1 0 1 1 1 0 0)(0 0 0 1 0 1 1 0) (0 0 0 1 1 1 1 0)

Upon expansion templates can generate invalid resultsfor instance let us consider the templatersquos core 119888(119879119894119899V119886119897119894119889) =(0 0 0 0 2 minus 1199093 1 1 1)

Since 119898 = 1 and 119896 = 2 this template has 2 possibleexpansions namely 119864(119879119894119899V119886119897119894119889) = (0 0 0 0 2 1 1 1) (0 00 0 1 1 1 1) however the set contains an invalid statetransition as it leads to the 2-state which is not in the [0 119896minus1]range

Expansion modifier functions can be used as a mecha-nism by which the template provides auxiliary informationfor the expansion operation in terms of some details it shouldabide by

Every template has at least one expansion modifierfunction defined Whenever the expansion operation isperformed on the 119894-th expansion its result is passed on to thetemplatersquos expansion modifier function which is defined bythe template builder function

This means that every template itself is able to definespecific behaviours to the expansion operation deciding howto deal with unwanted results

Expansion modifier functions are currently divided intotwo categories Mappers and Filters

411 Mappers A Mapper is a function that receives the i-thexpansion result and performs some kind of transformationon it So far we have identified the need for two expansionmodifier functions of the Mapper kind ModKMapper andIdentityMapper

(i) IdentityMapper simply receives the expansion andleaves it untouched

(ii) ModKMapper performs the 119898119900119889119906119897119906119904 operation oneach transition of the expansion result using the tem-platersquos 119896 as divisor thus obtaining a valid expansion

As an example of the latter let us define 119879119898119900119889119896 as avariation of 119879119894119899V119886119897119894119889 that uses ModKMapper instead of theIdentityMapper

119879119898119900119889119896= (2 10 (0 0 0 0 2 minus 1199093 1 1 1) 119872119900119889119870119872119886119901119901119890119903) (3)

Now the result of expanding 119879119898119900119889119896 becomes

119864 (119879119898119900119889119896) = (0 0 0 0 0 1 1 1) (0 0 0 0 1 1 1 1) (4)

412 Filters A Filter is a function that checks the expansionresult and decides whether it is an acceptable result forthe given template If it finds an unacceptable expansioncandidate it filters out this result by removing it from theset 119877 So far we have identified the need for two expansionmodifier functions of the Filter kind FilterKOutOfRange andFilterVariableAssignments

(i) FilterKOutOfRange simply removes any invalidexpansion For instance by defining 119879119891119894119897119905119890119903119870 as avariation of 119879119894119899V119886119897119894119889 that uses FilterKOutOfRangeinstead of the IdentityMapper and this results in119864(119879119891119894119897119905119890119903119870) = (0 0 0 0 1 1 1 1)

(ii) FilterVariableAssignments serves a different kind ofneed It allows for templates to define annotations onits corersquos variables which dictate the values from the[0 119896 minus 1] range the variable is allowed to have

The annotation referred to in FilterVariableAssignmentsis expressed with a special syntax on the templatersquos coreConsider the following template 119879V119886 and its 119894 = 0 expansion

119879V119886 = (2 10 (0 0 0 0 1199093 isin 1 1 1 1) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (5)

The process should result in the expansion candidate (0 00 0 0 isin 1 1 1 1) But since 0 isin 1 is false FilterVariable-Assignments detects this as unacceptable and removes it from119877

In the binary case FilterVariableAssignments is seldomneeded since the expression 119909119891119903119890119890 isin 0 1 is equivalentto a free variable 119909119891119903119890119890 and the expression 119909119891119894119909119890119889 isin 0 isequivalent to the fixed value 0

Therefore this expansionmodifier function becomes use-ful when 119896 gt 2 for various reasons For further clarificationSection 52 discusses an application of this filter

Complexity 5

42 Intersection Template intersection is a function of twotemplates which results in a template whose associated set 119877is equivalent to intersecting the 119877 sets of the two templatesreceived as arguments In another form

119868 (1198791 1198792) = 1198793 lArr997904 119864 (1198793) = 119864 (1198791) cap 119864 (1198792) (6)

Template intersection initially consists of building anequation system with the templatersquos cores received asoperands The equation system is then submitted to Mathe-maticarsquos Solve function [9] which solves it for the variablesthat admit a solution and elicits the relations among theremaining variables The resulting set of variable values andrelations is then applied to any of the two operands and theoutcome is a new template representing only the intersectionbetween both of the input templates

If the system has no solution this means both templatesrepresent disjoint 119877 sets and by definition do not intersect

As an example consider the template cores 119888(1198791) =(1199097 0 1199095 0 1 0 1199092 1199090) and 119888(1198792) = (1 0 1 minus 1199091 1 minus1199093 1199093 0 1199091 0)The associated equation system thus becomes

1199097 = 10 = 01199095 = 1 minus 11990910 = 1 minus 11990931 = 11990930 = 01199091 = 11990911199090 = 0

(7)

The solution set of the equation system as given by Math-ematicarsquos Solve is 119878 = 1199090 = 0 1199093 = 1 1199092 = 1199091 1199095 =1 minus 1199091 1199097 = 1 We can then substitute the variablesin 119888(1198791) using this set thus rendering the templatersquos core(1 0 1 minus 1199091 0 1 0 1199091 0) Notice that the same result wouldbe achieved had we applied the substitutions to 119888(1198792)

If a templatersquos core has variable restrictions a second stepis needed to guarantee that the solution found will not violatethem

For instance consider the templatesrsquo cores 119888(1198791199031) and119888(1198791199031) both with restricted variables 119888(1198791199031) = (1199097 0 1199095 0 10 1199092 isin 0 1 1199090) and 119888(1198791199032) = (1 0 1 minus 1199091 1 minus 1199093 1199093 0 1199091 isin0 0) To intersect 1198791199031 and 1198791199032 we first extract the variablerestriction expressions and then build and solve the systemas usual This time however the substitutions are appliedto both arguments therefore resulting in the set (1 0 1 minus1199091 0 1 0 1199091 isin 0 1 0) (1 0 1 minus 1199091 0 1 0 1199091 isin 0 0)

Now we extract variable restriction expressions andcreate a second equation system whose solutions indicatewhich values the variables may have In the example the setof expressions 1199091 isin 0 1 1199091 isin 0 would be extracted thusyielding the equation system

1199091 = 1 or 1199091 = 01199091 = 0 (8)

By solving this system the solution set 119878 = 1199091 = 0 canfinally be applied to 119888(1198791199031) yielding (1 0 1 0 1 0 0 0) as theresult

5 Template Builders

So far we have seen how templates can be built in orderto represent specific subsets of CA families We can nowgo about making evident the true power of templates byconsidering template builder functions

Template builder functions are algorithms tailored togenerate templates for specific subsets of CAs that share agiven static property

Currently six template builders for static properties areimplemented associated to rules of the following kindscaptive totalistic outer-totalistic number conserving col-orblind and maximum internal symmetry values (see [1])for reflection conjugacy and their composition The lattertwo are not discussed herein partly because we have alreadydiscussed them previously (see [8]) and at least in thecontext number conservation the corresponding templatebuilder simply did not change since its conception Howeverthe builder for rule table symmetries has undergone ageneralisation that now allows for any value of symmetry tobe accounted for not only maximum As such the CATem-plates package contains the SymmetryTemplate builder fullyavailable for use including its corresponding documentationbut we decided not to include it in the paper because itcannot yet handle arbitrary number of states in the case ofconjugation

So this section discusses builder functions for totalisticouter-totalistic captive and colorblind templates

51 Template Builder for Totalistic and Outer-Totalistic CAs

Definition 2 (totality) A totalistic CAmdashor alternatively aCA that presents the totality propertymdashis one whose statetransitions only depend on the sum of the state values of thecells in a given neighbourhood

Formally let 119891 be the local transition function of a CAdefined over the set119873 of possible neighborhoods for the CArsquosspace Let 119899 be the size of a neighbourhood of 119873 Let 119860 =(1205721 120572119899) and 119861 = (1205731 120573119899) be neighborhoods of 119873 ACA is said to be totalistic if and only if the following conditionis true

forall119860 119861 isin 119873( 119899sum119894=1

120572119894 = 119899sum119895=1

120573119895) lArrrArr (119891 (119860) = 119891 (119861)) (9)

Since totality is a static property we can derive a generalalgorithm to find all rule tables of CAs that share the totalityproperty given a value for 119896 and 119903

6 Complexity

The algorithm receives as arguments the values of 119896 and119903 for which the template will be generated It then proceedsto enumerate all possible neighborhoods of the defined spaceand calculates their sum

Now for every sum value found in the previous step thealgorithm picks the neighbourhood representing the smallest119896-ary number and assigns a variable corresponding to thatneighbourhoodrsquos decimal value to all of the state transitionsthat shared a result with it For instance let us considerall neighborhoods of the elementary space whose statessum equals 2 (1 1 0) (1 0 1) (0 1 1) Since the smallestneighbourhood in this set is (0 1 1) which is decimal 3 weassign to their respective transitions the result 1199093

The templatersquos core for the elementary space becomes

119888 (119879119905119900119905119886119897119894119904119905119894119888119864119878) = (1199097 1199093 1199093 1199091 1199093 1199091 1199091 1199090) (10)

Upon expansion this template yields the rule tables ofthe 16 totalistic elementary CAs Notice that this templatersquoscore is composed of only free variables and references toother free variables This being the case every expansionof this template shall yield a valid result excluding theneed to define any expansion modifier function other than119868119889119890119899119905119894119905119910119872119886119901119901119890119903

For 119896 = 3 and 119903 = 1 the resulting template would be

11987911990511990011990531 = (3 10 (11990926 11990917 1199098 11990917 1199098 1199095 1199098 1199095 1199092 11990917 11990981199095 1199098 1199095 1199092 1199095 1199092 1199091 1199098 1199095 1199092 1199095 1199092 1199091 1199092 1199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903)

(11)

Upon expansion this template yields the 2187 totalisticrules of the referred space

Definition 3 (outer-totality) An outer-totalistic CAmdashor al-ternatively a CA that presents the outer-totality propertymdashis one whose local rule considers the sum of the state valuesof the external cells of a neighbourhood (ie those except thecenter cell) in addition to the state value of the center cellitself

Formally let 119891 be the local transition function of a CAdefined over the set119873 of possible neighborhoods for the CArsquosspace Let 119899 be the size of a neighbourhood of 119873 and let119898 = lceil1198992rceil be the index of the cell that is meant to undergoa state change (ie the center cell when 119899 is an odd number)Let 119860 = (1205721 120572119898 120572119899) and 119861 = (1205731 120573119898 120573119899) beneighborhoods of119873 A CA is said to be outer-totalistic if andonly if the following condition is true

forall119860 119861 isin 119873((119898minus1sum119894=1

120572119894 + 119899sum119894=119898+1

120572119894 = 119898minus1sum119895=1

120573119895 + 119899sum119895=119898+1

120573119895)

and (120572119898 = 120573119898)) lArrrArr (119891 (119860) = 119891 (119861)) (12)

The algorithm for outer-totalistic templates is almost thesame as the one for totalistic rules with the exception that

it considers the sum of external cells in the neighbourhoodinstead of its entirety

The algorithmrsquos output for the elementary space is

119888 (119879119900119906119905119890119903minus119905119900119905119886119897119894119904119905119894119888119864119878) = (1199097 1199093 1199095 1199091 1199093 1199092 1199091 1199090) (13)

Upon expansion this template generates the 64 outer-totalistic elementary CAs

For reference here is the result for 119896 = 3 and 119903 = 1whichafter expansion would yield the 14 348 907 outer-totalisticrules of the space since 15 distinct variables are present inthe template

119879119900119906119905119890119903minus11990511990011990531 = (3 10 (11990926 11990917 1199098 x23 11990914 1199095 11990920 11990911 119909211990917 1199098 1199097 11990914 1199095 1199094 11990911 1199092 1199091 1199098 1199097 1199096 1199095 1199094 1199093 11990921199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903)

(14)

52 Template Builder for Captive CAs

Definition 4 (captivity [13]) A CA is said to be captivemdashoralternatively to have the captivity static propertymdashwhenevery transition of its rule table outputs a state that appearsin the corresponding neighbourhood

Formally if 119891 is the local transition function of a CA119860 =(1205721 120572119898 120572119899) is a neighbourhood of size 119899 out of allpossible neighborhoods 119873 and 120573 is an arbitrary state a CAis said to be captive if and only if the following condition istrue

forall119860 isin 119873119891 (1205721 120572119899) = 120573 lArrrArr 120573 isin 1205721 120572119899 (15)

In the binary case this naturally simplifies to the fact thatevery CA with 119891(01 02 0119899) = 0 and 119891(11 12 1119899) = 1is captive for any radius 119903

As a static property a general algorithm to find templatesof captive CAs for a given space does exist As such thealgorithm receives the values for 119896 and 119903 and starts bygenerating all possible neighborhoods for the space

It then uses the following simple rules to decide how totransform this neighbourhood in a template output

(i) If the neighbourhood is homogeneous like (1 1 1)the transition should output the only state thatappears in the neighbourhood (1)

(ii) If the neighbourhood is composed of all of the valuesin the interval [0 119896 minus 1] like (1 2 0) for 119896 = 3 and119903 = 1 the transition should output a free variableindexed by the decimal value of the neighbourhoodnamely 11990915 (since 120 in base 119896 = 3 corresponds tothe decimal 15)

(iii) If the neighbourhood is composed of only some of thepossible states the states of the interval [0 119896 minus 1] like(0 2 0) for 119896 = 3 and 119903 = 1 the output should bea variable indexed by the neighbourhood this timerestricted by the present values (1199096 isin 0 2)This typeof neighbourhood only appears when 119896 gt 2

Complexity 7

Note that since this template uses restricted variables itmust use the 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904 expansion modifierfunction

As a result of all the latter the captivity template for theelementary space becomes

119879119888119886119901119905119894V119890 = (2 10 (1 1199096 1199095 1199094 1199093 1199092 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (16)

while for 119896 = 3 and 119903 = 1 the template is

119879119888119886119901119905119894V11989031 = (3 10 (2 11990925 isin 1 2 11990924 isin 0 2 11990923isin 1 2 11990922 isin 1 2 11990921 11990920 isin 0 2 11990919 11990918isin 0 2 11990917 isin 1 2 11990916 isin 1 2 11990915 11990914isin 1 2 1 11990912 isin 0 1 11990911 11990910 isin 0 1 1199099isin 0 1 1199098 isin 0 2 1199097 1199096 isin 0 2 1199095 1199094isin 0 1 1199093 isin 0 1 1199092 isin 0 2 1199091 isin 0 1 0) 119865119894119897119905119890119903119873119900119905119860119897119897119900119908119890119889)

(17)

53 Template Builder for Colorblind CAs In order to fullygrasp the notion of colorblind rules let us first discuss themeaning of permutations in the context of CAs

Definition 5 (colour permutation (120587)) Let framework 119870 bethe set of possible states for a CA in the range [0 119896 minus 1] Acolour permutation 120587 is a bijective function of 119870 to itselfwhich can be written as a set of rules of the form 119896119894 997888rarr 119896119895meaning that a cell in state 119896119894 should be switched to state 119896119895when this permutation is applied

For instance a valid permutation for the case where 119870 =0 1 2 is 1205871 = 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0It is important to notice that every colour permutation

can be represented by an algebraic function that interpolatesthe points defined by the permutation For instance 1205871 couldbe written as 1205871(119909) = 1 + (1 minus 32(minus1 + 119909))119909Definition 6 (symmetric group (119878119870)) The symmetric group119878119870 of a set119870 is the set of all possible permutations over 119870

For instance the symmetric group for119870 = 0 1 2 is119878119870 = 0 997888rarr 0 1 997888rarr 1 2 997888rarr 2

0 997888rarr 0 1 997888rarr 2 2 997888rarr 1 0 997888rarr 1 1 997888rarr 0 2 997888rarr 2 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0 0 997888rarr 2 1 997888rarr 0 2 997888rarr 1 0 997888rarr 2 1 997888rarr 1 2 997888rarr 0

(18)

Definition 7 (neighbourhood permutation (120588(120587))) Let120587 be acolour permutation and let119873 be the set of all possible neigh-borhoods for a given CA The neighbourhood permutation

120588(120587) is a permutation 119873 that uses 120587 to transform 119899119894 isin 119873 intoneighbourhood 119899119895 isin 119873 by applying 120587 to every cell of 119899119894

For instance with119870 = 0 1 2 119903 = 1 and 1205871 = (0 1 2)a valid transformation due to 120588(1205871) would be (0 2 2) 997888rarr(1 0 0) The other transformations can be derived by apply-ing the same reasoning to all of the neighborhoods of119873

Definition 8 (cycle notation of a permutation) A permuta-tion can be written by means of a cycle notation formedby a set of vectors that represent cycles associated with thepermutation

For instance the colour permutation 1205872 = 0 997888rarr 1 1 997888rarr0 2 997888rarr 2 can be written as 1205872 = (0 1) (2) whereeach vector has the form (1199091198941 1199091198942 119909119894119895) 1 le 119895 le 119896 andrepresents a cycle due to the permutation namely the two-step cycle 0 997888rarr 1 997888rarr 0 and the self-loop 2 997888rarr 2Similarly The previous 1205871 permutation would be written incycle notation as 1205871 = (0 1 2)

As for neighbourhood permutations 120588(1205871) for examplewould be represented as follows

120588 (1205871) = ((0 2 2) (1 0 0) (2 1 1)) ((0 2 1) (1 0 2) (2 1 0)) ((0 2 0) (1 0 1) (2 1 2)) ((0 1 2) (1 2 0) (2 0 1)) ((0 1 1) (1 2 2) (2 0 0)) ((0 1 0) (1 2 1) (2 0 2)) ((0 0 2) (1 1 0) (2 2 1)) ((0 0 1) (1 1 2) (2 2 0)) ((0 0 0) (1 1 1) (2 2 2))

(19)

With the previous characterisations we can now define colorblindness

Definition 9 (color blindness [14]) A CA whose cells can bein any of the states of the set 119870 is said to be colorblindmdashoralternatively to possess the color blindness propertymdashif itsspace-time evolution does not change unless by a colourchange after applying any neighbourhood permutation120588(120587) 120587 isin 119878119870 to all state transitions that define its rule table

Notice that for a CA to be invariant to 120588(1205871) its ruletablersquos outputs 119900119894 should be consistent with the cycles formedby the application of 120588(1205871) over its neighborhoods 119887119894 119894 beingthe index of the state transition on the CArsquos rule table

In other words for a rule to be invariant to 1205871 theoutput of say neighbourhood (0 2 2) should be equal tothe application of 1205871 to the output of neighbourhood (1 0 0)since (0 2 2) is transformed into (1 0 0) due to 1205871 for thesame reason the output of (1 0 0) should be equal to theapplication of1205871 to the output of neighbourhood (2 1 1)Thesame happens analogously for the remaining cycles of 120588(1205871)

8 Complexity

Now in order to generate a template representing CAsthat are invariant to the neighbourhood permutation 120588(1205871)we need to assign an output to every neighbourhood andderive a rule table that could be turned into a template

So that outputs follow 120588(1205871) we use its cycle notationrepresentation to assign to every cycle start a free variableindexed by its corresponding neighbourhoodrsquos decimal rep-resentation ending upwith a tuple formed by neighbourhoodand output The (0 2 2) neighbourhood being a cycle startis turned into the tuple ((0 2 2) 1199098) for instance

For every remaining neighbourhood in a cycle we nowapply 1205871 to the free variable found in the previous step 119889times 119889 being the distance from this neighbourhood tothe start of the cycle The cycle ((0 2 2) (1 0 0) (2 1 1))is turned into (((0 2 2) 1199098) ((1 0 0) 1205871(1199098)) ((2 1 1)1205871(1205871(1199098)))) for instance

Applying this procedure to every cycle of 1205871 we obtainthe set(((0 2 2) 1199098) ((1 0 0) 1205871 (1199098))

((2 1 1) 120587 (1205871 (1199098)))) (((0 2 1) 1199097) ((1 0 2) 1205871 (1199097)) ((2 1 0) 120587 (1205871 (1199097)))) (((0 2 0) 1199096) ((1 0 1) 1205871 (1199096)) ((2 1 2) 120587 (1205871 (1199096)))) (((0 1 2) 1199095) ((1 2 0) 1205871 (1199095)) ((2 0 1) 120587 (1205871 (1199095)))) (((0 1 1) 1199094) ((1 2 2) 1205871 (1199094)) ((2 0 0) 120587 (1205871 (1199094)))) (((0 1 0) 1199093) ((1 2 1) 1205871 (1199093)) ((2 0 2) 120587 (1205871 (1199093)))) (((0 0 2) 1199092) ((1 1 0) 1205871 (1199092)) ((2 2 1) 120587 (1205871 (1199092)))) (((0 0 1) 1199091) ((1 1 2) 1205871 (1199091)) ((2 2 0) 120587 (1205871 (1199091)))) (((0 0 0) 1199090) ((1 1 1) 1205871 (1199090)) ((2 2 2) 120587 (1205871 (1199090))))

(20)

We can now flatten a level of this set and turn it into anordered list sorted lexicographically by neighbourhood Thisprocedure yields the rule table shown in Table 2

The core of a template for CAs invariant to 120588(1205871) can nowbe found by compressing this rule table into its 119896-ary form

119879120588(1205871) = (120587 (1205871 (1199090)) 120587 (1205871 (1199092)) 120587 (1205871 (1199091)) 120587 (1205871 (1199096)) 120587 (1205871 (1199098)) 120587 (1205871 (1199097)) 120587 (1205871 (1199093)) 120587 (1205871 (1199095)) 120587 (1205871 (1199094)) 1205871 (1199094) 1205871 (1199093) 1205871 (1199095) 1205871 (1199091) 1205871 (1199090) 1205871 (1199092) 1205871 (1199097) 1205871 (1199096) 1205871 (1199098) 11990981199097 1199096 1199095 1199094 1199093 1199092 1199091 1199090))

(21)

Remember from Definition 5 that any permutation 120587 canbe represented by an algebraic function which is the actual

Table 2 Rule table for the template representative of CAs invariantto 1205871(2 2 2) 120587(1205871(1199090)(2 2 1) 120587(1205871(1199092)(2 2 0) 120587(1205871(1199091)(2 1 2) 120587(1205871(1199096)(2 1 1) 120587(1205871(1199098)(2 1 0) 120587(1205871(1199097)(2 0 2) 120587(1205871(1199093)(2 0 1) 120587(1205871(1199095)(2 0 0) 120587(1205871(1199094)(1 2 2) 1205871(1199094)(1 2 1) 1205871(1199093)(1 2 0) 1205871(1199095)(1 1 2) 1205871(1199091)(1 1 1) 1205871(1199090)(1 1 0) 1205871(1199092)(1 0 2) 1205871(1199097)(1 0 1) 1205871(1199096)(1 0 0) 1205871(1199098)(0 2 2) 1199098(0 2 1) 1199097(0 2 0) 1199096(0 1 2) 1199095(0 1 1) 1199094(0 1 0) 1199093(0 0 2) 1199092(0 0 1) 1199091(0 0 0) 1199090

representation used by the algorithm We use the 120587 nota-tion here since it is compact and serves the explanationrsquospurpose

The same procedure can now be repeated for every per-mutation of the 119878119896 set essentially mapping each permutationof the set to a corresponding template of CAs invariant to thatpermutation It is now only a matter of intersecting all of thetemplates found and the result is a template that representsall colorblind rules of the space defined by 119896 and 119903

When applied to 119896 = 2 and 119903 = 1 we obtain119879119888119900119897119900119906119903119887119897119894119899119889

= (1 minus 1199090 1 minus 1199091 1 minus 1199092 1 minus 1199093 1199093 1199092 1199091 1199090) (22)

whereas for 119896 = 3 and 119903 = 1 the result becomes

11987911988811990011989711990011990611990311988711989711989411989911988931 = (2 2 minus 1199091 2 minus 21199091 2 minus 1199093 2 minus 1199094 2minus 1199095 2 minus 2 1199093 2 minus 21199095 2 minus 21199094 1 minus 21199094 1 minus 21199093 1minus 21199095 1 minus 21199091 1 1 + 21199091 1 + 21199095 1 + 21199093 1+ 21199094 21199094 21199095 21199093 1199095 1199094 1199093 21199091 1199091 0)

(23)

Complexity 9

6 A Detailed Example

Here we discuss a detailed application for the templateframework presented in this paper which is to find the rulesthat share a set of static properties This can be achieved withthe template builder functions provided with CATemplatesor one could implement custom builder functions on top ofthe core concepts provided by the package What follows isa sample of how the framework can be used to conduct anexperiment of this sort

More specifically let us suppose we are interested in therules which are both totalistic and captive This might comefrom a purely theoretical interest or motivated by the needfor obtaining rules of this type for some practical application

We then start by building the templates for totalisticand captive rules of the elementary space as shown in theprevious sections (119879119905119900119905119886119897119894119904119905119894119888 and 119879119888119886119901119905119894V119890) By performing theirintersection we end up with a template representing alltotalistic and captive rules of the elementary space as follows

11987911989621199031 = (2 10 (1 1199093 1199093 1199091 1199093 1199091 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (24)

Upon expansion this template yields the 4 totalisticelementary CAs which are also captive 128 150 232 254Notice that the template being expanded has only 2 variableswhichmeans the expansion has to consider only 4 expansioncandidates which is a substantially smaller subset of theoriginal space which has 256 rules

Since the elementary space is a small one let us performthe same example in larger spaces We can generate theequivalent templates for the space defined by 119896 = 3 and 119903 = 1and perform the intersection between them The result is

11987911989631199031 = (3 10 (2 11990917 isin 1 2 2 11990917isin 1 2 2 1 2 1 0 11990917 isin 1 2 2 1 2 1 0 1 0 1199091isin 0 1 2 1 0 1 0 1199091 isin 0 1 0 1199091 isin 0 1 0)FilterVariableAssignments)

(25)

Notice that this template also has two variables 1199091 and11990917 This means there are only 32 = 9 possible expansions forthis template from which some will be filtered out becauseof the variable assignment annotations After expansion thistemplate yields the 4 totalistic rules of the spacewhich are alsocaptive 223160992 223161514 265235104 265235626

This means that we took a space with 327 = 7 625 597484 987 rules and found out that only 4 of those sharethe totality and captivity properties all without actuallyenumerating the whole space (which would be not feasiblegiven its size) Notice that this space could be further reducedby intersecting this resulting template with templates fromother properties like color blindness

Extending the previous case we may now ask the generalquestion of up to which rule space size could we still manageto get access to totalistic and captive rulesWithout templatesthe rules would have to be obtained directly by scanningthe rule space and selecting those having the two properties

But with 119896 = 3 this approach would already be impracticaleven for 119903 = 1 on a standard personal computer since thespace has ≃ 76 times 1012 rules A first alternative now usingtemplates could be accessing the rules say by first expandingthe totalistic rules directly from the corresponding templateand then filtering out the captive ones This certainly helpsIn fact by doing so progressively starting with radius 119903 = 05and increasing its value in steps of 05 in a standard personalcomputer it would hardly be possible to reach beyond 119903 = 2(which corresponds to a space with ≃ 87 times 10115 rules)because of the substantial increase in computational timeas we would go from a given 119903 to its subsequent valueWe omit actual values of processing time here as this maystrongly vary among different machine architectures andtheir software environment

However by relying on the generation of the individualtemplates of each property and expanding the intersectionbetween them we easily access spaces up to 119903 = 4 (possiblyeven beyond) which contains ≃ 15times109391 rules It turns outthat in this space only 256 rules share the two properties anextremely smaller space to reason about

Furthermore the analysis of all the data generated fromthe previous experiment suggests that the number of ruleswith 119896 = 3 and the shared properties of totality andcaptivity seems to be given by 4119903 for symmetric rules (thosewith integer radius) whereas no rule would be present forasymmetric rules This is quite a remarkable general resultderived from direct probing of the corresponding rule spacesthat the full usage of templates allowed us

As a final note it is worth emphasising that templateexpansion is only made when the actual rules representedin a template are needed which is at the end of the processof answering which rules satisfy a given set of propertiesUntil then it suffices to operate directly with the tem-plates this is where the conciseness of template usage liesAnd although expansion may be computationally intensiveit is certainly much less than if the entire correspond-ing spaces would have to be manipulated directly all theway

7 Concluding Remarks

Searching for cellular automata with specific behaviours(such as global problem solvers) is a daunting task for anyonelooking further than the elementary space

In this paper we presented the current state of cellularautomata templates a valuable ally in this front We havedescribed what templates are and how the two currentlyimplemented operations (expansion and intersection) workwent into details of the implementations of template builderfunctions for captive totalistic outer-totalistic and color-blind rules and have shown a sample application of theframework established here

The sample application has led us to the discovery thatonly a handful of CAs share both of the properties of totalityand captivity (only 64 rules on the 119896 = 3 119903 = 3 spacefor instance) This little experiment shows how the proposedframework can be used as a means to sieve through very largespaceswhen searching forCAs that present a given behaviour

10 Complexity

As mentioned in distinct parts of the text the notionof templates and the implementation of the computationalsystem to support it underwent a long way since its originup to its current degree of structural maturity

The natural course from here is to develop new templatebuilders and whichever other operations we might conceiveMore concretely with respect to the latter we should say thatduring the last couple of years we have been investigating thenotion of ldquodifferencerdquo between templates an operationwhoseoutput would yield another template representing the rulesthat have the property associated with the first template butnot having the property associated with the second In spiteof a conference publication we have on the topic (see [15]) itis not yet mature to go into the publicly available package Butin due time we intend to do so

As for new template builders a generalisation of oneto handle arbitrary values of symmetry by conjugation ismore pressing As mentioned earlier we decided not toinclude this template builder mostly because the existing onecannot yet handle arbitrary number of states in the caseof conjugation However noticing that the notion of colorblindness is essentially the notion of rules with maximumsymmetry by conjugation generalised for any 119896-state ruleusing the same idea implemented for color blindness it isnow possible to face the generalisation of arbitrary values ofsymmetry by conjugation This is clearly future work to bedone

Also it is tempting to add completely new templatebuilders to the present package referring to other parameterslike those in [16] In fact we hope that this paper triggerscollaborative participation from the cellular automata com-munity in terms of both the systemrsquos expansion and its usein applications This is why we decided to keep the work inGitHub publicly available

As for the possibility of extending the framework tosupport rules in higher dimensions we would say this wouldbe readily possible for all current properties but one numberconservation This is due to the fact that the underlyingalgorithm we used to implement the corresponding tem-plate builder comes from [17] which is restricted to one-dimensional rules In order to change that a general algo-rithm would have to be used quite likely the one describedin [18]This is certainly feasible and desirable but we had notyet had the opportunity to go about that

Data Availability

The data used to support the findings of this study are avail-able from the corresponding author upon request and theCATemplates Mathematica package directly from GitHub[10]

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

The authors are grateful to financial support fromIPM (Instituto Presbiteriano Mackenzie) and CAPES

(Coordenacao de Aperfeicoamento de Pessoal de NıvelSuperior Brazil) by means of STIC-AmSud (CoDANet)project no 888811974562018-01 and PrInt project no 888873102812018-00

References

[1] S Wolfram A New Kind of Science WolframMedia Inc 2002[2] J L Zapotecatl D A Rosenblueth and C Gershenson ldquoDelib-

erative self-organizing traffic lights with elementary cellularautomatardquo Complexity vol 2017 Article ID 7691370 15 pages2017

[3] D Wolz and P P B de Oliveira ldquoVery effective evolutionarytechniques for searching cellular automata rule spacesrdquo Journalof Cellular Automata vol 3 no 4 pp 289ndash312 2008

[4] I Barragan-Vite J C Seck-Tuoh-MoraN Hernandez-RomeroJMedina-Marin and E S Hernandez-Gress ldquoDistributed con-trol of a manufacturing system with one-dimensional cellularautomatardquo Complexity vol 2018 Article ID 7235105 15 pages2018

[5] J Yang W Liu Y Li X Li and Q Ge ldquoSimulating intraurbanland use dynamics under multiple scenarios based on fuzzycellular automata a case study of Jinzhou District DalianrdquoComplexity vol 2018 Article ID 7202985 17 pages 2018

[6] H Betel P P B De Oliveira and P Flocchini ldquoSolving theparity problem in one-dimensional cellular automatardquo NaturalComputing vol 12 no 3 pp 323ndash337 2013

[7] M Bidlo ldquoOn routine evolution of complex cellular automatardquoIEEE Transactions on Evolutionary Computation vol 20 no 5pp 742ndash754 2016

[8] P de Oliveira andMVerardo ldquoRepresenting families of cellularautomata rulesrdquoThe Mathematica Journal vol 16 no 8 2014

[9] Wolfram Research ldquoWolfram mathematica 11rdquo httpwwwwolframcommathematica 2018

[10] M Verardo and P P B de Oliveira ldquoCATemplatesrdquo httpsgithubcommverardoCATemplates 2019

[11] P P B de Oliveira ldquoOn density determination with cellularautomata Results constructions and directionsrdquo Journal ofCellular Automata vol 9 no 5-6 pp 357ndash385 2014

[12] P P B de Oliveira andMVerardo ldquoTemplate based representa-tion of cellular automata rulesrdquo inProceedings of the ExploratoryPapers - AUTOMATA 2014 - 20th International Workshop onCellular Automata and Discrete Complex Systems T IsokawaK Imai N Matsiu F Peper and H Umeo Eds pp 199ndash2042014

[13] G Theyssier ldquoCaptive cellular automatardquo in MathematicalFoundations of Computer Science vol 3153 of Lecture Notes inComputer Science pp 427ndash438 2004

[14] V Salo and I Torma ldquoColor blind cellular automatardquo inCellularAutomata and Discrete Complex Systems J Kari M Kutrib andAMalcher Eds pp 139ndash154 SpringerHeidelberg Berlin 2013

[15] Z Soares M Verardo and P P de Oliveira ldquoThe differenceoperation between templates of binary cellular automatardquo inNew Advances in Information Systems and Technologies ARocha A M Correia H Adeli L P Reis and M M TeixeiraEds vol 444 of Advances in Intelligent Systems and Computingpp 707ndash715 Springer International Publishing Cham Swizer-land 2016

Complexity 11

[16] G M Oliveira P P Oliveira and N Omar ldquoDefinitionand application of a five-parameter characterization of one-dimensional cellular automata rule spacerdquo Artificial Life vol 7no 3 pp 277ndash301 2001

[17] N Boccara and H Fuks ldquoNumber-conserving cellular automa-ton rulesrdquo Fundamenta Informaticae vol 52 no 1-3 pp 1ndash132002

[18] B Durand E Formenti and Z Roka ldquoNumber-conservingcellular automata I decidabilityrdquoTheoretical Computer Sciencevol 299 no 1-3 pp 523ndash535 2003

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 4: A Fully Operational Framework for Handling Cellular ...downloads.hindawi.com/journals/complexity/2019/6573793.pdf · is a brief overview of cellular automata and their inner workings,

4 Complexity

Base templates are often used by template builder func-tions as a starting point

4 Template Operations

Currently templatesrsquo processing supports two operationsexpansion (119864) and intersection (119868) This section presentsdetails on how they work

41 Expansion Every template represents a set 119877 of 119896-aryrule tables This set is obtained by means of the expansionoperation

The 119894-th expansion of template119879 denoted as119864119894 (119879) beginswith the extraction of all variables present in the templatersquoscore in a total of 119898 variables For instance given thetemplatersquos core 119888(1198791) = (0 1minus1199091 0 1 1199093 1 1199091 0) the orderedlist of extracted variables would be (1199093 1199091) ordered by thevariablersquos index in decreasing order Next 119894 is converted tobase 119896 padded with zeros to the left up to achieving119898 digitsFor 119894 = 2 we would have the ordered list of digits (1 0) since10 is 2 in binary We then pair the extracted variables with thedigits in order and replace every occurrence of the variablewith the corresponding value like (0 1minus0 0 1 1 1 0 0) Anyalgebraic expression left in the core is then resolved resultingin 1198642(1198791) = (0 1 0 1 1 1 0 0)

With the process to find the 119894-th expansion defined itis only a matter of mapping it over every number in theinterval [0 119896119898 minus 1] and we have the set 119877 of CA rule tablesrepresented by the template This is how the full expansion119864(119879) is implemented

Still considering 1198791 since 119898 = 2 we only have 1198962 =4 possible expansions for this template By performing theexpansion procedure with 119894 isin 0 1 2 3 we end upwith the set 119877 = (0 1 0 1 0 1 0 0) (0 1 0 1 1 1 0 0)(0 0 0 1 0 1 1 0) (0 0 0 1 1 1 1 0)

Upon expansion templates can generate invalid resultsfor instance let us consider the templatersquos core 119888(119879119894119899V119886119897119894119889) =(0 0 0 0 2 minus 1199093 1 1 1)

Since 119898 = 1 and 119896 = 2 this template has 2 possibleexpansions namely 119864(119879119894119899V119886119897119894119889) = (0 0 0 0 2 1 1 1) (0 00 0 1 1 1 1) however the set contains an invalid statetransition as it leads to the 2-state which is not in the [0 119896minus1]range

Expansion modifier functions can be used as a mecha-nism by which the template provides auxiliary informationfor the expansion operation in terms of some details it shouldabide by

Every template has at least one expansion modifierfunction defined Whenever the expansion operation isperformed on the 119894-th expansion its result is passed on to thetemplatersquos expansion modifier function which is defined bythe template builder function

This means that every template itself is able to definespecific behaviours to the expansion operation deciding howto deal with unwanted results

Expansion modifier functions are currently divided intotwo categories Mappers and Filters

411 Mappers A Mapper is a function that receives the i-thexpansion result and performs some kind of transformationon it So far we have identified the need for two expansionmodifier functions of the Mapper kind ModKMapper andIdentityMapper

(i) IdentityMapper simply receives the expansion andleaves it untouched

(ii) ModKMapper performs the 119898119900119889119906119897119906119904 operation oneach transition of the expansion result using the tem-platersquos 119896 as divisor thus obtaining a valid expansion

As an example of the latter let us define 119879119898119900119889119896 as avariation of 119879119894119899V119886119897119894119889 that uses ModKMapper instead of theIdentityMapper

119879119898119900119889119896= (2 10 (0 0 0 0 2 minus 1199093 1 1 1) 119872119900119889119870119872119886119901119901119890119903) (3)

Now the result of expanding 119879119898119900119889119896 becomes

119864 (119879119898119900119889119896) = (0 0 0 0 0 1 1 1) (0 0 0 0 1 1 1 1) (4)

412 Filters A Filter is a function that checks the expansionresult and decides whether it is an acceptable result forthe given template If it finds an unacceptable expansioncandidate it filters out this result by removing it from theset 119877 So far we have identified the need for two expansionmodifier functions of the Filter kind FilterKOutOfRange andFilterVariableAssignments

(i) FilterKOutOfRange simply removes any invalidexpansion For instance by defining 119879119891119894119897119905119890119903119870 as avariation of 119879119894119899V119886119897119894119889 that uses FilterKOutOfRangeinstead of the IdentityMapper and this results in119864(119879119891119894119897119905119890119903119870) = (0 0 0 0 1 1 1 1)

(ii) FilterVariableAssignments serves a different kind ofneed It allows for templates to define annotations onits corersquos variables which dictate the values from the[0 119896 minus 1] range the variable is allowed to have

The annotation referred to in FilterVariableAssignmentsis expressed with a special syntax on the templatersquos coreConsider the following template 119879V119886 and its 119894 = 0 expansion

119879V119886 = (2 10 (0 0 0 0 1199093 isin 1 1 1 1) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (5)

The process should result in the expansion candidate (0 00 0 0 isin 1 1 1 1) But since 0 isin 1 is false FilterVariable-Assignments detects this as unacceptable and removes it from119877

In the binary case FilterVariableAssignments is seldomneeded since the expression 119909119891119903119890119890 isin 0 1 is equivalentto a free variable 119909119891119903119890119890 and the expression 119909119891119894119909119890119889 isin 0 isequivalent to the fixed value 0

Therefore this expansionmodifier function becomes use-ful when 119896 gt 2 for various reasons For further clarificationSection 52 discusses an application of this filter

Complexity 5

42 Intersection Template intersection is a function of twotemplates which results in a template whose associated set 119877is equivalent to intersecting the 119877 sets of the two templatesreceived as arguments In another form

119868 (1198791 1198792) = 1198793 lArr997904 119864 (1198793) = 119864 (1198791) cap 119864 (1198792) (6)

Template intersection initially consists of building anequation system with the templatersquos cores received asoperands The equation system is then submitted to Mathe-maticarsquos Solve function [9] which solves it for the variablesthat admit a solution and elicits the relations among theremaining variables The resulting set of variable values andrelations is then applied to any of the two operands and theoutcome is a new template representing only the intersectionbetween both of the input templates

If the system has no solution this means both templatesrepresent disjoint 119877 sets and by definition do not intersect

As an example consider the template cores 119888(1198791) =(1199097 0 1199095 0 1 0 1199092 1199090) and 119888(1198792) = (1 0 1 minus 1199091 1 minus1199093 1199093 0 1199091 0)The associated equation system thus becomes

1199097 = 10 = 01199095 = 1 minus 11990910 = 1 minus 11990931 = 11990930 = 01199091 = 11990911199090 = 0

(7)

The solution set of the equation system as given by Math-ematicarsquos Solve is 119878 = 1199090 = 0 1199093 = 1 1199092 = 1199091 1199095 =1 minus 1199091 1199097 = 1 We can then substitute the variablesin 119888(1198791) using this set thus rendering the templatersquos core(1 0 1 minus 1199091 0 1 0 1199091 0) Notice that the same result wouldbe achieved had we applied the substitutions to 119888(1198792)

If a templatersquos core has variable restrictions a second stepis needed to guarantee that the solution found will not violatethem

For instance consider the templatesrsquo cores 119888(1198791199031) and119888(1198791199031) both with restricted variables 119888(1198791199031) = (1199097 0 1199095 0 10 1199092 isin 0 1 1199090) and 119888(1198791199032) = (1 0 1 minus 1199091 1 minus 1199093 1199093 0 1199091 isin0 0) To intersect 1198791199031 and 1198791199032 we first extract the variablerestriction expressions and then build and solve the systemas usual This time however the substitutions are appliedto both arguments therefore resulting in the set (1 0 1 minus1199091 0 1 0 1199091 isin 0 1 0) (1 0 1 minus 1199091 0 1 0 1199091 isin 0 0)

Now we extract variable restriction expressions andcreate a second equation system whose solutions indicatewhich values the variables may have In the example the setof expressions 1199091 isin 0 1 1199091 isin 0 would be extracted thusyielding the equation system

1199091 = 1 or 1199091 = 01199091 = 0 (8)

By solving this system the solution set 119878 = 1199091 = 0 canfinally be applied to 119888(1198791199031) yielding (1 0 1 0 1 0 0 0) as theresult

5 Template Builders

So far we have seen how templates can be built in orderto represent specific subsets of CA families We can nowgo about making evident the true power of templates byconsidering template builder functions

Template builder functions are algorithms tailored togenerate templates for specific subsets of CAs that share agiven static property

Currently six template builders for static properties areimplemented associated to rules of the following kindscaptive totalistic outer-totalistic number conserving col-orblind and maximum internal symmetry values (see [1])for reflection conjugacy and their composition The lattertwo are not discussed herein partly because we have alreadydiscussed them previously (see [8]) and at least in thecontext number conservation the corresponding templatebuilder simply did not change since its conception Howeverthe builder for rule table symmetries has undergone ageneralisation that now allows for any value of symmetry tobe accounted for not only maximum As such the CATem-plates package contains the SymmetryTemplate builder fullyavailable for use including its corresponding documentationbut we decided not to include it in the paper because itcannot yet handle arbitrary number of states in the case ofconjugation

So this section discusses builder functions for totalisticouter-totalistic captive and colorblind templates

51 Template Builder for Totalistic and Outer-Totalistic CAs

Definition 2 (totality) A totalistic CAmdashor alternatively aCA that presents the totality propertymdashis one whose statetransitions only depend on the sum of the state values of thecells in a given neighbourhood

Formally let 119891 be the local transition function of a CAdefined over the set119873 of possible neighborhoods for the CArsquosspace Let 119899 be the size of a neighbourhood of 119873 Let 119860 =(1205721 120572119899) and 119861 = (1205731 120573119899) be neighborhoods of 119873 ACA is said to be totalistic if and only if the following conditionis true

forall119860 119861 isin 119873( 119899sum119894=1

120572119894 = 119899sum119895=1

120573119895) lArrrArr (119891 (119860) = 119891 (119861)) (9)

Since totality is a static property we can derive a generalalgorithm to find all rule tables of CAs that share the totalityproperty given a value for 119896 and 119903

6 Complexity

The algorithm receives as arguments the values of 119896 and119903 for which the template will be generated It then proceedsto enumerate all possible neighborhoods of the defined spaceand calculates their sum

Now for every sum value found in the previous step thealgorithm picks the neighbourhood representing the smallest119896-ary number and assigns a variable corresponding to thatneighbourhoodrsquos decimal value to all of the state transitionsthat shared a result with it For instance let us considerall neighborhoods of the elementary space whose statessum equals 2 (1 1 0) (1 0 1) (0 1 1) Since the smallestneighbourhood in this set is (0 1 1) which is decimal 3 weassign to their respective transitions the result 1199093

The templatersquos core for the elementary space becomes

119888 (119879119905119900119905119886119897119894119904119905119894119888119864119878) = (1199097 1199093 1199093 1199091 1199093 1199091 1199091 1199090) (10)

Upon expansion this template yields the rule tables ofthe 16 totalistic elementary CAs Notice that this templatersquoscore is composed of only free variables and references toother free variables This being the case every expansionof this template shall yield a valid result excluding theneed to define any expansion modifier function other than119868119889119890119899119905119894119905119910119872119886119901119901119890119903

For 119896 = 3 and 119903 = 1 the resulting template would be

11987911990511990011990531 = (3 10 (11990926 11990917 1199098 11990917 1199098 1199095 1199098 1199095 1199092 11990917 11990981199095 1199098 1199095 1199092 1199095 1199092 1199091 1199098 1199095 1199092 1199095 1199092 1199091 1199092 1199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903)

(11)

Upon expansion this template yields the 2187 totalisticrules of the referred space

Definition 3 (outer-totality) An outer-totalistic CAmdashor al-ternatively a CA that presents the outer-totality propertymdashis one whose local rule considers the sum of the state valuesof the external cells of a neighbourhood (ie those except thecenter cell) in addition to the state value of the center cellitself

Formally let 119891 be the local transition function of a CAdefined over the set119873 of possible neighborhoods for the CArsquosspace Let 119899 be the size of a neighbourhood of 119873 and let119898 = lceil1198992rceil be the index of the cell that is meant to undergoa state change (ie the center cell when 119899 is an odd number)Let 119860 = (1205721 120572119898 120572119899) and 119861 = (1205731 120573119898 120573119899) beneighborhoods of119873 A CA is said to be outer-totalistic if andonly if the following condition is true

forall119860 119861 isin 119873((119898minus1sum119894=1

120572119894 + 119899sum119894=119898+1

120572119894 = 119898minus1sum119895=1

120573119895 + 119899sum119895=119898+1

120573119895)

and (120572119898 = 120573119898)) lArrrArr (119891 (119860) = 119891 (119861)) (12)

The algorithm for outer-totalistic templates is almost thesame as the one for totalistic rules with the exception that

it considers the sum of external cells in the neighbourhoodinstead of its entirety

The algorithmrsquos output for the elementary space is

119888 (119879119900119906119905119890119903minus119905119900119905119886119897119894119904119905119894119888119864119878) = (1199097 1199093 1199095 1199091 1199093 1199092 1199091 1199090) (13)

Upon expansion this template generates the 64 outer-totalistic elementary CAs

For reference here is the result for 119896 = 3 and 119903 = 1whichafter expansion would yield the 14 348 907 outer-totalisticrules of the space since 15 distinct variables are present inthe template

119879119900119906119905119890119903minus11990511990011990531 = (3 10 (11990926 11990917 1199098 x23 11990914 1199095 11990920 11990911 119909211990917 1199098 1199097 11990914 1199095 1199094 11990911 1199092 1199091 1199098 1199097 1199096 1199095 1199094 1199093 11990921199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903)

(14)

52 Template Builder for Captive CAs

Definition 4 (captivity [13]) A CA is said to be captivemdashoralternatively to have the captivity static propertymdashwhenevery transition of its rule table outputs a state that appearsin the corresponding neighbourhood

Formally if 119891 is the local transition function of a CA119860 =(1205721 120572119898 120572119899) is a neighbourhood of size 119899 out of allpossible neighborhoods 119873 and 120573 is an arbitrary state a CAis said to be captive if and only if the following condition istrue

forall119860 isin 119873119891 (1205721 120572119899) = 120573 lArrrArr 120573 isin 1205721 120572119899 (15)

In the binary case this naturally simplifies to the fact thatevery CA with 119891(01 02 0119899) = 0 and 119891(11 12 1119899) = 1is captive for any radius 119903

As a static property a general algorithm to find templatesof captive CAs for a given space does exist As such thealgorithm receives the values for 119896 and 119903 and starts bygenerating all possible neighborhoods for the space

It then uses the following simple rules to decide how totransform this neighbourhood in a template output

(i) If the neighbourhood is homogeneous like (1 1 1)the transition should output the only state thatappears in the neighbourhood (1)

(ii) If the neighbourhood is composed of all of the valuesin the interval [0 119896 minus 1] like (1 2 0) for 119896 = 3 and119903 = 1 the transition should output a free variableindexed by the decimal value of the neighbourhoodnamely 11990915 (since 120 in base 119896 = 3 corresponds tothe decimal 15)

(iii) If the neighbourhood is composed of only some of thepossible states the states of the interval [0 119896 minus 1] like(0 2 0) for 119896 = 3 and 119903 = 1 the output should bea variable indexed by the neighbourhood this timerestricted by the present values (1199096 isin 0 2)This typeof neighbourhood only appears when 119896 gt 2

Complexity 7

Note that since this template uses restricted variables itmust use the 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904 expansion modifierfunction

As a result of all the latter the captivity template for theelementary space becomes

119879119888119886119901119905119894V119890 = (2 10 (1 1199096 1199095 1199094 1199093 1199092 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (16)

while for 119896 = 3 and 119903 = 1 the template is

119879119888119886119901119905119894V11989031 = (3 10 (2 11990925 isin 1 2 11990924 isin 0 2 11990923isin 1 2 11990922 isin 1 2 11990921 11990920 isin 0 2 11990919 11990918isin 0 2 11990917 isin 1 2 11990916 isin 1 2 11990915 11990914isin 1 2 1 11990912 isin 0 1 11990911 11990910 isin 0 1 1199099isin 0 1 1199098 isin 0 2 1199097 1199096 isin 0 2 1199095 1199094isin 0 1 1199093 isin 0 1 1199092 isin 0 2 1199091 isin 0 1 0) 119865119894119897119905119890119903119873119900119905119860119897119897119900119908119890119889)

(17)

53 Template Builder for Colorblind CAs In order to fullygrasp the notion of colorblind rules let us first discuss themeaning of permutations in the context of CAs

Definition 5 (colour permutation (120587)) Let framework 119870 bethe set of possible states for a CA in the range [0 119896 minus 1] Acolour permutation 120587 is a bijective function of 119870 to itselfwhich can be written as a set of rules of the form 119896119894 997888rarr 119896119895meaning that a cell in state 119896119894 should be switched to state 119896119895when this permutation is applied

For instance a valid permutation for the case where 119870 =0 1 2 is 1205871 = 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0It is important to notice that every colour permutation

can be represented by an algebraic function that interpolatesthe points defined by the permutation For instance 1205871 couldbe written as 1205871(119909) = 1 + (1 minus 32(minus1 + 119909))119909Definition 6 (symmetric group (119878119870)) The symmetric group119878119870 of a set119870 is the set of all possible permutations over 119870

For instance the symmetric group for119870 = 0 1 2 is119878119870 = 0 997888rarr 0 1 997888rarr 1 2 997888rarr 2

0 997888rarr 0 1 997888rarr 2 2 997888rarr 1 0 997888rarr 1 1 997888rarr 0 2 997888rarr 2 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0 0 997888rarr 2 1 997888rarr 0 2 997888rarr 1 0 997888rarr 2 1 997888rarr 1 2 997888rarr 0

(18)

Definition 7 (neighbourhood permutation (120588(120587))) Let120587 be acolour permutation and let119873 be the set of all possible neigh-borhoods for a given CA The neighbourhood permutation

120588(120587) is a permutation 119873 that uses 120587 to transform 119899119894 isin 119873 intoneighbourhood 119899119895 isin 119873 by applying 120587 to every cell of 119899119894

For instance with119870 = 0 1 2 119903 = 1 and 1205871 = (0 1 2)a valid transformation due to 120588(1205871) would be (0 2 2) 997888rarr(1 0 0) The other transformations can be derived by apply-ing the same reasoning to all of the neighborhoods of119873

Definition 8 (cycle notation of a permutation) A permuta-tion can be written by means of a cycle notation formedby a set of vectors that represent cycles associated with thepermutation

For instance the colour permutation 1205872 = 0 997888rarr 1 1 997888rarr0 2 997888rarr 2 can be written as 1205872 = (0 1) (2) whereeach vector has the form (1199091198941 1199091198942 119909119894119895) 1 le 119895 le 119896 andrepresents a cycle due to the permutation namely the two-step cycle 0 997888rarr 1 997888rarr 0 and the self-loop 2 997888rarr 2Similarly The previous 1205871 permutation would be written incycle notation as 1205871 = (0 1 2)

As for neighbourhood permutations 120588(1205871) for examplewould be represented as follows

120588 (1205871) = ((0 2 2) (1 0 0) (2 1 1)) ((0 2 1) (1 0 2) (2 1 0)) ((0 2 0) (1 0 1) (2 1 2)) ((0 1 2) (1 2 0) (2 0 1)) ((0 1 1) (1 2 2) (2 0 0)) ((0 1 0) (1 2 1) (2 0 2)) ((0 0 2) (1 1 0) (2 2 1)) ((0 0 1) (1 1 2) (2 2 0)) ((0 0 0) (1 1 1) (2 2 2))

(19)

With the previous characterisations we can now define colorblindness

Definition 9 (color blindness [14]) A CA whose cells can bein any of the states of the set 119870 is said to be colorblindmdashoralternatively to possess the color blindness propertymdashif itsspace-time evolution does not change unless by a colourchange after applying any neighbourhood permutation120588(120587) 120587 isin 119878119870 to all state transitions that define its rule table

Notice that for a CA to be invariant to 120588(1205871) its ruletablersquos outputs 119900119894 should be consistent with the cycles formedby the application of 120588(1205871) over its neighborhoods 119887119894 119894 beingthe index of the state transition on the CArsquos rule table

In other words for a rule to be invariant to 1205871 theoutput of say neighbourhood (0 2 2) should be equal tothe application of 1205871 to the output of neighbourhood (1 0 0)since (0 2 2) is transformed into (1 0 0) due to 1205871 for thesame reason the output of (1 0 0) should be equal to theapplication of1205871 to the output of neighbourhood (2 1 1)Thesame happens analogously for the remaining cycles of 120588(1205871)

8 Complexity

Now in order to generate a template representing CAsthat are invariant to the neighbourhood permutation 120588(1205871)we need to assign an output to every neighbourhood andderive a rule table that could be turned into a template

So that outputs follow 120588(1205871) we use its cycle notationrepresentation to assign to every cycle start a free variableindexed by its corresponding neighbourhoodrsquos decimal rep-resentation ending upwith a tuple formed by neighbourhoodand output The (0 2 2) neighbourhood being a cycle startis turned into the tuple ((0 2 2) 1199098) for instance

For every remaining neighbourhood in a cycle we nowapply 1205871 to the free variable found in the previous step 119889times 119889 being the distance from this neighbourhood tothe start of the cycle The cycle ((0 2 2) (1 0 0) (2 1 1))is turned into (((0 2 2) 1199098) ((1 0 0) 1205871(1199098)) ((2 1 1)1205871(1205871(1199098)))) for instance

Applying this procedure to every cycle of 1205871 we obtainthe set(((0 2 2) 1199098) ((1 0 0) 1205871 (1199098))

((2 1 1) 120587 (1205871 (1199098)))) (((0 2 1) 1199097) ((1 0 2) 1205871 (1199097)) ((2 1 0) 120587 (1205871 (1199097)))) (((0 2 0) 1199096) ((1 0 1) 1205871 (1199096)) ((2 1 2) 120587 (1205871 (1199096)))) (((0 1 2) 1199095) ((1 2 0) 1205871 (1199095)) ((2 0 1) 120587 (1205871 (1199095)))) (((0 1 1) 1199094) ((1 2 2) 1205871 (1199094)) ((2 0 0) 120587 (1205871 (1199094)))) (((0 1 0) 1199093) ((1 2 1) 1205871 (1199093)) ((2 0 2) 120587 (1205871 (1199093)))) (((0 0 2) 1199092) ((1 1 0) 1205871 (1199092)) ((2 2 1) 120587 (1205871 (1199092)))) (((0 0 1) 1199091) ((1 1 2) 1205871 (1199091)) ((2 2 0) 120587 (1205871 (1199091)))) (((0 0 0) 1199090) ((1 1 1) 1205871 (1199090)) ((2 2 2) 120587 (1205871 (1199090))))

(20)

We can now flatten a level of this set and turn it into anordered list sorted lexicographically by neighbourhood Thisprocedure yields the rule table shown in Table 2

The core of a template for CAs invariant to 120588(1205871) can nowbe found by compressing this rule table into its 119896-ary form

119879120588(1205871) = (120587 (1205871 (1199090)) 120587 (1205871 (1199092)) 120587 (1205871 (1199091)) 120587 (1205871 (1199096)) 120587 (1205871 (1199098)) 120587 (1205871 (1199097)) 120587 (1205871 (1199093)) 120587 (1205871 (1199095)) 120587 (1205871 (1199094)) 1205871 (1199094) 1205871 (1199093) 1205871 (1199095) 1205871 (1199091) 1205871 (1199090) 1205871 (1199092) 1205871 (1199097) 1205871 (1199096) 1205871 (1199098) 11990981199097 1199096 1199095 1199094 1199093 1199092 1199091 1199090))

(21)

Remember from Definition 5 that any permutation 120587 canbe represented by an algebraic function which is the actual

Table 2 Rule table for the template representative of CAs invariantto 1205871(2 2 2) 120587(1205871(1199090)(2 2 1) 120587(1205871(1199092)(2 2 0) 120587(1205871(1199091)(2 1 2) 120587(1205871(1199096)(2 1 1) 120587(1205871(1199098)(2 1 0) 120587(1205871(1199097)(2 0 2) 120587(1205871(1199093)(2 0 1) 120587(1205871(1199095)(2 0 0) 120587(1205871(1199094)(1 2 2) 1205871(1199094)(1 2 1) 1205871(1199093)(1 2 0) 1205871(1199095)(1 1 2) 1205871(1199091)(1 1 1) 1205871(1199090)(1 1 0) 1205871(1199092)(1 0 2) 1205871(1199097)(1 0 1) 1205871(1199096)(1 0 0) 1205871(1199098)(0 2 2) 1199098(0 2 1) 1199097(0 2 0) 1199096(0 1 2) 1199095(0 1 1) 1199094(0 1 0) 1199093(0 0 2) 1199092(0 0 1) 1199091(0 0 0) 1199090

representation used by the algorithm We use the 120587 nota-tion here since it is compact and serves the explanationrsquospurpose

The same procedure can now be repeated for every per-mutation of the 119878119896 set essentially mapping each permutationof the set to a corresponding template of CAs invariant to thatpermutation It is now only a matter of intersecting all of thetemplates found and the result is a template that representsall colorblind rules of the space defined by 119896 and 119903

When applied to 119896 = 2 and 119903 = 1 we obtain119879119888119900119897119900119906119903119887119897119894119899119889

= (1 minus 1199090 1 minus 1199091 1 minus 1199092 1 minus 1199093 1199093 1199092 1199091 1199090) (22)

whereas for 119896 = 3 and 119903 = 1 the result becomes

11987911988811990011989711990011990611990311988711989711989411989911988931 = (2 2 minus 1199091 2 minus 21199091 2 minus 1199093 2 minus 1199094 2minus 1199095 2 minus 2 1199093 2 minus 21199095 2 minus 21199094 1 minus 21199094 1 minus 21199093 1minus 21199095 1 minus 21199091 1 1 + 21199091 1 + 21199095 1 + 21199093 1+ 21199094 21199094 21199095 21199093 1199095 1199094 1199093 21199091 1199091 0)

(23)

Complexity 9

6 A Detailed Example

Here we discuss a detailed application for the templateframework presented in this paper which is to find the rulesthat share a set of static properties This can be achieved withthe template builder functions provided with CATemplatesor one could implement custom builder functions on top ofthe core concepts provided by the package What follows isa sample of how the framework can be used to conduct anexperiment of this sort

More specifically let us suppose we are interested in therules which are both totalistic and captive This might comefrom a purely theoretical interest or motivated by the needfor obtaining rules of this type for some practical application

We then start by building the templates for totalisticand captive rules of the elementary space as shown in theprevious sections (119879119905119900119905119886119897119894119904119905119894119888 and 119879119888119886119901119905119894V119890) By performing theirintersection we end up with a template representing alltotalistic and captive rules of the elementary space as follows

11987911989621199031 = (2 10 (1 1199093 1199093 1199091 1199093 1199091 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (24)

Upon expansion this template yields the 4 totalisticelementary CAs which are also captive 128 150 232 254Notice that the template being expanded has only 2 variableswhichmeans the expansion has to consider only 4 expansioncandidates which is a substantially smaller subset of theoriginal space which has 256 rules

Since the elementary space is a small one let us performthe same example in larger spaces We can generate theequivalent templates for the space defined by 119896 = 3 and 119903 = 1and perform the intersection between them The result is

11987911989631199031 = (3 10 (2 11990917 isin 1 2 2 11990917isin 1 2 2 1 2 1 0 11990917 isin 1 2 2 1 2 1 0 1 0 1199091isin 0 1 2 1 0 1 0 1199091 isin 0 1 0 1199091 isin 0 1 0)FilterVariableAssignments)

(25)

Notice that this template also has two variables 1199091 and11990917 This means there are only 32 = 9 possible expansions forthis template from which some will be filtered out becauseof the variable assignment annotations After expansion thistemplate yields the 4 totalistic rules of the spacewhich are alsocaptive 223160992 223161514 265235104 265235626

This means that we took a space with 327 = 7 625 597484 987 rules and found out that only 4 of those sharethe totality and captivity properties all without actuallyenumerating the whole space (which would be not feasiblegiven its size) Notice that this space could be further reducedby intersecting this resulting template with templates fromother properties like color blindness

Extending the previous case we may now ask the generalquestion of up to which rule space size could we still manageto get access to totalistic and captive rulesWithout templatesthe rules would have to be obtained directly by scanningthe rule space and selecting those having the two properties

But with 119896 = 3 this approach would already be impracticaleven for 119903 = 1 on a standard personal computer since thespace has ≃ 76 times 1012 rules A first alternative now usingtemplates could be accessing the rules say by first expandingthe totalistic rules directly from the corresponding templateand then filtering out the captive ones This certainly helpsIn fact by doing so progressively starting with radius 119903 = 05and increasing its value in steps of 05 in a standard personalcomputer it would hardly be possible to reach beyond 119903 = 2(which corresponds to a space with ≃ 87 times 10115 rules)because of the substantial increase in computational timeas we would go from a given 119903 to its subsequent valueWe omit actual values of processing time here as this maystrongly vary among different machine architectures andtheir software environment

However by relying on the generation of the individualtemplates of each property and expanding the intersectionbetween them we easily access spaces up to 119903 = 4 (possiblyeven beyond) which contains ≃ 15times109391 rules It turns outthat in this space only 256 rules share the two properties anextremely smaller space to reason about

Furthermore the analysis of all the data generated fromthe previous experiment suggests that the number of ruleswith 119896 = 3 and the shared properties of totality andcaptivity seems to be given by 4119903 for symmetric rules (thosewith integer radius) whereas no rule would be present forasymmetric rules This is quite a remarkable general resultderived from direct probing of the corresponding rule spacesthat the full usage of templates allowed us

As a final note it is worth emphasising that templateexpansion is only made when the actual rules representedin a template are needed which is at the end of the processof answering which rules satisfy a given set of propertiesUntil then it suffices to operate directly with the tem-plates this is where the conciseness of template usage liesAnd although expansion may be computationally intensiveit is certainly much less than if the entire correspond-ing spaces would have to be manipulated directly all theway

7 Concluding Remarks

Searching for cellular automata with specific behaviours(such as global problem solvers) is a daunting task for anyonelooking further than the elementary space

In this paper we presented the current state of cellularautomata templates a valuable ally in this front We havedescribed what templates are and how the two currentlyimplemented operations (expansion and intersection) workwent into details of the implementations of template builderfunctions for captive totalistic outer-totalistic and color-blind rules and have shown a sample application of theframework established here

The sample application has led us to the discovery thatonly a handful of CAs share both of the properties of totalityand captivity (only 64 rules on the 119896 = 3 119903 = 3 spacefor instance) This little experiment shows how the proposedframework can be used as a means to sieve through very largespaceswhen searching forCAs that present a given behaviour

10 Complexity

As mentioned in distinct parts of the text the notionof templates and the implementation of the computationalsystem to support it underwent a long way since its originup to its current degree of structural maturity

The natural course from here is to develop new templatebuilders and whichever other operations we might conceiveMore concretely with respect to the latter we should say thatduring the last couple of years we have been investigating thenotion of ldquodifferencerdquo between templates an operationwhoseoutput would yield another template representing the rulesthat have the property associated with the first template butnot having the property associated with the second In spiteof a conference publication we have on the topic (see [15]) itis not yet mature to go into the publicly available package Butin due time we intend to do so

As for new template builders a generalisation of oneto handle arbitrary values of symmetry by conjugation ismore pressing As mentioned earlier we decided not toinclude this template builder mostly because the existing onecannot yet handle arbitrary number of states in the caseof conjugation However noticing that the notion of colorblindness is essentially the notion of rules with maximumsymmetry by conjugation generalised for any 119896-state ruleusing the same idea implemented for color blindness it isnow possible to face the generalisation of arbitrary values ofsymmetry by conjugation This is clearly future work to bedone

Also it is tempting to add completely new templatebuilders to the present package referring to other parameterslike those in [16] In fact we hope that this paper triggerscollaborative participation from the cellular automata com-munity in terms of both the systemrsquos expansion and its usein applications This is why we decided to keep the work inGitHub publicly available

As for the possibility of extending the framework tosupport rules in higher dimensions we would say this wouldbe readily possible for all current properties but one numberconservation This is due to the fact that the underlyingalgorithm we used to implement the corresponding tem-plate builder comes from [17] which is restricted to one-dimensional rules In order to change that a general algo-rithm would have to be used quite likely the one describedin [18]This is certainly feasible and desirable but we had notyet had the opportunity to go about that

Data Availability

The data used to support the findings of this study are avail-able from the corresponding author upon request and theCATemplates Mathematica package directly from GitHub[10]

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

The authors are grateful to financial support fromIPM (Instituto Presbiteriano Mackenzie) and CAPES

(Coordenacao de Aperfeicoamento de Pessoal de NıvelSuperior Brazil) by means of STIC-AmSud (CoDANet)project no 888811974562018-01 and PrInt project no 888873102812018-00

References

[1] S Wolfram A New Kind of Science WolframMedia Inc 2002[2] J L Zapotecatl D A Rosenblueth and C Gershenson ldquoDelib-

erative self-organizing traffic lights with elementary cellularautomatardquo Complexity vol 2017 Article ID 7691370 15 pages2017

[3] D Wolz and P P B de Oliveira ldquoVery effective evolutionarytechniques for searching cellular automata rule spacesrdquo Journalof Cellular Automata vol 3 no 4 pp 289ndash312 2008

[4] I Barragan-Vite J C Seck-Tuoh-MoraN Hernandez-RomeroJMedina-Marin and E S Hernandez-Gress ldquoDistributed con-trol of a manufacturing system with one-dimensional cellularautomatardquo Complexity vol 2018 Article ID 7235105 15 pages2018

[5] J Yang W Liu Y Li X Li and Q Ge ldquoSimulating intraurbanland use dynamics under multiple scenarios based on fuzzycellular automata a case study of Jinzhou District DalianrdquoComplexity vol 2018 Article ID 7202985 17 pages 2018

[6] H Betel P P B De Oliveira and P Flocchini ldquoSolving theparity problem in one-dimensional cellular automatardquo NaturalComputing vol 12 no 3 pp 323ndash337 2013

[7] M Bidlo ldquoOn routine evolution of complex cellular automatardquoIEEE Transactions on Evolutionary Computation vol 20 no 5pp 742ndash754 2016

[8] P de Oliveira andMVerardo ldquoRepresenting families of cellularautomata rulesrdquoThe Mathematica Journal vol 16 no 8 2014

[9] Wolfram Research ldquoWolfram mathematica 11rdquo httpwwwwolframcommathematica 2018

[10] M Verardo and P P B de Oliveira ldquoCATemplatesrdquo httpsgithubcommverardoCATemplates 2019

[11] P P B de Oliveira ldquoOn density determination with cellularautomata Results constructions and directionsrdquo Journal ofCellular Automata vol 9 no 5-6 pp 357ndash385 2014

[12] P P B de Oliveira andMVerardo ldquoTemplate based representa-tion of cellular automata rulesrdquo inProceedings of the ExploratoryPapers - AUTOMATA 2014 - 20th International Workshop onCellular Automata and Discrete Complex Systems T IsokawaK Imai N Matsiu F Peper and H Umeo Eds pp 199ndash2042014

[13] G Theyssier ldquoCaptive cellular automatardquo in MathematicalFoundations of Computer Science vol 3153 of Lecture Notes inComputer Science pp 427ndash438 2004

[14] V Salo and I Torma ldquoColor blind cellular automatardquo inCellularAutomata and Discrete Complex Systems J Kari M Kutrib andAMalcher Eds pp 139ndash154 SpringerHeidelberg Berlin 2013

[15] Z Soares M Verardo and P P de Oliveira ldquoThe differenceoperation between templates of binary cellular automatardquo inNew Advances in Information Systems and Technologies ARocha A M Correia H Adeli L P Reis and M M TeixeiraEds vol 444 of Advances in Intelligent Systems and Computingpp 707ndash715 Springer International Publishing Cham Swizer-land 2016

Complexity 11

[16] G M Oliveira P P Oliveira and N Omar ldquoDefinitionand application of a five-parameter characterization of one-dimensional cellular automata rule spacerdquo Artificial Life vol 7no 3 pp 277ndash301 2001

[17] N Boccara and H Fuks ldquoNumber-conserving cellular automa-ton rulesrdquo Fundamenta Informaticae vol 52 no 1-3 pp 1ndash132002

[18] B Durand E Formenti and Z Roka ldquoNumber-conservingcellular automata I decidabilityrdquoTheoretical Computer Sciencevol 299 no 1-3 pp 523ndash535 2003

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 5: A Fully Operational Framework for Handling Cellular ...downloads.hindawi.com/journals/complexity/2019/6573793.pdf · is a brief overview of cellular automata and their inner workings,

Complexity 5

42 Intersection Template intersection is a function of twotemplates which results in a template whose associated set 119877is equivalent to intersecting the 119877 sets of the two templatesreceived as arguments In another form

119868 (1198791 1198792) = 1198793 lArr997904 119864 (1198793) = 119864 (1198791) cap 119864 (1198792) (6)

Template intersection initially consists of building anequation system with the templatersquos cores received asoperands The equation system is then submitted to Mathe-maticarsquos Solve function [9] which solves it for the variablesthat admit a solution and elicits the relations among theremaining variables The resulting set of variable values andrelations is then applied to any of the two operands and theoutcome is a new template representing only the intersectionbetween both of the input templates

If the system has no solution this means both templatesrepresent disjoint 119877 sets and by definition do not intersect

As an example consider the template cores 119888(1198791) =(1199097 0 1199095 0 1 0 1199092 1199090) and 119888(1198792) = (1 0 1 minus 1199091 1 minus1199093 1199093 0 1199091 0)The associated equation system thus becomes

1199097 = 10 = 01199095 = 1 minus 11990910 = 1 minus 11990931 = 11990930 = 01199091 = 11990911199090 = 0

(7)

The solution set of the equation system as given by Math-ematicarsquos Solve is 119878 = 1199090 = 0 1199093 = 1 1199092 = 1199091 1199095 =1 minus 1199091 1199097 = 1 We can then substitute the variablesin 119888(1198791) using this set thus rendering the templatersquos core(1 0 1 minus 1199091 0 1 0 1199091 0) Notice that the same result wouldbe achieved had we applied the substitutions to 119888(1198792)

If a templatersquos core has variable restrictions a second stepis needed to guarantee that the solution found will not violatethem

For instance consider the templatesrsquo cores 119888(1198791199031) and119888(1198791199031) both with restricted variables 119888(1198791199031) = (1199097 0 1199095 0 10 1199092 isin 0 1 1199090) and 119888(1198791199032) = (1 0 1 minus 1199091 1 minus 1199093 1199093 0 1199091 isin0 0) To intersect 1198791199031 and 1198791199032 we first extract the variablerestriction expressions and then build and solve the systemas usual This time however the substitutions are appliedto both arguments therefore resulting in the set (1 0 1 minus1199091 0 1 0 1199091 isin 0 1 0) (1 0 1 minus 1199091 0 1 0 1199091 isin 0 0)

Now we extract variable restriction expressions andcreate a second equation system whose solutions indicatewhich values the variables may have In the example the setof expressions 1199091 isin 0 1 1199091 isin 0 would be extracted thusyielding the equation system

1199091 = 1 or 1199091 = 01199091 = 0 (8)

By solving this system the solution set 119878 = 1199091 = 0 canfinally be applied to 119888(1198791199031) yielding (1 0 1 0 1 0 0 0) as theresult

5 Template Builders

So far we have seen how templates can be built in orderto represent specific subsets of CA families We can nowgo about making evident the true power of templates byconsidering template builder functions

Template builder functions are algorithms tailored togenerate templates for specific subsets of CAs that share agiven static property

Currently six template builders for static properties areimplemented associated to rules of the following kindscaptive totalistic outer-totalistic number conserving col-orblind and maximum internal symmetry values (see [1])for reflection conjugacy and their composition The lattertwo are not discussed herein partly because we have alreadydiscussed them previously (see [8]) and at least in thecontext number conservation the corresponding templatebuilder simply did not change since its conception Howeverthe builder for rule table symmetries has undergone ageneralisation that now allows for any value of symmetry tobe accounted for not only maximum As such the CATem-plates package contains the SymmetryTemplate builder fullyavailable for use including its corresponding documentationbut we decided not to include it in the paper because itcannot yet handle arbitrary number of states in the case ofconjugation

So this section discusses builder functions for totalisticouter-totalistic captive and colorblind templates

51 Template Builder for Totalistic and Outer-Totalistic CAs

Definition 2 (totality) A totalistic CAmdashor alternatively aCA that presents the totality propertymdashis one whose statetransitions only depend on the sum of the state values of thecells in a given neighbourhood

Formally let 119891 be the local transition function of a CAdefined over the set119873 of possible neighborhoods for the CArsquosspace Let 119899 be the size of a neighbourhood of 119873 Let 119860 =(1205721 120572119899) and 119861 = (1205731 120573119899) be neighborhoods of 119873 ACA is said to be totalistic if and only if the following conditionis true

forall119860 119861 isin 119873( 119899sum119894=1

120572119894 = 119899sum119895=1

120573119895) lArrrArr (119891 (119860) = 119891 (119861)) (9)

Since totality is a static property we can derive a generalalgorithm to find all rule tables of CAs that share the totalityproperty given a value for 119896 and 119903

6 Complexity

The algorithm receives as arguments the values of 119896 and119903 for which the template will be generated It then proceedsto enumerate all possible neighborhoods of the defined spaceand calculates their sum

Now for every sum value found in the previous step thealgorithm picks the neighbourhood representing the smallest119896-ary number and assigns a variable corresponding to thatneighbourhoodrsquos decimal value to all of the state transitionsthat shared a result with it For instance let us considerall neighborhoods of the elementary space whose statessum equals 2 (1 1 0) (1 0 1) (0 1 1) Since the smallestneighbourhood in this set is (0 1 1) which is decimal 3 weassign to their respective transitions the result 1199093

The templatersquos core for the elementary space becomes

119888 (119879119905119900119905119886119897119894119904119905119894119888119864119878) = (1199097 1199093 1199093 1199091 1199093 1199091 1199091 1199090) (10)

Upon expansion this template yields the rule tables ofthe 16 totalistic elementary CAs Notice that this templatersquoscore is composed of only free variables and references toother free variables This being the case every expansionof this template shall yield a valid result excluding theneed to define any expansion modifier function other than119868119889119890119899119905119894119905119910119872119886119901119901119890119903

For 119896 = 3 and 119903 = 1 the resulting template would be

11987911990511990011990531 = (3 10 (11990926 11990917 1199098 11990917 1199098 1199095 1199098 1199095 1199092 11990917 11990981199095 1199098 1199095 1199092 1199095 1199092 1199091 1199098 1199095 1199092 1199095 1199092 1199091 1199092 1199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903)

(11)

Upon expansion this template yields the 2187 totalisticrules of the referred space

Definition 3 (outer-totality) An outer-totalistic CAmdashor al-ternatively a CA that presents the outer-totality propertymdashis one whose local rule considers the sum of the state valuesof the external cells of a neighbourhood (ie those except thecenter cell) in addition to the state value of the center cellitself

Formally let 119891 be the local transition function of a CAdefined over the set119873 of possible neighborhoods for the CArsquosspace Let 119899 be the size of a neighbourhood of 119873 and let119898 = lceil1198992rceil be the index of the cell that is meant to undergoa state change (ie the center cell when 119899 is an odd number)Let 119860 = (1205721 120572119898 120572119899) and 119861 = (1205731 120573119898 120573119899) beneighborhoods of119873 A CA is said to be outer-totalistic if andonly if the following condition is true

forall119860 119861 isin 119873((119898minus1sum119894=1

120572119894 + 119899sum119894=119898+1

120572119894 = 119898minus1sum119895=1

120573119895 + 119899sum119895=119898+1

120573119895)

and (120572119898 = 120573119898)) lArrrArr (119891 (119860) = 119891 (119861)) (12)

The algorithm for outer-totalistic templates is almost thesame as the one for totalistic rules with the exception that

it considers the sum of external cells in the neighbourhoodinstead of its entirety

The algorithmrsquos output for the elementary space is

119888 (119879119900119906119905119890119903minus119905119900119905119886119897119894119904119905119894119888119864119878) = (1199097 1199093 1199095 1199091 1199093 1199092 1199091 1199090) (13)

Upon expansion this template generates the 64 outer-totalistic elementary CAs

For reference here is the result for 119896 = 3 and 119903 = 1whichafter expansion would yield the 14 348 907 outer-totalisticrules of the space since 15 distinct variables are present inthe template

119879119900119906119905119890119903minus11990511990011990531 = (3 10 (11990926 11990917 1199098 x23 11990914 1199095 11990920 11990911 119909211990917 1199098 1199097 11990914 1199095 1199094 11990911 1199092 1199091 1199098 1199097 1199096 1199095 1199094 1199093 11990921199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903)

(14)

52 Template Builder for Captive CAs

Definition 4 (captivity [13]) A CA is said to be captivemdashoralternatively to have the captivity static propertymdashwhenevery transition of its rule table outputs a state that appearsin the corresponding neighbourhood

Formally if 119891 is the local transition function of a CA119860 =(1205721 120572119898 120572119899) is a neighbourhood of size 119899 out of allpossible neighborhoods 119873 and 120573 is an arbitrary state a CAis said to be captive if and only if the following condition istrue

forall119860 isin 119873119891 (1205721 120572119899) = 120573 lArrrArr 120573 isin 1205721 120572119899 (15)

In the binary case this naturally simplifies to the fact thatevery CA with 119891(01 02 0119899) = 0 and 119891(11 12 1119899) = 1is captive for any radius 119903

As a static property a general algorithm to find templatesof captive CAs for a given space does exist As such thealgorithm receives the values for 119896 and 119903 and starts bygenerating all possible neighborhoods for the space

It then uses the following simple rules to decide how totransform this neighbourhood in a template output

(i) If the neighbourhood is homogeneous like (1 1 1)the transition should output the only state thatappears in the neighbourhood (1)

(ii) If the neighbourhood is composed of all of the valuesin the interval [0 119896 minus 1] like (1 2 0) for 119896 = 3 and119903 = 1 the transition should output a free variableindexed by the decimal value of the neighbourhoodnamely 11990915 (since 120 in base 119896 = 3 corresponds tothe decimal 15)

(iii) If the neighbourhood is composed of only some of thepossible states the states of the interval [0 119896 minus 1] like(0 2 0) for 119896 = 3 and 119903 = 1 the output should bea variable indexed by the neighbourhood this timerestricted by the present values (1199096 isin 0 2)This typeof neighbourhood only appears when 119896 gt 2

Complexity 7

Note that since this template uses restricted variables itmust use the 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904 expansion modifierfunction

As a result of all the latter the captivity template for theelementary space becomes

119879119888119886119901119905119894V119890 = (2 10 (1 1199096 1199095 1199094 1199093 1199092 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (16)

while for 119896 = 3 and 119903 = 1 the template is

119879119888119886119901119905119894V11989031 = (3 10 (2 11990925 isin 1 2 11990924 isin 0 2 11990923isin 1 2 11990922 isin 1 2 11990921 11990920 isin 0 2 11990919 11990918isin 0 2 11990917 isin 1 2 11990916 isin 1 2 11990915 11990914isin 1 2 1 11990912 isin 0 1 11990911 11990910 isin 0 1 1199099isin 0 1 1199098 isin 0 2 1199097 1199096 isin 0 2 1199095 1199094isin 0 1 1199093 isin 0 1 1199092 isin 0 2 1199091 isin 0 1 0) 119865119894119897119905119890119903119873119900119905119860119897119897119900119908119890119889)

(17)

53 Template Builder for Colorblind CAs In order to fullygrasp the notion of colorblind rules let us first discuss themeaning of permutations in the context of CAs

Definition 5 (colour permutation (120587)) Let framework 119870 bethe set of possible states for a CA in the range [0 119896 minus 1] Acolour permutation 120587 is a bijective function of 119870 to itselfwhich can be written as a set of rules of the form 119896119894 997888rarr 119896119895meaning that a cell in state 119896119894 should be switched to state 119896119895when this permutation is applied

For instance a valid permutation for the case where 119870 =0 1 2 is 1205871 = 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0It is important to notice that every colour permutation

can be represented by an algebraic function that interpolatesthe points defined by the permutation For instance 1205871 couldbe written as 1205871(119909) = 1 + (1 minus 32(minus1 + 119909))119909Definition 6 (symmetric group (119878119870)) The symmetric group119878119870 of a set119870 is the set of all possible permutations over 119870

For instance the symmetric group for119870 = 0 1 2 is119878119870 = 0 997888rarr 0 1 997888rarr 1 2 997888rarr 2

0 997888rarr 0 1 997888rarr 2 2 997888rarr 1 0 997888rarr 1 1 997888rarr 0 2 997888rarr 2 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0 0 997888rarr 2 1 997888rarr 0 2 997888rarr 1 0 997888rarr 2 1 997888rarr 1 2 997888rarr 0

(18)

Definition 7 (neighbourhood permutation (120588(120587))) Let120587 be acolour permutation and let119873 be the set of all possible neigh-borhoods for a given CA The neighbourhood permutation

120588(120587) is a permutation 119873 that uses 120587 to transform 119899119894 isin 119873 intoneighbourhood 119899119895 isin 119873 by applying 120587 to every cell of 119899119894

For instance with119870 = 0 1 2 119903 = 1 and 1205871 = (0 1 2)a valid transformation due to 120588(1205871) would be (0 2 2) 997888rarr(1 0 0) The other transformations can be derived by apply-ing the same reasoning to all of the neighborhoods of119873

Definition 8 (cycle notation of a permutation) A permuta-tion can be written by means of a cycle notation formedby a set of vectors that represent cycles associated with thepermutation

For instance the colour permutation 1205872 = 0 997888rarr 1 1 997888rarr0 2 997888rarr 2 can be written as 1205872 = (0 1) (2) whereeach vector has the form (1199091198941 1199091198942 119909119894119895) 1 le 119895 le 119896 andrepresents a cycle due to the permutation namely the two-step cycle 0 997888rarr 1 997888rarr 0 and the self-loop 2 997888rarr 2Similarly The previous 1205871 permutation would be written incycle notation as 1205871 = (0 1 2)

As for neighbourhood permutations 120588(1205871) for examplewould be represented as follows

120588 (1205871) = ((0 2 2) (1 0 0) (2 1 1)) ((0 2 1) (1 0 2) (2 1 0)) ((0 2 0) (1 0 1) (2 1 2)) ((0 1 2) (1 2 0) (2 0 1)) ((0 1 1) (1 2 2) (2 0 0)) ((0 1 0) (1 2 1) (2 0 2)) ((0 0 2) (1 1 0) (2 2 1)) ((0 0 1) (1 1 2) (2 2 0)) ((0 0 0) (1 1 1) (2 2 2))

(19)

With the previous characterisations we can now define colorblindness

Definition 9 (color blindness [14]) A CA whose cells can bein any of the states of the set 119870 is said to be colorblindmdashoralternatively to possess the color blindness propertymdashif itsspace-time evolution does not change unless by a colourchange after applying any neighbourhood permutation120588(120587) 120587 isin 119878119870 to all state transitions that define its rule table

Notice that for a CA to be invariant to 120588(1205871) its ruletablersquos outputs 119900119894 should be consistent with the cycles formedby the application of 120588(1205871) over its neighborhoods 119887119894 119894 beingthe index of the state transition on the CArsquos rule table

In other words for a rule to be invariant to 1205871 theoutput of say neighbourhood (0 2 2) should be equal tothe application of 1205871 to the output of neighbourhood (1 0 0)since (0 2 2) is transformed into (1 0 0) due to 1205871 for thesame reason the output of (1 0 0) should be equal to theapplication of1205871 to the output of neighbourhood (2 1 1)Thesame happens analogously for the remaining cycles of 120588(1205871)

8 Complexity

Now in order to generate a template representing CAsthat are invariant to the neighbourhood permutation 120588(1205871)we need to assign an output to every neighbourhood andderive a rule table that could be turned into a template

So that outputs follow 120588(1205871) we use its cycle notationrepresentation to assign to every cycle start a free variableindexed by its corresponding neighbourhoodrsquos decimal rep-resentation ending upwith a tuple formed by neighbourhoodand output The (0 2 2) neighbourhood being a cycle startis turned into the tuple ((0 2 2) 1199098) for instance

For every remaining neighbourhood in a cycle we nowapply 1205871 to the free variable found in the previous step 119889times 119889 being the distance from this neighbourhood tothe start of the cycle The cycle ((0 2 2) (1 0 0) (2 1 1))is turned into (((0 2 2) 1199098) ((1 0 0) 1205871(1199098)) ((2 1 1)1205871(1205871(1199098)))) for instance

Applying this procedure to every cycle of 1205871 we obtainthe set(((0 2 2) 1199098) ((1 0 0) 1205871 (1199098))

((2 1 1) 120587 (1205871 (1199098)))) (((0 2 1) 1199097) ((1 0 2) 1205871 (1199097)) ((2 1 0) 120587 (1205871 (1199097)))) (((0 2 0) 1199096) ((1 0 1) 1205871 (1199096)) ((2 1 2) 120587 (1205871 (1199096)))) (((0 1 2) 1199095) ((1 2 0) 1205871 (1199095)) ((2 0 1) 120587 (1205871 (1199095)))) (((0 1 1) 1199094) ((1 2 2) 1205871 (1199094)) ((2 0 0) 120587 (1205871 (1199094)))) (((0 1 0) 1199093) ((1 2 1) 1205871 (1199093)) ((2 0 2) 120587 (1205871 (1199093)))) (((0 0 2) 1199092) ((1 1 0) 1205871 (1199092)) ((2 2 1) 120587 (1205871 (1199092)))) (((0 0 1) 1199091) ((1 1 2) 1205871 (1199091)) ((2 2 0) 120587 (1205871 (1199091)))) (((0 0 0) 1199090) ((1 1 1) 1205871 (1199090)) ((2 2 2) 120587 (1205871 (1199090))))

(20)

We can now flatten a level of this set and turn it into anordered list sorted lexicographically by neighbourhood Thisprocedure yields the rule table shown in Table 2

The core of a template for CAs invariant to 120588(1205871) can nowbe found by compressing this rule table into its 119896-ary form

119879120588(1205871) = (120587 (1205871 (1199090)) 120587 (1205871 (1199092)) 120587 (1205871 (1199091)) 120587 (1205871 (1199096)) 120587 (1205871 (1199098)) 120587 (1205871 (1199097)) 120587 (1205871 (1199093)) 120587 (1205871 (1199095)) 120587 (1205871 (1199094)) 1205871 (1199094) 1205871 (1199093) 1205871 (1199095) 1205871 (1199091) 1205871 (1199090) 1205871 (1199092) 1205871 (1199097) 1205871 (1199096) 1205871 (1199098) 11990981199097 1199096 1199095 1199094 1199093 1199092 1199091 1199090))

(21)

Remember from Definition 5 that any permutation 120587 canbe represented by an algebraic function which is the actual

Table 2 Rule table for the template representative of CAs invariantto 1205871(2 2 2) 120587(1205871(1199090)(2 2 1) 120587(1205871(1199092)(2 2 0) 120587(1205871(1199091)(2 1 2) 120587(1205871(1199096)(2 1 1) 120587(1205871(1199098)(2 1 0) 120587(1205871(1199097)(2 0 2) 120587(1205871(1199093)(2 0 1) 120587(1205871(1199095)(2 0 0) 120587(1205871(1199094)(1 2 2) 1205871(1199094)(1 2 1) 1205871(1199093)(1 2 0) 1205871(1199095)(1 1 2) 1205871(1199091)(1 1 1) 1205871(1199090)(1 1 0) 1205871(1199092)(1 0 2) 1205871(1199097)(1 0 1) 1205871(1199096)(1 0 0) 1205871(1199098)(0 2 2) 1199098(0 2 1) 1199097(0 2 0) 1199096(0 1 2) 1199095(0 1 1) 1199094(0 1 0) 1199093(0 0 2) 1199092(0 0 1) 1199091(0 0 0) 1199090

representation used by the algorithm We use the 120587 nota-tion here since it is compact and serves the explanationrsquospurpose

The same procedure can now be repeated for every per-mutation of the 119878119896 set essentially mapping each permutationof the set to a corresponding template of CAs invariant to thatpermutation It is now only a matter of intersecting all of thetemplates found and the result is a template that representsall colorblind rules of the space defined by 119896 and 119903

When applied to 119896 = 2 and 119903 = 1 we obtain119879119888119900119897119900119906119903119887119897119894119899119889

= (1 minus 1199090 1 minus 1199091 1 minus 1199092 1 minus 1199093 1199093 1199092 1199091 1199090) (22)

whereas for 119896 = 3 and 119903 = 1 the result becomes

11987911988811990011989711990011990611990311988711989711989411989911988931 = (2 2 minus 1199091 2 minus 21199091 2 minus 1199093 2 minus 1199094 2minus 1199095 2 minus 2 1199093 2 minus 21199095 2 minus 21199094 1 minus 21199094 1 minus 21199093 1minus 21199095 1 minus 21199091 1 1 + 21199091 1 + 21199095 1 + 21199093 1+ 21199094 21199094 21199095 21199093 1199095 1199094 1199093 21199091 1199091 0)

(23)

Complexity 9

6 A Detailed Example

Here we discuss a detailed application for the templateframework presented in this paper which is to find the rulesthat share a set of static properties This can be achieved withthe template builder functions provided with CATemplatesor one could implement custom builder functions on top ofthe core concepts provided by the package What follows isa sample of how the framework can be used to conduct anexperiment of this sort

More specifically let us suppose we are interested in therules which are both totalistic and captive This might comefrom a purely theoretical interest or motivated by the needfor obtaining rules of this type for some practical application

We then start by building the templates for totalisticand captive rules of the elementary space as shown in theprevious sections (119879119905119900119905119886119897119894119904119905119894119888 and 119879119888119886119901119905119894V119890) By performing theirintersection we end up with a template representing alltotalistic and captive rules of the elementary space as follows

11987911989621199031 = (2 10 (1 1199093 1199093 1199091 1199093 1199091 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (24)

Upon expansion this template yields the 4 totalisticelementary CAs which are also captive 128 150 232 254Notice that the template being expanded has only 2 variableswhichmeans the expansion has to consider only 4 expansioncandidates which is a substantially smaller subset of theoriginal space which has 256 rules

Since the elementary space is a small one let us performthe same example in larger spaces We can generate theequivalent templates for the space defined by 119896 = 3 and 119903 = 1and perform the intersection between them The result is

11987911989631199031 = (3 10 (2 11990917 isin 1 2 2 11990917isin 1 2 2 1 2 1 0 11990917 isin 1 2 2 1 2 1 0 1 0 1199091isin 0 1 2 1 0 1 0 1199091 isin 0 1 0 1199091 isin 0 1 0)FilterVariableAssignments)

(25)

Notice that this template also has two variables 1199091 and11990917 This means there are only 32 = 9 possible expansions forthis template from which some will be filtered out becauseof the variable assignment annotations After expansion thistemplate yields the 4 totalistic rules of the spacewhich are alsocaptive 223160992 223161514 265235104 265235626

This means that we took a space with 327 = 7 625 597484 987 rules and found out that only 4 of those sharethe totality and captivity properties all without actuallyenumerating the whole space (which would be not feasiblegiven its size) Notice that this space could be further reducedby intersecting this resulting template with templates fromother properties like color blindness

Extending the previous case we may now ask the generalquestion of up to which rule space size could we still manageto get access to totalistic and captive rulesWithout templatesthe rules would have to be obtained directly by scanningthe rule space and selecting those having the two properties

But with 119896 = 3 this approach would already be impracticaleven for 119903 = 1 on a standard personal computer since thespace has ≃ 76 times 1012 rules A first alternative now usingtemplates could be accessing the rules say by first expandingthe totalistic rules directly from the corresponding templateand then filtering out the captive ones This certainly helpsIn fact by doing so progressively starting with radius 119903 = 05and increasing its value in steps of 05 in a standard personalcomputer it would hardly be possible to reach beyond 119903 = 2(which corresponds to a space with ≃ 87 times 10115 rules)because of the substantial increase in computational timeas we would go from a given 119903 to its subsequent valueWe omit actual values of processing time here as this maystrongly vary among different machine architectures andtheir software environment

However by relying on the generation of the individualtemplates of each property and expanding the intersectionbetween them we easily access spaces up to 119903 = 4 (possiblyeven beyond) which contains ≃ 15times109391 rules It turns outthat in this space only 256 rules share the two properties anextremely smaller space to reason about

Furthermore the analysis of all the data generated fromthe previous experiment suggests that the number of ruleswith 119896 = 3 and the shared properties of totality andcaptivity seems to be given by 4119903 for symmetric rules (thosewith integer radius) whereas no rule would be present forasymmetric rules This is quite a remarkable general resultderived from direct probing of the corresponding rule spacesthat the full usage of templates allowed us

As a final note it is worth emphasising that templateexpansion is only made when the actual rules representedin a template are needed which is at the end of the processof answering which rules satisfy a given set of propertiesUntil then it suffices to operate directly with the tem-plates this is where the conciseness of template usage liesAnd although expansion may be computationally intensiveit is certainly much less than if the entire correspond-ing spaces would have to be manipulated directly all theway

7 Concluding Remarks

Searching for cellular automata with specific behaviours(such as global problem solvers) is a daunting task for anyonelooking further than the elementary space

In this paper we presented the current state of cellularautomata templates a valuable ally in this front We havedescribed what templates are and how the two currentlyimplemented operations (expansion and intersection) workwent into details of the implementations of template builderfunctions for captive totalistic outer-totalistic and color-blind rules and have shown a sample application of theframework established here

The sample application has led us to the discovery thatonly a handful of CAs share both of the properties of totalityand captivity (only 64 rules on the 119896 = 3 119903 = 3 spacefor instance) This little experiment shows how the proposedframework can be used as a means to sieve through very largespaceswhen searching forCAs that present a given behaviour

10 Complexity

As mentioned in distinct parts of the text the notionof templates and the implementation of the computationalsystem to support it underwent a long way since its originup to its current degree of structural maturity

The natural course from here is to develop new templatebuilders and whichever other operations we might conceiveMore concretely with respect to the latter we should say thatduring the last couple of years we have been investigating thenotion of ldquodifferencerdquo between templates an operationwhoseoutput would yield another template representing the rulesthat have the property associated with the first template butnot having the property associated with the second In spiteof a conference publication we have on the topic (see [15]) itis not yet mature to go into the publicly available package Butin due time we intend to do so

As for new template builders a generalisation of oneto handle arbitrary values of symmetry by conjugation ismore pressing As mentioned earlier we decided not toinclude this template builder mostly because the existing onecannot yet handle arbitrary number of states in the caseof conjugation However noticing that the notion of colorblindness is essentially the notion of rules with maximumsymmetry by conjugation generalised for any 119896-state ruleusing the same idea implemented for color blindness it isnow possible to face the generalisation of arbitrary values ofsymmetry by conjugation This is clearly future work to bedone

Also it is tempting to add completely new templatebuilders to the present package referring to other parameterslike those in [16] In fact we hope that this paper triggerscollaborative participation from the cellular automata com-munity in terms of both the systemrsquos expansion and its usein applications This is why we decided to keep the work inGitHub publicly available

As for the possibility of extending the framework tosupport rules in higher dimensions we would say this wouldbe readily possible for all current properties but one numberconservation This is due to the fact that the underlyingalgorithm we used to implement the corresponding tem-plate builder comes from [17] which is restricted to one-dimensional rules In order to change that a general algo-rithm would have to be used quite likely the one describedin [18]This is certainly feasible and desirable but we had notyet had the opportunity to go about that

Data Availability

The data used to support the findings of this study are avail-able from the corresponding author upon request and theCATemplates Mathematica package directly from GitHub[10]

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

The authors are grateful to financial support fromIPM (Instituto Presbiteriano Mackenzie) and CAPES

(Coordenacao de Aperfeicoamento de Pessoal de NıvelSuperior Brazil) by means of STIC-AmSud (CoDANet)project no 888811974562018-01 and PrInt project no 888873102812018-00

References

[1] S Wolfram A New Kind of Science WolframMedia Inc 2002[2] J L Zapotecatl D A Rosenblueth and C Gershenson ldquoDelib-

erative self-organizing traffic lights with elementary cellularautomatardquo Complexity vol 2017 Article ID 7691370 15 pages2017

[3] D Wolz and P P B de Oliveira ldquoVery effective evolutionarytechniques for searching cellular automata rule spacesrdquo Journalof Cellular Automata vol 3 no 4 pp 289ndash312 2008

[4] I Barragan-Vite J C Seck-Tuoh-MoraN Hernandez-RomeroJMedina-Marin and E S Hernandez-Gress ldquoDistributed con-trol of a manufacturing system with one-dimensional cellularautomatardquo Complexity vol 2018 Article ID 7235105 15 pages2018

[5] J Yang W Liu Y Li X Li and Q Ge ldquoSimulating intraurbanland use dynamics under multiple scenarios based on fuzzycellular automata a case study of Jinzhou District DalianrdquoComplexity vol 2018 Article ID 7202985 17 pages 2018

[6] H Betel P P B De Oliveira and P Flocchini ldquoSolving theparity problem in one-dimensional cellular automatardquo NaturalComputing vol 12 no 3 pp 323ndash337 2013

[7] M Bidlo ldquoOn routine evolution of complex cellular automatardquoIEEE Transactions on Evolutionary Computation vol 20 no 5pp 742ndash754 2016

[8] P de Oliveira andMVerardo ldquoRepresenting families of cellularautomata rulesrdquoThe Mathematica Journal vol 16 no 8 2014

[9] Wolfram Research ldquoWolfram mathematica 11rdquo httpwwwwolframcommathematica 2018

[10] M Verardo and P P B de Oliveira ldquoCATemplatesrdquo httpsgithubcommverardoCATemplates 2019

[11] P P B de Oliveira ldquoOn density determination with cellularautomata Results constructions and directionsrdquo Journal ofCellular Automata vol 9 no 5-6 pp 357ndash385 2014

[12] P P B de Oliveira andMVerardo ldquoTemplate based representa-tion of cellular automata rulesrdquo inProceedings of the ExploratoryPapers - AUTOMATA 2014 - 20th International Workshop onCellular Automata and Discrete Complex Systems T IsokawaK Imai N Matsiu F Peper and H Umeo Eds pp 199ndash2042014

[13] G Theyssier ldquoCaptive cellular automatardquo in MathematicalFoundations of Computer Science vol 3153 of Lecture Notes inComputer Science pp 427ndash438 2004

[14] V Salo and I Torma ldquoColor blind cellular automatardquo inCellularAutomata and Discrete Complex Systems J Kari M Kutrib andAMalcher Eds pp 139ndash154 SpringerHeidelberg Berlin 2013

[15] Z Soares M Verardo and P P de Oliveira ldquoThe differenceoperation between templates of binary cellular automatardquo inNew Advances in Information Systems and Technologies ARocha A M Correia H Adeli L P Reis and M M TeixeiraEds vol 444 of Advances in Intelligent Systems and Computingpp 707ndash715 Springer International Publishing Cham Swizer-land 2016

Complexity 11

[16] G M Oliveira P P Oliveira and N Omar ldquoDefinitionand application of a five-parameter characterization of one-dimensional cellular automata rule spacerdquo Artificial Life vol 7no 3 pp 277ndash301 2001

[17] N Boccara and H Fuks ldquoNumber-conserving cellular automa-ton rulesrdquo Fundamenta Informaticae vol 52 no 1-3 pp 1ndash132002

[18] B Durand E Formenti and Z Roka ldquoNumber-conservingcellular automata I decidabilityrdquoTheoretical Computer Sciencevol 299 no 1-3 pp 523ndash535 2003

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 6: A Fully Operational Framework for Handling Cellular ...downloads.hindawi.com/journals/complexity/2019/6573793.pdf · is a brief overview of cellular automata and their inner workings,

6 Complexity

The algorithm receives as arguments the values of 119896 and119903 for which the template will be generated It then proceedsto enumerate all possible neighborhoods of the defined spaceand calculates their sum

Now for every sum value found in the previous step thealgorithm picks the neighbourhood representing the smallest119896-ary number and assigns a variable corresponding to thatneighbourhoodrsquos decimal value to all of the state transitionsthat shared a result with it For instance let us considerall neighborhoods of the elementary space whose statessum equals 2 (1 1 0) (1 0 1) (0 1 1) Since the smallestneighbourhood in this set is (0 1 1) which is decimal 3 weassign to their respective transitions the result 1199093

The templatersquos core for the elementary space becomes

119888 (119879119905119900119905119886119897119894119904119905119894119888119864119878) = (1199097 1199093 1199093 1199091 1199093 1199091 1199091 1199090) (10)

Upon expansion this template yields the rule tables ofthe 16 totalistic elementary CAs Notice that this templatersquoscore is composed of only free variables and references toother free variables This being the case every expansionof this template shall yield a valid result excluding theneed to define any expansion modifier function other than119868119889119890119899119905119894119905119910119872119886119901119901119890119903

For 119896 = 3 and 119903 = 1 the resulting template would be

11987911990511990011990531 = (3 10 (11990926 11990917 1199098 11990917 1199098 1199095 1199098 1199095 1199092 11990917 11990981199095 1199098 1199095 1199092 1199095 1199092 1199091 1199098 1199095 1199092 1199095 1199092 1199091 1199092 1199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903)

(11)

Upon expansion this template yields the 2187 totalisticrules of the referred space

Definition 3 (outer-totality) An outer-totalistic CAmdashor al-ternatively a CA that presents the outer-totality propertymdashis one whose local rule considers the sum of the state valuesof the external cells of a neighbourhood (ie those except thecenter cell) in addition to the state value of the center cellitself

Formally let 119891 be the local transition function of a CAdefined over the set119873 of possible neighborhoods for the CArsquosspace Let 119899 be the size of a neighbourhood of 119873 and let119898 = lceil1198992rceil be the index of the cell that is meant to undergoa state change (ie the center cell when 119899 is an odd number)Let 119860 = (1205721 120572119898 120572119899) and 119861 = (1205731 120573119898 120573119899) beneighborhoods of119873 A CA is said to be outer-totalistic if andonly if the following condition is true

forall119860 119861 isin 119873((119898minus1sum119894=1

120572119894 + 119899sum119894=119898+1

120572119894 = 119898minus1sum119895=1

120573119895 + 119899sum119895=119898+1

120573119895)

and (120572119898 = 120573119898)) lArrrArr (119891 (119860) = 119891 (119861)) (12)

The algorithm for outer-totalistic templates is almost thesame as the one for totalistic rules with the exception that

it considers the sum of external cells in the neighbourhoodinstead of its entirety

The algorithmrsquos output for the elementary space is

119888 (119879119900119906119905119890119903minus119905119900119905119886119897119894119904119905119894119888119864119878) = (1199097 1199093 1199095 1199091 1199093 1199092 1199091 1199090) (13)

Upon expansion this template generates the 64 outer-totalistic elementary CAs

For reference here is the result for 119896 = 3 and 119903 = 1whichafter expansion would yield the 14 348 907 outer-totalisticrules of the space since 15 distinct variables are present inthe template

119879119900119906119905119890119903minus11990511990011990531 = (3 10 (11990926 11990917 1199098 x23 11990914 1199095 11990920 11990911 119909211990917 1199098 1199097 11990914 1199095 1199094 11990911 1199092 1199091 1199098 1199097 1199096 1199095 1199094 1199093 11990921199091 1199090) 119868119889119890119899119905119894119905119910119872119886119901119901119890119903)

(14)

52 Template Builder for Captive CAs

Definition 4 (captivity [13]) A CA is said to be captivemdashoralternatively to have the captivity static propertymdashwhenevery transition of its rule table outputs a state that appearsin the corresponding neighbourhood

Formally if 119891 is the local transition function of a CA119860 =(1205721 120572119898 120572119899) is a neighbourhood of size 119899 out of allpossible neighborhoods 119873 and 120573 is an arbitrary state a CAis said to be captive if and only if the following condition istrue

forall119860 isin 119873119891 (1205721 120572119899) = 120573 lArrrArr 120573 isin 1205721 120572119899 (15)

In the binary case this naturally simplifies to the fact thatevery CA with 119891(01 02 0119899) = 0 and 119891(11 12 1119899) = 1is captive for any radius 119903

As a static property a general algorithm to find templatesof captive CAs for a given space does exist As such thealgorithm receives the values for 119896 and 119903 and starts bygenerating all possible neighborhoods for the space

It then uses the following simple rules to decide how totransform this neighbourhood in a template output

(i) If the neighbourhood is homogeneous like (1 1 1)the transition should output the only state thatappears in the neighbourhood (1)

(ii) If the neighbourhood is composed of all of the valuesin the interval [0 119896 minus 1] like (1 2 0) for 119896 = 3 and119903 = 1 the transition should output a free variableindexed by the decimal value of the neighbourhoodnamely 11990915 (since 120 in base 119896 = 3 corresponds tothe decimal 15)

(iii) If the neighbourhood is composed of only some of thepossible states the states of the interval [0 119896 minus 1] like(0 2 0) for 119896 = 3 and 119903 = 1 the output should bea variable indexed by the neighbourhood this timerestricted by the present values (1199096 isin 0 2)This typeof neighbourhood only appears when 119896 gt 2

Complexity 7

Note that since this template uses restricted variables itmust use the 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904 expansion modifierfunction

As a result of all the latter the captivity template for theelementary space becomes

119879119888119886119901119905119894V119890 = (2 10 (1 1199096 1199095 1199094 1199093 1199092 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (16)

while for 119896 = 3 and 119903 = 1 the template is

119879119888119886119901119905119894V11989031 = (3 10 (2 11990925 isin 1 2 11990924 isin 0 2 11990923isin 1 2 11990922 isin 1 2 11990921 11990920 isin 0 2 11990919 11990918isin 0 2 11990917 isin 1 2 11990916 isin 1 2 11990915 11990914isin 1 2 1 11990912 isin 0 1 11990911 11990910 isin 0 1 1199099isin 0 1 1199098 isin 0 2 1199097 1199096 isin 0 2 1199095 1199094isin 0 1 1199093 isin 0 1 1199092 isin 0 2 1199091 isin 0 1 0) 119865119894119897119905119890119903119873119900119905119860119897119897119900119908119890119889)

(17)

53 Template Builder for Colorblind CAs In order to fullygrasp the notion of colorblind rules let us first discuss themeaning of permutations in the context of CAs

Definition 5 (colour permutation (120587)) Let framework 119870 bethe set of possible states for a CA in the range [0 119896 minus 1] Acolour permutation 120587 is a bijective function of 119870 to itselfwhich can be written as a set of rules of the form 119896119894 997888rarr 119896119895meaning that a cell in state 119896119894 should be switched to state 119896119895when this permutation is applied

For instance a valid permutation for the case where 119870 =0 1 2 is 1205871 = 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0It is important to notice that every colour permutation

can be represented by an algebraic function that interpolatesthe points defined by the permutation For instance 1205871 couldbe written as 1205871(119909) = 1 + (1 minus 32(minus1 + 119909))119909Definition 6 (symmetric group (119878119870)) The symmetric group119878119870 of a set119870 is the set of all possible permutations over 119870

For instance the symmetric group for119870 = 0 1 2 is119878119870 = 0 997888rarr 0 1 997888rarr 1 2 997888rarr 2

0 997888rarr 0 1 997888rarr 2 2 997888rarr 1 0 997888rarr 1 1 997888rarr 0 2 997888rarr 2 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0 0 997888rarr 2 1 997888rarr 0 2 997888rarr 1 0 997888rarr 2 1 997888rarr 1 2 997888rarr 0

(18)

Definition 7 (neighbourhood permutation (120588(120587))) Let120587 be acolour permutation and let119873 be the set of all possible neigh-borhoods for a given CA The neighbourhood permutation

120588(120587) is a permutation 119873 that uses 120587 to transform 119899119894 isin 119873 intoneighbourhood 119899119895 isin 119873 by applying 120587 to every cell of 119899119894

For instance with119870 = 0 1 2 119903 = 1 and 1205871 = (0 1 2)a valid transformation due to 120588(1205871) would be (0 2 2) 997888rarr(1 0 0) The other transformations can be derived by apply-ing the same reasoning to all of the neighborhoods of119873

Definition 8 (cycle notation of a permutation) A permuta-tion can be written by means of a cycle notation formedby a set of vectors that represent cycles associated with thepermutation

For instance the colour permutation 1205872 = 0 997888rarr 1 1 997888rarr0 2 997888rarr 2 can be written as 1205872 = (0 1) (2) whereeach vector has the form (1199091198941 1199091198942 119909119894119895) 1 le 119895 le 119896 andrepresents a cycle due to the permutation namely the two-step cycle 0 997888rarr 1 997888rarr 0 and the self-loop 2 997888rarr 2Similarly The previous 1205871 permutation would be written incycle notation as 1205871 = (0 1 2)

As for neighbourhood permutations 120588(1205871) for examplewould be represented as follows

120588 (1205871) = ((0 2 2) (1 0 0) (2 1 1)) ((0 2 1) (1 0 2) (2 1 0)) ((0 2 0) (1 0 1) (2 1 2)) ((0 1 2) (1 2 0) (2 0 1)) ((0 1 1) (1 2 2) (2 0 0)) ((0 1 0) (1 2 1) (2 0 2)) ((0 0 2) (1 1 0) (2 2 1)) ((0 0 1) (1 1 2) (2 2 0)) ((0 0 0) (1 1 1) (2 2 2))

(19)

With the previous characterisations we can now define colorblindness

Definition 9 (color blindness [14]) A CA whose cells can bein any of the states of the set 119870 is said to be colorblindmdashoralternatively to possess the color blindness propertymdashif itsspace-time evolution does not change unless by a colourchange after applying any neighbourhood permutation120588(120587) 120587 isin 119878119870 to all state transitions that define its rule table

Notice that for a CA to be invariant to 120588(1205871) its ruletablersquos outputs 119900119894 should be consistent with the cycles formedby the application of 120588(1205871) over its neighborhoods 119887119894 119894 beingthe index of the state transition on the CArsquos rule table

In other words for a rule to be invariant to 1205871 theoutput of say neighbourhood (0 2 2) should be equal tothe application of 1205871 to the output of neighbourhood (1 0 0)since (0 2 2) is transformed into (1 0 0) due to 1205871 for thesame reason the output of (1 0 0) should be equal to theapplication of1205871 to the output of neighbourhood (2 1 1)Thesame happens analogously for the remaining cycles of 120588(1205871)

8 Complexity

Now in order to generate a template representing CAsthat are invariant to the neighbourhood permutation 120588(1205871)we need to assign an output to every neighbourhood andderive a rule table that could be turned into a template

So that outputs follow 120588(1205871) we use its cycle notationrepresentation to assign to every cycle start a free variableindexed by its corresponding neighbourhoodrsquos decimal rep-resentation ending upwith a tuple formed by neighbourhoodand output The (0 2 2) neighbourhood being a cycle startis turned into the tuple ((0 2 2) 1199098) for instance

For every remaining neighbourhood in a cycle we nowapply 1205871 to the free variable found in the previous step 119889times 119889 being the distance from this neighbourhood tothe start of the cycle The cycle ((0 2 2) (1 0 0) (2 1 1))is turned into (((0 2 2) 1199098) ((1 0 0) 1205871(1199098)) ((2 1 1)1205871(1205871(1199098)))) for instance

Applying this procedure to every cycle of 1205871 we obtainthe set(((0 2 2) 1199098) ((1 0 0) 1205871 (1199098))

((2 1 1) 120587 (1205871 (1199098)))) (((0 2 1) 1199097) ((1 0 2) 1205871 (1199097)) ((2 1 0) 120587 (1205871 (1199097)))) (((0 2 0) 1199096) ((1 0 1) 1205871 (1199096)) ((2 1 2) 120587 (1205871 (1199096)))) (((0 1 2) 1199095) ((1 2 0) 1205871 (1199095)) ((2 0 1) 120587 (1205871 (1199095)))) (((0 1 1) 1199094) ((1 2 2) 1205871 (1199094)) ((2 0 0) 120587 (1205871 (1199094)))) (((0 1 0) 1199093) ((1 2 1) 1205871 (1199093)) ((2 0 2) 120587 (1205871 (1199093)))) (((0 0 2) 1199092) ((1 1 0) 1205871 (1199092)) ((2 2 1) 120587 (1205871 (1199092)))) (((0 0 1) 1199091) ((1 1 2) 1205871 (1199091)) ((2 2 0) 120587 (1205871 (1199091)))) (((0 0 0) 1199090) ((1 1 1) 1205871 (1199090)) ((2 2 2) 120587 (1205871 (1199090))))

(20)

We can now flatten a level of this set and turn it into anordered list sorted lexicographically by neighbourhood Thisprocedure yields the rule table shown in Table 2

The core of a template for CAs invariant to 120588(1205871) can nowbe found by compressing this rule table into its 119896-ary form

119879120588(1205871) = (120587 (1205871 (1199090)) 120587 (1205871 (1199092)) 120587 (1205871 (1199091)) 120587 (1205871 (1199096)) 120587 (1205871 (1199098)) 120587 (1205871 (1199097)) 120587 (1205871 (1199093)) 120587 (1205871 (1199095)) 120587 (1205871 (1199094)) 1205871 (1199094) 1205871 (1199093) 1205871 (1199095) 1205871 (1199091) 1205871 (1199090) 1205871 (1199092) 1205871 (1199097) 1205871 (1199096) 1205871 (1199098) 11990981199097 1199096 1199095 1199094 1199093 1199092 1199091 1199090))

(21)

Remember from Definition 5 that any permutation 120587 canbe represented by an algebraic function which is the actual

Table 2 Rule table for the template representative of CAs invariantto 1205871(2 2 2) 120587(1205871(1199090)(2 2 1) 120587(1205871(1199092)(2 2 0) 120587(1205871(1199091)(2 1 2) 120587(1205871(1199096)(2 1 1) 120587(1205871(1199098)(2 1 0) 120587(1205871(1199097)(2 0 2) 120587(1205871(1199093)(2 0 1) 120587(1205871(1199095)(2 0 0) 120587(1205871(1199094)(1 2 2) 1205871(1199094)(1 2 1) 1205871(1199093)(1 2 0) 1205871(1199095)(1 1 2) 1205871(1199091)(1 1 1) 1205871(1199090)(1 1 0) 1205871(1199092)(1 0 2) 1205871(1199097)(1 0 1) 1205871(1199096)(1 0 0) 1205871(1199098)(0 2 2) 1199098(0 2 1) 1199097(0 2 0) 1199096(0 1 2) 1199095(0 1 1) 1199094(0 1 0) 1199093(0 0 2) 1199092(0 0 1) 1199091(0 0 0) 1199090

representation used by the algorithm We use the 120587 nota-tion here since it is compact and serves the explanationrsquospurpose

The same procedure can now be repeated for every per-mutation of the 119878119896 set essentially mapping each permutationof the set to a corresponding template of CAs invariant to thatpermutation It is now only a matter of intersecting all of thetemplates found and the result is a template that representsall colorblind rules of the space defined by 119896 and 119903

When applied to 119896 = 2 and 119903 = 1 we obtain119879119888119900119897119900119906119903119887119897119894119899119889

= (1 minus 1199090 1 minus 1199091 1 minus 1199092 1 minus 1199093 1199093 1199092 1199091 1199090) (22)

whereas for 119896 = 3 and 119903 = 1 the result becomes

11987911988811990011989711990011990611990311988711989711989411989911988931 = (2 2 minus 1199091 2 minus 21199091 2 minus 1199093 2 minus 1199094 2minus 1199095 2 minus 2 1199093 2 minus 21199095 2 minus 21199094 1 minus 21199094 1 minus 21199093 1minus 21199095 1 minus 21199091 1 1 + 21199091 1 + 21199095 1 + 21199093 1+ 21199094 21199094 21199095 21199093 1199095 1199094 1199093 21199091 1199091 0)

(23)

Complexity 9

6 A Detailed Example

Here we discuss a detailed application for the templateframework presented in this paper which is to find the rulesthat share a set of static properties This can be achieved withthe template builder functions provided with CATemplatesor one could implement custom builder functions on top ofthe core concepts provided by the package What follows isa sample of how the framework can be used to conduct anexperiment of this sort

More specifically let us suppose we are interested in therules which are both totalistic and captive This might comefrom a purely theoretical interest or motivated by the needfor obtaining rules of this type for some practical application

We then start by building the templates for totalisticand captive rules of the elementary space as shown in theprevious sections (119879119905119900119905119886119897119894119904119905119894119888 and 119879119888119886119901119905119894V119890) By performing theirintersection we end up with a template representing alltotalistic and captive rules of the elementary space as follows

11987911989621199031 = (2 10 (1 1199093 1199093 1199091 1199093 1199091 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (24)

Upon expansion this template yields the 4 totalisticelementary CAs which are also captive 128 150 232 254Notice that the template being expanded has only 2 variableswhichmeans the expansion has to consider only 4 expansioncandidates which is a substantially smaller subset of theoriginal space which has 256 rules

Since the elementary space is a small one let us performthe same example in larger spaces We can generate theequivalent templates for the space defined by 119896 = 3 and 119903 = 1and perform the intersection between them The result is

11987911989631199031 = (3 10 (2 11990917 isin 1 2 2 11990917isin 1 2 2 1 2 1 0 11990917 isin 1 2 2 1 2 1 0 1 0 1199091isin 0 1 2 1 0 1 0 1199091 isin 0 1 0 1199091 isin 0 1 0)FilterVariableAssignments)

(25)

Notice that this template also has two variables 1199091 and11990917 This means there are only 32 = 9 possible expansions forthis template from which some will be filtered out becauseof the variable assignment annotations After expansion thistemplate yields the 4 totalistic rules of the spacewhich are alsocaptive 223160992 223161514 265235104 265235626

This means that we took a space with 327 = 7 625 597484 987 rules and found out that only 4 of those sharethe totality and captivity properties all without actuallyenumerating the whole space (which would be not feasiblegiven its size) Notice that this space could be further reducedby intersecting this resulting template with templates fromother properties like color blindness

Extending the previous case we may now ask the generalquestion of up to which rule space size could we still manageto get access to totalistic and captive rulesWithout templatesthe rules would have to be obtained directly by scanningthe rule space and selecting those having the two properties

But with 119896 = 3 this approach would already be impracticaleven for 119903 = 1 on a standard personal computer since thespace has ≃ 76 times 1012 rules A first alternative now usingtemplates could be accessing the rules say by first expandingthe totalistic rules directly from the corresponding templateand then filtering out the captive ones This certainly helpsIn fact by doing so progressively starting with radius 119903 = 05and increasing its value in steps of 05 in a standard personalcomputer it would hardly be possible to reach beyond 119903 = 2(which corresponds to a space with ≃ 87 times 10115 rules)because of the substantial increase in computational timeas we would go from a given 119903 to its subsequent valueWe omit actual values of processing time here as this maystrongly vary among different machine architectures andtheir software environment

However by relying on the generation of the individualtemplates of each property and expanding the intersectionbetween them we easily access spaces up to 119903 = 4 (possiblyeven beyond) which contains ≃ 15times109391 rules It turns outthat in this space only 256 rules share the two properties anextremely smaller space to reason about

Furthermore the analysis of all the data generated fromthe previous experiment suggests that the number of ruleswith 119896 = 3 and the shared properties of totality andcaptivity seems to be given by 4119903 for symmetric rules (thosewith integer radius) whereas no rule would be present forasymmetric rules This is quite a remarkable general resultderived from direct probing of the corresponding rule spacesthat the full usage of templates allowed us

As a final note it is worth emphasising that templateexpansion is only made when the actual rules representedin a template are needed which is at the end of the processof answering which rules satisfy a given set of propertiesUntil then it suffices to operate directly with the tem-plates this is where the conciseness of template usage liesAnd although expansion may be computationally intensiveit is certainly much less than if the entire correspond-ing spaces would have to be manipulated directly all theway

7 Concluding Remarks

Searching for cellular automata with specific behaviours(such as global problem solvers) is a daunting task for anyonelooking further than the elementary space

In this paper we presented the current state of cellularautomata templates a valuable ally in this front We havedescribed what templates are and how the two currentlyimplemented operations (expansion and intersection) workwent into details of the implementations of template builderfunctions for captive totalistic outer-totalistic and color-blind rules and have shown a sample application of theframework established here

The sample application has led us to the discovery thatonly a handful of CAs share both of the properties of totalityand captivity (only 64 rules on the 119896 = 3 119903 = 3 spacefor instance) This little experiment shows how the proposedframework can be used as a means to sieve through very largespaceswhen searching forCAs that present a given behaviour

10 Complexity

As mentioned in distinct parts of the text the notionof templates and the implementation of the computationalsystem to support it underwent a long way since its originup to its current degree of structural maturity

The natural course from here is to develop new templatebuilders and whichever other operations we might conceiveMore concretely with respect to the latter we should say thatduring the last couple of years we have been investigating thenotion of ldquodifferencerdquo between templates an operationwhoseoutput would yield another template representing the rulesthat have the property associated with the first template butnot having the property associated with the second In spiteof a conference publication we have on the topic (see [15]) itis not yet mature to go into the publicly available package Butin due time we intend to do so

As for new template builders a generalisation of oneto handle arbitrary values of symmetry by conjugation ismore pressing As mentioned earlier we decided not toinclude this template builder mostly because the existing onecannot yet handle arbitrary number of states in the caseof conjugation However noticing that the notion of colorblindness is essentially the notion of rules with maximumsymmetry by conjugation generalised for any 119896-state ruleusing the same idea implemented for color blindness it isnow possible to face the generalisation of arbitrary values ofsymmetry by conjugation This is clearly future work to bedone

Also it is tempting to add completely new templatebuilders to the present package referring to other parameterslike those in [16] In fact we hope that this paper triggerscollaborative participation from the cellular automata com-munity in terms of both the systemrsquos expansion and its usein applications This is why we decided to keep the work inGitHub publicly available

As for the possibility of extending the framework tosupport rules in higher dimensions we would say this wouldbe readily possible for all current properties but one numberconservation This is due to the fact that the underlyingalgorithm we used to implement the corresponding tem-plate builder comes from [17] which is restricted to one-dimensional rules In order to change that a general algo-rithm would have to be used quite likely the one describedin [18]This is certainly feasible and desirable but we had notyet had the opportunity to go about that

Data Availability

The data used to support the findings of this study are avail-able from the corresponding author upon request and theCATemplates Mathematica package directly from GitHub[10]

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

The authors are grateful to financial support fromIPM (Instituto Presbiteriano Mackenzie) and CAPES

(Coordenacao de Aperfeicoamento de Pessoal de NıvelSuperior Brazil) by means of STIC-AmSud (CoDANet)project no 888811974562018-01 and PrInt project no 888873102812018-00

References

[1] S Wolfram A New Kind of Science WolframMedia Inc 2002[2] J L Zapotecatl D A Rosenblueth and C Gershenson ldquoDelib-

erative self-organizing traffic lights with elementary cellularautomatardquo Complexity vol 2017 Article ID 7691370 15 pages2017

[3] D Wolz and P P B de Oliveira ldquoVery effective evolutionarytechniques for searching cellular automata rule spacesrdquo Journalof Cellular Automata vol 3 no 4 pp 289ndash312 2008

[4] I Barragan-Vite J C Seck-Tuoh-MoraN Hernandez-RomeroJMedina-Marin and E S Hernandez-Gress ldquoDistributed con-trol of a manufacturing system with one-dimensional cellularautomatardquo Complexity vol 2018 Article ID 7235105 15 pages2018

[5] J Yang W Liu Y Li X Li and Q Ge ldquoSimulating intraurbanland use dynamics under multiple scenarios based on fuzzycellular automata a case study of Jinzhou District DalianrdquoComplexity vol 2018 Article ID 7202985 17 pages 2018

[6] H Betel P P B De Oliveira and P Flocchini ldquoSolving theparity problem in one-dimensional cellular automatardquo NaturalComputing vol 12 no 3 pp 323ndash337 2013

[7] M Bidlo ldquoOn routine evolution of complex cellular automatardquoIEEE Transactions on Evolutionary Computation vol 20 no 5pp 742ndash754 2016

[8] P de Oliveira andMVerardo ldquoRepresenting families of cellularautomata rulesrdquoThe Mathematica Journal vol 16 no 8 2014

[9] Wolfram Research ldquoWolfram mathematica 11rdquo httpwwwwolframcommathematica 2018

[10] M Verardo and P P B de Oliveira ldquoCATemplatesrdquo httpsgithubcommverardoCATemplates 2019

[11] P P B de Oliveira ldquoOn density determination with cellularautomata Results constructions and directionsrdquo Journal ofCellular Automata vol 9 no 5-6 pp 357ndash385 2014

[12] P P B de Oliveira andMVerardo ldquoTemplate based representa-tion of cellular automata rulesrdquo inProceedings of the ExploratoryPapers - AUTOMATA 2014 - 20th International Workshop onCellular Automata and Discrete Complex Systems T IsokawaK Imai N Matsiu F Peper and H Umeo Eds pp 199ndash2042014

[13] G Theyssier ldquoCaptive cellular automatardquo in MathematicalFoundations of Computer Science vol 3153 of Lecture Notes inComputer Science pp 427ndash438 2004

[14] V Salo and I Torma ldquoColor blind cellular automatardquo inCellularAutomata and Discrete Complex Systems J Kari M Kutrib andAMalcher Eds pp 139ndash154 SpringerHeidelberg Berlin 2013

[15] Z Soares M Verardo and P P de Oliveira ldquoThe differenceoperation between templates of binary cellular automatardquo inNew Advances in Information Systems and Technologies ARocha A M Correia H Adeli L P Reis and M M TeixeiraEds vol 444 of Advances in Intelligent Systems and Computingpp 707ndash715 Springer International Publishing Cham Swizer-land 2016

Complexity 11

[16] G M Oliveira P P Oliveira and N Omar ldquoDefinitionand application of a five-parameter characterization of one-dimensional cellular automata rule spacerdquo Artificial Life vol 7no 3 pp 277ndash301 2001

[17] N Boccara and H Fuks ldquoNumber-conserving cellular automa-ton rulesrdquo Fundamenta Informaticae vol 52 no 1-3 pp 1ndash132002

[18] B Durand E Formenti and Z Roka ldquoNumber-conservingcellular automata I decidabilityrdquoTheoretical Computer Sciencevol 299 no 1-3 pp 523ndash535 2003

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 7: A Fully Operational Framework for Handling Cellular ...downloads.hindawi.com/journals/complexity/2019/6573793.pdf · is a brief overview of cellular automata and their inner workings,

Complexity 7

Note that since this template uses restricted variables itmust use the 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904 expansion modifierfunction

As a result of all the latter the captivity template for theelementary space becomes

119879119888119886119901119905119894V119890 = (2 10 (1 1199096 1199095 1199094 1199093 1199092 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (16)

while for 119896 = 3 and 119903 = 1 the template is

119879119888119886119901119905119894V11989031 = (3 10 (2 11990925 isin 1 2 11990924 isin 0 2 11990923isin 1 2 11990922 isin 1 2 11990921 11990920 isin 0 2 11990919 11990918isin 0 2 11990917 isin 1 2 11990916 isin 1 2 11990915 11990914isin 1 2 1 11990912 isin 0 1 11990911 11990910 isin 0 1 1199099isin 0 1 1199098 isin 0 2 1199097 1199096 isin 0 2 1199095 1199094isin 0 1 1199093 isin 0 1 1199092 isin 0 2 1199091 isin 0 1 0) 119865119894119897119905119890119903119873119900119905119860119897119897119900119908119890119889)

(17)

53 Template Builder for Colorblind CAs In order to fullygrasp the notion of colorblind rules let us first discuss themeaning of permutations in the context of CAs

Definition 5 (colour permutation (120587)) Let framework 119870 bethe set of possible states for a CA in the range [0 119896 minus 1] Acolour permutation 120587 is a bijective function of 119870 to itselfwhich can be written as a set of rules of the form 119896119894 997888rarr 119896119895meaning that a cell in state 119896119894 should be switched to state 119896119895when this permutation is applied

For instance a valid permutation for the case where 119870 =0 1 2 is 1205871 = 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0It is important to notice that every colour permutation

can be represented by an algebraic function that interpolatesthe points defined by the permutation For instance 1205871 couldbe written as 1205871(119909) = 1 + (1 minus 32(minus1 + 119909))119909Definition 6 (symmetric group (119878119870)) The symmetric group119878119870 of a set119870 is the set of all possible permutations over 119870

For instance the symmetric group for119870 = 0 1 2 is119878119870 = 0 997888rarr 0 1 997888rarr 1 2 997888rarr 2

0 997888rarr 0 1 997888rarr 2 2 997888rarr 1 0 997888rarr 1 1 997888rarr 0 2 997888rarr 2 0 997888rarr 1 1 997888rarr 2 2 997888rarr 0 0 997888rarr 2 1 997888rarr 0 2 997888rarr 1 0 997888rarr 2 1 997888rarr 1 2 997888rarr 0

(18)

Definition 7 (neighbourhood permutation (120588(120587))) Let120587 be acolour permutation and let119873 be the set of all possible neigh-borhoods for a given CA The neighbourhood permutation

120588(120587) is a permutation 119873 that uses 120587 to transform 119899119894 isin 119873 intoneighbourhood 119899119895 isin 119873 by applying 120587 to every cell of 119899119894

For instance with119870 = 0 1 2 119903 = 1 and 1205871 = (0 1 2)a valid transformation due to 120588(1205871) would be (0 2 2) 997888rarr(1 0 0) The other transformations can be derived by apply-ing the same reasoning to all of the neighborhoods of119873

Definition 8 (cycle notation of a permutation) A permuta-tion can be written by means of a cycle notation formedby a set of vectors that represent cycles associated with thepermutation

For instance the colour permutation 1205872 = 0 997888rarr 1 1 997888rarr0 2 997888rarr 2 can be written as 1205872 = (0 1) (2) whereeach vector has the form (1199091198941 1199091198942 119909119894119895) 1 le 119895 le 119896 andrepresents a cycle due to the permutation namely the two-step cycle 0 997888rarr 1 997888rarr 0 and the self-loop 2 997888rarr 2Similarly The previous 1205871 permutation would be written incycle notation as 1205871 = (0 1 2)

As for neighbourhood permutations 120588(1205871) for examplewould be represented as follows

120588 (1205871) = ((0 2 2) (1 0 0) (2 1 1)) ((0 2 1) (1 0 2) (2 1 0)) ((0 2 0) (1 0 1) (2 1 2)) ((0 1 2) (1 2 0) (2 0 1)) ((0 1 1) (1 2 2) (2 0 0)) ((0 1 0) (1 2 1) (2 0 2)) ((0 0 2) (1 1 0) (2 2 1)) ((0 0 1) (1 1 2) (2 2 0)) ((0 0 0) (1 1 1) (2 2 2))

(19)

With the previous characterisations we can now define colorblindness

Definition 9 (color blindness [14]) A CA whose cells can bein any of the states of the set 119870 is said to be colorblindmdashoralternatively to possess the color blindness propertymdashif itsspace-time evolution does not change unless by a colourchange after applying any neighbourhood permutation120588(120587) 120587 isin 119878119870 to all state transitions that define its rule table

Notice that for a CA to be invariant to 120588(1205871) its ruletablersquos outputs 119900119894 should be consistent with the cycles formedby the application of 120588(1205871) over its neighborhoods 119887119894 119894 beingthe index of the state transition on the CArsquos rule table

In other words for a rule to be invariant to 1205871 theoutput of say neighbourhood (0 2 2) should be equal tothe application of 1205871 to the output of neighbourhood (1 0 0)since (0 2 2) is transformed into (1 0 0) due to 1205871 for thesame reason the output of (1 0 0) should be equal to theapplication of1205871 to the output of neighbourhood (2 1 1)Thesame happens analogously for the remaining cycles of 120588(1205871)

8 Complexity

Now in order to generate a template representing CAsthat are invariant to the neighbourhood permutation 120588(1205871)we need to assign an output to every neighbourhood andderive a rule table that could be turned into a template

So that outputs follow 120588(1205871) we use its cycle notationrepresentation to assign to every cycle start a free variableindexed by its corresponding neighbourhoodrsquos decimal rep-resentation ending upwith a tuple formed by neighbourhoodand output The (0 2 2) neighbourhood being a cycle startis turned into the tuple ((0 2 2) 1199098) for instance

For every remaining neighbourhood in a cycle we nowapply 1205871 to the free variable found in the previous step 119889times 119889 being the distance from this neighbourhood tothe start of the cycle The cycle ((0 2 2) (1 0 0) (2 1 1))is turned into (((0 2 2) 1199098) ((1 0 0) 1205871(1199098)) ((2 1 1)1205871(1205871(1199098)))) for instance

Applying this procedure to every cycle of 1205871 we obtainthe set(((0 2 2) 1199098) ((1 0 0) 1205871 (1199098))

((2 1 1) 120587 (1205871 (1199098)))) (((0 2 1) 1199097) ((1 0 2) 1205871 (1199097)) ((2 1 0) 120587 (1205871 (1199097)))) (((0 2 0) 1199096) ((1 0 1) 1205871 (1199096)) ((2 1 2) 120587 (1205871 (1199096)))) (((0 1 2) 1199095) ((1 2 0) 1205871 (1199095)) ((2 0 1) 120587 (1205871 (1199095)))) (((0 1 1) 1199094) ((1 2 2) 1205871 (1199094)) ((2 0 0) 120587 (1205871 (1199094)))) (((0 1 0) 1199093) ((1 2 1) 1205871 (1199093)) ((2 0 2) 120587 (1205871 (1199093)))) (((0 0 2) 1199092) ((1 1 0) 1205871 (1199092)) ((2 2 1) 120587 (1205871 (1199092)))) (((0 0 1) 1199091) ((1 1 2) 1205871 (1199091)) ((2 2 0) 120587 (1205871 (1199091)))) (((0 0 0) 1199090) ((1 1 1) 1205871 (1199090)) ((2 2 2) 120587 (1205871 (1199090))))

(20)

We can now flatten a level of this set and turn it into anordered list sorted lexicographically by neighbourhood Thisprocedure yields the rule table shown in Table 2

The core of a template for CAs invariant to 120588(1205871) can nowbe found by compressing this rule table into its 119896-ary form

119879120588(1205871) = (120587 (1205871 (1199090)) 120587 (1205871 (1199092)) 120587 (1205871 (1199091)) 120587 (1205871 (1199096)) 120587 (1205871 (1199098)) 120587 (1205871 (1199097)) 120587 (1205871 (1199093)) 120587 (1205871 (1199095)) 120587 (1205871 (1199094)) 1205871 (1199094) 1205871 (1199093) 1205871 (1199095) 1205871 (1199091) 1205871 (1199090) 1205871 (1199092) 1205871 (1199097) 1205871 (1199096) 1205871 (1199098) 11990981199097 1199096 1199095 1199094 1199093 1199092 1199091 1199090))

(21)

Remember from Definition 5 that any permutation 120587 canbe represented by an algebraic function which is the actual

Table 2 Rule table for the template representative of CAs invariantto 1205871(2 2 2) 120587(1205871(1199090)(2 2 1) 120587(1205871(1199092)(2 2 0) 120587(1205871(1199091)(2 1 2) 120587(1205871(1199096)(2 1 1) 120587(1205871(1199098)(2 1 0) 120587(1205871(1199097)(2 0 2) 120587(1205871(1199093)(2 0 1) 120587(1205871(1199095)(2 0 0) 120587(1205871(1199094)(1 2 2) 1205871(1199094)(1 2 1) 1205871(1199093)(1 2 0) 1205871(1199095)(1 1 2) 1205871(1199091)(1 1 1) 1205871(1199090)(1 1 0) 1205871(1199092)(1 0 2) 1205871(1199097)(1 0 1) 1205871(1199096)(1 0 0) 1205871(1199098)(0 2 2) 1199098(0 2 1) 1199097(0 2 0) 1199096(0 1 2) 1199095(0 1 1) 1199094(0 1 0) 1199093(0 0 2) 1199092(0 0 1) 1199091(0 0 0) 1199090

representation used by the algorithm We use the 120587 nota-tion here since it is compact and serves the explanationrsquospurpose

The same procedure can now be repeated for every per-mutation of the 119878119896 set essentially mapping each permutationof the set to a corresponding template of CAs invariant to thatpermutation It is now only a matter of intersecting all of thetemplates found and the result is a template that representsall colorblind rules of the space defined by 119896 and 119903

When applied to 119896 = 2 and 119903 = 1 we obtain119879119888119900119897119900119906119903119887119897119894119899119889

= (1 minus 1199090 1 minus 1199091 1 minus 1199092 1 minus 1199093 1199093 1199092 1199091 1199090) (22)

whereas for 119896 = 3 and 119903 = 1 the result becomes

11987911988811990011989711990011990611990311988711989711989411989911988931 = (2 2 minus 1199091 2 minus 21199091 2 minus 1199093 2 minus 1199094 2minus 1199095 2 minus 2 1199093 2 minus 21199095 2 minus 21199094 1 minus 21199094 1 minus 21199093 1minus 21199095 1 minus 21199091 1 1 + 21199091 1 + 21199095 1 + 21199093 1+ 21199094 21199094 21199095 21199093 1199095 1199094 1199093 21199091 1199091 0)

(23)

Complexity 9

6 A Detailed Example

Here we discuss a detailed application for the templateframework presented in this paper which is to find the rulesthat share a set of static properties This can be achieved withthe template builder functions provided with CATemplatesor one could implement custom builder functions on top ofthe core concepts provided by the package What follows isa sample of how the framework can be used to conduct anexperiment of this sort

More specifically let us suppose we are interested in therules which are both totalistic and captive This might comefrom a purely theoretical interest or motivated by the needfor obtaining rules of this type for some practical application

We then start by building the templates for totalisticand captive rules of the elementary space as shown in theprevious sections (119879119905119900119905119886119897119894119904119905119894119888 and 119879119888119886119901119905119894V119890) By performing theirintersection we end up with a template representing alltotalistic and captive rules of the elementary space as follows

11987911989621199031 = (2 10 (1 1199093 1199093 1199091 1199093 1199091 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (24)

Upon expansion this template yields the 4 totalisticelementary CAs which are also captive 128 150 232 254Notice that the template being expanded has only 2 variableswhichmeans the expansion has to consider only 4 expansioncandidates which is a substantially smaller subset of theoriginal space which has 256 rules

Since the elementary space is a small one let us performthe same example in larger spaces We can generate theequivalent templates for the space defined by 119896 = 3 and 119903 = 1and perform the intersection between them The result is

11987911989631199031 = (3 10 (2 11990917 isin 1 2 2 11990917isin 1 2 2 1 2 1 0 11990917 isin 1 2 2 1 2 1 0 1 0 1199091isin 0 1 2 1 0 1 0 1199091 isin 0 1 0 1199091 isin 0 1 0)FilterVariableAssignments)

(25)

Notice that this template also has two variables 1199091 and11990917 This means there are only 32 = 9 possible expansions forthis template from which some will be filtered out becauseof the variable assignment annotations After expansion thistemplate yields the 4 totalistic rules of the spacewhich are alsocaptive 223160992 223161514 265235104 265235626

This means that we took a space with 327 = 7 625 597484 987 rules and found out that only 4 of those sharethe totality and captivity properties all without actuallyenumerating the whole space (which would be not feasiblegiven its size) Notice that this space could be further reducedby intersecting this resulting template with templates fromother properties like color blindness

Extending the previous case we may now ask the generalquestion of up to which rule space size could we still manageto get access to totalistic and captive rulesWithout templatesthe rules would have to be obtained directly by scanningthe rule space and selecting those having the two properties

But with 119896 = 3 this approach would already be impracticaleven for 119903 = 1 on a standard personal computer since thespace has ≃ 76 times 1012 rules A first alternative now usingtemplates could be accessing the rules say by first expandingthe totalistic rules directly from the corresponding templateand then filtering out the captive ones This certainly helpsIn fact by doing so progressively starting with radius 119903 = 05and increasing its value in steps of 05 in a standard personalcomputer it would hardly be possible to reach beyond 119903 = 2(which corresponds to a space with ≃ 87 times 10115 rules)because of the substantial increase in computational timeas we would go from a given 119903 to its subsequent valueWe omit actual values of processing time here as this maystrongly vary among different machine architectures andtheir software environment

However by relying on the generation of the individualtemplates of each property and expanding the intersectionbetween them we easily access spaces up to 119903 = 4 (possiblyeven beyond) which contains ≃ 15times109391 rules It turns outthat in this space only 256 rules share the two properties anextremely smaller space to reason about

Furthermore the analysis of all the data generated fromthe previous experiment suggests that the number of ruleswith 119896 = 3 and the shared properties of totality andcaptivity seems to be given by 4119903 for symmetric rules (thosewith integer radius) whereas no rule would be present forasymmetric rules This is quite a remarkable general resultderived from direct probing of the corresponding rule spacesthat the full usage of templates allowed us

As a final note it is worth emphasising that templateexpansion is only made when the actual rules representedin a template are needed which is at the end of the processof answering which rules satisfy a given set of propertiesUntil then it suffices to operate directly with the tem-plates this is where the conciseness of template usage liesAnd although expansion may be computationally intensiveit is certainly much less than if the entire correspond-ing spaces would have to be manipulated directly all theway

7 Concluding Remarks

Searching for cellular automata with specific behaviours(such as global problem solvers) is a daunting task for anyonelooking further than the elementary space

In this paper we presented the current state of cellularautomata templates a valuable ally in this front We havedescribed what templates are and how the two currentlyimplemented operations (expansion and intersection) workwent into details of the implementations of template builderfunctions for captive totalistic outer-totalistic and color-blind rules and have shown a sample application of theframework established here

The sample application has led us to the discovery thatonly a handful of CAs share both of the properties of totalityand captivity (only 64 rules on the 119896 = 3 119903 = 3 spacefor instance) This little experiment shows how the proposedframework can be used as a means to sieve through very largespaceswhen searching forCAs that present a given behaviour

10 Complexity

As mentioned in distinct parts of the text the notionof templates and the implementation of the computationalsystem to support it underwent a long way since its originup to its current degree of structural maturity

The natural course from here is to develop new templatebuilders and whichever other operations we might conceiveMore concretely with respect to the latter we should say thatduring the last couple of years we have been investigating thenotion of ldquodifferencerdquo between templates an operationwhoseoutput would yield another template representing the rulesthat have the property associated with the first template butnot having the property associated with the second In spiteof a conference publication we have on the topic (see [15]) itis not yet mature to go into the publicly available package Butin due time we intend to do so

As for new template builders a generalisation of oneto handle arbitrary values of symmetry by conjugation ismore pressing As mentioned earlier we decided not toinclude this template builder mostly because the existing onecannot yet handle arbitrary number of states in the caseof conjugation However noticing that the notion of colorblindness is essentially the notion of rules with maximumsymmetry by conjugation generalised for any 119896-state ruleusing the same idea implemented for color blindness it isnow possible to face the generalisation of arbitrary values ofsymmetry by conjugation This is clearly future work to bedone

Also it is tempting to add completely new templatebuilders to the present package referring to other parameterslike those in [16] In fact we hope that this paper triggerscollaborative participation from the cellular automata com-munity in terms of both the systemrsquos expansion and its usein applications This is why we decided to keep the work inGitHub publicly available

As for the possibility of extending the framework tosupport rules in higher dimensions we would say this wouldbe readily possible for all current properties but one numberconservation This is due to the fact that the underlyingalgorithm we used to implement the corresponding tem-plate builder comes from [17] which is restricted to one-dimensional rules In order to change that a general algo-rithm would have to be used quite likely the one describedin [18]This is certainly feasible and desirable but we had notyet had the opportunity to go about that

Data Availability

The data used to support the findings of this study are avail-able from the corresponding author upon request and theCATemplates Mathematica package directly from GitHub[10]

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

The authors are grateful to financial support fromIPM (Instituto Presbiteriano Mackenzie) and CAPES

(Coordenacao de Aperfeicoamento de Pessoal de NıvelSuperior Brazil) by means of STIC-AmSud (CoDANet)project no 888811974562018-01 and PrInt project no 888873102812018-00

References

[1] S Wolfram A New Kind of Science WolframMedia Inc 2002[2] J L Zapotecatl D A Rosenblueth and C Gershenson ldquoDelib-

erative self-organizing traffic lights with elementary cellularautomatardquo Complexity vol 2017 Article ID 7691370 15 pages2017

[3] D Wolz and P P B de Oliveira ldquoVery effective evolutionarytechniques for searching cellular automata rule spacesrdquo Journalof Cellular Automata vol 3 no 4 pp 289ndash312 2008

[4] I Barragan-Vite J C Seck-Tuoh-MoraN Hernandez-RomeroJMedina-Marin and E S Hernandez-Gress ldquoDistributed con-trol of a manufacturing system with one-dimensional cellularautomatardquo Complexity vol 2018 Article ID 7235105 15 pages2018

[5] J Yang W Liu Y Li X Li and Q Ge ldquoSimulating intraurbanland use dynamics under multiple scenarios based on fuzzycellular automata a case study of Jinzhou District DalianrdquoComplexity vol 2018 Article ID 7202985 17 pages 2018

[6] H Betel P P B De Oliveira and P Flocchini ldquoSolving theparity problem in one-dimensional cellular automatardquo NaturalComputing vol 12 no 3 pp 323ndash337 2013

[7] M Bidlo ldquoOn routine evolution of complex cellular automatardquoIEEE Transactions on Evolutionary Computation vol 20 no 5pp 742ndash754 2016

[8] P de Oliveira andMVerardo ldquoRepresenting families of cellularautomata rulesrdquoThe Mathematica Journal vol 16 no 8 2014

[9] Wolfram Research ldquoWolfram mathematica 11rdquo httpwwwwolframcommathematica 2018

[10] M Verardo and P P B de Oliveira ldquoCATemplatesrdquo httpsgithubcommverardoCATemplates 2019

[11] P P B de Oliveira ldquoOn density determination with cellularautomata Results constructions and directionsrdquo Journal ofCellular Automata vol 9 no 5-6 pp 357ndash385 2014

[12] P P B de Oliveira andMVerardo ldquoTemplate based representa-tion of cellular automata rulesrdquo inProceedings of the ExploratoryPapers - AUTOMATA 2014 - 20th International Workshop onCellular Automata and Discrete Complex Systems T IsokawaK Imai N Matsiu F Peper and H Umeo Eds pp 199ndash2042014

[13] G Theyssier ldquoCaptive cellular automatardquo in MathematicalFoundations of Computer Science vol 3153 of Lecture Notes inComputer Science pp 427ndash438 2004

[14] V Salo and I Torma ldquoColor blind cellular automatardquo inCellularAutomata and Discrete Complex Systems J Kari M Kutrib andAMalcher Eds pp 139ndash154 SpringerHeidelberg Berlin 2013

[15] Z Soares M Verardo and P P de Oliveira ldquoThe differenceoperation between templates of binary cellular automatardquo inNew Advances in Information Systems and Technologies ARocha A M Correia H Adeli L P Reis and M M TeixeiraEds vol 444 of Advances in Intelligent Systems and Computingpp 707ndash715 Springer International Publishing Cham Swizer-land 2016

Complexity 11

[16] G M Oliveira P P Oliveira and N Omar ldquoDefinitionand application of a five-parameter characterization of one-dimensional cellular automata rule spacerdquo Artificial Life vol 7no 3 pp 277ndash301 2001

[17] N Boccara and H Fuks ldquoNumber-conserving cellular automa-ton rulesrdquo Fundamenta Informaticae vol 52 no 1-3 pp 1ndash132002

[18] B Durand E Formenti and Z Roka ldquoNumber-conservingcellular automata I decidabilityrdquoTheoretical Computer Sciencevol 299 no 1-3 pp 523ndash535 2003

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 8: A Fully Operational Framework for Handling Cellular ...downloads.hindawi.com/journals/complexity/2019/6573793.pdf · is a brief overview of cellular automata and their inner workings,

8 Complexity

Now in order to generate a template representing CAsthat are invariant to the neighbourhood permutation 120588(1205871)we need to assign an output to every neighbourhood andderive a rule table that could be turned into a template

So that outputs follow 120588(1205871) we use its cycle notationrepresentation to assign to every cycle start a free variableindexed by its corresponding neighbourhoodrsquos decimal rep-resentation ending upwith a tuple formed by neighbourhoodand output The (0 2 2) neighbourhood being a cycle startis turned into the tuple ((0 2 2) 1199098) for instance

For every remaining neighbourhood in a cycle we nowapply 1205871 to the free variable found in the previous step 119889times 119889 being the distance from this neighbourhood tothe start of the cycle The cycle ((0 2 2) (1 0 0) (2 1 1))is turned into (((0 2 2) 1199098) ((1 0 0) 1205871(1199098)) ((2 1 1)1205871(1205871(1199098)))) for instance

Applying this procedure to every cycle of 1205871 we obtainthe set(((0 2 2) 1199098) ((1 0 0) 1205871 (1199098))

((2 1 1) 120587 (1205871 (1199098)))) (((0 2 1) 1199097) ((1 0 2) 1205871 (1199097)) ((2 1 0) 120587 (1205871 (1199097)))) (((0 2 0) 1199096) ((1 0 1) 1205871 (1199096)) ((2 1 2) 120587 (1205871 (1199096)))) (((0 1 2) 1199095) ((1 2 0) 1205871 (1199095)) ((2 0 1) 120587 (1205871 (1199095)))) (((0 1 1) 1199094) ((1 2 2) 1205871 (1199094)) ((2 0 0) 120587 (1205871 (1199094)))) (((0 1 0) 1199093) ((1 2 1) 1205871 (1199093)) ((2 0 2) 120587 (1205871 (1199093)))) (((0 0 2) 1199092) ((1 1 0) 1205871 (1199092)) ((2 2 1) 120587 (1205871 (1199092)))) (((0 0 1) 1199091) ((1 1 2) 1205871 (1199091)) ((2 2 0) 120587 (1205871 (1199091)))) (((0 0 0) 1199090) ((1 1 1) 1205871 (1199090)) ((2 2 2) 120587 (1205871 (1199090))))

(20)

We can now flatten a level of this set and turn it into anordered list sorted lexicographically by neighbourhood Thisprocedure yields the rule table shown in Table 2

The core of a template for CAs invariant to 120588(1205871) can nowbe found by compressing this rule table into its 119896-ary form

119879120588(1205871) = (120587 (1205871 (1199090)) 120587 (1205871 (1199092)) 120587 (1205871 (1199091)) 120587 (1205871 (1199096)) 120587 (1205871 (1199098)) 120587 (1205871 (1199097)) 120587 (1205871 (1199093)) 120587 (1205871 (1199095)) 120587 (1205871 (1199094)) 1205871 (1199094) 1205871 (1199093) 1205871 (1199095) 1205871 (1199091) 1205871 (1199090) 1205871 (1199092) 1205871 (1199097) 1205871 (1199096) 1205871 (1199098) 11990981199097 1199096 1199095 1199094 1199093 1199092 1199091 1199090))

(21)

Remember from Definition 5 that any permutation 120587 canbe represented by an algebraic function which is the actual

Table 2 Rule table for the template representative of CAs invariantto 1205871(2 2 2) 120587(1205871(1199090)(2 2 1) 120587(1205871(1199092)(2 2 0) 120587(1205871(1199091)(2 1 2) 120587(1205871(1199096)(2 1 1) 120587(1205871(1199098)(2 1 0) 120587(1205871(1199097)(2 0 2) 120587(1205871(1199093)(2 0 1) 120587(1205871(1199095)(2 0 0) 120587(1205871(1199094)(1 2 2) 1205871(1199094)(1 2 1) 1205871(1199093)(1 2 0) 1205871(1199095)(1 1 2) 1205871(1199091)(1 1 1) 1205871(1199090)(1 1 0) 1205871(1199092)(1 0 2) 1205871(1199097)(1 0 1) 1205871(1199096)(1 0 0) 1205871(1199098)(0 2 2) 1199098(0 2 1) 1199097(0 2 0) 1199096(0 1 2) 1199095(0 1 1) 1199094(0 1 0) 1199093(0 0 2) 1199092(0 0 1) 1199091(0 0 0) 1199090

representation used by the algorithm We use the 120587 nota-tion here since it is compact and serves the explanationrsquospurpose

The same procedure can now be repeated for every per-mutation of the 119878119896 set essentially mapping each permutationof the set to a corresponding template of CAs invariant to thatpermutation It is now only a matter of intersecting all of thetemplates found and the result is a template that representsall colorblind rules of the space defined by 119896 and 119903

When applied to 119896 = 2 and 119903 = 1 we obtain119879119888119900119897119900119906119903119887119897119894119899119889

= (1 minus 1199090 1 minus 1199091 1 minus 1199092 1 minus 1199093 1199093 1199092 1199091 1199090) (22)

whereas for 119896 = 3 and 119903 = 1 the result becomes

11987911988811990011989711990011990611990311988711989711989411989911988931 = (2 2 minus 1199091 2 minus 21199091 2 minus 1199093 2 minus 1199094 2minus 1199095 2 minus 2 1199093 2 minus 21199095 2 minus 21199094 1 minus 21199094 1 minus 21199093 1minus 21199095 1 minus 21199091 1 1 + 21199091 1 + 21199095 1 + 21199093 1+ 21199094 21199094 21199095 21199093 1199095 1199094 1199093 21199091 1199091 0)

(23)

Complexity 9

6 A Detailed Example

Here we discuss a detailed application for the templateframework presented in this paper which is to find the rulesthat share a set of static properties This can be achieved withthe template builder functions provided with CATemplatesor one could implement custom builder functions on top ofthe core concepts provided by the package What follows isa sample of how the framework can be used to conduct anexperiment of this sort

More specifically let us suppose we are interested in therules which are both totalistic and captive This might comefrom a purely theoretical interest or motivated by the needfor obtaining rules of this type for some practical application

We then start by building the templates for totalisticand captive rules of the elementary space as shown in theprevious sections (119879119905119900119905119886119897119894119904119905119894119888 and 119879119888119886119901119905119894V119890) By performing theirintersection we end up with a template representing alltotalistic and captive rules of the elementary space as follows

11987911989621199031 = (2 10 (1 1199093 1199093 1199091 1199093 1199091 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (24)

Upon expansion this template yields the 4 totalisticelementary CAs which are also captive 128 150 232 254Notice that the template being expanded has only 2 variableswhichmeans the expansion has to consider only 4 expansioncandidates which is a substantially smaller subset of theoriginal space which has 256 rules

Since the elementary space is a small one let us performthe same example in larger spaces We can generate theequivalent templates for the space defined by 119896 = 3 and 119903 = 1and perform the intersection between them The result is

11987911989631199031 = (3 10 (2 11990917 isin 1 2 2 11990917isin 1 2 2 1 2 1 0 11990917 isin 1 2 2 1 2 1 0 1 0 1199091isin 0 1 2 1 0 1 0 1199091 isin 0 1 0 1199091 isin 0 1 0)FilterVariableAssignments)

(25)

Notice that this template also has two variables 1199091 and11990917 This means there are only 32 = 9 possible expansions forthis template from which some will be filtered out becauseof the variable assignment annotations After expansion thistemplate yields the 4 totalistic rules of the spacewhich are alsocaptive 223160992 223161514 265235104 265235626

This means that we took a space with 327 = 7 625 597484 987 rules and found out that only 4 of those sharethe totality and captivity properties all without actuallyenumerating the whole space (which would be not feasiblegiven its size) Notice that this space could be further reducedby intersecting this resulting template with templates fromother properties like color blindness

Extending the previous case we may now ask the generalquestion of up to which rule space size could we still manageto get access to totalistic and captive rulesWithout templatesthe rules would have to be obtained directly by scanningthe rule space and selecting those having the two properties

But with 119896 = 3 this approach would already be impracticaleven for 119903 = 1 on a standard personal computer since thespace has ≃ 76 times 1012 rules A first alternative now usingtemplates could be accessing the rules say by first expandingthe totalistic rules directly from the corresponding templateand then filtering out the captive ones This certainly helpsIn fact by doing so progressively starting with radius 119903 = 05and increasing its value in steps of 05 in a standard personalcomputer it would hardly be possible to reach beyond 119903 = 2(which corresponds to a space with ≃ 87 times 10115 rules)because of the substantial increase in computational timeas we would go from a given 119903 to its subsequent valueWe omit actual values of processing time here as this maystrongly vary among different machine architectures andtheir software environment

However by relying on the generation of the individualtemplates of each property and expanding the intersectionbetween them we easily access spaces up to 119903 = 4 (possiblyeven beyond) which contains ≃ 15times109391 rules It turns outthat in this space only 256 rules share the two properties anextremely smaller space to reason about

Furthermore the analysis of all the data generated fromthe previous experiment suggests that the number of ruleswith 119896 = 3 and the shared properties of totality andcaptivity seems to be given by 4119903 for symmetric rules (thosewith integer radius) whereas no rule would be present forasymmetric rules This is quite a remarkable general resultderived from direct probing of the corresponding rule spacesthat the full usage of templates allowed us

As a final note it is worth emphasising that templateexpansion is only made when the actual rules representedin a template are needed which is at the end of the processof answering which rules satisfy a given set of propertiesUntil then it suffices to operate directly with the tem-plates this is where the conciseness of template usage liesAnd although expansion may be computationally intensiveit is certainly much less than if the entire correspond-ing spaces would have to be manipulated directly all theway

7 Concluding Remarks

Searching for cellular automata with specific behaviours(such as global problem solvers) is a daunting task for anyonelooking further than the elementary space

In this paper we presented the current state of cellularautomata templates a valuable ally in this front We havedescribed what templates are and how the two currentlyimplemented operations (expansion and intersection) workwent into details of the implementations of template builderfunctions for captive totalistic outer-totalistic and color-blind rules and have shown a sample application of theframework established here

The sample application has led us to the discovery thatonly a handful of CAs share both of the properties of totalityand captivity (only 64 rules on the 119896 = 3 119903 = 3 spacefor instance) This little experiment shows how the proposedframework can be used as a means to sieve through very largespaceswhen searching forCAs that present a given behaviour

10 Complexity

As mentioned in distinct parts of the text the notionof templates and the implementation of the computationalsystem to support it underwent a long way since its originup to its current degree of structural maturity

The natural course from here is to develop new templatebuilders and whichever other operations we might conceiveMore concretely with respect to the latter we should say thatduring the last couple of years we have been investigating thenotion of ldquodifferencerdquo between templates an operationwhoseoutput would yield another template representing the rulesthat have the property associated with the first template butnot having the property associated with the second In spiteof a conference publication we have on the topic (see [15]) itis not yet mature to go into the publicly available package Butin due time we intend to do so

As for new template builders a generalisation of oneto handle arbitrary values of symmetry by conjugation ismore pressing As mentioned earlier we decided not toinclude this template builder mostly because the existing onecannot yet handle arbitrary number of states in the caseof conjugation However noticing that the notion of colorblindness is essentially the notion of rules with maximumsymmetry by conjugation generalised for any 119896-state ruleusing the same idea implemented for color blindness it isnow possible to face the generalisation of arbitrary values ofsymmetry by conjugation This is clearly future work to bedone

Also it is tempting to add completely new templatebuilders to the present package referring to other parameterslike those in [16] In fact we hope that this paper triggerscollaborative participation from the cellular automata com-munity in terms of both the systemrsquos expansion and its usein applications This is why we decided to keep the work inGitHub publicly available

As for the possibility of extending the framework tosupport rules in higher dimensions we would say this wouldbe readily possible for all current properties but one numberconservation This is due to the fact that the underlyingalgorithm we used to implement the corresponding tem-plate builder comes from [17] which is restricted to one-dimensional rules In order to change that a general algo-rithm would have to be used quite likely the one describedin [18]This is certainly feasible and desirable but we had notyet had the opportunity to go about that

Data Availability

The data used to support the findings of this study are avail-able from the corresponding author upon request and theCATemplates Mathematica package directly from GitHub[10]

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

The authors are grateful to financial support fromIPM (Instituto Presbiteriano Mackenzie) and CAPES

(Coordenacao de Aperfeicoamento de Pessoal de NıvelSuperior Brazil) by means of STIC-AmSud (CoDANet)project no 888811974562018-01 and PrInt project no 888873102812018-00

References

[1] S Wolfram A New Kind of Science WolframMedia Inc 2002[2] J L Zapotecatl D A Rosenblueth and C Gershenson ldquoDelib-

erative self-organizing traffic lights with elementary cellularautomatardquo Complexity vol 2017 Article ID 7691370 15 pages2017

[3] D Wolz and P P B de Oliveira ldquoVery effective evolutionarytechniques for searching cellular automata rule spacesrdquo Journalof Cellular Automata vol 3 no 4 pp 289ndash312 2008

[4] I Barragan-Vite J C Seck-Tuoh-MoraN Hernandez-RomeroJMedina-Marin and E S Hernandez-Gress ldquoDistributed con-trol of a manufacturing system with one-dimensional cellularautomatardquo Complexity vol 2018 Article ID 7235105 15 pages2018

[5] J Yang W Liu Y Li X Li and Q Ge ldquoSimulating intraurbanland use dynamics under multiple scenarios based on fuzzycellular automata a case study of Jinzhou District DalianrdquoComplexity vol 2018 Article ID 7202985 17 pages 2018

[6] H Betel P P B De Oliveira and P Flocchini ldquoSolving theparity problem in one-dimensional cellular automatardquo NaturalComputing vol 12 no 3 pp 323ndash337 2013

[7] M Bidlo ldquoOn routine evolution of complex cellular automatardquoIEEE Transactions on Evolutionary Computation vol 20 no 5pp 742ndash754 2016

[8] P de Oliveira andMVerardo ldquoRepresenting families of cellularautomata rulesrdquoThe Mathematica Journal vol 16 no 8 2014

[9] Wolfram Research ldquoWolfram mathematica 11rdquo httpwwwwolframcommathematica 2018

[10] M Verardo and P P B de Oliveira ldquoCATemplatesrdquo httpsgithubcommverardoCATemplates 2019

[11] P P B de Oliveira ldquoOn density determination with cellularautomata Results constructions and directionsrdquo Journal ofCellular Automata vol 9 no 5-6 pp 357ndash385 2014

[12] P P B de Oliveira andMVerardo ldquoTemplate based representa-tion of cellular automata rulesrdquo inProceedings of the ExploratoryPapers - AUTOMATA 2014 - 20th International Workshop onCellular Automata and Discrete Complex Systems T IsokawaK Imai N Matsiu F Peper and H Umeo Eds pp 199ndash2042014

[13] G Theyssier ldquoCaptive cellular automatardquo in MathematicalFoundations of Computer Science vol 3153 of Lecture Notes inComputer Science pp 427ndash438 2004

[14] V Salo and I Torma ldquoColor blind cellular automatardquo inCellularAutomata and Discrete Complex Systems J Kari M Kutrib andAMalcher Eds pp 139ndash154 SpringerHeidelberg Berlin 2013

[15] Z Soares M Verardo and P P de Oliveira ldquoThe differenceoperation between templates of binary cellular automatardquo inNew Advances in Information Systems and Technologies ARocha A M Correia H Adeli L P Reis and M M TeixeiraEds vol 444 of Advances in Intelligent Systems and Computingpp 707ndash715 Springer International Publishing Cham Swizer-land 2016

Complexity 11

[16] G M Oliveira P P Oliveira and N Omar ldquoDefinitionand application of a five-parameter characterization of one-dimensional cellular automata rule spacerdquo Artificial Life vol 7no 3 pp 277ndash301 2001

[17] N Boccara and H Fuks ldquoNumber-conserving cellular automa-ton rulesrdquo Fundamenta Informaticae vol 52 no 1-3 pp 1ndash132002

[18] B Durand E Formenti and Z Roka ldquoNumber-conservingcellular automata I decidabilityrdquoTheoretical Computer Sciencevol 299 no 1-3 pp 523ndash535 2003

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 9: A Fully Operational Framework for Handling Cellular ...downloads.hindawi.com/journals/complexity/2019/6573793.pdf · is a brief overview of cellular automata and their inner workings,

Complexity 9

6 A Detailed Example

Here we discuss a detailed application for the templateframework presented in this paper which is to find the rulesthat share a set of static properties This can be achieved withthe template builder functions provided with CATemplatesor one could implement custom builder functions on top ofthe core concepts provided by the package What follows isa sample of how the framework can be used to conduct anexperiment of this sort

More specifically let us suppose we are interested in therules which are both totalistic and captive This might comefrom a purely theoretical interest or motivated by the needfor obtaining rules of this type for some practical application

We then start by building the templates for totalisticand captive rules of the elementary space as shown in theprevious sections (119879119905119900119905119886119897119894119904119905119894119888 and 119879119888119886119901119905119894V119890) By performing theirintersection we end up with a template representing alltotalistic and captive rules of the elementary space as follows

11987911989621199031 = (2 10 (1 1199093 1199093 1199091 1199093 1199091 1199091 0) 119865119894119897119905119890119903119881119886119903119894119886119887119897119890119860119904119904119894119892119899119898119890119899119905119904) (24)

Upon expansion this template yields the 4 totalisticelementary CAs which are also captive 128 150 232 254Notice that the template being expanded has only 2 variableswhichmeans the expansion has to consider only 4 expansioncandidates which is a substantially smaller subset of theoriginal space which has 256 rules

Since the elementary space is a small one let us performthe same example in larger spaces We can generate theequivalent templates for the space defined by 119896 = 3 and 119903 = 1and perform the intersection between them The result is

11987911989631199031 = (3 10 (2 11990917 isin 1 2 2 11990917isin 1 2 2 1 2 1 0 11990917 isin 1 2 2 1 2 1 0 1 0 1199091isin 0 1 2 1 0 1 0 1199091 isin 0 1 0 1199091 isin 0 1 0)FilterVariableAssignments)

(25)

Notice that this template also has two variables 1199091 and11990917 This means there are only 32 = 9 possible expansions forthis template from which some will be filtered out becauseof the variable assignment annotations After expansion thistemplate yields the 4 totalistic rules of the spacewhich are alsocaptive 223160992 223161514 265235104 265235626

This means that we took a space with 327 = 7 625 597484 987 rules and found out that only 4 of those sharethe totality and captivity properties all without actuallyenumerating the whole space (which would be not feasiblegiven its size) Notice that this space could be further reducedby intersecting this resulting template with templates fromother properties like color blindness

Extending the previous case we may now ask the generalquestion of up to which rule space size could we still manageto get access to totalistic and captive rulesWithout templatesthe rules would have to be obtained directly by scanningthe rule space and selecting those having the two properties

But with 119896 = 3 this approach would already be impracticaleven for 119903 = 1 on a standard personal computer since thespace has ≃ 76 times 1012 rules A first alternative now usingtemplates could be accessing the rules say by first expandingthe totalistic rules directly from the corresponding templateand then filtering out the captive ones This certainly helpsIn fact by doing so progressively starting with radius 119903 = 05and increasing its value in steps of 05 in a standard personalcomputer it would hardly be possible to reach beyond 119903 = 2(which corresponds to a space with ≃ 87 times 10115 rules)because of the substantial increase in computational timeas we would go from a given 119903 to its subsequent valueWe omit actual values of processing time here as this maystrongly vary among different machine architectures andtheir software environment

However by relying on the generation of the individualtemplates of each property and expanding the intersectionbetween them we easily access spaces up to 119903 = 4 (possiblyeven beyond) which contains ≃ 15times109391 rules It turns outthat in this space only 256 rules share the two properties anextremely smaller space to reason about

Furthermore the analysis of all the data generated fromthe previous experiment suggests that the number of ruleswith 119896 = 3 and the shared properties of totality andcaptivity seems to be given by 4119903 for symmetric rules (thosewith integer radius) whereas no rule would be present forasymmetric rules This is quite a remarkable general resultderived from direct probing of the corresponding rule spacesthat the full usage of templates allowed us

As a final note it is worth emphasising that templateexpansion is only made when the actual rules representedin a template are needed which is at the end of the processof answering which rules satisfy a given set of propertiesUntil then it suffices to operate directly with the tem-plates this is where the conciseness of template usage liesAnd although expansion may be computationally intensiveit is certainly much less than if the entire correspond-ing spaces would have to be manipulated directly all theway

7 Concluding Remarks

Searching for cellular automata with specific behaviours(such as global problem solvers) is a daunting task for anyonelooking further than the elementary space

In this paper we presented the current state of cellularautomata templates a valuable ally in this front We havedescribed what templates are and how the two currentlyimplemented operations (expansion and intersection) workwent into details of the implementations of template builderfunctions for captive totalistic outer-totalistic and color-blind rules and have shown a sample application of theframework established here

The sample application has led us to the discovery thatonly a handful of CAs share both of the properties of totalityand captivity (only 64 rules on the 119896 = 3 119903 = 3 spacefor instance) This little experiment shows how the proposedframework can be used as a means to sieve through very largespaceswhen searching forCAs that present a given behaviour

10 Complexity

As mentioned in distinct parts of the text the notionof templates and the implementation of the computationalsystem to support it underwent a long way since its originup to its current degree of structural maturity

The natural course from here is to develop new templatebuilders and whichever other operations we might conceiveMore concretely with respect to the latter we should say thatduring the last couple of years we have been investigating thenotion of ldquodifferencerdquo between templates an operationwhoseoutput would yield another template representing the rulesthat have the property associated with the first template butnot having the property associated with the second In spiteof a conference publication we have on the topic (see [15]) itis not yet mature to go into the publicly available package Butin due time we intend to do so

As for new template builders a generalisation of oneto handle arbitrary values of symmetry by conjugation ismore pressing As mentioned earlier we decided not toinclude this template builder mostly because the existing onecannot yet handle arbitrary number of states in the caseof conjugation However noticing that the notion of colorblindness is essentially the notion of rules with maximumsymmetry by conjugation generalised for any 119896-state ruleusing the same idea implemented for color blindness it isnow possible to face the generalisation of arbitrary values ofsymmetry by conjugation This is clearly future work to bedone

Also it is tempting to add completely new templatebuilders to the present package referring to other parameterslike those in [16] In fact we hope that this paper triggerscollaborative participation from the cellular automata com-munity in terms of both the systemrsquos expansion and its usein applications This is why we decided to keep the work inGitHub publicly available

As for the possibility of extending the framework tosupport rules in higher dimensions we would say this wouldbe readily possible for all current properties but one numberconservation This is due to the fact that the underlyingalgorithm we used to implement the corresponding tem-plate builder comes from [17] which is restricted to one-dimensional rules In order to change that a general algo-rithm would have to be used quite likely the one describedin [18]This is certainly feasible and desirable but we had notyet had the opportunity to go about that

Data Availability

The data used to support the findings of this study are avail-able from the corresponding author upon request and theCATemplates Mathematica package directly from GitHub[10]

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

The authors are grateful to financial support fromIPM (Instituto Presbiteriano Mackenzie) and CAPES

(Coordenacao de Aperfeicoamento de Pessoal de NıvelSuperior Brazil) by means of STIC-AmSud (CoDANet)project no 888811974562018-01 and PrInt project no 888873102812018-00

References

[1] S Wolfram A New Kind of Science WolframMedia Inc 2002[2] J L Zapotecatl D A Rosenblueth and C Gershenson ldquoDelib-

erative self-organizing traffic lights with elementary cellularautomatardquo Complexity vol 2017 Article ID 7691370 15 pages2017

[3] D Wolz and P P B de Oliveira ldquoVery effective evolutionarytechniques for searching cellular automata rule spacesrdquo Journalof Cellular Automata vol 3 no 4 pp 289ndash312 2008

[4] I Barragan-Vite J C Seck-Tuoh-MoraN Hernandez-RomeroJMedina-Marin and E S Hernandez-Gress ldquoDistributed con-trol of a manufacturing system with one-dimensional cellularautomatardquo Complexity vol 2018 Article ID 7235105 15 pages2018

[5] J Yang W Liu Y Li X Li and Q Ge ldquoSimulating intraurbanland use dynamics under multiple scenarios based on fuzzycellular automata a case study of Jinzhou District DalianrdquoComplexity vol 2018 Article ID 7202985 17 pages 2018

[6] H Betel P P B De Oliveira and P Flocchini ldquoSolving theparity problem in one-dimensional cellular automatardquo NaturalComputing vol 12 no 3 pp 323ndash337 2013

[7] M Bidlo ldquoOn routine evolution of complex cellular automatardquoIEEE Transactions on Evolutionary Computation vol 20 no 5pp 742ndash754 2016

[8] P de Oliveira andMVerardo ldquoRepresenting families of cellularautomata rulesrdquoThe Mathematica Journal vol 16 no 8 2014

[9] Wolfram Research ldquoWolfram mathematica 11rdquo httpwwwwolframcommathematica 2018

[10] M Verardo and P P B de Oliveira ldquoCATemplatesrdquo httpsgithubcommverardoCATemplates 2019

[11] P P B de Oliveira ldquoOn density determination with cellularautomata Results constructions and directionsrdquo Journal ofCellular Automata vol 9 no 5-6 pp 357ndash385 2014

[12] P P B de Oliveira andMVerardo ldquoTemplate based representa-tion of cellular automata rulesrdquo inProceedings of the ExploratoryPapers - AUTOMATA 2014 - 20th International Workshop onCellular Automata and Discrete Complex Systems T IsokawaK Imai N Matsiu F Peper and H Umeo Eds pp 199ndash2042014

[13] G Theyssier ldquoCaptive cellular automatardquo in MathematicalFoundations of Computer Science vol 3153 of Lecture Notes inComputer Science pp 427ndash438 2004

[14] V Salo and I Torma ldquoColor blind cellular automatardquo inCellularAutomata and Discrete Complex Systems J Kari M Kutrib andAMalcher Eds pp 139ndash154 SpringerHeidelberg Berlin 2013

[15] Z Soares M Verardo and P P de Oliveira ldquoThe differenceoperation between templates of binary cellular automatardquo inNew Advances in Information Systems and Technologies ARocha A M Correia H Adeli L P Reis and M M TeixeiraEds vol 444 of Advances in Intelligent Systems and Computingpp 707ndash715 Springer International Publishing Cham Swizer-land 2016

Complexity 11

[16] G M Oliveira P P Oliveira and N Omar ldquoDefinitionand application of a five-parameter characterization of one-dimensional cellular automata rule spacerdquo Artificial Life vol 7no 3 pp 277ndash301 2001

[17] N Boccara and H Fuks ldquoNumber-conserving cellular automa-ton rulesrdquo Fundamenta Informaticae vol 52 no 1-3 pp 1ndash132002

[18] B Durand E Formenti and Z Roka ldquoNumber-conservingcellular automata I decidabilityrdquoTheoretical Computer Sciencevol 299 no 1-3 pp 523ndash535 2003

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 10: A Fully Operational Framework for Handling Cellular ...downloads.hindawi.com/journals/complexity/2019/6573793.pdf · is a brief overview of cellular automata and their inner workings,

10 Complexity

As mentioned in distinct parts of the text the notionof templates and the implementation of the computationalsystem to support it underwent a long way since its originup to its current degree of structural maturity

The natural course from here is to develop new templatebuilders and whichever other operations we might conceiveMore concretely with respect to the latter we should say thatduring the last couple of years we have been investigating thenotion of ldquodifferencerdquo between templates an operationwhoseoutput would yield another template representing the rulesthat have the property associated with the first template butnot having the property associated with the second In spiteof a conference publication we have on the topic (see [15]) itis not yet mature to go into the publicly available package Butin due time we intend to do so

As for new template builders a generalisation of oneto handle arbitrary values of symmetry by conjugation ismore pressing As mentioned earlier we decided not toinclude this template builder mostly because the existing onecannot yet handle arbitrary number of states in the caseof conjugation However noticing that the notion of colorblindness is essentially the notion of rules with maximumsymmetry by conjugation generalised for any 119896-state ruleusing the same idea implemented for color blindness it isnow possible to face the generalisation of arbitrary values ofsymmetry by conjugation This is clearly future work to bedone

Also it is tempting to add completely new templatebuilders to the present package referring to other parameterslike those in [16] In fact we hope that this paper triggerscollaborative participation from the cellular automata com-munity in terms of both the systemrsquos expansion and its usein applications This is why we decided to keep the work inGitHub publicly available

As for the possibility of extending the framework tosupport rules in higher dimensions we would say this wouldbe readily possible for all current properties but one numberconservation This is due to the fact that the underlyingalgorithm we used to implement the corresponding tem-plate builder comes from [17] which is restricted to one-dimensional rules In order to change that a general algo-rithm would have to be used quite likely the one describedin [18]This is certainly feasible and desirable but we had notyet had the opportunity to go about that

Data Availability

The data used to support the findings of this study are avail-able from the corresponding author upon request and theCATemplates Mathematica package directly from GitHub[10]

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

The authors are grateful to financial support fromIPM (Instituto Presbiteriano Mackenzie) and CAPES

(Coordenacao de Aperfeicoamento de Pessoal de NıvelSuperior Brazil) by means of STIC-AmSud (CoDANet)project no 888811974562018-01 and PrInt project no 888873102812018-00

References

[1] S Wolfram A New Kind of Science WolframMedia Inc 2002[2] J L Zapotecatl D A Rosenblueth and C Gershenson ldquoDelib-

erative self-organizing traffic lights with elementary cellularautomatardquo Complexity vol 2017 Article ID 7691370 15 pages2017

[3] D Wolz and P P B de Oliveira ldquoVery effective evolutionarytechniques for searching cellular automata rule spacesrdquo Journalof Cellular Automata vol 3 no 4 pp 289ndash312 2008

[4] I Barragan-Vite J C Seck-Tuoh-MoraN Hernandez-RomeroJMedina-Marin and E S Hernandez-Gress ldquoDistributed con-trol of a manufacturing system with one-dimensional cellularautomatardquo Complexity vol 2018 Article ID 7235105 15 pages2018

[5] J Yang W Liu Y Li X Li and Q Ge ldquoSimulating intraurbanland use dynamics under multiple scenarios based on fuzzycellular automata a case study of Jinzhou District DalianrdquoComplexity vol 2018 Article ID 7202985 17 pages 2018

[6] H Betel P P B De Oliveira and P Flocchini ldquoSolving theparity problem in one-dimensional cellular automatardquo NaturalComputing vol 12 no 3 pp 323ndash337 2013

[7] M Bidlo ldquoOn routine evolution of complex cellular automatardquoIEEE Transactions on Evolutionary Computation vol 20 no 5pp 742ndash754 2016

[8] P de Oliveira andMVerardo ldquoRepresenting families of cellularautomata rulesrdquoThe Mathematica Journal vol 16 no 8 2014

[9] Wolfram Research ldquoWolfram mathematica 11rdquo httpwwwwolframcommathematica 2018

[10] M Verardo and P P B de Oliveira ldquoCATemplatesrdquo httpsgithubcommverardoCATemplates 2019

[11] P P B de Oliveira ldquoOn density determination with cellularautomata Results constructions and directionsrdquo Journal ofCellular Automata vol 9 no 5-6 pp 357ndash385 2014

[12] P P B de Oliveira andMVerardo ldquoTemplate based representa-tion of cellular automata rulesrdquo inProceedings of the ExploratoryPapers - AUTOMATA 2014 - 20th International Workshop onCellular Automata and Discrete Complex Systems T IsokawaK Imai N Matsiu F Peper and H Umeo Eds pp 199ndash2042014

[13] G Theyssier ldquoCaptive cellular automatardquo in MathematicalFoundations of Computer Science vol 3153 of Lecture Notes inComputer Science pp 427ndash438 2004

[14] V Salo and I Torma ldquoColor blind cellular automatardquo inCellularAutomata and Discrete Complex Systems J Kari M Kutrib andAMalcher Eds pp 139ndash154 SpringerHeidelberg Berlin 2013

[15] Z Soares M Verardo and P P de Oliveira ldquoThe differenceoperation between templates of binary cellular automatardquo inNew Advances in Information Systems and Technologies ARocha A M Correia H Adeli L P Reis and M M TeixeiraEds vol 444 of Advances in Intelligent Systems and Computingpp 707ndash715 Springer International Publishing Cham Swizer-land 2016

Complexity 11

[16] G M Oliveira P P Oliveira and N Omar ldquoDefinitionand application of a five-parameter characterization of one-dimensional cellular automata rule spacerdquo Artificial Life vol 7no 3 pp 277ndash301 2001

[17] N Boccara and H Fuks ldquoNumber-conserving cellular automa-ton rulesrdquo Fundamenta Informaticae vol 52 no 1-3 pp 1ndash132002

[18] B Durand E Formenti and Z Roka ldquoNumber-conservingcellular automata I decidabilityrdquoTheoretical Computer Sciencevol 299 no 1-3 pp 523ndash535 2003

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 11: A Fully Operational Framework for Handling Cellular ...downloads.hindawi.com/journals/complexity/2019/6573793.pdf · is a brief overview of cellular automata and their inner workings,

Complexity 11

[16] G M Oliveira P P Oliveira and N Omar ldquoDefinitionand application of a five-parameter characterization of one-dimensional cellular automata rule spacerdquo Artificial Life vol 7no 3 pp 277ndash301 2001

[17] N Boccara and H Fuks ldquoNumber-conserving cellular automa-ton rulesrdquo Fundamenta Informaticae vol 52 no 1-3 pp 1ndash132002

[18] B Durand E Formenti and Z Roka ldquoNumber-conservingcellular automata I decidabilityrdquoTheoretical Computer Sciencevol 299 no 1-3 pp 523ndash535 2003

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 12: A Fully Operational Framework for Handling Cellular ...downloads.hindawi.com/journals/complexity/2019/6573793.pdf · is a brief overview of cellular automata and their inner workings,

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom