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