Proof: JUMP Instruction Example 2
Let's prove the following theorem:
if the following are true:
- instruction #0 is
jump imm=jump_to
- the PC at time 0 = 0
then value of cell x at time 1 = value of cell x at time 0
This example shows that a JUMP instruction does not change memory cell values. With some algebra, we prove that any memory cell at time 1 is equal to the cell at time 0.
Instructions
Memory Cells |
---|
Program Counter | Time |
---|---|
0 | 0 |
LW Computer Simulator
Proof:
Given
1 | instruction #0 is jump imm=jump_to |
---|---|
2 | the PC at time 0 = 0 |
# | Claim | Reason |
---|---|---|
1 | value of cell x at time (0 + 1) = value of cell x at time 0 | if instruction #0 is jump imm=jump_to and the PC at time 0 = 0, then value of cell x at time (0 + 1) = value of cell x at time 0 |
2 | 0 + 1 = 1 | 0 + 1 = 1 |
3 | value of cell x at time (0 + 1) = value of cell x at time 1 | if 0 + 1 = 1, then value of cell x at time (0 + 1) = value of cell x at time 1 |
4 | value of cell x at time 1 = value of cell x at time 0 | if value of cell x at time (0 + 1) = value of cell x at time 1 and value of cell x at time (0 + 1) = value of cell x at time 0, then value of cell x at time 1 = value of cell x at time 0 |
Comments
Please log in to add comments