In this example, we have the following map:
Key | Value |
---|---|
name | John |
city | New York |
country | USA |
We prove that, when the key "country" and its value is deleted, the map will change to:
Key | Value |
---|---|
name | John |
city | New York |
Quiz (1 point)
Prove that:
result of deleting the entry with key "country" from map [ entry "name": "John", [ entry "city": "New York", [ entry "country": "USA", [ ] ] ] ] = [ entry "name": "John", [ entry "city": "New York", [ ] ] ]
The following properties may be helpful:
- result of deleting the entry with key key from map entries = output of function delete_entry where input key is key, map is entries, and processed is [ ]
- output of function delete_entry where input key is key, map is [ entry lkey: lvalue, remaining ], and processed is kvs = output of function delete_entry where input key is key, map is remaining, and processed is [ entry lkey: lvalue, kvs ]
- output of function delete_entry where input key is key, map is [ entry lkey: lvalue, remaining ], and processed is kvs = output of function delete_entry where input key is key, map is remaining, and processed is [ entry lkey: lvalue, kvs ]
- output of function delete_entry where input key is key, map is [ entry key: value, remaining ], and processed is kvs = output of function delete_entry where input key is key, map is remaining, and processed is kvs
- output of function delete_entry where input key is key, map is [ ], and processed is kvs = reverse of kvs
- reverse of xs = reverse of remaining stack xs and already reversed stack [ ]
- reverse of remaining stack [ x, xs ] and already reversed stack ys = reverse of remaining stack xs and already reversed stack [ x, ys ]
- reverse of remaining stack [ x, [ ] ] and already reversed stack ys = [ x, ys ]
if the following are true:
- a = b
- b = c
then a = c
if the following are true:
- a = b
- b = c
then a = c
if the following are true:
- a = b
- b = c
then a = c
if the following are true:
- a = b
- b = c
then a = c
if the following are true:
- a = b
- b = c
then a = c
if the following are true:
- a = b
- b = c
then a = c
if the following are true:
- a = b
- b = c
then a = c
Please write your proof in the table below. Each row should contain one claim. The last claim is the statement that you are trying to prove.