fix creeping with debugger after failing a static clause

This commit is contained in:
Vítor Santos Costa 2015-11-12 14:56:31 +00:00
parent 832599d220
commit 67c8253135

View File

@ -307,6 +307,7 @@ be lost.
%'$do_spy'(V, M, CP, Flag) :- %'$do_spy'(V, M, CP, Flag) :-
% writeln('$do_spy'(V, M, CP, Flag)), fail. % writeln('$do_spy'(V, M, CP, Flag)), fail.
'$do_spy'(V, M, CP, Flag) :- '$do_spy'(V, M, CP, Flag) :-
'$stop_creeping',
var(V), !, var(V), !,
'$do_spy'(call(V), M, CP, Flag). '$do_spy'(call(V), M, CP, Flag).
'$do_spy'(!, _, CP, _) :- '$do_spy'(!, _, CP, _) :-
@ -323,6 +324,7 @@ be lost.
'$do_spy'((T->A;B), M, CP, CalledFromDebugger) :- !, '$do_spy'((T->A;B), M, CP, CalledFromDebugger) :- !,
( '$do_spy'(T, M, CP, debugger) -> '$do_spy'(A, M, CP, CalledFromDebugger) ( '$do_spy'(T, M, CP, debugger) -> '$do_spy'(A, M, CP, CalledFromDebugger)
; ;
'$do_spy'(B, M, CP, CalledFromDebugger) '$do_spy'(B, M, CP, CalledFromDebugger)
). ).
'$do_spy'((T->A|B), M, CP, CalledFromDebugger) :- !, '$do_spy'((T->A|B), M, CP, CalledFromDebugger) :- !,
@ -331,6 +333,7 @@ be lost.
-> ->
'$do_spy'(A, M, CP, CalledFromDebugger) '$do_spy'(A, M, CP, CalledFromDebugger)
; ;
'$stop_creeping',
'$do_spy'(B, M, CP, CalledFromDebugger) '$do_spy'(B, M, CP, CalledFromDebugger)
). ).
'$do_spy'((T->A), M, CP, CalledFromDebugger) :- !, '$do_spy'((T->A), M, CP, CalledFromDebugger) :- !,
@ -339,12 +342,14 @@ be lost.
( (
'$do_spy'(A, M, CP, CalledFromDebugger) '$do_spy'(A, M, CP, CalledFromDebugger)
; ;
'$stop_creeping',
'$do_spy'(B, M, CP, CalledFromDebugger) '$do_spy'(B, M, CP, CalledFromDebugger)
). ).
'$do_spy'((A|B), M, CP, CalledFromDebugger) :- !, '$do_spy'((A|B), M, CP, CalledFromDebugger) :- !,
( (
'$do_spy'(A, M, CP, CalledFromDebugger ) '$do_spy'(A, M, CP, CalledFromDebugger )
; ;
'$stop_creeping',
'$do_spy'(B, M, CP, CalledFromDebugger ) '$do_spy'(B, M, CP, CalledFromDebugger )
). ).
'$do_spy'((\+G), M, CP, CalledFromDebugger) :- !, '$do_spy'((\+G), M, CP, CalledFromDebugger) :- !,
@ -442,7 +447,7 @@ be lost.
), ),
'$continue_debugging'(exit, CalledFromDebugger) '$continue_debugging'(exit, CalledFromDebugger)
; ;
% make sure we are in system mode when running the debugger. /* make sure we are in system mode when running the debugger. */
/* backtracking from exit */ /* backtracking from exit */
/* we get here when we want to redo a goal */ /* we get here when we want to redo a goal */
/* redo port */ /* redo port */
@ -456,7 +461,7 @@ be lost.
true true
), ),
'$continue_debugging'(fail, CalledFromDebugger), '$continue_debugging'(fail, CalledFromDebugger),
fail /* to backtrack to spycalls */ fail /* to backtrack to spycall */
) )
; ;
'$stop_creeping', '$stop_creeping',
@ -572,6 +577,7 @@ be lost.
(CP1 == CP2 -> ! ; ( true ; '$creep', fail ) ), (CP1 == CP2 -> ! ; ( true ; '$creep', fail ) ),
'$stop_creeping' '$stop_creeping'
; ;
'$stop_creeping',
fail fail
). ).
'$creep'(G,M) :- '$creep'(G,M) :-