Merge branch 'master' of https://github.com/tacgomes/yap6.3
Conflicts: packages/CLPBN/clpbn/horus.yap
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
:- module(clpbn, [{}/1,
|
||||
clpbn_flag/2,
|
||||
set_clpbn_flag/2,
|
||||
@@ -39,24 +38,22 @@
|
||||
run_ve_solver/3
|
||||
]).
|
||||
|
||||
:- use_module('clpbn/bp',
|
||||
[bp/3,
|
||||
check_if_bp_done/1,
|
||||
init_bp_solver/4,
|
||||
run_bp_solver/3,
|
||||
call_bp_ground/6,
|
||||
finalize_bp_solver/1
|
||||
:- use_module('clpbn/horus_ground',
|
||||
[call_horus_ground_solver/6,
|
||||
check_if_horus_ground_solver_done/1,
|
||||
init_horus_ground_solver/4,
|
||||
run_horus_ground_solver/3,
|
||||
finalize_horus_ground_solver/1
|
||||
]).
|
||||
|
||||
:- use_module('clpbn/fove',
|
||||
[fove/3,
|
||||
check_if_fove_done/1,
|
||||
init_fove_solver/4,
|
||||
run_fove_solver/3,
|
||||
finalize_fove_solver/1
|
||||
:- use_module('clpbn/horus_lifted',
|
||||
[call_horus_lifted_solver/3,
|
||||
check_if_horus_lifted_solver_done/1,
|
||||
init_horus_lifted_solver/4,
|
||||
run_horus_lifted_solver/3,
|
||||
finalize_horus_lifted_solver/1
|
||||
]).
|
||||
|
||||
|
||||
:- use_module('clpbn/jt',
|
||||
[jt/3,
|
||||
init_jt_solver/4,
|
||||
@@ -306,18 +303,19 @@ write_out(jt, GVars, AVars, DiffVars) :-
|
||||
jt(GVars, AVars, DiffVars).
|
||||
write_out(bdd, GVars, AVars, DiffVars) :-
|
||||
bdd(GVars, AVars, DiffVars).
|
||||
write_out(bp, GVars, AVars, DiffVars) :-
|
||||
bp(GVars, AVars, DiffVars).
|
||||
write_out(bp, _GVars, _AVars, _DiffVars) :-
|
||||
writeln('interface not supported anymore').
|
||||
%bp(GVars, AVars, DiffVars).
|
||||
write_out(gibbs, GVars, AVars, DiffVars) :-
|
||||
gibbs(GVars, AVars, DiffVars).
|
||||
write_out(bnt, GVars, AVars, DiffVars) :-
|
||||
do_bnt(GVars, AVars, DiffVars).
|
||||
write_out(fove, GVars, AVars, DiffVars) :-
|
||||
fove(GVars, AVars, DiffVars).
|
||||
call_horus_lifted_solver(GVars, AVars, DiffVars).
|
||||
|
||||
% call a solver with keys, not actual variables
|
||||
call_ground_solver(bp, GVars, GoalKeys, Keys, Factors, Evidence, Answ) :-
|
||||
call_bp_ground(GVars, GoalKeys, Keys, Factors, Evidence, Answ).
|
||||
call_horus_ground_solver(GVars, GoalKeys, Keys, Factors, Evidence, Answ).
|
||||
|
||||
|
||||
get_bnode(Var, Goal) :-
|
||||
@@ -400,7 +398,7 @@ bind_clpbn(_, Var, _, _, _, _, []) :-
|
||||
check_if_ve_done(Var), !.
|
||||
bind_clpbn(_, Var, _, _, _, _, []) :-
|
||||
use(bp),
|
||||
check_if_bp_done(Var), !.
|
||||
check_if_horus_ground_solver_done(Var), !.
|
||||
bind_clpbn(_, Var, _, _, _, _, []) :-
|
||||
use(jt),
|
||||
check_if_ve_done(Var), !.
|
||||
@@ -475,7 +473,7 @@ clpbn_init_solver(gibbs, LVs, Vs0, VarsWithUnboundKeys, State) :-
|
||||
clpbn_init_solver(ve, LVs, Vs0, VarsWithUnboundKeys, State) :-
|
||||
init_ve_solver(LVs, Vs0, VarsWithUnboundKeys, State).
|
||||
clpbn_init_solver(bp, LVs, Vs0, VarsWithUnboundKeys, State) :-
|
||||
init_bp_solver(LVs, Vs0, VarsWithUnboundKeys, State).
|
||||
init_horus_ground_solver(LVs, Vs0, VarsWithUnboundKeys, State).
|
||||
clpbn_init_solver(jt, LVs, Vs0, VarsWithUnboundKeys, State) :-
|
||||
init_jt_solver(LVs, Vs0, VarsWithUnboundKeys, State).
|
||||
clpbn_init_solver(bdd, LVs, Vs0, VarsWithUnboundKeys, State) :-
|
||||
@@ -501,7 +499,7 @@ clpbn_run_solver(ve, LVs, LPs, State) :-
|
||||
run_ve_solver(LVs, LPs, State).
|
||||
|
||||
clpbn_run_solver(bp, LVs, LPs, State) :-
|
||||
run_bp_solver(LVs, LPs, State).
|
||||
run_horus_ground_solver(LVs, LPs, State).
|
||||
|
||||
clpbn_run_solver(jt, LVs, LPs, State) :-
|
||||
run_jt_solver(LVs, LPs, State).
|
||||
@@ -522,7 +520,7 @@ clpbn_finalize_solver(State) :-
|
||||
solver(bp), !,
|
||||
functor(State, _, Last),
|
||||
arg(Last, State, Info),
|
||||
finalize_bp_solver(Info).
|
||||
finalize_horus_ground_solver(Info).
|
||||
clpbn_finalize_solver(_State).
|
||||
|
||||
probability(Goal, Prob) :-
|
||||
|
Reference in New Issue
Block a user