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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Fra_FraigMiterStatus (Aig_Man_t *p)
 DECLARATIONS ///. More...
 
int Fra_FraigMiterAssertedOutput (Aig_Man_t *p)
 
static void Fra_FraigNodeSpeculate (Fra_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pObjFraig, Aig_Obj_t *pObjReprFraig)
 
void Fra_FraigVerifyCounterEx (Fra_Man_t *p, Vec_Int_t *vCex)
 
static void Fra_FraigNode (Fra_Man_t *p, Aig_Obj_t *pObj)
 
void Fra_FraigSweep (Fra_Man_t *p)
 
Aig_Man_tFra_FraigPerform (Aig_Man_t *pManAig, Fra_Par_t *pPars)
 
Aig_Man_tFra_FraigChoice (Aig_Man_t *pManAig, int nConfMax, int nLevelMax)
 
Aig_Man_tFra_FraigEquivence (Aig_Man_t *pManAig, int nConfMax, int fProve)
 

Function Documentation

Aig_Man_t* Fra_FraigChoice ( Aig_Man_t pManAig,
int  nConfMax,
int  nLevelMax 
)

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

Synopsis [Performs choicing of the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 442 of file fraCore.c.

443 {
444  Fra_Par_t Pars, * pPars = &Pars;
445  Fra_ParamsDefault( pPars );
446  pPars->nBTLimitNode = nConfMax;
447  pPars->fChoicing = 1;
448  pPars->fDoSparse = 1;
449  pPars->fSpeculate = 0;
450  pPars->fProve = 0;
451  pPars->fVerbose = 0;
452  pPars->fDontShowBar = 1;
453  pPars->nLevelMax = nLevelMax;
454  return Fra_FraigPerform( pManAig, pPars );
455 }
Aig_Man_t * Fra_FraigPerform(Aig_Man_t *pManAig, Fra_Par_t *pPars)
Definition: fraCore.c:375
void Fra_ParamsDefault(Fra_Par_t *pParams)
DECLARATIONS ///.
Definition: fraMan.c:45
typedefABC_NAMESPACE_HEADER_START struct Fra_Par_t_ Fra_Par_t
INCLUDES ///.
Definition: fra.h:53
Aig_Man_t* Fra_FraigEquivence ( Aig_Man_t pManAig,
int  nConfMax,
int  fProve 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 468 of file fraCore.c.

469 {
470  Aig_Man_t * pFraig;
471  Fra_Par_t Pars, * pPars = &Pars;
472  Fra_ParamsDefault( pPars );
473  pPars->nBTLimitNode = nConfMax;
474  pPars->fChoicing = 0;
475  pPars->fDoSparse = 1;
476  pPars->fSpeculate = 0;
477  pPars->fProve = fProve;
478  pPars->fVerbose = 0;
479  pPars->fDontShowBar = 1;
480  pFraig = Fra_FraigPerform( pManAig, pPars );
481  return pFraig;
482 }
Aig_Man_t * Fra_FraigPerform(Aig_Man_t *pManAig, Fra_Par_t *pPars)
Definition: fraCore.c:375
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Fra_ParamsDefault(Fra_Par_t *pParams)
DECLARATIONS ///.
Definition: fraMan.c:45
typedefABC_NAMESPACE_HEADER_START struct Fra_Par_t_ Fra_Par_t
INCLUDES ///.
Definition: fra.h:53
int Fra_FraigMiterAssertedOutput ( Aig_Man_t p)

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

Synopsis [Reports the status of the miter.]

Description []

SideEffects []

SeeAlso []

Definition at line 125 of file fraCore.c.

126 {
127  Aig_Obj_t * pObj, * pChild;
128  int i;
129  Aig_ManForEachPoSeq( p, pObj, i )
130  {
131  pChild = Aig_ObjChild0(pObj);
132  // check if the output is constant 0
133  if ( pChild == Aig_ManConst0(p) )
134  continue;
135  // check if the output is constant 1
136  if ( pChild == Aig_ManConst1(p) )
137  return i;
138  // check if the output can be not constant 0
139  if ( Aig_Regular(pChild)->fPhase != (unsigned)Aig_IsComplement(pChild) )
140  return i;
141  }
142  return -1;
143 }
static Aig_Obj_t * Aig_ObjChild0(Aig_Obj_t *pObj)
Definition: aig.h:310
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 Aig_Obj_t * Aig_ManConst0(Aig_Man_t *p)
Definition: aig.h:263
Definition: aig.h:69
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
#define Aig_ManForEachPoSeq(p, pObj, i)
Definition: aig.h:444
ABC_NAMESPACE_IMPL_START int Fra_FraigMiterStatus ( Aig_Man_t p)

DECLARATIONS ///.

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

FileName [fraCore.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [New FRAIG package.]

Synopsis []

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 30, 2007.]

Revision [

Id:
fraCore.c,v 1.00 2007/06/30 00:00:00 alanmi Exp

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

Synopsis [Reports the status of the miter.]

Description []

SideEffects []

SeeAlso []

Definition at line 62 of file fraCore.c.

63 {
64  Aig_Obj_t * pObj, * pChild;
65  int i, CountConst0 = 0, CountNonConst0 = 0, CountUndecided = 0;
66  if ( p->pData )
67  return 0;
68  Aig_ManForEachPoSeq( p, pObj, i )
69  {
70  pChild = Aig_ObjChild0(pObj);
71  // check if the output is constant 0
72  if ( pChild == Aig_ManConst0(p) )
73  {
74  CountConst0++;
75  continue;
76  }
77  // check if the output is constant 1
78  if ( pChild == Aig_ManConst1(p) )
79  {
80  CountNonConst0++;
81  continue;
82  }
83  // check if the output is a primary input
84  if ( Aig_ObjIsCi(Aig_Regular(pChild)) && Aig_ObjCioId(Aig_Regular(pChild)) < p->nTruePis )
85  {
86  CountNonConst0++;
87  continue;
88  }
89  // check if the output can be not constant 0
90  if ( Aig_Regular(pChild)->fPhase != (unsigned)Aig_IsComplement(pChild) )
91  {
92  CountNonConst0++;
93  continue;
94  }
95  CountUndecided++;
96  }
97 /*
98  if ( p->pParams->fVerbose )
99  {
100  printf( "Miter has %d outputs. ", Aig_ManCoNum(p->pManAig) );
101  printf( "Const0 = %d. ", CountConst0 );
102  printf( "NonConst0 = %d. ", CountNonConst0 );
103  printf( "Undecided = %d. ", CountUndecided );
104  printf( "\n" );
105  }
106 */
107  if ( CountNonConst0 )
108  return 0;
109  if ( CountUndecided )
110  return -1;
111  return 1;
112 }
static Aig_Obj_t * Aig_ObjChild0(Aig_Obj_t *pObj)
Definition: aig.h:310
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 Aig_Obj_t * Aig_ManConst0(Aig_Man_t *p)
Definition: aig.h:263
Definition: aig.h:69
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
#define Aig_ManForEachPoSeq(p, pObj, i)
Definition: aig.h:444
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
Definition: aig.h:275
static int Aig_ObjCioId(Aig_Obj_t *pObj)
Definition: aig.h:285
static void Fra_FraigNode ( Fra_Man_t p,
Aig_Obj_t pObj 
)
inlinestatic

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

Synopsis [Performs fraiging for one node.]

Description [Returns the fraiged node.]

SideEffects []

SeeAlso []

Definition at line 234 of file fraCore.c.

235 {
236  Aig_Obj_t * pObjRepr, * pObjFraig, * pObjFraig2, * pObjReprFraig;
237  int RetValue;
238  assert( !Aig_IsComplement(pObj) );
239  // get representative of this class
240  pObjRepr = Fra_ClassObjRepr( pObj );
241  if ( pObjRepr == NULL || // this is a unique node
242  (!p->pPars->fDoSparse && pObjRepr == Aig_ManConst1(p->pManAig)) ) // this is a sparse node
243  return;
244  // get the fraiged node
245  pObjFraig = Fra_ObjFraig( pObj, p->pPars->nFramesK );
246  // get the fraiged representative
247  pObjReprFraig = Fra_ObjFraig( pObjRepr, p->pPars->nFramesK );
248  // if the fraiged nodes are the same, return
249  if ( Aig_Regular(pObjFraig) == Aig_Regular(pObjReprFraig) )
250  {
251  p->nSatCallsSkipped++;
252  return;
253  }
254  assert( p->pPars->nFramesK || Aig_Regular(pObjFraig) != Aig_ManConst1(p->pManFraig) );
255  // if they are proved different, the c-ex will be in p->pPatWords
256  RetValue = Fra_NodesAreEquiv( p, Aig_Regular(pObjReprFraig), Aig_Regular(pObjFraig) );
257  if ( RetValue == 1 ) // proved equivalent
258  {
259 // if ( p->pPars->fChoicing )
260 // Aig_ObjCreateRepr( p->pManFraig, Aig_Regular(pObjReprFraig), Aig_Regular(pObjFraig) );
261  // the nodes proved equal
262  pObjFraig2 = Aig_NotCond( pObjReprFraig, pObj->fPhase ^ pObjRepr->fPhase );
263  Fra_ObjSetFraig( pObj, p->pPars->nFramesK, pObjFraig2 );
264  return;
265  }
266  if ( RetValue == -1 ) // failed
267  {
268  if ( p->vTimeouts == NULL )
269  p->vTimeouts = Vec_PtrAlloc( 100 );
270  Vec_PtrPush( p->vTimeouts, pObj );
271  if ( !p->pPars->fSpeculate )
272  return;
273  assert( 0 );
274  // speculate
275  p->nSpeculs++;
276  pObjFraig2 = Aig_NotCond( pObjReprFraig, pObj->fPhase ^ pObjRepr->fPhase );
277  Fra_ObjSetFraig( pObj, p->pPars->nFramesK, pObjFraig2 );
278  Fra_FraigNodeSpeculate( p, pObj, Aig_Regular(pObjFraig), Aig_Regular(pObjReprFraig) );
279  return;
280  }
281  // disprove the nodes
282  p->pCla->fRefinement = 1;
283  // if we do not include the node into those disproved, we may end up
284  // merging this node with another representative, for which proof has timed out
285  if ( p->vTimeouts )
286  Vec_PtrPush( p->vTimeouts, pObj );
287  // verify that the counter-example satisfies all the constraints
288 // if ( p->vCex )
289 // Fra_FraigVerifyCounterEx( p, p->vCex );
290  // simulate the counter-example and return the Fraig node
291  Fra_SmlResimulate( p );
292  if ( p->pManFraig->pData )
293  return;
294  if ( !p->pPars->nFramesK && Fra_ClassObjRepr(pObj) == pObjRepr )
295  printf( "Fra_FraigNode(): Error in class refinement!\n" );
296  assert( p->pPars->nFramesK || Fra_ClassObjRepr(pObj) != pObjRepr );
297 }
Aig_Man_t * pManAig
Definition: fra.h:191
int fRefinement
Definition: fra.h:162
static void Fra_FraigNodeSpeculate(Fra_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pObjFraig, Aig_Obj_t *pObjReprFraig)
Definition: fraCore.c:156
Fra_Cla_t * pCla
Definition: fra.h:198
Fra_Par_t * pPars
Definition: fra.h:189
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 void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
int nSpeculs
Definition: fra.h:234
static void Fra_ObjSetFraig(Aig_Obj_t *pObj, int i, Aig_Obj_t *pNode)
Definition: fra.h:261
Aig_Man_t * pManFraig
Definition: fra.h:192
Vec_Ptr_t * vTimeouts
Definition: fra.h:218
static Aig_Obj_t * Fra_ObjFraig(Aig_Obj_t *pObj, int i)
Definition: fra.h:260
Definition: aig.h:69
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
void Fra_SmlResimulate(Fra_Man_t *p)
Definition: fraSim.c:703
unsigned int fPhase
Definition: aig.h:78
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
int nSatCallsSkipped
Definition: fra.h:238
static Aig_Obj_t * Fra_ClassObjRepr(Aig_Obj_t *pObj)
Definition: fra.h:269
int Fra_NodesAreEquiv(Fra_Man_t *p, Aig_Obj_t *pOld, Aig_Obj_t *pNew)
FUNCTION DEFINITIONS ///.
Definition: fraSat.c:48
#define assert(ex)
Definition: util_old.h:213
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
Definition: aig.h:248
static void Fra_FraigNodeSpeculate ( Fra_Man_t p,
Aig_Obj_t pObj,
Aig_Obj_t pObjFraig,
Aig_Obj_t pObjReprFraig 
)
inlinestatic

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

Synopsis [Write speculative miter for one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 156 of file fraCore.c.

157 {
158  static int Counter = 0;
159  char FileName[20];
160  Aig_Man_t * pTemp;
161  Aig_Obj_t * pNode;
162  int i;
163  // create manager with the logic for these two nodes
164  pTemp = Aig_ManExtractMiter( p->pManFraig, pObjFraig, pObjReprFraig );
165  // dump the logic into a file
166  sprintf( FileName, "aig\\%03d.blif", ++Counter );
167  Aig_ManDumpBlif( pTemp, FileName, NULL, NULL );
168  printf( "Speculation cone with %d nodes was written into file \"%s\".\n", Aig_ManNodeNum(pTemp), FileName );
169  // clean up
170  Aig_ManStop( pTemp );
171  Aig_ManForEachObj( p->pManFraig, pNode, i )
172  pNode->pData = p;
173 }
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
Aig_Man_t * pManFraig
Definition: fra.h:192
Definition: aig.h:69
char * sprintf()
static int Counter
void Aig_ManDumpBlif(Aig_Man_t *p, char *pFileName, Vec_Ptr_t *vPiNames, Vec_Ptr_t *vPoNames)
Definition: aigUtil.c:733
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
Aig_Man_t * Aig_ManExtractMiter(Aig_Man_t *p, Aig_Obj_t *pNode1, Aig_Obj_t *pNode2)
Definition: aigMan.c:147
Aig_Man_t* Fra_FraigPerform ( Aig_Man_t pManAig,
Fra_Par_t pPars 
)

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

Synopsis [Performs fraiging of the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 375 of file fraCore.c.

376 {
377  Fra_Man_t * p;
378  Aig_Man_t * pManAigNew;
379  abctime clk;
380  if ( Aig_ManNodeNum(pManAig) == 0 )
381  return Aig_ManDupOrdered(pManAig);
382 clk = Abc_Clock();
383  p = Fra_ManStart( pManAig, pPars );
384  p->pManFraig = Fra_ManPrepareComb( p );
385  p->pSml = Fra_SmlStart( pManAig, 0, 1, pPars->nSimWords );
386  Fra_SmlSimulate( p, 0 );
387 // if ( p->pPars->fChoicing )
388 // Aig_ManReprStart( p->pManFraig, Aig_ManObjNumMax(p->pManAig) );
389  // collect initial states
391  p->nNodesBeg = Aig_ManNodeNum(pManAig);
392  p->nRegsBeg = Aig_ManRegNum(pManAig);
393  // perform fraig sweep
394 if ( p->pPars->fVerbose )
395 Fra_ClassesPrint( p->pCla, 1 );
396  Fra_FraigSweep( p );
397  // call back the procedure to check implications
398  if ( pManAig->pImpFunc )
399  pManAig->pImpFunc( p, pManAig->pImpData );
400  // no need to filter one-hot clauses because they satisfy base case by construction
401  // finalize the fraiged manager
402  Fra_ManFinalizeComb( p );
403  if ( p->pPars->fChoicing )
404  {
405 abctime clk2 = Abc_Clock();
407  pManAigNew = Aig_ManDupRepr( p->pManAig, 1 );
408  Aig_ManReprStart( pManAigNew, Aig_ManObjNumMax(pManAigNew) );
409  Aig_ManTransferRepr( pManAigNew, p->pManAig );
410  Aig_ManMarkValidChoices( pManAigNew );
411  Aig_ManStop( p->pManFraig );
412  p->pManFraig = NULL;
413 p->timeTrav += Abc_Clock() - clk2;
414  }
415  else
416  {
419  pManAigNew = p->pManFraig;
420  p->pManFraig = NULL;
421  }
422 p->timeTotal = Abc_Clock() - clk;
423  // collect final stats
425  p->nNodesEnd = Aig_ManNodeNum(pManAigNew);
426  p->nRegsEnd = Aig_ManRegNum(pManAigNew);
427  Fra_ManStop( p );
428  return pManAigNew;
429 }
Aig_Man_t * pManAig
Definition: fra.h:191
void Fra_ManFinalizeComb(Fra_Man_t *p)
Definition: fraMan.c:217
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
Fra_Man_t * Fra_ManStart(Aig_Man_t *pManAig, Fra_Par_t *pParams)
Definition: fraMan.c:104
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Fra_Cla_t * pCla
Definition: fra.h:198
int nRegsBeg
Definition: fra.h:226
Fra_Par_t * pPars
Definition: fra.h:189
int Fra_ClassesCountLits(Fra_Cla_t *p)
Definition: fraClass.c:164
Fra_Sml_t * pSml
Definition: fra.h:200
Aig_Man_t * Aig_ManDupOrdered(Aig_Man_t *p)
Definition: aigDup.c:277
abctime timeTrav
Definition: fra.h:241
int nLitsEnd
Definition: fra.h:223
int nRegsEnd
Definition: fra.h:227
int nNodesBeg
Definition: fra.h:224
void Fra_FraigSweep(Fra_Man_t *p)
Definition: fraCore.c:310
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
abctime timeTotal
Definition: fra.h:248
Fra_Sml_t * Fra_SmlStart(Aig_Man_t *pAig, int nPref, int nFrames, int nWordsFrame)
Definition: fraSim.c:813
Aig_Man_t * pManFraig
Definition: fra.h:192
Vec_Ptr_t * vTimeouts
Definition: fra.h:218
void Aig_ManReprStart(Aig_Man_t *p, int nIdMax)
DECLARATIONS ///.
Definition: aigRepr.c:45
Aig_Man_t * Fra_ManPrepareComb(Fra_Man_t *p)
Definition: fraMan.c:176
void Fra_ClassesPrint(Fra_Cla_t *p, int fVeryVerbose)
Definition: fraClass.c:236
void Aig_ManMarkValidChoices(Aig_Man_t *p)
Definition: aigRepr.c:481
Aig_Man_t * Aig_ManDupRepr(Aig_Man_t *p, int fOrdered)
Definition: aigRepr.c:267
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
int nNodesEnd
Definition: fra.h:225
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
void Fra_SmlSimulate(Fra_Man_t *p, int fInit)
Definition: fraSim.c:738
void Fra_ManStop(Fra_Man_t *p)
Definition: fraMan.c:240
void Fra_ClassesCopyReprs(Fra_Cla_t *p, Vec_Ptr_t *vFailed)
Definition: fraClass.c:114
void Aig_ManTransferRepr(Aig_Man_t *pNew, Aig_Man_t *p)
Definition: aigRepr.c:211
ABC_INT64_T abctime
Definition: abc_global.h:278
int Aig_ManCleanup(Aig_Man_t *p)
Definition: aigMan.c:265
int nLitsBeg
Definition: fra.h:222
void Fra_FraigSweep ( Fra_Man_t p)

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

Synopsis [Performs fraiging for the internal nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 310 of file fraCore.c.

311 {
312 // Bar_Progress_t * pProgress = NULL;
313  Aig_Obj_t * pObj, * pObjNew;
314  int i, Pos = 0;
315  int nBTracksOld;
316  // fraig latch outputs
317  Aig_ManForEachLoSeq( p->pManAig, pObj, i )
318  {
319  Fra_FraigNode( p, pObj );
320  if ( p->pPars->fUseImps )
321  Pos = Fra_ImpCheckForNode( p, p->pCla->vImps, pObj, Pos );
322  }
323  if ( p->pPars->fLatchCorr )
324  return;
325  // fraig internal nodes
326 // if ( !p->pPars->fDontShowBar )
327 // pProgress = Bar_ProgressStart( stdout, Aig_ManObjNumMax(p->pManAig) );
328  nBTracksOld = p->pPars->nBTLimitNode;
329  Aig_ManForEachNode( p->pManAig, pObj, i )
330  {
331 // if ( pProgress )
332 // Bar_ProgressUpdate( pProgress, i, NULL );
333  // derive and remember the new fraig node
334  pObjNew = Aig_And( p->pManFraig, Fra_ObjChild0Fra(pObj,p->pPars->nFramesK), Fra_ObjChild1Fra(pObj,p->pPars->nFramesK) );
335  Fra_ObjSetFraig( pObj, p->pPars->nFramesK, pObjNew );
336  Aig_Regular(pObjNew)->pData = p;
337  // quit if simulation detected a counter-example for a PO
338  if ( p->pManFraig->pData )
339  continue;
340 // if ( Aig_SupportSize(p->pManAig,pObj) > 16 )
341 // continue;
342  // perform fraiging
343  if ( p->pPars->nLevelMax && (int)pObj->Level > p->pPars->nLevelMax )
344  p->pPars->nBTLimitNode = 5;
345  Fra_FraigNode( p, pObj );
346  if ( p->pPars->nLevelMax && (int)pObj->Level > p->pPars->nLevelMax )
347  p->pPars->nBTLimitNode = nBTracksOld;
348  // check implications
349  if ( p->pPars->fUseImps )
350  Pos = Fra_ImpCheckForNode( p, p->pCla->vImps, pObj, Pos );
351  }
352 // if ( pProgress )
353 // Bar_ProgressStop( pProgress );
354  // try to prove the outputs of the miter
356 // Fra_MiterStatus( p->pManFraig );
357 // if ( p->pPars->fProve && p->pManFraig->pData == NULL )
358 // Fra_MiterProve( p );
359  // compress implications after processing all of them
360  if ( p->pPars->fUseImps )
362 }
unsigned Level
Definition: aig.h:82
Aig_Man_t * pManAig
Definition: fra.h:191
void Fra_ImpCompactArray(Vec_Int_t *vImps)
Definition: fraImp.c:607
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Fra_Cla_t * pCla
Definition: fra.h:198
Fra_Par_t * pPars
Definition: fra.h:189
ush Pos
Definition: deflate.h:88
void * pData
Definition: aig.h:87
static Aig_Obj_t * Fra_ObjChild0Fra(Aig_Obj_t *pObj, int i)
Definition: fra.h:272
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Definition: aig.h:246
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
static void Fra_ObjSetFraig(Aig_Obj_t *pObj, int i, Aig_Obj_t *pNode)
Definition: fra.h:261
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
Aig_Man_t * pManFraig
Definition: fra.h:192
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
int Fra_ImpCheckForNode(Fra_Man_t *p, Vec_Int_t *vImps, Aig_Obj_t *pNode, int Pos)
Definition: fraImp.c:503
Definition: aig.h:69
Vec_Int_t * vImps
Definition: fra.h:163
int nNodesMiter
Definition: fra.h:221
#define Aig_ManForEachLoSeq(p, pObj, i)
Definition: aig.h:441
static Aig_Obj_t * Fra_ObjChild1Fra(Aig_Obj_t *pObj, int i)
Definition: fra.h:273
static void Fra_FraigNode(Fra_Man_t *p, Aig_Obj_t *pObj)
Definition: fraCore.c:234
void Fra_FraigVerifyCounterEx ( Fra_Man_t p,
Vec_Int_t vCex 
)

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

Synopsis [Verifies the generated counter-ex.]

Description []

SideEffects []

SeeAlso []

Definition at line 186 of file fraCore.c.

187 {
188  Aig_Obj_t * pObj, ** ppClass;
189  int i, c;
190  assert( Aig_ManCiNum(p->pManAig) == Vec_IntSize(vCex) );
191  // make sure the input pattern is not used
192  Aig_ManForEachObj( p->pManAig, pObj, i )
193  assert( !pObj->fMarkB );
194  // simulate the cex through the AIG
195  Aig_ManConst1(p->pManAig)->fMarkB = 1;
196  Aig_ManForEachCi( p->pManAig, pObj, i )
197  pObj->fMarkB = Vec_IntEntry(vCex, i);
198  Aig_ManForEachNode( p->pManAig, pObj, i )
199  pObj->fMarkB = (Aig_ObjFanin0(pObj)->fMarkB ^ Aig_ObjFaninC0(pObj)) &
200  (Aig_ObjFanin1(pObj)->fMarkB ^ Aig_ObjFaninC1(pObj));
201  Aig_ManForEachCo( p->pManAig, pObj, i )
202  pObj->fMarkB = Aig_ObjFanin0(pObj)->fMarkB ^ Aig_ObjFaninC0(pObj);
203  // check if the classes hold
204  Vec_PtrForEachEntry( Aig_Obj_t *, p->pCla->vClasses1, pObj, i )
205  {
206  if ( pObj->fPhase != pObj->fMarkB )
207  printf( "The node %d is not constant under cex!\n", pObj->Id );
208  }
209  Vec_PtrForEachEntry( Aig_Obj_t **, p->pCla->vClasses, ppClass, i )
210  {
211  for ( c = 1; ppClass[c]; c++ )
212  if ( (ppClass[0]->fPhase ^ ppClass[c]->fPhase) != (ppClass[0]->fMarkB ^ ppClass[c]->fMarkB) )
213  printf( "The nodes %d and %d are not equal under cex!\n", ppClass[0]->Id, ppClass[c]->Id );
214 // for ( c = 0; ppClass[c]; c++ )
215 // if ( Fra_ObjFraig(ppClass[c],p->pPars->nFramesK) == Aig_ManConst1(p->pManFraig) )
216 // printf( "A member of non-constant class has a constant repr!\n" );
217  }
218  // clean the simulation pattern
219  Aig_ManForEachObj( p->pManAig, pObj, i )
220  pObj->fMarkB = 0;
221 }
Aig_Man_t * pManAig
Definition: fra.h:191
Fra_Cla_t * pCla
Definition: fra.h:198
Vec_Ptr_t * vClasses
Definition: fra.h:154
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
#define Aig_ManForEachCo(p, pObj, i)
Definition: aig.h:398
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
Definition: aig.h:309
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
Definition: aig.h:69
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
Definition: aig.h:306
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
Definition: aig.h:307
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55