Single Instruction URM Programs/Zero Function

From ProofWiki
Jump to navigation Jump to search

Theorem

The zero function $\Zero: \N \to \N$, defined as:

$\forall n \in \N: \map \Zero n = 0$

is URM computable by a single-instruction URM program.


Proof

The zero function is computed by the following URM program:

Line Command
$1$ $\map Z 1$

This sets the value $0$ into $R_1$ and then stops.

The output $0$ is in $R_1$ when the program terminates.

$\blacksquare$