YAP
7.1.0
index.h
1
/*************************************************************************
2
* *
3
* YAP Prolog %W% %G%
4
* *
5
* Yap Prolog was developed at NCCUP - Universidade do Porto *
6
* *
7
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
8
* *
9
**************************************************************************
10
* *
11
* File: index.h *
12
* Last rev: *
13
* mods: *
14
* comments: indexation info *
15
* *
16
*************************************************************************/
17
18
/* allowed types for clauses */
19
typedef
enum
clause_type_enum {
20
pair_clause = 0x01,
21
struct_clause = 0x02,
22
atom_clause = 0x04,
23
int_clause = 0x08,
24
flt_clause = 0x10,
25
lgint_clause = 0x20,
26
dbref_clause = 0x40
27
} clause_type;
28
29
/* Four types of Clauses */
30
#define MaxOptions 4
31
32
/* Minimum number of clauses needed to build an hash table */
33
/* must be a power of two */
34
#define MIN_HASH_ENTRIES 4
35
36
#define HASH_SHIFT 6
37
38
/* Intermediate Data structures,
39
used to build the indexing code */
40
41
/* Used to store all important information about a clause */
42
typedef
struct
StructClauseDef
{
43
44
Term Tag;
/* if nonvar or nonlist, first argument */
45
yamop
*Code;
/* start of code for clause */
46
yamop
*CurrentCode;
/* start of code for clause */
47
union
{
48
yamop
*WorkPC;
/* start of code for clause */
49
Term t_ptr;
50
CELL *c_sreg;
51
} ucd;
52
}
ClauseDef
;
53
54
/* Relevant information for groups */
55
typedef
struct
{
56
ClauseDef
*FirstClause;
57
ClauseDef
*LastClause;
58
UInt VarClauses;
59
UInt AtomClauses;
60
UInt PairClauses;
61
UInt StructClauses;
62
UInt TestClauses;
63
}
GroupDef
;
64
65
/* switch_on_cons */
66
typedef
struct
{
67
Term Tag;
68
union
{
69
UInt Label;
70
yamop
*labp;
71
} u_a;
72
}
AtomSwiEntry
;
73
74
/* switch_on_func */
75
typedef
struct
{
76
Functor
Tag;
77
union
{
78
UInt Label;
79
yamop
*labp;
80
} u_f;
81
}
FuncSwiEntry
;
82
83
/* switch_on_type */
84
typedef
struct
{
85
UInt PairEntry;
86
UInt ConstEntry;
87
UInt FuncEntry;
88
UInt
VarEntry
;
89
}
TypeSwitch
;
90
91
#define MAX_REG_COPIES 32
92
93
typedef
struct
{
94
Int pos;
95
Term val;
96
Term extra;
97
}
istack_entry
;
98
99
typedef
enum
{ pc_entry, block_entry } add2index_entries;
100
101
typedef
struct
{
102
add2index_entries flag;
103
union
{
104
struct
{
105
yamop
**pi_pc;
106
yamop
*code, *current_code, *work_pc;
107
Term tag;
108
} pce;
109
struct
{
110
ClauseUnion
*block;
111
yamop
**entry_code;
112
} cle;
113
} uip;
114
}
path_stack_entry
;
115
116
#define MAX_ISTACK_DEPTH 32
117
118
typedef
enum
{ REFRESH, RECORDA, RECORDZ } expand_values;
AtomSwiEntry
Definition:
index.h:66
FuncSwiEntry
Definition:
index.h:75
FunctorEntryStruct
Definition:
Atoms.h:122
GroupDef
Definition:
index.h:55
StructClauseDef
Definition:
index.h:42
TypeSwitch
Definition:
index.h:84
VARSTRUCT
Definition:
ScannerTypes.h:24
istack_entry
Definition:
index.h:93
path_stack_entry
Definition:
index.h:101
yami
Definition:
amidefs.h:264
clause_obj
Definition:
clause.h:152
H
index.h
Generated by
1.9.3