From e55d143e8d043aa7669b42e0c39d6f9ca991e7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Fri, 8 Jun 2012 13:26:11 +0100 Subject: [PATCH] fix extra CP. --- pl/boot.yap | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pl/boot.yap b/pl/boot.yap index a7fd65f3d..e7a120c34 100755 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -470,16 +470,15 @@ true :- true. '$execute'(G), yap_hacks:current_choice_point(NCP), ( '$enter_system_mode' ; '$exit_system_mode', fail), - yap_hacks:current_choice_point(NCP1), - '$delayed_goals'(G, V, NV, LGs), - yap_hacks:current_choice_point(NCP2), + '$delayed_goals'(G, V, NV, LGs, DCP), '$write_answer'(NV, LGs, Written), '$write_query_answer_true'(Written), ( - '$prompt_alternatives_on'(determinism), CP = NCP, NCP1 = NCP2 -> + '$prompt_alternatives_on'(determinism), CP = NCP, DCP = 0 -> nl(user_error), ! ; + '$another', ! ), @@ -492,7 +491,7 @@ true :- true. '$yes_no'(G,C) :- '$current_module'(M), '$do_yes_no'(G,M), - '$delayed_goals'(G, [], NV, LGs), + '$delayed_goals'(G, [], NV, LGs, _), '$write_answer'(NV, LGs, Written), ( Written = [] -> !,'$present_answer'(C, yes); @@ -505,13 +504,15 @@ true :- true. '$add_env_and_fail' :- fail. -'$delayed_goals'(G, V, NV, LGs) :- +'$delayed_goals'(G, V, NV, LGs, NCP) :- ( - '$attributes':delayed_goals(G, V, NV, LGs) + yap_hacks:current_choice_point(NCP1), + '$attributes':delayed_goals(G, V, NV, LGs), + yap_hacks:current_choice_point(NCP2) *-> - true + NCP is NCP2-NCP1 ; - copy_term_nat(V, NV), LGs = [] + copy_term_nat(V, NV), LGs = [], NCP = 0 ). '$out_neg_answer' :-