105 int first_literal_index;
127 ClauseIndex deleted_index = ClauseIndex(std::numeric_limits<int>::max());
131 std::vector<ClauseIndex> deleted_clauses;
134 bool is_needed_for_proof =
false;
138 bool tmp_is_needed_for_proof_step =
false;
140 Clause(
int first_literal_index,
int num_literals);
143 bool IsDeleted(ClauseIndex clause_index)
const;
152 struct LiteralToAssign {
160 ClauseIndex source_clause_index;
166 explicit ClauseHash(
DratChecker* checker) : checker(checker) {}
167 std::size_t operator()(ClauseIndex clause_index)
const;
173 explicit ClauseEquiv(
DratChecker* checker) : checker(checker) {}
174 bool operator()(ClauseIndex clause_index1, ClauseIndex clause_index2)
const;
178 ClauseIndex AddClause(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_infered_clause_index_;
237 absl::flat_hash_set<ClauseIndex, ClauseHash, ClauseEquiv> clause_set_;
240 std::vector<Literal> literals_;
250 std::vector<Literal> assigned_;
253 VariablesAssignment assignment_;
267 std::vector<LiteralToAssign> high_priority_literals_to_assign_;
271 std::vector<LiteralToAssign> low_priority_literals_to_assign_;
287 std::vector<ClauseIndex> single_literal_clauses_;
291 std::vector<ClauseIndex> unit_stack_;
294 VariablesAssignment tmp_assignment_;
bool Resolve(absl::Span< const Literal > clause, absl::Span< const Literal > other_clause, Literal complementary_literal, VariablesAssignment *assignment, std::vector< Literal > *resolvent)