In this example, we prove that the map [ entry "OH":"Ohio", [ entry "AK":"Alaska", [ entry "IA":"Iowa", [ ] ] ] ] contains key "AK." If there is an entry with key "AK," then the map contains "AK."
At each step, we observe the first entry in the map. If the key in the first entry is equal to "AK," then we have shown that the map contains key "AK." If not, pop the first entry off of the map and repeat.
For instance, the following:
map [ entry "OH": "Ohio", [ entry "AK": "Alaska", [ entry "IA": "Iowa", [ ] ] ] ] contains key "AK"
is equal to:
map [ entry "AK": "Alaska", [ entry "IA": "Iowa", [ ] ] ] contains key "AK"
which is True.
Quiz (1 point)
- map [ entry bad_key: value, remaining ] contains key key = map remaining contains key key
- map [ entry key: value, remaining ] contains key key = True
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.