Proof: Pop Index Result Example 3
Let's prove the following theorem:
remaining elements after [ 2, [ 1, [ ] ] ] is popped at index 0 and visited stack is [ ] = [ 1, [ ] ]
Proof:
| # | Claim | Reason |
|---|---|---|
| 1 | remaining elements after [ 2, [ 1, [ ] ] ] is popped at index 0 and visited stack is [ ] = reverse of (result of dumping [ 1, [ ] ] to [ ]) | remaining elements after [ 2, [ 1, [ ] ] ] is popped at index 0 and visited stack is [ ] = reverse of (result of dumping [ 1, [ ] ] to [ ]) |
| 2 | result of dumping [ 1, [ ] ] to [ ] = [ 1, [ ] ] | result of dumping [ 1, [ ] ] to [ ] = [ 1, [ ] ] |
| 3 | reverse of (result of dumping [ 1, [ ] ] to [ ]) = reverse of [ 1, [ ] ] | if result of dumping [ 1, [ ] ] to [ ] = [ 1, [ ] ], then reverse of (result of dumping [ 1, [ ] ] to [ ]) = reverse of [ 1, [ ] ] |
| 4 | reverse of [ 1, [ ] ] = [ 1, [ ] ] | reverse of [ 1, [ ] ] = [ 1, [ ] ] |
| 5 | reverse of (result of dumping [ 1, [ ] ] to [ ]) = [ 1, [ ] ] | if reverse of (result of dumping [ 1, [ ] ] to [ ]) = reverse of [ 1, [ ] ] and reverse of [ 1, [ ] ] = [ 1, [ ] ], then reverse of (result of dumping [ 1, [ ] ] to [ ]) = [ 1, [ ] ] |
| 6 | remaining elements after [ 2, [ 1, [ ] ] ] is popped at index 0 and visited stack is [ ] = [ 1, [ ] ] | if remaining elements after [ 2, [ 1, [ ] ] ] is popped at index 0 and visited stack is [ ] = reverse of (result of dumping [ 1, [ ] ] to [ ]) and reverse of (result of dumping [ 1, [ ] ] to [ ]) = [ 1, [ ] ], then remaining elements after [ 2, [ 1, [ ] ] ] is popped at index 0 and visited stack is [ ] = [ 1, [ ] ] |
Comments
Please log in to add comments