abc/src/aig/gia/giaCSat2.c
/**Function*************************************************************

  Synopsis    [Looking for a satisfying assignment of the node.]

  Description [Assumes that each node has flag pObj->fMark0 set to 0.
  Returns 1 if unsatisfiable, 0 if satisfiable, and -1 if undecided.
  The node may be complemented. ]
               
  SideEffects [The two procedures differ in the CEX format.]

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Looking for a satisfying assignment of the node.]

Description [Assumes that each node has flag pObj->fMark0 set to 0.
Returns 1 if unsatisfiable, 0 if satisfiable, and -1 if undecided.
The node may be complemented.

SideEffects [The two procedures differ in the CEX format.]


Function Synopsis [ Looking for a satisfying assignment of the node . ] Description [ Assumes that each node has flag pObj - > fMark0 set to 0 . Returns 1 if unsatisfiable 0 if satisfiable and - 1 if undecided . The node may be complemented . SideEffects [ The two procedures differ in the CEX format . ]
int Cbs2_ManSolve( Cbs2_Man_t * p, int iLit )
{
    int RetValue = 0;
    assert( !p->pProp.iHead && !p->pProp.iTail );
    assert( !p->pJust.iHead && !p->pJust.iTail );
    assert( p->pClauses.iHead == 1 && p->pClauses.iTail == 1 );
    p->Pars.nBTThis = p->Pars.nJustThis = p->Pars.nBTThisNc = 0;
    Cbs2_ManAssign( p, iLit, 0, 0, 0 );
    if ( !Cbs2_ManSolve_rec(p, 0) && !Cbs2_ManCheckLimits(p) )
        Cbs2_ManSaveModel( p, p->vModel );
    else
        RetValue = 1;
    Cbs2_ManCancelUntil( p, 0 );
    Cbs2_ManCleanWatch( p );
    Cbs2_ManBumpClean( p );
    p->pJust.iHead = p->pJust.iTail = 0;
    p->pClauses.iHead = p->pClauses.iTail = 1;
    p->Pars.nBTTotal += p->Pars.nBTThis;
    p->Pars.nJustTotal = Abc_MaxInt( p->Pars.nJustTotal, p->Pars.nJustThis );
    if ( Cbs2_ManCheckLimits( p ) )
        RetValue = -1;
    return RetValue;
}
int Cbs2_ManSolve ( Cbs2_Man_t * p , int iLit ) { int RetValue = 0 ; assert ( ! p -> pProp . iHead && ! p -> pProp . iTail ) ; assert ( ! p -> pJust . iHead && ! p -> pJust . iTail ) ; assert ( p -> pClauses . iHead == 1 && p -> pClauses . iTail == 1 ) ; p -> Pars . nBTThis = p -> Pars . nJustThis = p -> Pars . nBTThisNc = 0 ; Cbs2_ManAssign ( p , iLit , 0 , 0 , 0 ) ; if ( ! Cbs2_ManSolve_rec ( p , 0 ) && ! Cbs2_ManCheckLimits ( p ) ) Cbs2_ManSaveModel ( p , p -> vModel ) ; else RetValue = 1 ; Cbs2_ManCancelUntil ( p , 0 ) ; Cbs2_ManCleanWatch ( p ) ; Cbs2_ManBumpClean ( p ) ; p -> pJust . iHead = p -> pJust . iTail = 0 ; p -> pClauses . iHead = p -> pClauses . iTail = 1 ; p -> Pars . nBTTotal += p -> Pars . nBTThis ; p -> Pars . nJustTotal = Abc_MaxInt ( p -> Pars . nJustTotal , p -> Pars . nJustThis ) ; if ( Cbs2_ManCheckLimits ( p ) ) RetValue = -1 ; return RetValue ; }
Function
Synopsis    [Looking for a satisfying assignment of the node.]
Function Synopsis [ Looking for a satisfying assignment of the node . ]