src/hyperengine.cpp
/**
We can try both ways: either binary clause can be removed.
Try to remove one, then the other
Return which one is to be removed
*/
We can try both ways: either binary clause can be removed.
Try to remove one, then the other
Return which one is to be removed
We can try both ways : either binary clause can be removed . Try to remove one then the other Return which one is to be removed
Lit HyperEngine::remove_which_bin_due_to_trans_red(
    Lit conflict
    , Lit thisAncestor
    , bool thisStepRed
) {
    propStats.otfHyperTime += 1;
    const PropBy& data = varData[conflict.var()].reason;
    bool onlyIrred = !data.isRedStep();
    Lit lookingForAncestor = data.getAncestor();
    if (thisAncestor == lit_Undef || lookingForAncestor == lit_Undef)
        return lit_Undef;
    propStats.otfHyperTime += 1;
    bool second_is_deeper = false;
    bool ambivalent = true;
    if (use_depth_trick) {
        ambivalent = depth[thisAncestor.var()] == depth[lookingForAncestor.var()];
        if (depth[thisAncestor.var()] < depth[lookingForAncestor.var()]) {
            second_is_deeper = true;
        }
    }
    #ifdef DEBUG_DEPTH
    cout
    << "1st: " << std::setw(6) << thisAncestor
    << " depth: " << std::setw(4) << depth[thisAncestor.var()]
    << "  2nd: " << std::setw(6) << lookingForAncestor
    << " depth: " << std::setw(4) << depth[lookingForAncestor.var()]
    ;
    #endif
    if ((ambivalent || !second_is_deeper) &&
        is_ancestor_of(
        conflict
        , thisAncestor
        , thisStepRed
        , onlyIrred
        , lookingForAncestor
        )
    ) {
        #ifdef DEBUG_DEPTH
        cout << " -- OK" << endl;
        #endif
        return thisAncestor;
    }
    onlyIrred = !thisStepRed;
    thisStepRed = data.isRedStep();
    std::swap(lookingForAncestor, thisAncestor);
    if ((ambivalent || second_is_deeper) &&
        is_ancestor_of(
        conflict
        , thisAncestor
        , thisStepRed
        , onlyIrred
        , lookingForAncestor
        )
    ) {
        #ifdef DEBUG_DEPTH
        cout << " -- OK" << endl;
        #endif
        return thisAncestor;
    }
    #ifdef DEBUG_DEPTH
    cout << " -- NOTK" << endl;
    #endif
    return lit_Undef;
}
Lit HyperEngine :: remove_which_bin_due_to_trans_red ( Lit conflict , Lit thisAncestor , bool thisStepRed ) { propStats . otfHyperTime += 1 ; const PropBy & data = varData [ conflict . var ( ) ] . reason ; bool onlyIrred = ! data . isRedStep ( ) ; Lit lookingForAncestor = data . getAncestor ( ) ; if ( thisAncestor == lit_Undef || lookingForAncestor == lit_Undef ) return lit_Undef ; propStats . otfHyperTime += 1 ; bool second_is_deeper = false ; bool ambivalent = true ; if ( use_depth_trick ) { ambivalent = depth [ thisAncestor . var ( ) ] == depth [ lookingForAncestor . var ( ) ] ; if ( depth [ thisAncestor . var ( ) ] < depth [ lookingForAncestor . var ( ) ] ) { second_is_deeper = true ; } } #ifdef DEBUG_DEPTH cout << " " << std :: setw ( 6 ) << thisAncestor << " " << std :: setw ( 4 ) << depth [ thisAncestor . var ( ) ] << " " << std :: setw ( 6 ) << lookingForAncestor << " " << std :: setw ( 4 ) << depth [ lookingForAncestor . var ( ) ] ; #endif if ( ( ambivalent || ! second_is_deeper ) && is_ancestor_of ( conflict , thisAncestor , thisStepRed , onlyIrred , lookingForAncestor ) ) { #ifdef DEBUG_DEPTH cout << " " << endl ; #endif return thisAncestor ; } onlyIrred = ! thisStepRed ; thisStepRed = data . isRedStep ( ) ; std :: swap ( lookingForAncestor , thisAncestor ) ; if ( ( ambivalent || second_is_deeper ) && is_ancestor_of ( conflict , thisAncestor , thisStepRed , onlyIrred , lookingForAncestor ) ) { #ifdef DEBUG_DEPTH cout << " " << endl ; #endif return thisAncestor ; } #ifdef DEBUG_DEPTH cout << " " << endl ; #endif return lit_Undef ; }
We can try both ways: either binary clause can be removed.
We can try both ways : either binary clause can be removed .
//assert(ambivalent || !second_is_deeper); //assert(ambivalent || second_is_deeper);