summaryrefslogtreecommitdiffstats
path: root/src/bool
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-02-01 20:50:59 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2015-02-01 20:50:59 -0800
commit7b1c25086b650aa0b86280ea8c97ececbac79732 (patch)
tree8cc4cc28a9901ca91298f953eea9c8fb80cc9801 /src/bool
parenta704e9c9ff9470cd1af184c0f37d42198b86f419 (diff)
downloadabc-7b1c25086b650aa0b86280ea8c97ececbac79732.tar.gz
abc-7b1c25086b650aa0b86280ea8c97ececbac79732.tar.bz2
abc-7b1c25086b650aa0b86280ea8c97ececbac79732.zip
Improvements and tuning of CBA.
Diffstat (limited to 'src/bool')
-rw-r--r--src/bool/dec/decFactor.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/bool/dec/decFactor.c b/src/bool/dec/decFactor.c
index febaa905..391496e1 100644
--- a/src/bool/dec/decFactor.c
+++ b/src/bool/dec/decFactor.c
@@ -57,23 +57,20 @@ Dec_Graph_t * Dec_Factor( char * pSop )
Mvc_Cover_t * pCover;
Dec_Graph_t * pFForm;
Dec_Edge_t eRoot;
+ if ( Abc_SopIsConst0(pSop) )
+ return Dec_GraphCreateConst0();
+ if ( Abc_SopIsConst1(pSop) )
+ return Dec_GraphCreateConst1();
// derive the cover from the SOP representation
pCover = Dec_ConvertSopToMvc( pSop );
// make sure the cover is CCS free (should be done before CST)
Mvc_CoverContain( pCover );
+
// check for trivial functions
- if ( Mvc_CoverIsEmpty(pCover) )
- {
- Mvc_CoverFree( pCover );
- return Dec_GraphCreateConst0();
- }
- if ( Mvc_CoverIsTautology(pCover) )
- {
- Mvc_CoverFree( pCover );
- return Dec_GraphCreateConst1();
- }
+ assert( !Mvc_CoverIsEmpty(pCover) );
+ assert( !Mvc_CoverIsTautology(pCover) );
// perform CST
Mvc_CoverInverse( pCover ); // CST
@@ -334,6 +331,7 @@ Mvc_Cover_t * Dec_ConvertSopToMvc( char * pSop )
// start the cover
nVars = Abc_SopGetVarNum(pSop);
+ assert( nVars > 0 );
pMvc = Mvc_CoverAlloc( pMem, nVars * 2 );
// check the logic function of the node
Abc_SopForEachCube( pSop, nVars, pCube )