functor BLOCKASDAG( structure B: BlockSig ): sig structure G : GraphSig structure B : BlockSig sharing type G.Graph = B.Block and type G.Vertex = B.Expn end = struct structure B = B structure G = struct type Graph = B.Block type Vertex = B.Expn local open B in fun vertices (Block expns) = map #2 expns fun adj _ e = case e of (x *** y) => [x, y] | (x --- y) => [x, y] | (x +++ y) => [x, y] | (x /// y) => [x, y] | _ => [] end end end