# #include "discrimb.h"

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

## Contents

- Public Routines
- Public Definitions
- Introduction

## Public Routines in File discrimb.c

#### Index

discrim_bind_cancel | discrim_bind_retrieve_next | fprint_discrim_bind_index | p_discrim_bind_index
discrim_bind_retrieve_first | discrim_bind_update | fprint_discrimb_mem | p_discrimb_mem

#### Details

    void discrim_bind_cancel(Discrim_pos pos);

This routine must be called if you get some, but not all answers to a tame discrimbintaion query. The Context (which was given to the discrim_bind_retrieve_first() call) is cleared, and the memory associated the retrieval state is freed.

    void *discrim_bind_retrieve_first(Term t, Discrim root,
    				  Context subst, Discrim_pos *ppos);

This routine, along with discrim_bind_retrieve_next(), gets answers from a tame discrimination index. This routine retrieves the first object associated with a term, say ft, more general than Term t. (NULL is returned if there is none.) The substitution for variables of ft is placed into Context subst.

If an object is returned, Discrim_pos *ppos is set to the retrieval state and is used for subsequent discrim_tame_retrieve_next() calls.

If you to get some, but not all answers, you must call discrim_tame_cancel() to clear the substitution and free memory associated with the Discrim_pos.

    void *discrim_bind_retrieve_next(Discrim_pos pos);

This routine retrieves the next object in the sequence of answers to a query of a tame discrimbination tree. You must not explicitly clear the Context you gave to discrim_bind_retrieve_first()---that is handled internally. See discrim_bind_retrieve_first().

    void discrim_bind_update(Term t, Discrim root, void *object, Indexop op);

This routine inserts (op==INSERT) or deletes (op==DELETE) an object into/from a tame discrimination index. Term t is the key, root is the root of the discrimination tree, and *object is a pointer (in many cases, *object will be t). See discrim_tame_retrieve_first().

A fatal error occurs if yout ry to delete an object that was not previouly inserted.

    void fprint_discrim_bind_index(FILE *fp, Discrim d);

This routine prints (to FILE *fp) a tame discrimination index.

    void fprint_discrimb_mem(FILE *fp, BOOL heading);

This routine prints (to FILE *fp) memory usage statistics for data types associated with the discrimb package. The Boolean argument heading tells whether to print a heading on the table.

    void p_discrim_bind_index(Discrim d);

This routine prints (to stdout) a tame discrimination index.

    void p_discrimb_mem(void);

This routine prints (to stdout) memory usage statistics for data types associated with the discrimb package.

## Public Definitions in File discrimb.h

## Introduction

Discrimination tree indexing in which variables are distinguished in the index and are bound as soon as possible during retrieval.