34#define Bmc_SopForEachCube( pSop, nVars, pCube ) for ( pCube = (pSop); *pCube; pCube += (nVars) + 3 )
55 char * pCube, * pSop = Vec_StrArray(vSop);
59 Vec_Int_t * vLits = Vec_IntAlloc( nVars );
60 Vec_Int_t * vTemp = Vec_IntAlloc( nVars );
62 assert( nVars == Vec_IntSize(vVars) );
63 assert( Vec_StrSize(vSop) == nCubes * (nVars + 3) + 1 );
68 Vec_IntFill( vLits, nVars, -1 );
69 for ( k = 0; k < nVars; k++ )
71 if ( pCube[k] ==
'-' )
73 Vec_IntWriteEntry( vLits, k, Abc_Var2Lit(Vec_IntEntry(vVars, k), pCube[k] ==
'0') );
81 pCube[k] =
'1' - Abc_LitIsCompl(Entry);
93 Vec_Int_t * vVars = Vec_IntAlloc( nVars );
96 int v, n, iLit, status, nCubesNew, iCiVarBeg =
sat_solver_nvars(pSat) - nVars;
100 for ( n = 0; n < 2; n++ )
102 iLit = Abc_Var2Lit( iOutVar, n );
106 Vec_StrClear( vSop );
107 Vec_StrPrintStr( vSop, n ?
" 1\n" :
" 0\n" );
108 Vec_StrPush( vSop,
'\0' );
114 iLit = Abc_Var2Lit( iOutVar, 1 );
120 for ( v = nVars - 1; v >= 0; v-- )
121 Vec_IntPush( vVars, iCiVarBeg + v );
123 for ( v = 0; v < nVars; v++ )
124 Vec_IntPush( vVars, iCiVarBeg + v );
130 Vec_IntFree( vVars );
140 assert( Abc_NtkIsSopLogic(pNtk) );
141 assert( Abc_NtkCiNum(pNtk) == Gia_ManCiNum(pGia) );
142 assert( Abc_NtkCoNum(pNtk) == Gia_ManCoNum(pGia) );
145 pObj = Abc_ObjFanin0(pObj);
146 if ( !Abc_ObjIsNode(pObj) || Abc_ObjFaninNum(pObj) == 0 )
148 assert( Abc_ObjFaninNum(pObj) == Gia_ManCiNum(pGia) );
150 Vec_StrClear( vSop );
151 Vec_StrAppend( vSop, (
char *)pObj->
pData );
152 Vec_StrPush( vSop,
'\0' );
155 assert( Gia_ManCiNum(pNew) == Gia_ManCiNum(pGia) );
157 Vec_IntClear( &pObj->
vFanins );
struct Abc_Obj_t_ Abc_Obj_t
#define Abc_NtkForEachCo(pNtk, pCo, i)
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL void Abc_NtkSortSops(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_SopGetVarNum(char *pSop)
ABC_DLL int Abc_SopGetCubeNum(char *pSop)
ABC_DLL char * Abc_SopRegister(Mem_Flex_t *pMan, const char *pName)
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
struct Vec_Str_t_ Vec_Str_t
int Bmc_CollapseExpandRound(sat_solver *pSat, sat_solver *pSatOn, Vec_Int_t *vLits, Vec_Int_t *vNums, Vec_Int_t *vTemp, int nBTLimit, int fCanon, int fOnOffSetLit)
int Bmc_CollapseIrredundantFull(Vec_Str_t *vSop, int nCubes, int nVars)
void Abc_NtkExpandCubes(Abc_Ntk_t *pNtk, Gia_Man_t *pGia, int fVerbose)
#define Bmc_SopForEachCube(pSop, nVars, pCube)
DECLARATIONS ///.
int Abc_ObjExpandCubes(Vec_Str_t *vSop, Gia_Man_t *p, int nVars)
int Abc_ObjExpandCubesTry(Vec_Str_t *vSop, sat_solver *pSat, Vec_Int_t *vVars)
FUNCTION DEFINITIONS ///.
#define sat_solver_addclause
struct Cnf_Dat_t_ Cnf_Dat_t
void Cnf_DataFree(Cnf_Dat_t *p)
void Gia_ManStop(Gia_Man_t *p)
struct Gia_Man_t_ Gia_Man_t
Gia_Man_t * Gia_ManDupCones(Gia_Man_t *p, int *pPos, int nPos, int fTrimPis)
void * Mf_ManGenerateCnf(Gia_Man_t *pGia, int nLutSize, int fCnfObjIds, int fAddOrCla, int fMapping, int fVerbose)
struct Mem_Flex_t_ Mem_Flex_t
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
int sat_solver_nvars(sat_solver *s)
void sat_solver_delete(sat_solver *s)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.