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

Go to the source code of this file.

Classes

struct  reluctant
 

Typedefs

typedef typedefABC_NAMESPACE_HEADER_START struct reluctant reluctant
 

Functions

void kissat_enable_reluctant (reluctant *, uint64_t period, uint64_t limit)
 
void kissat_disable_reluctant (reluctant *)
 
void kissat_tick_reluctant (reluctant *)
 
void kissat_init_reluctant (struct kissat *)
 

Typedef Documentation

◆ reluctant

typedef typedefABC_NAMESPACE_HEADER_START struct reluctant reluctant

Definition at line 10 of file reluctant.h.

Function Documentation

◆ kissat_disable_reluctant()

void kissat_disable_reluctant ( reluctant * reluctant)

Definition at line 18 of file reluctant.c.

18 {
19 reluctant->period = 0;
20}
uint64_t period
Definition reluctant.h:15
Here is the caller graph for this function:

◆ kissat_enable_reluctant()

void kissat_enable_reluctant ( reluctant * reluctant,
uint64_t period,
uint64_t limit )

Definition at line 6 of file reluctant.c.

7 {
8 if (limit && period > limit)
9 period = limit;
10 reluctant->limited = (limit > 0);
11 reluctant->trigger = false;
12 reluctant->period = period;
13 reluctant->wait = period;
14 reluctant->u = reluctant->v = 1;
15 reluctant->limit = limit;
16}
uint64_t u
Definition reluctant.h:17
uint64_t wait
Definition reluctant.h:16
bool trigger
Definition reluctant.h:14
uint64_t limit
Definition reluctant.h:18
uint64_t v
Definition reluctant.h:17
bool limited
Definition reluctant.h:13
Here is the caller graph for this function:

◆ kissat_init_reluctant()

void kissat_init_reluctant ( struct kissat * solver)

Definition at line 59 of file reluctant.c.

59 {
60 if (GET_OPTION (reluctant)) {
61 LOG ("enable reluctant doubling with period %d limit %d",
62 GET_OPTION (reluctantint), GET_OPTION (reluctantlim));
63 kissat_enable_reluctant (&solver->reluctant, GET_OPTION (reluctantint),
64 GET_OPTION (reluctantlim));
65 } else {
66 LOG ("reluctant doubling disabled and thus no stable restarts");
67 kissat_disable_reluctant (&solver->reluctant);
68 }
69}
#define LOG(...)
#define solver
Definition kitten.c:211
#define GET_OPTION(N)
Definition options.h:295
ABC_NAMESPACE_IMPL_START void kissat_enable_reluctant(reluctant *reluctant, uint64_t period, uint64_t limit)
Definition reluctant.c:6
void kissat_disable_reluctant(reluctant *reluctant)
Definition reluctant.c:18
Here is the call graph for this function:

◆ kissat_tick_reluctant()

void kissat_tick_reluctant ( reluctant * reluctant)

Definition at line 22 of file reluctant.c.

22 {
23 if (!reluctant->period)
24 return;
25
26 if (reluctant->trigger)
27 return;
28
30 if (--reluctant->wait)
31 return;
32
33 uint64_t u = reluctant->u;
34 uint64_t v = reluctant->v;
35
36 if ((u & -u) == v) {
37 u++;
38 v = 1;
39 } else {
40 KISSAT_assert (UINT64_MAX / 2 >= v);
41 v *= 2;
42 }
43
44 KISSAT_assert (v);
45 KISSAT_assert (UINT64_MAX / v >= reluctant->period);
46 uint64_t wait = v * reluctant->period;
47
48 if (reluctant->limited && wait > reluctant->limit) {
49 u = v = 1;
50 wait = reluctant->period;
51 }
52
53 reluctant->trigger = true;
54 reluctant->wait = wait;
55 reluctant->u = u;
56 reluctant->v = v;
57}
#define KISSAT_assert(ignore)
Definition global.h:13
Here is the caller graph for this function: