diff --git a/pl/attributes.yap b/pl/attributes.yap index 84078cac4..26644647a 100644 --- a/pl/attributes.yap +++ b/pl/attributes.yap @@ -148,6 +148,7 @@ lcall2([Goal|Goals], Mod) :- prolog:call_residue_vars(Goal,Residue) :- attributes:all_attvars(Vs0), call(Goal), + '$stop_creeping', attributes:all_attvars(Vs), % this should not be actually strictly necessary right now. % but it makes it a safe bet. diff --git a/pl/boot.yap b/pl/boot.yap index 5e160517f..77530ebc5 100755 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -493,7 +493,7 @@ true :- true. '$write_answer'(NV, LGs, Written), '$write_query_answer_true'(Written), ( - '$prompt_alternatives_on'(determinism), CP = NCP, DCP = 0 + '$prompt_alternatives_on'(determinism), CP == NCP, DCP = 0 -> format(user_error, '.~n', []), ! @@ -1085,7 +1085,7 @@ bootstrap(F) :- % support SWI hook in a separate predicate, to avoid slow down standard consult. '$enter_command_with_hook'(Stream,Status) :- '$read_vars'(Stream,Command,_,Pos,Vars, '|: ', Comments), - ( prolog:comment_hook(Comments,Pos,Command), prolog) -> true ; true ), + ( prolog:comment_hook(Comments,Pos,Command) -> true ; true ), '$command'(Command,Vars,Pos,Status). '$abort_loop'(Stream) :- diff --git a/pl/control.yap b/pl/control.yap index e3e678578..131a93301 100644 --- a/pl/control.yap +++ b/pl/control.yap @@ -119,8 +119,7 @@ setup_call_catcher_cleanup(Setup, Goal, Catcher, Cleanup) :- yap_hacks:enable_interrupts, '$current_choice_point'(CP0), '$execute'(Goal), - % ensure environment for delayed variables in Goal - '$true', + '$stop_creeping', '$current_choice_point'(CPF), ( CP0 =:= CPF @@ -131,6 +130,7 @@ setup_call_catcher_cleanup(Setup, Goal, Catcher, Cleanup) :- true ) ; + '$stop_creeping', Catcher = fail, fail ). diff --git a/pl/setof.yap b/pl/setof.yap index ed6deafb4..fa99b7bdd 100644 --- a/pl/setof.yap +++ b/pl/setof.yap @@ -50,10 +50,12 @@ findall(Template, Generator, Answers, SoFar) :- nb:nb_queue(Ref), ( '$execute'(Generator), + '$stop_creeping', nb:nb_queue_enqueue(Ref, Template), - fail + fail ; - nb:nb_queue_close(Ref, Answers, SoFar) + '$stop_creeping', + nb:nb_queue_close(Ref, Answers, SoFar) ). @@ -147,9 +149,11 @@ all(T,G,S) :- '$init_db_queue'(Ref), ( '$catch'(Error,'$clean_findall'(Ref,Error),_), '$execute'(G), + '$stop_creeping', '$db_enqueue'(Ref, T), fail ; + '$stop_creeping', '$$set'(S,Ref) ).