Proof: Get Begin Expr Value 54
Let's prove the following theorem:
if the following are true:
- expression state at time 54 = "begin_expr"
- the expression at time 54 =
p.age_in_months()
- Value Stack at time 54 = [ ]
then Value Stack at time 55 = [ [ ], [ ] ]
Proof:
Given
1 | expression state at time 54 = "begin_expr" |
---|---|
2 | the expression at time 54 = p.age_in_months() |
3 | Value Stack at time 54 = [ ] |
# | Claim | Reason |
---|---|---|
1 | Value Stack at time (54 + 1) = [ [ ], Value Stack at time 54 ] | if expression state at time 54 = "begin_expr" and the expression at time 54 = p.age_in_months() , then Value Stack at time (54 + 1) = [ [ ], Value Stack at time 54 ] |
2 | [ [ ], Value Stack at time 54 ] = [ [ ], [ ] ] | if Value Stack at time 54 = [ ], then [ [ ], Value Stack at time 54 ] = [ [ ], [ ] ] |
3 | Value Stack at time (54 + 1) = [ [ ], [ ] ] | if Value Stack at time (54 + 1) = [ [ ], Value Stack at time 54 ] and [ [ ], Value Stack at time 54 ] = [ [ ], [ ] ], then Value Stack at time (54 + 1) = [ [ ], [ ] ] |
4 | 54 + 1 = 55 | 54 + 1 = 55 |
5 | Value Stack at time (54 + 1) = Value Stack at time 55 | if 54 + 1 = 55, then Value Stack at time (54 + 1) = Value Stack at time 55 |
6 | Value Stack at time 55 = [ [ ], [ ] ] | if Value Stack at time (54 + 1) = Value Stack at time 55 and Value Stack at time (54 + 1) = [ [ ], [ ] ], then Value Stack at time 55 = [ [ ], [ ] ] |
Comments
Please log in to add comments