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