From fdeca2852ad59b2f8d1ad706dc847fba5e9ab1c9 Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Thu, 10 Jan 2013 22:10:22 +0000 Subject: [PATCH] Use only one interface for options. set_pfl_flag/2 now can be called for setting options for solvers written in Prolog and for solvers in Horus. --- packages/CLPBN/clpbn.yap | 6 ++++++ packages/CLPBN/pfl.tex | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/CLPBN/clpbn.yap b/packages/CLPBN/clpbn.yap index 6ade48da4..c5b74709e 100644 --- a/packages/CLPBN/clpbn.yap +++ b/packages/CLPBN/clpbn.yap @@ -69,6 +69,9 @@ run_pcg_solver/3 ]). +:- use_module('clpbn/horus', + [set_horus_flag/2]). + :- use_module('clpbn/horus_ground', [call_horus_ground_solver/6, check_if_horus_ground_solver_done/1, @@ -201,6 +204,9 @@ clpbn_flag(output,Before,After) :- retract(output(Before)), assert(output(After)). +clpbn_flag(HorusKey,_Before,After) :- + set_horus_flag(HorusKey,After). + set_solver(Solver) :- set_clpbn_flag(solver,Solver). diff --git a/packages/CLPBN/pfl.tex b/packages/CLPBN/pfl.tex index b0e102990..0e3463d9d 100644 --- a/packages/CLPBN/pfl.tex +++ b/packages/CLPBN/pfl.tex @@ -292,11 +292,11 @@ For instance, if we want to use belief propagation to solve some probabilistic q \texttt{?- set\_solver(bp).} -It is possible to tweak some parameters of PFL through \texttt{set\_horus\_flag/2} predicate. The first argument is a key that identifies the parameter that we want to tweak. The second argument is some possible value for this key. +It is possible to tweak some parameters of PFL through \texttt{set\_pfl\_flag/2} predicate. The first argument is a key that identifies the parameter that we want to tweak. The second argument is some possible value for this key. The \texttt{verbosity} key controls the level of debugging information that will be printed. Its possible values are positive integers. The higher the number, the more information that will be shown. For instance, we can view some basic debugging information by calling the following goal. -\texttt{?- set\_horus\_flag(verbosity, 1).} +\texttt{?- set\_pfl\_flag(verbosity, 1).} This key defaults to 0 (no debugging) and only \texttt{hve}, \texttt{bp}, \texttt{cbp}, \texttt{lve}, \texttt{lkc} and \texttt{lbp} solvers have support for this key. @@ -382,7 +382,7 @@ By default, all probability tasks are resolved using the \texttt{hve} solver. It Notice that only the \texttt{hve}, \texttt{bp} and \texttt{cbp} solvers can be used with \texttt{hcli}. -The options that are available with the \texttt{set\_horus\_flag/2} predicate can be used in \texttt{hcli} too. The syntax is a pair \texttt{=} before the model's file name. +The options that are available with the \texttt{set\_pfl\_flag/2} predicate can be used in \texttt{hcli} too. The syntax is a pair \texttt{=} before the model's file name.