Commit 67e84b71 by Alan Mishchenko

Enhancing printing of counter-examples.

parent c4dd8067
......@@ -185,18 +185,47 @@ Abc_Cex_t * Abc_CexDeriveFromCombModel( int * pModel, int nPis, int nRegs, int i
SeeAlso []
***********************************************************************/
void Abc_CexPrintStats( Abc_Cex_t * p )
{
int k, Counter = 0;
if ( p == NULL )
{
printf( "The counter example is NULL.\n" );
return;
}
for ( k = 0; k < p->nBits; k++ )
Counter += Abc_InfoHasBit(p->pData, k);
printf( "CEX: iPo = %d iFrame = %d nRegs = %d nPis = %d nBits = %d nOnes = %5d (%5.2f %%)\n",
p->iPo, p->iFrame, p->nRegs, p->nPis, p->nBits, Counter, 100.0 * Counter / p->nBits );
}
/**Function*************************************************************
Synopsis [Prints out the counter-example.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Abc_CexPrint( Abc_Cex_t * p )
{
int i, f, k;
printf( "Counter-example: iPo = %d iFrame = %d nRegs = %d nPis = %d nBits = %d\n",
p->iPo, p->iFrame, p->nRegs, p->nPis, p->nBits );
if ( p == NULL )
{
printf( "The counter example is NULL.\n" );
return;
}
Abc_CexPrintStats( p );
printf( "State : " );
for ( k = 0; k < p->nRegs; k++ )
printf( "%d", Abc_InfoHasBit(p->pData, k) );
printf( "\n" );
for ( f = 0; f <= p->iFrame; f++ )
{
printf( "Frame %2d : ", f );
printf( "Frame %3d : ", f );
for ( i = 0; i < p->nPis; i++ )
printf( "%d", Abc_InfoHasBit(p->pData, k++) );
printf( "\n" );
......
......@@ -61,6 +61,7 @@ extern Abc_Cex_t * Abc_CexMakeTriv( int nRegs, int nTruePis, int nTruePos, int
extern Abc_Cex_t * Abc_CexCreate( int nRegs, int nTruePis, int * pArray, int iFrame, int iPo, int fSkipRegs );
extern Abc_Cex_t * Abc_CexDup( Abc_Cex_t * p, int nRegsNew );
extern Abc_Cex_t * Abc_CexDeriveFromCombModel( int * pModel, int nPis, int nRegs, int iPo );
extern void Abc_CexPrintStats( Abc_Cex_t * p );
extern void Abc_CexPrint( Abc_Cex_t * p );
extern void Abc_CexFree( Abc_Cex_t * p );
......
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