-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDEC.lp
50 lines (37 loc) · 1010 Bytes
/
DEC.lp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
%Discrete Event Calculus for ASP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Discete Event Calculus.
time(0..maxstep).
% DEC 5
holdsAt(F,T+1) :- holdsAt(F,T);
not _new_pred_1(T,F);
time(T);
fluent(F);
T<maxstep.
% DEC 6
:- {not holdsAt(F,T+1)}0;
not holdsAt(F,T);
not _new_pred_2(T,F);
fluent(F);
time(T);
T<maxstep.
% DEC 9
holdsAt(F,T+1) :- happens(E,T),initiates(E,F,T),event(E),fluent(F),time(T),T<maxstep.
% DEC 10
:- {not holdsAt(F,T+1)}0;
happens(E,T);
event(E);
fluent(F);
terminates(E,F,T);
time(T);
T<maxstep.
_new_pred_1(T,F) :- happens(E,T);
terminates(E,F,T);
event(E);
fluent(F).
_new_pred_2(T,F) :- happens(E,T);
initiates(E,F,T);
event(E);
fluent(F).
{holdsAt(F,T)}:-fluent(F);
time(T).