abc/src/sat/msat/msatClause.c
/**Function*************************************************************

  Synopsis    [Computes reason of conflict in the given clause.]

  Description [If the literal is unassigned, finds the reason by 
  complementing literals in the given cluase (pC). If the literal is
  assigned, makes sure that this literal is the first one in the clause
  and computes the complement of all other literals in the clause.
  Returns the reason in the given array (vLits_out). If the clause is
  learned, bumps its activity.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Computes reason of conflict in the given clause.]

Description [If the literal is unassigned, finds the reason by
complementing literals in the given cluase (pC). If the literal is
assigned, makes sure that this literal is the first one in the clause
and computes the complement of all other literals in the clause.
Returns the reason in the given array (vLits_out). If the clause is
learned, bumps its activity.]




Function Synopsis [ Computes reason of conflict in the given clause . ] Description [ If the literal is unassigned finds the reason by complementing literals in the given cluase ( pC ) . If the literal is assigned makes sure that this literal is the first one in the clause and computes the complement of all other literals in the clause . Returns the reason in the given array ( vLits_out ) . If the clause is learned bumps its activity . ]
void Msat_ClauseCalcReason( Msat_Solver_t * p, Msat_Clause_t * pC, Msat_Lit_t Lit, Msat_IntVec_t * vLits_out )
{
    int i;
    Msat_IntVecClear( vLits_out );
    assert( Lit == MSAT_LIT_UNASSIGNED || Lit == pC->pData[0] );
    for ( i = (Lit != MSAT_LIT_UNASSIGNED); i < (int)pC->nSize; i++ )
    {
        assert( Msat_SolverReadAssignsArray(p)[MSAT_LIT2VAR(pC->pData[i])] == MSAT_LITNOT(pC->pData[i]) );
        Msat_IntVecPush( vLits_out, MSAT_LITNOT(pC->pData[i]) );
    }
    if ( pC->fLearned ) 
        Msat_SolverClaBumpActivity( p, pC );
}
void Msat_ClauseCalcReason ( Msat_Solver_t * p , Msat_Clause_t * pC , Msat_Lit_t Lit , Msat_IntVec_t * vLits_out ) { int i ; Msat_IntVecClear ( vLits_out ) ; assert ( Lit == MSAT_LIT_UNASSIGNED || Lit == pC -> pData [ 0 ] ) ; for ( i = ( Lit != MSAT_LIT_UNASSIGNED ) ; i < ( int ) pC -> nSize ; i ++ ) { assert ( Msat_SolverReadAssignsArray ( p ) [ MSAT_LIT2VAR ( pC -> pData [ i ] ) ] == MSAT_LITNOT ( pC -> pData [ i ] ) ) ; Msat_IntVecPush ( vLits_out , MSAT_LITNOT ( pC -> pData [ i ] ) ) ; } if ( pC -> fLearned ) Msat_SolverClaBumpActivity ( p , pC ) ; }
Function
Synopsis    [Computes reason of conflict in the given clause.]
Function Synopsis [ Computes reason of conflict in the given clause . ]
// clear the reason