-
Notifications
You must be signed in to change notification settings - Fork 0
/
instructions.html
132 lines (122 loc) · 3.77 KB
/
instructions.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> Turing machine simulator instructions </title>
<meta name="description" content="Simple single-tape Turing machine
simulator instructions.">
<meta name="author" content="Aleš Bizjak <abizjak@cs.au.dk>">
<link rel="stylesheet" type="text/css" href="./pretty.css" />
</head>
<body>
<div id="instructions">
<div id="machine-format">
<h3> Machine format </h3>
<p>The transitions are entered as quintuples of the form
<code> State Sep Char Sep State Sep Char Sep Move </code>
where
</p>
<ul>
<li> <code> State </code>
can be any nonempty string of alphanumeric characters </li>
<li> <code> Sep </code> is any nonempty sequence of commas or
whitespaces</li>
<li> <code> Char </code> is any character that does not match Sep </li>
<li> <code> Move </code> is one of '>', '<' or '!' </li>
</ul>
<p> The meaning of the quintuple <code> (q, c, q', c', m) </code> is to
define the transition "when in state q and looking at character c,
transition to state q', writing character c' and moving in direction
m". Underscore '_' is interpreted as the blank. </p>
<p> Different transitions have to be separated by at least one whitespace
character and the last one has to be followed by at least one whitespace
character as well.</p>
</div>
<div id="how-to-use">
<h3> How to use </h3>
<ul>
<li> Write (or paste) the machine instructions into the obvious
text-area. </li>
<li> Possibly write some input into the input box (here blanks are
entered as spaces) </li>
<li> Either step manually through the execution (button Step) or run
automatically. The delay between steps can be adjusted using the
slider. </li>
</ul>
</div>
</div>
<div id="examples">
<div id="example-1">
<h3> Example machine (successor of a binary number) </h3>
<table id="examples-table-1">
<tr> <td> Machine instructions </td> <td> Input (note the leading space) </td></tr>
<tr>
<td>
<pre class="table-pre">1,_ 2,_,>
2,1 2,1,>
2,0 3,0,!
2,_ 4,0,<
4,1 4,0,<
4,0 4,0,<
4,_ 7,_,>
7,0 H,1,<
3,0 3,0,>
3,1 3,1,>
3,_ 5,_,<
5,0 6,1,<
5,1 5,0,<
6,1 6,1,<
6,0 6,0,<
6,_ H,_,!
</pre>
</td>
<td> <pre class="table-pre"> 11111001111</pre> </td></tr>
</table>
</div>
<div id="example-2">
<h3> Example machine (predecessor of a binary number) </h3>
<table id="examples-table-2">
<tr> <td> Machine instructions </td> <td> Input (note the leading space) </td></tr>
<tr>
<td>
<pre class="table-pre">1,_ 2,_,>
2,0 H,0,<
2,1 3,1,>
3,0 3,0,>
3,1 3,1,>
3,_ 4,_,<
4,0 4,1,<
4,1 5,0,<
5,1 6,1,<
5,0 6,0,<
6,0 6,0,<
6,1 6,1,<
6,_ H,_,!
5,_ 7,_,>
7,0 8,_,>
8,_ 9,_,<
9,_ H,_,<
8,1 10,1,!
10,1 11,_,<
11,_ 12,1,>
12,_ 10,_,>
10,0 13,_,<
13,_ 12,0,>
12,_ 10,_,>
10,_ 15,_,<
15,_ 14,_,<
14,0 14,0,<
14,1 14,1,<
14,_ H,_,!</pre>
</td>
<td> <pre class="table-pre"> 100000</pre> </td></tr>
</table>
</div>
</div>
<div id="footer">
© Aleš Bizjak
(<a href="mailto:abizjak@cs.au.dk">abizjak@cs.au.dk</a>),
<a href="https://bitbucket.org/abizjak/turingjs"> source code </a>
</div>
</body>
</html>