diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-09-27 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-09-27 08:01:00 -0700 |
commit | 689cbe904e3a28d7502feb9931b748764f947aaf (patch) | |
tree | bbb8fff24434b41482f2878489b8210d58b495c5 /src/opt/mfs/mfsSat.c | |
parent | 91effd8148493c3837513c9256eefdf488dd9b97 (diff) | |
download | abc-689cbe904e3a28d7502feb9931b748764f947aaf.tar.gz abc-689cbe904e3a28d7502feb9931b748764f947aaf.tar.bz2 abc-689cbe904e3a28d7502feb9931b748764f947aaf.zip |
Version abc80927
Diffstat (limited to 'src/opt/mfs/mfsSat.c')
-rw-r--r-- | src/opt/mfs/mfsSat.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/opt/mfs/mfsSat.c b/src/opt/mfs/mfsSat.c index 5023bf62..6cc0f0fd 100644 --- a/src/opt/mfs/mfsSat.c +++ b/src/opt/mfs/mfsSat.c @@ -133,6 +133,38 @@ int Abc_NtkMfsSolveSat( Mfs_Man_t * p, Abc_Obj_t * pNode ) return 1; } +/**Function************************************************************* + + Synopsis [Adds one-hotness constraints for the window inputs.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Abc_NtkAddOneHotness( Mfs_Man_t * p ) +{ + Aig_Obj_t * pObj1, * pObj2; + int i, k, Lits[2]; + for ( i = 0; i < Vec_PtrSize(p->pAigWin->vPis); i++ ) + for ( k = i+1; k < Vec_PtrSize(p->pAigWin->vPis); k++ ) + { + pObj1 = Aig_ManPi( p->pAigWin, i ); + pObj2 = Aig_ManPi( p->pAigWin, k ); + Lits[0] = toLitCond( p->pCnf->pVarNums[pObj1->Id], 1 ); + Lits[1] = toLitCond( p->pCnf->pVarNums[pObj2->Id], 1 ); + if ( !sat_solver_addclause( p->pSat, Lits, Lits+2 ) ) + { + sat_solver_delete( p->pSat ); + p->pSat = NULL; + return 0; + } + } + return 1; +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// |