2013-01-07 14:59:51 +00:00
|
|
|
/*
|
|
|
|
Model from the paper "Lifted Inference Seen
|
|
|
|
from the Other Side: The Tractable Features"
|
|
|
|
*/
|
|
|
|
|
2012-05-23 14:56:01 +01:00
|
|
|
:- use_module(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).
|
2012-05-23 14:56:01 +01:00
|
|
|
%:- set_solver(bp).
|
|
|
|
%:- set_solver(cbp).
|
2012-12-11 23:06:09 +00:00
|
|
|
%:- set_solver(gibbs).
|
|
|
|
%:- set_solver(lve).
|
|
|
|
%:- set_solver(lkc).
|
|
|
|
%:- set_solver(lbp).
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2013-01-07 14:59:51 +00:00
|
|
|
:- multifile person/1.
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2013-01-07 14:59:51 +00:00
|
|
|
person @ 5.
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2013-01-07 14:59:51 +00:00
|
|
|
person(X,Y) :-
|
|
|
|
person(X),
|
|
|
|
person(Y)
|
|
|
|
% ,X \== Y
|
|
|
|
.
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2013-01-07 14:59:51 +00:00
|
|
|
markov smokes(X) ; [1.0, 4.0552]; [person(X)].
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2013-01-07 14:59:51 +00:00
|
|
|
markov asthma(X) ; [1.0, 9.9742] ; [person(X)].
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2013-01-07 14:59:51 +00:00
|
|
|
markov friends(X,Y) ; [1.0, 99.48432] ; [person(X,Y)].
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2012-12-12 15:16:30 +00:00
|
|
|
markov asthma(X), smokes(X) ;
|
2013-01-07 14:59:51 +00:00
|
|
|
[4.48169, 4.48169, 1.0, 4.48169] ;
|
|
|
|
[person(X)].
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2012-12-12 15:16:30 +00:00
|
|
|
markov asthma(X), friends(X,Y), smokes(Y) ;
|
2013-01-07 14:59:51 +00:00
|
|
|
[3.004166, 3.004166, 3.004166, 3.004166, 3.004166, 1.0, 1.0, 3.004166] ;
|
|
|
|
[person(X,Y)].
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2012-12-12 17:01:30 +00:00
|
|
|
% ?- smokes(p1,t), smokes(p2,t), friends(p1,p2,X).
|
2012-05-23 14:56:01 +01:00
|
|
|
|