From 4aa434ad11355297dffa4b2384b5777e68e8ed8a Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Fri, 25 Jan 2013 14:16:31 +0700 Subject: Updated CEX code to handle trivial CEX of the type (Abc_Cex_t*)1. --- src/misc/util/utilCex.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src') diff --git a/src/misc/util/utilCex.c b/src/misc/util/utilCex.c index 75b99492..b0ce66be 100644 --- a/src/misc/util/utilCex.c +++ b/src/misc/util/utilCex.c @@ -146,6 +146,8 @@ Abc_Cex_t * Abc_CexDup( Abc_Cex_t * p, int nRegsNew ) { Abc_Cex_t * pCex; int i; + if ( p == (Abc_Cex_t *)(ABC_PTRINT_T)1 ) + return p; if ( nRegsNew == -1 ) nRegsNew = p->nRegs; pCex = Abc_CexAlloc( nRegsNew, p->nPis, p->iFrame+1 ); @@ -259,6 +261,11 @@ void Abc_CexPrintStats( Abc_Cex_t * p ) printf( "The counter example is NULL.\n" ); return; } + if ( p == (Abc_Cex_t *)(ABC_PTRINT_T)1 ) + { + printf( "The counter example is present but not available (pointer has value \"1\").\n" ); + return; + } for ( k = 0; k < p->nBits; k++ ) Counter += Abc_InfoHasBit(p->pData, k); printf( "CEX: Po =%4d Frame =%4d FF = %d PI = %d Bit =%8d 1s =%8d (%5.2f %%)\n", @@ -273,6 +280,11 @@ void Abc_CexPrintStatsInputs( Abc_Cex_t * p, int nInputs ) printf( "The counter example is NULL.\n" ); return; } + if ( p == (Abc_Cex_t *)(ABC_PTRINT_T)1 ) + { + printf( "The counter example is present but not available (pointer has value \"1\").\n" ); + return; + } for ( k = 0; k < p->nBits; k++ ) { Counter += Abc_InfoHasBit(p->pData, k); @@ -304,6 +316,11 @@ void Abc_CexPrint( Abc_Cex_t * p ) printf( "The counter example is NULL.\n" ); return; } + if ( p == (Abc_Cex_t *)(ABC_PTRINT_T)1 ) + { + printf( "The counter example is present but not available (pointer has value \"1\").\n" ); + return; + } Abc_CexPrintStats( p ); printf( "State : " ); for ( k = 0; k < p->nRegs; k++ ) @@ -350,6 +367,8 @@ void Abc_CexFreeP( Abc_Cex_t ** p ) ***********************************************************************/ void Abc_CexFree( Abc_Cex_t * p ) { + if ( p == (Abc_Cex_t *)(ABC_PTRINT_T)1 ) + return; ABC_FREE( p ); } -- cgit v1.2.3