diff --git a/packages/CLPBN/clpbn/bp/examples/city.yap b/packages/CLPBN/clpbn/bp/examples/city.yap index d210a6f26..5cad29586 100644 --- a/packages/CLPBN/clpbn/bp/examples/city.yap +++ b/packages/CLPBN/clpbn/bp/examples/city.yap @@ -1,26 +1,24 @@ :- use_module(library(pfl)). -:- clpbn_horus:set_solver(fove). -%:- clpbn_horus:set_solver(hve). -%:- clpbn_horus:set_solver(bp). -%:- clpbn_horus:set_solver(cbp). +%:- set_solver(fove). +%:- set_solver(hve). +%:- set_solver(bp). +%:- set_solver(cbp). :- multifile people/2. :- multifile ev/1. - people(joe,nyc). people(p2, nyc). people(p3, nyc). people(p4, nyc). people(p5, nyc). -%ev(descn(p2, t)). +ev(descn(p2, t)). ev(descn(p3, t)). ev(descn(p4, t)). ev(descn(p5, t)). - bayes city_conservativeness(C)::[y,n] ; cons_table(C) ; [people(_,C)]. bayes gender(P)::[m,f] ; gender_table(P) ; [people(P,_)]. diff --git a/packages/CLPBN/clpbn/bp/examples/comp_workshops.yap b/packages/CLPBN/clpbn/bp/examples/comp_workshops.yap index 00550f7da..39a14d8bd 100644 --- a/packages/CLPBN/clpbn/bp/examples/comp_workshops.yap +++ b/packages/CLPBN/clpbn/bp/examples/comp_workshops.yap @@ -1,12 +1,14 @@ :- use_module(library(pfl)). -:- clpbn_horus:set_solver(fove). -%:- clpbn_horus:set_solver(hve). -%:- clpbn_horus:set_solver(bp). -%:- clpbn_horus:set_solver(cbp). +%:- set_solver(fove). +%:- set_solver(hve). +%:- set_solver(bp). +%:- set_solver(cbp). :- yap_flag(write_strings, off). +:- multifile c/2. + c(p1,w1). c(p1,w2). c(p1,w3). @@ -23,9 +25,9 @@ c(p5,w1). c(p5,w2). c(p5,w3). -markov attends(P)::[t,f] , hot(W)::[t,f] ; [0.1, 0.2, 0.3, 0.4] ; [c(P,W)]. +markov attends(P)::[t,f], hot(W)::[t,f] ; [0.2, 0.8, 0.8, 0.8] ; [c(P,W)]. -markov attends(P)::[t,f], series::[t,f] ; [0.5, 0.6, 0.7, 0.8] ; [c(P,_)]. +markov attends(P)::[t,f], series::[t,f] ; [0.501, 0.499, 0.499, 0.499] ; [c(P,_)]. % ?- series(X). diff --git a/packages/CLPBN/clpbn/bp/examples/smokers.yap b/packages/CLPBN/clpbn/bp/examples/smokers.yap index e3fc6301a..c5c57b536 100644 --- a/packages/CLPBN/clpbn/bp/examples/smokers.yap +++ b/packages/CLPBN/clpbn/bp/examples/smokers.yap @@ -1,24 +1,31 @@ :- use_module(library(pfl)). -:- clpbn_horus:set_solver(fove). -%:- clpbn_horus:set_solver(hve). -%:- clpbn_horus:set_solver(bp). -%:- clpbn_horus:set_solver(cbp). +%:- set_solver(fove). +%:- set_solver(hve). +%:- set_solver(bp). +%:- set_solver(cbp). :- yap_flag(write_strings, off). +:- multifile people/1. -friends(P1, P2) :- - people(P1), - people(P2), - P1 @< P2. +people @ 5. -people @ 3. +friendship(X,Y) :- + people(X), + people(Y). +% X \== Y. -markov smokes(P)::[t,f], cancer(P)::[t,f] ; [0.1, 0.2, 0.3, 0.4] ; [people(P)]. +markov smokes(X)::[t,f] ; [1.0, 1.4] ; [people(X)]. -markov friend(P1,P2)::[t,f], smokes(P1)::[t,f], smokes(P2)::[t,f] ; - [0.5, 0.6, 0.7, 0.8, 0.5, 0.6, 0.7, 0.8] ; [friends(P1, P2)]. +markov asthma(X)::[t,f] ; [1.0, 2.3] ; [people(X)]. -% ?- smokes(p1, t), smokes(p2, f), friend(p1, p2, X). +markov friends(X,Y)::[t,f] ; [1.0, 4.6] ; [friendship(X,Y)]. + +markov asthma(X)::[t,f], smokes(X)::[t,f] ; [1.5, 1.0, 1.5, 1.5] ; [people(X)]. + +markov asthma(X)::[t,f], friends(X,Y)::[t,f], smokes(Y)::[t,f] ; + [1.1, 1.0, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1] ; [friendship(X,Y)]. + +% ?- smokes(p1,t), smokes(p2,t), friends(p1,p2,X) diff --git a/packages/CLPBN/clpbn/bp/examples/workshop_attrs.yap b/packages/CLPBN/clpbn/bp/examples/workshop_attrs.yap index 02a89257f..880adcae5 100644 --- a/packages/CLPBN/clpbn/bp/examples/workshop_attrs.yap +++ b/packages/CLPBN/clpbn/bp/examples/workshop_attrs.yap @@ -1,12 +1,14 @@ :- use_module(library(pfl)). -:- clpbn_horus:set_solver(fove). -%:- clpbn_horus:set_solver(hve). -%:- clpbn_horus:set_solver(bp). -%:- clpbn_horus:set_solver(cbp). +%:- set_solver(fove). +%:- set_solver(hve). +%:- set_solver(bp). +%:- set_solver(cbp). :- yap_flag(write_strings, off). +:- multifile people/1. + people @ 5. markov attends(P)::[t,f], attr1::[t,f] ; [0.7, 0.3, 0.3, 0.3] ; [people(P)].