:- use_module(library(mcintyre)).
:- if(current_predicate(use_rendering/1)).
:- use_rendering(c3).
:- endif.
:- mc.
:- begin_lpad.
m(S,N,P):multinomial(S,N,P).
query(N,P):-
m(S,N,P),
S=[N1,N2|_],
N1>N2.
:- end_lpad.
prob_query(N,P,Prob):-
mc_sample(query(N,P),1000,Prob).
(ins)?- prob_query(N,P,Prob).
^CAction (h for help) ? abort
(cmd)?- mc_sample(query(N,P),1,Prob).
^CAction (h for help) ? abort
The part:
query(N,P):-
m(S,N,P),
S=[N1,N2|_],
N1>N2.
When I append ‘writeln((N1,N2))’ after ‘S=[N1,N2|_]’ I’m constantly getting zeroes. So ‘N1>N2’ never gets true.
How long do I have to wait for this example?
Regards.