summaryrefslogtreecommitdiffstats
path: root/src/map/if/ifDec16.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-04-28 12:09:38 +0700
committerAlan Mishchenko <alanmi@berkeley.edu>2012-04-28 12:09:38 +0700
commit490e84c4bcbd726ac40700e6bfa93042d1f79c7d (patch)
tree08df31195e050f052aa05358d0a2af20fe6abb23 /src/map/if/ifDec16.c
parent334911a116309accef78bf28f267f883d2f228f4 (diff)
downloadabc-490e84c4bcbd726ac40700e6bfa93042d1f79c7d.tar.gz
abc-490e84c4bcbd726ac40700e6bfa93042d1f79c7d.tar.bz2
abc-490e84c4bcbd726ac40700e6bfa93042d1f79c7d.zip
Adding on-the-fly truth-table minimization.
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 )