functor GRAPH( type Vertex structure D:DictSig and VS:SetSig sharing type Vertex = VS.Item = AS.Item = D.Key and type Vertex list = D.Item) = struct type Vertex = Vertex structure VSet = VS type Graph = VS.Set * (Vertex list) D.Dict fun vertices (v,a) = v and adj (v,a) x = D.lookup a x end;