Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3

This commit is contained in:
Vitor Santos Costa 2015-11-12 15:01:36 +00:00
commit bfc67e5e35
4 changed files with 69 additions and 39 deletions

View File

@ -2,7 +2,7 @@
set (MPI_SOURCES
hash.c prologterms2c.c yap_mpi.c)
macro_optional_find_package(MPI ON)
macro_optional_find_package(Mpi ON)
macro_log_feature (MPI_C_FOUND "Mpi"
"Use Mpi System"
"http://www.mpi.org" FALSE)

View File

@ -307,6 +307,7 @@ be lost.
%'$do_spy'(V, M, CP, Flag) :-
% writeln('$do_spy'(V, M, CP, Flag)), fail.
'$do_spy'(V, M, CP, Flag) :-
'$stop_creeping',
var(V), !,
'$do_spy'(call(V), M, CP, Flag).
'$do_spy'(!, _, CP, _) :-
@ -323,6 +324,7 @@ be lost.
'$do_spy'((T->A;B), M, CP, CalledFromDebugger) :- !,
( '$do_spy'(T, M, CP, debugger) -> '$do_spy'(A, M, CP, CalledFromDebugger)
;
'$do_spy'(B, M, CP, CalledFromDebugger)
).
'$do_spy'((T->A|B), M, CP, CalledFromDebugger) :- !,
@ -331,6 +333,7 @@ be lost.
->
'$do_spy'(A, M, CP, CalledFromDebugger)
;
'$stop_creeping',
'$do_spy'(B, M, CP, CalledFromDebugger)
).
'$do_spy'((T->A), M, CP, CalledFromDebugger) :- !,
@ -339,13 +342,15 @@ be lost.
(
'$do_spy'(A, M, CP, CalledFromDebugger)
;
'$do_spy'(B, M, CP, CalledFromDebugger)
'$stop_creeping',
'$do_spy'(B, M, CP, CalledFromDebugger)
).
'$do_spy'((A|B), M, CP, CalledFromDebugger) :- !,
(
'$do_spy'(A, M, CP, CalledFromDebugger )
;
'$do_spy'(B, M, CP, CalledFromDebugger )
'$stop_creeping',
'$do_spy'(B, M, CP, CalledFromDebugger )
).
'$do_spy'((\+G), M, CP, CalledFromDebugger) :- !,
\+ '$do_spy'(G, M, CP, CalledFromDebugger).
@ -427,44 +432,44 @@ be lost.
/* go execute the continuation */
(
/* exit port */
Retry = false,
/* found an answer, so it can redo */
nb_setarg(6, Info, true),
'$show_trace'(exit,G,Module,GoalNumber,Det), /* output message at exit */
/* exit port */
/* get rid of deterministic computations */
(
Det == true
Retry = false,
/* found an answer, so it can redo */
nb_setarg(6, Info, true),
'$show_trace'(exit,G,Module,GoalNumber,Det), /* output message at exit */
/* exit port */
/* get rid of deterministic computations */
(
Det == true
->
'$$cut_by'(CP)
'$$cut_by'(CP)
;
true
),
'$continue_debugging'(exit, CalledFromDebugger)
true
),
'$continue_debugging'(exit, CalledFromDebugger)
;
% make sure we are in system mode when running the debugger.
/* backtracking from exit */
/* we get here when we want to redo a goal */
/* redo port */
(
arg(6, Info, true)
->
'$stop_creeping',
'$show_trace'(redo,G,Module,GoalNumber,_), /* inform user_error */
nb_setarg(6, Info, false)
;
true
),
/* make sure we are in system mode when running the debugger. */
/* backtracking from exit */
/* we get here when we want to redo a goal */
/* redo port */
(
arg(6, Info, true)
->
'$stop_creeping',
'$show_trace'(redo,G,Module,GoalNumber,_), /* inform user_error */
nb_setarg(6, Info, false)
;
true
),
'$continue_debugging'(fail, CalledFromDebugger),
fail /* to backtrack to spycalls */
)
fail /* to backtrack to spycall */
)
;
'$stop_creeping',
'$stop_creeping',
'$show_trace'(fail,G,Module,GoalNumber,_), /* inform at fail port */
'$continue_debugging'(fail, CalledFromDebugger),
'$continue_debugging'(fail, CalledFromDebugger),
/* fail port */
fail
).
).
'$enter_goal'(GoalNumber, G, Module) :-
'$zip'(GoalNumber, G, Module), !.
@ -512,7 +517,7 @@ be lost.
),
'$execute_nonstop'(G1,M).
'$spycall'(G, M, _, _) :-
(
(
'$system_predicate'(G,M)
;
'$system_module'(M)
@ -572,6 +577,7 @@ be lost.
(CP1 == CP2 -> ! ; ( true ; '$creep', fail ) ),
'$stop_creeping'
;
'$stop_creeping',
fail
).
'$creep'(G,M) :-

View File

@ -143,7 +143,7 @@ Execute a new shell.
unix(V) :- var(V), !,
'$do_error'(instantiation_error,unix(V)).
unix(argv(L)) :-
prolog_flag(argv, L).
current_prolog_flag(argv, L).
unix(cd) :- cd('~').
unix(cd(A)) :- cd(A).
unix(environ(X,Y)) :- '$do_environ'(X,Y).

View File

@ -655,25 +655,49 @@ is the atom _A_.
*/
system_predicate(A,T1) :-
'$yap_strip_module'( T1, M, T),
'$system_predicate3'( A, M, T).
'$system_predicate3'( A, M, T) :-
(
M \= prolog,
'$current_predicate'(A, M, T0, system)
'$current_predicate'(A, M, T, system)
;
'$imported_predicate'(T, M, SourceT, SourceMod),
M \= prolog,
functor(T, A, _),
'$system_predicate'(SourceT, SourceMod)
;
'$current_predicate'(A, prolog, T0, system)
'$current_predicate'(A, prolog, T, system)
).
/** @pred system_predicate( ?_P_ )
Defines the relation: _P_ is a currently defined system predicate.
Defines the relation: indicator _P_ refers to a currently defined system predicate.
*/
system_predicate(P0) :-
strip_module(P0, M, P),
system_predicate(_, M:P).
(
var(P)
->
P = A/Arity,
'$system_predicate3'( A, M, T),
functor(T, A, Arity)
;
P = A//Arity2
->
'$system_predicate3'( A, M, T),
functor(T, A, Arity),
Arity2 is Arity+2
;
P = A/Arity
->
'$system_predicate3'( A, M, T),
functor(T, A, Arity)
;
'$do_error'(type_error(predicate_indicator,P),
system_predicate(P0))
).
/**