Proof: Byte 123 Stays the Same 22
Let's prove the following theorem:
if the following are true:
- instruction #22 is
addi dst=1 src=1 imm=3 - the PC at time 22 = 22
- value of cell 123 at time 22 = 5
then value of cell 123 at time 23 = 5
Proof:
Given
| 1 | instruction #22 is addi dst=1 src=1 imm=3 |
|---|---|
| 2 | the PC at time 22 = 22 |
| 3 | value of cell 123 at time 22 = 5 |
| # | Claim | Reason |
|---|---|---|
| 1 | not (123 = 1) | not (123 = 1) |
| 2 | value of cell 123 at time (22 + 1) = value of cell 123 at time 22 | if instruction #22 is addi dst=1 src=1 imm=3 and the PC at time 22 = 22 and not (123 = 1), then value of cell 123 at time (22 + 1) = value of cell 123 at time 22 |
| 3 | 22 + 1 = 23 | 22 + 1 = 23 |
| 4 | value of cell 123 at time (22 + 1) = value of cell 123 at time 23 | if 22 + 1 = 23, then value of cell 123 at time (22 + 1) = value of cell 123 at time 23 |
| 5 | value of cell 123 at time 23 = value of cell 123 at time 22 | if value of cell 123 at time (22 + 1) = value of cell 123 at time 23 and value of cell 123 at time (22 + 1) = value of cell 123 at time 22, then value of cell 123 at time 23 = value of cell 123 at time 22 |
| 6 | value of cell 123 at time 23 = 5 | if value of cell 123 at time 23 = value of cell 123 at time 22 and value of cell 123 at time 22 = 5, then value of cell 123 at time 23 = 5 |
Comments
Please log in to add comments