fn retain_delay_sets(
        &self,
        changed: &mut ChangedFlag,
        dl_sets: &mut DelayedLiteralSets,
    ) -> bool {
        // Temporarily swap `*sets` with `None`; thus, if we return
        // early, we either remove the answer (false) or declare it
        // unconditional (true).
        let tmp = mem::replace(dl_sets, DelayedLiteralSets::None);

        match tmp {
            // No delayed literals? Just return, no changes.
            DelayedLiteralSets::None => true,

            // There are various sets of delayed literals. Let's see
            // if we can simplify any of them.
            DelayedLiteralSets::Some(sets) => {
                let mut new_sets = HashSet::new();
                for mut set in sets {
                    let len_before = set.delayed_literals.len();

                    // If we find that some set is not satisfiable, skip it.
                    if !self.retain_delay_set(&mut set) {
                        changed.mark_changed();
                        continue;
                    }

                    // If the number of delayed literals changed, something was filtered out.
                    changed.mark_changed_if(set.delayed_literals.len() != len_before);

                    // If all delayed literals were filtered out, then
                    // the answer is unambiguously true. We can just
                    // return true -- `*dl_sets` has already been
                    // updated to `None` above.
                    if set.delayed_literals.is_empty() {
                        return true;
                    }

                    // Otherwise, remember this for later as a
                    // possible set of delayed literals.
                    new_sets.insert(set);
                }

                // If we wound up removing *all* the sets, return false.
                // Otherwise, update `*dl_sets` with the remaining sets.
                if new_sets.is_empty() {
                    false
                } else {
                    *dl_sets = DelayedLiteralSets::Some(new_sets);
                    true
                }
            }
        }
    }
/// Simplifies the delayed literal sets found in some answer.
///
/// Returns false if the answer should be removed. This occurs when some
/// delayed literal is found to be definitively not satisfied.
///
/// Otherwise, returns true and modifies `*dl_sets` in place to
/// reflect the new state.
///
/// Whatever value is returned, updates `changed` to true if any
/// changes were made.
Simplifies the delayed literal sets found in some answer.
Returns false if the answer should be removed. This occurs when some
delayed literal is found to be definitively not satisfied.

Otherwise, returns true and modifies `*dl_sets` in place to
reflect the new state.

Whatever value is returned, updates `changed` to true if any
changes were made.
Simplifies the delayed literal sets found in some answer . Returns false if the answer should be removed . This occurs when some delayed literal is found to be definitively not satisfied . Otherwise returns true and modifies ` * dl_sets ` in place to reflect the new state . Whatever value is returned updates ` changed ` to true if any changes were made .
fn retain_delay_sets(
        &self,
        changed: &mut ChangedFlag,
        dl_sets: &mut DelayedLiteralSets,
    ) -> bool {
        // Temporarily swap `*sets` with `None`; thus, if we return
        // early, we either remove the answer (false) or declare it
        // unconditional (true).
        let tmp = mem::replace(dl_sets, DelayedLiteralSets::None);
        match tmp {
            // No delayed literals? Just return, no changes.
            DelayedLiteralSets::None => true,
            // There are various sets of delayed literals. Let's see
            // if we can simplify any of them.
            DelayedLiteralSets::Some(sets) => {
                let mut new_sets = HashSet::new();
                for mut set in sets {
                    let len_before = set.delayed_literals.len();
                    // If we find that some set is not satisfiable, skip it.
                    if !self.retain_delay_set(&mut set) {
                        changed.mark_changed();
                        continue;
                    }
                    // If the number of delayed literals changed, something was filtered out.
                    changed.mark_changed_if(set.delayed_literals.len() != len_before);
                    // If all delayed literals were filtered out, then
                    // the answer is unambiguously true. We can just
                    // return true -- `*dl_sets` has already been
                    // updated to `None` above.
                    if set.delayed_literals.is_empty() {
                        return true;
                    }
                    // Otherwise, remember this for later as a
                    // possible set of delayed literals.
                    new_sets.insert(set);
                }
                // If we wound up removing *all* the sets, return false.
                // Otherwise, update `*dl_sets` with the remaining sets.
                if new_sets.is_empty() {
                    false
                } else {
                    *dl_sets = DelayedLiteralSets::Some(new_sets);
                    true
                }
            }
        }
    }
fn retain_delay_sets ( & self , changed : & mut ChangedFlag , dl_sets : & mut DelayedLiteralSets , ) -> bool { // Temporarily swap `*sets` with `None`; thus, if we return // early, we either remove the answer (false) or declare it // unconditional (true). let tmp = mem :: replace ( dl_sets , DelayedLiteralSets :: None ) ; match tmp { // No delayed literals? Just return, no changes. DelayedLiteralSets :: None => true , // There are various sets of delayed literals. Let's see // if we can simplify any of them. DelayedLiteralSets :: Some ( sets ) => { let mut new_sets = HashSet :: new ( ) ; for mut set in sets { let len_before = set . delayed_literals . len ( ) ; // If we find that some set is not satisfiable, skip it. if ! self . retain_delay_set ( & mut set ) { changed . mark_changed ( ) ; continue ; } // If the number of delayed literals changed, something was filtered out. changed . mark_changed_if ( set . delayed_literals . len ( ) != len_before ) ; // If all delayed literals were filtered out, then // the answer is unambiguously true. We can just // return true -- `*dl_sets` has already been // updated to `None` above. if set . delayed_literals . is_empty ( ) { return true ; } // Otherwise, remember this for later as a // possible set of delayed literals. new_sets . insert ( set ) ; } // If we wound up removing *all* the sets, return false. // Otherwise, update `*dl_sets` with the remaining sets. if new_sets . is_empty ( ) { false } else { * dl_sets = DelayedLiteralSets :: Some ( new_sets ) ; true } } } }
Simplifies the delayed literal sets found in some answer.
Simplifies the delayed literal sets found in some answer .
&self
changed
&mut ChangedFlag
dl_sets
&mut DelayedLiteralSets