summaryrefslogtreecommitdiffstats
path: root/src/sat/satoko/act_clause.h
blob: 842e340e8bc0b9cbc539e5393c0c851c3f5b8338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//===--- 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_fetch(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 */