-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain.asl~
58 lines (48 loc) · 1.45 KB
/
train.asl~
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
51
52
53
54
55
56
57
58
/* Initial beliefs */
+waiting(passenger,station).
+onboard(passenger,train).
/* Goals */
!operate(train,station).
/* Plans */
+!operate(train,station) : true
<- !at(train,station);
open(doors);
!unboard(passenger);
!board(passenger);
close(doors);
+done(operations,station);
!at(train,station);
!operate(train,station).
+!at(train,station)
: at(train,station) & not done(operations,station)
<- true.
+!at(train,station)
: at(train,station) & done(operations,station)
<- depart(station);
-done(operations,station);
move_to(station);
!at(train,station).
+!at(train,station)
: not at(train,station)
<- move_to(station);
!at(train,station).
+!unboard(passenger) : onboard(passenger,train)
<- unboard(passenger).
+!unboard(passenger) : not onboard(passenger,train)
<- true.
+!board(passenger) : waiting(passenger,station)
<- board(passenger).
+!board(passenger) : not waiting(passenger,station)
<- true.
+waiting_pass(passenger,0)
: waiting(passenger,station)
<- -waiting(passenger,station).
+waiting_pass(passenger,N)
: N > 0 & not waiting(passenger,station)
<- -+waiting(passenger,station).
+onboard_pass(passenger,0)
: onboard(passenger,train)
<- -onboard(passenger,train).
+onboard_pass(passenger,N)
: N > 0 & not onboard(passenger,train)
<- -+onboard(passenger,train).