23 |
structure ITbl = IntHashTable |
structure ITbl = IntHashTable |
24 |
structure PQ = LeftPriorityQFn ( |
structure PQ = LeftPriorityQFn ( |
25 |
struct |
struct |
26 |
type priority = Freq.freq |
type priority = CFG.weight |
27 |
val compare = Freq.compare |
val compare = Real.compare |
28 |
type item = CFG.edge |
type item = CFG.edge |
29 |
fun priority (_, _, CFG.EDGE{w, ...}) = !w |
fun priority (_, _, CFG.EDGE{w, ...}) = !w |
30 |
end) |
end) |
49 |
fun head (CHAIN{hd, ...}) = #1 hd |
fun head (CHAIN{hd, ...}) = #1 hd |
50 |
fun tail (CHAIN{tl, ...}) = #1 tl |
fun tail (CHAIN{tl, ...}) = #1 tl |
51 |
fun id (CHAIN{hd, ...}) = #1 hd (* use node ID of head to identify chains *) |
fun id (CHAIN{hd, ...}) = #1 hd (* use node ID of head to identify chains *) |
52 |
fun sameChain (CHAIN{hd=h1, ...}, CHAIN{hd=h2, ...}) = (h1 = h2) |
fun sameChain (CHAIN{hd=h1, ...}, CHAIN{hd=h2, ...}) = (#1 h1 = #1 h2) |
53 |
|
|
54 |
fun blockToString (id', CFG.BLOCK{id, ...}) = |
fun blockToString (id', CFG.BLOCK{id, ...}) = |
55 |
concat["<", Int.toString id', ":", Int.toString id, ">"] |
concat["<", Int.toString id', ":", Int.toString id, ">"] |