60 for ( k = 0; k < pCut->
nFanins; k++ )
84 int Lits[4], Cube, iCube, i, b;
86 for ( i = 0; i < nCubes; i++ )
89 for ( b = 0; b < 4; b++ )
93 else if ( Cube % 3 == 1 )
100 for ( b = 0; b < 4; b++ )
101 iCube = (iCube << 2) | Lits[b];
119 int nLits = 0, Cube, i, b;
120 for ( i = 0; i < nCubes; i++ )
123 for ( b = 0; b < 4; b++ )
146 int nLits = 0, Cube, i, b;
149 for ( b = 0; b < nVars; b++ )
151 if ( (Cube & 3) == 1 || (Cube & 3) == 2 )
172 int nLits = nVars, b;
173 for ( b = 0; b < nVars; b++ )
175 if ( (Cube & 3) == 1 )
176 *pLiterals++ = 2 * pVars[b];
177 else if ( (Cube & 3) == 2 )
178 *pLiterals++ = 2 * pVars[b] + 1;
201 int fChangeVariableOrder = 0;
206 int OutVar, PoVar, pVars[32], * pLits, ** pClas;
208 int i, k, nLiterals, nClauses, Cube, Number;
211 nLiterals = 1 +
Aig_ManCoNum( p->pManAig ) + 3 * nOutputs;
222 nLiterals +=
Cnf_SopCountLiterals( p->pSops[uTruth], p->pSopSizes[uTruth] ) + p->pSopSizes[uTruth];
223 assert( p->pSopSizes[uTruth] >= 0 );
224 nClauses += p->pSopSizes[uTruth];
235 nLiterals +=
Cnf_SopCountLiterals( p->pSops[uTruth], p->pSopSizes[uTruth] ) + p->pSopSizes[uTruth];
236 assert( p->pSopSizes[uTruth] >= 0 );
237 nClauses += p->pSopSizes[uTruth];
250 pCnf->
pMan = p->pManAig;
262 if ( !fChangeVariableOrder )
288 pCnf->
nVars = Number;
294 pCnf->
nVars = Number + 1;
330 for ( k = 0; k < (int)pCut->
nFanins; k++ )
344 vCover = pCut->
vIsop[1];
348 *pLits++ = 2 * OutVar;
360 vCover = pCut->
vIsop[0];
364 *pLits++ = 2 * OutVar + 1;
374 *pLits++ = 2 * OutVar;
390 *pLits++ = 2 * PoVar;
394 *pLits++ = 2 * PoVar + 1;
425 int OutVar, PoVar, pVars[32], * pLits, ** pClas;
427 int i, k, nLiterals, nClauses, Cube;
440 nLiterals +=
Cnf_SopCountLiterals( p->pSops[uTruth], p->pSopSizes[uTruth] ) + p->pSopSizes[uTruth];
441 assert( p->pSopSizes[uTruth] >= 0 );
442 nClauses += p->pSopSizes[uTruth];
453 nLiterals +=
Cnf_SopCountLiterals( p->pSops[uTruth], p->pSopSizes[uTruth] ) + p->pSopSizes[uTruth];
454 assert( p->pSopSizes[uTruth] >= 0 );
455 nClauses += p->pSopSizes[uTruth];
466 pCnf->
pMan = p->pManAig;
477 pCnf->
nVars = Aig_ManObjNumMax(p->pManAig);
497 for ( k = 0; k < (int)pCut->
nFanins; k++ )
511 vCover = pCut->
vIsop[1];
515 *pLits++ = 2 * OutVar;
528 vCover = pCut->
vIsop[0];
532 *pLits++ = 2 * OutVar + 1;
550 *pLits++ = 2 * PoVar;
554 *pLits++ = 2 * PoVar + 1;
564 *pLits++ = 2 * OutVar;
591 int OutVar, PoVar, pVars[32], * pLits, ** pClas;
592 int i, nLiterals, nClauses, Number;
630 pCnf->
nVars = Number;
649 *pLits++ = 2 * OutVar;
654 *pLits++ = 2 * OutVar + 1;
657 *pLits++ = 2 * OutVar + 1;
665 *pLits++ = 2 * OutVar;
681 *pLits++ = 2 * PoVar;
685 *pLits++ = 2 * PoVar + 1;
713 int OutVar, PoVar, pVars[32], * pLits, ** pClas;
714 int i, nLiterals, nClauses, Number;
746 pCnf->
nVars = Number;
758 *pLits++ = 2 * OutVar;
763 *pLits++ = 2 * OutVar + 1;
766 *pLits++ = 2 * OutVar + 1;
774 *pLits++ = 2 * OutVar;
783 *pLits++ = 2 * PoVar;
787 *pLits++ = 2 * PoVar + 1;
791 *pLits++ = 2 * PoVar + 1;
static Cnf_Cut_t * Cnf_ObjBestCut(Aig_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Cnf_Dat_t * Cnf_ManWriteCnfOther(Cnf_Man_t *p, Vec_Ptr_t *vMapped)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
#define Aig_ManForEachCo(p, pObj, i)
#define ABC_ALLOC(type, num)
Cnf_Dat_t * Cnf_ManWriteCnf(Cnf_Man_t *p, Vec_Ptr_t *vMapped, int nOutputs)
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static int Aig_ManNodeNum(Aig_Man_t *p)
static unsigned * Cnf_CutTruth(Cnf_Cut_t *pCut)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static int Aig_ManCoNum(Aig_Man_t *p)
static Vec_Int_t * Vec_IntStart(int nSize)
#define Aig_ManForEachNode(p, pObj, i)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define ABC_NAMESPACE_IMPL_END
Cnf_Dat_t * Cnf_DeriveSimpleForRetiming(Aig_Man_t *p)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
int Cnf_IsopWriteCube(int Cube, int nVars, int *pVars, int *pLiterals)
void Cnf_SopConvertToVector(char *pSop, int nCubes, Vec_Int_t *vCover)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static int Aig_ManObjNumMax(Aig_Man_t *p)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static int Aig_ManRegNum(Aig_Man_t *p)
static int Vec_IntSize(Vec_Int_t *p)
#define ABC_CALLOC(type, num)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
static int Aig_ObjId(Aig_Obj_t *pObj)
#define Aig_ManForEachLiSeq(p, pObj, i)
ABC_NAMESPACE_IMPL_START Vec_Int_t * Cnf_ManWriteCnfMapping(Cnf_Man_t *p, Vec_Ptr_t *vMapped)
DECLARATIONS ///.
int Cnf_IsopCountLiterals(Vec_Int_t *vIsop, int nVars)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Cnf_Man_t_ Cnf_Man_t
INCLUDES ///.
int Cnf_SopCountLiterals(char *pSop, int nCubes)
static void Vec_IntClear(Vec_Int_t *p)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Cnf_Dat_t * Cnf_DeriveSimple(Aig_Man_t *p, int nOutputs)