371 lines
9.0 KiB
C
371 lines
9.0 KiB
C
/************************************************************************
|
|
** **
|
|
** The YapTab/YapOr/OPTYap systems **
|
|
** **
|
|
** YapTab extends the Yap Prolog engine to support sequential tabling **
|
|
** YapOr extends the Yap Prolog engine to support or-parallelism **
|
|
** OPTYap extends the Yap Prolog engine to support or-parallel tabling **
|
|
** **
|
|
** **
|
|
** Yap Prolog was developed at University of Porto, Portugal **
|
|
** **
|
|
************************************************************************/
|
|
|
|
/************************************************************************
|
|
** Trie instructions **
|
|
************************************************************************/
|
|
|
|
PBOp(traced_trie_do_var, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_var, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_var, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
|
|
PBOp(traced_trie_retry_var, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_var_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_var_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_var_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_retry_var_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_val, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_val, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_val, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_retry_val, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_val_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_val_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_val_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_retry_val_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_atom, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_atom, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_atom, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_retry_atom, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_atom_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_atom_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_atom_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_retry_atom_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_null, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_null, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_null, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_retry_null, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_null_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_null_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_null_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_retry_null_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_retry_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_appl, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_appl, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_appl, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_retry_appl, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_appl_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_appl_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_appl_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_retry_appl_in_pair, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_extension, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_extension, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_extension, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_retry_extension, e)
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_double, e)
|
|
register ans_node_ptr node = (ans_node_ptr) PREG;
|
|
register CELL *aux_stack = TOP_STACK;
|
|
int heap_arity = aux_stack[HEAP_ARITY_ENTRY];
|
|
int vars_arity = aux_stack[VARS_ARITY_ENTRY];
|
|
int subs_arity = aux_stack[SUBS_ARITY_ENTRY];
|
|
volatile union {
|
|
Float dbl;
|
|
Term ts[SIZEOF_DOUBLE/SIZEOF_INT_P];
|
|
} td;
|
|
Term t;
|
|
|
|
#if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P
|
|
td.ts[0] = aux_stack[HEAP_ENTRY(1)];
|
|
td.ts[1] = aux_stack[HEAP_ENTRY(3)]; /* jump the first extension mark */
|
|
heap_arity -= 4;
|
|
TOP_STACK = aux_stack = &aux_stack[4]; /* jump until the second extension mark */
|
|
#else /* SIZEOF_DOUBLE == SIZEOF_INT_P */
|
|
td.ts[0] = aux_stack[HEAP_ENTRY(1)];
|
|
heap_arity -= 2;
|
|
TOP_STACK = aux_stack = &aux_stack[2]; /* jump until the extension mark */
|
|
#endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */
|
|
TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity;
|
|
t = MkFloatTerm(td.dbl);
|
|
aux_stack_term_instr();
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
BOp(traced_trie_trust_double, e)
|
|
Yap_Error(INTERNAL_ERROR, TermNil, "trie_trust_double: invalid instruction");
|
|
ENDBOp();
|
|
|
|
|
|
BOp(traced_trie_try_double, e)
|
|
Yap_Error(INTERNAL_ERROR, TermNil, "trie_try_double: invalid instruction");
|
|
ENDBOp();
|
|
|
|
|
|
BOp(traced_trie_retry_double, e)
|
|
Yap_Error(INTERNAL_ERROR, TermNil, "trie_retry_double: invalid instruction");
|
|
ENDBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_longint, e)
|
|
register ans_node_ptr node = (ans_node_ptr) PREG;
|
|
register CELL *aux_stack = TOP_STACK;
|
|
int heap_arity = aux_stack[HEAP_ARITY_ENTRY];
|
|
int vars_arity = aux_stack[VARS_ARITY_ENTRY];
|
|
int subs_arity = aux_stack[SUBS_ARITY_ENTRY];
|
|
Term t = MkLongIntTerm(aux_stack[HEAP_ENTRY(1)]);
|
|
|
|
heap_arity -= 2;
|
|
TOP_STACK = aux_stack = &aux_stack[2]; /* jump until the extension mark */
|
|
TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity;
|
|
aux_stack_term_instr();
|
|
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
BOp(traced_trie_trust_longint, e)
|
|
Yap_Error(INTERNAL_ERROR, TermNil, "trie_trust_longint: invalid instruction");
|
|
ENDBOp();
|
|
|
|
|
|
BOp(traced_trie_try_longint, e)
|
|
Yap_Error(INTERNAL_ERROR, TermNil, "traced_trie_try_longint: invalid instruction");
|
|
ENDBOp();
|
|
|
|
|
|
BOp(traced_trie_retry_longint, e)
|
|
ENDBOp();
|
|
|
|
|
|
PBOp(traced_trie_do_bigint, e)
|
|
{ printf("Traced_Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
BOp(traced_trie_trust_bigint, e)
|
|
ENDBOp();
|
|
|
|
|
|
BOp(traced_trie_try_bigint, e)
|
|
ENDBOp();
|
|
|
|
|
|
BOp(traced_trie_retry_bigint, e)
|
|
ENDBOp();
|
|
|
|
|
|
|
|
PBOp(traced_trie_do_gterm, e)
|
|
|
|
{ printf("Traced_Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_trust_gterm, e)
|
|
{ printf("Traced_Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_try_gterm, e)
|
|
{ printf("Traced_Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|
|
|
|
|
|
PBOp(traced_trie_retry_gterm, e)
|
|
{ printf("Traced_Tries not supported by JIT!!\n"); exit(1); }
|
|
ENDPBOp();
|