abc/src/aig/saig/saigGlaPba.c
/**Function*************************************************************

  Synopsis    [Performs gate-level localization abstraction.]

  Description [Returns array of objects included in the abstraction. This array
  may contain only const1, flop outputs, and internal nodes, that is, objects
  that should have clauses added to the SAT solver.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Performs gate-level localization abstraction.]

Description [Returns array of objects included in the abstraction. This array
may contain only const1, flop outputs, and internal nodes, that is, objects
that should have clauses added to the SAT solver.]




Function Synopsis [ Performs gate - level localization abstraction . ] Description [ Returns array of objects included in the abstraction . This array may contain only const1 flop outputs and internal nodes that is objects that should have clauses added to the SAT solver . ]
Vec_Int_t * Aig_Gla2ManPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, int nConfLimit, int TimeLimit, int fSkipRand, int fVerbose )
{
    Aig_Gla2Man_t * p;
    Vec_Int_t * vCore, * vResult;
    clock_t nTimeToStop = TimeLimit ? TimeLimit * CLOCKS_PER_SEC + clock(): 0;
    clock_t clk, clk2 = clock();
    assert( Saig_ManPoNum(pAig) == 1 );
    if ( fVerbose )
    {
        if ( TimeLimit )
            printf( "Abstracting from frame %d to frame %d with timeout %d sec.\n", nStart, nFramesMax, TimeLimit );
        else
            printf( "Abstracting from frame %d to frame %d with no timeout.\n", nStart, nFramesMax );
    }
    clk = clock();
    p = Aig_Gla2ManStart( pAig, nStart, nFramesMax, fVerbose );
    if ( !Aig_Gla2CreateSatSolver( p ) )
    {
        printf( "Error!  SAT solver became UNSAT.\n" );
        Aig_Gla2ManStop( p );
        return NULL;
    }
    sat_solver_set_random( p->pSat, fSkipRand );
    p->timePre += clock() - clk;
    if ( TimeLimit )
        sat_solver_set_runtime_limit( p->pSat, nTimeToStop );
    clk = clock();
    vCore = Saig_AbsSolverUnsatCore( p->pSat, nConfLimit, fVerbose, NULL );
    if ( vCore == NULL )
    {
        Aig_Gla2ManStop( p );
        return NULL;
    }
    p->timeSat += clock() - clk;
    p->timeTotal += clock() - clk2;
    if ( fVerbose )
    {
        ABC_PRTP( "Pre   ", p->timePre,   p->timeTotal );
        ABC_PRTP( "Sat   ", p->timeSat,   p->timeTotal );
        ABC_PRTP( "Total ", p->timeTotal, p->timeTotal );
    }
    vResult = Aig_Gla2ManCollect( p, vCore );
    Vec_IntFree( vCore );
    Aig_Gla2ManStop( p );
    return vResult;
}
Vec_Int_t * Aig_Gla2ManPerform ( Aig_Man_t * pAig , int nStart , int nFramesMax , int nConfLimit , int TimeLimit , int fSkipRand , int fVerbose ) { Aig_Gla2Man_t * p ; Vec_Int_t * vCore , * vResult ; clock_t nTimeToStop = TimeLimit ? TimeLimit * CLOCKS_PER_SEC + clock ( ) : 0 ; clock_t clk , clk2 = clock ( ) ; assert ( Saig_ManPoNum ( pAig ) == 1 ) ; if ( fVerbose ) { if ( TimeLimit ) printf ( " \n " , nStart , nFramesMax , TimeLimit ) ; else printf ( " \n " , nStart , nFramesMax ) ; } clk = clock ( ) ; p = Aig_Gla2ManStart ( pAig , nStart , nFramesMax , fVerbose ) ; if ( ! Aig_Gla2CreateSatSolver ( p ) ) { printf ( " \n " ) ; Aig_Gla2ManStop ( p ) ; return NULL ; } sat_solver_set_random ( p -> pSat , fSkipRand ) ; p -> timePre += clock ( ) - clk ; if ( TimeLimit ) sat_solver_set_runtime_limit ( p -> pSat , nTimeToStop ) ; clk = clock ( ) ; vCore = Saig_AbsSolverUnsatCore ( p -> pSat , nConfLimit , fVerbose , NULL ) ; if ( vCore == NULL ) { Aig_Gla2ManStop ( p ) ; return NULL ; } p -> timeSat += clock ( ) - clk ; p -> timeTotal += clock ( ) - clk2 ; if ( fVerbose ) { ABC_PRTP ( " " , p -> timePre , p -> timeTotal ) ; ABC_PRTP ( " " , p -> timeSat , p -> timeTotal ) ; ABC_PRTP ( " " , p -> timeTotal , p -> timeTotal ) ; } vResult = Aig_Gla2ManCollect ( p , vCore ) ; Vec_IntFree ( vCore ) ; Aig_Gla2ManStop ( p ) ; return vResult ; }
Function
Synopsis    [Performs gate-level localization abstraction.]
Function Synopsis [ Performs gate - level localization abstraction . ]
// start the solver // set runtime limit // compute UNSAT core // print stats // prepare return value