From 9727f3c71c5934df9d74be3079ffeca18c5fbe88 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 4 Jul 2011 22:36:34 +0100 Subject: [PATCH] fix warning messages. --- packages/CLPBN/clpbn/bp.yap | 9 +++++++-- packages/CLPBN/clpbn/connected.yap | 3 +-- packages/CLPBN/clpbn/ve.yap | 4 ++-- packages/CLPBN/learning/aleph_params.yap | 5 ++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/CLPBN/clpbn/bp.yap b/packages/CLPBN/clpbn/bp.yap index 417958298..5ff389ef1 100644 --- a/packages/CLPBN/clpbn/bp.yap +++ b/packages/CLPBN/clpbn/bp.yap @@ -58,8 +58,8 @@ init_bp_solver(_, AllVars, _, (BayesNet, DistIds)) :- sort(DistIds0, DistIds), %(num_bayes_nets(0) -> writeln(vars:VarsInfo) ; true), %(num_bayes_nets(0) -> writeln(dists:DistsInfo) ; true), - create_network(VarsInfo, BayesNet). - %get_extra_vars_info(AllVars, ExtraVarsInfo), + create_network(VarsInfo, BayesNet), + get_extra_vars_info(AllVars, 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([V|Vs], [v(VarId, Label, Domain)|VarsInfo]) :- get_atts(V, [id(VarId)]), !, +writeln(k:V), clpbn:get_atts(V, [key(Key),dist(DistId, _)]), +writeln(j:Key), term_to_atom(Key, Label), +writeln(i:Label), get_dist_domain(DistId, Domain0), +writeln(a:Domain0), numbers2atoms(Domain0, Domain), +writeln(b:Domain), get_extra_vars_info(Vs, VarsInfo). get_extra_vars_info([_|Vs], VarsInfo) :- get_extra_vars_info(Vs, VarsInfo). diff --git a/packages/CLPBN/clpbn/connected.yap b/packages/CLPBN/clpbn/connected.yap index 276184683..967a4f5cc 100644 --- a/packages/CLPBN/clpbn/connected.yap +++ b/packages/CLPBN/clpbn/connected.yap @@ -43,8 +43,7 @@ build_edges([P|Parents], V, [P-V|Edges]) :- influences(Vs, G, RG, Vars) :- rb_new(Visited0), influences(Vs, G, RG, Visited0, Visited), - all_top(Visited, Vars), -length(Vars,Leng), writeln(done:Leng). + all_top(Visited, Vars). influences([], _, _, Visited, Visited). influences([V|LV], G, RG, Vs, NVs) :- diff --git a/packages/CLPBN/clpbn/ve.yap b/packages/CLPBN/clpbn/ve.yap index 41ed2b19f..54ce81bff 100644 --- a/packages/CLPBN/clpbn/ve.yap +++ b/packages/CLPBN/clpbn/ve.yap @@ -97,8 +97,8 @@ run_ve_solver(LVs, LPs, LNVs) :- findall(Ps, solve_ve(LVs, LNVs, Ps), LPs). solve_ve([LVs|_], [NVs0|_], Ps) :- -% length(NVs0, L), (L > 415 -> clpbn_gviz:clpbn2gviz(user_error,sort,NVs0,LVs) ; true ), -% length(NVs0, L), writeln(+LVs:L), +% length(NVs0, L), (L > 10 -> clpbn_gviz:clpbn2gviz(user_error,sort,NVs0,LVs) ; true ), +% length(NVs0, L), writeln(+L), find_all_clpbn_vars(NVs0, NVs0, LV0, LVi, Tables0), sort(LV0, LV), % construct the graph diff --git a/packages/CLPBN/learning/aleph_params.yap b/packages/CLPBN/learning/aleph_params.yap index c27844e22..91f7b39cd 100644 --- a/packages/CLPBN/learning/aleph_params.yap +++ b/packages/CLPBN/learning/aleph_params.yap @@ -123,14 +123,13 @@ correct_tab(p(Vs,_,Ps),K,p(Vs,TDist,Ps)) :- store_cl(Cl) :- recordz(best_theory, Cl, _). - :- user:set(best_clause_hook, clpbn_aleph:add_new_clause). add_new_clause(_,(_ :- true),_,_) :- !. add_new_clause(_,(H :- B),_,_) :- - user:db_usage, - user:db_dynamic, +% user:db_usage, +% user:db_dynamic, domain(H, K, V, D), rewrite_body(B, IB, Vs, _, ( !, { V = K with p(D, CPTList, Vs) })), % need to remember which CPT we want