Proof: Byte 4 Stays the Same 4

Let's prove the following theorem:

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

then value of cell 4 at time 5 = 0

Instructions
Memory Cells
Program Counter Time
0 0
LW Computer Simulator

Proof:

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

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

Comments

Please log in to add comments