Proof: Addi Insn 16
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 16 = 2
- value of cell 5 at time 16 = 10
then value of cell 5 at time 17 = 11
Proof:
Given
1 | instruction #2 is addi dst=5 src=5 imm=1 |
---|---|
2 | the PC at time 16 = 2 |
3 | value of cell 5 at time 16 = 10 |
# | Claim | Reason |
---|---|---|
1 | value of cell 5 at time (16 + 1) = (value of cell 5 at time 16) + 1 | if instruction #2 is addi dst=5 src=5 imm=1 and the PC at time 16 = 2, then value of cell 5 at time (16 + 1) = (value of cell 5 at time 16) + 1 |
2 | 16 + 1 = 17 | 16 + 1 = 17 |
3 | value of cell 5 at time (16 + 1) = value of cell 5 at time 17 | if 16 + 1 = 17, then value of cell 5 at time (16 + 1) = value of cell 5 at time 17 |
4 | value of cell 5 at time 17 = (value of cell 5 at time 16) + 1 | if value of cell 5 at time (16 + 1) = value of cell 5 at time 17 and value of cell 5 at time (16 + 1) = (value of cell 5 at time 16) + 1, then value of cell 5 at time 17 = (value of cell 5 at time 16) + 1 |
5 | value of cell 5 at time 17 = 10 + 1 | if value of cell 5 at time 17 = (value of cell 5 at time 16) + 1 and value of cell 5 at time 16 = 10, then value of cell 5 at time 17 = 10 + 1 |
6 | 10 + 1 = 11 | 10 + 1 = 11 |
7 | value of cell 5 at time 17 = 11 | if value of cell 5 at time 17 = 10 + 1 and 10 + 1 = 11, then value of cell 5 at time 17 = 11 |
Comments
Please log in to add comments