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