Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; Domain definition
- (define (domain weed-domain)
- ;; Predicates: Properties of objects that we are interested in (boolean)
- (:predicates
- (STONER ?x) ; True if x is a stoner
- (WEED ?x) ; True if x is weed
- (JOINT ?x) ; True if x is a rolled joint
- (CAN-SMOKE ?x) ; True if x is a joint that can be used for smoking
- (CAN-ROLL ?x) ; True if x is weed that can be used for rolling
- (stoner-is-high ?x) ; True if stoner x is high as fuck
- (well-smoked-joint ?x) ; True if x is a joint and is fucking high as shit
- )
- ;; Actions: Ways of changing the state of the world
- ; Chef x can grab a tool y if they do not hold any tool yet and if the tool is free
- ; As a result they hold the tool, and the tool is not free any more
- ; Parameters:
- ; - x: the chef
- ; - y: the tool
- (:action roll-weed :parameters (?x ?y)
- :precondition (and (STONER ?x) (WEED ?y) (CAN-ROLL ?y))
- :effect (and (JOINT ?y) (not (WEED ?y)))
- )
- ; Chef x can drop a tool y if they hold the tool
- ; As a result the chef stops holding the tool, and the tool becomes free
- ; Parameters:
- ; - x: the chef
- ; - y: the tool
- (:action smoke-joint :parameters (?x ?y)
- :precondition (and (STONER ?x) (JOINT ?y) (CAN-SMOKE ?y))
- :effect (and (stoner-is-high ?x) (not (CAN-SMOKE ?y)) (well-smoked-joint ?y))
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement