diff --git a/src/solver/clause.rs b/src/solver/clause.rs index 038aaa1..8b9d40b 100644 --- a/src/solver/clause.rs +++ b/src/solver/clause.rs @@ -292,6 +292,7 @@ impl Clause { ) } + #[allow(clippy::too_many_arguments)] fn conditional_with_extra( parent_id: VariableId, requirement: Requirement, @@ -649,6 +650,7 @@ impl WatchedLiterals { /// /// The returned boolean value is true when adding the clause resulted in a /// conflict. + #[allow(clippy::too_many_arguments)] pub fn conditional_with_extra( package_id: VariableId, requirement: Requirement, diff --git a/src/solver/mod.rs b/src/solver/mod.rs index 9e2f3d8..f142fa1 100644 --- a/src/solver/mod.rs +++ b/src/solver/mod.rs @@ -35,18 +35,21 @@ mod decision_tracker; pub(crate) mod variable_map; mod watch_map; +/// The output of the `add_clauses_for_solvables` function. +type AddConditionalClauseOutput = ( + VariableId, + Option, + Option, + Requirement, + ClauseId, +); + #[derive(Default)] struct AddClauseOutput { new_requires_clauses: Vec<(VariableId, Requirement, ClauseId)>, /// A vector of tuples from a solvable variable, conditional variable and extra(feature name) variable to /// the clauses that need to be watched. - new_conditional_clauses: Vec<( - VariableId, - Option, - Option, - Requirement, - ClauseId, - )>, + new_conditional_clauses: Vec, conflicting_clauses: Vec, negative_assertions: Vec<(VariableId, ClauseId)>, clauses_to_watch: Vec, @@ -153,6 +156,7 @@ impl Clauses { } type RequirementCandidateVariables = Vec>; +type ConditionalClauseMap = (VariableId, Option, Option); /// Drives the SAT solving process. pub struct Solver { @@ -164,11 +168,8 @@ pub struct Solver { /// A map from a solvable variable, conditional variable and extra(feature name) variable to /// the clauses that need to be watched. - conditional_clauses: IndexMap< - (VariableId, Option, Option), - Vec<(Requirement, ClauseId)>, - ahash::RandomState, - >, + conditional_clauses: + IndexMap, ahash::RandomState>, watches: WatchMap, /// A mapping from requirements to the variables that represent the