CLP(BN) stuff.

This commit is contained in:
Vitor Santos Costa
2012-06-01 13:17:39 +01:00
parent 39f392be9c
commit 71a62307f4
7 changed files with 39 additions and 29 deletions

View File

@@ -235,11 +235,7 @@ project_attributes(GVars, _AVars0) :-
use_parfactors(on),
clpbn_flag(solver, Solver), Solver \= fove, !,
generate_network(GVars, GKeys, Keys, Factors, Evidence),
(ground(GVars) ->
true
;
call_ground_solver(Solver, GVars, GKeys, Keys, Factors, Evidence, _Avars0)
).
call_ground_solver(Solver, GVars, GKeys, Keys, Factors, Evidence, _Avars0).
project_attributes(GVars, AVars) :-
suppress_attribute_display(false),
AVars = [_|_],
@@ -259,6 +255,14 @@ project_attributes(GVars, AVars) :-
).
project_attributes(_, _).
match([], _Keys).
match([V|GVars], Keys) :-
clpbn:get_atts(V,[key(GKey)]),
member(GKey, Keys), ground(GKey), !,
match(GVars, Keys).
match([_V|GVars], Keys) :-
match(GVars, Keys).
clpbn_vars(AVars, DiffVars, AllVars) :-
sort_vars_by_key(AVars,SortedAVars,DiffVars),
incorporate_evidence(SortedAVars, AllVars).