Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3
This commit is contained in:
commit
bfc67e5e35
@ -2,7 +2,7 @@
|
|||||||
set (MPI_SOURCES
|
set (MPI_SOURCES
|
||||||
hash.c prologterms2c.c yap_mpi.c)
|
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"
|
macro_log_feature (MPI_C_FOUND "Mpi"
|
||||||
"Use Mpi System"
|
"Use Mpi System"
|
||||||
"http://www.mpi.org" FALSE)
|
"http://www.mpi.org" FALSE)
|
||||||
|
10
pl/debug.yap
10
pl/debug.yap
@ -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) :-
|
||||||
|
@ -143,7 +143,7 @@ Execute a new shell.
|
|||||||
unix(V) :- var(V), !,
|
unix(V) :- var(V), !,
|
||||||
'$do_error'(instantiation_error,unix(V)).
|
'$do_error'(instantiation_error,unix(V)).
|
||||||
unix(argv(L)) :-
|
unix(argv(L)) :-
|
||||||
prolog_flag(argv, L).
|
current_prolog_flag(argv, L).
|
||||||
unix(cd) :- cd('~').
|
unix(cd) :- cd('~').
|
||||||
unix(cd(A)) :- cd(A).
|
unix(cd(A)) :- cd(A).
|
||||||
unix(environ(X,Y)) :- '$do_environ'(X,Y).
|
unix(environ(X,Y)) :- '$do_environ'(X,Y).
|
||||||
|
32
pl/preds.yap
32
pl/preds.yap
@ -655,25 +655,49 @@ is the atom _A_.
|
|||||||
*/
|
*/
|
||||||
system_predicate(A,T1) :-
|
system_predicate(A,T1) :-
|
||||||
'$yap_strip_module'( T1, M, T),
|
'$yap_strip_module'( T1, M, T),
|
||||||
|
'$system_predicate3'( A, M, T).
|
||||||
|
|
||||||
|
'$system_predicate3'( A, M, T) :-
|
||||||
(
|
(
|
||||||
M \= prolog,
|
M \= prolog,
|
||||||
'$current_predicate'(A, M, T0, system)
|
'$current_predicate'(A, M, T, system)
|
||||||
;
|
;
|
||||||
'$imported_predicate'(T, M, SourceT, SourceMod),
|
'$imported_predicate'(T, M, SourceT, SourceMod),
|
||||||
M \= prolog,
|
M \= prolog,
|
||||||
functor(T, A, _),
|
functor(T, A, _),
|
||||||
'$system_predicate'(SourceT, SourceMod)
|
'$system_predicate'(SourceT, SourceMod)
|
||||||
;
|
;
|
||||||
'$current_predicate'(A, prolog, T0, system)
|
'$current_predicate'(A, prolog, T, system)
|
||||||
).
|
).
|
||||||
|
|
||||||
/** @pred system_predicate( ?_P_ )
|
/** @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) :-
|
system_predicate(P0) :-
|
||||||
strip_module(P0, M, P),
|
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))
|
||||||
|
).
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user