Proof: Write Assign End Stack 35
Let's prove the following theorem:
if the following are true:
- the line at time 35 = 10
- the tab at time 35 = 0
- statement at line 10, tab 0 =
joe = Dog()
- stack at time 35 = [ ]
- expression state at time 35 = "end_expr"
then stack at time 36 = [ ]
Proof:
Given
1 | the line at time 35 = 10 |
---|---|
2 | the tab at time 35 = 0 |
3 | statement at line 10, tab 0 = joe = Dog() |
4 | stack at time 35 = [ ] |
5 | expression state at time 35 = "end_expr" |
# | Claim | Reason |
---|---|---|
1 | stack at time (35 + 1) = stack at time 35 | if the line at time 35 = 10 and the tab at time 35 = 0 and statement at line 10, tab 0 = joe = Dog() and expression state at time 35 = "end_expr", then stack at time (35 + 1) = stack at time 35 |
2 | stack at time (35 + 1) = [ ] | if stack at time (35 + 1) = stack at time 35 and stack at time 35 = [ ], then stack at time (35 + 1) = [ ] |
3 | 35 + 1 = 36 | 35 + 1 = 36 |
4 | stack at time (35 + 1) = stack at time 36 | if 35 + 1 = 36, then stack at time (35 + 1) = stack at time 36 |
5 | stack at time 36 = [ ] | if stack at time (35 + 1) = stack at time 36 and stack at time (35 + 1) = [ ], then stack at time 36 = [ ] |
Comments
Please log in to add comments