abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
giaCSat.c File Reference
#include "gia.h"

Go to the source code of this file.

Data Structures

struct  Cbs_Par_t_
 
struct  Cbs_Que_t_
 
struct  Cbs_Man_t_
 

Macros

#define Cbs_QueForEachEntry(Que, pObj, i)   for ( i = (Que).iHead; (i < (Que).iTail) && ((pObj) = (Que).pData[i]); i++ )
 
#define Cbs_ClauseForEachVar(p, hClause, pObj)   for ( (p)->pIter = (p)->pClauses.pData + hClause; (pObj = *pIter); (p)->pIter++ )
 
#define Cbs_ClauseForEachVar1(p, hClause, pObj)   for ( (p)->pIter = (p)->pClauses.pData+hClause+1; (pObj = *pIter); (p)->pIter++ )
 

Typedefs

typedef
typedefABC_NAMESPACE_IMPL_START
struct Cbs_Par_t_ 
Cbs_Par_t
 DECLARATIONS ///. More...
 
typedef struct Cbs_Que_t_ Cbs_Que_t
 
typedef struct Cbs_Man_t_ Cbs_Man_t
 

Functions

static int Cbs_VarIsAssigned (Gia_Obj_t *pVar)
 
static void Cbs_VarAssign (Gia_Obj_t *pVar)
 
static void Cbs_VarUnassign (Gia_Obj_t *pVar)
 
static int Cbs_VarValue (Gia_Obj_t *pVar)
 
static void Cbs_VarSetValue (Gia_Obj_t *pVar, int v)
 
static int Cbs_VarIsJust (Gia_Obj_t *pVar)
 
static int Cbs_VarFanin0Value (Gia_Obj_t *pVar)
 
static int Cbs_VarFanin1Value (Gia_Obj_t *pVar)
 
static int Cbs_VarDecLevel (Cbs_Man_t *p, Gia_Obj_t *pVar)
 
static Gia_Obj_tCbs_VarReason0 (Cbs_Man_t *p, Gia_Obj_t *pVar)
 
static Gia_Obj_tCbs_VarReason1 (Cbs_Man_t *p, Gia_Obj_t *pVar)
 
static int Cbs_ClauseDecLevel (Cbs_Man_t *p, int hClause)
 
void Cbs_SetDefaultParams (Cbs_Par_t *pPars)
 FUNCTION DEFINITIONS ///. More...
 
Cbs_Man_tCbs_ManAlloc ()
 
void Cbs_ManStop (Cbs_Man_t *p)
 
Vec_Int_tCbs_ReadModel (Cbs_Man_t *p)
 
static int Cbs_ManCheckLimits (Cbs_Man_t *p)
 
static void Cbs_ManSaveModel (Cbs_Man_t *p, Vec_Int_t *vCex)
 
static int Cbs_QueIsEmpty (Cbs_Que_t *p)
 
static void Cbs_QuePush (Cbs_Que_t *p, Gia_Obj_t *pObj)
 
static int Cbs_QueHasNode (Cbs_Que_t *p, Gia_Obj_t *pObj)
 
static void Cbs_QueStore (Cbs_Que_t *p, int *piHeadOld, int *piTailOld)
 
static void Cbs_QueRestore (Cbs_Que_t *p, int iHeadOld, int iTailOld)
 
static int Cbs_QueFinish (Cbs_Que_t *p)
 
static int Cbs_VarFaninFanoutMax (Cbs_Man_t *p, Gia_Obj_t *pObj)
 
static Gia_Obj_tCbs_ManDecideHighest (Cbs_Man_t *p)
 
static Gia_Obj_tCbs_ManDecideLowest (Cbs_Man_t *p)
 
static Gia_Obj_tCbs_ManDecideMaxFF (Cbs_Man_t *p)
 
static void Cbs_ManCancelUntil (Cbs_Man_t *p, int iBound)
 
static void Cbs_ManAssign (Cbs_Man_t *p, Gia_Obj_t *pObj, int Level, Gia_Obj_t *pRes0, Gia_Obj_t *pRes1)
 
static int Cbs_ManClauseSize (Cbs_Man_t *p, int hClause)
 
static void Cbs_ManPrintClause (Cbs_Man_t *p, int Level, int hClause)
 
static void Cbs_ManPrintClauseNew (Cbs_Man_t *p, int Level, int hClause)
 
static void Cbs_ManDeriveReason (Cbs_Man_t *p, int Level)
 
static int Cbs_ManAnalyze (Cbs_Man_t *p, int Level, Gia_Obj_t *pVar, Gia_Obj_t *pFan0, Gia_Obj_t *pFan1)
 
static int Cbs_ManResolve (Cbs_Man_t *p, int Level, int hClause0, int hClause1)
 
static int Cbs_ManPropagateOne (Cbs_Man_t *p, Gia_Obj_t *pVar, int Level)
 
static int Cbs_ManPropagateTwo (Cbs_Man_t *p, Gia_Obj_t *pVar, int Level)
 
int Cbs_ManPropagate (Cbs_Man_t *p, int Level)
 
int Cbs_ManSolve_rec (Cbs_Man_t *p, int Level)
 
int Cbs_ManSolve (Cbs_Man_t *p, Gia_Obj_t *pObj)
 
void Cbs_ManSatPrintStats (Cbs_Man_t *p)
 
Vec_Int_tCbs_ManSolveMiterNc (Gia_Man_t *pAig, int nConfs, Vec_Str_t **pvStatus, int fVerbose)
 

Variables

int s_Counter = 0
 

Macro Definition Documentation

#define Cbs_ClauseForEachVar (   p,
  hClause,
  pObj 
)    for ( (p)->pIter = (p)->pClauses.pData + hClause; (pObj = *pIter); (p)->pIter++ )

Definition at line 107 of file giaCSat.c.

#define Cbs_ClauseForEachVar1 (   p,
  hClause,
  pObj 
)    for ( (p)->pIter = (p)->pClauses.pData+hClause+1; (pObj = *pIter); (p)->pIter++ )

Definition at line 109 of file giaCSat.c.

#define Cbs_QueForEachEntry (   Que,
  pObj,
 
)    for ( i = (Que).iHead; (i < (Que).iTail) && ((pObj) = (Que).pData[i]); i++ )

Definition at line 104 of file giaCSat.c.

Typedef Documentation

typedef struct Cbs_Man_t_ Cbs_Man_t

Definition at line 62 of file giaCSat.c.

typedef typedefABC_NAMESPACE_IMPL_START struct Cbs_Par_t_ Cbs_Par_t

DECLARATIONS ///.

CFile****************************************************************

FileName [giaCSat.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Scalable AIG package.]

Synopsis [A simple circuit-based solver.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
giaCSat.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]

Definition at line 33 of file giaCSat.c.

typedef struct Cbs_Que_t_ Cbs_Que_t

Definition at line 53 of file giaCSat.c.

Function Documentation

static int Cbs_ClauseDecLevel ( Cbs_Man_t p,
int  hClause 
)
inlinestatic

Definition at line 102 of file giaCSat.c.

102 { return Cbs_VarDecLevel( p, p->pClauses.pData[hClause] ); }
Gia_Obj_t ** pData
Definition: giaCSat.c:59
Cbs_Que_t pClauses
Definition: giaCSat.c:69
static int Cbs_VarDecLevel(Cbs_Man_t *p, Gia_Obj_t *pVar)
Definition: giaCSat.c:99
Cbs_Man_t* Cbs_ManAlloc ( )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 149 of file giaCSat.c.

150 {
151  Cbs_Man_t * p;
152  p = ABC_CALLOC( Cbs_Man_t, 1 );
153  p->pProp.nSize = p->pJust.nSize = p->pClauses.nSize = 10000;
154  p->pProp.pData = ABC_ALLOC( Gia_Obj_t *, p->pProp.nSize );
155  p->pJust.pData = ABC_ALLOC( Gia_Obj_t *, p->pJust.nSize );
157  p->pClauses.iHead = p->pClauses.iTail = 1;
158  p->vModel = Vec_IntAlloc( 1000 );
159  p->vLevReas = Vec_IntAlloc( 1000 );
160  p->vTemp = Vec_PtrAlloc( 1000 );
161  Cbs_SetDefaultParams( &p->Pars );
162  return p;
163 }
Gia_Obj_t ** pData
Definition: giaCSat.c:59
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int nSize
Definition: giaCSat.c:58
Cbs_Que_t pClauses
Definition: giaCSat.c:69
Vec_Ptr_t * vTemp
Definition: giaCSat.c:73
Vec_Int_t * vModel
Definition: giaCSat.c:72
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
Cbs_Que_t pJust
Definition: giaCSat.c:68
Cbs_Que_t pProp
Definition: giaCSat.c:67
Definition: gia.h:75
Vec_Int_t * vLevReas
Definition: giaCSat.c:71
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
int iHead
Definition: giaCSat.c:56
Cbs_Par_t Pars
Definition: giaCSat.c:65
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
void Cbs_SetDefaultParams(Cbs_Par_t *pPars)
FUNCTION DEFINITIONS ///.
Definition: giaCSat.c:127
int iTail
Definition: giaCSat.c:57
static int Cbs_ManAnalyze ( Cbs_Man_t p,
int  Level,
Gia_Obj_t pVar,
Gia_Obj_t pFan0,
Gia_Obj_t pFan1 
)
inlinestatic

Function*************************************************************

Synopsis [Returns conflict clause.]

Description [Performs conflict analysis.]

SideEffects []

SeeAlso []

Definition at line 649 of file giaCSat.c.

650 {
651  Cbs_Que_t * pQue = &(p->pClauses);
652  assert( Cbs_VarIsAssigned(pVar) );
653  assert( Cbs_VarIsAssigned(pFan0) );
654  assert( pFan1 == NULL || Cbs_VarIsAssigned(pFan1) );
655  assert( Cbs_QueIsEmpty( pQue ) );
656  Cbs_QuePush( pQue, NULL );
657  Cbs_QuePush( pQue, pVar );
658  Cbs_QuePush( pQue, pFan0 );
659  if ( pFan1 )
660  Cbs_QuePush( pQue, pFan1 );
661  Cbs_ManDeriveReason( p, Level );
662  return Cbs_QueFinish( pQue );
663 }
static int Cbs_VarIsAssigned(Gia_Obj_t *pVar)
Definition: giaCSat.c:90
Cbs_Que_t pClauses
Definition: giaCSat.c:69
static void Cbs_ManDeriveReason(Cbs_Man_t *p, int Level)
Definition: giaCSat.c:587
static int Cbs_QueIsEmpty(Cbs_Que_t *p)
Definition: giaCSat.c:256
static void Cbs_QuePush(Cbs_Que_t *p, Gia_Obj_t *pObj)
Definition: giaCSat.c:272
#define assert(ex)
Definition: util_old.h:213
static int Cbs_QueFinish(Cbs_Que_t *p)
Definition: giaCSat.c:352
static void Cbs_ManAssign ( Cbs_Man_t p,
Gia_Obj_t pObj,
int  Level,
Gia_Obj_t pRes0,
Gia_Obj_t pRes1 
)
inlinestatic

Function*************************************************************

Synopsis [Assigns the variables a value.]

Description [Returns 1 if conflict; 0 if no conflict.]

SideEffects []

SeeAlso []

Definition at line 492 of file giaCSat.c.

493 {
494  Gia_Obj_t * pObjR = Gia_Regular(pObj);
495  assert( Gia_ObjIsCand(pObjR) );
496  assert( !Cbs_VarIsAssigned(pObjR) );
497  Cbs_VarAssign( pObjR );
498  Cbs_VarSetValue( pObjR, !Gia_IsComplement(pObj) );
499  assert( pObjR->Value == ~0 );
500  pObjR->Value = p->pProp.iTail;
501  Cbs_QuePush( &p->pProp, pObjR );
502  Vec_IntPush( p->vLevReas, Level );
503  Vec_IntPush( p->vLevReas, pRes0 ? pRes0-pObjR : 0 );
504  Vec_IntPush( p->vLevReas, pRes1 ? pRes1-pObjR : 0 );
505  assert( Vec_IntSize(p->vLevReas) == 3 * p->pProp.iTail );
506 // s_Counter++;
507 // s_Counter = Abc_MaxIntInt( s_Counter, Vec_IntSize(p->vLevReas)/3 );
508 }
static int Cbs_VarIsAssigned(Gia_Obj_t *pVar)
Definition: giaCSat.c:90
static Gia_Obj_t * Gia_Regular(Gia_Obj_t *p)
Definition: gia.h:377
static int Gia_ObjIsCand(Gia_Obj_t *pObj)
Definition: gia.h:429
static void Cbs_VarAssign(Gia_Obj_t *pVar)
Definition: giaCSat.c:91
Cbs_Que_t pProp
Definition: giaCSat.c:67
Definition: gia.h:75
Vec_Int_t * vLevReas
Definition: giaCSat.c:71
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static void Cbs_VarSetValue(Gia_Obj_t *pVar, int v)
Definition: giaCSat.c:94
static void Cbs_QuePush(Cbs_Que_t *p, Gia_Obj_t *pObj)
Definition: giaCSat.c:272
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static int Gia_IsComplement(Gia_Obj_t *p)
Definition: gia.h:380
#define assert(ex)
Definition: util_old.h:213
int iTail
Definition: giaCSat.c:57
unsigned Value
Definition: gia.h:87
static void Cbs_ManCancelUntil ( Cbs_Man_t p,
int  iBound 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 467 of file giaCSat.c.

468 {
469  Gia_Obj_t * pVar;
470  int i;
471  assert( iBound <= p->pProp.iTail );
472  p->pProp.iHead = iBound;
473  Cbs_QueForEachEntry( p->pProp, pVar, i )
474  Cbs_VarUnassign( pVar );
475  p->pProp.iTail = iBound;
476  Vec_IntShrink( p->vLevReas, 3*iBound );
477 }
Cbs_Que_t pProp
Definition: giaCSat.c:67
Definition: gia.h:75
int iHead
Definition: giaCSat.c:56
static void Cbs_VarUnassign(Gia_Obj_t *pVar)
Definition: giaCSat.c:92
#define Cbs_QueForEachEntry(Que, pObj, i)
Definition: giaCSat.c:104
static void Vec_IntShrink(Vec_Int_t *p, int nSizeNew)
Definition: bblif.c:435
#define assert(ex)
Definition: util_old.h:213
static int Cbs_ManCheckLimits ( Cbs_Man_t p)
inlinestatic

Function*************************************************************

Synopsis [Returns 1 if the solver is out of limits.]

Description []

SideEffects []

SeeAlso []

Definition at line 217 of file giaCSat.c.

218 {
219  return p->Pars.nJustThis > p->Pars.nJustLimit || p->Pars.nBTThis > p->Pars.nBTLimit;
220 }
Cbs_Par_t Pars
Definition: giaCSat.c:65
static int Cbs_ManClauseSize ( Cbs_Man_t p,
int  hClause 
)
inlinestatic

Function*************************************************************

Synopsis [Returns clause size.]

Description []

SideEffects []

SeeAlso []

Definition at line 522 of file giaCSat.c.

523 {
524  Cbs_Que_t * pQue = &(p->pClauses);
525  Gia_Obj_t ** pIter;
526  for ( pIter = pQue->pData + hClause; *pIter; pIter++ );
527  return pIter - pQue->pData - hClause ;
528 }
Gia_Obj_t ** pData
Definition: giaCSat.c:59
Cbs_Que_t pClauses
Definition: giaCSat.c:69
Definition: gia.h:75
static Gia_Obj_t* Cbs_ManDecideHighest ( Cbs_Man_t p)
inlinestatic

Function*************************************************************

Synopsis [Find variable with the highest ID.]

Description []

SideEffects []

SeeAlso []

Definition at line 394 of file giaCSat.c.

395 {
396  Gia_Obj_t * pObj, * pObjMax = NULL;
397  int i;
398  Cbs_QueForEachEntry( p->pJust, pObj, i )
399  if ( pObjMax == NULL || pObjMax < pObj )
400  pObjMax = pObj;
401  return pObjMax;
402 }
Cbs_Que_t pJust
Definition: giaCSat.c:68
Definition: gia.h:75
if(last==0)
Definition: sparse_int.h:34
#define Cbs_QueForEachEntry(Que, pObj, i)
Definition: giaCSat.c:104
static Gia_Obj_t* Cbs_ManDecideLowest ( Cbs_Man_t p)
inlinestatic

Function*************************************************************

Synopsis [Find variable with the lowest ID.]

Description []

SideEffects []

SeeAlso []

Definition at line 415 of file giaCSat.c.

416 {
417  Gia_Obj_t * pObj, * pObjMin = NULL;
418  int i;
419  Cbs_QueForEachEntry( p->pJust, pObj, i )
420  if ( pObjMin == NULL || pObjMin > pObj )
421  pObjMin = pObj;
422  return pObjMin;
423 }
Cbs_Que_t pJust
Definition: giaCSat.c:68
Definition: gia.h:75
if(last==0)
Definition: sparse_int.h:34
#define Cbs_QueForEachEntry(Que, pObj, i)
Definition: giaCSat.c:104
static Gia_Obj_t* Cbs_ManDecideMaxFF ( Cbs_Man_t p)
inlinestatic

Function*************************************************************

Synopsis [Find variable with the maximum number of fanin fanouts.]

Description []

SideEffects []

SeeAlso []

Definition at line 436 of file giaCSat.c.

437 {
438  Gia_Obj_t * pObj, * pObjMax = NULL;
439  int i, iMaxFF = 0, iCurFF;
440  assert( p->pAig->pRefs != NULL );
441  Cbs_QueForEachEntry( p->pJust, pObj, i )
442  {
443  iCurFF = Cbs_VarFaninFanoutMax( p, pObj );
444  assert( iCurFF > 0 );
445  if ( iMaxFF < iCurFF )
446  {
447  iMaxFF = iCurFF;
448  pObjMax = pObj;
449  }
450  }
451  return pObjMax;
452 }
Gia_Man_t * pAig
Definition: giaCSat.c:66
Cbs_Que_t pJust
Definition: giaCSat.c:68
int * pRefs
Definition: gia.h:114
Definition: gia.h:75
static int Cbs_VarFaninFanoutMax(Cbs_Man_t *p, Gia_Obj_t *pObj)
Definition: giaCSat.c:373
#define Cbs_QueForEachEntry(Que, pObj, i)
Definition: giaCSat.c:104
#define assert(ex)
Definition: util_old.h:213
static void Cbs_ManDeriveReason ( Cbs_Man_t p,
int  Level 
)
inlinestatic

Function*************************************************************

Synopsis [Returns conflict clause.]

Description [Performs conflict analysis.]

SideEffects []

SeeAlso []

Definition at line 587 of file giaCSat.c.

588 {
589  Cbs_Que_t * pQue = &(p->pClauses);
590  Gia_Obj_t * pObj, * pReason;
591  int i, k, iLitLevel;
592  assert( pQue->pData[pQue->iHead] == NULL );
593  assert( pQue->iHead + 1 < pQue->iTail );
594 /*
595  for ( i = pQue->iHead + 1; i < pQue->iTail; i++ )
596  {
597  pObj = pQue->pData[i];
598  assert( pObj->fMark0 == 1 );
599  }
600 */
601  // compact literals
602  Vec_PtrClear( p->vTemp );
603  for ( i = k = pQue->iHead + 1; i < pQue->iTail; i++ )
604  {
605  pObj = pQue->pData[i];
606  if ( !pObj->fMark0 ) // unassigned - seen again
607  continue;
608  // assigned - seen first time
609  pObj->fMark0 = 0;
610  Vec_PtrPush( p->vTemp, pObj );
611  // check decision level
612  iLitLevel = Cbs_VarDecLevel( p, pObj );
613  if ( iLitLevel < Level )
614  {
615  pQue->pData[k++] = pObj;
616  continue;
617  }
618  assert( iLitLevel == Level );
619  pReason = Cbs_VarReason0( p, pObj );
620  if ( pReason == pObj ) // no reason
621  {
622  assert( pQue->pData[pQue->iHead] == NULL );
623  pQue->pData[pQue->iHead] = pObj;
624  continue;
625  }
626  Cbs_QuePush( pQue, pReason );
627  pReason = Cbs_VarReason1( p, pObj );
628  if ( pReason != pObj ) // second reason
629  Cbs_QuePush( pQue, pReason );
630  }
631  assert( pQue->pData[pQue->iHead] != NULL );
632  pQue->iTail = k;
633  // clear the marks
634  Vec_PtrForEachEntry( Gia_Obj_t *, p->vTemp, pObj, i )
635  pObj->fMark0 = 1;
636 }
Gia_Obj_t ** pData
Definition: giaCSat.c:59
Cbs_Que_t pClauses
Definition: giaCSat.c:69
Vec_Ptr_t * vTemp
Definition: giaCSat.c:73
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static Gia_Obj_t * Cbs_VarReason1(Cbs_Man_t *p, Gia_Obj_t *pVar)
Definition: giaCSat.c:101
Definition: gia.h:75
int iHead
Definition: giaCSat.c:56
static Gia_Obj_t * Cbs_VarReason0(Cbs_Man_t *p, Gia_Obj_t *pVar)
Definition: giaCSat.c:100
static void Cbs_QuePush(Cbs_Que_t *p, Gia_Obj_t *pObj)
Definition: giaCSat.c:272
unsigned fMark0
Definition: gia.h:79
#define assert(ex)
Definition: util_old.h:213
static void Vec_PtrClear(Vec_Ptr_t *p)
Definition: vecPtr.h:545
int iTail
Definition: giaCSat.c:57
static int Cbs_VarDecLevel(Cbs_Man_t *p, Gia_Obj_t *pVar)
Definition: giaCSat.c:99
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static void Cbs_ManPrintClause ( Cbs_Man_t p,
int  Level,
int  hClause 
)
inlinestatic

Function*************************************************************

Synopsis [Prints conflict clause.]

Description []

SideEffects []

SeeAlso []

Definition at line 541 of file giaCSat.c.

542 {
543  Cbs_Que_t * pQue = &(p->pClauses);
544  Gia_Obj_t * pObj;
545  int i;
546  assert( Cbs_QueIsEmpty( pQue ) );
547  printf( "Level %2d : ", Level );
548  for ( i = hClause; (pObj = pQue->pData[i]); i++ )
549  printf( "%d=%d(%d) ", Gia_ObjId(p->pAig, pObj), Cbs_VarValue(pObj), Cbs_VarDecLevel(p, pObj) );
550  printf( "\n" );
551 }
Gia_Obj_t ** pData
Definition: giaCSat.c:59
Gia_Man_t * pAig
Definition: giaCSat.c:66
Cbs_Que_t pClauses
Definition: giaCSat.c:69
Definition: gia.h:75
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
static int Cbs_QueIsEmpty(Cbs_Que_t *p)
Definition: giaCSat.c:256
static int Cbs_VarValue(Gia_Obj_t *pVar)
Definition: giaCSat.c:93
#define assert(ex)
Definition: util_old.h:213
static int Cbs_VarDecLevel(Cbs_Man_t *p, Gia_Obj_t *pVar)
Definition: giaCSat.c:99
static void Cbs_ManPrintClauseNew ( Cbs_Man_t p,
int  Level,
int  hClause 
)
inlinestatic

Function*************************************************************

Synopsis [Prints conflict clause.]

Description []

SideEffects []

SeeAlso []

Definition at line 564 of file giaCSat.c.

565 {
566  Cbs_Que_t * pQue = &(p->pClauses);
567  Gia_Obj_t * pObj;
568  int i;
569  assert( Cbs_QueIsEmpty( pQue ) );
570  printf( "Level %2d : ", Level );
571  for ( i = hClause; (pObj = pQue->pData[i]); i++ )
572  printf( "%c%d ", Cbs_VarValue(pObj)? '+':'-', Gia_ObjId(p->pAig, pObj) );
573  printf( "\n" );
574 }
Gia_Obj_t ** pData
Definition: giaCSat.c:59
Gia_Man_t * pAig
Definition: giaCSat.c:66
Cbs_Que_t pClauses
Definition: giaCSat.c:69
Definition: gia.h:75
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
static int Cbs_QueIsEmpty(Cbs_Que_t *p)
Definition: giaCSat.c:256
static int Cbs_VarValue(Gia_Obj_t *pVar)
Definition: giaCSat.c:93
#define assert(ex)
Definition: util_old.h:213
int Cbs_ManPropagate ( Cbs_Man_t p,
int  Level 
)

Function*************************************************************

Synopsis [Propagates all variables.]

Description [Returns 1 if conflict; 0 if no conflict.]

SideEffects []

SeeAlso []

Definition at line 821 of file giaCSat.c.

822 {
823  int hClause;
824  Gia_Obj_t * pVar;
825  int i, k;
826  while ( 1 )
827  {
828  Cbs_QueForEachEntry( p->pProp, pVar, i )
829  {
830  if ( (hClause = Cbs_ManPropagateOne( p, pVar, Level )) )
831  return hClause;
832  }
833  p->pProp.iHead = p->pProp.iTail;
834  k = p->pJust.iHead;
835  Cbs_QueForEachEntry( p->pJust, pVar, i )
836  {
837  if ( Cbs_VarIsJust( pVar ) )
838  p->pJust.pData[k++] = pVar;
839  else if ( (hClause = Cbs_ManPropagateTwo( p, pVar, Level )) )
840  return hClause;
841  }
842  if ( k == p->pJust.iTail )
843  break;
844  p->pJust.iTail = k;
845  }
846  return 0;
847 }
Gia_Obj_t ** pData
Definition: giaCSat.c:59
static int Cbs_ManPropagateTwo(Cbs_Man_t *p, Gia_Obj_t *pVar, int Level)
Definition: giaCSat.c:788
Cbs_Que_t pJust
Definition: giaCSat.c:68
Cbs_Que_t pProp
Definition: giaCSat.c:67
static int Cbs_VarIsJust(Gia_Obj_t *pVar)
Definition: giaCSat.c:95
Definition: gia.h:75
int iHead
Definition: giaCSat.c:56
static int Cbs_ManPropagateOne(Cbs_Man_t *p, Gia_Obj_t *pVar, int Level)
Definition: giaCSat.c:731
#define Cbs_QueForEachEntry(Que, pObj, i)
Definition: giaCSat.c:104
int iTail
Definition: giaCSat.c:57
static int Cbs_ManPropagateOne ( Cbs_Man_t p,
Gia_Obj_t pVar,
int  Level 
)
inlinestatic

Function*************************************************************

Synopsis [Propagates a variable.]

Description [Returns clause handle if conflict; 0 if no conflict.]

SideEffects []

SeeAlso []

Definition at line 731 of file giaCSat.c.

732 {
733  int Value0, Value1;
734  assert( !Gia_IsComplement(pVar) );
735  assert( Cbs_VarIsAssigned(pVar) );
736  if ( Gia_ObjIsCi(pVar) )
737  return 0;
738  assert( Gia_ObjIsAnd(pVar) );
739  Value0 = Cbs_VarFanin0Value(pVar);
740  Value1 = Cbs_VarFanin1Value(pVar);
741  if ( Cbs_VarValue(pVar) )
742  { // value is 1
743  if ( Value0 == 0 || Value1 == 0 ) // one is 0
744  {
745  if ( Value0 == 0 && Value1 != 0 )
746  return Cbs_ManAnalyze( p, Level, pVar, Gia_ObjFanin0(pVar), NULL );
747  if ( Value0 != 0 && Value1 == 0 )
748  return Cbs_ManAnalyze( p, Level, pVar, Gia_ObjFanin1(pVar), NULL );
749  assert( Value0 == 0 && Value1 == 0 );
750  return Cbs_ManAnalyze( p, Level, pVar, Gia_ObjFanin0(pVar), Gia_ObjFanin1(pVar) );
751  }
752  if ( Value0 == 2 ) // first is unassigned
753  Cbs_ManAssign( p, Gia_ObjChild0(pVar), Level, pVar, NULL );
754  if ( Value1 == 2 ) // first is unassigned
755  Cbs_ManAssign( p, Gia_ObjChild1(pVar), Level, pVar, NULL );
756  return 0;
757  }
758  // value is 0
759  if ( Value0 == 0 || Value1 == 0 ) // one is 0
760  return 0;
761  if ( Value0 == 1 && Value1 == 1 ) // both are 1
762  return Cbs_ManAnalyze( p, Level, pVar, Gia_ObjFanin0(pVar), Gia_ObjFanin1(pVar) );
763  if ( Value0 == 1 || Value1 == 1 ) // one is 1
764  {
765  if ( Value0 == 2 ) // first is unassigned
766  Cbs_ManAssign( p, Gia_Not(Gia_ObjChild0(pVar)), Level, pVar, Gia_ObjFanin1(pVar) );
767  if ( Value1 == 2 ) // second is unassigned
768  Cbs_ManAssign( p, Gia_Not(Gia_ObjChild1(pVar)), Level, pVar, Gia_ObjFanin0(pVar) );
769  return 0;
770  }
771  assert( Cbs_VarIsJust(pVar) );
772  assert( !Cbs_QueHasNode( &p->pJust, pVar ) );
773  Cbs_QuePush( &p->pJust, pVar );
774  return 0;
775 }
static Gia_Obj_t * Gia_ObjChild0(Gia_Obj_t *pObj)
Definition: gia.h:457
static int Cbs_VarFanin0Value(Gia_Obj_t *pVar)
Definition: giaCSat.c:96
static int Cbs_VarIsAssigned(Gia_Obj_t *pVar)
Definition: giaCSat.c:90
Cbs_Que_t pJust
Definition: giaCSat.c:68
static int Cbs_VarIsJust(Gia_Obj_t *pVar)
Definition: giaCSat.c:95
static Gia_Obj_t * Gia_ObjChild1(Gia_Obj_t *pObj)
Definition: gia.h:458
static Gia_Obj_t * Gia_Not(Gia_Obj_t *p)
Definition: gia.h:378
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
static void Cbs_ManAssign(Cbs_Man_t *p, Gia_Obj_t *pObj, int Level, Gia_Obj_t *pRes0, Gia_Obj_t *pRes1)
Definition: giaCSat.c:492
static int Cbs_QueHasNode(Cbs_Que_t *p, Gia_Obj_t *pObj)
Definition: giaCSat.c:293
static int Cbs_VarFanin1Value(Gia_Obj_t *pVar)
Definition: giaCSat.c:97
static void Cbs_QuePush(Cbs_Que_t *p, Gia_Obj_t *pObj)
Definition: giaCSat.c:272
static int Cbs_VarValue(Gia_Obj_t *pVar)
Definition: giaCSat.c:93
static int Gia_IsComplement(Gia_Obj_t *p)
Definition: gia.h:380
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
#define assert(ex)
Definition: util_old.h:213
static int Cbs_ManAnalyze(Cbs_Man_t *p, int Level, Gia_Obj_t *pVar, Gia_Obj_t *pFan0, Gia_Obj_t *pFan1)
Definition: giaCSat.c:649
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Definition: gia.h:420
static int Cbs_ManPropagateTwo ( Cbs_Man_t p,
Gia_Obj_t pVar,
int  Level 
)
inlinestatic

Function*************************************************************

Synopsis [Propagates a variable.]

Description [Returns 1 if conflict; 0 if no conflict.]

SideEffects []

SeeAlso []

Definition at line 788 of file giaCSat.c.

789 {
790  int Value0, Value1;
791  assert( !Gia_IsComplement(pVar) );
792  assert( Gia_ObjIsAnd(pVar) );
793  assert( Cbs_VarIsAssigned(pVar) );
794  assert( !Cbs_VarValue(pVar) );
795  Value0 = Cbs_VarFanin0Value(pVar);
796  Value1 = Cbs_VarFanin1Value(pVar);
797  // value is 0
798  if ( Value0 == 0 || Value1 == 0 ) // one is 0
799  return 0;
800  if ( Value0 == 1 && Value1 == 1 ) // both are 1
801  return Cbs_ManAnalyze( p, Level, pVar, Gia_ObjFanin0(pVar), Gia_ObjFanin1(pVar) );
802  assert( Value0 == 1 || Value1 == 1 );
803  if ( Value0 == 2 ) // first is unassigned
804  Cbs_ManAssign( p, Gia_Not(Gia_ObjChild0(pVar)), Level, pVar, Gia_ObjFanin1(pVar) );
805  if ( Value1 == 2 ) // first is unassigned
806  Cbs_ManAssign( p, Gia_Not(Gia_ObjChild1(pVar)), Level, pVar, Gia_ObjFanin0(pVar) );
807  return 0;
808 }
static Gia_Obj_t * Gia_ObjChild0(Gia_Obj_t *pObj)
Definition: gia.h:457
static int Cbs_VarFanin0Value(Gia_Obj_t *pVar)
Definition: giaCSat.c:96
static int Cbs_VarIsAssigned(Gia_Obj_t *pVar)
Definition: giaCSat.c:90
static Gia_Obj_t * Gia_ObjChild1(Gia_Obj_t *pObj)
Definition: gia.h:458
static Gia_Obj_t * Gia_Not(Gia_Obj_t *p)
Definition: gia.h:378
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
static void Cbs_ManAssign(Cbs_Man_t *p, Gia_Obj_t *pObj, int Level, Gia_Obj_t *pRes0, Gia_Obj_t *pRes1)
Definition: giaCSat.c:492
static int Cbs_VarFanin1Value(Gia_Obj_t *pVar)
Definition: giaCSat.c:97
static int Cbs_VarValue(Gia_Obj_t *pVar)
Definition: giaCSat.c:93
static int Gia_IsComplement(Gia_Obj_t *p)
Definition: gia.h:380
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
#define assert(ex)
Definition: util_old.h:213
static int Cbs_ManAnalyze(Cbs_Man_t *p, int Level, Gia_Obj_t *pVar, Gia_Obj_t *pFan0, Gia_Obj_t *pFan1)
Definition: giaCSat.c:649
static int Cbs_ManResolve ( Cbs_Man_t p,
int  Level,
int  hClause0,
int  hClause1 
)
inlinestatic

Function*************************************************************

Synopsis [Performs resolution of two clauses.]

Description []

SideEffects []

SeeAlso []

Definition at line 677 of file giaCSat.c.

678 {
679  Cbs_Que_t * pQue = &(p->pClauses);
680  Gia_Obj_t * pObj;
681  int i, LevelMax = -1, LevelCur;
682  assert( pQue->pData[hClause0] != NULL );
683  assert( pQue->pData[hClause0] == pQue->pData[hClause1] );
684 /*
685  for ( i = hClause0 + 1; (pObj = pQue->pData[i]); i++ )
686  assert( pObj->fMark0 == 1 );
687  for ( i = hClause1 + 1; (pObj = pQue->pData[i]); i++ )
688  assert( pObj->fMark0 == 1 );
689 */
690  assert( Cbs_QueIsEmpty( pQue ) );
691  Cbs_QuePush( pQue, NULL );
692  for ( i = hClause0 + 1; (pObj = pQue->pData[i]); i++ )
693  {
694  if ( !pObj->fMark0 ) // unassigned - seen again
695  continue;
696  // assigned - seen first time
697  pObj->fMark0 = 0;
698  Cbs_QuePush( pQue, pObj );
699  LevelCur = Cbs_VarDecLevel( p, pObj );
700  if ( LevelMax < LevelCur )
701  LevelMax = LevelCur;
702  }
703  for ( i = hClause1 + 1; (pObj = pQue->pData[i]); i++ )
704  {
705  if ( !pObj->fMark0 ) // unassigned - seen again
706  continue;
707  // assigned - seen first time
708  pObj->fMark0 = 0;
709  Cbs_QuePush( pQue, pObj );
710  LevelCur = Cbs_VarDecLevel( p, pObj );
711  if ( LevelMax < LevelCur )
712  LevelMax = LevelCur;
713  }
714  for ( i = pQue->iHead + 1; i < pQue->iTail; i++ )
715  pQue->pData[i]->fMark0 = 1;
716  Cbs_ManDeriveReason( p, LevelMax );
717  return Cbs_QueFinish( pQue );
718 }
Gia_Obj_t ** pData
Definition: giaCSat.c:59
Cbs_Que_t pClauses
Definition: giaCSat.c:69
Definition: gia.h:75
int iHead
Definition: giaCSat.c:56
static void Cbs_ManDeriveReason(Cbs_Man_t *p, int Level)
Definition: giaCSat.c:587
static int Cbs_QueIsEmpty(Cbs_Que_t *p)
Definition: giaCSat.c:256
static void Cbs_QuePush(Cbs_Que_t *p, Gia_Obj_t *pObj)
Definition: giaCSat.c:272
unsigned fMark0
Definition: gia.h:79
#define assert(ex)
Definition: util_old.h:213
static int Cbs_VarDecLevel(Cbs_Man_t *p, Gia_Obj_t *pVar)
Definition: giaCSat.c:99
static int Cbs_QueFinish(Cbs_Que_t *p)
Definition: giaCSat.c:352
void Cbs_ManSatPrintStats ( Cbs_Man_t p)

Function*************************************************************

Synopsis [Prints statistics of the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 968 of file giaCSat.c.

969 {
970  printf( "CO = %8d ", Gia_ManCoNum(p->pAig) );
971  printf( "AND = %8d ", Gia_ManAndNum(p->pAig) );
972  printf( "Conf = %6d ", p->Pars.nBTLimit );
973  printf( "JustMax = %5d ", p->Pars.nJustLimit );
974  printf( "\n" );
975  printf( "Unsat calls %6d (%6.2f %%) Ave conf = %8.1f ",
976  p->nSatUnsat, p->nSatTotal? 100.0*p->nSatUnsat/p->nSatTotal :0.0, p->nSatUnsat? 1.0*p->nConfUnsat/p->nSatUnsat :0.0 );
977  ABC_PRTP( "Time", p->timeSatUnsat, p->timeTotal );
978  printf( "Sat calls %6d (%6.2f %%) Ave conf = %8.1f ",
979  p->nSatSat, p->nSatTotal? 100.0*p->nSatSat/p->nSatTotal :0.0, p->nSatSat? 1.0*p->nConfSat/p->nSatSat : 0.0 );
980  ABC_PRTP( "Time", p->timeSatSat, p->timeTotal );
981  printf( "Undef calls %6d (%6.2f %%) Ave conf = %8.1f ",
982  p->nSatUndec, p->nSatTotal? 100.0*p->nSatUndec/p->nSatTotal :0.0, p->nSatUndec? 1.0*p->nConfUndec/p->nSatUndec : 0.0 );
983  ABC_PRTP( "Time", p->timeSatUndec, p->timeTotal );
984  ABC_PRT( "Total time", p->timeTotal );
985 }
abctime timeTotal
Definition: giaCSat.c:87
int nConfSat
Definition: giaCSat.c:81
int nSatSat
Definition: giaCSat.c:76
int nSatTotal
Definition: giaCSat.c:78
Gia_Man_t * pAig
Definition: giaCSat.c:66
int nSatUndec
Definition: giaCSat.c:77
int nConfUnsat
Definition: giaCSat.c:80
#define ABC_PRTP(a, t, T)
Definition: abc_global.h:223
static int Gia_ManAndNum(Gia_Man_t *p)
Definition: gia.h:389
int nConfUndec
Definition: giaCSat.c:82
abctime timeSatSat
Definition: giaCSat.c:85
abctime timeSatUndec
Definition: giaCSat.c:86
Cbs_Par_t Pars
Definition: giaCSat.c:65
#define ABC_PRT(a, t)
Definition: abc_global.h:220
int nSatUnsat
Definition: giaCSat.c:75
abctime timeSatUnsat
Definition: giaCSat.c:84
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
static void Cbs_ManSaveModel ( Cbs_Man_t p,
Vec_Int_t vCex 
)
inlinestatic

Function*************************************************************

Synopsis [Saves the satisfying assignment as an array of literals.]

Description []

SideEffects []

SeeAlso []

Definition at line 233 of file giaCSat.c.

234 {
235  Gia_Obj_t * pVar;
236  int i;
237  Vec_IntClear( vCex );
238  p->pProp.iHead = 0;
239  Cbs_QueForEachEntry( p->pProp, pVar, i )
240  if ( Gia_ObjIsCi(pVar) )
241 // Vec_IntPush( vCex, Abc_Var2Lit(Gia_ObjId(p->pAig,pVar), !Cbs_VarValue(pVar)) );
242  Vec_IntPush( vCex, Abc_Var2Lit(Gia_ObjCioId(pVar), !Cbs_VarValue(pVar)) );
243 }
static int Abc_Var2Lit(int Var, int fCompl)
Definition: abc_global.h:263
Cbs_Que_t pProp
Definition: giaCSat.c:67
Definition: gia.h:75
int iHead
Definition: giaCSat.c:56
if(last==0)
Definition: sparse_int.h:34
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static int Cbs_VarValue(Gia_Obj_t *pVar)
Definition: giaCSat.c:93
#define Cbs_QueForEachEntry(Que, pObj, i)
Definition: giaCSat.c:104
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Definition: gia.h:420
static int Gia_ObjCioId(Gia_Obj_t *pObj)
Definition: gia.h:411
int Cbs_ManSolve ( Cbs_Man_t p,
Gia_Obj_t pObj 
)

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 []

SeeAlso []

Definition at line 932 of file giaCSat.c.

933 {
934  int RetValue = 0;
935  s_Counter = 0;
936  assert( !p->pProp.iHead && !p->pProp.iTail );
937  assert( !p->pJust.iHead && !p->pJust.iTail );
938  assert( p->pClauses.iHead == 1 && p->pClauses.iTail == 1 );
939  p->Pars.nBTThis = p->Pars.nJustThis = p->Pars.nBTThisNc = 0;
940  Cbs_ManAssign( p, pObj, 0, NULL, NULL );
941  if ( !Cbs_ManSolve_rec(p, 0) && !Cbs_ManCheckLimits(p) )
942  Cbs_ManSaveModel( p, p->vModel );
943  else
944  RetValue = 1;
945  Cbs_ManCancelUntil( p, 0 );
946  p->pJust.iHead = p->pJust.iTail = 0;
947  p->pClauses.iHead = p->pClauses.iTail = 1;
948  p->Pars.nBTTotal += p->Pars.nBTThis;
949  p->Pars.nJustTotal = Abc_MaxInt( p->Pars.nJustTotal, p->Pars.nJustThis );
950  if ( Cbs_ManCheckLimits( p ) )
951  RetValue = -1;
952 
953 // printf( "%d ", s_Counter );
954  return RetValue;
955 }
int s_Counter
Definition: giaCSat.c:479
Cbs_Que_t pClauses
Definition: giaCSat.c:69
Vec_Int_t * vModel
Definition: giaCSat.c:72
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
Cbs_Que_t pJust
Definition: giaCSat.c:68
int Cbs_ManSolve_rec(Cbs_Man_t *p, int Level)
Definition: giaCSat.c:860
Cbs_Que_t pProp
Definition: giaCSat.c:67
static int Cbs_ManCheckLimits(Cbs_Man_t *p)
Definition: giaCSat.c:217
static void Cbs_ManAssign(Cbs_Man_t *p, Gia_Obj_t *pObj, int Level, Gia_Obj_t *pRes0, Gia_Obj_t *pRes1)
Definition: giaCSat.c:492
int iHead
Definition: giaCSat.c:56
Cbs_Par_t Pars
Definition: giaCSat.c:65
#define assert(ex)
Definition: util_old.h:213
int iTail
Definition: giaCSat.c:57
static void Cbs_ManCancelUntil(Cbs_Man_t *p, int iBound)
Definition: giaCSat.c:467
static void Cbs_ManSaveModel(Cbs_Man_t *p, Vec_Int_t *vCex)
Definition: giaCSat.c:233
int Cbs_ManSolve_rec ( Cbs_Man_t p,
int  Level 
)

Function*************************************************************

Synopsis [Solve the problem recursively.]

Description [Returns learnt clause if unsat, NULL if sat or undecided.]

SideEffects []

SeeAlso []

Definition at line 860 of file giaCSat.c.

861 {
862  Cbs_Que_t * pQue = &(p->pClauses);
863  Gia_Obj_t * pVar, * pDecVar;
864  int hClause, hLearn0, hLearn1;
865  int iPropHead, iJustHead, iJustTail;
866  // propagate assignments
867  assert( !Cbs_QueIsEmpty(&p->pProp) );
868  if ( (hClause = Cbs_ManPropagate( p, Level )) )
869  return hClause;
870  // check for satisfying assignment
871  assert( Cbs_QueIsEmpty(&p->pProp) );
872  if ( Cbs_QueIsEmpty(&p->pJust) )
873  return 0;
874  // quit using resource limits
875  p->Pars.nJustThis = Abc_MaxInt( p->Pars.nJustThis, p->pJust.iTail - p->pJust.iHead );
876  if ( Cbs_ManCheckLimits( p ) )
877  return 0;
878  // remember the state before branching
879  iPropHead = p->pProp.iHead;
880  Cbs_QueStore( &p->pJust, &iJustHead, &iJustTail );
881  // find the decision variable
882  if ( p->Pars.fUseHighest )
883  pVar = Cbs_ManDecideHighest( p );
884  else if ( p->Pars.fUseLowest )
885  pVar = Cbs_ManDecideLowest( p );
886  else if ( p->Pars.fUseMaxFF )
887  pVar = Cbs_ManDecideMaxFF( p );
888  else assert( 0 );
889  assert( Cbs_VarIsJust( pVar ) );
890  // chose decision variable using fanout count
891  if ( Gia_ObjRefNum(p->pAig, Gia_ObjFanin0(pVar)) > Gia_ObjRefNum(p->pAig, Gia_ObjFanin1(pVar)) )
892  pDecVar = Gia_Not(Gia_ObjChild0(pVar));
893  else
894  pDecVar = Gia_Not(Gia_ObjChild1(pVar));
895 // pDecVar = Gia_NotCond( Gia_Regular(pDecVar), Gia_Regular(pDecVar)->fPhase );
896 // pDecVar = Gia_Not(pDecVar);
897  // decide on first fanin
898  Cbs_ManAssign( p, pDecVar, Level+1, NULL, NULL );
899  if ( !(hLearn0 = Cbs_ManSolve_rec( p, Level+1 )) )
900  return 0;
901  if ( pQue->pData[hLearn0] != Gia_Regular(pDecVar) )
902  return hLearn0;
903  Cbs_ManCancelUntil( p, iPropHead );
904  Cbs_QueRestore( &p->pJust, iJustHead, iJustTail );
905  // decide on second fanin
906  Cbs_ManAssign( p, Gia_Not(pDecVar), Level+1, NULL, NULL );
907  if ( !(hLearn1 = Cbs_ManSolve_rec( p, Level+1 )) )
908  return 0;
909  if ( pQue->pData[hLearn1] != Gia_Regular(pDecVar) )
910  return hLearn1;
911  hClause = Cbs_ManResolve( p, Level, hLearn0, hLearn1 );
912 // Cbs_ManPrintClauseNew( p, Level, hClause );
913 // if ( Level > Cbs_ClauseDecLevel(p, hClause) )
914 // p->Pars.nBTThisNc++;
915  p->Pars.nBTThis++;
916  return hClause;
917 }
static Gia_Obj_t * Cbs_ManDecideLowest(Cbs_Man_t *p)
Definition: giaCSat.c:415
Gia_Obj_t ** pData
Definition: giaCSat.c:59
static Gia_Obj_t * Gia_ObjChild0(Gia_Obj_t *pObj)
Definition: gia.h:457
static void Cbs_QueStore(Cbs_Que_t *p, int *piHeadOld, int *piTailOld)
Definition: giaCSat.c:314
int Cbs_ManPropagate(Cbs_Man_t *p, int Level)
Definition: giaCSat.c:821
Gia_Man_t * pAig
Definition: giaCSat.c:66
static Gia_Obj_t * Gia_Regular(Gia_Obj_t *p)
Definition: gia.h:377
Cbs_Que_t pClauses
Definition: giaCSat.c:69
static Gia_Obj_t * Cbs_ManDecideMaxFF(Cbs_Man_t *p)
Definition: giaCSat.c:436
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:521
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
Cbs_Que_t pJust
Definition: giaCSat.c:68
int Cbs_ManSolve_rec(Cbs_Man_t *p, int Level)
Definition: giaCSat.c:860
Cbs_Que_t pProp
Definition: giaCSat.c:67
static int Cbs_VarIsJust(Gia_Obj_t *pVar)
Definition: giaCSat.c:95
Definition: gia.h:75
static Gia_Obj_t * Gia_ObjChild1(Gia_Obj_t *pObj)
Definition: gia.h:458
static Gia_Obj_t * Gia_Not(Gia_Obj_t *p)
Definition: gia.h:378
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
static int Cbs_ManCheckLimits(Cbs_Man_t *p)
Definition: giaCSat.c:217
static void Cbs_ManAssign(Cbs_Man_t *p, Gia_Obj_t *pObj, int Level, Gia_Obj_t *pRes0, Gia_Obj_t *pRes1)
Definition: giaCSat.c:492
int iHead
Definition: giaCSat.c:56
static void Cbs_QueRestore(Cbs_Que_t *p, int iHeadOld, int iTailOld)
Definition: giaCSat.c:335
Cbs_Par_t Pars
Definition: giaCSat.c:65
static int Cbs_QueIsEmpty(Cbs_Que_t *p)
Definition: giaCSat.c:256
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
#define assert(ex)
Definition: util_old.h:213
int iTail
Definition: giaCSat.c:57
static Gia_Obj_t * Cbs_ManDecideHighest(Cbs_Man_t *p)
Definition: giaCSat.c:394
static void Cbs_ManCancelUntil(Cbs_Man_t *p, int iBound)
Definition: giaCSat.c:467
static int Cbs_ManResolve(Cbs_Man_t *p, int Level, int hClause0, int hClause1)
Definition: giaCSat.c:677
Vec_Int_t* Cbs_ManSolveMiterNc ( Gia_Man_t pAig,
int  nConfs,
Vec_Str_t **  pvStatus,
int  fVerbose 
)

Function*************************************************************

Synopsis [Procedure to test the new SAT solver.]

Description []

SideEffects []

SeeAlso []

Definition at line 998 of file giaCSat.c.

999 {
1000  extern void Gia_ManCollectTest( Gia_Man_t * pAig );
1001  extern void Cec_ManSatAddToStore( Vec_Int_t * vCexStore, Vec_Int_t * vCex, int Out );
1002  Cbs_Man_t * p;
1003  Vec_Int_t * vCex, * vVisit, * vCexStore;
1004  Vec_Str_t * vStatus;
1005  Gia_Obj_t * pRoot;
1006  int i, status;
1007  abctime clk, clkTotal = Abc_Clock();
1008  assert( Gia_ManRegNum(pAig) == 0 );
1009 // Gia_ManCollectTest( pAig );
1010  // prepare AIG
1011  Gia_ManCreateRefs( pAig );
1012  Gia_ManCleanMark0( pAig );
1013  Gia_ManCleanMark1( pAig );
1014  Gia_ManFillValue( pAig ); // maps nodes into trail ids
1015  Gia_ManSetPhase( pAig ); // maps nodes into trail ids
1016  // create logic network
1017  p = Cbs_ManAlloc();
1018  p->Pars.nBTLimit = nConfs;
1019  p->pAig = pAig;
1020  // create resulting data-structures
1021  vStatus = Vec_StrAlloc( Gia_ManPoNum(pAig) );
1022  vCexStore = Vec_IntAlloc( 10000 );
1023  vVisit = Vec_IntAlloc( 100 );
1024  vCex = Cbs_ReadModel( p );
1025  // solve for each output
1026  Gia_ManForEachCo( pAig, pRoot, i )
1027  {
1028 // printf( "\n" );
1029 
1030  Vec_IntClear( vCex );
1031  if ( Gia_ObjIsConst0(Gia_ObjFanin0(pRoot)) )
1032  {
1033  if ( Gia_ObjFaninC0(pRoot) )
1034  {
1035 // printf( "Constant 1 output of SRM!!!\n" );
1036  Cec_ManSatAddToStore( vCexStore, vCex, i ); // trivial counter-example
1037  Vec_StrPush( vStatus, 0 );
1038  }
1039  else
1040  {
1041 // printf( "Constant 0 output of SRM!!!\n" );
1042  Vec_StrPush( vStatus, 1 );
1043  }
1044  continue;
1045  }
1046  clk = Abc_Clock();
1047  p->Pars.fUseHighest = 1;
1048  p->Pars.fUseLowest = 0;
1049  status = Cbs_ManSolve( p, Gia_ObjChild0(pRoot) );
1050 // printf( "\n" );
1051 /*
1052  if ( status == -1 )
1053  {
1054  p->Pars.fUseHighest = 0;
1055  p->Pars.fUseLowest = 1;
1056  status = Cbs_ManSolve( p, Gia_ObjChild0(pRoot) );
1057  }
1058 */
1059  Vec_StrPush( vStatus, (char)status );
1060  if ( status == -1 )
1061  {
1062  p->nSatUndec++;
1063  p->nConfUndec += p->Pars.nBTThis;
1064  Cec_ManSatAddToStore( vCexStore, NULL, i ); // timeout
1065  p->timeSatUndec += Abc_Clock() - clk;
1066  continue;
1067  }
1068  if ( status == 1 )
1069  {
1070  p->nSatUnsat++;
1071  p->nConfUnsat += p->Pars.nBTThis;
1072  p->timeSatUnsat += Abc_Clock() - clk;
1073  continue;
1074  }
1075  p->nSatSat++;
1076  p->nConfSat += p->Pars.nBTThis;
1077 // Gia_SatVerifyPattern( pAig, pRoot, vCex, vVisit );
1078  Cec_ManSatAddToStore( vCexStore, vCex, i );
1079  p->timeSatSat += Abc_Clock() - clk;
1080  }
1081  Vec_IntFree( vVisit );
1082  p->nSatTotal = Gia_ManPoNum(pAig);
1083  p->timeTotal = Abc_Clock() - clkTotal;
1084  if ( fVerbose )
1085  Cbs_ManSatPrintStats( p );
1086 // printf( "RecCalls = %8d. RecClause = %8d. RecNonChro = %8d.\n", p->nRecCall, p->nRecClause, p->nRecNonChro );
1087  Cbs_ManStop( p );
1088  *pvStatus = vStatus;
1089 
1090 // printf( "Total number of cex literals = %d. (Ave = %d)\n",
1091 // Vec_IntSize(vCexStore)-2*p->nSatUndec-2*p->nSatSat,
1092 // (Vec_IntSize(vCexStore)-2*p->nSatUndec-2*p->nSatSat)/p->nSatSat );
1093  return vCexStore;
1094 }
void Gia_ManCreateRefs(Gia_Man_t *p)
Definition: giaUtil.c:715
abctime timeTotal
Definition: giaCSat.c:87
static Gia_Obj_t * Gia_ObjChild0(Gia_Obj_t *pObj)
Definition: gia.h:457
int nConfSat
Definition: giaCSat.c:81
int nSatSat
Definition: giaCSat.c:76
#define Gia_ManForEachCo(p, pObj, i)
Definition: gia.h:1022
int Cbs_ManSolve(Cbs_Man_t *p, Gia_Obj_t *pObj)
Definition: giaCSat.c:932
int nSatTotal
Definition: giaCSat.c:78
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Gia_Man_t * pAig
Definition: giaCSat.c:66
void Cbs_ManSatPrintStats(Cbs_Man_t *p)
Definition: giaCSat.c:968
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
Cbs_Man_t * Cbs_ManAlloc()
Definition: giaCSat.c:149
Vec_Int_t * Cbs_ReadModel(Cbs_Man_t *p)
Definition: giaCSat.c:198
void Gia_ManCleanMark0(Gia_Man_t *p)
Definition: giaUtil.c:215
int nSatUndec
Definition: giaCSat.c:77
static int Gia_ObjIsConst0(Gia_Obj_t *pObj)
Definition: gia.h:430
void Cbs_ManStop(Cbs_Man_t *p)
Definition: giaCSat.c:176
static Vec_Str_t * Vec_StrAlloc(int nCap)
Definition: bblif.c:495
static abctime Abc_Clock()
Definition: abc_global.h:279
static void Vec_StrPush(Vec_Str_t *p, char Entry)
Definition: vecStr.h:535
int nConfUnsat
Definition: giaCSat.c:80
Definition: gia.h:75
void Gia_ManCleanMark1(Gia_Man_t *p)
Definition: giaUtil.c:272
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
int nConfUndec
Definition: giaCSat.c:82
abctime timeSatSat
Definition: giaCSat.c:85
abctime timeSatUndec
Definition: giaCSat.c:86
void Gia_ManFillValue(Gia_Man_t *p)
Definition: giaUtil.c:328
Cbs_Par_t Pars
Definition: giaCSat.c:65
void Cec_ManSatAddToStore(Vec_Int_t *vCexStore, Vec_Int_t *vCex, int Out)
Definition: cecSolve.c:952
Definition: gia.h:95
#define assert(ex)
Definition: util_old.h:213
void Gia_ManSetPhase(Gia_Man_t *p)
Definition: giaUtil.c:379
void Gia_ManCollectTest(Gia_Man_t *p)
Definition: giaDfs.c:208
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
Definition: gia.h:451
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
ABC_INT64_T abctime
Definition: abc_global.h:278
int nSatUnsat
Definition: giaCSat.c:75
abctime timeSatUnsat
Definition: giaCSat.c:84
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
void Cbs_ManStop ( Cbs_Man_t p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 176 of file giaCSat.c.

177 {
178  Vec_IntFree( p->vLevReas );
179  Vec_IntFree( p->vModel );
180  Vec_PtrFree( p->vTemp );
181  ABC_FREE( p->pClauses.pData );
182  ABC_FREE( p->pProp.pData );
183  ABC_FREE( p->pJust.pData );
184  ABC_FREE( p );
185 }
Gia_Obj_t ** pData
Definition: giaCSat.c:59
Cbs_Que_t pClauses
Definition: giaCSat.c:69
Vec_Ptr_t * vTemp
Definition: giaCSat.c:73
Vec_Int_t * vModel
Definition: giaCSat.c:72
Cbs_Que_t pJust
Definition: giaCSat.c:68
Cbs_Que_t pProp
Definition: giaCSat.c:67
Vec_Int_t * vLevReas
Definition: giaCSat.c:71
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
static int Cbs_QueFinish ( Cbs_Que_t p)
inlinestatic

Function*************************************************************

Synopsis [Finalized the clause.]

Description []

SideEffects []

SeeAlso []

Definition at line 352 of file giaCSat.c.

353 {
354  int iHeadOld = p->iHead;
355  assert( p->iHead < p->iTail );
356  Cbs_QuePush( p, NULL );
357  p->iHead = p->iTail;
358  return iHeadOld;
359 }
int iHead
Definition: giaCSat.c:56
static void Cbs_QuePush(Cbs_Que_t *p, Gia_Obj_t *pObj)
Definition: giaCSat.c:272
#define assert(ex)
Definition: util_old.h:213
int iTail
Definition: giaCSat.c:57
static int Cbs_QueHasNode ( Cbs_Que_t p,
Gia_Obj_t pObj 
)
inlinestatic

Function*************************************************************

Synopsis [Returns 1 if the object in the queue.]

Description []

SideEffects []

SeeAlso []

Definition at line 293 of file giaCSat.c.

294 {
295  Gia_Obj_t * pTemp;
296  int i;
297  Cbs_QueForEachEntry( *p, pTemp, i )
298  if ( pTemp == pObj )
299  return 1;
300  return 0;
301 }
Definition: gia.h:75
if(last==0)
Definition: sparse_int.h:34
#define Cbs_QueForEachEntry(Que, pObj, i)
Definition: giaCSat.c:104
static int Cbs_QueIsEmpty ( Cbs_Que_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 256 of file giaCSat.c.

257 {
258  return p->iHead == p->iTail;
259 }
int iHead
Definition: giaCSat.c:56
int iTail
Definition: giaCSat.c:57
static void Cbs_QuePush ( Cbs_Que_t p,
Gia_Obj_t pObj 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 272 of file giaCSat.c.

273 {
274  if ( p->iTail == p->nSize )
275  {
276  p->nSize *= 2;
277  p->pData = ABC_REALLOC( Gia_Obj_t *, p->pData, p->nSize );
278  }
279  p->pData[p->iTail++] = pObj;
280 }
Gia_Obj_t ** pData
Definition: giaCSat.c:59
int nSize
Definition: giaCSat.c:58
#define ABC_REALLOC(type, obj, num)
Definition: abc_global.h:233
Definition: gia.h:75
int iTail
Definition: giaCSat.c:57
static void Cbs_QueRestore ( Cbs_Que_t p,
int  iHeadOld,
int  iTailOld 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 335 of file giaCSat.c.

336 {
337  p->iHead = iHeadOld;
338  p->iTail = iTailOld;
339 }
int iHead
Definition: giaCSat.c:56
int iTail
Definition: giaCSat.c:57
static void Cbs_QueStore ( Cbs_Que_t p,
int *  piHeadOld,
int *  piTailOld 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 314 of file giaCSat.c.

315 {
316  int i;
317  *piHeadOld = p->iHead;
318  *piTailOld = p->iTail;
319  for ( i = *piHeadOld; i < *piTailOld; i++ )
320  Cbs_QuePush( p, p->pData[i] );
321  p->iHead = *piTailOld;
322 }
Gia_Obj_t ** pData
Definition: giaCSat.c:59
int iHead
Definition: giaCSat.c:56
static void Cbs_QuePush(Cbs_Que_t *p, Gia_Obj_t *pObj)
Definition: giaCSat.c:272
int iTail
Definition: giaCSat.c:57
Vec_Int_t* Cbs_ReadModel ( Cbs_Man_t p)

Function*************************************************************

Synopsis [Returns satisfying assignment.]

Description []

SideEffects []

SeeAlso []

Definition at line 198 of file giaCSat.c.

199 {
200  return p->vModel;
201 }
Vec_Int_t * vModel
Definition: giaCSat.c:72
void Cbs_SetDefaultParams ( Cbs_Par_t pPars)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Sets default values of the parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 127 of file giaCSat.c.

128 {
129  memset( pPars, 0, sizeof(Cbs_Par_t) );
130  pPars->nBTLimit = 1000; // limit on the number of conflicts
131  pPars->nJustLimit = 100; // limit on the size of justification queue
132  pPars->fUseHighest = 1; // use node with the highest ID
133  pPars->fUseLowest = 0; // use node with the highest ID
134  pPars->fUseMaxFF = 0; // use node with the largest fanin fanout
135  pPars->fVerbose = 1; // print detailed statistics
136 }
char * memset()
typedefABC_NAMESPACE_IMPL_START struct Cbs_Par_t_ Cbs_Par_t
DECLARATIONS ///.
Definition: giaCSat.c:33
static void Cbs_VarAssign ( Gia_Obj_t pVar)
inlinestatic

Definition at line 91 of file giaCSat.c.

91 { assert(!pVar->fMark0); pVar->fMark0 = 1; }
unsigned fMark0
Definition: gia.h:79
#define assert(ex)
Definition: util_old.h:213
static int Cbs_VarDecLevel ( Cbs_Man_t p,
Gia_Obj_t pVar 
)
inlinestatic

Definition at line 99 of file giaCSat.c.

99 { assert( pVar->Value != ~0 ); return Vec_IntEntry(p->vLevReas, 3*pVar->Value); }
Vec_Int_t * vLevReas
Definition: giaCSat.c:71
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
#define assert(ex)
Definition: util_old.h:213
unsigned Value
Definition: gia.h:87
static int Cbs_VarFanin0Value ( Gia_Obj_t pVar)
inlinestatic

Definition at line 96 of file giaCSat.c.

96 { return !Cbs_VarIsAssigned(Gia_ObjFanin0(pVar)) ? 2 : (Cbs_VarValue(Gia_ObjFanin0(pVar)) ^ Gia_ObjFaninC0(pVar)); }
static int Cbs_VarIsAssigned(Gia_Obj_t *pVar)
Definition: giaCSat.c:90
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
static int Cbs_VarValue(Gia_Obj_t *pVar)
Definition: giaCSat.c:93
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
Definition: gia.h:451
static int Cbs_VarFanin1Value ( Gia_Obj_t pVar)
inlinestatic

Definition at line 97 of file giaCSat.c.

97 { return !Cbs_VarIsAssigned(Gia_ObjFanin1(pVar)) ? 2 : (Cbs_VarValue(Gia_ObjFanin1(pVar)) ^ Gia_ObjFaninC1(pVar)); }
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
Definition: gia.h:452
static int Cbs_VarIsAssigned(Gia_Obj_t *pVar)
Definition: giaCSat.c:90
static int Cbs_VarValue(Gia_Obj_t *pVar)
Definition: giaCSat.c:93
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
static int Cbs_VarFaninFanoutMax ( Cbs_Man_t p,
Gia_Obj_t pObj 
)
inlinestatic

Function*************************************************************

Synopsis [Max number of fanins fanouts.]

Description []

SideEffects []

SeeAlso []

Definition at line 373 of file giaCSat.c.

374 {
375  int Count0, Count1;
376  assert( !Gia_IsComplement(pObj) );
377  assert( Gia_ObjIsAnd(pObj) );
378  Count0 = Gia_ObjRefNum( p->pAig, Gia_ObjFanin0(pObj) );
379  Count1 = Gia_ObjRefNum( p->pAig, Gia_ObjFanin1(pObj) );
380  return Abc_MaxInt( Count0, Count1 );
381 }
Gia_Man_t * pAig
Definition: giaCSat.c:66
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:521
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
static int Gia_IsComplement(Gia_Obj_t *p)
Definition: gia.h:380
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
#define assert(ex)
Definition: util_old.h:213
static int Cbs_VarIsAssigned ( Gia_Obj_t pVar)
inlinestatic

Definition at line 90 of file giaCSat.c.

90 { return pVar->fMark0; }
unsigned fMark0
Definition: gia.h:79
static int Cbs_VarIsJust ( Gia_Obj_t pVar)
inlinestatic

Definition at line 95 of file giaCSat.c.

95 { return Gia_ObjIsAnd(pVar) && !Cbs_VarIsAssigned(Gia_ObjFanin0(pVar)) && !Cbs_VarIsAssigned(Gia_ObjFanin1(pVar)); }
static int Cbs_VarIsAssigned(Gia_Obj_t *pVar)
Definition: giaCSat.c:90
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
static Gia_Obj_t* Cbs_VarReason0 ( Cbs_Man_t p,
Gia_Obj_t pVar 
)
inlinestatic

Definition at line 100 of file giaCSat.c.

100 { assert( pVar->Value != ~0 ); return pVar + Vec_IntEntry(p->vLevReas, 3*pVar->Value+1); }
Vec_Int_t * vLevReas
Definition: giaCSat.c:71
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
#define assert(ex)
Definition: util_old.h:213
unsigned Value
Definition: gia.h:87
static Gia_Obj_t* Cbs_VarReason1 ( Cbs_Man_t p,
Gia_Obj_t pVar 
)
inlinestatic

Definition at line 101 of file giaCSat.c.

101 { assert( pVar->Value != ~0 ); return pVar + Vec_IntEntry(p->vLevReas, 3*pVar->Value+2); }
Vec_Int_t * vLevReas
Definition: giaCSat.c:71
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
#define assert(ex)
Definition: util_old.h:213
unsigned Value
Definition: gia.h:87
static void Cbs_VarSetValue ( Gia_Obj_t pVar,
int  v 
)
inlinestatic

Definition at line 94 of file giaCSat.c.

94 { assert(pVar->fMark0); pVar->fMark1 = v; }
unsigned fMark1
Definition: gia.h:84
unsigned fMark0
Definition: gia.h:79
#define assert(ex)
Definition: util_old.h:213
static void Cbs_VarUnassign ( Gia_Obj_t pVar)
inlinestatic

Definition at line 92 of file giaCSat.c.

92 { assert(pVar->fMark0); pVar->fMark0 = 0; pVar->fMark1 = 0; pVar->Value = ~0; }
unsigned fMark1
Definition: gia.h:84
unsigned fMark0
Definition: gia.h:79
#define assert(ex)
Definition: util_old.h:213
unsigned Value
Definition: gia.h:87
static int Cbs_VarValue ( Gia_Obj_t pVar)
inlinestatic

Definition at line 93 of file giaCSat.c.

93 { assert(pVar->fMark0); return pVar->fMark1; }
unsigned fMark1
Definition: gia.h:84
unsigned fMark0
Definition: gia.h:79
#define assert(ex)
Definition: util_old.h:213

Variable Documentation

int s_Counter = 0

Definition at line 479 of file giaCSat.c.