abc/src/sat/satoko/solver.c
/* Calculate Backtrack Level from the learnt clause */
Calculate Backtrack Level from the learnt clause
Calculate Backtrack Level from the learnt clause
static inline unsigned solver_calc_bt_level(solver_t *s, vec_uint_t *learnt)
{
    unsigned i, tmp;
        unsigned i_max = 1;
    unsigned *lits = vec_uint_data(learnt);
        unsigned max = lit_dlevel(s, lits[1]);
    if (vec_uint_size(learnt) == 1)
        return 0;
    for (i = 2; i < vec_uint_size(learnt); i++) {
        if (lit_dlevel(s, lits[i]) > max) {
            max   = lit_dlevel(s, lits[i]);
            i_max = i;
        }
    }
        tmp         = lits[1];
        lits[1]     = lits[i_max];
        lits[i_max] = tmp;
        return lit_dlevel(s, lits[1]);
}
static inline unsigned solver_calc_bt_level ( solver_t * s , vec_uint_t * learnt ) { unsigned i , tmp ; unsigned i_max = 1 ; unsigned * lits = vec_uint_data ( learnt ) ; unsigned max = lit_dlevel ( s , lits [ 1 ] ) ; if ( vec_uint_size ( learnt ) == 1 ) return 0 ; for ( i = 2 ; i < vec_uint_size ( learnt ) ; i ++ ) { if ( lit_dlevel ( s , lits [ i ] ) > max ) { max = lit_dlevel ( s , lits [ i ] ) ; i_max = i ; } } tmp = lits [ 1 ] ; lits [ 1 ] = lits [ i_max ] ; lits [ i_max ] = tmp ; return lit_dlevel ( s , lits [ 1 ] ) ; }
Calculate Backtrack Level from the learnt clause
Calculate Backtrack Level from the learnt clause