abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
pdrSat.c File Reference
#include "pdrInt.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
sat_solver
Pdr_ManCreateSolver (Pdr_Man_t *p, int k)
 DECLARATIONS ///. More...
 
sat_solverPdr_ManFetchSolver (Pdr_Man_t *p, int k)
 
Vec_Int_tPdr_ManLitsToCube (Pdr_Man_t *p, int k, int *pArray, int nArray)
 
Vec_Int_tPdr_ManCubeToLits (Pdr_Man_t *p, int k, Pdr_Set_t *pCube, int fCompl, int fNext)
 
void Pdr_ManSetPropertyOutput (Pdr_Man_t *p, int k)
 
void Pdr_ManSolverAddClause (Pdr_Man_t *p, int k, Pdr_Set_t *pCube)
 
void Pdr_ManCollectValues (Pdr_Man_t *p, int k, Vec_Int_t *vObjIds, Vec_Int_t *vValues)
 
int Pdr_ManCheckCubeCs (Pdr_Man_t *p, int k, Pdr_Set_t *pCube)
 
int Pdr_ManCheckCube (Pdr_Man_t *p, int k, Pdr_Set_t *pCube, Pdr_Set_t **ppPred, int nConfLimit)
 

Function Documentation

int Pdr_ManCheckCube ( Pdr_Man_t p,
int  k,
Pdr_Set_t pCube,
Pdr_Set_t **  ppPred,
int  nConfLimit 
)

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

Synopsis [Checks if the cube holds (UNSAT) in the given timeframe.]

Description [Return 1/0 if cube or property are proved to hold/fail in k-th timeframe. Returns the predecessor bad state in ppPred.]

SideEffects []

SeeAlso []

Definition at line 286 of file pdrSat.c.

287 {
288  int fUseLit = 1;
289  int fLitUsed = 0;
290  sat_solver * pSat;
291  Vec_Int_t * vLits;
292  int Lit, RetValue;
293  abctime clk, Limit;
294  p->nCalls++;
295  pSat = Pdr_ManFetchSolver( p, k );
296  if ( pCube == NULL ) // solve the property
297  {
298  clk = Abc_Clock();
299  Lit = toLit( Pdr_ObjSatVar(p, k, 2, Aig_ManCo(p->pAig, p->iOutCur)) ); // pos literal (property fails)
301  RetValue = sat_solver_solve( pSat, &Lit, &Lit + 1, nConfLimit, 0, 0, 0 );
302  sat_solver_set_runtime_limit( pSat, Limit );
303  if ( RetValue == l_Undef )
304  return -1;
305  }
306  else // check relative containment in terms of next states
307  {
308  if ( fUseLit )
309  {
310  fLitUsed = 1;
311  Vec_IntAddToEntry( p->vActVars, k, 1 );
312  // add the cube in terms of current state variables
313  vLits = Pdr_ManCubeToLits( p, k, pCube, 1, 0 );
314  // add activation literal
315  Lit = toLit( Pdr_ManFreeVar(p, k) );
316  // add activation literal
317  Vec_IntPush( vLits, Lit );
318  RetValue = sat_solver_addclause( pSat, Vec_IntArray(vLits), Vec_IntArray(vLits) + Vec_IntSize(vLits) );
319  assert( RetValue == 1 );
320  sat_solver_compress( pSat );
321  // create assumptions
322  vLits = Pdr_ManCubeToLits( p, k, pCube, 0, 1 );
323  // add activation literal
324  Vec_IntPush( vLits, lit_neg(Lit) );
325  }
326  else
327  vLits = Pdr_ManCubeToLits( p, k, pCube, 0, 1 );
328 
329  // solve
330  clk = Abc_Clock();
332  RetValue = sat_solver_solve( pSat, Vec_IntArray(vLits), Vec_IntArray(vLits) + Vec_IntSize(vLits), nConfLimit, 0, 0, 0 );
333  sat_solver_set_runtime_limit( pSat, Limit );
334  if ( RetValue == l_Undef )
335  return -1;
336 /*
337  if ( RetValue == l_True )
338  {
339  int RetValue2 = Pdr_ManCubeJust( p, k, pCube );
340  if ( RetValue2 )
341  p->nCasesSS++;
342  else
343  p->nCasesSU++;
344  }
345  else
346  {
347  int RetValue2 = Pdr_ManCubeJust( p, k, pCube );
348  if ( RetValue2 )
349  p->nCasesUS++;
350  else
351  p->nCasesUU++;
352  }
353 */
354  }
355  clk = Abc_Clock() - clk;
356  p->tSat += clk;
357  assert( RetValue != l_Undef );
358  if ( RetValue == l_False )
359  {
360  p->tSatUnsat += clk;
361  p->nCallsU++;
362  if ( ppPred )
363  *ppPred = NULL;
364  RetValue = 1;
365  }
366  else // if ( RetValue == l_True )
367  {
368  p->tSatSat += clk;
369  p->nCallsS++;
370  if ( ppPred )
371  *ppPred = Pdr_ManTernarySim( p, k, pCube );
372  RetValue = 0;
373  }
374 
375 /* // for some reason, it does not work...
376  if ( fLitUsed )
377  {
378  int RetValue;
379  Lit = lit_neg(Lit);
380  RetValue = sat_solver_addclause( pSat, &Lit, &Lit + 1 );
381  assert( RetValue == 1 );
382  sat_solver_compress( pSat );
383  }
384 */
385  return RetValue;
386 }
static abctime sat_solver_set_runtime_limit(sat_solver *s, abctime Limit)
Definition: satSolver.h:233
static int * Vec_IntArray(Vec_Int_t *p)
Definition: vecInt.h:328
Aig_Man_t * pAig
Definition: pdrInt.h:70
int sat_solver_addclause(sat_solver *s, lit *begin, lit *end)
Definition: satSolver.c:1492
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define l_Undef
Definition: SolverTypes.h:86
int iOutCur
Definition: pdrInt.h:81
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
Definition: satSolver.c:1700
static void sat_solver_compress(sat_solver *s)
Definition: satSolver.h:217
abctime tSatSat
Definition: pdrInt.h:125
Vec_Int_t * vActVars
Definition: pdrInt.h:87
Vec_Int_t * Pdr_ManCubeToLits(Pdr_Man_t *p, int k, Pdr_Set_t *pCube, int fCompl, int fNext)
Definition: pdrSat.c:142
static abctime Abc_Clock()
Definition: abc_global.h:279
int Pdr_ObjSatVar(Pdr_Man_t *p, int k, int Pol, Aig_Obj_t *pObj)
Definition: pdrCnf.c:241
static abctime Pdr_ManTimeLimit(Pdr_Man_t *p)
Definition: pdrInt.h:141
static lit lit_neg(lit l)
Definition: satVec.h:144
sat_solver * Pdr_ManFetchSolver(Pdr_Man_t *p, int k)
Definition: pdrSat.c:76
abctime tSatUnsat
Definition: pdrInt.h:126
static lit toLit(int v)
Definition: satVec.h:142
int nCalls
Definition: pdrInt.h:108
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
Definition: bblif.c:302
int nCallsU
Definition: pdrInt.h:110
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
Pdr_Set_t * Pdr_ManTernarySim(Pdr_Man_t *p, int k, Pdr_Set_t *pCube)
Definition: pdrTsim.c:351
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
Definition: aig.h:267
abctime tSat
Definition: pdrInt.h:124
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define l_False
Definition: SolverTypes.h:85
int nCallsS
Definition: pdrInt.h:109
#define assert(ex)
Definition: util_old.h:213
int Pdr_ManFreeVar(Pdr_Man_t *p, int k)
Definition: pdrCnf.c:332
ABC_INT64_T abctime
Definition: abc_global.h:278
int Pdr_ManCheckCubeCs ( Pdr_Man_t p,
int  k,
Pdr_Set_t pCube 
)

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

Synopsis [Checks if the cube holds (UNSAT) in the given timeframe.]

Description [Return 1/0 if cube or property are proved to hold/fail in k-th timeframe. Returns the predecessor bad state in ppPred.]

SideEffects []

SeeAlso []

Definition at line 258 of file pdrSat.c.

259 {
260  sat_solver * pSat;
261  Vec_Int_t * vLits;
262  abctime Limit;
263  int RetValue;
264  pSat = Pdr_ManFetchSolver( p, k );
265  vLits = Pdr_ManCubeToLits( p, k, pCube, 0, 0 );
267  RetValue = sat_solver_solve( pSat, Vec_IntArray(vLits), Vec_IntArray(vLits) + Vec_IntSize(vLits), 0, 0, 0, 0 );
268  sat_solver_set_runtime_limit( pSat, Limit );
269  if ( RetValue == l_Undef )
270  return -1;
271  return (RetValue == l_False);
272 }
static abctime sat_solver_set_runtime_limit(sat_solver *s, abctime Limit)
Definition: satSolver.h:233
static int * Vec_IntArray(Vec_Int_t *p)
Definition: vecInt.h:328
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define l_Undef
Definition: SolverTypes.h:86
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
Definition: satSolver.c:1700
Vec_Int_t * Pdr_ManCubeToLits(Pdr_Man_t *p, int k, Pdr_Set_t *pCube, int fCompl, int fNext)
Definition: pdrSat.c:142
static abctime Pdr_ManTimeLimit(Pdr_Man_t *p)
Definition: pdrInt.h:141
sat_solver * Pdr_ManFetchSolver(Pdr_Man_t *p, int k)
Definition: pdrSat.c:76
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define l_False
Definition: SolverTypes.h:85
ABC_INT64_T abctime
Definition: abc_global.h:278
void Pdr_ManCollectValues ( Pdr_Man_t p,
int  k,
Vec_Int_t vObjIds,
Vec_Int_t vValues 
)

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

Synopsis [Collects values of the RO/RI variables in k-th SAT solver.]

Description []

SideEffects []

SeeAlso []

Definition at line 232 of file pdrSat.c.

233 {
234  sat_solver * pSat;
235  Aig_Obj_t * pObj;
236  int iVar, i;
237  Vec_IntClear( vValues );
238  pSat = Pdr_ManSolver(p, k);
239  Aig_ManForEachObjVec( vObjIds, p->pAig, pObj, i )
240  {
241  iVar = Pdr_ObjSatVar( p, k, 3, pObj ); assert( iVar >= 0 );
242  Vec_IntPush( vValues, sat_solver_var_value(pSat, iVar) );
243  }
244 }
Aig_Man_t * pAig
Definition: pdrInt.h:70
#define Aig_ManForEachObjVec(vIds, p, pObj, i)
Definition: aig.h:408
int Pdr_ObjSatVar(Pdr_Man_t *p, int k, int Pol, Aig_Obj_t *pObj)
Definition: pdrCnf.c:241
static int sat_solver_var_value(sat_solver *s, int v)
Definition: satSolver.h:200
Definition: aig.h:69
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static sat_solver * Pdr_ManSolver(Pdr_Man_t *p, int k)
MACRO DEFINITIONS ///.
Definition: pdrInt.h:139
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
ABC_NAMESPACE_IMPL_START sat_solver* Pdr_ManCreateSolver ( Pdr_Man_t p,
int  k 
)

DECLARATIONS ///.

CFile****************************************************************

FileName [pdrSat.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Property driven reachability.]

Synopsis [SAT solver procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - November 20, 2010.]

Revision [

Id:
pdrSat.c,v 1.00 2010/11/20 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Creates new SAT solver.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file pdrSat.c.

46 {
47  sat_solver * pSat;
48  Aig_Obj_t * pObj;
49  int i;
50  assert( Vec_PtrSize(p->vSolvers) == k );
51  assert( Vec_VecSize(p->vClauses) == k );
52  assert( Vec_IntSize(p->vActVars) == k );
53  // create new solver
54  pSat = sat_solver_new();
55  pSat = Pdr_ManNewSolver( pSat, p, k, (int)(k == 0) );
56  Vec_PtrPush( p->vSolvers, pSat );
57  Vec_VecExpand( p->vClauses, k );
58  Vec_IntPush( p->vActVars, 0 );
59  // add property cone
60  Saig_ManForEachPo( p->pAig, pObj, i )
61  Pdr_ObjSatVar( p, k, 1, pObj );
62  return pSat;
63 }
sat_solver * Pdr_ManNewSolver(sat_solver *pSat, Pdr_Man_t *p, int k, int fInit)
Definition: pdrCnf.c:435
Aig_Man_t * pAig
Definition: pdrInt.h:70
Vec_Ptr_t * vSolvers
Definition: pdrInt.h:83
Vec_Int_t * vActVars
Definition: pdrInt.h:87
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
int Pdr_ObjSatVar(Pdr_Man_t *p, int k, int Pol, Aig_Obj_t *pObj)
Definition: pdrCnf.c:241
Definition: aig.h:69
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
Vec_Vec_t * vClauses
Definition: pdrInt.h:84
sat_solver * sat_solver_new(void)
Definition: satSolver.c:1001
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static void Vec_VecExpand(Vec_Vec_t *p, int Level)
Definition: vecVec.h:190
static int Vec_VecSize(Vec_Vec_t *p)
Definition: vecVec.h:222
#define Saig_ManForEachPo(p, pObj, i)
Definition: saig.h:93
#define assert(ex)
Definition: util_old.h:213
Vec_Int_t* Pdr_ManCubeToLits ( Pdr_Man_t p,
int  k,
Pdr_Set_t pCube,
int  fCompl,
int  fNext 
)

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

Synopsis [Converts the cube in terms of RO numbers into array of CNF literals.]

Description []

SideEffects []

SeeAlso []

Definition at line 142 of file pdrSat.c.

143 {
144  Aig_Obj_t * pObj;
145  int i, iVar, iVarMax = 0;
146  abctime clk = Abc_Clock();
147  Vec_IntClear( p->vLits );
148  assert( !(fNext && fCompl) );
149  for ( i = 0; i < pCube->nLits; i++ )
150  {
151  if ( pCube->Lits[i] == -1 )
152  continue;
153  if ( fNext )
154  pObj = Saig_ManLi( p->pAig, lit_var(pCube->Lits[i]) );
155  else
156  pObj = Saig_ManLo( p->pAig, lit_var(pCube->Lits[i]) );
157  iVar = Pdr_ObjSatVar( p, k, fNext ? 2 - lit_sign(pCube->Lits[i]) : 3, pObj ); assert( iVar >= 0 );
158  iVarMax = Abc_MaxInt( iVarMax, iVar );
159  Vec_IntPush( p->vLits, toLitCond( iVar, fCompl ^ lit_sign(pCube->Lits[i]) ) );
160  }
161 // sat_solver_setnvars( Pdr_ManSolver(p, k), iVarMax + 1 );
162  p->tCnf += Abc_Clock() - clk;
163  return p->vLits;
164 }
Aig_Man_t * pAig
Definition: pdrInt.h:70
static int lit_var(lit l)
Definition: satVec.h:145
static Aig_Obj_t * Saig_ManLo(Aig_Man_t *p, int i)
Definition: saig.h:79
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
int Pdr_ObjSatVar(Pdr_Man_t *p, int k, int Pol, Aig_Obj_t *pObj)
Definition: pdrCnf.c:241
static lit toLitCond(int v, int c)
Definition: satVec.h:143
static Aig_Obj_t * Saig_ManLi(Aig_Man_t *p, int i)
Definition: saig.h:80
Definition: aig.h:69
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
abctime tCnf
Definition: pdrInt.h:131
Vec_Int_t * vLits
Definition: pdrInt.h:91
static int lit_sign(lit l)
Definition: satVec.h:146
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
ABC_INT64_T abctime
Definition: abc_global.h:278
sat_solver* Pdr_ManFetchSolver ( Pdr_Man_t p,
int  k 
)

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

Synopsis [Returns old or restarted solver.]

Description []

SideEffects []

SeeAlso []

Definition at line 76 of file pdrSat.c.

77 {
78  sat_solver * pSat;
79  Vec_Ptr_t * vArrayK;
80  Pdr_Set_t * pCube;
81  int i, j;
82  pSat = Pdr_ManSolver(p, k);
83  if ( Vec_IntEntry(p->vActVars, k) < p->pPars->nRecycle )
84  return pSat;
85  assert( k < Vec_PtrSize(p->vSolvers) - 1 );
86  p->nStarts++;
87 // sat_solver_delete( pSat );
88 // pSat = sat_solver_new();
89  sat_solver_restart( pSat );
90  // create new SAT solver
91  pSat = Pdr_ManNewSolver( pSat, p, k, (int)(k == 0) );
92  // write new SAT solver
93  Vec_PtrWriteEntry( p->vSolvers, k, pSat );
94  Vec_IntWriteEntry( p->vActVars, k, 0 );
95  // set the property output
97  // add the clauses
98  Vec_VecForEachLevelStart( p->vClauses, vArrayK, i, k )
99  Vec_PtrForEachEntry( Pdr_Set_t *, vArrayK, pCube, j )
100  Pdr_ManSolverAddClause( p, k, pCube );
101  return pSat;
102 }
sat_solver * Pdr_ManNewSolver(sat_solver *pSat, Pdr_Man_t *p, int k, int fInit)
Definition: pdrCnf.c:435
Vec_Ptr_t * vSolvers
Definition: pdrInt.h:83
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
#define Vec_VecForEachLevelStart(vGlob, vVec, i, LevelStart)
Definition: vecVec.h:57
Vec_Int_t * vActVars
Definition: pdrInt.h:87
void Pdr_ManSolverAddClause(Pdr_Man_t *p, int k, Pdr_Set_t *pCube)
Definition: pdrSat.c:209
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Pdr_Par_t * pPars
Definition: pdrInt.h:69
typedefABC_NAMESPACE_HEADER_START struct Pdr_Set_t_ Pdr_Set_t
INCLUDES ///.
Definition: pdrInt.h:44
int nStarts
Definition: pdrInt.h:111
void Pdr_ManSetPropertyOutput(Pdr_Man_t *p, int k)
Definition: pdrSat.c:177
Vec_Vec_t * vClauses
Definition: pdrInt.h:84
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
Definition: vecPtr.h:396
static sat_solver * Pdr_ManSolver(Pdr_Man_t *p, int k)
MACRO DEFINITIONS ///.
Definition: pdrInt.h:139
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void sat_solver_restart(sat_solver *s)
Definition: satSolver.c:1186
Vec_Int_t* Pdr_ManLitsToCube ( Pdr_Man_t p,
int  k,
int *  pArray,
int  nArray 
)

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

Synopsis [Converts SAT variables into register IDs.]

Description []

SideEffects []

SeeAlso []

Definition at line 115 of file pdrSat.c.

116 {
117  int i, RegId;
118  Vec_IntClear( p->vLits );
119  for ( i = 0; i < nArray; i++ )
120  {
121  RegId = Pdr_ObjRegNum( p, k, lit_var(pArray[i]) );
122  if ( RegId == -1 )
123  continue;
124  assert( RegId >= 0 && RegId < Aig_ManRegNum(p->pAig) );
125  Vec_IntPush( p->vLits, toLitCond(RegId, !lit_sign(pArray[i])) );
126  }
127  assert( Vec_IntSize(p->vLits) >= 0 && Vec_IntSize(p->vLits) <= nArray );
128  return p->vLits;
129 }
Aig_Man_t * pAig
Definition: pdrInt.h:70
static int lit_var(lit l)
Definition: satVec.h:145
static lit toLitCond(int v, int c)
Definition: satVec.h:143
int Pdr_ObjRegNum(Pdr_Man_t *p, int k, int iSatVar)
Definition: pdrCnf.c:312
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
Vec_Int_t * vLits
Definition: pdrInt.h:91
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static int lit_sign(lit l)
Definition: satVec.h:146
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
void Pdr_ManSetPropertyOutput ( Pdr_Man_t p,
int  k 
)

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

Synopsis [Sets the property output to 0 (sat) forever.]

Description []

SideEffects []

SeeAlso []

Definition at line 177 of file pdrSat.c.

178 {
179  sat_solver * pSat;
180  Aig_Obj_t * pObj;
181  int Lit, RetValue, i;
182  pSat = Pdr_ManSolver(p, k);
183  Saig_ManForEachPo( p->pAig, pObj, i )
184  {
185  // skip solved outputs
186  if ( p->vCexes && Vec_PtrEntry(p->vCexes, i) )
187  continue;
188  // skip timedout outputs
189  if ( p->pPars->vOutMap && Vec_IntEntry(p->pPars->vOutMap, i) == -1 )
190  continue;
191  Lit = toLitCond( Pdr_ObjSatVar(p, k, 1, pObj), 1 ); // neg literal
192  RetValue = sat_solver_addclause( pSat, &Lit, &Lit + 1 );
193  assert( RetValue == 1 );
194  }
195  sat_solver_compress( pSat );
196 }
Aig_Man_t * pAig
Definition: pdrInt.h:70
int sat_solver_addclause(sat_solver *s, lit *begin, lit *end)
Definition: satSolver.c:1492
static void sat_solver_compress(sat_solver *s)
Definition: satSolver.h:217
int Pdr_ObjSatVar(Pdr_Man_t *p, int k, int Pol, Aig_Obj_t *pObj)
Definition: pdrCnf.c:241
static lit toLitCond(int v, int c)
Definition: satVec.h:143
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Pdr_Par_t * pPars
Definition: pdrInt.h:69
Definition: aig.h:69
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static sat_solver * Pdr_ManSolver(Pdr_Man_t *p, int k)
MACRO DEFINITIONS ///.
Definition: pdrInt.h:139
Vec_Ptr_t * vCexes
Definition: pdrInt.h:82
#define Saig_ManForEachPo(p, pObj, i)
Definition: saig.h:93
#define assert(ex)
Definition: util_old.h:213
void Pdr_ManSolverAddClause ( Pdr_Man_t p,
int  k,
Pdr_Set_t pCube 
)

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

Synopsis [Adds one clause in terms of ROs to the k-th SAT solver.]

Description []

SideEffects []

SeeAlso []

Definition at line 209 of file pdrSat.c.

210 {
211  sat_solver * pSat;
212  Vec_Int_t * vLits;
213  int RetValue;
214  pSat = Pdr_ManSolver(p, k);
215  vLits = Pdr_ManCubeToLits( p, k, pCube, 1, 0 );
216  RetValue = sat_solver_addclause( pSat, Vec_IntArray(vLits), Vec_IntArray(vLits) + Vec_IntSize(vLits) );
217  assert( RetValue == 1 );
218  sat_solver_compress( pSat );
219 }
static int * Vec_IntArray(Vec_Int_t *p)
Definition: vecInt.h:328
int sat_solver_addclause(sat_solver *s, lit *begin, lit *end)
Definition: satSolver.c:1492
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static void sat_solver_compress(sat_solver *s)
Definition: satSolver.h:217
Vec_Int_t * Pdr_ManCubeToLits(Pdr_Man_t *p, int k, Pdr_Set_t *pCube, int fCompl, int fNext)
Definition: pdrSat.c:142
static sat_solver * Pdr_ManSolver(Pdr_Man_t *p, int k)
MACRO DEFINITIONS ///.
Definition: pdrInt.h:139
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define assert(ex)
Definition: util_old.h:213