219 for ( i = 0; i < (int)pClause->
nLits; i++ )
220 printf(
" %d", pClause->
pLits[i] );
238 printf(
"Resolvent: {" );
239 for ( i = 0; i < nResLits; i++ )
240 printf(
" %d", pResLits[i] );
257 printf(
"Clause %2d : ", pClause->
Id );
278 if ( pClause->
pLits[0] == Lit )
327 for ( i = p->
nTrailSize - 1; i >= Level; i-- )
356 for ( pCur = p->
pWatches[Lit]; pCur; pCur = *ppPrev )
359 if ( pCur->
pLits[0] == LitF )
362 pCur->
pLits[1] = LitF;
377 for ( i = 2; i < (int)pCur->
nLits; i++ )
384 pCur->
pLits[i] = LitF;
391 if ( i < (
int)pCur->
nLits )
456 for ( v = 0; v < (int)pClause->
nLits; v++ )
458 fprintf( p->
pFile,
" 0 0\n" );
476 int i, v,
Var, PrevId;
489 for ( v = 0; v < (int)pConflict->
nLits; v++ )
521 if ( pReason == NULL )
526 for ( v = 1; v < (int)pReason->
nLits; v++ )
552 for ( v1 = 0; v1 < p->
nResLits; v1++ )
556 printf(
"Recording clause %d: Cannot find variable %d in the temporary resolvent.\n", pFinal->
Id, Var );
558 printf(
"Recording clause %d: The resolved variable %d is in the wrong polarity.\n", pFinal->
Id, Var );
565 for ( v2 = 1; v2 < (int)pReason->
nLits; v2++ )
567 for ( v1 = 0; v1 < p->
nResLits; v1++ )
574 printf(
"Recording clause %d: Ran out of space for intermediate resolvent.\n", pFinal->
Id );
582 printf(
"Recording clause %d: Trying to resolve the clause with more than one opposite literal.\n", pFinal->
Id );
604 for ( v1 = 0; v1 < p->
nResLits; v1++ )
606 for ( v2 = 0; v2 < (int)pFinal->
nLits; v2++ )
609 if ( v2 < (
int)pFinal->
nLits )
613 if ( v1 < p->nResLits )
615 printf(
"Recording clause %d: The final resolvent is wrong.\n", pFinal->
Id );
626 for ( v1 = 0; v1 < (int)pFinal->
nLits; v1++ )
628 for ( v2 = 0; v2 < p->
nResLits; v2++ )
631 if ( v2 < p->nResLits )
635 for ( v2 = v1; v2 < (int)pFinal->
nLits; v2++ )
675 if ( pClause->
nLits == 0 )
676 printf(
"Error: Empty clause is attempted.\n" );
683 for ( i = 0; i < (int)pClause->
nLits; i++ )
692 for ( i = 0; i < (int)pClause->
nLits; i++ )
701 if ( pConflict == NULL )
712 for ( i = 0; i < (int)pConflict->
nLits; i++ )
714 for ( j = 0; j < (int)pClause->
nLits; j++ )
715 if ( pConflict->
pLits[i] == pClause->
pLits[j] )
717 if ( j == (
int)pClause->
nLits )
720 if ( i == (
int)pConflict->
nLits )
737 if ( pClause->
nLits > 1 )
805 if ( pClause->
nLits > 1 )
811 if ( pClause->
nLits != 1 )
823 printf(
"Found root level conflict!\n" );
835 printf(
"Found root level conflict!\n" );
862 int nConfMax = 1000000;
866 int i, iClause, RetValue;
883 printf(
"The core verification problem is trivially UNSAT.\n" );
889 RetValue =
sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)nConfMax, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
894 printf(
"Conflict limit is reached. " );
895 else if ( RetValue ==
l_True )
896 printf(
"UNSAT core verification FAILED. " );
898 printf(
"UNSAT core verification succeeded. " );
904 printf(
"UNSAT core verification FAILED. \n" );
929 if ( iThis < nRoots )
983 p->
pFile = fopen(
"proof.cnf_",
"w" );
1002 if ( pClause->
fRoot )
1029 printf(
"Vars = %d. Roots = %d. Learned = %d. Resol steps = %d. Ave = %.2f. Mem = %.2f MB\n",
1042 printf(
"Root clauses = %d. Learned clauses = %d. UNSAT core size = %d.\n",
1065 int v, i, iClause, fCompl, iObj, iFrame;
1071 fprintf( pFile,
"UNSAT contains %d learned clauses:\n",
Vec_IntSize(vCore) );
1075 fprintf( pFile,
"%6d : %6d : ", i, iClause - pCnf->
nRoots );
1076 for ( v = 0; v < (int)pClause->
nLits; v++ )
1081 fprintf( pFile,
"%s%d(%d) ", fCompl ?
"!":
"", iObj, iFrame );
1083 if ( pClause->
nLits == 0 )
1084 fprintf( pFile,
"Empty" );
1085 fprintf( pFile,
"\n" );
int Sto_ManMemoryReport(Sto_Man_t *p)
void * Intp_ManUnsatCore(Intp_Man_t *p, Sto_Man_t *pCnf, int fLearned, int fVerbose)
static int lit_check(lit l, int n)
void Intp_ManPrintClause(Intp_Man_t *p, Sto_Cls_t *pClause)
void Intp_ManPrintInterOne(Intp_Man_t *p, Sto_Cls_t *pClause)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
int sat_solver_addclause(sat_solver *s, lit *begin, lit *end)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static void Intp_ManProofSet(Intp_Man_t *p, Sto_Cls_t *pCls, int n)
#define ABC_REALLOC(type, obj, num)
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
static int lit_var(lit l)
void sat_solver_delete(sat_solver *s)
static Sto_Cls_t * Intp_ManPropagateOne(Intp_Man_t *p, lit Lit)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
static abctime Abc_Clock()
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_VecFree(Vec_Vec_t *p)
for(p=first;p->value< newval;p=p->next)
Intp_Man_t * Intp_ManAlloc()
FUNCTION DEFINITIONS ///.
static lit lit_neg(lit l)
void Intp_ManFree(Intp_Man_t *p)
static void Vec_StrWriteEntry(Vec_Str_t *p, int i, char Entry)
static int Abc_LitIsCompl(int Lit)
static char Vec_StrEntry(Vec_Str_t *p, int i)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void * Vec_PtrEntryLast(Vec_Ptr_t *p)
static void Vec_StrFree(Vec_Str_t *p)
static int Vec_IntEntry(Vec_Int_t *p, int i)
#define ABC_NAMESPACE_IMPL_END
Sto_Cls_t * Intp_ManPropagate(Intp_Man_t *p, int Start)
static Vec_Str_t * Vec_StrStart(int nSize)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
void Intp_ManPrintResolvent(lit *pResLits, int nResLits)
int Intp_ManProofRecordOne(Intp_Man_t *p, Sto_Cls_t *pClause)
static int Intp_ManEnqueue(Intp_Man_t *p, lit Lit, Sto_Cls_t *pReason)
int Intp_ManProofTraceOne(Intp_Man_t *p, Sto_Cls_t *pConflict, Sto_Cls_t *pFinal)
static int Intp_ManProofGet(Intp_Man_t *p, Sto_Cls_t *pCls)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
void Intp_ManUnsatCore_rec(Vec_Ptr_t *vAntClas, int iThis, Vec_Int_t *vCore, int nRoots, Vec_Str_t *vVisited, int fLearned)
sat_solver * sat_solver_new(void)
static int Vec_IntSize(Vec_Int_t *p)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void Intp_ManWatchClause(Intp_Man_t *p, Sto_Cls_t *pClause, lit Lit)
void Intp_ManProofWriteOne(Intp_Man_t *p, Sto_Cls_t *pClause)
int Intp_ManProcessRoots(Intp_Man_t *p)
static int Abc_Lit2Var(int Lit)
static void Intp_ManCancelUntil(Intp_Man_t *p, int Level)
static void Vec_PtrClear(Vec_Ptr_t *p)
#define Sto_ManForEachClause(p, pCls)
#define Sto_ManForEachClauseRoot(p, pCls)
void Intp_ManUnsatCorePrintForBmc(FILE *pFile, Sto_Man_t *pCnf, void *vCore0, void *vVarMap0)
void Intp_ManUnsatCoreVerify(Sto_Man_t *pCnf, Vec_Int_t *vCore)
void Intp_ManResize(Intp_Man_t *p)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static ABC_NAMESPACE_IMPL_START const lit LIT_UNDEF
DECLARATIONS ///.
static void Vec_PtrFree(Vec_Ptr_t *p)
static int lit_print(lit l)