This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/CLPBN/examples/sprinkler.pfl

40 lines
657 B
Plaintext
Raw Normal View History

2012-06-22 19:00:12 +01:00
:- ensure_loaded(library(pfl)).
2012-12-11 23:06:09 +00:00
:- set_solver(hve).
%:- set_solver(ve).
%:- set_solver(jt).
%:- set_solver(bdd).
%:- set_solver(bp).
%:- set_solver(cbp).
%:- set_solver(gibbs).
%:- set_solver(lve).
%:- set_solver(lkc).
%:- set_solver(lbp).
2012-06-22 19:00:12 +01:00
bayes cloudy ; cloudy_table ; [].
bayes sprinkler, cloudy ; sprinkler_table ; [].
bayes rain, cloudy ; rain_table ; [].
bayes wet_grass, sprinkler, rain ; wet_grass_table ; [].
2012-12-11 23:06:09 +00:00
cloudy_table(
[ 0.5,
0.5 ]).
2012-06-22 19:00:12 +01:00
2012-12-11 23:06:09 +00:00
sprinkler_table(
[ 0.5, 0.9,
0.5, 0.1 ]).
2012-06-22 19:00:12 +01:00
2012-12-11 23:06:09 +00:00
rain_table(
[ 0.8, 0.2,
0.2, 0.8 ]).
2012-06-22 19:00:12 +01:00
2012-12-11 23:06:09 +00:00
wet_grass_table(
[ 1.0, 0.1, 0.1, 0.01,
0.0, 0.9, 0.9, 0.99 ]).
2012-06-22 19:00:12 +01:00
2012-12-11 23:06:09 +00:00
% ?- wet_grass(X).
2012-06-22 19:00:12 +01:00