fix small bugs

This commit is contained in:
Vítor Santos Costa 2014-11-26 09:45:11 +00:00
parent 624183b78e
commit dc21270454

View File

@ -949,17 +949,19 @@ static Int init_current_predicate(USES_REGS1) {
at = NameOfFunctor(f); at = NameOfFunctor(f);
arity = ArityOfFunctor(f); arity = ArityOfFunctor(f);
} }
if (IsAtomTerm(t2)) // we know the module and the main predicate if (IsAtomTerm(t2)) { // we know the module and the main predicate
// so that we are deterministic // so that we are deterministic
if (arity == 0) { if (arity == 0) {
if (Yap_GetPredPropByAtom(at, t2) != NIL && if (Yap_GetPredPropByAtom(at, t2) != NIL &&
Yap_unify(ARG1, MkAtomTerm(at))) Yap_unify(ARG1, MkAtomTerm(at))) {
cut_succeed(); cut_succeed();
}
} else { } else {
if (Yap_GetPredPropByFunc(f, t2) != NIL && if (Yap_GetPredPropByFunc(f, t2) != NIL &&
Yap_unify(ARG1, MkAtomTerm(at))) Yap_unify(ARG1, MkAtomTerm(at))) {
cut_succeed(); cut_succeed();
} }
}
cut_fail(); cut_fail();
} }
} }