diff options
Diffstat (limited to 'src/sop')
-rw-r--r-- | src/sop/ft/ft.h | 2 | ||||
-rw-r--r-- | src/sop/ft/ftFactor.c | 29 |
2 files changed, 30 insertions, 1 deletions
diff --git a/src/sop/ft/ft.h b/src/sop/ft/ft.h index cea7d935..da162e99 100644 --- a/src/sop/ft/ft.h +++ b/src/sop/ft/ft.h @@ -95,6 +95,8 @@ extern Vec_Int_t * Ft_Factor( char * pSop ); extern int Ft_FactorGetNumNodes( Vec_Int_t * vForm ); extern int Ft_FactorGetNumVars( Vec_Int_t * vForm ); extern void Ft_FactorComplement( Vec_Int_t * vForm ); +extern Vec_Int_t * Ft_FactorConst( int fConst1 ); +extern Vec_Int_t * Ft_FactorVar( int iVar, int nVars, int fCompl ); /*=== ftPrint.c =====================================================*/ extern void Ft_FactorPrint( FILE * pFile, Vec_Int_t * vForm, char * pNamesIn[], char * pNameOut ); diff --git a/src/sop/ft/ftFactor.c b/src/sop/ft/ftFactor.c index 1654973f..d25d0653 100644 --- a/src/sop/ft/ftFactor.c +++ b/src/sop/ft/ftFactor.c @@ -39,7 +39,6 @@ static Ft_Node_t * Ft_FactorTrivialCubeCascade( Vec_Int_t * vForm, Mvc_Cov static Ft_Node_t * Ft_FactorNodeCreate( Vec_Int_t * vForm, int Type, Ft_Node_t * pNode1, Ft_Node_t * pNode2 ); static Ft_Node_t * Ft_FactorLeafCreate( Vec_Int_t * vForm, int iLit ); static void Ft_FactorFinalize( Vec_Int_t * vForm, Ft_Node_t * pNode, int nVars ); -static Vec_Int_t * Ft_FactorConst( int fConst1 ); // temporary procedures that work with the covers static Mvc_Cover_t * Ft_ConvertSopToMvc( char * pSop ); @@ -320,6 +319,8 @@ Ft_Node_t * Ft_FactorTrivialTree_rec( Vec_Int_t * vForm, Ft_Node_t ** ppNodes, i return ppNodes[0]; // split the nodes into two parts +// nNodes1 = nNodes/2; +// nNodes2 = nNodes - nNodes1; nNodes2 = nNodes/2; nNodes1 = nNodes - nNodes2; @@ -613,6 +614,32 @@ Vec_Int_t * Ft_FactorConst( int fConst1 ) return vForm; } +/**Function************************************************************* + + Synopsis [Creates a constant 0 or 1 factored form.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Vec_Int_t * Ft_FactorVar( int iVar, int nVars, int fCompl ) +{ + Vec_Int_t * vForm; + Ft_Node_t * pNode; + // create the elementary variable node + vForm = Vec_IntAlloc( nVars + 1 ); + Vec_IntFill( vForm, nVars + 1, 0 ); + pNode = Ft_NodeReadLast( vForm ); + pNode->iFanin0 = iVar; + pNode->iFanin1 = iVar; + pNode->fIntern = 1; + pNode->fCompl = fCompl; + return vForm; +} + |