31#define KIT_FACTOR_MEM_LIMIT (1<<20)
67 if ( Vec_IntSize(vCover) == 0 )
69 if ( Vec_IntSize(vCover) == 1 && Vec_IntEntry(vCover, 0) == 0 )
82 eRoot = Kit_SopFactor_rec( pFForm, cSop, 2 * nVars, vMemory );
84 Kit_GraphSetRoot( pFForm, eRoot );
86 Kit_GraphComplement( pFForm );
111 Kit_Sop_t * cDiv = &Div, * cQuo = &Quo, * cRem = &Rem, * cCom = &Com;
112 Kit_Edge_t eNodeDiv, eNodeQuo, eNodeRem, eNodeAnd;
115 assert( Kit_SopCubeNum(cSop) > 0 );
119 return Kit_SopFactorTrivial( pFForm, cSop, nLits );
125 assert( Kit_SopCubeNum(cQuo) > 0 );
126 if ( Kit_SopCubeNum(cQuo) == 1 )
127 return Kit_SopFactorLF_rec( pFForm, cSop, cQuo, nLits, vMemory );
138 eNodeDiv = Kit_SopFactor_rec( pFForm, cDiv, nLits, vMemory );
139 eNodeQuo = Kit_SopFactor_rec( pFForm, cQuo, nLits, vMemory );
141 if ( Kit_SopCubeNum(cRem) == 0 )
143 eNodeRem = Kit_SopFactor_rec( pFForm, cRem, nLits, vMemory );
151 return Kit_SopFactorLF_rec( pFForm, cSop, cCom, nLits, vMemory );
169 Kit_Sop_t * cDiv = &Div, * cQuo = &Quo, * cRem = &Rem;
170 Kit_Edge_t eNodeDiv, eNodeQuo, eNodeRem, eNodeAnd;
171 assert( Kit_SopCubeNum(cSimple) == 1 );
177 eNodeDiv = Kit_SopFactorTrivialCube( pFForm, Kit_SopCube(cDiv, 0), nLits );
179 eNodeQuo = Kit_SopFactor_rec( pFForm, cQuo, nLits, vMemory );
181 if ( Kit_SopCubeNum(cRem) == 0 )
183 eNodeRem = Kit_SopFactor_rec( pFForm, cRem, nLits, vMemory );
202 int i, iLit = -1, nLits, nLits1, nLits2;
206 for ( i = nStart; i < nFinish; i++ )
207 if ( Kit_CubeHasLit(uCube, i) )
215 return Kit_EdgeCreate( iLit/2, iLit%2 );
218 nLits2 = nLits - nLits1;
223 for ( i = nStart; i < nFinish; i++ )
224 if ( Kit_CubeHasLit(uCube, i) )
226 if ( nLits == nLits1 )
266 int nCubes1, nCubes2;
271 nCubes2 = nCubes - nCubes1;
316 vCover = Vec_IntAlloc( 0 );
321 vMemory = Vec_IntAlloc( 0 );
330 printf(
"Vars = %2d. Cubes = %3d. FFNodes = %3d. FF_memory = %3d.\n",
331 nVars, Vec_IntSize(vCover), Kit_GraphNodeNum(pGraph), Vec_IntSize(vMemory) );
333 Vec_IntFree( vMemory );
334 Vec_IntFree( vCover );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Kit_Graph_t * Kit_SopFactor(Vec_Int_t *vCover, int fCompl, int nVars, Vec_Int_t *vMemory)
FUNCTION DEFINITIONS ///.
#define KIT_FACTOR_MEM_LIMIT
DECLARATIONS ///.
int Kit_SopFactorVerify(Vec_Int_t *cSop, Kit_Graph_t *pFForm, int nVars)
Kit_Edge_t Kit_SopFactorTrivial_rec(Kit_Graph_t *pFForm, unsigned *pCubes, int nCubes, int nLits)
void Kit_FactorTest(unsigned *pTruth, int nVars)
Kit_Edge_t Kit_SopFactorTrivialCube_rec(Kit_Graph_t *pFForm, unsigned uCube, int nStart, int nFinish)
struct Kit_Graph_t_ Kit_Graph_t
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
void Kit_SopMakeCubeFree(Kit_Sop_t *cSop)
Kit_Edge_t Kit_GraphAddNodeAnd(Kit_Graph_t *pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1)
typedefABC_NAMESPACE_HEADER_START struct Kit_Sop_t_ Kit_Sop_t
INCLUDES ///.
Kit_Graph_t * Kit_GraphCreateConst1()
void Kit_SopCommonCubeCover(Kit_Sop_t *cResult, Kit_Sop_t *cSop, Vec_Int_t *vMemory)
void Kit_SopCreateInverse(Kit_Sop_t *cResult, Vec_Int_t *vInput, int nVars, Vec_Int_t *vMemory)
int Kit_SopIsCubeFree(Kit_Sop_t *cSop)
void Kit_GraphFree(Kit_Graph_t *pGraph)
Kit_Edge_t Kit_GraphAddNodeOr(Kit_Graph_t *pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1)
void Kit_SopDivideByCube(Kit_Sop_t *cSop, Kit_Sop_t *cDiv, Kit_Sop_t *vQuo, Kit_Sop_t *vRem, Vec_Int_t *vMemory)
Kit_Graph_t * Kit_GraphCreate(int nLeaves)
DECLARATIONS ///.
Kit_Graph_t * Kit_GraphCreateConst0()
int Kit_SopDivisor(Kit_Sop_t *cResult, Kit_Sop_t *cSop, int nLits, Vec_Int_t *vMemory)
struct Kit_Edge_t_ Kit_Edge_t
void Kit_SopDivideInternal(Kit_Sop_t *cSop, Kit_Sop_t *cDiv, Kit_Sop_t *vQuo, Kit_Sop_t *vRem, Vec_Int_t *vMemory)
void Kit_SopBestLiteralCover(Kit_Sop_t *cResult, Kit_Sop_t *cSop, unsigned uCube, int nLits, Vec_Int_t *vMemory)