ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
decFactor.c File Reference
#include "base/abc/abc.h"
#include "base/main/main.h"
#include "misc/mvc/mvc.h"
#include "dec.h"
Include dependency graph for decFactor.c:

Go to the source code of this file.

Functions

Dec_Graph_tDec_Factor (char *pSop)
 FUNCTION DEFINITIONS ///.
 

Function Documentation

◆ Dec_Factor()

Dec_Graph_t * Dec_Factor ( char * pSop)

FUNCTION DEFINITIONS ///.

FUNCTION DECLARATIONS ///.

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

Synopsis [Factors the cover.]

Description []

SideEffects []

SeeAlso []

Definition at line 58 of file decFactor.c.

59{
60 Mvc_Cover_t * pCover;
61 Dec_Graph_t * pFForm;
62 Dec_Edge_t eRoot;
63 if ( Abc_SopIsConst0(pSop) )
64 return Dec_GraphCreateConst0();
65 if ( Abc_SopIsConst1(pSop) )
66 return Dec_GraphCreateConst1();
67
68 // derive the cover from the SOP representation
69 pCover = Dec_ConvertSopToMvc( pSop );
70
71 // make sure the cover is CCS free (should be done before CST)
72 Mvc_CoverContain( pCover );
73
74 // check for trivial functions
75 assert( !Mvc_CoverIsEmpty(pCover) );
76 assert( !Mvc_CoverIsTautology(pCover) );
77
78 // perform CST
79 Mvc_CoverInverse( pCover ); // CST
80 // start the factored form
81 pFForm = Dec_GraphCreate( Abc_SopGetVarNum(pSop) );
82 // factor the cover
83 eRoot = Dec_Factor_rec( pFForm, pCover );
84 // finalize the factored form
85 Dec_GraphSetRoot( pFForm, eRoot );
86 // complement the factored form if SOP is complemented
87 if ( Abc_SopIsComplement(pSop) )
88 Dec_GraphComplement( pFForm );
89 // verify the factored form
90// if ( !Dec_FactorVerify( pSop, pFForm ) )
91// printf( "Verification has failed.\n" );
92// Mvc_CoverInverse( pCover ); // undo CST
93 Mvc_CoverFree( pCover );
94 return pFForm;
95}
ABC_DLL int Abc_SopIsConst0(char *pSop)
Definition abcSop.c:724
ABC_DLL int Abc_SopGetVarNum(char *pSop)
Definition abcSop.c:584
ABC_DLL int Abc_SopIsComplement(char *pSop)
Definition abcSop.c:703
ABC_DLL int Abc_SopIsConst1(char *pSop)
Definition abcSop.c:740
typedefABC_NAMESPACE_HEADER_START struct Dec_Edge_t_ Dec_Edge_t
INCLUDES ///.
Definition dec.h:42
struct Dec_Graph_t_ Dec_Graph_t
Definition dec.h:68
void Mvc_CoverFree(Mvc_Cover_t *pCover)
Definition mvcCover.c:138
int Mvc_CoverContain(Mvc_Cover_t *pCover)
FUNCTION DEFINITIONS ///.
Definition mvcContain.c:47
int Mvc_CoverIsEmpty(Mvc_Cover_t *pCover)
Definition mvcApi.c:93
int Mvc_CoverIsTautology(Mvc_Cover_t *pCover)
Definition mvcApi.c:109
struct MvcCoverStruct Mvc_Cover_t
Definition mvc.h:58
void Mvc_CoverInverse(Mvc_Cover_t *pCover)
Definition mvcUtils.c:481
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function: