summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-09-28 12:10:13 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-09-28 12:10:13 -0700
commit98e377bdfff98a99f4c765a52cfa8023b4f0eb60 (patch)
tree0bd75202c2258fc40245998065b90541a8047e27 /src
parentfbc9c00fd15057c6372e399cd6bf443da70e490c (diff)
downloadabc-98e377bdfff98a99f4c765a52cfa8023b4f0eb60.tar.gz
abc-98e377bdfff98a99f4c765a52cfa8023b4f0eb60.tar.bz2
abc-98e377bdfff98a99f4c765a52cfa8023b4f0eb60.zip
Adding features to CNF generation.
Diffstat (limited to 'src')
-rw-r--r--src/aig/gia/giaMf.c4
-rw-r--r--src/base/io/io.c22
2 files changed, 18 insertions, 8 deletions
diff --git a/src/aig/gia/giaMf.c b/src/aig/gia/giaMf.c
index 331612a2..f52cb7ec 100644
--- a/src/aig/gia/giaMf.c
+++ b/src/aig/gia/giaMf.c
@@ -1643,11 +1643,11 @@ Cnf_Dat_t * Mf_ManGenerateCnf( Gia_Man_t * pGia, int nLutSize, int fCnfObjIds, i
// Cnf_DataPrint( (Cnf_Dat_t *)pGia->pData, 1 );
return pGia->pData;
}
-void Mf_ManDumpCnf( Gia_Man_t * p, char * pFileName, int nLutSize, int fVerbose )
+void Mf_ManDumpCnf( Gia_Man_t * p, char * pFileName, int nLutSize, int fCnfObjIds, int fAddOrCla, int fVerbose )
{
abctime clk = Abc_Clock();
Cnf_Dat_t * pCnf;
- pCnf = Mf_ManGenerateCnf( p, nLutSize, 0, 1, fVerbose );
+ pCnf = Mf_ManGenerateCnf( p, nLutSize, fCnfObjIds, fAddOrCla, fVerbose );
Cnf_DataWriteIntoFile( pCnf, pFileName, 0, NULL, NULL );
// if ( fVerbose )
{
diff --git a/src/base/io/io.c b/src/base/io/io.c
index 257acc30..39c08db4 100644
--- a/src/base/io/io.c
+++ b/src/base/io/io.c
@@ -1939,14 +1939,16 @@ usage:
int IoCommandWriteCnf2( Abc_Frame_t * pAbc, int argc, char **argv )
{
extern void Jf_ManDumpCnf( Gia_Man_t * p, char * pFileName, int fVerbose );
- extern void Mf_ManDumpCnf( Gia_Man_t * p, char * pFileName, int nLutSize, int fVerbose );
+ extern void Mf_ManDumpCnf( Gia_Man_t * p, char * pFileName, int nLutSize, int fCnfObjIds, int fAddOrCla, int fVerbose );
FILE * pFile;
char * pFileName;
- int nLutSize = 6;
- int fNewAlgo = 1;
+ int nLutSize = 6;
+ int fNewAlgo = 1;
+ int fCnfObjIds = 0;
+ int fAddOrCla = 1;
int c, fVerbose = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "Kavh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "Kaiovh" ) ) != EOF )
{
switch ( c )
{
@@ -1962,6 +1964,12 @@ int IoCommandWriteCnf2( Abc_Frame_t * pAbc, int argc, char **argv )
case 'a':
fNewAlgo ^= 1;
break;
+ case 'i':
+ fCnfObjIds ^= 1;
+ break;
+ case 'o':
+ fAddOrCla ^= 1;
+ break;
case 'v':
fVerbose ^= 1;
break;
@@ -2003,16 +2011,18 @@ int IoCommandWriteCnf2( Abc_Frame_t * pAbc, int argc, char **argv )
}
fclose( pFile );
if ( fNewAlgo )
- Mf_ManDumpCnf( pAbc->pGia, pFileName, nLutSize, fVerbose );
+ Mf_ManDumpCnf( pAbc->pGia, pFileName, nLutSize, fCnfObjIds, fAddOrCla, fVerbose );
else
Jf_ManDumpCnf( pAbc->pGia, pFileName, fVerbose );
return 0;
usage:
- fprintf( pAbc->Err, "usage: &write_cnf [-Kavh] <file>\n" );
+ fprintf( pAbc->Err, "usage: &write_cnf [-Kaiovh] <file>\n" );
fprintf( pAbc->Err, "\t writes CNF produced by a new generator\n" );
fprintf( pAbc->Err, "\t-K <num> : the LUT size (3 <= num <= 8) [default = %d]\n", nLutSize );
fprintf( pAbc->Err, "\t-a : toggle using new algorithm [default = %s]\n", fNewAlgo? "yes" : "no" );
+ fprintf( pAbc->Err, "\t-i : toggle using AIG object IDs as CNF variables [default = %s]\n", fCnfObjIds? "yes" : "no" );
+ fprintf( pAbc->Err, "\t-o : toggle adding OR clause for the outputs [default = %s]\n", fAddOrCla? "yes" : "no" );
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes" : "no" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );