ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
giaEsop.c File Reference
#include "gia.h"
#include "misc/extra/extra.h"
#include "misc/vec/vecHsh.h"
#include "misc/vec/vecWec.h"
Include dependency graph for giaEsop.c:

Go to the source code of this file.

Classes

struct  Eso_Man_t_
 

Typedefs

typedef typedefABC_NAMESPACE_IMPL_START struct Eso_Man_t_ Eso_Man_t
 DECLARATIONS ///.
 

Functions

Eso_Man_tEso_ManAlloc (Gia_Man_t *pGia)
 FUNCTION DEFINITIONS ///.
 
void Eso_ManStop (Eso_Man_t *p)
 
void Eso_ManCoverPrint (Eso_Man_t *p, Vec_Int_t *vEsop)
 
Vec_Wec_tEso_ManCoverDerive (Eso_Man_t *p, Vec_Ptr_t *vCover)
 
Gia_Man_tEso_ManCoverConvert (Eso_Man_t *p, Vec_Ptr_t *vCover)
 
int Eso_ManFindDistOneLitEqual (int *pCube1, int *pCube2, int nLits)
 
int Eso_ManFindDistOneLitNotEqual (int *pCube1, int *pCube2, int nLits)
 
void Eso_ManMinimizeAdd (Eso_Man_t *p, int Cube)
 
void Eso_ManMinimizeCopy (Eso_Man_t *p, Vec_Int_t *vEsop)
 
int Eso_ManComputeAnd (Eso_Man_t *p, Vec_Int_t *vCube1, Vec_Int_t *vCube2, Vec_Int_t *vCube)
 
void Eso_ManComputeOne (Eso_Man_t *p, Vec_Int_t *vEsop1, Vec_Int_t *vEsop2, Vec_Int_t *vEsop)
 
Vec_Int_tEso_ManTransformOne (Eso_Man_t *p, Vec_Int_t *vEsop, int fCompl, Vec_Int_t *vRes)
 
Gia_Man_tEso_ManCompute (Gia_Man_t *pGia, int fVerbose, Vec_Wec_t **pvRes)
 

Typedef Documentation

◆ Eso_Man_t

typedef typedefABC_NAMESPACE_IMPL_START struct Eso_Man_t_ Eso_Man_t

DECLARATIONS ///.

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

FileName [giaEsop.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Scalable AIG package.]

Synopsis [ESOP computation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 33 of file giaEsop.c.

Function Documentation

◆ Eso_ManAlloc()

Eso_Man_t * Eso_ManAlloc ( Gia_Man_t * pGia)

FUNCTION DEFINITIONS ///.

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

Synopsis [Computation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 65 of file giaEsop.c.

66{
67 int i, n, Id;
69 p->pGia = pGia;
70 p->nVars = Gia_ManCiNum(pGia);
71 p->Cube1 = ABC_INFINITY;
72 p->vEsops = Vec_WecStart( Gia_ManObjNum(pGia) );
73 p->pHash = Hsh_VecManStart( 1000 );
74 p->vCubes = Vec_WecStart(Gia_ManCiNum(pGia)+1);
75 p->vCube1 = Vec_IntAlloc(Gia_ManCiNum(pGia));
76 p->vCube2 = Vec_IntAlloc(Gia_ManCiNum(pGia));
77 p->vCube = Vec_IntAlloc(Gia_ManCiNum(pGia));
78 Gia_ManForEachCiId( pGia, Id, i )
79 {
80 for ( n = 0; n < 2; n++ )
81 {
82 Vec_IntFill( p->vCube, 1, Abc_Var2Lit(i, n) );
83 Hsh_VecManAdd( p->pHash, p->vCube );
84 }
85 Vec_IntPush( Vec_WecEntry(p->vEsops, Id), Abc_Var2Lit(i, 0) );
86 }
87 return p;
88}
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
Cube * p
Definition exorList.c:222
typedefABC_NAMESPACE_IMPL_START struct Eso_Man_t_ Eso_Man_t
DECLARATIONS ///.
Definition giaEsop.c:33
#define Gia_ManForEachCiId(p, Id, i)
Definition gia.h:1230
Here is the caller graph for this function:

◆ Eso_ManCompute()

Gia_Man_t * Eso_ManCompute ( Gia_Man_t * pGia,
int fVerbose,
Vec_Wec_t ** pvRes )

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

Synopsis [Computes ESOP from AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 489 of file giaEsop.c.

490{
491 abctime clk = Abc_Clock();
492 Vec_Ptr_t * vCover;
493 Gia_Man_t * pNew = NULL;
494 Gia_Obj_t * pObj;
495 int i, nCubes = 0, nCubesUsed = 0;
496 Vec_Int_t * vEsop1, * vEsop2, * vEsop;
497 Eso_Man_t * p = Eso_ManAlloc( pGia );
498 Gia_ManForEachAnd( pGia, pObj, i )
499 {
500 vEsop1 = Vec_WecEntry( p->vEsops, Gia_ObjFaninId0(pObj, i) );
501 vEsop2 = Vec_WecEntry( p->vEsops, Gia_ObjFaninId1(pObj, i) );
502 vEsop1 = Eso_ManTransformOne( p, vEsop1, Gia_ObjFaninC0(pObj), p->vCube1 );
503 vEsop2 = Eso_ManTransformOne( p, vEsop2, Gia_ObjFaninC1(pObj), p->vCube2 );
504 vEsop = Vec_WecEntry( p->vEsops, i );
505 Eso_ManComputeOne( p, vEsop1, vEsop2, vEsop );
506 nCubes += Vec_IntSize(vEsop);
507 }
508 vCover = Vec_PtrAlloc( Gia_ManCoNum(pGia) );
509 Gia_ManForEachCo( pGia, pObj, i )
510 {
511 vEsop1 = Vec_WecEntry( p->vEsops, Gia_ObjFaninId0p(pGia, pObj) );
512 vEsop1 = Eso_ManTransformOne( p, vEsop1, Gia_ObjFaninC0(pObj), p->vCube1 );
513 if ( fVerbose )
514 printf( "Output %3d: ESOP has %5d cubes\n", i, Vec_IntSize(vEsop1) );
515// if ( fVerbose )
516// Eso_ManCoverPrint( p, vEsop1 );
517 Vec_PtrPush( vCover, Vec_IntDup(vEsop1) );
518 nCubesUsed += Vec_IntSize(vEsop1);
519 }
520 if ( fVerbose )
521 {
522 printf( "Outs = %d. Cubes = %d. Used = %d. Hashed = %d. ",
523 Gia_ManCoNum(pGia), nCubes, nCubesUsed, Hsh_VecSize(p->pHash) );
524 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
525 }
526 if ( pvRes )
527 *pvRes = Eso_ManCoverDerive( p, vCover );
528 else
529 pNew = Eso_ManCoverConvert( p, vCover );
530 Vec_VecFree( (Vec_Vec_t *)vCover );
531 Eso_ManStop( p );
532 return pNew;
533}
ABC_INT64_T abctime
Definition abc_global.h:332
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
void Eso_ManComputeOne(Eso_Man_t *p, Vec_Int_t *vEsop1, Vec_Int_t *vEsop2, Vec_Int_t *vEsop)
Definition giaEsop.c:409
Vec_Int_t * Eso_ManTransformOne(Eso_Man_t *p, Vec_Int_t *vEsop, int fCompl, Vec_Int_t *vRes)
Definition giaEsop.c:454
Gia_Man_t * Eso_ManCoverConvert(Eso_Man_t *p, Vec_Ptr_t *vCover)
Definition giaEsop.c:173
void Eso_ManStop(Eso_Man_t *p)
Definition giaEsop.c:89
Vec_Wec_t * Eso_ManCoverDerive(Eso_Man_t *p, Vec_Ptr_t *vCover)
Definition giaEsop.c:146
Eso_Man_t * Eso_ManAlloc(Gia_Man_t *pGia)
FUNCTION DEFINITIONS ///.
Definition giaEsop.c:65
#define Gia_ManForEachAnd(p, pObj, i)
Definition gia.h:1214
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
#define Gia_ManForEachCo(p, pObj, i)
Definition gia.h:1236
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition vecVec.h:42
Here is the call graph for this function:

◆ Eso_ManComputeAnd()

int Eso_ManComputeAnd ( Eso_Man_t * p,
Vec_Int_t * vCube1,
Vec_Int_t * vCube2,
Vec_Int_t * vCube )

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

Synopsis [Compute the produce of two covers.]

Description []

SideEffects []

SeeAlso []

Definition at line 381 of file giaEsop.c.

382{
383 int * pBeg = vCube->pArray;
384 int * pBeg1 = vCube1->pArray;
385 int * pBeg2 = vCube2->pArray;
386 int * pEnd1 = vCube1->pArray + vCube1->nSize;
387 int * pEnd2 = vCube2->pArray + vCube2->nSize;
388 while ( pBeg1 < pEnd1 && pBeg2 < pEnd2 )
389 {
390 if ( *pBeg1 == *pBeg2 )
391 *pBeg++ = *pBeg1++, pBeg2++;
392 else if ( Abc_Lit2Var(*pBeg1) == Abc_Lit2Var(*pBeg2) )
393 return -1;
394 else if ( *pBeg1 < *pBeg2 )
395 *pBeg++ = *pBeg1++;
396 else
397 *pBeg++ = *pBeg2++;
398 }
399 while ( pBeg1 < pEnd1 )
400 *pBeg++ = *pBeg1++;
401 while ( pBeg2 < pEnd2 )
402 *pBeg++ = *pBeg2++;
403 vCube->nSize = pBeg - vCube->pArray;
404 assert( vCube->nSize <= vCube->nCap );
405 assert( vCube->nSize >= vCube1->nSize );
406 assert( vCube->nSize >= vCube2->nSize );
407 return Hsh_VecManAdd( p->pHash, vCube );
408}
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ Eso_ManComputeOne()

void Eso_ManComputeOne ( Eso_Man_t * p,
Vec_Int_t * vEsop1,
Vec_Int_t * vEsop2,
Vec_Int_t * vEsop )

Definition at line 409 of file giaEsop.c.

410{
411 Vec_Int_t vCube1, vCube2;
412 int i, k, Cube1, Cube2, Cube;
413 Vec_IntClear( vEsop );
414 if ( Vec_IntSize(vEsop1) == 0 || Vec_IntSize(vEsop2) == 0 )
415 return;
416 Cube1 = Vec_IntEntry(vEsop1, 0);
417 Cube2 = Vec_IntEntry(vEsop2, 0);
418 Vec_IntForEachEntry( vEsop1, Cube1, i )
419 {
420 if ( Cube1 == p->Cube1 )
421 {
422 Vec_IntForEachEntry( vEsop2, Cube2, k )
423 Eso_ManMinimizeAdd( p, Cube2 );
424 continue;
425 }
426 Vec_IntForEachEntry( vEsop2, Cube2, k )
427 {
428 if ( Cube2 == p->Cube1 )
429 {
430 Eso_ManMinimizeAdd( p, Cube1 );
431 continue;
432 }
433 vCube1 = *Hsh_VecReadEntry( p->pHash, Cube1 );
434 vCube2 = *Hsh_VecReadEntry( p->pHash, Cube2 );
435 Cube = Eso_ManComputeAnd( p, &vCube1, &vCube2, p->vCube );
436 if ( Cube >= 0 )
438 }
439 }
440 Eso_ManMinimizeCopy( p, vEsop );
441}
struct cube Cube
void Eso_ManMinimizeAdd(Eso_Man_t *p, int Cube)
Definition giaEsop.c:252
int Eso_ManComputeAnd(Eso_Man_t *p, Vec_Int_t *vCube1, Vec_Int_t *vCube2, Vec_Int_t *vCube)
Definition giaEsop.c:381
void Eso_ManMinimizeCopy(Eso_Man_t *p, Vec_Int_t *vEsop)
Definition giaEsop.c:352
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Eso_ManCoverConvert()

Gia_Man_t * Eso_ManCoverConvert ( Eso_Man_t * p,
Vec_Ptr_t * vCover )

Definition at line 173 of file giaEsop.c.

174{
175 Vec_Int_t * vEsop;
176 Gia_Man_t * pNew, * pTemp;
177 Gia_Obj_t * pObj; int i;
178 pNew = Gia_ManStart( Gia_ManObjNum(p->pGia) );
179 pNew->pName = Abc_UtilStrsav( p->pGia->pName );
180 pNew->pSpec = Abc_UtilStrsav( p->pGia->pSpec );
181 Gia_ManHashAlloc( pNew );
182 Gia_ManConst0(p->pGia)->Value = 0;
183 Gia_ManForEachCi( p->pGia, pObj, i )
184 pObj->Value = Gia_ManAppendCi(pNew);
185 Vec_PtrForEachEntry( Vec_Int_t *, vCover, vEsop, i )
186 {
187 if ( Vec_IntSize(vEsop) > 0 )
188 {
189 int c, Cube, iRoot = 0;
190 Vec_IntForEachEntry( vEsop, Cube, c )
191 {
192 int k, Lit, iAnd = 1;
193 if ( Cube != p->Cube1 )
194 {
195 Vec_Int_t * vCube = Eso_ManCube( p, Cube );
196 Vec_IntForEachEntry( vCube, Lit, k )
197 iAnd = Gia_ManHashAnd( pNew, iAnd, Lit + 2 );
198 }
199 iRoot = Gia_ManHashXor( pNew, iRoot, iAnd );
200 }
201 Gia_ManAppendCo( pNew, iRoot );
202 }
203 else
204 Gia_ManAppendCo( pNew, 0 );
205 }
206 // cleanup
207 pNew = Gia_ManCleanup( pTemp = pNew );
208 Gia_ManStop( pTemp );
209 return pNew;
210}
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition giaHash.c:105
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:668
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition giaScl.c:84
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:576
#define Gia_ManForEachCi(p, pObj, i)
Definition gia.h:1228
char * pSpec
Definition gia.h:100
char * pName
Definition gia.h:99
unsigned Value
Definition gia.h:89
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Eso_ManCoverDerive()

Vec_Wec_t * Eso_ManCoverDerive ( Eso_Man_t * p,
Vec_Ptr_t * vCover )

Definition at line 146 of file giaEsop.c.

147{
148 Vec_Wec_t * vRes;
149 Vec_Int_t * vEsop, * vLevel; int i;
150 vRes = Vec_WecAlloc( Vec_VecSizeSize((Vec_Vec_t *)vCover) );
151 Vec_PtrForEachEntry( Vec_Int_t *, vCover, vEsop, i )
152 {
153 if ( Vec_IntSize(vEsop) > 0 )
154 {
155 int c, Cube;
156 Vec_IntForEachEntry( vEsop, Cube, c )
157 {
158 vLevel = Vec_WecPushLevel( vRes );
159 if ( Cube != p->Cube1 )
160 {
161 int k, Lit;
162 Vec_Int_t * vCube = Eso_ManCube( p, Cube );
163 Vec_IntForEachEntry( vCube, Lit, k )
164 Vec_IntPush( vLevel, Lit );
165 }
166 Vec_IntPush( vLevel, -i-1 );
167 }
168 }
169 }
170 //assert( Abc_MaxInt(Vec_WecSize(vRes), 8) == Vec_WecCap(vRes) );
171 return vRes;
172}
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
Definition vecWec.h:42
Here is the caller graph for this function:

◆ Eso_ManCoverPrint()

void Eso_ManCoverPrint ( Eso_Man_t * p,
Vec_Int_t * vEsop )

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

Synopsis [Printing/transforming the cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 112 of file giaEsop.c.

113{
114 Vec_Str_t * vStr;
115 Vec_Int_t * vCube;
116 int i, k, Lit, Cube;
117 if ( Vec_IntSize(vEsop) == 0 )
118 {
119 printf( "Const 0\n" );
120 return;
121 }
122 vStr = Vec_StrAlloc( p->nVars + 4 );
123 Vec_StrFill( vStr, p->nVars, '-' );
124 Vec_StrPush( vStr, ' ' );
125 Vec_StrPush( vStr, '1' );
126 Vec_StrPush( vStr, '\n' );
127 Vec_StrPush( vStr, '\0' );
128 assert( Vec_IntSize(vEsop) > 0 );
129 Vec_IntForEachEntry( vEsop, Cube, i )
130 {
131 if ( Cube == p->Cube1 )
132 printf( "%s", Vec_StrArray(vStr) );
133 else
134 {
135 vCube = Eso_ManCube( p, Cube );
136 Vec_IntForEachEntry( vCube, Lit, k )
137 Vec_StrWriteEntry( vStr, Abc_Lit2Var(Lit), (char)(Abc_LitIsCompl(Lit)?'0':'1') );
138 printf( "%s", Vec_StrArray(vStr) );
139 Vec_IntForEachEntry( vCube, Lit, k )
140 Vec_StrWriteEntry( vStr, Abc_Lit2Var(Lit), '-' );
141 }
142 }
143 printf( "\n" );
144 Vec_StrFree( vStr );
145}
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46

◆ Eso_ManFindDistOneLitEqual()

int Eso_ManFindDistOneLitEqual ( int * pCube1,
int * pCube2,
int nLits )

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

Synopsis [Minimization.]

Description []

SideEffects []

SeeAlso []

Definition at line 223 of file giaEsop.c.

224{
225 int i, iDiff = -1;
226 for ( i = 0; i < nLits; i++ )
227 if ( pCube1[i] != pCube2[i] )
228 {
229 if ( iDiff != -1 )
230 return -1;
231 if ( Abc_Lit2Var(pCube1[i]) != Abc_Lit2Var(pCube2[i]) )
232 return -1;
233 iDiff = i;
234 }
235 return iDiff;
236}
Here is the caller graph for this function:

◆ Eso_ManFindDistOneLitNotEqual()

int Eso_ManFindDistOneLitNotEqual ( int * pCube1,
int * pCube2,
int nLits )

Definition at line 237 of file giaEsop.c.

238{
239 int i, k, iDiff = -1;
240 for ( i = k = 0; i < nLits; i++, k++ )
241 if ( pCube1[i] != pCube2[k] )
242 {
243 if ( iDiff != -1 )
244 return -1;
245 iDiff = i;
246 i--;
247 }
248 if ( iDiff == -1 )
249 iDiff = nLits;
250 return iDiff;
251}
Here is the caller graph for this function:

◆ Eso_ManMinimizeAdd()

void Eso_ManMinimizeAdd ( Eso_Man_t * p,
int Cube )

Definition at line 252 of file giaEsop.c.

253{
254 int fMimimize = 1;
255 Vec_Int_t * vCube = (Cube == p->Cube1) ? NULL : Eso_ManCube(p, Cube);
256 int * pCube2, * pCube = (Cube == p->Cube1) ? NULL : Vec_IntArray(vCube);
257 int Cube2, nLits = (Cube == p->Cube1) ? 0 : Vec_IntSize(vCube);
258 Vec_Int_t * vLevel = Vec_WecEntry( p->vCubes, nLits );
259 int c, k, iLit, iPlace = Vec_IntFind( vLevel, Cube );
260 if ( iPlace >= 0 ) // identical found
261 {
262 Vec_IntDrop( vLevel, iPlace );
263 return;
264 }
265 if ( Cube == p->Cube1 ) // simple case
266 {
267 assert( Vec_IntSize(vLevel) == 0 );
268 Vec_IntPush( vLevel, Cube );
269 return;
270 }
271 // look for distance-1 in next bin
272 if ( fMimimize && nLits < p->nVars - 1 )
273 {
274 Vec_Int_t * vLevel = Vec_WecEntry( p->vCubes, nLits+1 );
275 Vec_IntForEachEntry( vLevel, Cube2, c )
276 {
277 pCube2 = Hsh_VecReadArray( p->pHash, Cube2 );
278 iLit = Eso_ManFindDistOneLitNotEqual( pCube, pCube2, nLits );
279 if ( iLit == -1 )
280 continue;
281 // remove this cube
282 Vec_IntDrop( vLevel, c );
283 // create new cube
284 Vec_IntClear( p->vCube );
285 for ( k = 0; k <= nLits; k++ )
286 Vec_IntPush( p->vCube, Abc_LitNotCond(pCube2[k], k == iLit) );
287 Cube = Hsh_VecManAdd( p->pHash, p->vCube );
288 // try to add new cube
290 return;
291 }
292 }
293 // look for distance-1 in the same bin
294 if ( fMimimize )
295 {
296 Vec_IntForEachEntry( vLevel, Cube2, c )
297 {
298 pCube2 = Hsh_VecReadArray( p->pHash, Cube2 );
299 iLit = Eso_ManFindDistOneLitEqual( pCube2, pCube, nLits );
300 if ( iLit == -1 )
301 continue;
302 // remove this cube
303 Vec_IntDrop( vLevel, c );
304 // create new cube
305 Vec_IntClear( p->vCube );
306 for ( k = 0; k < nLits; k++ )
307 if ( k != iLit )
308 Vec_IntPush( p->vCube, pCube[k] );
309 if ( Vec_IntSize(p->vCube) == 0 )
310 Cube = p->Cube1;
311 else
312 Cube = Hsh_VecManAdd( p->pHash, p->vCube );
313 // try to add new cube
315 return;
316 }
317 }
318 assert( nLits > 0 );
319 if ( fMimimize && nLits > 0 )
320 {
321 // look for distance-1 in the previous bin
322 Vec_Int_t * vLevel = Vec_WecEntry( p->vCubes, nLits-1 );
323 // check for the case of one-literal cube
324 if ( nLits == 1 && Vec_IntSize(vLevel) == 1 )
325 {
326 Vec_IntDrop( vLevel, 0 );
327 Cube = Abc_LitNot( Cube );
328 }
329 else
330 Vec_IntForEachEntry( vLevel, Cube2, c )
331 {
332 pCube2 = Hsh_VecReadArray( p->pHash, Cube2 );
333 iLit = Eso_ManFindDistOneLitNotEqual( pCube2, pCube, nLits-1 );
334 if ( iLit == -1 )
335 continue;
336 // remove this cube
337 Vec_IntDrop( vLevel, c );
338 // create new cube
339 Vec_IntClear( p->vCube );
340 for ( k = 0; k < nLits; k++ )
341 Vec_IntPush( p->vCube, Abc_LitNotCond(pCube[k], k == iLit) );
342 Cube = Hsh_VecManAdd( p->pHash, p->vCube );
343 // try to add new cube
345 return;
346 }
347 }
348 // could not find - simply add this cube
349 Vec_IntPush( vLevel, Cube );
350}
int Eso_ManFindDistOneLitNotEqual(int *pCube1, int *pCube2, int nLits)
Definition giaEsop.c:237
int Eso_ManFindDistOneLitEqual(int *pCube1, int *pCube2, int nLits)
Definition giaEsop.c:223
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Eso_ManMinimizeCopy()

void Eso_ManMinimizeCopy ( Eso_Man_t * p,
Vec_Int_t * vEsop )

Definition at line 352 of file giaEsop.c.

353{
354 Vec_Int_t * vLevel;
355 int i;
356 Vec_IntClear( vEsop );
357 Vec_WecForEachLevel( p->vCubes, vLevel, i )
358 {
359 Vec_IntAppend( vEsop, vLevel );
360 if ( i > 0 )
361 {
362 int k, Cube;
363 Vec_IntForEachEntry( vLevel, Cube, k )
364 assert( Vec_IntSize(Eso_ManCube(p, Cube)) == i );
365 }
366 Vec_IntClear( vLevel );
367 }
368}
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition vecWec.h:55
Here is the caller graph for this function:

◆ Eso_ManStop()

void Eso_ManStop ( Eso_Man_t * p)

Definition at line 89 of file giaEsop.c.

90{
91 Vec_WecFree( p->vEsops );
92 Hsh_VecManStop( p->pHash );
93 Vec_WecFree( p->vCubes );
94 Vec_IntFree( p->vCube1 );
95 Vec_IntFree( p->vCube2 );
96 Vec_IntFree( p->vCube );
97 ABC_FREE( p );
98}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function:

◆ Eso_ManTransformOne()

Vec_Int_t * Eso_ManTransformOne ( Eso_Man_t * p,
Vec_Int_t * vEsop,
int fCompl,
Vec_Int_t * vRes )

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

Synopsis [Complements the cover if needed, or just copy it.]

Description []

SideEffects []

SeeAlso []

Definition at line 454 of file giaEsop.c.

455{
456 int i, Cube, Start = 0;
457 Vec_IntClear( vRes );
458 if ( fCompl )
459 {
460 if ( Vec_IntSize(vEsop) == 0 )
461 Vec_IntPush( vRes, p->Cube1 );
462 else
463 {
464 Cube = Vec_IntEntry(vEsop, 0);
465 if ( Cube == p->Cube1 )
466 Start = 1;
467 else if ( Cube < 2 * p->nVars )
468 Vec_IntPush( vRes, Abc_LitNot(Cube) ), Start = 1;
469 else
470 Vec_IntPush( vRes, p->Cube1 );
471 }
472 }
473 Vec_IntForEachEntryStart( vEsop, Cube, i, Start )
474 Vec_IntPush( vRes, Cube );
475 return vRes;
476}
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
Definition vecInt.h:56
Here is the caller graph for this function: