include cp_h field in deterministic choice points, otherwise we get in trouble
This commit is contained in:
parent
4f6676e5af
commit
23d44f959d
21
C/heapgc.c
21
C/heapgc.c
@ -1914,10 +1914,7 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose)
|
|||||||
current_B = gc_B;
|
current_B = gc_B;
|
||||||
prev_HB = HB;
|
prev_HB = HB;
|
||||||
#endif
|
#endif
|
||||||
#ifdef DETERMINISTIC_TABLING
|
HB = gc_B->cp_h;
|
||||||
if (!IS_DET_GEN_CP(gc_B))
|
|
||||||
#endif /* DETERMINISTIC_TABLING */
|
|
||||||
HB = gc_B->cp_h;
|
|
||||||
#ifdef INSTRUMENT_GC
|
#ifdef INSTRUMENT_GC
|
||||||
num_bs++;
|
num_bs++;
|
||||||
#endif
|
#endif
|
||||||
@ -1960,9 +1957,6 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef DETERMINISTIC_TABLING
|
|
||||||
if (!IS_DET_GEN_CP(gc_B))
|
|
||||||
#endif /* DETERMINISTIC_TABLING */
|
|
||||||
{
|
{
|
||||||
/* find out how many cells are still alive in the trail */
|
/* find out how many cells are still alive in the trail */
|
||||||
mark_trail(saved_TR, gc_B->cp_tr, gc_B->cp_h, gc_B);
|
mark_trail(saved_TR, gc_B->cp_tr, gc_B->cp_h, gc_B);
|
||||||
@ -3181,15 +3175,6 @@ update_B_H( choiceptr gc_B, CELL *current, CELL *dest, CELL *odest
|
|||||||
dep_fr_ptr depfr = *depfrp;
|
dep_fr_ptr depfr = *depfrp;
|
||||||
#endif /* TABLING */
|
#endif /* TABLING */
|
||||||
|
|
||||||
#ifdef DETERMINISTIC_TABLING
|
|
||||||
while (IS_DET_GEN_CP(gc_B))
|
|
||||||
gc_B = gc_B->cp_b;
|
|
||||||
/* make sure we include consumers */
|
|
||||||
if (depfr && gc_B >= DepFr_cons_cp(depfr)) {
|
|
||||||
gc_B = DepFr_cons_cp(depfr);
|
|
||||||
*depfrp = depfr = DepFr_next(depfr);
|
|
||||||
}
|
|
||||||
#endif /* DETERMINISTIC_TABLING */
|
|
||||||
while (gc_B && current <= gc_B->cp_h) {
|
while (gc_B && current <= gc_B->cp_h) {
|
||||||
if (gc_B->cp_h == current) {
|
if (gc_B->cp_h == current) {
|
||||||
gc_B->cp_h = dest;
|
gc_B->cp_h = dest;
|
||||||
@ -3198,10 +3183,6 @@ update_B_H( choiceptr gc_B, CELL *current, CELL *dest, CELL *odest
|
|||||||
}
|
}
|
||||||
gc_B = gc_B->cp_b;
|
gc_B = gc_B->cp_b;
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
#ifdef DETERMINISTIC_TABLING
|
|
||||||
while (IS_DET_GEN_CP(gc_B))
|
|
||||||
gc_B = gc_B->cp_b;
|
|
||||||
#endif /* DETERMINISTIC_TABLING */
|
|
||||||
/* make sure we include consumers */
|
/* make sure we include consumers */
|
||||||
if (depfr && gc_B >= DepFr_cons_cp(depfr)) {
|
if (depfr && gc_B >= DepFr_cons_cp(depfr)) {
|
||||||
gc_B = DepFr_cons_cp(depfr);
|
gc_B = DepFr_cons_cp(depfr);
|
||||||
|
@ -816,6 +816,7 @@ struct deterministic_choicept {
|
|||||||
int cp_lub; /* local untried branches */
|
int cp_lub; /* local untried branches */
|
||||||
struct or_frame *cp_or_fr; /* or-frame pointer */
|
struct or_frame *cp_or_fr; /* or-frame pointer */
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
|
CELL *cp_h; /* necessary, otherwise we get in trouble */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct choicept {
|
typedef struct choicept {
|
||||||
|
@ -39,15 +39,20 @@
|
|||||||
#define BFZ_TRAIL_SCHEME 1
|
#define BFZ_TRAIL_SCHEME 1
|
||||||
/* #define BBREG_TRAIL_SCHEME 1 */
|
/* #define BBREG_TRAIL_SCHEME 1 */
|
||||||
|
|
||||||
|
/* ----------------------------------------------- **
|
||||||
|
** support early completion ? (optional) **
|
||||||
|
** ----------------------------------------------- */
|
||||||
|
#define TABLING_EARLY_COMPLETION 1
|
||||||
|
|
||||||
/* ------------------------------------------------ **
|
/* ------------------------------------------------ **
|
||||||
** support trie compact pairs? (optional) **
|
** support trie compact pairs? (optional) **
|
||||||
** ------------------------------------------------ */
|
** ------------------------------------------------ */
|
||||||
/* #define TRIE_COMPACT_PAIRS 1 */
|
/* #define TRIE_COMPACT_PAIRS 1 */
|
||||||
|
|
||||||
/* ----------------------------------------------- **
|
/* --------------------------------------------------- **
|
||||||
** support early completion ? (optional) **
|
** support deterministic tabling? (optional) **
|
||||||
** ----------------------------------------------- */
|
** --------------------------------------------------- */
|
||||||
#define TABLING_EARLY_COMPLETION 1
|
/* #define DETERMINISTIC_TABLING 1 */
|
||||||
|
|
||||||
/* ------------------------------------------------ **
|
/* ------------------------------------------------ **
|
||||||
** limit the table space size? (optional) **
|
** limit the table space size? (optional) **
|
||||||
@ -59,11 +64,6 @@
|
|||||||
** ------------------------------------------------ */
|
** ------------------------------------------------ */
|
||||||
/* #define INCOMPLETE_TABLING 1 */
|
/* #define INCOMPLETE_TABLING 1 */
|
||||||
|
|
||||||
/* --------------------------------------------------- **
|
|
||||||
** support deterministic tabling? (optional) **
|
|
||||||
** --------------------------------------------------- */
|
|
||||||
/* #define DETERMINISTIC_TABLING 1 */
|
|
||||||
|
|
||||||
/* ---------------------------------------- -- **
|
/* ---------------------------------------- -- **
|
||||||
** enable error checking? (optional) **
|
** enable error checking? (optional) **
|
||||||
** ------------------------------------------- */
|
** ------------------------------------------- */
|
||||||
|
@ -95,9 +95,10 @@
|
|||||||
/* store deterministic generator choice point */ \
|
/* store deterministic generator choice point */ \
|
||||||
HBREG = H; \
|
HBREG = H; \
|
||||||
store_yaam_reg_cpdepth(gcp); \
|
store_yaam_reg_cpdepth(gcp); \
|
||||||
gcp->cp_tr = TR; \
|
|
||||||
gcp->cp_ap = COMPLETION; \
|
gcp->cp_ap = COMPLETION; \
|
||||||
gcp->cp_b = B; \
|
gcp->cp_b = B; \
|
||||||
|
gcp->cp_tr = TR; \
|
||||||
|
gcp->cp_h = H; \
|
||||||
DET_GEN_CP(gcp)->cp_sg_fr = SG_FR; \
|
DET_GEN_CP(gcp)->cp_sg_fr = SG_FR; \
|
||||||
store_low_level_trace_info(DET_GEN_CP(gcp), TAB_ENT); \
|
store_low_level_trace_info(DET_GEN_CP(gcp), TAB_ENT); \
|
||||||
set_cut((CELL *)gcp, B); \
|
set_cut((CELL *)gcp, B); \
|
||||||
@ -748,6 +749,7 @@
|
|||||||
choiceptr gcp = NORM_CP(DET_GEN_CP(subs_ptr) - 1);
|
choiceptr gcp = NORM_CP(DET_GEN_CP(subs_ptr) - 1);
|
||||||
sg_fr_ptr sg_fr = GEN_CP(B)->cp_sg_fr;
|
sg_fr_ptr sg_fr = GEN_CP(B)->cp_sg_fr;
|
||||||
DET_GEN_CP(gcp)->cp_sg_fr = sg_fr;
|
DET_GEN_CP(gcp)->cp_sg_fr = sg_fr;
|
||||||
|
gcp->cp_h = B->cp_h;
|
||||||
#ifdef DEPTH_LIMIT
|
#ifdef DEPTH_LIMIT
|
||||||
gcp->cp_depth = B->cp_depth;
|
gcp->cp_depth = B->cp_depth;
|
||||||
#endif /* DEPTH_LIMIT */
|
#endif /* DEPTH_LIMIT */
|
||||||
@ -775,6 +777,7 @@
|
|||||||
choiceptr gcp = NORM_CP(DET_GEN_CP(subs_ptr) - 1);
|
choiceptr gcp = NORM_CP(DET_GEN_CP(subs_ptr) - 1);
|
||||||
sg_fr_ptr sg_fr = GEN_CP(B)->cp_sg_fr;
|
sg_fr_ptr sg_fr = GEN_CP(B)->cp_sg_fr;
|
||||||
DET_GEN_CP(gcp)->cp_sg_fr = sg_fr;
|
DET_GEN_CP(gcp)->cp_sg_fr = sg_fr;
|
||||||
|
gcp->cp_h = B->cp_h;
|
||||||
#ifdef DEPTH_LIMIT
|
#ifdef DEPTH_LIMIT
|
||||||
gcp->cp_depth = B->cp_depth;
|
gcp->cp_depth = B->cp_depth;
|
||||||
#endif /* DEPTH_LIMIT */
|
#endif /* DEPTH_LIMIT */
|
||||||
|
Reference in New Issue
Block a user