Universal Turing machine: Difference between revisions

m (syntax highlighting fixup automation)
Line 2,375:
Tmcl is a tiny Turing machine control language.
 
1. ====Instruction set====
 
Tmcl uses postfix notation.
Line 2,386:
<symbol> : op <- symbol</pre>
 
2. ====Program====
 
Tape is split into two stacks.
 
<pre>T = reverse (left) . right where right is the scanned symbol.
<sub>0</sub></pre>
 
The program is concise.
 
<syntaxhighlight lang="lisp">;; 22.06.26
Line 2,413 ⟶ 2,411:
(format t "Q = <~a ~{~a~}.~{~a~}>~%" state (reverse left) right)))</syntaxhighlight>
 
====Code====
3. Rules
 
Rulescode areis stored in association lists.
 
<syntaxhighlight lang="lisp">(defconstant +incrementer+ '((q0 . (1 = > q0 @ b = 1 % qf @))))
'((q0 . (1 = > q0 @ b = 1 % qf @))))
 
(defconstant +three-states-buzy-beaver+ '((a . (0 = 1 % > b @ 1 = < c @))
' ((ab . (0 = 1 % >< ba @ 1 = <> cb @))
(bc . (0 = 1 % < ab @ 1 = > bhalt @))))</syntaxhighlight>
(c . (0 = 1 % < b @ 1 = halt @))))</syntaxhighlight>
 
4. ====Execution====
 
{{out}}
422

edits