ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
pdrCnf.c File Reference
#include "pdrInt.h"
Include dependency graph for pdrCnf.c:

Go to the source code of this file.

Functions

int Pdr_ObjSatVar2 (Pdr_Man_t *p, int k, Aig_Obj_t *pObj, int Level, int Pol)
 
int Pdr_ObjSatVar (Pdr_Man_t *p, int k, int Pol, Aig_Obj_t *pObj)
 FUNCTION DECLARATIONS ///.
 
int Pdr_ObjRegNum (Pdr_Man_t *p, int k, int iSatVar)
 
int Pdr_ManFreeVar (Pdr_Man_t *p, int k)
 
sat_solverPdr_ManNewSolver (sat_solver *pSat, Pdr_Man_t *p, int k, int fInit)
 

Function Documentation

◆ Pdr_ManFreeVar()

int Pdr_ManFreeVar ( Pdr_Man_t * p,
int k )

Function*************************************************************

Synopsis [Returns the index of unused SAT variable.]

Description []

SideEffects []

SeeAlso []

Definition at line 332 of file pdrCnf.c.

333{
334 if ( p->pPars->fMonoCnf )
335 return sat_solver_nvars( Pdr_ManSolver(p, k) );
336 else
337 {
338 Vec_Int_t * vVar2Ids = (Vec_Int_t *)Vec_PtrEntry( &p->vVar2Ids, k );
339 Vec_IntPush( vVar2Ids, -1 );
340 return Vec_IntSize( vVar2Ids ) - 1;
341 }
342}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
int sat_solver_nvars(sat_solver *s)
Definition satSolver.c:2369
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pdr_ManNewSolver()

sat_solver * Pdr_ManNewSolver ( sat_solver * pSat,
Pdr_Man_t * p,
int k,
int fInit )

Function*************************************************************

Synopsis [Creates SAT solver.]

Description []

SideEffects []

SeeAlso []

Definition at line 439 of file pdrCnf.c.

440{
441 assert( pSat != NULL );
442 if ( p->pPars->fMonoCnf )
443 return Pdr_ManNewSolver1( pSat, p, k, fInit );
444 else
445 return Pdr_ManNewSolver2( pSat, p, k, fInit );
446}
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ Pdr_ObjRegNum()

int Pdr_ObjRegNum ( Pdr_Man_t * p,
int k,
int iSatVar )

Function*************************************************************

Synopsis [Returns register number for the given SAT variable.]

Description []

SideEffects []

SeeAlso []

Definition at line 312 of file pdrCnf.c.

313{
314 if ( p->pPars->fMonoCnf )
315 return Pdr_ObjRegNum1( p, k, iSatVar );
316 else
317 return Pdr_ObjRegNum2( p, k, iSatVar );
318}
Here is the caller graph for this function:

◆ Pdr_ObjSatVar()

int Pdr_ObjSatVar ( Pdr_Man_t * p,
int k,
int Pol,
Aig_Obj_t * pObj )

FUNCTION DECLARATIONS ///.

Function*************************************************************

Synopsis [Returns SAT variable of the given object.]

Description []

SideEffects []

SeeAlso []

Definition at line 241 of file pdrCnf.c.

242{
243 if ( p->pPars->fMonoCnf )
244 return Pdr_ObjSatVar1( p, k, pObj );
245 else
246 return Pdr_ObjSatVar2( p, k, pObj, 0, Pol );
247}
int Pdr_ObjSatVar2(Pdr_Man_t *p, int k, Aig_Obj_t *pObj, int Level, int Pol)
Definition pdrCnf.c:200
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pdr_ObjSatVar2()

int Pdr_ObjSatVar2 ( Pdr_Man_t * p,
int k,
Aig_Obj_t * pObj,
int Level,
int Pol )

Definition at line 200 of file pdrCnf.c.

201{
202 Vec_Int_t * vLits;
203 sat_solver * pSat;
204 int fNewVar = 0, iVarThis = Pdr_ObjSatVar2FindOrAdd( p, k, pObj, &fNewVar );
205 int * pLit, i, iVar, iClaBeg, iClaEnd, RetValue;
206 if ( Aig_ObjIsCi(pObj) || !fNewVar )
207 return iVarThis;
208 iClaBeg = p->pCnf2->pObj2Clause[Aig_ObjId(pObj)];
209 iClaEnd = iClaBeg + p->pCnf2->pObj2Count[Aig_ObjId(pObj)];
210 assert( iClaBeg < iClaEnd );
211 pSat = Pdr_ManSolver(p, k);
212 vLits = Vec_WecEntry( p->vVLits, Level );
213 for ( i = iClaBeg; i < iClaEnd; i++ )
214 {
215 Vec_IntClear( vLits );
216 Vec_IntPush( vLits, Abc_Var2Lit( iVarThis, Abc_LitIsCompl(p->pCnf2->pClauses[i][0]) ) );
217 for ( pLit = p->pCnf2->pClauses[i]+1; pLit < p->pCnf2->pClauses[i+1]; pLit++ )
218 {
219 iVar = Pdr_ObjSatVar2( p, k, Aig_ManObj(p->pAig, Abc_Lit2Var(*pLit)), Level+1, Pol );
220 Vec_IntPush( vLits, Abc_Var2Lit( iVar, Abc_LitIsCompl(*pLit) ) );
221 }
222 RetValue = sat_solver_addclause( pSat, Vec_IntArray(vLits), Vec_IntArray(vLits)+Vec_IntSize(vLits) );
223 assert( RetValue );
224 (void) RetValue;
225 }
226 return iVarThis;
227}
#define sat_solver_addclause
Definition cecSatG2.c:37
#define sat_solver
Definition cecSatG2.c:34
Here is the call graph for this function:
Here is the caller graph for this function: