ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
covMinEsop.c File Reference
#include "covInt.h"
Include dependency graph for covMinEsop.c:

Go to the source code of this file.

Functions

void Min_EsopMinimize (Min_Man_t *p)
 FUNCTION DEFINITIONS ///.
 
int Min_EsopAddCubeInt (Min_Man_t *p, Min_Cube_t *pCube)
 
void Min_EsopAddCube (Min_Man_t *p, Min_Cube_t *pCube)
 

Function Documentation

◆ Min_EsopAddCube()

void Min_EsopAddCube ( Min_Man_t * p,
Min_Cube_t * pCube )

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

Synopsis [Adds the cube to storage.]

Description []

SideEffects []

SeeAlso []

Definition at line 291 of file covMinEsop.c.

292{
293 assert( pCube != p->pBubble );
294 assert( (int)pCube->nLits == Min_CubeCountLits(pCube) );
295 while ( Min_EsopAddCubeInt( p, pCube ) );
296}
int Min_EsopAddCubeInt(Min_Man_t *p, Min_Cube_t *pCube)
Definition covMinEsop.c:220
Cube * p
Definition exorList.c:222
unsigned nLits
Definition covInt.h:59
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Min_EsopAddCubeInt()

int Min_EsopAddCubeInt ( Min_Man_t * p,
Min_Cube_t * pCube )

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

Synopsis [Adds the cube to storage.]

Description [Returns 0 if the cube is added or removed. Returns 1 if the cube is glued with some other cube and has to be added again. Do not forget to clean the storage!]

SideEffects []

SeeAlso []

Definition at line 220 of file covMinEsop.c.

221{
222 Min_Cube_t * pThis, ** ppPrev;
223 // try to find the identical cube
224 Min_CoverForEachCubePrev( p->ppStore[pCube->nLits], pThis, ppPrev )
225 {
226 if ( Min_CubesAreEqual( pCube, pThis ) )
227 {
228 *ppPrev = pThis->pNext;
229 Min_CubeRecycle( p, pCube );
230 Min_CubeRecycle( p, pThis );
231 p->nCubes--;
232 return 0;
233 }
234 }
235 // find a distance-1 cube if it exists
236 if ( pCube->nLits < pCube->nVars )
237 Min_CoverForEachCubePrev( p->ppStore[pCube->nLits+1], pThis, ppPrev )
238 {
239 if ( Min_CubesDistOne( pCube, pThis, p->pTemp ) )
240 {
241 *ppPrev = pThis->pNext;
242 Min_CubesTransform( pCube, pThis, p->pTemp );
243 pCube->nLits++;
244 Min_CubeRecycle( p, pThis );
245 p->nCubes--;
246 return 1;
247 }
248 }
249 Min_CoverForEachCubePrev( p->ppStore[pCube->nLits], pThis, ppPrev )
250 {
251 if ( Min_CubesDistOne( pCube, pThis, p->pTemp ) )
252 {
253 *ppPrev = pThis->pNext;
254 Min_CubesTransform( pCube, pThis, p->pTemp );
255 pCube->nLits--;
256 Min_CubeRecycle( p, pThis );
257 p->nCubes--;
258 return 1;
259 }
260 }
261 if ( pCube->nLits > 0 )
262 Min_CoverForEachCubePrev( p->ppStore[pCube->nLits-1], pThis, ppPrev )
263 {
264 if ( Min_CubesDistOne( pCube, pThis, p->pTemp ) )
265 {
266 *ppPrev = pThis->pNext;
267 Min_CubesTransform( pCube, pThis, p->pTemp );
268 Min_CubeRecycle( p, pThis );
269 p->nCubes--;
270 return 1;
271 }
272 }
273 // add the cube
274 pCube->pNext = p->ppStore[pCube->nLits];
275 p->ppStore[pCube->nLits] = pCube;
276 p->nCubes++;
277 return 0;
278}
struct Min_Cube_t_ Min_Cube_t
Definition covInt.h:35
#define Min_CoverForEachCubePrev(pCover, pCube, ppPrev)
Definition covInt.h:75
unsigned nVars
Definition covInt.h:57
Min_Cube_t * pNext
Definition covInt.h:56
Here is the caller graph for this function:

◆ Min_EsopMinimize()

void Min_EsopMinimize ( Min_Man_t * p)

FUNCTION DEFINITIONS ///.

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 47 of file covMinEsop.c.

48{
49 int nCubesInit, nCubesOld, nIter;
50 if ( p->nCubes < 3 )
51 return;
52 nIter = 0;
53 nCubesInit = p->nCubes;
54 do {
55 nCubesOld = p->nCubes;
56 Min_EsopRewrite( p );
57 nIter++;
58 }
59 while ( 100.0*(nCubesOld - p->nCubes)/nCubesOld > 3.0 );
60
61// printf( "%d:%d->%d ", nIter, nCubesInit, p->nCubes );
62}
Here is the caller graph for this function: