All predicatesShow sourcebddem.pl

Re-exported predicates

The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.

Source init_em(--Context:int) is det
Initializes a data structure for performing parameter learning. It returns an integer in Context that is a pointer to a context data structure for performing the EM algorithm.
Source end_em(++Context:int) is det
Terminates the context data structure for performing parameter learning. Context is a pointer to a context data structure for performing the EM algorithm. Context must have been returned by a call to init_em/1. It frees the memory occupied by Context.
Source init_ex(++Context:int, --Environment:int) is det
Initializes an enviroment data structure for storing a BDD. Context is an integer that is a pointer to a context data structure created using init_em/1. Returns an integer Environment that is a pointer to a data structure for storing a single BDD to be used for the EM algorithm.
Source end_ex(++Environment:int) is det
Terminates the evnironment data structure for storing a BDD. Environment is a pointer to a data structure returned by init_ex/2. It frees the memory occupied by the BDD.
Source init(--Environment:int) is det
Initializes a data structure for storing a single BDD. Returns an integer Environment that is a pointer to a data structure for storing a single BDD to be used for inference only (no learning).
Source end(++Environment:int) is det
Terminates the environment data structure for storing a single BDD. Environment is a pointer to a data structure returned by a call to init/1.
Source one(++Environment:int, --One:int) is det
Returns in One a pointer to a BDD belonging to environment Environment representing the one Boolean function.
Source zero(++Environment:int, --Zero:int) is det
Returns in Zero a pointer to a BDD belonging to environment Environment representing the zero Boolean function.
Source and(++Environment:int, ++A:int, ++B:int, --AandB:int) is det
Returns in AandB a pointer to a BDD belonging to environment Environment representing the conjunction of BDDs A and B.
Source or(++Environment:int, ++A:int, ++B:int, --AorB:int) is det
Returns in AorB a pointer to a BDD belonging to environment Environment representing the disjunction of BDDs A and B.
Source ret_prob(++Environment:int, ++BDD:int, -Probability:float) is det
Returns the Probability of BDD belonging to environment Environment.
Source ret_map_prob(++Environment:int, ++BDD:int, -Probability:float, -MAPState:list) is det
Returns the MAP state MPAState of BDD and its Probability. BDD belongs to environment Environment.
Source ret_abd_prob(++Environment:int, ++BDD:int, -Probability:float, -Explanation:list) is det
Returns the abductive Explanation of BDD and its Probability. BDD belongs to environment Environment.
Source bdd_not(++Environment:int, ++A:int, --NotA:int) is det
Returns in NotA a pointer to a BDD belonging to environment Environment representing the negation of BDD A.
Source equality(++Environment:int, ++Variable:int, ++Value:int, --BDD:int) is det
Returns in BDD the BDD belonging to environment Environment that represents the equation Variable=Value.
Source em(++Context:int, ++RuleInfo:list, ++ListOfBDDs:list, ++EA:float, ++ER:float, ++Iterations:int, -LL:float, -Parameters:list, -ExampleProbabilities:list) is det
NumberOfHeads is a list of terms, one for each rule. Each term is either an integer, indicating the number of head atoms in the rule, or a list [N] where N is the number of head atoms. In the first case, the parameters of the rule are tunable, in the latter they are fixed.

Performs EM learning. Takes as input the Context, information on the rules, a list of BDDs each representing one example, the minimum absolute difference EA and relative difference ER between the log likelihood of examples in two different iterations and the maximum number of iterations Iterations. RuleInfo is a list of elements, one for each rule, with are either

Source add_var(++Environment:int, ++ProbabilityDistribution:list, ++Rule:int, -Variable:int) is det
Returns in Variable the index of a new random variable in Environment with NumberOHeads values and probability distribution ProbabilityDistribution.
Source add_abd_var(++Environment:int, ++ProbabilityDistribution:list, ++Rule:int, -Variable:int) is det
Returns in Variable the index of a new abducible random variable in Environment with NumberOHeads values and probability distribution ProbabilityDistribution.
Source add_query_var(++Environment:int, ++ProbabilityDistribution:list, ++Rule:int, -Variable:int) is det
Returns in Variable the index of a new random variable to be queried in MAP inference with NumberOHeads values and probability distribution ProbabilityDistribution. The variable belongs to Environment.
Source make_query_var(++Environment:int, +Variable:int, --BDD:int) is det
Makes Variable belonging to Environment a query random variable for MAP inference. Returns in BDD the diagram of the formula encoding the required constraints among the Boolean random variable that represent Variable.
Source create_dot_string(++Env:int, ++BDD:int, -Dot:string) is det
The predicate returns the BDD in dot format.
Source create_dot(++Env:int, ++BDD:int, ++File:string) is det
The predicate writes the BDD in dot format to to file FileName.
Source rand_seed(+Seed:int) is det
The pseudo-random number generator is initialized using the argument passed as Seed. It calls the C function srand.
Source orc(++A:couple, ++B:couple, --AorB:couple) is det
A and B are couples (Environment, BDDA) and (Environment, BDDB) respectively Returns in AorB a couple (Environment, BDDAorB) where BDDAorB is pointer to a BDD belonging to environment Environment representing the disjunction of BDDs BDDA and BDDB.
Source onec(++Environment:int, --One:couple) is det
Returns in One a couple (Environment,BDD) where BDD is pointer to a BDD belonging to environment Environment representing the one Boolean function
Source zeroc(++Environment:int, --Zero:couple) is det
Returns in Zero a couple (Environment,BDD) where BDD is pointer to a BDD belonging to environment Environment representing the zero Boolean function
Source andc(++Environment:int, ++A:couple, ++B:couple, --AandB:couple) is semidet
A and B are couples (Environment, BDDA) and (Environment, BDDB) respectively Returns in AandB a couple (Environment, BDDAandB) where BDDAandB is pointer to a BDD belonging to environment Environment representing the conjunction of BDDs BDDA and BDDB. fails if BDDB represents the zero function
Source andcnf(++Environment:int, ++A:couple, ++B:couple, --AandB:couple) is semidet
A and B are couples (Environment, BDDA) and (Environment, BDDB) respectively Returns in AandB a couple (Environment, BDDAandB) where BDDAandB is pointer to a BDD belonging to environment Environment representing the conjunction of BDDs BDDA and BDDB.
Source bdd_notc(++Environment:int, ++EBDD:couple, --NotEBDD:couple) is det
EBDD is a couple (Environment,A) Returns in NotEBDD a couple (Environment,NotA) where NotA is pointer to a BDD belonging to environment Environment representing the negation of BDD A
Source equalityc(++Environment:int, ++Variable:int, ++Value:int, --EBDD:couple) is det
Returns in EBDD a couple (Environment,BDD) where BDD belongs to environment Environment and represents the equation Variable=Value.
Source ret_probc(++Environment:int, ++EBDD:couple, -Probability:float) is det
EBDD is a couple (Environment,BDD) Returns the Probability of BDD belonging to environment Environment Uses
Source initial_values(++Environment:int, ++Alpha:float) is det
Sets the type of parameter initialization for EM on Environment: if Alpha is 0.0, it uses a truncated Dirichlet process if Alpha is a float > 0.0, it uses a symmetric Dirichlet distribution with that value as parameter
Source or_list(++ListOfBDDs:list, ++Environment, --BDD:int) is det
Returns in BDD a pointer to a BDD belonging to environment Environment representing the disjunction of all the BDDs in ListOfBDDs
Source or_listc(++ListOfBDDs:list, ++Environment, --BDD:int) is det
Returns in BDD a couple (Env,B) with B a pointer to a BDD belonging to environment Environment representing the disjunction of all the BDDs in ListOfBDDs (a list of couples (Env,BDD))
Source gamma_sample(++Shape:float, ++Scale:float, --Value:float) is det
Returns a Value sampled from a gamma distribution with parameters Shape and Scale
Source gauss_sample(++Mean:float, ++Variance:float, --Value:float) is det
Returns a Value sampled from a Gaussian distribution with parameters Mean and Variance
Source uniform_sample(--Value:float) is det
Returns a Value sampled from a uniform distribution in [0,1]
Source dirichlet_sample(++Alpha:list, --Value:list) is det
Returns a Value sampled from a Dirichlet distribution with parameters Alpha. Alpha and Value are lists of floating point numbers of the same length.
Source symmetric_dirichlet_sample(++Alpha:float, ++K:int, --Value:list) is det
Returns a Value sampled from a symmetric Dirichlet distribution with parameter Alpha. K is the number of dimensions of the result.
Source discrete_sample(++Theta:list, --Value:int) is det
Returns a Value sampled from a discrete distribution with parameters Theta. Theta is a list of floating point numbers in [0,1] that sum to 1. Value is in 0..(length(Theta)-1)
Source probability_dd(++Environment:int, ++BDD:int, --ADD:int) is det
Converts the BDD belonging to environment Environment into an ADD.
Source add_prod(++Environment:int, ++ADDIn:int, ++Utility:float, --ADDOut:int) is det
Multiplies the ADD belonging to environment Environment with the value Utility and stores the result in ADDOut.
Source add_sum(++Environment:int, ++ADD1:int, ++ADD2:int, --ADDOut:int) is det
Computes the sum of the two ADDs ADD1 ADD2 belonging to environment Environment. The result in saved in ADDOut.
Source ret_strategy(++Environment:int, ++ADD:int, --Decision:list, --Cost:int) is det
Computes the optimal strategy given a pointer to the ADD belonging to environment Environment. Decision is a list of selected facts, Cost is the total cost.
Source debug_cudd_var(++Environment:int, -Variable:out) is det
Prints the debug information which is the result of the call of Cudd_ReadDead, Cudd_CheckZeroRef, Cudd_CheckKeys and Cudd_DebugCheck(env->mgr));

Undocumented predicates

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

Source compute_optimal_strategy_sp(Arg1, Arg2, Arg3, Arg4, Arg5)
Source add_decision_var(Arg1, Arg2, Arg3, Arg4)