50 int Count, Costs[7] = {0, 0, 0, 1, 3, 3, 3};
51 for ( Count = 0; p->Type; p++ )
52 Count += Costs[p->Type];
80 int d = -1, fCompl = 0;
88 for ( --q; *pDsd; pDsd++ )
95 if ( *pDsd ==
')' || *pDsd ==
']' || *pDsd ==
'>' || *pDsd ==
'}' )
101 if ( pLevel[d]->Data > pLevel[d+1]->Data )
102 pLevel[d]->Data = pLevel[d+1]->Data;
110 if ( *pDsd >=
'a' && *pDsd <=
'z' )
113 q->iVar = *pDsd -
'a';
118 if ( pLevel[d]->Data > q->iVar )
119 pLevel[d]->Data = q->iVar;
125 else if ( *pDsd ==
'[' )
127 else if ( *pDsd ==
'<' )
129 else if ( *pDsd ==
'{' )
142 char OpenType[7] = {0, 0, 0,
'(',
'[',
'<',
'{'};
143 char CloseType[7] = {0, 0, 0,
')',
']',
'>',
'}'};
148 printf(
"%d\n", p->fCompl );
152 for ( d = 0; p->Type; p++ )
158 printf(
"%c",
'a' + p->iVar );
159 while ( d > 0 && --pVisits[d] == 0 )
160 printf(
"%c", pTypes[d--] );
164 pVisits[++d] = p->nFans;
165 printf(
"%c", OpenType[p->Type] );
166 printf(
"%c",
'a' + p->Data );
167 printf(
"%d", p->Depth );
168 pTypes[d] = CloseType[p->Type];
181 for ( d = 0; p->Type; p++ )
185 while ( d > 0 && --pVisits[d] == 0 )
188 pVisits[++d] = p->nFans;
200 for ( d = 0; p->Type; p++ )
204 while ( d > 0 && --pVisits[d] == 0 )
211 pLevel[d-1]->nFans += p->nFans - 1;
212 pVisits[d] += p->nFans - 1;
219 pVisits[d] = p->nFans;
227 for ( p = q; p->Type; p++ )
239 char * pDsd =
"[(abd)[cf](f(sg(he)))]";
typedefABC_NAMESPACE_IMPL_START struct Dau_Dsd_t_ Dau_Dsd_t
DECLARATIONS ///.
void Dau_DsdPrint(Dau_Dsd_t *p)
static int Dau_DsdIsConst(char *p)
MACRO DEFINITIONS ///.
void Dau_DsdRemoveUseless(Dau_Dsd_t *p)
static void Dau_DsdClean(Dau_Dsd_t *p)
#define DAU_MAX_VAR
INCLUDES ///.
#define ABC_NAMESPACE_IMPL_END
int Dau_DsdCountAnd(Dau_Dsd_t *p)
FUNCTION DEFINITIONS ///.
void Dau_DsdDepth(Dau_Dsd_t *p)
#define ABC_NAMESPACE_IMPL_START
static int Dau_DsdIsConst1(char *p)
int Dau_DsdConstruct(char *pDsd, Dau_Dsd_t *pStore)