incomplete tabling: remove subgoal frame from list of inactive subgoals when a repeated call appears.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1624 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
ricroc 2006-05-02 08:01:27 +00:00
parent fd79ec1b9d
commit ec5891574e
2 changed files with 6 additions and 15 deletions

View File

@ -5,7 +5,7 @@
Copyright: R. Rocha and NCC - University of Porto, Portugal
File: tab.insts.i
version: $Id: tab.insts.i,v 1.22 2006-01-17 14:10:41 vsc Exp $
version: $Id: tab.insts.i,v 1.23 2006-05-02 08:01:27 ricroc Exp $
**********************************************************************/
@ -362,7 +362,6 @@
PBOp(table_try_single, ld)
tab_ent_ptr tab_ent;
sg_fr_ptr sg_fr;
check_trail(TR);
tab_ent = PREG->u.ld.te;
@ -386,9 +385,6 @@
CELL *subs_ptr = YENV;
init_subgoal_frame(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
#ifdef LIMIT_TABLING
remove_from_global_sg_fr_list(sg_fr);
#endif /* LIMIT_TABLING */
SgFr_try_answer(sg_fr) = ans_node;
store_generator_node(tab_ent, sg_fr, PREG->u.ld.s, TRY_ANSWER);
PREG = (yamop *) CPREG;
@ -498,9 +494,6 @@
CELL *subs_ptr = YENV;
init_subgoal_frame(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
#ifdef LIMIT_TABLING
remove_from_global_sg_fr_list(sg_fr);
#endif /* LIMIT_TABLING */
SgFr_try_answer(sg_fr) = ans_node;
store_generator_node(tab_ent, sg_fr, PREG->u.ld.s, TRY_ANSWER);
PREG = (yamop *) CPREG;
@ -540,7 +533,7 @@
/* no answers --> fail */
UNLOCK(SgFr_lock(sg_fr));
goto fail;
} else if (SgFr_first_answer(sg_fr) == SgFr_answer_trie(sg_fr)) {
} else if (ans_node == SgFr_answer_trie(sg_fr)) {
/* yes answer --> procceed */
UNLOCK(SgFr_lock(sg_fr));
PREG = (yamop *) CPREG;
@ -610,9 +603,6 @@
CELL *subs_ptr = YENV;
init_subgoal_frame(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
#ifdef LIMIT_TABLING
remove_from_global_sg_fr_list(sg_fr);
#endif /* LIMIT_TABLING */
SgFr_try_answer(sg_fr) = ans_node;
store_generator_node(tab_ent, sg_fr, PREG->u.ld.s, TRY_ANSWER);
PREG = (yamop *) CPREG;
@ -652,7 +642,7 @@
/* no answers --> fail */
UNLOCK(SgFr_lock(sg_fr));
goto fail;
} else if (SgFr_first_answer(sg_fr) == SgFr_answer_trie(sg_fr)) {
} else if (ans_node == SgFr_answer_trie(sg_fr)) {
/* yes answer --> procceed */
UNLOCK(SgFr_lock(sg_fr));
PREG = (yamop *) CPREG;
@ -981,6 +971,7 @@
}
#endif /* YAPOR */
answer_resolution:
INIT_PREFETCH()
dep_fr_ptr dep_fr;

View File

@ -5,7 +5,7 @@
Copyright: R. Rocha and NCC - University of Porto, Portugal
File: tab.tries.C
version: $Id: tab.tries.c,v 1.19 2006-04-12 14:57:59 ricroc Exp $
version: $Id: tab.tries.c,v 1.20 2006-05-02 08:01:27 ricroc Exp $
**********************************************************************/
@ -755,7 +755,7 @@ sg_fr_ptr subgoal_search(yamop *preg, CELL **Yaddr) {
} else {
sg_fr = (sg_fr_ptr) TrNode_sg_fr(current_sg_node);
#ifdef LIMIT_TABLING
if (SgFr_state(sg_fr) == ready) {
if (SgFr_state(sg_fr) <= ready) { /* incomplete or ready */
remove_from_global_sg_fr_list(sg_fr);
}
#endif /* LIMIT_TABLING */