Proof: Do Stack At Unchanged 31
Let's prove the following theorem:
if the following are true:
- expression state at time 31 = "return"
- stack at time 31 = [ ]
then stack at time 32 = [ ]
Proof:
Given
1 | expression state at time 31 = "return" |
---|---|
2 | stack at time 31 = [ ] |
# | Claim | Reason |
---|---|---|
1 | stack at time (31 + 1) = stack at time 31 | if expression state at time 31 = "return", then stack at time (31 + 1) = stack at time 31 |
2 | stack at time (31 + 1) = [ ] | if stack at time (31 + 1) = stack at time 31 and stack at time 31 = [ ], then stack at time (31 + 1) = [ ] |
3 | 31 + 1 = 32 | 31 + 1 = 32 |
4 | stack at time (31 + 1) = stack at time 32 | if 31 + 1 = 32, then stack at time (31 + 1) = stack at time 32 |
5 | stack at time 32 = [ ] | if stack at time (31 + 1) = stack at time 32 and stack at time (31 + 1) = [ ], then stack at time 32 = [ ] |
Comments
Please log in to add comments