Commit 73dcdab6 authored by Alan Mishchenko's avatar Alan Mishchenko

Adding solver type in &sat.

parent 8066fdbc
...@@ -36123,10 +36123,21 @@ int Abc_CommandAbc9Sat( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -36123,10 +36123,21 @@ int Abc_CommandAbc9Sat( Abc_Frame_t * pAbc, int argc, char ** argv )
int fNewSolver = 0, fCSat = 0, f0Proved = 0; int fNewSolver = 0, fCSat = 0, f0Proved = 0;
Cec_ManSatSetDefaultParams( pPars ); Cec_ManSatSetDefaultParams( pPars );
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "CSNanmtcxzvh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "JCSNanmtcxzvh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
case 'J':
if ( globalUtilOptind >= argc )
{
Abc_Print( -1, "Command line switch \"-J\" should be followed by an integer.\n" );
goto usage;
}
pPars->SolverType = atoi(argv[globalUtilOptind]);
globalUtilOptind++;
if ( pPars->SolverType < 0 )
goto usage;
break;
case 'C': case 'C':
if ( globalUtilOptind >= argc ) if ( globalUtilOptind >= argc )
{ {
...@@ -36222,8 +36233,9 @@ int Abc_CommandAbc9Sat( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -36222,8 +36233,9 @@ int Abc_CommandAbc9Sat( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: &sat [-CSN <num>] [-anmctxzvh]\n" ); Abc_Print( -2, "usage: &sat [-JCSN <num>] [-anmctxzvh]\n" );
Abc_Print( -2, "\t performs SAT solving for the combinational outputs\n" ); Abc_Print( -2, "\t performs SAT solving for the combinational outputs\n" );
Abc_Print( -2, "\t-J num : the SAT solver type [default = %d]\n", pPars->SolverType );
Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit ); Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
Abc_Print( -2, "\t-S num : the min number of variables to recycle the solver [default = %d]\n", pPars->nSatVarMax ); Abc_Print( -2, "\t-S num : the min number of variables to recycle the solver [default = %d]\n", pPars->nSatVarMax );
Abc_Print( -2, "\t-N num : the min number of calls to recycle the solver [default = %d]\n", pPars->nCallsRecycle ); Abc_Print( -2, "\t-N num : the min number of calls to recycle the solver [default = %d]\n", pPars->nCallsRecycle );
...@@ -43,6 +43,7 @@ ABC_NAMESPACE_HEADER_START ...@@ -43,6 +43,7 @@ ABC_NAMESPACE_HEADER_START
typedef struct Cec_ParSat_t_ Cec_ParSat_t; typedef struct Cec_ParSat_t_ Cec_ParSat_t;
struct Cec_ParSat_t_ struct Cec_ParSat_t_
{ {
int SolverType; // SAT solver type
int nBTLimit; // conflict limit at a node int nBTLimit; // conflict limit at a node
int nSatVarMax; // the max number of SAT variables int nSatVarMax; // the max number of SAT variables
int nCallsRecycle; // calls to perform before recycling SAT solver int nCallsRecycle; // calls to perform before recycling SAT solver
......
...@@ -45,6 +45,7 @@ ABC_NAMESPACE_IMPL_START ...@@ -45,6 +45,7 @@ ABC_NAMESPACE_IMPL_START
void Cec_ManSatSetDefaultParams( Cec_ParSat_t * p ) void Cec_ManSatSetDefaultParams( Cec_ParSat_t * p )
{ {
memset( p, 0, sizeof(Cec_ParSat_t) ); memset( p, 0, sizeof(Cec_ParSat_t) );
p->SolverType = -1; // SAT solver type
p->nBTLimit = 100; // conflict limit at a node p->nBTLimit = 100; // conflict limit at a node
p->nSatVarMax = 2000; // the max number of SAT variables p->nSatVarMax = 2000; // the max number of SAT variables
p->nCallsRecycle = 200; // calls to perform before recycling SAT solver p->nCallsRecycle = 200; // calls to perform before recycling SAT solver
...@@ -237,7 +238,10 @@ Gia_Man_t * Cec_ManSatSolving( Gia_Man_t * pAig, Cec_ParSat_t * pPars, int f0Pro ...@@ -237,7 +238,10 @@ Gia_Man_t * Cec_ManSatSolving( Gia_Man_t * pAig, Cec_ParSat_t * pPars, int f0Pro
Gia_Man_t * pNew; Gia_Man_t * pNew;
Cec_ManPat_t * pPat; Cec_ManPat_t * pPat;
pPat = Cec_ManPatStart(); pPat = Cec_ManPatStart();
Cec_ManSatSolve( pPat, pAig, pPars, NULL, NULL, NULL, f0Proved ); if ( pPars->SolverType == -1 )
Cec_ManSatSolve( pPat, pAig, pPars, NULL, NULL, NULL, f0Proved );
else
CecG_ManSatSolve( pPat, pAig, pPars, f0Proved );
// pNew = Gia_ManDupDfsSkip( pAig ); // pNew = Gia_ManDupDfsSkip( pAig );
pNew = Gia_ManCleanup( pAig ); pNew = Gia_ManCleanup( pAig );
Cec_ManPatStop( pPat ); Cec_ManPatStop( pPat );
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
#include "sat/bsat/satSolver.h" #include "sat/bsat/satSolver.h"
#include "sat/glucose2/AbcGlucose2.h"
#include "misc/bar/bar.h" #include "misc/bar/bar.h"
#include "aig/gia/gia.h" #include "aig/gia/gia.h"
#include "cec.h" #include "cec.h"
...@@ -80,7 +81,8 @@ struct Cec_ManSat_t_ ...@@ -80,7 +81,8 @@ struct Cec_ManSat_t_
Gia_Man_t * pAig; // the AIG whose outputs are considered Gia_Man_t * pAig; // the AIG whose outputs are considered
Vec_Int_t * vStatus; // status for each output Vec_Int_t * vStatus; // status for each output
// SAT solving // SAT solving
sat_solver * pSat; // recyclable SAT solver sat_solver * pSat; // recyclable SAT solver (MiniSAT)
bmcg2_sat_solver*pSat2; // recyclable SAT solver (Glucose)
int nSatVars; // the counter of SAT variables int nSatVars; // the counter of SAT variables
int * pSatVars; // mapping of each node into its SAT var int * pSatVars; // mapping of each node into its SAT var
Vec_Ptr_t * vUsedNodes; // nodes whose SAT vars are assigned Vec_Ptr_t * vUsedNodes; // nodes whose SAT vars are assigned
...@@ -212,6 +214,8 @@ extern int Cec_ManSatCheckNode( Cec_ManSat_t * p, Gia_Obj_t * p ...@@ -212,6 +214,8 @@ extern int Cec_ManSatCheckNode( Cec_ManSat_t * p, Gia_Obj_t * p
extern int Cec_ManSatCheckNodeTwo( Cec_ManSat_t * p, Gia_Obj_t * pObj1, Gia_Obj_t * pObj2 ); extern int Cec_ManSatCheckNodeTwo( Cec_ManSat_t * p, Gia_Obj_t * pObj1, Gia_Obj_t * pObj2 );
extern void Cec_ManSavePattern( Cec_ManSat_t * p, Gia_Obj_t * pObj1, Gia_Obj_t * pObj2 ); extern void Cec_ManSavePattern( Cec_ManSat_t * p, Gia_Obj_t * pObj1, Gia_Obj_t * pObj2 );
extern Vec_Int_t * Cec_ManSatReadCex( Cec_ManSat_t * p ); extern Vec_Int_t * Cec_ManSatReadCex( Cec_ManSat_t * p );
/*=== cecSolveG.c ============================================================*/
extern void CecG_ManSatSolve( Cec_ManPat_t * pPat, Gia_Man_t * pAig, Cec_ParSat_t * pPars, int f0Proved );
/*=== ceFraeep.c ============================================================*/ /*=== ceFraeep.c ============================================================*/
extern Gia_Man_t * Cec_ManFraSpecReduction( Cec_ManFra_t * p ); extern Gia_Man_t * Cec_ManFraSpecReduction( Cec_ManFra_t * p );
extern int Cec_ManFraClassesUpdate( Cec_ManFra_t * p, Cec_ManSim_t * pSim, Cec_ManPat_t * pPat, Gia_Man_t * pNew ); extern int Cec_ManFraClassesUpdate( Cec_ManFra_t * p, Cec_ManSim_t * pSim, Cec_ManPat_t * pPat, Gia_Man_t * pNew );
......
This diff is collapsed.
...@@ -11,6 +11,7 @@ SRC += src/proof/cec/cecCec.c \ ...@@ -11,6 +11,7 @@ SRC += src/proof/cec/cecCec.c \
src/proof/cec/cecSatG2.c \ src/proof/cec/cecSatG2.c \
src/proof/cec/cecSeq.c \ src/proof/cec/cecSeq.c \
src/proof/cec/cecSolve.c \ src/proof/cec/cecSolve.c \
src/proof/cec/cecSolveG.c \
src/proof/cec/cecSplit.c \ src/proof/cec/cecSplit.c \
src/proof/cec/cecSynth.c \ src/proof/cec/cecSynth.c \
src/proof/cec/cecSweep.c src/proof/cec/cecSweep.c
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment