103 size_t first_literal_index;
125 ClauseIndex deleted_index = ClauseIndex(std::numeric_limits<int>::max());
129 std::vector<ClauseIndex> deleted_clauses;
132 bool is_needed_for_proof =
false;
136 bool tmp_is_needed_for_proof_step =
false;
138 Clause(
size_t first_literal_index,
int num_literals);
141 bool IsDeleted(ClauseIndex clause_index)
const;
150 struct LiteralToAssign {
158 ClauseIndex source_clause_index;
164 explicit ClauseHash(
DratChecker* checker) : checker(checker) {}
165 std::size_t operator()(ClauseIndex clause_index)
const;
171 explicit ClauseEquiv(
DratChecker* checker) : checker(checker) {}
172 bool operator()(ClauseIndex clause_index1, ClauseIndex clause_index2)
const;
178 ClauseIndex MaybeAddClause(absl::Span<const Literal> clause);
181 void RemoveLastClause();
184 absl::Span<const Literal> Literals(
const Clause& clause)
const;
190 void WatchClause(ClauseIndex clause_index);
197 bool HasRupProperty(ClauseIndex num_clauses,
198 absl::Span<const Literal> clause);
208 ClauseIndex AssignAndPropagate(ClauseIndex num_clauses, Literal literal,
209 ClauseIndex source_clause_index);
216 void MarkAsNeededForProof(Clause* clause);
221 std::vector<std::vector<Literal>> GetClausesNeededForProof(
222 ClauseIndex
begin, ClauseIndex
end)
const;
224 void LogStatistics(int64_t duration_nanos)
const;
228 ClauseIndex first_inferred_clause_index_;
231 util_intops::StrongVector<ClauseIndex, Clause> clauses_;
237 absl::flat_hash_set<ClauseIndex, ClauseHash, ClauseEquiv> clause_set_;
240 std::vector<Literal> literals_;
250 std::vector<Literal> assigned_;
253 VariablesAssignment assignment_;
258 util_intops::StrongVector<BooleanVariable, ClauseIndex> assignment_source_;
267 std::vector<LiteralToAssign> high_priority_literals_to_assign_;
271 std::vector<LiteralToAssign> low_priority_literals_to_assign_;
281 util_intops::StrongVector<LiteralIndex, std::vector<ClauseIndex>>
287 std::vector<ClauseIndex> single_literal_clauses_;
291 std::vector<ClauseIndex> unit_stack_;
294 VariablesAssignment tmp_assignment_;