Notation for single-tape TM programs #
Enable with open scoped TMQuery. A do [TMQuery tm] block fixes the machine for its instructions.
tape ←ₜ symbolwrites a fixedOption Symbol, withnonerepresenting blank.state ←ₜ labelupdates the control state.moveₜ directionmoves left, right, or stays in place.tape =ₜ symbolandstate =ₜ labelare machine conditions;notₜnegates one.ifₜ condition then ... else ...andwhileₜ condition do ...select and repeat fixed bodies.
Conditions remain syntax, and every instruction returns Unit. The notation adds no queries.
Instruction notation and control-flow unexpanders also display programs in this syntax.
Write the symbol under the tape head.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Set the control-state label.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Move the tape head in a fixed direction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Test the head symbol without returning it to Lean.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Test an optional control-state label without returning it to Lean.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Negate a machine condition.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A machine-controlled branch with indented program bodies.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A machine-controlled loop with an indented program body.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Specify the query type once for every instruction in a program block.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Display a machine branch using its indented notation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Display a machine loop using its indented notation.
Equations
- One or more equations did not get rendered due to their size.