55 printf(
"Clause %d: {", Clause );
58 printf(
" %d", Entry );
78 int Entry1, Entry2, ResVar;
83 if ( Entry1 == -Entry2 )
90 printf(
"Error: Clause %d = Resolve(%d, %d): The number of pivot vars is %d.\n",
91 Result, Clause1, Clause2, Counter );
99 if ( Entry1 != ResVar && Entry1 != -ResVar )
103 if ( Entry2 != ResVar && Entry2 != -ResVar )
123 int c, i, Num, RetValue,
Counter, Counter2, Clause1, Clause2;
126 pFile = fopen( pFileName,
"r" );
130 Counter = Counter2 = 0;
131 while ( (c = fgetc(pFile)) != EOF )
133 Counter += (c ==
'\n');
134 Counter2 += (c ==
'*');
137 printf(
"The proof contains %d roots and %d resolution steps.\n", Counter-Counter2, Counter2 );
140 for ( i = 1 ; ; i++ )
142 RetValue = RetValue = fscanf( pFile,
"%d", &Num );
146 while ( (c = fgetc( pFile )) ==
' ' );
149 RetValue = fscanf( pFile,
"%d %d", &Clause1, &Clause2 );
151 RetValue = fscanf( pFile,
"%d", &Num );
156 printf(
"Error detected in the resolution proof.\n" );
167 RetValue = fscanf( pFile,
"%d", &Num );
173 RetValue = fscanf( pFile,
"%d", &Num );
180 printf(
"The last clause is not empty.\n" );
182 printf(
"The empty clause is derived.\n" );
static void Vec_VecPush(Vec_Vec_t *p, int Level, void *Entry)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static void Vec_VecFree(Vec_Vec_t *p)
void Sat_ProofChecker(char *pFileName)
ABC_NAMESPACE_IMPL_START void Sat_PrintClause(Vec_Vec_t *vClauses, int Clause)
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_END
static Vec_Vec_t * Vec_VecStart(int nSize)
#define ABC_NAMESPACE_IMPL_START
static int Vec_IntSize(Vec_Int_t *p)
static Vec_Ptr_t * Vec_VecEntry(Vec_Vec_t *p, int i)
static int Vec_IntPushUnique(Vec_Int_t *p, int Entry)
int Sat_ProofResolve(Vec_Vec_t *vClauses, int Result, int Clause1, int Clause2)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.