creepy fixes

This commit is contained in:
Vítor Santos Costa 2013-02-15 10:31:49 -06:00
parent fdd05abd38
commit 918a973019
4 changed files with 11 additions and 6 deletions

View File

@ -148,6 +148,7 @@ lcall2([Goal|Goals], Mod) :-
prolog:call_residue_vars(Goal,Residue) :- prolog:call_residue_vars(Goal,Residue) :-
attributes:all_attvars(Vs0), attributes:all_attvars(Vs0),
call(Goal), call(Goal),
'$stop_creeping',
attributes:all_attvars(Vs), attributes:all_attvars(Vs),
% this should not be actually strictly necessary right now. % this should not be actually strictly necessary right now.
% but it makes it a safe bet. % but it makes it a safe bet.

View File

@ -493,7 +493,7 @@ true :- true.
'$write_answer'(NV, LGs, Written), '$write_answer'(NV, LGs, Written),
'$write_query_answer_true'(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', []), format(user_error, '.~n', []),
! !
@ -1085,7 +1085,7 @@ bootstrap(F) :-
% support SWI hook in a separate predicate, to avoid slow down standard consult. % support SWI hook in a separate predicate, to avoid slow down standard consult.
'$enter_command_with_hook'(Stream,Status) :- '$enter_command_with_hook'(Stream,Status) :-
'$read_vars'(Stream,Command,_,Pos,Vars, '|: ', Comments), '$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). '$command'(Command,Vars,Pos,Status).
'$abort_loop'(Stream) :- '$abort_loop'(Stream) :-

View File

@ -119,8 +119,7 @@ setup_call_catcher_cleanup(Setup, Goal, Catcher, Cleanup) :-
yap_hacks:enable_interrupts, yap_hacks:enable_interrupts,
'$current_choice_point'(CP0), '$current_choice_point'(CP0),
'$execute'(Goal), '$execute'(Goal),
% ensure environment for delayed variables in Goal '$stop_creeping',
'$true',
'$current_choice_point'(CPF), '$current_choice_point'(CPF),
( (
CP0 =:= CPF CP0 =:= CPF
@ -131,6 +130,7 @@ setup_call_catcher_cleanup(Setup, Goal, Catcher, Cleanup) :-
true true
) )
; ;
'$stop_creeping',
Catcher = fail, Catcher = fail,
fail fail
). ).

View File

@ -50,10 +50,12 @@ findall(Template, Generator, Answers, SoFar) :-
nb:nb_queue(Ref), nb:nb_queue(Ref),
( (
'$execute'(Generator), '$execute'(Generator),
'$stop_creeping',
nb:nb_queue_enqueue(Ref, Template), 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), '$init_db_queue'(Ref),
( '$catch'(Error,'$clean_findall'(Ref,Error),_), ( '$catch'(Error,'$clean_findall'(Ref,Error),_),
'$execute'(G), '$execute'(G),
'$stop_creeping',
'$db_enqueue'(Ref, T), '$db_enqueue'(Ref, T),
fail fail
; ;
'$stop_creeping',
'$$set'(S,Ref) '$$set'(S,Ref)
). ).