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
660 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(ve).
2013-01-10 23:02:34 +00:00
%:- set_solver(hve).
2012-12-11 23:06:09 +00:00
%:- 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(
2013-01-03 18:48:15 +00:00
[ 0.1, 0.5,
0.9, 0.5 ]).
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(
2013-01-03 18:48:15 +00:00
[ 0.99, 0.9, 0.9, 0.0,
0.01, 0.1, 0.1, 1.0 ]).
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