21 #ifndef ABC__opt__dec__dec_h
22 #define ABC__opt__dec__dec_h
98 #define Dec_GraphForEachLeaf( pGraph, pLeaf, i ) \
99 for ( i = 0; (i < (pGraph)->nLeaves) && (((pLeaf) = Dec_GraphNode(pGraph, i)), 1); i++ )
101 #define Dec_GraphForEachNode( pGraph, pAnd, i ) \
102 for ( i = (pGraph)->nLeaves; (i < (pGraph)->nSize) && (((pAnd) = Dec_GraphNode(pGraph, i)), 1); i++ )
153 return (eEdge.Node << 1) | eEdge.fCompl;
227 pGraph->
nSize = nLeaves;
228 pGraph->
nCap = 2 * nLeaves + 50;
251 pGraph->
eRoot.fCompl = 1;
289 assert( 0 <= iLeaf && iLeaf < nLeaves );
291 pGraph->
eRoot.Node = iLeaf;
292 pGraph->
eRoot.fCompl = fCompl;
374 return pGraph->
eRoot.fCompl;
390 pGraph->
eRoot.fCompl ^= 1;
439 return pGraph->
pNodes + i;
471 return pNode - pGraph->
pNodes;
553 pGraph->
eRoot = eRoot;
599 pNode->
fCompl0 = eEdge0.fCompl;
600 pNode->
fCompl1 = eEdge1.fCompl;
623 pNode->
fCompl0 = eEdge0.fCompl;
624 pNode->
fCompl1 = eEdge1.fCompl;
static int Dec_GraphVarInt(Dec_Graph_t *pGraph)
static unsigned Dec_EdgeToInt(Dec_Edge_t eEdge)
static int Dec_GraphNodeInt(Dec_Graph_t *pGraph, Dec_Node_t *pNode)
static int Dec_GraphNodeNum(Dec_Graph_t *pGraph)
static Dec_Edge_t Dec_GraphAddNodeMux(Dec_Graph_t *pGraph, Dec_Edge_t eEdgeC, Dec_Edge_t eEdgeT, Dec_Edge_t eEdgeE, int Type)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
#define ABC_REALLOC(type, obj, num)
static Dec_Edge_t Dec_EdgeCreate(int Node, int fCompl)
FUNCTION DEFINITIONS ///.
static int Dec_GraphIsConst(Dec_Graph_t *pGraph)
#define ABC_ALLOC(type, num)
typedefABC_NAMESPACE_HEADER_START struct Dec_Edge_t_ Dec_Edge_t
INCLUDES ///.
Dec_Graph_t * Dec_Factor(char *pSop)
FUNCTION DECLARATIONS ///.
static Dec_Edge_t Dec_IntToEdge(unsigned Edge)
static Dec_Graph_t * Dec_GraphCreateConst1()
static Dec_Node_t * Dec_GraphAppendNode(Dec_Graph_t *pGraph)
static Dec_Edge_t Dec_GraphAddNodeAnd(Dec_Graph_t *pGraph, Dec_Edge_t eEdge0, Dec_Edge_t eEdge1)
static Dec_Edge_t Dec_IntToEdge_(unsigned m)
static int Dec_GraphIsComplement(Dec_Graph_t *pGraph)
void Dec_GraphPrint(FILE *pFile, Dec_Graph_t *pGraph, char *pNamesIn[], char *pNameOut)
FUNCTION DEFINITIONS ///.
static Dec_Node_t * Dec_GraphVar(Dec_Graph_t *pGraph)
static Dec_Graph_t * Dec_GraphCreateConst0()
unsigned Dec_GraphDeriveTruth(Dec_Graph_t *pGraph)
static Dec_Edge_t Dec_GraphAddNodeXor(Dec_Graph_t *pGraph, Dec_Edge_t eEdge0, Dec_Edge_t eEdge1, int Type)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
unsigned short * puCanons
#define ABC_NAMESPACE_HEADER_END
static void Dec_GraphSetRoot(Dec_Graph_t *pGraph, Dec_Edge_t eRoot)
static unsigned Dec_EdgeToInt_(Dec_Edge_t m)
static int Dec_GraphIsConst0(Dec_Graph_t *pGraph)
static Dec_Graph_t * Dec_GraphCreateLeaf(int iLeaf, int nLeaves, int fCompl)
static Dec_Graph_t * Dec_GraphCreate(int nLeaves)
static Dec_Edge_t Dec_GraphAddNodeOr(Dec_Graph_t *pGraph, Dec_Edge_t eEdge0, Dec_Edge_t eEdge1)
static Dec_Node_t * Dec_GraphNodeLast(Dec_Graph_t *pGraph)
static int Dec_GraphLeaveNum(Dec_Graph_t *pGraph)
static void Dec_GraphFree(Dec_Graph_t *pGraph)
static int Dec_GraphIsVar(Dec_Graph_t *pGraph)
static int Dec_GraphNodeIsVar(Dec_Graph_t *pGraph, Dec_Node_t *pNode)
static Dec_Node_t * Dec_GraphNode(Dec_Graph_t *pGraph, int i)
static int Dec_GraphIsConst1(Dec_Graph_t *pGraph)
Dec_Man_t * Dec_ManStart()
DECLARATIONS ///.
void Dec_ManStop(Dec_Man_t *p)
static void Dec_GraphComplement(Dec_Graph_t *pGraph)