mcintyre.pl -- mcintyre

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

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

Reexports cplint_util and clpr.

author
- Fabrizio Riguzzi
license
- Artistic License 2.0 https://opensource.org/licenses/Artistic-2.0
 mc_load(++File:atom) is det
Loads File.lpad if it exists, otherwise loads File.cpl if it exists.
 mc_load_file(++FileWithExtension:atom) is det
Loads FileWithExtension.
 mc_prob(:Query:atom, -Probability:float, +Options:list) is det
The predicate computes the probability of the query Query If Query is not ground, it considers it as an existential query and returns the probability that there is a satisfying assignment to the query.

Options is a list of options, the following are recognised by mc_prob/3:

bar(-BarChart:dict)
BarChart is a dict for rendering with c3 as a bar chart with a bar for the probability of success and a bar for the probability of failure.
 mc_prob(:Query:conjunction_of_literals, -Probability:float) is det
Equivalent to mc_prob/2 with an empty option list.
 mc_sample(:Query:conjunction_of_literals, +Samples:int, -Probability:float, +Options:list) is det
The predicate samples Query a number of Samples times and returns the resulting Probability (Successes/Samples) If Query is not ground, it considers it as an existential query

Options is a list of options, the following are recognised by mc_sample/4:

successes(-Successes:int)
Number of successes
failures(-Failures:int)
Number of failures
bar(-BarChart:dict)
BarChart is a dict for rendering with c3 as a bar chart with a bar for the number of successes and a bar for the number of failures.
 mc_sample(:Query:conjunction_of_literals, +Samples:int, -Probability:float) is det
Equivalent to mc_sample/4 with an empty option list.
 mc_rejection_sample(:Query:conjunction_of_literals, :Evidence:conjunction_of_literals, +Samples:int, -Probability:float, +Options:list) is det
The predicate samples Query a number of Samples times given that Evidence is true and returns the Probability of Query. It performs rejection sampling: if in a sample Evidence is false, the sample is discarded. If Query/Evidence are not ground, it considers them an existential queries.

Options is a list of options, the following are recognised by mc_rejection_sample/5:

successes(-Successes:int)
Number of succeses
failures(-Failures:int)
Number of failueres
 mc_rejection_sample(:Query:conjunction_of_literals, :Evidence:conjunction_of_literals, +Samples:int, -Probability:float) is det
Equivalent to mc_rejection_sample/5 with an empty option list.
 mc_gibbs_sample(:Query:conjunction_of_literals, +Samples:int, -Probability:float, +Options:list) is det
The predicate samples Query a number of Mix+Samples (Mix is set with the options, default value 0) times. The first Mix (that is set with the options, default value 0) samples are discarded (mixing time). It performs Gibbs sampling: each sample is obtained from the previous one by resampling a variable given the values of the variables in its Markov blanket. If Query/Evidence are not ground, it considers them as existential queries.

Options is a list of options, the following are recognised by mc_gibbs_sample/4:

block(+Block:int)
Perform blocked Gibbs: Block variables are sampled together, default value 1
mix(+Mix:int)
The first Mix samples are discarded (mixing time), default value 0
successes(-Successes:int)
Number of succeses
failures(-Failures:int)
Number of failueres
 mc_gibbs_sample(:Query:conjunction_of_literals, +Samples:int, -Probability:float) is det
Equivalent to mc_gibbs_sample/4 with an empty option list.
 mc_gibbs_sample(:Query:conjunction_of_literals, :Evidence:conjunction_of_literals, +Samples:int, -Probability:float, +Options:list) is det
The predicate samples Query a number of Mix+Samples (Mix is set with the options, default value 0) times given that Evidence is true and returns the number of Successes, of Failures and the Probability (Successes/Samples). The first Mix (that is set with the options, default value 0) samples are discarded (mixing time). It performs Gibbs sampling: each sample is obtained from the previous one by resampling a variable given the values of the variables in its Markov blanket. If Query/Evidence are not ground, it considers them as existential queries.

Options is a list of options, the following are recognised by mc_gibbs_sample/5:

block(+Block:int)
Perform blocked Gibbs: Block variables are sampled together, default value 1
mix(+Mix:int)
The first Mix samples are discarded (mixing time), default value 0
successes(-Successes:int)
Number of succeses
failures(-Failures:int)
Number of failueres
 mc_gibbs_sample_arg(:Query:conjunction_of_literals, +Samples:int, ?Arg:var, -Values:list, +Options:list) is det
The predicate samples Query a number of Samples times. Arg should be a variable in Query. The predicate returns in Values a list of couples L-N where L is the list of values of Arg for which Query succeeds in a world sampled at random and N is the number of samples returning that list of values. The first Mix (that is set with the options, default value 0) samples are discarded (mixing time). It performs Gibbs sampling: each sample is obtained from the previous one by resampling a variable given the values of the variables in its Markov blanket.

Options is a list of options, the following are recognised by mc_gibbs_sample_arg/5:

block(+Block:int)
Perform blocked Gibbs: Block variables are sampled together, default value 1
mix(+Mix:int)
The first Mix samples are discarded (mixing time), default value 0
bar(-BarChar:dict)
BarChart is a dict for rendering with c3 as a bar chart with a bar for each possible value of L, the list of value of Arg for which Query succeeds in a world sampled at random.
 mc_gibbs_sample_arg(:Query:conjunction_of_literals, +Samples:int, ?Arg:var, -Values:list) is det
Equivalent to mc_gibbs_sample_arg/5 with an empty option list.
 mc_gibbs_sample_arg(:Query:conjunction_of_literals, :Evidence:conjunction_of_groundliterals, +Samples:int, ?Arg:var, -Values:list, +Options:list) is det
The predicate samples Query a number of Samples times given that Evidence is true. Arg should be a variable in Query. The predicate returns in Values a list of couples L-N where L is the list of values of Arg for which Query succeeds in a world sampled at random and N is the number of samples returning that list of values. The first Mix (that is set with the options, default value 0) samples are discarded (mixing time). It performs Gibbs sampling: each sample is obtained from the previous one by resampling a variable given the values of the variables in its Markov blanket.

Options is a list of options, the following are recognised by mc_gibbs_sample_arg/6:

block(+Block:int)
Perform blocked Gibbs: Block variables are sampled together, default value 1
mix(+Mix:int)
The first Mix samples are discarded (mixing time), default value 0
bar(-BarChar:dict)
BarChart is a dict for rendering with c3 as a bar chart with a bar for each possible value of L, the list of value of Arg for which Query succeeds in a world sampled at random.
 mc_mh_sample(:Query:conjunction_of_literals, :Evidence:conjunction_of_literals, +Samples:int, -Probability:float, +Options:list) is det
The predicate samples Query a number of Mix+Samples (Mix is set with the options, default value 0) times given that Evidence is true and returns the number of Successes, of Failures and the Probability (Successes/Samples). The first Mix (that is set with the options, default value 0) samples are discarded (mixing time). It performs Metropolis/Hastings sampling: between each sample, Lag (that is set with the options, default value 1) sampled choices are forgotten and each sample is accepted with a certain probability. If Query/Evidence are not ground, it considers them as existential queries.

Options is a list of options, the following are recognised by mc_mh_sample/5:

mix(+Mix:int)
The first Mix samples are discarded (mixing time), default value 0
lag(+Lag:int)
lag between each sample, Lag sampled choices are forgotten, default value 1
successes(-Successes:int)
Number of succeses
failures(-Failures:int)
Number of failueres
 mc_mh_sample(:Query:conjunction_of_literals, :Evidence:conjunction_of_literals, +Samples:int, -Probability:float) is det
Equivalent to mc_mh_sample/5 with an empty option list.
 mc_sample_arg(:Query:conjunction_of_literals, +Samples:int, ?Arg:var, -Values:list, +Options:list) is det
The predicate samples Query a number of Samples times. Arg should be a variable in Query. The predicate returns in Values a list of couples L-N where L is the list of values of Arg for which Query succeeds in a world sampled at random and N is the number of samples returning that list of values.

Options is a list of options, the following are recognised by mc_sample_arg/5:

bar(-BarChar:dict)
BarChart is a dict for rendering with c3 as a bar chart with a bar for each possible value of L, the list of value of Arg for which Query succeeds in a world sampled at random.
 mc_sample_arg(:Query:conjunction_of_literals, +Samples:int, ?Arg:var, -Values:list) is det
Equivalent to mc_sample_arg/5 with an empty option list.
 mc_rejection_sample_arg(:Query:conjunction_of_literals, :Evidence:conjunction_of_literals, +Samples:int, ?Arg:var, -Values:list, +Options:list) is det
The predicate samples Query a number of Samples times given that Evidence is true. Arg should be a variable in Query. The predicate returns in Values a list of couples L-N where L is the list of values of Arg for which Query succeeds in a world sampled at random and N is the number of samples returning that list of values. Rejection sampling is performed.

Options is a list of options, the following are recognised by mc_rejection_sample_arg/6:

bar(-BarChar:dict)
BarChart is a dict for rendering with c3 as a bar chart with a bar for each possible value of L, the list of value of Arg for which Query succeeds in a world sampled at random.
 mc_rejection_sample_arg(:Query:conjunction_of_literals, :Evidence:conjunction_of_literals, +Samples:int, ?Arg:var, -Values:list) is det
Equivalent to mc_rejection_sample_arg/6 with an empty option list.
 mc_mh_sample_arg(:Query:conjunction_of_literals, :Evidence:conjunction_of_literals, +Samples:int, ?Arg:var, -Values:list, +Options:list) is det
The predicate samples Query a number of Samples times given that Evidence is true. Arg should be a variable in Query. The predicate returns in Values a list of couples L-N where L is the list of values of Arg for which Query succeeds in a world sampled at random and N is the number of samples returning that list of values. The first Mix (that is set with the options, default value 0) samples are discarded (mixing time). It performs Metropolis/Hastings sampling: between each sample, Lag (that is set with the options, default value 1) sampled choices are forgotten and each sample is accepted with a certain probability.

Options is a list of options, the following are recognised by mc_mh_sample_arg/6:

mix(+Mix:int)
The first Mix samples are discarded (mixing time), default value 0
lag(+Lag:int)
lag between each sample, Lag sampled choices are forgotten, default value 1
bar(-BarChar:dict)
BarChart is a dict for rendering with c3 as a bar chart with a bar for each possible value of L, the list of value of Arg for which Query succeeds in a world sampled at random.
 mc_mh_sample_arg(:Query:conjunction_of_literals, :Evidence:conjunction_of_literals, +Samples:int, ?Arg:var, -Values:list) is det
Equivalent to mc_mh_sample_arg/6 with an empty option list.
 mc_particle_sample_arg(:Query:conjunction_of_literals, +Evidence:list, +Samples:int, ?Arg:term, -Values:list) is det
The predicate samples Query a number of Samples times given that Evidence is true. It performs particle filtering with likelihood weighting: each sample is weighted by the likelihood of an element of the Evidence list and constitutes a particle. After weighting, particles are resampled and the next element of Evidence is considered. Arg should be a variable in Query. Evidence is a list of goals. Query can be either a single goal or a list of goals. When Query is a single goal, the predicate returns in Values a list of couples V-W where V is a value of Arg for which Query succeeds in a particle in the last set of particles and W is the weight of the particle. For each element of Evidence, the particles are obtained by sampling Query in each current particle and weighting the particle by the likelihood of the evidence element. When Query is a list of goals, Arg is a list of variables, one for each query of Query and Arg and Query must have the same length of Evidence. Values is then list of the same length of Evidence and each of its elements is a list of couples V-W where V is a value of the corresponding element of Arg for which the corresponding element of Query succeeds in a particle and W is the weight of the particle. For each element of Evidence, the particles are obtained by sampling the corresponding element of Query in each current particle and weighting the particle by the likelihood of the evidence element.
 mc_particle_expectation(:Query:conjunction_of_literals, :Evidence:list, +N:int, ?Arg:var, -Exp:float) is det
The predicate computes the expected value of Arg in Query given Evidence by particle filtering. It uses N particle and sums up the weighted value of Arg for each particle. The overall sum is divided by the sum of weights to give Exp. Arg should be a variable in Query.
 mc_lw_sample(:Query:conjunction_of_literals, :Evidence:conjunction_of_literals, +Samples:int, -Prob:float) is det
The predicate samples Query a number of Samples times given that Evidence is true. The predicate returns in Prob the probability that the query is true. It performs likelihood weighting: each sample is weighted by the likelihood of evidence in the sample.
 mc_lw_sample_arg(:Query:atom, :Evidence:atom, +Samples:int, ?Arg:var, -Values:list) is det
The predicate samples Query a number of Samples times given that Evidence is true. Arg should be a variable in Query. The predicate returns in Values a list of couples V-W where V is a value of Arg for which Query succeeds in a world sampled at random and W is the weight of the sample. It performs likelihood weighting: each sample is weighted by the likelihood of evidence in the sample.
 mc_lw_sample_arg_log(:Query:atom, :Evidence:atom, +Samples:int, ?Arg:var, -Values:list) is det
The predicate samples Query a number of Samples times given that Evidence is true. Arg should be a variable in Query. The predicate returns in Values a list of couples V-W where V is a value of Arg for which Query succeeds in a world sampled at random and W is the natural logarithm of the weight of \ the sample. It performs likelihood weighting: each sample is weighted by the likelihood of evidence in the sample. It differs from mc_lw_sample_arg/5 because the natural logarithm of the weight is returned, useful when the evidence is very unlikely.
 mc_lw_expectation(:Query:atom, :Evidence:atom, +N:int, ?Arg:var, -Exp:float) is det
The predicate computes the expected value of Arg in Query given Evidence by likelihood weighting. It takes N samples of Query and sums up the weighted value of Arg for each sample. The overall sum is divided by the sum of weights to give Exp. Arg should be a variable in Query.
 mc_sample_arg_first(:Query:atom, +Samples:int, ?Arg:var, -Values:list, +Options:list) is det
The predicate samples Query a number of Samples times. Arg should be a variable in Query. The predicate returns in Values a list of couples V-N where V is the value of Arg returned as the first answer by Query in a world sampled at random and N is the number of samples returning that value. V is failure if the query fails.

Options is a list of options, the following are recognised by mc_sample_arg_first/5:

bar(-BarChar:dict)
BarChart is a dict for rendering with c3 as a bar chart with with a bar for each value of Arg returned as a first answer by Query in a world sampled at random. The size of the bar is the number of samples that returned that value.
 mc_sample_arg_first(:Query:atom, +Samples:int, ?Arg:var, -Values:list) is det
Equivalent to mc_sample_arg_first/5 with an empty option list.
 mc_sample_arg_one(:Query:atom, +Samples:int, ?Arg:var, -Values:list, +Options:list) is det
The predicate samples Query a number of Samples times. Arg should be a variable in Query. The predicate returns in Values a list of couples V-N where V is a value of Arg sampled with uniform probability from those returned by Query in a world sampled at random and N is the number of samples returning that value. V is failure if the query fails.

Options is a list of options, the following are recognised by mc_sample_arg_one/5:

bar(-BarChar:dict)
BarChart is a dict for rendering with c3 as a bar chart with a bar for each value of Arg returned by sampling with uniform probability one answer from those returned by Query in a world sampled at random. The size of the bar is the number of samples.
 mc_sample_arg_one(:Query:atom, +Samples:int, ?Arg:var, -Values:list) is det
Equivalent to mc_sample_arg_one/5 with an empty option list.
 mc_sample_arg_raw(:Query:atom, +Samples:int, ?Arg:var, -Values:list) is det
The predicate samples Query a number of Samples times. Arg should be a variable in Query. The predicate returns in Values a list of values of Arg returned as the first answer by Query in a world sampled at random. The value is failure if the query fails.
 mc_expectation(:Query:atom, +N:int, ?Arg:var, -Exp:float) is det
The predicate computes the expected value of Arg in Query by sampling. It takes N samples of Query and sums up the value of Arg for each sample. The overall sum is divided by N to give Exp. Arg should be a variable in Query.
 mc_gibbs_expectation(:Query:atom, +N:int, ?Arg:var, -Exp:float, +Options:list) is det
The predicate computes the expected value of Arg in Query by sampling. It takes N samples of Query and sums up the value of Arg for each sample. The overall sum is divided by N to give Exp. Arg should be a variable in Query. Options is a list of options, the following are recognised by mc_mh_sample_arg/6:
block(+Block:int)
Perform blocked Gibbs: Block variables are sampled together, default value 1
mix(+Mix:int)
The first Mix samples are discarded (mixing time), default value 0
 mc_gibbs_expectation(:Query:atom, +N:int, ?Arg:var, -Exp:float) is det
Equivalent to mc_gibbs_expectation/5 with an empty option list.
 mc_rejection_expectation(:Query:atom, :Evidence:atom, +N:int, ?Arg:var, -Exp:float) is det
The predicate computes the expected value of Arg in Query by sampling. It takes N samples of Query and sums up the value of Arg for each sample. The overall sum is divided by N to give Exp. Arg should be a variable in Query.
 mc_gibbs_expectation(:Query:atom, :Evidence:atom, +N:int, ?Arg:var, -Exp:float, +Options:list) is det
The predicate computes the expected value of Arg in Query by Gibbs sampling. It takes N samples of Query and sums up the value of Arg for each sample. The overall sum is divided by N to give Exp. Arg should be a variable in Query.

Options is a list of options, the following are recognised by mc_mh_expectation/6:

block(+Block:int)
Perform blocked Gibbs: Block variables are sampled together, default value 1
mix(+Mix:int)
The first Mix samples are discarded (mixing time), default value 0
 mc_mh_expectation(:Query:atom, :Evidence:atom, +N:int, ?Arg:var, -Exp:float, +Options:list) is det
The predicate computes the expected value of Arg in Query by Metropolis Hastings sampling. It takes N samples of Query and sums up the value of Arg for each sample. The overall sum is divided by N to give Exp. Arg should be a variable in Query.

Options is a list of options, the following are recognised by mc_mh_expectation/6:

mix(+Mix:int)
The first Mix samples are discarded (mixing time), default value 0
lag(+Lag:int)
lag between each sample, Lag sampled choices are forgotten, default value 1
 mc_mh_expectation(:Query:atom, :Evidence:atom, +N:int, ?Arg:var, -Exp:float) is det
Equivalent to mc_mh_expectation/6 with an empty option list.
 sample_head(+R:int, +Variables:list, +M:module, +HeadList:list, -HeadNumber:int) is det
samples a head from rule R instantiated as indicated by Variables (list of constants, one per variable. HeadList contains the head as a list. HeadNumber is the number of the sample head. Internal predicates used by the transformed input program
 take_a_sample(+R:int, +VC:list, +M:module, +Distr:term, -S:term) is det
Returns in S a sample for a random variable with distribution Distr associated to rule R with substitution VC. If the variable has already been sampled, it retrieves the sampled value, otherwise it takes a new sample and records it for rule R with substitution VC.
 gaussian(+Mean:float, +Variance:float, +M:module, -S:float) is det
samples a value from a Gaussian with mean Mean and variance Variance and returns it in S
 gaussian(+Mean:float, +Variance:float, +M:module, +S:float, -Density:float) is det
Computes the probability density of value S according to a Gaussian with mean Mean and variance Variance and returns it in Density.
 add_prob(?Prob:float, :Goal:atom, ?AnnGoal:atom) is det
From Prob and Goal builds the annotated atom AnnGoal=Goal:Prob.
 set_mc(: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_mc(: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/
 set_sw(:Var:term, +List:lit) is det
Sets the domain of the random variable Var to List. This is a predicate for programs in the PRISM syntax
 msw(:Var:term, ?Value:term) is det
Gets or tests the Value of the random variable Var. This is a predicate for programs in the PRISM syntax
 swap(?Term1:term, ?Term2:term) is det
If Term1 is of the form A:B, then Term2 is of the form B:A.
 :Term:term ~= +B:term is det
equality predicate for distributional clauses

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.

 argbar(+Values:list, -Chart:dict) is det
Values is a list of pairs V-N where V is the value and N is the number of samples returning that value. The predicate returns a dict for rendering with c3 as a bar chart with a bar for each value V. The size of the bar is given by N.
 std_dev(+Values:list, -Dev:float) is det
Computes the standard deviation of Values. Values can be
 variance(+Values:list, -Average:float, -Variance:float) is det
Computes the variance the average of Values. Values can be
 bin(+N:int, +Values:list, +Lower:number, +BinWidth:number, -Couples:list) is det
Given a list of numeric Values, a Lower value and BinWidth, returns in Couples a list of N pairs V-Freq where V is the midpoint of a bin and Freq is the number of values that are inside the bin interval [V-BinWidth/2,V+BinWidth/2) starting with the bin where V-BinWidth/2=Lower
 density2d(+List:list, -Dens:list, +Options:list) is det
Returns a set of 3-dimensional points representing the plot of the density of a sets of 2-dimensional samples. The samples are in List as pairs [X,Y]-W where (X,Y) is a point and W its weigth.

Options is a list of options, the following are recognised by density2d/3:

xmin(+XMin:float)
the minimum value of the X domain, default value the minimum in List
xmax(-XMax:float)
the maximum value of the X domain, default value the maximum in List
ymin(-YMin:float)
the minimum value of the Y domain, default value the minimum in List
ymax(-YMax:float)
the maximum value of the Y domain, default value the maximum in List
nbins(+NBins:int)
the number of bins for dividing the X and Y domains, default value 40
 densities(+PriorList:list, +PostList:list, -Chart:dict, +Options:list) is det
Draws a line chart of the density of two sets of samples, usually prior and post observations. The samples from the prior are in PriorList while the samples from the posterior are in PostList. PriorList and PostList must be lists of pairs of the form [V]-W or V-W where V is a sampled value and W is its weight, or lists of values V. Options is a list of options, the following are recognised by histogram/3:
nbins(+NBins:int)
the number of bins for dividing the domain, default value 40 */
 bar1(+Probability:float, -Chart:dict) is det
The predicate returns a dict for rendering with c3 as a bar chart with a bar for the probability
 std_dev(+Values:list, -Average:float, -Dev:float) is det
Computes the standard deviation and the average of Values. Values can be
 to_atom(+In:pair, -Out:pair) is det
Given In=A0-N, to_atom/2 returns Out=A-N where A is an atom representing A0
 variance(+Values:list, -Variance:float) is det
Computes the variance of Values. Values can be
 value_pair(+Pair:pair, -Value:term) is det
Given a pair Key-Vaule, returns its second element Value
 density2d(+List:list, -Dens:list) is det
Equivalent to density2d/3 with an empty option list.
 densities(+PriorList:list, +PostList:list, -Chart:dict) is det
Equivalent to densities/4 with an empty option list.
 bar(+Successes:int, +Failures:int, -Chart:dict) is det
The predicate returns a dict for rendering with c3 as a bar chart with a bar for the number of successes and a bar for the number of failures
 agg_val(+Couple:atom, +PartialSum:number, -Sum:number) is det
Aggregate values by summation. The first argument is a couple _-N with N the new value to sum to PartialSum
 average(+Values:list, -Average:float) is det
Computes the average of Values. Values can be
 key_pair(+Pair:pair, -Key:term) is det
Given a pair Key-Vaule, returns its first element Key
 density(+List:list, -Chart:dict, +Options:list) is det
Draws a line chart of the density of a sets of samples. The samples are in List as pairs [V]-W or V-W where V is a value and W its weigth.

Options is a list of options, the following are recognised by density/3:

min(+Min:float)
the minimum value of domain, default value the minimum in List
max(+Max:float)
the maximum value of domain, default value the maximum in List
nbins(+NBins:int)
the number of bins for dividing the domain, default value 40
 histogram(+List:list, -Chart:dict, +Options:list) is det
Draws a histogram of the samples in List. List must be a list of pairs of the form [V]-W or V-W where V is a sampled value and W is its weight, or a list of values.

Options is a list of options, the following are recognised by histogram/3:

min(+Min:float)
the minimum value of domain, default value the minimum in List
max(+Max:float)
the maximum value of domain, default value the maximum in List
nbins(+NBins:int)
the number of bins for dividing the domain, default value 40
 bar(+Probability:float, -Chart:dict) is det
The predicate returns a dict for rendering with c3 as a bar chart with a bar for the probability and a bar for one minus the probability.
 dump(+Target, -NewVars, -Constraints) is det
Returns in Constraints, the constraints that currently hold on Target where all variables in Target are copied to new variables in NewVars and the constraints are given on these new variables. In short, you can safely manipulate NewVars and Constraints without changing the constraints on Target.
 swi_builtin(+Goal:atom) is det
Succeeds if Goal is an atom whose predicate is defined in Prolog (either builtin or defined in a standard library).
 beta(+Alphas:list, -Beta:float) is det
Computes the value of the multivariate beta function for vector Alphas https://en.wikipedia.org/wiki/Beta_function#Multivariate_beta_function Alphas is a list of floats
 to_pair(+Pair:pair, -FlattenedPair:pair) is det
Given a pair E-W, returns a pair Ep-W where Ep=EE if E=[EE], otherwise Ep=E
 density(+List:list, -Chart:dict) is det
Equivalent to density/3 with an empty option list.
 histogram(+List:list, -Chart:dict) is det
Equivalent to histogram/3 with an empty option list.

Undocumented predicates

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

 bb_inf(Arg1, Arg2, Arg3, Arg4, Arg5)
 ordering(Arg1)
 sup(Arg1, Arg2)
 inf(Arg1, Arg2, Arg3, Arg4)
 sup(Arg1, Arg2, Arg3, Arg4)
 entailed(Arg1)
 inf(Arg1, Arg2)
 clp_type(Arg1, Arg2)
 bb_inf(Arg1, Arg2, Arg3)
 minimize(Arg1)
 {Arg1}
 maximize(Arg1)