recognise discontiguous flag

This commit is contained in:
Vitor Santos Costa 2016-05-12 11:48:39 +01:00
parent d46bef3adb
commit abe1168b1d

View File

@ -1464,9 +1464,10 @@ PredEntry *Yap_PredFromClause(Term t USES_REGS) {
bool Yap_discontiguous(PredEntry *ap, Term mode USES_REGS) { bool Yap_discontiguous(PredEntry *ap, Term mode USES_REGS) {
register consult_obj *fp; register consult_obj *fp;
if (ap->PredFlags & (DiscontiguousPredFlag|MultiFileFlag)) if (ap->PredFlags & (DiscontiguousPredFlag | MultiFileFlag) ||
falseGlobalPrologFlag(DISCONTIGUOUS_WARNINGS_FLAG))
return false; return false;
if (mode != TermConsult && mode != TermReconsult) if ((mode != TermConsult && mode != TermReconsult))
return false; return false;
if (!LOCAL_ConsultSp) { if (!LOCAL_ConsultSp) {
return false; return false;
@ -1503,18 +1504,18 @@ static Int
Term mod = Deref(ARG3); Term mod = Deref(ARG3);
if (IsVarTerm(t)) if (IsVarTerm(t))
return (FALSE); return false;
if (IsAtomTerm(t)) if (IsAtomTerm(t))
at = AtomOfTerm(t); at = AtomOfTerm(t);
else else
return (FALSE); return false;
t = Deref(ARG2); t = Deref(ARG2);
if (IsVarTerm(t)) if (IsVarTerm(t))
return (FALSE); return false;
if (IsIntTerm(t)) if (IsIntTerm(t))
arity = IntOfTerm(t); arity = IntOfTerm(t);
else else
return FALSE; return false;
if (arity == 0) if (arity == 0)
pe = RepPredProp(PredPropByAtom(at, mod)); pe = RepPredProp(PredPropByAtom(at, mod));
else else
@ -1639,7 +1640,7 @@ bool Yap_addclause(Term t, yamop *cp, Term tmode, Term mod, Term *t4ref)
else else
tf = t; tf = t;
tf = Yap_YapStripModule(tf, &mod); tf = Yap_YapStripModule(tf, &mod);
if (IsAtomTerm(tf)) { if (IsAtomTerm(tf)) {
at = AtomOfTerm(tf); at = AtomOfTerm(tf);
p = RepPredProp(PredPropByAtom(at, mod)); p = RepPredProp(PredPropByAtom(at, mod));
@ -1811,11 +1812,11 @@ bool Yap_addclause(Term t, yamop *cp, Term tmode, Term mod, Term *t4ref)
tn = Yap_MkApplTerm(FunctorMultiFileClause, 5, t); tn = Yap_MkApplTerm(FunctorMultiFileClause, 5, t);
Yap_Recordz(AtomMultiFile, tn); Yap_Recordz(AtomMultiFile, tn);
} }
if (t4ref && *t4ref != TermNil) { if (t4ref && *t4ref != TermNil) {
if (!Yap_unify(*t4ref, tf)) { if (!Yap_unify(*t4ref, tf)) {
return false; return false;
} }
} }
return true; return true;
} }