fix cut predicate in YapOr and ThOr

This commit is contained in:
João Santos
2012-02-27 17:18:01 +00:00
parent 21522ce151
commit 553fbc505f
6 changed files with 118 additions and 14 deletions

View File

@@ -156,6 +156,8 @@ int p_share_work(void) {
LOCAL_reply_signal = sharing;
REMOTE_reply_signal(worker_q) = sharing;
share_private_nodes(worker_q);
if(Get_LOCAL_prune_request())
CUT_send_prune_request(worker_q, Get_LOCAL_prune_request());
REMOTE_reply_signal(worker_q) = nodes_shared;
/* copy local stack ? */
LOCK(REMOTE_lock_signals(worker_q));
@@ -208,8 +210,12 @@ int q_share_work(int worker_p) {
}
YAPOR_ERROR_CHECKING(q_share_work, Get_OrFr_pend_prune_cp(LOCAL_top_or_fr) && BRANCH_LTT(worker_p, OrFr_depth(LOCAL_top_or_fr)) < OrFr_pend_prune_ltt(LOCAL_top_or_fr));
/* there is no pending prune with worker p at right --> safe move to worker p branch */
CUT_reset_prune_request();
if(Get_LOCAL_prune_request()){
UNLOCK_OR_FRAME(LOCAL_top_or_fr);
return FALSE;
}
BRANCH(worker_id, OrFr_depth(LOCAL_top_or_fr)) = BRANCH(worker_p, OrFr_depth(LOCAL_top_or_fr));
LOCAL_prune_request = NULL;
UNLOCK_OR_FRAME(LOCAL_top_or_fr);
/* unbind variables */
@@ -618,6 +624,13 @@ void share_private_nodes(int worker_q) {
or_frame = OrFr_next_on_stack(or_frame);
}
LOCK_OR_FRAME(REMOTE_top_or_fr(worker_q));
or_fr_ptr old_top = REMOTE_top_or_fr(worker_q);
Set_REMOTE_top_cp(worker_q,B);
Set_LOCAL_top_cp(B);
REMOTE_top_or_fr(worker_q) = LOCAL_top_or_fr = Get_LOCAL_top_cp()->cp_or_fr;
UNLOCK_OR_FRAME(old_top);
#ifdef TABLING
/* update subgoal frames in the maintained private branches */
sg_frame = LOCAL_top_sg_fr;