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,16 +949,18 @@ static Int init_current_predicate(USES_REGS1) {
at = NameOfFunctor(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
if (arity == 0) {
if (Yap_GetPredPropByAtom(at, t2) != NIL &&
Yap_unify(ARG1, MkAtomTerm(at)))
Yap_unify(ARG1, MkAtomTerm(at))) {
cut_succeed();
}
} else {
if (Yap_GetPredPropByFunc(f, t2) != NIL &&
Yap_unify(ARG1, MkAtomTerm(at)))
Yap_unify(ARG1, MkAtomTerm(at))) {
cut_succeed();
}
}
cut_fail();
}