summaryrefslogtreecommitdiffstats
path: root/src/opt/sfm/sfmCnf.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-05-24 19:54:28 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-05-24 19:54:28 -0700
commit283abd4795bd5c45d7dc51abd2e097a1794bad5d (patch)
treea8e4eaccabb038f22cdb39d8c6048f1cc0a4d415 /src/opt/sfm/sfmCnf.c
parentac037cbb966285b724c8bbf776195855dc4a558f (diff)
downloadabc-283abd4795bd5c45d7dc51abd2e097a1794bad5d.tar.gz
abc-283abd4795bd5c45d7dc51abd2e097a1794bad5d.tar.bz2
abc-283abd4795bd5c45d7dc51abd2e097a1794bad5d.zip
New MFS package.
Diffstat (limited to 'src/opt/sfm/sfmCnf.c')
-rw-r--r--src/opt/sfm/sfmCnf.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/opt/sfm/sfmCnf.c b/src/opt/sfm/sfmCnf.c
index 825c336b..09dce50c 100644
--- a/src/opt/sfm/sfmCnf.c
+++ b/src/opt/sfm/sfmCnf.c
@@ -117,6 +117,37 @@ int Sfm_TruthToCnf( word Truth, int nVars, Vec_Int_t * vCover, Vec_Str_t * vCnf
SeeAlso []
***********************************************************************/
+Vec_Wec_t * Sfm_CreateCnf( Sfm_Ntk_t * p )
+{
+ Vec_Wec_t * vCnfs;
+ Vec_Str_t * vCnf, * vCnfBase;
+ word uTruth;
+ int i;
+ vCnf = Vec_StrAlloc( 100 );
+ vCnfs = Vec_WecStart( p->nObjs );
+ Vec_WrdForEachEntryStartStop( p->vTruths, uTruth, i, p->nPis, Vec_WrdSize(p->vTruths)-p->nPos )
+ {
+ Sfm_TruthToCnf( uTruth, Sfm_ObjFaninNum(p, i), p->vCover, vCnf );
+ vCnfBase = (Vec_Str_t *)Vec_WecEntry( vCnfs, i );
+ Vec_StrGrow( vCnfBase, Vec_StrSize(vCnf) );
+ memcpy( Vec_StrArray(vCnfBase), Vec_StrArray(vCnf), Vec_StrSize(vCnf) );
+ vCnfBase->nSize = Vec_StrSize(vCnf);
+ }
+ Vec_StrFree( vCnf );
+ return vCnfs;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
void Sfm_TranslateCnf( Vec_Wec_t * vRes, Vec_Str_t * vCnf, Vec_Int_t * vFaninMap )
{
Vec_Int_t * vClause;