Proof: Byte 6 Stays the Same Store 1
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 1 = 1
- value of cell 6 at time 1 = 12
- value of cell 6 at time 1 = 12
then value of cell 6 at time 2 = 12
Proof:
Given
1 | instruction #1 is store src=7 addr=6 imm=0 |
---|---|
2 | the PC at time 1 = 1 |
3 | value of cell 6 at time 1 = 12 |
4 | value of cell 6 at time 1 = 12 |
# | Claim | Reason |
---|---|---|
1 | (value of cell 6 at time 1) + 0 = 12 + 0 | if value of cell 6 at time 1 = 12 and value of cell 6 at time 1 = 12, then (value of cell 6 at time 1) + 0 = 12 + 0 |
2 | 12 + 0 = 12 | 12 + 0 = 12 |
3 | (value of cell 6 at time 1) + 0 = 12 | if (value of cell 6 at time 1) + 0 = 12 + 0 and 12 + 0 = 12, then (value of cell 6 at time 1) + 0 = 12 |
4 | 6 = (value of cell 6 at time 1) + 0 = 6 = 12 | if (value of cell 6 at time 1) + 0 = 12, then 6 = (value of cell 6 at time 1) + 0 = 6 = 12 |
5 | not (6 = (value of cell 6 at time 1) + 0) = not (6 = 12) | if 6 = (value of cell 6 at time 1) + 0 = 6 = 12, then not (6 = (value of cell 6 at time 1) + 0) = not (6 = 12) |
6 | not (6 = 12) | not (6 = 12) |
7 | not (6 = (value of cell 6 at time 1) + 0) | if not (6 = 12) and not (6 = (value of cell 6 at time 1) + 0) = not (6 = 12), then not (6 = (value of cell 6 at time 1) + 0) |
8 | value of cell 6 at time (1 + 1) = value of cell 6 at time 1 | if instruction #1 is store src=7 addr=6 imm=0 and the PC at time 1 = 1 and not (6 = (value of cell 6 at time 1) + 0), then value of cell 6 at time (1 + 1) = value of cell 6 at time 1 |
9 | 1 + 1 = 2 | 1 + 1 = 2 |
10 | value of cell 6 at time (1 + 1) = value of cell 6 at time 2 | if 1 + 1 = 2, then value of cell 6 at time (1 + 1) = value of cell 6 at time 2 |
11 | value of cell 6 at time 2 = value of cell 6 at time 1 | if value of cell 6 at time (1 + 1) = value of cell 6 at time 2 and value of cell 6 at time (1 + 1) = value of cell 6 at time 1, then value of cell 6 at time 2 = value of cell 6 at time 1 |
12 | value of cell 6 at time 2 = 12 | if value of cell 6 at time 2 = value of cell 6 at time 1 and value of cell 6 at time 1 = 12, then value of cell 6 at time 2 = 12 |
Comments
Please log in to add comments