| 1 |
structure TestDJGraph = |
| 2 |
struct |
| 3 |
structure Graph = Graph; |
| 4 |
val G as Graph.GRAPH g = DirectedGraph.graph("foo",(),10) : |
| 5 |
(string,int,unit) Graph.graph |
| 6 |
structure Dom = DominatorTree(DirectedGraph) |
| 7 |
structure DJ = DJGraph(Dom) |
| 8 |
val _ = app (#add_node g) |
| 9 |
[(0,"s"), |
| 10 |
(1,"v1"), |
| 11 |
(2,"v2"), |
| 12 |
(3,"v3"), |
| 13 |
(4,"v4"), |
| 14 |
(5,"t") |
| 15 |
] |
| 16 |
val _ = #set_entries g [0] |
| 17 |
val _ = #set_exits g [5] |
| 18 |
val _ = app (#add_edge g) |
| 19 |
[(0,1,16), |
| 20 |
(0,2,13), |
| 21 |
(1,2,10), |
| 22 |
(2,1,4), |
| 23 |
(1,3,12), |
| 24 |
(2,4,14), |
| 25 |
(3,2,9), |
| 26 |
(4,3,7), |
| 27 |
(3,5,20), |
| 28 |
(4,5,4) |
| 29 |
] |
| 30 |
|
| 31 |
val dom = Dom.makeDominator G |
| 32 |
val pdom = Dom.makePostdominator G |
| 33 |
val IDFs = DJ.IDFs dom |
| 34 |
|
| 35 |
end |