Proof: Write Assign End Vars 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)
- expression state at time 45 = "end_expr"
- Variables Map at time 45 = [ entry a: 1, [ ] ]
- Return Value at time 45 = 2
then Variables Map at time 46 = [ entry a: 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 | expression state at time 45 = "end_expr" |
5 | Variables Map at time 45 = [ entry a: 1, [ ] ] |
6 | Return Value at time 45 = 2 |
# | Claim | Reason |
---|---|---|
1 | Variables Map at time (45 + 1) = result of storing (Return Value at time 45) at key: a in map: (Variables 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) and expression state at time 45 = "end_expr", then Variables Map at time (45 + 1) = result of storing (Return Value at time 45) at key: a in map: (Variables Map at time 45) |
2 | result of storing (Return Value at time 45) at key: a in map: (Variables Map at time 45) = result of storing 2 at key: a in map: (Variables Map at time 45) | if Return Value at time 45 = 2, then result of storing (Return Value at time 45) at key: a in map: (Variables Map at time 45) = result of storing 2 at key: a in map: (Variables Map at time 45) |
3 | Variables Map at time (45 + 1) = result of storing 2 at key: a in map: (Variables Map at time 45) | if Variables Map at time (45 + 1) = result of storing (Return Value at time 45) at key: a in map: (Variables Map at time 45) and result of storing (Return Value at time 45) at key: a in map: (Variables Map at time 45) = result of storing 2 at key: a in map: (Variables Map at time 45), then Variables Map at time (45 + 1) = result of storing 2 at key: a in map: (Variables Map at time 45) |
4 | result of storing 2 at key: a in map: (Variables Map at time 45) = result of storing 2 at key: a in map: [ entry a: 1, [ ] ] | if Variables Map at time 45 = [ entry a: 1, [ ] ], then result of storing 2 at key: a in map: (Variables Map at time 45) = result of storing 2 at key: a in map: [ entry a: 1, [ ] ] |
5 | result of storing 2 at key: a in map: [ entry a: 1, [ ] ] = [ entry a: 2, [ ] ] | result of storing 2 at key: a in map: [ entry a: 1, [ ] ] = [ entry a: 2, [ ] ] |
6 | result of storing 2 at key: a in map: (Variables Map at time 45) = [ entry a: 2, [ ] ] | if result of storing 2 at key: a in map: (Variables Map at time 45) = result of storing 2 at key: a in map: [ entry a: 1, [ ] ] and result of storing 2 at key: a in map: [ entry a: 1, [ ] ] = [ entry a: 2, [ ] ], then result of storing 2 at key: a in map: (Variables Map at time 45) = [ entry a: 2, [ ] ] |
7 | Variables Map at time (45 + 1) = [ entry a: 2, [ ] ] | if Variables Map at time (45 + 1) = result of storing 2 at key: a in map: (Variables Map at time 45) and result of storing 2 at key: a in map: (Variables Map at time 45) = [ entry a: 2, [ ] ], then Variables Map at time (45 + 1) = [ entry a: 2, [ ] ] |
8 | 45 + 1 = 46 | 45 + 1 = 46 |
9 | Variables Map at time (45 + 1) = Variables Map at time 46 | if 45 + 1 = 46, then Variables Map at time (45 + 1) = Variables Map at time 46 |
10 | Variables Map at time 46 = [ entry a: 2, [ ] ] | if Variables Map at time (45 + 1) = Variables Map at time 46 and Variables Map at time (45 + 1) = [ entry a: 2, [ ] ], then Variables Map at time 46 = [ entry a: 2, [ ] ] |
Comments
Please log in to add comments