14 #ifndef OR_TOOLS_SAT_SAT_DECISION_H_
15 #define OR_TOOLS_SAT_SAT_DECISION_H_
70 void Untrail(
int target_trail_index);
85 maybe_enable_phase_saving_ = save_phase;
106 void InitializeVariableOrdering();
109 void RescaleVariableActivities(
double scaling_factor);
113 void ResetInitialPolarity(
int from,
bool inverted =
false);
117 void RephaseIfNeeded();
118 void UseLongestAssignmentAsInitialPolarity();
119 void FlipCurrentPolarity();
120 void RandomizeCurrentPolarity();
124 void PqInsertOrUpdate(BooleanVariable
var);
127 const SatParameters& parameters_;
137 struct WeightedVarQueueElement {
139 int Index()
const {
return var.value(); }
156 bool operator<(
const WeightedVarQueueElement& other)
const {
157 return weight < other.weight ||
158 (
weight == other.weight && (tie_breaker < other.tie_breaker));
169 static_assert(
sizeof(WeightedVarQueueElement) == 16,
170 "ERROR_WeightedVarQueueElement_is_not_well_compacted");
172 bool var_ordering_is_initialized_ =
false;
173 IntegerPriorityQueue<WeightedVarQueueElement> var_ordering_;
182 struct NumConflictsStackEntry {
186 int64 num_conflicts_ = 0;
187 std::vector<NumConflictsStackEntry> num_conflicts_stack_;
195 BitQueue64 pq_need_update_for_var_at_trail_index_;
198 double variable_activity_increment_ = 1.0;
211 bool in_stable_phase_ =
false;
212 int target_length_ = 0;
220 bool maybe_enable_phase_saving_ =
true;
221 int64 polarity_phase_ = 0;
222 int64 num_conflicts_until_rephase_ = 1000;
225 std::vector<Literal> best_partial_assignment_;
234 #endif // OR_TOOLS_SAT_SAT_DECISION_H_