YAP 7.1.0
ihstruct.h
1
2 /* This file, ihstruct.h, was generated automatically by "yap -L misc/buildlocalglobal"
3 please do not update, update H/HEAPFIELDS instead */
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33#if USE_DL_MALLOC
34#if defined(YAPOR) || defined(THREADS)
35 INIT_LOCK(DLMallocLock);
36#endif
37#endif
38#if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO)
39#ifndef HeapUsed
40#define HeapUsed Yap_givemallinfo()
41#endif
42
43#else
44
45#endif
46
47
48
49
50#if defined(YAPOR) || defined(THREADS)
51 INIT_LOCK(FreeBlocksLock);
52 INIT_LOCK(HeapUsedLock);
53 INIT_LOCK(HeapTopLock);
54 HeapTopOwner = -1;
55#endif
56 MaxStack = 0;
57 MaxTrail = 0;
58
59
60#if USE_THREADED_CODE
61
62#endif
63
64 EITHER_OPCODE = Yap_opcode(_execute_cpred);
65 EXECUTE_CPRED_OPCODE = Yap_opcode(_execute_cpred);
66 EXECUTE_CPRED_OP_CODE = Yap_opcode(_execute_cpred);
67 EXPAND_OP_CODE = Yap_opcode(_expand_index);
68 FAIL_OPCODE = Yap_opcode(_op_fail);
69 INDEX_OPCODE = Yap_opcode(_index_pred);
70 LOCKPRED_OPCODE = Yap_opcode(_lock_pred);
71 ORLAST_OPCODE = Yap_opcode(_or_last);
72 UNDEF_OPCODE = Yap_opcode(_undef_p);
73 RETRY_USERC_OPCODE = Yap_opcode(_retry_userc);
74 EXECUTE_CPRED_OPCODE = Yap_opcode(_execute_cpred);
75 FCALL_OPCODE = Yap_opcode(_fcall);
76
77
78
79
80
81 InitInvisibleAtoms();
82 InitWideAtoms();
83 InitAtoms();
84
85#include "iatoms.h"
86#ifdef EUROTRA
87 TermDollarU = MkAtomTerm(AtomDollarU);
88#endif
89
90 USER_MODULE = MkAtomTerm(AtomUser);
91 IDB_MODULE = MkAtomTerm(AtomIDB);
92 ATTRIBUTES_MODULE = MkAtomTerm(AtomAttributes);
93 CHARSIO_MODULE = MkAtomTerm(AtomCharsio);
94 CHTYPE_MODULE = MkAtomTerm(AtomChType);
95 TERMS_MODULE = MkAtomTerm(AtomTerms);
96 SYSTEM_MODULE = MkAtomTerm(AtomSystem);
97 READUTIL_MODULE = MkAtomTerm(AtomReadutil);
98 HACKS_MODULE = MkAtomTerm(AtomYapHacks);
99 ARG_MODULE = MkAtomTerm(AtomArg);
100 GLOBALS_MODULE = MkAtomTerm(AtomNb);
101 SWI_MODULE = MkAtomTerm(AtomSwi);
102 DBLOAD_MODULE = MkAtomTerm(AtomDBLoad);
103 RANGE_MODULE = MkAtomTerm(AtomRange);
104 ERROR_MODULE = MkAtomTerm(AtomError);
105
106
107
108 CurrentModules = NULL;
109
110
111 Yap_InitModules();
112
113 HIDDEN_PREDICATES = NULL;
114
115
116 Yap_InitPlIO(yapi);
117 GLOBAL_Flags = 0;
118 Yap_InitFlags(true);
119
120 Yap_ExecutionMode = INTERPRETED;
121
122 PredsInHashTable = 0;
123 PredHashTableSize = 0;
124 InitPredHash();
125#if defined(YAPOR) || defined(THREADS)
126
127#endif
128
129 CreepCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomCreep,1),PROLOG_MODULE));
130 UndefHook = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomUndefp,1),PROLOG_MODULE));
131 UndefHook0 = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomUndefp0,1),PROLOG_MODULE));
132 UserUndefHook = RepPredProp(PredPropByFunc(FunctorUnknownPredicateHandler,USER_MODULE));
133 SpyCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomSpy,1),PROLOG_MODULE));
134 PredFail = RepPredProp(PredPropByAtom(AtomFail,PROLOG_MODULE));
135 PredTrue = RepPredProp(PredPropByAtom(AtomTrue,PROLOG_MODULE));
136#ifdef COROUTINING
137 WakeUpCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomWakeUpGoal,2),PROLOG_MODULE));
138#endif
139 PredCsult = RepPredProp(PredPropByFunc(FunctorCsult,PROLOG_MODULE));
140 PredDollarCatch = RepPredProp(PredPropByFunc(FunctorCatch,PROLOG_MODULE));
141#ifdef YAPOR
142 PredGetwork = RepPredProp(PredPropByAtom(AtomGetwork,PROLOG_MODULE));
143#endif /* YAPOR */
144 PredGoalExpansion = RepPredProp(PredPropByFunc(FunctorGoalExpansion,USER_MODULE));
145 PredHandleThrow = RepPredProp(PredPropByFunc(FunctorHandleThrow,PROLOG_MODULE));
146 PredIs = RepPredProp(PredPropByFunc(FunctorIs,PROLOG_MODULE));
147 PredLogUpdClause = RepPredProp(PredPropByFunc(FunctorDoLogUpdClause,PROLOG_MODULE));
148 PredLogUpdClauseErase = RepPredProp(PredPropByFunc(FunctorDoLogUpdClauseErase,PROLOG_MODULE));
149 PredLogUpdClause0 = RepPredProp(PredPropByFunc(FunctorDoLogUpdClause,PROLOG_MODULE));
150 PredCall = RepPredProp(PredPropByFunc(FunctorCall,PROLOG_MODULE));
151 PredMetaCall = RepPredProp(PredPropByFunc(FunctorMetaCall,PROLOG_MODULE));
152 PredPrologCutTo = RepPredProp(PredPropByFunc(FunctorPrologCutTo,PROLOG_MODULE));
153 PredProtectStack = RepPredProp(PredPropByFunc(FunctorProtectStack,PROLOG_MODULE));
154 PredRecordedWithKey = RepPredProp(PredPropByFunc(FunctorRecordedWithKey,PROLOG_MODULE));
155 PredRestoreRegs = RepPredProp(PredPropByFunc(FunctorRestoreRegs,PROLOG_MODULE));
156 PredSafeCallCleanup = RepPredProp(PredPropByFunc(FunctorSafeCallCleanup,PROLOG_MODULE));
157 PredStaticClause = RepPredProp(PredPropByFunc(FunctorDoStaticClause,PROLOG_MODULE));
158 PredThrow = RepPredProp(PredPropByFunc(FunctorThrow,PROLOG_MODULE));
159 PredTraceMetaCall = RepPredProp(PredPropByFunc(FunctorTraceMetaCall,PROLOG_MODULE));
160 PredCommentHook = RepPredProp(PredPropByFunc(FunctorCommentHook,PROLOG_MODULE));
161 PredProcedure = Yap_MkLogPred(RepPredProp(PredPropByFunc(FunctorProcedure,PROLOG_MODULE)));
162 PredUndefinedQuery = RepPredProp(PredPropByFunc(FunctorUndefinedQuery,PROLOG_MODULE));
163 PredComma = RepPredProp(PredPropByFunc(FunctorComma,PROLOG_MODULE));
164 PredCatch = RepPredProp(PredPropByFunc(FunctorCatch,PROLOG_MODULE));
165
166#ifdef LOW_LEVEL_TRACER
167 Yap_do_low_level_trace = FALSE;
168#if defined(YAPOR) || defined(THREADS)
169 INIT_LOCK(Yap_low_level_trace_lock);
170#endif
171#endif
172
173 Yap_ClauseSpace = 0;
174 Yap_IndexSpace_Tree = 0;
175 Yap_IndexSpace_EXT = 0;
176 Yap_IndexSpace_SW = 0;
177 Yap_LUClauseSpace = 0;
178 Yap_LUIndexSpace_Tree = 0;
179 Yap_LUIndexSpace_CP = 0;
180 Yap_LUIndexSpace_EXT = 0;
181 Yap_LUIndexSpace_SW = 0;
182
183
184 DUMMYCODE->opc = Yap_opcode(_op_fail);
185 FAILCODE->opc = Yap_opcode(_op_fail);
186 NOCODE->opc = Yap_opcode(_Nstop);
187 EXITCODE->opc = Yap_opcode(_Nstop);
188 InitEnvInst(ENV_FOR_TRUSTFAIL,&TRUSTFAILCODE,_trust_fail,PredFail);
189
190 InitEnvInst(ENV_FOR_YESCODE,&YESCODE,_Ystop,PredFail);
191
192 InitOtaplInst(RTRYCODE,_retry_and_mark,PredFail);
193#ifdef BEAM
194 BEAM_RETRY_CODE->opc = Yap_opcode(_beam_retry_code);
195#endif /* BEAM */
196#ifdef YAPOR
197 InitOtaplInst(GETWORK,_getwork,PredGetwork);
198 InitOtaplInst(GETWORK_SEQ,_getwork_seq,PredGetworkSeq);
199 GETWORK_FIRST_TIME->opc = Yap_opcode(_getwork_first_time);
200#endif /* YAPOR */
201#ifdef TABLING
202 InitOtaplInst(LOAD_ANSWER,_table_load_answer,PredFail);
203 InitOtaplInst(TRY_ANSWER,_table_try_answer,PredFail);
204 InitOtaplInst(ANSWER_RESOLUTION,_table_answer_resolution,PredFail);
205 InitOtaplInst(COMPLETION,_table_completion,PredFail);
206#ifdef THREADS_CONSUMER_SHARING
207 InitOtaplInst(ANSWER_RESOLUTION_COMPLETION,_table_answer_resolution_completion,PredFail);
208#endif /* THREADS_CONSUMER_SHARING */
209#endif /* TABLING */
210
211
212
213
214 P_before_spy = NULL;
215
216 RETRY_C_RECORDEDP_CODE = NULL;
217 RETRY_C_RECORDED_K_CODE = NULL;
218
219 PROFILING = FALSE;
220 CALL_COUNTING = FALSE;
221 optimizer_on = TRUE;
222 compile_mode = 0;
223 profiling = FALSE;
224 call_counting = FALSE;
225
226 compile_arrays = FALSE;
227
228#if defined(YAPOR) || defined(THREADS)
229 INIT_LOCK(DBTermsListLock);
230#endif
231 DBTermsList = NULL;
232
233 ExpandClausesFirst = NULL;
234 ExpandClausesLast = NULL;
235 Yap_ExpandClauses = 0;
236#if defined(YAPOR) || defined(THREADS)
237 INIT_LOCK(ExpandClausesListLock);
238 INIT_LOCK(OpListLock);
239#endif
240
241#ifdef DEBUG
242 Yap_NewCps = 0L;
243 Yap_LiveCps = 0L;
244 Yap_DirtyCps = 0L;
245 Yap_FreedCps = 0L;
246#endif
247 Yap_expand_clauses_sz = 0L;
248
249 UdiControlBlocks = NULL;
250
251
252 STATIC_PREDICATES_MARKED = FALSE;
253
254 INT_KEYS = NULL;
255 INT_LU_KEYS = NULL;
256 INT_BB_KEYS = NULL;
257
258 INT_KEYS_SIZE = INT_KEYS_DEFAULT_SIZE;
259 INT_KEYS_TIMESTAMP = 0L;
260 INT_BB_KEYS_SIZE = INT_KEYS_DEFAULT_SIZE;
261
262 UPDATE_MODE = UPDATE_MODE_LOGICAL;
263
264 InitDBErasedMarker();
265 InitLogDBErasedMarker();
266
267 DeadStaticClauses = NULL;
268 DeadMegaClauses = NULL;
269 DeadStaticIndices = NULL;
270 DBErasedList = NULL;
271 DBErasedIList = NULL;
272#if defined(YAPOR) || defined(THREADS)
273 INIT_LOCK(DeadStaticClausesLock);
274 INIT_LOCK(DeadMegaClausesLock);
275 INIT_LOCK(DeadStaticIndicesLock);
276#endif
277#ifdef COROUTINING
278
279 NUM_OF_ATTS = 1;
280
281
282#endif
283
284
285
286 OpList = NULL;
287
288 ForeignCodeLoaded = NULL;
289 ForeignCodeBase = NULL;
290 ForeignCodeTop = NULL;
291 ForeignCodeMax = NULL;
292
293 Yap_Records = NULL;
294 InitEmptyWakeups();
295 MaxEmptyWakeups = 0;
296
297 BlobTypes = NULL;
298 Blobs = NULL;
299 NOfBlobs = 0;
300 NOfBlobsMax = 256;
301#if defined(YAPOR) || defined(THREADS)
302 INIT_LOCK(Blobs_Lock);
303#endif
304
void Yap_InitFlags(bool bootstrap)
Init System Prolog flags.
Definition: flags.c:2002
@ profiling
profiling
Definition: YapGFlagInfo.h:479
@ call_counting
Predicates compiled with this flag set maintain a counter on the numbers of proceduree calls and of r...
Definition: YapLFlagInfo.h:56