diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-05-10 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-05-10 08:01:00 -0700 |
commit | 0f03f34924b64814791347c5dcf0633dd244d341 (patch) | |
tree | 0b72993e4638a476ab4dc292311e6f3af35ffb2c /src/aig/cnf/cnfMan.c | |
parent | e94ccfd3fb07d22ed426e0386ccf536e470744b7 (diff) | |
download | abc-0f03f34924b64814791347c5dcf0633dd244d341.tar.gz abc-0f03f34924b64814791347c5dcf0633dd244d341.tar.bz2 abc-0f03f34924b64814791347c5dcf0633dd244d341.zip |
Version abc80510
Diffstat (limited to 'src/aig/cnf/cnfMan.c')
-rw-r--r-- | src/aig/cnf/cnfMan.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/aig/cnf/cnfMan.c b/src/aig/cnf/cnfMan.c index 934aab1c..b6ed3da0 100644 --- a/src/aig/cnf/cnfMan.c +++ b/src/aig/cnf/cnfMan.c @@ -212,6 +212,31 @@ void Cnf_DataLift( Cnf_Dat_t * p, int nVarsPlus ) SeeAlso [] ***********************************************************************/ +void Cnf_DataPrint( Cnf_Dat_t * p, int fReadable ) +{ + FILE * pFile = stdout; + int * pLit, * pStop, i; + fprintf( pFile, "p cnf %d %d\n", p->nVars, p->nClauses ); + for ( i = 0; i < p->nClauses; i++ ) + { + for ( pLit = p->pClauses[i], pStop = p->pClauses[i+1]; pLit < pStop; pLit++ ) + fprintf( pFile, "%d ", fReadable? Cnf_Lit2Var2(*pLit) : Cnf_Lit2Var(*pLit) ); + fprintf( pFile, "\n" ); + } + fprintf( pFile, "\n" ); +} + +/**Function************************************************************* + + Synopsis [Writes CNF into a file.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ void Cnf_DataWriteIntoFile( Cnf_Dat_t * p, char * pFileName, int fReadable ) { FILE * pFile; |