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/ProbLog/problog_examples/office.pl

29 lines
777 B
Perl
Raw Normal View History

2010-08-26 13:44:10 +01:00
%%% -*- Mode: Prolog; -*-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ProbLog program describing an office window
% example for using hybrid ProbLog
2010-12-02 14:02:49 +00:00
% $Id: office.pl 4970 2010-10-21 08:47:36Z bernd $
2010-08-26 13:44:10 +01:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2010-12-02 14:04:42 +00:00
:- use_module(library(problog)).
2010-08-26 13:44:10 +01:00
2010-12-02 14:02:49 +00:00
(W,gaussian(2,1)) :: width(W).
(L,gaussian(9,3)) :: length(L).
2010-08-26 13:44:10 +01:00
0.8 :: office_has_window.
0.001 :: corridor_has_window.
in_office :- width(W),length(L), in_interval(W,2,4), in_interval(L,2,4).
in_corridor :- width(W),length(L), below(W,2.5), above(L,3).
room_has_window:-
in_office, office_has_window.
room_has_window:-
in_corridor,corridor_has_window.
2010-10-05 17:26:40 +01:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% query ?- problog_exact(room_has_window, Prob, Status).
% Prob = 0.01517076,
% Status = ok ?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%