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