tmsim

A fast turing machine simulator with graphviz export functionality

git clone https://git.8pit.net/tmsim.git

 1# Input: A string conisting of 'a' and 'b' symbols.
 2# Accepts the following input: { a^{n}b^{m} | n > 1, n divides m }
 3
 4start: q0;
 5accept: q7;
 6
 7q0 {
 8	a > $ => q1;
 9	c | c => q3;
10}
11
12q1 {
13	a > a => q1;
14	c > c => q1;
15
16	b < c => q2;
17}
18
19q2 {
20	a < a => q2;
21	c < c => q2;
22
23	$ > $ => q0;
24}
25
26q3 {
27	c > c => q3;
28	$ | $ => q7;
29	b < b => q4;
30}
31
32q4 {
33	c < c => q4;
34	$ > $ => q5;
35}
36
37q5 {
38	c > a => q5;
39	b < b => q6;
40}
41
42q6 {
43	a < a => q6;
44	$ > $ => q0;
45}