Skip to content

Commit 839f3e1

Browse files
committed
Experiments with mapping.
1 parent aaba1b9 commit 839f3e1

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

src/aig/gia/giaSatLut.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,27 +1539,27 @@ int Gia_ManDumpCnf( char * pFileName, Vec_Str_t * vStr, int nVars )
15391539
int Gia_ManDumpCnf2( Vec_Str_t * vStr, int nVars, int argc, char ** argv, abctime Time, int Status )
15401540
{
15411541
Vec_Str_t * vFileName = Vec_StrAlloc( 100 ); int c;
1542-
Vec_StrPrintF( vFileName, "%s", argv[0] );
1542+
Vec_StrPrintF( vFileName, "%s", argv[0] + (argv[0][0] == '&') );
15431543
for ( c = 1; c < argc; c++ )
15441544
Vec_StrPrintF( vFileName, "_%s", argv[c] + (argv[c][0] == '-') );
15451545
Vec_StrPrintF( vFileName, ".cnf" );
15461546
Vec_StrPush( vFileName, '\0' );
15471547
FILE * pFile = fopen( Vec_StrArray(vFileName), "wb" );
15481548
if ( pFile == NULL ) { printf( "Cannot open output file \"%s\".\n", Vec_StrArray(vFileName) ); Vec_StrFree(vFileName); return 0; }
15491549
Vec_StrFree(vFileName);
1550-
fprintf( pFile, "c ABC command line: \"" );
1550+
fprintf( pFile, "c This file was generated by ABC command: \"" );
15511551
fprintf( pFile, "%s", argv[0] );
15521552
for ( c = 1; c < argc; c++ )
15531553
fprintf( pFile, " %s", argv[c] );
1554-
fprintf( pFile, "\" " );
1554+
fprintf( pFile, "\" on %s\n", Gia_TimeStamp() );
1555+
fprintf( pFile, "c Cardinality CDCL (https://github.com/jreeves3/Cardinality-CDCL) found it to be " );
15551556
if ( Status == 1 )
1556-
fprintf( pFile, "UNSAT after " );
1557+
fprintf( pFile, "UNSAT" );
15571558
if ( Status == 0 )
1558-
fprintf( pFile, "SAT after " );
1559+
fprintf( pFile, "SAT" );
15591560
if ( Status == -1 )
1560-
fprintf( pFile, "UNDECIDED after " );
1561-
fprintf( pFile, "%.2f sec by CaDiCal on ", 1.0*((double)(Time))/((double)CLOCKS_PER_SEC) );
1562-
fprintf( pFile, "%s\n", Gia_TimeStamp() );
1561+
fprintf( pFile, "UNDECIDED" );
1562+
fprintf( pFile, " in %.2f sec\n", 1.0*((double)(Time))/((double)CLOCKS_PER_SEC) );
15631563
fprintf( pFile, "p knf %d %d\n%s\n", nVars, Vec_StrCountEntry(vStr, '\n'), Vec_StrArray(vStr) );
15641564
fclose( pFile );
15651565
return 1;
@@ -1687,16 +1687,23 @@ Vec_Str_t * Gia_ManKSatCnf( int * pMap, int nIns, int nNodes, int nBound, int fM
16871687
// fanins are connected once
16881688
for ( n = nIns; n < nIns+nNodes; n++ )
16891689
for ( f = 0; f < 2; f++ ) {
1690+
16901691
nLits = 0;
16911692
for ( i = 0; i < n; i++ )
16921693
pLits[nLits++] = Abc_Var2Lit( Gia_KSatVarFan(pMap, n, f, i), 0 );
16931694
Gia_SatDumpClause( vStr, pLits, nLits );
1695+
/*
16941696
for ( i = 0; i < n; i++ )
16951697
for ( j = 0; j < i; j++ ) {
16961698
pLits[0] = Abc_Var2Lit( Gia_KSatVarFan(pMap, n, f, i), 1 );
16971699
pLits[1] = Abc_Var2Lit( Gia_KSatVarFan(pMap, n, f, j), 1 );
16981700
Gia_SatDumpClause( vStr, pLits, 2 );
16991701
}
1702+
*/
1703+
Vec_StrPrintF( vStr, "k %d ", n-1 );
1704+
for ( i = 0; i < n; i++ )
1705+
pLits[i] = Abc_Var2Lit( Gia_KSatVarFan(pMap, n, f, i), 1 );
1706+
Gia_SatDumpClause( vStr, pLits, n );
17001707
}
17011708
for ( n = nIns; n < nIns+nNodes; n++ ) {
17021709
// fanins are equal

src/base/abci/abc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55359,7 +55359,7 @@ int Abc_CommandAbc9GenRel( Abc_Frame_t * pAbc, int argc, char ** argv )
5535955359
Abc_Print( -2, "\t generates Boolean relation for the given logic window\n" );
5536055360
Abc_Print( -2, "\t-I list : comma-separated list of window inputs [default = undefined]\n" );
5536155361
Abc_Print( -2, "\t-O list : comma-separated list of window outputs [default = undefined]\n" );
55362-
Abc_Print( -2, "\t-v : toggles printing verbose information [default = %d]\n", fVerbose ? "yes": "no" );
55362+
Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose ? "yes": "no" );
5536355363
Abc_Print( -2, "\t-h : print the command usage\n");
5536455364
Abc_Print( -2, "\t<file> : the output file name (PLA format extended to represented Boolean relations)\n");
5536555365
return 1;

0 commit comments

Comments
 (0)