abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sswSweep.c File Reference
#include "sswInt.h"
#include "misc/bar/bar.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Ssw_ManGetSatVarValue (Ssw_Man_t *p, Aig_Obj_t *pObj, int f)
 DECLARATIONS ///. More...
 
void Ssw_CheckConstraints (Ssw_Man_t *p)
 
void Ssw_SmlSavePatternAigPhase (Ssw_Man_t *p, int f)
 
void Ssw_SmlSavePatternAig (Ssw_Man_t *p, int f)
 
void Ssw_SmlAddPatternDyn (Ssw_Man_t *p)
 
int Ssw_ManSweepNode (Ssw_Man_t *p, Aig_Obj_t *pObj, int f, int fBmc, Vec_Int_t *vPairs)
 
int Ssw_ManSweepBmc (Ssw_Man_t *p)
 
void Ssw_ManDumpEquivMiter (Aig_Man_t *p, Vec_Int_t *vPairs, int Num)
 
int Ssw_ManSweep (Ssw_Man_t *p)
 

Function Documentation

void Ssw_CheckConstraints ( Ssw_Man_t p)

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

Synopsis [Performs fraiging for the internal nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 84 of file sswSweep.c.

85 {
86  Aig_Obj_t * pObj, * pObj2;
87  int nConstrPairs, i;
88  int Counter = 0;
89  nConstrPairs = Aig_ManCoNum(p->pFrames)-Aig_ManRegNum(p->pAig);
90  assert( (nConstrPairs & 1) == 0 );
91  for ( i = 0; i < nConstrPairs; i += 2 )
92  {
93  pObj = Aig_ManCo( p->pFrames, i );
94  pObj2 = Aig_ManCo( p->pFrames, i+1 );
95  if ( Ssw_NodesAreEquiv( p, Aig_ObjFanin0(pObj), Aig_ObjFanin0(pObj2) ) != 1 )
96  {
98  Counter++;
99  }
100  }
101  Abc_Print( 1, "Total constraints = %d. Added constraints = %d.\n", nConstrPairs/2, Counter );
102 }
Aig_Man_t * pAig
Definition: llb3Image.c:49
static Aig_Obj_t * Aig_ObjChild0(Aig_Obj_t *pObj)
Definition: aig.h:310
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Ssw_NodesAreConstrained(Ssw_Man_t *p, Aig_Obj_t *pOld, Aig_Obj_t *pNew)
Definition: sswSat.c:196
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
Definition: aig.h:69
static int Counter
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
Definition: aig.h:267
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
#define assert(ex)
Definition: util_old.h:213
int Ssw_NodesAreEquiv(Ssw_Man_t *p, Aig_Obj_t *pOld, Aig_Obj_t *pNew)
DECLARATIONS ///.
Definition: sswSat.c:45
void Ssw_ManDumpEquivMiter ( Aig_Man_t p,
Vec_Int_t vPairs,
int  Num 
)

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

Synopsis [Generates AIG with the following nodes put into seq miters.]

Description []

SideEffects []

SeeAlso []

Definition at line 334 of file sswSweep.c.

335 {
336  FILE * pFile;
337  char pBuffer[16];
338  Aig_Man_t * pNew;
339  sprintf( pBuffer, "equiv%03d.aig", Num );
340  pFile = fopen( pBuffer, "w" );
341  if ( pFile == NULL )
342  {
343  Abc_Print( 1, "Cannot open file %s for writing.\n", pBuffer );
344  return;
345  }
346  fclose( pFile );
347  pNew = Saig_ManCreateEquivMiter( p, vPairs );
348  Ioa_WriteAiger( pNew, pBuffer, 0, 0 );
349  Aig_ManStop( pNew );
350  Abc_Print( 1, "AIG with %4d disproved equivs is dumped into file \"%s\".\n", Vec_IntSize(vPairs)/2, pBuffer );
351 }
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Aig_Man_t * Saig_ManCreateEquivMiter(Aig_Man_t *pAig, Vec_Int_t *vPairs)
Definition: saigDup.c:91
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Ioa_WriteAiger(Aig_Man_t *pMan, char *pFileName, int fWriteSymbols, int fCompact)
Definition: ioaWriteAig.c:446
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
ABC_NAMESPACE_IMPL_START int Ssw_ManGetSatVarValue ( Ssw_Man_t p,
Aig_Obj_t pObj,
int  f 
)

DECLARATIONS ///.

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

FileName [sswSweep.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Inductive prover with constraints.]

Synopsis [One round of SAT sweeping.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - September 1, 2008.]

Revision [

Id:
sswSweep.c,v 1.00 2008/09/01 00:00:00 alanmi Exp

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

Synopsis [Retrives value of the PI in the original AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file sswSweep.c.

47 {
48  int fUseNoBoundary = 0;
49  Aig_Obj_t * pObjFraig;
50  int Value;
51 // assert( Aig_ObjIsCi(pObj) );
52  pObjFraig = Ssw_ObjFrame( p, pObj, f );
53  if ( fUseNoBoundary )
54  {
55  Value = Ssw_CnfGetNodeValue( p->pMSat, Aig_Regular(pObjFraig) );
56  Value ^= Aig_IsComplement(pObjFraig);
57  }
58  else
59  {
60  int nVarNum = Ssw_ObjSatNum( p->pMSat, Aig_Regular(pObjFraig) );
61  Value = (!nVarNum)? 0 : (Aig_IsComplement(pObjFraig) ^ sat_solver_var_value( p->pMSat->pSat, nVarNum ));
62  }
63 
64 // Value = (Aig_IsComplement(pObjFraig) ^ ((!nVarNum)? 0 : sat_solver_var_value( p->pSat, nVarNum )));
65 // Value = (!nVarNum)? Aig_ManRandom(0) & 1 : (Aig_IsComplement(pObjFraig) ^ sat_solver_var_value( p->pSat, nVarNum ));
66  if ( p->pPars->fPolarFlip )
67  {
68  if ( Aig_Regular(pObjFraig)->fPhase ) Value ^= 1;
69  }
70  return Value;
71 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Aig_IsComplement(Aig_Obj_t *p)
Definition: aig.h:249
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Definition: aig.h:246
static int sat_solver_var_value(sat_solver *s, int v)
Definition: satSolver.h:200
Definition: aig.h:69
unsigned int fPhase
Definition: aig.h:78
static int Ssw_ObjSatNum(Ssw_Sat_t *p, Aig_Obj_t *pObj)
MACRO DEFINITIONS ///.
Definition: sswInt.h:169
int Ssw_CnfGetNodeValue(Ssw_Sat_t *p, Aig_Obj_t *pObj)
Definition: sswCnf.c:402
static Aig_Obj_t * Ssw_ObjFrame(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:182
int Ssw_ManSweep ( Ssw_Man_t p)

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

Synopsis [Performs fraiging for the internal nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 365 of file sswSweep.c.

366 {
367  static int Counter;
368  Bar_Progress_t * pProgress = NULL;
369  Aig_Obj_t * pObj, * pObj2, * pObjNew;
370  int nConstrPairs, i, f;
371  abctime clk;
372  Vec_Int_t * vDisproved;
373 
374  // perform speculative reduction
375 clk = Abc_Clock();
376  // create timeframes
377  p->pFrames = Ssw_FramesWithClasses( p );
378  // add constants
379  nConstrPairs = Aig_ManCoNum(p->pFrames)-Aig_ManRegNum(p->pAig);
380  assert( (nConstrPairs & 1) == 0 );
381  for ( i = 0; i < nConstrPairs; i += 2 )
382  {
383  pObj = Aig_ManCo( p->pFrames, i );
384  pObj2 = Aig_ManCo( p->pFrames, i+1 );
386  }
387  // build logic cones for register inputs
388  for ( i = 0; i < Aig_ManRegNum(p->pAig); i++ )
389  {
390  pObj = Aig_ManCo( p->pFrames, nConstrPairs + i );
391  Ssw_CnfNodeAddToSolver( p->pMSat, Aig_ObjFanin0(pObj) );//
392  }
393  sat_solver_simplify( p->pMSat->pSat );
394 
395  // map constants and PIs of the last frame
396  f = p->pPars->nFramesK;
397  Ssw_ObjSetFrame( p, Aig_ManConst1(p->pAig), f, Aig_ManConst1(p->pFrames) );
398  Saig_ManForEachPi( p->pAig, pObj, i )
399  Ssw_ObjSetFrame( p, pObj, f, Aig_ObjCreateCi(p->pFrames) );
400 p->timeReduce += Abc_Clock() - clk;
401 
402  // sweep internal nodes
403  p->fRefined = 0;
404  Ssw_ClassesClearRefined( p->ppClasses );
405  if ( p->pPars->fVerbose )
406  pProgress = Bar_ProgressStart( stdout, Aig_ManObjNumMax(p->pAig) );
407  vDisproved = p->pPars->fEquivDump? Vec_IntAlloc(1000) : NULL;
408  Aig_ManForEachObj( p->pAig, pObj, i )
409  {
410  if ( p->pPars->fVerbose )
411  Bar_ProgressUpdate( pProgress, i, NULL );
412  if ( Saig_ObjIsLo(p->pAig, pObj) )
413  p->fRefined |= Ssw_ManSweepNode( p, pObj, f, 0, vDisproved );
414  else if ( Aig_ObjIsNode(pObj) )
415  {
416  pObjNew = Aig_And( p->pFrames, Ssw_ObjChild0Fra(p, pObj, f), Ssw_ObjChild1Fra(p, pObj, f) );
417  Ssw_ObjSetFrame( p, pObj, f, pObjNew );
418  p->fRefined |= Ssw_ManSweepNode( p, pObj, f, 0, vDisproved );
419  }
420  }
421  if ( p->pPars->fVerbose )
422  Bar_ProgressStop( pProgress );
423 
424  // cleanup
425 // Ssw_ClassesCheck( p->ppClasses );
426  if ( p->pPars->fEquivDump )
427  Ssw_ManDumpEquivMiter( p->pAig, vDisproved, Counter++ );
428  Vec_IntFreeP( &vDisproved );
429  return p->fRefined;
430 }
Aig_Man_t * pAig
Definition: llb3Image.c:49
void Ssw_CnfNodeAddToSolver(Ssw_Sat_t *p, Aig_Obj_t *pObj)
Definition: sswCnf.c:351
static int Saig_ObjIsLo(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: saig.h:84
static Aig_Obj_t * Ssw_ObjChild0Fra(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:185
static Aig_Obj_t * Aig_ObjChild0(Aig_Obj_t *pObj)
Definition: aig.h:310
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
int Ssw_NodesAreConstrained(Ssw_Man_t *p, Aig_Obj_t *pOld, Aig_Obj_t *pNew)
Definition: sswSat.c:196
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
static abctime Abc_Clock()
Definition: abc_global.h:279
static Aig_Obj_t * Ssw_ObjChild1Fra(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:186
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
Definition: aig.h:280
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
void Ssw_ClassesClearRefined(Ssw_Cla_t *p)
Definition: sswClass.c:243
static void Bar_ProgressUpdate(Bar_Progress_t *p, int nItemsCur, char *pString)
Definition: bar.h:63
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
static int Counter
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
void Ssw_ManDumpEquivMiter(Aig_Man_t *p, Vec_Int_t *vPairs, int Num)
Definition: sswSweep.c:334
DECLARATIONS ///.
Definition: bar.c:36
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
Definition: aig.h:267
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
int sat_solver_simplify(sat_solver *s)
Definition: satSolver.c:1276
int Ssw_ManSweepNode(Ssw_Man_t *p, Aig_Obj_t *pObj, int f, int fBmc, Vec_Int_t *vPairs)
Definition: sswSweep.c:187
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
static void Ssw_ObjSetFrame(Ssw_Man_t *p, Aig_Obj_t *pObj, int i, Aig_Obj_t *pNode)
Definition: sswInt.h:183
Aig_Man_t * Ssw_FramesWithClasses(Ssw_Man_t *p)
Definition: sswAig.c:144
#define assert(ex)
Definition: util_old.h:213
ABC_INT64_T abctime
Definition: abc_global.h:278
void Bar_ProgressStop(Bar_Progress_t *p)
Definition: bar.c:126
Bar_Progress_t * Bar_ProgressStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
Definition: bar.c:66
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91
int Ssw_ManSweepBmc ( Ssw_Man_t p)

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

Synopsis [Performs fraiging for the internal nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 267 of file sswSweep.c.

268 {
269  Bar_Progress_t * pProgress = NULL;
270  Aig_Obj_t * pObj, * pObjNew, * pObjLi, * pObjLo;
271  int i, f;
272  abctime clk;
273 clk = Abc_Clock();
274 
275  // start initialized timeframes
276  p->pFrames = Aig_ManStart( Aig_ManObjNumMax(p->pAig) * p->pPars->nFramesK );
277  Saig_ManForEachLo( p->pAig, pObj, i )
278  Ssw_ObjSetFrame( p, pObj, 0, Aig_ManConst0(p->pFrames) );
279 
280  // sweep internal nodes
281  p->fRefined = 0;
282  if ( p->pPars->fVerbose )
283  pProgress = Bar_ProgressStart( stdout, Aig_ManObjNumMax(p->pAig) * p->pPars->nFramesK );
284  for ( f = 0; f < p->pPars->nFramesK; f++ )
285  {
286  // map constants and PIs
287  Ssw_ObjSetFrame( p, Aig_ManConst1(p->pAig), f, Aig_ManConst1(p->pFrames) );
288  Saig_ManForEachPi( p->pAig, pObj, i )
289  Ssw_ObjSetFrame( p, pObj, f, Aig_ObjCreateCi(p->pFrames) );
290  // sweep internal nodes
291  Aig_ManForEachNode( p->pAig, pObj, i )
292  {
293  if ( p->pPars->fVerbose )
294  Bar_ProgressUpdate( pProgress, Aig_ManObjNumMax(p->pAig) * f + i, NULL );
295  pObjNew = Aig_And( p->pFrames, Ssw_ObjChild0Fra(p, pObj, f), Ssw_ObjChild1Fra(p, pObj, f) );
296  Ssw_ObjSetFrame( p, pObj, f, pObjNew );
297  p->fRefined |= Ssw_ManSweepNode( p, pObj, f, 1, NULL );
298  }
299  // quit if this is the last timeframe
300  if ( f == p->pPars->nFramesK - 1 )
301  break;
302  // transfer latch input to the latch outputs
303  Aig_ManForEachCo( p->pAig, pObj, i )
304  Ssw_ObjSetFrame( p, pObj, f, Ssw_ObjChild0Fra(p, pObj, f) );
305  // build logic cones for register outputs
306  Saig_ManForEachLiLo( p->pAig, pObjLi, pObjLo, i )
307  {
308  pObjNew = Ssw_ObjFrame( p, pObjLi, f );
309  Ssw_ObjSetFrame( p, pObjLo, f+1, pObjNew );
310  Ssw_CnfNodeAddToSolver( p->pMSat, Aig_Regular(pObjNew) );//
311  }
312  }
313  if ( p->pPars->fVerbose )
314  Bar_ProgressStop( pProgress );
315 
316  // cleanup
317 // Ssw_ClassesCheck( p->ppClasses );
318 p->timeBmc += Abc_Clock() - clk;
319  return p->fRefined;
320 }
Aig_Man_t * pAig
Definition: llb3Image.c:49
void Ssw_CnfNodeAddToSolver(Ssw_Sat_t *p, Aig_Obj_t *pObj)
Definition: sswCnf.c:351
static Aig_Obj_t * Ssw_ObjChild0Fra(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:185
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
Definition: saig.h:101
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition: aigMan.c:47
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Definition: aig.h:246
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
static Aig_Obj_t * Aig_ManConst0(Aig_Man_t *p)
Definition: aig.h:263
#define Aig_ManForEachCo(p, pObj, i)
Definition: aig.h:398
static abctime Abc_Clock()
Definition: abc_global.h:279
for(p=first;p->value< newval;p=p->next)
static Aig_Obj_t * Ssw_ObjChild1Fra(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:186
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
static void Bar_ProgressUpdate(Bar_Progress_t *p, int nItemsCur, char *pString)
Definition: bar.h:63
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
#define Saig_ManForEachLo(p, pObj, i)
Definition: saig.h:96
DECLARATIONS ///.
Definition: bar.c:36
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
int Ssw_ManSweepNode(Ssw_Man_t *p, Aig_Obj_t *pObj, int f, int fBmc, Vec_Int_t *vPairs)
Definition: sswSweep.c:187
static void Ssw_ObjSetFrame(Ssw_Man_t *p, Aig_Obj_t *pObj, int i, Aig_Obj_t *pNode)
Definition: sswInt.h:183
ABC_INT64_T abctime
Definition: abc_global.h:278
void Bar_ProgressStop(Bar_Progress_t *p)
Definition: bar.c:126
Bar_Progress_t * Bar_ProgressStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
Definition: bar.c:66
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91
static Aig_Obj_t * Ssw_ObjFrame(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:182
int Ssw_ManSweepNode ( Ssw_Man_t p,
Aig_Obj_t pObj,
int  f,
int  fBmc,
Vec_Int_t vPairs 
)

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

Synopsis [Performs fraiging for one node.]

Description [Returns the fraiged node.]

SideEffects []

SeeAlso []

Definition at line 187 of file sswSweep.c.

188 {
189  Aig_Obj_t * pObjRepr, * pObjFraig, * pObjFraig2, * pObjReprFraig;
190  int RetValue;
191  abctime clk;
192  // get representative of this class
193  pObjRepr = Aig_ObjRepr( p->pAig, pObj );
194  if ( pObjRepr == NULL )
195  return 0;
196  // get the fraiged node
197  pObjFraig = Ssw_ObjFrame( p, pObj, f );
198  // get the fraiged representative
199  pObjReprFraig = Ssw_ObjFrame( p, pObjRepr, f );
200  // check if constant 0 pattern distinquishes these nodes
201  assert( pObjFraig != NULL && pObjReprFraig != NULL );
202  assert( (pObj->fPhase == pObjRepr->fPhase) == (Aig_ObjPhaseReal(pObjFraig) == Aig_ObjPhaseReal(pObjReprFraig)) );
203  // if the fraiged nodes are the same, return
204  if ( Aig_Regular(pObjFraig) == Aig_Regular(pObjReprFraig) )
205  return 0;
206  // add constraints on demand
207  if ( !fBmc && p->pPars->fDynamic )
208  {
209 clk = Abc_Clock();
210  Ssw_ManLoadSolver( p, pObjRepr, pObj );
211  p->nRecycleCalls++;
212 p->timeMarkCones += Abc_Clock() - clk;
213  }
214  // call equivalence checking
215  if ( Aig_Regular(pObjFraig) != Aig_ManConst1(p->pFrames) )
216  RetValue = Ssw_NodesAreEquiv( p, Aig_Regular(pObjReprFraig), Aig_Regular(pObjFraig) );
217  else
218  RetValue = Ssw_NodesAreEquiv( p, Aig_Regular(pObjFraig), Aig_Regular(pObjReprFraig) );
219  if ( RetValue == 1 ) // proved equivalent
220  {
221  pObjFraig2 = Aig_NotCond( pObjReprFraig, pObj->fPhase ^ pObjRepr->fPhase );
222  Ssw_ObjSetFrame( p, pObj, f, pObjFraig2 );
223  return 0;
224  }
225  if ( vPairs )
226  {
227  Vec_IntPush( vPairs, pObjRepr->Id );
228  Vec_IntPush( vPairs, pObj->Id );
229  }
230  if ( RetValue == -1 ) // timed out
231  {
232  Ssw_ClassesRemoveNode( p->ppClasses, pObj );
233  return 1;
234  }
235  // disproved the equivalence
236  if ( !fBmc && p->pPars->fDynamic )
237  {
239  p->nPatterns++;
240  return 1;
241  }
242  else
243  Ssw_SmlSavePatternAig( p, f );
244  if ( !p->pPars->fConstrs )
245  Ssw_ManResimulateWord( p, pObj, pObjRepr, f );
246  else
247  Ssw_ManResimulateBit( p, pObj, pObjRepr );
248  assert( Aig_ObjRepr( p->pAig, pObj ) != pObjRepr );
249  if ( Aig_ObjRepr( p->pAig, pObj ) == pObjRepr )
250  {
251  Abc_Print( 1, "Ssw_ManSweepNode(): Failed to refine representative.\n" );
252  }
253  return 1;
254 }
void Ssw_SmlSavePatternAig(Ssw_Man_t *p, int f)
Definition: sswSweep.c:136
static Aig_Obj_t * Aig_ObjRepr(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: aig.h:330
Aig_Man_t * pAig
Definition: llb3Image.c:49
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Ssw_ManResimulateWord(Ssw_Man_t *p, Aig_Obj_t *pCand, Aig_Obj_t *pRepr, int f)
Definition: sswSimSat.c:92
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Definition: aig.h:246
static abctime Abc_Clock()
Definition: abc_global.h:279
void Ssw_ClassesRemoveNode(Ssw_Cla_t *p, Aig_Obj_t *pObj)
Definition: sswClass.c:448
static int Aig_ObjPhaseReal(Aig_Obj_t *pObj)
Definition: aig.h:299
Definition: aig.h:69
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
void Ssw_ManLoadSolver(Ssw_Man_t *p, Aig_Obj_t *pRepr, Aig_Obj_t *pObj)
Definition: sswDyn.c:142
unsigned int fPhase
Definition: aig.h:78
static void Ssw_ObjSetFrame(Ssw_Man_t *p, Aig_Obj_t *pObj, int i, Aig_Obj_t *pNode)
Definition: sswInt.h:183
#define assert(ex)
Definition: util_old.h:213
void Ssw_SmlAddPatternDyn(Ssw_Man_t *p)
Definition: sswSweep.c:157
int Ssw_NodesAreEquiv(Ssw_Man_t *p, Aig_Obj_t *pOld, Aig_Obj_t *pNew)
DECLARATIONS ///.
Definition: sswSat.c:45
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
Definition: aig.h:248
ABC_INT64_T abctime
Definition: abc_global.h:278
int Id
Definition: aig.h:85
void Ssw_ManResimulateBit(Ssw_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pRepr)
DECLARATIONS ///.
Definition: sswSimSat.c:45
static Aig_Obj_t * Ssw_ObjFrame(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:182
void Ssw_SmlAddPatternDyn ( Ssw_Man_t p)

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

Synopsis [Saves one counter-example into internal storage.]

Description []

SideEffects []

SeeAlso []

Definition at line 157 of file sswSweep.c.

158 {
159  Aig_Obj_t * pObj;
160  unsigned * pInfo;
161  int i, nVarNum;
162  // iterate through the PIs of the frames
163  Vec_PtrForEachEntry( Aig_Obj_t *, p->pMSat->vUsedPis, pObj, i )
164  {
165  assert( Aig_ObjIsCi(pObj) );
166  nVarNum = Ssw_ObjSatNum( p->pMSat, pObj );
167  assert( nVarNum > 0 );
168  if ( sat_solver_var_value( p->pMSat->pSat, nVarNum ) )
169  {
170  pInfo = (unsigned *)Vec_PtrEntry( p->vSimInfo, Aig_ObjCioId(pObj) );
171  Abc_InfoSetBit( pInfo, p->nPatterns );
172  }
173  }
174 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int sat_solver_var_value(sat_solver *s, int v)
Definition: satSolver.h:200
Definition: aig.h:69
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static void Abc_InfoSetBit(unsigned *p, int i)
Definition: abc_global.h:259
static int Ssw_ObjSatNum(Ssw_Sat_t *p, Aig_Obj_t *pObj)
MACRO DEFINITIONS ///.
Definition: sswInt.h:169
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
Definition: aig.h:275
static int Aig_ObjCioId(Aig_Obj_t *pObj)
Definition: aig.h:285
void Ssw_SmlSavePatternAig ( Ssw_Man_t p,
int  f 
)

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

Synopsis [Copy pattern from the solver into the internal storage.]

Description []

SideEffects []

SeeAlso []

Definition at line 136 of file sswSweep.c.

137 {
138  Aig_Obj_t * pObj;
139  int i;
140  memset( p->pPatWords, 0, sizeof(unsigned) * p->nPatWords );
141  Aig_ManForEachCi( p->pAig, pObj, i )
142  if ( Ssw_ManGetSatVarValue( p, pObj, f ) )
143  Abc_InfoSetBit( p->pPatWords, i );
144 }
char * memset()
Aig_Man_t * pAig
Definition: llb3Image.c:49
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
ABC_NAMESPACE_IMPL_START int Ssw_ManGetSatVarValue(Ssw_Man_t *p, Aig_Obj_t *pObj, int f)
DECLARATIONS ///.
Definition: sswSweep.c:46
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
static void Abc_InfoSetBit(unsigned *p, int i)
Definition: abc_global.h:259
void Ssw_SmlSavePatternAigPhase ( Ssw_Man_t p,
int  f 
)

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

Synopsis [Copy pattern from the solver into the internal storage.]

Description []

SideEffects []

SeeAlso []

Definition at line 115 of file sswSweep.c.

116 {
117  Aig_Obj_t * pObj;
118  int i;
119  memset( p->pPatWords, 0, sizeof(unsigned) * p->nPatWords );
120  Aig_ManForEachCi( p->pAig, pObj, i )
121  if ( Aig_ObjPhaseReal( Ssw_ObjFrame(p, pObj, f) ) )
122  Abc_InfoSetBit( p->pPatWords, i );
123 }
char * memset()
Aig_Man_t * pAig
Definition: llb3Image.c:49
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
if(last==0)
Definition: sparse_int.h:34
static int Aig_ObjPhaseReal(Aig_Obj_t *pObj)
Definition: aig.h:299
Definition: aig.h:69
static void Abc_InfoSetBit(unsigned *p, int i)
Definition: abc_global.h:259
static Aig_Obj_t * Ssw_ObjFrame(Ssw_Man_t *p, Aig_Obj_t *pObj, int i)
Definition: sswInt.h:182