@@ -22,12 +22,9 @@ mod tests;
22
22
/// An annotation for an SCC. This can be a representative,
23
23
/// the max/min element of the SCC, or all of the above.
24
24
///
25
- /// Concretely, the following properties must hold (where `merge`
26
- /// is `merge_scc` and `merge_reached`):
27
- /// - idempotency: `a.merge(a) = a`
28
- /// - commutativity: `a.merge(b) = b.merge(a)`
25
+ /// Concretely, the both merge operations must commute, e.g. where `merge`
26
+ /// is `merge_scc` and `merge_reached`: `a.merge(b) == b.merge(a)`
29
27
///
30
- /// This is rather limiting and precludes, for example, counting.
31
28
/// In general, what you want is probably always min/max according
32
29
/// to some ordering, potentially with side constraints (min x such
33
30
/// that P holds).
@@ -62,7 +59,7 @@ impl Annotation for () {
62
59
/// the index type for the graph nodes and `S` is the index type for
63
60
/// the SCCs. We can map from each node to the SCC that it
64
61
/// participates in, and we also have the successors of each SCC.
65
- pub struct Sccs < N : Idx , S : Idx , A : Annotation > {
62
+ pub struct Sccs < N : Idx , S : Idx , A : Annotation = ( ) > {
66
63
/// For each node, what is the SCC index of the SCC to which it
67
64
/// belongs.
68
65
scc_indices : IndexVec < N , S > ,
@@ -314,8 +311,7 @@ where
314
311
/// D' (i.e., D' < D), we know that N, N', and all nodes in
315
312
/// between them on the stack are part of an SCC.
316
313
///
317
- /// Additionally, we keep track of a representative annotation of the
318
- /// SCC.
314
+ /// Additionally, we keep track of a current annotation of the SCC.
319
315
///
320
316
/// [wikipedia]: https://bit.ly/2EZIx84
321
317
fn construct ( graph : & ' c G , to_annotation : F ) -> Sccs < G :: Node , S , A > {
0 commit comments