-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathobstacle.asl
37 lines (33 loc) · 1.23 KB
/
obstacle.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
+!checkObstacle(Time) :
obstacle(XObstacle,YObstacle,Time) &
obstacle(XObstacle+1,YObstacle-1,Time) &
obstacle(XObstacle+2,YObstacle,Time) &
not obstacle(XObstacle+1,YObstacle,Time) &
not thing(XObstacle+1,YObstacle,_,_,Time)
<- +obstacle(XObstacle+1,YObstacle,Time);
!checkObstacle(Time).
+!checkObstacle(Time) :
obstacle(XObstacle,YObstacle,Time) &
obstacle(XObstacle+1,YObstacle+1,Time) &
obstacle(XObstacle+2,YObstacle,Time) &
not obstacle(XObstacle+1,YObstacle,Time) &
not thing(XObstacle+1,YObstacle,_,_,Time)
<- +obstacle(XObstacle+1,YObstacle,Time);
!checkObstacle(Time).
+!checkObstacle(Time) :
obstacle(XObstacle,YObstacle,Time) &
obstacle(XObstacle+1,YObstacle+1,Time) &
obstacle(XObstacle+1,YObstacle-1,Time) &
not obstacle(XObstacle+1,YObstacle,Time) &
not thing(XObstacle+1,YObstacle,_,_,Time)
<- +obstacle(XObstacle+1,YObstacle,Time);
!checkObstacle(Time).
+!checkObstacle(Time) :
obstacle(XObstacle,YObstacle,Time) &
obstacle(XObstacle-1,YObstacle-1,Time) &
obstacle(XObstacle-1,YObstacle+1,Time) &
not obstacle(XObstacle-1,YObstacle,Time) &
not thing(XObstacle-1,YObstacle,_,_,Time)
<- +obstacle(XObstacle-1,YObstacle,Time);
!checkObstacle(Time).
+!checkObstacle(Time) <- true.