This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/H/index.h
vsc d290885f8f new indexing algorithm
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@822 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2003-04-30 17:46:05 +00:00

85 lines
1.9 KiB
C

/*************************************************************************
* *
* YAP Prolog %W% %G%
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: index.h *
* Last rev: *
* mods: *
* comments: indexation info *
* *
*************************************************************************/
/* allowed types for clauses */
typedef enum clause_type_enum {
pair_clause = 0x01,
struct_clause = 0x02,
atom_clause = 0x04,
int_clause = 0x08,
flt_clause = 0x10,
lgint_clause = 0x20,
dbref_clause = 0x40
} clause_type;
/* Four types of Clauses */
#define MaxOptions 4
/* Minimum number of clauses needed to build an hash table */
/* must be a power of two */
#define MIN_HASH_ENTRIES 4
#define HASH_SHIFT 6
/* Intermediate Data structures,
used to build the indexing code */
/* Used to store all important information about a clause */
typedef struct StructClauseDef {
Term Tag; /* if nonvar or nonlist, first argument */
yamop *Code; /* start of code for clause */
yamop *CurrentCode; /* start of code for clause */
yamop *WorkPC; /* start of code for clause */
} ClauseDef;
/* Relevant information for groups */
typedef struct {
ClauseDef *FirstClause;
ClauseDef *LastClause;
UInt VarClauses;
UInt AtomClauses;
UInt PairClauses;
UInt StructClauses;
UInt TestClauses;
} GroupDef;
/* switch_on_cons */
typedef struct {
Term Tag;
UInt Label;
} AtomSwiEntry;
/* switch_on_func */
typedef struct {
Functor Tag;
UInt Label;
} FuncSwiEntry;
/* switch_on_type */
typedef struct {
UInt PairEntry;
UInt ConstEntry;
UInt FuncEntry;
UInt VarEntry;
} TypeSwitch;
#define MAX_REG_COPIES 32