experiments with early completion.
This commit is contained in:
parent
537dbb19fa
commit
e35af2a352
@ -952,8 +952,31 @@
|
|||||||
/* if the number of substitution variables is zero,
|
/* if the number of substitution variables is zero,
|
||||||
an answer is sufficient to perform an early completion */
|
an answer is sufficient to perform an early completion */
|
||||||
if (*subs_ptr == 0 && gcp->cp_ap != ANSWER_RESOLUTION) {
|
if (*subs_ptr == 0 && gcp->cp_ap != ANSWER_RESOLUTION) {
|
||||||
|
dep_fr_ptr depfr = LOCAL_top_dep_fr;
|
||||||
gcp->cp_ap = COMPLETION;
|
gcp->cp_ap = COMPLETION;
|
||||||
mark_as_completed(sg_fr);
|
mark_as_completed(sg_fr);
|
||||||
|
if (LOCAL_top_sg_fr && gcp != SgFr_gen_cp(LOCAL_top_sg_fr)) {
|
||||||
|
fprintf(stderr,"Producer %p--%p\n",gcp,SgFr_gen_cp(LOCAL_top_sg_fr));
|
||||||
|
} else if ((depfr = LOCAL_top_dep_fr)) {
|
||||||
|
int external_consumers = FALSE;
|
||||||
|
choiceptr gc_B = B;
|
||||||
|
while (gc_B) {
|
||||||
|
if (gc_B > DepFr_cons_cp(depfr)) {
|
||||||
|
gc_B = DepFr_cons_cp(depfr);
|
||||||
|
depfr = DepFr_next(depfr);
|
||||||
|
}
|
||||||
|
if (gc_B->cp_b >= gcp) {
|
||||||
|
if (gc_B->cp_b > gcp)
|
||||||
|
external_consumers = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
gc_B = gc_B->cp_b;
|
||||||
|
}
|
||||||
|
if (!external_consumers) {
|
||||||
|
B = gcp;
|
||||||
|
goto complete_all;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* fail */
|
/* fail */
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -1555,6 +1578,7 @@
|
|||||||
/* complete all */
|
/* complete all */
|
||||||
sg_fr_ptr sg_fr;
|
sg_fr_ptr sg_fr;
|
||||||
|
|
||||||
|
complete_all:
|
||||||
sg_fr = GEN_CP(B)->cp_sg_fr;
|
sg_fr = GEN_CP(B)->cp_sg_fr;
|
||||||
private_completion(sg_fr);
|
private_completion(sg_fr);
|
||||||
if (IS_BATCHED_GEN_CP(B)) {
|
if (IS_BATCHED_GEN_CP(B)) {
|
||||||
|
@ -84,7 +84,7 @@ STD_PROTO(static inline tg_sol_fr_ptr CUT_prune_tg_solution_frames, (tg_sol_fr_p
|
|||||||
void *old_top; \
|
void *old_top; \
|
||||||
UInt diff; \
|
UInt diff; \
|
||||||
CELL *NEW_STACK; \
|
CELL *NEW_STACK; \
|
||||||
INFORMATION_MESSAGE("Expanding trail in 64 Mbytes"); \
|
INFORMATION_MESSAGE("Expanding trail in 64 Kbytes"); \
|
||||||
old_top = Yap_TrailTop; \
|
old_top = Yap_TrailTop; \
|
||||||
Yap_growtrail(64 * 1024L, TRUE); \
|
Yap_growtrail(64 * 1024L, TRUE); \
|
||||||
diff = (void *)Yap_TrailTop - old_top; \
|
diff = (void *)Yap_TrailTop - old_top; \
|
||||||
|
Reference in New Issue
Block a user