Proof: Write Test Call End Control Map 34
Let's prove the following theorem:
if the following are true:
- the line at time 34 = 2
- the tab at time 34 = 0
- statement at line 2, tab 0 =
while __lt__(a, 2):
- expression state at time 34 = "end_expr"
- Return Value at time 34 = True
- Control Map at time 34 = [ entry 0: (pair ("while", 2)), [ ] ]
then Control Map at time 35 = [ entry 0: (pair ("while", 2)), [ ] ]
Proof:
Given
1 | the line at time 34 = 2 |
---|---|
2 | the tab at time 34 = 0 |
3 | statement at line 2, tab 0 = while __lt__(a, 2): |
4 | expression state at time 34 = "end_expr" |
5 | Return Value at time 34 = True |
6 | Control Map at time 34 = [ entry 0: (pair ("while", 2)), [ ] ] |
# | Claim | Reason |
---|---|---|
1 | Control Map at time (34 + 1) = result of storing (pair ("while", 2)) at key: 0 in map: (Control Map at time 34) | if the line at time 34 = 2 and the tab at time 34 = 0 and statement at line 2, tab 0 = while __lt__(a, 2): and expression state at time 34 = "end_expr" and Return Value at time 34 = True, then Control Map at time (34 + 1) = result of storing (pair ("while", 2)) at key: 0 in map: (Control Map at time 34) |
2 | result of storing (pair ("while", 2)) at key: 0 in map: (Control Map at time 34) = result of storing (pair ("while", 2)) at key: 0 in map: [ entry 0: (pair ("while", 2)), [ ] ] | if Control Map at time 34 = [ entry 0: (pair ("while", 2)), [ ] ], then result of storing (pair ("while", 2)) at key: 0 in map: (Control Map at time 34) = result of storing (pair ("while", 2)) at key: 0 in map: [ entry 0: (pair ("while", 2)), [ ] ] |
3 | result of storing (pair ("while", 2)) at key: 0 in map: [ entry 0: (pair ("while", 2)), [ ] ] = [ entry 0: (pair ("while", 2)), [ ] ] | result of storing (pair ("while", 2)) at key: 0 in map: [ entry 0: (pair ("while", 2)), [ ] ] = [ entry 0: (pair ("while", 2)), [ ] ] |
4 | result of storing (pair ("while", 2)) at key: 0 in map: (Control Map at time 34) = [ entry 0: (pair ("while", 2)), [ ] ] | if result of storing (pair ("while", 2)) at key: 0 in map: (Control Map at time 34) = result of storing (pair ("while", 2)) at key: 0 in map: [ entry 0: (pair ("while", 2)), [ ] ] and result of storing (pair ("while", 2)) at key: 0 in map: [ entry 0: (pair ("while", 2)), [ ] ] = [ entry 0: (pair ("while", 2)), [ ] ], then result of storing (pair ("while", 2)) at key: 0 in map: (Control Map at time 34) = [ entry 0: (pair ("while", 2)), [ ] ] |
5 | Control Map at time (34 + 1) = [ entry 0: (pair ("while", 2)), [ ] ] | if Control Map at time (34 + 1) = result of storing (pair ("while", 2)) at key: 0 in map: (Control Map at time 34) and result of storing (pair ("while", 2)) at key: 0 in map: (Control Map at time 34) = [ entry 0: (pair ("while", 2)), [ ] ], then Control Map at time (34 + 1) = [ entry 0: (pair ("while", 2)), [ ] ] |
6 | 34 + 1 = 35 | 34 + 1 = 35 |
7 | Control Map at time (34 + 1) = Control Map at time 35 | if 34 + 1 = 35, then Control Map at time (34 + 1) = Control Map at time 35 |
8 | Control Map at time 35 = [ entry 0: (pair ("while", 2)), [ ] ] | if Control Map at time (34 + 1) = Control Map at time 35 and Control Map at time (34 + 1) = [ entry 0: (pair ("while", 2)), [ ] ], then Control Map at time 35 = [ entry 0: (pair ("while", 2)), [ ] ] |
Comments
Please log in to add comments