1+ ; ---------------------------------------------------------------------------
2+ ; domain.clp -
3+ ; CX planning instance based on https://github.com/potassco/pddl-instances/blob/master/ipc-2002/domains/rovers-strips-automatic/instances/instance-1.pddl
4+ ; ---------------------------------------------------------------------------
5+
6+ (defrule load-domain
7+ (executive-init)
8+ (not (domain-loaded))
9+ =>
10+ (parse-pddl-domain (path-resolve "demo-scenario/domain.pddl"))
11+ (assert (domain-loaded))
12+ )
13+
14+ ; (defrule test-domain-set-sensed-predicates
15+ ; (executive-init)
16+ ; (domain-loaded)
17+ ; ?p <- (domain-predicate (name robot_at) (sensed FALSE))
18+ ; =>
19+ ; (modify ?p (sensed TRUE))
20+ ; )
21+
22+ (defrule load-initial-facts
23+ (executive-init)
24+ (domain-loaded)
25+ =>
26+ (assert (domain-fact (name visible) (param-values waypoint1 waypoint0)))
27+ (assert (domain-fact (name visible) (param-values waypoint0 waypoint1)))
28+ (assert (domain-fact (name visible) (param-values waypoint2 waypoint0)))
29+ (assert (domain-fact (name visible) (param-values waypoint0 waypoint2)))
30+ (assert (domain-fact (name visible) (param-values waypoint2 waypoint1)))
31+ (assert (domain-fact (name visible) (param-values waypoint1 waypoint2)))
32+ (assert (domain-fact (name visible) (param-values waypoint3 waypoint0)))
33+ (assert (domain-fact (name visible) (param-values waypoint0 waypoint3)))
34+ (assert (domain-fact (name visible) (param-values waypoint3 waypoint1)))
35+ (assert (domain-fact (name visible) (param-values waypoint1 waypoint3)))
36+ (assert (domain-fact (name visible) (param-values waypoint3 waypoint2)))
37+ (assert (domain-fact (name visible) (param-values waypoint2 waypoint3)))
38+ (assert (domain-fact (name at_soil_sample) (param-values waypoint0)))
39+ (assert (domain-fact (name at_rock_sample) (param-values waypoint1)))
40+ (assert (domain-fact (name at_soil_sample) (param-values waypoint2)))
41+ (assert (domain-fact (name at_rock_sample) (param-values waypoint2)))
42+ (assert (domain-fact (name at_soil_sample) (param-values waypoint3)))
43+ (assert (domain-fact (name at_rock_sample) (param-values waypoint3)))
44+ (assert (domain-fact (name at_lander) (param-values general waypoint0)))
45+ (assert (domain-fact (name channel_free) (param-values general)))
46+ (assert (domain-fact (name at) (param-values rover0 waypoint3)))
47+ (assert (domain-fact (name available) (param-values rover0)))
48+ (assert (domain-fact (name store_of) (param-values rover0store rover0)))
49+ (assert (domain-fact (name empty) (param-values rover0store)))
50+ (assert (domain-fact (name equipped_for_soil_analysis) (param-values rover0)))
51+ (assert (domain-fact (name equipped_for_rock_analysis) (param-values rover0)))
52+ (assert (domain-fact (name equipped_for_imaging) (param-values rover0)))
53+ (assert (domain-fact (name can_traverse) (param-values rover0 waypoint3 waypoint0)))
54+ (assert (domain-fact (name can_traverse) (param-values rover0 waypoint0 waypoint3)))
55+ (assert (domain-fact (name can_traverse) (param-values rover0 waypoint3 waypoint1)))
56+ (assert (domain-fact (name can_traverse) (param-values rover0 waypoint1 waypoint3)))
57+ (assert (domain-fact (name can_traverse) (param-values rover0 waypoint1 waypoint2)))
58+ (assert (domain-fact (name can_traverse) (param-values rover0 waypoint2 waypoint1)))
59+ (assert (domain-fact (name on_board) (param-values camera0 rover0)))
60+ (assert (domain-fact (name calibration_target) (param-values camera0 objective1)))
61+ (assert (domain-fact (name supports) (param-values camera0 colour)))
62+ (assert (domain-fact (name supports) (param-values camera0 high_res)))
63+ (assert (domain-fact (name visible_from) (param-values objective0 waypoint0)))
64+ (assert (domain-fact (name visible_from) (param-values objective0 waypoint1)))
65+ (assert (domain-fact (name visible_from) (param-values objective0 waypoint2)))
66+ (assert (domain-fact (name visible_from) (param-values objective0 waypoint3)))
67+ (assert (domain-fact (name visible_from) (param-values objective1 waypoint0)))
68+ (assert (domain-fact (name visible_from) (param-values objective1 waypoint1)))
69+ (assert (domain-fact (name visible_from) (param-values objective1 waypoint2)))
70+ (assert (domain-fact (name visible_from) (param-values objective1 waypoint3)))
71+ (assert
72+ (domain-object (name general) (type lander))
73+ (domain-object (name colour) (type mode))
74+ (domain-object (name high_res) (type mode))
75+ (domain-object (name low_res) (type mode))
76+ (domain-object (name rover0) (type rover))
77+ (domain-object (name rover0store) (type store))
78+ (domain-object (name waypoint0) (type waypoint))
79+ (domain-object (name waypoint1) (type waypoint))
80+ (domain-object (name waypoint2) (type waypoint))
81+ (domain-object (name waypoint3) (type waypoint))
82+ (domain-object (name camera0) (type camera))
83+ (domain-object (name objective0) (type objective))
84+ (domain-object (name objective1) (type objective))
85+ )
86+
87+ (assert (domain-facts-loaded))
88+ )
0 commit comments