Did you know ... Search Documentation:
Pack pha -- prolog/pha_sched.pl
PublicShow source

This module uses the the PHA continuation capturing meta-interpreter in pha_mi.pl to run PHA goals and a priority queue to manage a collection of threads, each exploring a different possible world associated with a list of valuations of random variables. Each time a thread tries to sample a random variable, its continuation is captured and a new set of threads corresponding to the different possible choices is created in a suspended state. next//1 then advances the state of the collection of threads by running all threads until a success is found or all threads fail.

A thread can either be a list of random variable valuations (assumptions) and a continuation, or a continuation to be appended to a lazy list of explanations for a previous goal. [cf. Monadic bind!]

 explanation(+Es:explist, -E:weighted(explanation)) is nondet
Unifies E with an explanation, finds other explanations on backtracking.
 prob(+Es:llist(expentry), -Ps:llist(interval(prob))) is det
Compute a lazy stream of probability intervals from a lazy list of explanations.

Undocumented predicates

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

 nil_belief(Arg1)
 cons_belief(Arg1, Arg2, Arg3)