diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-04-23 11:58:35 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-04-23 11:58:35 -0700 |
commit | 3a4ef2d7a7ecb1d7d7678327d08139a18529defa (patch) | |
tree | 3613822754c466bfec18f4267bb358808d1fa446 /src/misc/extra | |
parent | c6999c3ca404de8dc9098e812ef2063d4043cc5f (diff) | |
download | abc-3a4ef2d7a7ecb1d7d7678327d08139a18529defa.tar.gz abc-3a4ef2d7a7ecb1d7d7678327d08139a18529defa.tar.bz2 abc-3a4ef2d7a7ecb1d7d7678327d08139a18529defa.zip |
Experiments with permutations.
Diffstat (limited to 'src/misc/extra')
-rw-r--r-- | src/misc/extra/extraUtilPerm.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/misc/extra/extraUtilPerm.c b/src/misc/extra/extraUtilPerm.c index 1646b49f..b077a7a9 100644 --- a/src/misc/extra/extraUtilPerm.c +++ b/src/misc/extra/extraUtilPerm.c @@ -587,10 +587,9 @@ int Abc_ZddPerm( Abc_ZddMan * p, int a, int Var ) } return Abc_ZddCacheInsert( p, a, Var, ABC_ZDD_OPER_PERM, r ); } - int Abc_ZddPermProduct( Abc_ZddMan * p, int a, int b ) { - Abc_ZddObj * A, * B; + Abc_ZddObj * B; int r0, r1, r; if ( a == 0 ) return 0; if ( a == 1 ) return b; @@ -598,17 +597,11 @@ int Abc_ZddPermProduct( Abc_ZddMan * p, int a, int b ) if ( b == 1 ) return a; if ( (r = Abc_ZddCacheLookup(p, a, b, ABC_ZDD_OPER_PERM_PROD)) >= 0 ) return r; - A = Abc_ZddNode( p, a ); B = Abc_ZddNode( p, b ); - if ( p->pV2TJ[A->Var] < p->pV2TI[B->Var] ) // Aj < Bi - r0 = Abc_ZddPermProduct( p, A->False, b ), - r1 = Abc_ZddPermProduct( p, A->True, b ), - r = Abc_ZddUniqueCreate( p, A->Var, r1, r0 ); - else - r0 = Abc_ZddPermProduct( p, a, B->False ), - r1 = Abc_ZddPermProduct( p, a, B->True ), - r1 = Abc_ZddPerm( p, r1, B->Var ), - r = Abc_ZddUnion( p, r0, r1 ); + r0 = Abc_ZddPermProduct( p, a, B->False ); + r1 = Abc_ZddPermProduct( p, a, B->True ); + r1 = Abc_ZddPerm( p, r1, B->Var ); + r = Abc_ZddUnion( p, r0, r1 ); return Abc_ZddCacheInsert( p, a, b, ABC_ZDD_OPER_PERM_PROD, r ); } |