Did you know ... Search Documentation:
Pack cplint -- prolog/pita.pl
PublicShow source

This module performs reasoning over Logic Programs with Annotated Disjunctions and CP-Logic programs. It reads probabilistic program and computes the probability of queries.

See https://friguzzi.github.io/cplint/ for details.

Reexports cplint_util and bddem

author
- Fabrizio Riguzzi
license
- Artistic License 2.0 https://opensource.org/licenses/Artistic-2.0
 load(++File:atom) is det
Loads File.lpad if it exists, otherwise loads File.cpl if it exists.
 load_file(++FileWithExtension:atom) is det
Loads FileWithExtension.
 dt_solve(-Strategy:list, -Cost:float) is det
The predicate computes the best solution for the decision theory problem. It returns the best strategy in Strategy and it cost in Cost. Complete solution without pruning.
 prob_meta(:Query:conjunction_of_literals, -Probability:float) is nondet
To be used in place of prob/2 for meta calls (doesn't abolish tables)
 abd_prob(:Query:conjunction_of_literals, -Probability:float, -Delta:list) is nondet
The predicate computes the most probable abductive explanation of the ground query Query. It returns the explanation in Delta together with its Probability
 bdd_dot_file(:Query:atom, +FileName:string, -LV:list) is det
The predicate builds the BDD for Query and writes its dot representation to file FileName and a list in LV with the association of variables to rules. LV is a list of list, each sublist has three elements: the multivalued variable number, the rule number and the grounding substitution.
 bdd_dot_string(:Query:atom, -DotString:string, -LV:list) is det
The predicate builds the BDD for Query and returns its dot representation in DotString and a list in LV with the association of variables to rules. LV is a list of list, each sublist has three elements: the multivalued variable number, the rule number and the grounding substitution.
 abd_bdd_dot_string(:Query:atom, -DotString:string, -LV:list, -LAV:list) is det
The predicate builds the BDD for the abductive explanations for Query and returns its dot representation in DotString and lists LV and LAV, the association of variables to rules and to abductive variables to rules respectively. LV and LAV are lists of list, each sublist has three elements: the multivalued variable number, the rule number and the grounding substitution.
 abd_bdd_dot_string(:Query:atom, -DotString:string, -LV:list, -LAV:list, -Probability:float, -Delta:list) is det
The predicate builds the BDD for the abductive explanations for Query It returns the explanation in Delta together with its Probability. The predicate builds the BDD for Query and returns its dot representation in DotString and lists LV and LAV, the association of variables to rules and to abductive variables to rules respectively. LV and LAV are lists of list, each sublist has three elements: the multivalued variable number, the rule number and the grounding substitution.
 map(:Query:atom, -Probability:float, -Delta:list) is nondet
The predicate computes the explanation of the ground query Query with Maximum A Posteriori (MAP) probability. It returns the explanation in Delta together with its Probability
 map_bdd_dot_string(:Query:atom, -DotString:string, -LV:list, -LAV:list, -Probability:float, -Delta:list) is nondet
The predicate computes the explanation of the ground query Query with Maximum A Posteriori (MAP) probability. It returns the explanation in Delta together with its Probability The predicate builds the BDD for Query and returns its dot representation in DotString and lists LV and LAV, the association of variables to rules and of query variables to rules respectively. LV and LAV are lists of list, each sublist has three elements: the multivalued variable number, the rule number and the grounding substitution.
 prob(:Query:atom, -Probability:float) is nondet
The predicate computes the probability of Query If Query is not ground, it returns in backtracking all ground instantiations of Query together with their probabilities
 prob(:Query:conjunction_of_literals, :Evidence:conjunction_of_literals, -Probability:float) is nondet
Equivalent to prob/4 with an empty option list.
 prob_meta(:Query:conjunction_of_literals, :Evidence:conjunction_of_literals, -Probability:float) is nondet
To be used in place of prob/3 for meta calls (doesn't abolish tables)
 get_var_n(++M:atomic, ++Environment:int, ++Rule:int, ++Substitution:term, ++Probabilities:list, -Variable:int) is det
Returns the index Variable of the random variable associated to rule with index Rule, grounding substitution Substitution and head distribution Probabilities in environment Environment.
 get_dec_var_n(++M:atomic, ++Environment:int, ++Rule:int, ++Substitution:term, -Variable:int) is det
Returns the index Variable of the random variable associated to rule with index Rule in environment Environment.
 get_abd_var_n(++M:atomic, ++Environment:int, ++Rule:int, ++Substitution:term, ++Probabilities:list, -Variable:int) is det
Returns the index Variable of the random variable associated to rule with index Rule, grounding substitution Substitution and head distribution Probabilities in environment Environment.
 msw(:Var:term, ?Value:term, ++Environment:int, --BDD:int) is det
Returns a BDD representing Var=Value. This is a predicate for programs in the PRISM syntax
 msw(:Var:term, ?Value:term, ++Environment:int, --BDD:int, ?DB:int) is det
Returns a BDD representing Var=Value when there is a depth bound on derivations. This is a predicate for programs in the PRISM syntax
 set_pita(:Parameter:atom, +Value:term) is det
The predicate sets the value of a parameter For a list of parameters see https://friguzzi.github.io/cplint/
 setting_pita(:Parameter:atom, ?Value:term) is det
The predicate returns the value of a parameter For a list of parameters see https://friguzzi.github.io/cplint/

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 bar(Arg1, Arg2)
 bar(Arg1, Arg2, Arg3)
 bar1(Arg1, Arg2)
 argbar(Arg1, Arg2)
 histogram(Arg1, Arg2)
 histogram(Arg1, Arg2, Arg3)
 densities(Arg1, Arg2, Arg3)
 densities(Arg1, Arg2, Arg3, Arg4)
 density(Arg1, Arg2)
 density(Arg1, Arg2, Arg3)
 density2d(Arg1, Arg2)
 density2d(Arg1, Arg2, Arg3)
 to_pair(Arg1, Arg2)
 key_pair(Arg1, Arg2)
 value_pair(Arg1, Arg2)
 bin(Arg1, Arg2, Arg3, Arg4, Arg5)
 beta(Arg1, Arg2)
 to_atom(Arg1, Arg2)
 average(Arg1, Arg2)
 variance(Arg1, Arg2)
 variance(Arg1, Arg2, Arg3)
 std_dev(Arg1, Arg2)
 std_dev(Arg1, Arg2, Arg3)
 agg_val(Arg1, Arg2, Arg3)
 swi_builtin(Arg1)
 init_em(Arg1)
 init_ex(Arg1, Arg2)
 init(Arg1)
 end_em(Arg1)
 end_ex(Arg1)
 end(Arg1)
 one(Arg1, Arg2)
 zero(Arg1, Arg2)
 and(Arg1, Arg2, Arg3, Arg4)
 or(Arg1, Arg2, Arg3, Arg4)
 bdd_not(Arg1, Arg2, Arg3)
 ret_prob(Arg1, Arg2, Arg3)
 equality(Arg1, Arg2, Arg3, Arg4)
 add_var(Arg1, Arg2, Arg3, Arg4)
 add_abd_var(Arg1, Arg2, Arg3, Arg4)
 ret_abd_prob(Arg1, Arg2, Arg3, Arg4)
 add_query_var(Arg1, Arg2, Arg3, Arg4)
 ret_map_prob(Arg1, Arg2, Arg3, Arg4)
 onec(Arg1, Arg2)
 zeroc(Arg1, Arg2)
 andc(Arg1, Arg2, Arg3, Arg4)
 andcnf(Arg1, Arg2, Arg3, Arg4)
 bdd_notc(Arg1, Arg2, Arg3)
 orc(Arg1, Arg2, Arg3)
 ret_probc(Arg1, Arg2, Arg3)
 equalityc(Arg1, Arg2, Arg3, Arg4)
 or_list(Arg1, Arg2, Arg3)
 or_listc(Arg1, Arg2, Arg3)
 make_query_var(Arg1, Arg2, Arg3)
 create_dot(Arg1, Arg2, Arg3)
 create_dot_string(Arg1, Arg2, Arg3)
 em(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9)
 rand_seed(Arg1)
 gamma_sample(Arg1, Arg2, Arg3)
 gauss_sample(Arg1, Arg2, Arg3)
 uniform_sample(Arg1)
 dirichlet_sample(Arg1, Arg2)
 symmetric_dirichlet_sample(Arg1, Arg2, Arg3)
 discrete_sample(Arg1, Arg2)
 initial_values(Arg1, Arg2)
 add_decision_var(Arg1, Arg2, Arg3)
 probability_dd(Arg1, Arg2, Arg3)
 add_prod(Arg1, Arg2, Arg3, Arg4)
 add_sum(Arg1, Arg2, Arg3, Arg4)
 ret_strategy(Arg1, Arg2, Arg3, Arg4)
 debug_cudd_var(Arg1, Arg2)