35#define GA2_BIG_NUM 0x3FFFFFF0
84static inline int Ga2_ObjId(
Ga2_Man_t *
p,
Gia_Obj_t * pObj ) {
return Vec_IntEntry(
p->vIds, Gia_ObjId(
p->pGia, pObj)); }
85static inline void Ga2_ObjSetId(
Ga2_Man_t *
p,
Gia_Obj_t * pObj,
int i ) { Vec_IntWriteEntry(
p->vIds, Gia_ObjId(
p->pGia, pObj), i); }
90static inline int Ga2_ObjIsAbs0(
Ga2_Man_t *
p,
Gia_Obj_t * pObj ) {
assert(Ga2_ObjId(
p,pObj) >= 0);
return Ga2_ObjId(
p,pObj) >= 0 && Ga2_ObjId(
p,pObj) <
p->LimAbs; }
91static inline int Ga2_ObjIsLeaf0(
Ga2_Man_t *
p,
Gia_Obj_t * pObj ) {
assert(Ga2_ObjId(
p,pObj) >= 0);
return Ga2_ObjId(
p,pObj) >=
p->LimAbs && Ga2_ObjId(
p,pObj) <
p->LimPpi; }
92static inline int Ga2_ObjIsAbs(
Ga2_Man_t *
p,
Gia_Obj_t * pObj ) {
return Ga2_ObjId(
p,pObj) >= 0 && Ga2_ObjCnf0(
p,pObj); }
93static inline int Ga2_ObjIsLeaf(
Ga2_Man_t *
p,
Gia_Obj_t * pObj ) {
return Ga2_ObjId(
p,pObj) >= 0 && !Ga2_ObjCnf0(
p,pObj); }
101 assert( Ga2_ObjId(
p,pObj) >= 0 && Ga2_ObjId(
p,pObj) < Vec_IntSize(
p->vValues) );
102 return Vec_IntEntry( Ga2_MapFrameMap(
p, f), Ga2_ObjId(
p,pObj) );
108 assert( Ga2_ObjFindLit(
p, pObj, f) == -1 );
109 Vec_IntSetEntry( Ga2_MapFrameMap(
p, f), Ga2_ObjId(
p,pObj), Lit );
114 int Lit = Ga2_ObjFindLit(
p, pObj, f );
117 Lit = toLitCond(
p->nSatVars++, 0 );
118 Ga2_ObjAddLit(
p, pObj, f, Lit );
143 if ( pObj->
fPhase && !fFirst )
145 assert( Gia_ObjIsAnd(pObj) );
148 return (Gia_ObjFaninC0(pObj) ? ~Val0 : Val0) & (Gia_ObjFaninC1(pObj) ? ~Val1 : Val1);
152 static unsigned uTruth5[5] = { 0xAAAAAAAA, 0xCCCCCCCC, 0xF0F0F0F0, 0xFF00FF00, 0xFFFF0000 };
157 pObj->
Value = uTruth5[i];
179 if ( pObj->
fPhase && !fFirst )
183 if ( Val0 + Val1 < N )
185 if ( Val0 + Val1 == N )
190 assert( Val0 + Val1 > N );
191 assert( Val0 < N && Val1 < N );
194 Gia_ObjFanin0(pObj)->fPhase = 1;
199 Gia_ObjFanin1(pObj)->fPhase = 1;
202 if ( Val0 + Val1 < N )
204 if ( Val0 + Val1 == N )
217 if ( (!Gia_ObjFanin0(pObj)->fPhase && Gia_ObjFaninC0(pObj)) ||
218 (!Gia_ObjFanin1(pObj)->fPhase && Gia_ObjFaninC1(pObj)) )
224 if ( pObj->
fPhase && !fFirst )
226 assert( Gia_ObjIsAnd(pObj) );
229 Vec_IntPush( vNodes, Gia_ObjId(
p, pObj) );
234 if ( pObj->
fPhase && !fFirst )
236 Vec_IntPushUnique( vLeaves, Gia_ObjId(
p, pObj) );
239 assert( Gia_ObjIsAnd(pObj) );
245 static unsigned uTruth5[5] = { 0xAAAAAAAA, 0xCCCCCCCC, 0xF0F0F0F0, 0xFF00FF00, 0xFFFF0000 };
249 int i, k, Leaf, CountMarks;
251 vLeaves = Vec_IntAlloc( 100 );
256 pObj->
fPhase = !Gia_ObjIsCo(pObj);
264 if ( !Gia_ObjIsAnd(pObj) )
266 Gia_ObjFanin0(pObj)->Value++;
267 Gia_ObjFanin1(pObj)->Value++;
270 Gia_ObjFanin0(Gia_ObjFanin0(pObj))->Value++;
271 Gia_ObjFanin1(Gia_ObjFanin0(pObj))->Value++;
272 Gia_ObjFanin0(Gia_ObjFanin1(pObj))->Value++;
273 Gia_ObjFanin1(Gia_ObjFanin1(pObj))->Value++;
278 if ( Gia_ObjIsAnd(pObj) )
280 else if ( Gia_ObjIsCo(pObj) )
281 Gia_ObjFanin0(pObj)->fPhase = 1;
290 Vec_IntClear( vLeaves );
292 if ( Vec_IntSize(vLeaves) > N )
298 Vec_IntFreeP( &
p->vMapping );
299 p->vMapping = Vec_IntStart( Gia_ManObjNum(
p) );
304 assert( Gia_ObjFanin0(pObjRi)->fPhase );
306 Vec_IntWriteEntry(
p->vMapping, Gia_ObjId(
p, pObj), Vec_IntSize(
p->vMapping) );
307 Vec_IntPush(
p->vMapping, 1 );
308 Vec_IntPush(
p->vMapping, Gia_ObjFaninId0p(
p, pObjRi) );
309 Vec_IntPush(
p->vMapping, Gia_ObjFaninC0(pObjRi) ? 0x55555555 : 0xAAAAAAAA );
310 Vec_IntPush(
p->vMapping, -1 );
312 CountMarks = Gia_ManRegNum(
p);
317 Vec_IntClear( vLeaves );
319 assert( Vec_IntSize(vLeaves) <= N );
321 Vec_IntWriteEntry(
p->vMapping, i, Vec_IntSize(
p->vMapping) );
322 Vec_IntPush(
p->vMapping, Vec_IntSize(vLeaves) );
325 Vec_IntPush(
p->vMapping, Leaf );
326 Gia_ManObj(
p, Leaf)->Value = uTruth5[k];
327 assert( Gia_ManObj(
p, Leaf)->fPhase );
330 Vec_IntPush(
p->vMapping, -1 );
334 Vec_IntFree( vLeaves );
346 Abc_PrintTime( 1,
"Time", Abc_Clock() - clk );
357 Abc_Print( 1,
"Marked AND nodes = %6d. ", Counter );
358 Abc_PrintTime( 1,
"Time", Abc_Clock() - clk );
376 p->timeStart = Abc_Clock();
383 p->vCnfs = Vec_PtrAlloc( 1000 );
384 Vec_PtrPush(
p->vCnfs, Vec_IntAlloc(0) );
385 Vec_PtrPush(
p->vCnfs, Vec_IntAlloc(0) );
387 p->vIds = Vec_IntStartFull( Gia_ManObjNum(pGia) );
388 p->vProofIds = Vec_IntAlloc( 0 );
389 p->vAbs = Vec_IntAlloc( 1000 );
390 p->vValues = Vec_IntAlloc( 1000 );
392 Ga2_ObjSetId(
p, Gia_ManConst0(pGia), 0 );
393 Vec_IntPush(
p->vValues, 0 );
394 Vec_IntPush(
p->vAbs, 0 );
399 p->vId2Lit = Vec_PtrAlloc( 1000 );
401 p->vLits = Vec_IntAlloc( 100 );
402 p->vIsopMem = Vec_IntAlloc( 100 );
405 p->nTable = Abc_PrimeCudd(1<<18);
414 sprintf( pFileName,
"stats_gla%s%s.txt", fUseN ?
"n":
"", pPars->fUseFullProof ?
"p":
"" );
416 pFile = fopen( pFileName,
"a+" );
418 fprintf( pFile,
"%s pi=%d ff=%d and=%d mem=%d bmc=%d",
420 Gia_ManPiNum(pGia), Gia_ManRegNum(pGia), Gia_ManAndNum(pGia),
425 fprintf( pFile,
" ff=%d and=%d",
429 fprintf( pFile,
"\n" );
435 double memAig = 1.0 *
p->pGia->nObjsAlloc *
sizeof(
Gia_Obj_t) + Vec_IntMemory(
p->pGia->vMapping);
438 double memMap = Vec_VecMemoryInt( (
Vec_Vec_t *)
p->vId2Lit );
440 double memHash=
sizeof(int) * 6 *
p->nTable;
442 memOth += Vec_VecMemoryInt( (
Vec_Vec_t *)
p->vCnfs );
443 memOth += Vec_IntMemory(
p->vIds );
444 memOth += Vec_IntMemory(
p->vProofIds );
445 memOth += Vec_IntMemory(
p->vAbs );
446 memOth += Vec_IntMemory(
p->vValues );
447 memOth += Vec_IntMemory(
p->vLits );
448 memOth += Vec_IntMemory(
p->vIsopMem );
449 memOth += 336450 + (
sizeof(char) +
sizeof(
char*)) * 65536;
450 memTot = memAig + memSat + memPro + memMap + memRef + memHash + memOth;
451 ABC_PRMP(
"Memory: AIG ", memAig, memTot );
452 ABC_PRMP(
"Memory: SAT ", memSat, memTot );
453 ABC_PRMP(
"Memory: Proof ", memPro, memTot );
454 ABC_PRMP(
"Memory: Map ", memMap, memTot );
455 ABC_PRMP(
"Memory: Refine ", memRef, memTot );
456 ABC_PRMP(
"Memory: Hash ", memHash,memTot );
457 ABC_PRMP(
"Memory: Other ", memOth, memTot );
458 ABC_PRMP(
"Memory: TOTAL ", memTot, memTot );
462 Vec_IntFreeP( &
p->pGia->vMapping );
464 if (
p->pPars->fVerbose )
465 Abc_Print( 1,
"SAT solver: Var = %d Cla = %d Conf = %d Lrn = %d Reduce = %d Cex = %d ObjsAdded = %d\n",
466 sat_solver2_nvars(
p->pSat), sat_solver2_nclauses(
p->pSat),
467 sat_solver2_nconflicts(
p->pSat), sat_solver2_nlearnts(
p->pSat),
468 p->pSat->nDBreduces,
p->nCexes,
p->nObjAdded );
469 if (
p->pPars->fVerbose )
470 Abc_Print( 1,
"Hash hits = %d. Hash misses = %d. Hash overs = %d. Concurrent calls = %d.\n",
471 p->nHashHit,
p->nHashMiss,
p->nHashOver,
p->nPdrCalls );
476 Vec_IntFree(
p->vIds );
477 Vec_IntFree(
p->vProofIds );
478 Vec_IntFree(
p->vAbs );
479 Vec_IntFree(
p->vValues );
480 Vec_IntFree(
p->vLits );
481 Vec_IntFree(
p->vIsopMem );
506static inline unsigned Ga2_ObjTruthDepends(
unsigned t,
int v )
508 static unsigned uInvTruth5[5] = { 0x55555555, 0x33333333, 0x0F0F0F0F, 0x00FF00FF, 0x0000FFFF };
509 assert( v >= 0 && v <= 4 );
510 return ((t ^ (t >> (1 << v))) & uInvTruth5[v]);
515 static unsigned uTruth5[5] = { 0xAAAAAAAA, 0xCCCCCCCC, 0xF0F0F0F0, 0xFF00FF00, 0xFFFF0000 };
520 assert( Gia_ObjIsAnd(pRoot) );
523 printf(
"Object %d.\n", Gia_ObjId(
p, pRoot) );
528 Entry = Vec_IntEntry( vLits, i );
532 else if ( Entry == 1 )
535 pObj->
Value = uTruth5[i];
537 printf(
"%d ", Entry );
542 Res = Ga2_ObjTruth(
p, pRoot );
549 if ( Res != 0 && Res != ~0 )
552 int nUsed = 0, pUsed[5];
553 for ( i = 0; i < Vec_IntSize(vLeaves); i++ )
554 if ( Ga2_ObjTruthDepends( Res, i ) )
558 Vec_IntSelectSortCost( pUsed, nUsed, vLits );
559 assert( Vec_IntEntry(vLits, pUsed[0]) <= Vec_IntEntry(vLits, pUsed[nUsed-1]) );
563 Entry = Vec_IntEntry( vLits, i );
567 else if ( Entry == 1 )
570 pObj->
Value = 0xDEADCAFE;
572 for ( i = 0; i < nUsed; i++ )
574 Entry = Vec_IntEntry( vLits, pUsed[i] );
576 pObj = Gia_ManObj(
p, Vec_IntEntry(vLeaves, pUsed[i]) );
577 pObj->
Value = Abc_LitIsCompl(Entry) ? ~uTruth5[i] : uTruth5[i];
580 pUsed[i] = Abc_LitRegular(Entry);
586 Vec_IntClear( vLits );
587 for ( i = 0; i < nUsed; i++ )
589 Vec_IntPush( vLits, pUsed[i] );
590 assert( Ga2_ObjTruthDepends(Res, i) );
592 printf(
"%d ", pUsed[i] );
595 assert( !Ga2_ObjTruthDepends(Res, i) );
609 Vec_IntClear( vLits );
610 printf(
"Const %d\n", Res > 0 );
638 return Vec_IntDup( vCover );
652static inline void Ga2_ManCnfAddDynamic(
Ga2_Man_t *
p,
int uTruth,
int Lits[],
int iLitOut,
int ProofId )
654 int i, k, b,
Cube, nClaLits, ClaLits[6];
656 for ( i = 0; i < 2; i++ )
659 uTruth = 0xffff & ~uTruth;
661 for ( k = 0; k <
p->pSopSizes[uTruth]; k++ )
664 ClaLits[nClaLits++] = i ? lit_neg(iLitOut) : iLitOut;
665 Cube =
p->pSops[uTruth][k];
666 for ( b = 3; b >= 0; b-- )
671 ClaLits[nClaLits++] = Lits[b];
673 else if (
Cube % 3 == 1 )
676 ClaLits[nClaLits++] = lit_neg(Lits[b]);
687 int i, k, b,
Cube, Literal, nClaLits, ClaLits[6];
688 for ( i = 0; i < 2; i++ )
690 vCnf = i ? vCnf1 : vCnf0;
694 ClaLits[nClaLits++] = i ? lit_neg(iLitOut) : iLitOut;
695 for ( b = 0; b < 5; b++ )
697 Literal = 3 & (
Cube >> (b << 1));
701 ClaLits[nClaLits++] = Lits[b];
703 else if ( Literal == 2 )
706 ClaLits[nClaLits++] = lit_neg(Lits[b]);
708 else if ( Literal != 0 )
727static inline unsigned Saig_ManBmcHashKey(
int * pArray )
729 static int s_Primes[5] = { 12582917, 25165843, 50331653, 100663319, 201326611 };
731 for ( i = 0; i < 5; i++ )
732 Key += pArray[i] * s_Primes[i];
735static inline int * Saig_ManBmcLookup(
Ga2_Man_t *
p,
int * pArray )
737 int * pTable =
p->pTable + 6 * (Saig_ManBmcHashKey(pArray) %
p->nTable);
738 if (
memcmp( pTable, pArray, 20 ) )
740 if ( pTable[0] == 0 )
744 memcpy( pTable, pArray, 20 );
749 assert( pTable + 5 < pTable + 6 *
p->nTable );
770 assert( Vec_PtrSize(
p->vCnfs) == 2 * Vec_IntSize(
p->vValues) );
772 if ( Ga2_ObjId(
p,pObj) == -1 )
774 Ga2_ObjSetId(
p, pObj, Vec_IntSize(
p->vValues) );
775 Vec_IntPush(
p->vValues, Gia_ObjId(
p->pGia, pObj) );
776 Vec_PtrPush(
p->vCnfs, NULL );
777 Vec_PtrPush(
p->vCnfs, NULL );
779 assert( Ga2_ObjCnf0(
p, pObj) == NULL );
782 Vec_IntPush(
p->vAbs, Gia_ObjId(
p->pGia, pObj) );
783 assert( Gia_ObjIsAnd(pObj) || Gia_ObjIsRo(
p->pGia, pObj) );
785 nLeaves = Ga2_ObjLeaveNum(
p->pGia, pObj);
786 uTruth = Ga2_ObjTruth(
p->pGia, pObj );
788 Vec_PtrWriteEntry(
p->vCnfs, 2 * Ga2_ObjId(
p,pObj),
Ga2_ManCnfCompute( uTruth, nLeaves,
p->vIsopMem) );
789 Vec_PtrWriteEntry(
p->vCnfs, 2 * Ga2_ObjId(
p,pObj) + 1,
Ga2_ManCnfCompute(~uTruth, nLeaves,
p->vIsopMem) );
792static inline void Ga2_ManAddToAbsOneStatic(
Ga2_Man_t *
p,
Gia_Obj_t * pObj,
int f,
int fUseId )
796 int k, Lit, iLitOut = Ga2_ObjFindOrAddLit(
p, pObj, f );
798 assert( Gia_ObjIsConst0(pObj) || Gia_ObjIsRo(
p->pGia, pObj) || Gia_ObjIsAnd(pObj) );
799 if ( Gia_ObjIsConst0(pObj) || (f == 0 && Gia_ObjIsRo(
p->pGia, pObj)) )
801 iLitOut = Abc_LitNot( iLitOut );
807 Vec_IntClear(
p->vLits );
808 vLeaves = Ga2_ObjLeaves(
p->pGia, pObj );
811 Lit = Ga2_ObjFindOrAddLit(
p, pLeaf, f - Gia_ObjIsRo(
p->pGia, pObj) );
812 Vec_IntPush(
p->vLits, Lit );
816 if ( fUseStatic || Gia_ObjIsRo(
p->pGia, pObj) )
817 Ga2_ManCnfAddStatic(
p->pSat, Ga2_ObjCnf0(
p, pObj), Ga2_ObjCnf1(
p, pObj), Vec_IntArray(
p->vLits), iLitOut, fUseId ? Gia_ObjId(
p->pGia, pObj) : -1 );
821 Ga2_ManCnfAddDynamic(
p, uTruth & 0xFFFF, Vec_IntArray(
p->vLits), iLitOut, Gia_ObjId(
p->pGia, pObj) );
833 assert( Ga2_ObjIsAbs0(
p, pObj) );
834 assert( Gia_ObjIsConst0(pObj) || Gia_ObjIsRo(
p->pGia, pObj) || Gia_ObjIsAnd(pObj) );
835 if ( Gia_ObjIsConst0(pObj) || (f == 0 && Gia_ObjIsRo(
p->pGia, pObj)) )
837 Ga2_ObjAddLit(
p, pObj, f, 0 );
839 else if ( Gia_ObjIsRo(
p->pGia, pObj) )
843 pLeaf = Gia_ObjRoToRi(
p->pGia, pObj );
844 Lit = Ga2_ObjFindOrAddLit(
p, Gia_ObjFanin0(pLeaf), f-1 );
846 Lit = Abc_LitNotCond( Lit, Gia_ObjFaninC0(pLeaf) );
847 Ga2_ObjAddLit(
p, pObj, f, Lit );
851 assert( Gia_ObjIsAnd(pObj) );
852 Vec_IntClear(
p->vLits );
853 vLeaves = Ga2_ObjLeaves(
p->pGia, pObj );
856 if ( Ga2_ObjIsAbs0(
p, pLeaf) )
858 Lit = Ga2_ObjFindLit(
p, pLeaf, f );
861 else if ( Ga2_ObjIsLeaf0(
p, pLeaf) )
863 Lit = Ga2_ObjFindLit(
p, pLeaf, f );
872 Vec_IntPush(
p->vLits, Lit );
877 if ( uTruth == 0 || uTruth == ~0 )
880 Ga2_ObjAddLit(
p, pObj, f, Lit );
882 else if ( uTruth == 0xAAAAAAAA || uTruth == 0x55555555 )
884 Lit = Vec_IntEntry(
p->vLits, 0 );
887 pLeaf = Gia_ManObj(
p->pGia, Vec_IntEntry(vLeaves, (Lit-
GA2_BIG_NUM)/2) );
888 Lit = Ga2_ObjFindLit(
p, pLeaf, f );
890 Lit = Ga2_ObjFindOrAddLit(
p, pLeaf, f );
893 Lit = Abc_LitNotCond( Lit, uTruth == 0x55555555 );
894 Ga2_ObjAddLit(
p, pObj, f, Lit );
899 assert( Vec_IntSize(
p->vLits) > 1 && Vec_IntSize(
p->vLits) < 6 );
905 pLeaf = Gia_ManObj(
p->pGia, Vec_IntEntry(vLeaves, (Lit-
GA2_BIG_NUM)/2) );
906 Lit = Ga2_ObjFindLit(
p, pLeaf, f );
908 Lit = Ga2_ObjFindOrAddLit(
p, pLeaf, f );
909 Vec_IntWriteEntry(
p->vLits, i, Lit );
915 if ( Vec_IntSize(
p->vLits) == 5 )
917 Vec_IntClear(
p->vLits );
919 Vec_IntPush(
p->vLits, Ga2_ObjFindOrAddLit(
p, pLeaf, f ) );
920 Lit = Ga2_ObjFindOrAddLit(
p, pObj, f);
926 if ( !
p->pPars->fSkipHash )
928 int * pLookup, nSize = Vec_IntSize(
p->vLits);
929 assert( Vec_IntSize(
p->vLits) < 5 );
930 assert( Vec_IntEntry(
p->vLits, 0) <= Vec_IntEntryLast(
p->vLits) );
931 assert( Ga2_ObjFindLit(
p, pObj, f) == -1 );
932 for ( i = Vec_IntSize(
p->vLits); i < 4; i++ )
934 Vec_IntPush(
p->vLits, (
int)uTruth );
935 assert( Vec_IntSize(
p->vLits) == 5 );
938 pLookup = Saig_ManBmcLookup(
p, Vec_IntArray(
p->vLits) );
941 *pLookup = Ga2_ObjFindOrAddLit(
p, pObj, f);
942 Vec_IntShrink(
p->vLits, nSize );
943 Ga2_ManCnfAddDynamic(
p, uTruth & 0xFFFF, Vec_IntArray(
p->vLits), *pLookup, -1 );
946 Ga2_ObjAddLit(
p, pObj, f, *pLookup );
951 Lit = Ga2_ObjFindOrAddLit(
p, pObj, f);
952 Ga2_ManCnfAddDynamic(
p, uTruth & 0xFFFF, Vec_IntArray(
p->vLits), Lit, -1 );
966 if ( i ==
p->LimAbs )
969 Ga2_ManAddToAbsOneStatic(
p, pObj, f, 0 );
971 Ga2_ManAddToAbsOneDynamic(
p, pObj, f );
974 if ( i >=
p->LimAbs )
975 Ga2_ManAddToAbsOneStatic(
p, pObj, f, 1 );
987 Ga2_ManSetupNode(
p, pObj, 1 );
988 if (
p->pSat->pPrf2 )
989 Vec_IntWriteEntry(
p->vProofIds, Gia_ObjId(
p->pGia, pObj),
p->nProofIds++ );
994 vLeaves = Ga2_ObjLeaves(
p->pGia, pObj );
996 if ( Ga2_ObjId(
p, pFanin ) == -1 )
997 Ga2_ManSetupNode(
p, pFanin, 0 );
1000 for ( f = 0; f <=
p->pPars->iFrame; f++ )
1002 Vec_IntFillExtra( Ga2_MapFrameMap(
p, f), Vec_IntSize(
p->vValues), -1 );
1004 Ga2_ManAddToAbsOneStatic(
p, pObj, f, 1 );
1021 assert( Ga2_ObjCnf0(
p, pObj) != NULL );
1022 assert( Ga2_ObjCnf1(
p, pObj) != NULL );
1025 Vec_IntFree( Ga2_ObjCnf0(
p, pObj) );
1026 Vec_IntFree( Ga2_ObjCnf1(
p, pObj) );
1027 Vec_PtrWriteEntry(
p->vCnfs, 2 * Ga2_ObjId(
p,pObj), NULL );
1028 Vec_PtrWriteEntry(
p->vCnfs, 2 * Ga2_ObjId(
p,pObj) + 1, NULL );
1030 Vec_IntShrink(
p->vAbs, nAbs );
1034 assert( Ga2_ObjId(
p,pObj) >= 0 );
1037 Ga2_ObjSetId(
p, pObj, -1 );
1039 Vec_IntShrink(
p->vValues, nValues );
1040 Vec_PtrShrink(
p->vCnfs, 2 * nValues );
1047 Vec_IntShrink( vMap, nValues );
1049 if ( Entry >= 2*nSatVars )
1050 Vec_IntWriteEntry( vMap, k, -1 );
1053 p->nSatVars = nSatVars;
1069 if ( pObj->
fPhase && !fFirst )
1071 assert( Gia_ObjIsAnd(pObj) );
1074 Vec_IntWriteEntry( vClasses, Gia_ObjId(
p, pObj), 1 );
1082 vGateClasses = Vec_IntStart( Gia_ManObjNum(
p->pGia) );
1083 Vec_IntWriteEntry( vGateClasses, 0, 1 );
1086 if ( Gia_ObjIsAnd(pObj) )
1088 else if ( Gia_ObjIsRo(
p->pGia, pObj) )
1089 Vec_IntWriteEntry( vGateClasses, Gia_ObjId(
p->pGia, pObj), 1 );
1090 else if ( !Gia_ObjIsConst0(pObj) )
1094 return vGateClasses;
1102 vToAdd = Vec_IntAlloc( 1000 );
1104 if ( pObj->
fPhase && Vec_IntEntry(
p->vGateClasses, Gia_ObjId(
p, pObj)) )
1105 Vec_IntPush( vToAdd, Gia_ObjId(
p, pObj) );
1107 if ( pObj->
fPhase && Vec_IntEntry(
p->vGateClasses, i) )
1108 Vec_IntPush( vToAdd, i );
1116 assert(
p->pGia != NULL &&
p->pGia->vGateClasses != NULL );
1117 assert( Gia_ManPi(
p->pGia, 0)->fPhase );
1121 p->pSat->nLearntStart =
p->pPars->nLearnedStart;
1122 p->pSat->nLearntDelta =
p->pPars->nLearnedDelta;
1123 p->pSat->nLearntRatio =
p->pPars->nLearnedPerce;
1124 p->pSat->nLearntMax =
p->pSat->nLearntStart;
1131 assert(
p->pSat->pPrf2 == NULL );
1132 assert(
p->pPars->iFrame < 0 );
1134 Vec_IntFree( vToAdd );
1135 p->LimAbs = Vec_IntSize(
p->vAbs);
1136 p->LimPpi = Vec_IntSize(
p->vValues);
1138 if (
p->pPars->nTimeOut )
1139 sat_solver2_set_runtime_limit(
p->pSat,
p->pPars->nTimeOut * CLOCKS_PER_SEC +
p->timeStart );
1141 memset(
p->pTable, 0, 6 *
sizeof(
int) *
p->nTable );
1158 int Lit = Ga2_ObjFindLit(
p, pObj, f );
1159 assert( !Gia_ObjIsConst0(pObj) );
1162 if ( Abc_Lit2Var(Lit) >=
p->pSat->size )
1164 return Abc_LitIsCompl(Lit) ^ sat_solver2_var_value(
p->pSat, Abc_Lit2Var(Lit) );
1171 pCex =
Abc_CexAlloc( Gia_ManRegNum(
p->pGia), Gia_ManPiNum(
p->pGia),
p->pPars->iFrame+1 );
1173 pCex->iFrame =
p->pPars->iFrame;
1176 if ( !Gia_ObjIsPi(
p->pGia, pObj) )
1178 assert( Gia_ObjIsPi(
p->pGia, pObj) );
1179 for ( f = 0; f <= pCex->iFrame; f++ )
1180 if ( Ga2_ObjSatValue(
p, pObj, f ) )
1181 Abc_InfoSetBit( pCex->pData, pCex->nRegs + f * pCex->nPis + Gia_ObjCioId(pObj) );
1189 printf(
"\n Unsat core: \n" );
1192 Vec_Int_t * vLeaves = Ga2_ObjLeaves(
p->pGia, pObj );
1193 printf(
"%12d : ", i );
1194 printf(
"Obj =%6d ", Gia_ObjId(
p->pGia, pObj) );
1195 if ( Gia_ObjIsRo(
p->pGia, pObj) )
1199 if ( Ga2_ObjIsAbs0(
p, pObj) )
1201 else if ( Ga2_ObjIsLeaf0(
p, pObj) )
1205 printf(
"Fanins: " );
1208 printf(
"%6d ", Gia_ObjId(
p->pGia, pFanin) );
1209 if ( Gia_ObjIsRo(
p->pGia, pFanin) )
1213 if ( Ga2_ObjIsAbs0(
p, pFanin) )
1215 else if ( Ga2_ObjIsLeaf0(
p, pFanin) )
1231 if ( Ga2_ObjIsAbs(
p, pObj) )
1234 assert( Ga2_ObjIsLeaf(
p, pObj) );
1235 assert( Gia_ObjIsAnd(pObj) || Gia_ObjIsCi(pObj) );
1236 Vec_IntPush( vVec, Gia_ObjId(
p->pGia, pObj) );
1238 printf(
" Current PPIs (%d): ", Vec_IntSize(vVec) );
1239 Vec_IntSort( vVec, 1 );
1241 printf(
"%d ", Gia_ObjId(
p->pGia, pObj) );
1243 Vec_IntFree( vVec );
1259 vMap = Vec_IntAlloc( 1000 );
1263 if ( Ga2_ObjIsAbs(
p, pObj) )
1266 assert( Ga2_ObjIsLeaf(
p, pObj) );
1267 assert( Gia_ObjIsAnd(pObj) || Gia_ObjIsCi(pObj) );
1268 Vec_IntPush( vMap, Gia_ObjId(
p->pGia, pObj) );
1271 pCex =
Abc_CexAlloc( 0, Vec_IntSize(vMap),
p->pPars->iFrame+1 );
1272 pCex->iFrame =
p->pPars->iFrame;
1273 for ( f = 0; f <=
p->pPars->iFrame; f++ )
1275 if ( Ga2_ObjSatValue(
p, pObj, f ) )
1276 Abc_InfoSetBit( pCex->pData, f * Vec_IntSize(vMap) + k );
1286 if (
p->pPars->fAddLayer )
1289 vVec = Vec_IntAlloc( 100 );
1293 if ( Ga2_ObjIsAbs(
p, pObj) )
1296 assert( Ga2_ObjIsLeaf(
p, pObj) );
1297 assert( Gia_ObjIsAnd(pObj) || Gia_ObjIsCi(pObj) );
1298 if ( Gia_ObjIsPi(
p->pGia, pObj) )
1300 Vec_IntPush( vVec, Gia_ObjId(
p->pGia, pObj) );
1302 p->nObjAdded += Vec_IntSize(vVec);
1307 vVec =
Rnm_ManRefine(
p->pRnm, pCex, vMap,
p->pPars->fPropFanout,
p->pPars->fNewRefine, 1 );
1310 if ( Vec_IntSize(vVec) == 0 )
1312 Vec_IntFree( vVec );
1315 Vec_IntFree( vMap );
1318 Vec_IntFree( vMap );
1322 if ( !Ga2_ObjIsAbs(
p, pObj) )
1323 Vec_IntWriteEntry( vVec, k++, Gia_ObjId(
p->pGia, pObj) );
1324 Vec_IntShrink( vVec, k );
1329 p->nObjAdded += Vec_IntSize(vVec);
1350 Counter += Gia_ObjIsRo(
p->pGia, pObj);
1353 Counter += Gia_ObjIsAnd(pObj);
1371 int fUseNewLine = ((fFinal && nCexes) ||
p->pPars->fVeryVerbose);
1374 p->fUseNewLine = fUseNewLine;
1375 Abc_Print( 1,
"%4d :", nFrames );
1376 Abc_Print( 1,
"%4d", Abc_MinInt(100, 100 * Vec_IntSize(
p->vAbs) /
p->nMarked) );
1377 Abc_Print( 1,
"%6d", Vec_IntSize(
p->vAbs) );
1378 Abc_Print( 1,
"%5d", Vec_IntSize(
p->vValues)-Vec_IntSize(
p->vAbs)-1 );
1381 Abc_Print( 1,
"%8d", nConfls );
1383 Abc_Print( 1,
"%5c",
'-' );
1385 Abc_Print( 1,
"%5d", nCexes );
1386 Abc_PrintInt( sat_solver2_nvars(
p->pSat) );
1387 Abc_PrintInt( sat_solver2_nclauses(
p->pSat) );
1388 Abc_PrintInt( sat_solver2_nlearnts(
p->pSat) );
1389 Abc_Print( 1,
"%9.2f sec", 1.0*Time/CLOCKS_PER_SEC );
1391 Abc_Print( 1,
"%s", fUseNewLine ?
"\n" :
"\r" );
1408 static char * pFileNameDef =
"glabs.aig";
1409 if (
p->pPars->pFileVabs )
1410 return p->pPars->pFileVabs;
1411 if (
p->pGia->pSpec )
1418 return pFileNameDef;
1424 assert(
p->pPars->fDumpMabs ||
p->pPars->fDumpVabs );
1425 if (
p->pPars->fDumpMabs )
1429 Abc_Print( 1,
"Dumping miter with abstraction map into file \"%s\"...\n", pFileName );
1431 Vec_IntFreeP( &
p->pGia->vGateClasses );
1435 else if (
p->pPars->fDumpVabs )
1441 Abc_Print( 1,
"Dumping abstracted model into file \"%s\"...\n", pFileName );
1448 Vec_IntFreeP( &vGateClasses );
1474 Vec_IntFreeP( &vGateClasses );
1502 int fUseSecondCore = 1;
1505 abctime clk2, clk = Abc_Clock();
1506 int Status =
l_Undef, RetValue = -1, iFrameTryToProve = -1, fOneIsSent = 0;
1510 assert( Gia_ManPoNum(pAig) == 1 );
1512 if ( Gia_ObjIsConst0(Gia_ObjFanin0(Gia_ManPo(pAig,0))) )
1514 if ( !Gia_ObjFaninC0(Gia_ManPo(pAig,0)) )
1516 Abc_Print( 1,
"Sequential miter is trivially UNSAT.\n" );
1520 Abc_Print( 1,
"Sequential miter is trivially SAT.\n" );
1526 pAig->
vGateClasses = Vec_IntStart( Gia_ManObjNum(pAig) );
1528 Vec_IntWriteEntry( pAig->
vGateClasses, Gia_ObjFaninId0p(pAig, Gia_ManPo(pAig, 0)), 1 );
1532 p->timeInit = Abc_Clock() - clk;
1534 if (
p->pPars->fVerbose )
1536 Abc_Print( 1,
"Running gate-level abstraction (GLA) with the following parameters:\n" );
1537 Abc_Print( 1,
"FrameMax = %d ConfMax = %d Timeout = %d Limit = %d %% Limit2 = %d %% RatioMax = %d %%\n",
1538 pPars->nFramesMax, pPars->nConfLimit, pPars->nTimeOut, pPars->nRatioMin, pPars->nRatioMin2, pPars->nRatioMax );
1539 Abc_Print( 1,
"LrnStart = %d LrnDelta = %d LrnRatio = %d %% Skip = %d SimpleCNF = %d Dump = %d\n",
1540 pPars->nLearnedStart, pPars->nLearnedDelta, pPars->nLearnedPerce, pPars->fUseSkip, pPars->fUseSimple, pPars->fDumpVabs|pPars->fDumpMabs );
1541 if ( pPars->fDumpVabs || pPars->fDumpMabs )
1542 Abc_Print( 1,
"%s will be continuously dumped into file \"%s\".\n",
1543 pPars->fDumpVabs ?
"Abstracted model" :
"Miter with abstraction map",
1545 if ( pPars->fDumpMabs )
1560 pAig->
vGateClasses = Vec_IntStart( Gia_ManObjNum(pAig) );
1565 Vec_IntWriteEntry( pAig->
vGateClasses, Gia_ObjId(pAig, pObj), 1 );
1569 if (
p->pPars->fVerbose )
1570 Abc_Print( 1,
"Dumping miter with abstraction map into file \"%s\"...\n", pFileName );
1573 Abc_Print( 1,
" Frame %% Abs PPI FF LUT Confl Cex Vars Clas Lrns Time Mem\n" );
1576 for ( i = f = 0; !pPars->nFramesMax || f < pPars->nFramesMax; i++ )
1580 p->pPars->iFrame = -1;
1584 nAbsOld = Vec_IntSize(
p->vAbs);
1586 for ( f = 0; !pPars->nFramesMax || f < pPars->nFramesMax; f++ )
1589 int nConflsBeg = sat_solver2_nconflicts(
p->pSat);
1590 int nAbs = Vec_IntSize(
p->vAbs);
1591 int nValues = Vec_IntSize(
p->vValues);
1594 p->pPars->iFrame = f;
1596 if ( f == Vec_PtrSize(
p->vId2Lit) )
1597 Vec_PtrPush(
p->vId2Lit, Vec_IntAlloc(0) );
1598 Vec_IntFillExtra( Ga2_MapFrameMap(
p, f), Vec_IntSize(
p->vValues), -1 );
1602 if (
p->pPars->fUseSkip && f <= p->pPars->iFrameProved )
1605 if (
p->pPars->nFramesStart && f <= p->pPars->nFramesStart )
1609 Lit = Ga2_ObjFindLit(
p, Gia_ObjFanin0(Gia_ManPo(pAig,0)), f );
1611 Lit = Abc_LitNotCond( Lit, Gia_ObjFaninC0(Gia_ManPo(pAig,0)) );
1616 if (
p->nSatVars > sat_solver2_nvars(
p->pSat) )
1618 nVarsOld =
p->nSatVars;
1619 for ( c = 0; ; c++ )
1627 Prf_ManStopP( &
p->pSat->pPrf2 );
1632 Status =
sat_solver2_solve(
p->pSat, &Lit, &Lit+1, (ABC_INT64_T)pPars->nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
1636 p->timeSat += Abc_Clock() - clk2;
1644 if ( iFrameTryToProve >= 0 )
1647 iFrameTryToProve = -1;
1652 Rnm_ManSetRefId(
p->pRnm, c );
1654 p->timeCex += Abc_Clock() - clk2;
1655 if ( vPPis == NULL )
1657 if ( pPars->fVerbose )
1666 assert( nVarsOld ==
p->pSat->size );
1667 sat_solver2_bookmark(
p->pSat );
1669 assert(
p->pSat->pPrf2 == NULL );
1670 p->pSat->pPrf2 = Prf_ManAlloc();
1671 if (
p->pSat->pPrf2 )
1674 Vec_IntFill(
p->vProofIds, Gia_ManObjNum(
p->pGia), -1 );
1675 Prf_ManRestart(
p->pSat->pPrf2,
p->vProofIds, sat_solver2_nlearnts(
p->pSat), Vec_IntSize(vPPis) );
1681 if (
p->pSat->pPrf2 )
1682 Prf_ManGrow(
p->pSat->pPrf2,
p->nProofIds + Vec_IntSize(vPPis) );
1686 Vec_IntFree( vPPis );
1687 if ( pPars->fVerbose )
1690 if ( pPars->nRatioMin2 && Vec_IntSize(
p->vAbs) >=
p->nMarked * pPars->nRatioMin2 / 100 )
1697 p->timeUnsat += Abc_Clock() - clk2;
1700 if (
p->pSat->nRuntimeLimit && Abc_Clock() >
p->pSat->nRuntimeLimit )
1704 if ( f >
p->pPars->iFrameProved )
1705 p->pPars->nFramesNoChange++;
1708 if ( f >
p->pPars->iFrameProved )
1709 p->pPars->nFramesNoChange = 0;
1712 assert(
p->pSat->pPrf2 != NULL );
1714 Prf_ManStopP( &
p->pSat->pPrf2 );
1721 if ( fUseSecondCore )
1728 assert( nVarsOld ==
p->pSat->size );
1729 sat_solver2_bookmark(
p->pSat );
1731 assert(
p->pSat->pPrf2 == NULL );
1732 p->pSat->pPrf2 = Prf_ManAlloc();
1733 if (
p->pSat->pPrf2 )
1736 Vec_IntFill(
p->vProofIds, Gia_ManObjNum(
p->pGia), -1 );
1737 Prf_ManRestart(
p->pSat->pPrf2,
p->vProofIds, sat_solver2_nlearnts(
p->pSat), Vec_IntSize(vCore) );
1740 Vec_IntFree( vCore );
1744 Status =
sat_solver2_solve(
p->pSat, &Lit, &Lit+1, (ABC_INT64_T)pPars->nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
1748 p->timeUnsat += Abc_Clock() - clk2;
1751 assert(
p->pSat->pPrf2 != NULL );
1753 Prf_ManStopP( &
p->pSat->pPrf2 );
1763 Vec_IntFree( vCore );
1767 if (
p->pPars->iFrameProved < f )
1768 p->pPars->iFrameProved = f;
1770 if ( pPars->fVerbose )
1780 if (
p->pPars->fVeryVerbose )
1781 Abc_Print( 1,
"\n" );
1786 if ( pPars->nRatioMin && Vec_IntSize(
p->vAbs) >=
p->nMarked * pPars->nRatioMin / 100 )
1793 if (
p->pPars->nFramesNoChange ==
p->pPars->nFramesNoChangeLim )
1796 if (
p->pPars->fDumpVabs ||
p->pPars->fDumpMabs )
1807 if (
p->pPars->fCallProver )
1810 if ( iFrameTryToProve >= 0 )
1814 iFrameTryToProve = f;
1829 if ( pPars->nRatioMax == 0 )
1831 if ( c > 0 && (f > 20 || Vec_IntSize(
p->vAbs) > 100) && Vec_IntSize(
p->vAbs) - nAbsOld >= nAbsOld * pPars->nRatioMax / 100 )
1833 if (
p->pPars->fVerbose )
1834 Abc_Print( 1,
"Forcing restart because abstraction grew from %d to %d (more than %d %%).\n",
1835 nAbsOld, Vec_IntSize(
p->vAbs), pPars->nRatioMax );
1841 Prf_ManStopP( &
p->pSat->pPrf2 );
1843 if ( iFrameTryToProve >= 0 )
1846 if ( !
p->fUseNewLine )
1847 Abc_Print( 1,
"\n" );
1848 if ( RetValue == 1 )
1849 Abc_Print( 1,
"GLA completed %d frames and proved abstraction derived in frame %d ",
p->pPars->iFrameProved+1, iFrameTryToProve );
1850 else if ( pAig->
pCexSeq == NULL )
1854 if (
p->pPars->nTimeOut && Abc_Clock() >=
p->pSat->nRuntimeLimit )
1855 Abc_Print( 1,
"GLA reached timeout %d sec in frame %d with a %d-stable abstraction. ",
p->pPars->nTimeOut,
p->pPars->iFrameProved+1,
p->pPars->nFramesNoChange );
1856 else if ( pPars->nConfLimit && sat_solver2_nconflicts(
p->pSat) >= pPars->nConfLimit )
1857 Abc_Print( 1,
"GLA exceeded %d conflicts in frame %d with a %d-stable abstraction. ", pPars->nConfLimit,
p->pPars->iFrameProved+1,
p->pPars->nFramesNoChange );
1858 else if ( pPars->nRatioMin2 && Vec_IntSize(
p->vAbs) >=
p->nMarked * pPars->nRatioMin2 / 100 )
1859 Abc_Print( 1,
"GLA found that the size of abstraction exceeds %d %% in frame %d during refinement. ", pPars->nRatioMin2,
p->pPars->iFrameProved+1 );
1860 else if ( pPars->nRatioMin && Vec_IntSize(
p->vAbs) >=
p->nMarked * pPars->nRatioMin / 100 )
1861 Abc_Print( 1,
"GLA found that the size of abstraction exceeds %d %% in frame %d. ", pPars->nRatioMin,
p->pPars->iFrameProved+1 );
1863 Abc_Print( 1,
"GLA finished %d frames and produced a %d-stable abstraction. ",
p->pPars->iFrameProved+1,
p->pPars->nFramesNoChange );
1864 p->pPars->iFrame =
p->pPars->iFrameProved;
1868 if (
p->pPars->fVerbose )
1869 Abc_Print( 1,
"\n" );
1871 Abc_Print( 1,
" Gia_ManPerformGlaOld(): CEX verification has failed!\n" );
1872 Abc_Print( 1,
"True counter-example detected in frame %d. ", f );
1873 p->pPars->iFrame = f - 1;
1877 Abc_PrintTime( 1,
"Time", Abc_Clock() - clk );
1878 if (
p->pPars->fVerbose )
1880 p->timeOther = (Abc_Clock() - clk) -
p->timeUnsat -
p->timeSat -
p->timeCex -
p->timeInit;
1881 ABC_PRTP(
"Runtime: Initializing",
p->timeInit, Abc_Clock() - clk );
1882 ABC_PRTP(
"Runtime: Solver UNSAT",
p->timeUnsat, Abc_Clock() - clk );
1883 ABC_PRTP(
"Runtime: Solver SAT ",
p->timeSat, Abc_Clock() - clk );
1884 ABC_PRTP(
"Runtime: Refinement ",
p->timeCex, Abc_Clock() - clk );
1885 ABC_PRTP(
"Runtime: Other ",
p->timeOther, Abc_Clock() - clk );
1886 ABC_PRTP(
"Runtime: TOTAL ", Abc_Clock() - clk, Abc_Clock() - clk );
#define ABC_PRTP(a, t, T)
int Gia_ManToBridgeAbsNetlist(FILE *pFile, void *p, int pkg_type)
#define ABC_PRMP(a, f, F)
#define BRIDGE_ABS_NETLIST
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
ABC_DLL Abc_Frame_t * Abc_FrameGetGlobalFrame()
int Ga2_GlaAbsCount(Ga2_Man_t *p, int fRo, int fAnd)
void Ga2_ManReportMemory(Ga2_Man_t *p)
void Ga2_ManDumpStats(Gia_Man_t *pGia, Abs_Par_t *pPars, sat_solver2 *pSat, int iFrame, int fUseN)
int Ga2_ManMarkup(Gia_Man_t *p, int N, int fSimple)
void Ga2_ManRestart(Ga2_Man_t *p)
void Ga2_ManAbsTranslate_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vClasses, int fFirst)
void Ga2_ManComputeTest(Gia_Man_t *p)
void Ga2_GlaPrepareCexAndMap(Ga2_Man_t *p, Abc_Cex_t **ppCex, Vec_Int_t **pvMaps)
Vec_Int_t * Ga2_ManAbsDerive(Gia_Man_t *p)
struct Ga2_Man_t_ Ga2_Man_t
void Ga2_ManAddToAbs(Ga2_Man_t *p, Vec_Int_t *vToAdd)
void Ga2_GlaDumpAbsracted(Ga2_Man_t *p, int fVerbose)
void Ga2_ManRefinePrint(Ga2_Man_t *p, Vec_Int_t *vVec)
Vec_Int_t * Ga2_ManAbsTranslate(Ga2_Man_t *p)
void Ga2_ManCollectNodes_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vNodes, int fFirst)
void Gia_Ga2SendAbsracted(Ga2_Man_t *p, int fVerbose)
void Ga2_ManAddAbsClauses(Ga2_Man_t *p, int f)
void Ga2_ManShrinkAbs(Ga2_Man_t *p, int nAbs, int nValues, int nSatVars)
void Ga2_ManCollectLeaves_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vLeaves, int fFirst)
int Gia_ManPerformGla(Gia_Man_t *pAig, Abs_Par_t *pPars)
int Ga2_ManBreakTree_rec(Gia_Man_t *p, Gia_Obj_t *pObj, int fFirst, int N)
char * Ga2_GlaGetFileName(Ga2_Man_t *p, int fAbs)
void Ga2_ManRefinePrintPPis(Ga2_Man_t *p)
Ga2_Man_t * Ga2_ManStart(Gia_Man_t *pGia, Abs_Par_t *pPars)
Vec_Int_t * Ga2_ManCnfCompute(unsigned uTruth, int nVars, Vec_Int_t *vCover)
int Ga2_ManCheckNodesAnd(Gia_Man_t *p, Vec_Int_t *vNodes)
#define GA2_BIG_NUM
DECLARATIONS ///.
void Ga2_ManStop(Ga2_Man_t *p)
void Gia_Ga2SendCancel(Ga2_Man_t *p, int fVerbose)
unsigned Ga2_ObjComputeTruthSpecial(Gia_Man_t *p, Gia_Obj_t *pRoot, Vec_Int_t *vLeaves, Vec_Int_t *vLits)
unsigned Ga2_ManComputeTruth(Gia_Man_t *p, Gia_Obj_t *pRoot, Vec_Int_t *vLeaves)
void Ga2_ManCnfAddStatic(sat_solver2 *pSat, Vec_Int_t *vCnf0, Vec_Int_t *vCnf1, int Lits[], int iLitOut, int ProofId)
void Ga2_ManAbsPrintFrame(Ga2_Man_t *p, int nFrames, int nConfls, int nCexes, abctime Time, int fFinal)
Abc_Cex_t * Ga2_ManDeriveCex(Ga2_Man_t *p, Vec_Int_t *vPis)
Vec_Int_t * Ga2_ManRefine(Ga2_Man_t *p)
unsigned Ga2_ObjComputeTruth_rec(Gia_Man_t *p, Gia_Obj_t *pObj, int fFirst)
FUNCTION DEFINITIONS ///.
void Rnm_ManStop(Rnm_Man_t *p, int fProfile)
double Rnm_ManMemoryUsage(Rnm_Man_t *p)
Vec_Int_t * Rnm_ManRefine(Rnm_Man_t *p, Abc_Cex_t *pCex, Vec_Int_t *vMap, int fPropFanout, int fNewRefinement, int fVerbose)
Rnm_Man_t * Rnm_ManStart(Gia_Man_t *pGia)
FUNCTION DEFINITIONS ///.
struct Rnm_Man_t_ Rnm_Man_t
int Gia_GlaCountNodes(Gia_Man_t *p, Vec_Int_t *vGla)
Gia_Man_t * Gia_ManDupAbsGates(Gia_Man_t *p, Vec_Int_t *vGateClasses)
typedefABC_NAMESPACE_HEADER_START struct Abs_Par_t_ Abs_Par_t
INCLUDES ///.
void Gia_GlaProveCancel(int fVerbose)
void Gia_GlaProveAbsracted(Gia_Man_t *p, int fSimpProver, int fVerbose)
DECLARATIONS ///.
int Gia_GlaProveCheck(int fVerbose)
int Gia_GlaCountFlops(Gia_Man_t *p, Vec_Int_t *vGla)
ABC_DLL void Abc_FrameSetNFrames(int nFrames)
ABC_DLL void Abc_FrameSetStatus(int Status)
ABC_DLL void Abc_FrameSetCex(Abc_Cex_t *pCex)
ABC_DLL int Abc_FrameIsBridgeMode()
ABC_DLL int Abc_FrameIsBatchMode()
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
ABC_DLL int Cmd_CommandExecute(Abc_Frame_t *pAbc, const char *sCommand)
void Cnf_ReadMsops(char **ppSopSizes, char ***ppSops)
FUNCTION DEFINITIONS ///.
void Gia_ManStop(Gia_Man_t *p)
#define Gia_ManForEachRo(p, pObj, i)
#define Gia_ManForEachAnd(p, pObj, i)
struct Gia_Obj_t_ Gia_Obj_t
int Gia_ObjIsMuxType(Gia_Obj_t *pNode)
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
void Gia_ManCleanValue(Gia_Man_t *p)
int Gia_ManVerifyCex(Gia_Man_t *pAig, Abc_Cex_t *p, int fDualOut)
DECLARATIONS ///.
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
void Gia_ManSetPhase(Gia_Man_t *p)
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact, int fWriteNewLine)
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
double sat_solver2_memory_proof(sat_solver2 *s)
void sat_solver2_delete(sat_solver2 *s)
double sat_solver2_memory(sat_solver2 *s, int fAll)
int var_is_assigned(sat_solver2 *s, int v)
sat_solver2 * sat_solver2_new(void)
void sat_solver2_rollback(sat_solver2 *s)
int sat_solver2_solve(sat_solver2 *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
void sat_solver2_setnvars(sat_solver2 *s, int n)
void * Sat_ProofCore(sat_solver2 *s)
int sat_solver2_addclause(sat_solver2 *s, lit *begin, lit *end, int Id)
struct sat_solver2_t sat_solver2
int Gia_ManToBridgeBadAbs(FILE *pFile)
void Abc_CexFreeP(Abc_Cex_t **p)
Abc_Cex_t * Abc_CexMakeTriv(int nRegs, int nTruePis, int nTruePos, int iFrameOut)
void Abc_CexFree(Abc_Cex_t *p)
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.