#include "lindex.h"

This page has information from files lindex.h and lindex.c.

Contents


Public Routines in File lindex.c

Index

fprint_lindex_memlindex_emptylindex_update_first
lindex_backtracklindex_initlindex_update_maximal
lindex_destroylindex_updatep_lindex_mem

Details


void fprint_lindex_mem(FILE *fp, BOOL heading);
This routine prints (to FILE *fp) memory usage statistics for data types associated with Lindex. The Boolean argument heading tells whether to print a heading on the table.
BOOL lindex_backtrack(Lindex idx);
This Boolean function checks if either of the Mindex components (pos, neg) uses backtrack unification.
void lindex_destroy(Lindex ldx);
This frees all the memory associated with a Lindex. Do not refer to the Lindex after calling this routine.
BOOL lindex_empty(Lindex idx);
This Boolean routine checks if an Lindex is empty, that is, has no atoms. It must exist (be non-NULL).
Lindex lindex_init(Mindextype pos_mtype, Uniftype pos_utype, int pos_fpa_depth,
		   Mindextype neg_mtype, Uniftype neg_utype, int neg_fpa_depth);
This routine allocates and returns a literal index (Lindex), which is a pair of Mindexes, one for positive literals, and one for negative literals. The first three parameters are for the positive literal Mindex, and the second three are for the negative.

See the routine mindex_init() for further information.
void lindex_update(Lindex ldx, Clause c, Indexop op);
This routine updates the literals of a clause into a Lindex.
void lindex_update_first(Lindex ldx, Clause c, Indexop op);
This routine updates the first literal of a clause into a Lindex.
void lindex_update_maximal(Lindex ldx, Clause c, Indexop op);
Positive clauses: index maximal literals.

Nonpositive clauses: index all literals. (For hyperresolution, we have to be able to find nonmaximal negative literals in nuclei. So why not index negative literals only? In case we are doing nonordered binary, we have to be able to find positive literals in nonpositive clauses. To implement nonorderd resolution, we just let all literals be maximal.)


void p_lindex_mem();
This routine prints (to stdout) memory usage statistics for data types associated with Lindex.

Public Definitions in File lindex.h

typedef struct lindex * Lindex;

struct lindex {
  Mindex pos;   /* index for positive literals */
  Mindex neg;   /* index for negative literals */
  Lindex next;  /* for avail list */
};


Introduction

This is a simple package that can be used when you need a pair of indexes (Mindexes), one for positive literals, and one for negative literals. The name Lindex means "literal index".

When you allocate the Lindex (lindex_init()), you specify the parameters as you would for two separate Mindexes. When you insert into or delete from the Lindex, you give a clause, and each literal of the clause is indexed: positive literals go into the positive component of the Lindex, and negative literals go into the negative component.

There are no retrieval operations in this package. Instead, use the retrieval operations from the Mindex package on the appropriate member (positive or negative) of the pair.

See the package "mindex" for information on the initialization parameters and retrieval operations.


These activities are projects of the Mathematics and Computer Science Division of Argonne National Laboratory.