summaryrefslogtreecommitdiffstats
path: root/src/aig/int/intUtil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/aig/int/intUtil.c')
-rw-r--r--src/aig/int/intUtil.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/aig/int/intUtil.c b/src/aig/int/intUtil.c
index 0d8beda5..ce48c37d 100644
--- a/src/aig/int/intUtil.c
+++ b/src/aig/int/intUtil.c
@@ -46,17 +46,28 @@ ABC_NAMESPACE_IMPL_START
int Inter_ManCheckInitialState( Aig_Man_t * p )
{
Cnf_Dat_t * pCnf;
+ Aig_Obj_t * pObj;
sat_solver * pSat;
- int status;
+ int i, status;
int clk = clock();
pCnf = Cnf_Derive( p, Saig_ManRegNum(p) );
pSat = (sat_solver *)Cnf_DataWriteIntoSolver( pCnf, 1, 1 );
- Cnf_DataFree( pCnf );
if ( pSat == NULL )
+ {
+ Cnf_DataFree( pCnf );
return 0;
+ }
status = sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
- sat_solver_delete( pSat );
ABC_PRT( "Time", clock() - clk );
+ if ( status == l_True )
+ {
+ p->pSeqModel = Abc_CexAlloc( Aig_ManRegNum(p), Saig_ManPiNum(p), 1 );
+ Saig_ManForEachPi( p, pObj, i )
+ if ( sat_solver_var_value( pSat, pCnf->pVarNums[Aig_ObjId(pObj)] ) )
+ Aig_InfoSetBit( p->pSeqModel->pData, Aig_ManRegNum(p) + i );
+ }
+ Cnf_DataFree( pCnf );
+ sat_solver_delete( pSat );
return status == l_True;
}