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