From dfb065fa553e54fe00891fbeefb866be2c6dfa9d Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Tue, 26 Mar 2013 18:42:47 -0700 Subject: Fixing the dump of SAT solver into a CNF file. --- src/opt/mfs/mfsInter.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/opt') diff --git a/src/opt/mfs/mfsInter.c b/src/opt/mfs/mfsInter.c index 812e22cf..5e97f0b3 100644 --- a/src/opt/mfs/mfsInter.c +++ b/src/opt/mfs/mfsInter.c @@ -329,7 +329,8 @@ int Abc_NtkMfsInterplateEval( Mfs_Man_t * p, int * pCands, int nCands ) Hop_Obj_t * Abc_NtkMfsInterplate( Mfs_Man_t * p, int * pCands, int nCands ) { extern Hop_Obj_t * Kit_GraphToHop( Hop_Man_t * pMan, Kit_Graph_t * pGraph ); - + int fDumpFile = 0; + char FileName[32]; sat_solver * pSat; Sto_Man_t * pCnf = NULL; unsigned * puTruth; @@ -338,14 +339,23 @@ Hop_Obj_t * Abc_NtkMfsInterplate( Mfs_Man_t * p, int * pCands, int nCands ) int nFanins, status; int c, i, * pGloVars; // clock_t clk = clock(); - // p->nDcMints += Abc_NtkMfsInterplateEval( p, pCands, nCands ); // derive the SAT solver for interpolation pSat = Abc_MfsCreateSolverResub( p, pCands, nCands, 0 ); + // dump CNF file (remember to uncomment two-lit clases in clause_create_new() in 'satSolver.c') + if ( fDumpFile ) + { + static int Counter = 0; + sprintf( FileName, "cnf\\pj1_if6_mfs%03d.cnf", Counter++ ); + Sat_SolverWriteDimacs( pSat, FileName, NULL, NULL, 1 ); + } + // solve the problem 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 ); + if ( fDumpFile ) + printf( "File %s has UNSAT problem with %d conflicts.\n", FileName, (int)pSat->stats.conflicts ); if ( status != l_False ) { p->nTimeOuts++; -- cgit v1.2.3