68 assert( Vec_IntSize(vPrio) == Aig_ManRegNum(pAig) );
74 p->vCiObjs = Vec_IntAlloc( 100 );
75 p->vFosPre = Vec_IntAlloc( 100 );
76 p->vFosAbs = Vec_IntAlloc( 100 );
77 p->vCoObjs = Vec_IntAlloc( 100 );
78 p->vCiVals = Vec_IntAlloc( 100 );
79 p->vCoVals = Vec_IntAlloc( 100 );
80 p->vNodes = Vec_IntAlloc( 100 );
81 p->vTemp = Vec_IntAlloc( 100 );
82 p->vPiLits = Vec_IntAlloc( 100 );
83 p->vFfLits = Vec_IntAlloc( 100 );
90 Vec_IntFree(
p->vCiObjs );
91 Vec_IntFree(
p->vFosPre );
92 Vec_IntFree(
p->vFosAbs );
93 Vec_IntFree(
p->vCoObjs );
94 Vec_IntFree(
p->vCiVals );
95 Vec_IntFree(
p->vCoVals );
96 Vec_IntFree(
p->vNodes );
97 Vec_IntFree(
p->vTemp );
98 Vec_IntFree(
p->vPiLits );
99 Vec_IntFree(
p->vFfLits );
120 if ( Gia_ObjIsCi(pObj) )
123 if ( Gia_ObjIsPi(
p->pGia, pObj) )
125 Vec_IntPush(
p->vCiObjs, Gia_ObjId(
p->pGia, pObj) );
128 Entry = Gia_ObjCioId(pObj) - Gia_ManPiNum(
p->pGia);
129 if ( Vec_IntEntry(
p->vPrio, Entry) )
130 Vec_IntPush(
p->vFosPre, Gia_ObjId(
p->pGia, pObj) );
132 Vec_IntPush(
p->vFosAbs, Gia_ObjId(
p->pGia, pObj) );
135 assert( Gia_ObjIsAnd(pObj) );
138 Vec_IntPush(
p->vNodes, Gia_ObjId(
p->pGia, pObj) );
144 Vec_IntClear(
p->vCiObjs );
145 Vec_IntClear(
p->vFosPre );
146 Vec_IntClear(
p->vFosAbs );
147 Vec_IntClear(
p->vNodes );
148 Gia_ManConst0(
p->pGia)->Value = ~0;
152printf(
"%d %d %d \n", Vec_IntSize(
p->vCiObjs), Vec_IntSize(
p->vFosPre), Vec_IntSize(
p->vFosAbs) );
153 p->nPiLits = Vec_IntSize(
p->vCiObjs);
155 Vec_IntSelectSort( Vec_IntArray(
p->vCiObjs), Vec_IntSize(
p->vCiObjs) );
157 Vec_IntSelectSortReverse( Vec_IntArray(
p->vFosPre), Vec_IntSize(
p->vFosPre) );
159 Vec_IntPush(
p->vCiObjs, Entry );
161 Vec_IntSelectSortReverse( Vec_IntArray(
p->vFosAbs), Vec_IntSize(
p->vFosAbs) );
163 Vec_IntPush(
p->vCiObjs, Entry );
197 int i, Lit, LitAux,
Var, Value, RetValue, nCoreLits, * pCoreLits;
201 Vec_IntClear(
p->vCoObjs );
204 pObj = Gia_ManCo(
p->pGia,
p->pMan->iOutCur);
205 Vec_IntPush(
p->vCoObjs, Gia_ObjId(
p->pGia, pObj) );
210 for ( i = 0; i < pCube->
nLits; i++ )
212 if ( pCube->
Lits[i] == -1 )
214 pObj = Gia_ManCo(
p->pGia, Gia_ManPoNum(
p->pGia) + Abc_Lit2Var(pCube->
Lits[i]));
215 Vec_IntPush(
p->vCoObjs, Gia_ObjId(
p->pGia, pObj) );
220Abc_Print( 1,
"Trying to justify cube " );
224 Abc_Print( 1,
"<prop=fail>" );
225Abc_Print( 1,
" in frame %d.\n", k );
240 vLits =
p->pMan->vLits;
241 Lit = Abc_Var2Lit(
Pdr_ObjSatVar(
p->pMan, k, 2, Aig_ManCo(
p->pMan->pAig,
p->pMan->iOutCur)), 1 );
242 Vec_IntFill( vLits, 1, Lit );
247 Vec_IntPush( vLits, LitAux );
248 RetValue =
sat_solver_addclause( pSat, Vec_IntArray(vLits), Vec_IntArray(vLits) + Vec_IntSize(vLits) );
250 sat_solver_compress( pSat );
253 Vec_IntClear(
p->vTemp );
254 Vec_IntPush(
p->vTemp, Abc_LitNot(LitAux) );
261 assert( Aig_ObjIsCi(pObj) );
262 Vec_IntPush(
p->vTemp, Abc_Var2Lit(iVar, !Value) );
266 printf(
"Clause with %d lits on lev %d\n", pCube ? pCube->
nLits : 0, k );
267 Vec_IntPrint(
p->vTemp );
293 RetValue =
sat_solver_solve( pSat, Vec_IntArray(
p->vTemp), Vec_IntLimit(
p->vTemp), 0, 0, 0, 0 );
297 nCoreLits = sat_solver_final(pSat, &pCoreLits);
300 Vec_IntClear(
p->vTemp );
301 for ( i = 0; i < nCoreLits; i++ )
302 Vec_IntPush(
p->vTemp, Abc_LitNot(pCoreLits[i]) );
303 Vec_IntSelectSort( Vec_IntArray(
p->vTemp), Vec_IntSize(
p->vTemp) );
306 Vec_IntPrint(
p->vTemp );
309 Vec_IntClear(
p->vPiLits );
310 Vec_IntClear(
p->vFfLits );
311 vVar2Ids = (
Vec_Int_t *)Vec_PtrGetEntry( &
p->pMan->vVar2Ids, k );
314 if ( Lit != Abc_LitNot(LitAux) )
316 int Id = Vec_IntEntry( vVar2Ids, Abc_Lit2Var(Lit) );
317 Aig_Obj_t * pObj = Aig_ManObj(
p->pMan->pAig, Id );
318 assert( Aig_ObjIsCi(pObj) );
319 if ( Saig_ObjIsPi(
p->pMan->pAig, pObj) )
320 Vec_IntPush(
p->vPiLits, Abc_Var2Lit(Aig_ObjCioId(pObj), Abc_LitIsCompl(Lit)) );
322 Vec_IntPush(
p->vFfLits, Abc_Var2Lit(Aig_ObjCioId(pObj) - Saig_ManPiNum(
p->pMan->pAig), Abc_LitIsCompl(Lit)) );
325 assert( Vec_IntSize(
p->vTemp) == Vec_IntSize(
p->vPiLits) + Vec_IntSize(
p->vFfLits) + 1 );
328 if (
p->pMan->pPars->fUseAbs &&
p->pMan->vAbsFlops )
333 if ( Vec_IntEntry(
p->pMan->vAbsFlops, Abc_Lit2Var(iLit)) )
334 Vec_IntWriteEntry(
p->vFfLits, k++, iLit );
336 Vec_IntPush(
p->vPiLits, 2*Saig_ManPiNum(
p->pMan->pAig) + iLit );
338 Vec_IntShrink(
p->vFfLits, k );
342 Vec_IntPrint(
p->vPiLits );
344 Vec_IntPrint(
p->vFfLits );
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
struct Aig_Obj_t_ Aig_Obj_t
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
#define sat_solver_addclause
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
void Gia_ManStop(Gia_Man_t *p)
struct Gia_Obj_t_ Gia_Obj_t
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
int Pdr_ManFreeVar(Pdr_Man_t *p, int k)
int Pdr_ObjSatVar(Pdr_Man_t *p, int k, int Pol, Aig_Obj_t *pObj)
FUNCTION DECLARATIONS ///.
sat_solver * Pdr_ManFetchSolver(Pdr_Man_t *p, int k)
Pdr_Set_t * Pdr_SetCreate(Vec_Int_t *vLits, Vec_Int_t *vPiLits)
struct Pdr_Set_t_ Pdr_Set_t
void Pdr_SetPrint(FILE *pFile, Pdr_Set_t *p, int nRegs, Vec_Int_t *vFlopCounts)
struct Txs3_Man_t_ Txs3_Man_t
int Pdr_SetIsInit(Pdr_Set_t *p, int iRemove)
struct Pdr_Man_t_ Pdr_Man_t
Vec_Int_t * Pdr_ManCubeToLits(Pdr_Man_t *p, int k, Pdr_Set_t *pCube, int fCompl, int fNext)
void Pdr_ManCollectValues(Pdr_Man_t *p, int k, Vec_Int_t *vObjIds, Vec_Int_t *vValues)
Pdr_Set_t * Txs3_ManTernarySim(Txs3_Man_t *p, int k, Pdr_Set_t *pCube)
Txs3_Man_t * Txs3_ManStart(Pdr_Man_t *pMan, Aig_Man_t *pAig, Vec_Int_t *vPrio)
FUNCTION DEFINITIONS ///.
void Txs3_ManStop(Txs3_Man_t *p)
void Txs3_ManCollectCone_rec(Txs3_Man_t *p, Gia_Obj_t *pObj)
void Txs3_ManCollectCone(Txs3_Man_t *p, int fVerbose)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
#define Vec_IntForEachEntryTwo(vVec1, vVec2, Entry1, Entry2, i)