# #include "discrimw.h"

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

## Contents

- Public Routines
- Public Definitions
- Introduction

## Public Routines in File discrimw.c

#### Index

discrim_wild_cancel | discrim_wild_retrieve_next | fprint_discrim_wild_index | p_discrim_wild_index
discrim_wild_retrieve_first | discrim_wild_update | fprint_discrimw_mem | p_discrimw_mem

#### Details

    void discrim_wild_cancel(Discrim_pos pos);

This routine should be called if you get some, but not all answers to a wild discrimintaion query. The memory associated the retrieval state is freed.

    void *discrim_wild_retrieve_first(Term t, Discrim root,
    				  Discrim_pos *ppos);

This routine, along with discrim_wild_retrieve_next(), gets answers from a wild discrimination index. This routine retrieves the first object associated with a term more general than Term t. (NULL is returned if there is none.)

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_wild_cancel() to clear the substitution and free memory associated with the Discrim_pos.

    void *discrim_wild_retrieve_next(Discrim_pos pos);

This routine retrieves the next object in the sequence of answers to a query of a wild discrimination tree. See discrim_wild_retrieve_first().

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

This routine inserts (op==INSERT) or deletes (op==DELETE) an object into/from a wild 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_wild_index(FILE *fp, Discrim d);

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

    void fprint_discrimw_mem(FILE *fp, BOOL heading);

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

    void p_discrim_wild_index(Discrim d);

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

    void p_discrimw_mem(void);

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

## Public Definitions in File discrimw.h

## Introduction

Discrimination tree indexing in which all variables variables are represented as wildcards in the index. Matching occurs after retrieval of candidates.