Proof: Write Stmt Tab At Unchanged Expr23
Let's prove the following theorem:
if the following are true:
- the line at time 23 = 2
- the tab at time 23 = 1
- statement at line 2, tab 1 =
z = __add__(x, 3)
- expression state at time 23 = "end_expr"
then the tab at time 24 = 1
Proof:
Given
1 | the line at time 23 = 2 |
---|---|
2 | the tab at time 23 = 1 |
3 | statement at line 2, tab 1 = z = __add__(x, 3) |
4 | expression state at time 23 = "end_expr" |
# | Claim | Reason |
---|---|---|
1 | the tab at time (23 + 1) = the tab at time 23 | if the line at time 23 = 2 and the tab at time 23 = 1 and statement at line 2, tab 1 = z = __add__(x, 3) and expression state at time 23 = "end_expr", then the tab at time (23 + 1) = the tab at time 23 |
2 | the tab at time (23 + 1) = 1 | if the tab at time (23 + 1) = the tab at time 23 and the tab at time 23 = 1, then the tab at time (23 + 1) = 1 |
3 | 23 + 1 = 24 | 23 + 1 = 24 |
4 | the tab at time (23 + 1) = the tab at time 24 | if 23 + 1 = 24, then the tab at time (23 + 1) = the tab at time 24 |
5 | the tab at time 24 = 1 | if the tab at time (23 + 1) = the tab at time 24 and the tab at time (23 + 1) = 1, then the tab at time 24 = 1 |
Comments
Please log in to add comments