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