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