56 printf(
"%s%d ", Abc_LitIsCompl(Lit) ?
"-":
"", Abc_Lit2Var(Lit) );
73 int w,
nWords = Abc_Truth6WordNum( nVars );
77 if ( Truth == 0 || ~Truth == 0 )
80 Vec_StrPush( vCnf, (
char)(Truth == 0) );
81 Vec_StrPush( vCnf, (
char)-1 );
88 for ( w = 0; w <
nWords; w++ )
93 Vec_StrPush( vCnf, (
char)1 );
94 Vec_StrPush( vCnf, (
char)-1 );
99 for ( w = 0; w <
nWords; w++ )
104 Vec_StrPush( vCnf, (
char)0 );
105 Vec_StrPush( vCnf, (
char)-1 );
111 int i, k, c, RetValue, Literal,
Cube, nCubes = 0;
114 Abc_TtFlipVar5( &Truth, nVars );
115 Abc_TtFlipVar5( pTruth, nVars );
116 for ( c = 0; c < 2; c ++ )
120 Truth = c ? ~Truth : Truth;
121 RetValue =
Kit_TruthIsop( (
unsigned *)&Truth, nVars, vCover, 0 );
126 for ( k = 0; k <
nWords; k++ )
127 pTruth[k] = ~pTruth[k];
128 RetValue =
Kit_TruthIsop( (
unsigned *)pTruth, nVars, vCover, 0 );
130 for ( k = 0; k <
nWords; k++ )
131 pTruth[k] = ~pTruth[k];
134 nCubes += Vec_IntSize( vCover );
137 for ( k = 0; k < nVars; k++ )
139 Literal = 3 & (
Cube >> (k << 1));
141 Vec_StrPush( vCnf, (
char)Abc_Var2Lit(k, 0) );
142 else if ( Literal == 2 )
143 Vec_StrPush( vCnf, (
char)Abc_Var2Lit(k, 1) );
144 else if ( Literal != 0 )
147 Vec_StrPush( vCnf, (
char)Abc_Var2Lit(nVars, c) );
148 Vec_StrPush( vCnf, (
char)-1 );
151 Abc_TtFlipVar5( pTruth, nVars );
174 vCnf = Vec_StrAlloc( 100 );
175 vCnfs = Vec_WecStart(
p->nObjs );
178 int Offset = Vec_IntEntry(
p->vStarts, i );
179 word * pRes = Vec_WrdSize(
p->vTruths2) ? Vec_WrdEntryP(
p->vTruths2, Offset ) : NULL;
180 nCubes =
Sfm_TruthToCnf( uTruth, pRes, Sfm_ObjFaninNum(
p, i),
p->vCover, vCnf );
181 vCnfBase = (
Vec_Str_t *)Vec_WecEntry( vCnfs, i );
182 Vec_StrGrow( vCnfBase, Vec_StrSize(vCnf) );
183 memcpy( Vec_StrArray(vCnfBase), Vec_StrArray(vCnf), (
size_t)Vec_StrSize(vCnf) );
184 vCnfBase->
nSize = Vec_StrSize(vCnf);
206 assert( Vec_StrEntry(vCnf, 1) != -1 || Vec_IntSize(vFaninMap) == 1 );
207 Vec_WecClear( vRes );
208 vClause = Vec_WecPushLevel( vRes );
211 if ( (
int)Entry == -1 )
213 vClause = Vec_WecPushLevel( vRes );
216 Lit = Abc_Lit2LitV( Vec_IntArray(vFaninMap), (
int)Entry );
217 Lit = Abc_LitNotCond( Lit, Abc_Lit2Var(Lit) == iPivotVar );
218 Vec_IntPush( vClause, Lit );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
struct Vec_Str_t_ Vec_Str_t
unsigned __int64 word
DECLARATIONS ///.
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
int Sfm_TruthToCnf(word Truth, word *pTruth, int nVars, Vec_Int_t *vCover, Vec_Str_t *vCnf)
void Sfm_TranslateCnf(Vec_Wec_t *vRes, Vec_Str_t *vCnf, Vec_Int_t *vFaninMap, int iPivotVar)
ABC_NAMESPACE_IMPL_START void Sfm_PrintCnf(Vec_Str_t *vCnf)
DECLARATIONS ///.
Vec_Wec_t * Sfm_CreateCnf(Sfm_Ntk_t *p)
typedefABC_NAMESPACE_HEADER_START struct Sfm_Ntk_t_ Sfm_Ntk_t
INCLUDES ///.
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
#define Vec_StrForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
#define Vec_WrdForEachEntryStartStop(vVec, Entry, i, Start, Stop)