Proof: Byte 3 Stays the Same 17
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 17 = 5
- value of cell 3 at time 17 = 3
then value of cell 3 at time 18 = 3
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 17 = 5 |
3 | value of cell 3 at time 17 = 3 |
# | Claim | Reason |
---|---|---|
1 | not (3 = 1) | not (3 = 1) |
2 | value of cell 3 at time (17 + 1) = value of cell 3 at time 17 | if instruction #5 is addi dst=1 src=2 imm=0 and the PC at time 17 = 5 and not (3 = 1), then value of cell 3 at time (17 + 1) = value of cell 3 at time 17 |
3 | 17 + 1 = 18 | 17 + 1 = 18 |
4 | value of cell 3 at time (17 + 1) = value of cell 3 at time 18 | if 17 + 1 = 18, then value of cell 3 at time (17 + 1) = value of cell 3 at time 18 |
5 | value of cell 3 at time 18 = value of cell 3 at time 17 | if value of cell 3 at time (17 + 1) = value of cell 3 at time 18 and value of cell 3 at time (17 + 1) = value of cell 3 at time 17, then value of cell 3 at time 18 = value of cell 3 at time 17 |
6 | value of cell 3 at time 18 = 3 | if value of cell 3 at time 18 = value of cell 3 at time 17 and value of cell 3 at time 17 = 3, then value of cell 3 at time 18 = 3 |
Comments
Please log in to add comments