/// Invoked when all available strands for a table have
/// encountered a cycle. In this case, the vector `strands` are
/// the set of strands that encountered cycles, and `minimums` is
/// the minimum stack depths that they were dependent on.
///
/// Returns `None` if we have resolved the cycle and should try to
/// pick a strand again. Returns `Some(_)` if the cycle indicates
/// an error that we can propagate higher up.
Invoked when all available strands for a table have
encountered a cycle. In this case, the vector `strands` are
the set of strands that encountered cycles, and `minimums` is
the minimum stack depths that they were dependent on.

Returns `None` if we have resolved the cycle and should try to
pick a strand again. Returns `Some(_)` if the cycle indicates
an error that we can propagate higher up.
Invoked when all available strands for a table have encountered a cycle . In this case the vector ` strands ` are the set of strands that encountered cycles and ` minimums ` is the minimum stack depths that they were dependent on . Returns ` None ` if we have resolved the cycle and should try to pick a strand again . Returns ` Some ( _ ) ` if the cycle indicates an error that we can propagate higher up .
fn cycle(
        &mut self,
        depth: StackIndex,
        strands: Vec<CanonicalStrand<C>>,
        minimums: Minimums,
    ) -> Option<RecursiveSearchFail> {
        let table = self.stack[depth].table;
        assert!(self.tables[table].pop_next_strand().is_none());
        let dfn = self.stack[depth].dfn;
        if minimums.positive == dfn && minimums.negative == DepthFirstNumber::MAX {
            // If all the things that we recursively depend on have
            // positive dependencies on things below us in the stack,
            // then no more answers are forthcoming. We can clear all
            // the strands for those things recursively.
            self.clear_strands_after_cycle(table, strands);
            Some(RecursiveSearchFail::NoMoreSolutions)
        } else if minimums.positive >= dfn && minimums.negative >= dfn {
            let mut visited = FxHashSet::default();
            visited.insert(table);
            self.tables[table].extend_strands(strands);
            self.delay_strands_after_cycle(table, &mut visited);
            None
        } else {
            self.tables[table].extend_strands(strands);
            Some(RecursiveSearchFail::Cycle(minimums))
        }
    }
fn cycle ( & mut self , depth : StackIndex , strands : Vec < CanonicalStrand < C > > , minimums : Minimums , ) -> Option < RecursiveSearchFail > { let table = self . stack [ depth ] . table ; assert ! ( self tables [ table ] pop_next_strand ( ) is_none ( ) ) ; let dfn = self . stack [ depth ] . dfn ; if minimums . positive == dfn && minimums . negative == DepthFirstNumber :: MAX { // If all the things that we recursively depend on have // positive dependencies on things below us in the stack, // then no more answers are forthcoming. We can clear all // the strands for those things recursively. self . clear_strands_after_cycle ( table , strands ) ; Some ( RecursiveSearchFail :: NoMoreSolutions ) } else if minimums . positive >= dfn && minimums . negative >= dfn { let mut visited = FxHashSet :: default ( ) ; visited . insert ( table ) ; self . tables [ table ] . extend_strands ( strands ) ; self . delay_strands_after_cycle ( table , & mut visited ) ; None } else { self . tables [ table ] . extend_strands ( strands ) ; Some ( RecursiveSearchFail :: Cycle ( minimums ) ) } }
Invoked when all available strands for a table have
encountered a cycle.
Invoked when all available strands for a table have encountered a cycle .
&mut self
depth
StackIndex
strands
Vec<CanonicalStrand<C>>
minimums
Minimums