YAP 7.1.0
traced_tab.tries.insts.h
1/************************************************************************
2** **
3** The YapTab/YapOr/OPTYap systems **
4** **
5** YapTab extends the Yap Prolog engine to support sequential tabling **
6** YapOr extends the Yap Prolog engine to support or-parallelism **
7** OPTYap extends the Yap Prolog engine to support or-parallel tabling **
8** **
9** **
10** Yap Prolog was developed at University of Porto, Portugal **
11** **
12************************************************************************/
13
14/************************************************************************
15 ** Trie instructions: auxiliary stack organization **
16 *************************************************************************
17 -------------------
18 | ha = heap_arity |
19 ------------------- --
20 | heap ptr 1 | |
21 ------------------- |
22 | ... | -- heap_arity (0 if in global trie)
23 ------------------- |
24 | heap ptr ha | |
25 ------------------- --
26 | va = vars_arity |
27 ------------------- --
28 | var ptr va | |
29 ------------------- |
30 | ... | -- vars_arity
31 ------------------- |
32 | var ptr 1 | |
33 ------------------- --
34 | sa = subs_arity |
35 ------------------- --
36 | subs ptr sa | |
37 ------------------- |
38 | ... | -- subs_arity
39 ------------------- |
40 | subs ptr 1 | |
41 ------------------- --
42************************************************************************/
43
44
45
46/************************************************************************
47 ** Trie instructions: macros **
48 ************************************************************************/
49
50#define TOP_STACK YENV
51
52#define HEAP_ARITY_ENTRY (0)
53#define VARS_ARITY_ENTRY (1 + heap_arity)
54#define SUBS_ARITY_ENTRY (1 + heap_arity + 1 + vars_arity)
55
56/* macros 'HEAP_ENTRY', 'VARS_ENTRY' and 'SUBS_ENTRY' **
57** assume that INDEX starts at 1 (and not at 0 !!!) */
58#define HEAP_ENTRY(INDEX) (HEAP_ARITY_ENTRY + (INDEX))
59#define VARS_ENTRY(INDEX) (VARS_ARITY_ENTRY + 1 + vars_arity - (INDEX))
60#define SUBS_ENTRY(INDEX) (SUBS_ARITY_ENTRY + 1 + subs_arity - (INDEX))
61
62#define next_trie_instruction(NODE) \
63 PREG = (yamop *) TrNode_child(NODE); \
64 PREFETCH_OP(PREG); \
65 GONext()
66
67#define next_instruction(CONDITION, NODE) \
68 if (CONDITION) { \
69 PREG = (yamop *) TrNode_child(NODE); \
70 } else { /* procceed */ \
71 PREG = (yamop *) CPREG; \
72 TOP_STACK = ENV; \
73 } \
74 PREFETCH_OP(PREG); \
75 GONext()
76
77#define copy_aux_stack() \
78 { int size = 3 + heap_arity + subs_arity + vars_arity; \
79 TOP_STACK -= size; \
80 memcpy(TOP_STACK, aux_stack, size * sizeof(CELL *)); \
81 aux_stack = TOP_STACK; \
82 }/* macros 'store_trie_node', 'restore_trie_node' and 'pop_trie_node' **
83 ** do not include 'set_cut' because trie instructions are cut safe */
84
85#define store_trie_node(AP) \
86 { register choiceptr cp; \
87 TOP_STACK = (CELL *) (NORM_CP(TOP_STACK) - 1); \
88 cp = NORM_CP(TOP_STACK); \
89 HBREG = HR; \
90 store_yaam_reg_cpdepth(cp); \
91 cp->cp_tr = TR; \
92 cp->cp_h = HR; \
93 cp->cp_b = B; \
94 cp->cp_cp = CPREG; \
95 cp->cp_ap = (yamop *) AP; \
96 cp->cp_env= ENV; \
97 B = cp; \
98 YAPOR_SET_LOAD(B); \
99 SET_BB(B); \
100 TABLING_ERROR_CHECKING_STACK; \
101 } \
102 copy_aux_stack()
103
104#define restore_trie_node(AP) \
105 HR = HBREG = PROTECT_FROZEN_H(B); \
106 restore_yaam_reg_cpdepth(B); \
107 CPREG = B->cp_cp; \
108 ENV = B->cp_env; \
109 YAPOR_update_alternative(PREG, (yamop *) AP) \
110 B->cp_ap = (yamop *) AP; \
111 TOP_STACK = (CELL *) PROTECT_FROZEN_B(B); \
112 SET_BB(NORM_CP(TOP_STACK)); \
113 copy_aux_stack()
114
115#define really_pop_trie_node() \
116 TOP_STACK = (CELL *) PROTECT_FROZEN_B((B + 1)); \
117 HR = PROTECT_FROZEN_H(B); \
118 pop_yaam_reg_cpdepth(B); \
119 CPREG = B->cp_cp; \
120 TABLING_close_alt(B); \
121 ENV = B->cp_env; \
122 B = B->cp_b; \
123 HBREG = PROTECT_FROZEN_H(B); \
124 SET_BB(PROTECT_FROZEN_B(B)); \
125 if ((choiceptr) TOP_STACK == B_FZ) { \
126 copy_aux_stack(); \
127 }
128
129#ifdef YAPOR
130#define pop_trie_node() \
131 if (SCH_top_shared_cp(B)) { \
132 restore_trie_node(NULL); \
133 } else { \
134 really_pop_trie_node(); \
135 }
136#else
137#define pop_trie_node() \
138 really_pop_trie_node()
139#endif /* YAPOR */
140
141
142
143/************************************************************************
144 ** aux_stack_null_instr **
145 ************************************************************************/
146
147#define aux_stack_null_instr() \
148 next_trie_instruction(node)
149
150
151
152/************************************************************************
153 ** aux_stack_extension_instr **
154 ************************************************************************/
155
156#define aux_stack_extension_instr() \
157 TOP_STACK = &aux_stack[-2]; \
158 TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity + 2; \
159 TOP_STACK[HEAP_ENTRY(1)] = TrNode_entry(node); \
160 TOP_STACK[HEAP_ENTRY(2)] = 0; /* extension mark */ \
161 next_trie_instruction(node)
162
163
164
165/************************************************************************
166 ** aux_stack_term_(in_pair_)instr **
167 ************************************************************************/
168
169#define aux_stack_term_instr() \
170 if (heap_arity) { \
171 Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], t); \
172 TOP_STACK = &aux_stack[1]; \
173 TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity - 1; \
174 next_instruction(heap_arity - 1 || subs_arity, node); \
175 } else { \
176 YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], t); \
177 aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
178 next_instruction(subs_arity - 1, node); \
179 }
180
181#define aux_stack_term_in_pair_instr() \
182 if (heap_arity) { \
183 Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsPair(HR)); \
184 } else { \
185 YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsPair(HR)); \
186 aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
187 TOP_STACK = &aux_stack[-1]; \
188 TOP_STACK[HEAP_ARITY_ENTRY] = 1; \
189 } \
190 Bind_Global(HR, TrNode_entry(node)); \
191 TOP_STACK[HEAP_ENTRY(1)] = (CELL) (HR + 1); \
192 HR += 2; \
193 next_trie_instruction(node)
194
195
196
197/************************************************************************
198 ** aux_stack_(new_)pair_instr **
199 ************************************************************************/
200
201#define aux_stack_new_pair_instr() /* for term 'CompactPairInit' */ \
202 if (heap_arity) { \
203 Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsPair(HR)); \
204 TOP_STACK = &aux_stack[-1]; \
205 TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity + 1; \
206 } else { \
207 YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsPair(HR)); \
208 aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
209 TOP_STACK = &aux_stack[-2]; \
210 TOP_STACK[HEAP_ARITY_ENTRY] = 2; \
211 } \
212 TOP_STACK[HEAP_ENTRY(1)] = (CELL) HR; \
213 TOP_STACK[HEAP_ENTRY(2)] = (CELL) (HR + 1); \
214 HR += 2; \
215 next_trie_instruction(node)
216
217#ifdef TRIE_COMPACT_PAIRS
218#define aux_stack_pair_instr() /* for term 'CompactPairEndList' */ \
219 if (heap_arity) { \
220 Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsPair(HR)); \
221 } else { \
222 YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsPair(HR)); \
223 aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
224 TOP_STACK = &aux_stack[-1]; \
225 TOP_STACK[HEAP_ARITY_ENTRY] = 1; \
226 } \
227 TOP_STACK[HEAP_ENTRY(1)] = (CELL) HR; \
228 Bind_Global(HR + 1, TermNil); \
229 HR += 2; \
230 next_trie_instruction(node)
231#else
232#define aux_stack_pair_instr() \
233 aux_stack_new_pair_instr()
234#endif /* TRIE_COMPACT_PAIRS */
235
236
237
238/************************************************************************
239 ** aux_stack_appl_(in_pair_)instr **
240 ************************************************************************/
241
242#define aux_stack_appl_instr() \
243 if (heap_arity) { \
244 Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsAppl(HR)); \
245 TOP_STACK = &aux_stack[-func_arity + 1]; \
246 TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity + func_arity - 1; \
247 } else { \
248 YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsAppl(HR)); \
249 aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
250 TOP_STACK = &aux_stack[-func_arity]; \
251 TOP_STACK[HEAP_ARITY_ENTRY] = func_arity; \
252 } \
253 *HR = (CELL) func; \
254 { int i; \
255 for (i = 1; i <= func_arity; i++) \
256 TOP_STACK[HEAP_ENTRY(i)] = (CELL) (HR + i); \
257 } \
258 HR += 1 + func_arity; \
259 next_trie_instruction(node)
260
261#define aux_stack_appl_in_pair_instr() \
262 if (heap_arity) { \
263 Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsPair(HR)); \
264 TOP_STACK = &aux_stack[-func_arity]; \
265 TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity + func_arity; \
266 } else { \
267 YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsPair(HR)); \
268 aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
269 TOP_STACK = &aux_stack[-func_arity - 1]; \
270 TOP_STACK[HEAP_ARITY_ENTRY] = func_arity + 1; \
271 } \
272 TOP_STACK[HEAP_ENTRY(func_arity + 1)] = (CELL) (HR + 1); \
273 Bind_Global(HR, AbsAppl(HR + 2)); \
274 HR += 2; \
275 *HR = (CELL) func; \
276 { int i; \
277 for (i = 1; i <= func_arity; i++) \
278 TOP_STACK[HEAP_ENTRY(i)] = (CELL) (HR + i); \
279 } \
280 HR += 1 + func_arity; \
281 next_trie_instruction(node)
282
283
284
285/************************************************************************
286 ** aux_stack_var_(in_pair_)instr **
287 ************************************************************************/
288
289#define aux_stack_var_instr() \
290 if (heap_arity) { \
291 int i; \
292 CELL var = aux_stack[HEAP_ENTRY(1)]; \
293 RESET_VARIABLE(var); \
294 TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity - 1; \
295 for (i = 2; i <= heap_arity; i++) \
296 TOP_STACK[HEAP_ENTRY(i - 1)] = aux_stack[HEAP_ENTRY(i)]; \
297 aux_stack[VARS_ARITY_ENTRY - 1] = vars_arity + 1; \
298 aux_stack[VARS_ENTRY(vars_arity + 1)] = var; \
299 next_instruction(heap_arity - 1 || subs_arity, node); \
300 } else { \
301 CELL var = aux_stack[SUBS_ENTRY(1)]; \
302 aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
303 TOP_STACK = &aux_stack[-1]; \
304 TOP_STACK[HEAP_ARITY_ENTRY] = 0; \
305 aux_stack[VARS_ARITY_ENTRY - 1] = vars_arity + 1; \
306 aux_stack[VARS_ENTRY(vars_arity + 1)] = var; \
307 next_instruction(subs_arity - 1, node); \
308 }
309
310#define aux_stack_var_in_pair_instr() \
311 if (heap_arity) { \
312 int i; \
313 Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsPair(HR)); \
314 TOP_STACK = &aux_stack[-1]; \
315 TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity; \
316 TOP_STACK[HEAP_ENTRY(1)] = (CELL) (HR + 1); \
317 for (i = 2; i <= heap_arity; i++) \
318 TOP_STACK[HEAP_ENTRY(i)] = aux_stack[HEAP_ENTRY(i)]; \
319 } else { \
320 YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsPair(HR)); \
321 aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
322 TOP_STACK = &aux_stack[-2]; \
323 TOP_STACK[HEAP_ARITY_ENTRY] = 1; \
324 TOP_STACK[HEAP_ENTRY(1)] = (CELL) (HR + 1); \
325 } \
326 aux_stack[VARS_ARITY_ENTRY - 1] = vars_arity + 1; \
327 aux_stack[VARS_ENTRY(vars_arity + 1)] = (CELL) HR; \
328 RESET_VARIABLE((CELL) HR); \
329 HR += 2; \
330 next_trie_instruction(node)
331
332
333
334/************************************************************************
335 ** aux_stack_val_(in_pair_)instr **
336 ************************************************************************/
337
338#define aux_stack_val_instr() \
339 if (heap_arity) { \
340 CELL aux_sub, aux_var; \
341 aux_sub = aux_stack[HEAP_ENTRY(1)]; \
342 aux_var = aux_stack[VARS_ENTRY(var_index + 1)]; \
343 if (aux_sub > aux_var) { \
344 Bind_Global((CELL *) aux_sub, aux_var); \
345 } else { \
346 RESET_VARIABLE(aux_sub); \
347 Bind_Local((CELL *) aux_var, aux_sub); \
348 aux_stack[VARS_ENTRY(var_index + 1)] = aux_sub; \
349 } \
350 TOP_STACK = &aux_stack[1]; \
351 TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity - 1; \
352 next_instruction(heap_arity - 1 || subs_arity, node); \
353 } else { \
354 CELL aux_sub, aux_var; \
355 aux_sub = aux_stack[SUBS_ENTRY(1)]; \
356 aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
357 aux_var = aux_stack[VARS_ENTRY(var_index + 1)]; \
358 if (aux_sub > aux_var) { \
359 if ((CELL *) aux_sub <= HR) { \
360 Bind_Global((CELL *) aux_sub, aux_var); \
361 } else if ((CELL *) aux_var <= HR) { \
362 Bind_Local((CELL *) aux_sub, aux_var); \
363 } else { \
364 Bind_Local((CELL *) aux_var, aux_sub); \
365 aux_stack[VARS_ENTRY(var_index + 1)] = aux_sub; \
366 } \
367 } else { \
368 if ((CELL *) aux_var <= HR) { \
369 Bind_Global((CELL *) aux_var, aux_sub); \
370 aux_stack[VARS_ENTRY(var_index + 1)] = aux_sub; \
371 } else if ((CELL *) aux_sub <= HR) { \
372 Bind_Local((CELL *) aux_var, aux_sub); \
373 aux_stack[VARS_ENTRY(var_index + 1)] = aux_sub; \
374 } else { \
375 Bind_Local((CELL *) aux_sub, aux_var); \
376 } \
377 } \
378 next_instruction(subs_arity - 1, node); \
379 }
380
381#define aux_stack_val_in_pair_instr() \
382 if (heap_arity) { \
383 Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsPair(HR)); \
384 } else { \
385 YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsPair(HR)); \
386 aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
387 TOP_STACK = &aux_stack[-1]; \
388 TOP_STACK[HEAP_ARITY_ENTRY] = 1; \
389 } \
390 { CELL aux_sub, aux_var; \
391 aux_sub = (CELL) HR; \
392 aux_var = aux_stack[VARS_ENTRY(var_index + 1)]; \
393 if (aux_sub > aux_var) { \
394 Bind_Global((CELL *) aux_sub, aux_var); \
395 } else { \
396 RESET_VARIABLE(aux_sub); \
397 Bind_Local((CELL *) aux_var, aux_sub); \
398 aux_stack[VARS_ENTRY(var_index + 1)] = aux_sub; \
399 } \
400 } \
401 TOP_STACK[HEAP_ENTRY(1)] = (CELL) (HR + 1); \
402 HR += 2; \
403 next_trie_instruction(node)
404
405
406/************************************************************************
407** Trie instructions **
408************************************************************************/
409
410PBOp(trie_do_var, e)
411{ printf("Tries not supported by JIT!!\n"); exit(1); }
412
413ENDPBOp();
414
415
416PBOp(trie_trust_var, e)
417{ printf("Tries not supported by JIT!!\n"); exit(1); }
418ENDPBOp();
419
420
421PBOp(trie_try_var, e)
422 { printf("Tries not supported by JIT!!\n"); exit(1); }
423ENDPBOp();
424
425
426
427PBOp(trie_retry_var, e)
428{ printf("Tries not supported by JIT!!\n"); exit(1); }
429ENDPBOp();
430
431
432 PBOp(trie_do_var_in_pair, e)
433 { printf("Tries not supported by JIT!!\n"); exit(1); }
434ENDPBOp();
435
436
437 PBOp(trie_trust_var_in_pair, e)
438 { printf("Tries not supported by JIT!!\n"); exit(1); }
439ENDPBOp();
440
441
442 PBOp(trie_try_var_in_pair, e)
443 { printf("Tries not supported by JIT!!\n"); exit(1); }
444ENDPBOp();
445
446
447 PBOp(trie_retry_var_in_pair, e)
448 { printf("Tries not supported by JIT!!\n"); exit(1); }
449ENDPBOp();
450
451
452 PBOp(trie_do_val, e)
453 { printf("Tries not supported by JIT!!\n"); exit(1); }
454ENDPBOp();
455
456
457 PBOp(trie_trust_val, e)
458 { printf("Tries not supported by JIT!!\n"); exit(1); }
459ENDPBOp();
460
461
462 PBOp(trie_try_val, e)
463 { printf("Tries not supported by JIT!!\n"); exit(1); }
464ENDPBOp();
465
466
467 PBOp(trie_retry_val, e)
468 { printf("Tries not supported by JIT!!\n"); exit(1); }
469ENDPBOp();
470
471
472 PBOp(trie_do_val_in_pair, e)
473 { printf("Tries not supported by JIT!!\n"); exit(1); }
474ENDPBOp();
475
476
477 PBOp(trie_trust_val_in_pair, e)
478 { printf("Tries not supported by JIT!!\n"); exit(1); }
479ENDPBOp();
480
481
482 PBOp(trie_try_val_in_pair, e)
483 { printf("Tries not supported by JIT!!\n"); exit(1); }
484ENDPBOp();
485
486
487 PBOp(trie_retry_val_in_pair, e)
488 { printf("Tries not supported by JIT!!\n"); exit(1); }
489ENDPBOp();
490
491
492 PBOp(trie_do_atom, e)
493 { printf("Tries not supported by JIT!!\n"); exit(1); }
494ENDPBOp();
495
496
497 PBOp(trie_trust_atom, e)
498 { printf("Tries not supported by JIT!!\n"); exit(1); }
499ENDPBOp();
500
501
502 PBOp(trie_try_atom, e)
503 { printf("Tries not supported by JIT!!\n"); exit(1); }
504ENDPBOp();
505
506
507 PBOp(trie_retry_atom, e)
508 { printf("Tries not supported by JIT!!\n"); exit(1); }
509ENDPBOp();
510
511
512 PBOp(trie_do_atom_in_pair, e)
513 { printf("Tries not supported by JIT!!\n"); exit(1); }
514ENDPBOp();
515
516
517 PBOp(trie_trust_atom_in_pair, e)
518 { printf("Tries not supported by JIT!!\n"); exit(1); }
519ENDPBOp();
520
521
522 PBOp(trie_try_atom_in_pair, e)
523 { printf("Tries not supported by JIT!!\n"); exit(1); }
524ENDPBOp();
525
526
527 PBOp(trie_retry_atom_in_pair, e)
528 { printf("Tries not supported by JIT!!\n"); exit(1); }
529ENDPBOp();
530
531
532 PBOp(trie_do_null, e)
533 { printf("Tries not supported by JIT!!\n"); exit(1); }
534ENDPBOp();
535
536
537 PBOp(trie_trust_null, e)
538 { printf("Tries not supported by JIT!!\n"); exit(1); }
539ENDPBOp();
540
541
542 PBOp(trie_try_null, e)
543 { printf("Tries not supported by JIT!!\n"); exit(1); }
544ENDPBOp();
545
546
547 PBOp(trie_retry_null, e)
548 { printf("Tries not supported by JIT!!\n"); exit(1); }
549ENDPBOp();
550
551
552 PBOp(trie_do_null_in_pair, e)
553 { printf("Tries not supported by JIT!!\n"); exit(1); }
554ENDPBOp();
555
556
557 PBOp(trie_trust_null_in_pair, e)
558{ printf("Tries not supported by JIT!!\n"); exit(1); }
559ENDPBOp();
560
561
562PBOp(trie_try_null_in_pair, e)
563 { printf("Tries not supported by JIT!!\n"); exit(1); }
564ENDPBOp();
565
566
567 PBOp(trie_retry_null_in_pair, e)
568{ printf("Tries not supported by JIT!!\n"); exit(1); }
569ENDPBOp();
570
571
572PBOp(trie_do_pair, e)
573 { printf("Tries not supported by JIT!!\n"); exit(1); }
574ENDPBOp();
575
576
577 PBOp(trie_trust_pair, e)
578 { printf("Tries not supported by JIT!!\n"); exit(1); }
579ENDPBOp();
580
581
582 PBOp(trie_try_pair, e)
583 { printf("Tries not supported by JIT!!\n"); exit(1); }
584ENDPBOp();
585
586
587 PBOp(trie_retry_pair, e)
588 { printf("Tries not supported by JIT!!\n"); exit(1); }
589ENDPBOp();
590
591
592 PBOp(trie_do_appl, e)
593 { printf("Tries not supported by JIT!!\n"); exit(1); }
594ENDPBOp();
595
596
597 PBOp(trie_trust_appl, e)
598 { printf("Tries not supported by JIT!!\n"); exit(1); }
599ENDPBOp();
600
601
602 PBOp(trie_try_appl, e)
603 { printf("Tries not supported by JIT!!\n"); exit(1); }
604ENDPBOp();
605
606
607 PBOp(trie_retry_appl, e)
608 { printf("Tries not supported by JIT!!\n"); exit(1); }
609ENDPBOp();
610
611
612 PBOp(trie_do_appl_in_pair, e)
613{ printf("Tries not supported by JIT!!\n"); exit(1); }
614ENDPBOp();
615
616
617 PBOp(trie_trust_appl_in_pair, e)
618 { printf("Tries not supported by JIT!!\n"); exit(1); }
619ENDPBOp();
620
621
622 PBOp(trie_try_appl_in_pair, e)
623 { printf("Tries not supported by JIT!!\n"); exit(1); }
624ENDPBOp();
625
626
627 PBOp(trie_retry_appl_in_pair, e)
628 { printf("Tries not supported by JIT!!\n"); exit(1); }
629ENDPBOp();
630
631
632 PBOp(trie_do_extension, e)
633 { printf("Tries not supported by JIT!!\n"); exit(1); }
634ENDPBOp();
635
636
637 PBOp(trie_trust_extension, e)
638 { printf("Tries not supported by JIT!!\n"); exit(1); }
639ENDPBOp();
640
641
642 PBOp(trie_try_extension, e)
643 { printf("Tries not supported by JIT!!\n"); exit(1); }
644ENDPBOp();
645
646
647 PBOp(trie_retry_extension, e)
648 { printf("Tries not supported by JIT!!\n"); exit(1); }
649ENDPBOp();
650
651
652 PBOp(trie_do_double, e)
653 register ans_node_ptr node = (ans_node_ptr) PREG;
654 register CELL *aux_stack = TOP_STACK;
655 int heap_arity = aux_stack[HEAP_ARITY_ENTRY];
656 int vars_arity = aux_stack[VARS_ARITY_ENTRY];
657 int subs_arity = aux_stack[SUBS_ARITY_ENTRY];
658 volatile union {
659 Float dbl;
660 Term ts[SIZEOF_DOUBLE/SIZEOF_INT_P];
661 } td;
662 Term t;
663
664#if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P
665 td.ts[0] = aux_stack[HEAP_ENTRY(1)];
666 td.ts[1] = aux_stack[HEAP_ENTRY(3)]; /* jump the first extension mark */
667 heap_arity -= 4;
668 TOP_STACK = aux_stack = &aux_stack[4]; /* jump until the second extension mark */
669#else /* SIZEOF_DOUBLE == SIZEOF_INT_P */
670 td.ts[0] = aux_stack[HEAP_ENTRY(1)];
671 heap_arity -= 2;
672 TOP_STACK = aux_stack = &aux_stack[2]; /* jump until the extension mark */
673#endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */
674 TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity;
675 t = MkFloatTerm(td.dbl);
676 aux_stack_term_instr();
677 { printf("Tries not supported by JIT!!\n"); exit(1); }
678ENDPBOp();
679
680
681 BOp(trie_trust_double, e)
682 Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "trie_trust_double: invalid instruction");
683 ENDBOp();
684
685
686 BOp(trie_try_double, e)
687 Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "trie_try_double: invalid instruction");
688 ENDBOp();
689
690
691 BOp(trie_retry_double, e)
692 Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "trie_retry_double: invalid instruction");
693 ENDBOp();
694
695
696 PBOp(trie_do_longint, e)
697 register ans_node_ptr node = (ans_node_ptr) PREG;
698 register CELL *aux_stack = TOP_STACK;
699 int heap_arity = aux_stack[HEAP_ARITY_ENTRY];
700 int vars_arity = aux_stack[VARS_ARITY_ENTRY];
701 int subs_arity = aux_stack[SUBS_ARITY_ENTRY];
702 Term t = MkLongIntTerm(aux_stack[HEAP_ENTRY(1)]);
703
704 heap_arity -= 2;
705 TOP_STACK = aux_stack = &aux_stack[2]; /* jump until the extension mark */
706 TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity;
707 aux_stack_term_instr();
708 { printf("Tries not supported by JIT!!\n"); exit(1); }
709ENDPBOp();
710
711
712 BOp(trie_trust_longint, e)
713 Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "trie_trust_longint: invalid instruction");
714 ENDBOp();
715
716
717 BOp(trie_try_longint, e)
718 Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "trie_try_longint: invalid instruction");
719 ENDBOp();
720
721
722 BOp(trie_retry_longint, e)
723 ENDBOp();
724
725
726 PBOp(trie_do_bigint, e)
727 { printf("Tries not supported by JIT!!\n"); exit(1); }
728ENDPBOp();
729
730
731 BOp(trie_trust_bigint, e)
732 ENDBOp();
733
734
735 BOp(trie_try_bigint, e)
736 ENDBOp();
737
738
739 BOp(trie_retry_bigint, e)
740 ENDBOp();
741
742
743
744 PBOp(trie_do_gterm, e)
745
746 { printf("Tries not supported by JIT!!\n"); exit(1); }
747ENDPBOp();
748
749
750 PBOp(trie_trust_gterm, e)
751 { printf("Tries not supported by JIT!!\n"); exit(1); }
752ENDPBOp();
753
754
755 PBOp(trie_try_gterm, e)
756 { printf("Tries not supported by JIT!!\n"); exit(1); }
757ENDPBOp();
758
759
760 PBOp(trie_retry_gterm, e)
761 { printf("Tries not supported by JIT!!\n"); exit(1); }
762ENDPBOp();