Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.45 KB | None | 0 0
  1. (define
  2. (domain world-of-blocks)
  3. (:requirements :adl)
  4. (:predicates
  5. (on-top ?x ?y)
  6. (on-floor ?x)
  7. (clear ?x)
  8. (armempty)
  9. (armholding ?x)
  10. )
  11.  
  12. (:action pickup
  13. :parameters (?x)
  14. :precondition
  15. (and
  16. (clear ?x)
  17. (on-floor ?x)
  18. (armempty)
  19. )
  20. :effect
  21. (and
  22. (armholding ?x )
  23. (not (on-floor?x) )
  24. (not (armempty) )
  25. )
  26. )
  27. (:action putdown
  28. :parameters (?x)
  29. :precondition (armholding ?x)
  30. :effect
  31. (and
  32. (on-floor ?x)
  33. (armempty)
  34. (not (armholding ?x))
  35. )
  36. )
  37. (:action stack
  38. :parameters (?x ?y)
  39. :precondition
  40. (and
  41. (clear ?y)
  42. (armholding ?x)
  43. )
  44. :effect
  45. (and
  46. (on-top ?x ?y)
  47. (clear ?x)
  48. (armempty)
  49. (not(armholding ?x))
  50. (not(clear ?y))
  51. )
  52. )
  53. (:action unstack
  54. :parameters (?x ?y)
  55. :precondition
  56. (and
  57. (on-top ?x ?y)
  58. (clear ?x)
  59. (armempty)
  60. )
  61. :effect
  62. (and
  63. (not(on-top ?x ?y))
  64. (not(armempty))
  65. (armholding ?x)
  66. (clear ?y)
  67. )
  68. )
  69.  
  70. )
  71.  
  72.  
  73.  
  74.  
  75. (define (problem p1)
  76. (:domain world-of-blocks)
  77. (:objects a b c arm)
  78. (:init
  79. (clear b)
  80. (on-floor b)
  81. (on-floor a)
  82. (on-top c a)
  83. (clear c)
  84. (armempty)
  85. )
  86. (:goal
  87. (and
  88. (clear a)
  89. (on-top a b)
  90. (on-top b c)
  91. (on-floor c)
  92. (armempty)
  93. )
  94. )
  95. )
  96.  
  97.  
  98.  
  99.  
  100.  
  101. (define
  102. (domain sokoban)
  103. (:requirements :adl)
  104. (:predicates
  105. (poziomo ?x ?y)
  106. (pionowo ?x ?y)
  107. (paczka ?x)
  108. (robot ?x)
  109. (cel ?x)
  110. )
  111. (:action idz
  112. :parameters (?x ?y)
  113. :precondition
  114. (and
  115. (robot ?x)
  116. (not(paczka ?y))
  117. (or
  118. (poziomo ?x ?y)
  119. (pionowo ?x ?y)
  120. )
  121. )
  122. :effect
  123. (and
  124. (not(robot ?x))
  125. (robot ?y)
  126. )
  127. )
  128. (:action pchaj
  129. :parameters (?x ?y ?z)
  130. :precondition
  131. (and
  132. (not(= ?x ?z))
  133. (robot ?x)
  134. (paczka ?y)
  135. (not(paczka ?z))
  136. (or
  137. (and (poziomo ?x ?y) (poziomo ?y ?z))
  138. (and (pionowo ?x ?y) (pionowo ?y ?z))
  139. )
  140. )
  141. :effect
  142. (and
  143. (not(robot ?x))
  144. (robot ?y)
  145. (not(paczka ?y))
  146. (paczka ?z)
  147. )
  148. )
  149. )
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156. (define
  157. (domain hanoi)
  158. (:requirements :adl)
  159. (:predicates
  160. (on-top ?x ?y)
  161. (on-tower ?k ?x)
  162. (clear ?x)
  163. (smaller ?x ?y)
  164. )
  165. (:action przesun-na-pusty
  166. :parameters (?x ?y ?ktop ?kpod)
  167. :precondition
  168. (and
  169. (clear ?ktop)
  170. (on-tower ?ktop ?x)
  171. (on-top ?ktop ?kpod)
  172. (clear ?y)
  173. )
  174. :effect
  175. (and
  176. (not(on-tower ?ktop ?x))
  177. (on-tower ?ktop ?y)
  178. (not(on-top ?ktop ?kpod))
  179. (on-top ?ktop ?y)
  180. (clear ?kpod)
  181. (not(clear ?y))
  182. )
  183. )
  184. (:action przesun
  185. :parameters (?x ?y ?ktop ?kpod ?ky)
  186. :precondition
  187. (and
  188. (clear ?ktop)
  189. (smaller ?ktop ?ky)
  190. (on-tower ?ktop ?x)
  191. (on-top ?ktop ?kpod)
  192. (on-tower ?ky ?y)
  193. (clear ?ky)
  194. )
  195. :effect
  196. (and
  197. (not(on-tower ?ktop ?x))
  198. (on-tower ?ktop ?y)
  199. (not(on-top ?ktop ?kpod))
  200. (clear ?kpod)
  201. (on-top ?ktop ?ky)
  202. (not(clear ?ky))
  203. )
  204. )
  205. )
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212. (define (problem hanoi1)
  213. (:domain hanoi)
  214. (:objects x y z k1 k2 k3 k4 k5 )
  215. (:init
  216. (clear y)
  217. (clear z)
  218. (clear k1)
  219. (on-top k1 k2)
  220. (on-top k2 k3)
  221. (on-top k3 k4)
  222. (on-top k4 k5)
  223. (on-top k5 x)
  224. (on-tower k1 x)
  225. (on-tower k2 x)
  226. (on-tower k3 x)
  227. (on-tower k4 x)
  228. (on-tower k5 x)
  229. (smaller k1 k2)
  230. (smaller k2 k3)
  231. (smaller k3 k4)
  232. (smaller k4 k5)
  233.  
  234. )
  235. (:goal (and
  236. (clear y)
  237. (clear x)
  238. (clear k1)
  239. (on-top k1 k2)
  240. (on-top k2 k3)
  241. (on-top k3 k4)
  242. (on-top k4 k5)
  243. (on-top k5 x)
  244. (on-tower k1 z)
  245. (on-tower k2 z)
  246. (on-tower k3 z)
  247. (on-tower k4 z)
  248. (on-tower k5 z)
  249. ))
  250. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement