Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. (define (domain blocksworld)
  2. (:requirements :strips) ; STRIPS required
  3. (:predicates (on ?x ?y) ; block ?x is on block ?y
  4. (ontable ?x) ; block ?x on the table
  5. (clear ?x) ; no block is on block ?x
  6. (handempty) ; robot’s arm is empty
  7. (holding ?x) ; robot’s arm is holding ?x
  8. )
  9. (:action pick-up ; action „pick up from the table”
  10. :parameters (?block)
  11. :precondition (and (clear ?block) (ontable ?block) (handempty))
  12. :effect
  13. (and (not (ontable ?block))
  14. (not (clear ?block))
  15. (not (handempty))
  16. (holding ?block)))
  17. (:action put-on-table ; action „put on the table”
  18. :parameters (?block)
  19. :precondition (holding ?block)
  20. :effect
  21. (and (ontable ?block)
  22. (clear ?block)
  23. (handempty)
  24. (not(holding ?block)))
  25. (:action put-on-block ; action „put block A on block B”
  26. :parameters (?blockA, ?blockB)
  27. :precondition (holding ?blockA)
  28. :effect
  29. (and (on ?blockA ?blockB)
  30. (not (clear ?blockB))
  31. (handempty)
  32. (not(holding ?blockA)))
  33. (:action pick-up-from-block ; action „take block A off block B”
  34. :parameters (?blockA ?blockB)
  35. :precondition (and (clear ?blockA) (on ?blockA ?blockB) (handempty))
  36. :effect
  37. (and (not (on ?blockA ?blockB))
  38. (not (clear ?blockA))
  39. (not (handempty))
  40. (holding ?blockA))
  41. (clear ?blockB))
  42. )
  43.  
  44. (define (problem easy)
  45. (:domain blocksworld)
  46. (:objects a b c)
  47. (:init (ontable a) (ontable b) (ontable c) (clear a) (clear b) (clear c) (handempty))
  48. (:goal (and (on b c) (on a b)))
  49. )
  50.  
  51. (define (problem medium)
  52. (:domain blocksworld)
  53. (:objects a b c)
  54. (:init (on a c) (ontable b) (ontable c) (clear a) (clear b) (handempty))
  55. (:goal (and (on b c) (on a b)))
  56. )
  57.  
  58. (define (problem hard)
  59. (:domain blocksworld)
  60. (:objects a b c)
  61. (:init (on c a) (ontable a) (ontable b) (clear b) (clear b) (handempty))
  62. (:goal (and (on b c) (on a b)))
  63. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement