This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coffee.pygments/tests/examplefiles/cplint/dt_umbrella.pl
2022-02-03 15:46:34 +01:00

34 lines
523 B
Prolog

% From [Van den Broeck et al., 2010].
:- use_module(library(pita)).
:- pita.
:- begin_lpad.
0.3::rain.
0.5::wind.
% decision facts
? :: umbrella.
? :: raincoat.
broken_umbrella :- rain,umbrella,wind.
dry :- rain, raincoat.
dry :- rain, umbrella, \+(broken_umbrella).
dry :- \+(rain).
% utility facts
broken_umbrella => -40.
raincoat => -20.
umbrella => -2.
dry => 60.
:- end_lpad.
/*
* ?- dt_solve(Strategy,Value).
* Expected result:
* Strategy = [umbrella]
* Value = 43.0
*/