dp_append_clause | dp_first_model | dp_next_model | fprint_dp_report |
dp_atom_value | dp_get_model | dp_p_model | fprint_putnam_mem |
dp_cancel | dp_init | fprint_dp_preprocess_report | p_putnam_mem |
DP_rc dp_append_clause(DP_state dp, int clause[], int number_of_literals);This routine adds a propositional clause to a Davis-Putnam set. The clause is an array of non-zero integers (atoms are positive integers). (If the set of clauses has n atoms, it is most efficient to name them 1, 2, ..., n.)
Clauses cannot be added to the set after dp_first_model() has been called. If you try to do so, a fatal error will occur.
The return codes are
int dp_atom_value(DP_state dp, int atom);This routine returns the current value of an atom. It assumes you have a model (that is, dp_first_model() or dp_next_model() just returned OK_RETURN). The return is ATOM_TRUE or ATOM_FALSE. If the atom is out of range, ATOM_FALSE is returned.
void dp_cancel(DP_state dp);This routine deallocates a DP_state. It should be called if
DP_rc dp_first_model(DP_state dp);This routine starts the Davis-Putnam search. The return codes are
void dp_get_model(DP_state dp, int **literals, int *num_literals);This routine can be called to retrieve the current model after dp_first_model() or dp_next_model() returns with OK_RETURN. The form of the model is an array (*literals) of nonzero integers (sorted by absolute value) giving the literals true in the model. The size of the array (*num_literals) is the number of atoms in the set of clauses.
DP_state dp_init(int seconds_limit, int megabyte_limit, BOOL subsume, FILE *report_file);This routine allocates a DP_state for a Davis-Putnam search.
DP_rc dp_next_model(DP_state dp);This routine continues the Davis-Putnam search. The return codes are
void dp_p_model(DP_state dp);
void fprint_dp_preprocess_report(FILE *fp, DP_state dp);This routine prints (to FILE *fp) a report containing all statistics for a Davis-Putnam search.
void fprint_dp_report(FILE *fp, DP_state dp);This routine prints (to FILE *fp) a report containing all statistics for a Davis-Putnam search.
void fprint_putnam_mem(FILE *fp, BOOL heading);This routine prints (to FILE *fp) memory usage statistics for data types associated with Davis-Putnam. The Boolean argument heading tells whether to print a heading on the table. (This does not include the vast majority of the DP memory usage, which is managed privately. See fprint_dp_report().)
void p_putnam_mem();This routine prints (to stdout) memory usage statistics for data types associated with Davis-Putnam. (This does not include the vast majority of the DP memory usage, which is managed privately. See fprint_dp_report().)
typedef struct dp_state * DP_state; /* return codes for first_model(), next_model(), and dp_insert_clause() */ typedef enum { OK_RETURN, NO_MODEL_RETURN, TIME_OUT_RETURN, MEMORY_OUT_RETURN, } DP_rc; /* values of propositional variables */ #define ATOM_FALSE 0 #define ATOM_TRUE 1 #define ATOM_NOT_ASSIGNED 2
The search is incremental, returning models as they are found. How to use the package:
These activities are projects of the Mathematics and Computer Science Division of Argonne National Laboratory.