Docstring for for Annotation
Note that this changes no executing code. The change is 100% in documentation.
This commit is contained in:
parent
582c613be8
commit
14c10ec88e
1 changed files with 12 additions and 2 deletions
|
@ -20,10 +20,20 @@ use tracing::{debug, instrument};
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
/// An annotation for an SCC. This can be a representative,
|
/// An annotation for an SCC. This can be a representative,
|
||||||
/// or the max/min element of the SCC, or all of the above.
|
/// the max/min element of the SCC, or all of the above.
|
||||||
|
///
|
||||||
|
/// Concretely, the following properties must hold (where `merge`
|
||||||
|
/// is `merge_scc` and `merge_reached`):
|
||||||
|
/// - idempotency: `a.merge(a) = a`
|
||||||
|
/// - commutativity: `a.merge(b) = b.merge(a)`
|
||||||
|
///
|
||||||
|
/// This is rather limiting and precludes, for example, counting.
|
||||||
|
/// In general, what you want is probably always min/max according
|
||||||
|
/// to some ordering, potentially with side constraints (min x such
|
||||||
|
/// that P holds).
|
||||||
pub trait Annotation: Debug + Copy {
|
pub trait Annotation: Debug + Copy {
|
||||||
/// Merge two existing annotations into one during
|
/// Merge two existing annotations into one during
|
||||||
/// path compression.
|
/// path compression.o
|
||||||
fn merge_scc(self, other: Self) -> Self;
|
fn merge_scc(self, other: Self) -> Self;
|
||||||
|
|
||||||
/// Merge a successor into this annotation.
|
/// Merge a successor into this annotation.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue