ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
CaDiCaL::Reluctant Class Reference

#include <reluctant.hpp>

Public Member Functions

 Reluctant ()
 
void enable (int p, int64_t l)
 
void disable ()
 
void tick ()
 
 operator bool ()
 

Detailed Description

Definition at line 28 of file reluctant.hpp.

Constructor & Destructor Documentation

◆ Reluctant()

CaDiCaL::Reluctant::Reluctant ( )
inline

Definition at line 35 of file reluctant.hpp.

35: period (0), trigger (false) {}

Member Function Documentation

◆ disable()

void CaDiCaL::Reluctant::disable ( )
inline

Definition at line 48 of file reluctant.hpp.

48{ period = 0, trigger = false; }

◆ enable()

void CaDiCaL::Reluctant::enable ( int p,
int64_t l )
inline

Definition at line 37 of file reluctant.hpp.

37 {
38 CADICAL_assert (p > 0);
39 u = v = 1;
40 period = countdown = p;
41 trigger = false;
42 if (l <= 0)
43 limited = false;
44 else
45 limited = true, limit = l;
46 };
#define CADICAL_assert(ignore)
Definition global.h:14
Cube * p
Definition exorList.c:222

◆ operator bool()

CaDiCaL::Reluctant::operator bool ( )
inline

Definition at line 76 of file reluctant.hpp.

76 {
77 if (!trigger)
78 return false;
79 trigger = false;
80 return true;
81 }

◆ tick()

void CaDiCaL::Reluctant::tick ( )
inline

Definition at line 56 of file reluctant.hpp.

56 {
57
58 if (!period)
59 return; // disabled
60 if (trigger)
61 return; // already triggered
62 if (--countdown)
63 return; // not there yet
64
65 if ((u & -u) == v)
66 u = u + 1, v = 1;
67 else
68 v = 2 * v; // (DK)
69
70 if (limited && v >= limit)
71 u = v = 1;
72 countdown = v * period;
73 trigger = true;
74 }

The documentation for this class was generated from the following file: