Exemplo n.º 1
0
inline int DPLL_add_compensation_resolvents( const int lit1, const int lit2 )
{
	int i, lit, *bImp = BIMP_START(lit2);

    	CHECK_NODE_STAMP( -lit1 );
	CHECK_BIMP_UPPERBOUND( -lit1, BinaryImp[ lit2 ][ 0 ] );

	for (i = BIMP_ELEMENTS; --i; )
	{
	    lit = *(bImp++); 
	    if( IS_FIXED(lit) ) continue;

	    if( bImp_stamps[ -lit ] == current_bImp_stamp )	
		return look_fix_binary_implications( lit1 );
#ifdef COMPENSATION_RESOLVENTS
	    if( bImp_stamps[ lit ] != current_bImp_stamp )
	    {
		CHECK_NODE_STAMP( -lit );
	      	CHECK_BIMP_BOUND  ( -lit );
		ADD_BINARY_IMPLICATIONS( lit, lit1 );
	    }
#endif
    	}
	return UNKNOWN;
}
Exemplo n.º 2
0
inline void look_add_autarky_binary_implications( const int parent, const int nrval )
{
	int i, *bImp = BIMP_START(-nrval); 

	for( i = BIMP_ELEMENTS; --i; )
	    if( *(bImp++) == parent )
		return;

	CHECK_BIMP_BOUND  ( -nrval );
	CHECK_BIMP_BOUND  ( parent );
	CHECK_NODE_STAMP( -nrval );
	CHECK_NODE_STAMP( parent );
	ADD_BINARY_IMPLICATIONS( -parent, nrval );
}
Exemplo n.º 3
0
inline int look_ternary_to_binary_implications( const int nrval )
{
        int i, lit1, lit2, *tImp = TernaryImp[ -nrval ];

        for( i = TernaryImpSize[ -nrval ]; i > 0; i-- )
        {
            lit1 = *(tImp++);
            lit2 = *(tImp++);

	    if( IS_FORCED( lit1 ) || IS_FORCED( lit2 ) ) continue;

            CHECK_NODE_STAMP( -lit1 );
            CHECK_NODE_STAMP( -lit2 );

	    CHECK_AND_ADD_BINARY_IMPLICATIONS( lit1, lit2 );
	}

	return SAT;
}
Exemplo n.º 4
0
inline void add_resolvents( const int nrval )
{
	int lit, stackSize;

        stackSize = (int) (look_resstackp - look_resstack);
#ifdef ADD_BOTH_IMPLICATIONS
        CHECK_NODE_STAMP(nrval);
        CHECK_BIMP_UPPERBOUND( nrval, stackSize );
#endif
        while( look_resstackp > look_resstack )
        {
            lit = *(--look_resstackp);

            CHECK_BIMP_BOUND( -lit );
	    CHECK_NODE_STAMP( -lit );
#ifdef ADD_BOTH_IMPLICATIONS
	    ADD_BINARY_IMPLICATION( -nrval, lit );
#endif
	    ADD_BINARY_IMPLICATION( lit, -nrval );
        }
}