Proof: Reverse One
Let's prove the following theorem:
reverse of [ [ 0, [ ] ], [ ] ] = [ [ 0, [ ] ], [ ] ]
Proof:
# | Claim | Reason |
---|---|---|
1 | reverse of [ [ 0, [ ] ], [ ] ] = reverse of remaining stack [ [ 0, [ ] ], [ ] ] and already reversed stack [ ] | reverse of [ [ 0, [ ] ], [ ] ] = reverse of remaining stack [ [ 0, [ ] ], [ ] ] and already reversed stack [ ] |
2 | reverse of remaining stack [ [ 0, [ ] ], [ ] ] and already reversed stack [ ] = [ [ 0, [ ] ], [ ] ] | reverse of remaining stack [ [ 0, [ ] ], [ ] ] and already reversed stack [ ] = [ [ 0, [ ] ], [ ] ] |
3 | reverse of [ [ 0, [ ] ], [ ] ] = [ [ 0, [ ] ], [ ] ] | if reverse of [ [ 0, [ ] ], [ ] ] = reverse of remaining stack [ [ 0, [ ] ], [ ] ] and already reversed stack [ ] and reverse of remaining stack [ [ 0, [ ] ], [ ] ] and already reversed stack [ ] = [ [ 0, [ ] ], [ ] ], then reverse of [ [ 0, [ ] ], [ ] ] = [ [ 0, [ ] ], [ ] ] |
Comments
Please log in to add comments