Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (domain blocksworld)
- (:requirements :strips) ; STRIPS required
- (:predicates (on ?x ?y) ; block ?x is on block ?y
- (ontable ?x) ; block ?x on the table
- (clear ?x) ; no block is on block ?x
- (handempty) ; robot’s arm is empty
- (holding ?x) ; robot’s arm is holding ?x
- )
- (:action pick-up ; action „pick up from the table”
- :parameters (?block)
- :precondition (and (clear ?block) (ontable ?block) (handempty))
- :effect
- (and (not (ontable ?block))
- (not (clear ?block))
- (not (handempty))
- (holding ?block)))
- (:action put-on-table ; action „put on the table”
- :parameters (?block)
- :precondition (holding ?block)
- :effect
- (and (ontable ?block)
- (clear ?block)
- (handempty)
- (not(holding ?block)))
- (:action put-on-block ; action „put block A on block B”
- :parameters (?blockA, ?blockB)
- :precondition (holding ?blockA)
- :effect
- (and (on ?blockA ?blockB)
- (not (clear ?blockB))
- (handempty)
- (not(holding ?blockA)))
- (:action pick-up-from-block ; action „take block A off block B”
- :parameters (?blockA ?blockB)
- :precondition (and (clear ?blockA) (on ?blockA ?blockB) (handempty))
- :effect
- (and (not (on ?blockA ?blockB))
- (not (clear ?blockA))
- (not (handempty))
- (holding ?blockA))
- (clear ?blockB))
- )
- (define (problem easy)
- (:domain blocksworld)
- (:objects a b c)
- (:init (ontable a) (ontable b) (ontable c) (clear a) (clear b) (clear c) (handempty))
- (:goal (and (on b c) (on a b)))
- )
- (define (problem medium)
- (:domain blocksworld)
- (:objects a b c)
- (:init (on a c) (ontable b) (ontable c) (clear a) (clear b) (handempty))
- (:goal (and (on b c) (on a b)))
- )
- (define (problem hard)
- (:domain blocksworld)
- (:objects a b c)
- (:init (on c a) (ontable a) (ontable b) (clear b) (clear b) (handempty))
- (:goal (and (on b c) (on a b)))
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement