mirror of https://github.com/YosysHQ/abc.git
44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
//===--- act_var.h ----------------------------------------------------------===
|
|
//
|
|
// satoko: Satisfiability solver
|
|
//
|
|
// This file is distributed under the BSD 2-Clause License.
|
|
// See LICENSE for details.
|
|
//
|
|
//===------------------------------------------------------------------------===
|
|
#ifndef satoko__act_clause_h
|
|
#define satoko__act_clause_h
|
|
|
|
#include "solver.h"
|
|
#include "types.h"
|
|
|
|
#include "misc/util/abc_global.h"
|
|
ABC_NAMESPACE_HEADER_START
|
|
|
|
static inline void clause_act_rescale(solver_t *s)
|
|
{
|
|
unsigned i, cref;
|
|
struct clause *clause;
|
|
|
|
vec_uint_foreach(s->learnts, cref, i) {
|
|
clause = clause_read(s, cref);
|
|
clause->data[clause->size].act >>= 10;
|
|
}
|
|
s->clause_act_inc = stk_uint_max((s->clause_act_inc >> 10), (1 << 11));
|
|
}
|
|
|
|
static inline void clause_act_bump(solver_t *s, struct clause *clause)
|
|
{
|
|
clause->data[clause->size].act += s->clause_act_inc;
|
|
if (clause->data[clause->size].act & 0x80000000)
|
|
clause_act_rescale(s);
|
|
}
|
|
|
|
static inline void clause_act_decay(solver_t *s)
|
|
{
|
|
s->clause_act_inc += (s->clause_act_inc >> 10);
|
|
}
|
|
|
|
ABC_NAMESPACE_HEADER_END
|
|
#endif /* satoko__act_clause_h */
|