From Jose Santos: rb_map is a meta_predicate!

This commit is contained in:
Vitor Santos Costa 2009-02-10 22:53:40 +00:00
parent 8dbda5580d
commit 3439cc8787

View File

@ -773,6 +773,9 @@ visit(black(L,K,V,R),L0,Lf) :-
visit(L,[K-V|L1],Lf),
visit(R,L0,L1).
:- meta_predicate rb_map(?,:,?). % this is not strictly required
:- meta_predicate map(?,:,?,?). % this is required.
%% rb_map(+T, :Goal) is semidet.
%
% True if call(Goal, Value) is true for all nodes in T.
@ -791,6 +794,9 @@ map(black(L,K,V,R),Goal,black(NL,K,NV,NR),Nil) :-
map(L,Goal,NL,Nil),
map(R,Goal,NR,Nil).
:- meta_predicate rb_map(?,:). % this is not strictly required
:- meta_predicate map(?,:). % this is required.
%% rb_map(+T, :G, -TN) is semidet.
%
% For all nodes Key in the tree T, if the value associated with