Blame view

code/asp/plp/alarm.plp 430 Bytes
3e0f9b8a   Francisco Coelho   back to work?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{burglary}.
:~not burglary.["2.19722"@0,0,()]

{earthquake}.
:~not earthquake.["1.38629"@0,1,()]

{hears_alarm(mary)}.
{hears_alarm(john)}.
:~not hears_alarm(mary).["-0.84729"@0,2,(mary,)]
:~not hears_alarm(john).["-0.84729"@0,2,(john,)]

alarm :- burglary. 
alarm :- earthquake.
calls(X) :- alarm, hears_alarm(X).

person(mary).
person(john).

% Evidence that alarm has (been observed) to be true
:- not alarm.

&query(burglary).