diff --git a/CLPBN/clpbn/evidence.yap b/CLPBN/clpbn/evidence.yap index ef9435b05..8ac2f67ba 100644 --- a/CLPBN/clpbn/evidence.yap +++ b/CLPBN/clpbn/evidence.yap @@ -17,9 +17,9 @@ ]). :- use_module(library(rbtrees), [ - new/1, - lookup/3, - insert/4 + rb_new/1, + rb_lookup/3, + rb_insert/4 ]). :- meta_predicate store_evidence(:). @@ -68,7 +68,7 @@ add_links([K0|TVs],K) :- incorporate_evidence(Vs,AllVs) :- - new(Cache0), + rb_new(Cache0), create_open_list(Vs, OL, FL, Cache0, CacheI), do_variables(OL, FL, CacheI), extract_vars(OL, AllVs). @@ -77,7 +77,7 @@ create_open_list([], L, L, C, C). create_open_list([V|Vs], [K-V|OL], FL, C0, CF) :- clpbn:get_atts(V,[key(K)]), add_evidence(K, V), - insert(C0, K, V, CI), + rb_insert(C0, K, V, CI), create_open_list(Vs, OL, FL, CI, CF). do_variables([], [], _) :- !. @@ -94,10 +94,10 @@ create_new_variable(K, V, Vf0, Vff, C0, Cf) :- add_variables([], [], Vf, Vf, C, C). add_variables([K|TVs], [V|NTVs], Vf0, Vff, C0, Cf) :- - lookup(K, V, C0), !, + rb_lookup(K, V, C0), !, add_variables(TVs, NTVs, Vf0, Vff, C0, Cf). add_variables([K|TVs], [V|NTVs], [K-V|Vf0], Vff, C0, Cf) :- - insert(C0, K, V, C1), + rb_insert(C0, K, V, C1), create_new_variable(K, V, Vf0, Vf1, C1, C2), add_variables(TVs, NTVs, Vf1, Vff, C2, Cf). diff --git a/CLPBN/clpbn/gibbs.yap b/CLPBN/clpbn/gibbs.yap index 44800ff8f..a27451ded 100644 --- a/CLPBN/clpbn/gibbs.yap +++ b/CLPBN/clpbn/gibbs.yap @@ -11,9 +11,9 @@ check_if_gibbs_done/1]). :- use_module(library(rbtrees), - [new/1, - insert/4, - lookup/3]). + [rb_new/1, + rb_insert/4, + rb_lookup/3]). :- use_module(library(lists), [member/2, @@ -62,7 +62,7 @@ initialise(LVs, Graph, GVs, OutputVars, VarOrder) :- add_output_vars(GVs, Keys, OutputVars). init_keys(Keys0) :- - new(Keys0). + rb_new(Keys0). gen_keys([], I, I, Keys, Keys). gen_keys([V|Vs], I0, If, Keys0, Keys) :- @@ -70,7 +70,7 @@ gen_keys([V|Vs], I0, If, Keys0, Keys) :- gen_keys(Vs, I0, If, Keys0, Keys). gen_keys([V|Vs], I0, If, Keys0, Keys) :- I is I0+1, - insert(Keys0,V,I,KeysI), + rb_insert(Keys0,V,I,KeysI), gen_keys(Vs, I, If, KeysI, Keys). graph_representation([],_,_,_,[]). @@ -112,7 +112,7 @@ get_sizes([V|Parents], [Sz|Szs]) :- parent_indices([], _, []). parent_indices([V|Parents], Keys, [I|IParents]) :- - lookup(V, I, Keys), + rb_lookup(V, I, Keys), parent_indices(Parents, Keys, IParents). @@ -139,7 +139,7 @@ propagate2parents([V|NewParents], Table, Variables, Graph, Keys) :- propagate2parents(NewParents,Table, Variables, Graph, Keys). add2graph(V, Vals, Table, IParents, Graph, Keys) :- - lookup(V, Index, Keys), + rb_lookup(V, Index, Keys), (var(Vals) -> true ; length(Vals,Sz)), arg(Index, Graph, var(V,Index,_,Vals,Sz,VarSlot,_,_,_)), member(tabular(Table,Index,IParents), VarSlot), !. @@ -156,7 +156,7 @@ split_parents([I-V|Sorted], [V|SortedNVs],[I|SortedIndices]) :- vars2indices([],_,[]). vars2indices([V|Parents],Keys,[I-V|IParents]) :- - lookup(V, I, Keys), + rb_lookup(V, I, Keys), vars2indices(Parents,Keys,IParents). compact_table(NewTable, RepTable) :- @@ -297,7 +297,7 @@ store_mblanket(I,Values,Probs) :- add_output_vars([], _, []). add_output_vars([V|LVs], Keys, [I|OutputVars]) :- - lookup(V, I, Keys), + rb_lookup(V, I, Keys), add_output_vars(LVs, Keys, OutputVars). process(VarOrder, Graph, OutputVars, Estimates) :- diff --git a/CLPBN/clpbn/topsort.yap b/CLPBN/clpbn/topsort.yap index 2cd589072..7525279a4 100644 --- a/CLPBN/clpbn/topsort.yap +++ b/CLPBN/clpbn/topsort.yap @@ -4,9 +4,9 @@ reversed_topsort/2]). :- use_module(library(rbtrees), - [new/1, - lookup/3, - insert/4]). + [rb_new/1, + rb_lookup/3, + rb_insert/4]). :- use_module(library(lists), [reverse/2]). @@ -15,18 +15,18 @@ /* graph is as Node-[Parents] */ topsort(Graph0, Sorted) :- - new(RB), + rb_new(RB), topsort(Graph0, [], RB, Sorted). topsort(Graph0, Sorted0, Sorted) :- - new(RB), + rb_new(RB), topsort(Graph0, Sorted0, RB, Sorted). % % Have children first in the list % reversed_topsort(Graph0, RSorted) :- - new(RB), + rb_new(RB), topsort(Graph0, [], RB, Sorted), reverse(Sorted, RSorted). @@ -42,7 +42,7 @@ add_nodes([N-Ns|Graph0], Found0, SortI, NewGraph, Found, NSort) :- ( NNs == [] -> NewGraph = IGraph, NSort = [N|Sort], - insert(Found0, N, '$', FoundI) + rb_insert(Found0, N, '$', FoundI) ; NewGraph = [N-NNs|IGraph], NSort = Sort, @@ -52,7 +52,7 @@ add_nodes([N-Ns|Graph0], Found0, SortI, NewGraph, Found, NSort) :- delete_nodes([], _, []). delete_nodes([N|Ns], Found, NNs) :- - lookup(N,'$',Found), !, + rb_lookup(N,'$',Found), !, delete_nodes(Ns, Found, NNs). delete_nodes([N|Ns], Found, [N|NNs]) :- delete_nodes(Ns, Found, NNs). diff --git a/changes-5.1.html b/changes-5.1.html index f00302016..1cfb74b0f 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -15,8 +15,18 @@

Changes in YAP-5.1

Yap-5.1.0:

-