From 375f3b7bc60f62b89df645163cc216443a24dc32 Mon Sep 17 00:00:00 2001 From: Ricardo Rocha Date: Fri, 7 Aug 2009 04:46:45 +0100 Subject: [PATCH] fix debugging procedures for tabling --- OPTYap/tab.insts.i | 7 ------- OPTYap/tab.tries.c | 8 ++++---- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/OPTYap/tab.insts.i b/OPTYap/tab.insts.i index 802193cda..2cf248ae0 100644 --- a/OPTYap/tab.insts.i +++ b/OPTYap/tab.insts.i @@ -813,17 +813,10 @@ } #ifdef TABLING_ERRORS { - sg_fr_ptr aux_sg_fr; int i, j, arity_args, arity_subs; CELL *aux_args; CELL *aux_subs; - aux_sg_fr = LOCAL_top_sg_fr; - while (aux_sg_fr && aux_sg_fr != sg_fr) - aux_sg_fr = SgFr_next(aux_sg_fr); - if (aux_sg_fr == NULL) - TABLING_ERROR_MESSAGE("aux_sg_fr == NULL (table_new_answer)"); - arity_args = PREG->u.s.s; arity_subs = *subs_ptr; aux_args = (CELL *)(GEN_CP(gcp) + 1); diff --git a/OPTYap/tab.tries.c b/OPTYap/tab.tries.c index 3804247ba..f085b16ca 100644 --- a/OPTYap/tab.tries.c +++ b/OPTYap/tab.tries.c @@ -821,12 +821,12 @@ ans_node_ptr answer_search(sg_fr_ptr sg_fr, CELL *subs_ptr) { current_ans_node = SgFr_answer_trie(sg_fr); for (i = subs_arity; i >= 1; i--) { +#ifdef TABLING_ERRORS + if (IsNonVarTerm(*(subs_ptr + i))) + TABLING_ERROR_MESSAGE("IsNonVarTem(*(subs_ptr + i)) (answer_search)"); +#endif /* TABLING_ERRORS */ STACK_CHECK_EXPAND(stack_terms, stack_vars, stack_terms_base); STACK_PUSH_UP(Deref(*(subs_ptr + i)), stack_terms); -#ifdef TABLING_ERRORS - if (IsNonVarTerm(*stack_terms)) - TABLING_ERROR_MESSAGE("IsNonVarTem(*stack_terms) (answer_search)"); -#endif /* TABLING_ERRORS */ do { Term t = STACK_POP_DOWN(stack_terms); if (IsVarTerm(t)) {