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