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