summaryrefslogtreecommitdiffstats
path: root/src/aig/gia/giaHash.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-04-25 15:32:30 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-04-25 15:32:30 -0700
commit486eacc542f193231fd7f116f38e2efab753568c (patch)
tree2d548fb6d23f8751f592d184889839fc8295d576 /src/aig/gia/giaHash.c
parent005f0e39d2c97340f39c4fbf71422fc17e16139b (diff)
downloadabc-486eacc542f193231fd7f116f38e2efab753568c.tar.gz
abc-486eacc542f193231fd7f116f38e2efab753568c.tar.bz2
abc-486eacc542f193231fd7f116f38e2efab753568c.zip
SAT sweeping under constraints.
Diffstat (limited to 'src/aig/gia/giaHash.c')
-rw-r--r--src/aig/gia/giaHash.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/aig/gia/giaHash.c b/src/aig/gia/giaHash.c
index 4ae01f06..81980b40 100644
--- a/src/aig/gia/giaHash.c
+++ b/src/aig/gia/giaHash.c
@@ -625,6 +625,37 @@ Gia_Man_t * Gia_ManRehash( Gia_Man_t * p, int fAddStrash )
}
+/**Function*************************************************************
+
+ Synopsis [Creates well-balanced AND gate.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Gia_ManHashAndMulti( Gia_Man_t * p, Vec_Int_t * vLits )
+{
+ if ( Vec_IntSize(vLits) == 0 )
+ return 0;
+ while ( Vec_IntSize(vLits) > 1 )
+ {
+ int i, k = 0, Lit1, Lit2, LitRes;
+ Vec_IntForEachEntryDouble( vLits, Lit1, Lit2, i )
+ {
+ LitRes = Gia_ManHashAnd( p, Lit1, Lit2 );
+ Vec_IntWriteEntry( vLits, k++, LitRes );
+ }
+ if ( Vec_IntSize(vLits) & 1 )
+ Vec_IntWriteEntry( vLits, k++, Vec_IntEntryLast(vLits) );
+ Vec_IntShrink( vLits, k );
+ }
+ assert( Vec_IntSize(vLits) == 1 );
+ return Vec_IntEntry(vLits, 0);
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////