50 Lits[0] = toLitCond( iVarA, 1 );
51 Lits[1] = toLitCond( iVarB, 1 );
52 Lits[2] = toLitCond( iVarC, 1 );
56 Lits[0] = toLitCond( iVarA, 1 );
57 Lits[1] = toLitCond( iVarB, 0 );
58 Lits[2] = toLitCond( iVarC, 0 );
62 Lits[0] = toLitCond( iVarA, 0 );
63 Lits[1] = toLitCond( iVarB, 1 );
64 Lits[2] = toLitCond( iVarC, 0 );
68 Lits[0] = toLitCond( iVarA, 0 );
69 Lits[1] = toLitCond( iVarB, 0 );
70 Lits[2] = toLitCond( iVarC, 1 );
92 int Lits[2], status, iVar, i, c;
95 pObjPo = Aig_ManCo(
p->pAigWin, Aig_ManCoNum(
p->pAigWin) - Vec_PtrSize(
p->vDivs) - 1 );
96 Lits[0] = toLitCond(
p->pCnf->pVarNums[pObjPo->
Id], fInvert );
99 Vec_IntClear(
p->vProjVarsCnf );
102 assert(
p->pCnf->pVarNums[pObjPo->
Id] >= 0 );
103 Vec_IntPush(
p->vProjVarsCnf,
p->pCnf->pVarNums[pObjPo->
Id] );
105 assert( Vec_IntSize(
p->vProjVarsCnf) == Vec_PtrSize(
p->vDivs) );
114 for ( i = 0; i <
p->pCnf->nClauses; i++ )
130 if (
p->pPars->fOneHotness )
143 for ( i = 0; i <
p->pCnf->nLiterals; i++ )
144 p->pCnf->pClauses[0][i] += 2 *
p->pCnf->nVars;
146 for ( i = 0; i <
p->pCnf->nClauses; i++ )
155 if (
p->pPars->fOneHotness )
163 for ( i = 0; i <
p->pCnf->nLiterals; i++ )
164 p->pCnf->pClauses[0][i] -= 2 *
p->pCnf->nVars;
166 Lits[0] = 2 *
p->pCnf->nVars + lit_neg( Lits[0] );
176 for ( c = 0; c < nCands; c++ )
179 i = lit_var( pCands[c] ) - 2 *
p->pCnf->nVars;
181 iVar = Vec_IntEntry(
p->vProjVarsCnf, i );
201 Vec_IntClear(
p->vProjVarsSat );
209 Vec_IntPush(
p->vProjVarsSat, 2 *
p->pCnf->nVars + i );
211 assert( Vec_IntSize(
p->vProjVarsCnf) == Vec_IntSize(
p->vProjVarsSat) );
241 int c, i, * pGloVars;
247 status =
sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)
p->pPars->nBTLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
259 for ( c = 0; c < nCands; c++ )
262 i = lit_var( pCands[c] ) - 2 *
p->pCnf->nVars;
264 pGloVars[c] = Vec_IntEntry(
p->vProjVarsCnf, i );
270 assert( nFanins == nCands );
287 unsigned * pTruth, uTruth0[2], uTruth1[2];
292 uTruth1[0] = pTruth[0];
293 uTruth1[1] = pTruth[1];
297 uTruth1[0] = pTruth[0];
298 uTruth1[1] = pTruth[0];
303 uTruth0[0] = ~pTruth[0];
304 uTruth0[1] = ~pTruth[1];
308 uTruth0[0] = ~pTruth[0];
309 uTruth0[1] = ~pTruth[0];
311 nCounter = Extra_WordCountOnes( uTruth0[0] ^ uTruth1[0] );
312 nCounter += Extra_WordCountOnes( uTruth0[1] ^ uTruth1[1] );
340 int c, i, * pGloVars;
350 static int Counter = 0;
351 sprintf( FileName,
"cnf\\pj1_if6_mfs%03d.cnf", Counter++ );
356 status =
sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)
p->pPars->nBTLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
358 printf(
"File %s has UNSAT problem with %d conflicts.\n", FileName, (
int)pSat->
stats.
conflicts );
372 for ( c = 0; c < nCands; c++ )
375 i = lit_var( pCands[c] ) - 2 *
p->pCnf->nVars;
377 pGloVars[c] = Vec_IntEntry(
p->vProjVarsCnf, i );
383 assert( nFanins == nCands );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
struct Aig_Obj_t_ Aig_Obj_t
#define sat_solver_addclause
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
struct Hop_Obj_t_ Hop_Obj_t
Hop_Obj_t * Kit_GraphToHop(Hop_Man_t *pMan, Kit_Graph_t *pGraph)
struct Kit_Graph_t_ Kit_Graph_t
void Kit_GraphFree(Kit_Graph_t *pGraph)
Kit_Graph_t * Kit_TruthToGraph(unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
struct Mfs_Man_t_ Mfs_Man_t
int Abc_NtkAddOneHotness(Mfs_Man_t *p)
ABC_NAMESPACE_IMPL_START int Abc_MfsSatAddXor(sat_solver *pSat, int iVarA, int iVarB, int iVarC)
DECLARATIONS ///.
sat_solver * Abc_MfsCreateSolverResub(Mfs_Man_t *p, int *pCands, int nCands, int fInvert)
unsigned * Abc_NtkMfsInterplateTruth(Mfs_Man_t *p, int *pCands, int nCands, int fInvert)
Hop_Obj_t * Abc_NtkMfsInterplate(Mfs_Man_t *p, int *pCands, int nCands)
int Abc_NtkMfsInterplateEval(Mfs_Man_t *p, int *pCands, int nCands)
int * Int_ManSetGlobalVars(Int_Man_t *p, int nGloVars)
int Int_ManInterpolate(Int_Man_t *p, Sto_Man_t *pCnf, int fVerbose, unsigned **ppResult)
sat_solver * sat_solver_new(void)
void sat_solver_store_mark_clauses_a(sat_solver *s)
int sat_solver_simplify(sat_solver *s)
void sat_solver_setnvars(sat_solver *s, int n)
void sat_solver_store_alloc(sat_solver *s)
void sat_solver_store_mark_roots(sat_solver *s)
void * sat_solver_store_release(sat_solver *s)
void sat_solver_delete(sat_solver *s)
void Sat_SolverWriteDimacs(sat_solver *p, char *pFileName, lit *assumptionsBegin, lit *assumptionsEnd, int incrementVars)
void Sto_ManFree(Sto_Man_t *p)
struct Sto_Man_t_ Sto_Man_t
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)