Proof: Get Begin Expr State 17
Let's prove the following theorem:
if the following are true:
- the expression at time 17 = 25
- expression state at time 17 = "begin_expr"
- 25 is constant
- parent stack at time 17 = [
Person("John", "Smith", 25)
, [ ] ]
then expression state at time 18 = "return"
Proof:
Given
1 | the expression at time 17 = 25 |
---|---|
2 | expression state at time 17 = "begin_expr" |
3 | 25 is constant |
4 | parent stack at time 17 = [ Person("John", "Smith", 25) , [ ] ] |
# | Claim | Reason |
---|---|---|
1 | expression state at time (17 + 1) = "return" | if expression state at time 17 = "begin_expr" and the expression at time 17 = 25 and 25 is constant and parent stack at time 17 = [ Person("John", "Smith", 25) , [ ] ], then expression state at time (17 + 1) = "return" |
2 | 17 + 1 = 18 | 17 + 1 = 18 |
3 | expression state at time (17 + 1) = expression state at time 18 | if 17 + 1 = 18, then expression state at time (17 + 1) = expression state at time 18 |
4 | expression state at time 18 = "return" | if expression state at time (17 + 1) = expression state at time 18 and expression state at time (17 + 1) = "return", then expression state at time 18 = "return" |
Comments
Please log in to add comments