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