11static unsigned last_enqueued_unassigned_variable (
kissat *
solver) {
15 unsigned res =
solver->queue.search.idx;
16 if (values[
LIT (res)]) {
20 }
while (values[
LIT (res)]);
25 LOG (
"last enqueued unassigned %s stamp %u", LOGVAR (res), stamp);
34static unsigned largest_score_unassigned_variable (
kissat *
solver) {
36 unsigned res = kissat_max_heap (
scores);
38 while (values[
LIT (res)]) {
40 res = kissat_max_heap (
scores);
42#if defined(LOGGING) || defined(CHECK_HEAP)
43 const double score = kissat_get_heap_score (
scores, res);
45 LOG (
"largest score unassigned %s score %g", LOGVAR (res), score);
52 const double idx_score = kissat_get_heap_score (
scores, idx);
71 "continuing random decision sequence "
75 INC (random_sequences);
76 const uint64_t count =
solver->statistics_.random_sequences;
79 "starting random decision sequence "
80 "at %s conflicts for %s conflicts",
111 if (conflicts < limits->randec.conflicts)
118 unsigned idx = kissat_next_random32 (&
solver->random) %
VARS;
130 const char *
type = 0;
132 unsigned res = next_random_decision (
solver);
136 type =
"maximum score";
138 res = largest_score_unassigned_variable (
solver);
139 INC (score_decisions);
144 res = last_enqueued_unassigned_variable (
solver);
145 INC (queue_decisions);
151 INC (random_decisions);
153 LOG (
"next %s decision %s",
type, LOGVAR (res));
166 target =
solver->phases.target + idx;
174 saved =
solver->phases.saved + idx;
181 switch ((
solver->statistics_.switched >> 1) & 7) {
191 if (!res && target && (res = *target)) {
192 LOG (
"%s uses target decision phase %d", LOGVAR (idx), (
int) res);
193 INC (target_decisions);
196 if (!res && saved && (res = *saved)) {
197 LOG (
"%s uses saved decision phase %d", LOGVAR (idx), (
int) res);
198 INC (saved_decisions);
203 LOG (
"%s uses initial decision phase %d", LOGVAR (idx), (
int) res);
204 INC (initial_decisions);
208 return res < 0 ? -1 : 1;
215 INC (warming_decisions);
219 INC (stable_decisions);
221 INC (focused_decisions);
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
void kissat_assign_decision(kissat *solver, unsigned lit)
ABC_NAMESPACE_IMPL_START typedef signed char value
int kissat_decide_phase(kissat *solver, unsigned idx)
void kissat_start_random_sequence(kissat *solver)
unsigned kissat_next_decision_variable(kissat *solver)
void kissat_internal_assume(kissat *solver, unsigned lit)
void kissat_decide(kissat *solver)
type
CUBE COVER and CUBE typedefs ///.
#define all_variables(IDX)
#define UPDATE_CONFLICT_LIMIT(NAME, COUNT, SCALE_COUNT_FUNCTION, SCALE_DELTA)
#define KISSAT_assert(ignore)
#define kissat_very_verbose(...)
#define DISCONNECTED(IDX)