Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

A (one dimensional) cellular automaton is a function1 F : Σ → Σ with the property that there is a K > 0 such that F (x)i depends only on the 2K + 1 coordinates xi−K , xi−K+1, . . . , xi−1, xi, xi+1, . . . , xi+K . A periodic point of σ is any x such that σ^p (x) = x for some p ∈ N, and a periodic point of F is any x such that F^q (x) = x for some q ∈ N. Given a cellular automaton F, a point x ∈ Σ is jointly periodic if there are p, q ∈ N such that σ^p (x) = F^q (x) = x, that is, it is a periodic point under both functions.

This project aims to explore the nature of one-dimensional Cellular Automata, in the hope of finding the structure of cellular automata through its periodic points.

2034 views
License: MIT
ubuntu2004
1
/*
2
* Copyright (C) 2004 Bryant Lee
3
*
4
* This file is part of FPeriod.
5
*
6
* FPeriod is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* FPeriod is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with FPeriod; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
/* FuncNode
22
* Node used to represent a single piece of a function (term, operator,
23
* or constant)
24
*
25
* Written by: Bryant Lee
26
* Date: 10/29/04
27
*/
28
29
#ifndef FUNC_NODE_H
30
#define FUNC_NODE_H
31
32
#define byte unsigned char
33
34
35
#include <fstream> //for printing
36
#include <map> //for termValue_by_inputs only
37
38
class FuncNode {
39
public:
40
int type; // 1 = term, 2 = operator, 3 = constant
41
int val; // term index, specific operator, or constant's value
42
43
//Operator: 1 = +, 2 = -, 3 = *, 4 = ^;
44
45
//No argument constructor
46
FuncNode();
47
48
//primary constructor
49
FuncNode(int iType, int iVal);
50
51
//copy constructor
52
FuncNode(const FuncNode &m);
53
54
//copy assignment
55
const FuncNode& operator=(const FuncNode &right);
56
57
//deepCopy
58
FuncNode* deepCopy();
59
60
//If holding a constant, returns the constant
61
//If holding a term, returns the term value based on
62
// the array x
63
int termValue(byte *x, int wLength, int i);
64
65
//If holding a constant, returns the constant
66
//If holding a term, returns the term value based on
67
// the array x
68
int termValue(unsigned int *x, int wLength, int i);
69
70
//like above except used by inputs, rather than by actual word
71
int termValue_by_inputs(byte *itTerms, int numTerms,
72
const map<int,int> &optFindTerm);
73
74
//print
75
void print(ofstream & fout);
76
77
//relational operators
78
bool operator==(const FuncNode &right) const;
79
bool operator!=(const FuncNode &right) const;
80
bool operator<(const FuncNode &right) const;
81
bool operator>(const FuncNode &right) const;
82
bool operator<=(const FuncNode &right) const;
83
bool operator>=(const FuncNode &right) const;
84
};
85
86
#endif
87
88
89
90