#include "mace.h"
This page has information from files
mace.h and mace.c.
Contents
Public Routines in File mace.c
Index
Details
void fprint_mace_mem(FILE *fp, BOOL heading);
This routine prints (to FILE *fp) memory usage statistics for data types
associated with mace.
The Boolean argument heading tells whether to print a heading on the table.
void mace_cancel(Mace_state ms);
This routine should be called if you get some, but not all, models
from mace_first_model()/mace_next_model(). It frees memory used by
the Mace_state.
Term mace_first_model(Clist lst,
int domain_size,
BOOL distinct_constants,
BOOL elements_in_input,
int max_seconds,
int max_megabytes,
BOOL flip_equations,
BOOL subsume,
FILE *fp,
Mace_state *msp,
int *rcp);
This routine looks for the first model of a set of unsorted clauses.
The domain size is fixed. If a model is found, a term representation
of the model is returned. (NULL is returned if there is no model of
the requested size.)
- lst -- a list of clauses
- domain_size -- we look for models with this number of elements
- distinct_constants -- if TRUE, each constant in the input is
assigned a distinct element of the domain. If the number of
constants is greater than the domain size, say n, then the
first n constants are fixed, and the rest can vary.
This option can block models, but it is well worth trying,
because it really prunes the search by eliminating many
isomorphic models.
- elements_in_input -- if TRUE, then nonnegative integer constants
in the input (up to domain_size-1) are assigned the domain
elements of the same name. Integer constants >= domain_size
can take on any element of the domain.
- max_seconds -- at most this many time will be spent
(-1 means that there is no time limit).
- max_megabytes -- at most this much memory will be used
(-1 means that there is no memory limit).
- flip_equations -- if TRUE, equations (positive unit) are
used in both orientations.
- subsume -- if TRUE, forward subsumption will be applied in the
Davis-Putnam procedure. (FALSE is usually faster.)
- fp -- file to which ordinary processing messages are sent
(this must not be NULL, but it may be "/dev/null").
- msp -- this is the address of a pointer to a mace_state struct.
If a model is found, the pointer is set to the state of the
search. It is used for subsequent calls to mace_next_model().
If you get a model and don't call mace_next_model(), you should
call mace_cancel() to free memory in the mace_state.
If you don't get a model, don't call mace_cancel().
- rcp -- pointer to the return code variable:
- OK_RETURN -- a model is returned.
- NO_MODEL_RETURN -- there are no models (modulo distinct_constants).
- TIME_OUT_RETURN -- max_seconds.
- MEMORY_OUT_RETURN -- max_megabytes.
Term mace_next_model(Mace_state ms, int *rcp);
Get the next model. Return codes are the same as for mace_first_model().
The max_seconds parameter given to mace_first_model() applies here as
well, and the time spent includes the call to mace_first_model.
The max_megabytes parameter given to mace_first_model() is irrelevant,
because mace_next_model() never allocates additional memory.
void p_mace_mem();
This routine prints (to stdout) memory usage statistics for data types
associated with mace.
void print_model(FILE *fp);
This routine prints the current first-order model in readable format.
(This routine is almost obsolete. See interp.h for routines
to print interpretations.)
Public Definitions in File mace.h
#define MAX_MACE_RELATION_ARITY 4
#define MAX_MACE_FUNCTION_ARITY 3
typedef struct mace_state * Mace_state;
Introduction
This package looks for (small) finite models of (unsorted first order)
clause sets. You call mace_first_model() with a list of clauses
and a bunch of parameters, and if it succeeds, it returns a
term representation of the model. Also see the package interp,
which allows you to do things with the model, such as print it
and evaluate clauses and formulas w.r.t. it.
These activities are projects of the
Mathematics and Computer Science Division
of
Argonne National Laboratory.