summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-10-20 11:00:11 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-10-20 11:00:11 -0700
commitbae5e26fb5d600ffec17e5c3bebc12f6219be920 (patch)
treeca2c94802bbca2a47b48031219e0cd0bbc250de2 /src/base
parent8de80e673a1400f925292f2482c28f413a41a205 (diff)
downloadabc-bae5e26fb5d600ffec17e5c3bebc12f6219be920.tar.gz
abc-bae5e26fb5d600ffec17e5c3bebc12f6219be920.tar.bz2
abc-bae5e26fb5d600ffec17e5c3bebc12f6219be920.zip
Adding switch &qbf -q to quantify functional variables.
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abci/abc.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 2086faa5..55c523c1 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -35690,6 +35690,7 @@ usage:
***********************************************************************/
int Abc_CommandAbc9Qbf( Abc_Frame_t * pAbc, int argc, char ** argv )
{
+ extern Gia_Man_t * Gia_QbfQuantify( Gia_Man_t * p, int nPars );
extern void Gia_QbfDumpFile( Gia_Man_t * pGia, int nPars );
extern int Gia_QbfSolve( Gia_Man_t * pGia, int nPars, int nIterLimit, int nConfLimit, int nTimeOut, int fVerbose );
int c, nPars = -1;
@@ -35697,9 +35698,10 @@ int Abc_CommandAbc9Qbf( Abc_Frame_t * pAbc, int argc, char ** argv )
int nConfLimit = 0;
int nTimeOut = 0;
int fDumpCnf = 0;
+ int fQuantX = 0;
int fVerbose = 1;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "PICTdvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "PICTdqvh" ) ) != EOF )
{
switch ( c )
{
@@ -35750,6 +35752,9 @@ int Abc_CommandAbc9Qbf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'd':
fDumpCnf ^= 1;
break;
+ case 'q':
+ fQuantX ^= 1;
+ break;
case 'v':
fVerbose ^= 1;
break;
@@ -35779,6 +35784,18 @@ int Abc_CommandAbc9Qbf( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "The number of parameter variables is invalid (should be > 0 and < PI num).\n" );
return 1;
}
+ if ( fQuantX )
+ {
+ Gia_Man_t * pTemp;
+ if ( Gia_ManPiNum(pAbc->pGia) - nPars > 16 )
+ {
+ Abc_Print( -1, "Cannot quantify more than 16 variables.\n" );
+ return 1;
+ }
+ pTemp = Gia_QbfQuantify( pAbc->pGia, nPars );
+ Abc_FrameUpdateGia( pAbc, pTemp );
+ return 0;
+ }
if ( fDumpCnf )
Gia_QbfDumpFile( pAbc->pGia, nPars );
else
@@ -35786,13 +35803,14 @@ int Abc_CommandAbc9Qbf( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- Abc_Print( -2, "usage: &qbf [-PICT num] [-dvh]\n" );
+ Abc_Print( -2, "usage: &qbf [-PICT num] [-dqvh]\n" );
Abc_Print( -2, "\t solves QBF problem EpVxM(p,x)\n" );
Abc_Print( -2, "\t-P num : number of parameters p (should be the first PIs) [default = %d]\n", nPars );
Abc_Print( -2, "\t-I num : quit after the given iteration even if unsolved [default = %d]\n", nIterLimit );
Abc_Print( -2, "\t-C num : conflict limit per problem [default = %d]\n", nConfLimit );
Abc_Print( -2, "\t-T num : global timeout [default = %d]\n", nTimeOut );
Abc_Print( -2, "\t-d : toggle dumping QDIMACS file instead of solving [default = %s]\n", fDumpCnf? "yes": "no" );
+ Abc_Print( -2, "\t-q : toggle quantifying functions variables [default = %s]\n", fQuantX? "yes": "no" );
Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;