54 nFileSize = ftell( pFile );
58 pBuffer =
ABC_ALLOC(
char, nFileSize + 3 );
59 RetValue = fread( pBuffer, nFileSize, 1, pFile );
61 pBuffer[ nFileSize + 0] =
'\n';
62 pBuffer[ nFileSize + 1] =
'\0';
79 while ((**pIn >= 9 && **pIn <= 13) || **pIn == 32)
96 while ( !((**pIn >= 9 && **pIn <= 13) || **pIn == 32) )
146 else if ( **pIn ==
'+' )
148 if ( **pIn < '0' || **pIn >
'9' )
149 fprintf(stderr,
"PARSE ERROR! Unexpected char: %c\n", **pIn),
151 while ( **pIn >=
'0' && **pIn <=
'9' )
152 val = val*10 + (**pIn -
'0'),
154 return neg ? -val : val;
177 if ( parsed_lit == 0 )
179 var = abs(parsed_lit) - 1;
180 sign = (parsed_lit > 0);
183 printf(
"Variable %d is larger than the number of allocated variables (%d).\n", var+1, nVars );
212 else if ( *pIn ==
'c' )
214 else if ( *pIn ==
'p' )
234 printf(
"There is no parameter line.\n" );
static ABC_NAMESPACE_IMPL_START char * Msat_FileRead(FILE *pFile)
DECLARATIONS ///.
static int Msat_ReadDimacs(char *pText, Msat_Solver_t **pS, int fVerbose)
int Msat_SolverAddClause(Msat_Solver_t *p, Msat_IntVec_t *pLits)
static void Msat_ReadWhitespace(char **pIn)
int Msat_SolverSimplifyDB(Msat_Solver_t *p)
void Msat_IntVecClear(Msat_IntVec_t *p)
#define ABC_ALLOC(type, num)
Msat_Solver_t * Msat_SolverAlloc(int nVars, double dClaInc, double dClaDecay, double dVarInc, double dVarDecay, int fVerbose)
static void Msat_ReadNotWhitespace(char **pIn)
void Msat_IntVecPush(Msat_IntVec_t *p, int Entry)
static int Msat_ReadInt(char **pIn)
#define ABC_NAMESPACE_IMPL_END
static void skipLine(char **pIn)
Msat_IntVec_t * Msat_IntVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Msat_IntVecFree(Msat_IntVec_t *p)
#define ABC_NAMESPACE_IMPL_START
static void Msat_ReadClause(char **pIn, Msat_Solver_t *p, Msat_IntVec_t *pLits)
void Msat_SolverSetVerbosity(Msat_Solver_t *p, int fVerbose)
void Msat_SolverClean(Msat_Solver_t *p, int nVars)
int Msat_SolverReadVarNum(Msat_Solver_t *p)
FUNCTION DEFINITIONS ///.
#define MSAT_VAR2LIT(v, s)
int Msat_SolverParseDimacs(FILE *pFile, Msat_Solver_t **p, int fVerbose)
GLOBAL VARIABLES ///.
typedefABC_NAMESPACE_HEADER_START struct Msat_Solver_t_ Msat_Solver_t
INCLUDES ///.