1:- use_module(library(pita)). 2 3:- if(current_predicate(use_rendering/1)). 4:- use_rendering(c3). 5:- endif. 6 7:- pita. 8 9:- begin_lpad. 10 11sampled_male(X)0.5:- 12 db(male(X)). 13 14:- end_lpad. 15 16male(john). 17male(david). 18 19female(anna). 20female(elen). 21female(cathy).
?-
prob(sampled_male(X),Prob)
. % expected result 0.5 for X=john, X=david*/