undefined with fast_fail support

This commit is contained in:
Vítor Santos Costa
2015-12-15 09:18:36 +00:00
parent 5ceb98bdf9
commit 14459cce03
5 changed files with 241 additions and 32 deletions

View File

@@ -1441,6 +1441,26 @@ static void retract_all(PredEntry *p, int in_use) {
Yap_PutValue(AtomAbol, MkAtomTerm(AtomTrue));
}
bool Yap_unknown( Term t )
{
if (t == TermFastFail) {
UndefCode->OpcodeOfPred = FAIL_OPCODE;
return true;
} else if (t == TermError) {
UndefCode->OpcodeOfPred = UndefCode->CodeOfPred->opc;
return true;
} else if (t == TermFail) {
UndefCode->OpcodeOfPred = UndefCode->CodeOfPred->opc;
return true;
} else if (t == TermWarning) {
UndefCode->OpcodeOfPred = UndefCode->CodeOfPred->opc;
return true;
}
return false;
}
static int source_pred(PredEntry *p, yamop *q) {
if (p->PredFlags & (DynamicPredFlag | LogUpdatePredFlag))
return FALSE;