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