src/walksat.cpp
/*******************************************************/
/* Utility Functions                                   */
/*******************************************************/
//ONLY used for checking solution
Utility Functions
ONLY used for checking solution
Utility Functions ONLY used for checking solution
uint32_t WalkSAT::countunsat()
{
    uint32_t unsat = 0;
    for (uint32_t i = 0; i < numclauses; i++) {
        bool bad = true;
        for (uint32_t j = 0; j < clsize[i]; j++) {
            Lit lit = clause[i][j];
            if (value(lit) == l_True) {
                bad = false;
                break;
            }
        }
        if (bad) {
            unsat++;
        }
    }
    return unsat;
}
uint32_t WalkSAT :: countunsat ( ) { uint32_t unsat = 0 ; for ( uint32_t i = 0 ; i < numclauses ; i ++ ) { bool bad = true ; for ( uint32_t j = 0 ; j < clsize [ i ] ; j ++ ) { Lit lit = clause [ i ] [ j ] ; if ( value ( lit ) == l_True ) { bad = false ; break ; } } if ( bad ) { unsat ++ ; } } return unsat ; }
Utility Functions
ONLY used for checking solution
Utility Functions ONLY used for checking solution