Home My Page Projects Code Snippets Project Openings SML/NJ
 Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

# SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/graphs/graph-comb.sml
 [smlnj] / sml / trunk / src / MLRISC / graphs / graph-comb.sml

# Annotation of /sml/trunk/src/MLRISC/graphs/graph-comb.sml

 1 : monnier 221 structure GraphCombinations : GRAPH_COMBINATIONS = 2 : struct 3 : 4 : structure G = Graph 5 : structure Union = UnionGraphView 6 : structure Rename = RenamedGraphView 7 : structure Rev = ReversedGraphView 8 : 9 : (* 10 : * Disjoint union 11 : *) 12 : fun my_union (a,b) = Union.union_view (fn (x,y) => x) (a, b) 13 : fun sum (A as G.GRAPH a, B as G.GRAPH b) = 14 : my_union(A, Rename.rename_view (#capacity a ()) B) 15 : fun union [] = raise G.Graph "union" 16 : | union [a] = a 17 : | union [a,b] = my_union(a,b) 18 : | union (a::b) = my_union(a,union b) 19 : 20 : fun sums [] = raise G.Graph "sums" 21 : | sums [a] = a 22 : | sums [a,b] = sum(a,b) 23 : | sums (a::b) = sum(a,sums b) 24 : 25 : end 26 : 27 : (* 28 : monnier 227 * \$Log\$ 29 : monnier 221 *) 30 :