summaryrefslogtreecommitdiffstats
path: root/src/map/if/ifDec16.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/if/ifDec16.c')
-rw-r--r--src/map/if/ifDec16.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/map/if/ifDec16.c b/src/map/if/ifDec16.c
index 2f7d5ff9..cedf4f06 100644
--- a/src/map/if/ifDec16.c
+++ b/src/map/if/ifDec16.c
@@ -2040,6 +2040,23 @@ int If_CutPerformCheck16( If_Man_t * p, unsigned * pTruth, int nVars, int nLeave
{
If_Grp_t G1 = {0};//, G3 = {0};
int i, nLutLeaf, nLutLeaf2, nLutRoot, Length;
+ // if cutmin is disabled, minimize the cut
+ if ( !p->pPars->fCutMin && If_CluSupportSize((word *)pTruth, nVars) < nLeaves )
+ {
+ If_Cut_t * pCut = p->pCutTemp;
+ pCut->nLimit = nVars;
+ pCut->nLeaves = nLeaves;
+ pCut->pLeaves = (int *)(pCut + 1);
+ for ( i = 0; i < nLeaves; i++ )
+ pCut->pLeaves[i] = i;
+ pCut->pTruth = (unsigned *)pCut->pLeaves + pCut->nLimit + p->nPermWords;
+ If_CluCopy( (word *)If_CutTruth(pCut), (word *)pTruth, nVars );
+ if ( If_CutTruthMinimize( p, pCut ) >= 2 )
+ return 0;
+ nLeaves = pCut->nLeaves;
+ If_CluCopy( (word *)pTruth, (word *)If_CutTruth(pCut), nVars );
+ }
+
// quit if parameters are wrong
Length = strlen(pStr);
if ( Length != 2 && Length != 3 )