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