Universal Turing machine: Difference between revisions

Content added Content deleted
Line 2,377: Line 2,377:
1. Instruction set
1. Instruction set


We use postfix notation.
Tmcl uses postfix notation.


<pre>'=' : if scanned symbol = op do
<pre>'=' : if scanned symbol = op do
Line 2,395: Line 2,395:


<lang lisp>(defun run (table input state halt blank)
<lang lisp>(defun run (table input state halt blank)
;; help : cyril nocton <cyril.nocton:gmail.com>
(let (lStack (rStack input) code operand match)
(let (lStack (rStack input) code operand match)
(loop until (eql state halt) do
(loop until (eql state halt) do
Line 2,424: Line 2,423:
4. Execution
4. Execution


{{Out}}
<pre>(run +incrementer+ '(1 1 1) 'q0 'qf 'b)
<pre>(run +incrementer+ '(1 1 1) 'q0 'qf 'b)
M = (QF, 111.1)
M = (QF, 111.1)