summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2018-09-10 18:23:59 +0300
committerAlan Mishchenko <alanmi@berkeley.edu>2018-09-10 18:23:59 +0300
commit68524cc19c7c85b02e7da7855cf4ec1f2584f27d (patch)
tree6c8071ecced7444b56b706c862683a6cbc5b3dd4 /src
parenta628fb30155dbb1794a4ba9e14388e7c143497c3 (diff)
downloadabc-68524cc19c7c85b02e7da7855cf4ec1f2584f27d.tar.gz
abc-68524cc19c7c85b02e7da7855cf4ec1f2584f27d.tar.bz2
abc-68524cc19c7c85b02e7da7855cf4ec1f2584f27d.zip
Suspected bug fix in exact NPN classification (undoing this change as useless).
Diffstat (limited to 'src')
-rw-r--r--src/opt/dau/dauCanon.c40
1 files changed, 8 insertions, 32 deletions
diff --git a/src/opt/dau/dauCanon.c b/src/opt/dau/dauCanon.c
index 393fc95b..0c93cc85 100644
--- a/src/opt/dau/dauCanon.c
+++ b/src/opt/dau/dauCanon.c
@@ -1220,7 +1220,7 @@ int Abc_TtHieRetrieveOrInsert(Abc_TtHieMan_t * p, int level, word * pTruth, word
return 0;
}
-unsigned Abc_TtCanonicizeHie_int( Abc_TtHieMan_t * p, word * pTruthInit, int nVars, char * pCanonPerm, int fExact )
+unsigned Abc_TtCanonicizeHie( Abc_TtHieMan_t * p, word * pTruthInit, int nVars, char * pCanonPerm, int fExact )
{
int fNaive = 1;
int pStore[17];
@@ -1230,6 +1230,13 @@ unsigned Abc_TtCanonicizeHie_int( Abc_TtHieMan_t * p, word * pTruthInit, int nVa
int i, k;
assert( nVars <= 16 );
+ // handle constant
+ if ( nVars == 0 )
+ {
+ Abc_TtClear( pTruthInit, nWords );
+ return 0;
+ }
+
Abc_TtCopy( pTruth, pTruthInit, nWords, 0 );
for ( i = 0; i < nVars; i++ )
@@ -1347,37 +1354,6 @@ unsigned Abc_TtCanonicizeHie_int( Abc_TtHieMan_t * p, word * pTruthInit, int nVa
return 0;
}
-unsigned Abc_TtCanonicizeHie( Abc_TtHieMan_t * p, word * pTruthInit, int nVars, char * pCanonPerm, int fExact )
-{
- int nOnes, nWords = Abc_TtWordNum( nVars );
- static word pTruth0[1024], pTruth1[1024];
- // handle constant
- if ( nVars == 0 )
- {
- Abc_TtClear( pTruthInit, nWords );
- return 0;
- }
- if ( !fExact )
- return Abc_TtCanonicizeHie_int(p, pTruthInit, nVars, pCanonPerm, fExact );
-
- // normalize polarity
- nOnes = Abc_TtCountOnesInTruth( pTruthInit, nVars );
- if ( nOnes != nWords * 32 )
- return Abc_TtCanonicizeHie_int(p, pTruthInit, nVars, pCanonPerm, fExact );
-
- Abc_TtCopy( pTruth0, pTruthInit, nWords, 0 );
- Abc_TtCopy( pTruth1, pTruthInit, nWords, 0 );
- Abc_TtNot( pTruth0, nWords );
-
- Abc_TtCanonicizeHie_int(p, pTruth0, nVars, pCanonPerm, fExact );
- Abc_TtCanonicizeHie_int(p, pTruth1, nVars, pCanonPerm, fExact );
-
- if ( memcmp(pTruth0, pTruth1, sizeof(word)*nWords) < 0 )
- Abc_TtCopy( pTruthInit, pTruth0, nWords, 0 );
- else
- Abc_TtCopy( pTruthInit, pTruth1, nWords, 0 );
- return 0;
-}
/**Function*************************************************************