Proof: Write Decrement Tab Variables At 12
Let's prove the following theorem:
if the following are true:
- the line at time 12 = 3
- the tab at time 12 = 1
- statement at line 3, tab 0 =
else:
- Variables Map at time 12 = [ entry a: 7, [ ] ]
- Control Map at time 12 = [ entry 0: (pair ("if", True)), [ ] ]
then Variables Map at time 13 = [ entry a: 7, [ ] ]
Proof:
Given
1 | the line at time 12 = 3 |
---|---|
2 | the tab at time 12 = 1 |
3 | statement at line 3, tab 0 = else: |
4 | Variables Map at time 12 = [ entry a: 7, [ ] ] |
5 | Control Map at time 12 = [ entry 0: (pair ("if", True)), [ ] ] |
# | Claim | Reason |
---|---|---|
1 | 0 < 1 | 0 < 1 |
2 | value at (1 - 1) in map (Control Map at time 12) = pair ("if", True) | if Control Map at time 12 = [ entry 0: (pair ("if", True)), [ ] ], then value at (1 - 1) in map (Control Map at time 12) = pair ("if", True) |
3 | Variables Map at time (12 + 1) = Variables Map at time 12 | if the line at time 12 = 3 and the tab at time 12 = 1 and statement at line 3, tab 0 = else: and 0 < 1 and value at (1 - 1) in map (Control Map at time 12) = pair ("if", True), then Variables Map at time (12 + 1) = Variables Map at time 12 |
4 | Variables Map at time (12 + 1) = [ entry a: 7, [ ] ] | if Variables Map at time (12 + 1) = Variables Map at time 12 and Variables Map at time 12 = [ entry a: 7, [ ] ], then Variables Map at time (12 + 1) = [ entry a: 7, [ ] ] |
5 | 12 + 1 = 13 | 12 + 1 = 13 |
6 | Variables Map at time (12 + 1) = Variables Map at time 13 | if 12 + 1 = 13, then Variables Map at time (12 + 1) = Variables Map at time 13 |
7 | Variables Map at time 13 = [ entry a: 7, [ ] ] | if Variables Map at time (12 + 1) = Variables Map at time 13 and Variables Map at time (12 + 1) = [ entry a: 7, [ ] ], then Variables Map at time 13 = [ entry a: 7, [ ] ] |
Comments
Please log in to add comments