src/sat/bsat/satTrace.c File Reference

#include <stdio.h>
#include <assert.h>
#include "satSolver.h"
Include dependency graph for satTrace.c:

Go to the source code of this file.

Functions

void Sat_SolverTraceStart (sat_solver *pSat, char *pName)
void Sat_SolverTraceStop (sat_solver *pSat)
void Sat_SolverTraceWrite (sat_solver *pSat, int *pBeg, int *pEnd, int fRoot)

Function Documentation

void Sat_SolverTraceStart ( sat_solver pSat,
char *  pName 
)

CFile****************************************************************

FileName [satTrace.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [SAT sat_solver.]

Synopsis [Records the trace of SAT solving in the CNF form.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
satTrace.c,v 1.4 2005/09/16 22:55:03 casem Exp

] DECLARATIONS /// FUNCTION DEFINITIONS ///Function*************************************************************

Synopsis [Start the trace recording.]

Description []

SideEffects []

SeeAlso []

Definition at line 52 of file satTrace.c.

00053 {
00054     assert( pSat->pFile == NULL );
00055     pSat->pFile = fopen( pName, "w" );
00056     fprintf( pSat->pFile, "                                        \n" );
00057     pSat->nClauses = 0;
00058     pSat->nRoots = 0;
00059 }   

void Sat_SolverTraceStop ( sat_solver pSat  ) 

Function*************************************************************

Synopsis [Stops the trace recording.]

Description []

SideEffects []

SeeAlso []

Definition at line 72 of file satTrace.c.

00073 {
00074     if ( pSat->pFile == NULL )
00075         return;
00076     rewind( pSat->pFile );
00077     fprintf( pSat->pFile, "p %d %d %d", sat_solver_nvars(pSat), pSat->nClauses, pSat->nRoots );
00078     fclose( pSat->pFile );
00079     pSat->pFile = NULL;
00080 }

void Sat_SolverTraceWrite ( sat_solver pSat,
int *  pBeg,
int *  pEnd,
int  fRoot 
)

Function*************************************************************

Synopsis [Writes one clause into the trace file.]

Description []

SideEffects []

SeeAlso []

Definition at line 94 of file satTrace.c.

00095 {
00096     if ( pSat->pFile == NULL )
00097         return;
00098     pSat->nClauses++;
00099     pSat->nRoots += fRoot;
00100     for ( ; pBeg < pEnd ; pBeg++ )
00101         fprintf( pSat->pFile, " %d", lit_print(*pBeg) );
00102     fprintf( pSat->pFile, " 0\n" );
00103 }


Generated on Tue Jan 5 12:19:37 2010 for abc70930 by  doxygen 1.6.1