ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
mode.h File Reference
#include "global.h"
Include dependency graph for mode.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mode
 

Typedefs

typedef struct mode mode
 

Functions

void kissat_init_mode_limit (struct kissat *)
 
bool kissat_switching_search_mode (struct kissat *)
 
void kissat_switch_search_mode (struct kissat *)
 

Typedef Documentation

◆ mode

typedef struct mode mode

Definition at line 9 of file mode.h.

Function Documentation

◆ kissat_init_mode_limit()

void kissat_init_mode_limit ( struct kissat * solver)

Definition at line 21 of file mode.c.

21 {
22 limits *limits = &solver->limits;
23
24 if (GET_OPTION (stable) == 1) {
25 KISSAT_assert (!solver->stable);
26
27 const uint64_t conflicts_delta = GET_OPTION (modeinit);
28 const uint64_t conflicts_limit = CONFLICTS + conflicts_delta;
29
30 KISSAT_assert (conflicts_limit);
31
32 limits->mode.conflicts = conflicts_limit;
33 limits->mode.ticks = 0;
34 limits->mode.count = 0;
35
37 "initial %s mode switching limit "
38 "at %s after %s conflicts",
39 mode_string (solver),
40 FORMAT_COUNT (conflicts_limit),
41 FORMAT_COUNT (conflicts_delta));
42
43 solver->mode.ticks = solver->statistics_.search_ticks;
44#ifndef KISSAT_QUIET
45 solver->mode.conflicts = CONFLICTS;
46#ifdef METRICS
47 solver->mode.propagations = solver->statistics_.search_propagations;
48#endif
49 // clang-format off
50 solver->mode.entered = kissat_process_time ();
52 "starting %s mode at %.2f seconds "
53 "(%" PRIu64 " conflicts, %" PRIu64 " ticks"
54#ifdef METRICS
55 ", %" PRIu64 " propagations, %" PRIu64 " visits"
56#endif
57 ")", mode_string (solver),
58 solver->mode.entered, solver->mode.conflicts, solver->mode.ticks
59#ifdef METRICS
60 , solver->mode.propagations, solver->mode.visits
61#endif
62 );
63// clang-format on
64#endif
65 } else
67 "no need to set mode limit (only %s mode enabled)",
68 mode_string (solver));
69}
#define FORMAT_COUNT(WORD)
Definition format.h:33
#define KISSAT_assert(ignore)
Definition global.h:13
#define solver
Definition kitten.c:211
#define GET_OPTION(N)
Definition options.h:295
#define kissat_very_verbose(...)
Definition print.h:52
#define CONFLICTS
Definition statistics.h:335
uint64_t count
Definition kimits.h:32
uint64_t ticks
Definition kimits.h:33
uint64_t conflicts
Definition kimits.h:27
struct limits::@174206357337173032026364064366275325046050235136 mode
Here is the caller graph for this function:

◆ kissat_switch_search_mode()

void kissat_switch_search_mode ( struct kissat * solver)

Definition at line 203 of file mode.c.

203 {
205
206 INC (switched);
207 solver->limits.mode.count++;
208
209 if (solver->stable)
210 switch_to_focused_mode (solver);
211 else
212 switch_to_stable_mode (solver);
213
214 solver->averages[solver->stable].saved_decisions = DECISIONS;
215
217}
#define INC(NAME)
void kissat_start_random_sequence(kissat *solver)
Definition decide.c:59
bool kissat_switching_search_mode(kissat *solver)
Definition mode.c:188
#define DECISIONS
Definition statistics.h:336
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kissat_switching_search_mode()

bool kissat_switching_search_mode ( struct kissat * solver)

Definition at line 188 of file mode.c.

188 {
189 KISSAT_assert (!solver->inconsistent);
190
191 if (GET_OPTION (stable) != 1)
192 return false;
193
194 limits *limits = &solver->limits;
195 statistics *statistics = &solver->statistics_;
196
197 if (limits->mode.count & 1)
198 return statistics->search_ticks >= limits->mode.ticks;
199 else
200 return statistics->conflicts >= limits->mode.conflicts;
201}
Here is the caller graph for this function: