Proof: Byte 4 Stays the Same 11
Let's prove the following theorem:
if the following are true:
- instruction #5 is
addi dst=1 src=2 imm=0 - the PC at time 11 = 5
- value of cell 4 at time 11 = 1
then value of cell 4 at time 12 = 1
Instructions
| Memory Cells |
|---|
| Program Counter | Time |
|---|---|
| 0 | 0 |
LW Computer Simulator
Proof:
Given
| 1 | instruction #5 is addi dst=1 src=2 imm=0 |
|---|---|
| 2 | the PC at time 11 = 5 |
| 3 | value of cell 4 at time 11 = 1 |
| # | Claim | Reason |
|---|---|---|
| 1 | not (4 = 1) | not (4 = 1) |
| 2 | value of cell 4 at time (11 + 1) = value of cell 4 at time 11 | if instruction #5 is addi dst=1 src=2 imm=0 and the PC at time 11 = 5 and not (4 = 1), then value of cell 4 at time (11 + 1) = value of cell 4 at time 11 |
| 3 | 11 + 1 = 12 | 11 + 1 = 12 |
| 4 | value of cell 4 at time (11 + 1) = value of cell 4 at time 12 | if 11 + 1 = 12, then value of cell 4 at time (11 + 1) = value of cell 4 at time 12 |
| 5 | value of cell 4 at time 12 = value of cell 4 at time 11 | if value of cell 4 at time (11 + 1) = value of cell 4 at time 12 and value of cell 4 at time (11 + 1) = value of cell 4 at time 11, then value of cell 4 at time 12 = value of cell 4 at time 11 |
| 6 | value of cell 4 at time 12 = 1 | if value of cell 4 at time 12 = value of cell 4 at time 11 and value of cell 4 at time 11 = 1, then value of cell 4 at time 12 = 1 |
Comments
Please log in to add comments