abc-master
|
Go to the source code of this file.
Macros | |
#define | MSAT_VAR2LIT(v, s) (2*(v)+(s)) |
#define | MSAT_LITNOT(l) ((l)^1) |
#define | MSAT_LITSIGN(l) ((l)&1) |
#define | MSAT_LIT2VAR(l) ((l)>>1) |
Typedefs | |
typedef typedefABC_NAMESPACE_HEADER_START struct Msat_Solver_t_ | Msat_Solver_t |
INCLUDES ///. More... | |
typedef struct Msat_IntVec_t_ | Msat_IntVec_t |
typedef struct Msat_ClauseVec_t_ | Msat_ClauseVec_t |
typedef struct Msat_VarHeap_t_ | Msat_VarHeap_t |
Enumerations | |
enum | Msat_Type_t { MSAT_FALSE = -1, MSAT_UNKNOWN = 0, MSAT_TRUE = 1 } |
typedef struct Msat_ClauseVec_t_ Msat_ClauseVec_t |
typedef struct Msat_IntVec_t_ Msat_IntVec_t |
typedef typedefABC_NAMESPACE_HEADER_START struct Msat_Solver_t_ Msat_Solver_t |
INCLUDES ///.
CFile****************************************************************
FileName [msat.h]
PackageName [A C version of SAT solver MINISAT, originally developed in C++ by Niklas Een and Niklas Sorensson, Chalmers University of Technology, Sweden: http://www.cs.chalmers.se/~een/Satzoo.]
Synopsis [External definitions of the solver.]
Author [Alan Mishchenko alanm] i@ee cs.be rkel ey.ed u
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - January 1, 2004.]
Revision [
]PARAMETERS ///STRUCTURE DEFINITIONS ///
typedef struct Msat_VarHeap_t_ Msat_VarHeap_t |
enum Msat_Type_t |
Msat_IntVec_t* Msat_IntVecAlloc | ( | int | nCap | ) |
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Allocates a vector with the given capacity.]
Description []
SideEffects []
SeeAlso []
Definition at line 48 of file msatVec.c.
Msat_IntVec_t* Msat_IntVecAllocArray | ( | int * | pArray, |
int | nSize | ||
) |
Function*************************************************************
Synopsis [Creates the vector from an integer array of the given size.]
Description []
SideEffects []
SeeAlso []
Definition at line 71 of file msatVec.c.
Msat_IntVec_t* Msat_IntVecAllocArrayCopy | ( | int * | pArray, |
int | nSize | ||
) |
Function*************************************************************
Synopsis [Creates the vector from an integer array of the given size.]
Description []
SideEffects []
SeeAlso []
Definition at line 92 of file msatVec.c.
void Msat_IntVecClear | ( | Msat_IntVec_t * | p | ) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Msat_IntVec_t* Msat_IntVecDup | ( | Msat_IntVec_t * | pVec | ) |
Function*************************************************************
Synopsis [Duplicates the integer array.]
Description []
SideEffects []
SeeAlso []
Definition at line 114 of file msatVec.c.
Msat_IntVec_t* Msat_IntVecDupArray | ( | Msat_IntVec_t * | pVec | ) |
Function*************************************************************
Synopsis [Transfers the array into another vector.]
Description []
SideEffects []
SeeAlso []
Definition at line 136 of file msatVec.c.
void Msat_IntVecFill | ( | Msat_IntVec_t * | p, |
int | nSize, | ||
int | Entry | ||
) |
void Msat_IntVecFree | ( | Msat_IntVec_t * | p | ) |
void Msat_IntVecGrow | ( | Msat_IntVec_t * | p, |
int | nCapMin | ||
) |
int Msat_IntVecPop | ( | Msat_IntVec_t * | p | ) |
void Msat_IntVecPush | ( | Msat_IntVec_t * | p, |
int | Entry | ||
) |
int Msat_IntVecPushUnique | ( | Msat_IntVec_t * | p, |
int | Entry | ||
) |
void Msat_IntVecPushUniqueOrder | ( | Msat_IntVec_t * | p, |
int | Entry, | ||
int | fIncrease | ||
) |
Function*************************************************************
Synopsis [Inserts the element while sorting in the increasing order.]
Description []
SideEffects []
SeeAlso []
Definition at line 395 of file msatVec.c.
int* Msat_IntVecReadArray | ( | Msat_IntVec_t * | p | ) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
int Msat_IntVecReadEntry | ( | Msat_IntVec_t * | p, |
int | i | ||
) |
int Msat_IntVecReadEntryLast | ( | Msat_IntVec_t * | p | ) |
int Msat_IntVecReadSize | ( | Msat_IntVec_t * | p | ) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
int* Msat_IntVecReleaseArray | ( | Msat_IntVec_t * | p | ) |
void Msat_IntVecShrink | ( | Msat_IntVec_t * | p, |
int | nSizeNew | ||
) |
void Msat_IntVecSort | ( | Msat_IntVec_t * | p, |
int | fReverse | ||
) |
Function*************************************************************
Synopsis [Sorting the entries by their integer value.]
Description []
SideEffects []
SeeAlso []
Definition at line 442 of file msatVec.c.
void Msat_IntVecWriteEntry | ( | Msat_IntVec_t * | p, |
int | i, | ||
int | Entry | ||
) |
int Msat_SolverAddClause | ( | Msat_Solver_t * | p, |
Msat_IntVec_t * | vLits | ||
) |
Function*************************************************************
Synopsis [Adds one clause to the solver's clause database.]
Description []
SideEffects []
SeeAlso []
Definition at line 65 of file msatSolverCore.c.
int Msat_SolverAddVar | ( | Msat_Solver_t * | p, |
int | Level | ||
) |
DECLARATIONS ///.
CFile****************************************************************
FileName [msatSolverCore.c]
PackageName [A C version of SAT solver MINISAT, originally developed in C++ by Niklas Een and Niklas Sorensson, Chalmers University of Technology, Sweden: http://www.cs.chalmers.se/~een/Satzoo.]
Synopsis [The SAT solver core procedures.]
Author [Alan Mishchenko alanm] i@ee cs.be rkel ey.ed u
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - January 1, 2004.]
Revision [
]FUNCTION DEFINITIONS /// Function*************************************************************
Synopsis [Adds one variable to the solver.]
Description []
SideEffects []
SeeAlso []
Definition at line 45 of file msatSolverCore.c.
Msat_Solver_t* Msat_SolverAlloc | ( | int | nVarsAlloc, |
double | dClaInc, | ||
double | dClaDecay, | ||
double | dVarInc, | ||
double | dVarDecay, | ||
int | fVerbose | ||
) |
Function*************************************************************
Synopsis [Allocates the solver.]
Description [After the solver is allocated, the procedure Msat_SolverClean() should be called to set the number of variables.]
SideEffects []
SeeAlso []
Definition at line 154 of file msatSolverApi.c.
void Msat_SolverClean | ( | Msat_Solver_t * | p, |
int | nVars | ||
) |
Function*************************************************************
Synopsis [Prepares the solver.]
Description [Cleans the solver assuming that the problem will involve the given number of variables (nVars). This procedure is useful for many small (incremental) SAT problems, to prevent the solver from being reallocated each time.]
SideEffects []
SeeAlso []
Definition at line 307 of file msatSolverApi.c.
void Msat_SolverFree | ( | Msat_Solver_t * | p | ) |
Function*************************************************************
Synopsis [Frees the solver.]
Description []
SideEffects []
SeeAlso []
Definition at line 386 of file msatSolverApi.c.
void Msat_SolverMarkClausesStart | ( | Msat_Solver_t * | p | ) |
Definition at line 69 of file msatSolverApi.c.
void Msat_SolverMarkLastClauseTypeA | ( | Msat_Solver_t * | p | ) |
Definition at line 68 of file msatSolverApi.c.
int Msat_SolverParseDimacs | ( | FILE * | pFile, |
Msat_Solver_t ** | p, | ||
int | fVerbose | ||
) |
GLOBAL VARIABLES ///.
MACRO DEFINITIONS ///FUNCTION DECLARATIONS ///
Function*************************************************************
Synopsis [Starts the solver and reads the DIMAC file.]
Description [Returns FALSE upon immediate conflict.]
SideEffects []
SeeAlso []
Definition at line 258 of file msatRead.c.
void Msat_SolverPrepare | ( | Msat_Solver_t * | p, |
Msat_IntVec_t * | vVars | ||
) |
Function*************************************************************
Synopsis [Prepares the solver to run on a subset of variables.]
Description []
SideEffects []
SeeAlso []
Definition at line 451 of file msatSolverApi.c.
void Msat_SolverPrintAssignment | ( | Msat_Solver_t * | p | ) |
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 47 of file msatSolverIo.c.
void Msat_SolverPrintClauses | ( | Msat_Solver_t * | p | ) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 79 of file msatSolverIo.c.
void Msat_SolverPrintStats | ( | Msat_Solver_t * | p | ) |
Function*************************************************************
Synopsis [Prints statistics about the solver.]
Description []
SideEffects []
SeeAlso []
Definition at line 110 of file msatSolverCore.c.
Msat_ClauseVec_t* Msat_SolverReadAdjacents | ( | Msat_Solver_t * | p | ) |
Function*************************************************************
Synopsis [Reads the clause with the given number.]
Description []
SideEffects []
SeeAlso []
Definition at line 104 of file msatSolverApi.c.
int* Msat_SolverReadAssignsArray | ( | Msat_Solver_t * | p | ) |
Definition at line 56 of file msatSolverApi.c.
int Msat_SolverReadBackTracks | ( | Msat_Solver_t * | p | ) |
Definition at line 58 of file msatSolverApi.c.
int Msat_SolverReadClauseNum | ( | Msat_Solver_t * | p | ) |
Definition at line 48 of file msatSolverApi.c.
Msat_IntVec_t* Msat_SolverReadConeVars | ( | Msat_Solver_t * | p | ) |
Function*************************************************************
Synopsis [Reads the clause with the given number.]
Description []
SideEffects []
SeeAlso []
Definition at line 120 of file msatSolverApi.c.
float* Msat_SolverReadFactors | ( | Msat_Solver_t * | p | ) |
Definition at line 70 of file msatSolverApi.c.
int Msat_SolverReadInspects | ( | Msat_Solver_t * | p | ) |
Definition at line 59 of file msatSolverApi.c.
int* Msat_SolverReadModelArray | ( | Msat_Solver_t * | p | ) |
Definition at line 57 of file msatSolverApi.c.
int Msat_SolverReadSolutions | ( | Msat_Solver_t * | p | ) |
int* Msat_SolverReadSolutionsArray | ( | Msat_Solver_t * | p | ) |
unsigned Msat_SolverReadTruth | ( | Msat_Solver_t * | p | ) |
int Msat_SolverReadVarAllocNum | ( | Msat_Solver_t * | p | ) |
Definition at line 49 of file msatSolverApi.c.
int Msat_SolverReadVarNum | ( | Msat_Solver_t * | p | ) |
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Simple SAT solver APIs.]
Description []
SideEffects []
SeeAlso []
Definition at line 47 of file msatSolverApi.c.
Msat_IntVec_t* Msat_SolverReadVarsUsed | ( | Msat_Solver_t * | p | ) |
Function*************************************************************
Synopsis [Reads the clause with the given number.]
Description []
SideEffects []
SeeAlso []
Definition at line 136 of file msatSolverApi.c.
void Msat_SolverRemoveLearned | ( | Msat_Solver_t * | p | ) |
Function*************************************************************
Synopsis [Removes the learned clauses.]
Description []
SideEffects []
SeeAlso []
Definition at line 371 of file msatSolverSearch.c.
void Msat_SolverRemoveMarked | ( | Msat_Solver_t * | p | ) |
Function*************************************************************
Synopsis [Removes the recently added clauses.]
Description []
SideEffects []
SeeAlso []
Definition at line 403 of file msatSolverSearch.c.
void Msat_SolverResize | ( | Msat_Solver_t * | p, |
int | nVarsAlloc | ||
) |
Function*************************************************************
Synopsis [Resizes the solver.]
Description [Assumes that the solver contains some clauses, and that it is currently between the calls. Resizes the solver to accomodate more variables.]
SideEffects []
SeeAlso []
Definition at line 242 of file msatSolverApi.c.
void Msat_SolverSetProofWriting | ( | Msat_Solver_t * | p, |
int | fProof | ||
) |
void Msat_SolverSetVarMap | ( | Msat_Solver_t * | p, |
Msat_IntVec_t * | vVarMap | ||
) |
void Msat_SolverSetVarTypeA | ( | Msat_Solver_t * | p, |
int | Var | ||
) |
void Msat_SolverSetVerbosity | ( | Msat_Solver_t * | p, |
int | fVerbose | ||
) |
Definition at line 63 of file msatSolverApi.c.
int Msat_SolverSimplifyDB | ( | Msat_Solver_t * | p | ) |
Function*************************************************************
Synopsis [Simplifies the data base.]
Description [Simplify all constraints according to the current top-level assigment (redundant constraints may be removed altogether).]
SideEffects []
SeeAlso []
Definition at line 282 of file msatSolverSearch.c.
int Msat_SolverSolve | ( | Msat_Solver_t * | p, |
Msat_IntVec_t * | vAssumps, | ||
int | nBackTrackLimit, | ||
int | nTimeLimit | ||
) |
Function*************************************************************
Synopsis [Top-level solve.]
Description [If using assumptions (non-empty 'assumps' vector), you must call 'simplifyDB()' first to see that no top-level conflict is present (which would put the solver in an undefined state. If the last argument is given (vProj), the solver enumerates through the satisfying solutions, which are projected on the variables listed in this array. Note that the variables in the array may be complemented, in which case the derived assignment for the variable is complemented.]
SideEffects []
SeeAlso []
Definition at line 138 of file msatSolverCore.c.
void Msat_SolverWriteDimacs | ( | Msat_Solver_t * | p, |
char * | pFileName | ||
) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 118 of file msatSolverIo.c.
Msat_VarHeap_t* Msat_VarHeapAlloc | ( | ) |
void Msat_VarHeapCheck | ( | Msat_VarHeap_t * | p | ) |
void Msat_VarHeapCheckOne | ( | Msat_VarHeap_t * | p, |
int | iVar | ||
) |
int Msat_VarHeapContainsVar | ( | Msat_VarHeap_t * | p, |
int | iVar | ||
) |
int Msat_VarHeapCountNodes | ( | Msat_VarHeap_t * | p, |
double | WeightLimit | ||
) |
void Msat_VarHeapDelete | ( | Msat_VarHeap_t * | p, |
int | iVar | ||
) |
int Msat_VarHeapGetMax | ( | Msat_VarHeap_t * | p | ) |
void Msat_VarHeapGrow | ( | Msat_VarHeap_t * | p, |
int | nSize | ||
) |
void Msat_VarHeapInsert | ( | Msat_VarHeap_t * | p, |
int | iVar | ||
) |
void Msat_VarHeapPrint | ( | FILE * | pFile, |
Msat_VarHeap_t * | p | ||
) |
int Msat_VarHeapReadMax | ( | Msat_VarHeap_t * | p | ) |
double Msat_VarHeapReadMaxWeight | ( | Msat_VarHeap_t * | p | ) |
void Msat_VarHeapSetActivity | ( | Msat_VarHeap_t * | p, |
double * | pActivity | ||
) |
void Msat_VarHeapStart | ( | Msat_VarHeap_t * | p, |
int * | pVars, | ||
int | nVars, | ||
int | nVarsAlloc | ||
) |
void Msat_VarHeapStop | ( | Msat_VarHeap_t * | p | ) |
void Msat_VarHeapUpdate | ( | Msat_VarHeap_t * | p, |
int | iVar | ||
) |