56 int Lits[3], status, i;
59 assert( Aig_ManCiNum(pManOn) == Aig_ManCiNum(pManOff) );
60 assert( Aig_ManCoNum(pManOn) == Aig_ManCoNum(pManOff) );
63 pManOn->nRegs = Aig_ManCoNum(pManOn);
64 pCnfOn =
Cnf_Derive( pManOn, Aig_ManCoNum(pManOn) );
67 pManOff->nRegs = Aig_ManCoNum(pManOn);
68 pCnfOff =
Cnf_Derive( pManOff, Aig_ManCoNum(pManOff) );
80 for ( i = 0; i < pCnfOn->
nClauses; i++ )
92 for ( i = 0; i < pCnfOff->
nClauses; i++ )
107 pObj2 = Aig_ManCi( pManOff, i );
109 Lits[0] = toLitCond( pCnfOn->
pVarNums[pObj->
Id], 0 );
110 Lits[1] = toLitCond( pCnfOff->
pVarNums[pObj2->
Id], 1 );
113 Lits[0] = toLitCond( pCnfOn->
pVarNums[pObj->
Id], 1 );
114 Lits[1] = toLitCond( pCnfOff->
pVarNums[pObj2->
Id], 0 );
124 pObj2 = Aig_ManCo( pManOff, i );
126 Lits[0] = toLitCond( pCnfOn->
pVarNums[pObj->
Id], 0 );
127 Lits[1] = toLitCond( pCnfOff->
pVarNums[pObj2->
Id], 0 );
128 status =
sat_solver_solve( pSat, Lits, Lits+2, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
130 printf(
"The incremental SAT problem is not UNSAT.\n" );
151 void * pSatCnf = NULL;
158 int Lits[3], status, i;
162 assert( Aig_ManCiNum(pManOn) == Aig_ManCiNum(pManOff) );
180 for ( i = 0; i < pCnfOn->
nClauses; i++ )
200 for ( i = 0; i < pCnfOff->
nClauses; i++ )
213 vVarsAB = Vec_IntAlloc( Aig_ManCiNum(pManOn) );
215 Vec_IntPush( vVarsAB, iLast );
219 Vec_IntPush( vVarsAB, pCnfOn->
pVarNums[pObj->
Id] );
220 pObj2 = Aig_ManCi( pManOff, i );
222 Lits[0] = toLitCond( pCnfOn->
pVarNums[pObj->
Id], 0 );
223 Lits[1] = toLitCond( pCnfOff->
pVarNums[pObj2->
Id], 1 );
226 Lits[0] = toLitCond( pCnfOn->
pVarNums[pObj->
Id], 1 );
227 Lits[1] = toLitCond( pCnfOff->
pVarNums[pObj2->
Id], 0 );
248 status =
sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
255 else if ( status ==
l_True )
264 if ( pSatCnf == NULL )
266 printf(
"The SAT problem is not unsat.\n" );
267 Vec_IntFree( vVarsAB );
288 Vec_IntFree( vVarsAB );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
void Aig_ManInterFast(Aig_Man_t *pManOn, Aig_Man_t *pManOff, int fVerbose)
FUNCTION DEFINITIONS ///.
Aig_Man_t * Aig_ManInter(Aig_Man_t *pManOn, Aig_Man_t *pManOff, int fRelation, int fVerbose)
ABC_NAMESPACE_IMPL_START abctime timeCnf
DECLARATIONS ///.
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
struct Aig_Obj_t_ Aig_Obj_t
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
#define Aig_ManForEachCo(p, pObj, i)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
#define sat_solver_addclause
Cnf_Dat_t * Cnf_DeriveSimple(Aig_Man_t *p, int nOutputs)
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
struct Cnf_Dat_t_ Cnf_Dat_t
void Cnf_DataFree(Cnf_Dat_t *p)
void Cnf_DataLift(Cnf_Dat_t *p, int nVarsPlus)
void * Inta_ManInterpolate(Inta_Man_t *p, Sto_Man_t *pCnf, abctime TimeToStop, void *vVarsAB, int fVerbose)
Inta_Man_t * Inta_ManAlloc()
FUNCTION DEFINITIONS ///.
void Inta_ManFree(Inta_Man_t *p)
sat_solver * sat_solver_new(void)
int sat_solver_store_change_last(sat_solver *s)
void sat_solver_store_mark_clauses_a(sat_solver *s)
int sat_solver_simplify(sat_solver *s)
void sat_solver_setnvars(sat_solver *s, int n)
void sat_solver_store_alloc(sat_solver *s)
void sat_solver_store_mark_roots(sat_solver *s)
void * sat_solver_store_release(sat_solver *s)
void sat_solver_delete(sat_solver *s)
void Sto_ManFree(Sto_Man_t *p)
struct Sto_Man_t_ Sto_Man_t
struct Inta_Man_t_ Inta_Man_t