What is a good, common way to express dictionaries (= maps) in pseudocode? I.e. datastructures that basically allow to store values for keys, iterate over all key/value pairs, test for inclusion of a given key, etc. I have something like the following (in this case senseless) Python code in mind:
D = {}
D[1] = 2
for key, value in D.items():
# do something with key and value
if key in D:
# do something
And I want to express it as pseudocode in a publication. Thinking mathematically, dictionaries are functions are relations are sets of pairs, so writing something like
D ← ∅
D[1] ← 2
for all (k, v) ∈ D
would actually make sense. But is it understandable? And for the test, I'd use
if k ∈ keys(D)
Or is it saver to be more literal, e.g.
D ← empty dictionary
for all key-value pairs (k, v) in D
Is there existing good practice / any reference on how to write commonly understandable pseudocode?