fix arithmetic dependence on Prolog table.

This commit is contained in:
Vitor Santos Costa
2009-02-25 00:12:36 +00:00
parent ffb621c53b
commit 2bc5d8425a
4 changed files with 75 additions and 61 deletions

View File

@@ -131,16 +131,16 @@ BEAM_is(void)
#endif
static Int
p_is(CELL result, CELL in)
p_is(void)
{ /* X is Y */
Term out;
out = Eval(Deref(in));
out = Eval(Deref(ARG2));
if (out == 0L) {
Yap_Error(EVALUATION_ERROR_INT_OVERFLOW, ARG2, "is/2");
return FALSE;
}
return Yap_unify_constant(result,out);
return Yap_unify_constant(ARG1,out);
}
void
@@ -150,6 +150,6 @@ Yap_InitEval(void)
Yap_InitConstExps();
Yap_InitUnaryExps();
Yap_InitBinaryExps();
Yap_InitCmpPred("is", 2, p_is, BinaryPredFlag | TestPredFlag | SafePredFlag);
Yap_InitCPred("is", 2, p_is, SafePredFlag);
}