Proof: JAL Instruction Example 3
Let's prove the following theorem:
if the following are true:
- instruction #i is a JAL instruction with jump to: 1
- the PC at time 2 = i
- not (x = 2)
then value of cell x at time 3 = value of cell x at time 2
In this example, the JAL instruction does not change memory cell values.
Instructions
| Memory Cells |
|---|
| Program Counter | Time |
|---|---|
| 0 | 0 |
LW Computer Simulator
Proof:
Given
| 1 | instruction #i is a JAL instruction with jump to: 1 |
|---|---|
| 2 | the PC at time 2 = i |
| 3 | not (x = 2) |
| # | Claim | Reason |
|---|---|---|
| 1 | value of cell x at time (2 + 1) = value of cell x at time 2 | if instruction #i is a JAL instruction with jump to: 1 and the PC at time 2 = i and not (x = 2), then value of cell x at time (2 + 1) = value of cell x at time 2 |
| 2 | 2 + 1 = 3 | 2 + 1 = 3 |
| 3 | value of cell x at time (2 + 1) = value of cell x at time 3 | if 2 + 1 = 3, then value of cell x at time (2 + 1) = value of cell x at time 3 |
| 4 | value of cell x at time 3 = value of cell x at time 2 | if value of cell x at time (2 + 1) = value of cell x at time 3 and value of cell x at time (2 + 1) = value of cell x at time 2, then value of cell x at time 3 = value of cell x at time 2 |
Comments
Please log in to add comments