Commit 6a020d6f by Alan Mishchenko

Added switch to PDR to disable expensive generalization step.

parent 669f390c
...@@ -20213,7 +20213,7 @@ int Abc_CommandPdr( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -20213,7 +20213,7 @@ int Abc_CommandPdr( Abc_Frame_t * pAbc, int argc, char ** argv )
int c; int c;
Pdr_ManSetDefaultParams( pPars ); Pdr_ManSetDefaultParams( pPars );
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "OMFCTrmsdvwh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "OMFCTrmsdgvwh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -20284,6 +20284,9 @@ int Abc_CommandPdr( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -20284,6 +20284,9 @@ int Abc_CommandPdr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'd': case 'd':
pPars->fDumpInv ^= 1; pPars->fDumpInv ^= 1;
break; break;
case 'g':
pPars->fSkipGeneral ^= 1;
break;
case 'v': case 'v':
pPars->fVerbose ^= 1; pPars->fVerbose ^= 1;
break; break;
...@@ -20331,7 +20334,7 @@ int Abc_CommandPdr( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -20331,7 +20334,7 @@ int Abc_CommandPdr( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: pdr [-OMFCT<num] [-rmsdvwh]\n" ); Abc_Print( -2, "usage: pdr [-OMFCT<num] [-rmsdgvwh]\n" );
Abc_Print( -2, "\t model checking using property directed reachability (aka ic3)\n" ); Abc_Print( -2, "\t model checking using property directed reachability (aka ic3)\n" );
Abc_Print( -2, "\t pioneered by Aaron Bradley (http://ecee.colorado.edu/~bradleya/ic3/)\n" ); Abc_Print( -2, "\t pioneered by Aaron Bradley (http://ecee.colorado.edu/~bradleya/ic3/)\n" );
Abc_Print( -2, "\t with improvements by Niklas Een (http://een.se/niklas/)\n" ); Abc_Print( -2, "\t with improvements by Niklas Een (http://een.se/niklas/)\n" );
...@@ -20344,6 +20347,7 @@ usage: ...@@ -20344,6 +20347,7 @@ usage:
Abc_Print( -2, "\t-m : toggle using monolythic CNF computation [default = %s]\n", pPars->fMonoCnf? "yes": "no" ); Abc_Print( -2, "\t-m : toggle using monolythic CNF computation [default = %s]\n", pPars->fMonoCnf? "yes": "no" );
Abc_Print( -2, "\t-s : toggle creating only shortest counter-examples [default = %s]\n", pPars->fShortest? "yes": "no" ); Abc_Print( -2, "\t-s : toggle creating only shortest counter-examples [default = %s]\n", pPars->fShortest? "yes": "no" );
Abc_Print( -2, "\t-d : toggle dumping inductive invariant [default = %s]\n", pPars->fDumpInv? "yes": "no" ); Abc_Print( -2, "\t-d : toggle dumping inductive invariant [default = %s]\n", pPars->fDumpInv? "yes": "no" );
Abc_Print( -2, "\t-g : toggle skipping expensive generalization step [default = %s]\n", pPars->fSkipGeneral? "yes": "no" );
Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" ); Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
Abc_Print( -2, "\t-w : toggle printing detailed stats default = %s]\n", pPars->fVeryVerbose? "yes": "no" ); Abc_Print( -2, "\t-w : toggle printing detailed stats default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n"); Abc_Print( -2, "\t-h : print the command usage\n");
......
...@@ -49,6 +49,7 @@ struct Pdr_Par_t_ ...@@ -49,6 +49,7 @@ struct Pdr_Par_t_
int fMonoCnf; // monolythic CNF int fMonoCnf; // monolythic CNF
int fDumpInv; // dump inductive invariant int fDumpInv; // dump inductive invariant
int fShortest; // forces bug traces to be shortest int fShortest; // forces bug traces to be shortest
int fSkipGeneral; // skips expensive generalization step
int fVerbose; // verbose output int fVerbose; // verbose output
int fVeryVerbose; // very verbose output int fVeryVerbose; // very verbose output
int iFrame; // explored up to this frame int iFrame; // explored up to this frame
......
...@@ -302,20 +302,23 @@ int Pdr_ManGeneralize( Pdr_Man_t * p, int k, Pdr_Set_t * pCube, Pdr_Set_t ** ppP ...@@ -302,20 +302,23 @@ int Pdr_ManGeneralize( Pdr_Man_t * p, int k, Pdr_Set_t * pCube, Pdr_Set_t ** ppP
p->tGeneral += clock() - clk; p->tGeneral += clock() - clk;
return 0; return 0;
} }
// reduce clause using assumptions // reduce clause using assumptions
// pCubeMin = Pdr_SetDup( pCube ); // pCubeMin = Pdr_SetDup( pCube );
pCubeMin = Pdr_ManReduceClause( p, k, pCube ); pCubeMin = Pdr_ManReduceClause( p, k, pCube );
if ( pCubeMin == NULL ) if ( pCubeMin == NULL )
pCubeMin = Pdr_SetDup( pCube ); pCubeMin = Pdr_SetDup( pCube );
// perform generalization
if ( !p->pPars->fSkipGeneral )
{
// sort literals by their occurences // sort literals by their occurences
pOrder = Pdr_ManSortByPriority( p, pCubeMin ); pOrder = Pdr_ManSortByPriority( p, pCubeMin );
// try removing literals // try removing literals
for ( j = 0; j < pCubeMin->nLits; j++ ) for ( j = 0; j < pCubeMin->nLits; j++ )
{ {
// use ordering // use ordering
// i = j; // i = j;
i = pOrder[j]; i = pOrder[j];
// check init state // check init state
...@@ -353,7 +356,7 @@ int Pdr_ManGeneralize( Pdr_Man_t * p, int k, Pdr_Set_t * pCube, Pdr_Set_t ** ppP ...@@ -353,7 +356,7 @@ int Pdr_ManGeneralize( Pdr_Man_t * p, int k, Pdr_Set_t * pCube, Pdr_Set_t ** ppP
for ( j = 0; j < pCubeMin->nLits; j++ ) for ( j = 0; j < pCubeMin->nLits; j++ )
{ {
// use ordering // use ordering
// i = j; // i = j;
i = pOrder[j]; i = pOrder[j];
// check init state // check init state
...@@ -386,6 +389,7 @@ int Pdr_ManGeneralize( Pdr_Man_t * p, int k, Pdr_Set_t * pCube, Pdr_Set_t ** ppP ...@@ -386,6 +389,7 @@ int Pdr_ManGeneralize( Pdr_Man_t * p, int k, Pdr_Set_t * pCube, Pdr_Set_t ** ppP
// get the ordering by decreasing priorit // get the ordering by decreasing priorit
pOrder = Pdr_ManSortByPriority( p, pCubeMin ); pOrder = Pdr_ManSortByPriority( p, pCubeMin );
} }
}
assert( ppCubeMin != NULL ); assert( ppCubeMin != NULL );
*ppCubeMin = pCubeMin; *ppCubeMin = pCubeMin;
......
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