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