The examples so far have all concerned entirely discrete spaces. Continuous distributions can be implemented by including calls to Prolog built-ins which generate floating point values according to various distributions. (In some cases it may be necessary to call C code if the Prolog you are using does not have built-ins for the distributions you need. See Section 4.3 for pointers to the C language interface.)
In Fig 18 there is a prior that adapts the mixture
prior (Fig 16) so that the radii of circles is uniformly
distributed over the range . random/1 is a predicate of
library(random) in both Sicstus and Yap.
![]() |