change the way predicates are hidden
This commit is contained in:
parent
7d7a59ae28
commit
88f2dc7730
39
C/absmi.c
39
C/absmi.c
@ -2948,46 +2948,9 @@ Yap_absmi(int inp)
|
|||||||
if (LOCAL_ActiveSignals & YAP_CREEP_SIGNAL) {
|
if (LOCAL_ActiveSignals & YAP_CREEP_SIGNAL) {
|
||||||
PredEntry *ap = PREG->u.pp.p;
|
PredEntry *ap = PREG->u.pp.p;
|
||||||
|
|
||||||
if (ap->PredFlags & HiddenPredFlag) {
|
|
||||||
CACHE_Y_AS_ENV(YREG);
|
|
||||||
CACHE_A1();
|
|
||||||
check_depth(DEPTH, ap);
|
|
||||||
PREG = ap->CodeOfPred;
|
|
||||||
/* for profiler */
|
|
||||||
save_pc();
|
|
||||||
ALWAYS_LOOKAHEAD(ap->OpcodeOfPred);
|
|
||||||
/* do deallocate */
|
|
||||||
CPREG = (yamop *) ENV_YREG[E_CP];
|
|
||||||
ENV_YREG = ENV = (CELL *) ENV_YREG[E_E];
|
|
||||||
#ifdef FROZEN_STACKS
|
|
||||||
{
|
|
||||||
choiceptr top_b = PROTECT_FROZEN_B(B);
|
|
||||||
|
|
||||||
#ifdef YAPOR_SBA
|
|
||||||
if (ENV_YREG > (CELL *) top_b || ENV_YREG < H) ENV_YREG = (CELL *) top_b;
|
|
||||||
#else
|
|
||||||
if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b;
|
|
||||||
#endif
|
|
||||||
else ENV_YREG = (CELL *)((CELL)ENV_YREG + ENV_Size(CPREG));
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (ENV_YREG > (CELL *)B) {
|
|
||||||
ENV_YREG = (CELL *)B;
|
|
||||||
} else {
|
|
||||||
ENV_YREG = (CELL *) ((CELL) ENV_YREG + ENV_Size(CPREG));
|
|
||||||
}
|
|
||||||
#endif /* FROZEN_STACKS */
|
|
||||||
WRITEBACK_Y_AS_ENV();
|
|
||||||
/* setup GB */
|
|
||||||
ENV_YREG[E_CB] = (CELL) B;
|
|
||||||
ALWAYS_GONext();
|
|
||||||
ALWAYS_END_PREFETCH();
|
|
||||||
ENDCACHE_Y_AS_ENV();
|
|
||||||
} else {
|
|
||||||
SREG = (CELL *) ap;
|
SREG = (CELL *) ap;
|
||||||
goto creepde;
|
goto creepde;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/* set SREG for next instructions */
|
/* set SREG for next instructions */
|
||||||
SREG = (CELL *) PREG->u.p.p;
|
SREG = (CELL *) PREG->u.p.p;
|
||||||
if (LOCAL_ActiveSignals & YAP_CDOVF_SIGNAL) {
|
if (LOCAL_ActiveSignals & YAP_CDOVF_SIGNAL) {
|
||||||
@ -6918,7 +6881,7 @@ Yap_absmi(int inp)
|
|||||||
|
|
||||||
BOp(call_cpred, Osbpp);
|
BOp(call_cpred, Osbpp);
|
||||||
check_trail(TR);
|
check_trail(TR);
|
||||||
if (!(PREG->u.Osbpp.p->PredFlags & (SafePredFlag|HiddenPredFlag))) {
|
if (!(PREG->u.Osbpp.p->PredFlags & (SafePredFlag))) {
|
||||||
CACHE_Y_AS_ENV(YREG);
|
CACHE_Y_AS_ENV(YREG);
|
||||||
check_stack(NoStackCall, H);
|
check_stack(NoStackCall, H);
|
||||||
ENDCACHE_Y_AS_ENV();
|
ENDCACHE_Y_AS_ENV();
|
||||||
|
6
C/agc.c
6
C/agc.c
@ -557,7 +557,7 @@ p_agc_threshold(USES_REGS1)
|
|||||||
void
|
void
|
||||||
Yap_init_agc(void)
|
Yap_init_agc(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPred("$atom_gc", 0, p_atom_gc, HiddenPredFlag);
|
Yap_InitCPred("$atom_gc", 0, p_atom_gc, 0);
|
||||||
Yap_InitCPred("$inform_agc", 3, p_inform_agc, HiddenPredFlag);
|
Yap_InitCPred("$inform_agc", 3, p_inform_agc, 0);
|
||||||
Yap_InitCPred("$agc_threshold", 1, p_agc_threshold, HiddenPredFlag|SafePredFlag);
|
Yap_InitCPred("$agc_threshold", 1, p_agc_threshold, SafePredFlag);
|
||||||
}
|
}
|
||||||
|
14
C/arrays.c
14
C/arrays.c
@ -2445,9 +2445,9 @@ p_static_array_location( USES_REGS1 )
|
|||||||
void
|
void
|
||||||
Yap_InitArrayPreds( void )
|
Yap_InitArrayPreds( void )
|
||||||
{
|
{
|
||||||
Yap_InitCPred("$create_array", 2, p_create_array, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$create_array", 2, p_create_array, SyncPredFlag);
|
||||||
Yap_InitCPred("$array_references", 3, p_array_references, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$array_references", 3, p_array_references, SafePredFlag);
|
||||||
Yap_InitCPred("$array_arg", 3, p_array_arg, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$array_arg", 3, p_array_arg, SafePredFlag);
|
||||||
Yap_InitCPred("static_array", 3, p_create_static_array, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("static_array", 3, p_create_static_array, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("resize_static_array", 3, p_resize_static_array, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("resize_static_array", 3, p_resize_static_array, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("mmapped_array", 4, p_create_mmapped_array, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("mmapped_array", 4, p_create_mmapped_array, SafePredFlag|SyncPredFlag);
|
||||||
@ -2457,10 +2457,10 @@ Yap_InitArrayPreds( void )
|
|||||||
Yap_InitCPred("array_element", 3, p_access_array, 0);
|
Yap_InitCPred("array_element", 3, p_access_array, 0);
|
||||||
Yap_InitCPred("reset_static_array", 1, p_clear_static_array, SafePredFlag);
|
Yap_InitCPred("reset_static_array", 1, p_clear_static_array, SafePredFlag);
|
||||||
Yap_InitCPred("close_static_array", 1, p_close_static_array, SafePredFlag);
|
Yap_InitCPred("close_static_array", 1, p_close_static_array, SafePredFlag);
|
||||||
Yap_InitCPred("$sync_mmapped_arrays", 0, p_sync_mmapped_arrays, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$sync_mmapped_arrays", 0, p_sync_mmapped_arrays, SafePredFlag);
|
||||||
Yap_InitCPred("$compile_array_refs", 0, p_compile_array_refs, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$compile_array_refs", 0, p_compile_array_refs, SafePredFlag);
|
||||||
Yap_InitCPred("$array_refs_compiled", 0, p_array_refs_compiled, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$array_refs_compiled", 0, p_array_refs_compiled, SafePredFlag);
|
||||||
Yap_InitCPred("$static_array_properties", 3, p_static_array_properties, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$static_array_properties", 3, p_static_array_properties, SafePredFlag);
|
||||||
Yap_InitCPred("static_array_to_term", 2, p_static_array_to_term, 0L);
|
Yap_InitCPred("static_array_to_term", 2, p_static_array_to_term, 0L);
|
||||||
Yap_InitCPred("static_array_location", 2, p_static_array_location, 0L);
|
Yap_InitCPred("static_array_location", 2, p_static_array_location, 0L);
|
||||||
}
|
}
|
||||||
|
@ -1075,7 +1075,7 @@ void Yap_InitAttVarPreds(void)
|
|||||||
Yap_InitCPred("all_attvars", 1, p_all_attvars, 0);
|
Yap_InitCPred("all_attvars", 1, p_all_attvars, 0);
|
||||||
CurrentModule = OldCurrentModule;
|
CurrentModule = OldCurrentModule;
|
||||||
Yap_InitCPred("attvar", 1, p_is_attvar, SafePredFlag|TestPredFlag);
|
Yap_InitCPred("attvar", 1, p_is_attvar, SafePredFlag|TestPredFlag);
|
||||||
Yap_InitCPred("$att_bound", 1, p_attvar_bound, SafePredFlag|TestPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$att_bound", 1, p_attvar_bound, SafePredFlag|TestPredFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
2
C/bb.c
2
C/bb.c
@ -375,6 +375,6 @@ Yap_InitBBPreds(void)
|
|||||||
Yap_InitCPred("bb_get", 2, p_bb_get, 0);
|
Yap_InitCPred("bb_get", 2, p_bb_get, 0);
|
||||||
Yap_InitCPred("bb_delete", 2, p_bb_delete, 0);
|
Yap_InitCPred("bb_delete", 2, p_bb_delete, 0);
|
||||||
Yap_InitCPred("bb_update", 3, p_bb_update, 0);
|
Yap_InitCPred("bb_update", 3, p_bb_update, 0);
|
||||||
Yap_InitCPred("$resize_bb_int_keys", 1, p_resize_bb_int_keys, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$resize_bb_int_keys", 1, p_resize_bb_int_keys, SafePredFlag|SyncPredFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,8 +556,8 @@ Yap_BlobStringOfTermAndLength(Term t, size_t *sp)
|
|||||||
void
|
void
|
||||||
Yap_InitBigNums(void)
|
Yap_InitBigNums(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPred("$has_bignums", 0, p_has_bignums, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$has_bignums", 0, p_has_bignums, SafePredFlag);
|
||||||
Yap_InitCPred("$bignum", 1, p_is_bignum, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$bignum", 1, p_is_bignum, SafePredFlag);
|
||||||
Yap_InitCPred("rational", 3, p_rational, 0);
|
Yap_InitCPred("rational", 3, p_rational, 0);
|
||||||
Yap_InitCPred("rational", 1, p_is_rational, SafePredFlag);
|
Yap_InitCPred("rational", 1, p_is_rational, SafePredFlag);
|
||||||
}
|
}
|
||||||
|
162
C/cdmgr.c
162
C/cdmgr.c
@ -4335,6 +4335,42 @@ p_all_system_pred( USES_REGS1 )
|
|||||||
pe->OpcodeOfPred == Yap_opcode(_try_userc));
|
pe->OpcodeOfPred == Yap_opcode(_try_userc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Yap_HidePred(PredEntry *pe)
|
||||||
|
{
|
||||||
|
Prop p0 = AbsPredProp(pe);
|
||||||
|
if (pe->ArityOfPE == 0) {
|
||||||
|
Atom a = (Atom)pe->FunctorOfPred;
|
||||||
|
|
||||||
|
p0 = RepAtom(a)->PropsOfAE;
|
||||||
|
if (p0 == AbsPredProp(pe)) {
|
||||||
|
RepAtom(a)->PropsOfAE = pe->NextOfPE;
|
||||||
|
} else {
|
||||||
|
while (p0->NextOfPE != AbsPredProp(pe))
|
||||||
|
p0 = p0->NextOfPE;
|
||||||
|
if (p0 == NIL)
|
||||||
|
return;
|
||||||
|
p0->NextOfPE = pe->NextOfPE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Functor funt = pe->FunctorOfPred;
|
||||||
|
|
||||||
|
p0 = funt->PropsOfFE;
|
||||||
|
if (p0 == AbsPredProp(pe)) {
|
||||||
|
funt->PropsOfFE = pe->NextOfPE;
|
||||||
|
} else {
|
||||||
|
while (p0->NextOfPE != AbsPredProp(pe))
|
||||||
|
p0 = p0->NextOfPE;
|
||||||
|
if (p0 == NIL)
|
||||||
|
return;
|
||||||
|
p0->NextOfPE = pe->NextOfPE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pe->NextOfPE = HIDDEN_PREDICATES;
|
||||||
|
HIDDEN_PREDICATES = AbsPredProp(pe);
|
||||||
|
pe->PredFlags |= HiddenPredFlag;
|
||||||
|
}
|
||||||
|
|
||||||
static Int /* $system_predicate(P) */
|
static Int /* $system_predicate(P) */
|
||||||
p_hide_predicate( USES_REGS1 )
|
p_hide_predicate( USES_REGS1 )
|
||||||
{
|
{
|
||||||
@ -4342,12 +4378,15 @@ p_hide_predicate( USES_REGS1 )
|
|||||||
|
|
||||||
Term t1 = Deref(ARG1);
|
Term t1 = Deref(ARG1);
|
||||||
Term mod = Deref(ARG2);
|
Term mod = Deref(ARG2);
|
||||||
|
Prop p0;
|
||||||
|
|
||||||
restart_system_pred:
|
restart_system_pred:
|
||||||
if (IsVarTerm(t1))
|
if (IsVarTerm(t1))
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
if (IsAtomTerm(t1)) {
|
if (IsAtomTerm(t1)) {
|
||||||
pe = RepPredProp(Yap_GetPredPropByAtom(AtomOfTerm(t1), mod));
|
Atom a = AtomOfTerm(t1);
|
||||||
|
|
||||||
|
pe = RepPredProp(Yap_GetPredPropByAtom(a, mod));
|
||||||
} else if (IsApplTerm(t1)) {
|
} else if (IsApplTerm(t1)) {
|
||||||
Functor funt = FunctorOfTerm(t1);
|
Functor funt = FunctorOfTerm(t1);
|
||||||
if (IsExtensionFunctor(funt)) {
|
if (IsExtensionFunctor(funt)) {
|
||||||
@ -4368,15 +4407,16 @@ p_hide_predicate( USES_REGS1 )
|
|||||||
}
|
}
|
||||||
pe = RepPredProp(Yap_GetPredPropByFunc(funt, mod));
|
pe = RepPredProp(Yap_GetPredPropByFunc(funt, mod));
|
||||||
} else if (IsPairTerm(t1)) {
|
} else if (IsPairTerm(t1)) {
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
} else
|
} else
|
||||||
return (FALSE);
|
return FALSE;
|
||||||
if (EndOfPAEntr(pe))
|
if (EndOfPAEntr(pe))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
pe->PredFlags |= HiddenPredFlag;
|
Yap_HidePred(pe);
|
||||||
return(TRUE);
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Int /* $hidden_predicate(P) */
|
static Int /* $hidden_predicate(P) */
|
||||||
p_hidden_predicate( USES_REGS1 )
|
p_hidden_predicate( USES_REGS1 )
|
||||||
{
|
{
|
||||||
@ -5888,65 +5928,65 @@ Yap_InitCdMgr(void)
|
|||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
Term cm = CurrentModule;
|
Term cm = CurrentModule;
|
||||||
|
|
||||||
Yap_InitCPred("$compile_mode", 2, p_compile_mode, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$compile_mode", 2, p_compile_mode, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$start_consult", 3, p_startconsult, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$start_consult", 3, p_startconsult, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$show_consult_level", 1, p_showconslultlev, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$show_consult_level", 1, p_showconslultlev, SafePredFlag);
|
||||||
Yap_InitCPred("$end_consult", 0, p_endconsult, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$end_consult", 0, p_endconsult, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$set_spy", 2, p_setspy, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$set_spy", 2, p_setspy, SyncPredFlag);
|
||||||
Yap_InitCPred("$rm_spy", 2, p_rmspy, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$rm_spy", 2, p_rmspy, SafePredFlag|SyncPredFlag);
|
||||||
/* gc() may happen during compilation, hence these predicates are
|
/* gc() may happen during compilation, hence these predicates are
|
||||||
now unsafe */
|
now unsafe */
|
||||||
Yap_InitCPred("$compile", 4, p_compile, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$compile", 4, p_compile, SyncPredFlag);
|
||||||
Yap_InitCPred("$compile_dynamic", 5, p_compile_dynamic, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$compile_dynamic", 5, p_compile_dynamic, SyncPredFlag);
|
||||||
Yap_InitCPred("$purge_clauses", 2, p_purge_clauses, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$purge_clauses", 2, p_purge_clauses, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$in_use", 2, p_in_use, TestPredFlag | SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$in_use", 2, p_in_use, TestPredFlag | SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$is_dynamic", 2, p_is_dynamic, TestPredFlag | SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$is_dynamic", 2, p_is_dynamic, TestPredFlag | SafePredFlag);
|
||||||
Yap_InitCPred("$is_metapredicate", 2, p_is_metapredicate, TestPredFlag | SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$is_metapredicate", 2, p_is_metapredicate, TestPredFlag | SafePredFlag);
|
||||||
Yap_InitCPred("$is_expand_goal_or_meta_predicate", 2, p_is_expandgoalormetapredicate, TestPredFlag | SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$is_expand_goal_or_meta_predicate", 2, p_is_expandgoalormetapredicate, TestPredFlag | SafePredFlag);
|
||||||
Yap_InitCPred("$is_log_updatable", 2, p_is_log_updatable, TestPredFlag | SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$is_log_updatable", 2, p_is_log_updatable, TestPredFlag | SafePredFlag);
|
||||||
Yap_InitCPred("$is_source", 2, p_is_source, TestPredFlag | SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$is_source", 2, p_is_source, TestPredFlag | SafePredFlag);
|
||||||
Yap_InitCPred("$owner_file", 3, p_owner_file, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$owner_file", 3, p_owner_file, SafePredFlag);
|
||||||
Yap_InitCPred("$mk_d", 2, p_mk_d, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$mk_d", 2, p_mk_d, SafePredFlag);
|
||||||
Yap_InitCPred("$pred_exists", 2, p_pred_exists, TestPredFlag | SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$pred_exists", 2, p_pred_exists, TestPredFlag | SafePredFlag);
|
||||||
Yap_InitCPred("$number_of_clauses", 3, p_number_of_clauses, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$number_of_clauses", 3, p_number_of_clauses, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$undefined", 2, p_undefined, SafePredFlag|TestPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$undefined", 2, p_undefined, SafePredFlag|TestPredFlag);
|
||||||
Yap_InitCPred("$optimizer_on", 0, p_optimizer_on, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$optimizer_on", 0, p_optimizer_on, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$clean_up_dead_clauses", 0, p_clean_up_dead_clauses, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$clean_up_dead_clauses", 0, p_clean_up_dead_clauses, SyncPredFlag);
|
||||||
Yap_InitCPred("$optimizer_off", 0, p_optimizer_off, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$optimizer_off", 0, p_optimizer_off, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$kill_dynamic", 2, p_kill_dynamic, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$kill_dynamic", 2, p_kill_dynamic, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$new_multifile", 3, p_new_multifile, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$new_multifile", 3, p_new_multifile, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$is_multifile", 2, p_is_multifile, TestPredFlag | SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$is_multifile", 2, p_is_multifile, TestPredFlag | SafePredFlag);
|
||||||
Yap_InitCPred("$is_profiled", 1, p_is_profiled, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$is_profiled", 1, p_is_profiled, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$profile_info", 3, p_profile_info, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$profile_info", 3, p_profile_info, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$profile_reset", 2, p_profile_reset, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$profile_reset", 2, p_profile_reset, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$is_call_counted", 1, p_is_call_counted, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$is_call_counted", 1, p_is_call_counted, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$call_count_info", 3, p_call_count_info, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$call_count_info", 3, p_call_count_info, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$call_count_set", 6, p_call_count_set, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$call_count_set", 6, p_call_count_set, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$call_count_reset", 0, p_call_count_reset, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$call_count_reset", 0, p_call_count_reset, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$toggle_static_predicates_in_use", 0, p_toggle_static_predicates_in_use, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$toggle_static_predicates_in_use", 0, p_toggle_static_predicates_in_use, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$set_pred_module", 2, p_set_pred_module, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$set_pred_module", 2, p_set_pred_module, SafePredFlag);
|
||||||
Yap_InitCPred("$parent_pred", 3, p_parent_pred, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$parent_pred", 3, p_parent_pred, SafePredFlag);
|
||||||
Yap_InitCPred("$system_predicate", 2, p_system_pred, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$system_predicate", 2, p_system_pred, SafePredFlag);
|
||||||
Yap_InitCPred("$all_system_predicate", 3, p_all_system_pred, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$all_system_predicate", 3, p_all_system_pred, SafePredFlag);
|
||||||
Yap_InitCPred("$hide_predicate", 2, p_hide_predicate, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$hide_predicate", 2, p_hide_predicate, SafePredFlag);
|
||||||
Yap_InitCPred("$hidden_predicate", 2, p_hidden_predicate, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$hidden_predicate", 2, p_hidden_predicate, SafePredFlag);
|
||||||
Yap_InitCPred("$pred_for_code", 5, p_pred_for_code, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$pred_for_code", 5, p_pred_for_code, SyncPredFlag);
|
||||||
Yap_InitCPred("$current_stack", 1, p_current_stack, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$current_stack", 1, p_current_stack, SyncPredFlag);
|
||||||
Yap_InitCPred("$log_update_clause", 4, p_log_update_clause, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$log_update_clause", 4, p_log_update_clause, SyncPredFlag);
|
||||||
Yap_InitCPred("$continue_log_update_clause", 5, p_continue_log_update_clause, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$continue_log_update_clause", 5, p_continue_log_update_clause, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$log_update_clause_erase", 4, p_log_update_clause_erase, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$log_update_clause_erase", 4, p_log_update_clause_erase, SyncPredFlag);
|
||||||
Yap_InitCPred("$continue_log_update_clause_erase", 5, p_continue_log_update_clause_erase, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$continue_log_update_clause_erase", 5, p_continue_log_update_clause_erase, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$static_clause", 4, p_static_clause, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$static_clause", 4, p_static_clause, SyncPredFlag);
|
||||||
Yap_InitCPred("$continue_static_clause", 5, p_continue_static_clause, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$continue_static_clause", 5, p_continue_static_clause, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$static_pred_statistics", 5, p_static_pred_statistics, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$static_pred_statistics", 5, p_static_pred_statistics, SyncPredFlag);
|
||||||
Yap_InitCPred("$p_nth_clause", 4, p_nth_clause, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$p_nth_clause", 4, p_nth_clause, SyncPredFlag);
|
||||||
Yap_InitCPred("$program_continuation", 3, p_program_continuation, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$program_continuation", 3, p_program_continuation, SafePredFlag|SyncPredFlag);
|
||||||
CurrentModule = HACKS_MODULE;
|
CurrentModule = HACKS_MODULE;
|
||||||
Yap_InitCPred("current_choicepoints", 1, p_all_choicepoints, HiddenPredFlag);
|
Yap_InitCPred("current_choicepoints", 1, p_all_choicepoints, 0);
|
||||||
Yap_InitCPred("current_continuations", 1, p_all_envs, HiddenPredFlag);
|
Yap_InitCPred("current_continuations", 1, p_all_envs, 0);
|
||||||
Yap_InitCPred("choicepoint", 7, p_choicepoint_info, HiddenPredFlag);
|
Yap_InitCPred("choicepoint", 7, p_choicepoint_info, 0);
|
||||||
Yap_InitCPred("continuation", 4, p_env_info, HiddenPredFlag);
|
Yap_InitCPred("continuation", 4, p_env_info,0);
|
||||||
Yap_InitCPred("cp_to_predicate", 5, p_cpc_info, HiddenPredFlag);
|
Yap_InitCPred("cp_to_predicate", 5, p_cpc_info, 0);
|
||||||
CurrentModule = cm;
|
CurrentModule = cm;
|
||||||
CurrentModule = DBLOAD_MODULE;
|
CurrentModule = DBLOAD_MODULE;
|
||||||
Yap_InitCPred("dbload_get_space", 4, p_dbload_get_space, 0L);
|
Yap_InitCPred("dbload_get_space", 4, p_dbload_get_space, 0L);
|
||||||
|
@ -728,7 +728,7 @@ Yap_InitCmpPreds(void)
|
|||||||
Yap_InitCmpPred("=<", 2, a_le, SafePredFlag | BinaryPredFlag);
|
Yap_InitCmpPred("=<", 2, a_le, SafePredFlag | BinaryPredFlag);
|
||||||
Yap_InitCmpPred("<", 2, a_lt, SafePredFlag | BinaryPredFlag);
|
Yap_InitCmpPred("<", 2, a_lt, SafePredFlag | BinaryPredFlag);
|
||||||
Yap_InitCmpPred(">=", 2, a_ge, SafePredFlag | BinaryPredFlag);
|
Yap_InitCmpPred(">=", 2, a_ge, SafePredFlag | BinaryPredFlag);
|
||||||
Yap_InitCPred("$a_compare", 3, p_acomp, TestPredFlag | SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$a_compare", 3, p_acomp, TestPredFlag | SafePredFlag);
|
||||||
Yap_InitCmpPred("\\==", 2, a_noteq, BinaryPredFlag | SafePredFlag);
|
Yap_InitCmpPred("\\==", 2, a_noteq, BinaryPredFlag | SafePredFlag);
|
||||||
Yap_InitCmpPred("@<", 2, a_gen_lt, BinaryPredFlag | SafePredFlag);
|
Yap_InitCmpPred("@<", 2, a_gen_lt, BinaryPredFlag | SafePredFlag);
|
||||||
Yap_InitCmpPred("@=<", 2, a_gen_le, BinaryPredFlag | SafePredFlag);
|
Yap_InitCmpPred("@=<", 2, a_gen_le, BinaryPredFlag | SafePredFlag);
|
||||||
|
12
C/corout.c
12
C/corout.c
@ -563,12 +563,12 @@ Yap_InitCoroutPreds( void )
|
|||||||
WakeUpCode = pred;
|
WakeUpCode = pred;
|
||||||
#endif
|
#endif
|
||||||
Yap_InitAttVarPreds();
|
Yap_InitAttVarPreds();
|
||||||
Yap_InitCPred("$yap_has_rational_trees", 0, p_yap_has_rational_trees, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$yap_has_rational_trees", 0, p_yap_has_rational_trees, SafePredFlag);
|
||||||
Yap_InitCPred("$yap_has_coroutining", 0, p_yap_has_coroutining, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$yap_has_coroutining", 0, p_yap_has_coroutining, SafePredFlag);
|
||||||
Yap_InitCPred("$can_unify", 3, p_can_unify, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$can_unify", 3, p_can_unify, SafePredFlag);
|
||||||
Yap_InitCPred("$non_ground", 2, p_non_ground, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$non_ground", 2, p_non_ground, SafePredFlag);
|
||||||
Yap_InitCPred("$coroutining", 0, p_coroutining, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$coroutining", 0, p_coroutining, SafePredFlag);
|
||||||
Yap_InitCPred("$awoken_goals", 1, p_awoken_goals, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$awoken_goals", 1, p_awoken_goals, SafePredFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
58
C/dbase.c
58
C/dbase.c
@ -5522,56 +5522,56 @@ Yap_InitDBPreds(void)
|
|||||||
Yap_InitCPred("recorded", 3, p_recorded, SyncPredFlag);
|
Yap_InitCPred("recorded", 3, p_recorded, SyncPredFlag);
|
||||||
Yap_InitCPred("recorda", 3, p_rcda, SyncPredFlag);
|
Yap_InitCPred("recorda", 3, p_rcda, SyncPredFlag);
|
||||||
Yap_InitCPred("recordz", 3, p_rcdz, SyncPredFlag);
|
Yap_InitCPred("recordz", 3, p_rcdz, SyncPredFlag);
|
||||||
Yap_InitCPred("$still_variant", 2, p_still_variant, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$still_variant", 2, p_still_variant, SyncPredFlag);
|
||||||
Yap_InitCPred("recorda_at", 3, p_rcda_at, SyncPredFlag);
|
Yap_InitCPred("recorda_at", 3, p_rcda_at, SyncPredFlag);
|
||||||
Yap_InitCPred("recordz_at", 3, p_rcdz_at, SyncPredFlag);
|
Yap_InitCPred("recordz_at", 3, p_rcdz_at, SyncPredFlag);
|
||||||
Yap_InitCPred("$recordap", 3, p_rcdap, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$recordap", 3, p_rcdap, SyncPredFlag);
|
||||||
Yap_InitCPred("$recordzp", 3, p_rcdzp, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$recordzp", 3, p_rcdzp, SyncPredFlag);
|
||||||
Yap_InitCPred("$recordap", 4, p_drcdap, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$recordap", 4, p_drcdap, SyncPredFlag);
|
||||||
Yap_InitCPred("$recordzp", 4, p_drcdzp, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$recordzp", 4, p_drcdzp, SyncPredFlag);
|
||||||
Yap_InitCPred("erase", 1, p_erase, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("erase", 1, p_erase, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$erase_clause", 2, p_erase_clause, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$erase_clause", 2, p_erase_clause, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("increase_reference_count", 1, p_increase_reference_counter, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("increase_reference_count", 1, p_increase_reference_counter, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("decrease_reference_count", 1, p_decrease_reference_counter, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("decrease_reference_count", 1, p_decrease_reference_counter, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("current_reference_count", 2, p_current_reference_counter, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("current_reference_count", 2, p_current_reference_counter, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("erased", 1, p_erased, TestPredFlag | SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("erased", 1, p_erased, TestPredFlag | SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("instance", 2, p_instance, SyncPredFlag);
|
Yap_InitCPred("instance", 2, p_instance, SyncPredFlag);
|
||||||
Yap_InitCPred("$instance_module", 2, p_instance_module, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$instance_module", 2, p_instance_module, SyncPredFlag);
|
||||||
Yap_InitCPred("eraseall", 1, p_eraseall, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("eraseall", 1, p_eraseall, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$record_stat_source", 4, p_rcdstatp, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$record_stat_source", 4, p_rcdstatp, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$some_recordedp", 1, p_somercdedp, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$some_recordedp", 1, p_somercdedp, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$first_instance", 3, p_first_instance, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$first_instance", 3, p_first_instance, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$init_db_queue", 1, p_init_queue, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$init_db_queue", 1, p_init_queue, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$db_key", 2, p_db_key, HiddenPredFlag);
|
Yap_InitCPred("$db_key", 2, p_db_key, 0L);
|
||||||
Yap_InitCPred("$db_enqueue", 2, p_enqueue, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$db_enqueue", 2, p_enqueue, SyncPredFlag);
|
||||||
Yap_InitCPred("$db_enqueue_unlocked", 2, p_enqueue_unlocked, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$db_enqueue_unlocked", 2, p_enqueue_unlocked, SyncPredFlag);
|
||||||
Yap_InitCPred("$db_dequeue", 2, p_dequeue, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$db_dequeue", 2, p_dequeue, SyncPredFlag);
|
||||||
Yap_InitCPred("$db_dequeue_unlocked", 2, p_dequeue_unlocked, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$db_dequeue_unlocked", 2, p_dequeue_unlocked, SyncPredFlag);
|
||||||
Yap_InitCPred("$db_peek_queue", 2, p_peek_queue, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$db_peek_queue", 2, p_peek_queue, SyncPredFlag);
|
||||||
Yap_InitCPred("$db_clean_queues", 1, p_clean_queues, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$db_clean_queues", 1, p_clean_queues, SyncPredFlag);
|
||||||
Yap_InitCPred("$switch_log_upd", 1, p_slu, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$switch_log_upd", 1, p_slu, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$log_upd", 1, p_lu, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$log_upd", 1, p_lu, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$hold_index", 3, p_hold_index, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$hold_index", 3, p_hold_index, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$fetch_reference_from_index", 3, p_fetch_reference_from_index, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$fetch_reference_from_index", 3, p_fetch_reference_from_index, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$resize_int_keys", 1, p_resize_int_keys, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$resize_int_keys", 1, p_resize_int_keys, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("key_statistics", 4, p_key_statistics, SyncPredFlag);
|
Yap_InitCPred("key_statistics", 4, p_key_statistics, SyncPredFlag);
|
||||||
Yap_InitCPred("$lu_statistics", 5, p_lu_statistics, SyncPredFlag);
|
Yap_InitCPred("$lu_statistics", 5, p_lu_statistics, SyncPredFlag);
|
||||||
Yap_InitCPred("total_erased", 4, p_total_erased, SyncPredFlag);
|
Yap_InitCPred("total_erased", 4, p_total_erased, SyncPredFlag);
|
||||||
Yap_InitCPred("key_erased_statistics", 5, p_key_erased_statistics, SyncPredFlag);
|
Yap_InitCPred("key_erased_statistics", 5, p_key_erased_statistics, SyncPredFlag);
|
||||||
Yap_InitCPred("heap_space_info", 3, p_heap_space_info, SyncPredFlag);
|
Yap_InitCPred("heap_space_info", 3, p_heap_space_info, SyncPredFlag);
|
||||||
Yap_InitCPred("$nth_instance", 3, p_nth_instance, SyncPredFlag);
|
Yap_InitCPred("$nth_instance", 3, p_nth_instance, SyncPredFlag);
|
||||||
Yap_InitCPred("$nth_instancep", 3, p_nth_instancep, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$nth_instancep", 3, p_nth_instancep, SyncPredFlag);
|
||||||
Yap_InitCPred("$jump_to_next_dynamic_clause", 0, p_jump_to_next_dynamic_clause, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$jump_to_next_dynamic_clause", 0, p_jump_to_next_dynamic_clause, SyncPredFlag);
|
||||||
Yap_InitCPred("$install_thread_local", 2, p_install_thread_local, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$install_thread_local", 2, p_install_thread_local, SafePredFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Yap_InitBackDB(void)
|
Yap_InitBackDB(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPredBack("$recorded_with_key", 3, 3, in_rded_with_key, co_rded, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPredBack("$recorded_with_key", 3, 3, in_rded_with_key, co_rded, SyncPredFlag);
|
||||||
RETRY_C_RECORDED_K_CODE = NEXTOP(PredRecordedWithKey->cs.p_code.FirstClause,OtapFs);
|
RETRY_C_RECORDED_K_CODE = NEXTOP(PredRecordedWithKey->cs.p_code.FirstClause,OtapFs);
|
||||||
Yap_InitCPredBack("$recordedp", 3, 3, in_rdedp, co_rdedp, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPredBack("$recordedp", 3, 3, in_rdedp, co_rdedp, SyncPredFlag);
|
||||||
RETRY_C_RECORDEDP_CODE = NEXTOP(RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomRecordedP, 3),0))->cs.p_code.FirstClause,OtapFs);
|
RETRY_C_RECORDEDP_CODE = NEXTOP(RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomRecordedP, 3),0))->cs.p_code.FirstClause,OtapFs);
|
||||||
Yap_InitCPredBack("$current_immediate_key", 2, 4, init_current_key, cont_current_key,
|
Yap_InitCPredBack("$current_immediate_key", 2, 4, init_current_key, cont_current_key,
|
||||||
SyncPredFlag|HiddenPredFlag);
|
SyncPredFlag);
|
||||||
}
|
}
|
||||||
|
@ -72,8 +72,8 @@ static Int p_set_depth_limit_for_next_call( USES_REGS1 )
|
|||||||
void Yap_InitItDeepenPreds(void)
|
void Yap_InitItDeepenPreds(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPred("get_depth_limit", 1, p_get_depth_limit, SafePredFlag);
|
Yap_InitCPred("get_depth_limit", 1, p_get_depth_limit, SafePredFlag);
|
||||||
Yap_InitCPred("$set_depth_limit", 1, p_set_depth_limit, HiddenPredFlag);
|
Yap_InitCPred("$set_depth_limit", 1, p_set_depth_limit, 0);
|
||||||
Yap_InitCPred("$set_depth_limit_for_next_call", 1, p_set_depth_limit_for_next_call, HiddenPredFlag);
|
Yap_InitCPred("$set_depth_limit_for_next_call", 1, p_set_depth_limit_for_next_call, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
90
C/exec.c
90
C/exec.c
@ -236,7 +236,7 @@ do_execute(Term t, Term mod USES_REGS)
|
|||||||
|
|
||||||
if (a == AtomTrue || a == AtomOtherwise || a == AtomCut)
|
if (a == AtomTrue || a == AtomOtherwise || a == AtomCut)
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
else if (a == AtomFail || a == AtomFalse)
|
else if (a == AtomFail || (a == AtomFalse && !RepPredProp(PredPropByAtom(a, mod))->ModuleOfPred) )
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
/* call may not define new system predicates!! */
|
/* call may not define new system predicates!! */
|
||||||
pe = RepPredProp(PredPropByAtom(a, mod));
|
pe = RepPredProp(PredPropByAtom(a, mod));
|
||||||
@ -1789,56 +1789,56 @@ Yap_InitExecFs(void)
|
|||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
Term cm = CurrentModule;
|
Term cm = CurrentModule;
|
||||||
Yap_InitComma();
|
Yap_InitComma();
|
||||||
Yap_InitCPred("$execute", 1, p_execute, HiddenPredFlag);
|
Yap_InitCPred("$execute", 1, p_execute, 0);
|
||||||
Yap_InitCPred("$execute", 2, p_execute2, HiddenPredFlag);
|
Yap_InitCPred("$execute", 2, p_execute2, 0);
|
||||||
Yap_InitCPred("$execute", 3, p_execute3, HiddenPredFlag);
|
Yap_InitCPred("$execute", 3, p_execute3, 0);
|
||||||
Yap_InitCPred("$execute", 4, p_execute4, HiddenPredFlag);
|
Yap_InitCPred("$execute", 4, p_execute4, 0);
|
||||||
Yap_InitCPred("$execute", 5, p_execute5, HiddenPredFlag);
|
Yap_InitCPred("$execute", 5, p_execute5, 0);
|
||||||
Yap_InitCPred("$execute", 6, p_execute6, HiddenPredFlag);
|
Yap_InitCPred("$execute", 6, p_execute6, 0);
|
||||||
Yap_InitCPred("$execute", 7, p_execute7, HiddenPredFlag);
|
Yap_InitCPred("$execute", 7, p_execute7, 0);
|
||||||
Yap_InitCPred("$execute", 8, p_execute8, HiddenPredFlag);
|
Yap_InitCPred("$execute", 8, p_execute8, 0);
|
||||||
Yap_InitCPred("$execute", 9, p_execute9, HiddenPredFlag);
|
Yap_InitCPred("$execute", 9, p_execute9, 0);
|
||||||
Yap_InitCPred("$execute", 10, p_execute10, HiddenPredFlag);
|
Yap_InitCPred("$execute", 10, p_execute10, 0);
|
||||||
Yap_InitCPred("$execute", 11, p_execute11, HiddenPredFlag);
|
Yap_InitCPred("$execute", 11, p_execute11, 0);
|
||||||
Yap_InitCPred("$execute", 12, p_execute12, HiddenPredFlag);
|
Yap_InitCPred("$execute", 12, p_execute12, 0);
|
||||||
Yap_InitCPred("$execute_in_mod", 2, p_execute_in_mod, HiddenPredFlag);
|
Yap_InitCPred("$execute_in_mod", 2, p_execute_in_mod, 0);
|
||||||
Yap_InitCPred("$execute_wo_mod", 2, p_execute_in_mod, HiddenPredFlag);
|
Yap_InitCPred("$execute_wo_mod", 2, p_execute_in_mod, 0);
|
||||||
Yap_InitCPred("call_with_args", 1, p_execute_0, HiddenPredFlag);
|
Yap_InitCPred("call_with_args", 1, p_execute_0, 0);
|
||||||
Yap_InitCPred("call_with_args", 2, p_execute_1, HiddenPredFlag);
|
Yap_InitCPred("call_with_args", 2, p_execute_1, 0);
|
||||||
Yap_InitCPred("call_with_args", 3, p_execute_2, HiddenPredFlag);
|
Yap_InitCPred("call_with_args", 3, p_execute_2, 0);
|
||||||
Yap_InitCPred("call_with_args", 4, p_execute_3, HiddenPredFlag);
|
Yap_InitCPred("call_with_args", 4, p_execute_3, 0);
|
||||||
Yap_InitCPred("call_with_args", 5, p_execute_4, HiddenPredFlag);
|
Yap_InitCPred("call_with_args", 5, p_execute_4, 0);
|
||||||
Yap_InitCPred("call_with_args", 6, p_execute_5, HiddenPredFlag);
|
Yap_InitCPred("call_with_args", 6, p_execute_5, 0);
|
||||||
Yap_InitCPred("call_with_args", 7, p_execute_6, HiddenPredFlag);
|
Yap_InitCPred("call_with_args", 7, p_execute_6, 0);
|
||||||
Yap_InitCPred("call_with_args", 8, p_execute_7, HiddenPredFlag);
|
Yap_InitCPred("call_with_args", 8, p_execute_7, 0);
|
||||||
Yap_InitCPred("call_with_args", 9, p_execute_8, HiddenPredFlag);
|
Yap_InitCPred("call_with_args", 9, p_execute_8, 0);
|
||||||
Yap_InitCPred("call_with_args", 10, p_execute_9, HiddenPredFlag);
|
Yap_InitCPred("call_with_args", 10, p_execute_9, 0);
|
||||||
Yap_InitCPred("call_with_args", 11, p_execute_10, HiddenPredFlag);
|
Yap_InitCPred("call_with_args", 11, p_execute_10, 0);
|
||||||
Yap_InitCPred("$debug_on", 1, p_debug_on, HiddenPredFlag);
|
Yap_InitCPred("$debug_on", 1, p_debug_on, 0);
|
||||||
#ifdef DEPTH_LIMIT
|
#ifdef DEPTH_LIMIT
|
||||||
Yap_InitCPred("$execute_under_depth_limit", 2, p_execute_depth_limit, HiddenPredFlag);
|
Yap_InitCPred("$execute_under_depth_limit", 2, p_execute_depth_limit, 0);
|
||||||
#endif
|
#endif
|
||||||
Yap_InitCPred("$execute0", 2, p_execute0, HiddenPredFlag);
|
Yap_InitCPred("$execute0", 2, p_execute0, 0);
|
||||||
Yap_InitCPred("$execute_nonstop", 2, p_execute_nonstop, HiddenPredFlag);
|
Yap_InitCPred("$execute_nonstop", 2, p_execute_nonstop, 0);
|
||||||
Yap_InitCPred("$execute_clause", 4, p_execute_clause, HiddenPredFlag);
|
Yap_InitCPred("$execute_clause", 4, p_execute_clause, 0);
|
||||||
CurrentModule = HACKS_MODULE;
|
CurrentModule = HACKS_MODULE;
|
||||||
Yap_InitCPred("current_choice_point", 1, p_save_cp, HiddenPredFlag);
|
Yap_InitCPred("current_choice_point", 1, p_save_cp, 0);
|
||||||
Yap_InitCPred("current_choicepoint", 1, p_save_cp, HiddenPredFlag);
|
Yap_InitCPred("current_choicepoint", 1, p_save_cp, 0);
|
||||||
Yap_InitCPred("env_choice_point", 1, p_save_env_b, HiddenPredFlag);
|
Yap_InitCPred("env_choice_point", 1, p_save_env_b, 0);
|
||||||
Yap_InitCPred("trail_suspension_marker", 1, p_trail_suspension_marker, HiddenPredFlag);
|
Yap_InitCPred("trail_suspension_marker", 1, p_trail_suspension_marker, 0);
|
||||||
Yap_InitCPred("cut_at", 1, p_clean_ifcp, SafePredFlag);
|
Yap_InitCPred("cut_at", 1, p_clean_ifcp, SafePredFlag);
|
||||||
CurrentModule = cm;
|
CurrentModule = cm;
|
||||||
Yap_InitCPred("$pred_goal_expansion_on", 0, p_pred_goal_expansion_on, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$pred_goal_expansion_on", 0, p_pred_goal_expansion_on, SafePredFlag);
|
||||||
Yap_InitCPred("$restore_regs", 1, p_restore_regs, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$restore_regs", 1, p_restore_regs, SafePredFlag);
|
||||||
Yap_InitCPred("$restore_regs", 2, p_restore_regs2, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$restore_regs", 2, p_restore_regs2, SafePredFlag);
|
||||||
Yap_InitCPred("$clean_ifcp", 1, p_clean_ifcp, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$clean_ifcp", 1, p_clean_ifcp, SafePredFlag);
|
||||||
Yap_InitCPred("qpack_clean_up_to_disjunction", 0, p_cut_up_to_next_disjunction, SafePredFlag);
|
Yap_InitCPred("qpack_clean_up_to_disjunction", 0, p_cut_up_to_next_disjunction, SafePredFlag);
|
||||||
Yap_InitCPred("$jump_env_and_store_ball", 1, p_jump_env, HiddenPredFlag);
|
Yap_InitCPred("$jump_env_and_store_ball", 1, p_jump_env, 0);
|
||||||
Yap_InitCPred("$creep_allowed", 0, p_creep_allowed, HiddenPredFlag);
|
Yap_InitCPred("$creep_allowed", 0, p_creep_allowed, 0);
|
||||||
Yap_InitCPred("$generate_pred_info", 4, p_generate_pred_info, HiddenPredFlag);
|
Yap_InitCPred("$generate_pred_info", 4, p_generate_pred_info, 0);
|
||||||
Yap_InitCPred("$uncaught_throw", 0, p_uncaught_throw, HiddenPredFlag);
|
Yap_InitCPred("$uncaught_throw", 0, p_uncaught_throw, 0);
|
||||||
Yap_InitCPred("$reset_exception", 1, p_reset_exception, HiddenPredFlag);
|
Yap_InitCPred("$reset_exception", 1, p_reset_exception, 0);
|
||||||
Yap_InitCPred("$get_exception", 1, p_get_exception, HiddenPredFlag);
|
Yap_InitCPred("$get_exception", 1, p_get_exception, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
10
C/grow.c
10
C/grow.c
@ -1980,11 +1980,11 @@ Yap_total_stack_shift_time(void)
|
|||||||
void
|
void
|
||||||
Yap_InitGrowPreds(void)
|
Yap_InitGrowPreds(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPred("$grow_heap", 1, p_growheap, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$grow_heap", 1, p_growheap, SafePredFlag);
|
||||||
Yap_InitCPred("$grow_stack", 1, p_growstack, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$grow_stack", 1, p_growstack, SafePredFlag);
|
||||||
Yap_InitCPred("$inform_trail_overflows", 2, p_inform_trail_overflows, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$inform_trail_overflows", 2, p_inform_trail_overflows, SafePredFlag);
|
||||||
Yap_InitCPred("$inform_heap_overflows", 2, p_inform_heap_overflows, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$inform_heap_overflows", 2, p_inform_heap_overflows, SafePredFlag);
|
||||||
Yap_InitCPred("$inform_stack_overflows", 2, p_inform_stack_overflows, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$inform_stack_overflows", 2, p_inform_stack_overflows, SafePredFlag);
|
||||||
Yap_init_gc();
|
Yap_init_gc();
|
||||||
Yap_init_agc();
|
Yap_init_agc();
|
||||||
}
|
}
|
||||||
|
@ -4201,8 +4201,8 @@ p_gc( USES_REGS1 )
|
|||||||
void
|
void
|
||||||
Yap_init_gc(void)
|
Yap_init_gc(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPred("$gc", 0, p_gc, HiddenPredFlag);
|
Yap_InitCPred("$gc", 0, p_gc, 0);
|
||||||
Yap_InitCPred("$inform_gc", 3, p_inform_gc, HiddenPredFlag);
|
Yap_InitCPred("$inform_gc", 3, p_inform_gc, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
24
C/iopreds.c
24
C/iopreds.c
@ -1114,24 +1114,24 @@ Yap_InitIOPreds(void)
|
|||||||
if (!Stream)
|
if (!Stream)
|
||||||
Stream = (StreamDesc *)Yap_AllocCodeSpace(sizeof(StreamDesc)*MaxStreams);
|
Stream = (StreamDesc *)Yap_AllocCodeSpace(sizeof(StreamDesc)*MaxStreams);
|
||||||
/* here the Input/Output predicates */
|
/* here the Input/Output predicates */
|
||||||
Yap_InitCPred ("$set_read_error_handler", 1, p_set_read_error_handler, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$set_read_error_handler", 1, p_set_read_error_handler, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$get_read_error_handler", 1, p_get_read_error_handler, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$get_read_error_handler", 1, p_get_read_error_handler, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$read", 7, p_read, SyncPredFlag|HiddenPredFlag|UserCPredFlag);
|
Yap_InitCPred ("$read", 7, p_read, SyncPredFlag|UserCPredFlag);
|
||||||
Yap_InitCPred ("$read", 8, p_read2, SyncPredFlag|HiddenPredFlag|UserCPredFlag);
|
Yap_InitCPred ("$read", 8, p_read2, SyncPredFlag|UserCPredFlag);
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Yap_InitCPred ("write_string", 2, p_write_string, SyncPredFlag|UserCPredFlag);
|
Yap_InitCPred ("write_string", 2, p_write_string, SyncPredFlag|UserCPredFlag);
|
||||||
#endif
|
#endif
|
||||||
Yap_InitCPred ("$start_line", 1, p_startline, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$start_line", 1, p_startline, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$change_type_of_char", 2, p_change_type_of_char, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$change_type_of_char", 2, p_change_type_of_char, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$type_of_char", 2, p_type_of_char, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$type_of_char", 2, p_type_of_char, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("char_conversion", 2, p_char_conversion, SyncPredFlag);
|
Yap_InitCPred ("char_conversion", 2, p_char_conversion, SyncPredFlag);
|
||||||
Yap_InitCPred ("$current_char_conversion", 2, p_current_char_conversion, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$current_char_conversion", 2, p_current_char_conversion, SyncPredFlag);
|
||||||
Yap_InitCPred ("$all_char_conversions", 1, p_all_char_conversions, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$all_char_conversions", 1, p_all_char_conversions, SyncPredFlag);
|
||||||
Yap_InitCPred ("$force_char_conversion", 0, p_force_char_conversion, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$force_char_conversion", 0, p_force_char_conversion, SyncPredFlag);
|
||||||
Yap_InitCPred ("$disable_char_conversion", 0, p_disable_char_conversion, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$disable_char_conversion", 0, p_disable_char_conversion, SyncPredFlag);
|
||||||
#if HAVE_SELECT
|
#if HAVE_SELECT
|
||||||
// Yap_InitCPred ("stream_select", 3, p_stream_select, SafePredFlag|SyncPredFlag);
|
// Yap_InitCPred ("stream_select", 3, p_stream_select, SafePredFlag|SyncPredFlag);
|
||||||
#endif
|
#endif
|
||||||
Yap_InitCPred ("$float_format", 1, p_float_format, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$float_format", 1, p_float_format, SafePredFlag|SyncPredFlag);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -229,12 +229,12 @@ Yap_InitLoadForeign( void )
|
|||||||
Yap_FindExecutable("yap");
|
Yap_FindExecutable("yap");
|
||||||
else
|
else
|
||||||
Yap_FindExecutable(GLOBAL_argv[0]);
|
Yap_FindExecutable(GLOBAL_argv[0]);
|
||||||
Yap_InitCPred("$load_foreign_files", 3, p_load_foreign, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$load_foreign_files", 3, p_load_foreign, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$open_shared_objects", 0, p_open_shared_objects, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$open_shared_objects", 0, p_open_shared_objects, SafePredFlag);
|
||||||
Yap_InitCPred("$open_shared_object", 3, p_open_shared_object, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$open_shared_object", 3, p_open_shared_object, SyncPredFlag);
|
||||||
Yap_InitCPred("close_shared_object", 1, p_close_shared_object, SyncPredFlag|SafePredFlag);
|
Yap_InitCPred("close_shared_object", 1, p_close_shared_object, SyncPredFlag|SafePredFlag);
|
||||||
Yap_InitCPred("call_shared_object_function", 2, p_call_shared_object_function, SyncPredFlag);
|
Yap_InitCPred("call_shared_object_function", 2, p_call_shared_object_function, SyncPredFlag);
|
||||||
Yap_InitCPred("$obj_suffix", 1, p_obj_suffix, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$obj_suffix", 1, p_obj_suffix, SafePredFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
10
C/modules.c
10
C/modules.c
@ -301,13 +301,13 @@ Yap_StripModule(Term t, Term *modp)
|
|||||||
void
|
void
|
||||||
Yap_InitModulesC(void)
|
Yap_InitModulesC(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPred("$current_module", 2, p_current_module, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$current_module", 2, p_current_module, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$current_module", 1, p_current_module1, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$current_module", 1, p_current_module1, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$change_module", 1, p_change_module, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$change_module", 1, p_change_module, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("strip_module", 3, p_strip_module, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("strip_module", 3, p_strip_module, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("context_module", 1, p_context_module, 0);
|
Yap_InitCPred("context_module", 1, p_context_module, 0);
|
||||||
Yap_InitCPredBack("$all_current_modules", 1, 1, init_current_module, cont_current_module,
|
Yap_InitCPredBack("$all_current_modules", 1, 1, init_current_module, cont_current_module,
|
||||||
SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
SafePredFlag|SyncPredFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
7
C/qlyr.c
7
C/qlyr.c
@ -934,6 +934,9 @@ read_pred(IOSTREAM *stream, Term mod) {
|
|||||||
if (flags & MultiFileFlag && ap->ModuleOfPred == PROLOG_MODULE)
|
if (flags & MultiFileFlag && ap->ModuleOfPred == PROLOG_MODULE)
|
||||||
ap->ModuleOfPred = TermProlog;
|
ap->ModuleOfPred = TermProlog;
|
||||||
read_clauses(stream, ap, nclauses, flags);
|
read_clauses(stream, ap, nclauses, flags);
|
||||||
|
if (flags & HiddenPredFlag) {
|
||||||
|
Yap_HidePred(ap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1054,8 +1057,8 @@ Yap_Restore(char *s, char *lib_dir)
|
|||||||
|
|
||||||
void Yap_InitQLYR(void)
|
void Yap_InitQLYR(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPred("$qload_module_preds", 1, p_read_module_preds, SyncPredFlag|HiddenPredFlag|UserCPredFlag);
|
Yap_InitCPred("$qload_module_preds", 1, p_read_module_preds, SyncPredFlag|UserCPredFlag);
|
||||||
Yap_InitCPred("$qload_program", 1, p_read_program, SyncPredFlag|HiddenPredFlag|UserCPredFlag);
|
Yap_InitCPred("$qload_program", 1, p_read_program, SyncPredFlag|UserCPredFlag);
|
||||||
if (FALSE) {
|
if (FALSE) {
|
||||||
restore_codes();
|
restore_codes();
|
||||||
}
|
}
|
||||||
|
4
C/qlyw.c
4
C/qlyw.c
@ -898,8 +898,8 @@ p_save_program( USES_REGS1 )
|
|||||||
|
|
||||||
void Yap_InitQLY(void)
|
void Yap_InitQLY(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPred("$qsave_module_preds", 2, p_save_module_preds, SyncPredFlag|HiddenPredFlag|UserCPredFlag);
|
Yap_InitCPred("$qsave_module_preds", 2, p_save_module_preds, SyncPredFlag|UserCPredFlag);
|
||||||
Yap_InitCPred("$qsave_program", 1, p_save_program, SyncPredFlag|HiddenPredFlag|UserCPredFlag);
|
Yap_InitCPred("$qsave_program", 1, p_save_program, SyncPredFlag|UserCPredFlag);
|
||||||
if (FALSE) {
|
if (FALSE) {
|
||||||
restore_codes();
|
restore_codes();
|
||||||
}
|
}
|
||||||
|
6
C/save.c
6
C/save.c
@ -1843,7 +1843,7 @@ p_restore( USES_REGS1 )
|
|||||||
void
|
void
|
||||||
Yap_InitSavePreds(void)
|
Yap_InitSavePreds(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPred("$save", 2, p_save2, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$save", 2, p_save2, SyncPredFlag);
|
||||||
Yap_InitCPred("$save_program", 1, p_save_program, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$save_program", 1, p_save_program, SyncPredFlag);
|
||||||
Yap_InitCPred("$restore", 1, p_restore, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$restore", 1, p_restore, SyncPredFlag);
|
||||||
}
|
}
|
||||||
|
6
C/sort.c
6
C/sort.c
@ -415,7 +415,7 @@ p_ksort( USES_REGS1 )
|
|||||||
void
|
void
|
||||||
Yap_InitSortPreds(void)
|
Yap_InitSortPreds(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPred("$sort", 2, p_sort, HiddenPredFlag);
|
Yap_InitCPred("$sort", 2, p_sort, 0);
|
||||||
Yap_InitCPred("$msort", 2, p_msort, HiddenPredFlag);
|
Yap_InitCPred("$msort", 2, p_msort, 0);
|
||||||
Yap_InitCPred("$keysort", 2, p_ksort, HiddenPredFlag);
|
Yap_InitCPred("$keysort", 2, p_ksort, 0);
|
||||||
}
|
}
|
||||||
|
92
C/stdpreds.c
92
C/stdpreds.c
@ -4395,19 +4395,19 @@ void
|
|||||||
Yap_InitBackCPreds(void)
|
Yap_InitBackCPreds(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPredBack("$current_atom", 1, 2, init_current_atom, cont_current_atom,
|
Yap_InitCPredBack("$current_atom", 1, 2, init_current_atom, cont_current_atom,
|
||||||
SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPredBack("$current_wide_atom", 1, 2, init_current_wide_atom,
|
Yap_InitCPredBack("$current_wide_atom", 1, 2, init_current_wide_atom,
|
||||||
cont_current_wide_atom,
|
cont_current_wide_atom,
|
||||||
SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPredBack("$current_predicate", 3, 1, init_current_predicate, cont_current_predicate,
|
Yap_InitCPredBack("$current_predicate", 3, 1, init_current_predicate, cont_current_predicate,
|
||||||
SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPredBack("$current_predicate_for_atom", 3, 1, init_current_predicate_for_atom, cont_current_predicate_for_atom,
|
Yap_InitCPredBack("$current_predicate_for_atom", 3, 1, init_current_predicate_for_atom, cont_current_predicate_for_atom,
|
||||||
SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPredBack("$current_op", 5, 1, init_current_op, cont_current_op,
|
Yap_InitCPredBack("$current_op", 5, 1, init_current_op, cont_current_op,
|
||||||
SafePredFlag|SyncPredFlag);
|
SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPredBack("$current_atom_op", 5, 1, init_current_atom_op, cont_current_atom_op,
|
Yap_InitCPredBack("$current_atom_op", 5, 1, init_current_atom_op, cont_current_atom_op,
|
||||||
SafePredFlag|SyncPredFlag);
|
SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPredBack("$sub_atom_fetch", 5, 5, init_sub_atom_fetch, cont_sub_atom_fetch, HiddenPredFlag);
|
Yap_InitCPredBack("$sub_atom_fetch", 5, 5, init_sub_atom_fetch, cont_sub_atom_fetch, 0);
|
||||||
#ifdef BEAM
|
#ifdef BEAM
|
||||||
Yap_InitCPredBack("eam", 1, 0, start_eam, cont_eam,
|
Yap_InitCPredBack("eam", 1, 0, start_eam, cont_eam,
|
||||||
SafePredFlag);
|
SafePredFlag);
|
||||||
@ -4452,9 +4452,9 @@ Yap_InitCPreds(void)
|
|||||||
/* numerical comparison */
|
/* numerical comparison */
|
||||||
Yap_InitCPred("set_value", 2, p_setval, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("set_value", 2, p_setval, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("get_value", 2, p_value, TestPredFlag|SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("get_value", 2, p_value, TestPredFlag|SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$values", 3, p_values, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$values", 3, p_values, SafePredFlag|SyncPredFlag);
|
||||||
/* general purpose */
|
/* general purpose */
|
||||||
Yap_InitCPred("$opdec", 4, p_opdec, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$opdec", 4, p_opdec, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("name", 2, p_name, 0);
|
Yap_InitCPred("name", 2, p_name, 0);
|
||||||
Yap_InitCPred("string_to_atom", 2, p_string_to_atom, 0);
|
Yap_InitCPred("string_to_atom", 2, p_string_to_atom, 0);
|
||||||
Yap_InitCPred("string_to_list", 2, p_string_to_list, 0);
|
Yap_InitCPred("string_to_list", 2, p_string_to_list, 0);
|
||||||
@ -4462,8 +4462,8 @@ Yap_InitCPreds(void)
|
|||||||
Yap_InitCPred("atom_chars", 2, p_atom_chars, 0);
|
Yap_InitCPred("atom_chars", 2, p_atom_chars, 0);
|
||||||
Yap_InitCPred("atom_codes", 2, p_atom_codes, 0);
|
Yap_InitCPred("atom_codes", 2, p_atom_codes, 0);
|
||||||
Yap_InitCPred("atom_length", 2, p_atom_length, SafePredFlag);
|
Yap_InitCPred("atom_length", 2, p_atom_length, SafePredFlag);
|
||||||
Yap_InitCPred("$atom_split", 4, p_atom_split, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$atom_split", 4, p_atom_split, SafePredFlag);
|
||||||
Yap_InitCPred("$sub_atom_extract", 5, p_sub_atom_extract, HiddenPredFlag);
|
Yap_InitCPred("$sub_atom_extract", 5, p_sub_atom_extract, 0);
|
||||||
Yap_InitCPred("number_chars", 2, p_number_chars, 0);
|
Yap_InitCPred("number_chars", 2, p_number_chars, 0);
|
||||||
Yap_InitCPred("number_atom", 2, p_number_atom, 0);
|
Yap_InitCPred("number_atom", 2, p_number_atom, 0);
|
||||||
Yap_InitCPred("number_codes", 2, p_number_codes, 0);
|
Yap_InitCPred("number_codes", 2, p_number_codes, 0);
|
||||||
@ -4471,28 +4471,28 @@ Yap_InitCPreds(void)
|
|||||||
Yap_InitCPred("atom_concat", 2, p_atom_concat, 0);
|
Yap_InitCPred("atom_concat", 2, p_atom_concat, 0);
|
||||||
Yap_InitCPred("atomic_concat", 2, p_atomic_concat, 0);
|
Yap_InitCPred("atomic_concat", 2, p_atomic_concat, 0);
|
||||||
Yap_InitCPred("=..", 2, p_univ, 0);
|
Yap_InitCPred("=..", 2, p_univ, 0);
|
||||||
Yap_InitCPred("$statistics_trail_max", 1, p_statistics_trail_max, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$statistics_trail_max", 1, p_statistics_trail_max, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$statistics_heap_max", 1, p_statistics_heap_max, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$statistics_heap_max", 1, p_statistics_heap_max, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$statistics_global_max", 1, p_statistics_global_max, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$statistics_global_max", 1, p_statistics_global_max, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$statistics_local_max", 1, p_statistics_local_max, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$statistics_local_max", 1, p_statistics_local_max, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$statistics_heap_info", 2, p_statistics_heap_info, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$statistics_heap_info", 2, p_statistics_heap_info, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$statistics_stacks_info", 3, p_statistics_stacks_info, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$statistics_stacks_info", 3, p_statistics_stacks_info, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$statistics_trail_info", 2, p_statistics_trail_info, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$statistics_trail_info", 2, p_statistics_trail_info, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$statistics_atom_info", 2, p_statistics_atom_info, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$statistics_atom_info", 2, p_statistics_atom_info, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$statistics_db_size", 4, p_statistics_db_size, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$statistics_db_size", 4, p_statistics_db_size, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$statistics_lu_db_size", 5, p_statistics_lu_db_size, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$statistics_lu_db_size", 5, p_statistics_lu_db_size, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$argv", 1, p_argv, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$argv", 1, p_argv, SafePredFlag);
|
||||||
Yap_InitCPred("$executable", 1, p_executable, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$executable", 1, p_executable, SafePredFlag);
|
||||||
Yap_InitCPred("$runtime", 2, p_runtime, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$runtime", 2, p_runtime, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$cputime", 2, p_cputime, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$cputime", 2, p_cputime, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$systime", 2, p_systime, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$systime", 2, p_systime, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$walltime", 2, p_walltime, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$walltime", 2, p_walltime, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$access_yap_flags", 2, p_access_yap_flags, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$access_yap_flags", 2, p_access_yap_flags, SafePredFlag);
|
||||||
Yap_InitCPred("$set_yap_flags", 2, p_set_yap_flags, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$set_yap_flags", 2, p_set_yap_flags, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$p_system_mode", 1, p_system_mode, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$p_system_mode", 1, p_system_mode, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("abort", 0, p_abort, SyncPredFlag);
|
Yap_InitCPred("abort", 0, p_abort, SyncPredFlag);
|
||||||
Yap_InitCPred("$max_tagged_integer", 1, p_max_tagged_integer, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$max_tagged_integer", 1, p_max_tagged_integer, SafePredFlag);
|
||||||
Yap_InitCPred("$min_tagged_integer", 1, p_min_tagged_integer, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$min_tagged_integer", 1, p_min_tagged_integer, SafePredFlag);
|
||||||
#ifdef BEAM
|
#ifdef BEAM
|
||||||
Yap_InitCPred("@", 0, eager_split, SafePredFlag);
|
Yap_InitCPred("@", 0, eager_split, SafePredFlag);
|
||||||
Yap_InitCPred(":", 0, force_wait, SafePredFlag);
|
Yap_InitCPred(":", 0, force_wait, SafePredFlag);
|
||||||
@ -4502,33 +4502,33 @@ Yap_InitCPreds(void)
|
|||||||
Yap_InitCPred("eamtime", 0, show_time, SafePredFlag);
|
Yap_InitCPred("eamtime", 0, show_time, SafePredFlag);
|
||||||
Yap_InitCPred("eam", 0, use_eam, SafePredFlag);
|
Yap_InitCPred("eam", 0, use_eam, SafePredFlag);
|
||||||
#endif
|
#endif
|
||||||
Yap_InitCPred("$halt", 1, p_halt, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$halt", 1, p_halt, SyncPredFlag);
|
||||||
Yap_InitCPred("$lock_system", 0, p_lock_system, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$lock_system", 0, p_lock_system, SafePredFlag);
|
||||||
Yap_InitCPred("$unlock_system", 0, p_unlock_system, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$unlock_system", 0, p_unlock_system, SafePredFlag);
|
||||||
Yap_InitCPred("$enter_undefp", 0, p_enterundefp, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$enter_undefp", 0, p_enterundefp, SafePredFlag);
|
||||||
Yap_InitCPred("$exit_undefp", 0, p_exitundefp, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$exit_undefp", 0, p_exitundefp, SafePredFlag);
|
||||||
/* basic predicates for the prolog machine tracer */
|
/* basic predicates for the prolog machine tracer */
|
||||||
/* they are defined in analyst.c */
|
/* they are defined in analyst.c */
|
||||||
/* Basic predicates for the debugger */
|
/* Basic predicates for the debugger */
|
||||||
Yap_InitCPred("$creep", 0, p_creep, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$creep", 0, p_creep, SafePredFlag);
|
||||||
Yap_InitCPred("$signal_creep", 0, p_signal_creep, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$signal_creep", 0, p_signal_creep, SafePredFlag);
|
||||||
Yap_InitCPred("$disable_creep", 0, p_disable_creep, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$disable_creep", 0, p_disable_creep, SafePredFlag);
|
||||||
Yap_InitCPred("$disable_docreep", 0, p_disable_docreep, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$disable_docreep", 0, p_disable_docreep, SafePredFlag);
|
||||||
Yap_InitCPred("$do_not_creep", 0, p_stop_creep, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$do_not_creep", 0, p_stop_creep, SafePredFlag|SyncPredFlag);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Yap_InitCPred("$debug", 1, p_debug, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$debug", 1, p_debug, SafePredFlag|SyncPredFlag);
|
||||||
#endif
|
#endif
|
||||||
/* Accessing and changing the flags for a predicate */
|
/* Accessing and changing the flags for a predicate */
|
||||||
Yap_InitCPred("$flags", 4, p_flags, SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$flags", 4, p_flags, SyncPredFlag);
|
||||||
/* hiding and unhiding some predicates */
|
/* hiding and unhiding some predicates */
|
||||||
Yap_InitCPred("hide", 1, p_hide, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("hide", 1, p_hide, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("unhide", 1, p_unhide, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("unhide", 1, p_unhide, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$hidden", 1, p_hidden, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$hidden", 1, p_hidden, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$has_yap_or", 0, p_has_yap_or, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$has_yap_or", 0, p_has_yap_or, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$has_eam", 0, p_has_eam, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$has_eam", 0, p_has_eam, SafePredFlag|SyncPredFlag);
|
||||||
#ifndef YAPOR
|
#ifndef YAPOR
|
||||||
Yap_InitCPred("parallel_mode", 1, p_parallel_mode, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("parallel_mode", 1, p_parallel_mode, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("$c_yapor_workers", 1, p_yapor_workers, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$c_yapor_workers", 1, p_yapor_workers, SafePredFlag|SyncPredFlag);
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
#ifdef INES
|
#ifdef INES
|
||||||
Yap_InitCPred("euc_dist", 3, p_euc_dist, SafePredFlag);
|
Yap_InitCPred("euc_dist", 3, p_euc_dist, SafePredFlag);
|
||||||
|
22
C/sysbits.c
22
C/sysbits.c
@ -3226,18 +3226,18 @@ Yap_InitSysPreds(void)
|
|||||||
InitLastWtime();
|
InitLastWtime();
|
||||||
Yap_InitCPred ("srandom", 1, p_srandom, SafePredFlag);
|
Yap_InitCPred ("srandom", 1, p_srandom, SafePredFlag);
|
||||||
Yap_InitCPred ("sh", 0, p_sh, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred ("sh", 0, p_sh, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$shell", 1, p_shell, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$shell", 1, p_shell, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("system", 1, p_system, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred ("system", 1, p_system, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("rename", 2, p_mv, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred ("rename", 2, p_mv, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$yap_home", 1, p_yap_home, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$yap_home", 1, p_yap_home, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$dir_separator", 1, p_dir_sp, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$dir_separator", 1, p_dir_sp, SafePredFlag);
|
||||||
Yap_InitCPred ("$alarm", 4, p_alarm, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$alarm", 4, p_alarm, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$getenv", 2, p_getenv, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$getenv", 2, p_getenv, SafePredFlag);
|
||||||
Yap_InitCPred ("$putenv", 2, p_putenv, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$putenv", 2, p_putenv, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$set_fpu_exceptions", 0, p_set_fpu_exceptions, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$set_fpu_exceptions", 0, p_set_fpu_exceptions, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$first_signal", 1, p_first_signal, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$first_signal", 1, p_first_signal, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$host_type", 1, p_host_type, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$host_type", 1, p_host_type, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$continue_signals", 0, p_continue_signals, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("$continue_signals", 0, p_continue_signals, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("$env_separator", 1, p_env_separator, SafePredFlag);
|
Yap_InitCPred ("$env_separator", 1, p_env_separator, SafePredFlag);
|
||||||
Yap_InitCPred ("$unix", 0, p_unix, SafePredFlag);
|
Yap_InitCPred ("$unix", 0, p_unix, SafePredFlag);
|
||||||
Yap_InitCPred ("$win32", 0, p_win32, SafePredFlag);
|
Yap_InitCPred ("$win32", 0, p_win32, SafePredFlag);
|
||||||
@ -3247,7 +3247,7 @@ Yap_InitSysPreds(void)
|
|||||||
Yap_InitCPred ("win_registry_get_value", 3, p_win_registry_get_value,0);
|
Yap_InitCPred ("win_registry_get_value", 3, p_win_registry_get_value,0);
|
||||||
#endif
|
#endif
|
||||||
CurrentModule = HACKS_MODULE;
|
CurrentModule = HACKS_MODULE;
|
||||||
Yap_InitCPred ("virtual_alarm", 4, p_virtual_alarm, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred ("virtual_alarm", 4, p_virtual_alarm, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred ("enable_interrupts", 0, p_enable_interrupts, SafePredFlag);
|
Yap_InitCPred ("enable_interrupts", 0, p_enable_interrupts, SafePredFlag);
|
||||||
Yap_InitCPred ("disable_interrupts", 0, p_disable_interrupts, SafePredFlag);
|
Yap_InitCPred ("disable_interrupts", 0, p_disable_interrupts, SafePredFlag);
|
||||||
CurrentModule = OPERATING_SYSTEM_MODULE;
|
CurrentModule = OPERATING_SYSTEM_MODULE;
|
||||||
|
82
C/threads.c
82
C/threads.c
@ -949,41 +949,41 @@ p_thread_unlock( USES_REGS1 )
|
|||||||
|
|
||||||
void Yap_InitThreadPreds(void)
|
void Yap_InitThreadPreds(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPred("$no_threads", 0, p_no_threads, HiddenPredFlag);
|
Yap_InitCPred("$no_threads", 0, p_no_threads, 0);
|
||||||
Yap_InitCPred("$max_workers", 1, p_max_workers, HiddenPredFlag);
|
Yap_InitCPred("$max_workers", 1, p_max_workers, 0);
|
||||||
Yap_InitCPred("$max_threads", 1, p_max_threads, HiddenPredFlag);
|
Yap_InitCPred("$max_threads", 1, p_max_threads, 0);
|
||||||
Yap_InitCPred("$thread_new_tid", 1, p_thread_new_tid, HiddenPredFlag);
|
Yap_InitCPred("$thread_new_tid", 1, p_thread_new_tid, 0);
|
||||||
Yap_InitCPred("$create_thread", 7, p_create_thread, HiddenPredFlag);
|
Yap_InitCPred("$create_thread", 7, p_create_thread, 0);
|
||||||
Yap_InitCPred("$thread_self", 1, p_thread_self, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$thread_self", 1, p_thread_self, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_status_lock", 1, p_thread_status_lock, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$thread_status_lock", 1, p_thread_status_lock, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_status_unlock", 1, p_thread_status_unlock, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$thread_status_unlock", 1, p_thread_status_unlock, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_zombie_self", 1, p_thread_zombie_self, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$thread_zombie_self", 1, p_thread_zombie_self, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_join", 1, p_thread_join, HiddenPredFlag);
|
Yap_InitCPred("$thread_join", 1, p_thread_join, 0);
|
||||||
Yap_InitCPred("$thread_destroy", 1, p_thread_destroy, HiddenPredFlag);
|
Yap_InitCPred("$thread_destroy", 1, p_thread_destroy, 0);
|
||||||
Yap_InitCPred("thread_yield", 0, p_thread_yield, 0);
|
Yap_InitCPred("thread_yield", 0, p_thread_yield, 0);
|
||||||
Yap_InitCPred("$detach_thread", 1, p_thread_detach, HiddenPredFlag);
|
Yap_InitCPred("$detach_thread", 1, p_thread_detach, 0);
|
||||||
Yap_InitCPred("$thread_detached", 1, p_thread_detached, HiddenPredFlag);
|
Yap_InitCPred("$thread_detached", 1, p_thread_detached, 0);
|
||||||
Yap_InitCPred("$thread_detached", 2, p_thread_detached2, HiddenPredFlag);
|
Yap_InitCPred("$thread_detached", 2, p_thread_detached2, 0);
|
||||||
Yap_InitCPred("$thread_exit", 0, p_thread_exit, HiddenPredFlag);
|
Yap_InitCPred("$thread_exit", 0, p_thread_exit, 0);
|
||||||
Yap_InitCPred("thread_setconcurrency", 2, p_thread_set_concurrency, 0);
|
Yap_InitCPred("thread_setconcurrency", 2, p_thread_set_concurrency, 0);
|
||||||
Yap_InitCPred("$valid_thread", 1, p_valid_thread, HiddenPredFlag);
|
Yap_InitCPred("$valid_thread", 1, p_valid_thread, 0);
|
||||||
Yap_InitCPred("$new_mutex", 1, p_new_mutex, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$new_mutex", 1, p_new_mutex, SafePredFlag);
|
||||||
Yap_InitCPred("$destroy_mutex", 1, p_destroy_mutex, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$destroy_mutex", 1, p_destroy_mutex, SafePredFlag);
|
||||||
Yap_InitCPred("$lock_mutex", 1, p_lock_mutex, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$lock_mutex", 1, p_lock_mutex, SafePredFlag);
|
||||||
Yap_InitCPred("$trylock_mutex", 1, p_trylock_mutex, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$trylock_mutex", 1, p_trylock_mutex, SafePredFlag);
|
||||||
Yap_InitCPred("$unlock_mutex", 1, p_unlock_mutex, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$unlock_mutex", 1, p_unlock_mutex, SafePredFlag);
|
||||||
Yap_InitCPred("$mutex_info", 3, p_mutex_info, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$mutex_info", 3, p_mutex_info, SafePredFlag);
|
||||||
Yap_InitCPred("$cond_create", 1, p_cond_create, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$cond_create", 1, p_cond_create, SafePredFlag);
|
||||||
Yap_InitCPred("$cond_destroy", 1, p_cond_destroy, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$cond_destroy", 1, p_cond_destroy, SafePredFlag);
|
||||||
Yap_InitCPred("$cond_signal", 1, p_cond_signal, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$cond_signal", 1, p_cond_signal, SafePredFlag);
|
||||||
Yap_InitCPred("$cond_broadcast", 1, p_cond_broadcast, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$cond_broadcast", 1, p_cond_broadcast, SafePredFlag);
|
||||||
Yap_InitCPred("$cond_wait", 2, p_cond_wait, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$cond_wait", 2, p_cond_wait, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_stacks", 4, p_thread_stacks, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$thread_stacks", 4, p_thread_stacks, SafePredFlag);
|
||||||
Yap_InitCPred("$signal_thread", 1, p_thread_signal, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$signal_thread", 1, p_thread_signal, SafePredFlag);
|
||||||
Yap_InitCPred("$nof_threads", 1, p_nof_threads, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$nof_threads", 1, p_nof_threads, SafePredFlag);
|
||||||
Yap_InitCPred("$nof_threads_created", 1, p_nof_threads_created, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$nof_threads_created", 1, p_nof_threads_created, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_sleep", 4, p_thread_sleep, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$thread_sleep", 4, p_thread_sleep, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_runtime", 1, p_thread_runtime, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$thread_runtime", 1, p_thread_runtime, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_self_lock", 1, p_thread_self_lock, SafePredFlag);
|
Yap_InitCPred("$thread_self_lock", 1, p_thread_self_lock, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_run_at_exit", 2, p_thread_atexit, SafePredFlag);
|
Yap_InitCPred("$thread_run_at_exit", 2, p_thread_atexit, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_unlock", 1, p_thread_unlock, SafePredFlag);
|
Yap_InitCPred("$thread_unlock", 1, p_thread_unlock, SafePredFlag);
|
||||||
@ -1047,14 +1047,14 @@ p_max_workers(void)
|
|||||||
|
|
||||||
void Yap_InitThreadPreds(void)
|
void Yap_InitThreadPreds(void)
|
||||||
{
|
{
|
||||||
Yap_InitCPred("$max_workers", 1, p_max_workers, HiddenPredFlag);
|
Yap_InitCPred("$max_workers", 1, p_max_workers, 0);
|
||||||
Yap_InitCPred("$thread_self", 1, p_thread_self, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$thread_self", 1, p_thread_self, SafePredFlag);
|
||||||
Yap_InitCPred("$no_threads", 0, p_no_threads, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$no_threads", 0, p_no_threads, SafePredFlag);
|
||||||
Yap_InitCPred("$max_threads", 1, p_max_threads, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$max_threads", 1, p_max_threads, SafePredFlag);
|
||||||
Yap_InitCPred("$nof_threads", 1, p_nof_threads, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$nof_threads", 1, p_nof_threads, SafePredFlag);
|
||||||
Yap_InitCPred("$nof_threads_created", 1, p_nof_threads_created, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$nof_threads_created", 1, p_nof_threads_created, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_stacks", 4, p_thread_stacks, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$thread_stacks", 4, p_thread_stacks, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_runtime", 1, p_thread_runtime, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$thread_runtime", 1, p_thread_runtime, SafePredFlag);
|
||||||
Yap_InitCPred("$thread_unlock", 1, p_thread_unlock, SafePredFlag);
|
Yap_InitCPred("$thread_unlock", 1, p_thread_unlock, SafePredFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5195,8 +5195,8 @@ void Yap_InitUtilCPreds(void)
|
|||||||
Yap_InitCPred("duplicate_term", 2, p_duplicate_term, 0);
|
Yap_InitCPred("duplicate_term", 2, p_duplicate_term, 0);
|
||||||
Yap_InitCPred("copy_term_nat", 2, p_copy_term_no_delays, 0);
|
Yap_InitCPred("copy_term_nat", 2, p_copy_term_no_delays, 0);
|
||||||
Yap_InitCPred("ground", 1, p_ground, SafePredFlag);
|
Yap_InitCPred("ground", 1, p_ground, SafePredFlag);
|
||||||
Yap_InitCPred("$variables_in_term", 3, p_variables_in_term, HiddenPredFlag);
|
Yap_InitCPred("$variables_in_term", 3, p_variables_in_term, 0);
|
||||||
Yap_InitCPred("$non_singletons_in_term", 3, p_non_singletons_in_term, HiddenPredFlag);
|
Yap_InitCPred("$non_singletons_in_term", 3, p_non_singletons_in_term, 0);
|
||||||
Yap_InitCPred("term_variables", 2, p_term_variables, 0);
|
Yap_InitCPred("term_variables", 2, p_term_variables, 0);
|
||||||
Yap_InitCPred("term_variables", 3, p_term_variables3, 0);
|
Yap_InitCPred("term_variables", 3, p_term_variables3, 0);
|
||||||
Yap_InitCPred("term_attvars", 2, p_term_attvars, 0);
|
Yap_InitCPred("term_attvars", 2, p_term_attvars, 0);
|
||||||
@ -5224,7 +5224,7 @@ void Yap_InitUtilCPreds(void)
|
|||||||
Yap_InitCPred("import_term", 2, p_import_term, 0);
|
Yap_InitCPred("import_term", 2, p_import_term, 0);
|
||||||
CurrentModule = cm;
|
CurrentModule = cm;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Yap_InitCPred("$force_trail_expansion", 1, p_force_trail_expansion, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$force_trail_expansion", 1, p_force_trail_expansion, SafePredFlag);
|
||||||
Yap_InitCPred("dum", 1, camacho_dum, SafePredFlag);
|
Yap_InitCPred("dum", 1, camacho_dum, SafePredFlag);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -137,6 +137,7 @@ void STD_PROTO(Yap_BuildMegaClause,(struct pred_entry *));
|
|||||||
void STD_PROTO(Yap_EraseMegaClause,(yamop *,struct pred_entry *));
|
void STD_PROTO(Yap_EraseMegaClause,(yamop *,struct pred_entry *));
|
||||||
void STD_PROTO(Yap_ResetConsultStack,(void));
|
void STD_PROTO(Yap_ResetConsultStack,(void));
|
||||||
void STD_PROTO(Yap_AssertzClause,(struct pred_entry *, yamop *));
|
void STD_PROTO(Yap_AssertzClause,(struct pred_entry *, yamop *));
|
||||||
|
void Yap_HidePred(struct pred_entry *pe);
|
||||||
|
|
||||||
|
|
||||||
/* cmppreds.c */
|
/* cmppreds.c */
|
||||||
|
@ -100,6 +100,8 @@
|
|||||||
#define SWI_MODULE Yap_heap_regs->swi_module
|
#define SWI_MODULE Yap_heap_regs->swi_module
|
||||||
#define DBLOAD_MODULE Yap_heap_regs->dbload_module
|
#define DBLOAD_MODULE Yap_heap_regs->dbload_module
|
||||||
|
|
||||||
|
#define HIDDEN_PREDICATES Yap_heap_regs->hidden_predicates
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define CurrentModules Yap_heap_regs->current_modules
|
#define CurrentModules Yap_heap_regs->current_modules
|
||||||
|
@ -100,6 +100,8 @@
|
|||||||
Term swi_module;
|
Term swi_module;
|
||||||
Term dbload_module;
|
Term dbload_module;
|
||||||
|
|
||||||
|
Prop hidden_predicates;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct mod_entry *current_modules;
|
struct mod_entry *current_modules;
|
||||||
|
@ -100,6 +100,8 @@
|
|||||||
SWI_MODULE = MkAtomTerm(AtomSwi);
|
SWI_MODULE = MkAtomTerm(AtomSwi);
|
||||||
DBLOAD_MODULE = MkAtomTerm(AtomDBLoad);
|
DBLOAD_MODULE = MkAtomTerm(AtomDBLoad);
|
||||||
|
|
||||||
|
HIDDEN_PREDICATES = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CurrentModules = NULL;
|
CurrentModules = NULL;
|
||||||
|
@ -726,6 +726,14 @@ RestoreSWIBlobs__( USES_REGS1 )
|
|||||||
RestoreAtomList(SWI_Blobs PASS_REGS);
|
RestoreAtomList(SWI_Blobs PASS_REGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
RestoreHidenPredicates( USES_REGS1 )
|
||||||
|
{
|
||||||
|
HIDDEN_PREDICATES = PropAdjust(HIDDEN_PREDICATES);
|
||||||
|
RestoreEntries(HIDDEN_PREDICATES, TRUE PASS_REGS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
RestorePredHash__( USES_REGS1 )
|
RestorePredHash__( USES_REGS1 )
|
||||||
{
|
{
|
||||||
|
@ -100,6 +100,8 @@
|
|||||||
SWI_MODULE = AtomTermAdjust(SWI_MODULE);
|
SWI_MODULE = AtomTermAdjust(SWI_MODULE);
|
||||||
DBLOAD_MODULE = AtomTermAdjust(DBLOAD_MODULE);
|
DBLOAD_MODULE = AtomTermAdjust(DBLOAD_MODULE);
|
||||||
|
|
||||||
|
RestoreHidenPredicates();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CurrentModules = ModEntryPtrAdjust(CurrentModules);
|
CurrentModules = ModEntryPtrAdjust(CurrentModules);
|
||||||
|
@ -89,6 +89,9 @@ Int tot_agc_time =0
|
|||||||
/* number of heap objects in all garbage collections */
|
/* number of heap objects in all garbage collections */
|
||||||
Int tot_agc_recovered =0
|
Int tot_agc_recovered =0
|
||||||
|
|
||||||
|
// hidden predicates
|
||||||
|
struct PropEntryStruct * hidden_predicates =NULL
|
||||||
|
|
||||||
//arrays.c
|
//arrays.c
|
||||||
#if HAVE_MMAP
|
#if HAVE_MMAP
|
||||||
struct MMAP_ARRAY_BLOCK* mmap_arrays =NULL
|
struct MMAP_ARRAY_BLOCK* mmap_arrays =NULL
|
||||||
|
@ -102,6 +102,9 @@ Term globals_module GLOBALS_MODULE MkAT AtomNb
|
|||||||
Term swi_module SWI_MODULE MkAT AtomSwi
|
Term swi_module SWI_MODULE MkAT AtomSwi
|
||||||
Term dbload_module DBLOAD_MODULE MkAT AtomDBLoad
|
Term dbload_module DBLOAD_MODULE MkAT AtomDBLoad
|
||||||
|
|
||||||
|
// hidden predicates
|
||||||
|
Prop hidden_predicates HIDDEN_PREDICATES =NULL RestoreHidenPredicates()
|
||||||
|
|
||||||
//
|
//
|
||||||
// Module list
|
// Module list
|
||||||
//
|
//
|
||||||
|
@ -647,7 +647,7 @@ yap_flag(update_semantics,X) :-
|
|||||||
|
|
||||||
yap_flag(toplevel_hook,G) :-
|
yap_flag(toplevel_hook,G) :-
|
||||||
var(G), !,
|
var(G), !,
|
||||||
( recorded('$toplevel_hooks',G,_) -> G ; G = false ).
|
( recorded('$toplevel_hooks',G,_) -> G ; G = fail ).
|
||||||
yap_flag(toplevel_hook,G) :- !,
|
yap_flag(toplevel_hook,G) :- !,
|
||||||
'$set_toplevel_hook'(G).
|
'$set_toplevel_hook'(G).
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
'$protect' :-
|
'$protect' :-
|
||||||
current_atom(Name),
|
current_atom(Name),
|
||||||
atom_codes(Name,[0'$|_]),
|
atom_codes(Name,[0'$|_]),
|
||||||
'$hide_predicates'(Name),
|
% '$hide_predicates'(Name),
|
||||||
'$hide'(Name).
|
'$hide'(Name).
|
||||||
'$protect' :-
|
'$protect' :-
|
||||||
'$hide_predicates'(bootstrap),
|
'$hide_predicates'(bootstrap),
|
||||||
|
Reference in New Issue
Block a user