Proof: Get Begin Expr Parent 37
Let's prove the following theorem:
if the following are true:
- expression state at time 37 = "begin_expr"
- the expression at time 37 =
joe.move()
- parent stack at time 37 = [ ]
then parent stack at time 38 = [ joe.move()
, [ ] ]
Proof:
Given
1 | expression state at time 37 = "begin_expr" |
---|---|
2 | the expression at time 37 = joe.move() |
3 | parent stack at time 37 = [ ] |
# | Claim | Reason |
---|---|---|
1 | parent stack at time (37 + 1) = [ joe.move() , parent stack at time 37 ] |
if expression state at time 37 = "begin_expr" and the expression at time 37 = joe.move() , then parent stack at time (37 + 1) = [ joe.move() , parent stack at time 37 ] |
2 | [ joe.move() , parent stack at time 37 ] = [ joe.move() , [ ] ] |
if parent stack at time 37 = [ ], then [ joe.move() , parent stack at time 37 ] = [ joe.move() , [ ] ] |
3 | parent stack at time (37 + 1) = [ joe.move() , [ ] ] |
if parent stack at time (37 + 1) = [ joe.move() , parent stack at time 37 ] and [ joe.move() , parent stack at time 37 ] = [ joe.move() , [ ] ], then parent stack at time (37 + 1) = [ joe.move() , [ ] ] |
4 | 37 + 1 = 38 | 37 + 1 = 38 |
5 | parent stack at time (37 + 1) = parent stack at time 38 | if 37 + 1 = 38, then parent stack at time (37 + 1) = parent stack at time 38 |
6 | parent stack at time 38 = [ joe.move() , [ ] ] |
if parent stack at time (37 + 1) = parent stack at time 38 and parent stack at time (37 + 1) = [ joe.move() , [ ] ], then parent stack at time 38 = [ joe.move() , [ ] ] |
Comments
Please log in to add comments