Proof: Store 13
Let's prove the following theorem:
if the following are true:
- instruction #19 is
store src=3 addr=1 imm=0
- the PC at time 13 = 19
- value of cell 1 at time 13 = 124
- value of cell 3 at time 13 = 3
then value of cell 124 at time 14 = 3
Proof:
Given
1 | instruction #19 is store src=3 addr=1 imm=0 |
---|---|
2 | the PC at time 13 = 19 |
3 | value of cell 1 at time 13 = 124 |
4 | value of cell 3 at time 13 = 3 |
# | Claim | Reason |
---|---|---|
1 | value of cell ((value of cell 1 at time 13) + 0) at time (13 + 1) = value of cell 3 at time 13 | if instruction #19 is store src=3 addr=1 imm=0 and the PC at time 13 = 19, then value of cell ((value of cell 1 at time 13) + 0) at time (13 + 1) = value of cell 3 at time 13 |
2 | (value of cell 1 at time 13) + 0 = 124 + 0 | if value of cell 1 at time 13 = 124, then (value of cell 1 at time 13) + 0 = 124 + 0 |
3 | 124 + 0 = 124 | 124 + 0 = 124 |
4 | (value of cell 1 at time 13) + 0 = 124 | if (value of cell 1 at time 13) + 0 = 124 + 0 and 124 + 0 = 124, then (value of cell 1 at time 13) + 0 = 124 |
5 | value of cell ((value of cell 1 at time 13) + 0) at time (13 + 1) = value of cell 124 at time (13 + 1) | if (value of cell 1 at time 13) + 0 = 124, then value of cell ((value of cell 1 at time 13) + 0) at time (13 + 1) = value of cell 124 at time (13 + 1) |
6 | 13 + 1 = 14 | 13 + 1 = 14 |
7 | value of cell 124 at time (13 + 1) = value of cell 124 at time 14 | if 13 + 1 = 14, then value of cell 124 at time (13 + 1) = value of cell 124 at time 14 |
8 | value of cell 124 at time 14 = value of cell 3 at time 13 | if value of cell ((value of cell 1 at time 13) + 0) at time (13 + 1) = value of cell 124 at time (13 + 1) and value of cell 124 at time (13 + 1) = value of cell 124 at time 14 and value of cell ((value of cell 1 at time 13) + 0) at time (13 + 1) = value of cell 3 at time 13, then value of cell 124 at time 14 = value of cell 3 at time 13 |
9 | value of cell 124 at time 14 = 3 | if value of cell 124 at time 14 = value of cell 3 at time 13 and value of cell 3 at time 13 = 3, then value of cell 124 at time 14 = 3 |
Comments
Please log in to add comments