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