abc/src/base/abci/abcRec3.c
// replace GIA and vTruthIds by filtered ones
replace GIA and vTruthIds by filtered ones
replace GIA and vTruthIds by filtered ones
void Lms_GiaNormalize( Lms_Man_t * p )
{
    Gia_Man_t * pGiaNew;
    Gia_Obj_t * pObj;
    Vec_Int_t * vRemain;
    Vec_Int_t * vTruthIdsNew;
    int i, Entry, Prev = -1, Next;
    vRemain = Lms_GiaFindNonRedundantCos( p );
    vTruthIdsNew = Vec_IntAlloc( Vec_IntSize(vRemain) );
    Vec_IntForEachEntry( vRemain, Entry, i )
    {
        pObj = Gia_ManCo(p->pGia, Entry);
        assert( Gia_ObjIsAnd(Gia_ObjFanin0(pObj)) );
        Vec_IntWriteEntry( vRemain, i, Gia_ObjFaninLit0p(p->pGia, pObj) );
        Next = Vec_IntEntry(p->vTruthIds, Gia_ObjCioId(pObj));
        assert( Prev <= Next );
        Vec_IntPush( vTruthIdsNew, Next );
        Prev = Next;
    }
    Gia_ManForEachObj( p->pGia, pObj, i )
        assert( pObj->fMark0 == 0 );
    for ( i = 0; i < Gia_ManCoNum(p->pGia); i++ )
        Gia_ManPatchCoDriver( p->pGia, i, 0 );
    Vec_IntForEachEntry( vRemain, Entry, i )
        Gia_ManAppendCo( p->pGia, Entry );
    pGiaNew = Gia_ManCleanupOutputs( p->pGia, Gia_ManCoNum(p->pGia) - Vec_IntSize(vRemain) );
    Gia_ManStop( p->pGia );
    p->pGia = pGiaNew;
    Vec_IntFree( vRemain );
    Vec_IntFree( p->vTruthIds );
    p->vTruthIds = vTruthIdsNew;
}
void Lms_GiaNormalize ( Lms_Man_t * p ) { Gia_Man_t * pGiaNew ; Gia_Obj_t * pObj ; Vec_Int_t * vRemain ; Vec_Int_t * vTruthIdsNew ; int i , Entry , Prev = -1 , Next ; vRemain = Lms_GiaFindNonRedundantCos ( p ) ; vTruthIdsNew = Vec_IntAlloc ( Vec_IntSize ( vRemain ) ) ; Vec_IntForEachEntry ( vRemain , Entry , i ) { pObj = Gia_ManCo ( p -> pGia , Entry ) ; assert ( Gia_ObjIsAnd ( Gia_ObjFanin0 ( pObj ) ) ) ; Vec_IntWriteEntry ( vRemain , i , Gia_ObjFaninLit0p ( p -> pGia , pObj ) ) ; Next = Vec_IntEntry ( p -> vTruthIds , Gia_ObjCioId ( pObj ) ) ; assert ( Prev <= Next ) ; Vec_IntPush ( vTruthIdsNew , Next ) ; Prev = Next ; } Gia_ManForEachObj ( p -> pGia , pObj , i ) assert ( pObj -> fMark0 == 0 ) ; for ( i = 0 ; i < Gia_ManCoNum ( p -> pGia ) ; i ++ ) Gia_ManPatchCoDriver ( p -> pGia , i , 0 ) ; Vec_IntForEachEntry ( vRemain , Entry , i ) Gia_ManAppendCo ( p -> pGia , Entry ) ; pGiaNew = Gia_ManCleanupOutputs ( p -> pGia , Gia_ManCoNum ( p -> pGia ) - Vec_IntSize ( vRemain ) ) ; Gia_ManStop ( p -> pGia ) ; p -> pGia = pGiaNew ; Vec_IntFree ( vRemain ) ; Vec_IntFree ( p -> vTruthIds ) ; p -> vTruthIds = vTruthIdsNew ; }
replace GIA and vTruthIds by filtered ones
replace GIA and vTruthIds by filtered ones
// collect non-redundant COs // change these to be useful literals // create new truth IDs // create a new GIA //    pGiaNew = Gia_ManCleanup( p->pGia ); // update truth IDs //    Vec_IntPrint( vTruthIdsNew );