This commit is contained in:
Vítor Santos Costa 2019-02-01 13:14:33 +00:00
parent ca2542c798
commit fa96ffa932
7 changed files with 710 additions and 938 deletions

View File

@ -2854,12 +2854,12 @@ static Int undefp_handler(USES_REGS1) { /* '$undefp_handler'(P,Mod) */
pe = Yap_get_pred(Deref(ARG1), Deref(ARG2), "undefined/1"); pe = Yap_get_pred(Deref(ARG1), Deref(ARG2), "undefined/1");
PELOCK(59, pe); PELOCK(59, pe);
if (EndOfPAEntr(pe)) { if (EndOfPAEntr(pe)) {
UndefCode = FAILCODE; UndefCode = Yap_get_pred(TermFail, MkIntTerm(0), "no def");
UNLOCKPE(59, pe); UNLOCKPE(59, pe);
return false; return false;
} }
if (pe->OpcodeOfPred == UNDEF_OPCODE) { if (pe->OpcodeOfPred == UNDEF_OPCODE) {
UndefCode = FAILCODE; UndefCode = Yap_get_pred(TermFail, MkIntTerm(0), "no def");
UNLOCKPE(59, pe); UNLOCKPE(59, pe);
return false; return false;
} }

1607
C/terms.c

File diff suppressed because it is too large Load Diff

View File

@ -1107,17 +1107,11 @@ void Yap_plwrite(Term t, StreamDesc *mywrite, int max_depth, int flags,
rwt.parent = NULL; rwt.parent = NULL;
wglb.Ignore_ops = flags & Ignore_ops_f; wglb.Ignore_ops = flags & Ignore_ops_f;
wglb.Write_strings = flags & BackQuote_String_f; wglb.Write_strings = flags & BackQuote_String_f;
if (!(flags & Ignore_cyclics_f) && false) { // if (!(flags & Ignore_cyclics_f) && false)
Term ts[2]; {
ts[0] = Yap_BreakRational(t, 0, ts + 1, TermNil PASS_REGS); t = Yap_CheckLoops(t, 1);
// fprintf(stderr, "%lx %lx %lx\n", t, ts[0], ts[1]);
// Yap_DebugPlWriteln(ts[0]);
// ap_DebugPlWriteln(ts[1[);
if (ts[1] != TermNil) {
t = Yap_MkApplTerm(FunctorAtSymbol, 2, ts);
}
} }
/* protect slots for portray */ /* protect slots for portray */
writeTerm(t, priority, 1, FALSE, &wglb, &rwt); writeTerm(t, priority, 1, FALSE, &wglb, &rwt);
if (flags & New_Line_f) { if (flags & New_Line_f) {
if (flags & Fullstop_f) { if (flags & Fullstop_f) {
@ -1134,4 +1128,5 @@ void Yap_plwrite(Term t, StreamDesc *mywrite, int max_depth, int flags,
} }
Yap_CloseSlots(sls); Yap_CloseSlots(sls);
pop_text_stack(lvl); pop_text_stack(lvl);
} }

View File

@ -482,6 +482,9 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "_YAP_NOT_INSTALLED_=
# Model Specific # Model Specific
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUG=1>) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUG=1>)
# debug across macros
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:Debug>:-g3>)
#ensure cells are properly aligned in code #ensure cells are properly aligned in code
set(ALIGN_LONGS 1) set(ALIGN_LONGS 1)

View File

@ -444,6 +444,10 @@ extern bool Yap_ChDir(const char *path);
bool Yap_isDirectory(const char *FileName); bool Yap_isDirectory(const char *FileName);
extern bool Yap_Exists(const char *f); extern bool Yap_Exists(const char *f);
/* terms.c */
extern Term Yap_CheckLoops(Term inp, UInt arity USES_REGS);
extern void Yap_InitTermCPreds(void);
/* threads.c */ /* threads.c */
extern void Yap_InitThreadPreds(void); extern void Yap_InitThreadPreds(void);
extern void Yap_InitFirstWorkerThreadHandle(void); extern void Yap_InitFirstWorkerThreadHandle(void);

View File

@ -285,4 +285,8 @@ INLINE_ONLY Term Yap_ensure_atom__(const char *fu, const char *fi, int line,
yap_error_descriptor_t *new_error); yap_error_descriptor_t *new_error);
extern yap_error_descriptor_t *Yap_popErrorContext(bool oerr, bool pass); extern yap_error_descriptor_t *Yap_popErrorContext(bool oerr, bool pass);
#define must_be_variable(t) if (!IsVarTerm(t)) Yap_ThrowError(UNINSTANTIATION_ERROR, v, NULL)
#endif #endif

View File

@ -104,14 +104,6 @@ Succeed if _Term1_ and _Term2_ are unifiable with substitution
*/ */
/** @pred variable_in_term(? _Term_,? _Var_)
Succeed if the second argument _Var_ is a variable and occurs in
term _Term_.
*/
/** @pred variables_within_term(+ _Variables_,? _Term_, - _OutputVariables_) /** @pred variables_within_term(+ _Variables_,? _Term_, - _OutputVariables_)
@ -136,6 +128,7 @@ Succeed if _Term1_ and _Term2_ are variant terms.
variant/2, variant/2,
unifiable/3, unifiable/3,
subsumes/2, subsumes/2,
subsumes_chk/2, subsumes_chk/2,
cyclic_term/1, cyclic_term/1,
variable_in_term/2, variable_in_term/2,