printf("give up due to impossible decomposition (depth = %d, input = %d, arrival time = %d)",pSes->nMaxDepth,l,pSes->pArrTimeProfile[l]);
return0;
}
i=0;
for(l=0;l<pSes->nSpecVars;++l)
if(pSes->pArrTimeProfile[l]+2==pSes->nMaxDepth)
if(++i>fMaxGatesLevel2)
{
if(pSes->fVeryVerbose)
printf("give up due to impossible decomposition at second level (depth = %d, input = %d, arrival time = %d)",pSes->nMaxDepth,l,pSes->pArrTimeProfile[l]);
return0;
}
}
/* check if depth's match with structure at second level from top */
if(fAndDecStructure)
fMaxGatesLevel2=(pSes->nSpecVars==3)?2:1;
else
fMaxGatesLevel2=(pSes->nSpecVars==4)?4:3;
/* check if depth's match with structure at third level from top */
if(pSes->nSpecVars>4&&pSes->fDecStructure&&i==1)/* we have f = AND(x_i, AND(x_j, g)) (x_i and x_j may be complemented) */
{
i=0;
for(l=0;l<pSes->nSpecVars;++l)
if(pSes->pArrTimeProfile[l]+2==pSes->nMaxDepth)
if(++i>fMaxGatesLevel2)
if(pSes->pArrTimeProfile[l]+3==pSes->nMaxDepth)
if(++i>1)
{
if(pSes->fVeryVerbose)
printf("give up due to impossible decomposition at second level (depth = %d, input = %d, arrival time = %d)",pSes->nMaxDepth,l,pSes->pArrTimeProfile[l]);
printf("give up due to impossible decomposition at third level (depth = %d, input = %d, arrival time = %d)",pSes->nMaxDepth,l,pSes->pArrTimeProfile[l]);
return0;
}
}
return1;
}
// returns 0, if current max depth and #gates are not consistent