Proof: Write Stmt Control Map At Unchanged 45
Let's prove the following theorem:
if the following are true:
- the line at time 45 = 3
- the tab at time 45 = 1
- statement at line 3, tab 1 =
a = __add__(a, 1)
- Control Map at time 45 = [ entry 0: (pair ("while", 2)), [ ] ]
then Control Map at time 46 = [ entry 0: (pair ("while", 2)), [ ] ]
Proof:
Given
1 | the line at time 45 = 3 |
---|---|
2 | the tab at time 45 = 1 |
3 | statement at line 3, tab 1 = a = __add__(a, 1) |
4 | Control Map at time 45 = [ entry 0: (pair ("while", 2)), [ ] ] |
# | Claim | Reason |
---|---|---|
1 | Control Map at time (45 + 1) = Control Map at time 45 | if the line at time 45 = 3 and the tab at time 45 = 1 and statement at line 3, tab 1 = a = __add__(a, 1) , then Control Map at time (45 + 1) = Control Map at time 45 |
2 | Control Map at time (45 + 1) = [ entry 0: (pair ("while", 2)), [ ] ] | if Control Map at time (45 + 1) = Control Map at time 45 and Control Map at time 45 = [ entry 0: (pair ("while", 2)), [ ] ], then Control Map at time (45 + 1) = [ entry 0: (pair ("while", 2)), [ ] ] |
3 | 45 + 1 = 46 | 45 + 1 = 46 |
4 | Control Map at time (45 + 1) = Control Map at time 46 | if 45 + 1 = 46, then Control Map at time (45 + 1) = Control Map at time 46 |
5 | Control Map at time 46 = [ entry 0: (pair ("while", 2)), [ ] ] | if Control Map at time (45 + 1) = Control Map at time 46 and Control Map at time (45 + 1) = [ entry 0: (pair ("while", 2)), [ ] ], then Control Map at time 46 = [ entry 0: (pair ("while", 2)), [ ] ] |
Comments
Please log in to add comments