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