summaryrefslogtreecommitdiffstats
path: root/src/misc
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-10-05 22:44:02 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-10-05 22:44:02 -0700
commita4a1053d9851cf9ef52a5b52818e66b9c1bdba4d (patch)
tree3333b0b56ee4e2444df1ef251ca7005516156bed /src/misc
parentc9635d029ebc27ce8001c6859d2b992e327ceec7 (diff)
downloadabc-a4a1053d9851cf9ef52a5b52818e66b9c1bdba4d.tar.gz
abc-a4a1053d9851cf9ef52a5b52818e66b9c1bdba4d.tar.bz2
abc-a4a1053d9851cf9ef52a5b52818e66b9c1bdba4d.zip
Towards better Boolean matching.
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/util/utilTruth.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h
index 07f36382..cded2ce8 100644
--- a/src/misc/util/utilTruth.h
+++ b/src/misc/util/utilTruth.h
@@ -1064,6 +1064,19 @@ static inline void Abc_TtSwapVars( word * pTruth, int nVars, int iVar, int jVar
return;
}
}
+// moves one var (v) to the given position (p)
+static inline void Abc_TtMoveVar( word * pF, int nVars, int * V2P, int * P2V, int v, int p )
+{
+ int iVar = V2P[v], jVar = p;
+ if ( iVar == jVar )
+ return;
+ Abc_TtSwapVars( pF, nVars, iVar, jVar );
+ V2P[P2V[iVar]] = jVar;
+ V2P[P2V[jVar]] = iVar;
+ P2V[iVar] ^= P2V[jVar];
+ P2V[jVar] ^= P2V[iVar];
+ P2V[iVar] ^= P2V[jVar];
+}
/**Function*************************************************************