Definition
Register Machine Program
A program of a register machine with registers consists of a start token and a finite set of instructions:
- Function instruction: read as : do then goto
- Test instruction: read as : if then goto else goto
is called the label of the instruction, and and are jump labels . Jump labels that are not labels of any instruction are called end labels. Labels are unique.
Computation
Computation of an arithmetic Function
Let an arithmetic function and an -RM.
Initial state:
End state:
- end label reached
Number of Registers Number of Inputs
In general, a register machine has more registers than input numbers.
Configuration:
: the current label is ; after executing the previous instructions, or initially if is the start label
Addition Program
Subtraction Program
Predecessor Program
Compositionality
Register machines programs - as Turing machines - can run other register machine programs.
Universality
There are universal register machine programs :
Let the code of a program which computes . Then computes a function , such that: