In this example, we have a map that has 1 entry:

"name":"John"

And we want to store a new key "city" with value "New York".

The map is then updated to:

[ entry "name":"Mike", [ entry "city":"New York", [ ] ] ]

Step 1 uses Set Key and Value Property 1 which sets "processed" to an empty map and "key found" to false.

In step 2, we skip the key "name" since we are looking to replace the key "city".

In step 3, we have reached the end of the map and the key "city" has not yet been found, so we add the new "city":"New York" entry to the map. After that, we just reverse the new map and then use the Transitive Property of Equality to set the result to the new map.

Quiz (1 point)

Prove that:
result of storing "New York" at key: "city" in map: [ entry "name": "John", [ ] ] = [ entry "name": "John", [ entry "city": "New York", [ ] ] ]

The following properties may be helpful:

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.

Step Claim Reason (optional) Error Message (if any)
1
2
3
4
5
6
7
8
9
10

Become a subscriber to save your progress, see the correct answer, and more!