1257{
1258 Vec_Int_t * vObjsUsed = Vec_IntAlloc( 100 );
1259 Vec_Int_t * vCiVars = Vec_IntAlloc( 100 );
1261 int i, iVar, iVarLast,
Lit, RetValue, Count = 0, Result = -1;
1262 if ( vDLits ) Vec_IntClear( vDLits );
1263 if ( iLit < 2 )
1264 return iLit;
1265 if ( Vec_IntSize(&
p->vCopies) < Gia_ManObjNum(
p) )
1266 Vec_IntFillExtra( &
p->vCopies, Gia_ManObjNum(
p), -1 );
1267
1268 iVar = Vec_IntSize(vObjsUsed);
1269 Vec_IntPush( vObjsUsed, 0 );
1270 Gia_ObjSetCopyArray(
p, 0, iVar );
1272
1273
1276
1277
1278 Lit = Abc_Var2Lit( iVarLast, !Abc_LitIsCompl(iLit) );
1281 {
1282 Result = 1;
1283 goto cleanup;
1284 }
1285 Lit = Abc_Var2Lit( iVarLast, Abc_LitIsCompl(iLit) );
1288 {
1289 Result = 0;
1290 goto cleanup;
1291 }
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313 vVarMap = Vec_IntStartFull( Vec_IntSize(vObjsUsed) );
1315 {
1316 Gia_Obj_t * pObj = Gia_ManObj(
p, Vec_IntEntry(vObjsUsed, iVar) );
1317 assert( Gia_ObjIsCi(pObj) );
1318 if ( pFuncCiToKeep(pData, Gia_ObjCioId(pObj)) )
1319 Vec_IntWriteEntry( vVarMap, iVar, i ), Count++;
1320 }
1321 if ( Count == 0 || Count == Vec_IntSize(vCiVars) )
1322 {
1323 Result = Count == 0 ? 1 : iLit;
1324 goto cleanup;
1325 }
1326
1328
1329
1331 Vec_IntWriteEntry( vCiVars, i, Vec_IntEntry(vObjsUsed, iVar) );
1332
1333 if ( vDLits )
1335
1336 RetValue = Gia_ManAndNum(
p);
1338
1339
1340
1341
1342
1343
1344cleanup:
1346 Gia_ObjSetCopyArray(
p, iVar, -1 );
1347 Vec_IntFree( vObjsUsed );
1348 Vec_IntFree( vCiVars );
1349 Vec_IntFreeP( &vVarMap );
1350 Vec_StrFreeP( &vSop );
1351 return Result;
1352}
Vec_Str_t * Glucose_GenerateCubes(bmcg_sat_solver *pSat[2], Vec_Int_t *vCiSatVars, Vec_Int_t *vVar2Index, int CubeLimit)
int Gia_ManFactorSop(Gia_Man_t *p, Vec_Int_t *vCiObjIds, Vec_Str_t *vSop, int fHash)
void bmcg_sat_generate_dvars(Vec_Int_t *vCiVars, Vec_Str_t *vSop, Vec_Int_t *vDLits)
struct Vec_Str_t_ Vec_Str_t
struct Gia_Obj_t_ Gia_Obj_t