Commit 40bfe2fb authored by Alan Mishchenko's avatar Alan Mishchenko

Experiments with SAT sweeping.

parent 0b89fd38
...@@ -5415,6 +5415,10 @@ SOURCE=.\src\proof\cec\cecSatG.c ...@@ -5415,6 +5415,10 @@ SOURCE=.\src\proof\cec\cecSatG.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\proof\cec\cecSatG2.c
# End Source File
# Begin Source File
SOURCE=.\src\proof\cec\cecSeq.c SOURCE=.\src\proof\cec\cecSeq.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -1069,9 +1069,11 @@ static inline void Gia_ClassUndoPair( Gia_Man_t * p, int i ) { a ...@@ -1069,9 +1069,11 @@ static inline void Gia_ClassUndoPair( Gia_Man_t * p, int i ) { a
#define Gia_ManForEachClassReverse( p, i ) \ #define Gia_ManForEachClassReverse( p, i ) \
for ( i = Gia_ManObjNum(p) - 1; i > 0; i-- ) if ( !Gia_ObjIsHead(p, i) ) {} else for ( i = Gia_ManObjNum(p) - 1; i > 0; i-- ) if ( !Gia_ObjIsHead(p, i) ) {} else
#define Gia_ClassForEachObj( p, i, iObj ) \ #define Gia_ClassForEachObj( p, i, iObj ) \
for ( assert(Gia_ObjIsHead(p, i)), iObj = i; iObj > 0; iObj = Gia_ObjNext(p, iObj) ) for ( assert(Gia_ObjIsHead(p, i) && i), iObj = i; iObj > 0; iObj = Gia_ObjNext(p, iObj) )
#define Gia_ClassForEachObj1( p, i, iObj ) \ #define Gia_ClassForEachObj1( p, i, iObj ) \
for ( assert(Gia_ObjIsHead(p, i)), iObj = Gia_ObjNext(p, i); iObj > 0; iObj = Gia_ObjNext(p, iObj) ) for ( assert(Gia_ObjIsHead(p, i)), iObj = Gia_ObjNext(p, i); iObj > 0; iObj = Gia_ObjNext(p, iObj) )
#define Gia_ClassForEachObjStart( p, i, iObj, Start ) \
for ( assert(Gia_ObjIsHead(p, i)), iObj = Gia_ObjNext(p, Start); iObj > 0; iObj = Gia_ObjNext(p, iObj) )
static inline int Gia_ObjFoffsetId( Gia_Man_t * p, int Id ) { return Vec_IntEntry( p->vFanout, Id ); } static inline int Gia_ObjFoffsetId( Gia_Man_t * p, int Id ) { return Vec_IntEntry( p->vFanout, Id ); }
......
...@@ -480,8 +480,10 @@ void Gia_ManEquivPrintClasses( Gia_Man_t * p, int fVerbose, float Mem ) ...@@ -480,8 +480,10 @@ void Gia_ManEquivPrintClasses( Gia_Man_t * p, int fVerbose, float Mem )
} }
CounterX -= Gia_ManCoNum(p); CounterX -= Gia_ManCoNum(p);
nLits = Gia_ManCiNum(p) + Gia_ManAndNum(p) - Counter - CounterX; nLits = Gia_ManCiNum(p) + Gia_ManAndNum(p) - Counter - CounterX;
Abc_Print( 1, "cst =%8d cls =%7d lit =%8d unused =%8d proof =%6d mem =%5.2f MB\n", // Abc_Print( 1, "cst =%8d cls =%7d lit =%8d unused =%8d proof =%6d mem =%5.2f MB\n",
Counter0, Counter, nLits, CounterX, Proved, (Mem == 0.0) ? 8.0*Gia_ManObjNum(p)/(1<<20) : Mem ); // Counter0, Counter, nLits, CounterX, Proved, (Mem == 0.0) ? 8.0*Gia_ManObjNum(p)/(1<<20) : Mem );
Abc_Print( 1, "cst =%8d cls =%7d lit =%8d unused =%8d proof =%6d\n",
Counter0, Counter, nLits, CounterX, Proved );
assert( Gia_ManEquivCheckLits( p, nLits ) ); assert( Gia_ManEquivCheckLits( p, nLits ) );
if ( fVerbose ) if ( fVerbose )
{ {
......
...@@ -36286,14 +36286,15 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -36286,14 +36286,15 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
extern Gia_Man_t * Cec2_ManSimulateTest( Gia_Man_t * p, Cec_ParFra_t * pPars ); extern Gia_Man_t * Cec2_ManSimulateTest( Gia_Man_t * p, Cec_ParFra_t * pPars );
extern Gia_Man_t * Cec3_ManSimulateTest( Gia_Man_t * p, Cec_ParFra_t * pPars ); extern Gia_Man_t * Cec3_ManSimulateTest( Gia_Man_t * p, Cec_ParFra_t * pPars );
extern Gia_Man_t * Cec4_ManSimulateTest( Gia_Man_t * p, Cec_ParFra_t * pPars );
Cec_ParFra_t ParsFra, * pPars = &ParsFra; Cec_ParFra_t ParsFra, * pPars = &ParsFra;
Gia_Man_t * pTemp; Gia_Man_t * pTemp;
int c, fUseAlgo = 0, fUseAlgoG = 0; int c, fUseAlgo = 0, fUseAlgoG = 0, fUseAlgoG2 = 0;
Cec_ManFraSetDefaultParams( pPars ); Cec_ManFraSetDefaultParams( pPars );
pPars->fSatSweeping = 1; pPars->fSatSweeping = 1;
pPars->nItersMax = 1000000; pPars->nItersMax = 1000000;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "WRILDCrmdckngwvh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "WRILDCrmdckngxwvh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -36384,6 +36385,9 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -36384,6 +36385,9 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'g': case 'g':
fUseAlgoG ^= 1; fUseAlgoG ^= 1;
break; break;
case 'x':
fUseAlgoG2 ^= 1;
break;
case 'w': case 'w':
pPars->fVeryVerbose ^= 1; pPars->fVeryVerbose ^= 1;
break; break;
...@@ -36403,6 +36407,8 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -36403,6 +36407,8 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
pTemp = Cec2_ManSimulateTest( pAbc->pGia, pPars ); pTemp = Cec2_ManSimulateTest( pAbc->pGia, pPars );
else if ( fUseAlgoG ) else if ( fUseAlgoG )
pTemp = Cec3_ManSimulateTest( pAbc->pGia, pPars ); pTemp = Cec3_ManSimulateTest( pAbc->pGia, pPars );
else if ( fUseAlgoG2 )
pTemp = Cec4_ManSimulateTest( pAbc->pGia, pPars );
else else
pTemp = Cec_ManSatSweeping( pAbc->pGia, pPars, 0 ); pTemp = Cec_ManSatSweeping( pAbc->pGia, pPars, 0 );
Abc_FrameUpdateGia( pAbc, pTemp ); Abc_FrameUpdateGia( pAbc, pTemp );
...@@ -348,6 +348,8 @@ Gia_Man_t * Cec_ManSatSweeping( Gia_Man_t * pAig, Cec_ParFra_t * pPars, int fSil ...@@ -348,6 +348,8 @@ Gia_Man_t * Cec_ManSatSweeping( Gia_Man_t * pAig, Cec_ParFra_t * pPars, int fSil
Cec_ManPat_t * pPat; Cec_ManPat_t * pPat;
int i, fTimeOut = 0, nMatches = 0; int i, fTimeOut = 0, nMatches = 0;
abctime clk, clk2, clkTotal = Abc_Clock(); abctime clk, clk2, clkTotal = Abc_Clock();
if ( pPars->fVerbose )
printf( "Simulating %d words for %d rounds. SAT solving with %d conflicts.\n", pPars->nWords, pPars->nRounds, pPars->nBTLimit );
// duplicate AIG and transfer equivalence classes // duplicate AIG and transfer equivalence classes
Gia_ManRandom( 1 ); Gia_ManRandom( 1 );
...@@ -519,6 +521,9 @@ p->timeSat += Abc_Clock() - clk; ...@@ -519,6 +521,9 @@ p->timeSat += Abc_Clock() - clk;
} }
} }
finalize: finalize:
if ( pPars->fVerbose )
printf( "Performed %d SAT calls: P = %d D = %d F = %d\n",
p->nAllProvedS + p->nAllDisprovedS + p->nAllFailedS, p->nAllProvedS, p->nAllDisprovedS, p->nAllFailedS );
if ( p->pPars->fVerbose && p->pAig ) if ( p->pPars->fVerbose && p->pAig )
{ {
Abc_Print( 1, "NBeg = %d. NEnd = %d. (Gain = %6.2f %%). RBeg = %d. REnd = %d. (Gain = %6.2f %%).\n", Abc_Print( 1, "NBeg = %d. NEnd = %d. (Gain = %6.2f %%). RBeg = %d. REnd = %d. (Gain = %6.2f %%).\n",
......
...@@ -153,6 +153,9 @@ struct Cec_ManFra_t_ ...@@ -153,6 +153,9 @@ struct Cec_ManFra_t_
int nAllProved; // total number of proved nodes int nAllProved; // total number of proved nodes
int nAllDisproved; // total number of disproved nodes int nAllDisproved; // total number of disproved nodes
int nAllFailed; // total number of failed nodes int nAllFailed; // total number of failed nodes
int nAllProvedS; // total number of proved nodes
int nAllDisprovedS; // total number of disproved nodes
int nAllFailedS; // total number of failed nodes
// runtime stats // runtime stats
abctime timeSim; // unsat abctime timeSim; // unsat
abctime timePat; // unsat abctime timePat; // unsat
......
This diff is collapsed.
...@@ -289,6 +289,9 @@ p->timeSim += Abc_Clock() - clk; ...@@ -289,6 +289,9 @@ p->timeSim += Abc_Clock() - clk;
p->nAllFailed++; p->nAllFailed++;
} }
} }
p->nAllProvedS += p->nAllProved;
p->nAllDisprovedS += p->nAllDisproved;
p->nAllFailedS += p->nAllFailed;
return 0; return 0;
} }
......
...@@ -8,6 +8,7 @@ SRC += src/proof/cec/cecCec.c \ ...@@ -8,6 +8,7 @@ SRC += src/proof/cec/cecCec.c \
src/proof/cec/cecPat.c \ src/proof/cec/cecPat.c \
src/proof/cec/cecSat.c \ src/proof/cec/cecSat.c \
src/proof/cec/cecSatG.c \ src/proof/cec/cecSatG.c \
src/proof/cec/cecSatG2.c \
src/proof/cec/cecSeq.c \ src/proof/cec/cecSeq.c \
src/proof/cec/cecSolve.c \ src/proof/cec/cecSolve.c \
src/proof/cec/cecSplit.c \ src/proof/cec/cecSplit.c \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment