Proof: Write Assign End Vars 76
Let's prove the following theorem:
if the following are true:
- the line at time 76 = 9
- the tab at time 76 = 0
- statement at line 9, tab 0 =
age = p.age_in_months()
- expression state at time 76 = "end_expr"
- Variables Map at time 76 = [ entry p: (Python reference 0), [ ] ]
- Return Value at time 76 = 300
then Variables Map at time 77 = [ entry p: (Python reference 0), [ entry age: 300, [ ] ] ]
Proof:
Given
1 | the line at time 76 = 9 |
---|---|
2 | the tab at time 76 = 0 |
3 | statement at line 9, tab 0 = age = p.age_in_months() |
4 | expression state at time 76 = "end_expr" |
5 | Variables Map at time 76 = [ entry p: (Python reference 0), [ ] ] |
6 | Return Value at time 76 = 300 |
# | Claim | Reason |
---|---|---|
1 | Variables Map at time (76 + 1) = result of storing (Return Value at time 76) at key: age in map: (Variables Map at time 76) | if the line at time 76 = 9 and the tab at time 76 = 0 and statement at line 9, tab 0 = age = p.age_in_months() and expression state at time 76 = "end_expr", then Variables Map at time (76 + 1) = result of storing (Return Value at time 76) at key: age in map: (Variables Map at time 76) |
2 | result of storing (Return Value at time 76) at key: age in map: (Variables Map at time 76) = result of storing 300 at key: age in map: (Variables Map at time 76) | if Return Value at time 76 = 300, then result of storing (Return Value at time 76) at key: age in map: (Variables Map at time 76) = result of storing 300 at key: age in map: (Variables Map at time 76) |
3 | Variables Map at time (76 + 1) = result of storing 300 at key: age in map: (Variables Map at time 76) | if Variables Map at time (76 + 1) = result of storing (Return Value at time 76) at key: age in map: (Variables Map at time 76) and result of storing (Return Value at time 76) at key: age in map: (Variables Map at time 76) = result of storing 300 at key: age in map: (Variables Map at time 76), then Variables Map at time (76 + 1) = result of storing 300 at key: age in map: (Variables Map at time 76) |
4 | result of storing 300 at key: age in map: (Variables Map at time 76) = result of storing 300 at key: age in map: [ entry p: (Python reference 0), [ ] ] | if Variables Map at time 76 = [ entry p: (Python reference 0), [ ] ], then result of storing 300 at key: age in map: (Variables Map at time 76) = result of storing 300 at key: age in map: [ entry p: (Python reference 0), [ ] ] |
5 | result of storing 300 at key: age in map: [ entry p: (Python reference 0), [ ] ] = [ entry p: (Python reference 0), [ entry age: 300, [ ] ] ] | result of storing 300 at key: age in map: [ entry p: (Python reference 0), [ ] ] = [ entry p: (Python reference 0), [ entry age: 300, [ ] ] ] |
6 | result of storing 300 at key: age in map: (Variables Map at time 76) = [ entry p: (Python reference 0), [ entry age: 300, [ ] ] ] | if result of storing 300 at key: age in map: (Variables Map at time 76) = result of storing 300 at key: age in map: [ entry p: (Python reference 0), [ ] ] and result of storing 300 at key: age in map: [ entry p: (Python reference 0), [ ] ] = [ entry p: (Python reference 0), [ entry age: 300, [ ] ] ], then result of storing 300 at key: age in map: (Variables Map at time 76) = [ entry p: (Python reference 0), [ entry age: 300, [ ] ] ] |
7 | Variables Map at time (76 + 1) = [ entry p: (Python reference 0), [ entry age: 300, [ ] ] ] | if Variables Map at time (76 + 1) = result of storing 300 at key: age in map: (Variables Map at time 76) and result of storing 300 at key: age in map: (Variables Map at time 76) = [ entry p: (Python reference 0), [ entry age: 300, [ ] ] ], then Variables Map at time (76 + 1) = [ entry p: (Python reference 0), [ entry age: 300, [ ] ] ] |
8 | 76 + 1 = 77 | 76 + 1 = 77 |
9 | Variables Map at time (76 + 1) = Variables Map at time 77 | if 76 + 1 = 77, then Variables Map at time (76 + 1) = Variables Map at time 77 |
10 | Variables Map at time 77 = [ entry p: (Python reference 0), [ entry age: 300, [ ] ] ] | if Variables Map at time (76 + 1) = Variables Map at time 77 and Variables Map at time (76 + 1) = [ entry p: (Python reference 0), [ entry age: 300, [ ] ] ], then Variables Map at time 77 = [ entry p: (Python reference 0), [ entry age: 300, [ ] ] ] |
Comments
Please log in to add comments