Commit 02081dba by Alan Mishchenko

Added generation of counter-examples in &reachm.

parent 2f874d27
...@@ -208,6 +208,7 @@ int Llb_ManModelCheckGia( Gia_Man_t * pGia, Gia_ParLlb_t * pPars ) ...@@ -208,6 +208,7 @@ int Llb_ManModelCheckGia( Gia_Man_t * pGia, Gia_ParLlb_t * pPars )
RetValue = Llb_ManModelCheckAig( pAig, pPars, NULL, NULL ); RetValue = Llb_ManModelCheckAig( pAig, pPars, NULL, NULL );
else else
RetValue = Llb_ManModelCheckAigWithHints( pAig, pPars ); RetValue = Llb_ManModelCheckAigWithHints( pAig, pPars );
pGia->pCexSeq = pAig->pSeqModel; pAig->pSeqModel = NULL;
Aig_ManStop( pAig ); Aig_ManStop( pAig );
return RetValue; return RetValue;
} }
......
...@@ -47,9 +47,13 @@ void Llb_ManPrepareVarMap( Llb_Man_t * p ) ...@@ -47,9 +47,13 @@ void Llb_ManPrepareVarMap( Llb_Man_t * p )
Aig_Obj_t * pObjLi, * pObjLo; Aig_Obj_t * pObjLi, * pObjLo;
int i, iVarLi, iVarLo; int i, iVarLi, iVarLo;
assert( p->vNs2Glo == NULL ); assert( p->vNs2Glo == NULL );
assert( p->vCs2Glo == NULL );
assert( p->vGlo2Cs == NULL ); assert( p->vGlo2Cs == NULL );
assert( p->vGlo2Ns == NULL );
p->vNs2Glo = Vec_IntStartFull( Vec_IntSize(p->vVar2Obj) ); p->vNs2Glo = Vec_IntStartFull( Vec_IntSize(p->vVar2Obj) );
p->vCs2Glo = Vec_IntStartFull( Vec_IntSize(p->vVar2Obj) );
p->vGlo2Cs = Vec_IntStartFull( Aig_ManRegNum(p->pAig) ); p->vGlo2Cs = Vec_IntStartFull( Aig_ManRegNum(p->pAig) );
p->vGlo2Ns = Vec_IntStartFull( Aig_ManRegNum(p->pAig) );
Saig_ManForEachLiLo( p->pAig, pObjLi, pObjLo, i ) Saig_ManForEachLiLo( p->pAig, pObjLi, pObjLo, i )
{ {
iVarLi = Vec_IntEntry(p->vObj2Var, Aig_ObjId(pObjLi)); iVarLi = Vec_IntEntry(p->vObj2Var, Aig_ObjId(pObjLi));
...@@ -57,7 +61,16 @@ void Llb_ManPrepareVarMap( Llb_Man_t * p ) ...@@ -57,7 +61,16 @@ void Llb_ManPrepareVarMap( Llb_Man_t * p )
assert( iVarLi >= 0 && iVarLi < Vec_IntSize(p->vVar2Obj) ); assert( iVarLi >= 0 && iVarLi < Vec_IntSize(p->vVar2Obj) );
assert( iVarLo >= 0 && iVarLo < Vec_IntSize(p->vVar2Obj) ); assert( iVarLo >= 0 && iVarLo < Vec_IntSize(p->vVar2Obj) );
Vec_IntWriteEntry( p->vNs2Glo, iVarLi, i ); Vec_IntWriteEntry( p->vNs2Glo, iVarLi, i );
Vec_IntWriteEntry( p->vCs2Glo, iVarLo, i );
Vec_IntWriteEntry( p->vGlo2Cs, i, iVarLo ); Vec_IntWriteEntry( p->vGlo2Cs, i, iVarLo );
Vec_IntWriteEntry( p->vGlo2Ns, i, iVarLi );
}
// add mapping of the PIs
Saig_ManForEachPi( p->pAig, pObjLo, i )
{
iVarLo = Vec_IntEntry(p->vObj2Var, Aig_ObjId(pObjLo));
Vec_IntWriteEntry( p->vCs2Glo, iVarLo, Aig_ManRegNum(p->pAig)+i );
Vec_IntWriteEntry( p->vNs2Glo, iVarLo, Aig_ManRegNum(p->pAig)+i );
} }
} }
...@@ -117,6 +130,7 @@ void Llb_ManPrepareVarLimits( Llb_Man_t * p ) ...@@ -117,6 +130,7 @@ void Llb_ManPrepareVarLimits( Llb_Man_t * p )
void Llb_ManStop( Llb_Man_t * p ) void Llb_ManStop( Llb_Man_t * p )
{ {
Llb_Grp_t * pGrp; Llb_Grp_t * pGrp;
DdNode * bTemp;
int i; int i;
// Vec_IntFreeP( &p->vMem ); // Vec_IntFreeP( &p->vMem );
...@@ -128,25 +142,39 @@ void Llb_ManStop( Llb_Man_t * p ) ...@@ -128,25 +142,39 @@ void Llb_ManStop( Llb_Man_t * p )
Llb_MtrFree( p->pMatrix ); Llb_MtrFree( p->pMatrix );
Vec_PtrForEachEntry( Llb_Grp_t *, p->vGroups, pGrp, i ) Vec_PtrForEachEntry( Llb_Grp_t *, p->vGroups, pGrp, i )
Llb_ManGroupStop( pGrp ); Llb_ManGroupStop( pGrp );
Vec_PtrFreeP( &p->vGroups );
Vec_IntFreeP( &p->vVar2Obj );
Vec_IntFreeP( &p->vObj2Var );
Vec_IntFreeP( &p->vVarBegs );
Vec_IntFreeP( &p->vVarEnds );
Vec_IntFreeP( &p->vNs2Glo );
Vec_IntFreeP( &p->vGlo2Cs );
// Vec_IntFreeP( &p->vHints );
if ( p->dd ) if ( p->dd )
{ {
// printf( "Manager dd\n" );
Extra_StopManager( p->dd ); Extra_StopManager( p->dd );
} }
if ( p->ddG ) if ( p->ddG )
{ {
// printf( "Manager ddG\n" );
if ( p->ddG->bFunc ) if ( p->ddG->bFunc )
Cudd_RecursiveDeref( p->ddG, p->ddG->bFunc ); Cudd_RecursiveDeref( p->ddG, p->ddG->bFunc );
Extra_StopManager( p->ddG ); Extra_StopManager( p->ddG );
} }
if ( p->ddR )
{
// printf( "Manager ddR\n" );
if ( p->ddR->bFunc )
Cudd_RecursiveDeref( p->ddR, p->ddR->bFunc );
Vec_PtrForEachEntry( DdNode *, p->vRings, bTemp, i )
Cudd_RecursiveDeref( p->ddR, bTemp );
Extra_StopManager( p->ddR );
}
Aig_ManStop( p->pAig ); Aig_ManStop( p->pAig );
Vec_PtrFreeP( &p->vGroups );
Vec_IntFreeP( &p->vVar2Obj );
Vec_IntFreeP( &p->vObj2Var );
Vec_IntFreeP( &p->vVarBegs );
Vec_IntFreeP( &p->vVarEnds );
Vec_PtrFreeP( &p->vRings );
Vec_IntFreeP( &p->vNs2Glo );
Vec_IntFreeP( &p->vCs2Glo );
Vec_IntFreeP( &p->vGlo2Cs );
Vec_IntFreeP( &p->vGlo2Ns );
// Vec_IntFreeP( &p->vHints );
ABC_FREE( p ); ABC_FREE( p );
} }
...@@ -172,6 +200,7 @@ Llb_Man_t * Llb_ManStart( Aig_Man_t * pAigGlo, Aig_Man_t * pAig, Gia_ParLlb_t * ...@@ -172,6 +200,7 @@ Llb_Man_t * Llb_ManStart( Aig_Man_t * pAigGlo, Aig_Man_t * pAig, Gia_ParLlb_t *
p->pAig = pAig; p->pAig = pAig;
p->vVar2Obj = Llb_ManMarkPivotNodes( p->pAig, pPars->fUsePivots ); p->vVar2Obj = Llb_ManMarkPivotNodes( p->pAig, pPars->fUsePivots );
p->vObj2Var = Vec_IntInvert( p->vVar2Obj, -1 ); p->vObj2Var = Vec_IntInvert( p->vVar2Obj, -1 );
p->vRings = Vec_PtrAlloc( 100 );
Llb_ManPrepareVarMap( p ); Llb_ManPrepareVarMap( p );
Llb_ManPrepareGroups( p ); Llb_ManPrepareGroups( p );
Aig_ManCleanMarkA( pAig ); Aig_ManCleanMarkA( pAig );
......
...@@ -55,16 +55,20 @@ struct Llb_Man_t_ ...@@ -55,16 +55,20 @@ struct Llb_Man_t_
Aig_Man_t * pAig; // derived AIG manager (created in this package) Aig_Man_t * pAig; // derived AIG manager (created in this package)
DdManager * dd; // BDD manager DdManager * dd; // BDD manager
DdManager * ddG; // BDD manager DdManager * ddG; // BDD manager
DdManager * ddR; // BDD manager
Vec_Int_t * vObj2Var; // mapping AIG ObjId into BDD var index Vec_Int_t * vObj2Var; // mapping AIG ObjId into BDD var index
Vec_Int_t * vVar2Obj; // mapping BDD var index into AIG ObjId Vec_Int_t * vVar2Obj; // mapping BDD var index into AIG ObjId
Vec_Ptr_t * vGroups; // group Id into group pointer Vec_Ptr_t * vGroups; // group Id into group pointer
Llb_Mtr_t * pMatrix; // dependency matrix Llb_Mtr_t * pMatrix; // dependency matrix
// image computation // image computation
Vec_Ptr_t * vRings; // onion rings
Vec_Int_t * vVarBegs; // the first group where the var appears Vec_Int_t * vVarBegs; // the first group where the var appears
Vec_Int_t * vVarEnds; // the last group where the var appears Vec_Int_t * vVarEnds; // the last group where the var appears
// variable mapping // variable mapping
Vec_Int_t * vNs2Glo; // next state variables into global variables Vec_Int_t * vNs2Glo; // next state variables into global variables
Vec_Int_t * vCs2Glo; // next state variables into global variables
Vec_Int_t * vGlo2Cs; // global variables into current state variables Vec_Int_t * vGlo2Cs; // global variables into current state variables
Vec_Int_t * vGlo2Ns; // global variables into current state variables
// flow computation // flow computation
// Vec_Int_t * vMem; // Vec_Int_t * vMem;
// Vec_Ptr_t * vTops; // Vec_Ptr_t * vTops;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment