summaryrefslogtreecommitdiffstats
path: root/src/sat/fraig/fraigFeed.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2005-08-28 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2005-08-28 08:01:00 -0700
commit3c25decf65704916943b0569e6d0608072550a89 (patch)
treec4b532e8edd1e2226bc84268e4e2368db8ee295d /src/sat/fraig/fraigFeed.c
parent28db025b8393e307328d51ff6901c4ebab669e95 (diff)
downloadabc-3c25decf65704916943b0569e6d0608072550a89.tar.gz
abc-3c25decf65704916943b0569e6d0608072550a89.tar.bz2
abc-3c25decf65704916943b0569e6d0608072550a89.zip
Version abc50828
Diffstat (limited to 'src/sat/fraig/fraigFeed.c')
-rw-r--r--src/sat/fraig/fraigFeed.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/sat/fraig/fraigFeed.c b/src/sat/fraig/fraigFeed.c
index 0a950aba..b46f6c41 100644
--- a/src/sat/fraig/fraigFeed.c
+++ b/src/sat/fraig/fraigFeed.c
@@ -765,6 +765,47 @@ void Fraig_ReallocateSimulationInfo( Fraig_Man_t * p )
p->pSimsDiff = (unsigned *)Fraig_MemFixedEntryFetch( mmSimsNew );
}
+
+/**Function*************************************************************
+
+ Synopsis [Doubles the size of simulation info.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int * Fraig_ManSaveCounterExample( Fraig_Man_t * p, Fraig_Node_t * pNode )
+{
+ int * pModel = NULL;
+ int iPattern;
+ int i;
+
+ iPattern = Fraig_FindFirstDiff( p->pConst1, pNode, p->nWordsDyna, 0 );
+ if ( iPattern >= 0 )
+ {
+ pModel = ALLOC( int, p->vInputs->nSize );
+ memset( pModel, 0, sizeof(int) * p->vInputs->nSize );
+ for ( i = 0; i < p->vInputs->nSize; i++ )
+ if ( Fraig_BitStringHasBit( p->vInputs->pArray[i]->puSimD, iPattern ) )
+ pModel[i] = 1;
+ return pModel;
+ }
+ iPattern = Fraig_FindFirstDiff( p->pConst1, pNode, p->nWordsRand, 1 );
+ if ( iPattern >= 0 )
+ {
+ pModel = ALLOC( int, p->vInputs->nSize );
+ memset( pModel, 0, sizeof(int) * p->vInputs->nSize );
+ for ( i = 0; i < p->vInputs->nSize; i++ )
+ if ( Fraig_BitStringHasBit( p->vInputs->pArray[i]->puSimR, iPattern ) )
+ pModel[i] = 1;
+ return pModel;
+ }
+ return pModel;
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////