diff --git a/pl/arith.yap b/pl/arith.yap index 2d692e19f..0599dfc79 100644 --- a/pl/arith.yap +++ b/pl/arith.yap @@ -77,6 +77,11 @@ do_not_compile_expressions :- set_value('$c_arith',[]). '$clean_cuts'(NG0, NG), '$do_c_built_in'(A,M,NA), '$do_c_built_in'(B,M,NB). +'$do_c_built_in'((G*->A;B), M, (yap_hacks:current_choicepoint(DCP),NG,yap_hacks:cut_at(DCP),NA; NB)) :- !, + '$do_c_built_in'(G,M,NG0), + '$clean_cuts'(NG0, NG), + '$do_c_built_in'(A,M,NA), + '$do_c_built_in'(B,M,NB). '$do_c_built_in'((G*->A), M, (NG,NA)) :- !, '$do_c_built_in'(G,M,NG0), '$clean_cuts'(NG0, NG), diff --git a/pl/boot.yap b/pl/boot.yap index 73c47d069..fe7a4fe17 100755 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -505,15 +505,18 @@ true :- true. '$add_env_and_fail' :- fail. +% +% *-> at this point would require compiler support, which does not exist. +% '$delayed_goals'(G, V, NV, LGs, NCP) :- - ( - yap_hacks:current_choice_point(NCP1), + if( + (yap_hacks:current_choice_point(NCP1), '$attributes':delayed_goals(G, V, NV, LGs), - yap_hacks:current_choice_point(NCP2) - *-> - NCP is NCP2-NCP1 - ; - copy_term_nat(V, NV), LGs = [], NCP = 0 + yap_hacks:current_choice_point(NCP2)) + , + (NCP is NCP2-NCP1) + , + (copy_term_nat(V, NV), LGs = [], NCP = 0) ). '$out_neg_answer' :-