fix warning messages.

This commit is contained in:
Vitor Santos Costa 2011-07-04 22:36:34 +01:00
parent 89e23bff65
commit 9727f3c71c
4 changed files with 12 additions and 9 deletions

View File

@ -58,8 +58,8 @@ init_bp_solver(_, AllVars, _, (BayesNet, DistIds)) :-
sort(DistIds0, DistIds), sort(DistIds0, DistIds),
%(num_bayes_nets(0) -> writeln(vars:VarsInfo) ; true), %(num_bayes_nets(0) -> writeln(vars:VarsInfo) ; true),
%(num_bayes_nets(0) -> writeln(dists:DistsInfo) ; true), %(num_bayes_nets(0) -> writeln(dists:DistsInfo) ; true),
create_network(VarsInfo, BayesNet). create_network(VarsInfo, BayesNet),
%get_extra_vars_info(AllVars, ExtraVarsInfo), get_extra_vars_info(AllVars, ExtraVarsInfo).
%set_extra_vars_info(BayesNet, ExtraVarsInfo). %set_extra_vars_info(BayesNet, ExtraVarsInfo).
@ -99,10 +99,15 @@ get_evidence(_V, -1). % no evidence !!!
get_extra_vars_info([], []). get_extra_vars_info([], []).
get_extra_vars_info([V|Vs], [v(VarId, Label, Domain)|VarsInfo]) :- get_extra_vars_info([V|Vs], [v(VarId, Label, Domain)|VarsInfo]) :-
get_atts(V, [id(VarId)]), !, get_atts(V, [id(VarId)]), !,
writeln(k:V),
clpbn:get_atts(V, [key(Key),dist(DistId, _)]), clpbn:get_atts(V, [key(Key),dist(DistId, _)]),
writeln(j:Key),
term_to_atom(Key, Label), term_to_atom(Key, Label),
writeln(i:Label),
get_dist_domain(DistId, Domain0), get_dist_domain(DistId, Domain0),
writeln(a:Domain0),
numbers2atoms(Domain0, Domain), numbers2atoms(Domain0, Domain),
writeln(b:Domain),
get_extra_vars_info(Vs, VarsInfo). get_extra_vars_info(Vs, VarsInfo).
get_extra_vars_info([_|Vs], VarsInfo) :- get_extra_vars_info([_|Vs], VarsInfo) :-
get_extra_vars_info(Vs, VarsInfo). get_extra_vars_info(Vs, VarsInfo).

View File

@ -43,8 +43,7 @@ build_edges([P|Parents], V, [P-V|Edges]) :-
influences(Vs, G, RG, Vars) :- influences(Vs, G, RG, Vars) :-
rb_new(Visited0), rb_new(Visited0),
influences(Vs, G, RG, Visited0, Visited), influences(Vs, G, RG, Visited0, Visited),
all_top(Visited, Vars), all_top(Visited, Vars).
length(Vars,Leng), writeln(done:Leng).
influences([], _, _, Visited, Visited). influences([], _, _, Visited, Visited).
influences([V|LV], G, RG, Vs, NVs) :- influences([V|LV], G, RG, Vs, NVs) :-

View File

@ -97,8 +97,8 @@ run_ve_solver(LVs, LPs, LNVs) :-
findall(Ps, solve_ve(LVs, LNVs, Ps), LPs). findall(Ps, solve_ve(LVs, LNVs, Ps), LPs).
solve_ve([LVs|_], [NVs0|_], Ps) :- solve_ve([LVs|_], [NVs0|_], Ps) :-
% length(NVs0, L), (L > 415 -> clpbn_gviz:clpbn2gviz(user_error,sort,NVs0,LVs) ; true ), % length(NVs0, L), (L > 10 -> clpbn_gviz:clpbn2gviz(user_error,sort,NVs0,LVs) ; true ),
% length(NVs0, L), writeln(+LVs:L), % length(NVs0, L), writeln(+L),
find_all_clpbn_vars(NVs0, NVs0, LV0, LVi, Tables0), find_all_clpbn_vars(NVs0, NVs0, LV0, LVi, Tables0),
sort(LV0, LV), sort(LV0, LV),
% construct the graph % construct the graph

View File

@ -124,13 +124,12 @@ correct_tab(p(Vs,_,Ps),K,p(Vs,TDist,Ps)) :-
store_cl(Cl) :- store_cl(Cl) :-
recordz(best_theory, Cl, _). recordz(best_theory, Cl, _).
:- user:set(best_clause_hook, clpbn_aleph:add_new_clause). :- user:set(best_clause_hook, clpbn_aleph:add_new_clause).
add_new_clause(_,(_ :- true),_,_) :- !. add_new_clause(_,(_ :- true),_,_) :- !.
add_new_clause(_,(H :- B),_,_) :- add_new_clause(_,(H :- B),_,_) :-
user:db_usage, % user:db_usage,
user:db_dynamic, % user:db_dynamic,
domain(H, K, V, D), domain(H, K, V, D),
rewrite_body(B, IB, Vs, _, ( !, { V = K with p(D, CPTList, Vs) })), rewrite_body(B, IB, Vs, _, ( !, { V = K with p(D, CPTList, Vs) })),
% need to remember which CPT we want % need to remember which CPT we want