mirror of https://github.com/YosysHQ/abc.git
Recording and reusing learned util clauses in bmc2.
This commit is contained in:
parent
2379dea445
commit
a40c13a93c
|
|
@ -207,7 +207,7 @@ void Rnm_ManCollect_rec( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vObjs, int
|
|||
}
|
||||
void Rnm_ManCollect( Rnm_Man_t * p )
|
||||
{
|
||||
Gia_Obj_t * pObj;
|
||||
Gia_Obj_t * pObj = NULL;
|
||||
int i;
|
||||
// mark const/PIs/PPIs
|
||||
Gia_ManIncrementTravId( p->pGia );
|
||||
|
|
|
|||
|
|
@ -1461,6 +1461,8 @@ unsigned * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj )
|
|||
pTruth = Gla_ObjTruthElem( p, Gia_ObjCioId(pRoot) );
|
||||
else if ( Gia_ObjIsAnd(pRoot) )
|
||||
pTruth = Gla_ObjTruthNode( p, pRoot );
|
||||
else
|
||||
pTruth = NULL;
|
||||
return (unsigned *)Gla_ObjTruthDup( p, Gla_ObjTruthFree2(p), pTruth, Gia_ObjIsCo(pObj) && Gia_ObjFaninC0(pObj) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -671,7 +671,7 @@ Abc_Cex_t * Saig_BmcGenerateCounterExample( Saig_Bmc_t * p )
|
|||
int Saig_BmcSolveTargets( Saig_Bmc_t * p, int nStart, int * pnOutsSolved )
|
||||
{
|
||||
Aig_Obj_t * pObj;
|
||||
int i, VarNum, Lit, RetValue;
|
||||
int i, k, VarNum, Lit, status, RetValue;
|
||||
assert( Vec_PtrSize(p->vTargets) > 0 );
|
||||
if ( p->pSat->qtail != p->pSat->qhead )
|
||||
{
|
||||
|
|
@ -688,7 +688,23 @@ int Saig_BmcSolveTargets( Saig_Bmc_t * p, int nStart, int * pnOutsSolved )
|
|||
Lit = toLitCond( VarNum, Aig_IsComplement(pObj) );
|
||||
RetValue = sat_solver_solve( p->pSat, &Lit, &Lit + 1, (ABC_INT64_T)p->nConfMaxOne, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
|
||||
if ( RetValue == l_False ) // unsat
|
||||
{
|
||||
// add final unit clause
|
||||
Lit = lit_neg( Lit );
|
||||
status = sat_solver_addclause( p->pSat, &Lit, &Lit + 1 );
|
||||
assert( status );
|
||||
// add learned units
|
||||
for ( k = 0; k < veci_size(&p->pSat->unit_lits); k++ )
|
||||
{
|
||||
Lit = veci_begin(&p->pSat->unit_lits)[k];
|
||||
status = sat_solver_addclause( p->pSat, &Lit, &Lit + 1 );
|
||||
assert( status );
|
||||
}
|
||||
veci_resize(&p->pSat->unit_lits, 0);
|
||||
// propagate units
|
||||
sat_solver_compress( p->pSat );
|
||||
continue;
|
||||
}
|
||||
if ( RetValue == l_Undef ) // undecided
|
||||
return l_Undef;
|
||||
// generate counter-example
|
||||
|
|
|
|||
|
|
@ -2402,7 +2402,7 @@ void Extra_NpnTest()
|
|||
clock_t clk = clock();
|
||||
word * pFuncs;
|
||||
int * pComp, * pPerm;
|
||||
int i, k, nUnique = 0;
|
||||
int i;//, k, nUnique = 0;
|
||||
/*
|
||||
// read functions
|
||||
pFuncs = Extra_NpnRead( "C:\\_projects\\abc\\_TEST\\allan\\lib6var5M.txt", nFuncs );
|
||||
|
|
|
|||
|
|
@ -1526,6 +1526,7 @@ int sat_solver_solve(sat_solver* s, lit* begin, lit* end, ABC_INT64_T nConfLimit
|
|||
return l_False;
|
||||
}
|
||||
////////////////////////////////////////////////
|
||||
veci_resize(&s->unit_lits, 0);
|
||||
|
||||
// set the external limits
|
||||
s->nCalls++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue