|
TuringSim
C++ framework to simulate abstract computing models
|
1 #include <machine/Turing/utm.h>
15 transitions.merge(
makeE());
19 transitions.merge(
makeMf());
20 transitions.merge(
makeSh());
24 {std::make_shared<const State::MConfiguration::MConfiguration<std::string>>(
"b")},
26 {transitions.begin(), transitions.end()}
33 {
"f(_E, _B, _a)",
"|",
"L",
"#",
"f1(_E, _B, _a)"},
34 {
"f(_E, _B, _a)",
"non(|)",
"L",
"#",
"f(_E, _B, _a)"},
35 {
"f1(_E, _B, _a)",
"none",
"R",
"#",
"f2(_E, _B, _a)"},
36 {
"f1(_E, _B, _a)",
"_a",
"",
"#",
"_E"},
37 {
"f1(_E, _B, _a)",
"non(_a, none)",
"R",
"#",
"f1(_E, _B, _a)"},
38 {
"f2(_E, _B, _a)",
"none",
"R",
"#",
"_B"},
39 {
"f2(_E, _B, _a)",
"_a",
"N",
"#",
"_E"},
40 {
"f2(_E, _B, _a)",
"non(_a, none)",
"R",
"#",
"f1(_E, _B, _a)"},
47 {
"e(_E, _B, _a)",
"",
"",
"#",
"f(e1(_E, _B, _a), _B, _a)"},
48 {
"e1(_E, _B, _a)",
"",
"E",
"#",
"_E"},
49 {
"e(_B, _a)",
"",
"",
"#",
"e(e(_B, _a), _B, _a)"},
56 {
"pe(_E, _b)",
"",
"",
"#",
"f(pe1(_E, _b), _E, |)"},
57 {
"pe1(_E, _b)",
"none",
"I _b",
"#",
"_E"},
58 {
"pe1(_E, _b)",
"any",
"R, R",
"#",
"pe1(_E, _b)"},
59 {
"pe2(_E, _a, _b)",
"",
"",
"#",
"pe(pe(_E, _b), _a)"},
66 {
"l(_E)",
"",
"L",
"#",
"_E"},
67 {
"r(_E)",
"",
"R",
"#",
"_E"},
68 {
"f'(_E, _B, _a)",
"",
"",
"#",
"f(l(_E), _B, _a)"},
69 {
"f''(_E, _B, _a)",
"",
"",
"#",
"f(r(_E), _B, _a)"},
76 {
"c(_E, _B, _a)",
"",
"",
"#",
"f'(c1(_E), _B, _a)"},
77 {
"c1(_E)",
"",
"",
"#",
"pe(_E, _#)"},
84 {
"ce(_E, _B, _a)",
"",
"",
"#",
"c(e(_E, _B, _a), _B, _a)"},
85 {
"ce(_B, _a)",
"",
"",
"#",
"ce(ce(_B, _a), _B, _a)"},
86 {
"ce(_B, _a)",
"",
"",
"#",
"ce(ce(_B, _a), _B, _a)"},
87 {
"ce2(_B, _a, _b)",
"",
"",
"#",
"ce(ce(_B, _b), _a)"},
88 {
"ce3(_B, _a, _b, _c)",
"",
"",
"#",
"ce(ce2(_B, _b, _c), _a)"},
89 {
"ce4(_B, _a, _b, _c, _d)",
"",
"",
"#",
"ce(ce3(_B, _b, _c, _d), _a)"},
90 {
"ce5(_B, _a, _b, _c, _d, _e)",
"",
"",
"#",
"ce(ce4(_B, _b, _c, _d, _e), _a)"},
98 {
"re(_E, _B, _a, _b)",
"",
"",
"#",
"f(re1(_E, _B, _a, _b), _B, _a)"},
99 {
"re1(_E, _B, _a, _b)",
"",
"E, I _b",
"#",
"_E"},
100 {
"re(_B, _a, _b)",
"",
"",
"#",
"re(re(_B, _a, _b), _B, _a, _b)"},
107 {
"cp(_E1, _U, _E, _a, _b)",
"",
"",
"#",
"f'(cp1(_E1, _U, _b), f(_U, _E, _b), _a)"},
108 {
"cp1(_E, _U, _b)",
"",
"",
"#",
"f'(cp2(_E, _U, _#), _U, _b)"},
109 {
"cp2(_E, _U, _c)",
"_c",
"",
"#",
"_E"},
110 {
"cp2(_E, _U, _c)",
"non(_c, none)",
"",
"#",
"_U"},
111 {
"cpe(_E1, _U, _E, _a, _b)",
"",
"",
"#",
"cp(e(e(_E1, _E, _b), _E, _a), _U, _E, _a, _b)"},
112 {
"cpe(_U, _E, _a, _b)",
"",
"",
"#",
"cpe(cpe(_U, _E, _a, _b), _U, _E, _a, _b)"},
119 {
"q(_E)",
"none",
"R",
"#",
"q1(_E)"},
120 {
"q(_E)",
"any",
"R",
"#",
"q(_E)"},
121 {
"q1(_E)",
"none",
"R",
"#",
"_E"},
122 {
"q1(_E)",
"any",
"",
"#",
"q(_E)"},
123 {
"q(_E, _a)",
"",
"",
"#",
"q(q1(_E, _a))"},
124 {
"q1(_E, _a)",
"_a",
"",
"#",
"_E"},
125 {
"q1(_E, _a)",
"non(_a)",
"L",
"#",
"q1(_E, _a)"},
132 {
"e(anf)",
"|",
"R",
"#",
"e1(anf)"},
133 {
"e(anf)",
"non(|)",
"L",
"#",
"e(anf)"},
134 {
"e1(anf)",
"none",
"",
"#",
"anf"},
135 {
"e1(anf)",
"any",
"R, E, R",
"#",
"e1(anf)"},
142 {
"con(_E, _a)",
"non(A)",
"R, R",
"#",
"con(_E, _a)"},
143 {
"con(_E, _a)",
"A",
"L, I _a, R",
"#",
"con1(_E, _a)"},
144 {
"con1(_E, _a)",
"A",
"R, I _a, R",
"#",
"con1(_E, _a)"},
145 {
"con1(_E, _a)",
"C",
"R, I _a, R",
"#",
"con2(_E, _a)"},
146 {
"con1(_E, _a)",
"none",
"I C, R, I _a, R, R, R",
"#",
"_E"},
147 {
"con2(_E, _a)",
"B",
"R, I _a, R",
"#",
"con2(_E, _a)"},
148 {
"con2(_E, _a)",
"non(B)",
"R, R",
"#",
"_E"},
155 {
"b",
"",
"",
"#",
"f(b1, b1, +)"},
156 {
"b1",
"",
"R, R, I(:, ., C, ., A)",
"#",
"anf"},
157 {
"anf",
"",
"",
"#",
"q(anf1, :)"},
158 {
"anf1",
"",
"",
"#",
"con(fom, y)"},
159 {
"fom",
";",
"R, I z, L",
"#",
"con(fmp, x)"},
160 {
"fom",
"z",
"L, L",
"#",
"fom"},
161 {
"fom",
"non(;, z)",
"L",
"#",
"fom"},
162 {
"fmp",
"",
"",
"#",
"cpe(e(e(anf, y), x), sim, x, y)"},
169 {
"sim",
"",
"",
"#",
"f'(sim1, sim1, z)"},
170 {
"sim1",
"",
"",
"#",
"con(sim2, blank)"},
171 {
"sim2",
"A",
"",
"#",
"sim3"},
172 {
"sim2",
"non(A)",
"L, I u, R, R, R",
"#",
"sim2"},
173 {
"sim3",
"non(A)",
"L, I y",
"#",
"e(mf, z)"},
174 {
"sim3",
"A",
"L, I y, R, R, R",
"#",
"sim3"},
181 {
"mf",
"",
"",
"#",
"q(mf1, :)"},
182 {
"mf1",
"A",
"L, L, L, L",
"#",
"mf2"},
183 {
"mf1",
"non(A)",
"R, R",
"#",
"mf1"},
184 {
"mf2",
"B",
"R, I x, L, L, L",
"#",
"mf2"},
185 {
"mf2",
":",
"",
"#",
"mf4"},
186 {
"mf2",
"C",
"R, I x, L, L, L",
"#",
"mf3"},
187 {
"mf3",
"non(:)",
"R, I v, L, L, L",
"#",
"mf3"},
188 {
"mf3",
":",
"",
"#",
"mf4"},
189 {
"mf4",
"",
"",
"#",
"con(l(l(mf5)), blank)"},
190 {
"mf5",
"any",
"R, I w, R",
"#",
"mf5"},
191 {
"mf5",
"none",
"I :",
"#",
"sh"},
198 {
"sh",
"",
"",
"#",
"f(sh1, inst, u)"},
199 {
"sh1",
"",
"L, L, L",
"#",
"sh2"},
200 {
"sh2",
"C",
"R, R, R, R",
"#",
"sh3"},
201 {
"sh2",
"non(C)",
"",
"#",
"inst"},
202 {
"sh3",
"B",
"R, R",
"#",
"sh4"},
203 {
"sh3",
"non(B)",
"",
"#",
"inst"},
204 {
"sh4",
"B",
"R, R",
"#",
"sh5"},
205 {
"sh4",
"non(B)",
"",
"#",
"pe2(inst, 0, :)"},
206 {
"sh5",
"B",
"",
"#",
"inst"},
207 {
"sh5",
"non(B)",
"",
"#",
"pe2(inst, 1, :)"},
214 {
"inst",
"",
"",
"#",
"q(l(inst1), u)"},
215 {
"inst1",
"",
"R, E",
"#",
"inst1(_#)"},
216 {
"inst1(G)",
"",
"",
"#",
"ce5(ov, v, y, x, u, w)"},
217 {
"inst1(D)",
"",
"",
"#",
"ce5(ov, v, x, u, y, w)"},
218 {
"inst1(N)",
"",
"",
"#",
"ce5(ov, v, x, y, u, w)"},
219 {
"ov",
"",
"",
"#",
"e(anf)"},
static TransitionSetType makePrintAtEnd()
Build the print at end function.
static TransitionSetType makeFind()
Build the find function.
static TransitionSetType makeReplace()
Build the replace function.
static TransitionSetType makeE()
Build the e table of the UTM.
static TransitionSetType makeCopyAndErase()
Build the copy and erase function.
static TransitionSetType makeInst()
Build the inst_n table of the UTM.
static TransitionSetType makeComparison()
Build the comparison function.
static TransitionSetType makeFindLast()
Build the find last function.
Deterministic machines whose transitions are Transition::TuringStyleMConfigurationTuringMachineTransi...
static TransitionSetType makeSim()
Build the sim_n table of the UTM.
static TransitionSetType makeCopy()
Build the copy function.
static TransitionSetType makeFindAndMove()
Build the find and move function.
Namespace of Turing machines, that is whose storage is a tape.
static TransitionSetType makeMf()
Build the mf_n table of the UTM.
static UtmType makeUtm()
Build a new UTM.
std::set< TransitionType > TransitionSetType
Sets of TransitionType.
static TransitionSetType makeErase()
Build the erase function.
static TransitionSetType makeInit()
Build the init table of the UTM.
static TransitionSetType makeCon()
Build the con table of the UTM.
static TransitionSetType makeSh()
Build the sh_n table of the UTM.