Proof: Do Stack At Unchanged 38
Let's prove the following theorem:
if the following are true:
- expression state at time 38 = "return"
- stack at time 38 = [ program context with variables: [ ] and expression state: (expression state with parent stack: [ ] arguments: [ ] values: [ ] line: 8 tab: 0) and control map: [ entry 0: (pair ("class", "Person")), [ ] ], [ ] ]
then stack at time 39 = [ program context with variables: [ ] and expression state: (expression state with parent stack: [ ] arguments: [ ] values: [ ] line: 8 tab: 0) and control map: [ entry 0: (pair ("class", "Person")), [ ] ], [ ] ]
Proof:
Given
1 | expression state at time 38 = "return" |
---|---|
2 | stack at time 38 = [ program context with variables: [ ] and expression state: (expression state with parent stack: [ ] arguments: [ ] values: [ ] line: 8 tab: 0) and control map: [ entry 0: (pair ("class", "Person")), [ ] ], [ ] ] |
# | Claim | Reason |
---|---|---|
1 | stack at time (38 + 1) = stack at time 38 | if expression state at time 38 = "return", then stack at time (38 + 1) = stack at time 38 |
2 | stack at time (38 + 1) = [ program context with variables: [ ] and expression state: (expression state with parent stack: [ ] arguments: [ ] values: [ ] line: 8 tab: 0) and control map: [ entry 0: (pair ("class", "Person")), [ ] ], [ ] ] | if stack at time (38 + 1) = stack at time 38 and stack at time 38 = [ program context with variables: [ ] and expression state: (expression state with parent stack: [ ] arguments: [ ] values: [ ] line: 8 tab: 0) and control map: [ entry 0: (pair ("class", "Person")), [ ] ], [ ] ], then stack at time (38 + 1) = [ program context with variables: [ ] and expression state: (expression state with parent stack: [ ] arguments: [ ] values: [ ] line: 8 tab: 0) and control map: [ entry 0: (pair ("class", "Person")), [ ] ], [ ] ] |
3 | 38 + 1 = 39 | 38 + 1 = 39 |
4 | stack at time (38 + 1) = stack at time 39 | if 38 + 1 = 39, then stack at time (38 + 1) = stack at time 39 |
5 | stack at time 39 = [ program context with variables: [ ] and expression state: (expression state with parent stack: [ ] arguments: [ ] values: [ ] line: 8 tab: 0) and control map: [ entry 0: (pair ("class", "Person")), [ ] ], [ ] ] | if stack at time (38 + 1) = stack at time 39 and stack at time (38 + 1) = [ program context with variables: [ ] and expression state: (expression state with parent stack: [ ] arguments: [ ] values: [ ] line: 8 tab: 0) and control map: [ entry 0: (pair ("class", "Person")), [ ] ], [ ] ], then stack at time 39 = [ program context with variables: [ ] and expression state: (expression state with parent stack: [ ] arguments: [ ] values: [ ] line: 8 tab: 0) and control map: [ entry 0: (pair ("class", "Person")), [ ] ], [ ] ] |
Comments
Please log in to add comments