91 absl::Span<const BooleanVariable> bool_vars);
114 bool ProbeDnf(absl::string_view name,
115 absl::Span<
const std::vector<Literal>> dnf,
DnfType type,
133 bool ProbeOneVariableInternal(BooleanVariable
b);
137 bool FixProbedDnfLiterals(
138 absl::Span<
const std::vector<Literal>> dnf,
139 const absl::btree_set<LiteralIndex>& propagated_literals,
DnfType type,
140 ClauseId dnf_clause_id, absl::Span<const Literal> dnf_clause_literals);
148 bool FixLiteralImpliedByAnAtLeastOneCombinationDnf(
149 absl::Span<
const std::vector<Literal>> conjunctions,
150 absl::Span<ClauseId> clause_ids,
Literal propagated_lit);
165 const bool drat_enabled_;
173 std::vector<Literal> to_fix_at_true_;
174 std::vector<IntegerLiteral> new_integer_bounds_;
175 std::vector<Literal> new_literals_implied_by_decision_;
176 std::vector<Literal> new_implied_or_fixed_literals_;
177 absl::btree_set<LiteralIndex> new_propagated_literals_;
178 absl::btree_set<LiteralIndex> always_propagated_literals_;
179 absl::btree_map<IntegerVariable, IntegerValue> new_propagated_bounds_;
180 absl::btree_map<IntegerVariable, IntegerValue> always_propagated_bounds_;
182 absl::flat_hash_map<std::pair<Literal, Literal>, ClauseId>
183 tmp_binary_clause_ids_;
184 std::vector<ClauseId> tmp_clause_ids_;
185 std::vector<Literal> tmp_literals_;
189 int num_decisions_ = 0;
190 int num_new_holes_ = 0;
191 int num_new_binary_ = 0;
192 int num_new_integer_bounds_ = 0;
193 int num_new_literals_fixed_ = 0;
194 int num_lrat_clauses_ = 0;
195 int num_lrat_proof_clauses_ = 0;
196 int num_unneeded_lrat_clauses_ = 0;
198 std::function<void(
Literal decision)> callback_ =
nullptr;
323 struct SavedNextLiteral {
324 LiteralIndex literal_index;
327 bool operator<(
const SavedNextLiteral& o)
const {
return rank < o.rank; }
337 bool ComputeNextDecisionInOrder(LiteralIndex& next_decision);
341 bool GetNextDecisionInNoParticularOrder(LiteralIndex& next_decision);
345 bool GetFirstDecision(LiteralIndex& next_decision);
349 bool EnqueueDecisionAndBackjumpOnConflict(LiteralIndex next_decision,
351 int& first_new_trail_index);
358 void MaybeSubsumeWithBinaryClause(
Literal last_decision,
Literal l);
362 bool ShouldExtractImplication(
Literal l);
364 bool lrat_only =
false);
370 void ExtractImplications(
Literal last_decision,
371 absl::Span<const Literal> literals);
382 void SubsumeWithBinaryClauseUsingBlockingLiteral(
Literal last_decision);
387 void AddFailedLiteralToFix(
Literal literal);
390 bool ProcessLiteralsToFix();
394 void DeleteTemporaryLratImplicationsAfterBacktrack();
404 int binary_propagator_id_;
405 int clause_propagator_id_;
408 std::vector<LiteralIndex> probing_order_;
409 int order_index_ = 0;
413 std::vector<SavedNextLiteral> queue_;
420 std::vector<Literal> to_fix_;
422 std::vector<ClauseId> to_fix_unit_id_;
424 std::vector<Literal> binary_clauses_to_extract_;
428 std::vector<bool> binary_clause_extracted_;
434 std::vector<std::pair<ClauseId, bool>> trail_implication_clauses_;
437 std::vector<ClauseId> tmp_clause_ids_;
439 std::vector<int> tmp_heap_;
440 std::vector<Literal> tmp_marked_literals_;
443 int64_t num_probed_ = 0;
444 int64_t num_explicit_fix_ = 0;
445 int64_t num_conflicts_ = 0;
446 int64_t num_new_binary_ = 0;
447 int64_t num_subsumed_ = 0;
448 int64_t num_lrat_clauses_ = 0;
449 int64_t num_lrat_proof_clauses_ = 0;