Proof: Add Insn 16

Let's prove the following theorem:

if the following are true:
  • the PC at time 16 = 4
  • instruction #4 is add dst=3 src1=1 src2=2

then value of cell 3 at time 17 = (value of cell 1 at time 16) + (value of cell 2 at time 16)

Instructions
Memory Cells
Program Counter Time
0 0
LW Computer Simulator

Proof:

View as a tree | View dependent proofs | Try proving it

Given
1 the PC at time 16 = 4
2 instruction #4 is add dst=3 src1=1 src2=2
Proof Table
# Claim Reason
1 value of cell 3 at time (16 + 1) = (value of cell 1 at time 16) + (value of cell 2 at time 16) if instruction #4 is add dst=3 src1=1 src2=2 and the PC at time 16 = 4, then value of cell 3 at time (16 + 1) = (value of cell 1 at time 16) + (value of cell 2 at time 16)
2 16 + 1 = 17 16 + 1 = 17
3 value of cell 3 at time (16 + 1) = value of cell 3 at time 17 if 16 + 1 = 17, then value of cell 3 at time (16 + 1) = value of cell 3 at time 17
4 value of cell 3 at time 17 = (value of cell 1 at time 16) + (value of cell 2 at time 16) if value of cell 3 at time (16 + 1) = value of cell 3 at time 17 and value of cell 3 at time (16 + 1) = (value of cell 1 at time 16) + (value of cell 2 at time 16), then value of cell 3 at time 17 = (value of cell 1 at time 16) + (value of cell 2 at time 16)

Comments

Please log in to add comments