-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnake.pddl
72 lines (67 loc) · 1.92 KB
/
snake.pddl
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
(define (domain snake)
(:requirements :strips :typing :equality :negative-preconditions)
(:types snake location)
(:predicates
(occupied ?pos - location)
(adjacent ?pos1 ?pos2 - location)
(head ?snake - snake ?headpos - location)
(connected ?snake - snake ?bodypos1 ?bodypos2 - location)
(tail ?snake - snake ?tailpos - location)
(mouse-at ?foodpos - location)
)
(:action strike
:parameters (?snake - snake ?headpos ?foodpos - location)
:precondition (and
(head ?snake ?headpos)
(mouse-at ?foodpos)
(adjacent ?foodpos ?headpos)
)
:effect (and
(not (mouse-at ?foodpos))
(not (head ?snake ?headpos))
(connected ?snake ?foodpos ?headpos)
(head ?snake ?foodpos)
)
)
(:action move-short
:parameters (?snake - snake ?nextpos ?snakepos - location)
:precondition (and
(head ?snake ?snakepos)
(tail ?snake ?snakepos)
(adjacent ?nextpos ?snakepos)
(not (occupied ?nextpos))
)
:effect (and
(not (head ?snake ?snakepos))
(not (tail ?snake ?snakepos))
(occupied ?nextpos)
(head ?snake ?nextpos)
(tail ?snake ?nextpos)
(not (occupied ?snakepos))
)
)
(:action move-long
:parameters (?snake - snake ?nextpos ?headpos ?bodypos ?tailpos - location)
:precondition (and
(head ?snake ?headpos)
(connected ?snake ?bodypos ?tailpos)
(tail ?snake ?tailpos)
(adjacent ?nextpos ?headpos)
(adjacent ?bodypos ?tailpos)
(not (occupied ?nextpos))
(not (= ?bodypos ?nextpos))
(not (= ?tailpos ?nextpos))
(not (= ?headpos ?tailpos))
)
:effect (and
(not (head ?snake ?headpos))
(head ?snake ?nextpos)
(not (tail ?snake ?tailpos))
(tail ?snake ?bodypos)
(not (connected ?snake ?bodypos ?tailpos))
(connected ?snake ?nextpos ?headpos)
(occupied ?nextpos)
(not (occupied ?tailpos))
)
)
)