/**
@brief Helper function for detachPointerUsingClauses()
*/
CompleteDetachReatacher::ClausesStay CompleteDetachReatacher::clearWatchNotBinNotTri(
    watch_subarray ws
) {
    ClausesStay stay;

    watch_subarray::iterator i = ws.begin();
    watch_subarray::iterator j = i;
    for (watch_subarray::iterator end = ws.end(); i != end; i++) {
        if (i->isBinary()) {
            if (i->red())
                stay.redBins++;
            else
                stay.irredBins++;

            *j++ = *i;
        } else if (i->isTri()) {
            if (i->red())
                stay.redTris++;
            else
                stay.irredTris++;

            *j++ = *i;
        }
    }
    ws.shrink_(i-j);

    return stay;
}
Exemple #2
0
inline void PropEngine::updateWatch(
    watch_subarray ws
    , const vector<uint32_t>& outerToInter
) {
    for(watch_subarray::iterator
        it = ws.begin(), end = ws.end()
        ; it != end
        ; ++it
    ) {
        if (it->isBinary()) {
            it->setLit2(
                getUpdatedLit(it->lit2(), outerToInter)
            );

            continue;
        }

        if (it->isTri()) {
            Lit lit1 = it->lit2();
            Lit lit2 = it->lit3();
            lit1 = getUpdatedLit(lit1, outerToInter);
            lit2 = getUpdatedLit(lit2, outerToInter);
            if (lit1 > lit2)
                std::swap(lit1, lit2);

            it->setLit2(lit1);
            it->setLit3(lit2);

            continue;
        }

        if (it->isClause()) {
            it->setBlockedLit(
                getUpdatedLit(it->getBlockedLit(), outerToInter)
            );
        }
    }
}