forked from UMBC-CMSC-471-01-SP2016/hw5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdomain.pddl
86 lines (73 loc) · 2.93 KB
/
domain.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; HW5 blocks world + painting (stub)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (domain hw5)
(:requirements :strips)
(:constants red green blue yellow)
(:predicates (on ?x ?y) ; object ?x is on object ?y
(on-table ?x) ; object ?x is on the table
(clear ?x) ; nothing is on object ?x
(arm-empty) ; the robot arm is holding nothing
(holding ?x) ; the robot arm is holding object ?x
(color ?x ?color) ; object ?x has color ?color
(block ?x) ; object ?x is a block
(sprayer ?x ?color) ; object ?x is a sprayer with color ?color
(paint-can ?x ?color) ; object ?x is a paint can with color ?color
(brush ?x) ; object ?x is a brush
(water-bucket ?x) ; object ?x is a water bucket
(clean ?b) ; brush ?b is clean
(loaded ?b ?color) ; brush ?b is loaded with paint of color ?color
)
(:action pick-up
:parameters (?obj1)
:precondition (and (clear ?obj1) (on-table ?obj1) (arm-empty))
:effect
(and (not (on-table ?obj1))
(not (clear ?obj1))
(not (arm-empty))
(holding ?obj1)))
(:action put-down
:parameters (?ob)
:precondition (holding ?ob)
:effect
(and (not (holding ?ob))
(clear ?ob)
(arm-empty)
(on-table ?ob)))
(:action stack
:parameters (?obj1 ?obj2)
:precondition (and (holding ?obj1) (clear ?obj2))
:effect
(and (not (holding ?obj1))
(not (clear ?obj2))
(clear ?obj1)
(arm-empty)
(on ?obj1 ?obj2)))
(:action unstack
:parameters (?obj1 ?obj2)
:precondition (and (on ?obj1 ?obj2) (clear ?obj1) (arm-empty))
:effect
(and (holding ?obj1)
(clear ?obj2)
(not (clear ?obj1))
(not (arm-empty))
(not (on ?obj1 ?obj2))))
(:action spray-paint
:parameters (?obj ?sprayer ?color)
:precondition (and (< 1 0)) ; REPLACE (< 1 0) WITH ONE OR MORE CONDITIONS
:effect (color ?obj ?color))
(:action brush-paint
:parameters (?obj ?brush ?color)
:precondition (and (< 1 0)) ; REPLACE (< 1 0) WITH ONE OR MORE CONDITIONS
:effect (color ?obj ?color))
(:action wash-brush
:parameters (?brush ?waterbucket ?color)
:precondition (and (< 1 0)) ; REPLACE (< 1 0) WITH ONE OR MORE CONDITIONS
:effect (and (not (loaded ?brush ?color))
(clean ?brush)))
(:action load-brush
:parameters (?brush ?can ?color)
:precondition (and (< 1 0)) ; REPLACE (< 1 0) WITH ONE OR MORE CONDITIONS
:effect (and (loaded ?brush ?color)
(not (clean ?brush))))
)