Universal Turing machine: Difference between revisions
→Control language
Cyril Nocton (talk | contribs) |
Cyril Nocton (talk | contribs) |
||
Line 2,386:
<symbol> : op <- symbol</pre>
2. Machine definition
2. Interpreter▼
<pre>M = <f i q h b> where
f is a transition function
i is an input tape
q is the current state
h is the halt state
b is the blank symbol</pre>
Tape is split into two stacks.
<pre>T = reverse(l) .
0</pre>
The simpler the better.
<lang lisp>
(let (l code op x)
(loop until (eql q h) do
(
(case c
(
(
(
(
(
(
(format t "M = (~a, ~{~a~}.~{~a~})~%"
Instructions are stored in association lists.
Line 2,424 ⟶ 2,432:
(c . (0 = 1 % < b @ 1 = halt @))))</lang>
{{out}}
Line 2,434 ⟶ 2,442:
That's all Folks !
''cyril nocton (cyril.nocton@gmail.com)''
=={{header|Cowgol}}==
|