summaryrefslogtreecommitdiffstats
path: root/src/opt/kit/kitTruth.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-04-28 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2007-04-28 08:01:00 -0700
commitfeb8fb692e09a2fc7c1da4f2fcf605d398e940f2 (patch)
tree9a1cc7b8e64719e109bbdb99b1e8d49dcb34715c /src/opt/kit/kitTruth.c
parentc09d4d499cee70f02e3e9a18226554b8d1d34488 (diff)
downloadabc-feb8fb692e09a2fc7c1da4f2fcf605d398e940f2.tar.gz
abc-feb8fb692e09a2fc7c1da4f2fcf605d398e940f2.tar.bz2
abc-feb8fb692e09a2fc7c1da4f2fcf605d398e940f2.zip
Version abc70428
Diffstat (limited to 'src/opt/kit/kitTruth.c')
-rw-r--r--src/opt/kit/kitTruth.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/opt/kit/kitTruth.c b/src/opt/kit/kitTruth.c
index 64a6a052..73264661 100644
--- a/src/opt/kit/kitTruth.c
+++ b/src/opt/kit/kitTruth.c
@@ -769,6 +769,61 @@ void Kit_TruthForallNew( unsigned * pRes, unsigned * pTruth, int nVars, int iVar
/**Function*************************************************************
+ Synopsis [Universally quantifies the variable.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Kit_TruthUniqueNew( unsigned * pRes, unsigned * pTruth, int nVars, int iVar )
+{
+ int nWords = Kit_TruthWordNum( nVars );
+ int i, k, Step;
+
+ assert( iVar < nVars );
+ switch ( iVar )
+ {
+ case 0:
+ for ( i = 0; i < nWords; i++ )
+ pRes[i] = pTruth[i] ^ (((pTruth[i] & 0xAAAAAAAA) >> 1) | ((pTruth[i] & 0x55555555) << 1));
+ return;
+ case 1:
+ for ( i = 0; i < nWords; i++ )
+ pRes[i] = pTruth[i] ^ (((pTruth[i] & 0xCCCCCCCC) >> 2) | ((pTruth[i] & 0x33333333) << 2));
+ return;
+ case 2:
+ for ( i = 0; i < nWords; i++ )
+ pRes[i] = pTruth[i] ^ (((pTruth[i] & 0xF0F0F0F0) >> 4) | ((pTruth[i] & 0x0F0F0F0F) << 4));
+ return;
+ case 3:
+ for ( i = 0; i < nWords; i++ )
+ pRes[i] = pTruth[i] ^ (((pTruth[i] & 0xFF00FF00) >> 8) | ((pTruth[i] & 0x00FF00FF) << 8));
+ return;
+ case 4:
+ for ( i = 0; i < nWords; i++ )
+ pRes[i] = pTruth[i] ^ (((pTruth[i] & 0xFFFF0000) >> 16) | ((pTruth[i] & 0x0000FFFF) << 16));
+ return;
+ default:
+ Step = (1 << (iVar - 5));
+ for ( k = 0; k < nWords; k += 2*Step )
+ {
+ for ( i = 0; i < Step; i++ )
+ {
+ pRes[i] = pTruth[i] ^ pTruth[Step+i];
+ pRes[Step+i] = pRes[i];
+ }
+ pRes += 2*Step;
+ pTruth += 2*Step;
+ }
+ return;
+ }
+}
+
+/**Function*************************************************************
+
Synopsis [Universally quantifies the set of variables.]
Description []