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