Commit bacc1bc1 by Yen-Sheng Ho

added callbacks to bmc3 and sat solver

parent 245532ca
...@@ -1416,6 +1416,8 @@ int Saig_ManBmcScalable( Aig_Man_t * pAig, Saig_ParBmc_t * pPars ) ...@@ -1416,6 +1416,8 @@ int Saig_ManBmcScalable( Aig_Man_t * pAig, Saig_ParBmc_t * pPars )
p->pSat->nLearntRatio = p->pPars->nLearnedPerce; p->pSat->nLearntRatio = p->pPars->nLearnedPerce;
p->pSat->nLearntMax = p->pSat->nLearntStart; p->pSat->nLearntMax = p->pSat->nLearntStart;
p->pSat->fNoRestarts = p->pPars->fNoRestarts; p->pSat->fNoRestarts = p->pPars->fNoRestarts;
p->pSat->RunId = p->pPars->RunId;
p->pSat->pFuncStop = p->pPars->pFuncStop;
if ( pPars->fSolveAll && p->vCexes == NULL ) if ( pPars->fSolveAll && p->vCexes == NULL )
p->vCexes = Vec_PtrStart( Saig_ManPoNum(pAig) ); p->vCexes = Vec_PtrStart( Saig_ManPoNum(pAig) );
if ( pPars->fVerbose ) if ( pPars->fVerbose )
......
...@@ -1956,6 +1956,8 @@ int sat_solver_solve_internal(sat_solver* s) ...@@ -1956,6 +1956,8 @@ int sat_solver_solve_internal(sat_solver* s)
break; break;
if ( s->nRuntimeLimit && Abc_Clock() > s->nRuntimeLimit ) if ( s->nRuntimeLimit && Abc_Clock() > s->nRuntimeLimit )
break; break;
if ( s->pFuncStop && s->pFuncStop(s->RunId) )
break;
} }
if (s->verbosity >= 1) if (s->verbosity >= 1)
printf("==============================================================================\n"); printf("==============================================================================\n");
......
...@@ -196,6 +196,10 @@ struct sat_solver_t ...@@ -196,6 +196,10 @@ struct sat_solver_t
// CNF loading // CNF loading
void * pCnfMan; // external CNF manager void * pCnfMan; // external CNF manager
int(*pCnfFunc)(void * p, int); // external callback int(*pCnfFunc)(void * p, int); // external callback
// termination callback
int RunId; // SAT id in this run
int(*pFuncStop)(int); // callback to terminate
}; };
static inline clause * clause_read( sat_solver * s, cla h ) static inline clause * clause_read( sat_solver * s, cla h )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment