diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2005-09-15 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2005-09-15 08:01:00 -0700 |
commit | 2d782f7bc966fb19c9d849ac70366709f04d25d8 (patch) | |
tree | d11e13b3c07e2282be6493cf4d7e3b808e6b5c2f /src/sat/fraig | |
parent | 0f6eeaea3c9d8fb7f4b4aa97f6e640d39e3c0afa (diff) | |
download | abc-2d782f7bc966fb19c9d849ac70366709f04d25d8.tar.gz abc-2d782f7bc966fb19c9d849ac70366709f04d25d8.tar.bz2 abc-2d782f7bc966fb19c9d849ac70366709f04d25d8.zip |
Version abc50915
Diffstat (limited to 'src/sat/fraig')
-rw-r--r-- | src/sat/fraig/fraigSat.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/src/sat/fraig/fraigSat.c b/src/sat/fraig/fraigSat.c index fcb1018f..d54a3119 100644 --- a/src/sat/fraig/fraigSat.c +++ b/src/sat/fraig/fraigSat.c @@ -123,26 +123,32 @@ void Fraig_ManProveMiter( Fraig_Man_t * p ) int Fraig_ManCheckMiter( Fraig_Man_t * p ) { Fraig_Node_t * pNode; + int i; FREE( p->pModel ); - // get the output node (it can be complemented!) - pNode = p->vOutputs->pArray[0]; - // if the miter is constant 0, the problem is UNSAT - if ( pNode == Fraig_Not(p->pConst1) ) - return 1; - // consider the special case when the miter is constant 1 - if ( pNode == p->pConst1 ) + for ( i = 0; i < p->vOutputs->nSize; i++ ) { - // in this case, any counter example will do to distinquish it from constant 0 - // here we pick the counter example composed of all zeros - p->pModel = Fraig_ManAllocCounterExample( p ); - return 0; + // get the output node (it can be complemented!) + pNode = p->vOutputs->pArray[i]; + // if the miter is constant 0, the problem is UNSAT + if ( pNode == Fraig_Not(p->pConst1) ) + continue; + // consider the special case when the miter is constant 1 + if ( pNode == p->pConst1 ) + { + // in this case, any counter example will do to distinquish it from constant 0 + // here we pick the counter example composed of all zeros + p->pModel = Fraig_ManAllocCounterExample( p ); + return 0; + } + // save the counter example + p->pModel = Fraig_ManSaveCounterExample( p, pNode ); + // if the model is not found, return undecided + if ( p->pModel == NULL ) + return -1; + else + return 0; } - // save the counter example - p->pModel = Fraig_ManSaveCounterExample( p, pNode ); - // if the model is not found, return undecided - if ( p->pModel == NULL ) - return -1; - return 0; + return 1; } |