-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathr4.asl~
49 lines (36 loc) · 789 Bytes
/
r4.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
// mars robot 4 (carries the coal to r2)
/* Initial beliefs */
//at(P) :- pos(P,X,Y) & pos(r4,X,Y).
/* Initial goal */
//!check(slots).
/* Plans */
/*
+!check(slots) : not coal(r4)
<- next(slot);
!check(slots).
+!check(slots).
@lg[atomic]
+coal(r4) : not .desire(carry_to(r2))
<- !carry_to(r2).
+!carry_to(R)
<- // remember where to go back
?pos(r4,X,Y);
-+pos(last,X,Y);
// carry coal to r2
!take(coal,R);
// goes back and continue to check
!at(last);
!check(slots).
+!take(S,L) : true
<- !ensure_pick(S);
!at(L);
drop(S).
+!ensure_pick(S) : coal(r4)
<- pick(coal);
!ensure_pick(S).
+!ensure_pick(_).
+!at(L) : at(L).
+!at(L) <- ?pos(L,X,Y);
move_towards(X,Y);
!at(L).
*/