Definition:Trace Table

From ProofWiki
Jump to navigation Jump to search

This page is about Trace Table in the context of Mathematical Logic. For other uses, see Trace.

Definition

Let $P$ be a URM program.

The trace table of $P$ consists of:

Thus the trace table is a list of the states of the URM program at each stage.


Example

For example, consider the following URM program:

Line Command
$1$ $J \left({2, 3, 5}\right)$
$2$ $S \left({1}\right)$
$3$ $S \left({3}\right)$
$4$ $J \left({1, 1, 1}\right)$


Let it have the following input:

  • $r_1 = 7$
  • $r_2 = 2$


It has the following trace table:

Stage Instruction $R_1$ $R_2$ $R_3$
$0$ $1$ $7$ $2$ $0$
$1$ $2$ $7$ $2$ $0$
$2$ $3$ $8$ $2$ $0$
$3$ $4$ $8$ $2$ $1$
$4$ $1$ $8$ $2$ $1$
$5$ $2$ $8$ $2$ $1$
$6$ $3$ $9$ $2$ $1$
$7$ $4$ $9$ $2$ $2$
$8$ $1$ $9$ $2$ $2$
$9$ $5$ $9$ $2$ $2$