Universal Turing machine: Difference between revisions

Content added Content deleted
Line 2,391: Line 2,391:


m is the machine code
m is the machine code
i is an input tape
i is the input tape
q is the current state
q is the current state
h is the halt state
h is the halt state
Line 2,418: Line 2,418:
(t (setf op c)))
(t (setf op c)))
(unless (car i) (pop i) (push b i))))
(unless (car i) (pop i) (push b i))))
(format t "M = <~a, ~{~a~}.~{~a~}>~%" q (reverse l) i)))</lang>
(format t "Q = <~a, ~{~a~}.~{~a~}>~%" q (reverse l) i)))</lang>


4. Rules
4. Rules
Line 2,434: Line 2,434:
5. Execution
5. Execution


<pre>M = <state tape head></pre>
<pre>Q = <state tape position></pre>


{{out}}
{{out}}
<pre>(run +incrementer+ '(1 1 1) 'q0 'qf 'b)
<pre>(run +incrementer+ '(1 1 1) 'q0 'qf 'b)
M = <QF, 111.1>
Q = <QF 111.1>
(run +three-states-buzy-beaver+ '(0) 'a 'halt '0)
(run +three-states-buzy-beaver+ '(0) 'a 'halt '0)
M = <HALT, 111.111></pre>
Q = <HALT 111.111></pre>


That's all Folks !
That's all Folks !