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