summaryrefslogtreecommitdiffstats
path: root/src/map/if/ifDec16.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-08-29 16:03:40 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-08-29 16:03:40 -0700
commit009cc92e0544b69b0591394b3645de74eb513a8c (patch)
tree723fcc906b0a0ffbe43cbf78b90f9c7fba3ace26 /src/map/if/ifDec16.c
parenta495163f74ee677bf9199bd5be8118c32f65e66a (diff)
downloadabc-009cc92e0544b69b0591394b3645de74eb513a8c.tar.gz
abc-009cc92e0544b69b0591394b3645de74eb513a8c.tar.bz2
abc-009cc92e0544b69b0591394b3645de74eb513a8c.zip
Buf fixes and minor changes to the &if mapper.
Diffstat (limited to 'src/map/if/ifDec16.c')
-rw-r--r--src/map/if/ifDec16.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/map/if/ifDec16.c b/src/map/if/ifDec16.c
index 372473a7..ce59a946 100644
--- a/src/map/if/ifDec16.c
+++ b/src/map/if/ifDec16.c
@@ -1760,6 +1760,31 @@ static inline word Abc_Tt6Cofactor1( word t, int iVar )
assert( iVar >= 0 && iVar < 6 );
return (t & Truth6[iVar]) | ((t & Truth6[iVar]) >> (1<<iVar));
}
+int If_CluCheckDecInAny( word t, int nVars )
+{
+ int v, u, Cof2[2], Cof4[4];
+ for ( v = 0; v < nVars; v++ )
+ {
+ Cof2[0] = Abc_Tt6Cofactor0( t, v );
+ Cof2[1] = Abc_Tt6Cofactor1( t, v );
+ for ( u = v+1; u < nVars; u++ )
+ {
+ Cof4[0] = Abc_Tt6Cofactor0( Cof2[0], u );
+ Cof4[1] = Abc_Tt6Cofactor1( Cof2[0], u );
+ Cof4[2] = Abc_Tt6Cofactor0( Cof2[1], u );
+ Cof4[3] = Abc_Tt6Cofactor1( Cof2[1], u );
+ if ( Cof4[0] == Cof4[1] && Cof4[0] == Cof4[2] )
+ return 1;
+ if ( Cof4[0] == Cof4[2] && Cof4[0] == Cof4[3] )
+ return 1;
+ if ( Cof4[0] == Cof4[1] && Cof4[0] == Cof4[3] )
+ return 1;
+ if ( Cof4[1] == Cof4[2] && Cof4[1] == Cof4[3] )
+ return 1;
+ }
+ }
+ return 0;
+}
int If_CluCheckDecIn( word t, int nVars )
{
int v, u, Cof2[2], Cof4[4];