Block Copy Program

From ProofWiki
Jump to navigation Jump to search

Theorem

Let $k, m, n \in \N$ be natural numbers such that:

  • $k \ge 1$;
  • $\left|{m - n}\right| \ge k$.

The URM program defined as:

Line Command
$1$ $C \left({m, n}\right)$
$2$ $C \left({m+1, n+1}\right)$
$\vdots$ $\vdots$
$k$ $C \left({m+k-1, n+k-1}\right)$

is called a block copy program.

It is abbreviated $C \left({m, n, k}\right)$.

It has the effect of copying the contents of registers $R_m, R_{m+1}, \ldots, R_{m+k-1}$ into the registers $R_n, R_{n+1}, \ldots, R_{n+k-1}$ respectively.

It has length defined as $\lambda \left({C \left({m, n, k}\right)}\right) = k$.


Proof

Immediate.

$\blacksquare$