Hello,
I'd like to just add that sets are very natural in describing algorithms :-)
(but not low-level data structures). For example, consider graph reachability:
-- given a set e of edges and a set s of vertices, compute
-- set r of vertices reachable from vertices in s following edges in e:
r := s
while exists v in {v: (u,v) in e, u in r, v not in r}:
r := r + {v}
-- same algorithm at a low level,
-- so it is linear/optimal time by doing each set operation in O(1) time:
w := s
r := {}
while exists x in w:
for y in e{x}:
if y not in r and y not in w:
w := w + {y}
w := w - {x}
r := r + {x}
where e{x} is the image of x under map e (as in SETL:-), where a map is
just a set of pairs), i.e., the set of elements that e maps x to.
Annie