Library for Probabilistic Functional Logic Programming
Author: Sandra Dylus, Jan Christiansen, Finn Teegen, Jan Tikovsky
Version: June 2018
enum
:: [a] -> [Float] -> Dist a
Creates a distribution based on a given list of events and another list providing the corresponding probabilities. |
uniform
:: [a] -> Dist a
Creates a uniform distribution based on a given list of events. |
certainly
:: a -> Dist a
Creates a single-event-distribution with probability 1.0 .
|
(>>>=)
:: Dist a -> (a -> Dist b) -> Dist b
Combines two (dependent) distributions. |
joinWith
:: (a -> b -> c) -> Dist a -> Dist b -> Dist c
Combines two (independent) distributions with respect to a given function. |
(??)
:: (a -> Bool) -> Dist a -> Float
Queries a distribution for the probabilitiy of events that satisfy a given predicate. |
pick
:: (() -> a) -> a
Triggers the evaluation of a run-time choice value (see type synonym RT ).
|
replicateDist
:: Int -> (() -> Dist a) -> Dist [a]
Independently replicates a distribution a given number of times. |
Probabilities. Floating point numbers are used to model probabilities.
Type synonym: Probability = Float
Probability distributions.
Distributions are abstract and can only be created using the functions
provided by this library, e.g., enum
and uniform
. Internally, Curry's
built-in non-determinism is used to model distributions with more than one
event-probability pair.
Constructors:
Run-time choice values. Currently, the only way to construct a run-time
choice value is to explicitly use a lambda abstraction. The evaluation of
a run-time choice can be triggered by the function pick
.
Type synonym: RT a = () -> a
Creates a distribution based on a given list of events and another list
providing the corresponding probabilities. This function also ensures that
the relevant probabilities add up to |
Creates a uniform distribution based on a given list of events. The list of events must be non-empty. |
Creates a single-event-distribution with probability
|
Combines two (dependent) distributions.
|
Combines two (independent) distributions with respect to a given function. |
Queries a distribution for the probabilitiy of events that satisfy a given predicate.
|
Triggers the evaluation of a run-time choice value (see type synonym |
Independently replicates a distribution a given number of times. In order
to behave properly, the given distribution is required to be a run-time
choice value (see type synonym |