update smokers examples
This commit is contained in:
parent
2bef3f6866
commit
10ac7720f7
@ -1,31 +0,0 @@
|
|||||||
:- use_module(library(pfl)).
|
|
||||||
|
|
||||||
%:- set_solver(fove).
|
|
||||||
%:- set_solver(hve).
|
|
||||||
%:- set_solver(bp).
|
|
||||||
%:- set_solver(cbp).
|
|
||||||
|
|
||||||
:- yap_flag(write_strings, off).
|
|
||||||
|
|
||||||
:- multifile people/1.
|
|
||||||
|
|
||||||
people @ 5.
|
|
||||||
|
|
||||||
friendship(X,Y) :-
|
|
||||||
people(X),
|
|
||||||
people(Y).
|
|
||||||
% X \== Y.
|
|
||||||
|
|
||||||
markov smokes(X)::[t,f] ; [1.0, 1.4] ; [people(X)].
|
|
||||||
|
|
||||||
markov asthma(X)::[t,f] ; [1.0, 2.3] ; [people(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)
|
|
||||||
|
|
31
packages/CLPBN/clpbn/bp/examples/smokers1.yap
Normal file
31
packages/CLPBN/clpbn/bp/examples/smokers1.yap
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
:- use_module(library(pfl)).
|
||||||
|
|
||||||
|
%:- set_solver(fove).
|
||||||
|
%:- set_solver(hve).
|
||||||
|
%:- set_solver(bp).
|
||||||
|
%:- set_solver(cbp).
|
||||||
|
|
||||||
|
:- yap_flag(write_strings, off).
|
||||||
|
|
||||||
|
:- multifile people/1.
|
||||||
|
|
||||||
|
people @ 5.
|
||||||
|
|
||||||
|
people(X,Y) :-
|
||||||
|
people(X),
|
||||||
|
people(Y),
|
||||||
|
X \== Y.
|
||||||
|
|
||||||
|
markov smokes(X)::[t,f]; [1.0, 4.0552]; [people(X)].
|
||||||
|
|
||||||
|
markov cancer(X)::[t,f]; [1.0, 9.9742]; [people(X)].
|
||||||
|
|
||||||
|
markov friends(X,Y)::[t,f] ; [1.0, 99.48432] ; [people(X,Y)].
|
||||||
|
|
||||||
|
markov smokes(X)::[t,f], cancer(X)::[t,f] ; [4.48169, 4.48169, 1.0, 4.48169] ; [people(X)].
|
||||||
|
|
||||||
|
markov friends(X,Y)::[t,f], smokes(X)::[t,f], smokes(Y)::[t,f] ;
|
||||||
|
[3.004166, 3.004166, 3.004166, 3.004166, 3.004166, 1.0, 1.0, 3.004166] ; [people(X,Y)].
|
||||||
|
|
||||||
|
% ?- friends(p1,p2,X).
|
||||||
|
|
31
packages/CLPBN/clpbn/bp/examples/smokers2.yap
Normal file
31
packages/CLPBN/clpbn/bp/examples/smokers2.yap
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
:- use_module(library(pfl)).
|
||||||
|
|
||||||
|
%:- set_solver(fove).
|
||||||
|
%:- set_solver(hve).
|
||||||
|
%:- set_solver(bp).
|
||||||
|
%:- set_solver(cbp).
|
||||||
|
|
||||||
|
:- yap_flag(write_strings, off).
|
||||||
|
|
||||||
|
:- multifile people/1.
|
||||||
|
|
||||||
|
people @ 5.
|
||||||
|
|
||||||
|
people(X,Y) :-
|
||||||
|
people(X),
|
||||||
|
people(Y).
|
||||||
|
% X \== Y.
|
||||||
|
|
||||||
|
markov smokes(X)::[t,f]; [1.0, 4.0552]; [people(X)].
|
||||||
|
|
||||||
|
markov asthma(X)::[t,f]; [1.0, 9.9742] ; [people(X)].
|
||||||
|
|
||||||
|
markov friends(X,Y)::[t,f]; [1.0, 99.48432] ; [people(X,Y)].
|
||||||
|
|
||||||
|
markov asthma(X)::[t,f], smokes(X)::[t,f]; [4.48169, 4.48169, 1.0, 4.48169] ; [people(X)].
|
||||||
|
|
||||||
|
markov asthma(X)::[t,f], friends(X,Y)::[t,f], smokes(Y)::[t,f];
|
||||||
|
[3.004166, 3.004166, 3.004166, 3.004166, 3.004166, 1.0, 1.0, 3.004166] ; [people(X,Y)].
|
||||||
|
|
||||||
|
% ?- smokes(p1,t), smokes(p2,t), friends(p1,p2,X)
|
||||||
|
|
Reference in New Issue
Block a user