forked from mitar/fri-latex-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
magisterij.tex
2091 lines (1716 loc) · 93.2 KB
/
magisterij.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%*****************************************************************
% Vzorec za pisanje diplomskega dela,
% ki vsebuje navodila za izdelavo diplomskega dela
%
% UNIVERZA V LJUBLJANI
% Fakulteta za računalništvo in informatiko
%
% Pripravila: [email protected]
%*****************************************************************
\documentclass[12pt,a4paper,openany,twoside]{book}
%Uporabljeni paketi
\RequirePackage{pdf14}
\usepackage{cmap}
\usepackage[utf8]{inputenc}
\usepackage{type1ec}
\usepackage[T1]{fontenc}
\usepackage{graphicx,epsfig}
\usepackage[slovene]{babel}
\usepackage{cite}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{listings}
%\usepackage{url}
\usepackage[pdftex,colorlinks,citecolor=black,filecolor=black,linkcolor=black,urlcolor=black]{hyperref}
\usepackage[top=2cm, bottom=3cm, inner=3cm, outer=2cm]{geometry}
\usepackage{fancyvrb}
\usepackage{incgraph}
\usepackage[a-1b]{pdfx}
%\usepackage[backend=bibtex]{biblatex}
%\addbibresource{magisterij.bib}
%Nastavitev glave in repa strani
\pagestyle{myheadings}
% stil odstavkov
\setlength{\parindent}{0cm}
\setlength{\parskip}{5mm plus2mm minus2mm}
%\input{cc}
%********************************************
% kratice, simboli
\newcommand{\abbrlabel}[1]{\makebox[3cm][l]{\textbf{#1}\ \dotfill}}
\newenvironment{abbreviations}{\begin{list}{}{\renewcommand{\makelabel}{\abbrlabel}}}{\end{list}}
%********************************************
\begin{document}
%********************************************
% platnica
\thispagestyle{empty}
\begin{center}
{\large UNIVERZA V LJUBLJANI\\
FAKULTETA ZA RAČUNALNIŠTVO IN INFORMATIKO\\}
\vspace{3cm} {\large Iztok Jeras}\\
\vspace{2cm} {\large \textbf{Predslike 2D celičnih avtomatov}}\\
\vspace{2cm} {MAGISTRSKO DELO\\ NA UNIVERZITETNEM ŠTUDIJU}\\
\vfill {\Large Ljubljana, 2016}
\end{center}
\newpage
\ \thispagestyle{empty}
\newpage
%********************************************
%********************************************
% stran 1 med uvodnimi listi
\thispagestyle{empty}
\begin{center}
{\large UNIVERZA V LJUBLJANI\\
FAKULTETA ZA RAČUNALNIŠTVO IN INFORMATIKO\\}
\vspace{3cm} {\large Iztok Jeras}\\
\vspace{2cm} {\large \textbf{Predslike 2D celičnih avtomatov}}\\
\vspace{2cm} {MAGISTRSKO DELO\\ NA UNIVERZITETNEM ŠTUDIJU}\\
\vspace{2cm} {\Large Mentor: prof. dr. Branko Šter}
\vfill {\Large Ljubljana, 2016}
\end{center}
\newpage
\ \thispagestyle{empty}
\newpage
%********************************************
%********************************************
% stran 2 med uvodnimi listi
\thispagestyle{empty}
\vspace*{5cm}
{\small \noindent
To magistrsko delo je ponujeno pod licenco \textit{Creative Commons Attribution-ShareAlike 4.0 International}
\footnote{http://creativecommons.org/licenses/by-sa/4.0/} ali v slovenščini \textit{priznanje avtorstva in deljenje pod enakimi pogoji 4.0 mednarodna}
\footnote{http://www.ipi.si/sl/creative-commons-cc/o-uporabi-licence}. Po želji se lahko uporabnik poslužuje novejše različice.
To pomeni, da se tako besedilo, slike, grafi in druge sestavine dela kot tudi rezultati magistrskega dela lahko prosto distribuirajo,
reproducirajo, uporabljajo, dajejo v najem, priobčujejo javnosti in predelujejo, pod pogojem, da se jasno in vidno navede avtorja in naslov tega
dela in da se v primeru spremembe, preoblikovanja ali uporabe tega dela v svojem delu, lahko distribuira predelava le pod
licenco, ki je enaka tej.
Uporabljena je mednarodna licenca, čeprav obstaja verzija prilagojena za slovenski pravni red, to pa zato, ker slovenska verzija ni vzdrževana.
Podrobnosti licence so dostopne na spletni strani \url{http://creativecommons.org}
ali na Inštitutu za intelektualno lastnino, Streliška 1, 1000 Ljubljana.
\begin{center}
\includegraphics[width=5cm]{by-sa.png}
\end{center}
}
\vspace*{1.5cm}
{\small \noindent
Izvorna koda programske opreme, razvite za potrebe magistrskega dela, je ponujena pod licenco \textit{Unlicense} \footnote{http://unlicense.org/}.
To pomeni, da se lahko prosto uporablja, distribuira in/ali predeluje, brez kakšnih koli obveznosti.
Avtor se odpoveduje vsem pravicam in tako omogoča uporabnikom izvorne kode, da se izognejo preverjanju pravnih obveznosti.
}
\begin{center}
\ \\ \vfill
{\em Besedilo je oblikovano z urejevalnikom besedil \LaTeX.\\
Slike in grafi so narisani s pomočjo programa za vektorske ilustracije Inkscape \footnote{https://inkscape.org}.}
\end{center}
\newpage
\ \thispagestyle{empty}
\newpage
%********************************************
% stran 3 med uvodnimi listi
\incgraph[documentpaper][width=\paperwidth,height=\paperheight]{original_izdane_teme_magistrskega_dela.jpg}
%\includepdf{original_izdane_teme_magistrskega_dela.pdf}
%\thispagestyle{empty}
%Namesto te strani {\bf vstavite} original izdane teme magistrskega dela s podpisom mentorja in dekana ter žigom fakultete, ki ga magistrant
%dvigne v študent\-skem referatu, preden odda izdelek v vezavo!
%\newpage
%********************************************
% stran 4 med uvodnimi listi je prazna
\ \thispagestyle{empty}
\newpage
%********************************************
% stran 5 med uvodnimi listi
\thispagestyle{empty}
\vspace*{2cm}
\begin{center}
{\Large \textbf{IZJAVA O AVTORSTVU \\ \vspace{0.5cm} magistrskega dela}}
\end{center}
\vspace{1cm}
Spodaj podpisani \textbf{Iztok Jeras},
z vpisno številko \textbf{63030393},
sem avtor magistrskega dela z naslovom:
\vspace{1cm}
\hspace{1cm}\textbf{Predslike 2D celičnih avtomatov}
\vspace{1cm}
S svojim podpisom zagotavljam, da:
\begin{itemize}
\item sem magistrsko delo izdelal samostojno pod vodstvom mentorja \textbf{prof. dr. Branka Štera},
\item so elektronska oblika magistrskega dela, naslova (slov., angl.), povzetka (slov., angl.) ter ključne besede (slov., angl.) identični s tiskano obliko magistrskega dela
\item in soglašam z javno objavo elektronske oblike magistrskega dela v zbirki »Dela FRI«.
\end{itemize}
\vspace{3cm}
V Ljubljani, dne 30. avgust 2016 \hfill Podpis avtorja:
\newpage
%********************************************
% stran 6 med uvodnimi listi je prazna pri dvostranskem tiskanju
\ \thispagestyle{empty}
\newpage
%********************************************
% stran 7 med uvodnimi listi
\chapter*{Zahvala}
\thispagestyle{empty}
Zahvaljujem se prof. dr. Andreju Dobnikarju za pomoč pri pisanju člankov
o algoritmih za štetje in izpis predslik pri enodimenzionalnih celičnih avtomatih.
\newpage
%********************************************
% stran 8 med uvodnimi listi je prazna pri dvostranskem tiskanju
\ \thispagestyle{empty}
\newpage
%********************************************
\renewcommand\thepage{}
\tableofcontents
\renewcommand\thepage{\arabic{page}}
\thispagestyle{empty}
%********************************************
\chapter*{Seznam uporabljenih kratic in simbolov}
\thispagestyle{empty}
% simboli
\begin{abbreviations}
\item[1D] enodimenzionalen
\item[2D] dvodimenzionalen
\item[3D] tridimenzionalen
\item[CA] celični avtomati (angl. cellular automata)
\item[GoL] Conwayeva igra življenja (angl. Conway's Game of Life)
\item[GoE] rajski vrt (angl. Garden of Eden)
\item[trid] okolica CA, sestavljena iz treh celic na heksagonalni mreži
\item[quad] okolica CA, sestavljena iz štirih celic na kvadratni mreži
\item[DFS] iskanje v globino (angl. depth first search)
\item[SAT] problem izpolnjivosti (angl. boolean satisfiability problem)
\vspace{10mm}
\item[\(C\)] poljubna konstanta
\item[\(S\)] nabor stanj celice
\item[\(|S|\)] število možnih stanj celice
\item[\(c\)] stanje posamezne celice (celoštevilska vrednost)
\item[\(c(x,y)\)] stanje celice na koordinatah \((x,y)\) znotraj 2D polja celic
\item[\(c^t\)] stanje celice v sedanjosti
\item[\(c^{t+1}\)] stanje celice v prihodnosti (en korak)
\item[\(N_x\)] velikost pravokotnega 2D polja celic v dimenziji X
\item[\(N_y\)] velikost pravokotnega 2D polja celic v dimenziji Y
\item[\(N\)] število celic v 1D ali 2D polju
\item[\(M_x\)] velikost pravokotne 2D okolice celice v dimenziji X
\item[\(M_y\)] velikost pravokotne 2D okolice celice v dimenziji Y
\item[\(M\)] število celic v 1D ali 2D okolici
\item[\(n\)] stanje okolice posamezne celice (celoštevilska vrednost)
\item[\(n(x,y)\)] stanje okolice celice na koordinatah \((x,y)\) znotraj 2D polja celic
\item[\(n^{t-1}\)] stanje okolice celice v preteklosti (en korak)
\item[\(n^t\)] stanje okolice celice v sedanjosti
\item[\(f\)] tranzicijska funkcija, ki definira časovno evolucijo avtomata
\item[\(f^{-1}\)] obratna tranzicijska funkcija
\item[\(o_{\leftrightarrow}\)] prekrivanje okolic v dimenziji X
\item[\(o_{\updownarrow}\)] prekrivanje okolic v dimenziji Y
\item[\(o_{\times}\)] prekrivanje okolic v diagonalni smeri
\end{abbreviations}
%\cleardoublepage
\clearpage{\pagestyle{empty}\cleardoublepage}
%********************************************
%zacno se glavni listi, ki so numerirani z arabskimi stevilkami
\setcounter{page}{1}
\pagenumbering{arabic}
\chapter*{Povzetek}
\addcontentsline{toc}{chapter}{Povzetek}
Medtem ko je računanje predslik 1D celičnih avtomatov dobro raziskan in
podrobno dokumentiran problem, je to področje pri 2D celičnih avtomatih manj raziskano.
Za 1D problem poznamo algoritme za štetje in izpis predslik s
procesno zahtevnostjo linearno odvisno od velikosti problema.
Možno je tudi določiti, ali je 1D celični avtomat reverzibilen in
kakšen je regularen jezik vseh stanj brez predslik.
Pri 2D problemu sicer poznamo nekaj algoritmov za iskanje predslik,
vendar so slabo teoretično raziskani.
Vemo tudi, da je problem reverzibilnosti 2D celičnih avtomatov na splošno neodločljiv.
Mreža predslik, ki sem jo v preteklosti razvil za potrebe analize predslik 1D celičnih avtomatov,
se je izkazala za praktično orodje pri razlagi algoritmov in pri dokazovanju njihove pravilnosti.
Tukaj opišem kako se mrežo predslik tvori za 2D celične avtomate.
Če je bila ta mreža za 1D problem navaden graf, je za 2D problem razširjena v tretjo dimenzijo.
Predslike so namesto poti v grafu ploskve na mreži.
Robni pogoj se spremeni iz uteži za vozlišča, ki zaključujejo pot v 1D problemu,
v uteži za sklenjeno pot okoli ploskve predslike v 2D problemu.
Pri razvoju algoritma se je izkazalo, da štetja predslik 2D celičnega avtomata
ni mogoče izvesti v linearni odvisnosti od velikosti problema.
Zahtevnost podanega algoritma narašča eksponentno z velikostjo problema v eni dimenziji.
Podani algoritem se ne razlikuje dosti od obstoječih.
Celični avtomat razdeli na vrstice in išče predslike za posamezno vrstico od prve do zadnje.
Vrstične rezultate nato združi v rešitev za celoten 2D problem.
Podobno kot pri algoritmu za 1D probleme je analiza razdeljena v dva prehoda.
V prvem prehodu po vrsticah algoritem prešteje predslike,
v drugem opcijskem prehodu pa predslike izpiše.
Drugi prehod poteka v obratni smeri kakor prvi prehod.
Tudi procesiranje posamezne vrstice poteka iz drugega zornega kota.
Glavni napredek algoritma vidim v uporabi učinkovitih rešitev za 1D problem pri analizi vrstic ter
v uporabi progresivnega kodiranja vmesnih rezultatov, kar lahko zmanjša porabo pomnilnika.
\vspace{1.3cm}
\noindent
{\large \bf Ključne besede:}
\vspace{0.5cm}
\noindent
celični avtomati, predslike, predhodniki, računska zahtevnost, reverzibilnost, rajski vrt, Conwayeva igra življenja, trid, quad
\newpage
% prazna stran
\ \thispagestyle{empty}
\newpage
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
While computing preimages of 1D cellular automata is a well researched and documented problem,
for 2D cellular automata there is less research available.
For the 1D problem we know algorithms for counting and listing preimages
where computational complexity is a linear function of the size of the problem.
It is possible to determine whether a 1D cellular automaton is reversible,
and what is the Garden of Eden sequence regular language.
For the 2D problem we know a few algorithms,
but they are poorly theoretically researched.
We also know that the reversibility problem is
in general undecidable for 2D cellular automata.
The preimage network, first developed for 1D cellular automata,
was proved to be a useful tool for explaining algorithms and for constructing proofs.
Here I explain how to construct the preimage network for 2D cellular automata.
While for the 1D problem this network is a normal graph,
for 2D it was extended into the third dimension.
Preimages are transformed from paths in the graph in 1D into surfaces on the network in 2D.
Edge conditions are transformed from weights for vertices ending a path in the 1D problem
into weights for the closed path around a preimage surface in the 2D problem.
While developing the algorithm, it proved impossible
to count preimages of 2D cellular automata
with processing requirements growing linearly with problem size.
Instead, processing requirements grow exponentially
with the size in one of the dimensions.
The described algorithm does not differ much from the existing ones.
The cellular automaton is split into rows,
the preimage list is first determined for each row from the first to the last.
The row results are then combined into the result for the whole 2D problem.
In a similar fashion to the 1D approach,
the algorithm splits into two passes.
In the first pass preimages are counted,
in the second optional pass preimages are listed.
The second pass is performed in the opposite direction,
while rows are also observed from the opposite side.
I see the main advantage of the described algorithm
in using existing solutions for row processing.
Solutions proved to be effective in solving the 1D problem.
Using progressive encoding of intermediate solutions
also enables reducing memory consumption.
\vspace{1.3cm}
\noindent
{\large \bf Key words:}
\vspace{0.5cm}
\noindent
cellular automata, preimages, predecessors, ataviser, computational complexity, reversibility, Garden of Eden, Conway's Game of Life, trid, quad
\newpage
% prazna stran
\ \thispagestyle{empty}
\newpage
%********************************************
\chapter{Uvod}
\section{Motivacija}
\subsection{Celični avtomati kot model vesolja}
Ker lahko vsak univerzalen sistem modelira vsak drug univerzalen sistem, lahko predpostavimo,
da lahko z univerzalnimi \emph{celičnimi avtomati} (angl. \emph{cellular automata, CA}) modeliramo vesolje. Samo modeliranje vesolja
je še izven našega dosega, poizkuša pa se vsaj približati teorijo CA teoretični fiziki.
S strani informacijske teorije in termodinamike je predvsem zanimiv model gravitacije
kakor entropijske sile (angl. Entropic gravity) \cite{Verlinde2010}, ki predpostavlja, da je
3D vesolje projekcija procesov, ki se odvijajo na 2D ploskvi. Z druge strani pa CA tudi omogočajo
opazovanje abstraktnega kopiranja informacij (replikacija) in evolucije \cite{Salzberg2004}.
Oba sta pomembna informacijska pojava v našem vesolju.
\subsection{Informacijska dinamika}
Informacijsko dinamiko CA se najpogosteje opisuje samo kakor reverzibilno ali ireverzibilno.
Obstaja tudi nekaj člankov, ki opazujejo entropijo sistema.
Pri reverzibilnem avtomatu se vsa informacija ohranja. Vsako stanje ima natanko eno prihodnost in eno preteklost.
Za reverzibilen celični avtomat lahko tudi definiramo pravilo oziroma funkcijo,
s katero preprosto procesiramo avtomat v preteklost namesto v prihodnost.
Za reverzibilne CA je torej računanje predslik (preteklosti)
trivialno in ne potrebuje tukaj opisanega algoritma.
Za ireverzibilne CA tako reverzno pravilo ne obstaja.
Trenutno stanje ima lahko nobeno, eno, ali več predslik.
Opisani algoritem je namenjen štetju in izpisu predslik za dano sedanje stanje CA.
Za take avtomate pravimo, da s časom izgubljajo informacijo,
ker ne moremo enolično določiti preteklega stanja.
Pogosto je tudi opazovanje dinamike delcev pri \emph{Igri življenja} (angl. \emph{Game of Life, GoL}) \cite{WikiGoL} (slika \ref{gospers_glider_gun})
in elementarnem pravilu 110 \cite{WikiRule110} (slika \ref{ca110-interaction2}).
Pištole, trki delcev in podobni konstrukti obstajajo tako v GoL kakor pri elementarnem pravilu 110
in na splošno pri vsakem univerzalnem celičnem avtomatu.
Pištole (slika \ref{gospers_glider_gun}) oddajajo delce, izvor in oddani delci skupaj rastejo v neskončnost.
S tem se informacija, potrebna za opis sistema, povečuje.
Slika \ref{ca110-interaction2} prikazuje dve različni interakciji med dvema delcema.
V levem primeru se delca srečata, si nekaj časa delita skupen prostor in nato nadaljujejta pot vsak zase.
V desnem primeru se delca srečata in po trku nastane nov delec.
Veliko poklicnih in amaterskih raziskovalcev proučuje delce v GoL in njihovo dinamiko.
S pomočjo osnovnih gradnikov je mogoče skonstruirati kompleksnejše sisteme, med katerimi so
najzanimivejši Turingov stroj \cite{Rendell2001} in univerzalni konstruktor \cite{Greene2013}.
\vspace{5mm}
\begin{figure}[htb]
\centerline{\includegraphics[width=8cm]{gospers_glider_gun}}
\caption[Gosperjeva pištola.]
{Gosperjeva pištola z nekaj izstreljenimi drsalci.}
\label{gospers_glider_gun}
\end{figure}
\vspace{5mm}
\begin{figure}[htb]
\centerline{\includegraphics[width=13.9cm]{ca110-interaction2}}
\caption[Trk delcev v pravilu 110.]
{Trk para delcev v pravilu 110. Razlika v začetnem stanju med slikama je v razdalji (fazi) med delcema.}
\label{ca110-interaction2}
\end{figure}
\vspace{5mm}
Celične Avtomate sta si zamislila matematika John von Neumann in Stanislaw Ulam,
da bi lahko oblikovala teorijo univerzalnega konstruktorja \cite{WikiVonNeumannUniversalConstructor},
ki je sposoben iz zapisa na traku narediti kopijo samega sebe.
Christopher Langton je vzel del univerzalnega konstruktorja in ga poenostavil v preprosto zanko \cite{WikiLangtonLoops},
ki kopira samo sebe na podlagi informacije zapisane v notranjosti telesa (slika \ref{langtons_loop}).
\vspace{5mm}
\begin{figure}[htb]
\centering
\begin{BVerbatim}
2 2 2 2 2 2 2 2
2 1 7 0 1 4 0 1 4 2
2 0 2 2 2 2 2 2 0 2
2 7 2 2 1 2
2 1 2 2 1 2
2 0 2 2 1 2
2 7 2 2 1 2
2 1 2 2 2 2 2 2 1 2 2 2 2 2
2 0 7 1 0 7 1 0 7 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2 2 2 2
\end{BVerbatim}
\caption[Langtonova zanka.]
{Langtonova zanka. Številke so stanja posamezne celice. Spodaj desno iz zanke raste nova zanka.}
\label{langtons_loop}
\end{figure}
\vspace{5mm}
Zgoraj našteti primeri nekako opisujejo informacijsko dinamiko v CA.
Ne obstaja pa še splošna teorija dinamike informacij v CA,
ki bi dinamiko opisala kvantitativno in prostorsko.
V svojem članku \cite{JerasDobnikar2007} in prispevkih na konferencah \cite{DBLP:conf/iccS/JerasD06, DBLP:conf/automata/Jeras08, Jeras2008-pyca}
sem grafično upodobil predslike trenutnega stanja za 1D problem.
Iz upodobitve (slika \ref{network_rule110_quiescent}) je videti, da se ponekod izgubi več informacije kakor drugod,
kar kaže na možnost izpeljave splošne teorije dinamike informacij.
Na žalost se ta možnost še ni udejanila. Podobno je možno grafično upodobiti predslike 2D CA,
ter iz grafov sklepati o izgubi informacije v 2D CA.
\vspace{10mm}
\begin{figure}[htb]
\centerline{\psfig{figure=network_rule110_quiescent,width=16cm}}
\caption[Mreža predslik 1D CA.]
{Mreža predslik 1D CA (pravilo 110) za tiho ozadje s cikličnim zaporedjem 00010011011111.
Vsaka od dveh poudarjenih poti med levim in desnim predstavlja predsliko.
V enem delu sta si predsliki enaki, drugod se razlikujeta.
Laično lahko sklepamo, da se tam, kjer se predsliki razlikujeta, izgubi 1 bit informacije.}
\label{network_rule110_quiescent}
\end{figure}
\vspace{5mm}
\subsection{Atraktorjevo korito}
Pomembno orodje za analizo časovno in prostorsko diskretnih dinamičnih sistemov
je \emph{atraktorjevo korito} (angl. \emph{basin of attraction}) (slika \ref{basin_of_attraction}).
Andrew Wuensche že leta proučuje atraktorjeva korita naključnih binarnih mrež in celičnih avtomatov \cite{Wuensche1992, WuenscheDDLab}.
To je graf, kjer so vozlišča stanja cikličnega končnega CA,
usmerjene poti pa povezujejo vsako stanje z njegovim časovnim naslednikom.
Vsa stanja se lahko zberejo v eno ali več korit, odvisno od sistema.
V vsakem CA, ki ni lokalno injektiven, se pojavljajo stanja brez predslik,
imenovana \emph{rajski vrt} (angl. \emph{Garden of Eden, GoE}) \cite{Moore1962, Myhill1963}.
Stanja GoE so listi v grafu korita.
Sam atraktor je cikel v grafu korita.
To je časovno periodično stanje, v katerem se končna časovna evolucija vsakega končnega diskretnega dinamičnega sistema.
Cikel lahko vsebuje eno ali več stanj, njihovo število imenujemo perioda atraktorja.
Atraktor predstavlja tudi stabilne objekte v neskončnem CA.
Za GoL obstajajo katalogi takih objektov, kjer so ti urejeni po velikosti, periodi in hitrosti premikanja.
Kot primer bi navedel \emph{mrtvo ozadje} (angl. \emph{quiescent background}) (perioda 1)
in \emph{drsalca} (angl. \emph{glider}) (perioda 4).
\begin{figure}[htb]
\centerline{\psfig{figure=basin_of_attraction_rule110_conf00010011011111,width=15cm}}
\caption[Atraktorjevo korito.]
{Atraktorjevo korito za elementarno pravilo 110 in konfiguracijo 00010011011111 znotraj atraktorja.
Korito vsebuje osrednji cikel atraktorja ter drevesa, ki rastejo iz cikla in se končujejo z listi (stanja GoE).
Slika je narejena s programom \url{www.ddlab.com}.}
\label{basin_of_attraction}
\end{figure}
\section{Algoritmi za štetje in izpis predslik CA}
Doslej sem že razvil napredne algoritme za štetje in izpis predslik 1D CA \cite{JerasDobnikar2007}.
Skozi zgodovino so taki algoritmi napredovali, tako da je padala njihova
računska zahtevnost in opisna/implementacijska zahtevnost:
\begin{enumerate}[noitemsep,nolistsep]
\item algoritmi s \emph{surovo silo} (angl. \emph{brute force}) \cite{WikiBruteForce} imajo zahtevnost \( O(C^N) \),
\item algoritmi z \emph{iskanjem v globino} (angl. \emph{depth first search, DFS}) \cite{WikiDFS}, \\
algoritmi s \emph{sestopanjem} (angl. \emph{backtacking}) \cite{WikiBacktracking}, \\
algoritmi, ki rešujejo \emph{problem izpolnjivosti} (angl. \emph{Boolean satisfiability problem, SAT}) \cite{WikiSAT},
\item optimalni algoritmi, kjer sta izpis in štetje strogo ločena.
\end{enumerate}
Bistvo optimalnega algoritma je, da je proces štetja predslik optimalen.
Za 1D CA je to doseženo, saj je zahtevnost štetja
linearno odvisna od velikosti problema \(O(N)\) (\(N\) je število opazovanih celic).
Raziskave algoritma za štetje predslik 2D CA sem se lotil s predpostavko,
da je tudi tu možno opraviti štetje predslik z linearno zahtevnostjo.
Izkaže se, da 2D problem ni tako preprost.
Predstavljeni so primeri, iz katerih je razvidno,
da algoritem z linearno zahtevnostjo ne more pravilno opisati vseh situacij.
Zahtevnost opisanega algoritma sicer raste eksponentno z velikostjo ene
od dimenzij polja CA \( O(C^{N_x}) \), in linearno z velikostjo druge dimenzije \( O(N_y) \)
(\(C\) je konstanta, odvisna od števila stanj celice in velikosti okolice, ne pa tudi od velikosti polja).
Ker pa nisem dokazal optimalnosti opisanega algoritma za štetje,
dopuščam možnost, da obstaja algoritem z nižjo kompleksnostjo.
Proces izpisa predslik ima vedno eksponentno rastočo komponento.
Ker število vseh stanj sistema raste eksponentno z velikostjo problema,
posledično tudi povprečje števila predslik skozi vsa stanja raste eksponentno.
Optimalen algoritem za izpis predslik je časovno in pomnilniško linearno odvisen od števila predslik.
Moja algoritma za izpis predslik 1D in 2D CA sta optimalna in
omogočata izpis predslik brez slepih poti,
kar je posledica podrobne analize problema ob štetju.
Ostali znani algoritmi spadajo v drugo kategorijo.
Večinoma izkoriščajo le lokalno znanje o sistemu (lokalno štetje predslik),
ne pa tudi globalnih števcev.
Zato zahajajo v slepe poti in se morajo vračati v prejšnje stanje
ali pa opuščajo neustrezne rešitve, katerim so že namenili procesni čas.
Pomembno vlogo pri razvoju opisanega algoritma ima mreža predslik.
To je grafična upodobitev problema, katere cilj je lažje razumevanje problema in rešitve.
Osnova za oblikovanje mreže predslik so De Bruijnovi diagrami.
Posamezen De Bruijnov diagram je mreža predslik ene celice.
Mreže posameznih celic se nato povezujejo,
tako da na koncu opisujejo celotno polje celic.
McIntosh in njegovi učenci so bili pobudniki uporabe De Bruijnovih diagramov za analizo 1D CA \cite{McIntosh1991}.
Uporabljali so jih za štetje in izpis predslik ter za analizo delcev in njihovih interakcij.
Paulina Léon in Genaro Martínez (McIntoshev učenec) \cite{PaulinaGenaro2016}
sta začetnika apliciranja De Bruijnovih diagramov na 2D CA,
vendar jih ne uporabljata za štetje in izpis predslik.
Največ raziskav s področja predslik 2D CA je bilo opravljenih ravno s ciljem iskanja stanj GoE v avtomatu GoL.
S stališča algoritma za štetje predslik je stanje GoE tako stanje, katerega število predslik je nič.
Algoritem za štetje predslik je možno pretvoriti v manj zahteven algoritem za preverjanje, ali je dano stanje stanje GoE,
tako da se operacije nad celimi števili pretvori v logične operacije nad Boolovimi stanji.
\subsection{Implementacija algoritma}
Algoritem je implementiran kot računalniški program v jeziku C \cite{Jeras2016-algirithm}.
Knjižnica GMP \footnote{The GNU Multiple Precision Arithmetic Library \url{https://gmplib.org/}}
je uporabljena za zapis celih števil, večjih od 64 bitov.
Poleg samega algoritma za štetje in izpis predslik sem pripravil tudi
orodje za simulacijo binarnega CA z okolico quad \cite{Jeras2016-quad},
ki temelji na simulatorju za GoE \cite{webgl-gol}.
Simulator se lahko zažene kar v internetnem brskalniku.
%in orodje za prikaz poljubne mreže predslik \cite{Jeras2016-network}.
\subsection{Primeri in ilustracije}
Večina primerov in ilustracij opisuje binarni 2D CA z majhno okolico quad
(štiri celice na kvadratnem polju, Toffoli 2008 \cite{Toffoli2008}).
Večina primerov in sploh ilustracije za GoL bi bile zaradi
\(2^{3 \cdot 3}=512\) možnih stanj okolice preveč kompleksne in nepregledne (glej dodatek \ref{GoLmatrika}).
V nasprotju ima binarna okolica quad le \(2^{2 \cdot 2}=16\) možnih stanj.
Želel sem sicer uporabiti kako določeno pravilo za okolico quad,
tako ki bi omogočalo zanimivo dinamiko delcev, vendar na tem področju še ni kaj dosti raziskav.
Obstaja le dokaz univerzalnosti za binarni avtomat z okolico trid (Powley 2008 \cite{Powley2008}).
Na slikah je uporabljena izometrična projekcija,
saj je za potrebe analize osnovnemu 2D polju dodana tretja dimenzija,
ki opisuje prostor predslik (mreža predslik).
\section{Pregled vsebine}
V poglavju \ref{definicija} podajam definicijo 1D in 2D CA.
V poglavju \ref{mreža} opišem konstrukcijo mreže predslik za 2D CA
in razložim njen odnos z naborom predslik za dano konfiguracijo.
V poglavju \ref{algoritem} opišem na novo razvit algoritem za štetje in izpis predslik
ter razložim, zakaj algoritem z linearno zahtevnostjo ni možen.
V poglavju \ref{pregled} opravim pregled obstoječih algoritmov
ter jih v poglavju \ref{sklep} primerjam s svojim algoritmom.
Tukaj še navedem doprinos tega magistrskega dela k področju celičnih avtomatov
in naštejem nekaj problemov, ki bi jih rad raziskal v prihodnje.
V dodatku \ref{primer} navedem primer delovanja algoritma in
v dodatku \ref{koda} navedem izvorno kodo algoritma.
\chapter{Definicija celičnih avtomatov}
\label{definicija}
V delu se omejujemo na celične avtomate, ki so:
\begin{itemize}[noitemsep,nolistsep]
\item prostorsko diskretni (celice),
\item časovno diskretni (korak),
\item homogeni (pravila so enaka za vse celice in vse celice se posodobijo naenkrat) in
\item deterministični (novo stanje je odvisno le od trenutnega stanja).
\end{itemize}
Vsaka celica ima diskretno vrednost \(c\) iz nabora stanj celice \(S\).
Stanja so oštevilčena:
\begin{equation}
c \in S
\quad \textrm{in} \quad
S = \{ 0, 1, \ldots, |S|-1 \}
\end{equation}
Za potrebe implementacije algoritma je pomembno,
da smo stanje elementov CA, kakor so pravilo, vrednost okolice in podobno,
sposobni indeksirati.
Uporabljena je metoda, ki je bila v osnovi namenjena zapisu pravila.
Posplošeno, vrednosti celic \(c(i)\) so zložene v niz \(A=[c(0),c(1), \ldots, c(|A|-1)\)] dolžine \(|A|\),
ki je interpretiran kakor \(|A|\) mestno pozitivno celo število \(num\) v
\(S\)-iškem številskem sestavu:
\begin{equation}
num = \sum_{i=0}^{i=|A|-1} |S|^i \cdot c(i)
\end{equation}
Za podane primere so uporabljeni binarni CA kjer je \(S=2\),
tako da so števila v dvojiškem sestavu.
\section{Definicija 1D celičnih avtomatov}
Definicijo 1D CA povzamemo po \cite{JerasDobnikar2007}.
Za 1D CA se celice združujejo v regularen niz.
Na splošno je dolžina niza lahko neskončna,
bolj običajni pa so končni nizi dolžine \(N\).
Nize zapisujemo z malimi grškimi črkami \(\alpha\) ali \(\beta\),
kjer je \(c(x)\) celica na koordinati \(x\):
\begin{equation}
\alpha = [c(0), c(1), \ldots, c(N-1)]
\end{equation}
\subsection{Okolica}
Za potrebe enostavnosti implementacije se okolica celice širi le v pozitivni smeri (slika \ref{neighborhood_1d}).
Torej je za celico \(c(x)\) njena okolica velikosti \(M\) enaka
\(n(x) = \{c(x), c(x+1), \ldots, c(x+M-1)\}\).
V praksi se podana definicija okolice razlikuje od
bolj običajne centrirane okolice le v tem,
kako je časovno sosledje stanj poravnano v grafični upodobitvi.
Nekoliko neobičajno definicijo sem uporabil zato,
ker ne potrebuje ločene interpretacije za okolice sode velikosti.
Hkrati sem se tako izognil uporabi negativnih števil v implementaciji algoritma.
\begin{figure}[htb]
\centerline{\psfig{figure=neighborhood_1d,width=16cm}}
\caption[Okolica 1D CA.]{Okolica 1D CA velikosti \(M=3\).}
\label{neighborhood_1d}
\end{figure}
\vspace{5mm}
Indeks okolice \(n(x)\) in nabor možnih okolic sta:
\begin{equation}
n(x) = \sum_{i=0}^{i=M-1} |S|^i \cdot c(x+i)
\end{equation}
\begin{equation}
n \in \{0, 1, \ldots, |S|^M-1\}
\end{equation}
\subsection{Prekrivanje okolic}
Dana okolica \(n(x)\) se za \(M-1\) celic prekriva z okolicama sosednjih celic (slika \ref{overlap_1d}).
Na levi imamo prekrivanje \(o_{\leftarrow}(x)\) med okolicama \(n(x-1)\) in \(n(x)\).
Na desni imamo prekrivanje \(o_{\rightarrow}(x)\) med okolicama \(n(x)\) in \(n(x+1)\).
\begin{figure}[htb]
\centerline{\psfig{figure=overlap_1d,width=12cm}}
\caption[Prekrivanje okolic 1D CA.]{Prekrivanje okolic 1D CA velikosti \(M-1=2\).}
\label{overlap_1d}
\end{figure}
Indeksa levega prekrivanja \(o_{\leftarrow}(x)\) ter desnega prekrivanja \(o_{\rightarrow}(x)\) in nabor možnih prekrivanj so:
\begin{equation}
o_{\leftarrow}(x) = \sum_{i=0}^{i=M-2} |S|^i \cdot c(x+i)
\end{equation}
\begin{equation}
o_{\rightarrow}(x) = \sum_{i=1}^{i=M-1} |S|^i \cdot c(x+i)
\end{equation}
\begin{equation}
o \in \{0, 1, \ldots, |S|^M-2\}
\end{equation}
\subsection{Lokalna tranzicijska funkcija in pravilo}
Preslikava sedanje okolice \(n^{t}(x)\) v prihodnjo istoležno celico \(c^{t+1}(x)\) je definirana
s tranzicijsko funkcijo \(f\), ki vsaki vrednosti okolice pripiše vrednost celice:
\begin{equation}
c^{t+1}(x) = f(n^{t}(x))
\end{equation}
Za potrebe iskanja predslik je zanimiva obratna funkcija \(f^{-1}\), ki ob
podanem stanju trenutne celice \(c^{t}(x)\) vrne množico okolic \(n^{t-1}(x)\),
ki se preslikajo v to vrednost:
\begin{equation}
f^{-1}(c^{t}(x)) = \{ n^{t-1}(x) \in S^m \ \arrowvert \ f(n^{t-1}(x)) = c^{t}(x) \}
\end{equation}
Tranzicijsko funkcijo je možno definirati s pravilom \(r\).
Pravilo je indeks izbrane funkcije znotraj celotnega nabora \(|S|^{|S|^M}\) funkcij.
Definirano je kakor celo število v \(S\)-iškem številskem sestavu,
kjer so cifre zaporedje vrednosti celic v katere tranzicijska funkcija
preslika vsako od \(|S|^M\) možnih okolic:
\begin{equation}
r = \sum_{n=0}^{n=|S|^M-1} |S|^n \cdot f(n)
\end{equation}
\begin{equation}
r \in \{0, 1, \ldots |S|^{|S|^M}-1\}
\end{equation}
Globalna tranzicijska funkcija se pogosto zapisuje kakor tranzicijska tabela,
ki navaja vrednost tranzicijske funkcije \(f(n)\) za vsako okolico \(n\).
\subsection{Robni pogoji}
Neskončen niz celic nima roba in zanj ne potrebujemo definicije robnih pogojev.
Hkrati pa v praksi ne moremo računati z neskončnostjo,
zato obravnavamo končne nize celic.
Če smatramo opazovani končen niz za del neskončnega niza,
potem se moramo opredeliti, kako bomo obravnavali vrednosti celic izven opazovanega niza.
Tukaj je opisan samo odprt robni pogoj, kjer celice izven roba niso definirane,
oziroma lahko zasedejo poljubno vrednost.
Za niz dolžine \(N\) je potemtakem definiranih le \(N-(M-1)\) okolic.
Drugi običajen robni pogoj je cikličen, kjer je niz celic sklenjena zanka.
Ciklično koordinato celice \(x_{\circlearrowright}\) izračunamo iz \(x\) po modulu \(N\):
\begin{equation}
x_{\circlearrowright} = x \bmod N
\end{equation}
\subsection{Globalna tranzicijska funkcija}
Globalna tranzicijska funkcija \(F\) s pomočjo lokalne tranzicijske funkcije \(f(n)\)
preslika vsako okolico \(n^t(x)\) iz niza celic \(\alpha^t\) v času \(t\)
v celico \(c^{t+1}(x)\) iz niza celic \(\beta^{t+1}\) v času \(t+1\):
\begin{equation}
\beta^{t+1} = F (\alpha^t)
\end{equation}
Za odprti robni pogoj vrne globalna funkcija za vhodni niz dolžine \(N\)
izhodni niz dolžine \(N-(M-1)\), za cikličen robni pogoj pa niz dolžine \(N\).
\subsection{Predslike}
Vsaka predslika \(\beta^{t-1}\) dolžine \(N+M-1\) danega niza \(\alpha^t\) dolžine \(N\) mora ustrezati dvema pogojema:
\begin{enumerate}
\item Za vsako celico \(c^{t}(x)\) mora okolica \(n^{t-1}(x)\) ustrezati inverzni tranzicijski funkciji \(f^{-1}\):
\begin{equation}
\forall x : c^{t}(x) = f(n^{t-1}(x))
\end{equation}
\item Vsak par okolic \(\{n^{t-1}(x), n^{t-1}(x+1)\}\) se mora ujemati v prekrivanju:
\begin{equation}
\forall x : o^{t-1}(x) = o_{\rightarrow}^{t-1}(x) = o_{\leftarrow}^{t-1}(x+1)
\end{equation}
\end{enumerate}
Opazovanje prekrivanja okolic je glavni element algoritmov za iskanje predslik.
\section{Definicija 2D celičnih avtomatov}
Za 2D CA se celice združujejo v regularno 2D polje.
Mreža polja je lahko pravokotna, šestkotna ali celo kvazikristalna.
Tukaj se bomo omejili na pravokotno mrežo.
Na splošno je velikost polja lahko neskončna,
bolj običajna pa so končna polja,
definirana kakor pravokotnik velikosti \(N_x \times N_y\).
Skupno število celic v končnem polju je \(N=N_x \cdot N_y\).
Za potrebe indeksiranja elementov CA so ploskve razdeljene v vrstice,
nato pa so vrstice sestavljene v niz, ki je interpretiran kakor število.
Cifre v številu si sledijo od spodaj levo do zgoraj desno znotraj okolice
(sliki \ref{neighborhood_index_moore} in \ref{neighborhood_index_quad}).
\subsection{Okolica}
Prihodnje stanje neke celice \(c_(x,y)\) s koordinatami \((x,y)\)
je odvisno od trenutnega stanja pripadajoče okolice \(n_(x,y)\) (slika \ref{neighborhood}).
Tudi pri obliki okolice se bomo omejili na pravokotnik velikosti \(M_x \times M_y\).
Število celic v okolici je \(M=M_x \cdot M_y\).
Indeks okolice (sliki \ref{neighborhood_index_moore} in \ref{neighborhood_index_quad})
in nabor možnih okolic sta:
\begin{equation}
n(x,y) = \sum_{\substack{i=0 \\ j=0}}^{\substack{i=M_x-1 \\ j=M_y-1}} |S|^{M_x j + i} \cdot c(x+i,y+j)
\end{equation}
\begin{equation}
n \in \{0, 1, \ldots, |S|^{M_x M_y}-1\}
\end{equation}
\begin{figure}[htb]
\centerline{\psfig{figure=neighborhood_index_moore,width=12cm}}
\caption[Indeksiranje okolice \(3 \times 3\).]{Indeksiranje okolice celice z dimenzijama \(M_x=M_y=3\).}
\label{neighborhood_index_moore}
\end{figure}
\begin{figure}[htb]
\centerline{\psfig{figure=neighborhood_index_quad,width=10cm}}
\caption[Indeksiranje okolice \(2 \times 2\).]{Indeksiranje okolice celice z dimenzijama \(M_x=M_y=2\).}
\label{neighborhood_index_quad}
\end{figure}
Običajno se smatra, da je celica poravnana s sredino svoje okolice.
Tukaj pa je celica poravnana v levi spodnji kot svoje okolice.
To omogoča uporabo enake definicije tudi za sode velikosti okolic in
odpravlja potrebo po uporabi negativnih števil v algoritmu.
\begin{figure}[htb]
\centerline{\psfig{figure=neighborhood,width=16cm}}
\caption[Celica in pripadajoča okolica.]{Celica \(c(x,y)\) in pripadajoča okolica \(n(x,y)\) z dimenzijama \(M_x=M_y=3\).}
\label{neighborhood}
\end{figure}
\subsection{Prekrivanje okolic}
Okolice se v smeri dimenzije X prekrivajo za ploskev velikosti \((M_x-1) \times M_y\) (sliki \ref{overlap_dimension_moore} in \ref{overlap_dimension_quad}).
To ob indeksiranju da nabor:
\begin{equation}
o_{\leftarrow}(x,y) = \sum_{\substack{i=0 \\ j=0}}^{\substack{i=M_x-2 \\ j=M_y-1}} |S|^{(M_x-1) j + i} \cdot c(x+i,y+j)
\end{equation}
\begin{equation}
o_{\rightarrow}(x,y) = \sum_{\substack{i=1 \\ j=0}}^{\substack{i=M_x-1 \\ j=M_y-1}} |S|^{(M_x-1) j + i} \cdot c(x+i,y+j)
\end{equation}
\begin{equation}
o_{\leftrightarrow} \in \{0, 1, \ldots, |S|^{(M_x-1)M_y}-1\}
\end{equation}
Okolice se v smeri dimenzije Y prekrivajo za ploskev velikosti \(M_x \times (M_y-1)\) (sliki \ref{overlap_dimension_moore} in \ref{overlap_dimension_quad}).
To ob indeksiranju da nabor:
\begin{equation}
o_{\downarrow}(x,y) = \sum_{\substack{i=0 \\ j=0}}^{\substack{i=M_x-1 \\ j=M_y-2}} |S|^{M_x j + i} \cdot c(x+i,y+j)
\end{equation}
\begin{equation}
o_{\uparrow}(x,y) = \sum_{\substack{i=0 \\ j=1}}^{\substack{i=M_x-1 \\ j=M_y-1}} |S|^{M_x j + i} \cdot c(x+i,y+j)
\end{equation}
\begin{equation}
o_{\updownarrow} \in \{0, 1, \ldots, |S|^{M_x(M_y-1)}-1\}
\end{equation}
\vspace{5mm}
\begin{figure}[htb]
\centerline{\psfig{figure=overlap_dimension_moore,width=8cm}}
\caption[Prekrivaje okolic \(3 \times 3\) v smeri dimenzij X in Y.]
{Prekrivanje okolic sosednjih celic v smeri dimenzij X in Y, za velikost okolice \(M_x=M_y=3\).
Okolice se prekrivajo v 6 celicah od 9.}
\label{overlap_dimension_moore}
\end{figure}
\vspace{5mm}
\begin{figure}[htb]
\centerline{\psfig{figure=overlap_dimension_quad,width=8cm}}
\caption[Prekrivaje okolic \(2 \times 2\) v smeri dimenzij X in Y.]
{Prekrivanje okolic sosednjih celic v smeri dimenzij X in Y, za velikost okolice \(M_x=M_y=2\).
Okolice se prekrivajo v 2 celicah od 4.}
\label{overlap_dimension_quad}
\end{figure}
\vspace{5mm}
Okolice se v diagonalni smeri prekrivajo za ploskev velikosti \((M_x-1) \times (M_y-1)\) (sliki \ref{overlap_diagonal_moore} in \ref{overlap_diagonal_quad}).
To ob indeksiranju da nabor:
\begin{equation}
o_{\swarrow} = \sum_{\substack{i=0 \\ j=0}}^{\substack{i=M_x-2 \\ j=M_y-2}} |S|^{(M_x-1) j + i} \cdot c(x+i,y+j)
\end{equation}
\begin{equation}
o_{\searrow} = \sum_{\substack{i=1 \\ j=0}}^{\substack{i=M_x-1 \\ j=M_y-2}} |S|^{(M_x-1) j + i} \cdot c(x+i,y+j)
\end{equation}
\begin{equation}
o_{\nwarrow} = \sum_{\substack{i=0 \\ j=1}}^{\substack{i=M_x-2 \\ j=M_y-1}} |S|^{(M_x-1) j + i} \cdot c(x+i,y+j)
\end{equation}
\begin{equation}
o_{\nearrow} = \sum_{\substack{i=1 \\ j=1}}^{\substack{i=M_x-1 \\ j=M_y-1}} |S|^{(M_x-1) j + i} \cdot c(x+i,y+j)
\end{equation}
\begin{equation}
o_{\times} \in \{0, 1, \ldots, |S|^{(M_x-1)(M_y-1)}-1\}
\end{equation}
\vspace{5mm}
\begin{figure}[htb]
\centerline{\psfig{figure=overlap_diagonal_moore,width=10cm}}
\caption[Prekrivanje okolic \(3 \times 3\) - diagonalno.]
{Prekrivanje okolic sosednjih celic v diagonalni smeri, za velikost okolice \(M_x=M_y=3\).
Okolice se prekrivajo v 4 celicah od 9.}
\label{overlap_diagonal_moore}
\end{figure}
\vspace{5mm}
\begin{figure}[htb]
\centerline{\psfig{figure=overlap_diagonal_quad,width=8cm}}
\caption[Prekrivanje okolic \(2 \times 2\) - diagonalno.]
{Prekrivanje okolic sosednjih celic v diagonalni smeri, za velikost okolice \(M_x=M_y=2\).
Okolice se prekrivajo v eni celici od 4.}
\label{overlap_diagonal_quad}
\end{figure}
\subsection{Lokalna tranzicijska funkcija in pravilo}
Preslikava sedanje okolice \(n^{t}(x,y)\) v prihodnjo istoležno celico \(c^{t+1}(x,y)\) je definirana
s tranzicijsko funkcijo \(f\), ki vsaki vrednosti okolice pripiše vrednost celice:
\begin{equation}
c^{t+1}(x,y) = f(n^{t}(x,y))
\end{equation}
Za potrebe iskanja predslik je zanimiva obratna funkcija \(f^{-1}\), ki ob
podanem stanju trenutne celice \(c^{t}(x,y)\) vrne množico okolic \(n^{t-1}(x,y)\),
ki se preslikajo v to vrednost:
\begin{equation}
f^{-1}(c^{t}(x,y)) = \{ n^{t-1}(x,y) \in S^m \ \arrowvert \ f(n^{t-1}(x,y)) = c^{t}(x,y) \}
\end{equation}
Tranzicijsko funkcijo je možno definirati s pravilom \(r\).
Pravilo je indeks izbrane funkcije znotraj celotnega nabora \(|S|^{|S|^{M_x M_y}}\) funkcij.
Definirano je kakor celo število v \(S\)-iškem številskem sestavu,
kjer so cifre zaporedje vrednosti celic, v katere tranzicijska funkcija
preslika vsako od \(|S|^{M_x M_y}\) možnih okolic:
\begin{equation}
r = \sum_{n=0}^{n=|S|^{M_x M_y}-1} |S|^n \cdot f(n)
\end{equation}
\begin{equation}
r \in \{0, 1, \ldots |S|^{|S|^{M_x M_y}}-1\}
\end{equation}
\subsection{Robni pogoji}
Neskončno polje nima roba in zanj ne potrebujemo definicije robnih pogojev.
Hkrati pa v praksi ne moremo računati z neskončnostjo,
zato obravnavamo končna polja celic.
Če smatramo opazovano končno polje za del neskončnega polja,
potem se moramo opredeliti, kako bomo obravnavali vrednosti celic izven opazovanega polja.
Tukaj je opisan samo odprt robni pogoj, kjer celice izven roba niso definirane,
oziroma lahko zasedejo poljubno vrednost.
Za polje velikosti \(N_x \times N_y\) je potemtakem definiranih le \((N_x+(M_x-1)) \times (N_y+(M_y-1))\) okolic.
Drugi običajen robni pogoj je cikličen, kjer je polje celic torus.
Ciklično koordinato celice \((x_{\circlearrowright},x_{\circlearrowright})\) izračunamo iz \((x,y)\) po modulu \(N_x\) oziroma \(N_y\).
\begin{equation}
x_{\circlearrowright} = x \bmod N_x
\hspace{10mm}
y_{\circlearrowright} = y \bmod N_y
\end{equation}
\subsection{Globalna tranzicijska funkcija}
Globalna tranzicijska funkcija \(F\) s pomočjo lokalne tranzicijske funkcije \(f(n)\)
preslika vsako okolico \(n^t(x,y)\) iz niza celic \(A^t\) v času \(t\)
v celico \(c^{t+1}(x)\) iz niza celic \(B^{t+1}\) v času \(t+1\).
\begin{equation}
B^{t+1} = F (A^t)
\end{equation}
Za odprti robni pogoj vrne globalna funkcija za vhodno polje velikosti \(N_x \times N_y\)
izhodno polje velikosti \((N_x+(M_x-1)) \times (N_y+(M_y-1))\),
za ciklični robni pogoj pa polje velikosti \(N_x \times N_y\).
\subsection{Predslike}
Vsaka predslika \(B^{t-1}\) velikosti \((N_x+1) \times (N_y+1)\) danega polja \(A^t\) velikosti \(N_x \times N_y\) mora ustrezati naslednjim pogojem:
\begin{enumerate}
\item Za vsako celico \(c^{t}(x,y)\) mora okolica \(n^{t-1}(x,y)\) ustrezati invezni funkciji \(f^{-1}\):
\begin{equation}
\forall x,y : c^{t}(x,y) = f(n^{t-1}(x,y))
\end{equation}
\item Vsak par okolic v dimenziji X \(\{n^{t-1}(x,y), n^{t-1}(x+1,y)\}\) se mora ujemati v prekrivanju:
\begin{equation}
\forall x,y : o_{\leftrightarrow}^{t-1}(x,y) = o_{\rightarrow}^{t-1}(x,y) = o_{\leftarrow}^{t-1}(x+1,y)
\end{equation}
\item Vsak par okolic v dimenziji Y \(\{n^{t-1}(x,y+0), n^{t-1}(x,y+1)\}\) se mora ujemati v prekrivanju:
\begin{equation}
\begin{align}
\forall x,y : o_{\updownarrow}^{t-1}(x,y) &= o_{\downarrow}^{t-1}(x,y+1) \\
&= o_{\uparrow} ^{t-1}(x,y+0)
\end{align}
\end{equation}
\item Vsaka četvorka diagonalnih okolic \(\{n^{t-1}(x,y), n^{t-1}(x+1,y), n^{t-1}(x,y+1), n^{t-1}(x+1,y+1)\}\) se mora ujemati v prekrivanju: