72 pFile = fopen( pFileName,
"w" );
75 printf(
"Cannot open log file for writing \"%s\".\n" , pFileName );
80 fprintf( pFile,
"snl_UNSAT" );
81 else if ( Status == 0 )
82 fprintf( pFile,
"snl_SAT" );
83 else if ( Status == -1 )
84 fprintf( pFile,
"snl_UNK" );
86 printf(
"Abc_NtkWriteLogFile(): Cannot recognize solving status.\n" );
87 fprintf( pFile,
" " );
89 fprintf( pFile,
"%d", nFrames );
90 fprintf( pFile,
" " );
92 fprintf( pFile,
"%s", pCommand ? pCommand :
"unknown" );
93 if ( pCex && Status == 0 )
94 fprintf( pFile,
" %d", pCex->iPo );
96 if ( pCex && pCex->iFrame != nFrames )
97 fprintf( pFile,
" %d", pCex->iFrame );
98 fprintf( pFile,
"\n" );
101 fprintf( pFile,
"NULL" );
104 for ( i = 0; i < pCex->nRegs; i++ )
107 fprintf( pFile,
"\n" );
110 fprintf( pFile,
"NULL" );
113 assert( pCex->nBits - pCex->nRegs == pCex->nPis * (pCex->iFrame + 1) );
114 for ( i = pCex->nRegs; i < pCex->nBits; i++ )
117 fprintf( pFile,
"\n" );
137 char Buffer[1000], * pToken, * RetValue;
138 int c, nRegs = -1, nFrames = -1, iPo = -1, Status = -1, nFrames2 = -1;
139 pFile = fopen( pFileName,
"r" );
142 printf(
"Cannot open log file for reading \"%s\".\n" , pFileName );
145 RetValue = fgets( Buffer, 1000, pFile );
149 nFrames = atoi( Buffer +
strlen(
"snl_UNSAT") );
156 nFrames = atoi( pToken );
157 pToken =
strtok( NULL,
" \t\n" );
158 pToken =
strtok( NULL,
" \t\n" );
159 if ( pToken != NULL )
161 iPo = atoi( pToken );
162 pToken =
strtok( NULL,
" \t\n" );
164 nFrames2 = atoi( pToken );
172 nFrames = atoi( Buffer +
strlen(
"snl_UNK") );
176 printf(
"Unrecognized status.\n" );
180 while ( (c = fgetc(pFile)) != EOF )
184 if ( c ==
'0' || c ==
'1' )
189 while ( (c = fgetc(pFile)) != EOF )
191 if ( c ==
'0' || c ==
'1' )
197 int iFrameCex = (nFrames2 == -1) ? nFrames : nFrames2;
200 printf(
"Cannot read register number.\n" );
206 printf(
"Cannot read counter example.\n" );
210 if ( (
Vec_IntSize(vNums)-nRegs) % (iFrameCex + 1) != 0 )
212 printf(
"Incorrect number of bits.\n" );
218 pCex->iFrame = iFrameCex;
220 for ( c = 0; c < pCex->nBits; c++ )
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Abc_InfoHasBit(unsigned *p, int i)
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
int Abc_NtkReadLogFile(char *pFileName, Abc_Cex_t **ppCex, int *pnFrames)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Vec_IntEntry(Vec_Int_t *p, int i)
#define ABC_NAMESPACE_IMPL_END
static void Vec_IntPush(Vec_Int_t *p, int Entry)
ABC_NAMESPACE_IMPL_START void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_START
static void Abc_InfoSetBit(unsigned *p, int i)
static int Vec_IntSize(Vec_Int_t *p)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
static void Vec_IntFree(Vec_Int_t *p)