ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
xsatCnfReader.c File Reference
#include <ctype.h>
#include "misc/util/abc_global.h"
#include "misc/vec/vecInt.h"
#include "xsatSolver.h"
Include dependency graph for xsatCnfReader.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START char * xSAT_FileRead (FILE *pFile)
 INCLUDES ///.
 
int xSAT_SolverParseDimacs (FILE *pFile, xSAT_Solver_t **p)
 FUNCTION DECLARATIONS ///.
 

Function Documentation

◆ xSAT_FileRead()

ABC_NAMESPACE_IMPL_START char * xSAT_FileRead ( FILE * pFile)

INCLUDES ///.

CFile****************************************************************

FileName [xsatCnfReader.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [xSAT - A SAT solver written in C. Read the license file for more info.]

Synopsis [CNF DIMACS file format parser.]

Author [Bruno Schmitt bosch.nosp@m.mitt.nosp@m.@inf..nosp@m.ufrg.nosp@m.s.br]

Affiliation [UC Berkeley / UFRGS]

Date [Ver. 1.0. Started - November 10, 2016.]

Revision [] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Read the file into the internal buffer.]

Description []

SideEffects []

SeeAlso []

Definition at line 49 of file xsatCnfReader.c.

50{
51 int nFileSize;
52 char * pBuffer;
53 int RetValue;
54 // get the file size, in bytes
55 fseek( pFile, 0, SEEK_END );
56 nFileSize = ftell( pFile );
57 // move the file current reading position to the beginning
58 rewind( pFile );
59 // load the contents of the file into memory
60 pBuffer = ABC_ALLOC( char, nFileSize + 3 );
61 RetValue = fread( pBuffer, nFileSize, 1, pFile );
62 // terminate the string with '\0'
63 pBuffer[ nFileSize + 0] = '\n';
64 pBuffer[ nFileSize + 1] = '\0';
65 return pBuffer;
66}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
VOID_HACK rewind()
#define SEEK_END
Definition zconf.h:392
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xSAT_SolverParseDimacs()

int xSAT_SolverParseDimacs ( FILE * pFile,
xSAT_Solver_t ** p )

FUNCTION DECLARATIONS ///.

Function*************************************************************

Synopsis [Starts the solver and reads the DIMAC file.]

Description [Returns FALSE upon immediate conflict.]

SideEffects []

SeeAlso []

Definition at line 222 of file xsatCnfReader.c.

223{
224 char * pText;
225 int Value;
226 pText = xSAT_FileRead( pFile );
227 Value = xSAT_ParseDimacs( pText, p );
228 ABC_FREE( pText );
229 return Value;
230}
#define ABC_FREE(obj)
Definition abc_global.h:267
Cube * p
Definition exorList.c:222
ABC_NAMESPACE_IMPL_START char * xSAT_FileRead(FILE *pFile)
INCLUDES ///.
Here is the call graph for this function: