Advertisement
Guest User

climbon

a guest
May 18th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. (def world
  4.   '#{(connects G1 G2)
  5.      (connects G2 G1)
  6.      (connects G2 G3)
  7.      (on table1 G1)
  8.      (climbable table)
  9.      (platform table)
  10.      (agent R)
  11.      })
  12.  
  13.  
  14. (def state1
  15.   '#{(at R G1)
  16.      ;(holds R nil)
  17.      })
  18.  
  19. (def ops
  20.   '{pickup {:pre ((agent ?agent)
  21.                    (manipulable ?obj)
  22.                    (at ?agent ?place)
  23.                    (on ?obj ?place)
  24.                    (holds ?agent nil))
  25.  
  26.             :add ((holds ?agent ?obj))
  27.             :del ((on ?obj ?place)
  28.                    (holds ?agent nil))
  29.             :txt (pickup ?obj from ?place)
  30.             :cmd [grasp ?obj]
  31.             }
  32.     drop {:pre ((at ?agent ?place)
  33.                  (holds ?agent ?obj)
  34.                  (holds ?agent ?platform))
  35.  
  36.           :add ((holds ?agent nil)
  37.                  (on ?obj ?place))
  38.           :del ((holds ?agent ?obj)
  39.                  (holds ?agent ?platform))
  40.           :txt (drop ?obj at ?place)
  41.           :cmd [drop ?obj]
  42.           }
  43.     move {:pre ((agent ?agent)
  44.                  (at ?agent ?p1)
  45.                  (connects ?p1 ?p2))
  46.           :add ((at ?agent ?p2))
  47.           :del ((at ?agent ?p1))
  48.           :txt (move ?p1 to ?p2)
  49.           :cmd [move ?p2]
  50.           }
  51.  
  52.     climbon {:pre ((agent ?agent)
  53.                      (at ?agent ?place)
  54.                      (on ?platform ?place)
  55.                      (climbable ?climbable)
  56.                      (platform ?platform))
  57.                      ;(holds ?agent nil))
  58.                      :del ((at ?agent ?place))
  59.                      :add ((on ?agent ?platform))
  60.                      :txt (climbon ?agent ?platform)
  61.                      :cmd [on ?agent ?platform]
  62.               }
  63.  
  64.     ;climboff (:pre ((agent ?agent)
  65.     ;                 (on ?agent ?obj)
  66.     ;                 :del ((on ?agent ?obj))
  67.     ;                 :add ((at agent ?p2))
  68.     ;                 :txt (climb off ?agent ?p2)
  69.     ;                 :cmd [on ?agent ?p2])
  70.     ;           )
  71.  
  72.     })
  73.  
  74. (ops-search state1 '((on R table)) ops :world world)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement