From 28ec10b7648fc46a409d1e1f21a5e944b29bdf8d Mon Sep 17 00:00:00 2001 From: vsc Date: Tue, 26 Nov 2002 23:00:32 +0000 Subject: [PATCH] meta-call should not have choice-points when co-routyining starts. This happened because of ; Thanks to Patrick Caldron. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@709 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- pl/boot.yap | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/pl/boot.yap b/pl/boot.yap index 5cd543d33..37bbed1e5 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -749,15 +749,19 @@ not(A) :- '$call'(A, _, _,CurMod) :- ( % goal_expansion is defined, or - '$pred_goal_expansion_on' + '$pred_goal_expansion_on' -> + '$expand_call'(A,CurMod) ; % this is a meta-predicate - '$flags'(A,CurMod,F,_), F /\ 0x200000 =:= 0x200000 - ), !, + '$flags'(A,CurMod,F,_), F /\ 0x200000 =:= 0x200000 -> + '$expand_call'(A,CurMod) + ; + '$execute0'(A, CurMod) + ). + +'$expand_call'(A,CurMod) :- '$expand_goal'(A, CurMod, CurMod, NG, NMod), '$execute0'(NG, NMod). -'$call'(A, _, _, M) :- - '$execute0'(A, M). '$spied_call'((A,B),CP,G0,M) :- !, '$execute_within'(A,CP,G0,M), @@ -796,17 +800,27 @@ not(A) :- '$$cut_by'(CP). '$spied_call'([A|B],_,_,M) :- !, '$csult'([A|B], M). -'$spied_call'(A, _CP, _G0, CurMod) :- +'$spied_call'(A, CP, G0, CurMod) :- ( % goal_expansion is defined, or '$pred_goal_expansion_on' + -> + '$finish_spied_call'(A,CurMod) ; % this is a meta-predicate '$flags'(A,CurMod,F,_), F /\ 0x200000 =:= 0x200000 - ), !, + -> + '$finish_spied_call'(A,CurMod) + ; + % finish_it_off (careful with co-routining) + '$std_spied_call'(A, CP, G0, CurMod) + ). + +'$finish_spied_call'(A,CurMod) :- '$expand_goal'(A, CurMod, CurMod, NG, NMod), '$execute0'(NG, NMod). -'$spied_call'(A, CP, G0, M) :- + +'$std_spied_call'(A, CP, G0, M) :- ( '$undefined'(A, M) -> functor(A,F,N), ( '$recorded'('$import','$import'(S,M,F,N),_) ->