system_preds

This commit is contained in:
Vitor Santos Costa
2017-06-16 11:53:21 +01:00
parent 97aad19cd0
commit 8ac3d980c2
4 changed files with 23 additions and 2 deletions

View File

@@ -2534,6 +2534,24 @@ static Int
// return (out);
}
static Int
p_is_opaque_predicate(USES_REGS1) { /* '$is_multifile'(+S,+Mod) */
PredEntry *pe;
Term t1 = Deref(ARG1);
bool out;
// pe = Yap_get_pred(t1, Deref(ARG2), "system_predicate");
// if (!pe)
pe = Yap_get_pred(t1, Deref(ARG2), "system_predicate");
// if (!pe) pe = Yap_get_pred(t1, USER_MODULE, "system_predicate");
if (EndOfPAEntr(pe))
return FALSE;
return (pe->ModuleOfPred == 0 ||
pe->PredFlags & (SystemPredFlags|ForeignPredFlags));
UNLOCKPE(44, pe);
return (out);
}
static Int p_is_thread_local(USES_REGS1) { /* '$is_dynamic'(+P) */
PredEntry *pe;
bool out;
@@ -4724,6 +4742,8 @@ void Yap_InitCdMgr(void) {
SafePredFlag | SyncPredFlag);
Yap_InitCPred("$is_system_predicate", 2, p_is_system_predicate,
TestPredFlag | SafePredFlag);
Yap_InitCPred("$is_opaque_predicate", 2, p_is_opaque_predicate,
TestPredFlag | SafePredFlag);
Yap_InitCPred("$new_discontiguous", 3, p_new_discontiguous,
SafePredFlag | SyncPredFlag);
Yap_InitCPred("$is_discontiguous", 2, p_is_discontiguous,