50DdNode * Dec_GraphDeriveBdd( DdManager * dd,
Dec_Graph_t * pGraph )
52 DdNode * bFunc, * bFunc0, * bFunc1;
57 assert( Dec_GraphLeaveNum(pGraph) >= 0 );
58 assert( Dec_GraphLeaveNum(pGraph) <= pGraph->
nSize );
61 if ( Dec_GraphIsConst(pGraph) )
62 return Cudd_NotCond(
b1, Dec_GraphIsComplement(pGraph) );
64 if ( Dec_GraphIsVar(pGraph) )
65 return Cudd_NotCond( Cudd_bddIthVar(dd, Dec_GraphVarInt(pGraph)), Dec_GraphIsComplement(pGraph) );
69 pNode->
pFunc = Cudd_bddIthVar( dd, i );
74 bFunc0 = Cudd_NotCond( Dec_GraphNode(pGraph, pNode->
eEdge0.Node)->pFunc, pNode->
eEdge0.fCompl );
75 bFunc1 = Cudd_NotCond( Dec_GraphNode(pGraph, pNode->
eEdge1.Node)->pFunc, pNode->
eEdge1.fCompl );
76 pNode->
pFunc = Cudd_bddAnd( dd, bFunc0, bFunc1 ); Cudd_Ref( (DdNode *)pNode->
pFunc );
80 bFunc = (DdNode *)pNode->
pFunc; Cudd_Ref( bFunc );
82 Cudd_RecursiveDeref( dd, (DdNode *)pNode->
pFunc );
86 return Cudd_NotCond( bFunc, Dec_GraphIsComplement(pGraph) );
104 unsigned uTruths[5] = { 0xAAAAAAAA, 0xCCCCCCCC, 0xF0F0F0F0, 0xFF00FF00, 0xFFFF0000 };
106 unsigned uTruth0, uTruth1;
111 assert( Dec_GraphLeaveNum(pGraph) >= 0 );
112 assert( Dec_GraphLeaveNum(pGraph) <= pGraph->
nSize );
113 assert( Dec_GraphLeaveNum(pGraph) <= 5 );
116 if ( Dec_GraphIsConst(pGraph) )
117 return Dec_GraphIsComplement(pGraph)? 0 : ~((unsigned)0);
119 if ( Dec_GraphIsVar(pGraph) )
120 return Dec_GraphIsComplement(pGraph)? ~uTruths[Dec_GraphVarInt(pGraph)] : uTruths[Dec_GraphVarInt(pGraph)];
124 pNode->
pFunc = (
void *)(ABC_PTRUINT_T)uTruths[i];
129 uTruth0 = (unsigned)(ABC_PTRUINT_T)Dec_GraphNode(pGraph, pNode->
eEdge0.Node)->pFunc;
130 uTruth1 = (unsigned)(ABC_PTRUINT_T)Dec_GraphNode(pGraph, pNode->
eEdge1.Node)->pFunc;
131 uTruth0 = pNode->
eEdge0.fCompl? ~uTruth0 : uTruth0;
132 uTruth1 = pNode->
eEdge1.fCompl? ~uTruth1 : uTruth1;
133 uTruth = uTruth0 & uTruth1;
134 pNode->
pFunc = (
void *)(ABC_PTRUINT_T)uTruth;
138 return Dec_GraphIsComplement(pGraph)? ~uTruth : uTruth;
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
ABC_NAMESPACE_IMPL_START unsigned Dec_GraphDeriveTruth(Dec_Graph_t *pGraph)
DECLARATIONS ///.
struct Dec_Node_t_ Dec_Node_t
#define Dec_GraphForEachLeaf(pGraph, pLeaf, i)
ITERATORS ///.
#define Dec_GraphForEachNode(pGraph, pAnd, i)
struct Dec_Graph_t_ Dec_Graph_t